@simai-studio/ui 5.20261019.2041 → 5.20261020.1056
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 +5 -5
- package/distr/component/buttons/css/buttons.min.css +1 -1
- package/distr/component/buttons/js/buttons.min.js +1 -1
- package/distr/component/icon-buttons/css/icon-buttons.min.css +1 -1
- package/distr/component/icon-buttons/js/icon-buttons.min.js +1 -1
- package/distr/component/spinner/css/spinner.min.css +1 -1
- package/distr/component/spinner/js/spinner.min.js +1 -1
- package/distr/core/js/core-rules.js +25 -2
- package/distr/core/js/core-rules.min.js +1 -1
- package/distr/rule/js/rule.min.js +1 -1
- package/distr/rule/rule.json +24 -0
- package/distr/smart/button-group/js/button-group.min.js +13 -10
- package/distr/smart/button-group/smart.manifest.json +8 -3
- package/distr/smart/button-group/template/default.js +15 -2
- package/distr/smart/buttons/js/buttons.min.js +11 -10
- package/distr/smart/buttons/smart.manifest.json +3 -2
- package/distr/smart/buttons/template/default.js +17 -2
- package/distr/smart/icon-buttons/js/icon-buttons.min.js +11 -11
- package/distr/smart/icon-buttons/smart.manifest.json +4 -3
- package/distr/smart/icon-buttons/template/default.js +6 -2
- package/distr/smart/spinner/js/spinner.min.js +2 -2
- package/distr/smart/spinner/smart.manifest.json +36 -9
- package/distr/smart/spinner/template/default.js +4 -1
- package/package-manifest.json +25 -25
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";class t{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 e=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)},n=(()=>{const t="undefined"!=typeof globalThis?globalThis:{},e="__sfPageLanguage";return t[e]||(t[e]={listeners:new Set,registered:new Map,chosen:null}),t[e]})(),i=n.listeners,s=n.registered,a=t=>String(t??"").trim().toLowerCase().replace("_","-"),o=()=>{for(const t of[...i])try{t()}catch{}};function r(t){let e=t;for(;e;){const t="function"==typeof e.closest?e.closest("[lang]"):null;if(t)return t;const n="function"==typeof e.getRootNode?e.getRootNode():null;e=n&&n!==e&&n.host?n.host:null}return null}function l(t){if(n.chosen)return n.chosen.split("-")[0];const e=r(t),i=e?.getAttribute("lang")||globalThis.document?.documentElement?.lang||"en";return a(i).split("-")[0]||"en"}function d(t){if(n.chosen)return n.chosen;const e=r(t);return a(e?.getAttribute("lang")||globalThis.document?.documentElement?.lang||"en")}function c(t,e,n,i){const o=i??(t=>{const e=t?.tagName;return"string"==typeof e?e.toLowerCase():null})(n);for(const i of(t=>{const e=a(t),n=e.split("-")[0],i=[];for(const t of[e,n,"en"])t&&!i.includes(t)&&i.push(t);return i})(d(n))){const n=o?s.get(o)?.get(i)?.[e]:void 0;if(void 0!==n)return n;const a=t?.[i]?.[e];if(void 0!==a)return a}return e}const h={current:(t=globalThis.document?.documentElement??null)=>d(t),use(t){const e=null==t?null:a(t);return e===n.chosen||(n.chosen=e,o()),n.chosen},register(t,e,n){const i=String(t??"").toLowerCase(),r=a(e);if(!i||!r)throw new TypeError("a component and a language are required");s.has(i)||s.set(i,new Map);const l=s.get(i);return null===n?l.delete(r):l.set(r,{...l.get(r)??{},...n}),o(),this},registerAll(t,e={}){for(const[n,i]of Object.entries(e))this.register(n,t,i);return this},known(t){const e=String(t??"").toLowerCase();return[...s.get(e)?.keys()??[]]},components:()=>[...s.keys()],onChange:t=>"function"!=typeof t?()=>{}:(i.add(t),()=>i.delete(t)),forget(){return s.clear(),n.chosen=null,o(),this}};"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.language=h,window.SF.pageLanguage=l,window.SF.pageText=c);const u={en:{label:"Loading…"},ru:{label:"Загрузка…"}},f=".sf-loader-container",p="sfSpinnerBound";function m(t,e){const n=Number.parseFloat(String(t??""));return Number.isFinite(n)?n:e}function w(t,e,n){return Math.min(Math.max(t,e),n)}function g(t,e,n){const i=String(t||"").trim().toLowerCase();return e.includes(i)?i:n}function y(t,e={}){const n=document.createElementNS("http://www.w3.org/2000/svg",t);return Object.entries(e).forEach(([t,e])=>{null!=e&&""!==e&&n.setAttribute(t,String(e))}),n}function S({width:t=58,height:e=58,strokeWidth:n=4}={}){const i=w(m(t,58),16,256),s=w(m(e,i),16,256),a=w(m(n,4),1,Math.min(i,s)/2),o=Math.max(1,Math.min(i,s)/2-a/2),r=i/2,l=s/2,d=y("svg",{class:"sf-loader-svg",viewBox:`0 0 ${i} ${s}`,width:i,height:s,"aria-hidden":"true"}),c=y("circle",{class:"sf-loader-ring-filled",cx:r,cy:l,r:o}),h=y("circle",{class:"sf-loader-ring-accent",cx:r,cy:l,r:o,pathLength:100,"stroke-dasharray":"0 100",transform:`rotate(90 ${r} ${l})`});return d.append(c,h),d}function v({width:t=58,height:e=58,dots:n=16,filled:i=6,dotRadius:s=null,direction:a="clockwise"}={}){const o=w(m(t,58),16,256),r=w(m(e,o),16,256),l=w(Math.floor(m(n,16)),3,32),d=w(Math.floor(m(i,6)),1,l),c=null===s?Math.max(1.5,.06*Math.min(o,r)):w(m(s,1),1,Math.min(o,r)/4),h=Math.max(c,Math.min(o,r)/2-c-1),u=o/2,f=r/2,p=y("svg",{class:"sf-loader-svg",viewBox:`0 0 ${o} ${r}`,width:o,height:r,"aria-hidden":"true",style:`--sf-loader-dot-count:${l}; --sf-loader-dot-filled:${d};`});for(let t=0;t<l;t+=1){const e=2*Math.PI/l*t-Math.PI/2,n=y("circle",{class:"sf-loader-dot"+(t<d?" sf-loader-dot--active":""),cx:u+h*Math.cos(e),cy:f+h*Math.sin(e),r:c,style:`--sf-loader-dot-index:${t}; --sf-loader-dot-step:${"counterclockwise"===a?t:(l-t)%l};`});p.append(n)}return p}function b(t,e,n){let i=t.querySelector(e);return i?(i.innerHTML="",i):(i=document.createElement("div"),i.className=n,i.dataset.sfSpinnerPart=n,t.append(i),i)}function E(t){if(!(t instanceof HTMLElement))return t;const e=function(t){const e=t.querySelector(".sf-loader--loading-indicator"),n=t.querySelector(".sf-loader--circles"),i=t.querySelector(".sf-loader--text"),s=Object.prototype.hasOwnProperty.call(t.dataset,"width")||Object.prototype.hasOwnProperty.call(t.dataset,"w"),a=Object.prototype.hasOwnProperty.call(t.dataset,"height")||Object.prototype.hasOwnProperty.call(t.dataset,"h"),o=w(m(t.dataset.width,m(t.dataset.w,58)),16,256),r=w(m(t.dataset.height,m(t.dataset.h,o)),16,256),l=t.dataset.strokeWidth?w(m(t.dataset.strokeWidth,4),1,Math.min(o,r)/2):null,d=w(Math.floor(m(t.dataset.dots,16)),3,32),c=w(Math.floor(m(t.dataset.filled,6)),1,d),h=t.dataset.dotRadius?w(m(t.dataset.dotRadius,1),1,Math.min(o,r)/4):null,u=g(t.dataset.direction,["clockwise","counterclockwise"],"clockwise");let f=String(t.dataset.variant||"").toLowerCase();return f=g(f,["arc","dots"],n?"dots":"arc"),{width:o,height:r,strokeWidth:l,dots:d,filled:c,dotRadius:h,direction:u,variant:f,hasExplicitWidth:s,hasExplicitHeight:a,infinite:"true"===t.dataset.infinite,announce:"true"===t.dataset.announce,label:void 0!==t.dataset.label?t.dataset.label:i?.textContent?.trim?.()||"",indicator:e,circles:n,labelNode:i}}(t);t.classList.add("sf-loader-container"),e.infinite?t.classList.add("sf-loader--infinite"):t.classList.remove("sf-loader--infinite"),e.hasExplicitWidth?t.style.setProperty("--sf-loader-svg-width",`${e.width}px`):t.style.removeProperty("--sf-loader-svg-width"),e.hasExplicitHeight||e.hasExplicitWidth?t.style.setProperty("--sf-loader-svg-height",`${e.height}px`):t.style.removeProperty("--sf-loader-svg-height"),null!==e.strokeWidth?t.style.setProperty("--sf-loader-stroke-width",`${e.strokeWidth}px`):t.style.removeProperty("--sf-loader-stroke-width");const n="dots"===e.variant?"sf-loader--circles":"sf-loader--loading-indicator",i=b(t,`.${n}`,n),s=e.label||e.labelNode?b(t,".sf-loader--text","sf-loader--text"):null,a="dots"===e.variant?v(e):S(e);i.append(a);const o="dots"===e.variant?".sf-loader--loading-indicator":".sf-loader--circles";return t.querySelector(o)?.remove(),s&&(s.textContent=e.label||""),function(t,e){const n=Boolean(e.label);if(t.toggleAttribute("aria-hidden",!n),e.announce&&n)return t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),void(t.dataset.sfSpinnerSemantics="status");"status"===t.dataset.sfSpinnerSemantics&&(t.removeAttribute("role"),t.removeAttribute("aria-live"),t.removeAttribute("aria-atomic"),delete t.dataset.sfSpinnerSemantics)}(t,e),t}function M(t){return t instanceof HTMLElement&&"1"!==t.dataset[p]?(E(t),t.dataset[p]="1",t):t}function x(t){t instanceof HTMLElement&&delete t.dataset[p]}function N(t){(t instanceof Element||t===document)&&(t instanceof Element&&t.matches?.(f)&&M(t),t.querySelectorAll?.(f).forEach(M))}e("Spinner",class extends t{static componentName="Spinner";constructor(t){super(t);const{width:e,height:n,label:i=c(u,"label",t?.root??document.documentElement),variant:s="arc",dots:a=16,filled:o=6,strokeWidth:r=null,dotRadius:l=null,infinite:d=!1,announce:h=!1,direction:f="clockwise"}=this.params||{},p=this.attrs.class||this.attrs.className;this.template=document.createElement("div"),this.id&&(this.template.id=this.id),this.template.classList.add("sf-loader-container"),p&&this.template.classList.add(...`${p}`.split(" ").filter(Boolean)),Object.entries(this.attrs).filter(([t])=>!["class","className"].includes(t)).forEach(([t,e])=>{null!=e&&this.template.setAttribute(t,e)}),null!=e&&""!==e&&(this.template.dataset.width=String(e)),null!=n&&""!==n&&(this.template.dataset.height=String(n)),this.template.dataset.label=String(i??""),this.template.dataset.variant=String(s),this.template.dataset.dots=String(a),this.template.dataset.filled=String(o),null!=r&&""!==r&&(this.template.dataset.strokeWidth=String(r)),this.template.dataset.infinite=String(d),this.template.dataset.announce=String(h),this.template.dataset.direction=String(f),null!=l&&(this.template.dataset.dotRadius=String(l))}init(){M(this.template)}destroyInternal(){x(this.template)}}),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.Spinner=window.SF.Spinner||{},window.SF.Spinner.bind=M,window.SF.Spinner.render=E,window.SF.Spinner.unbind=x,window.SF.Spinner.createArcSvg=S,window.SF.Spinner.createDotsSvg=v),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>N(document)):N(document);new MutationObserver(t=>{t.forEach(t=>{t.addedNodes.forEach(t=>{t instanceof Element&&N(t)})})}).observe(document.documentElement,{childList:!0,subtree:!0})})();
|
|
1
|
+
(()=>{"use strict";class t{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 e=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)},n=(()=>{const t="undefined"!=typeof globalThis?globalThis:{},e="__sfPageLanguage";return t[e]||(t[e]={listeners:new Set,registered:new Map,chosen:null}),t[e]})(),i=n.listeners,o=n.registered,s=t=>String(t??"").trim().toLowerCase().replace("_","-"),r=()=>{for(const t of[...i])try{t()}catch{}};function a(t){let e=t;for(;e;){const t="function"==typeof e.closest?e.closest("[lang]"):null;if(t)return t;const n="function"==typeof e.getRootNode?e.getRootNode():null;e=n&&n!==e&&n.host?n.host:null}return null}function l(t){if(n.chosen)return n.chosen.split("-")[0];const e=a(t),i=e?.getAttribute("lang")||globalThis.document?.documentElement?.lang||"en";return s(i).split("-")[0]||"en"}function d(t){if(n.chosen)return n.chosen;const e=a(t);return s(e?.getAttribute("lang")||globalThis.document?.documentElement?.lang||"en")}function c(t,e,n,i){const r=i??(t=>{const e=t?.tagName;return"string"==typeof e?e.toLowerCase():null})(n);for(const i of(t=>{const e=s(t),n=e.split("-")[0],i=[];for(const t of[e,n,"en"])t&&!i.includes(t)&&i.push(t);return i})(d(n))){const n=r?o.get(r)?.get(i)?.[e]:void 0;if(void 0!==n)return n;const s=t?.[i]?.[e];if(void 0!==s)return s}return e}const h={current:(t=globalThis.document?.documentElement??null)=>d(t),use(t){const e=null==t?null:s(t);return e===n.chosen||(n.chosen=e,r()),n.chosen},register(t,e,n){const i=String(t??"").toLowerCase(),a=s(e);if(!i||!a)throw new TypeError("a component and a language are required");o.has(i)||o.set(i,new Map);const l=o.get(i);return null===n?l.delete(a):l.set(a,{...l.get(a)??{},...n}),r(),this},registerAll(t,e={}){for(const[n,i]of Object.entries(e))this.register(n,t,i);return this},known(t){const e=String(t??"").toLowerCase();return[...o.get(e)?.keys()??[]]},components:()=>[...o.keys()],onChange:t=>"function"!=typeof t?()=>{}:(i.add(t),()=>i.delete(t)),forget(){return o.clear(),n.chosen=null,r(),this}};function u(){const t=globalThis.SF=globalThis.SF||{};return t.__deprecationNotes instanceof Map||Object.defineProperty(t,"__deprecationNotes",{value:new Map,configurable:!0}),t.__deprecationNotes}function f({component:t="",kind:e="attribute",attribute:n="",from:i,to:o=null}={}){if(!i)return;const s=[t,e,n,i].join("|"),r=u(),a=r.get(s);if(a)a.count+=1;else if(r.set(s,{component:t,kind:e,attribute:n,from:i,to:o,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const s=t?`${t}: `:"",r="value"===e?`${n}="${i}"`:`${e} ${i}`;globalThis.console?.warn?.(`[SIMAI Framework] ${s}${r} is a legacy name${o?`; write ${o}`:""}. See contracts/changes/journal.json.`)}}if("undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.language=h,window.SF.pageLanguage=l,window.SF.pageText=c),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...u().values()].map(t=>({...t}))},t.clear=function(){u().clear()},t.note=f,globalThis.SF.deprecations=t}function p(t,e={}){const n=document.createElementNS("http://www.w3.org/2000/svg",t);return Object.entries(e).forEach(([t,e])=>{null!=e&&""!==e&&n.setAttribute(t,String(e))}),n}function m(){const t=12,e=p("svg",{class:"sf-loader-svg",viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false"}),n=p("circle",{class:"sf-loader-ring-filled",cx:t,cy:t,r:11,fill:"none",stroke:"currentColor","stroke-width":2,opacity:"0.3"}),i=p("circle",{class:"sf-loader-ring-accent",cx:t,cy:t,r:11,fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round",pathLength:100,"stroke-dasharray":"0 100",transform:"rotate(90 12 12)"});return e.append(n,i),e}const g={en:{label:"Loading…"},ru:{label:"Загрузка…"}},w=".sf-loader-container",S="sfSpinnerBound";function y(t,e){const n=Number.parseFloat(String(t??""));return Number.isFinite(n)?n:e}function b(t,e,n){return Math.min(Math.max(t,e),n)}function v(t,e,n){const i=String(t||"").trim().toLowerCase();return e.includes(i)?i:n}const E=[["width","data-width","width"],["w","data-w","width"],["height","data-height","height"],["h","data-h","height"],["strokeWidth","data-stroke-width","stroke-width"],["dotRadius","data-dot-radius","dot-radius"]];function x({width:t=58,height:e=58,strokeWidth:n=4}={}){const i=b(y(t,58),16,256),o=b(y(e,i),16,256),s=b(y(n,4),1,Math.min(i,o)/2),r=Math.max(1,Math.min(i,o)/2-s/2),a=i/2,l=o/2,d=p("svg",{class:"sf-loader-svg",viewBox:`0 0 ${i} ${o}`,width:i,height:o,"aria-hidden":"true"}),c=p("circle",{class:"sf-loader-ring-filled",cx:a,cy:l,r}),h=p("circle",{class:"sf-loader-ring-accent",cx:a,cy:l,r,pathLength:100,"stroke-dasharray":"0 100",transform:`rotate(90 ${a} ${l})`});return d.append(c,h),d}function M({width:t=58,height:e=58,dots:n=16,filled:i=6,dotRadius:o=null,direction:s="clockwise"}={}){const r=b(y(t,58),16,256),a=b(y(e,r),16,256),l=b(Math.floor(y(n,16)),3,32),d=b(Math.floor(y(i,6)),1,l),c=null===o?Math.max(1.5,.06*Math.min(r,a)):b(y(o,1),1,Math.min(r,a)/4),h=Math.max(c,Math.min(r,a)/2-c-1),u=r/2,f=a/2,m=p("svg",{class:"sf-loader-svg",viewBox:`0 0 ${r} ${a}`,width:r,height:a,"aria-hidden":"true",style:`--sf-loader-dot-count:${l}; --sf-loader-dot-filled:${d};`});for(let t=0;t<l;t+=1){const e=2*Math.PI/l*t-Math.PI/2,n=p("circle",{class:"sf-loader-dot"+(t<d?" sf-loader-dot--active":""),cx:u+h*Math.cos(e),cy:f+h*Math.sin(e),r:c,style:`--sf-loader-dot-index:${t}; --sf-loader-dot-step:${"counterclockwise"===s?t:(l-t)%l};`});m.append(n)}return m}function k(t){const e=t.querySelector(".sf-loader--loading-indicator"),n=t.querySelector(".sf-loader--circles"),i=t.querySelector(".sf-loader--text"),o=Object.prototype.hasOwnProperty.call(t.dataset,"width")||Object.prototype.hasOwnProperty.call(t.dataset,"w"),s=Object.prototype.hasOwnProperty.call(t.dataset,"height")||Object.prototype.hasOwnProperty.call(t.dataset,"h"),r=function(t){const e=t.closest?.("sf-spinner"),n=E.filter(([e])=>{const n=t.dataset[e];return void 0!==n&&""!==n});return n.forEach(([,t,n])=>{f({component:e?"sf-spinner":"spinner",kind:"attribute",from:e?n:t,to:e?"size":null})}),n.length>0}(t),a=b(y(t.dataset.width,y(t.dataset.w,58)),16,256),l=b(y(t.dataset.height,y(t.dataset.h,a)),16,256),d=t.dataset.strokeWidth?b(y(t.dataset.strokeWidth,4),1,Math.min(a,l)/2):null,c=b(Math.floor(y(t.dataset.dots,16)),3,32),h=b(Math.floor(y(t.dataset.filled,6)),1,c),u=t.dataset.dotRadius?b(y(t.dataset.dotRadius,1),1,Math.min(a,l)/4):null,p=v(t.dataset.direction,["clockwise","counterclockwise"],"clockwise");let m=String(t.dataset.variant||"").toLowerCase();return m=v(m,["arc","dots"],n?"dots":"arc"),{pixel:r,width:a,height:l,strokeWidth:d,dots:c,filled:h,dotRadius:u,direction:p,variant:m,hasExplicitWidth:o,hasExplicitHeight:s,infinite:"true"===t.dataset.infinite,announce:"true"===t.dataset.announce,label:void 0!==t.dataset.label?t.dataset.label:i?.textContent?.trim?.()||"",indicator:e,circles:n,labelNode:i}}function N(t,e,n){let i=t.querySelector(e);return i?(i.innerHTML="",i):(i=document.createElement("div"),i.className=n,i.dataset.sfSpinnerPart=n,t.append(i),i)}function F(t){if(!(t instanceof HTMLElement))return t;const e=k(t);t.classList.add("sf-loader-container"),e.infinite?t.classList.add("sf-loader--infinite"):t.classList.remove("sf-loader--infinite"),e.pixel&&e.hasExplicitWidth?t.style.setProperty("--sf-loader-svg-width",`${e.width}px`):t.style.removeProperty("--sf-loader-svg-width"),e.pixel&&(e.hasExplicitHeight||e.hasExplicitWidth)?t.style.setProperty("--sf-loader-svg-height",`${e.height}px`):t.style.removeProperty("--sf-loader-svg-height"),null!==e.strokeWidth?t.style.setProperty("--sf-loader-stroke-width",`${e.strokeWidth}px`):t.style.removeProperty("--sf-loader-stroke-width"),t.classList.toggle("sf-loader--pixel-geometry",e.pixel);const n="dots"===e.variant?"sf-loader--circles":"sf-loader--loading-indicator",i=N(t,`.${n}`,n),o=e.label||e.labelNode?N(t,".sf-loader--text","sf-loader--text"):null,s=e.pixel?e:{...e,width:24,height:24,strokeWidth:null},r="dots"===e.variant?M(s):e.pixel?x(e):m();i.append(r);const a="dots"===e.variant?".sf-loader--loading-indicator":".sf-loader--circles";return t.querySelector(a)?.remove(),o&&(o.textContent=e.label||""),function(t,e){const n=Boolean(e.label);if(t.toggleAttribute("aria-hidden",!n),e.announce&&n)return t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),void(t.dataset.sfSpinnerSemantics="status");"status"===t.dataset.sfSpinnerSemantics&&(t.removeAttribute("role"),t.removeAttribute("aria-live"),t.removeAttribute("aria-atomic"),delete t.dataset.sfSpinnerSemantics)}(t,e),t}function L(t){return t instanceof HTMLElement&&"1"!==t.dataset[S]?(F(t),t.dataset[S]="1",t):t}function $(t){t instanceof HTMLElement&&delete t.dataset[S]}function C(t){(t instanceof Element||t===document)&&(t instanceof Element&&t.matches?.(w)&&L(t),t.querySelectorAll?.(w).forEach(L))}e("Spinner",class extends t{static componentName="Spinner";constructor(t){super(t);const{width:e,height:n,label:i=c(g,"label",t?.root??document.documentElement),variant:o="arc",dots:s=16,filled:r=6,strokeWidth:a=null,dotRadius:l=null,infinite:d=!1,announce:h=!1,direction:u="clockwise"}=this.params||{},f=this.attrs.class||this.attrs.className;this.template=document.createElement("div"),this.id&&(this.template.id=this.id),this.template.classList.add("sf-loader-container"),f&&this.template.classList.add(...`${f}`.split(" ").filter(Boolean)),Object.entries(this.attrs).filter(([t])=>!["class","className"].includes(t)).forEach(([t,e])=>{null!=e&&this.template.setAttribute(t,e)}),null!=e&&""!==e&&(this.template.dataset.width=String(e)),null!=n&&""!==n&&(this.template.dataset.height=String(n)),this.template.dataset.label=String(i??""),this.template.dataset.variant=String(o),this.template.dataset.dots=String(s),this.template.dataset.filled=String(r),null!=a&&""!==a&&(this.template.dataset.strokeWidth=String(a)),this.template.dataset.infinite=String(d),this.template.dataset.announce=String(h),this.template.dataset.direction=String(u),null!=l&&(this.template.dataset.dotRadius=String(l))}init(){L(this.template)}destroyInternal(){$(this.template)}}),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.Spinner=window.SF.Spinner||{},window.SF.Spinner.bind=L,window.SF.Spinner.render=F,window.SF.Spinner.unbind=$,window.SF.Spinner.createArcSvg=function(t={}){return["width","height","strokeWidth"].some(e=>{const n=t?.[e];return null!=n&&""!==n})?x(t):m()},window.SF.Spinner.createDotsSvg=M),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>C(document)):C(document);new MutationObserver(t=>{t.forEach(t=>{t.addedNodes.forEach(t=>{t instanceof Element&&C(t)})})}).observe(document.documentElement,{childList:!0,subtree:!0})})();
|
|
@@ -94,7 +94,12 @@ SF.RuleLoader['buttons'] = {
|
|
|
94
94
|
regex: /class\s*=\s*["'][^"']*\bsf-button\b/i,
|
|
95
95
|
type: 'component',
|
|
96
96
|
css: true,
|
|
97
|
-
js: true
|
|
97
|
+
js: true,
|
|
98
|
+
// The spinner a loading button shows, fetched after the page is ready.
|
|
99
|
+
relation: [{
|
|
100
|
+
name: 'spinner',
|
|
101
|
+
lazy: true
|
|
102
|
+
}]
|
|
98
103
|
};
|
|
99
104
|
|
|
100
105
|
/***/ },
|
|
@@ -367,7 +372,12 @@ SF.RuleLoader['icon-buttons'] = {
|
|
|
367
372
|
regex: /class\s*=\s*["'][^"']*\bsf-icon-button\b/i,
|
|
368
373
|
type: 'component',
|
|
369
374
|
css: true,
|
|
370
|
-
js: true
|
|
375
|
+
js: true,
|
|
376
|
+
// The spinner a loading button shows, fetched after the page is ready.
|
|
377
|
+
relation: [{
|
|
378
|
+
name: 'spinner',
|
|
379
|
+
lazy: true
|
|
380
|
+
}]
|
|
371
381
|
};
|
|
372
382
|
|
|
373
383
|
/***/ },
|
|
@@ -3501,12 +3511,16 @@ SF.RuleLoader['cl-button-group'] = {
|
|
|
3501
3511
|
type: 'smart',
|
|
3502
3512
|
mode: 'smart',
|
|
3503
3513
|
js: true,
|
|
3514
|
+
// spinner: a loading item shows it, fetched after the page is ready.
|
|
3504
3515
|
relation: [{
|
|
3505
3516
|
name: 'button-group'
|
|
3506
3517
|
}, {
|
|
3507
3518
|
name: 'cl-buttons'
|
|
3508
3519
|
}, {
|
|
3509
3520
|
name: 'cl-icons'
|
|
3521
|
+
}, {
|
|
3522
|
+
name: 'spinner',
|
|
3523
|
+
lazy: true
|
|
3510
3524
|
}]
|
|
3511
3525
|
};
|
|
3512
3526
|
|
|
@@ -3528,6 +3542,11 @@ SF.RuleLoader['cl-buttons'] = {
|
|
|
3528
3542
|
name: 'text-align/default'
|
|
3529
3543
|
}, {
|
|
3530
3544
|
name: 'cl-icons'
|
|
3545
|
+
}, // The spinner a loading button shows: its slot is drawn by the button sheet,
|
|
3546
|
+
// the motion by the spinner's, fetched after the page is ready.
|
|
3547
|
+
{
|
|
3548
|
+
name: 'spinner',
|
|
3549
|
+
lazy: true
|
|
3531
3550
|
}]
|
|
3532
3551
|
};
|
|
3533
3552
|
|
|
@@ -3862,6 +3881,10 @@ SF.RuleLoader['cl-icon-buttons'] = {
|
|
|
3862
3881
|
name: 'cl-close'
|
|
3863
3882
|
}, {
|
|
3864
3883
|
name: 'pointer-events/default'
|
|
3884
|
+
}, // The spinner a loading icon button shows, fetched after the page is ready.
|
|
3885
|
+
{
|
|
3886
|
+
name: 'spinner',
|
|
3887
|
+
lazy: true
|
|
3865
3888
|
}]
|
|
3866
3889
|
};
|
|
3867
3890
|
|