@dso-toolkit/core 40.0.0 → 40.1.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.
Files changed (37) hide show
  1. package/dist/cjs/dso-date-picker.cjs.entry.js +25 -10
  2. package/dist/cjs/dso-ozon-content.cjs.entry.js +1 -1
  3. package/dist/cjs/dso-pagination.cjs.entry.js +38 -0
  4. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  5. package/dist/cjs/dso-tooltip.cjs.entry.js +40 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/collection-manifest.json +1 -0
  8. package/dist/collection/components/date-picker/date-picker.js +25 -10
  9. package/dist/collection/components/ozon-content/ozon-content.js +4 -1
  10. package/dist/collection/components/ozon-content/ozon-content.template.js +3 -3
  11. package/dist/collection/components/pagination/pagination.css +68 -0
  12. package/dist/collection/components/pagination/pagination.interfaces.js +1 -0
  13. package/dist/collection/components/pagination/pagination.js +114 -0
  14. package/dist/collection/components/pagination/pagination.template.js +11 -0
  15. package/dist/collection/components/tooltip/tooltip.js +60 -0
  16. package/dist/custom-elements/index.d.ts +6 -0
  17. package/dist/custom-elements/index.js +104 -14
  18. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  19. package/dist/dso-toolkit/p-0777c1c4.entry.js +1 -0
  20. package/dist/dso-toolkit/{p-150fe323.entry.js → p-37e12c3c.entry.js} +1 -1
  21. package/dist/dso-toolkit/p-4a41728e.entry.js +1 -0
  22. package/dist/dso-toolkit/{p-a8cf15cf.entry.js → p-f1026921.entry.js} +1 -1
  23. package/dist/esm/dso-date-picker.entry.js +25 -10
  24. package/dist/esm/dso-ozon-content.entry.js +2 -2
  25. package/dist/esm/dso-pagination.entry.js +34 -0
  26. package/dist/esm/dso-toolkit.js +1 -1
  27. package/dist/esm/dso-tooltip.entry.js +40 -0
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/types/components/date-picker/date-picker.d.ts +1 -1
  30. package/dist/types/components/ozon-content/ozon-content.template.d.ts +1 -1
  31. package/dist/types/components/pagination/pagination.d.ts +22 -0
  32. package/dist/types/components/pagination/pagination.interfaces.d.ts +6 -0
  33. package/dist/types/components/pagination/pagination.template.d.ts +2 -0
  34. package/dist/types/components/tooltip/tooltip.d.ts +6 -0
  35. package/dist/types/components.d.ts +50 -0
  36. package/package.json +1 -1
  37. package/dist/dso-toolkit/p-7abe091d.entry.js +0 -1
@@ -268,6 +268,22 @@ const keyCode = {
268
268
  };
269
269
  const DISALLOWED_CHARACTERS = /[^0-9\-]+/g;
270
270
  const TRANSITION_MS = 300;
