@cds/core 6.1.6 → 6.2.0

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,13 +1,10 @@
1
1
  import { ReactiveController, ReactiveElement } from 'lit';
2
- export declare type AriaPopupTrigger = {
3
- popup: string;
4
- };
5
2
  /**
6
3
  * Provides all nessesary aria-* attributes to create a vaild aria popup trigger.
7
4
  * Used in combination of the `@ariaPopup` controller.
8
5
  */
9
- export declare function ariaPopupTrigger<T extends ReactiveElement & AriaPopupTrigger>(): ClassDecorator;
10
- export declare class AriaPopupTriggerController<T extends ReactiveElement & AriaPopupTrigger> implements ReactiveController {
6
+ export declare function ariaPopupTrigger<T extends ReactiveElement>(): ClassDecorator;
7
+ export declare class AriaPopupTriggerController<T extends ReactiveElement> implements ReactiveController {
11
8
  private host;
12
9
  constructor(host: T);
13
10
  hostConnected(): void;
@@ -1,2 +1,2 @@
1
- function t(){return t=>t.addInitializer((t=>new s(t)))}class s{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){this.host.popup&&(this.host.ariaControls=this.host.popup,this.host.ariaHasPopup="true",this.host.ariaExpanded="false")}}export{s as AriaPopupTriggerController,t as ariaPopupTrigger};
1
+ function t(){return t=>t.addInitializer((t=>new s(t)))}class s{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){(this.host.hasAttribute("aria-controls")||this.host.ariaControls)&&(this.host.ariaHasPopup="true",this.host.ariaExpanded="false")}}export{s as AriaPopupTriggerController,t as ariaPopupTrigger};
2
2
  //# sourceMappingURL=aria-popup-trigger.controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aria-popup-trigger.controller.js","sources":["../../../../src/internal/controllers/aria-popup-trigger.controller.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n/**\n * Provides all nessesary aria-* attributes to create a vaild aria popup trigger.\n * Used in combination of the `@ariaPopup` controller.\n */\nexport function ariaPopupTrigger() {\n return (target) => target.addInitializer((instance) => new AriaPopupTriggerController(instance));\n}\nexport class AriaPopupTriggerController {\n constructor(host) {\n this.host = host;\n this.host.addController(this);\n }\n hostConnected() {\n if (this.host.popup) {\n this.host.ariaControls = this.host.popup;\n this.host.ariaHasPopup = 'true';\n this.host.ariaExpanded = 'false';\n }\n }\n}\n"],"names":["ariaPopupTrigger","target","addInitializer","instance","AriaPopupTriggerController","constructor","host","this","addController","hostConnected","popup","ariaControls","ariaHasPopup","ariaExpanded"],"mappings":"AASO,SAASA,IACZ,OAAQC,GAAWA,EAAOC,gBAAgBC,GAAa,IAAIC,EAA2BD,KAEnF,MAAMC,EACTC,YAAYC,GACRC,KAAKD,KAAOA,EACZC,KAAKD,KAAKE,cAAcD,MAE5BE,gBACQF,KAAKD,KAAKI,QACVH,KAAKD,KAAKK,aAAeJ,KAAKD,KAAKI,MACnCH,KAAKD,KAAKM,aAAe,OACzBL,KAAKD,KAAKO,aAAe"}
