@cds/core 5.6.1 → 5.6.2
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{property as t}from"lit/decorators/property.js";import{camelCaseToKebabCase as r,capitalizeFirstLetter as e,kebabCaseToPascalCase as n}from"../utils/string.js";import{LogService as
|
|
1
|
+
import{property as t}from"lit/decorators/property.js";import{camelCaseToKebabCase as r,capitalizeFirstLetter as e,kebabCaseToPascalCase as n}from"../utils/string.js";import{LogService as i}from"../services/log.service.js";import{getAngularVersion as o,getVueVersion as u,getReactVersion as c}from"../utils/framework.js";import{isNilOrEmpty as s}from"../utils/identity.js";function a(t,e){switch(e?e.type:e){case Array:case Object:return{reflect:!1,...e};case String:return{reflect:!0,attribute:r(t),converter:{toAttribute:t=>t||null},...e};case Number:return{reflect:!0,attribute:r(t),...e};case Boolean:return{reflect:!0,attribute:r(t),converter:{toAttribute:t=>t?"":null,fromAttribute:t=>"false"!==t&&null!==t},...e};case Date:return{reflect:!1,converter:{fromAttribute:t=>new Date(t)},...e};default:return{...e}}}function l(t,a,l){const f=t.firstUpdated;t.firstUpdated=function(t){if(l&&l.required&&s(this[a])){const t=l.requiredMessage||function(t="warning",i,s){const a=s.toLocaleLowerCase();return`${e(t)}: ${i} is required to use ${a} component. Set the JS Property or HTML Attribute.\n\n`+(o()?`Angular: <${a} [${i}]="..."></${a}>\n`:"")+(u()?`Vue: <${a} :${i}="..."></${a}>\n`:"")+(c()?`React: <${n(a)} ${function(t){return t.startsWith("aria")?r(t):t}(i)}={...} />\n`:"")+`HTML: <${a} ${r(i)}="..."></${a}>\n`+`JavaScript: document.querySelector('${a}').${i} = '...';\n\n`}(l.required,a,this.tagName);if("error"===l.required)throw Error(t);i.warn(t,this)}f&&f.call(this,t)}}function f(r){return(e,n)=>(l(e,n,r),t(a(n,r))(e,n))}function m(e){return(n,i)=>{const o=a(i,e);return o&&(o.reflect=!!(null==e?void 0:e.reflect)&&e.reflect,o.reflect&&!(null==e?void 0:e.attribute)&&(o.attribute="_"+r(i))),t(o)(n,i)}}export{a as getDefaultOptions,f as property,l as requirePropertyCheck,m as state};
|
|
2
2
|
//# sourceMappingURL=property.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.js","sources":["../../../../src/internal/decorators/property.ts"],"sourcesContent":null,"names":["getDefaultOptions","propertyKey","options","type","Array","Object","reflect","String","attribute","camelCaseToKebabCase","converter","toAttribute","value","Number","Boolean","fromAttribute","Date","requirePropertyCheck","protoOrDescriptor","name","targetFirstUpdated","firstUpdated","props","required","isNilOrEmpty","this","message","requiredMessage","level","propertyName","tagName","tag","toLocaleLowerCase","capitalizeFirstLetter","getAngularVersion","getVueVersion","getReactVersion","kebabCaseToPascalCase","getRequiredMessage","Error","LogService","warn","apply","property","_property","state","defaultOptions"],"mappings":"oXAaO,SAASA,EAAkBC,EAAaC,GAE3C,OADaA,EAAUA,EAAQC,KAAOD,GAElC,KAAKE,MAEL,KAAKC,OACD,MAAO,CAAEC,SAAS,KAAUJ,GAChC,KAAKK,OACD,MAAO,CACHD,SAAS,EACTE,UAAWC,EAAqBR,GAChCS,UAAW,CACPC,YAAcC,GAAWA,GAAgB,SAE1CV,GAEX,KAAKW,OACD,MAAO,CAAEP,SAAS,EAAME,UAAWC,EAAqBR,MAAiBC,GAC7E,KAAKY,QACD,MAAO,CACHR,SAAS,EACTE,UAAWC,EAAqBR,GAChCS,UAAW,CAGPC,YAAcC,GAAWA,EAAQ,GAAK,KACtCG,cAAgBH,GAAoB,UAAVA,GAA+B,OAAVA,MAEhDV,GAEX,KAAKc,KACD,MAAO,CAEHV,SAAS,EACTI,UAAW,CACPK,cAAgBH,GAAU,IAAII,KAAKJ,OAEpCV,GAGX,QACI,MAAO,IAAKA,IAGjB,SAASe,EAAqBC,EAAmBC,EAAMjB,GAC1D,MAAMkB,EAAqBF,EAAkBG,aAe7CH,EAAkBG,aAdlB,SAAsBC,GAClB,GAAIpB,GAAWA,EAAQqB,UAAYC,EAAaC,KAAKN,IAAQ,CACzD,MAAMO,EAAUxB,EAAQyB,
|
|
1
|
+
{"version":3,"file":"property.js","sources":["../../../../src/internal/decorators/property.ts"],"sourcesContent":null,"names":["getDefaultOptions","propertyKey","options","type","Array","Object","reflect","String","attribute","camelCaseToKebabCase","converter","toAttribute","value","Number","Boolean","fromAttribute","Date","requirePropertyCheck","protoOrDescriptor","name","targetFirstUpdated","firstUpdated","props","required","isNilOrEmpty","this","message","requiredMessage","level","propertyName","tagName","tag","toLocaleLowerCase","capitalizeFirstLetter","getAngularVersion","getVueVersion","getReactVersion","kebabCaseToPascalCase","startsWith","getReactPropertyName","getRequiredMessage","Error","LogService","warn","apply","property","_property","state","defaultOptions"],"mappings":"oXAaO,SAASA,EAAkBC,EAAaC,GAE3C,OADaA,EAAUA,EAAQC,KAAOD,GAElC,KAAKE,MAEL,KAAKC,OACD,MAAO,CAAEC,SAAS,KAAUJ,GAChC,KAAKK,OACD,MAAO,CACHD,SAAS,EACTE,UAAWC,EAAqBR,GAChCS,UAAW,CACPC,YAAcC,GAAWA,GAAgB,SAE1CV,GAEX,KAAKW,OACD,MAAO,CAAEP,SAAS,EAAME,UAAWC,EAAqBR,MAAiBC,GAC7E,KAAKY,QACD,MAAO,CACHR,SAAS,EACTE,UAAWC,EAAqBR,GAChCS,UAAW,CAGPC,YAAcC,GAAWA,EAAQ,GAAK,KACtCG,cAAgBH,GAAoB,UAAVA,GAA+B,OAAVA,MAEhDV,GAEX,KAAKc,KACD,MAAO,CAEHV,SAAS,EACTI,UAAW,CACPK,cAAgBH,GAAU,IAAII,KAAKJ,OAEpCV,GAGX,QACI,MAAO,IAAKA,IAGjB,SAASe,EAAqBC,EAAmBC,EAAMjB,GAC1D,MAAMkB,EAAqBF,EAAkBG,aAe7CH,EAAkBG,aAdlB,SAAsBC,GAClB,GAAIpB,GAAWA,EAAQqB,UAAYC,EAAaC,KAAKN,IAAQ,CACzD,MAAMO,EAAUxB,EAAQyB,iBA0BpC,SAA4BC,EAAQ,UAAWC,EAAcC,GACzD,MAAMC,EAAMD,EAAQE,oBACpB,MAAQ,GAAGC,EAAsBL,OAAWC,wBAAmCE,2DACxEG,IAAsB,aAAaH,MAAQF,cAAyBE,OAAW,KAC/EI,IAAkB,SAASJ,MAAQF,aAAwBE,OAAW,KACtEK,IAAoB,WAAWC,EAAsBN,MAXhE,SAA8BF,GAC1B,OAAIA,EAAaS,WAAW,QACjB7B,EAAqBoB,GAEzBA,EAO6DU,CAAqBV,gBAA6B,IAClH,UAAaE,KAAOtB,EAAqBoB,cAAyBE,OAClE,uCAA0CA,OAASF,iBAjCJW,CAAmBtC,EAAQqB,SAAUJ,EAAMM,KAAKK,SAC3F,GAAyB,UAArB5B,EAAQqB,SACR,MAAUkB,MAAMf,GAGhBgB,EAAWC,KAAKjB,EAASD,MAG7BL,GACAA,EAAmBwB,KAAMnB,KAAOH,IAoCrC,SAASuB,EAAS3C,GACrB,MAAO,CAACgB,EAAmBC,KACvBF,EAAqBC,EAAmBC,EAAMjB,GACvC4C,EAAU9C,EAAkBmB,EAAMjB,GAAlC4C,CAA4C5B,EAAmBC,IAevE,SAAS4B,EAAM7C,GAClB,MAAO,CAACgB,EAAmBC,KACvB,MAAM6B,EAAiBhD,EAAkBmB,EAAMjB,GAS/C,OARI8C,IACAA,EAAe1C,WAAWJ,MAAAA,OAAyC,EAASA,EAAQI,UAAWJ,EAAQI,QACnG0C,EAAe1C,WAAaJ,MAAAA,OAAyC,EAASA,EAAQM,aAGtFwC,EAAexC,UAAY,IAAIC,EAAqBU,KAGrD2B,EAAUE,EAAVF,CAA0B5B,EAAmBC"}
|
package/internal/utils/global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isBrowser as e}from"./exists.js";import{getAngularVersion as o,getAngularJSVersion as n,getReactVersion as t,getVueVersion as i}from"./framework.js";import{browserFeatures as s}from"./supports.js";import{LogService as r}from"../services/log.service.js";function w(){e()&&(window.CDS=window.CDS||{_version:[],_react:{version:void 0},_supports:s.supports,_isStateProxied:!1,_state:{focusTrapItems:[],i18nRegistry:{},elementRegistry:{},iconRegistry:{},motionRegistry:{}},environment:{production:!1},getDetails:a,logDetails:d},function(){var e;const o="5.6.
|
|
1
|
+
import{isBrowser as e}from"./exists.js";import{getAngularVersion as o,getAngularJSVersion as n,getReactVersion as t,getVueVersion as i}from"./framework.js";import{browserFeatures as s}from"./supports.js";import{LogService as r}from"../services/log.service.js";function w(){e()&&(window.CDS=window.CDS||{_version:[],_react:{version:void 0},_supports:s.supports,_isStateProxied:!1,_state:{focusTrapItems:[],i18nRegistry:{},elementRegistry:{},iconRegistry:{},motionRegistry:{}},environment:{production:!1},getDetails:a,logDetails:d},function(){var e;const o="5.6.2";window.CDS._version.indexOf(o)<0&&(window.CDS._version.push(o),null===(e=document.querySelector("body"))||void 0===e||e.setAttribute("cds-version",window.CDS._version.join(" "))),window.CDS._version.length>1&&r.warn("Running more than one version of Clarity can cause unexpected issues. Please ensure only one version is loaded.")}(),window.CDS._isStateProxied||(window.CDS._isStateProxied=!0,window.CDS._state=new Proxy(window.CDS._state,{set:(e,o,n)=>{const t={key:o,prev:window.CDS._state[o],current:n};return e[o]=n,document.dispatchEvent(new CustomEvent("CDS_STATE_UPDATE",{detail:t})),!0}})))}function a(){return{versions:window.CDS._version,environment:window.CDS.environment,userAgent:navigator.userAgent,supports:window.CDS._supports,angularVersion:o(!1),angularJSVersion:n(!1),reactVersion:t(!1),vueVersion:i(!1),state:{...window.CDS._state,iconRegistry:Object.keys(window.CDS._state.iconRegistry),motionRegistry:Object.keys(window.CDS._state.motionRegistry),focusTrapRegistry:Object.keys(window.CDS._state.focusTrapItems.map((e=>e.focusTrapId)))}}}function d(){r.log(JSON.stringify(a(),null,2))}export{w as setupCDSGlobal};
|
|
2
2
|
//# sourceMappingURL=global.js.map
|