@dso-toolkit/core 52.0.0 → 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-date-picker.cjs.entry.js +3 -5
- package/dist/cjs/dso-expandable-heading.cjs.entry.js +1 -1
- package/dist/cjs/dso-label.cjs.entry.js +48 -31
- 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 +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/date-picker/date-picker-day.js +2 -4
- package/dist/collection/components/date-picker/date-picker.css +3 -11
- package/dist/collection/components/expandable-heading/expandable-heading.css +15 -1
- package/dist/collection/components/label/label.js +68 -26
- package/dist/collection/components/label/resize-observer.js +11 -0
- package/dist/collection/components/tooltip/tooltip.js +75 -40
- package/dist/collection/components/viewer-grid/viewer-grid.css +9 -1
- package/dist/collection/components/viewer-grid/viewer-grid.js +1 -1
- package/dist/components/dso-date-picker.js +3 -5
- package/dist/components/dso-expandable-heading.js +1 -1
- package/dist/components/dso-label.js +46 -27
- package/dist/components/dso-viewer-grid.js +2 -2
- package/dist/components/tooltip.js +76 -41
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/{p-e00a3019.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/dso-toolkit/p-9984079e.entry.js +1 -0
- package/dist/dso-toolkit/p-d05ea304.entry.js +1 -0
- package/dist/esm/dso-date-picker.entry.js +3 -5
- package/dist/esm/dso-expandable-heading.entry.js +1 -1
- package/dist/esm/dso-label.entry.js +42 -25
- 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 +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/label/label.d.ts +8 -5
- package/dist/types/components/label/resize-observer.d.ts +1 -0
- package/dist/types/components/tooltip/tooltip.d.ts +6 -3
- package/dist/types/components.d.ts +5 -0
- package/package.json +2 -2
- package/dist/dso-toolkit/p-67df25a7.entry.js +0 -1
- package/dist/dso-toolkit/p-b8052fd6.entry.js +0 -1
- package/dist/dso-toolkit/p-bdc3b14b.entry.js +0 -1
- package/dist/dso-toolkit/p-f53860da.entry.js +0 -1
|
@@ -148,17 +148,15 @@ function getViewOfMonth(date, firstDayOfWeek = DaysOfWeek.Monday) {
|
|
|
148
148
|
const DatePickerDay = ({ focusedDay, today, day, onDaySelect, onKeyboardNavigation, focusedDayRef, inRange, }) => {
|
|
149
149
|
const isToday = isEqual(day, today);
|
|
150
150
|
const isFocused = isEqual(day, focusedDay);
|
|
151
|
-
const
|
|
151
|
+
const notCurrentMonth = day.getMonth() !== focusedDay.getMonth();
|
|
152
152
|
const isOutsideRange = !inRange;
|
|
153
153
|
function handleClick(e) {
|
|
154
154
|
onDaySelect(e, day);
|
|
155
155
|
}
|
|
156
156
|
return (index.h("button", { class: {
|
|
157
157
|
"dso-date__day": true,
|
|
158
|
-
"is-outside": isOutsideRange,
|
|
159
|
-
"is-disabled": isDisabled,
|
|
160
158
|
"is-today": isToday,
|
|
161
|
-
}, tabIndex: isFocused ? 0 : -1, onClick: handleClick, onKeyDown: onKeyboardNavigation, disabled: isOutsideRange ||
|
|
159
|
+
}, tabIndex: isFocused ? 0 : -1, onClick: handleClick, onKeyDown: onKeyboardNavigation, disabled: isOutsideRange || notCurrentMonth, type: "button", ref: (el) => {
|
|
162
160
|
if (isFocused && el && focusedDayRef) {
|
|
163
161
|
focusedDayRef(el);
|
|
164
162
|
}
|
|
@@ -221,7 +219,7 @@ const localization = {
|
|
|
221
219
|
monthNamesShort: ["Jan", "Feb", "Mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
|
|
222
220
|
};
|
|
223
221
|
|
|
224
|
-
const datePickerCss = ".sc-dso-date-picker-h{display:block}[invalid].sc-dso-date-picker-h .dso-date__input.sc-dso-date-picker{border-color:#ce3f51}.dso-date.sc-dso-date-picker *.sc-dso-date-picker,.dso-date.sc-dso-date-picker *.sc-dso-date-picker::before,.dso-date.sc-dso-date-picker *.sc-dso-date-picker::after{box-sizing:border-box}.dso-date.sc-dso-date-picker{box-sizing:border-box;color:#191919;display:block;font-family:\"Asap\", sans-serif;margin:0;position:relative;text-align:left;width:100%}.dso-date.sc-dso-date-picker:not(.dso-visible) .dso-date__dialog.sc-dso-date-picker{display:none}.dso-date__input.sc-dso-date-picker{display:block;width:100%;height:40px;padding:6px 14px;font-size:1rem;line-height:1.5;color:#191919;background-color:#fff;background-image:none;border:1px solid #275937;border-radius:4px;transition:border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s}.dso-date__input.sc-dso-date-picker::-moz-placeholder{color:#666;opacity:1}.dso-date__input.sc-dso-date-picker:-ms-input-placeholder{color:#666}.dso-date__input.sc-dso-date-picker::-webkit-input-placeholder{color:#666}.dso-date__input.sc-dso-date-picker::-ms-expand{background-color:transparent;border:0}.dso-date__input.sc-dso-date-picker:focus{border-color:#275937;outline:0;box-shadow:inset 0 0 0 1px #275937}.dso-date__input[disabled].sc-dso-date-picker,.dso-date__input[readonly].sc-dso-date-picker,fieldset[disabled].sc-dso-date-picker .dso-date__input.sc-dso-date-picker{background-color:#fff;opacity:1}.dso-date__input[disabled].sc-dso-date-picker,fieldset[disabled].sc-dso-date-picker .dso-date__input.sc-dso-date-picker{cursor:default}.dso-date__input[disabled].sc-dso-date-picker{border-color:#e5e5e5;color:#999}.dso-date__input[readonly].sc-dso-date-picker{border-width:1px}.dso-date__input[type=text].sc-dso-date-picker{line-height:40px}.dso-date__input[size].sc-dso-date-picker{width:auto}.dso-date__toggle.sc-dso-date-picker{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:transparent;border:0;border-radius:0;border-bottom-right-radius:4px;border-top-right-radius:4px;color:#39870c;cursor:pointer;display:flex;height:38px;justify-content:center;padding:0;position:absolute;right:0;transform:translateY(-50%);top:50%;user-select:none;width:38px;z-index:101}.dso-date__toggle.sc-dso-date-picker:disabled{color:#afcf9d;cursor:default}.dso-date__dialog.sc-dso-date-picker{border-width:1px;display:flex;right:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;will-change:transform, opacity, visibility;z-index:210}@media (max-width: 35.9375em){.dso-date__dialog.sc-dso-date-picker{background:rgba(25, 25, 25, 0.5);bottom:0;position:fixed;left:0;right:0;top:0;transform:translateZ(0);transform-origin:bottom center}}.dso-date__dialog.is-left.sc-dso-date-picker{left:-11px;right:auto;width:auto}.dso-date__dialog.is-active.sc-dso-date-picker{opacity:1;transform:scale(1.0001) translateZ(0) translateY(0);visibility:visible}.dso-date__dialog-content.sc-dso-date-picker{background:#fff;border:1px solid rgba(0, 0, 0, 0.1);border-radius:4px;box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.4);margin-left:auto;margin-right:-1px;margin-top:8px;max-width:310px;min-width:290px;padding:16px;position:relative;transform:none;width:100%;z-index:210}@media (max-width: 35.9375em){.dso-date__dialog-content.sc-dso-date-picker{border:0;border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px;bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active.sc-dso-date-picker .dso-date__dialog-content.sc-dso-date-picker{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.dso-date__table.sc-dso-date-picker{border-collapse:collapse;border-spacing:0;color:#191919;font-size:1rem;font-weight:400;line-height:1.25;min-width:280px;table-layout:fixed;text-align:center;width:100%}.dso-date__table-header.sc-dso-date-picker{font-size:0.875em;font-weight:600;height:36px;line-height:36px;text-decoration:none;text-transform:uppercase}.dso-date__cell.sc-dso-date-picker{height:40px;padding:1px;text-align:center;width:40px}.dso-date__day.sc-dso-date-picker{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;box-shadow:0 0 0 1px transparent;color:#191919;cursor:pointer;display:inline-block;font-family:\"Asap\", sans-serif;font-variant-numeric:tabular-nums;font-weight:400;height:38px;line-height:0;padding:0;position:relative;text-align:center;vertical-align:middle;width:38px;z-index:100}.dso-date__day.is-today.sc-dso-date-picker{background:transparent;height:36px;box-shadow:0 0 0 1px #39870c;width:36px}.dso-date__day.sc-dso-date-picker:hover,.dso-date__day.sc-dso-date-picker:active{background:#39870c;color:#fff}.dso-date__day.sc-dso-date-picker:focus{background:transparent;box-shadow:0 0 0 2px #275937;color:#191919;height:34px;outline:0;width:34px}[aria-selected=true].sc-dso-date-picker .dso-date__day.sc-dso-date-picker{background:#39870c;color:#fff}[aria-selected=true].sc-dso-date-picker .dso-date__day.sc-dso-date-picker:focus{background:transparent}[aria-selected=true].sc-dso-date-picker .dso-date__day.sc-dso-date-picker:focus span[aria-hidden=true].sc-dso-date-picker{background:#39870c;border:1px solid #fff;line-height:32px}.dso-date__day.
|
|
222
|
+
const datePickerCss = ".sc-dso-date-picker-h{display:block}[invalid].sc-dso-date-picker-h .dso-date__input.sc-dso-date-picker{border-color:#ce3f51}.dso-date.sc-dso-date-picker *.sc-dso-date-picker,.dso-date.sc-dso-date-picker *.sc-dso-date-picker::before,.dso-date.sc-dso-date-picker *.sc-dso-date-picker::after{box-sizing:border-box}.dso-date.sc-dso-date-picker{box-sizing:border-box;color:#191919;display:block;font-family:\"Asap\", sans-serif;margin:0;position:relative;text-align:left;width:100%}.dso-date.sc-dso-date-picker:not(.dso-visible) .dso-date__dialog.sc-dso-date-picker{display:none}.dso-date__input.sc-dso-date-picker{display:block;width:100%;height:40px;padding:6px 14px;font-size:1rem;line-height:1.5;color:#191919;background-color:#fff;background-image:none;border:1px solid #275937;border-radius:4px;transition:border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s}.dso-date__input.sc-dso-date-picker::-moz-placeholder{color:#666;opacity:1}.dso-date__input.sc-dso-date-picker:-ms-input-placeholder{color:#666}.dso-date__input.sc-dso-date-picker::-webkit-input-placeholder{color:#666}.dso-date__input.sc-dso-date-picker::-ms-expand{background-color:transparent;border:0}.dso-date__input.sc-dso-date-picker:focus{border-color:#275937;outline:0;box-shadow:inset 0 0 0 1px #275937}.dso-date__input[disabled].sc-dso-date-picker,.dso-date__input[readonly].sc-dso-date-picker,fieldset[disabled].sc-dso-date-picker .dso-date__input.sc-dso-date-picker{background-color:#fff;opacity:1}.dso-date__input[disabled].sc-dso-date-picker,fieldset[disabled].sc-dso-date-picker .dso-date__input.sc-dso-date-picker{cursor:default}.dso-date__input[disabled].sc-dso-date-picker{border-color:#e5e5e5;color:#999}.dso-date__input[readonly].sc-dso-date-picker{border-width:1px}.dso-date__input[type=text].sc-dso-date-picker{line-height:40px}.dso-date__input[size].sc-dso-date-picker{width:auto}.dso-date__toggle.sc-dso-date-picker{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:transparent;border:0;border-radius:0;border-bottom-right-radius:4px;border-top-right-radius:4px;color:#39870c;cursor:pointer;display:flex;height:38px;justify-content:center;padding:0;position:absolute;right:0;transform:translateY(-50%);top:50%;user-select:none;width:38px;z-index:101}.dso-date__toggle.sc-dso-date-picker:disabled{color:#afcf9d;cursor:default}.dso-date__dialog.sc-dso-date-picker{border-width:1px;display:flex;right:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;will-change:transform, opacity, visibility;z-index:210}@media (max-width: 35.9375em){.dso-date__dialog.sc-dso-date-picker{background:rgba(25, 25, 25, 0.5);bottom:0;position:fixed;left:0;right:0;top:0;transform:translateZ(0);transform-origin:bottom center}}.dso-date__dialog.is-left.sc-dso-date-picker{left:-11px;right:auto;width:auto}.dso-date__dialog.is-active.sc-dso-date-picker{opacity:1;transform:scale(1.0001) translateZ(0) translateY(0);visibility:visible}.dso-date__dialog-content.sc-dso-date-picker{background:#fff;border:1px solid rgba(0, 0, 0, 0.1);border-radius:4px;box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.4);margin-left:auto;margin-right:-1px;margin-top:8px;max-width:310px;min-width:290px;padding:16px;position:relative;transform:none;width:100%;z-index:210}@media (max-width: 35.9375em){.dso-date__dialog-content.sc-dso-date-picker{border:0;border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px;bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active.sc-dso-date-picker .dso-date__dialog-content.sc-dso-date-picker{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.dso-date__table.sc-dso-date-picker{border-collapse:collapse;border-spacing:0;color:#191919;font-size:1rem;font-weight:400;line-height:1.25;min-width:280px;table-layout:fixed;text-align:center;width:100%}.dso-date__table-header.sc-dso-date-picker{font-size:0.875em;font-weight:600;height:36px;line-height:36px;text-align:center;text-decoration:none;text-transform:uppercase}.dso-date__cell.sc-dso-date-picker{height:40px;padding:1px;text-align:center;width:40px}.dso-date__day.sc-dso-date-picker{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;box-shadow:0 0 0 1px transparent;color:#191919;cursor:pointer;display:inline-block;font-family:\"Asap\", sans-serif;font-variant-numeric:tabular-nums;font-weight:400;height:38px;line-height:0;padding:0;position:relative;text-align:center;vertical-align:middle;width:38px;z-index:100}.dso-date__day.is-today.sc-dso-date-picker{background:transparent;height:36px;box-shadow:0 0 0 1px #39870c;width:36px}.dso-date__day.sc-dso-date-picker:hover,.dso-date__day.sc-dso-date-picker:active{background:#39870c;color:#fff}.dso-date__day.sc-dso-date-picker:focus{background:transparent;box-shadow:0 0 0 2px #275937;color:#191919;height:34px;outline:0;width:34px}[aria-selected=true].sc-dso-date-picker .dso-date__day.sc-dso-date-picker{background:#39870c;color:#fff}[aria-selected=true].sc-dso-date-picker .dso-date__day.sc-dso-date-picker:focus{background:transparent}[aria-selected=true].sc-dso-date-picker .dso-date__day.sc-dso-date-picker:focus span[aria-hidden=true].sc-dso-date-picker{background:#39870c;border:1px solid #fff;line-height:32px}.dso-date__day.sc-dso-date-picker:disabled{background:#fff;color:#ccc;cursor:default}.dso-date__day.sc-dso-date-picker span[aria-hidden=true].sc-dso-date-picker{border-radius:50%;display:inline-block;height:34px;line-height:34px;width:34px}.dso-date__header.sc-dso-date-picker{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.dso-date__header.sc-dso-date-picker span.sc-dso-date-picker{font-size:0.875rem}.dso-date__nav.sc-dso-date-picker{white-space:nowrap}.dso-date__prev.sc-dso-date-picker,.dso-date__next.sc-dso-date-picker{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:transparent;border:1px solid #39870c;border-radius:4px;box-sizing:border-box;color:#39870c;cursor:pointer;display:inline-flex;font-size:1em;height:32px;justify-content:center;margin-left:8px;padding:0;width:32px}@media (max-width: 35.9375em){.dso-date__prev.sc-dso-date-picker,.dso-date__next.sc-dso-date-picker{height:40px;width:40px}}.dso-date__prev.sc-dso-date-picker:hover,.dso-date__prev.sc-dso-date-picker:active,.dso-date__next.sc-dso-date-picker:hover,.dso-date__next.sc-dso-date-picker:active{background-color:#39870c;color:#fff}.dso-date__prev.sc-dso-date-picker:focus,.dso-date__next.sc-dso-date-picker:focus{background:transparent;color:#39870c}.dso-date__prev.sc-dso-date-picker:disabled,.dso-date__prev.sc-dso-date-picker:disabled:hover,.dso-date__next.sc-dso-date-picker:disabled,.dso-date__next.sc-dso-date-picker:disabled:hover{background-color:#fff;border-color:#afcf9d;color:#afcf9d;opacity:1}.dso-date__prev.sc-dso-date-picker svg.sc-dso-date-picker,.dso-date__next.sc-dso-date-picker svg.sc-dso-date-picker{margin:0 auto}.dso-date__select.sc-dso-date-picker{display:inline-flex;height:28px;line-height:28px;position:relative}.dso-date__select.sc-dso-date-picker span.sc-dso-date-picker{margin-right:4px}.dso-date__select.sc-dso-date-picker select.sc-dso-date-picker{color:#275937;cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:101}.dso-date__select.sc-dso-date-picker select.sc-dso-date-picker:focus+.dso-date__select-label.sc-dso-date-picker{box-shadow:0 0 0 2px #275937}.dso-date__select.sc-dso-date-picker select.sc-dso-date-picker:disabled{color:#afcf9d}.dso-date__select-label.sc-dso-date-picker{align-items:center;border-radius:4px;color:#39870c;display:flex;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:100}.dso-date__select-label.sc-dso-date-picker span.sc-dso-date-picker{font-size:1.25rem;font-weight:600;line-height:1.25}.dso-date__select-label.sc-dso-date-picker svg.sc-dso-date-picker{width:16px;height:16px}.dso-date__mobile.sc-dso-date-picker{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;font-size:1em;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.dso-date__mobile.sc-dso-date-picker{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-16px;top:-16px;width:auto}}.dso-date__mobile-heading.sc-dso-date-picker{display:inline-block;font-weight:600;max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.dso-date__mobile-heading.sc-dso-date-picker{display:none}}.dso-date__close.sc-dso-date-picker{-webkit-appearance:none;align-items:center;appearance:none;background-color:#fff;border:0;border-radius:50%;color:#39870c;cursor:pointer;display:flex;font-size:1em;height:32px;justify-content:center;margin-right:-4px;padding:0;width:32px}@media (min-width: 36em){.dso-date__close.sc-dso-date-picker{margin-right:0;opacity:0}}.dso-date__close.sc-dso-date-picker:focus{box-shadow:0 0 0 2px #275937;outline:none}@media (min-width: 36em){.dso-date__close.sc-dso-date-picker:focus{opacity:1}}.dso-date__vhidden.sc-dso-date-picker{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}";
|
|
225
223
|
|
|
226
224
|
function range(from, to) {
|
|
227
225
|
const result = [];
|
|
@@ -22,7 +22,7 @@ const Heading = ({ heading, ref, className }, children) => {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
const expandableHeadingCss = "h1,.h1,h2,.h2,h3,.h3{margin-bottom:16px;margin-top:24px}h1,.h1{line-height:1.25}h1{
|
|
25
|
+
const expandableHeadingCss = "h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6{color:#275937}h1,.h1,h2,.h2,h3,.h3{margin-bottom:16px;margin-top:24px}h1,.h1{line-height:1.25}h1{font-size:2rem;font-weight:700}h2,.h2{line-height:1.33}h2{color:#275937;font-size:1.5rem;font-weight:700}h3,.h3{line-height:1.2}h3{color:#275937;font-size:1.25rem;font-weight:600}h4,.h4,h5,.h5,h6,.h6{margin-bottom:16px;margin-top:12px}h4,.h4{line-height:1.5}h4{color:#275937;font-size:1rem;font-weight:600}h5,.h5{line-height:1.5}h5{color:#191919;font-size:1rem;font-weight:600}h6,.h6{line-height:1.5}:host{display:block}*,*::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}.expandable-heading{align-items:center;display:flex;margin-bottom:8px;margin-top:8px}.expandable-heading h2,.expandable-heading h3,.expandable-heading h4,.expandable-heading h5,.expandable-heading h6{font-size:1rem;margin-bottom:0;margin-right:8px;margin-top:0}.expandable-heading button{align-items:flex-start;cursor:pointer;background-color:transparent;border:0;color:inherit;display:flex;line-height:24px;font-size:inherit;font-weight:inherit;padding:0;text-align:left}.expandable-heading button>dso-icon{flex-shrink:0}.expandable-heading.dso-expandable-heading-black button{color:#000}dso-expandable{padding-left:24px}.addons-end{display:inline-block;margin-left:auto}";
|
|
26
26
|
|
|
27
27
|
const ExpandableHeading = class {
|
|
28
28
|
constructor(hostRef) {
|
|
@@ -2,8 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-ecec64a0.js');
|
|
5
|
+
const index$1 = require('./index-ecec64a0.js');
|
|
6
6
|
const clsx_m = require('./clsx.m-b81c6b86.js');
|
|
7
|
+
const index = require('./index-794ad37a.js');
|
|
8
|
+
|
|
9
|
+
const resizeObserver = new ResizeObserver(index.debounce_1.debounce((entries) => {
|
|
10
|
+
entries.forEach(({ target }) => {
|
|
11
|
+
if (isDsoLabelComponent(target)) {
|
|
12
|
+
target.truncateLabel();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}, 150));
|
|
16
|
+
function isDsoLabelComponent(element) {
|
|
17
|
+
return element.truncateLabel !== undefined;
|
|
18
|
+
}
|
|
7
19
|
|
|
8
20
|
const labelCss = ":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)}";
|
|
9
21
|
|
|
@@ -12,15 +24,8 @@ function hasEllipses(el) {
|
|
|
12
24
|
}
|
|
13
25
|
const Label = class {
|
|
14
26
|
constructor(hostRef) {
|
|
15
|
-
index.registerInstance(this, hostRef);
|
|
16
|
-
this.dsoRemoveClick = index.createEvent(this, "dsoRemoveClick", 7);
|
|
17
|
-
this.mutationObserver = new MutationObserver(() => {
|
|
18
|
-
this.labelText = this.host.innerText;
|
|
19
|
-
if (this.truncate) {
|
|
20
|
-
this.truncateLabel();
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
this.resizeObserver = new ResizeObserver(() => this.truncateLabel());
|
|
27
|
+
index$1.registerInstance(this, hostRef);
|
|
28
|
+
this.dsoRemoveClick = index$1.createEvent(this, "dsoRemoveClick", 7);
|
|
24
29
|
this.keydownListenerActive = false;
|
|
25
30
|
this.keyDownListener = (event) => {
|
|
26
31
|
if (event.key === "Escape") {
|
|
@@ -36,8 +41,8 @@ const Label = class {
|
|
|
36
41
|
this.truncate = undefined;
|
|
37
42
|
this.textHover = undefined;
|
|
38
43
|
this.textFocus = undefined;
|
|
39
|
-
this.
|
|
40
|
-
this.labelText =
|
|
44
|
+
this.isTruncated = undefined;
|
|
45
|
+
this.labelText = null;
|
|
41
46
|
}
|
|
42
47
|
watchTruncate(truncate) {
|
|
43
48
|
if (truncate) {
|
|
@@ -57,51 +62,63 @@ const Label = class {
|
|
|
57
62
|
this.keydownListenerActive = false;
|
|
58
63
|
}
|
|
59
64
|
}
|
|
60
|
-
truncateLabel() {
|
|
65
|
+
async truncateLabel() {
|
|
61
66
|
setTimeout(() => {
|
|
62
|
-
|
|
63
|
-
this.truncatedContent = hasEllipses(this.labelContent) ? this.host.innerText : undefined;
|
|
64
|
-
}
|
|
67
|
+
this.isTruncated = this.labelContent && hasEllipses(this.labelContent);
|
|
65
68
|
});
|
|
66
69
|
}
|
|
70
|
+
/** **[Internal]** Synchronizes the text on the remove button and tooltip. You should never have to use this. */
|
|
71
|
+
async syncLabelText() {
|
|
72
|
+
this.labelText = this.host.textContent;
|
|
73
|
+
}
|
|
67
74
|
componentDidLoad() {
|
|
68
|
-
this.labelText = this.host.innerText;
|
|
69
|
-
this.mutationObserver.observe(this.host, {
|
|
70
|
-
attributes: true,
|
|
71
|
-
subtree: true,
|
|
72
|
-
});
|
|
73
75
|
if (this.truncate) {
|
|
74
76
|
this.startTruncate();
|
|
75
77
|
}
|
|
78
|
+
if (this.removable) {
|
|
79
|
+
this.startMutationObserver();
|
|
80
|
+
}
|
|
76
81
|
}
|
|
77
82
|
disconnectedCallback() {
|
|
78
|
-
var _a;
|
|
79
|
-
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
80
83
|
this.stopTruncate();
|
|
81
84
|
}
|
|
85
|
+
/** The mutationObserver fetches the text placed inside the label, this is then used for the remove button and tooltip. */
|
|
86
|
+
startMutationObserver() {
|
|
87
|
+
if (this.mutationObserver) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.mutationObserver = new MutationObserver((entries) => entries.forEach(() => this.syncLabelText()));
|
|
91
|
+
this.mutationObserver.observe(this.host, {
|
|
92
|
+
characterData: true,
|
|
93
|
+
subtree: true,
|
|
94
|
+
attributes: true,
|
|
95
|
+
});
|
|
96
|
+
this.labelText = this.host.textContent;
|
|
97
|
+
}
|
|
82
98
|
startTruncate() {
|
|
83
|
-
|
|
99
|
+
resizeObserver.observe(this.host);
|
|
100
|
+
this.startMutationObserver();
|
|
84
101
|
this.truncateLabel();
|
|
85
102
|
}
|
|
86
103
|
stopTruncate() {
|
|
87
104
|
document.removeEventListener("keydown", this.keyDownListener);
|
|
88
|
-
|
|
89
|
-
this.
|
|
105
|
+
resizeObserver.unobserve(this.host);
|
|
106
|
+
this.isTruncated = undefined;
|
|
90
107
|
this.keydownListenerActive = false;
|
|
91
108
|
}
|
|
92
109
|
render() {
|
|
93
110
|
const status = this.status && Label.statusMap.get(this.status);
|
|
94
|
-
return (index.h(index.Host, { "aria-roledescription": this.truncate && this.
|
|
111
|
+
return (index$1.h(index$1.Host, { "aria-roledescription": this.truncate && this.isTruncated
|
|
95
112
|
? "Deze tekst is visueel afgekapt en wordt volledig zichtbaar bij focus."
|
|
96
|
-
: undefined }, index.h("span", { "aria-describedby": "toggle-anchor", class: clsx_m.clsx("dso-label", {
|
|
113
|
+
: undefined }, index$1.h("span", { "aria-describedby": "toggle-anchor", class: clsx_m.clsx("dso-label", {
|
|
97
114
|
[`dso-label-${this.status}`]: this.status,
|
|
98
115
|
"dso-compact": this.compact && !this.removable,
|
|
99
116
|
"dso-hover": this.removeHover || this.removeFocus,
|
|
100
|
-
}) }, index.h("slot", { name: "symbol" }), status && index.h("span", { class: "sr-only" }, status, ": "), index.h("span", { class: clsx_m.clsx("dso-label-content", {
|
|
117
|
+
}) }, index$1.h("slot", { name: "symbol" }), status && index$1.h("span", { class: "sr-only" }, status, ": "), index$1.h("span", { class: clsx_m.clsx("dso-label-content", {
|
|
101
118
|
"dso-truncate": !!this.truncate,
|
|
102
|
-
}), ref: (element) => (this.labelContent = element), tabindex: this.truncate && this.
|
|
119
|
+
}), ref: (element) => (this.labelContent = element), tabindex: this.truncate && this.isTruncated ? 0 : undefined, onMouseEnter: () => (this.textHover = true), onMouseLeave: () => (this.textHover = false), onFocus: () => (this.textFocus = true), onBlur: () => (this.textFocus = false) }, index$1.h("slot", null)), this.removable && (index$1.h("button", { type: "button", onClick: (e) => this.dsoRemoveClick.emit(e), onMouseEnter: () => (this.removeHover = true), onMouseLeave: () => (this.removeHover = false), onFocus: () => (this.removeFocus = true), onBlur: () => (this.removeFocus = false) }, index$1.h("span", { class: "sr-only" }, "Verwijder: ", this.labelText), index$1.h("dso-icon", { icon: "times" })))), this.isTruncated && (index$1.h("dso-tooltip", { stateless: true, id: "toggle-anchor", active: this.textHover || this.textFocus, position: "top", strategy: "absolute" }, this.labelText))));
|
|
103
120
|
}
|
|
104
|
-
get host() { return index.getElement(this); }
|
|
121
|
+
get host() { return index$1.getElement(this); }
|
|
105
122
|
static get watchers() { return {
|
|
106
123
|
"truncate": ["watchTruncate"],
|
|
107
124
|
"textHover": ["watchTooltipActive"],
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["dso-icon.cjs",[[1,"dso-icon",{"icon":[1]}]]],["dso-map-base-layers.cjs",[[1,"dso-map-base-layers",{"group":[1],"baseLayers":[16]}]]],["dso-map-overlays.cjs",[[1,"dso-map-overlays",{"group":[1],"overlays":[16]}]]],["dso-annotation-output.cjs",[[4,"dso-annotation-output",{"identifier":[1],"annotationPrefix":[1,"annotation-prefix"],"toggleAnnotation":[64]}]]],["dso-toggletip.cjs",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-expandable-heading.cjs",[[1,"dso-expandable-heading",{"open":[4],"heading":[1],"color":[1]}]]],["dso-header.cjs",[[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.cjs",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"truncate":[4],"removeHover":[32],"removeFocus":[32],"textHover":[32],"textFocus":[32],"
|
|
18
|
+
return index.bootstrapLazy([["dso-icon.cjs",[[1,"dso-icon",{"icon":[1]}]]],["dso-map-base-layers.cjs",[[1,"dso-map-base-layers",{"group":[1],"baseLayers":[16]}]]],["dso-map-overlays.cjs",[[1,"dso-map-overlays",{"group":[1],"overlays":[16]}]]],["dso-annotation-output.cjs",[[4,"dso-annotation-output",{"identifier":[1],"annotationPrefix":[1,"annotation-prefix"],"toggleAnnotation":[64]}]]],["dso-toggletip.cjs",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-expandable-heading.cjs",[[1,"dso-expandable-heading",{"open":[4],"heading":[1],"color":[1]}]]],["dso-header.cjs",[[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.cjs",[[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.cjs",[[1,"dso-pagination",{"totalPages":[2,"total-pages"],"currentPage":[2,"current-page"],"formatHref":[16],"availablePositions":[32]},[[0,"dsoSizeChange","sizeChangeHandler"]]]]],["dso-tree-view.cjs",[[1,"dso-tree-view",{"collection":[16],"focusItem":[64]}]]],["dso-accordion-section.cjs",[[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.cjs",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-annotation-button.cjs",[[0,"dso-annotation-button",{"identifier":[1]}]]],["dso-attachments-counter.cjs",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-autosuggest.cjs",[[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.cjs",[[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.cjs",[[1,"dso-helpcenter-panel",{"label":[1],"url":[1],"visibility":[32],"isOpen":[32],"slideState":[32],"loadIframe":[32]},[[8,"keydown","keyDownListener"]]]]],["dso-image-overlay.cjs",[[1,"dso-image-overlay",{"active":[32],"zoomable":[32]},[[2,"load","loadListener"]]]]],["dso-list-button.cjs",[[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.cjs",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32],"toggleVisibility":[64]}]]],["dso-modal.cjs",[[1,"dso-modal",{"modalTitle":[1,"modal-title"],"role":[1],"showCloseButton":[4,"show-close-button"],"initialFocus":[1,"initial-focus"],"ariaId":[32],"hasFooter":[32]}]]],["dso-table.cjs",[[1,"dso-table",{"noModal":[516,"no-modal"],"isResponsive":[516,"is-responsive"],"modalActive":[32],"placeholderHeight":[32]}]]],["dso-viewer-grid.cjs",[[1,"dso-viewer-grid",{"filterpanelOpen":[516,"filterpanel-open"],"overlayOpen":[516,"overlay-open"],"initialMainSize":[1,"initial-main-size"],"mainSize":[32]}]]],["dso-accordion.cjs",[[1,"dso-accordion",{"variant":[513],"reverseAlign":[516,"reverse-align"],"allowMultipleOpen":[516,"allow-multiple-open"],"getState":[64],"toggleSection":[64],"animationEnd":[64],"closeOpenSections":[64]}]]],["dso-badge.cjs",[[1,"dso-badge",{"status":[1]}]]],["dso-banner.cjs",[[1,"dso-banner",{"status":[513]}]]],["dso-card.cjs",[[1,"dso-card",{"isSelectable":[516,"is-selectable"],"hasImage":[516,"has-image"],"clickable":[4],"imageShape":[513,"image-shape"]}]]],["dso-card-container.cjs",[[1,"dso-card-container",{"mode":[513]}]]],["dso-highlight-box.cjs",[[1,"dso-highlight-box",{"yellow":[4],"border":[4],"white":[4],"dropShadow":[4,"drop-shadow"],"step":[2]}]]],["dso-ozon-content.cjs",[[6,"dso-ozon-content",{"content":[1],"inline":[516],"deleted":[516],"interactive":[520],"state":[32]}]]],["dso-progress-bar.cjs",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-slide-toggle.cjs",[[4,"dso-slide-toggle",{"checked":[4],"disabled":[4],"accessibleLabel":[1,"accessible-label"],"labelledbyId":[1,"labelledby-id"],"identifier":[1],"hasVisibleLabel":[32]}]]],["dso-dropdown-menu.cjs",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4],"boundary":[1],"strategy":[1]}]]],["dso-expandable.cjs",[[1,"dso-expandable",{"open":[516]}]]],["dso-progress-indicator.cjs",[[1,"dso-progress-indicator",{"label":[1],"size":[513],"block":[4]}]]],["dso-responsive-element.cjs",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32],"getSize":[64]}]]],["dso-tooltip.cjs",[[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.cjs",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1],"hover":[32],"setFocus":[64]}]]],["dso-info_2.cjs",[[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);
|
|
19
19
|
});
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-ecec64a0.js');
|
|
6
6
|
const hasOverflow = require('./has-overflow-b1b4f3f3.js');
|
|
7
7
|
const clsx_m = require('./clsx.m-b81c6b86.js');
|
|
8
|
+
const index$1 = require('./index-794ad37a.js');
|
|
8
9
|
|
|
9
10
|
var maxSize = {
|
|
10
11
|
name: 'maxSize',
|
|
@@ -42,29 +43,57 @@ var maxSize = {
|
|
|
42
43
|
|
|
43
44
|
const tooltipCss = ":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}";
|
|
44
45
|
|
|
46
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
47
|
+
if (kind === "a" && !f)
|
|
48
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
49
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
50
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
51
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
52
|
+
};
|
|
53
|
+
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
54
|
+
if (kind === "m")
|
|
55
|
+
throw new TypeError("Private method is not writable");
|
|
56
|
+
if (kind === "a" && !f)
|
|
57
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
58
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
59
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
60
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
61
|
+
};
|
|
62
|
+
var _Tooltip_target;
|
|
45
63
|
// Keep const in sync with $tooltip-transition-duration in dso-toolkit/src/components/tooltip/tooltip.scss tooltip_root() mixin
|
|
46
64
|
const transitionDuration = 150;
|
|
65
|
+
const applyMaxSize = {
|
|
66
|
+
name: "applyMaxSize",
|
|
67
|
+
enabled: true,
|
|
68
|
+
phase: hasOverflow.beforeWrite,
|
|
69
|
+
requires: ["maxSize"],
|
|
70
|
+
fn({ state }) {
|
|
71
|
+
let { width } = state.modifiersData.maxSize;
|
|
72
|
+
if (width < 160) {
|
|
73
|
+
width = 160;
|
|
74
|
+
}
|
|
75
|
+
state.styles.popper = Object.assign(Object.assign({}, state.styles.popper), { maxWidth: `${width}px` });
|
|
76
|
+
},
|
|
77
|
+
};
|
|
47
78
|
const Tooltip = class {
|
|
48
79
|
constructor(hostRef) {
|
|
49
80
|
index.registerInstance(this, hostRef);
|
|
50
|
-
this.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
phase: hasOverflow.beforeWrite,
|
|
54
|
-
requires: ["maxSize"],
|
|
55
|
-
fn({ state }) {
|
|
56
|
-
let { width } = state.modifiersData.maxSize;
|
|
57
|
-
if (width < 160) {
|
|
58
|
-
width = 160;
|
|
59
|
-
}
|
|
60
|
-
state.styles.popper = Object.assign(Object.assign({}, state.styles.popper), { maxWidth: `${width}px` });
|
|
61
|
-
},
|
|
81
|
+
this.callbacks = {
|
|
82
|
+
activate: () => (this.active = true),
|
|
83
|
+
deactivate: () => (this.active = false),
|
|
62
84
|
};
|
|
63
85
|
this.keyDownListener = (event) => {
|
|
64
86
|
if (event.key === "Escape") {
|
|
65
87
|
this.deactivate();
|
|
66
88
|
}
|
|
67
89
|
};
|
|
90
|
+
this.deactivatePopper = index$1.debounce_1(() => {
|
|
91
|
+
var _a;
|
|
92
|
+
this.hidden = true;
|
|
93
|
+
(_a = this.popper) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
94
|
+
this.popper = undefined;
|
|
95
|
+
}, transitionDuration);
|
|
96
|
+
_Tooltip_target.set(this, void 0);
|
|
68
97
|
this.descriptive = false;
|
|
69
98
|
this.position = "top";
|
|
70
99
|
this.strategy = "auto";
|
|
@@ -122,9 +151,8 @@ const Tooltip = class {
|
|
|
122
151
|
});
|
|
123
152
|
}
|
|
124
153
|
watchActive() {
|
|
125
|
-
var _a;
|
|
126
154
|
if (this.active) {
|
|
127
|
-
this.
|
|
155
|
+
this.activatePopper();
|
|
128
156
|
if (!this.stateless) {
|
|
129
157
|
setTimeout(() => {
|
|
130
158
|
var _a;
|
|
@@ -136,13 +164,8 @@ const Tooltip = class {
|
|
|
136
164
|
}
|
|
137
165
|
}
|
|
138
166
|
else {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
modifiers: [{ name: "eventListeners", enabled: false }],
|
|
142
|
-
});
|
|
143
|
-
document.removeEventListener("keydown", this.keyDownListener);
|
|
144
|
-
}
|
|
145
|
-
setTimeout(() => (this.hidden = true), transitionDuration);
|
|
167
|
+
document.removeEventListener("keydown", this.keyDownListener);
|
|
168
|
+
this.deactivatePopper();
|
|
146
169
|
}
|
|
147
170
|
}
|
|
148
171
|
listenClick(e) {
|
|
@@ -150,25 +173,10 @@ const Tooltip = class {
|
|
|
150
173
|
}
|
|
151
174
|
componentDidLoad() {
|
|
152
175
|
var _a;
|
|
153
|
-
if (this.popper) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
176
|
const tooltip = (_a = this.element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".tooltip");
|
|
157
177
|
if (!(tooltip instanceof HTMLElement)) {
|
|
158
178
|
throw new Error("tooltip element is not instanceof HTMLElement");
|
|
159
179
|
}
|
|
160
|
-
if (!this.element.id) {
|
|
161
|
-
throw new Error("Unable to find reference tooltip has no [id] attribute.");
|
|
162
|
-
}
|
|
163
|
-
this.target = this.getTarget(this.element.id);
|
|
164
|
-
this.popper = hasOverflow.createPopper(this.target, tooltip, {
|
|
165
|
-
placement: this.position,
|
|
166
|
-
modifiers: [maxSize, this.applyMaxSize],
|
|
167
|
-
});
|
|
168
|
-
this.callbacks = {
|
|
169
|
-
activate: () => (this.active = true),
|
|
170
|
-
deactivate: () => (this.active = false),
|
|
171
|
-
};
|
|
172
180
|
if (!this.stateless) {
|
|
173
181
|
this.target.addEventListener("mouseenter", this.callbacks.activate);
|
|
174
182
|
this.target.addEventListener("mouseleave", this.callbacks.deactivate);
|
|
@@ -179,18 +187,16 @@ const Tooltip = class {
|
|
|
179
187
|
disconnectedCallback() {
|
|
180
188
|
var _a;
|
|
181
189
|
(_a = this.popper) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
182
|
-
if (!this.stateless && this.target
|
|
190
|
+
if (!this.stateless && this.target) {
|
|
183
191
|
this.target.removeEventListener("mouseenter", this.callbacks.activate);
|
|
184
192
|
this.target.removeEventListener("mouseleave", this.callbacks.deactivate);
|
|
185
193
|
this.target.removeEventListener("focus", this.callbacks.activate);
|
|
186
194
|
this.target.removeEventListener("blur", this.callbacks.deactivate);
|
|
187
195
|
}
|
|
188
|
-
this.callbacks = undefined;
|
|
189
196
|
this.target = undefined;
|
|
190
197
|
}
|
|
191
198
|
componentDidRender() {
|
|
192
199
|
var _a;
|
|
193
|
-
this.setStrategy();
|
|
194
200
|
if (this.active) {
|
|
195
201
|
(_a = this.popper) === null || _a === void 0 ? void 0 : _a.update();
|
|
196
202
|
}
|
|
@@ -198,7 +204,34 @@ const Tooltip = class {
|
|
|
198
204
|
render() {
|
|
199
205
|
return (index.h(index.Host, { class: { hidden: this.hidden }, role: "tooltip" }, index.h("div", { class: clsx_m.clsx("tooltip", { in: this.active }) }, !this.noArrow && index.h("div", { "data-popper-arrow": true, class: "tooltip-arrow" }), index.h("div", { "aria-hidden": !this.descriptive || undefined, class: clsx_m.clsx("tooltip-inner", { "dso-small": this.small }) }, index.h("slot", null)))));
|
|
200
206
|
}
|
|
201
|
-
|
|
207
|
+
activatePopper() {
|
|
208
|
+
var _a;
|
|
209
|
+
this.hidden = false;
|
|
210
|
+
if (this.popper) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const tooltip = (_a = this.element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".tooltip");
|
|
214
|
+
if (!(tooltip instanceof HTMLElement)) {
|
|
215
|
+
throw new Error("tooltip element is not instanceof HTMLElement");
|
|
216
|
+
}
|
|
217
|
+
this.popper = hasOverflow.createPopper(this.target, tooltip, {
|
|
218
|
+
placement: this.position,
|
|
219
|
+
modifiers: [maxSize, applyMaxSize, { name: "eventListeners", enabled: false }],
|
|
220
|
+
});
|
|
221
|
+
this.setStrategy();
|
|
222
|
+
}
|
|
223
|
+
get target() {
|
|
224
|
+
var _a;
|
|
225
|
+
return (_a = __classPrivateFieldGet(this, _Tooltip_target, "f")) !== null && _a !== void 0 ? _a : this.initializeTarget();
|
|
226
|
+
}
|
|
227
|
+
set target(element) {
|
|
228
|
+
__classPrivateFieldSet(this, _Tooltip_target, element, "f");
|
|
229
|
+
}
|
|
230
|
+
initializeTarget() {
|
|
231
|
+
const id = this.element.id;
|
|
232
|
+
if (!id) {
|
|
233
|
+
throw new Error("Unable to find reference tooltip has no [id] attribute.");
|
|
234
|
+
}
|
|
202
235
|
const rootNode = this.element.getRootNode();
|
|
203
236
|
if (!(rootNode instanceof Document || rootNode instanceof ShadowRoot)) {
|
|
204
237
|
throw new Error(`rootNode is not instance of Document or ShadowRoot`);
|
|
@@ -207,6 +240,7 @@ const Tooltip = class {
|
|
|
207
240
|
if (!reference) {
|
|
208
241
|
throw new Error(`Unable to find reference with aria-describedby ${id}`);
|
|
209
242
|
}
|
|
243
|
+
__classPrivateFieldSet(this, _Tooltip_target, reference, "f");
|
|
210
244
|
return reference;
|
|
211
245
|
}
|
|
212
246
|
get element() { return index.getElement(this); }
|
|
@@ -216,6 +250,7 @@ const Tooltip = class {
|
|
|
216
250
|
"active": ["watchActive"]
|
|
217
251
|
}; }
|
|
218
252
|
};
|
|
253
|
+
_Tooltip_target = new WeakMap();
|
|
219
254
|
Tooltip.style = tooltipCss;
|
|
220
255
|
|
|
221
256
|
exports.dso_tooltip = Tooltip;
|