@simai-studio/ui 5.20261021.2249 → 5.20261022.1303
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/component/dropdown/js/dropdown.min.js +1 -1
- package/distr/core/contracts/packages/larena.package.json +1 -0
- package/distr/core/js/core-loader.js +133 -7
- package/distr/core/js/core-loader.min.js +1 -1
- package/distr/core/js/smart-base.js +134 -12
- package/distr/core/js/smart-base.min.js +1 -1
- package/distr/smart/buttons/js/buttons.min.js +1 -1
- package/distr/smart/buttons/smart.manifest.json +1 -1
- package/distr/smart/country-code/js/country-code.min.js +9 -7
- package/distr/smart/country-code/smart.manifest.json +6 -1
- package/distr/smart/country-code/template/default.js +12 -4
- package/distr/smart/datepicker/js/datepicker.min.js +12 -9
- package/distr/smart/datepicker/smart.manifest.json +13 -3
- package/distr/smart/datepicker/template/default.js +4 -1
- package/distr/smart/dropdown/js/dropdown.min.js +10 -10
- package/distr/smart/dropdown/smart.manifest.json +1 -1
- package/distr/smart/dropdown/template/default.js +10 -3
- package/distr/smart/field-renderers/js/field-renderers.min.js +17 -17
- package/distr/smart/icon-buttons/js/icon-buttons.min.js +1 -1
- package/distr/smart/icon-buttons/smart.manifest.json +1 -1
- package/distr/smart/icons/js/icons.min.js +1 -1
- package/distr/smart/icons/smart.manifest.json +1 -1
- package/distr/smart/inputs/js/inputs.min.js +33 -31
- package/distr/smart/inputs/smart.manifest.json +6 -1
- package/distr/smart/inputs/template/default.js +8 -0
- package/distr/smart/popover/js/popover.min.js +1 -1
- package/distr/smart/popover/smart.manifest.json +1 -1
- package/distr/smart/switch/js/switch.min.js +12 -11
- package/distr/smart/switch/smart.manifest.json +6 -1
- package/distr/smart/switch/template/default.js +2 -1
- package/package-manifest.json +33 -33
- package/package.json +4 -4
|
@@ -144,10 +144,10 @@
|
|
|
144
144
|
@click=${()=>t.loadEndpointFilterPage(e,r.nextCursor,i)}></sf-button>`:""}
|
|
145
145
|
`:""}
|
|
146
146
|
</div>
|
|
147
|
-
`}function g(e,t){return f(e,t)}function m(e,t){const r=e.filter?.options??["image","document","archive","other"].map(e=>({value:e,label:he(t,`fileKind_${e}`)}));return f({...e,filter:{...e.filter||{},options:r,defaultOperator:e.filter?.defaultOperator??"in"}},t)}function h(e,t){const r=e.filter?.options??(Array.isArray(e.swatches)?e.swatches:[]).map(e=>"string"==typeof e?{value:e,label:e}:e).filter(e=>e?.value).map(e=>({value:e.value,label:e.label??e.value,color:e.value}));return r.length?f({...e,filter:{...e.filter||{},options:r,optionRenderer:e.filter?.optionRenderer??"swatch",defaultOperator:e.filter?.defaultOperator??"in"}},t):u(e,t)}const $={text:u,string:u,number:d,integer:d,date:p,datetime:p,range:c,"date-range":p,"multi-select":f,"single-select":f,choice:f,choices:f,boolean:f,user:f,"entity-multi-select":g,"entity-single-select":g,record:g,relation:g,file:m,color:h};function y(e={},t){const r=e.filter?.control||e.propertyType||e.type||e.dataType||"text";return($[r]||$.text)(e,t)}const b="1/2",v="tonal",S=[[/^image\//u,"image"],[/^video\//u,"movie"],[/^audio\//u,"audiotrack"],[/^text\/(csv|tab-separated-values)$/u,"table"],[/^text\//u,"description"],[/pdf$/u,"picture_as_pdf"],[/(zip|compressed|tar|rar|7z)/u,"folder_zip"],[/(sheet|excel|spreadsheet)/u,"table"],[/(word|document)$/u,"description"],[/(presentation|powerpoint)/u,"slideshow"]];function w(e){const t=String(e||"").toLowerCase(),r=S.find(([e])=>e.test(t));return r?r[1]:"attach_file"}function x(e,t){const r=
|
|
147
|
+
`}function g(e,t){return f(e,t)}function m(e,t){const r=e.filter?.options??["image","document","archive","other"].map(e=>({value:e,label:he(t,`fileKind_${e}`)}));return f({...e,filter:{...e.filter||{},options:r,defaultOperator:e.filter?.defaultOperator??"in"}},t)}function h(e,t){const r=e.filter?.options??(Array.isArray(e.swatches)?e.swatches:[]).map(e=>"string"==typeof e?{value:e,label:e}:e).filter(e=>e?.value).map(e=>({value:e.value,label:e.label??e.value,color:e.value}));return r.length?f({...e,filter:{...e.filter||{},options:r,optionRenderer:e.filter?.optionRenderer??"swatch",defaultOperator:e.filter?.defaultOperator??"in"}},t):u(e,t)}const $={text:u,string:u,number:d,integer:d,date:p,datetime:p,range:c,"date-range":p,"multi-select":f,"single-select":f,choice:f,choices:f,boolean:f,user:f,"entity-multi-select":g,"entity-single-select":g,record:g,relation:g,file:m,color:h};function y(e={},t){const r=e.filter?.control||e.propertyType||e.type||e.dataType||"text";return($[r]||$.text)(e,t)}const b="1/2",v="tonal",S=[[/^image\//u,"image"],[/^video\//u,"movie"],[/^audio\//u,"audiotrack"],[/^text\/(csv|tab-separated-values)$/u,"table"],[/^text\//u,"description"],[/pdf$/u,"picture_as_pdf"],[/(zip|compressed|tar|rar|7z)/u,"folder_zip"],[/(sheet|excel|spreadsheet)/u,"table"],[/(word|document)$/u,"description"],[/(presentation|powerpoint)/u,"slideshow"]];function w(e){const t=String(e||"").toLowerCase(),r=S.find(([e])=>e.test(t));return r?r[1]:"attach_file"}function x(e,t){const r=ke(t);return r?a.html`
|
|
148
148
|
<sf-color size="1/2" appearance="plain" value=${String(r)}
|
|
149
149
|
label=${e.label||e.key||""} disabled></sf-color>
|
|
150
|
-
`:a.nothing}function
|
|
150
|
+
`:a.nothing}function k(e,t){const r=ke(t),n=e.inheritedValue??"";return r||n?a.html`
|
|
151
151
|
<sf-color
|
|
152
152
|
size="1"
|
|
153
153
|
appearance="plain"
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
label=${e.label||e.key||""}
|
|
157
157
|
disabled
|
|
158
158
|
></sf-color>
|
|
159
|
-
`:a.nothing}function
|
|
159
|
+
`:a.nothing}function F(e,t,r){const n=ke(t),l=e.inheritedValue??"";return a.html`
|
|
160
160
|
<sf-color
|
|
161
161
|
size=${M}
|
|
162
162
|
appearance="bordered"
|
|
@@ -169,12 +169,12 @@
|
|
|
169
169
|
label=${e.label||e.key||""}
|
|
170
170
|
@change=${t=>r.setFieldValue(e,t.detail?.value??"")}
|
|
171
171
|
></sf-color>
|
|
172
|
-
`}function T(e,t){return t&&"object"==typeof t&&t.label?W(e)?A(t):{component:{type:"reference-link",props:{line:b,label:String(t.label),icon:w(t.mime),...t.href?{href:String(t.href)}:{}}}}:null}function A(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:w(t),...e.href?{href:String(e.href)}:{},...r?{imageUrl:String(e.href),kind:"image"}:{kind:"icon"},actions:!1,downloadAction:!1,removeAction:!1}}}}function z(e,t){if(!Array.isArray(t)||!t.length)return null;if("badges"===String(e.variant??""))return _(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 _(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??v,...i?.scheme?{scheme:i.scheme}:{},...i?.rootStyle?{rootStyle:i.rootStyle}:{}}}}})}const O={string:Z,date:E,datetime:E,boolean:V,choices:z,file:T,color:x,include:te,choice:j,integer:P,number:P,user:B,record:C,relation:C};function q(e,t){return{yes:e.trueText??e.labels?.true??he(t,"yes"),no:e.falseText??e.labels?.false??he(t,"no")}}function V(e,t,r){if("boolean"!=typeof t)return null;const a=q(e,r);return t?a.yes:a.no}function j(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??v,...l?.scheme?{scheme:l.scheme}:{},...l?.rootStyle?{rootStyle:l.rootStyle}:{}}}}}function E(e,t,r){const a=r?.formatFieldValue?.(e,t);return"string"==typeof a&&""!==a?a:null}function P(e,t,r){const a=e.variant||e.filter?.variant,n=Number(
|
|
172
|
+
`}function T(e,t){return t&&"object"==typeof t&&t.label?W(e)?A(t):{component:{type:"reference-link",props:{line:b,label:String(t.label),icon:w(t.mime),...t.href?{href:String(t.href)}:{}}}}:null}function A(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:w(t),...e.href?{href:String(e.href)}:{},...r?{imageUrl:String(e.href),kind:"image"}:{kind:"icon"},actions:!1,downloadAction:!1,removeAction:!1}}}}function z(e,t){if(!Array.isArray(t)||!t.length)return null;if("badges"===String(e.variant??""))return _(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 _(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??v,...i?.scheme?{scheme:i.scheme}:{},...i?.rootStyle?{rootStyle:i.rootStyle}:{}}}}})}const O={string:Z,date:E,datetime:E,boolean:V,choices:z,file:T,color:x,include:te,choice:j,integer:P,number:P,user:B,record:C,relation:C};function q(e,t){return{yes:e.trueText??e.labels?.true??he(t,"yes"),no:e.falseText??e.labels?.false??he(t,"no")}}function V(e,t,r){if("boolean"!=typeof t)return null;const a=q(e,r);return t?a.yes:a.no}function j(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??v,...l?.scheme?{scheme:l.scheme}:{},...l?.rootStyle?{rootStyle:l.rootStyle}:{}}}}}function E(e,t,r){const a=r?.formatFieldValue?.(e,t);return"string"==typeof a&&""!==a?a:null}function P(e,t,r){const a=e.variant||e.filter?.variant,n=Number(ke(t));return"scale"===a&&Number.isFinite(n)?n<0||n>100?null:{component:{type:"progress-scale",props:{line:b,value:String(n)}}}:E(e,t,r)}function R(e){return{component:{type:"reference-link",props:{line:b,appearance:"plain",icon:"",label:String(e.label),...e.href?{href:String(e.href)}:{}}}}}function B(e,t){return t&&"object"==typeof t&&t.label?[{component:{type:"avatar",props:{line:b,text:t.avatarText||""}}},t.href?R(t):String(t.label)]:null}function C(e,t){return t&&"object"==typeof t&&t.label?R(t):null}function L(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 M="1";const N={record:$e,relation:$e,user:$e,string:re,text:ae,integer:ne,number:ne,date:oe,datetime:oe,boolean:se,choice:ce,choices:fe,file:be,color:F,include:ee};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=${M}
|
|
175
175
|
name=${K(e)}
|
|
176
|
-
value=${
|
|
177
|
-
label=${e.label||e.key||""}
|
|
176
|
+
value=${ke(t)??""}
|
|
177
|
+
aria-label=${e.label||e.key||""}
|
|
178
178
|
?required=${Boolean(e.required)}
|
|
179
179
|
?disabled=${!0===e.readonly}
|
|
180
180
|
use-mask="true"
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
@click=${Y}
|
|
207
207
|
></sf-icon-button>
|
|
208
208
|
</span>
|
|
209
|
-
`}function Z(e,t,r){return I(e)?H(r,t):null}function G(e,t,r){return I(e)?a.html`<span class="sf-field-view">${H(r,t)}</span>`:Te(e,t,r)}const Q=new Set(["image","image-card","image-list"]);function W(e){return Q.has(String(e.variant??""))}function X(e,t){const r=
|
|
209
|
+
`}function Z(e,t,r){return I(e)?H(r,t):null}function G(e,t,r){return I(e)?a.html`<span class="sf-field-view">${H(r,t)}</span>`:Te(e,t,r)}const Q=new Set(["image","image-card","image-list"]);function W(e){return Q.has(String(e.variant??""))}function X(e,t){const r=ke(t);return r?a.html`
|
|
210
210
|
<pre class="sf-field-include" data-language=${e.language?String(e.language):a.nothing}><code>${String(r)}</code></pre>
|
|
211
211
|
`:a.nothing}function ee(e,t,r){return a.html`
|
|
212
212
|
<sf-textarea
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
appearance="bordered"
|
|
215
215
|
class="sf-field-include-edit"
|
|
216
216
|
name=${K(e)}
|
|
217
|
-
value=${
|
|
217
|
+
value=${ke(t)??""}
|
|
218
218
|
rows="8"
|
|
219
219
|
spellcheck="false"
|
|
220
220
|
?required=${Boolean(e.required)}
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
@change=${t=>r.setFieldValue(e,t.target?.value??"")}
|
|
224
224
|
@input=${t=>r.setFieldValue(e,t.target?.value??"")}
|
|
225
225
|
></sf-textarea>
|
|
226
|
-
`}function te(e,t){const r=
|
|
226
|
+
`}function te(e,t){const r=ke(t);if(!r)return a.nothing;const n=String(r).split("\n")[0];return a.html`<code>${n.length>60?`${n.slice(0,60)}…`:n}</code>`}function re(e,t,r){return"phone"===String(e.variant??"")?U(e,t,r):I(e)?J(e,t,r):(t=ke(t),a.html`
|
|
227
227
|
<sf-input
|
|
228
228
|
size=${M}
|
|
229
229
|
appearance="bordered"
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
@input=${t=>r.setFieldValue(e,t.target?.value??"")}
|
|
236
236
|
@change=${t=>r.setFieldValue(e,t.target?.value??"")}
|
|
237
237
|
></sf-input>
|
|
238
|
-
`)}function ae(e,t,r){return t=
|
|
238
|
+
`)}function ae(e,t,r){return t=ke(t),a.html`
|
|
239
239
|
<sf-textarea
|
|
240
240
|
size=${M}
|
|
241
241
|
appearance="bordered"
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
@input=${t=>r.setFieldValue(e,t.target?.value??"")}
|
|
248
248
|
@change=${t=>r.setFieldValue(e,t.target?.value??"")}
|
|
249
249
|
></sf-textarea>
|
|
250
|
-
`}function ne(e,t,r){const n="number"===(e.propertyType||e.type);return t=
|
|
250
|
+
`}function ne(e,t,r){const n="number"===(e.propertyType||e.type);return t=ke(t),a.html`
|
|
251
251
|
<sf-input
|
|
252
252
|
size=${M}
|
|
253
253
|
appearance="bordered"
|
|
@@ -259,12 +259,12 @@
|
|
|
259
259
|
@input=${t=>{const a=t.target?.value??"";r.setFieldValue(e,""===a?null:Number(a))}}
|
|
260
260
|
@change=${t=>{const a=t.target?.value??"";r.setFieldValue(e,""===a?null:Number(a))}}
|
|
261
261
|
></sf-input>
|
|
262
|
-
`}const le=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?)(Z|[+-]\d{2}:?\d{2})?$/;function ie(e){const t="string"==typeof e?e.trim().match(le):null;return t?{date:t[1],suffix:`T${t[2]}${t[3]||""}`}:{date:e,suffix:""}}function oe(e,t,r){t=
|
|
262
|
+
`}const le=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?)(Z|[+-]\d{2}:?\d{2})?$/;function ie(e){const t="string"==typeof e?e.trim().match(le):null;return t?{date:t[1],suffix:`T${t[2]}${t[3]||""}`}:{date:e,suffix:""}}function oe(e,t,r){t=ke(t);const{date:n,suffix:l}=ie(t);return a.html`
|
|
263
263
|
<sf-datepicker
|
|
264
264
|
size=${M}
|
|
265
265
|
name=${K(e)}
|
|
266
266
|
value=${n??""}
|
|
267
|
-
label=${e.label||""}
|
|
267
|
+
aria-label=${e.label||e.key||""}
|
|
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>
|
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
size=${M}
|
|
274
274
|
name=${K(e)}
|
|
275
275
|
?checked=${!0===t}
|
|
276
|
-
label=${e.label||""}
|
|
276
|
+
aria-label=${e.label||e.key||""}
|
|
277
277
|
@change=${t=>r.setFieldValue(e,Boolean(t.target?.checked))}
|
|
278
278
|
></sf-switch>
|
|
279
279
|
`;const n=q(e,r),l=JSON.stringify([{value:"yes",label:n.yes},{value:"no",label:n.no}]);return a.html`
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
aria-label=${e.label||e.key||""}
|
|
285
285
|
@change=${t=>{const a=t.detail?.value;r.setFieldValue(e,"yes"===a||"no"!==a&&null)}}
|
|
286
286
|
></sf-button-group>
|
|
287
|
-
`}function ue(e,t,r){const a=e.options||e.filter?.options||e.constraints?.options||[],n=r?new Set((Array.isArray(t)?t:[]).map(e=>String(e))):new Set([String(t??"")]);return a.map(e=>({type:"text",size:"1",text:e.label??e.text??String(e.value),value:String(e.value),selected:n.has(String(e.value))}))}function ce(e,t,r){return t=
|
|
287
|
+
`}function ue(e,t,r){const a=e.options||e.filter?.options||e.constraints?.options||[],n=r?new Set((Array.isArray(t)?t:[]).map(e=>String(e))):new Set([String(t??"")]);return a.map(e=>({type:"text",size:"1",text:e.label??e.text??String(e.value),value:String(e.value),selected:n.has(String(e.value))}))}function ce(e,t,r){return t=ke(t),a.html`
|
|
288
288
|
<sf-dropdown
|
|
289
289
|
size=${M}
|
|
290
290
|
appearance="outlined"
|
|
@@ -389,7 +389,7 @@
|
|
|
389
389
|
></sf-file-upload>
|
|
390
390
|
`:a.nothing}
|
|
391
391
|
</div>
|
|
392
|
-
`}const ve=e=>"1/2"===e?.size?"1/2":"1";function Se(e={},t,r,a={}){const n=e.propertyType||e.type||e.dataType;if(!0===e.readonly&&Pe[n])return Re(e,t,r,a);const l=N[n];if(!l||!r?.setFieldValue)return null;const i=M;M=ve(a);try{return l(e,t,r)}finally{M=i}}let we="1";function xe(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)&&"string"==typeof e.text}function
|
|
392
|
+
`}const ve=e=>"1/2"===e?.size?"1/2":"1";function Se(e={},t,r,a={}){const n=e.propertyType||e.type||e.dataType;if(!0===e.readonly&&Pe[n])return Re(e,t,r,a);const l=N[n];if(!l||!r?.setFieldValue)return null;const i=M;M=ve(a);try{return l(e,t,r)}finally{M=i}}let we="1";function xe(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)&&"string"==typeof e.text}function ke(e){return xe(e)?e.value:e}function Fe(e,t,r){const a=r?.formatFieldValue?.(e,t);if("string"==typeof a)return a;if(xe(t))return t.text;const n=ke(t);return null==n?"":String(n)}function Te(e,t,r){const n=Fe(e,t,r);return n?a.html`<span class="sf-field-view">${n}</span>`:a.nothing}function Ae(e,t,r){if(null==t||""===t)return a.nothing;const n=e.variant||e.filter?.variant,l=Number(ke(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=Fe(e,t,r);return a.html`<span class="sf-field-view">${e.unit?`${i} ${e.unit}`:i}</span>`}function ze(e,t,r){const n=Fe(e,t,r);return n?a.html`<span class="sf-field-view">${n}</span>`:a.nothing}function _e(e,t,r){if("boolean"!=typeof t)return a.nothing;const n=q(e,r);return a.html`<span class="sf-field-view">${t?n.yes:n.no}</span>`}function Oe(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`
|
|
393
393
|
<sf-badge
|
|
394
394
|
line=${we}
|
|
395
395
|
appearance=${e.badgeAppearance??v}
|
|
@@ -431,4 +431,4 @@
|
|
|
431
431
|
></sf-file-preview>
|
|
432
432
|
`)}
|
|
433
433
|
</span>
|
|
434
|
-
`}const Pe={string:G,text:Te,integer:Ae,number:Ae,date:ze,datetime:ze,boolean:_e,choice:Oe,choices:qe,user:Ve,record:je,relation:je,file:Ee,color:
|
|
434
|
+
`}const Pe={string:G,text:Te,integer:Ae,number:Ae,date:ze,datetime:ze,boolean:_e,choice:Oe,choices:qe,user:Ve,record:je,relation:je,file:Ee,color:k,include:X};function Re(e={},t,r,a={}){const n=e.propertyType||e.type||e.dataType,l=Pe[n];if(!l)return null;const i=we;we=ve(a);try{return l(e,t,r)}finally{we=i}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.fieldRenderers={...window.SF.fieldRenderers||{},renderCellField:L,renderEditField:Se,renderFilterField:y,renderViewField:Re,FILTER_RENDERERS:$,registry:i.u.map(e=>{return{...e,modes:(t=e.type,(0,i.U)(t,{view:Pe,edit:N,cell:O,filter:$}))};var t})},globalThis.document?.dispatchEvent?.(new CustomEvent("sf-field-renderers-ready"))),t()}catch(Be){t(Be)}})},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 c,d,p;const f=new Promise((e,t)=>{p=t,d=e});f[a]=u,f[t]=e=>(o&&e(o),s.forEach(e),f.catch(e=>{})),e.exports=f;r(e=>{let r;c=(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=()=>c.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)));c.map(e=>e[t](a))});return r.r?u:i()},e=>(e?p(f[n]=e):d(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")})();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
class="sf-badge sf-badge--anchored${t.dot?" sf-badge--dot":""}"
|
|
3
3
|
aria-hidden="true"
|
|
4
4
|
title=${t.phrase||s.nothing}
|
|
5
|
-
>${t.text}</span>`:s.nothing}function d(t,e=!0){return t?.visible&&t.phrase?s.html`<span class="sf-badge-anchored-text">${e?", ":""}${t.phrase}</span>`:s.nothing}n.d(e,["Tw",0,o]),a()}catch(c){a(c)}})},"2557e7cf84cc"(t,e,n){n.a(t,async(t,e)=>{try{var a=n("fbe0570fcc69"),s=n("7a7da66f4cf1"),r=n("2feae72af89f"),i=n("34addf781b5b"),o=t([a,s,r,i]);[a,s,r,i]=o.then?(await o)():o;var l=n.n(a);const u=new Set(["template","kind","variant","size","appearance","type","scheme","status","icon","filled","spacing","tightness","radius","segment","root-class","loading","disabled","native-type","aria-label",...i.Tw,"class","style","id","slot"]);function d(t,e){t?.forwardHostAttributes(e,{exclude:u,transferDataAttributes:!0,storageKey:"__sfIconButtonForwardedDataAttributes",targetStorageKey:"__sfIconButtonAttributeKeys"})}const c=["default","tonal","outline","link","surface","ghost"];class h extends(l()){constructor(){super(),this._attributeObserver=null}static get props(){return{templateName:{attribute:"template",default:"default"},kind:{default:"icon",values:["icon","close"],aliases:["variant"]},size:{default:"1"},appearance:{default:"default",aliases:["type"]},scheme:{default:"primary"},status:{default:"",values:["","error"]},segment:{default:""},icon:{default:"add"},filled:{type:Boolean,default:!1},spacing:{type:String,default:null},tightness:{default:"",values:["","low","high","highest"]},radius:{default:"",values:["","default","square","rounded"]},rootClass:{default:""},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},nativeType:{default:"button"},ariaLabel:{default:""},badgeCount:{default:""},badgeDot:{type:Boolean,default:!1},badgeCap:{type:Number,default:99},badgeLabel:{default:""}}}get templateName(){return this.getAttribute("template")||"default"}get size(){return this.getAttribute("size")||"1"}get kind(){return this.getProp("kind")}get variant(){return this.kind}get appearance(){const t=this.getAttribute("appearance")||this.getAttribute("type")||"default";return c.includes(t)?t:"default"}get type(){return this.appearance}get scheme(){return this.getAttribute("scheme")||"primary"}get status(){return this.getAttribute("status")||""}get icon(){return this.getAttribute("icon")||"add"}get segment(){return this.getEnumAttr("segment",["start","middle","end"],"")}get filled(){return this.getBooleanAttr("filled",!1)}get tightness(){return(0,r.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}).tightness}get spacing(){return(0,r.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}).spacing}get radius(){return this.getEnumAttr("radius",["default","square","rounded"],"")}get rootClass(){return this.getAttribute("root-class")||""}get loading(){return this.getBooleanAttr("loading",!1)}get disabled(){return this.getBooleanAttr("disabled",!1)}get nativeType(){return this.getAttribute("native-type")||"button"}get ariaLabel(){return this.getAttribute("aria-label")||""}templateContext(){const t=this.getPropsContext();return this.createTemplateContext({...t,type:this.type,variant:this.variant,...(0,r.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}),badge:this.badgeState?.(),component:this})}badgeState(){return(0,i.Wd)(this)}template(){return(0,s.y)(this.templateContext())}resolveUpdateMode(t=[]){const e=["disabled","aria-label","icon"];return t.length>0&&t.every(t=>e.includes(t))?"dom":"lit"}updateDom(t=[]){const e=this.querySelector(".sf-icon-button");if(!e)return!1;if(t.includes("disabled")&&(e.disabled=this.disabled||this.loading),t.includes("aria-label")&&(this.ariaLabel?e.setAttribute("aria-label",(0,i.VI)(this.ariaLabel,(0,i.Wd)(this).phrase)):e.removeAttribute("aria-label")),t.includes("icon")){const t=e.querySelector(".sf-icon");t&&(t.textContent=this.icon)}return d(this,e),!0}afterRender(){d(this,this.querySelector(".sf-icon-button")),this._attributeObserver||(this._attributeObserver=this.observeForwardedHostAttributes(()=>this.querySelector(".sf-icon-button"),{exclude:u,transferDataAttributes:!0,storageKey:"__sfIconButtonForwardedDataAttributes",targetStorageKey:"__sfIconButtonAttributeKeys"})._forwardHostAttributeObserver)}get value(){return{template:this.templateName,size:this.size,variant:this.variant,appearance:this.appearance,type:this.type,scheme:this.scheme,status:this.status,icon:this.icon,segment:this.segment,filled:this.filled,tightness:this.tightness,spacing:this.spacing,radius:this.radius,rootClass:this.rootClass,loading:this.loading,disabled:this.disabled,nativeType:this.nativeType,ariaLabel:this.ariaLabel,badgeCount:this.getProp("badgeCount"),badgeDot:this.getProp("badgeDot"),badgeCap:this.getProp("badgeCap"),badgeLabel:this.getProp("badgeLabel")}}setButtonAttributes(t={}){return this.setState({buttonAttributes:t}),this}onClick(t,e){return"function"==typeof t&&this.addEventListener("click",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}onMouseEnter(t,e){return"function"==typeof t&&this.addEventListener("mouseenter",t,e),this}onMouseLeave(t,e){return"function"==typeof t&&this.addEventListener("mouseleave",t,e),this}setDisabled(t=!0){return t?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this}set value(t){this.setValueAttributes(t)}onDisconnected(){this.disconnectForwardedHostAttributes(),this._attributeObserver=null,super.onDisconnected?.()}}h.define("sf-icon-button"),e()}catch(g){e(g)}})},"7a7da66f4cf1"(t,e,n){n.a(t,async(t,a)=>{try{n.d(e,{y:()=>u});var s=n("ddf1cdb42ecc"),r=n("50d2a204ba4c"),i=n("34addf781b5b"),o=t([s,i]);[s,i]=o.then?(await o)():o;const l=new Set(["1/3","1/2","1","2","3"]);function u(t){const{size:e,appearance:n,type:a,scheme:o,status:u,icon:d,segment:c,tightness:h,kind:g,variant:b,radius:f,filled:p,rootClass:m,loading:y,disabled:v,nativeType:S,ariaLabel:w,badge:A}=t,x=["sf-icon-button",l.has(e||"1")?`sf-icon-button--size-${e||"1"}`:"",`sf-icon-button--${g??b??"icon"}`,`sf-icon-button--${n||a||"default"}`,"flex","items-cross-center",c?`segment-${c}`:"",`sf-icon-button--${u||o||"primary"}`,h?`tightness-${h}`:"",f?`radius-${f}`:"",m,y?"loading sf-icon-button-state-loading":""].filter(Boolean),$=y?(0,r.le)({className:"sf-icon-button-spinner"}):t.component?.hasSlotContent?.("icon")?t.component.getSlotContent("icon"):"close"===(g??b)?s.html`
|
|
5
|
+
>${t.text}</span>`:s.nothing}function d(t,e=!0){return t?.visible&&t.phrase?s.html`<span class="sf-badge-anchored-text">${e?", ":""}${t.phrase}</span>`:s.nothing}n.d(e,["Tw",0,o]),a()}catch(c){a(c)}})},"2557e7cf84cc"(t,e,n){n.a(t,async(t,e)=>{try{var a=n("fbe0570fcc69"),s=n("7a7da66f4cf1"),r=n("2feae72af89f"),i=n("34addf781b5b"),o=t([a,s,r,i]);[a,s,r,i]=o.then?(await o)():o;var l=n.n(a);const u=new Set(["template","kind","variant","size","appearance","type","scheme","status","icon","filled","spacing","tightness","radius","segment","root-class","loading","disabled","native-type","aria-label",...i.Tw,"class","style","id","slot"]);function d(t,e){t?.forwardHostAttributes(e,{exclude:u,transferDataAttributes:!0,storageKey:"__sfIconButtonForwardedDataAttributes",targetStorageKey:"__sfIconButtonAttributeKeys"})}const c=["default","tonal","outline","link","surface","ghost"];class h extends(l()){constructor(){super(),this._attributeObserver=null}static get props(){return{templateName:{attribute:"template",default:"default"},kind:{default:"icon",values:["icon","close"],aliases:["variant"]},size:{default:"1"},appearance:{default:"default",aliases:["type"]},scheme:{default:"primary"},status:{default:"",values:["","error"]},segment:{default:""},icon:{default:"add"},filled:{type:Boolean,default:!1},spacing:{type:String,default:null},tightness:{default:"",values:["","low","high","highest"]},radius:{default:"",values:["","default","square","rounded"]},rootClass:{default:""},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},nativeType:{default:"button"},ariaLabel:{default:""},badgeCount:{default:""},badgeDot:{type:Boolean,default:!1},badgeCap:{type:Number,default:99},badgeLabel:{default:""}}}get templateName(){return this.getAttribute("template")||"default"}get size(){return this.getAttribute("size")||"1"}get kind(){return this.getProp("kind")}get variant(){return this.kind}get appearance(){const t=this.getAttribute("appearance")||this.getAttribute("type")||"default";return c.includes(t)?t:"default"}get type(){return this.appearance}get scheme(){return this.getAttribute("scheme")||"primary"}get status(){return this.getAttribute("status")||""}get icon(){return this.getAttribute("icon")||"add"}get segment(){return this.getEnumAttr("segment",["start","middle","end"],"")}get filled(){return this.getBooleanAttr("filled",!1)}get tightness(){return(0,r.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}).tightness}get spacing(){return(0,r.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}).spacing}get radius(){return this.getEnumAttr("radius",["default","square","rounded"],"")}get rootClass(){return this.getAttribute("root-class")||""}get loading(){return this.getBooleanAttr("loading",!1)}get disabled(){return this.getBooleanAttr("disabled",!1)}get nativeType(){return this.getAttribute("native-type")||"button"}get ariaLabel(){return this.getAttribute("aria-label")||""}templateContext(){const t=this.getPropsContext();return this.createTemplateContext({...t,type:this.type,variant:this.variant,...(0,r.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}),badge:this.badgeState?.(),component:this})}badgeState(){return(0,i.Wd)(this)}template(){return(0,s.y)(this.templateContext())}resolveUpdateMode(t=[]){const e=["disabled","aria-label","icon"];return t.length>0&&t.every(t=>e.includes(t))?"dom":"lit"}updateDom(t=[]){const e=this.querySelector(".sf-icon-button");if(!e)return!1;if(t.includes("disabled")&&(e.disabled=this.disabled||this.loading),t.includes("aria-label")&&(this.ariaLabel?e.setAttribute("aria-label",(0,i.VI)(this.ariaLabel,(0,i.Wd)(this).phrase)):e.removeAttribute("aria-label")),t.includes("icon")){const t=e.querySelector(".sf-icon");t&&(t.textContent=this.icon)}return d(this,e),!0}afterRender(){d(this,this.querySelector(".sf-icon-button")),this._attributeObserver||(this._attributeObserver=this.observeForwardedHostAttributes(()=>this.querySelector(".sf-icon-button"),{exclude:u,transferDataAttributes:!0,storageKey:"__sfIconButtonForwardedDataAttributes",targetStorageKey:"__sfIconButtonAttributeKeys"})._forwardHostAttributeObserver)}focusDelegate(){return this.querySelector(".sf-icon-button")}get value(){return{template:this.templateName,size:this.size,variant:this.variant,appearance:this.appearance,type:this.type,scheme:this.scheme,status:this.status,icon:this.icon,segment:this.segment,filled:this.filled,tightness:this.tightness,spacing:this.spacing,radius:this.radius,rootClass:this.rootClass,loading:this.loading,disabled:this.disabled,nativeType:this.nativeType,ariaLabel:this.ariaLabel,badgeCount:this.getProp("badgeCount"),badgeDot:this.getProp("badgeDot"),badgeCap:this.getProp("badgeCap"),badgeLabel:this.getProp("badgeLabel")}}setButtonAttributes(t={}){return this.setState({buttonAttributes:t}),this}onClick(t,e){return"function"==typeof t&&this.addEventListener("click",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}onMouseEnter(t,e){return"function"==typeof t&&this.addEventListener("mouseenter",t,e),this}onMouseLeave(t,e){return"function"==typeof t&&this.addEventListener("mouseleave",t,e),this}setDisabled(t=!0){return t?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this}set value(t){this.setValueAttributes(t)}onDisconnected(){this.disconnectForwardedHostAttributes(),this._attributeObserver=null,super.onDisconnected?.()}}h.define("sf-icon-button"),e()}catch(g){e(g)}})},"7a7da66f4cf1"(t,e,n){n.a(t,async(t,a)=>{try{n.d(e,{y:()=>u});var s=n("ddf1cdb42ecc"),r=n("50d2a204ba4c"),i=n("34addf781b5b"),o=t([s,i]);[s,i]=o.then?(await o)():o;const l=new Set(["1/3","1/2","1","2","3"]);function u(t){const{size:e,appearance:n,type:a,scheme:o,status:u,icon:d,segment:c,tightness:h,kind:g,variant:b,radius:f,filled:p,rootClass:m,loading:y,disabled:v,nativeType:S,ariaLabel:w,badge:A}=t,x=["sf-icon-button",l.has(e||"1")?`sf-icon-button--size-${e||"1"}`:"",`sf-icon-button--${g??b??"icon"}`,`sf-icon-button--${n||a||"default"}`,"flex","items-cross-center",c?`segment-${c}`:"",`sf-icon-button--${u||o||"primary"}`,h?`tightness-${h}`:"",f?`radius-${f}`:"",m,y?"loading sf-icon-button-state-loading":""].filter(Boolean),$=y?(0,r.le)({className:"sf-icon-button-spinner"}):t.component?.hasSlotContent?.("icon")?t.component.getSlotContent("icon"):"close"===(g??b)?s.html`
|
|
6
6
|
<sf-close root-class="pointer-event-none" size="${e||"1"}"></sf-close>`:s.html`
|
|
7
7
|
<sf-icon filled="${p}" root-class="pointer-event-none" icon="${d}" weight="400" aria-hidden="true"></sf-icon>`;return s.html`
|
|
8
8
|
<button
|
|
@@ -511,7 +511,7 @@
|
|
|
511
511
|
"source_artifacts": [
|
|
512
512
|
{
|
|
513
513
|
"path": "src/smart/icon-buttons/index.js",
|
|
514
|
-
"sha256": "
|
|
514
|
+
"sha256": "05e68e238c2e58bba406a4e89543d9ad28aa92050c1421e15686b90f121cff26"
|
|
515
515
|
}
|
|
516
516
|
],
|
|
517
517
|
"generated_runtime": [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
class="sf-badge sf-badge--anchored${e.dot?" sf-badge--dot":""}"
|
|
3
3
|
aria-hidden="true"
|
|
4
4
|
title=${e.phrase||a.nothing}
|
|
5
|
-
>${e.text}</span>`:a.nothing}function c(e,t=!0){return e?.visible&&e.phrase?a.html`<span class="sf-badge-anchored-text">${t?", ":""}${e.phrase}</span>`:a.nothing}o()}catch(u){o(u)}})},c24fff940cd9(e,t,n){n.a(e,async(e,t)=>{try{var o=n("fbe0570fcc69"),a=n("dc7d6ce8f484"),r=n("34addf781b5b"),i=e([o,a,r]);[o,a,r]=i.then?(await i)():i;var s=n.n(o);const l=new Map([[100,"thin"],[200,"extra-light"],[300,"light"],[400,"regular"],[500,"medium"],[600,"semi-bold"],[700,"bold"]]),d=["outlined","rounded","sharp"],c=["1/4","1/3","1/2","1","2","3","4","5","6","7"];function u(e,t,n,o){const a=Number(e);return Number.isFinite(a)?Math.min(o,Math.max(n,a)):t}class g extends(s()){static clearLightDomBeforeFirstRender=!0;constructor(){super(),this.onIconSubsetReady=e=>{const t=this.getProp("icon"),n=e.detail?.icons||[],o=n instanceof Set?n.has(t):Array.isArray(n)&&n.includes(t);t
|
|
5
|
+
>${e.text}</span>`:a.nothing}function c(e,t=!0){return e?.visible&&e.phrase?a.html`<span class="sf-badge-anchored-text">${t?", ":""}${e.phrase}</span>`:a.nothing}o()}catch(u){o(u)}})},c24fff940cd9(e,t,n){n.a(e,async(e,t)=>{try{var o=n("fbe0570fcc69"),a=n("dc7d6ce8f484"),r=n("34addf781b5b"),i=e([o,a,r]);[o,a,r]=i.then?(await i)():i;var s=n.n(o);const l=new Map([[100,"thin"],[200,"extra-light"],[300,"light"],[400,"regular"],[500,"medium"],[600,"semi-bold"],[700,"bold"]]),d=["outlined","rounded","sharp"],c=["1/4","1/3","1/2","1","2","3","4","5","6","7"];function u(e,t,n,o){const a=Number(e);return Number.isFinite(a)?Math.min(o,Math.max(n,a)):t}class g extends(s()){static clearLightDomBeforeFirstRender=!0;constructor(){super(),this.onIconSubsetReady=e=>{const t=this.getProp("icon"),n=e.detail?.icons||[],o=n instanceof Set?n.has(t):Array.isArray(n)&&n.includes(t);(!t||o||e.detail?.all)&&this.syncLoadedState()}}connectedCallback(){super.connectedCallback(),window.addEventListener("sf-icons-subset:ready",this.onIconSubsetReady),this.requestIconLoad(),this.syncLoadedState()}disconnectedCallback(){window.removeEventListener("sf-icons-subset:ready",this.onIconSubsetReady),super.disconnectedCallback()}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),["icon","filled","weight","grade","optical-size","type"].includes(e)&&t!==n&&(window.addEventListener("sf-icons-subset:ready",this.onIconSubsetReady),this.requestIconLoad(),this.syncLoadedState())}requestIconLoad(){const e=window.SF?.Loader;(e?.trackIconElement?.(this)||0)>0&&e.mutate?.(()=>e.loadFonts?.())}syncLoadedState(){const e=window.SF?.Loader,t=e?.getTrackedIconAttrs?.(this)||null,n=Boolean(t?.icon&&e?.isTrackedIconLoaded?.(t));n?window.removeEventListener("sf-icons-subset:ready",this.onIconSubsetReady):window.addEventListener("sf-icons-subset:ready",this.onIconSubsetReady),this.getProp("loaded")!==n&&this.setState({loaded:n})}static get props(){return{icon:"",loaded:{type:Boolean,default:!1},filled:{type:Boolean,default:!1},weight:{type:Number,default:400},size:{type:String,default:""},type:{type:String,default:""},grade:{type:Number,default:0},opticalSize:{type:Number,default:24},label:{type:String,default:""},badgeCount:{type:String,default:""},badgeDot:{type:Boolean,default:!1},badgeCap:{type:Number,default:99},badgeLabel:{type:String,default:""}}}static get observedAttributes(){return Array.from(new Set([...super.observedAttributes,"icon","size","weight","filled","loaded","type","grade","optical-size","label","badge-count","badge-dot","badge-cap","badge-label"]))}get weightClass(){let e=this.getProp("weight");return e=this.toNumber(e,400),l.get(e)||l.get(400)}get iconType(){const e=String(this.getProp("type")||"").trim().toLowerCase()||window.SF?.Loader?.getDefaultIconType?.()||window.SF_BOOT_CONFIG?.icons?.type||window.SF_ICON_TYPE||"outlined",t="shape"===e?"sharp":e;return d.includes(t)?t:"outlined"}get iconSize(){const e=String(this.getProp("size")||"").trim();return c.includes(e)?e:""}get iconGrade(){return u(this.getProp("grade"),0,-50,200)}get iconOpticalSize(){return u(this.getProp("opticalSize"),24,20,48)}get templateData(){return{icon:this.getProp("icon"),loaded:this.getProp("loaded"),filled:this.getProp("filled"),rounded:"rounded"===this.iconType,sharp:"sharp"===this.iconType,weightClass:this.weightClass,size:this.iconSize,grade:this.iconGrade,opticalSize:this.iconOpticalSize,label:String(this.getProp("label")||"").trim(),badge:(0,r.Wd)(this)}}template(){return(0,a.S)({...this.templateContext(),...this.templateData})}}g.define("sf-icon"),t()}catch(h){t(h)}})},dc7d6ce8f484(e,t,n){n.a(e,async(e,o)=>{try{n.d(t,{S:()=>d});var a=n("ddf1cdb42ecc"),r=n("7cd0e63a3ed6"),i=n("34addf781b5b"),s=e([a,r,i]);[a,r,i]=s.then?(await s)():s;function l(e){const{icon:t,size:n,filled:o,rounded:a,sharp:r,weightClass:i,loaded:s,rootClass:l,rootStyle:d,grade:c,opticalSize:u,label:g}=e;return{icon:t,className:["sf-icon",n?`sf-icon--size-${n}`:"",s?"sf-icon-loaded":"",i?`sf-icon--weight-${i}`:"",a?"sf-icon--rounded":"",r?"sf-icon--sharp":"",o?"sf-icon--filled":"",l].filter(Boolean).join(" "),style:[d,`--sf-icon--grade:${c}`,`--sf-icon--optical-size:${u}`].filter(Boolean).join(";"),label:g}}function d(e){const{icon:t,className:n,style:o,label:s}=l(e),d=e.badge;return(0,i.so)(d)?a.html`<span
|
|
6
6
|
class="sf-badge-anchor sf-badge-anchor--size-${(0,r.zZ)(e.size)} sf-badge-anchor--square"
|
|
7
7
|
role=${s?"img":a.nothing}
|
|
8
8
|
aria-label=${s?(0,i.VI)(s,d.phrase):a.nothing}
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
"source_artifacts": [
|
|
219
219
|
{
|
|
220
220
|
"path": "src/smart/icons/index.js",
|
|
221
|
-
"sha256": "
|
|
221
|
+
"sha256": "9c1a00450be17564c5898e1b352a4f41fc724501d84d899f99e281ff1ccb5e26"
|
|
222
222
|
},
|
|
223
223
|
{
|
|
224
224
|
"path": "src/smart/icons/js/templates/default.js",
|
|
@@ -1,42 +1,42 @@
|
|
|
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:()=>_});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 y(t,e=!1){return null==t||""===t?e:"boolean"==typeof t?t:["1","true","yes","on"].includes(String(t).toLowerCase())}function b(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=y(r,!0)),void 0!==s&&""!==s&&(a.placeholderChar=String(s)),a}async function $(t,e){const n=function(t,e){if(!y(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||b(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=b(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 _(t){if(!t||"1"!==t.dataset[p])return;delete t.__sfInputMaskRequest;const e=b(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 L(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:b="",value:w="",name:x="",leftIcon:S="",rightText:v="",hintIcon:$="",disabled:k=!1,readonly:_=!1,error:L=!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",y(I||L,!1)),this.template.dataset.mask=String(y(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),y(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=y(k,!1),B.readOnly=y(_,!1),B.required=y(r,!0),B.dataset.mask=String(y(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",y(I||L,!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=y(I||L,!1)&&E?E:b;if(U){const t=document.createElement("span");t.classList.add("sf-input-hint-text-wrap"),t.textContent=String(U),t.dataset.fieldMessage=y(I||L,!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(){_(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=b(n);if(!a)return!1;if(Object.prototype.hasOwnProperty.call(e,"disabled")&&(a.disabled=y(e.disabled)),Object.prototype.hasOwnProperty.call(e,"error")){const t=y(e.error);n.classList.toggle("error",t),a.classList.toggle("error",t)}if(Object.prototype.hasOwnProperty.call(e,"invalid")){const t=y(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",()=>L()):L();new MutationObserver(t=>{t.forEach(t=>{t.addedNodes.forEach(t=>{t instanceof Element&&(t.matches?.(c)&&k(t),L(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:""}}}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")||""}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:y,hasControlledValue:b,name:w,leftIcon:x,rightText:S,hintIcon:v,disabled:$,error:k,invalid:_,errorMessage:L,mask:I,rootClass:E,rootStyle:C,readonly:A,maskPattern:M,maskLazy:P,maskPlaceholderChar:q,maskOptions:O}=t,j=""===P?"":String(P),F=b?g:y,T=(0,s.h)(t.component,{prefix:"sf-input",required:o,invalid:_||k,hint:m,errorMessage:L}),N=["sf-input",T.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 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
|
|
2
2
|
style=${C||r.nothing}
|
|
3
3
|
type="hidden"
|
|
4
|
-
.value=${
|
|
4
|
+
.value=${T}
|
|
5
5
|
name=${w||""}
|
|
6
6
|
?disabled=${$}
|
|
7
7
|
?readonly=${A}
|
|
8
8
|
data-mask=${String(I)}
|
|
9
9
|
data-mask-pattern=${M||""}
|
|
10
|
-
data-mask-lazy=${
|
|
10
|
+
data-mask-lazy=${F}
|
|
11
11
|
data-mask-placeholder-char=${q||""}
|
|
12
12
|
data-mask-options=${O||""}
|
|
13
|
-
/>`;const
|
|
13
|
+
/>`;const B=t.component?.hasSlotContent?.("label")?t.component.getSlotContent("label"):i?r.html`
|
|
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
17
|
${S?r.html`<span class="sf-input-right"><span class="sf-input-text">${S}</span></span>`:""}
|
|
18
18
|
${v?r.html`<span class="sf-input-hint flex"><sf-icon icon="${v}"></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
|
-
class=${
|
|
21
|
+
class=${z.join(" ")}
|
|
22
22
|
style=${C||r.nothing}
|
|
23
23
|
data-mask=${String(I)}
|
|
24
24
|
data-mask-pattern=${M||""}
|
|
25
|
-
data-mask-lazy=${
|
|
25
|
+
data-mask-lazy=${F}
|
|
26
26
|
data-mask-placeholder-char=${q||""}
|
|
27
27
|
data-mask-options=${O||""}
|
|
28
28
|
>
|
|
29
|
-
${
|
|
29
|
+
${B?r.html`
|
|
30
30
|
<span class="sf-input-label flex">
|
|
31
|
-
${
|
|
31
|
+
${B}
|
|
32
32
|
</span>
|
|
33
33
|
`:""}
|
|
34
34
|
|
|
35
35
|
<span class="sf-input-field items-cross-center transition flex">
|
|
36
|
-
${
|
|
37
|
-
${
|
|
36
|
+
${R}
|
|
37
|
+
${y?r.html`
|
|
38
38
|
<input
|
|
39
|
-
id=${
|
|
39
|
+
id=${N.controlId}
|
|
40
40
|
type=${u}
|
|
41
41
|
autocomplete=${d||r.nothing}
|
|
42
42
|
inputmode=${c||r.nothing}
|
|
@@ -45,23 +45,24 @@
|
|
|
45
45
|
pattern=${h||r.nothing}
|
|
46
46
|
placeholder=${l}
|
|
47
47
|
.value=${g}
|
|
48
|
-
.defaultValue=${
|
|
48
|
+
.defaultValue=${b}
|
|
49
49
|
name=${w||""}
|
|
50
50
|
?disabled=${$}
|
|
51
51
|
?readonly=${A}
|
|
52
|
-
?required=${
|
|
53
|
-
aria-
|
|
54
|
-
aria-
|
|
55
|
-
aria-
|
|
52
|
+
?required=${N.required}
|
|
53
|
+
aria-label=${W}
|
|
54
|
+
aria-invalid=${N.invalid?"true":r.nothing}
|
|
55
|
+
aria-describedby=${D?N.messageId:r.nothing}
|
|
56
|
+
aria-errormessage=${N.invalid&&V?N.messageId:r.nothing}
|
|
56
57
|
data-mask=${String(I)}
|
|
57
58
|
data-mask-pattern=${M||""}
|
|
58
|
-
data-mask-lazy=${
|
|
59
|
+
data-mask-lazy=${F}
|
|
59
60
|
data-mask-placeholder-char=${q||""}
|
|
60
61
|
data-mask-options=${O||""}
|
|
61
62
|
/>
|
|
62
63
|
`:r.html`
|
|
63
64
|
<input
|
|
64
|
-
id=${
|
|
65
|
+
id=${N.controlId}
|
|
65
66
|
type=${u}
|
|
66
67
|
autocomplete=${d||r.nothing}
|
|
67
68
|
inputmode=${c||r.nothing}
|
|
@@ -69,29 +70,30 @@
|
|
|
69
70
|
maxlength=${""===f?r.nothing:f}
|
|
70
71
|
pattern=${h||r.nothing}
|
|
71
72
|
placeholder=${l}
|
|
72
|
-
.defaultValue=${
|
|
73
|
+
.defaultValue=${T}
|
|
73
74
|
.value=${g}
|
|
74
75
|
name=${w||""}
|
|
75
76
|
?disabled=${$}
|
|
76
77
|
?readonly=${A}
|
|
77
|
-
?required=${
|
|
78
|
-
aria-
|
|
79
|
-
aria-
|
|
80
|
-
aria-
|
|
78
|
+
?required=${N.required}
|
|
79
|
+
aria-label=${W}
|
|
80
|
+
aria-invalid=${N.invalid?"true":r.nothing}
|
|
81
|
+
aria-describedby=${D?N.messageId:r.nothing}
|
|
82
|
+
aria-errormessage=${N.invalid&&V?N.messageId:r.nothing}
|
|
81
83
|
data-mask=${String(I)}
|
|
82
84
|
data-mask-pattern=${M||""}
|
|
83
|
-
data-mask-lazy=${
|
|
85
|
+
data-mask-lazy=${F}
|
|
84
86
|
data-mask-placeholder-char=${q||""}
|
|
85
87
|
data-mask-options=${O||""}
|
|
86
88
|
/>
|
|
87
89
|
`}
|
|
88
|
-
${
|
|
90
|
+
${H}
|
|
89
91
|
</span>
|
|
90
92
|
|
|
91
|
-
${
|
|
92
|
-
id=${
|
|
93
|
+
${D?r.html`<span
|
|
94
|
+
id=${N.messageId}
|
|
93
95
|
class="sf-input-hint-text-wrap"
|
|
94
|
-
data-field-message=${
|
|
95
|
-
>${
|
|
96
|
+
data-field-message=${N.invalid&&V?"error":"hint"}
|
|
97
|
+
>${D}</span>`:""}
|
|
96
98
|
</label>
|
|
97
99
|
`}a()}catch(u){a(u)}})},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}))},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 n(a){const r=e[a];if(void 0!==r)return r.exports;const s=e[a]={exports:{}};return t[a](s,s.exports,n),s.exports}(()=>{const t="function"==typeof Symbol,e=t?Symbol("webpack queues"):"__webpack_queues__",a=t?Symbol("webpack exports"):"__webpack_exports__",r=t?Symbol("webpack error"):"__webpack_error__",s=t=>{t?.d<1&&(t.d=1,t.forEach(t=>t.r--),t.forEach(t=>t.r--?t.r++:t()))};n.a=(t,n,i)=>{let o;i&&((o=[]).d=-1);const l=new Set,u=t.exports;let d,c,p;const f=new Promise((t,e)=>{p=e,c=t});f[a]=u,f[e]=t=>(o&&t(o),l.forEach(t),f.catch(t=>{})),t.exports=f;n(t=>{let n;d=(t=>t.map(t=>{if(null!==t&&"object"==typeof t){if(t[e])return t;if(t.then){const n=[];n.d=0,t.then(t=>{i[a]=t,s(n)},t=>{i[r]=t,s(n)});const i={};return i[e]=t=>t(n),i}}const n={};return n[e]=t=>{},n[a]=t,n}))(t);const i=()=>d.map(t=>{if(t[r])throw t[r];return t[a]}),u=new Promise(t=>{n=()=>t(i),n.r=0;const a=t=>t!==o&&!l.has(t)&&(l.add(t),t&&!t.d&&(n.r++,t.push(n)));d.map(t=>t[e](a))});return n.r?u:i()},t=>(t?p(f[r]=t):c(u),s(o))),o?.d<0&&(o.d=0)}})(),n.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{if(Array.isArray(e))for(var a=0;a<e.length;){var r=e[a++],s=e[a++];n.o(t,r)?0===s&&a++:0===s?Object.defineProperty(t,r,{enumerable:!0,value:e[a++]}):Object.defineProperty(t,r,{enumerable:!0,get:s})}else for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);n("44b791419862")})();
|
|
@@ -200,6 +200,11 @@
|
|
|
200
200
|
"filled",
|
|
201
201
|
"hidden"
|
|
202
202
|
]
|
|
203
|
+
},
|
|
204
|
+
"aria-label": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"default": "",
|
|
207
|
+
"description": "Accessible name for a field rendered without a visible label; it lands on the native input."
|
|
203
208
|
}
|
|
204
209
|
},
|
|
205
210
|
"additionalProperties": false
|
|
@@ -497,7 +502,7 @@
|
|
|
497
502
|
"source_artifacts": [
|
|
498
503
|
{
|
|
499
504
|
"path": "src/smart/inputs/index.js",
|
|
500
|
-
"sha256": "
|
|
505
|
+
"sha256": "2e5d356b7e2ccc5c4be5abc9893d87b61e3cf12e067cf766e135bfbe46271bfc"
|
|
501
506
|
}
|
|
502
507
|
],
|
|
503
508
|
"generated_runtime": [
|
|
@@ -35,6 +35,7 @@ export function renderInputTemplate(context) {
|
|
|
35
35
|
maskLazy,
|
|
36
36
|
maskPlaceholderChar,
|
|
37
37
|
maskOptions,
|
|
38
|
+
ariaLabel,
|
|
38
39
|
} = context;
|
|
39
40
|
const maskLazyValue = maskLazy === '' ? '' : String(maskLazy);
|
|
40
41
|
const inputValue = hasControlledValue ? value : defaultValue;
|
|
@@ -115,6 +116,11 @@ export function renderInputTemplate(context) {
|
|
|
115
116
|
? context.component.getSlotContent('error')
|
|
116
117
|
: errorMessage;
|
|
117
118
|
const messageContent = field.invalid && errorContent ? errorContent : hintContent;
|
|
119
|
+
// The visible label names the control through the wrapping <label>; with no
|
|
120
|
+
// visible label there is nothing to name it, so the host's aria-label lands on
|
|
121
|
+
// the native input. Both at once would make the name say one thing and the
|
|
122
|
+
// page another.
|
|
123
|
+
const accessibleName = !labelContent && ariaLabel ? ariaLabel : nothing;
|
|
118
124
|
|
|
119
125
|
return html`
|
|
120
126
|
<label
|
|
@@ -153,6 +159,7 @@ export function renderInputTemplate(context) {
|
|
|
153
159
|
?disabled=${disabled}
|
|
154
160
|
?readonly=${readonly}
|
|
155
161
|
?required=${field.required}
|
|
162
|
+
aria-label=${accessibleName}
|
|
156
163
|
aria-invalid=${field.invalid ? 'true' : nothing}
|
|
157
164
|
aria-describedby=${messageContent ? field.messageId : nothing}
|
|
158
165
|
aria-errormessage=${field.invalid && errorContent ? field.messageId : nothing}
|
|
@@ -179,6 +186,7 @@ export function renderInputTemplate(context) {
|
|
|
179
186
|
?disabled=${disabled}
|
|
180
187
|
?readonly=${readonly}
|
|
181
188
|
?required=${field.required}
|
|
189
|
+
aria-label=${accessibleName}
|
|
182
190
|
aria-invalid=${field.invalid ? 'true' : nothing}
|
|
183
191
|
aria-describedby=${messageContent ? field.messageId : nothing}
|
|
184
192
|
aria-errormessage=${field.invalid && errorContent ? field.messageId : nothing}
|