@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
@@ -0,0 +1,34 @@
1
+ import { r as registerInstance, c as createEvent, h } from './index-1602fde1.js';
2
+
3
+ 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}";
4
+
5
+ let Pagination = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.selectPage = createEvent(this, "selectPage", 7);
9
+ /**
10
+ * This function is called to format the href
11
+ */
12
+ this.formatHref = (page) => '#' + page;
13
+ }
14
+ clickHandler(e, page) {
15
+ if (e.button !== 0 || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) {
16
+ return;
17
+ }
18
+ e.preventDefault();
19
+ this.selectPage.emit({ originalEvent: e, page });
20
+ }
21
+ ;
22
+ render() {
23
+ if (!this.totalPages) {
24
+ return null;
25
+ }
26
+ const pages = Array.from({ length: this.totalPages }, (_value, i) => i + 1);
27
+ return (h("ul", { class: "pagination" }, h("li", { class: this.currentPage === pages[0] ? 'dso-page-hidden' : undefined }, h("a", { href: this.formatHref(pages[0]), "aria-label": "Vorige", onClick: e => this.clickHandler(e, pages[0]) }, h("dso-icon", { icon: "chevron-left" }))), pages.map(page => (h("li", { key: page, class: this.currentPage === page ? 'active' : undefined }, this.currentPage === page
28
+ ? (h("span", { "aria-current": "page" }, page))
29
+ : (h("a", { href: this.formatHref(page), onClick: e => this.clickHandler(e, page) }, page))))), h("li", { class: this.currentPage === pages[pages.length - 1] ? 'dso-page-hidden' : undefined }, h("a", { href: this.formatHref(pages[pages.length - 1]), "aria-label": "Volgende", onClick: e => this.clickHandler(e, pages[pages.length - 1]) }, h("dso-icon", { icon: "chevron-right" })))));
30
+ }
31
+ };
32
+ Pagination.style = paginationCss;
33
+
34
+ export { Pagination as dso_pagination };
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["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-header",[[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",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-tree-view",[[1,"dso-tree-view",{"collection":[16]}]]],["dso-autosuggest",[[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",[[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",[[1,"dso-helpcenter-panel",{"label":[1],"url":[1],"visibility":[32],"isOpen":[32],"slideState":[32],"loadIframe":[32]}]]],["dso-image-overlay",[[1,"dso-image-overlay",{"active":[32],"focused":[32]}]]],["dso-label",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"hover":[32]}]]],["dso-map-controls",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32]}]]],["dso-viewer-grid",[[1,"dso-viewer-grid",{"filterpanelOpen":[516,"filterpanel-open"],"overlayOpen":[516,"overlay-open"],"initialMainSize":[1,"initial-main-size"],"mainSize":[32]}]]],["dso-alert",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-badge",[[1,"dso-badge",{"status":[1]}]]],["dso-banner",[[1,"dso-banner",{"status":[1]}]]],["dso-highlight-box",[[1,"dso-highlight-box",{"yellow":[4],"border":[4],"white":[4],"dropShadow":[4,"drop-shadow"],"step":[2]}]]],["dso-ozon-content",[[2,"dso-ozon-content",{"content":[1],"inline":[516],"deleted":[516],"interactive":[516],"state":[32]}]]],["dso-progress-bar",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-responsive-element",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32]}]]],["dso-dropdown-menu",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-tooltip",[[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",[[1,"dso-progress-indicator",{"label":[1],"size":[1],"block":[4]}]]],["dso-info-button",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1]}]]],["dso-info_2",[[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",[[1,"dso-icon",{"icon":[1]}]]]], options);
16
+ return bootstrapLazy([["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-header",[[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",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-tree-view",[[1,"dso-tree-view",{"collection":[16]}]]],["dso-autosuggest",[[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",[[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",[[1,"dso-helpcenter-panel",{"label":[1],"url":[1],"visibility":[32],"isOpen":[32],"slideState":[32],"loadIframe":[32]}]]],["dso-image-overlay",[[1,"dso-image-overlay",{"active":[32],"focused":[32]}]]],["dso-label",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"hover":[32]}]]],["dso-map-controls",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32]}]]],["dso-pagination",[[1,"dso-pagination",{"totalPages":[2,"total-pages"],"currentPage":[2,"current-page"],"formatHref":[16]}]]],["dso-viewer-grid",[[1,"dso-viewer-grid",{"filterpanelOpen":[516,"filterpanel-open"],"overlayOpen":[516,"overlay-open"],"initialMainSize":[1,"initial-main-size"],"mainSize":[32]}]]],["dso-alert",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-badge",[[1,"dso-badge",{"status":[1]}]]],["dso-banner",[[1,"dso-banner",{"status":[1]}]]],["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":[516],"state":[32]}]]],["dso-progress-bar",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-responsive-element",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32]}]]],["dso-dropdown-menu",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-tooltip",[[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",[[1,"dso-progress-indicator",{"label":[1],"size":[1],"block":[4]}]]],["dso-info-button",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1]}]]],["dso-info_2",[[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",[[1,"dso-icon",{"icon":[1]}]]]], options);
17
17
  });
@@ -1826,6 +1826,13 @@ const tooltipCss = ":host(.hidden){visibility:hidden}:host-context(dso-toggletip
1826
1826
 
1827
1827
  // Keep const in sync with $tooltip-transition-duration in @dso-toolkit/sources/tooltip.scss tooltip_root() mixin
1828
1828
  const transitionDuration = 150;
1829
+ function hasOverflow(el) {
1830
+ const style = window.getComputedStyle(el);
1831
+ const overflowX = style.getPropertyValue('overflow-x');
1832
+ const overflowY = style.getPropertyValue('overflow-y');
1833
+ const overflowValues = ['hidden', 'clip'];
1834
+ return overflowValues.indexOf(overflowX) != -1 || overflowValues.indexOf(overflowY) != -1;
1835
+ }
1829
1836
  let Tooltip = class {
1830
1837
  constructor(hostRef) {
1831
1838
  registerInstance(this, hostRef);
@@ -1837,6 +1844,10 @@ let Tooltip = class {
1837
1844
  * Set position of tooltip relative to target
1838
1845
  */
1839
1846
  this.position = 'top';
1847
+ /**
1848
+ * Set position strategy of tooltip
1849
+ */
1850
+ this.strategy = 'auto';
1840
1851
  /**
1841
1852
  * Set attribute `no-arrow` to hide the arrow
1842
1853
  */
@@ -1880,6 +1891,33 @@ let Tooltip = class {
1880
1891
  placement: this.position
1881
1892
  });
1882
1893
  }
1894
+ watchStrategy() {
1895
+ this.setStrategy();
1896
+ }
1897
+ setStrategy() {
1898
+ if (!this.popper) {
1899
+ return;
1900
+ }
1901
+ if (this.strategy == 'absolute' || this.strategy == 'fixed') {
1902
+ this.popper.setOptions({
1903
+ strategy: this.strategy,
1904
+ });
1905
+ return;
1906
+ }
1907
+ let element = this.element;
1908
+ while ((element === null || element === void 0 ? void 0 : element.parentNode) != null && element.parentNode != document) {
1909
+ element = element.parentNode instanceof ShadowRoot ? element.parentNode.host : element.parentElement;
1910
+ if (element != null && hasOverflow(element)) {
1911
+ this.popper.setOptions({
1912
+ strategy: 'fixed',
1913
+ });
1914
+ return;
1915
+ }
1916
+ }
1917
+ this.popper.setOptions({
1918
+ strategy: 'absolute',
1919
+ });
1920
+ }
1883
1921
  watchActive() {
1884
1922
  var _a;
1885
1923
  if (this.active) {
@@ -1944,6 +1982,7 @@ let Tooltip = class {
1944
1982
  }
1945
1983
  componentDidRender() {
1946
1984
  var _a;
1985
+ this.setStrategy();
1947
1986
  if (this.active) {
1948
1987
  (_a = this.popper) === null || _a === void 0 ? void 0 : _a.update();
1949
1988
  }
@@ -1975,6 +2014,7 @@ let Tooltip = class {
1975
2014
  get element() { return getElement(this); }
1976
2015
  static get watchers() { return {
1977
2016
  "position": ["watchPosition"],
2017
+ "strategy": ["watchStrategy"],
1978
2018
  "active": ["watchActive"]
1979
2019
  }; }
1980
2020
  };
@@ -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-map-base-layers",[[1,"dso-map-base-layers",{"group":[1],"baseLayers":[16]}]]],["dso-map-overlays",[[1,"dso-map-overlays",{"group":[1],"overlays":[16]}]]],["dso-header",[[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",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-tree-view",[[1,"dso-tree-view",{"collection":[16]}]]],["dso-autosuggest",[[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",[[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",[[1,"dso-helpcenter-panel",{"label":[1],"url":[1],"visibility":[32],"isOpen":[32],"slideState":[32],"loadIframe":[32]}]]],["dso-image-overlay",[[1,"dso-image-overlay",{"active":[32],"focused":[32]}]]],["dso-label",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"hover":[32]}]]],["dso-map-controls",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32]}]]],["dso-viewer-grid",[[1,"dso-viewer-grid",{"filterpanelOpen":[516,"filterpanel-open"],"overlayOpen":[516,"overlay-open"],"initialMainSize":[1,"initial-main-size"],"mainSize":[32]}]]],["dso-alert",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-badge",[[1,"dso-badge",{"status":[1]}]]],["dso-banner",[[1,"dso-banner",{"status":[1]}]]],["dso-highlight-box",[[1,"dso-highlight-box",{"yellow":[4],"border":[4],"white":[4],"dropShadow":[4,"drop-shadow"],"step":[2]}]]],["dso-ozon-content",[[2,"dso-ozon-content",{"content":[1],"inline":[516],"deleted":[516],"interactive":[516],"state":[32]}]]],["dso-progress-bar",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-responsive-element",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32]}]]],["dso-dropdown-menu",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-tooltip",[[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",[[1,"dso-progress-indicator",{"label":[1],"size":[1],"block":[4]}]]],["dso-info-button",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1]}]]],["dso-info_2",[[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",[[1,"dso-icon",{"icon":[1]}]]]], options);
13
+ return bootstrapLazy([["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-header",[[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",[[1,"dso-toggletip",{"label":[1],"position":[1],"small":[4],"secondary":[4],"active":[32]}]]],["dso-tree-view",[[1,"dso-tree-view",{"collection":[16]}]]],["dso-autosuggest",[[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",[[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",[[1,"dso-helpcenter-panel",{"label":[1],"url":[1],"visibility":[32],"isOpen":[32],"slideState":[32],"loadIframe":[32]}]]],["dso-image-overlay",[[1,"dso-image-overlay",{"active":[32],"focused":[32]}]]],["dso-label",[[1,"dso-label",{"compact":[4],"removable":[4],"status":[1],"hover":[32]}]]],["dso-map-controls",[[1,"dso-map-controls",{"open":[1540],"disableZoom":[1,"disable-zoom"],"hideContent":[32]}]]],["dso-pagination",[[1,"dso-pagination",{"totalPages":[2,"total-pages"],"currentPage":[2,"current-page"],"formatHref":[16]}]]],["dso-viewer-grid",[[1,"dso-viewer-grid",{"filterpanelOpen":[516,"filterpanel-open"],"overlayOpen":[516,"overlay-open"],"initialMainSize":[1,"initial-main-size"],"mainSize":[32]}]]],["dso-alert",[[1,"dso-alert",{"status":[1],"roleAlert":[4,"role-alert"]}]]],["dso-attachments-counter",[[1,"dso-attachments-counter",{"count":[2]}]]],["dso-badge",[[1,"dso-badge",{"status":[1]}]]],["dso-banner",[[1,"dso-banner",{"status":[1]}]]],["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":[516],"state":[32]}]]],["dso-progress-bar",[[1,"dso-progress-bar",{"progress":[2],"min":[2],"max":[2]}]]],["dso-responsive-element",[[1,"dso-responsive-element",{"sizeAlias":[32],"sizeWidth":[32]}]]],["dso-dropdown-menu",[[1,"dso-dropdown-menu",{"open":[1540],"dropdownAlign":[1,"dropdown-align"],"checkable":[4]}]]],["dso-tooltip",[[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",[[1,"dso-progress-indicator",{"label":[1],"size":[1],"block":[4]}]]],["dso-info-button",[[1,"dso-info-button",{"active":[1540],"secondary":[4],"label":[1]}]]],["dso-info_2",[[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",[[1,"dso-icon",{"icon":[1]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -31,6 +31,7 @@ export declare class DsoDatePicker implements ComponentInterface {
31
31
  private initialTouchY;
32
32
  private localization;
33
33
  private firstDayOfWeek;
34
+ private previousValue;
34
35
  /**
35
36
  * Reference to host HTML element.
36
37
  */
@@ -163,7 +164,6 @@ export declare class DsoDatePicker implements ComponentInterface {
163
164
  private handleMonthSelect;
164
165
  private handleYearSelect;
165
166
  private handleInputChange;
166
- private handleKeyPress;
167
167
  private setValue;
168
168
  private prepareEvent;
169
169
  private processFocusedDayNode;
@@ -1,2 +1,2 @@
1
1
  import { OzonContent } from '@dso-toolkit/sources';
2
- export declare function ozonContentTemplate({ content, inline, interactive, deleted, onAnchorClick, onClick }: OzonContent): import("lit-html").TemplateResult<1>;
2
+ export declare function ozonContentTemplate({ content, inline, interactive, deleted, prefix, suffix, onAnchorClick, onClick }: OzonContent): import("lit-html").TemplateResult<1>;
@@ -0,0 +1,22 @@
1
+ import { ComponentInterface, EventEmitter } from '../../stencil-public-runtime';
2
+ import { PaginationSelectPageEvent } from './pagination.interfaces';
3
+ export declare class Pagination implements ComponentInterface {
4
+ /**
5
+ * Total pages
6
+ */
7
+ totalPages?: number;
8
+ /**
9
+ * Current page
10
+ */
11
+ currentPage?: number;
12
+ /**
13
+ * This function is called to format the href
14
+ */
15
+ formatHref: (page: number) => string;
16
+ /**
17
+ * Emitted on page select
18
+ */
19
+ selectPage: EventEmitter<PaginationSelectPageEvent>;
20
+ clickHandler(e: MouseEvent, page: number): void;
21
+ render(): any;
22
+ }
@@ -0,0 +1,6 @@
1
+ export interface PaginationSelectPageEvent {
2
+ /** The selected page */
3
+ page: number;
4
+ /** The original pointer event */
5
+ originalEvent: MouseEvent;
6
+ }
@@ -0,0 +1,2 @@
1
+ import { Pagination } from '@dso-toolkit/sources';
2
+ export declare function paginationTemplate({ totalPages, currentPage, onSelectPage, formatHref, }: Pagination): import("lit-html").TemplateResult<1>;
@@ -7,6 +7,10 @@ export declare class Tooltip {
7
7
  * Set position of tooltip relative to target
8
8
  */
9
9
  position: 'top' | 'right' | 'bottom' | 'left';
10
+ /**
11
+ * Set position strategy of tooltip
12
+ */
13
+ strategy: 'auto' | 'absolute' | 'fixed';
10
14
  /**
11
15
  * Specify target element that the tooltip will describe and listens to for events.
12
16
  * * `undefined`: The direct parent is used.
@@ -40,6 +44,8 @@ export declare class Tooltip {
40
44
  */
41
45
  deactivate(): Promise<void>;
42
46
  watchPosition(): void;
47
+ watchStrategy(): void;
48
+ setStrategy(): void;
43
49
  watchActive(): void;
44
50
  private element;
45
51
  private target;
@@ -12,6 +12,7 @@ import { InfoButtonToggleEvent } from "./components/info-button/info-button";
12
12
  import { BaseLayer, BaseLayerChangeEvent } from "./components/map-base-layers/map-base-layers.interfaces";
13
13
  import { Overlay, OverlayChangeEvent } from "./components/map-overlays/map-overlays.interfaces";
14
14
  import { OzonContentAnchorClick, OzonContentClick } from "./components/ozon-content/ozon-content.interfaces";
15
+ import { PaginationSelectPageEvent } from "./components/pagination/pagination.interfaces";
15
16
  import { SelectableChangeEvent } from "./components/selectable/selectable";
16
17
  import { TreeViewItem, TreeViewPointerEvent } from "./components/tree-view/tree-view.interfaces";
17
18
  import { FilterpanelEvent, MainSize, ViewerGridChangeSizeEvent } from "./components/viewer-grid/viewer-grid";
@@ -191,6 +192,20 @@ export namespace Components {
191
192
  */
192
193
  "interactive": boolean;
193
194
  }
195
+ interface DsoPagination {
196
+ /**
197
+ * Current page
198
+ */
199
+ "currentPage"?: number;
200
+ /**
201
+ * This function is called to format the href
202
+ */
203
+ "formatHref": (page: number) => string;
204
+ /**
205
+ * Total pages
206
+ */
207
+ "totalPages"?: number;
208
+ }
194
209
  interface DsoProgressBar {
195
210
  "max": number;
196
211
  "min": number;
@@ -260,6 +275,10 @@ export namespace Components {
260
275
  * Deactivates mouseover behaviour
261
276
  */
262
277
  "stateless"?: boolean;
278
+ /**
279
+ * Set position strategy of tooltip
280
+ */
281
+ "strategy": 'auto' | 'absolute' | 'fixed';
263
282
  }
264
283
  interface DsoTreeView {
265
284
  /**
@@ -391,6 +410,12 @@ declare global {
391
410
  prototype: HTMLDsoOzonContentElement;
392
411
  new (): HTMLDsoOzonContentElement;
393
412
  };
413
+ interface HTMLDsoPaginationElement extends Components.DsoPagination, HTMLStencilElement {
414
+ }
415
+ var HTMLDsoPaginationElement: {
416
+ prototype: HTMLDsoPaginationElement;
417
+ new (): HTMLDsoPaginationElement;
418
+ };
394
419
  interface HTMLDsoProgressBarElement extends Components.DsoProgressBar, HTMLStencilElement {
395
420
  }
396
421
  var HTMLDsoProgressBarElement: {
@@ -459,6 +484,7 @@ declare global {
459
484
  "dso-map-controls": HTMLDsoMapControlsElement;
460
485
  "dso-map-overlays": HTMLDsoMapOverlaysElement;
461
486
  "dso-ozon-content": HTMLDsoOzonContentElement;
487
+ "dso-pagination": HTMLDsoPaginationElement;
462
488
  "dso-progress-bar": HTMLDsoProgressBarElement;
463
489
  "dso-progress-indicator": HTMLDsoProgressIndicatorElement;
464
490
  "dso-responsive-element": HTMLDsoResponsiveElementElement;
@@ -682,6 +708,24 @@ declare namespace LocalJSX {
682
708
  */
683
709
  "onDsoClick"?: (event: CustomEvent<OzonContentClick>) => void;
684
710
  }
711
+ interface DsoPagination {
712
+ /**
713
+ * Current page
714
+ */
715
+ "currentPage"?: number;
716
+ /**
717
+ * This function is called to format the href
718
+ */
719
+ "formatHref"?: (page: number) => string;
720
+ /**
721
+ * Emitted on page select
722
+ */
723
+ "onSelectPage"?: (event: CustomEvent<PaginationSelectPageEvent>) => void;
724
+ /**
725
+ * Total pages
726
+ */
727
+ "totalPages"?: number;
728
+ }
685
729
  interface DsoProgressBar {
686
730
  "max"?: number;
687
731
  "min"?: number;
@@ -743,6 +787,10 @@ declare namespace LocalJSX {
743
787
  * Deactivates mouseover behaviour
744
788
  */
745
789
  "stateless"?: boolean;
790
+ /**
791
+ * Set position strategy of tooltip
792
+ */
793
+ "strategy"?: 'auto' | 'absolute' | 'fixed';
746
794
  }
747
795
  interface DsoTreeView {
748
796
  /**
@@ -794,6 +842,7 @@ declare namespace LocalJSX {
794
842
  "dso-map-controls": DsoMapControls;
795
843
  "dso-map-overlays": DsoMapOverlays;
796
844
  "dso-ozon-content": DsoOzonContent;
845
+ "dso-pagination": DsoPagination;
797
846
  "dso-progress-bar": DsoProgressBar;
798
847
  "dso-progress-indicator": DsoProgressIndicator;
799
848
  "dso-responsive-element": DsoResponsiveElement;
@@ -827,6 +876,7 @@ declare module "@stencil/core" {
827
876
  "dso-map-controls": LocalJSX.DsoMapControls & JSXBase.HTMLAttributes<HTMLDsoMapControlsElement>;
828
877
  "dso-map-overlays": LocalJSX.DsoMapOverlays & JSXBase.HTMLAttributes<HTMLDsoMapOverlaysElement>;
829
878
  "dso-ozon-content": LocalJSX.DsoOzonContent & JSXBase.HTMLAttributes<HTMLDsoOzonContentElement>;
879
+ "dso-pagination": LocalJSX.DsoPagination & JSXBase.HTMLAttributes<HTMLDsoPaginationElement>;
830
880
  "dso-progress-bar": LocalJSX.DsoProgressBar & JSXBase.HTMLAttributes<HTMLDsoProgressBarElement>;
831
881
  "dso-progress-indicator": LocalJSX.DsoProgressIndicator & JSXBase.HTMLAttributes<HTMLDsoProgressIndicatorElement>;
832
882
  "dso-responsive-element": LocalJSX.DsoResponsiveElement & JSXBase.HTMLAttributes<HTMLDsoResponsiveElementElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dso-toolkit/core",
3
- "version": "40.0.0",
3
+ "version": "40.1.0",
4
4
  "description": "DSO Toolkit Web Components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/custom-elements/index.js",
@@ -1 +0,0 @@
1
- import{h as e,r as t,c as s,H as i,g as d}from"./p-c62606a3.js";import{c as o}from"./p-7b37bd52.js";var a;function r(e){if(!e)return;const t=e.split("-");return 3===t.length&&4===t[2].length?function(e,t,s){var i=parseInt(s,10),d=parseInt(t,10),o=parseInt(e,10);if(Number.isInteger(o)&&Number.isInteger(d)&&Number.isInteger(i)&&d>0&&d<=12&&i>0&&i<=31&&o>0)return new Date(o,d-1,i)}(t[2],t[1],t[0]):void 0}function n(e){return e?`${e.getDate().toString(10).padStart(2,"0")}-${(e.getMonth()+1).toString(10).padStart(2,"0")}-${e.getFullYear().toString(10).padStart(2,"0")}`:""}function c(e,t){return!(!e||!t)&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function l(e,t){var s=new Date(e);return s.setDate(s.getDate()+t),s}function h(e,t=a.Monday){var s=new Date(e),i=s.getDay(),d=(i<t?7:0)+i-t;return s.setDate(s.getDate()-d),s}function p(e,t=a.Monday){var s=new Date(e),i=s.getDay(),d=6+(i<t?-7:0)-(i-t);return s.setDate(s.getDate()+d),s}function u(e){return new Date(e.getFullYear(),e.getMonth(),1)}function _(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function b(e,t){const s=new Date(e);return s.setMonth(t),s}function f(e,t){const s=new Date(e);return s.setFullYear(t),s}function g(e,t,s){return k(e,t,s)===e}function k(e,t,s){const i=e.getTime();return t&&t instanceof Date&&i<t.getTime()?t:s&&s instanceof Date&&i>s.getTime()?s:e}!function(e){e[e.Sunday=0]="Sunday",e[e.Monday=1]="Monday",e[e.Tuesday=2]="Tuesday",e[e.Wednesday=3]="Wednesday",e[e.Thursday=4]="Thursday",e[e.Friday=5]="Friday",e[e.Saturday=6]="Saturday"}(a||(a={}));const m=({focusedDay:t,today:s,day:i,onDaySelect:d,onKeyboardNavigation:o,focusedDayRef:a,inRange:r})=>{const l=c(i,s),h=c(i,t),p=i.getMonth()!==t.getMonth(),u=!r;return e("button",{class:{"dso-date__day":!0,"is-outside":u,"is-disabled":p,"is-today":l},tabIndex:h?0:-1,onClick:function(e){d(e,i)},onKeyDown:o,disabled:u||p,type:"button",ref:e=>{h&&e&&a&&a(e)}},e("span",{"aria-hidden":"true"},i.getDate()),e("span",{class:"dso-date__vhidden"},n(i)))},x=({selectedDate:t,focusedDate:s,labelledById:i,localization:d,firstDayOfWeek:o,min:r,max:n,onDateSelect:b,onKeyboardNavigation:f,focusedDayRef:k,onMouseDown:x,onFocusIn:v})=>{const y=new Date,w=function(e,t=a.Monday){return function(e,t){const s=[];let i=e;for(;!c(i,t);)s.push(i),i=l(i,1);return s.push(i),s}(h(u(e),t),p(_(e),t))}(s,o);return e("table",{class:"dso-date__table",role:"grid","aria-labelledby":i,onFocusin:v,onMouseDown:x},e("thead",null,e("tr",null,(z=o,M=t=>e("th",{class:"dso-date__table-header",scope:"col"},e("span",{"aria-hidden":"true"},t.substr(0,2)),e("span",{class:"dso-date__vhidden"},t)),(D=d.dayNames).map(((e,t)=>M(D[(t+z)%D.length])))))),e("tbody",null,function(e){const t=[];for(let s=0;s<e.length;s+=7)t.push(e.slice(s,s+7));return t}(w).map((i=>e("tr",{class:"dso-date__row"},i.map((i=>e("td",{class:"dso-date__cell",role:"gridcell","aria-selected":c(i,t)?"true":void 0,"aria-current":c(i,y)?"date":void 0},e(m,{day:i,today:y,focusedDay:s,inRange:g(i,r,n),onDaySelect:b,onKeyboardNavigation:f,focusedDayRef:k})))))))));var D,z,M},v={buttonLabel:"Kies datum",placeholder:"dd-mm-jjjj",selectedDateMessage:"Geselecteerde datum is",prevMonthLabel:"Vorige maand",nextMonthLabel:"Volgende maand",monthSelectLabel:"Maand",yearSelectLabel:"Jaar",closeLabel:"Sluiten",keyboardInstruction:"Gebruik de pijltjestoetsen om een dag te kiezen",calendarHeading:"Kies een datum",dayNames:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"],monthNames:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthNamesShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"]},y=/[^0-9\-]+/g;let w=class{constructor(e){t(this,e),this.dateChange=s(this,"dateChange",7),this.dsoBlur=s(this,"dsoBlur",7),this.dsoKeyUp=s(this,"dsoKeyUp",7),this.dsoKeyDown=s(this,"dsoKeyDown",7),this.dsoFocus=s(this,"dsoFocus",7),this.monthSelectId=o("DsoDateMonth"),this.yearSelectId=o("DsoDateYear"),this.dialogLabelId=o("DsoDateLabel"),this.localization=v,this.firstDayOfWeek=a.Monday,this.activeFocus=!1,this.focusedDay=new Date,this.open=!1,this.visible=!1,this.name="date",this.disabled=!1,this.direction="right",this.required=!1,this.dsoAutofocus=!1,this.value="",this.enableActiveFocus=()=>{this.activeFocus=!0},this.disableActiveFocus=()=>{this.activeFocus=!1},this.toggleOpen=e=>{e.preventDefault(),this.open?this.hide(!1):this.show()},this.handleEscKey=e=>{27===e.keyCode&&this.hide()},this.handleBlur=e=>{e.stopPropagation(),this.dsoBlur.emit({component:"dso-date-picker"})},this.handleKeyUp=e=>{e.stopPropagation(),this.dsoKeyUp.emit({component:"dso-date-picker",originalEvent:e})},this.handleKeyDown=e=>{e.stopPropagation(),this.dsoKeyDown.emit({component:"dso-date-picker",originalEvent:e})},this.handleFocus=e=>{e.stopPropagation(),this.dsoFocus.emit({component:"dso-date-picker"})},this.handleTouchStart=e=>{const t=e.changedTouches[0];this.initialTouchX=t.pageX,this.initialTouchY=t.pageY},this.handleTouchMove=e=>{e.preventDefault()},this.handleTouchEnd=e=>{const t=e.changedTouches[0],s=t.pageX-this.initialTouchX,i=t.pageY-this.initialTouchY,d=Math.abs(s)>=70&&Math.abs(i)<=70,o=Math.abs(i)>=70&&Math.abs(s)<=70&&i>0;d?this.addMonths(s<0?1:-1):o&&(this.hide(!1),e.preventDefault()),this.initialTouchY=void 0,this.initialTouchX=void 0},this.handleNextMonthClick=e=>{e.preventDefault(),this.addMonths(1)},this.handlePreviousMonthClick=e=>{e.preventDefault(),this.addMonths(-1)},this.handleFirstFocusableKeydown=e=>{var t;9===e.keyCode&&e.shiftKey&&(null===(t=this.focusedDayNode)||void 0===t||t.focus(),e.preventDefault())},this.handleKeyboardNavigation=e=>{var t;if(9===e.keyCode&&!e.shiftKey)return e.preventDefault(),void(null===(t=this.firstFocusableElement)||void 0===t||t.focus());var s=!0;switch(e.keyCode){case 39:this.addDays(1);break;case 37:this.addDays(-1);break;case 40:this.addDays(7);break;case 38:this.addDays(-7);break;case 33:e.shiftKey?this.addYears(-1):this.addMonths(-1);break;case 34:e.shiftKey?this.addYears(1):this.addMonths(1);break;case 36:this.startOfWeek();break;case 35:this.endOfWeek();break;default:s=!1}s&&(e.preventDefault(),this.enableActiveFocus())},this.handleDaySelect=(e,t)=>{g(t,r(this.min),r(this.max))&&(t.getMonth()===this.focusedDay.getMonth()?(this.setValue(t),this.hide()):this.setFocusedDay(t))},this.handleMonthSelect=e=>{this.setMonth(parseInt(e.target.value,10))},this.handleYearSelect=e=>{this.setYear(parseInt(e.target.value,10))},this.handleInputChange=e=>{this.setValue(e.target.value)},this.handleKeyPress=e=>{e.key.search(y)>-1&&e.preventDefault()},this.prepareEvent=e=>{var t={component:"dso-date-picker",value:"",valueAsDate:void 0};if(e instanceof Date?t.valueAsDate=e:(t.value=e,t.valueAsDate=r(e)),t.valueAsDate&&(t.value=n(t.valueAsDate)),!t.valueAsDate&&this.required&&(t.error="required"),t.value&&!t.valueAsDate&&(t.error="invalid"),t.valueAsDate&&(this.min||this.max)){const e=r(this.min),s=r(this.max),i=k(t.valueAsDate,e,s);i!==t.valueAsDate&&i===e?(t.valueAsDate=void 0,t.error="min-range"):i!==t.valueAsDate&&i===s&&(t.valueAsDate=void 0,t.error="max-range")}return t},this.processFocusedDayNode=e=>{this.focusedDayNode=e,this.activeFocus&&this.open&&setTimeout((()=>e.focus()),0)}}handleDocumentClick(e){if(!this.open)return;const t=e.composedPath();for(const e of t)if(e instanceof Node&&this.element.contains(e))return;this.hide(!1)}async setFocus(){var e;return null===(e=this.datePickerInput)||void 0===e?void 0:e.focus()}async show(){void 0!==this.hideTimeoutId&&clearTimeout(this.hideTimeoutId),this.visible=!0,setTimeout((()=>{this.open=!0,this.setFocusedDay(r(this.value)||new Date),void 0!==this.focusTimeoutId&&clearTimeout(this.focusTimeoutId),this.focusTimeoutId=setTimeout((()=>{var e;return null===(e=this.monthSelectNode)||void 0===e?void 0:e.focus()}),300)}))}async hide(e=!0){this.open=!1,void 0!==this.focusTimeoutId&&clearTimeout(this.focusTimeoutId),this.hideTimeoutId=setTimeout((()=>{e&&this.datePickerButton&&this.datePickerButton.focus(),this.visible=!1}),500)}addDays(e){this.setFocusedDay(l(this.focusedDay,e))}addMonths(e){this.setMonth(this.focusedDay.getMonth()+e)}addYears(e){this.setYear(this.focusedDay.getFullYear()+e)}startOfWeek(){this.setFocusedDay(h(this.focusedDay,this.firstDayOfWeek))}endOfWeek(){this.setFocusedDay(p(this.focusedDay,this.firstDayOfWeek))}setMonth(e){const t=b(u(this.focusedDay),e),s=_(t),i=b(this.focusedDay,e);this.setFocusedDay(k(i,t,s))}setYear(e){const t=f(u(this.focusedDay),e),s=_(t),i=f(this.focusedDay,e);this.setFocusedDay(k(i,t,s))}setFocusedDay(e){this.focusedDay=k(e,r(this.min),r(this.max))}setValue(e){const t=this.prepareEvent(e);this.value=t.value,this.dateChange.emit(t)}componentDidLoad(){const e=r(this.value);e&&(this.value=n(e)),this.dsoAutofocus&&this.setFocus()}render(){const t=r(this.value),s=t&&n(t),d=(t||this.focusedDay).getFullYear(),o=this.focusedDay.getMonth(),a=this.focusedDay.getFullYear(),c=r(this.min),l=r(this.max),h=null!=c&&c.getMonth()===o&&c.getFullYear()===a,p=null!=l&&l.getMonth()===o&&l.getFullYear()===a;let u=d-10,_=d+10;return c&&(u=Math.max(u,c.getFullYear())),l&&(_=Math.min(_,l.getFullYear())),e(i,null,e("div",{class:{"dso-date":!0,"dso-visible":this.visible}},e("div",{class:"dso-date__input-wrapper"},e("input",{class:"dso-date__input",value:this.value,placeholder:this.localization.placeholder,id:this.identifier,disabled:this.disabled,role:this.role,required:!!this.required||void 0,"aria-autocomplete":"none",onKeyPress:this.handleKeyPress,onInput:this.handleInputChange,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyUp:this.handleKeyUp,onKeyDown:this.handleKeyDown,autoComplete:"off",ref:e=>this.datePickerInput=e}),e("button",{type:"button",class:"dso-date__toggle",onClick:this.toggleOpen,disabled:this.disabled,ref:e=>this.datePickerButton=e},e("span",{class:"dso-date__toggle-icon"},e("dso-icon",{icon:"calendar"})),e("span",{class:"dso-date__vhidden"},this.localization.buttonLabel,s&&e("span",null,", ",this.localization.selectedDateMessage," ",s)))),e("div",{class:{"dso-date__dialog":!0,"is-left":"left"===this.direction,"is-active":this.open},role:"dialog","aria-modal":"true","aria-hidden":this.open?"false":"true","aria-labelledby":this.dialogLabelId,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},e("div",{class:"dso-date__dialog-content",onKeyDown:this.handleEscKey},e("div",{class:"dso-date__vhidden dso-date__instructions","aria-live":"polite"},this.localization.keyboardInstruction),e("div",{class:"dso-date__mobile",onFocusin:this.disableActiveFocus},e("label",{class:"dso-date__mobile-heading"},this.localization.calendarHeading),e("button",{class:"dso-date__close",ref:e=>this.firstFocusableElement=e,onKeyDown:this.handleFirstFocusableKeydown,onClick:()=>this.hide(),type:"button"},e("dso-icon",{icon:"times"}),e("span",{class:"dso-date__vhidden"},this.localization.closeLabel))),e("div",{class:"dso-date__header",onFocusin:this.disableActiveFocus},e("div",null,e("h2",{id:this.dialogLabelId,class:"dso-date__vhidden","aria-live":"polite"},this.localization.monthNames[o]," ",this.focusedDay.getFullYear()),e("label",{htmlFor:this.monthSelectId,class:"dso-date__vhidden"},this.localization.monthSelectLabel),e("div",{class:"dso-date__select"},e("select",{id:this.monthSelectId,class:"dso-date__select--month",ref:e=>this.monthSelectNode=e,onChange:this.handleMonthSelect},this.localization.monthNames.map(((t,s)=>e("option",{key:t,value:s,selected:s===o},t)))),e("div",{class:"dso-date__select-label","aria-hidden":"true"},e("span",null,this.localization.monthNamesShort[o]),e("dso-icon",{icon:"chevron-down"}))),e("label",{htmlFor:this.yearSelectId,class:"dso-date__vhidden"},this.localization.yearSelectLabel),e("div",{class:"dso-date__select"},e("select",{id:this.yearSelectId,class:"dso-date__select--year",onChange:this.handleYearSelect},function(e,t){for(var s=[],i=e;i<=t;i++)s.push(i);return s}(u,_).map((t=>e("option",{key:t,selected:t===a},t)))),e("div",{class:"dso-date__select-label","aria-hidden":"true"},e("span",null,this.focusedDay.getFullYear()),e("dso-icon",{icon:"chevron-down"})))),e("div",{class:"dso-date__nav"},e("button",{class:"dso-date__prev",onClick:this.handlePreviousMonthClick,disabled:h,type:"button"},e("dso-icon",{icon:"chevron-left"}),e("span",{class:"dso-date__vhidden"},this.localization.prevMonthLabel)),e("button",{class:"dso-date__next",onClick:this.handleNextMonthClick,disabled:p,type:"button"},e("dso-icon",{icon:"chevron-right"}),e("span",{class:"dso-date__vhidden"},this.localization.nextMonthLabel)))),e(x,{selectedDate:t,focusedDate:this.focusedDay,onDateSelect:this.handleDaySelect,onKeyboardNavigation:this.handleKeyboardNavigation,labelledById:this.dialogLabelId,localization:this.localization,firstDayOfWeek:this.firstDayOfWeek,focusedDayRef:this.processFocusedDayNode,min:c,max:l})))))}get element(){return d(this)}};w.style='.sc-dso-date-picker-h{display:block}.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:16px;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:pointer}.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.is-outside.sc-dso-date-picker{background:#f2f2f2;box-shadow:none;color:#666;cursor:default;pointer-events:none}.dso-date__day.is-disabled.sc-dso-date-picker{background:#fff;cursor:default}.dso-date__day.is-disabled.sc-dso-date-picker:hover{color:#666}.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}';export{w as dso_date_picker}