1
+ {"version":3,"file":"aria-popup-trigger.controller.js","sources":["../../../../src/internal/controllers/aria-popup-trigger.controller.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n/**\n * Provides all nessesary aria-* attributes to create a vaild aria popup trigger.\n * Used in combination of the `@ariaPopup` controller.\n */\nexport function ariaPopupTrigger() {\n return (target) => target.addInitializer((instance) => new AriaPopupTriggerController(instance));\n}\nexport class AriaPopupTriggerController {\n constructor(host) {\n this.host = host;\n this.host.addController(this);\n }\n hostConnected() {\n if (this.host.hasAttribute('aria-controls') || this.host.ariaControls) {\n this.host.ariaHasPopup = 'true';\n this.host.ariaExpanded = 'false';\n }\n }\n}\n"],"names":["ariaPopupTrigger","target","addInitializer","instance","AriaPopupTriggerController","constructor","host","this","addController","hostConnected","hasAttribute","ariaControls","ariaHasPopup","ariaExpanded"],"mappings":"AASO,SAASA,IACZ,OAAQC,GAAWA,EAAOC,gBAAgBC,GAAa,IAAIC,EAA2BD,KAEnF,MAAMC,EACTC,YAAYC,GACRC,KAAKD,KAAOA,EACZC,KAAKD,KAAKE,cAAcD,MAE5BE,iBACQF,KAAKD,KAAKI,aAAa,kBAAoBH,KAAKD,KAAKK,gBACrDJ,KAAKD,KAAKM,aAAe,OACzBL,KAAKD,KAAKO,aAAe"}
@@ -1,2 +1,2 @@
1
- import{listenForAttributeChange as t}from"../utils/events.js";import{TriggerController as e}from"./trigger.controller.js";function r(){return t=>t.addInitializer((t=>new i(t)))}class i{constructor(t){this.host=t,this.host.addController(this),this.trigger=new e(this.host,{focus:!1})}async hostConnected(){await this.host.updateComplete,this.observer=t(this.host,"hidden",(()=>this.updateTrigger(!this.host.hidden)))}async hostUpdate(){await this.host.updateComplete,this.updateTrigger(!this.host.hidden)}hostDisconnected(){this.updateTrigger(!1),this.observer?.disconnect()}updateTrigger(t){this.trigger.current?.hasAttribute("popup")&&(this.trigger.current.ariaExpanded=""+t),this.trigger.prev?.hasAttribute("popup")&&this.trigger.prev!==this.trigger.current&&(this.trigger.prev.ariaExpanded="false")}}export{i as AriaPopupController,r as ariaPopup};
1
+ import{listenForAttributeChange as t}from"../utils/events.js";import{TriggerController as r}from"./trigger.controller.js";function e(){return t=>t.addInitializer((t=>new i(t)))}class i{constructor(t){this.host=t,this.host.addController(this),this.trigger=new r(this.host,{focus:!1})}async hostConnected(){await this.host.updateComplete,this.observer=t(this.host,"hidden",(()=>this.updateTrigger(!this.host.hidden)))}async hostUpdate(){await this.host.updateComplete,this.updateTrigger(!this.host.hidden)}hostDisconnected(){this.updateTrigger(!1),this.observer?.disconnect()}updateTrigger(t){this.trigger.current?.hasAttribute("aria-controls")&&(this.trigger.current.ariaExpanded=""+t),this.trigger.prev?.hasAttribute("aria-controls")&&this.trigger.prev!==this.trigger.current&&(this.trigger.prev.ariaExpanded="false")}}export{i as AriaPopupController,e as ariaPopup};
2
2
  //# sourceMappingURL=aria-popup.controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aria-popup.controller.js","sources":["../../../../src/internal/controllers/aria-popup.controller.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { listenForAttributeChange } from '../utils/events.js';\nimport { TriggerController } from './trigger.controller.js';\n/**\n * Provides all nessesary aria-* attributes to create a vaild aria popup.\n * Used in combination of the `@ariaPopupTrigger` controller.\n */\nexport function ariaPopup() {\n return (target) => target.addInitializer((instance) => new AriaPopupController(instance));\n}\nexport class AriaPopupController {\n constructor(host) {\n this.host = host;\n this.host.addController(this);\n this.trigger = new TriggerController(this.host, { focus: false });\n }\n async hostConnected() {\n await this.host.updateComplete;\n this.observer = listenForAttributeChange(this.host, 'hidden', () => this.updateTrigger(!this.host.hidden));\n }\n async hostUpdate() {\n await this.host.updateComplete;\n this.updateTrigger(!this.host.hidden);\n }\n hostDisconnected() {\n this.updateTrigger(false);\n this.observer?.disconnect();\n }\n updateTrigger(expanded) {\n if (this.trigger.current?.hasAttribute('popup')) {\n this.trigger.current.ariaExpanded = `${expanded}`;\n }\n if (this.trigger.prev?.hasAttribute('popup') && this.trigger.prev !== this.trigger.current) {\n this.trigger.prev.ariaExpanded = 'false';\n }\n }\n}\n"],"names":["ariaPopup","target","addInitializer","instance","AriaPopupController","constructor","host","this","addController","trigger","TriggerController","focus","async","updateComplete","observer","listenForAttributeChange","updateTrigger","hidden","hostDisconnected","disconnect","expanded","current","hasAttribute","ariaExpanded","prev"],"mappings":"0HAWO,SAASA,IACZ,OAAQC,GAAWA,EAAOC,gBAAgBC,GAAa,IAAIC,EAAoBD,KAE5E,MAAMC,EACTC,YAAYC,GACRC,KAAKD,KAAOA,EACZC,KAAKD,KAAKE,cAAcD,MACxBA,KAAKE,QAAU,IAAIC,EAAkBH,KAAKD,KAAM,CAAEK,OAAO,IAE7DC,4BACUL,KAAKD,KAAKO,eAChBN,KAAKO,SAAWC,EAAyBR,KAAKD,KAAM,UAAU,IAAMC,KAAKS,eAAeT,KAAKD,KAAKW,UAEtGL,yBACUL,KAAKD,KAAKO,eAChBN,KAAKS,eAAeT,KAAKD,KAAKW,QAElCC,mBACIX,KAAKS,eAAc,GACnBT,KAAKO,UAAUK,aAEnBH,cAAcI,GACNb,KAAKE,QAAQY,SAASC,aAAa,WACnCf,KAAKE,QAAQY,QAAQE,aAAe,GAAGH,GAEvCb,KAAKE,QAAQe,MAAMF,aAAa,UAAYf,KAAKE,QAAQe,OAASjB,KAAKE,QAAQY,UAC/Ed,KAAKE,QAAQe,KAAKD,aAAe"}
