@cds/core 5.5.7 → 6.0.0-next.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.
- package/accordion/accordion-content.element.scss.js +1 -1
- package/accordion/accordion-header.element.scss.js +1 -1
- package/accordion/accordion-panel.element.js +1 -1
- package/accordion/accordion-panel.element.js.map +1 -1
- package/accordion/accordion-panel.element.scss.js +1 -1
- package/alert/alert-group.element.d.ts +4 -7
- package/alert/alert-group.element.js +1 -1
- package/alert/alert-group.element.js.map +1 -1
- package/alert/alert-group.element.scss.js +1 -1
- package/alert/alert.element.d.ts +2 -2
- package/alert/alert.element.scss.js +1 -1
- package/badge/badge.element.d.ts +1 -1
- package/badge/badge.element.scss.js +1 -1
- package/breadcrumb/breadcrumb.element.d.ts +1 -1
- package/breadcrumb/breadcrumb.element.js +1 -1
- package/breadcrumb/breadcrumb.element.js.map +1 -1
- package/button/button.element.d.ts +1 -1
- package/button/button.element.js +1 -1
- package/button/button.element.js.map +1 -1
- package/button/button.element.scss.js +1 -1
- package/button/icon-button.element.d.ts +1 -1
- package/button/icon-button.element.js +1 -1
- package/button/icon-button.element.js.map +1 -1
- package/button/inline-button.element.scss.js +1 -1
- package/card/card.element.js +1 -1
- package/card/card.element.js.map +1 -1
- package/card/card.element.scss.js +1 -1
- package/checkbox/checkbox.element.scss.js +1 -1
- package/custom-elements.json +31473 -67510
- package/custom-elements.legacy.json +814 -120
- package/divider/divider.element.scss.js +1 -1
- package/dropdown/dropdown.element.d.ts +39 -0
- package/dropdown/dropdown.element.js +2 -0
- package/dropdown/dropdown.element.js.map +1 -0
- package/dropdown/index.d.ts +1 -0
- package/dropdown/index.js +2 -0
- package/{internal/interfaces → dropdown}/index.js.map +0 -0
- package/dropdown/register.d.ts +6 -0
- package/dropdown/register.js +2 -0
- package/dropdown/register.js.map +1 -0
- package/forms/control/control.element.d.ts +6 -4
- package/forms/control/control.element.js +2 -2
- package/forms/control/control.element.js.map +1 -1
- package/forms/control/control.element.scss.js +1 -1
- package/forms/control-action/control-action.element.scss.js +1 -1
- package/forms/control-group/control-group.element.d.ts +3 -2
- package/forms/control-group/control-group.element.js +1 -1
- package/forms/control-group/control-group.element.js.map +1 -1
- package/forms/control-group/control-group.element.scss.js +1 -1
- package/forms/control-inline/control-inline.element.d.ts +1 -0
- package/forms/control-inline/control-inline.element.js +1 -1
- package/forms/control-inline/control-inline.element.js.map +1 -1
- package/forms/control-inline/control-inline.element.scss.js +1 -1
- package/forms/control-label/control-label.element.scss.js +1 -1
- package/forms/control-message/control-message.element.d.ts +1 -1
- package/forms/control-message/control-message.element.scss.js +1 -1
- package/forms/form-group/form-group.element.d.ts +2 -2
- package/forms/form-group/form-group.element.js +1 -1
- package/forms/utils/{index.d.ts → utils.d.ts} +2 -1
- package/forms/utils/utils.js +2 -0
- package/forms/utils/utils.js.map +1 -0
- package/global.css +8 -3
- package/global.min.css +1 -1
- package/icon/icon.element.d.ts +5 -5
- package/icon/icon.element.scss.js +1 -1
- package/icon/utils/icon.classnames.d.ts +1 -0
- package/icon/utils/icon.classnames.js +1 -1
- package/icon/utils/icon.classnames.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.js +1 -1
- package/input/input.element.scss.js +1 -1
- package/internal/base/base.element.scss.js +1 -1
- package/internal/base/button.base.d.ts +3 -2
- package/internal/base/button.base.js +1 -1
- package/internal/base/button.base.js.map +1 -1
- package/internal/base/focus-trap.base.d.ts +9 -11
- package/internal/base/focus-trap.base.js +1 -1
- package/internal/base/focus-trap.base.js.map +1 -1
- package/internal/controllers/aria-popup-trigger.controller.d.ts +6 -0
- package/internal/controllers/aria-popup-trigger.controller.js +2 -0
- package/internal/controllers/aria-popup-trigger.controller.js.map +1 -0
- package/internal/controllers/aria-popup.controller.d.ts +10 -0
- package/internal/controllers/aria-popup.controller.js +2 -0
- package/internal/controllers/aria-popup.controller.js.map +1 -0
- package/internal/controllers/closable.controller.d.ts +29 -0
- package/internal/controllers/closable.controller.js +2 -0
- package/internal/controllers/closable.controller.js.map +1 -0
- package/internal/controllers/first-focus.controller.d.ts +13 -0
- package/internal/controllers/first-focus.controller.js +2 -0
- package/internal/controllers/first-focus.controller.js.map +1 -0
- package/internal/controllers/inline-focus-trap.controller.d.ts +16 -0
- package/internal/controllers/inline-focus-trap.controller.js +2 -0
- package/internal/controllers/inline-focus-trap.controller.js.map +1 -0
- package/internal/controllers/utils/first-focus.controller.utils.d.ts +3 -0
- package/internal/controllers/utils/first-focus.controller.utils.js +2 -0
- package/internal/controllers/utils/first-focus.controller.utils.js.map +1 -0
- package/internal/decorators/animate.js.map +1 -1
- package/internal/decorators/element.d.ts +1 -1
- package/internal/decorators/element.js +2 -0
- package/internal/decorators/element.js.map +1 -0
- package/internal/decorators/id.d.ts +1 -1
- package/internal/decorators/query-slot.d.ts +2 -2
- package/internal/index.d.ts +17 -2
- package/internal/index.js +1 -1
- package/internal/index.js.map +1 -1
- package/internal/interfaces/{index.d.ts → interfaces.d.ts} +0 -0
- package/internal/interfaces/interfaces.js +2 -0
- package/internal/interfaces/interfaces.js.map +1 -0
- package/internal/motion/animations/cds-dropdown-open.d.ts +3 -0
- package/internal/motion/animations/cds-dropdown-open.js +2 -0
- package/internal/motion/animations/cds-dropdown-open.js.map +1 -0
- package/internal/motion/animations/cds-modal-enter.js +1 -1
- package/internal/motion/animations/cds-modal-enter.js.map +1 -1
- package/internal/motion/interfaces.d.ts +1 -1
- package/internal/motion/utils.d.ts +3 -3
- package/internal/motion/utils.js +1 -1
- package/internal/motion/utils.js.map +1 -1
- package/internal/positioning/interfaces.d.ts +61 -0
- package/internal/positioning/interfaces.js +2 -0
- package/internal/positioning/interfaces.js.map +1 -0
- package/internal/positioning/utils.d.ts +26 -0
- package/internal/positioning/utils.js +2 -0
- package/internal/positioning/utils.js.map +1 -0
- package/internal/services/focus-trap-tracker.service.d.ts +3 -0
- package/internal/services/focus-trap-tracker.service.js +1 -1
- package/internal/services/focus-trap-tracker.service.js.map +1 -1
- package/internal/services/global.service.d.ts +1 -1
- package/internal/services/i18n.service.d.ts +28 -0
- package/internal/services/i18n.service.js +1 -1
- package/internal/services/i18n.service.js.map +1 -1
- package/internal/utils/array.d.ts +7 -4
- package/internal/utils/array.js +1 -1
- package/internal/utils/array.js.map +1 -1
- package/internal/utils/color.d.ts +2 -0
- package/internal/utils/color.js +2 -0
- package/internal/utils/color.js.map +1 -0
- package/internal/utils/conditional.d.ts +4 -1
- package/internal/utils/conditional.js +1 -1
- package/internal/utils/conditional.js.map +1 -1
- package/internal/utils/css.d.ts +2 -0
- package/internal/utils/css.js +1 -1
- package/internal/utils/css.js.map +1 -1
- package/internal/utils/dom.d.ts +17 -2
- package/internal/utils/dom.js +1 -1
- package/internal/utils/dom.js.map +1 -1
- package/internal/utils/enum.d.ts +1 -0
- package/internal/utils/enum.js +2 -0
- package/internal/utils/enum.js.map +1 -0
- package/internal/utils/events.d.ts +4 -0
- package/internal/utils/events.js +1 -1
- package/internal/utils/events.js.map +1 -1
- package/internal/utils/exists.d.ts +1 -3
- package/internal/utils/exists.js.map +1 -1
- package/internal/utils/focus-trap.d.ts +30 -1
- package/internal/utils/focus-trap.js +1 -1
- package/internal/utils/focus-trap.js.map +1 -1
- package/internal/utils/global.d.ts +3 -3
- package/internal/utils/global.js +1 -1
- package/internal/utils/global.js.map +1 -1
- package/internal/utils/identity.d.ts +28 -1
- package/internal/utils/identity.js +1 -1
- package/internal/utils/identity.js.map +1 -1
- package/internal/utils/math.d.ts +3 -0
- package/internal/utils/math.js +2 -0
- package/internal/utils/math.js.map +1 -0
- package/internal/utils/{register.d.ts → registration.d.ts} +0 -0
- package/internal/utils/registration.js +2 -0
- package/internal/utils/registration.js.map +1 -0
- package/internal/utils/string.d.ts +6 -0
- package/internal/utils/string.js +1 -1
- package/internal/utils/string.js.map +1 -1
- package/internal/utils/traversal.d.ts +4 -0
- package/internal/utils/traversal.js +2 -0
- package/internal/utils/traversal.js.map +1 -0
- package/internal-components/close-button/close-button.element.d.ts +1 -3
- package/internal-components/close-button/close-button.element.js +1 -1
- package/internal-components/close-button/close-button.element.js.map +1 -1
- package/internal-components/close-button/close-button.element.scss.js +1 -1
- package/internal-components/close-button/index.js +1 -1
- package/internal-components/overlay/index.js +1 -1
- package/internal-components/overlay/overlay.element.d.ts +35 -25
- package/internal-components/overlay/overlay.element.js +1 -1
- package/internal-components/overlay/overlay.element.js.map +1 -1
- package/internal-components/overlay/overlay.element.scss.js +1 -1
- package/internal-components/overlay/shared.element.scss.js +2 -0
- package/internal-components/overlay/shared.element.scss.js.map +1 -0
- package/internal-components/panel/panel.element.scss.js +1 -1
- package/internal-components/popup/index.d.ts +2 -0
- package/internal-components/popup/index.js +2 -0
- package/internal-components/popup/index.js.map +1 -0
- package/internal-components/popup/pointer.element.d.ts +35 -0
- package/internal-components/popup/pointer.element.js +2 -0
- package/internal-components/popup/pointer.element.js.map +1 -0
- package/internal-components/popup/pointer.element.scss.js +2 -0
- package/internal-components/popup/pointer.element.scss.js.map +1 -0
- package/internal-components/popup/popup.element.d.ts +116 -0
- package/internal-components/popup/popup.element.js +2 -0
- package/internal-components/popup/popup.element.js.map +1 -0
- package/internal-components/popup/popup.element.scss.js +2 -0
- package/internal-components/popup/popup.element.scss.js.map +1 -0
- package/internal-components/popup/register.d.ts +9 -0
- package/internal-components/popup/register.js +2 -0
- package/internal-components/popup/register.js.map +1 -0
- package/internal-components/popup/utils/pointer.utils.d.ts +2 -0
- package/internal-components/popup/utils/pointer.utils.js +2 -0
- package/internal-components/popup/utils/pointer.utils.js.map +1 -0
- package/internal-components/visual-checkbox/visual-checkbox.element.scss.js +1 -1
- package/modal/modal-content.element.d.ts +2 -5
- package/modal/modal-content.element.js +1 -1
- package/modal/modal-content.element.js.map +1 -1
- package/modal/modal.element.d.ts +13 -3
- package/modal/modal.element.js +1 -1
- package/modal/modal.element.js.map +1 -1
- package/modal/modal.element.scss.js +1 -1
- package/navigation/navigation-group.element.scss.js +1 -1
- package/navigation/navigation-item.element.d.ts +1 -1
- package/navigation/navigation-item.element.js +1 -1
- package/navigation/navigation-item.element.js.map +1 -1
- package/navigation/navigation-item.element.scss.js +2 -2
- package/navigation/navigation-start.element.d.ts +1 -2
- package/navigation/navigation-start.element.js +1 -1
- package/navigation/navigation-start.element.js.map +1 -1
- package/navigation/navigation.element.d.ts +5 -9
- package/navigation/navigation.element.js +1 -3
- package/navigation/navigation.element.js.map +1 -1
- package/navigation/navigation.element.scss.js +1 -1
- package/navigation/utils/{index.d.ts → utils.d.ts} +0 -0
- package/navigation/utils/{index.js → utils.js} +1 -1
- package/navigation/utils/{index.js.map → utils.js.map} +1 -1
- package/package.json +101 -80
- package/pagination/pagination-button.element.scss.js +1 -1
- package/password/password.element.d.ts +0 -1
- package/password/password.element.js +1 -1
- package/password/password.element.js.map +1 -1
- package/polyfills/aria-reflect.d.ts +45 -0
- package/polyfills/aria-reflect.js +2 -0
- package/polyfills/aria-reflect.js.map +1 -0
- package/polyfills/index.d.ts +1 -0
- package/{internal/interfaces → polyfills}/index.js +1 -1
- package/polyfills/index.js.map +1 -0
- package/progress-circle/progress-circle.element.d.ts +26 -3
- package/progress-circle/progress-circle.element.js +1 -1
- package/progress-circle/progress-circle.element.js.map +1 -1
- package/progress-circle/progress-circle.element.scss.js +1 -1
- package/progress-circle/progress-circle.utils.d.ts +6 -0
- package/progress-circle/progress-circle.utils.js +2 -0
- package/progress-circle/progress-circle.utils.js.map +1 -0
- package/radio/radio-group.element.js +1 -1
- package/radio/radio-group.element.js.map +1 -1
- package/radio/radio.element.scss.js +1 -1
- package/range/range.global.scss.js +1 -1
- package/select/register.js +1 -1
- package/select/register.js.map +1 -1
- package/select/select.element.d.ts +1 -1
- package/select/select.element.js +1 -1
- package/select/select.element.js.map +1 -1
- package/select/select.element.scss.js +1 -1
- package/select/select.global.scss.js +1 -1
- package/selection-panels/checkbox/checkbox-panel.element.d.ts +35 -0
- package/selection-panels/checkbox/checkbox-panel.element.js +2 -0
- package/selection-panels/checkbox/checkbox-panel.element.js.map +1 -0
- package/selection-panels/checkbox/index.d.ts +1 -0
- package/selection-panels/checkbox/index.js +2 -0
- package/selection-panels/checkbox/index.js.map +1 -0
- package/selection-panels/checkbox/register.d.ts +6 -0
- package/selection-panels/checkbox/register.js +2 -0
- package/selection-panels/checkbox/register.js.map +1 -0
- package/selection-panels/radio/index.d.ts +1 -0
- package/selection-panels/radio/index.js +2 -0
- package/selection-panels/radio/index.js.map +1 -0
- package/selection-panels/radio/radio-panel.element.d.ts +35 -0
- package/selection-panels/radio/radio-panel.element.js +2 -0
- package/selection-panels/radio/radio-panel.element.js.map +1 -0
- package/selection-panels/radio/register.d.ts +6 -0
- package/selection-panels/radio/register.js +2 -0
- package/selection-panels/radio/register.js.map +1 -0
- package/selection-panels/shared/selection-panel.element.scss.js +6 -0
- package/selection-panels/shared/selection-panel.element.scss.js.map +1 -0
- package/selection-panels/shared/selection-panel.interfaces.d.ts +1 -0
- package/styles/module.tokens.css +8 -3
- package/styles/module.tokens.min.css +1 -1
- package/styles/theme.dark.css +7 -8
- package/styles/theme.dark.min.css +1 -1
- package/tag/tag.element.d.ts +1 -1
- package/tag/tag.element.scss.js +1 -1
- package/test/index.js +1 -1
- package/test/utils.d.ts +2 -0
- package/test/utils.js +1 -1
- package/test/utils.js.map +1 -1
- package/textarea/textarea.element.scss.js +1 -1
- package/toggle/toggle.element.scss.js +1 -1
- package/tokens/tokens.android.xml +8 -3
- package/tokens/tokens.d.ts +5 -0
- package/tokens/tokens.ios.swift +8 -3
- package/tokens/tokens.js +5 -0
- package/tokens/tokens.json +23 -3
- package/tokens/tokens.scss +5 -0
- package/tree-view/tree-item.element.d.ts +1 -5
- package/tree-view/tree-item.element.js +1 -1
- package/tree-view/tree-item.element.js.map +1 -1
- package/tree-view/tree-item.element.scss.js +1 -1
- package/tree-view/tree.element.d.ts +0 -4
- package/tree-view/tree.element.js +1 -1
- package/tree-view/tree.element.js.map +1 -1
- package/_virtual/_virtual_library-entry-points +0 -2
- package/_virtual/_virtual_library-entry-points.map +0 -1
- package/accordion/accordion-content.element.css.d.ts +0 -1
- package/accordion/accordion-header.element.css.d.ts +0 -1
- package/accordion/accordion-panel.element.css.d.ts +0 -1
- package/accordion/accordion.element.css.d.ts +0 -1
- package/alert/alert-actions.element.css.d.ts +0 -1
- package/alert/alert-group.element.css.d.ts +0 -1
- package/alert/alert.element.css.d.ts +0 -1
- package/badge/badge.element.css.d.ts +0 -1
- package/button/base-button.element.css.d.ts +0 -1
- package/button/base-button.element.scss.js +0 -2
- package/button/base-button.element.scss.js.map +0 -1
- package/button/button.element.css.d.ts +0 -1
- package/button/icon-button.element.css.d.ts +0 -1
- package/button/inline-button.element.css.d.ts +0 -1
- package/checkbox/checkbox.element.css.d.ts +0 -1
- package/datalist/datalist-global.element.css.d.ts +0 -1
- package/date/date.global.css.d.ts +0 -1
- package/divider/divider.element.css.d.ts +0 -1
- package/file/file.element.css.d.ts +0 -1
- package/forms/control/control.element.css.d.ts +0 -1
- package/forms/control-action/control-action.element.css.d.ts +0 -1
- package/forms/control-group/control-group.element.css.d.ts +0 -1
- package/forms/control-inline/control-inline.element.css.d.ts +0 -1
- package/forms/control-label/control-label.element.css.d.ts +0 -1
- package/forms/control-message/control-message.element.css.d.ts +0 -1
- package/forms/form-group/form-group.element.css.d.ts +0 -1
- package/forms/utils/index.js +0 -2
- package/forms/utils/index.js.map +0 -1
- package/icon/icon.element.css.d.ts +0 -1
- package/input/input-group.element.css.d.ts +0 -1
- package/input/input.element.css.d.ts +0 -1
- package/internal/base/base.element.css.d.ts +0 -1
- package/internal/base/css-gap.base.d.ts +0 -18
- package/internal/base/css-gap.base.js +0 -2
- package/internal/base/css-gap.base.js.map +0 -1
- package/internal/utils/register.js +0 -2
- package/internal/utils/register.js.map +0 -1
- package/internal-components/close-button/close-button.element.css.d.ts +0 -1
- package/internal-components/overlay/overlay.element.css.d.ts +0 -1
- package/modal/modal.element.css.d.ts +0 -1
- package/navigation/navigation-start.element.scss.js +0 -6
- package/navigation/navigation-start.element.scss.js.map +0 -1
- package/progress-circle/progress-circle.element.css.d.ts +0 -1
- package/radio/radio.element.css.d.ts +0 -1
- package/range/range.element.css.d.ts +0 -1
- package/range/range.global.css.d.ts +0 -1
- package/search/search.global.css.d.ts +0 -1
- package/select/select.element.css.d.ts +0 -1
- package/select/select.global.css.d.ts +0 -1
- package/styles/module.shims.css +0 -896
- package/styles/module.shims.min.css +0 -1
- package/tag/tag.element.css.d.ts +0 -1
- package/test-dropdown/test-dropdown.element.css.d.ts +0 -1
- package/textarea/textarea.element.css.d.ts +0 -1
- package/time/time.global.css.d.ts +0 -1
- package/toggle/toggle.element.css.d.ts +0 -1
|
@@ -8,7 +8,7 @@ interface ClassElement {
|
|
|
8
8
|
kind: 'field' | 'method';
|
|
9
9
|
key: PropertyKey;
|
|
10
10
|
placement: 'static' | 'prototype' | 'own';
|
|
11
|
-
initializer?:
|
|
11
|
+
initializer?: (...args: any[]) => any;
|
|
12
12
|
extras?: ClassElement[];
|
|
13
13
|
finisher?: <T>(classDef: Constructor<T>) => undefined | Constructor<T>;
|
|
14
14
|
descriptor?: PropertyDescriptor;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{registerElementSafely as t}from"../utils/registration.js";const e=e=>n=>"function"==typeof n?((e,n)=>(t(e,n),n))(e,n):((e,n)=>{const{kind:i,elements:o}=n;return{kind:i,elements:o,finisher(n){t(e,n)}}})(e,n);export{e as customElement};
|
|
2
|
+
//# sourceMappingURL=element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.js","sources":["../../../../src/internal/decorators/element.ts"],"sourcesContent":null,"names":["customElement","tagName","classOrDescriptor","classDef","registerElementSafely","legacyCustomElement","descriptor","kind","elements","[object Object]","standardCustomElement"],"mappings":"iEAqBA,MAeaA,EAAiBC,GAAaC,GACH,mBAAtBA,EALU,EAACD,EAASE,KAClCC,EAAsBH,EAASE,GACxBA,GAIDE,CAAoBJ,EAASC,GAjBT,EAACD,EAASK,KACpC,MAAMC,KAAEA,EAAIC,SAAEA,GAAaF,EAC3B,MAAO,CACHC,KAAAA,EACAC,SAAAA,EACAC,SAASN,GACLC,EAAsBH,EAASE,MAYjCO,CAAsBT,EAASC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function id(): (protoOrDescriptor:
|
|
1
|
+
export declare function id(): (protoOrDescriptor: Record<string, unknown> | any, name?: PropertyKey | undefined) => any;
|
|
@@ -11,11 +11,11 @@ export interface QuerySlotConfig {
|
|
|
11
11
|
*
|
|
12
12
|
* @ExportDecoratedItems
|
|
13
13
|
*/
|
|
14
|
-
export declare function querySlot(selector: string, config?: QuerySlotConfig): (protoOrDescriptor:
|
|
14
|
+
export declare function querySlot(selector: string, config?: QuerySlotConfig): (protoOrDescriptor: Record<string, unknown> | any, name?: PropertyKey | undefined) => any;
|
|
15
15
|
/**
|
|
16
16
|
* A property decorator that converts a class property into a getter
|
|
17
17
|
* that executes a querySelectorAll on the element's light DOM Slot.
|
|
18
18
|
*
|
|
19
19
|
* @ExportDecoratedItems
|
|
20
20
|
*/
|
|
21
|
-
export declare function querySlotAll(selector: string, config?: QuerySlotConfig): (protoOrDescriptor:
|
|
21
|
+
export declare function querySlotAll(selector: string, config?: QuerySlotConfig): (protoOrDescriptor: Record<string, unknown> | any, name?: PropertyKey | undefined) => any;
|
package/internal/index.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
import '@cds/core/polyfills';
|
|
2
|
+
/** @internal private module to Clarity Core */
|
|
1
3
|
export declare const baseStyles: import("lit").CSSResultGroup;
|
|
2
4
|
export * from './base/button.base.js';
|
|
3
5
|
export * from './base/focus-trap.base.js';
|
|
6
|
+
export * from './utils/color.js';
|
|
7
|
+
export * from './controllers/aria-popup-trigger.controller.js';
|
|
8
|
+
export * from './controllers/aria-popup.controller.js';
|
|
9
|
+
export * from './controllers/closable.controller.js';
|
|
10
|
+
export * from './controllers/first-focus.controller.js';
|
|
11
|
+
export * from './controllers/inline-focus-trap.controller.js';
|
|
4
12
|
export * from './utils/css.js';
|
|
5
13
|
export * from './utils/dom.js';
|
|
6
|
-
export * from './utils/
|
|
14
|
+
export * from './utils/registration.js';
|
|
7
15
|
export * from './decorators/animate.js';
|
|
8
16
|
export * from './decorators/query-slot.js';
|
|
9
17
|
export * from './decorators/property.js';
|
|
18
|
+
export * from './decorators/element.js';
|
|
10
19
|
export * from './decorators/event.js';
|
|
11
20
|
export * from './directives/spread-props.js';
|
|
12
21
|
export * from './decorators/id.js';
|
|
@@ -21,13 +30,17 @@ export * from './utils/a11y.js';
|
|
|
21
30
|
export * from './utils/array.js';
|
|
22
31
|
export * from './services/keycodes.service.js';
|
|
23
32
|
export * from './utils/conditional.js';
|
|
33
|
+
export * from './utils/enum.js';
|
|
24
34
|
export * from './utils/exists.js';
|
|
25
35
|
export * from './utils/focus-trap.js';
|
|
26
36
|
export * from './utils/framework.js';
|
|
27
37
|
export * from './i18n/utils.js';
|
|
38
|
+
export * from './positioning/utils.js';
|
|
39
|
+
export * from './positioning/interfaces.js';
|
|
28
40
|
export * from './utils/identity.js';
|
|
29
41
|
export * from './utils/keycodes.js';
|
|
30
42
|
export * from './utils/lit.js';
|
|
43
|
+
export * from './utils/math.js';
|
|
31
44
|
export * from './utils/metadata.js';
|
|
32
45
|
export * from './utils/responsive.js';
|
|
33
46
|
export * from './utils/size.js';
|
|
@@ -35,7 +48,8 @@ export * from './utils/string.js';
|
|
|
35
48
|
export * from './utils/supports.js';
|
|
36
49
|
export * from './utils/events.js';
|
|
37
50
|
export * from './utils/event-subject.js';
|
|
38
|
-
export * from './
|
|
51
|
+
export * from './utils/traversal.js';
|
|
52
|
+
export * from './interfaces/interfaces.js';
|
|
39
53
|
export * from './motion/interfaces.js';
|
|
40
54
|
export * from './motion/motion.service.js';
|
|
41
55
|
export * from './motion/utils.js';
|
|
@@ -46,3 +60,4 @@ export { AnimationShakeConfig, AnimationShakeName } from './motion/animations/cd
|
|
|
46
60
|
export { AnimationNavigationGroupOpenConfig, AnimationNavigationGroupOpenName, } from './motion/animations/cds-navigation-group-open.js';
|
|
47
61
|
export { AnimationNavigationOpenConfig, AnimationNavigationOpenName } from './motion/animations/cds-navigation-open.js';
|
|
48
62
|
export { AnimationTreeItemExpandConfig, AnimationTreeItemExpandName, } from './motion/animations/cds-tree-item-expand.js';
|
|
63
|
+
export { AnimationResponsivePopupEnterConfig, AnimationResponsivePopupEnterName, } from './motion/animations/cds-dropdown-open.js';
|
package/internal/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"./base/base.element.scss.js";export{CdsBaseButton}from"./base/button.base.js";export{CdsBaseFocusTrap}from"./base/focus-trap.base.js";export{addClassnames,getCssPropertyValue,hasClassnames,isCssPropertyName,pxToRem,removeClassnames,removeClassnamesUnless,updateElementStyles}from"./utils/css.js";export{addAttributeValue,assignSlotNames,getElementWidth,getElementWidthUnless,hasAttributeAndIsNotEmpty,isFocusable,isHTMLElement,isVisible,
|
|
1
|
+
import"@cds/core/polyfills";import e from"./base/base.element.scss.js";export{CdsBaseButton}from"./base/button.base.js";export{CdsBaseFocusTrap}from"./base/focus-trap.base.js";export{hslToRgb,rgbToHex}from"./utils/color.js";export{AriaPopupTriggerController}from"./controllers/aria-popup-trigger.controller.js";export{AriaPopupController}from"./controllers/aria-popup.controller.js";export{ClosableController}from"./controllers/closable.controller.js";export{FirstFocusController}from"./controllers/first-focus.controller.js";export{InlineFocusTrapController}from"./controllers/inline-focus-trap.controller.js";export{addClassnames,getCssPropertyValue,hasClassnames,isCssPropertyName,pxToRem,removeClassnames,removeClassnamesUnless,setCssPropertyValue,unsetElementStyles,updateElementStyles}from"./utils/css.js";export{addAttributeValue,assignSlotNames,createFragment,focusableSelectors,getElementWidth,getElementWidthUnless,getShadowRootOrElse,getWindowDimensions,hasAttributeAndIsNotEmpty,isFocusable,isHTMLElement,isScrollable,isVisible,makeFocusable,queryAllFocusable,queryChildFromLightOrShadowDom,removeAttributeValue,removeAttributes,setAttributes,setOrRemoveAttribute,spanWrapper,tabFlowSelectors,windowIsAboveMobileBreakpoint}from"./utils/dom.js";export{registerElementSafely}from"./utils/registration.js";export{animate}from"./decorators/animate.js";export{querySlot,querySlotAll}from"./decorators/query-slot.js";export{getDefaultOptions,property,requirePropertyCheck,state}from"./decorators/property.js";export{customElement}from"./decorators/element.js";export{EventEmitter,event}from"./decorators/event.js";export{SpreadProps,spreadProps}from"./directives/spread-props.js";export{id}from"./decorators/id.js";export{i18n}from"./decorators/i18n.js";export{globalStyle}from"./decorators/global-style.js";export{CDS_FOCUS_TRAP_DOCUMENT_ATTR,FocusTrapTrackerService}from"./services/focus-trap-tracker.service.js";export{GlobalStateService}from"./services/global.service.js";export{I18nService,componentStringsDefault}from"./services/i18n.service.js";export{LogService,notProductionEnvironment}from"./services/log.service.js";export{sleep}from"./utils/async.js";export{describeElementByElements,hasAriaLabelTypeAttr}from"./utils/a11y.js";export{arrayHead,arrayRemoveAllInstances,arrayRemoveFirstInstance,arrayRemoveLastInstance,arrayTail,arrayToObject,nextInArray,previousInArray}from"./utils/array.js";export{KeyCodeService,getKeycodeFromRegistry}from"./services/keycodes.service.js";export{anyPassOrAnyFail,returnOrFallthrough}from"./utils/conditional.js";export{getEnumValueFromStringKey}from"./utils/enum.js";export{elementExists,existsIn,existsInWindow,isBrowser}from"./utils/exists.js";export{FocusTrap,addReboundElementsToFocusTrapElement,castHtmlElementToFocusTrapElement,createFocusTrapReboundElement,elementIsOutsideFocusTrapElement,refocusIfOutsideFocusTrapElement,removeReboundElementsFromFocusTrapElement,reorderCloseButtonSlot,whichReboundElement}from"./utils/focus-trap.js";export{getAngularJSVersion,getAngularVersion,getReactVersion,getVueVersion,isStorybook}from"./utils/framework.js";export{getElementLanguageDirection}from"./i18n/utils.js";export{checkNextPosition,getBestPositionForPreferences,getCrossAxisOrderOfPreference,getCrossAxisPosition,getMainAxisPosition,getMainAxisPositionOrViolation,getNextDefaultPosition,getNextPosition,getOrientationTuple,getPointerAlignment,getPointerPosition,getPopupOffsetOrDefaultOffsets,getPopupPosition,getPositionConfig,getPositionOrViolationFromCrossAxis,getPositions,setPopupPosition,testCrossAxisPosition,testMainAxisPosition}from"./positioning/utils.js";export{Positions}from"./positioning/interfaces.js";export{allAre,allAreDefined,allPropertiesPass,anyOrAllPropertiesPass,anyPropertiesPass,convertAttributeStringValuesToValue,convertStringPropValuePairsToTuple,createId,deepClone,doesPropertyPass,getEnumValues,hasPropertyChanged,hasStringPropertyChanged,hasStringPropertyChangedAndNotNil,isMap,isNil,isNilOrEmpty,isNumericString,isObject,isObjectAndNotNilOrEmpty,isString,isStringAndNotNilOrEmpty,isStringOrNil}from"./utils/identity.js";export{getModifierKeysFromKeyCombo,keyWasEvented,onAnyKey,onKey,onKeyCombo,removeModifierKeysFromKeyCombo}from"./utils/keycodes.js";export{childrenUpdateComplete,syncDefinedProps,syncProps,syncPropsForAllItems}from"./utils/lit.js";export{compareSumTo,getMillisecondsFromSeconds,sumAndSubtract}from"./utils/math.js";export{getElementStorybookArgTypes,getElementStorybookArgs}from"./utils/metadata.js";export{elementResize,elementVisible,updateComponentLayout}from"./utils/responsive.js";export{isTshirtSize,updateEquilateralSizeStyles}from"./utils/size.js";export{camelCaseToKebabCase,capitalizeFirstLetter,convertStringPropertyToObjectConfig,cssGroup,getNumericValueFromCssSecondsStyleValue,isPrefixedBy,isPrefixedOrSuffixedBy,isSuffixedBy,kebabCaseToCamelCase,kebabCaseToPascalCase,pluckPixelValue,pluckValueFromStringUnit,propertiesGroup,removePrefix,removePrefixOrSuffix,removeSuffix,replaceWord,setPropStyles,setStyles,transformSpacedStringToArray,transformToSpacedString,transformToString,transformToUnspacedString,trimExtraWhitespace}from"./utils/string.js";export{browserFeatures}from"./utils/supports.js";export{getElementUpdates,listenForAttributeChange,listenForAttributeListChange,onChildListMutation,onFirstInteraction,stopEvent}from"./utils/events.js";export{EventSubject}from"./utils/event-subject.js";export{getChildren,getFlattenedDOMTree,getFlattenedFocusableItems,getFocusableItems}from"./utils/traversal.js";import"./interfaces/interfaces.js";export{AnimationStatus,CLARITY_MOTION_ENTER_LEAVE_PROPERTY,CLARITY_MOTION_FALLBACK_DURATION_IN_MS,CLARITY_MOTION_FALLBACK_EASING,CLARITY_MOTION_REVERSE_ANIMATION_LABEL,CLARITY_MOTION_REVERSE_ANIMATION_SUFFIX,PRIVATE_ANIMATION_STATUS_ATTR_NAME}from"./motion/interfaces.js";export{ClarityMotion}from"./motion/motion.service.js";export{animationIsReversed,extractAnimationNameIfReversed,filterAnimationsByUpdatedProperties,flattenAndSortAnimations,getAnimationConfigForPropertyValue,getAnimationFromOverrideOrDecorator,getAnimationKeyframesOrPropertyIndexedFrames,getAnimationPromiseInstructions,getAnimationTarget,getHidingAndNonHidingPropertyAnimations,getInlineOverride,getPropertyAnimations,resolveAnimationEndStatus,reverseAnimation,reverseAnimationConfig,runPropertyAnimations,setAnimationConfigOptions,setAnimationDuration,setAnimationEasing,setAnimationProperty,setAnimationStartStatus,sizeDimensionKeyframes,zeroOutAnimationConfig}from"./motion/utils.js";export{AnimationModalEnterConfig,AnimationModalEnterName}from"./motion/animations/cds-modal-enter.js";export{AnimationAccordionPanelOpenConfig,AnimationAccordionPanelOpenName}from"./motion/animations/cds-accordion-panel-open.js";export{AnimationHingeConfig,AnimationHingeName}from"./motion/animations/cds-overlay-hinge-example.js";export{AnimationShakeConfig,AnimationShakeName}from"./motion/animations/cds-component-shake.js";export{AnimationNavigationGroupOpenConfig,AnimationNavigationGroupOpenName}from"./motion/animations/cds-navigation-group-open.js";export{AnimationNavigationOpenConfig,AnimationNavigationOpenName}from"./motion/animations/cds-navigation-open.js";export{AnimationTreeItemExpandConfig,AnimationTreeItemExpandName}from"./motion/animations/cds-tree-item-expand.js";export{AnimationResponsivePopupEnterConfig,AnimationResponsivePopupEnterName}from"./motion/animations/cds-dropdown-open.js";import"ramda/es/includes.js";import"ramda/es/without.js";import"ramda/es/is.js";import"ramda/es/isEmpty.js";import"ramda/es/clone.js";import"lit/decorators/property.js";const o=e;export{o as baseStyles};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/internal/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/internal/index.ts"],"sourcesContent":null,"names":["baseStyles","styles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/internal/index.ts"],"sourcesContent":null,"names":["baseStyles","styles"],"mappings":"87OAQY,MAACA,EAAaC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sources":[],"sourcesContent":null,"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{fadeInKeyframes as a}from"./keyframes/fade-in.js";const i="cds-responsive-popup-enter",o=[{target:".overlay-backdrop",onlyIf:"isLayered:false responsive:true",animation:a,options:{duration:"--animation-duration",easing:"--animation-easing",fill:"forwards"}},{target:".private-host",onlyIf:"responsive:true",animation:[{opacity:0},{opacity:0,marginBottom:"-100%",offset:.001},{opacity:1,marginBottom:"0"}],options:{duration:"--animation-duration",easing:"--animation-easing",fill:"forwards"}},{target:".private-host",onlyIf:"responsive:false",animation:[{opacity:0},{opacity:1}],options:{duration:0,easing:"--animation-easing",fill:"forwards"}}];export{o as AnimationResponsivePopupEnterConfig,i as AnimationResponsivePopupEnterName};
|
|
2
|
+
//# sourceMappingURL=cds-dropdown-open.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cds-dropdown-open.js","sources":["../../../../../src/internal/motion/animations/cds-dropdown-open.ts"],"sourcesContent":null,"names":["AnimationResponsivePopupEnterName","AnimationResponsivePopupEnterConfig","target","onlyIf","animation","fadeInKeyframes","options","duration","easing","fill","opacity","marginBottom","offset"],"mappings":"yDAMY,MAACA,EAAoC,6BACpCC,EAAsC,CAC/C,CACIC,OAAQ,oBACRC,OAAQ,kCACRC,UAAWC,EACXC,QAAS,CACLC,SAAU,uBACVC,OAAQ,qBACRC,KAAM,aAGd,CACIP,OAAQ,gBACRC,OAAQ,kBACRC,UAAW,CAEP,CAAEM,QAAS,GACX,CAAEA,QAAS,EAAGC,aAAc,QAASC,OAAQ,MAC7C,CAAEF,QAAS,EAAGC,aAAc,MAEhCL,QAAS,CACLC,SAAU,uBACVC,OAAQ,qBACRC,KAAM,aAGd,CACIP,OAAQ,gBACRC,OAAQ,mBACRC,UAAW,CAAC,CAAEM,QAAS,GAAK,CAAEA,QAAS,IACvCJ,QAAS,CACLC,SAAU,EACVC,OAAQ,qBACRC,KAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{fadeInKeyframes as a}from"./keyframes/fade-in.js";import{fadeAndSlideInKeyframes as i}from"./keyframes/fade-in-and-slide-down.js";const n="cds-modal-enter",o=[{target:".overlay-backdrop",onlyIf:"isLayered:false",animation:a,options:{duration:"--animation-duration",easing:"--animation-easing",fill:"forwards"}},{target:".private-host",animation:i,options:{duration:"--animation-duration",easing:"--animation-easing",fill:"forwards",endDelay:50}}];export{o as AnimationModalEnterConfig,n as AnimationModalEnterName};
|
|
1
|
+
import{fadeInKeyframes as a}from"./keyframes/fade-in.js";import{fadeAndSlideInKeyframes as i}from"./keyframes/fade-in-and-slide-down.js";const n="cds-modal-enter",o=[{target:".overlay-backdrop",onlyIf:"isLayered:false",animation:a,options:{duration:"--backdrop-animation-duration",easing:"--animation-easing",fill:"forwards"}},{target:".private-host",animation:i,options:{duration:"--animation-duration",easing:"--animation-easing",fill:"forwards",endDelay:50}}];export{o as AnimationModalEnterConfig,n as AnimationModalEnterName};
|
|
2
2
|
//# sourceMappingURL=cds-modal-enter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cds-modal-enter.js","sources":["../../../../../src/internal/motion/animations/cds-modal-enter.ts"],"sourcesContent":null,"names":["AnimationModalEnterName","AnimationModalEnterConfig","target","onlyIf","animation","fadeInKeyframes","options","duration","easing","fill","fadeAndSlideInKeyframes","endDelay"],"mappings":"yIAOY,MAACA,EAA0B,kBAC1BC,EAA4B,CACrC,CACIC,OAAQ,oBACRC,OAAQ,kBACRC,UAAWC,EACXC,QAAS,CACLC,SAAU,
|
|
1
|
+
{"version":3,"file":"cds-modal-enter.js","sources":["../../../../../src/internal/motion/animations/cds-modal-enter.ts"],"sourcesContent":null,"names":["AnimationModalEnterName","AnimationModalEnterConfig","target","onlyIf","animation","fadeInKeyframes","options","duration","easing","fill","fadeAndSlideInKeyframes","endDelay"],"mappings":"yIAOY,MAACA,EAA0B,kBAC1BC,EAA4B,CACrC,CACIC,OAAQ,oBACRC,OAAQ,kBACRC,UAAWC,EACXC,QAAS,CACLC,SAAU,gCACVC,OAAQ,qBACRC,KAAM,aAGd,CACIP,OAAQ,gBACRE,UAAWM,EACXJ,QAAS,CACLC,SAAU,uBACVC,OAAQ,qBACRC,KAAM,WACNE,SAAU"}
|
|
@@ -41,7 +41,7 @@ export interface Animatable {
|
|
|
41
41
|
cdsMotion: string;
|
|
42
42
|
cdsMotionChange: EventEmitter<string>;
|
|
43
43
|
}
|
|
44
|
-
export declare type AnimatableElement =
|
|
44
|
+
export declare type AnimatableElement = HTMLElement & Animatable & {
|
|
45
45
|
[key: string]: any;
|
|
46
46
|
_animations: PropertyDrivenAnimation;
|
|
47
47
|
};
|
|
@@ -16,8 +16,8 @@ export declare function setAnimationStartStatus(animatedPropertyValueAsString: s
|
|
|
16
16
|
export declare function resolveAnimationEndStatus(animatedPropertyValueAsString: string, hostEl: AnimatableElement): void;
|
|
17
17
|
export declare function setAnimationConfigOptions(motionName: string, motionForMyValue: TargetedAnimation[], hostEl: AnimatableElement): TargetedAnimation[];
|
|
18
18
|
export declare function getAnimationPromiseInstructions(animatedPropertyValueAsString: string, motionConfigs: TargetedAnimation[], hostEl: AnimatableElement): Promise<unknown>[];
|
|
19
|
-
export declare function getAnimationTarget(hostEl:
|
|
20
|
-
export declare function getAnimationKeyframesOrPropertyIndexedFrames(animationConfig: AnimationKeyframes | PropertyIndexedKeyframes, hostEl:
|
|
19
|
+
export declare function getAnimationTarget(hostEl: HTMLElement, targetSelector?: string): Element;
|
|
20
|
+
export declare function getAnimationKeyframesOrPropertyIndexedFrames(animationConfig: AnimationKeyframes | PropertyIndexedKeyframes, hostEl: HTMLElement): AnimationKeyframes | PropertyIndexedKeyframes;
|
|
21
21
|
export declare function animationIsReversed(nameOfAnimation: string): boolean;
|
|
22
22
|
export declare function reverseAnimationConfig(config: TargetedAnimation[]): TargetedAnimation[];
|
|
23
23
|
export declare function reverseAnimation(animationName: string): string;
|
|
@@ -29,7 +29,7 @@ export declare function setAnimationDuration(config: TargetedAnimation[], hostEl
|
|
|
29
29
|
export declare function setAnimationEasing(config: TargetedAnimation[], hostEl: AnimatableElement): TargetedAnimation[];
|
|
30
30
|
export declare function zeroOutAnimationConfig(config: TargetedAnimation[]): TargetedAnimation[];
|
|
31
31
|
export declare function setAnimationProperty(propertyName: string, hostEl: AnimatableElement, config: TargetedAnimation[], staticFallback: string | number, valueConverter?: (arg: string) => string | number): TargetedAnimation[];
|
|
32
|
-
export declare function sizeDimensionKeyframes(animationKeyframes: AnimationKeyframes, hostEl:
|
|
32
|
+
export declare function sizeDimensionKeyframes(animationKeyframes: AnimationKeyframes, hostEl: HTMLElement): AnimationKeyframes;
|
|
33
33
|
export declare function filterAnimationsByUpdatedProperties(animations: PropertyDrivenAnimation, updatingProps: Map<string, any>): PropertyDrivenAnimation | null;
|
|
34
34
|
declare type TupleOfHiddenAndOtherAnimations = [TargetedAnimationAsPropertyTuple[], TargetedAnimationAsPropertyTuple[]];
|
|
35
35
|
export declare function flattenAndSortAnimations(hiddenAndNotAnimationTuple: TupleOfHiddenAndOtherAnimations, isHiding: boolean): TargetedAnimationAsPropertyTuple[];
|
package/internal/motion/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{CLARITY_MOTION_REVERSE_ANIMATION_SUFFIX as t,AnimationStatus as n,CLARITY_MOTION_REVERSE_ANIMATION_LABEL as
|
|
1
|
+
import{CLARITY_MOTION_REVERSE_ANIMATION_SUFFIX as t,AnimationStatus as n,CLARITY_MOTION_REVERSE_ANIMATION_LABEL as o,CLARITY_MOTION_FALLBACK_EASING as i,CLARITY_MOTION_FALLBACK_DURATION_IN_MS as r,CLARITY_MOTION_ENTER_LEAVE_PROPERTY as e}from"./interfaces.js";import{LogService as s}from"../services/log.service.js";import{ClarityMotion as u}from"./motion.service.js";import a from"ramda/es/clone.js";import{isCssPropertyName as c,getCssPropertyValue as f}from"../utils/css.js";import{isSuffixedBy as l,getNumericValueFromCssSecondsStyleValue as m,isPrefixedBy as d,removePrefix as p}from"../utils/string.js";import{queryChildFromLightOrShadowDom as h}from"../utils/dom.js";import{allPropertiesPass as g}from"../utils/identity.js";import{getMillisecondsFromSeconds as v}from"../utils/math.js";async function y(t,n){if(!n._animations)return s.warn(n.tagName.toLocaleLowerCase()+" is trying to animate but no animations are defined."),!1;const o=z(n._animations,t);return await Promise.all(o.map((o=>{const[i,r]=o;if(t.get(i)===n[i])return!1;const e=r[n[i].toString()],s=n.cdsMotion,[u,c]=M(e,x(s,i,n[i].toString()));let f=a(c);if(f.length<1)return!1;f=O(u,f,n);const l=b(e,f,n);return Promise.all(l).then((()=>(w(e,n),!0)))}))).then((t=>t.indexOf(!0)>-1)).catch((()=>!1))}function j(t,o){o.getAttribute("_cds-animation-status")!==n.active&&(o.setAttribute("_cds-animation-status",n.active),o.cdsMotionChange.emit(`${t} animation ${n.start}`))}function w(t,o){o.setAttribute("_cds-animation-status",n.ready),o.cdsMotionChange.emit(`${t} animation ${n.end}`)}function O(t,n,o){const i=o.cdsMotion,r=!i||"off"===i;return S(t)&&(n=C(n)),r?B(n):$(n=N(n,o),o)}function b(t,n,o){return n.filter((t=>!t.onlyIf||g(o,t.onlyIf))).map((n=>(j(t,o),new Promise((t=>{const i=A(o,n.target).animate(P(n.animation,o),n.options||{}),r=()=>{t("animation finished"),i.removeEventListener("finish",r)};i.addEventListener("finish",r)})))))}function A(t,n){return h(t,n)||t}function P(t,n){return Array.isArray(t)?R(t,n):t}function S(n){return l(n,t)}function C(t){return t.map((t=>(t.options?t.options.direction=o:t.options={direction:o},t)))}function _(t){return t+"-"+o}function x(t,n,o){if(!t||!n||void 0===o)return"";if("on"===t||"off"===t)return"";let i;try{i=JSON.parse(t)}catch(t){return""}return i[n]&&i[n][o]||""}function E(n){return S(n)?n.slice(0,-1*t.length):n}function L(t,n){return n&&u.has(E(n))?n:t}function M(t,n){const o=L(t,n);return[o,a(u.get(E(o)))]}function N(t,n){return I("duration",n,t,r,(t=>v(m(t))))}function $(t,n){return I("easing",n,t,i)}function B(t){return t.map((t=>(t.options?(t.options.duration=0,t.options.easing=i):t.options={duration:0,easing:i},t)))}function I(t,n,o,i,r){return o.map((o=>{if(o.options)if(o.options[t]){if(c(o.options[t])){const e=o.options[t];let s=f(e,n);s?r&&(s=r(s)):s=i,o.options[t]=s}}else o.options[t]=i;else{const n={};n[t]=i,o.options=n}return o}))}function R(t,n){return Array.isArray(t)?t.map((t=>{var o,i,r,e;if(Object.prototype.hasOwnProperty.call(t,"height")&&d((null===(o=null==t?void 0:t.height)||void 0===o?void 0:o.toString())||"","from:")){const o=p((null===(i=null==t?void 0:t.height)||void 0===i?void 0:i.toString())||"","from:"),r=h(n,o)||null;t.height=r?r.getBoundingClientRect().height+"px":"auto"}if(Object.prototype.hasOwnProperty.call(t,"width")&&d((null===(r=null==t?void 0:t.width)||void 0===r?void 0:r.toString())||"","from:")){const o=p((null===(e=null==t?void 0:t.width)||void 0===e?void 0:e.toString())||"","from:"),i=h(n,o)||null;t.width=i?i.getBoundingClientRect().width+"px":"auto"}return t})):t}function J(t,n){if(null==t)return null;let o=!0;const i={};return Object.getOwnPropertyNames(t).forEach((r=>{n.has(r)&&void 0!==n.get(r)&&(i[r]=a(t[r]),o=!1)})),o?null:i}function k(t,n){if(null==t)return[];const[o,i]=t;return o.length>0?n?[].concat(i,o):[].concat(o,i):i}function q(t){const n=[],o=[];return Object.getOwnPropertyNames(t||{}).forEach((i=>{const r=[i,a(t[i])];i===e?n.push(r):o.push(r)})),[n,o]}function z(t,n){const o=J(t||{},n);return null===o?[]:k(q(o),n.get(e))}export{S as animationIsReversed,E as extractAnimationNameIfReversed,J as filterAnimationsByUpdatedProperties,k as flattenAndSortAnimations,M as getAnimationConfigForPropertyValue,L as getAnimationFromOverrideOrDecorator,P as getAnimationKeyframesOrPropertyIndexedFrames,b as getAnimationPromiseInstructions,A as getAnimationTarget,q as getHidingAndNonHidingPropertyAnimations,x as getInlineOverride,z as getPropertyAnimations,w as resolveAnimationEndStatus,_ as reverseAnimation,C as reverseAnimationConfig,y as runPropertyAnimations,O as setAnimationConfigOptions,N as setAnimationDuration,$ as setAnimationEasing,I as setAnimationProperty,j as setAnimationStartStatus,R as sizeDimensionKeyframes,B as zeroOutAnimationConfig};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/internal/motion/utils.ts"],"sourcesContent":null,"names":["async","runPropertyAnimations","props","hostEl","_animations","LogService","warn","tagName","toLocaleLowerCase","propertyAnimations","getPropertyAnimations","Promise","all","map","propNameAnimationTuple","propname","propertyAnimationsByValue","get","animatedPropertyValueAsString","toString","cdsMotionValue","cdsMotion","motionName","returnedMotion","getAnimationConfigForPropertyValue","getInlineOverride","motionForMyValue","clone","length","setAnimationConfigOptions","animations","getAnimationPromiseInstructions","then","resolveAnimationEndStatus","result","indexOf","catch","setAnimationStartStatus","getAttribute","AnimationStatus","active","setAttribute","cdsMotionChange","emit","start","ready","end","animationsAreTurnedOff","animationIsReversed","reverseAnimationConfig","zeroOutAnimationConfig","setAnimationEasing","setAnimationDuration","motionConfigs","filter","config","onlyIf","allPropertiesPass","resolve","animationPlayer","getAnimationTarget","target","animate","getAnimationKeyframesOrPropertyIndexedFrames","animation","options","listener","removeEventListener","addEventListener","targetSelector","queryChildFromLightOrShadowDom","animationConfig","Array","isArray","sizeDimensionKeyframes","nameOfAnimation","isSuffixedBy","CLARITY_MOTION_REVERSE_ANIMATION_SUFFIX","anim","direction","CLARITY_MOTION_REVERSE_ANIMATION_LABEL","reverseAnimation","animationName","propName","propValue","inlineOverride","JSON","parse","e","extractAnimationNameIfReversed","name","slice","getAnimationFromOverrideOrDecorator","decoratorValue","overrideValue","ClarityMotion","has","nameOfAnimationFromObject","cdsMotionOverride","setAnimationProperty","CLARITY_MOTION_FALLBACK_DURATION_IN_MS","val","getMillisecondsFromSeconds","getNumericValueFromCssSecondsStyleValue","CLARITY_MOTION_FALLBACK_EASING","duration","easing","propertyName","staticFallback","valueConverter","isCssPropertyName","myConfigOption","valFromProperty","getCssPropertyValue","newConfigOptions","animationKeyframes","kf","_a","_b","_c","_d","hasOwnProperty","isPrefixedBy","height","selector","removePrefix","measureTarget","getBoundingClientRect","width","filterAnimationsByUpdatedProperties","updatingProps","objectIsEmpty","returnObject","
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/internal/motion/utils.ts"],"sourcesContent":null,"names":["async","runPropertyAnimations","props","hostEl","_animations","LogService","warn","tagName","toLocaleLowerCase","propertyAnimations","getPropertyAnimations","Promise","all","map","propNameAnimationTuple","propname","propertyAnimationsByValue","get","animatedPropertyValueAsString","toString","cdsMotionValue","cdsMotion","motionName","returnedMotion","getAnimationConfigForPropertyValue","getInlineOverride","motionForMyValue","clone","length","setAnimationConfigOptions","animations","getAnimationPromiseInstructions","then","resolveAnimationEndStatus","result","indexOf","catch","setAnimationStartStatus","getAttribute","AnimationStatus","active","setAttribute","cdsMotionChange","emit","start","ready","end","animationsAreTurnedOff","animationIsReversed","reverseAnimationConfig","zeroOutAnimationConfig","setAnimationEasing","setAnimationDuration","motionConfigs","filter","config","onlyIf","allPropertiesPass","resolve","animationPlayer","getAnimationTarget","target","animate","getAnimationKeyframesOrPropertyIndexedFrames","animation","options","listener","removeEventListener","addEventListener","targetSelector","queryChildFromLightOrShadowDom","animationConfig","Array","isArray","sizeDimensionKeyframes","nameOfAnimation","isSuffixedBy","CLARITY_MOTION_REVERSE_ANIMATION_SUFFIX","anim","direction","CLARITY_MOTION_REVERSE_ANIMATION_LABEL","reverseAnimation","animationName","propName","propValue","inlineOverride","JSON","parse","e","extractAnimationNameIfReversed","name","slice","getAnimationFromOverrideOrDecorator","decoratorValue","overrideValue","ClarityMotion","has","nameOfAnimationFromObject","cdsMotionOverride","setAnimationProperty","CLARITY_MOTION_FALLBACK_DURATION_IN_MS","val","getMillisecondsFromSeconds","getNumericValueFromCssSecondsStyleValue","CLARITY_MOTION_FALLBACK_EASING","duration","easing","propertyName","staticFallback","valueConverter","isCssPropertyName","myConfigOption","valFromProperty","getCssPropertyValue","newConfigOptions","animationKeyframes","kf","_a","_b","_c","_d","Object","prototype","hasOwnProperty","call","isPrefixedBy","height","selector","removePrefix","measureTarget","getBoundingClientRect","width","filterAnimationsByUpdatedProperties","updatingProps","objectIsEmpty","returnObject","getOwnPropertyNames","forEach","prop","undefined","flattenAndSortAnimations","hiddenAndNotAnimationTuple","isHiding","hiddenAnimations","otherAnimations","concat","getHidingAndNonHidingPropertyAnimations","animationTuple","CLARITY_MOTION_ENTER_LEAVE_PROPERTY","push","activeAnimations"],"mappings":"yxBA2BOA,eAAeC,EAAsBC,EAAOC,GAC/C,IAAKA,EAAOC,YAER,OADAC,EAAWC,KAAQH,EAAOI,QAAQC,oBAAlB,yDACT,EAUX,MAAMC,EAAqBC,EAAsBP,EAAOC,YAAaF,GAkCrE,aAjC4BS,QAAQC,IAAIH,EAAmBI,KAAKC,IAC5D,MAAOC,EAAUC,GAA6BF,EAC9C,GAAIZ,EAAMe,IAAIF,KAAcZ,EAAOY,GAE/B,OAAO,EAGX,MAAMG,EAAgCF,EAA0Bb,EAAOY,GAAUI,YAC3EC,EAAiBjB,EAAOkB,WAKvBC,EAAYC,GAAkBC,EAAmCN,EAA+BO,EAAkBL,EAAgBL,EAAUZ,EAAOY,GAAUI,aACpK,IAAIO,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declare type WindowDims = {
|
|
2
|
+
height: number;
|
|
3
|
+
width: number;
|
|
4
|
+
};
|
|
5
|
+
export declare type PointerObj = {
|
|
6
|
+
size?: number;
|
|
7
|
+
location?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare type PositionObj = {
|
|
10
|
+
popup: {
|
|
11
|
+
top: number;
|
|
12
|
+
left: number;
|
|
13
|
+
};
|
|
14
|
+
pointer?: PointerObj;
|
|
15
|
+
};
|
|
16
|
+
export declare type PositionObjOrNot = false | PositionObj;
|
|
17
|
+
export declare type CardinalPositionConfig = false | PositionObjOrNot[];
|
|
18
|
+
export declare type CardinalPositions = 'top' | 'right' | 'bottom' | 'left';
|
|
19
|
+
export declare type AxisAligns = 'start' | 'mid' | 'end';
|
|
20
|
+
export declare type AllCardinalPositionConfigs = {
|
|
21
|
+
[index: string]: CardinalPositionConfig;
|
|
22
|
+
top: CardinalPositionConfig;
|
|
23
|
+
bottom: CardinalPositionConfig;
|
|
24
|
+
left: CardinalPositionConfig;
|
|
25
|
+
right: CardinalPositionConfig;
|
|
26
|
+
};
|
|
27
|
+
export declare type PositionConfig = false | AllCardinalPositionConfigs;
|
|
28
|
+
export declare enum Positions {
|
|
29
|
+
Responsive = 0,
|
|
30
|
+
Top = 1,
|
|
31
|
+
Left = 2,
|
|
32
|
+
TopOrLeft = 3,
|
|
33
|
+
Right = 4,
|
|
34
|
+
TopOrRight = 5,
|
|
35
|
+
Horizontal = 6,
|
|
36
|
+
TopOrHorizontal = 7,
|
|
37
|
+
Bottom = 8,
|
|
38
|
+
Vertical = 9,
|
|
39
|
+
BottomOrLeft = 10,
|
|
40
|
+
VerticalOrLeft = 11,
|
|
41
|
+
BottomOrRight = 12,
|
|
42
|
+
VerticalOrRight = 13,
|
|
43
|
+
BottomOrHorizontal = 14,
|
|
44
|
+
All = 15
|
|
45
|
+
}
|
|
46
|
+
export declare type PositionableElement = HTMLElement & {
|
|
47
|
+
crossAxisOffset: number;
|
|
48
|
+
mainAxisOffset: number;
|
|
49
|
+
orientation: string;
|
|
50
|
+
pointer: PointerElement;
|
|
51
|
+
pointerAlign: AxisAligns;
|
|
52
|
+
anchorAlign: AxisAligns;
|
|
53
|
+
anchorRect: DOMRect;
|
|
54
|
+
contentWrapper: HTMLElement;
|
|
55
|
+
hostWrapper: HTMLElement;
|
|
56
|
+
pointerWrapper: HTMLElement;
|
|
57
|
+
};
|
|
58
|
+
export declare type PointerElement = HTMLElement & {
|
|
59
|
+
type: string;
|
|
60
|
+
axisAlign: string;
|
|
61
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t;!function(t){t[t.Responsive=0]="Responsive",t[t.Top=1]="Top",t[t.Left=2]="Left",t[t.TopOrLeft=3]="TopOrLeft",t[t.Right=4]="Right",t[t.TopOrRight=5]="TopOrRight",t[t.Horizontal=6]="Horizontal",t[t.TopOrHorizontal=7]="TopOrHorizontal",t[t.Bottom=8]="Bottom",t[t.Vertical=9]="Vertical",t[t.BottomOrLeft=10]="BottomOrLeft",t[t.VerticalOrLeft=11]="VerticalOrLeft",t[t.BottomOrRight=12]="BottomOrRight",t[t.VerticalOrRight=13]="VerticalOrRight",t[t.BottomOrHorizontal=14]="BottomOrHorizontal",t[t.All=15]="All"}(t||(t={}));export{t as Positions};
|
|
2
|
+
//# sourceMappingURL=interfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sources":["../../../../src/internal/positioning/interfaces.ts"],"sourcesContent":null,"names":["Positions"],"mappings":"AASU,IAACA,GACX,SAAWA,GACPA,EAAUA,EAAsB,WAAI,GAAK,aACzCA,EAAUA,EAAe,IAAI,GAAK,MAClCA,EAAUA,EAAgB,KAAI,GAAK,OACnCA,EAAUA,EAAqB,UAAI,GAAK,YACxCA,EAAUA,EAAiB,MAAI,GAAK,QACpCA,EAAUA,EAAsB,WAAI,GAAK,aACzCA,EAAUA,EAAsB,WAAI,GAAK,aACzCA,EAAUA,EAA2B,gBAAI,GAAK,kBAC9CA,EAAUA,EAAkB,OAAI,GAAK,SACrCA,EAAUA,EAAoB,SAAI,GAAK,WACvCA,EAAUA,EAAwB,aAAI,IAAM,eAC5CA,EAAUA,EAA0B,eAAI,IAAM,iBAC9CA,EAAUA,EAAyB,cAAI,IAAM,gBAC7CA,EAAUA,EAA2B,gBAAI,IAAM,kBAC/CA,EAAUA,EAA8B,mBAAI,IAAM,qBAClDA,EAAUA,EAAe,IAAI,IAAM,MAhBvC,CAiBGA,IAAcA,EAAY"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AllCardinalPositionConfigs, AxisAligns, CardinalPositionConfig, CardinalPositions, PointerElement, PositionConfig, PositionObjOrNot, PositionableElement, WindowDims } from './interfaces.js';
|
|
2
|
+
export declare function getPopupOffsetOrDefaultOffsets(existingMainAxisOffset: number, existingCrossAxisOffset: number, pointer: PointerElement, pointerAlign: string, anchorAlign: string): {
|
|
3
|
+
mainAxisOffset: number;
|
|
4
|
+
crossAxisOffset: number;
|
|
5
|
+
};
|
|
6
|
+
export declare function setPopupPosition(component: PositionableElement): void;
|
|
7
|
+
declare type PositioningPreferencesTuple = [number[], number];
|
|
8
|
+
export declare function getOrientationTuple(orientationPrefs: string): PositioningPreferencesTuple;
|
|
9
|
+
export declare function getCrossAxisOrderOfPreference(preference: string): number[];
|
|
10
|
+
export declare function checkNextPosition(whichPosition: number, positions: PositionConfig, anchorAlignPref: string): PositionObjOrNot;
|
|
11
|
+
export declare function getNextDefaultPosition(currentPositionTotal: number): number[];
|
|
12
|
+
export declare function getNextPosition(userPrefs: number[], prefTotal: number): [number, number[], number];
|
|
13
|
+
export declare function getPointerPosition(workingPositionRelativeToAnchor: string): string;
|
|
14
|
+
export declare function getPointerAlignment(popupPosition: string, pointerAlign: string): any;
|
|
15
|
+
export declare function getBestPositionForPreferences(positions: PositionConfig, preferences: PositioningPreferencesTuple, anchorAlignPref: string): PositionObjOrNot;
|
|
16
|
+
export declare function getPopupPosition(orientationPrefs: string, anchorRect: DOMRect, anchorAlign: AxisAligns, pointer: HTMLElement, pointerAlign: AxisAligns, popup: HTMLElement, mainAxisOffset: number, crossAxisOffset: number): PositionObjOrNot;
|
|
17
|
+
export declare function getPositions(anchorRect: DOMRect, pointerHeight: number, pointerAlign: AxisAligns, popupRect: DOMRect, windowDims: WindowDims, mainAxisOffset: number, crossAxisOffset: number): AllCardinalPositionConfigs;
|
|
18
|
+
export declare function getPositionConfig(cardinalPos: CardinalPositions, pointerAlign: AxisAligns, anchor: DOMRect, popup: DOMRect, pointerHeight: number, win: WindowDims, mainAxisOffset: number, crossAxisOffset: number): false | CardinalPositionConfig;
|
|
19
|
+
declare type PositionOrViolation = false | number;
|
|
20
|
+
export declare function getMainAxisPosition(startPos: number, pointer: number, popup: number, offset: number, limit: number): number;
|
|
21
|
+
export declare function testMainAxisPosition(pos: number, startPos: number, limit: number): PositionOrViolation;
|
|
22
|
+
export declare function getCrossAxisPosition(position: AxisAligns, startPos: number, anchorAlign: number, anchorWidth: number, offset: number, popup?: number): number;
|
|
23
|
+
export declare function testCrossAxisPosition(axisAlign: AxisAligns, position: number, popup: number, limit: [number, number]): PositionOrViolation;
|
|
24
|
+
export declare function getPositionOrViolationFromCrossAxis(startPos: number, anchorLength: number, popupLength: number, offset: number, limitMinimum: number, limitMaximum: number, pointerPosition: AxisAligns): PositionOrViolation[];
|
|
25
|
+
export declare function getMainAxisPositionOrViolation(startPos: number, pointerLength: number, popupLength: number, offset: number, limit?: number): false | number;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Positions as t}from"./interfaces.js";import{transformSpacedStringToArray as e,removePrefix as o,capitalizeFirstLetter as i}from"../utils/string.js";import{setAttributes as n,getWindowDimensions as r}from"../utils/dom.js";import{isNil as s}from"../utils/identity.js";import{updateElementStyles as p,getCssPropertyValue as f}from"../utils/css.js";import{sumAndSubtract as u}from"../utils/math.js";import{getEnumValueFromStringKey as c}from"../utils/enum.js";function a(t,e,o,i,n){const r={mainAxisOffset:0,crossAxisOffset:0},p=o&&"default"===o.type;return s(t)?p&&(r.mainAxisOffset=-10):r.mainAxisOffset=t,s(e)?p&&"end"===i&&"start"===n&&(r.crossAxisOffset=-10):r.crossAxisOffset=e,r}function l(t){t.removeAttribute("responsive");const e=a(t.mainAxisOffset,t.crossAxisOffset,t.pointer,t.pointerAlign,t.anchorAlign),o=O(t.orientation,t.anchorRect,t.anchorAlign,t.pointer,t.pointerAlign,t.contentWrapper,e.mainAxisOffset,e.crossAxisOffset);if(!1===o)n(t,["responsive",""],["_position-at",!1]),p(t.hostWrapper,["position",""],["top",""],["left",""]),p(t.pointerWrapper,["visibility","hidden"]);else{if(t.pointer){const e=o.pointer;p(t.pointerWrapper,["visibility","visible"]),n(t,["_pointer-type",t.pointer.type||!1]),n(t,["_position-at",e.location])}else p(t.pointerWrapper,["visibility","hidden"]),n(t,["_position-at",!1],["_pointer-type",!1]);const e=o.popup.top+"px",i=o.popup.left+"px";p(t.hostWrapper,["position","absolute"],["top",e],["left",i])}}function h(n){const r=[],s=[];for(const p of e(n)){if("none"===p)return[[],0];if(p.indexOf("only:")>-1)return[[c(t,o(p,"only:"),i)],0];if(p.indexOf("not:")>-1)s.push(c(t,o(p,"not:"),i));else{const e=c(t,p,i);s.push(e),r.push(e)}}return[r,u(0,[t.All],s)]}function m(t){switch(t){case"mid":return[1,0,2];case"end":return[2,1,0];case"start":default:return[0,1,2]}}function d(e,o,i){var n;if(!1===o)return!1;const r=o[null===(n=t[e])||void 0===n?void 0:n.toLowerCase()];if(!r)return!1;const[s,p,f]=r;if(!1===s&&!1===p&&!1===f)return!1;for(const t of m(i))if(r[t])return Object.assign({},r[t]);return!1}function g(e){const o=[t.Bottom,t.Right,t.Left,t.Top,t.Responsive];for(const t of o)if(e>=t)return[t,e-t];return[0,0]}function b(e,o){if(e.length<1){const[t,i]=g(o);return[t,e,i]}return[e[0],e.slice(1),e[0]!==t.Responsive?o:0]}function w(t){switch(t.toLowerCase()){case"top":return"popup-bottom";case"bottom":return"popup-top";case"left":return"popup-right";case"right":default:return"popup-left"}}function x(t,e){let o;return o="popup-bottom"===t||"popup-top"===t?{start:"pointer-left",mid:"pointer-center",end:"pointer-right"}:{start:"pointer-top",mid:"pointer-mid",end:"pointer-bottom"},o[e]}function A(e,o,i){let[n,r]=o,s=null;for(;null===s;){const[o,p,f]=b(n,r),u=d(o,e,i);switch(!0){case!1!==u:s=Object.assign({},u,{pointer:{location:w(t[o])}});break;case!1===u&&0===f:s=!1;break;case!1===u:n=p,r=f}}return s}function O(t,e,o,i,n,s,p,u){if(!e)return!1;const c=i?i.offsetHeight:0,a=r();if(a.width<=parseInt(f("--cds-global-layout-width-xs-static"),10))return!1;const l=A(v(e,c,n,s.getBoundingClientRect(),a,p,u),h(t),o);if(!1===l)return!1;const m=l.pointer.location,d=m+" "+x(m,n);return Object.assign({},l,{pointer:{size:c,location:d}})}function v(t,e,o,i,n,r,s){return{top:y("top",o,t,i,e,n,r,s),right:y("right",o,t,i,e,n,r,s),bottom:y("bottom",o,t,i,e,n,r,s),left:y("left",o,t,i,e,n,r,s)}}function y(t,e,o,i,n,r,s,p){let f;switch(t){case"top":return f=L(o.top,n,i.height,s,0),!1!==f&&C(o.left,o.width,i.width,p,0,r.width,e).map((t=>!1!==t&&{popup:{top:f,left:t}}));case"bottom":return f=L(o.bottom,0,i.height,s,r.height),!1!==f&&C(o.left,o.width,i.width,p,0,r.width,e).map((t=>!1!==t&&{popup:{top:f,left:t}}));case"left":return f=L(o.left,n,i.width,s,0),!1!==f&&C(o.top,o.height,i.height,p,0,r.height,e).map((t=>!1!==t&&{popup:{top:t,left:f}}));case"right":return f=L(o.right,0,i.width,s,r.width),!1!==f&&C(o.top,o.height,i.height,p,0,r.height,e).map((t=>!1!==t&&{popup:{top:t,left:f}}))}}function j(t,e,o,i,n){return 0===n?u(t,[],[e,o,i]):u(t,[e,o,i],[])}function W(t,e,o){return 0===o?t>o&&t:t<o&&e}function R(t,e,o,i,n,r=0){switch(t){case"mid":return e+o*i-.5*r+n;case"end":return e+o*i-n;case"start":return e+o*i+n}}function _(t,e,o,i){const[n,r]=i;switch(t){case"mid":return e>n&&e+o<r&&e;case"end":{const t=e-o;return t>n&&t}case"start":return e+o<r&&e}}function C(t,e,o,i,n,r,s){return[0,.5,1].map((p=>_(s,R(s,t,p,e,i,o),o,[n,r])))}function L(t,e,o,i,n=0){return W(j(t,e,o,i,n),t+i,n)}export{d as checkNextPosition,A as getBestPositionForPreferences,m as getCrossAxisOrderOfPreference,R as getCrossAxisPosition,j as getMainAxisPosition,L as getMainAxisPositionOrViolation,g as getNextDefaultPosition,b as getNextPosition,h as getOrientationTuple,x as getPointerAlignment,w as getPointerPosition,a as getPopupOffsetOrDefaultOffsets,O as getPopupPosition,y as getPositionConfig,C as getPositionOrViolationFromCrossAxis,v as getPositions,l as setPopupPosition,_ as testCrossAxisPosition,W as testMainAxisPosition};
|
|
2
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/internal/positioning/utils.ts"],"sourcesContent":null,"names":["getPopupOffsetOrDefaultOffsets","existingMainAxisOffset","existingCrossAxisOffset","pointer","pointerAlign","anchorAlign","returnObj","mainAxisOffset","crossAxisOffset","isDefaultPointerType","type","isNil","setPopupPosition","component","removeAttribute","offsets","myPosition","getPopupPosition","orientation","anchorRect","contentWrapper","setAttributes","updateElementStyles","hostWrapper","pointerWrapper","positionedPointer","location","posTop","popup","top","posLeft","left","getOrientationTuple","orientationPrefs","preferredPositions","deniedPositions","userPref","transformSpacedStringToArray","indexOf","getEnumValueFromStringKey","Positions","removePrefix","capitalizeFirstLetter","push","positionVal","sumAndSubtract","All","getCrossAxisOrderOfPreference","preference","checkNextPosition","whichPosition","positions","anchorAlignPref","_a","positionToCheck","toLowerCase","startOfAnchor","middleOfAnchor","endOfAnchor","i","Object","assign","getNextDefaultPosition","currentPositionTotal","defaults","Bottom","Right","Left","Top","Responsive","position","getNextPosition","userPrefs","prefTotal","length","positionIndexToCheck","newPrefTotal","slice","getPointerPosition","workingPositionRelativeToAnchor","getPointerAlignment","popupPosition","myAligns","start","mid","end","getBestPositionForPreferences","preferences","arrayOfUserPrefs","currentPrefTotal","returnPref","newArrayOfUserPrefs","newCurrentPrefTotal","positionWillWork","pointerHeight","offsetHeight","windowDims","getWindowDimensions","width","parseInt","getCssPropertyValue","getPositions","getBoundingClientRect","pointerLocationRelativeToAnchor","pointerLocation","size","popupRect","getPositionConfig","right","bottom","cardinalPos","anchor","win","mainAxisPosition","getMainAxisPositionOrViolation","height","getPositionOrViolationFromCrossAxis","map","crossAxisPos","getMainAxisPosition","startPos","offset","limit","testMainAxisPosition","pos","getCrossAxisPosition","anchorWidth","testCrossAxisPosition","axisAlign","limitMin","limitMax","pulledPosition","anchorLength","popupLength","limitMinimum","limitMaximum","pointerPosition","anchorAlignment","pointerLength"],"mappings":"+cAYO,SAASA,EAA+BC,EAAwBC,EAAyBC,EAASC,EAAcC,GACnH,MAAMC,EAAY,CAAEC,eAAgB,EAAGC,gBAAiB,GAClDC,EAAuBN,GAA4B,YAAjBA,EAAQO,KAiBhD,OAhBKC,EAAMV,GAIHQ,IACAH,EAAUC,gBAAkB,IAJhCD,EAAUC,eAAiBN,EAO1BU,EAAMT,GAIHO,GAAyC,QAAjBL,GAA0C,UAAhBC,IAClDC,EAAUE,iBAAmB,IAJjCF,EAAUE,gBAAkBN,EAOzBI,EAEJ,SAASM,EAAiBC,GAG7BA,EAAUC,gBAAgB,cAC1B,MAAMC,EAAUf,EAA+Ba,EAAUN,eAAgBM,EAAUL,gBAAiBK,EAAUV,QAASU,EAAUT,aAAcS,EAAUR,aACnJW,EAAaC,EAAiBJ,EAAUK,YAAaL,EAAUM,WAAYN,EAAUR,YAAaQ,EAAUV,QAASU,EAAUT,aAAcS,EAAUO,eAAgBL,EAAQR,eAAgBQ,EAAQP,iBAC7M,IAAmB,IAAfQ,EAGAK,EAAcR,EAAW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EAAcC,MAGhL,SAASrB,EAA+BM,EAAUkB,EAAeL,EAAaZ,EAAQC,EAAQ,GACjG,OAAOC,EAAqBJ,EAAoBC,EAAUkB,EAAeL,EAAaZ,EAAQC,GAC9FF,EAAWC,EACXC"}
|
|
@@ -10,6 +10,9 @@ export declare class FocusTrapTrackerService {
|
|
|
10
10
|
static setTrapElements(elements: {
|
|
11
11
|
focusTrapId: string;
|
|
12
12
|
}[]): void;
|
|
13
|
+
static removeTrapElement(element: {
|
|
14
|
+
focusTrapId: string;
|
|
15
|
+
}): void;
|
|
13
16
|
static setCurrent(element: {
|
|
14
17
|
focusTrapId: string;
|
|
15
18
|
}): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{arrayTail as t}from"../utils/array.js";import{
|
|
1
|
+
import{arrayTail as t}from"../utils/array.js";import{setAttributes as e}from"../utils/dom.js";import{GlobalStateService as s}from"./global.service.js";const r="cds-focus-trap";class a{static getTrapElements(){return[...s.state.focusTrapItems]}static setTrapElements(t){const r=document.querySelector("html");null!==r&&e(r,["cds-focus-trap",!!t.length&&""]),s.state.focusTrapItems=[...t]}static removeTrapElement(t){this.getTrapElements().length<1||this.setTrapElements([...this.getTrapElements().filter((e=>e.focusTrapId!==t.focusTrapId))])}static setCurrent(t){(null==t?void 0:t.focusTrapId)&&this.setTrapElements([...this.getTrapElements().filter((e=>e.focusTrapId!==t.focusTrapId)),t])}static activatePreviousCurrent(){this.setTrapElements([...this.getTrapElements()].slice(0,-1))}static getCurrent(){return t(this.getTrapElements())||null}}export{r as CDS_FOCUS_TRAP_DOCUMENT_ATTR,a as FocusTrapTrackerService};
|
|
2
2
|
//# sourceMappingURL=focus-trap-tracker.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus-trap-tracker.service.js","sources":["../../../../src/internal/services/focus-trap-tracker.service.ts"],"sourcesContent":null,"names":["CDS_FOCUS_TRAP_DOCUMENT_ATTR","FocusTrapTrackerService","[object Object]","GlobalStateService","state","focusTrapItems","elements","htmlEl","document","querySelector","
|
|
1
|
+
{"version":3,"file":"focus-trap-tracker.service.js","sources":["../../../../src/internal/services/focus-trap-tracker.service.ts"],"sourcesContent":null,"names":["CDS_FOCUS_TRAP_DOCUMENT_ATTR","FocusTrapTrackerService","[object Object]","GlobalStateService","state","focusTrapItems","elements","htmlEl","document","querySelector","setAttributes","length","element","this","getTrapElements","setTrapElements","filter","e","focusTrapId","slice","arrayTail"],"mappings":"uJAQY,MAACA,EAA+B,iBAKrC,MAAMC,EACTC,yBACI,MAAO,IAAIC,EAAmBC,MAAMC,gBAExCH,uBAAuBI,GACnB,MAAMC,EAASC,SAASC,cAAc,QACvB,OAAXF,GACAG,EAAcH,EAAQ,CAZU,mBAYqBD,EAASK,QAAS,KAE3ER,EAAmBC,MAAMC,eAAiB,IAAIC,GAElDJ,yBAAyBU,GACEC,KAAKC,kBACTH,OAAS,GAG5BE,KAAKE,gBAAgB,IAAIF,KAAKC,kBAAkBE,QAAOC,GAAKA,EAAEC,cAAgBN,EAAQM,gBAE1FhB,kBAAkBU,IACRA,MAAAA,OAAyC,EAASA,EAAQM,cAGhEL,KAAKE,gBAAgB,IAAIF,KAAKC,kBAAkBE,QAAOC,GAAKA,EAAEC,cAAgBN,EAAQM,cAAcN,IAExGV,iCACIW,KAAKE,gBAAgB,IAAIF,KAAKC,mBAAmBK,MAAM,GAAI,IAE/DjB,oBACI,OAAOkB,EAAUP,KAAKC,oBAAsB"}
|
|
@@ -4,7 +4,7 @@ export declare class GlobalStateService {
|
|
|
4
4
|
static get state(): CDSState;
|
|
5
5
|
static getValue(key: keyof CDSState): readonly {
|
|
6
6
|
focusTrapId: string;
|
|
7
|
-
}[] | Readonly<
|
|
7
|
+
}[] | Readonly<Record<string, unknown>> | Readonly<{
|
|
8
8
|
[key: string]: any;
|
|
9
9
|
}>;
|
|
10
10
|
static setValue(key: keyof CDSState, val: CDSState[keyof CDSState]): void;
|
|
@@ -24,10 +24,24 @@ export interface I18nStrings {
|
|
|
24
24
|
contentBox: string;
|
|
25
25
|
contentEnd: string;
|
|
26
26
|
};
|
|
27
|
+
overlay: {
|
|
28
|
+
closeButtonAriaLabel: string;
|
|
29
|
+
contentStart: string;
|
|
30
|
+
contentEnd: string;
|
|
31
|
+
};
|
|
32
|
+
popup: {
|
|
33
|
+
closeButtonAriaLabel: string;
|
|
34
|
+
contentStart: string;
|
|
35
|
+
contentEnd: string;
|
|
36
|
+
};
|
|
27
37
|
password: {
|
|
28
38
|
showButtonAriaLabel: string;
|
|
29
39
|
hideButtonAriaLabel: string;
|
|
30
40
|
};
|
|
41
|
+
progress: {
|
|
42
|
+
loading: string;
|
|
43
|
+
looping: string;
|
|
44
|
+
};
|
|
31
45
|
treeview: {
|
|
32
46
|
loading: string;
|
|
33
47
|
};
|
|
@@ -61,10 +75,24 @@ export declare const componentStringsDefault: {
|
|
|
61
75
|
navigationAbridgedText: string;
|
|
62
76
|
navigationUnabridgedText: string;
|
|
63
77
|
};
|
|
78
|
+
overlay: {
|
|
79
|
+
closeButtonAriaLabel: string;
|
|
80
|
+
contentStart: string;
|
|
81
|
+
contentEnd: string;
|
|
82
|
+
};
|
|
83
|
+
popup: {
|
|
84
|
+
closeButtonAriaLabel: string;
|
|
85
|
+
contentStart: string;
|
|
86
|
+
contentEnd: string;
|
|
87
|
+
};
|
|
64
88
|
password: {
|
|
65
89
|
showButtonAriaLabel: string;
|
|
66
90
|
hideButtonAriaLabel: string;
|
|
67
91
|
};
|
|
92
|
+
progress: {
|
|
93
|
+
loading: string;
|
|
94
|
+
looping: string;
|
|
95
|
+
};
|
|
68
96
|
treeview: {
|
|
69
97
|
loading: string;
|
|
70
98
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{GlobalStateService as
|
|
1
|
+
import{GlobalStateService as n}from"./global.service.js";const e={alert:{closeButtonAriaLabel:"Close",loading:"Loading",info:"Info",success:"Success",warning:"Warning",danger:"Error"},dropdown:{open:"Open"},file:{browse:"browse",files:"files",removeFile:"remove file"},modal:{closeButtonAriaLabel:"Close modal",contentStart:"Beginning of modal content",contentBox:"Scrollable modal body",contentEnd:"End of modal content"},navigation:{navigationElement:"navigation",navigationLabel:"navigation menu",navigationAbridgedText:"View abridged menu",navigationUnabridgedText:"View unabridged menu"},overlay:{closeButtonAriaLabel:"Close dialog",contentStart:"Beginning of dialog content",contentEnd:"End of dialog content"},popup:{closeButtonAriaLabel:"Close popup",contentStart:"Beginning of popup content",contentEnd:"End of popup content"},password:{showButtonAriaLabel:"Show password",hideButtonAriaLabel:"Hide password"},progress:{loading:"Loading",looping:"Loading"},treeview:{loading:"Loading"}};class o{static get keys(){return 0===Object.keys(n.state.i18nRegistry).length&&(n.state.i18nRegistry={...e,...n.state.i18nRegistry}),{...e,...n.state.i18nRegistry}}static localize(o){n.state.i18nRegistry={...e,...n.state.i18nRegistry,...o}}}export{o as I18nService,e as componentStringsDefault};
|
|
2
2
|
//# sourceMappingURL=i18n.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.service.js","sources":["../../../../src/internal/services/i18n.service.ts"],"sourcesContent":null,"names":["componentStringsDefault","alert","closeButtonAriaLabel","loading","info","success","warning","danger","dropdown","open","file","browse","files","removeFile","modal","contentStart","contentBox","contentEnd","navigation","navigationElement","navigationLabel","navigationAbridgedText","navigationUnabridgedText","password","showButtonAriaLabel","hideButtonAriaLabel","treeview","I18nService","keys","Object","GlobalStateService","state","i18nRegistry","length","[object Object]","overrides"],"mappings":"yDAMY,MAACA,EAA0B,CACnCC,MAAO,CACHC,qBAAsB,QACtBC,QAAS,UACTC,KAAM,OACNC,QAAS,UACTC,QAAS,UACTC,OAAQ,SAEZC,SAAU,CACNC,KAAM,QAEVC,KAAM,CACFC,OAAQ,SACRC,MAAO,QACPC,WAAY,eAEhBC,MAAO,CACHZ,qBAAsB,cACtBa,aAAc,6BACdC,WAAY,wBACZC,WAAY,wBAEhBC,WAAY,CACRC,kBAAmB,aACnBC,gBAAiB,kBACjBC,uBAAwB,qBACxBC,yBAA0B,wBAE9BC,SAAU,CACNC,oBAAqB,gBACrBC,oBAAqB,iBAEzBC,SAAU,
|
|
1
|
+
{"version":3,"file":"i18n.service.js","sources":["../../../../src/internal/services/i18n.service.ts"],"sourcesContent":null,"names":["componentStringsDefault","alert","closeButtonAriaLabel","loading","info","success","warning","danger","dropdown","open","file","browse","files","removeFile","modal","contentStart","contentBox","contentEnd","navigation","navigationElement","navigationLabel","navigationAbridgedText","navigationUnabridgedText","overlay","popup","password","showButtonAriaLabel","hideButtonAriaLabel","progress","looping","treeview","I18nService","keys","Object","GlobalStateService","state","i18nRegistry","length","[object Object]","overrides"],"mappings":"yDAMY,MAACA,EAA0B,CACnCC,MAAO,CACHC,qBAAsB,QACtBC,QAAS,UACTC,KAAM,OACNC,QAAS,UACTC,QAAS,UACTC,OAAQ,SAEZC,SAAU,CACNC,KAAM,QAEVC,KAAM,CACFC,OAAQ,SACRC,MAAO,QACPC,WAAY,eAEhBC,MAAO,CACHZ,qBAAsB,cACtBa,aAAc,6BACdC,WAAY,wBACZC,WAAY,wBAEhBC,WAAY,CACRC,kBAAmB,aACnBC,gBAAiB,kBACjBC,uBAAwB,qBACxBC,yBAA0B,wBAE9BC,QAAS,CACLrB,qBAAsB,eACtBa,aAAc,8BACdE,WAAY,yBAEhBO,MAAO,CACHtB,qBAAsB,cACtBa,aAAc,6BACdE,WAAY,wBAEhBQ,SAAU,CACNC,oBAAqB,gBACrBC,oBAAqB,iBAEzBC,SAAU,CACNzB,QAAS,UACT0B,QAAS,WAEbC,SAAU,CACN3B,QAAS,YAYV,MAAM4B,EACTC,kBAKI,OAHkE,IAA9DC,OAAOD,KAAKE,EAAmBC,MAAMC,cAAcC,SACnDH,EAAmBC,MAAMC,aAAe,IAAKpC,KAA4BkC,EAAmBC,MAAMC,eAE/F,IAAKpC,KAA4BkC,EAAmBC,MAAMC,cAErEE,gBAAgBC,GACZL,EAAmBC,MAAMC,aAAe,IACjCpC,KACAkC,EAAmBC,MAAMC,gBACzBG"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export declare function arrayToObject(arr: any[], key: string): any;
|
|
2
|
-
export declare function arrayTail(arr:
|
|
3
|
-
export declare function arrayHead(arr:
|
|
4
|
-
export declare function previousInArray(current:
|
|
5
|
-
export declare function nextInArray(current:
|
|
2
|
+
export declare function arrayTail<T>(arr: T[]): T | undefined;
|
|
3
|
+
export declare function arrayHead<T>(arr: T[]): T | undefined;
|
|
4
|
+
export declare function previousInArray<T>(current: T, arr: T[]): T | undefined;
|
|
5
|
+
export declare function nextInArray<T>(current: T, arr: T[]): T | undefined;
|
|
6
|
+
export declare function arrayRemoveFirstInstance<T>(val: T, arr: T[]): T[];
|
|
7
|
+
export declare function arrayRemoveLastInstance<T>(val: T, arr: T[]): T[];
|
|
8
|
+
export declare function arrayRemoveAllInstances<T>(val: T | T[], arr: T[]): T[];
|
package/internal/utils/array.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function n(n,
|
|
1
|
+
function n(n,r){return n.reduce(((n,t)=>(n[t[r]]=t,n)),{})}function r(n){return n.length?n[n.length-1]:void 0}function t(n){return n.length?n[0]:void 0}function e(n,r){const t=r.indexOf(n);return-1===t?void 0:r[Math.max(t-1,0)]}function o(n,r){const t=r.indexOf(n);return-1===t?void 0:r[Math.min(t+1,r.length-1)]}function i(n,r){const t=Array.from(r),e=r.indexOf(n);return e>-1&&t.splice(e,1),t}function u(n,r){return i(n,Array.from(r).reverse()).reverse()}function c(n,r){const t=[].concat(n);return r.filter((n=>!t.includes(n)))}export{t as arrayHead,c as arrayRemoveAllInstances,i as arrayRemoveFirstInstance,u as arrayRemoveLastInstance,r as arrayTail,n as arrayToObject,o as nextInArray,e as previousInArray};
|
|
2
2
|
//# sourceMappingURL=array.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.js","sources":["../../../../src/internal/utils/array.ts"],"sourcesContent":null,"names":["arrayToObject","arr","key","reduce","obj","item","arrayTail","length","arrayHead","previousInArray","current","idx","indexOf","Math","max","nextInArray","min"],"mappings":"AAKO,SAASA,EAAcC,EAAKC,GAC/B,OAAOD,EAAIE,QAAO,CAACC,EAAKC,KACpBD,EAAIC,EAAKH,IAAQG,EACVD,IACR,IAEA,SAASE,EAAUL,GACtB,OAAOA,EAAIM,OAASN,EAAIA,EAAIM,OAAS,QAAK,EAEvC,SAASC,EAAUP,GACtB,OAAOA,EAAIM,OAASN,EAAI,QAAK,EAE1B,SAASQ,EAAgBC,EAAST,GACrC,MAAMU,EAAMV,EAAIW,QAAQF,GACxB,OAAgB,IAATC,OAAa,EAASV,EAAIY,KAAKC,IAAIH,EAAM,EAAG,IAEhD,SAASI,EAAYL,EAAST,GACjC,MAAMU,EAAMV,EAAIW,QAAQF,GACxB,OAAgB,IAATC,OAAa,EAASV,EAAIY,KAAKG,IAAIL,EAAM,EAAGV,EAAIM,OAAS"}
|
|
1
|
+
{"version":3,"file":"array.js","sources":["../../../../src/internal/utils/array.ts"],"sourcesContent":null,"names":["arrayToObject","arr","key","reduce","obj","item","arrayTail","length","arrayHead","previousInArray","current","idx","indexOf","Math","max","nextInArray","min","arrayRemoveFirstInstance","val","newArr","Array","from","i","splice","arrayRemoveLastInstance","reverse","arrayRemoveAllInstances","arrayRemovalMachine","concat","filter","includes"],"mappings":"AAKO,SAASA,EAAcC,EAAKC,GAC/B,OAAOD,EAAIE,QAAO,CAACC,EAAKC,KACpBD,EAAIC,EAAKH,IAAQG,EACVD,IACR,IAEA,SAASE,EAAUL,GACtB,OAAOA,EAAIM,OAASN,EAAIA,EAAIM,OAAS,QAAK,EAEvC,SAASC,EAAUP,GACtB,OAAOA,EAAIM,OAASN,EAAI,QAAK,EAE1B,SAASQ,EAAgBC,EAAST,GACrC,MAAMU,EAAMV,EAAIW,QAAQF,GACxB,OAAgB,IAATC,OAAa,EAASV,EAAIY,KAAKC,IAAIH,EAAM,EAAG,IAEhD,SAASI,EAAYL,EAAST,GACjC,MAAMU,EAAMV,EAAIW,QAAQF,GACxB,OAAgB,IAATC,OAAa,EAASV,EAAIY,KAAKG,IAAIL,EAAM,EAAGV,EAAIM,OAAS,IAE7D,SAASU,EAAyBC,EAAKjB,GAC1C,MAAMkB,EAASC,MAAMC,KAAKpB,GACpBqB,EAAIrB,EAAIW,QAAQM,GAItB,OAHII,GAAK,GACLH,EAAOI,OAAOD,EAAG,GAEdH,EAEJ,SAASK,EAAwBN,EAAKjB,GAEzC,OAAOgB,EAAyBC,EADZE,MAAMC,KAAKpB,GAAKwB,WACcA,UAE/C,SAASC,EAAwBR,EAAKjB,GACzC,MAAM0B,EAAsB,GAAGC,OAAOV,GACtC,OAAOjB,EAAI4B,QAAOxB,IAASsB,EAAoBG,SAASzB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function t(t,n,r){const o=(n/=100)*Math.min(r/=100,1-r),h=(n,h=(n+t/30)%12)=>r-o*Math.max(Math.min(h-3,9-h,1),-1);return[Math.round(255*h(0)),Math.round(255*h(8)),Math.round(255*h(4))]}function n(t,n,r){let o=t.toString(16),h=n.toString(16),a=r.toString(16);return 1===o.length&&(o="0"+o),1===h.length&&(h="0"+h),1===a.length&&(a="0"+a),`#${o}${h}${a}`}export{t as hslToRgb,n as rgbToHex};
|
|
2
|
+
//# sourceMappingURL=color.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.js","sources":["../../../../src/internal/utils/color.ts"],"sourcesContent":null,"names":["hslToRgb","h","s","l","a","Math","min","f","n","k","max","round","rgbToHex","red","green","blue","r","toString","g","b","length"],"mappings":"AAAO,SAASA,EAASC,EAAGC,EAAGC,GAG3B,MAAMC,GAFNF,GAAQ,KAEMG,KAAKC,IADnBH,GAAQ,IACkB,EAAIA,GACxBI,EAAI,CAACC,EAAGC,GAAKD,EAAIP,EAAI,IAAM,KAAOE,EAAIC,EAAIC,KAAKK,IAAIL,KAAKC,IAAIG,EAAI,EAAG,EAAIA,EAAG,IAAK,GACrF,MAAO,CAACJ,KAAKM,MAAa,IAAPJ,EAAE,IAAWF,KAAKM,MAAa,IAAPJ,EAAE,IAAWF,KAAKM,MAAa,IAAPJ,EAAE,KAElE,SAASK,EAASC,EAAKC,EAAOC,GACjC,IAAIC,EAAIH,EAAII,SAAS,IACjBC,EAAIJ,EAAMG,SAAS,IACnBE,EAAIJ,EAAKE,SAAS,IAUtB,OATiB,IAAbD,EAAEI,SACFJ,EAAI,IAAMA,GAEG,IAAbE,EAAEE,SACFF,EAAI,IAAMA,GAEG,IAAbC,EAAEC,SACFD,EAAI,IAAMA,GAEP,IAAIH,IAAIE,IAAIC"}
|