271
+ function cleanValue(input, regex) {
272
+ const value = input.value;
273
+ const cursor = input.selectionStart;
274
+ if (!cursor) {
275
+ return value;
276
+ }
277
+ const beforeCursor = value.slice(0, cursor);
278
+ const afterCursor = value.slice(cursor, value.length);
279
+ const filteredBeforeCursor = beforeCursor.replace(regex, "");
280
+ const filterAfterCursor = afterCursor.replace(regex, "");
281
+ const newValue = filteredBeforeCursor + filterAfterCursor;
282
+ const newCursor = filteredBeforeCursor.length;
283
+ input.value = newValue;
284
+ input.selectionStart = input.selectionEnd = newCursor;
285
+ return newValue;
286
+ }
271
287
  let DsoDatePicker = class {
272
288
  constructor(hostRef) {
273
289
  index.registerInstance(this, hostRef);
@@ -479,12 +495,8 @@ let DsoDatePicker = class {
479
495
  };
480
496
  this.handleInputChange = (e) => {
481
497
  const target = e.target;
482
- this.setValue(target.value);
483
- };
484
- this.handleKeyPress = (e) => {
485
- if (e.key.search(DISALLOWED_CHARACTERS) > -1) {
486
- e.preventDefault();
487
- }
498
+ const cleanedValue = cleanValue(target, DISALLOWED_CHARACTERS);
499
+ this.setValue(cleanedValue);
488
500
  };
489
501
  this.prepareEvent = (value) => {
490
502
  var event = {
@@ -622,13 +634,16 @@ let DsoDatePicker = class {
622
634
  }
623
635
  setValue(value) {
624
636
  const event = this.prepareEvent(value);
625
- this.value = event.value;
626
- this.dateChange.emit(event);
637
+ this.value = typeof value === 'string' ? value : event.value;
638
+ if (this.value !== this.previousValue) {
639
+ this.dateChange.emit(event);
640
+ this.previousValue = this.value;
641
+ }
627
642
  }
628
643
  componentDidLoad() {
629
644
  const valueAsDate = parseDutchDate(this.value);
630
645
  if (valueAsDate) {
631
- this.value = printDutchDate(valueAsDate);
646
+ this.previousValue = this.value = printDutchDate(valueAsDate);
632
647
  }
633
648
  if (this.dsoAutofocus) {
634
649
  this.setFocus();
@@ -656,7 +671,7 @@ let DsoDatePicker = class {
656
671
  if (maxDate) {
657
672
  maxYear = Math.min(maxYear, maxDate.getFullYear());
658
673
  }
659
- return (index.h(index.Host, null, index.h("div", { class: ({ 'dso-date': true, 'dso-visible': this.visible }) }, index.h("div", { class: "dso-date__input-wrapper" }, index.h("input", { class: "dso-date__input", value: this.value, placeholder: this.localization.placeholder, id: this.identifier, disabled: this.disabled, role: this.role, required: this.required ? true : undefined, "aria-autocomplete": "none", onKeyPress: this.handleKeyPress, onInput: this.handleInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown, autoComplete: "off", ref: element => (this.datePickerInput = element) }), index.h("button", { type: "button", class: "dso-date__toggle", onClick: this.toggleOpen, disabled: this.disabled, ref: element => (this.datePickerButton = element) }, index.h("span", { class: "dso-date__toggle-icon" }, index.h("dso-icon", { icon: "calendar" })), index.h("span", { class: "dso-date__vhidden" }, this.localization.buttonLabel, formattedDate && (index.h("span", null, ", ", this.localization.selectedDateMessage, " ", formattedDate))))), index.h("div", { class: {
674
+ return (index.h(index.Host, null, index.h("div", { class: ({ 'dso-date': true, 'dso-visible': this.visible }) }, index.h("div", { class: "dso-date__input-wrapper" }, index.h("input", { class: "dso-date__input", value: this.value, placeholder: this.localization.placeholder, id: this.identifier, disabled: this.disabled, role: this.role, required: this.required ? true : undefined, "aria-autocomplete": "none", onInput: this.handleInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown, autoComplete: "off", ref: element => (this.datePickerInput = element) }), index.h("button", { type: "button", class: "dso-date__toggle", onClick: this.toggleOpen, disabled: this.disabled, ref: element => (this.datePickerButton = element) }, index.h("span", { class: "dso-date__toggle-icon" }, index.h("dso-icon", { icon: "calendar" })), index.h("span", { class: "dso-date__vhidden" }, this.localization.buttonLabel, formattedDate && (index.h("span", null, ", ", this.localization.selectedDateMessage, " ", formattedDate))))), index.h("div", { class: {
660
675
  "dso-date__dialog": true,
661
676
  "is-left": this.direction === "left",
662
677
  "is-active": this.open,
@@ -398,7 +398,7 @@ let OzonContent = class {
398
398
  if (this.deleted) {
399
399
  return (index.h("section", null, index.h("span", { class: "deleted-start" }, "Begin verwijderd element"), transformed, index.h("span", { class: "deleted-end" }, "Einde verwijderd element")));
400
400
  }
401
- return (index.h(index.Host, { onClick: (e) => this.handleHostOnClick(e) }, transformed));
401
+ return (index.h(index.Host, { onClick: (e) => this.handleHostOnClick(e) }, index.h("slot", { name: "prefix" }), transformed, index.h("slot", { name: "suffix" })));
402
402
  }
403
403
  get host() { return index.getElement(this); }
404
404
  };
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-0a7c679a.js');
6
+
7
+ const paginationCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}.pagination{text-align:center}.pagination>li{display:inline-block;font-weight:bold;line-height:28px;text-align:center;vertical-align:middle}.pagination>li>a,.pagination>li>span{align-items:center;color:#39870c;display:flex;height:32px;justify-content:center;position:relative;width:32px}.pagination>li>a:active,.pagination>li>span:active{background-color:#ebf3e6}.pagination>li>span{border:2px solid transparent;border-radius:50%}.pagination>li a{line-height:32px;text-decoration:none}.pagination>li a:hover,.pagination>li a:focus{text-decoration:none}.pagination>li a:hover::after,.pagination>li a:focus::after{border-bottom-color:#39870c}.pagination>li a::after{border-bottom:3px solid transparent;bottom:0;content:\"\";display:inline-block;left:0;position:absolute;width:100%}.pagination>li.active span{background-color:#39870c;color:#fff}.pagination>li+li{margin-left:8px}.dso-page-hidden{visibility:hidden}";
8
+
9
+ let Pagination = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.selectPage = index.createEvent(this, "selectPage", 7);
13
+ /**
14
+ * This function is called to format the href
15
+ */
16
+ this.formatHref = (page) => '#' + page;
17
+ }
18
+ clickHandler(e, page) {
19
+ if (e.button !== 0 || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) {
20
+ return;
21
+ }
22
+ e.preventDefault();
23
+ this.selectPage.emit({ originalEvent: e, page });
24
+ }
25
+ ;
26
+ render() {
27
+ if (!this.totalPages) {
28
+ return null;
29
+ }
30
+ const pages = Array.from({ length: this.totalPages }, (_value, i) => i + 1);
31
+ return (index.h("ul", { class: "pagination" }, index.h("li", { class: this.currentPage === pages[0] ? 'dso-page-hidden' : undefined }, index.h("a", { href: this.formatHref(pages[0]), "aria-label": "Vorige", onClick: e => this.clickHandler(e, pages[0]) }, index.h("dso-icon", { icon: "chevron-left" }))), pages.map(page => (index.h("li", { key: page, class: this.currentPage === page ? 'active' : undefined }, this.currentPage === page
32
+ ? (index.h("span", { "aria-current": "page" }, page))
33
+ : (index.h("a", { href: this.formatHref(page), onClick: e => this.clickHandler(e, page) }, page))))), index.h("li", { class: this.currentPage === pages[pages.length - 1] ? 'dso-page-hidden' : undefined }, index.h("a", { href: this.formatHref(pages[pages.length - 1]), "aria-label": "Volgende", onClick: e => this.clickHandler(e, pages[pages.length - 1]) }, index.h("dso-icon", { icon: "chevron-right" })))));
34
+ }
35
+ };
36
+ Pagination.style = paginationCss;
37
+
38
+ exports.dso_pagination = Pagination;
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["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-header.cjs",[[1,"dso-header",{"loginUrl":[1,"login-url"],"logoutUrl":[1,"logout-url"],"mainMenu":[16],"useDropDownMenu":[1,"use-drop-down-menu"],"isLoggedIn":[4,"is-logged-in"],"userProfileName":[1,"user-profile-name"],"userProfileUrl":[1,"user-profile-url"],"userHomeUrl":[1,"user-home-url"],"showDropDown":[32],"hasSubLogo":[32],"overflowMenuItems":[32]}]]],["dso-toggletip.cjs",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-tree-view.cjs",[[1,"dso-tree-view",{"collection":[16]}]]],["dso-autosuggest.cjs",[[6,"dso-autosuggest",{"suggestions":[16],"loading":[4],"loadingLabel":[1,"loading-label"],"suggestOnFocus":[4,"suggest-on-focus"],"showSuggestions":[32],"selectedSuggestion":[32]},[[4,"click","onDocumentClick"]]]]],["dso-date-picker.cjs",[[2,"dso-date-picker",{"name":[1],"identifier":[1],"disabled":[516],"role":[1],"direction":[1],"required":[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]}]]],["dso-image-overlay.cjs",[[1,"dso-image-overlay",{"active":[32],"focused":[32]}]]],["dso-label.cjs",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"hover":[32]}]]],["dso-map-controls.cjs",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[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-alert.cjs",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter.cjs",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-badge.cjs",[[1,"dso-badge",{"status":[1]}]]],["dso-banner.cjs",[[1,"dso-banner",{"status":[1]}]]],["dso-highlight-box.cjs",[[1,"dso-highlight-box",{"yellow":[4],"border":[4],"white":[4],"dropShadow":[4,"drop-shadow"],"step":[2]}]]],["dso-ozon-content.cjs",[[2,"dso-ozon-content",{"content":[1],"inline":[516],"deleted":[516],"interactive":[516],"state":[32]}]]],["dso-progress-bar.cjs",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-responsive-element.cjs",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32]}]]],["dso-dropdown-menu.cjs",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-tooltip.cjs",[[1,"dso-tooltip",{"descriptive":[516],"position":[1],"for":[1],"noArrow":[4,"no-arrow"],"stateless":[4],"small":[4],"active":[1540],"hidden":[32],"activate":[64],"deactivate":[64]},[[0,"click","listenClick"]]]]],["dso-progress-indicator.cjs",[[1,"dso-progress-indicator",{"label":[1],"size":[1],"block":[4]}]]],["dso-info-button.cjs",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1]}]]],["dso-info_2.cjs",[[6,"dso-selectable",{"type":[1],"identifier":[1],"name":[1],"value":[1],"invalid":[4],"describedById":[1,"described-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]}]]],["dso-icon.cjs",[[1,"dso-icon",{"icon":[1]}]]]], options);
18
+ return index.bootstrapLazy([["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-header.cjs",[[1,"dso-header",{"loginUrl":[1,"login-url"],"logoutUrl":[1,"logout-url"],"mainMenu":[16],"useDropDownMenu":[1,"use-drop-down-menu"],"isLoggedIn":[4,"is-logged-in"],"userProfileName":[1,"user-profile-name"],"userProfileUrl":[1,"user-profile-url"],"userHomeUrl":[1,"user-home-url"],"showDropDown":[32],"hasSubLogo":[32],"overflowMenuItems":[32]}]]],["dso-toggletip.cjs",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-tree-view.cjs",[[1,"dso-tree-view",{"collection":[16]}]]],["dso-autosuggest.cjs",[[6,"dso-autosuggest",{"suggestions":[16],"loading":[4],"loadingLabel":[1,"loading-label"],"suggestOnFocus":[4,"suggest-on-focus"],"showSuggestions":[32],"selectedSuggestion":[32]},[[4,"click","onDocumentClick"]]]]],["dso-date-picker.cjs",[[2,"dso-date-picker",{"name":[1],"identifier":[1],"disabled":[516],"role":[1],"direction":[1],"required":[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]}]]],["dso-image-overlay.cjs",[[1,"dso-image-overlay",{"active":[32],"focused":[32]}]]],["dso-label.cjs",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"hover":[32]}]]],["dso-map-controls.cjs",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32]}]]],["dso-pagination.cjs",[[1,"dso-pagination",{"totalPages":[2,"total-pages"],"currentPage":[2,"current-page"],"formatHref":[16]}]]],["dso-viewer-grid.cjs",[[1,"dso-viewer-grid",{"filterpanelOpen":[516,"filterpanel-open"],"overlayOpen":[516,"overlay-open"],"initialMainSize":[1,"initial-main-size"],"mainSize":[32]}]]],["dso-alert.cjs",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter.cjs",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-badge.cjs",[[1,"dso-badge",{"status":[1]}]]],["dso-banner.cjs",[[1,"dso-banner",{"status":[1]}]]],["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":[516],"state":[32]}]]],["dso-progress-bar.cjs",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-responsive-element.cjs",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32]}]]],["dso-dropdown-menu.cjs",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-tooltip.cjs",[[1,"dso-tooltip",{"descriptive":[516],"position":[1],"strategy":[1],"for":[1],"noArrow":[4,"no-arrow"],"stateless":[4],"small":[4],"active":[1540],"hidden":[32],"activate":[64],"deactivate":[64]},[[0,"click","listenClick"]]]]],["dso-progress-indicator.cjs",[[1,"dso-progress-indicator",{"label":[1],"size":[1],"block":[4]}]]],["dso-info-button.cjs",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1]}]]],["dso-info_2.cjs",[[6,"dso-selectable",{"type":[1],"identifier":[1],"name":[1],"value":[1],"invalid":[4],"describedById":[1,"described-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]}]]],["dso-icon.cjs",[[1,"dso-icon",{"icon":[1]}]]]], options);
19
19
  });
@@ -1830,6 +1830,13 @@ const tooltipCss = ":host(.hidden){visibility:hidden}:host-context(dso-toggletip
1830
1830
 
1831
1831
  // Keep const in sync with $tooltip-transition-duration in @dso-toolkit/sources/tooltip.scss tooltip_root() mixin
1832
1832
  const transitionDuration = 150;
1833
+ function hasOverflow(el) {
1834
+ const style = window.getComputedStyle(el);
1835
+ const overflowX = style.getPropertyValue('overflow-x');
1836
+ const overflowY = style.getPropertyValue('overflow-y');
1837
+ const overflowValues = ['hidden', 'clip'];
1838
+ return overflowValues.indexOf(overflowX) != -1 || overflowValues.indexOf(overflowY) != -1;
1839
+ }
1833
1840
  let Tooltip = class {
1834
1841
  constructor(hostRef) {
1835
1842
  index.registerInstance(this, hostRef);
@@ -1841,6 +1848,10 @@ let Tooltip = class {
1841
1848
  * Set position of tooltip relative to target
1842
1849
  */
1843
1850
  this.position = 'top';
1851
+ /**
1852
+ * Set position strategy of tooltip
1853
+ */
1854
+ this.strategy = 'auto';
1844
1855
  /**
1845
1856
  * Set attribute `no-arrow` to hide the arrow
1846
1857
  */
@@ -1884,6 +1895,33 @@ let Tooltip = class {
1884
1895
  placement: this.position
1885
1896
  });
1886
1897
  }
1898
+ watchStrategy() {
1899
+ this.setStrategy();
1900
+ }
1901
+ setStrategy() {
1902
+ if (!this.popper) {
1903
+ return;
1904
+ }
1905
+ if (this.strategy == 'absolute' || this.strategy == 'fixed') {
1906
+ this.popper.setOptions({
1907
+ strategy: this.strategy,
1908
+ });
1909
+ return;
1910
+ }
1911
+ let element = this.element;
1912
+ while ((element === null || element === void 0 ? void 0 : element.parentNode) != null && element.parentNode != document) {
1913
+ element = element.parentNode instanceof ShadowRoot ? element.parentNode.host : element.parentElement;
1914
+ if (element != null && hasOverflow(element)) {
1915
+ this.popper.setOptions({
1916
+ strategy: 'fixed',
1917
+ });
1918
+ return;
1919
+ }
1920
+ }
1921
+ this.popper.setOptions({
1922
+ strategy: 'absolute',
1923
+ });
1924
+ }
1887
1925
  watchActive() {
1888
1926
  var _a;
1889
1927
  if (this.active) {
@@ -1948,6 +1986,7 @@ let Tooltip = class {
1948
1986
  }
1949
1987
  componentDidRender() {
1950
1988
  var _a;
1989
+ this.setStrategy();
1951
1990
  if (this.active) {
1952
1991
  (_a = this.popper) === null || _a === void 0 ? void 0 : _a.update();
1953
1992
  }
@@ -1979,6 +2018,7 @@ let Tooltip = class {
1979
2018
  get element() { return index.getElement(this); }
1980
2019
  static get watchers() { return {
1981
2020
  "position": ["watchPosition"],
2021
+ "strategy": ["watchStrategy"],
1982
2022
  "active": ["watchActive"]
1983
2023
  }; }
1984
2024
  };
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["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-header.cjs",[[1,"dso-header",{"loginUrl":[1,"login-url"],"logoutUrl":[1,"logout-url"],"mainMenu":[16],"useDropDownMenu":[1,"use-drop-down-menu"],"isLoggedIn":[4,"is-logged-in"],"userProfileName":[1,"user-profile-name"],"userProfileUrl":[1,"user-profile-url"],"userHomeUrl":[1,"user-home-url"],"showDropDown":[32],"hasSubLogo":[32],"overflowMenuItems":[32]}]]],["dso-toggletip.cjs",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-tree-view.cjs",[[1,"dso-tree-view",{"collection":[16]}]]],["dso-autosuggest.cjs",[[6,"dso-autosuggest",{"suggestions":[16],"loading":[4],"loadingLabel":[1,"loading-label"],"suggestOnFocus":[4,"suggest-on-focus"],"showSuggestions":[32],"selectedSuggestion":[32]},[[4,"click","onDocumentClick"]]]]],["dso-date-picker.cjs",[[2,"dso-date-picker",{"name":[1],"identifier":[1],"disabled":[516],"role":[1],"direction":[1],"required":[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]}]]],["dso-image-overlay.cjs",[[1,"dso-image-overlay",{"active":[32],"focused":[32]}]]],["dso-label.cjs",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"hover":[32]}]]],["dso-map-controls.cjs",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[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-alert.cjs",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter.cjs",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-badge.cjs",[[1,"dso-badge",{"status":[1]}]]],["dso-banner.cjs",[[1,"dso-banner",{"status":[1]}]]],["dso-highlight-box.cjs",[[1,"dso-highlight-box",{"yellow":[4],"border":[4],"white":[4],"dropShadow":[4,"drop-shadow"],"step":[2]}]]],["dso-ozon-content.cjs",[[2,"dso-ozon-content",{"content":[1],"inline":[516],"deleted":[516],"interactive":[516],"state":[32]}]]],["dso-progress-bar.cjs",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-responsive-element.cjs",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32]}]]],["dso-dropdown-menu.cjs",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-tooltip.cjs",[[1,"dso-tooltip",{"descriptive":[516],"position":[1],"for":[1],"noArrow":[4,"no-arrow"],"stateless":[4],"small":[4],"active":[1540],"hidden":[32],"activate":[64],"deactivate":[64]},[[0,"click","listenClick"]]]]],["dso-progress-indicator.cjs",[[1,"dso-progress-indicator",{"label":[1],"size":[1],"block":[4]}]]],["dso-info-button.cjs",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1]}]]],["dso-info_2.cjs",[[6,"dso-selectable",{"type":[1],"identifier":[1],"name":[1],"value":[1],"invalid":[4],"describedById":[1,"described-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]}]]],["dso-icon.cjs",[[1,"dso-icon",{"icon":[1]}]]]], options);
17
+ return index.bootstrapLazy([["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-header.cjs",[[1,"dso-header",{"loginUrl":[1,"login-url"],"logoutUrl":[1,"logout-url"],"mainMenu":[16],"useDropDownMenu":[1,"use-drop-down-menu"],"isLoggedIn":[4,"is-logged-in"],"userProfileName":[1,"user-profile-name"],"userProfileUrl":[1,"user-profile-url"],"userHomeUrl":[1,"user-home-url"],"showDropDown":[32],"hasSubLogo":[32],"overflowMenuItems":[32]}]]],["dso-toggletip.cjs",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-tree-view.cjs",[[1,"dso-tree-view",{"collection":[16]}]]],["dso-autosuggest.cjs",[[6,"dso-autosuggest",{"suggestions":[16],"loading":[4],"loadingLabel":[1,"loading-label"],"suggestOnFocus":[4,"suggest-on-focus"],"showSuggestions":[32],"selectedSuggestion":[32]},[[4,"click","onDocumentClick"]]]]],["dso-date-picker.cjs",[[2,"dso-date-picker",{"name":[1],"identifier":[1],"disabled":[516],"role":[1],"direction":[1],"required":[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]}]]],["dso-image-overlay.cjs",[[1,"dso-image-overlay",{"active":[32],"focused":[32]}]]],["dso-label.cjs",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"hover":[32]}]]],["dso-map-controls.cjs",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32]}]]],["dso-pagination.cjs",[[1,"dso-pagination",{"totalPages":[2,"total-pages"],"currentPage":[2,"current-page"],"formatHref":[16]}]]],["dso-viewer-grid.cjs",[[1,"dso-viewer-grid",{"filterpanelOpen":[516,"filterpanel-open"],"overlayOpen":[516,"overlay-open"],"initialMainSize":[1,"initial-main-size"],"mainSize":[32]}]]],["dso-alert.cjs",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter.cjs",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-badge.cjs",[[1,"dso-badge",{"status":[1]}]]],["dso-banner.cjs",[[1,"dso-banner",{"status":[1]}]]],["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":[516],"state":[32]}]]],["dso-progress-bar.cjs",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-responsive-element.cjs",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32]}]]],["dso-dropdown-menu.cjs",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-tooltip.cjs",[[1,"dso-tooltip",{"descriptive":[516],"position":[1],"strategy":[1],"for":[1],"noArrow":[4,"no-arrow"],"stateless":[4],"small":[4],"active":[1540],"hidden":[32],"activate":[64],"deactivate":[64]},[[0,"click","listenClick"]]]]],["dso-progress-indicator.cjs",[[1,"dso-progress-indicator",{"label":[1],"size":[1],"block":[4]}]]],["dso-info-button.cjs",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1]}]]],["dso-info_2.cjs",[[6,"dso-selectable",{"type":[1],"identifier":[1],"name":[1],"value":[1],"invalid":[4],"describedById":[1,"described-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]}]]],["dso-icon.cjs",[[1,"dso-icon",{"icon":[1]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -21,6 +21,7 @@
21
21
  "./components/map-controls/map-controls.js",
22
22
  "./components/map-overlays/map-overlays.js",
23
23
  "./components/ozon-content/ozon-content.js",
24
+ "./components/pagination/pagination.js",
24
25
  "./components/progress-bar/progress-bar.js",
25
26
  "./components/progress-indicator/progress-indicator.js",
26
27
  "./components/responsive-element/responsive-element.js",
@@ -25,6 +25,22 @@ const keyCode = {
25
25
  };
26
26
  const DISALLOWED_CHARACTERS = /[^0-9\-]+/g;
27
27
  const TRANSITION_MS = 300;
28
+ function cleanValue(input, regex) {
29
+ const value = input.value;
30
+ const cursor = input.selectionStart;
31
+ if (!cursor) {
32
+ return value;
33
+ }
34
+ const beforeCursor = value.slice(0, cursor);
35
+ const afterCursor = value.slice(cursor, value.length);
36
+ const filteredBeforeCursor = beforeCursor.replace(regex, "");
37
+ const filterAfterCursor = afterCursor.replace(regex, "");
38
+ const newValue = filteredBeforeCursor + filterAfterCursor;
39
+ const newCursor = filteredBeforeCursor.length;
40
+ input.value = newValue;
41
+ input.selectionStart = input.selectionEnd = newCursor;
42
+ return newValue;
43
+ }
28
44
  export class DsoDatePicker {
29
45
  constructor() {
30
46
  /**
@@ -230,12 +246,8 @@ export class DsoDatePicker {
230
246
  };
231
247
  this.handleInputChange = (e) => {
232
248
  const target = e.target;
233
- this.setValue(target.value);
234
- };
235
- this.handleKeyPress = (e) => {
236
- if (e.key.search(DISALLOWED_CHARACTERS) > -1) {
237
- e.preventDefault();
238
- }
249
+ const cleanedValue = cleanValue(target, DISALLOWED_CHARACTERS);
250
+ this.setValue(cleanedValue);
239
251
  };
240
252
  this.prepareEvent = (value) => {
241
253
  var event = {
@@ -373,13 +385,16 @@ export class DsoDatePicker {
373
385
  }
374
386
  setValue(value) {
375
387
  const event = this.prepareEvent(value);
376
- this.value = event.value;
377
- this.dateChange.emit(event);
388
+ this.value = typeof value === 'string' ? value : event.value;
389
+ if (this.value !== this.previousValue) {
390
+ this.dateChange.emit(event);
391
+ this.previousValue = this.value;
392
+ }
378
393
  }
379
394
  componentDidLoad() {
380
395
  const valueAsDate = parseDutchDate(this.value);
381
396
  if (valueAsDate) {
382
- this.value = printDutchDate(valueAsDate);
397
+ this.previousValue = this.value = printDutchDate(valueAsDate);
383
398
  }
384
399
  if (this.dsoAutofocus) {
385
400
  this.setFocus();
@@ -410,7 +425,7 @@ export class DsoDatePicker {
410
425
  return (h(Host, null,
411
426
  h("div", { class: ({ 'dso-date': true, 'dso-visible': this.visible }) },
412
427
  h("div", { class: "dso-date__input-wrapper" },
413
- h("input", { class: "dso-date__input", value: this.value, placeholder: this.localization.placeholder, id: this.identifier, disabled: this.disabled, role: this.role, required: this.required ? true : undefined, "aria-autocomplete": "none", onKeyPress: this.handleKeyPress, onInput: this.handleInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown, autoComplete: "off", ref: element => (this.datePickerInput = element) }),
428
+ h("input", { class: "dso-date__input", value: this.value, placeholder: this.localization.placeholder, id: this.identifier, disabled: this.disabled, role: this.role, required: this.required ? true : undefined, "aria-autocomplete": "none", onInput: this.handleInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown, autoComplete: "off", ref: element => (this.datePickerInput = element) }),
414
429
  h("button", { type: "button", class: "dso-date__toggle", onClick: this.toggleOpen, disabled: this.disabled, ref: element => (this.datePickerButton = element) },
415
430
  h("span", { class: "dso-date__toggle-icon" },
416
431
  h("dso-icon", { icon: "calendar" })),
@@ -44,7 +44,10 @@ export class OzonContent {
44
44
  transformed,
45
45
  h("span", { class: "deleted-end" }, "Einde verwijderd element")));
46
46
  }
47
- return (h(Host, { onClick: (e) => this.handleHostOnClick(e) }, transformed));
47
+ return (h(Host, { onClick: (e) => this.handleHostOnClick(e) },
48
+ h("slot", { name: "prefix" }),
49
+ transformed,
50
+ h("slot", { name: "suffix" })));
48
51
  }
49
52
  static get is() { return "dso-ozon-content"; }
50
53
  static get encapsulation() { return "scoped"; }
@@ -1,6 +1,6 @@
1
- import { html } from 'lit-html';
1
+ import { html, nothing } from 'lit-html';
2
2
  import { ifDefined } from 'lit-html/directives/if-defined.js';
3
- export function ozonContentTemplate({ content, inline, interactive, deleted, onAnchorClick, onClick }) {
3
+ export function ozonContentTemplate({ content, inline, interactive, deleted, prefix, suffix, onAnchorClick, onClick }) {
4
4
  return html `
5
5
  <dso-ozon-content
6
6
  .content=${content}
@@ -9,6 +9,6 @@ export function ozonContentTemplate({ content, inline, interactive, deleted, onA
9
9
  ?deleted=${deleted}
10
10
  @anchorClick=${onAnchorClick}
11
11
  @dsoClick=${ifDefined(interactive ? onClick : undefined)}
12
- ></dso-ozon-content>
12
+ >${prefix ? html `<span slot="prefix">${prefix}</span>` : nothing}${suffix ? html `<span slot="suffix">${suffix}</span>` : nothing}</dso-ozon-content>
13
13
  `;
14
14
  }
@@ -0,0 +1,68 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ *,
6
+ *::after,
7
+ *::before {
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ .pagination {
12
+ text-align: center;
13
+ }
14
+ .pagination > li {
15
+ display: inline-block;
16
+ font-weight: bold;
17
+ line-height: 28px;
18
+ text-align: center;
19
+ vertical-align: middle;
20
+ }
21
+ .pagination > li > a,
22
+ .pagination > li > span {
23
+ align-items: center;
24
+ color: #39870c;
25
+ display: flex;
26
+ height: 32px;
27
+ justify-content: center;
28
+ position: relative;
29
+ width: 32px;
30
+ }
31
+ .pagination > li > a:active,
32
+ .pagination > li > span:active {
33
+ background-color: #ebf3e6;
34
+ }
35
+ .pagination > li > span {
36
+ border: 2px solid transparent;
37
+ border-radius: 50%;
38
+ }
39
+ .pagination > li a {
40
+ line-height: 32px;
41
+ text-decoration: none;
42
+ }
43
+ .pagination > li a:hover, .pagination > li a:focus {
44
+ text-decoration: none;
45
+ }
46
+ .pagination > li a:hover::after, .pagination > li a:focus::after {
47
+ border-bottom-color: #39870c;
48
+ }
49
+ .pagination > li a::after {
50
+ border-bottom: 3px solid transparent;
51
+ bottom: 0;
52
+ content: "";
53
+ display: inline-block;
54
+ left: 0;
55
+ position: absolute;
56
+ width: 100%;
57
+ }
58
+ .pagination > li.active span {
59
+ background-color: #39870c;
60
+ color: #fff;
61
+ }
62
+ .pagination > li + li {
63
+ margin-left: 8px;
64
+ }
65
+
66
+ .dso-page-hidden {
67
+ visibility: hidden;
68
+ }
@@ -0,0 +1,114 @@
1
+ import { h, Component, Event, Prop } from '@stencil/core';
2
+ export class Pagination {
3
+ constructor() {
4
+ /**
5
+ * This function is called to format the href
6
+ */
7
+ this.formatHref = (page) => '#' + page;
8
+ }
9
+ clickHandler(e, page) {
10
+ if (e.button !== 0 || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) {
11
+ return;
12
+ }
13
+ e.preventDefault();
14
+ this.selectPage.emit({ originalEvent: e, page });
15
+ }
16
+ ;
17
+ render() {
18
+ if (!this.totalPages) {
19
+ return null;
20
+ }
21
+ const pages = Array.from({ length: this.totalPages }, (_value, i) => i + 1);
22
+ return (h("ul", { class: "pagination" },
23
+ h("li", { class: this.currentPage === pages[0] ? 'dso-page-hidden' : undefined },
24
+ h("a", { href: this.formatHref(pages[0]), "aria-label": "Vorige", onClick: e => this.clickHandler(e, pages[0]) },
25
+ h("dso-icon", { icon: "chevron-left" }))),
26
+ pages.map(page => (h("li", { key: page, class: this.currentPage === page ? 'active' : undefined }, this.currentPage === page
27
+ ? (h("span", { "aria-current": "page" }, page))
28
+ : (h("a", { href: this.formatHref(page), onClick: e => this.clickHandler(e, page) }, page))))),
29
+ h("li", { class: this.currentPage === pages[pages.length - 1] ? 'dso-page-hidden' : undefined },
30
+ h("a", { href: this.formatHref(pages[pages.length - 1]), "aria-label": "Volgende", onClick: e => this.clickHandler(e, pages[pages.length - 1]) },
31
+ h("dso-icon", { icon: "chevron-right" })))));
32
+ }
33
+ static get is() { return "dso-pagination"; }
34
+ static get encapsulation() { return "shadow"; }
35
+ static get originalStyleUrls() { return {
36
+ "$": ["pagination.scss"]
37
+ }; }
38
+ static get styleUrls() { return {
39
+ "$": ["pagination.css"]
40
+ }; }
41
+ static get properties() { return {
42
+ "totalPages": {
43
+ "type": "number",
44
+ "mutable": false,
45
+ "complexType": {
46
+ "original": "number",
47
+ "resolved": "number | undefined",
48
+ "references": {}
49
+ },
50
+ "required": false,
51
+ "optional": true,
52
+ "docs": {
53
+ "tags": [],
54
+ "text": "Total pages"
55
+ },
56
+ "attribute": "total-pages",
57
+ "reflect": false
58
+ },
59
+ "currentPage": {
60
+ "type": "number",
61
+ "mutable": false,
62
+ "complexType": {
63
+ "original": "number",
64
+ "resolved": "number | undefined",
65
+ "references": {}
66
+ },
67
+ "required": false,
68
+ "optional": true,
69
+ "docs": {
70
+ "tags": [],
71
+ "text": "Current page"
72
+ },
73
+ "attribute": "current-page",
74
+ "reflect": false
75
+ },
76
+ "formatHref": {
77
+ "type": "unknown",
78
+ "mutable": false,
79
+ "complexType": {
80
+ "original": "(page: number) => string",
81
+ "resolved": "(page: number) => string",
82
+ "references": {}
83
+ },
84
+ "required": false,
85
+ "optional": false,
86
+ "docs": {
87
+ "tags": [],
88
+ "text": "This function is called to format the href"
89
+ },
90
+ "defaultValue": "(page) => '#' + page"
91
+ }
92
+ }; }
93
+ static get events() { return [{
94
+ "method": "selectPage",
95
+ "name": "selectPage",
96
+ "bubbles": true,
97
+ "cancelable": true,
98
+ "composed": true,
99
+ "docs": {
100
+ "tags": [],
101
+ "text": "Emitted on page select"
102
+ },
103
+ "complexType": {
104
+ "original": "PaginationSelectPageEvent",
105
+ "resolved": "PaginationSelectPageEvent",
106
+ "references": {
107
+ "PaginationSelectPageEvent": {
108
+ "location": "import",
109
+ "path": "./pagination.interfaces"
110
+ }
111
+ }
112
+ }
113
+ }]; }
114
+ }
@@ -0,0 +1,11 @@
1
+ import { html } from 'lit-html';
2
+ export function paginationTemplate({ totalPages, currentPage, onSelectPage, formatHref, }) {
3
+ return html `
4
+ <dso-pagination
5
+ total-pages=${totalPages}
6
+ current-page=${currentPage}
7
+ .formatHref=${formatHref}
8
+ @selectPage=${onSelectPage}
9
+ ></dso-pagination>
10
+ `;
11
+ }
@@ -4,6 +4,13 @@ import { h, Component, Element, Host, Listen, Method, Prop, State, Watch } from
4
4
  import clsx from 'clsx';
5
5
  // Keep const in sync with $tooltip-transition-duration in @dso-toolkit/sources/tooltip.scss tooltip_root() mixin
6
6
  const transitionDuration = 150;
7
+ function hasOverflow(el) {
8
+ const style = window.getComputedStyle(el);
9
+ const overflowX = style.getPropertyValue('overflow-x');
10
+ const overflowY = style.getPropertyValue('overflow-y');
11
+ const overflowValues = ['hidden', 'clip'];
12
+ return overflowValues.indexOf(overflowX) != -1 || overflowValues.indexOf(overflowY) != -1;
13
+ }
7
14
  export class Tooltip {
8
15
  constructor() {
9
16
  /**
@@ -14,6 +21,10 @@ export class Tooltip {
14
21
  * Set position of tooltip relative to target
15
22
  */
16
23
  this.position = 'top';
24
+ /**
25
+ * Set position strategy of tooltip
26
+ */
27
+ this.strategy = 'auto';
17
28
  /**
18
29
  * Set attribute `no-arrow` to hide the arrow
19
30
  */
@@ -57,6 +68,33 @@ export class Tooltip {
57
68
  placement: this.position
58
69
  });
59
70
  }
71
+ watchStrategy() {
72
+ this.setStrategy();
73
+ }
74
+ setStrategy() {
75
+ if (!this.popper) {
76
+ return;
77
+ }
78
+ if (this.strategy == 'absolute' || this.strategy == 'fixed') {
79
+ this.popper.setOptions({
80
+ strategy: this.strategy,
81
+ });
82
+ return;
83
+ }
84
+ let element = this.element;
85
+ while ((element === null || element === void 0 ? void 0 : element.parentNode) != null && element.parentNode != document) {
86
+ element = element.parentNode instanceof ShadowRoot ? element.parentNode.host : element.parentElement;
87
+ if (element != null && hasOverflow(element)) {
88
+ this.popper.setOptions({
89
+ strategy: 'fixed',
90
+ });
91
+ return;
92
+ }
93
+ }
94
+ this.popper.setOptions({
95
+ strategy: 'absolute',
96
+ });
97
+ }
60
98
  watchActive() {
61
99
  var _a;
62
100
  if (this.active) {
@@ -121,6 +159,7 @@ export class Tooltip {
121
159
  }
122
160
  componentDidRender() {
123
161
  var _a;
162
+ this.setStrategy();
124
163
  if (this.active) {
125
164
  (_a = this.popper) === null || _a === void 0 ? void 0 : _a.update();
126
165
  }
@@ -198,6 +237,24 @@ export class Tooltip {
198
237
  "reflect": false,
199
238
  "defaultValue": "'top'"
200
239
  },
240
+ "strategy": {
241
+ "type": "string",
242
+ "mutable": false,
243
+ "complexType": {
244
+ "original": "'auto' | 'absolute' | 'fixed'",
245
+ "resolved": "\"absolute\" | \"auto\" | \"fixed\"",
246
+ "references": {}
247
+ },
248
+ "required": false,
249
+ "optional": false,
250
+ "docs": {
251
+ "tags": [],
252
+ "text": "Set position strategy of tooltip"
253
+ },
254
+ "attribute": "strategy",
255
+ "reflect": false,
256
+ "defaultValue": "'auto'"
257
+ },
201
258
  "for": {
202
259
  "type": "string",
203
260
  "mutable": false,
@@ -331,6 +388,9 @@ export class Tooltip {
331
388
  static get watchers() { return [{
332
389
  "propName": "position",
333
390
  "methodName": "watchPosition"
391
+ }, {
392
+ "propName": "strategy",
393
+ "methodName": "watchStrategy"
334
394
  }, {
335
395
  "propName": "active",
336
396
  "methodName": "watchActive"