1
+ {"version":3,"file":"aria-popup.controller.js","sources":["../../../../src/internal/controllers/aria-popup.controller.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { listenForAttributeChange } from '../utils/events.js';\nimport { TriggerController } from './trigger.controller.js';\n/**\n * Provides all nessesary aria-* attributes to create a vaild aria popup.\n * Used in combination of the `@ariaPopupTrigger` controller.\n */\nexport function ariaPopup() {\n return (target) => target.addInitializer((instance) => new AriaPopupController(instance));\n}\nexport class AriaPopupController {\n constructor(host) {\n this.host = host;\n this.host.addController(this);\n this.trigger = new TriggerController(this.host, { focus: false });\n }\n async hostConnected() {\n await this.host.updateComplete;\n this.observer = listenForAttributeChange(this.host, 'hidden', () => this.updateTrigger(!this.host.hidden));\n }\n async hostUpdate() {\n await this.host.updateComplete;\n this.updateTrigger(!this.host.hidden);\n }\n hostDisconnected() {\n this.updateTrigger(false);\n this.observer?.disconnect();\n }\n updateTrigger(expanded) {\n if (this.trigger.current?.hasAttribute('aria-controls')) {\n this.trigger.current.ariaExpanded = `${expanded}`;\n }\n if (this.trigger.prev?.hasAttribute('aria-controls') && this.trigger.prev !== this.trigger.current) {\n this.trigger.prev.ariaExpanded = 'false';\n }\n }\n}\n"],"names":["ariaPopup","target","addInitializer","instance","AriaPopupController","constructor","host","this","addController","trigger","TriggerController","focus","async","updateComplete","observer","listenForAttributeChange","updateTrigger","hidden","hostDisconnected","disconnect","expanded","current","hasAttribute","ariaExpanded","prev"],"mappings":"0HAWO,SAASA,IACZ,OAAQC,GAAWA,EAAOC,gBAAgBC,GAAa,IAAIC,EAAoBD,KAE5E,MAAMC,EACTC,YAAYC,GACRC,KAAKD,KAAOA,EACZC,KAAKD,KAAKE,cAAcD,MACxBA,KAAKE,QAAU,IAAIC,EAAkBH,KAAKD,KAAM,CAAEK,OAAO,IAE7DC,4BACUL,KAAKD,KAAKO,eAChBN,KAAKO,SAAWC,EAAyBR,KAAKD,KAAM,UAAU,IAAMC,KAAKS,eAAeT,KAAKD,KAAKW,UAEtGL,yBACUL,KAAKD,KAAKO,eAChBN,KAAKS,eAAeT,KAAKD,KAAKW,QAElCC,mBACIX,KAAKS,eAAc,GACnBT,KAAKO,UAAUK,aAEnBH,cAAcI,GACNb,KAAKE,QAAQY,SAASC,aAAa,mBACnCf,KAAKE,QAAQY,QAAQE,aAAe,GAAGH,GAEvCb,KAAKE,QAAQe,MAAMF,aAAa,kBAAoBf,KAAKE,QAAQe,OAASjB,KAAKE,QAAQY,UACvFd,KAAKE,QAAQe,KAAKD,aAAe"}
@@ -1,2 +1,2 @@
1
- import{isBrowser as e}from"./environment.js";import{getAngularVersion as n,getAngularJSVersion as o,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:[],layerElements:[],i18nRegistry:{},elementRegistry:{},iconRegistry:{},motionRegistry:{}},environment:{production:!1},getDetails:a,logDetails:d},function(){const e="6.1.6";window.CDS._version.indexOf(e)<0&&(window.CDS._version.push(e),document.querySelector("body")?.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,n,o)=>{const t={key:n,prev:window.CDS._state[n],current:o};return e[n]=o,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:n(!1),angularJSVersion:o(!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};
1
+ import{isBrowser as e}from"./environment.js";import{getAngularVersion as n,getAngularJSVersion as o,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:[],layerElements:[],i18nRegistry:{},elementRegistry:{},iconRegistry:{},motionRegistry:{}},environment:{production:!1},getDetails:a,logDetails:d},function(){const e="6.2.0";window.CDS._version.indexOf(e)<0&&(window.CDS._version.push(e),document.querySelector("body")?.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,n,o)=>{const t={key:n,prev:window.CDS._state[n],current:o};return e[n]=o,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:n(!1),angularJSVersion:o(!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
package/package.json CHANGED
@@ -256,5 +256,5 @@
256
256
  "./tokens/tokens.ios.swift": "./tokens/tokens.ios.swift",
257
257
  "./tokens/tokens.android.xml": "./tokens/tokens.android.xml"
258
258
  },
259
- "version": "6.1.6"
259
+ "version": "6.2.0"
260
260
  }