@dso-toolkit/core 52.0.1 → 52.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dso-label.cjs.entry.js +38 -43
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/dso-tooltip.cjs.entry.js +75 -40
- package/dist/cjs/dso-viewer-grid.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/label/label.js +29 -23
- package/dist/collection/components/label/resize-observer.js +6 -6
- package/dist/collection/components/tooltip/tooltip.js +75 -40
- package/dist/collection/components/viewer-grid/viewer-grid.js +1 -1
- package/dist/components/dso-label.js +34 -39
- package/dist/components/dso-viewer-grid.js +1 -1
- package/dist/components/tooltip.js +76 -41
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/{p-4d70d9c0.entry.js → p-1ab86eed.entry.js} +1 -1
- package/dist/dso-toolkit/p-3b83e9c6.entry.js +1 -0
- package/dist/dso-toolkit/p-8a0a97de.entry.js +1 -0
- package/dist/esm/dso-label.entry.js +32 -37
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/dso-tooltip.entry.js +76 -41
- package/dist/esm/dso-viewer-grid.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/label/label.d.ts +7 -3
- package/dist/types/components/tooltip/tooltip.d.ts +6 -3
- package/dist/types/components.d.ts +4 -1
- package/package.json +2 -2
- package/dist/collection/components/label/mutation-observer.js +0 -11
- package/dist/dso-toolkit/p-0f37693a.entry.js +0 -1
- package/dist/dso-toolkit/p-bdc3b14b.entry.js +0 -1
- package/dist/types/components/label/mutation-observer.d.ts +0 -1
package/dist/esm/loader.js
CHANGED
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["dso-icon",[[1,"dso-icon",{"icon":[1]}]]],["dso-map-base-layers",[[1,"dso-map-base-layers",{"group":[1],"baseLayers":[16]}]]],["dso-map-overlays",[[1,"dso-map-overlays",{"group":[1],"overlays":[16]}]]],["dso-annotation-output",[[4,"dso-annotation-output",{"identifier":[1],"annotationPrefix":[1,"annotation-prefix"],"toggleAnnotation":[64]}]]],["dso-toggletip",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-expandable-heading",[[1,"dso-expandable-heading",{"open":[4],"heading":[1],"color":[1]}]]],["dso-header",[[6,"dso-header",{"mainMenu":[16],"useDropDownMenu":[1,"use-drop-down-menu"],"authStatus":[1,"auth-status"],"loginUrl":[1,"login-url"],"logoutUrl":[1,"logout-url"],"userProfileName":[1,"user-profile-name"],"userProfileUrl":[1,"user-profile-url"],"userHomeUrl":[1,"user-home-url"],"showDropDown":[32],"hasSubLogo":[32],"overflowMenuItems":[32]}]]],["dso-label",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"truncate":[4],"removeHover":[32],"removeFocus":[32],"textHover":[32],"textFocus":[32],"
|
|
13
|
+
return bootstrapLazy([["dso-icon",[[1,"dso-icon",{"icon":[1]}]]],["dso-map-base-layers",[[1,"dso-map-base-layers",{"group":[1],"baseLayers":[16]}]]],["dso-map-overlays",[[1,"dso-map-overlays",{"group":[1],"overlays":[16]}]]],["dso-annotation-output",[[4,"dso-annotation-output",{"identifier":[1],"annotationPrefix":[1,"annotation-prefix"],"toggleAnnotation":[64]}]]],["dso-toggletip",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-expandable-heading",[[1,"dso-expandable-heading",{"open":[4],"heading":[1],"color":[1]}]]],["dso-header",[[6,"dso-header",{"mainMenu":[16],"useDropDownMenu":[1,"use-drop-down-menu"],"authStatus":[1,"auth-status"],"loginUrl":[1,"login-url"],"logoutUrl":[1,"logout-url"],"userProfileName":[1,"user-profile-name"],"userProfileUrl":[1,"user-profile-url"],"userHomeUrl":[1,"user-home-url"],"showDropDown":[32],"hasSubLogo":[32],"overflowMenuItems":[32]}]]],["dso-label",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"truncate":[4],"removeHover":[32],"removeFocus":[32],"textHover":[32],"textFocus":[32],"isTruncated":[32],"labelText":[32],"truncateLabel":[64],"syncLabelText":[64]}]]],["dso-pagination",[[1,"dso-pagination",{"totalPages":[2,"total-pages"],"currentPage":[2,"current-page"],"formatHref":[16],"availablePositions":[32]},[[0,"dsoSizeChange","sizeChangeHandler"]]]]],["dso-tree-view",[[1,"dso-tree-view",{"collection":[16],"focusItem":[64]}]]],["dso-accordion-section",[[1,"dso-accordion-section",{"handleTitle":[1,"handle-title"],"heading":[1],"handleUrl":[1,"handle-url"],"state":[1],"attachmentCount":[2,"attachment-count"],"icon":[1],"status":[1],"open":[1540],"hasNestedSection":[32],"toggleSection":[64],"scrollSectionIntoView":[64]}]]],["dso-alert",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-annotation-button",[[0,"dso-annotation-button",{"identifier":[1]}]]],["dso-attachments-counter",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-autosuggest",[[6,"dso-autosuggest",{"suggestions":[16],"loading":[4],"loadingLabel":[1,"loading-label"],"loadingDelayed":[2,"loading-delayed"],"notFoundLabel":[1,"not-found-label"],"suggestOnFocus":[4,"suggest-on-focus"],"showSuggestions":[32],"selectedSuggestion":[32],"notFound":[32],"showLoading":[32]},[[4,"click","onDocumentClick"]]]]],["dso-date-picker",[[2,"dso-date-picker",{"name":[1],"identifier":[1],"disabled":[516],"role":[1],"direction":[1],"required":[4],"invalid":[4],"dsoAutofocus":[4,"dso-autofocus"],"value":[1537],"min":[1],"max":[1],"activeFocus":[32],"focusedDay":[32],"open":[32],"visible":[32],"setFocus":[64],"show":[64],"hide":[64]},[[6,"click","handleDocumentClick"]]]]],["dso-helpcenter-panel",[[1,"dso-helpcenter-panel",{"label":[1],"url":[1],"visibility":[32],"isOpen":[32],"slideState":[32],"loadIframe":[32]},[[8,"keydown","keyDownListener"]]]]],["dso-image-overlay",[[1,"dso-image-overlay",{"active":[32],"zoomable":[32]},[[2,"load","loadListener"]]]]],["dso-list-button",[[1,"dso-list-button",{"label":[1],"sublabel":[1],"subcontent":[1],"count":[2],"min":[8],"max":[8],"checked":[516],"disabled":[516],"manualInputWrapperElement":[32],"manualCount":[32]}]]],["dso-map-controls",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32],"toggleVisibility":[64]}]]],["dso-modal",[[1,"dso-modal",{"modalTitle":[1,"modal-title"],"role":[1],"showCloseButton":[4,"show-close-button"],"initialFocus":[1,"initial-focus"],"ariaId":[32],"hasFooter":[32]}]]],["dso-table",[[1,"dso-table",{"noModal":[516,"no-modal"],"isResponsive":[516,"is-responsive"],"modalActive":[32],"placeholderHeight":[32]}]]],["dso-viewer-grid",[[1,"dso-viewer-grid",{"filterpanelOpen":[516,"filterpanel-open"],"overlayOpen":[516,"overlay-open"],"initialMainSize":[1,"initial-main-size"],"mainSize":[32]}]]],["dso-accordion",[[1,"dso-accordion",{"variant":[513],"reverseAlign":[516,"reverse-align"],"allowMultipleOpen":[516,"allow-multiple-open"],"getState":[64],"toggleSection":[64],"animationEnd":[64],"closeOpenSections":[64]}]]],["dso-badge",[[1,"dso-badge",{"status":[1]}]]],["dso-banner",[[1,"dso-banner",{"status":[513]}]]],["dso-card",[[1,"dso-card",{"isSelectable":[516,"is-selectable"],"hasImage":[516,"has-image"],"clickable":[4],"imageShape":[513,"image-shape"]}]]],["dso-card-container",[[1,"dso-card-container",{"mode":[513]}]]],["dso-highlight-box",[[1,"dso-highlight-box",{"yellow":[4],"border":[4],"white":[4],"dropShadow":[4,"drop-shadow"],"step":[2]}]]],["dso-ozon-content",[[6,"dso-ozon-content",{"content":[1],"inline":[516],"deleted":[516],"interactive":[520],"state":[32]}]]],["dso-progress-bar",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-slide-toggle",[[4,"dso-slide-toggle",{"checked":[4],"disabled":[4],"accessibleLabel":[1,"accessible-label"],"labelledbyId":[1,"labelledby-id"],"identifier":[1],"hasVisibleLabel":[32]}]]],["dso-dropdown-menu",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4],"boundary":[1],"strategy":[1]}]]],["dso-expandable",[[1,"dso-expandable",{"open":[516]}]]],["dso-progress-indicator",[[1,"dso-progress-indicator",{"label":[1],"size":[513],"block":[4]}]]],["dso-responsive-element",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32],"getSize":[64]}]]],["dso-tooltip",[[1,"dso-tooltip",{"descriptive":[516],"position":[1],"strategy":[1],"noArrow":[4,"no-arrow"],"stateless":[4],"small":[4],"active":[1540],"hidden":[32],"activate":[64],"deactivate":[64]},[[0,"click","listenClick"]]]]],["dso-info-button",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1],"hover":[32],"setFocus":[64]}]]],["dso-info_2",[[6,"dso-selectable",{"type":[1],"identifier":[1],"name":[1],"value":[1],"invalid":[4],"describedById":[1,"described-by-id"],"labelledById":[1,"labelled-by-id"],"disabled":[4],"required":[4],"checked":[4],"indeterminate":[4],"infoFixed":[4,"info-fixed"],"infoActive":[32],"toggleInfo":[64]}],[1,"dso-info",{"fixed":[516],"active":[516]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -2,6 +2,7 @@ import { EventEmitter, ComponentInterface } from "../../stencil-public-runtime";
|
|
|
2
2
|
export declare class Label implements ComponentInterface {
|
|
3
3
|
private labelContent;
|
|
4
4
|
private keydownListenerActive;
|
|
5
|
+
private mutationObserver?;
|
|
5
6
|
private host;
|
|
6
7
|
compact?: boolean;
|
|
7
8
|
removable?: boolean;
|
|
@@ -11,16 +12,19 @@ export declare class Label implements ComponentInterface {
|
|
|
11
12
|
truncate?: boolean;
|
|
12
13
|
textHover?: boolean;
|
|
13
14
|
textFocus?: boolean;
|
|
14
|
-
|
|
15
|
-
labelText
|
|
15
|
+
isTruncated?: boolean;
|
|
16
|
+
labelText: string | null;
|
|
16
17
|
dsoRemoveClick: EventEmitter<MouseEvent>;
|
|
17
18
|
watchTruncate(truncate: boolean): void;
|
|
18
19
|
watchTooltipActive(): void;
|
|
19
20
|
private static statusMap;
|
|
20
21
|
truncateLabel(): Promise<void>;
|
|
21
|
-
|
|
22
|
+
/** **[Internal]** Synchronizes the text on the remove button and tooltip. You should never have to use this. */
|
|
23
|
+
syncLabelText(): Promise<void>;
|
|
22
24
|
componentDidLoad(): void;
|
|
23
25
|
disconnectedCallback(): void;
|
|
26
|
+
/** The mutationObserver fetches the text placed inside the label, this is then used for the remove button and tooltip. */
|
|
27
|
+
startMutationObserver(): void;
|
|
24
28
|
startTruncate(): void;
|
|
25
29
|
stopTruncate(): void;
|
|
26
30
|
keyDownListener: (event: KeyboardEvent) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare class Tooltip {
|
|
2
|
+
#private;
|
|
2
3
|
/**
|
|
3
4
|
* Defines if the tooltip is descriptive. A descriptive tooltip contains a meaningful message. Tooltips that are not descriptive are hidden from screenreaders using `aria-hidden`.
|
|
4
5
|
*/
|
|
@@ -40,16 +41,18 @@ export declare class Tooltip {
|
|
|
40
41
|
setStrategy(): void;
|
|
41
42
|
watchActive(): void;
|
|
42
43
|
private element;
|
|
43
|
-
private target;
|
|
44
44
|
private popper;
|
|
45
45
|
private callbacks;
|
|
46
46
|
private hidden;
|
|
47
47
|
listenClick(e: MouseEvent): void;
|
|
48
|
-
private applyMaxSize;
|
|
49
48
|
componentDidLoad(): void;
|
|
50
49
|
disconnectedCallback(): void;
|
|
51
50
|
componentDidRender(): void;
|
|
52
51
|
keyDownListener: (event: KeyboardEvent) => void;
|
|
53
52
|
render(): any;
|
|
54
|
-
private
|
|
53
|
+
private deactivatePopper;
|
|
54
|
+
private activatePopper;
|
|
55
|
+
private get target();
|
|
56
|
+
private set target(value);
|
|
57
|
+
private initializeTarget;
|
|
55
58
|
}
|
|
@@ -283,9 +283,12 @@ export namespace Components {
|
|
|
283
283
|
"compact"?: boolean;
|
|
284
284
|
"removable"?: boolean;
|
|
285
285
|
"status"?: "primary" | "info" | "success" | "warning" | "danger" | "error" | "bright" | "attention";
|
|
286
|
+
/**
|
|
287
|
+
* **[Internal]** Synchronizes the text on the remove button and tooltip. You should never have to use this.
|
|
288
|
+
*/
|
|
289
|
+
"syncLabelText": () => Promise<void>;
|
|
286
290
|
"truncate"?: boolean;
|
|
287
291
|
"truncateLabel": () => Promise<void>;
|
|
288
|
-
"updateTooltipText": () => Promise<void>;
|
|
289
292
|
}
|
|
290
293
|
interface DsoListButton {
|
|
291
294
|
"checked": boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dso-toolkit/core",
|
|
3
|
-
"version": "52.0.
|
|
3
|
+
"version": "52.0.2",
|
|
4
4
|
"description": "DSO Toolkit Web Components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/components/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@stencil/store": "^2.0.1",
|
|
25
25
|
"animejs": "3.2.1",
|
|
26
26
|
"clsx": "1.2.1",
|
|
27
|
-
"dso-toolkit": "52.0.
|
|
27
|
+
"dso-toolkit": "52.0.2",
|
|
28
28
|
"escape-string-regexp": "^5.0.0",
|
|
29
29
|
"focus-trap": "^7.1.0",
|
|
30
30
|
"popper-max-size-modifier": "^0.2.0",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const mutationObserver = new MutationObserver((entries) => {
|
|
2
|
-
entries.forEach((entry) => {
|
|
3
|
-
const component = entry.target;
|
|
4
|
-
if (isDsoLabelComponent(component)) {
|
|
5
|
-
component.updateTooltipText();
|
|
6
|
-
}
|
|
7
|
-
});
|
|
8
|
-
});
|
|
9
|
-
function isDsoLabelComponent(element) {
|
|
10
|
-
return element.updateTooltipText !== undefined;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as t,h as s,H as i,g as e}from"./p-98fd1658.js";import{c as l}from"./p-6a1980b4.js";const a=new MutationObserver((o=>{o.forEach((o=>{const t=o.target;void 0!==t.updateTooltipText&&t.updateTooltipText()}))})),r=new ResizeObserver((o=>{o.forEach((o=>{const t=o.target;void 0!==t.truncateLabel&&t.truncateLabel()}))})),n=class{constructor(s){o(this,s),this.dsoRemoveClick=t(this,"dsoRemoveClick",7),this.keydownListenerActive=!1,this.keyDownListener=o=>{"Escape"===o.key&&(this.textHover=!1,this.textFocus=!1)},this.compact=void 0,this.removable=void 0,this.status=void 0,this.removeHover=void 0,this.removeFocus=void 0,this.truncate=void 0,this.textHover=void 0,this.textFocus=void 0,this.truncatedContent=void 0,this.labelText=void 0}watchTruncate(o){o?this.startTruncate():this.stopTruncate()}watchTooltipActive(){this.keydownListenerActive||!this.textHover&&!this.textFocus||(document.addEventListener("keydown",this.keyDownListener),this.keydownListenerActive=!0),this.textHover||this.textFocus||(document.removeEventListener("keydown",this.keyDownListener),this.keydownListenerActive=!1)}async truncateLabel(){setTimeout((()=>{var o;this.labelContent&&(this.truncatedContent=(o=this.labelContent).scrollWidth>o.clientWidth?this.host.innerText:void 0)}))}async updateTooltipText(){this.labelText=this.host.innerText,this.truncate&&this.truncateLabel()}componentDidLoad(){this.labelText=this.host.innerText,a.observe(this.host,{attributes:!0,subtree:!0}),this.truncate&&this.startTruncate()}disconnectedCallback(){null==a||a.disconnect(),this.stopTruncate()}startTruncate(){r.observe(this.host),this.truncateLabel()}stopTruncate(){document.removeEventListener("keydown",this.keyDownListener),r.unobserve(this.host),this.truncatedContent=void 0,this.keydownListenerActive=!1}render(){const o=this.status&&n.statusMap.get(this.status);return s(i,{"aria-roledescription":this.truncate&&this.truncatedContent?"Deze tekst is visueel afgekapt en wordt volledig zichtbaar bij focus.":void 0},s("span",{"aria-describedby":"toggle-anchor",class:l("dso-label",{[`dso-label-${this.status}`]:this.status,"dso-compact":this.compact&&!this.removable,"dso-hover":this.removeHover||this.removeFocus})},s("slot",{name:"symbol"}),o&&s("span",{class:"sr-only"},o,": "),s("span",{class:l("dso-label-content",{"dso-truncate":!!this.truncate}),ref:o=>this.labelContent=o,tabindex:this.truncate&&this.truncatedContent?0:void 0,onMouseEnter:()=>this.textHover=!0,onMouseLeave:()=>this.textHover=!1,onFocus:()=>this.textFocus=!0,onBlur:()=>this.textFocus=!1},s("slot",null)),this.removable&&s("button",{type:"button",onClick:o=>this.dsoRemoveClick.emit(o),onMouseEnter:()=>this.removeHover=!0,onMouseLeave:()=>this.removeHover=!1,onFocus:()=>this.removeFocus=!0,onBlur:()=>this.removeFocus=!1},s("span",{class:"sr-only"},"Verwijder: ",this.labelText),s("dso-icon",{icon:"times"}))),s("dso-tooltip",{stateless:!0,id:"toggle-anchor",active:!!this.truncatedContent&&(this.textHover||this.textFocus),position:"top",strategy:"absolute"},this.truncatedContent))}get host(){return e(this)}static get watchers(){return{truncate:["watchTruncate"],textHover:["watchTooltipActive"],textFocus:["watchTooltipActive"]}}};n.statusMap=new Map([["info","Opmerking"],["success","Gelukt"],["warning","Waarschuwing"],["danger","Fout"]]),n.style=":host{display:inline-block;max-width:100%}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.dso-label{background-color:#f2f2f2;border-radius:4px;color:#191919;display:inline-block;line-height:1.5;max-width:100%;padding:4px 8px}.dso-label:focus-within,.dso-label.dso-hover{text-decoration:line-through}.dso-label button{background:none;border:0;border-radius:0 4px 4px 0;color:inherit;float:right;font-size:1rem;margin-bottom:-4px;margin-left:8px;margin-right:-4px;margin-top:0;padding:0}.dso-label button:hover{cursor:pointer}.dso-label button>dso-icon,.dso-label button>svg.di{display:block}.dso-label.dso-label-info{background-color:#6ca4d9;color:#000}.dso-label.dso-label-primary{background-color:#275937;color:#fff}.dso-label.dso-label-success{background-color:#39870c;color:#fff}.dso-label.dso-label-warning{background-color:#dcd400;color:#000}.dso-label.dso-label-danger{background-color:#ce3f51;color:#fff}.dso-label.dso-label-error{background-color:#ce3f51;color:#fff}.dso-label.dso-label-bright{background-color:#fff;color:#191919;outline:1px solid #ccc;outline-offset:-1px}.dso-label.dso-label-attention{background-color:#8b4a6a;color:#fff}.dso-label.dso-compact{padding:0 8px}.dso-label.dso-hover .dso-label-content{text-decoration:line-through}.dso-truncate.dso-label-content{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;white-space:nowrap}:host([removable]) .dso-truncate.dso-label-content{max-width:calc(100% - 28px)}";export{n as dso_label}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as o,H as i,g as e}from"./p-98fd1658.js";import{d as r,b as a,h as p,c as s}from"./p-d3ed00f6.js";import{c as n}from"./p-6a1980b4.js";var l={name:"maxSize",enabled:!0,phase:"main",requiresIfExists:["offset","preventOverflow","flip"],fn:function(t){var o=t.state,i=t.name,e=r(o,t.options),a=o.modifiersData.preventOverflow||{x:0,y:0},p=a.x,s=a.y,n=o.rects.popper,l=n.width,h=n.height,d=o.placement.split("-")[0];o.modifiersData[i]={width:l-e["left"===d?"left":"right"]-p,height:h-e["top"===d?"top":"bottom"]-s}}};const h=class{constructor(o){t(this,o),this.applyMaxSize={name:"applyMaxSize",enabled:!0,phase:a,requires:["maxSize"],fn({state:t}){let{width:o}=t.modifiersData.maxSize;o<160&&(o=160),t.styles.popper=Object.assign(Object.assign({},t.styles.popper),{maxWidth:`${o}px`})}},this.keyDownListener=t=>{"Escape"===t.key&&this.deactivate()},this.descriptive=!1,this.position="top",this.strategy="auto",this.noArrow=!1,this.stateless=void 0,this.small=void 0,this.active=!1,this.hidden=!0}async activate(){this.active=!0}async deactivate(){this.active=!1}watchPosition(){this.popper&&this.popper.setOptions({placement:this.position})}watchStrategy(){this.setStrategy()}setStrategy(){if(!this.popper)return;if("absolute"===this.strategy||"fixed"===this.strategy)return void this.popper.setOptions({strategy:this.strategy});let t=this.element;for(;t&&t.parentNode!==document;)if(t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentElement,null!==t&&p(t))return void this.popper.setOptions({strategy:"fixed"});this.popper.setOptions({strategy:"absolute"})}watchActive(){var t;this.active?(this.hidden=!1,this.stateless||setTimeout((()=>{var t;null===(t=this.popper)||void 0===t||t.setOptions({modifiers:[{name:"eventListeners",enabled:!0}]}),document.addEventListener("keydown",this.keyDownListener)}))):(this.stateless||(null===(t=this.popper)||void 0===t||t.setOptions({modifiers:[{name:"eventListeners",enabled:!1}]}),document.removeEventListener("keydown",this.keyDownListener)),setTimeout((()=>this.hidden=!0),150))}listenClick(t){t.stopPropagation()}componentDidLoad(){var t;if(this.popper)return;const o=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector(".tooltip");if(!(o instanceof HTMLElement))throw new Error("tooltip element is not instanceof HTMLElement");if(!this.element.id)throw new Error("Unable to find reference tooltip has no [id] attribute.");this.target=this.getTarget(this.element.id),this.popper=s(this.target,o,{placement:this.position,modifiers:[l,this.applyMaxSize]}),this.callbacks={activate:()=>this.active=!0,deactivate:()=>this.active=!1},this.stateless||(this.target.addEventListener("mouseenter",this.callbacks.activate),this.target.addEventListener("mouseleave",this.callbacks.deactivate),this.target.addEventListener("focus",this.callbacks.activate),this.target.addEventListener("blur",this.callbacks.deactivate))}disconnectedCallback(){var t;null===(t=this.popper)||void 0===t||t.destroy(),!this.stateless&&this.target&&this.callbacks&&(this.target.removeEventListener("mouseenter",this.callbacks.activate),this.target.removeEventListener("mouseleave",this.callbacks.deactivate),this.target.removeEventListener("focus",this.callbacks.activate),this.target.removeEventListener("blur",this.callbacks.deactivate)),this.callbacks=void 0,this.target=void 0}componentDidRender(){var t;this.setStrategy(),this.active&&(null===(t=this.popper)||void 0===t||t.update())}render(){return o(i,{class:{hidden:this.hidden},role:"tooltip"},o("div",{class:n("tooltip",{in:this.active})},!this.noArrow&&o("div",{"data-popper-arrow":!0,class:"tooltip-arrow"}),o("div",{"aria-hidden":!this.descriptive||void 0,class:n("tooltip-inner",{"dso-small":this.small})},o("slot",null))))}getTarget(t){const o=this.element.getRootNode();if(!(o instanceof Document||o instanceof ShadowRoot))throw new Error("rootNode is not instance of Document or ShadowRoot");const i=o.querySelector(`[aria-describedBy="${t}`);if(!i)throw new Error(`Unable to find reference with aria-describedby ${t}`);return i}get element(){return e(this)}static get watchers(){return{position:["watchPosition"],strategy:["watchStrategy"],active:["watchActive"]}}};h.style=":host(.hidden){visibility:hidden}:host-context(dso-toggletip){color:red !important}:host-context(dso-toggletip) *[data-popper-placement=top] .tooltip-arrow{margin-left:3px}:host-context(dso-toggletip) *[data-popper-placement=right] .tooltip-arrow{margin-top:0}:host-context(dso-toggletip) *[data-popper-placement=bottom] .tooltip-arrow{margin-left:3px}:host-context(dso-toggletip) *[data-popper-placement=left]{margin-right:-8px !important}:host-context(dso-toggletip) *[data-popper-placement=left] .tooltip-arrow{margin-top:0}*,*::after,*::before{box-sizing:border-box}.tooltip{font-family:Asap, sans-serif;font-style:normal;font-weight:400;line-height:1.5;line-break:auto;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;display:block;filter:drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));font-size:14px;opacity:0;position:absolute;transition:opacity 0.15s linear;z-index:410}.tooltip.in{opacity:1}.tooltip .tooltip-inner{background-color:#fff;border-radius:4px;color:#191919;display:inline-block;font-size:1rem;max-width:640px;padding:8px 16px;position:relative}.tooltip .tooltip-inner.dso-small{max-width:320px}.tooltip .tooltip-arrow{border-color:transparent;border-style:solid;height:0;width:0}.tooltip[data-popper-placement=top]{margin-top:-3px;padding:6px 0}.tooltip[data-popper-placement=top] .tooltip-arrow{border-top-color:#fff;border-width:6px 6px 0;bottom:0}.tooltip[data-popper-placement=top] .tooltip-arrow{margin-left:-3px}.tooltip[data-popper-placement=right]{margin-left:3px;padding:0 6px}.tooltip[data-popper-placement=right] .tooltip-arrow{border-right-color:#fff;border-width:6px 6px 6px 0;left:0}.tooltip[data-popper-placement=right] .tooltip-arrow{margin-top:-3px}.tooltip[data-popper-placement=bottom]{margin-top:3px;padding:6px 0}.tooltip[data-popper-placement=bottom] .tooltip-arrow{border-bottom-color:#fff;border-width:0 6px 6px;top:0}.tooltip[data-popper-placement=bottom] .tooltip-arrow{margin-left:-3px}.tooltip[data-popper-placement=left]{margin-left:-3px;padding:0 6px}.tooltip[data-popper-placement=left] .tooltip-arrow{border-left-color:#fff;border-width:6px 0 6px 6px;right:0}.tooltip[data-popper-placement=left] .tooltip-arrow{margin-top:-3px}";export{h as dso_tooltip}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const mutationObserver: MutationObserver;
|