@dso-toolkit/core 39.0.0 → 41.0.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 (74) hide show
  1. package/dist/cjs/dso-date-picker.cjs.entry.js +25 -10
  2. package/dist/cjs/dso-header.cjs.entry.js +3 -2
  3. package/dist/cjs/dso-info_2.cjs.entry.js +2 -2
  4. package/dist/cjs/dso-map-base-layers.cjs.entry.js +3 -1
  5. package/dist/cjs/dso-map-overlays.cjs.entry.js +3 -1
  6. package/dist/cjs/dso-ozon-content.cjs.entry.js +1 -1
  7. package/dist/cjs/dso-pagination.cjs.entry.js +38 -0
  8. package/dist/cjs/dso-responsive-element.cjs.entry.js +44 -0
  9. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  10. package/dist/cjs/dso-tooltip.cjs.entry.js +40 -0
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/collection/collection-manifest.json +2 -0
  13. package/dist/collection/components/date-picker/date-picker.js +25 -10
  14. package/dist/collection/components/header/header.js +21 -2
  15. package/dist/collection/components/map-base-layers/map-base-layers.js +21 -1
  16. package/dist/collection/components/map-overlays/map-overlays.js +21 -1
  17. package/dist/collection/components/ozon-content/ozon-content.js +4 -1
  18. package/dist/collection/components/ozon-content/ozon-content.template.js +3 -3
  19. package/dist/collection/components/pagination/pagination.css +68 -0
  20. package/dist/collection/components/pagination/pagination.interfaces.js +1 -0
  21. package/dist/collection/components/pagination/pagination.js +114 -0
  22. package/dist/collection/components/pagination/pagination.template.js +11 -0
  23. package/dist/collection/components/responsive-element/responsive-element.css +3 -0
  24. package/dist/collection/components/responsive-element/responsive-element.js +46 -0
  25. package/dist/collection/components/responsive-element/responsive-element.template.js +8 -0
  26. package/dist/collection/components/selectable/selectable.js +5 -4
  27. package/dist/collection/components/tooltip/tooltip.js +60 -0
  28. package/dist/collection/components/viewer-grid/example-pages/viewer-grid-document-header.example-template.js +15 -164
  29. package/dist/collection/components/viewer-grid/example-pages/viewer-grid-document-list.example-template.js +12 -0
  30. package/dist/custom-elements/index.d.ts +12 -0
  31. package/dist/custom-elements/index.js +157 -24
  32. package/dist/dso-toolkit/dso-toolkit.css +1 -1
  33. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  34. package/dist/dso-toolkit/p-02272301.entry.js +1 -0
  35. package/dist/dso-toolkit/p-0777c1c4.entry.js +1 -0
  36. package/dist/dso-toolkit/p-09b53589.entry.js +1 -0
  37. package/dist/dso-toolkit/p-202bd676.entry.js +1 -0
  38. package/dist/dso-toolkit/p-336bf5b9.entry.js +1 -0
  39. package/dist/dso-toolkit/{p-150fe323.entry.js → p-37e12c3c.entry.js} +1 -1
  40. package/dist/dso-toolkit/p-3ad06d9d.entry.js +1 -0
  41. package/dist/dso-toolkit/p-b1dc8d76.entry.js +1 -0
  42. package/dist/dso-toolkit/{p-a8cf15cf.entry.js → p-f1026921.entry.js} +1 -1
  43. package/dist/esm/dso-date-picker.entry.js +25 -10
  44. package/dist/esm/dso-header.entry.js +3 -2
  45. package/dist/esm/dso-info_2.entry.js +2 -2
  46. package/dist/esm/dso-map-base-layers.entry.js +3 -1
  47. package/dist/esm/dso-map-overlays.entry.js +3 -1
  48. package/dist/esm/dso-ozon-content.entry.js +2 -2
  49. package/dist/esm/dso-pagination.entry.js +34 -0
  50. package/dist/esm/dso-responsive-element.entry.js +40 -0
  51. package/dist/esm/dso-toolkit.js +1 -1
  52. package/dist/esm/dso-tooltip.entry.js +40 -0
  53. package/dist/esm/loader.js +1 -1
  54. package/dist/types/components/date-picker/date-picker.d.ts +1 -1
  55. package/dist/types/components/header/header.d.ts +7 -0
  56. package/dist/types/components/map-base-layers/map-base-layers.d.ts +1 -0
  57. package/dist/types/components/map-overlays/map-overlays.d.ts +1 -0
  58. package/dist/types/components/ozon-content/ozon-content.template.d.ts +1 -1
  59. package/dist/types/components/pagination/pagination.d.ts +22 -0
  60. package/dist/types/components/pagination/pagination.interfaces.d.ts +8 -0
  61. package/dist/types/components/pagination/pagination.template.d.ts +2 -0
  62. package/dist/types/components/responsive-element/responsive-element.d.ts +10 -0
  63. package/dist/types/components/responsive-element/responsive-element.template.d.ts +3 -0
  64. package/dist/types/components/tooltip/tooltip.d.ts +6 -0
  65. package/dist/types/components/viewer-grid/example-pages/viewer-grid-document-list.example-template.d.ts +2 -0
  66. package/dist/types/components.d.ts +72 -1
  67. package/package.json +1 -1
  68. package/dist/collection/components/viewer-grid/example-pages/viewer-grid-document-item.example-template.js +0 -56
  69. package/dist/dso-toolkit/p-746d70f9.entry.js +0 -1
  70. package/dist/dso-toolkit/p-7abe091d.entry.js +0 -1
  71. package/dist/dso-toolkit/p-8bb8148f.entry.js +0 -1
  72. package/dist/dso-toolkit/p-c32860a3.entry.js +0 -1
  73. package/dist/dso-toolkit/p-d76c1151.entry.js +0 -1
  74. package/dist/types/components/viewer-grid/example-pages/viewer-grid-document-item.example-template.d.ts +0 -1
@@ -1,7 +1,9 @@
1
1
  import { Component, Event, Prop, h } from '@stencil/core';
2
+ import { v4 as uuidv4 } from 'uuid';
2
3
  export class MapOverlays {
3
4
  constructor() {
4
5
  this.selectableRefs = {};
6
+ this.group = uuidv4();
5
7
  }
6
8
  overlayChangeHandler(overlay, e) {
7
9
  const checked = e.detail.target instanceof HTMLInputElement ? !!e.detail.target.checked : false;
@@ -24,7 +26,7 @@ export class MapOverlays {
24
26
  h("legend", { class: "sr-only" }, "Kaartlagen"),
25
27
  h("div", { class: "dso-label-container" },
26
28
  h("span", { class: "control-label", "aria-hidden": "true" }, "Kaartlagen")),
27
- h("div", { class: "dso-field-container" }, this.overlays.map(overlay => (h("dso-selectable", { key: overlay.id, type: "checkbox", value: overlay.name, checked: overlay.checked, disabled: overlay.disabled, ref: ref => this.selectableRefs[overlay.id] = ref, onDsoChange: e => this.overlayChangeHandler(overlay, e) },
29
+ h("div", { class: "dso-field-container" }, this.overlays.map(overlay => (h("dso-selectable", { key: overlay.id, type: "checkbox", value: overlay.name, checked: overlay.checked, disabled: overlay.disabled, name: this.group, ref: ref => this.selectableRefs[overlay.id] = ref, onDsoChange: e => this.overlayChangeHandler(overlay, e) },
28
30
  overlay.name,
29
31
  overlay.info
30
32
  ? h("p", { slot: "info" }, overlay.info)
@@ -39,6 +41,24 @@ export class MapOverlays {
39
41
  "$": ["map-overlays.css"]
40
42
  }; }
41
43
  static get properties() { return {
44
+ "group": {
45
+ "type": "string",
46
+ "mutable": false,
47
+ "complexType": {
48
+ "original": "string",
49
+ "resolved": "string",
50
+ "references": {}
51
+ },
52
+ "required": false,
53
+ "optional": false,
54
+ "docs": {
55
+ "tags": [],
56
+ "text": ""
57
+ },
58
+ "attribute": "group",
59
+ "reflect": false,
60
+ "defaultValue": "uuidv4()"
61
+ },
42
62
  "overlays": {
43
63
  "type": "unknown",
44
64
  "mutable": false,
@@ -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
+ this.selectPage.emit({
11
+ originalEvent: e,
12
+ page,
13
+ isModifiedEvent: e.button !== 0 || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey,
14
+ });
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.currentPage && this.clickHandler(e, pages[this.currentPage - 2]) },
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.currentPage && this.clickHandler(e, pages[this.currentPage]) },
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
+ }
@@ -0,0 +1,3 @@
1
+ :host {
2
+ display: block;
3
+ }
@@ -0,0 +1,46 @@
1
+ import { Component, Element, Host, State, h } from '@stencil/core';
2
+ const elementSizes = [
3
+ {
4
+ width: 624, alias: 'large'
5
+ },
6
+ {
7
+ width: 375, alias: 'medium'
8
+ },
9
+ {
10
+ width: 0, alias: 'small'
11
+ }
12
+ ];
13
+ export class ResponsiveElement {
14
+ constructor() {
15
+ this.sizeAlias = elementSizes[0].alias;
16
+ this.sizeWidth = 0;
17
+ this.observer = new ResizeObserver(([entry]) => {
18
+ var _a, _b;
19
+ const size = (_b = (_a = elementSizes.find(s => entry.contentRect.width >= s.width)) === null || _a === void 0 ? void 0 : _a.alias) !== null && _b !== void 0 ? _b : elementSizes[0].alias;
20
+ this.sizeAlias = size;
21
+ });
22
+ }
23
+ componentWillLoad() {
24
+ this.observer.observe(this.host);
25
+ }
26
+ disconnectedCallback() {
27
+ this.observer.unobserve(this.host);
28
+ }
29
+ render() {
30
+ return (h(Host, { small: this.sizeAlias === 'small', medium: this.sizeAlias === 'medium', large: this.sizeAlias === 'large' },
31
+ h("slot", null)));
32
+ }
33
+ static get is() { return "dso-responsive-element"; }
34
+ static get encapsulation() { return "shadow"; }
35
+ static get originalStyleUrls() { return {
36
+ "$": ["./responsive-element.scss"]
37
+ }; }
38
+ static get styleUrls() { return {
39
+ "$": ["responsive-element.css"]
40
+ }; }
41
+ static get states() { return {
42
+ "sizeAlias": {},
43
+ "sizeWidth": {}
44
+ }; }
45
+ static get elementRef() { return "host"; }
46
+ }
@@ -0,0 +1,8 @@
1
+ import { html } from 'lit-html';
2
+ export function responsiveElementTemplate({ children }) {
3
+ return html `
4
+ <dso-responsive-element>
5
+ ${children}
6
+ </dso-responsive-element>
7
+ `;
8
+ }
@@ -31,20 +31,21 @@ export class Selectable {
31
31
  var _a;
32
32
  const hasInfo = !!this.host.querySelector('[slot="info"]');
33
33
  return (h(Fragment, null,
34
- h("input", { type: this.type, id: this.getIdentifier(), value: this.value, name: this.name, "aria-invalid": (_a = this.invalid) === null || _a === void 0 ? void 0 : _a.toString(), "aria-describedby": this.describedById, disabled: this.disabled, required: this.required, checked: this.checked, onChange: e => this.change.emit(e), ref: (el) => this.input = el }),
34
+ h("input", { type: this.type, id: this.getIdentifier(), value: this.value, name: this.name, "aria-invalid": (_a = this.invalid) === null || _a === void 0 ? void 0 : _a.toString(), "aria-describedby": (hasInfo && this.infoFixed) ? this.describedById : undefined, disabled: this.disabled, required: this.required, checked: this.checked, onChange: e => this.change.emit(e), ref: (el) => this.input = el }),
35
35
  h("label", { htmlFor: this.getIdentifier() },
36
36
  h("slot", null)),
37
37
  hasInfo && (h(Fragment, null,
38
38
  !this.infoFixed && (h("dso-info-button", { active: this.infoActive, onToggle: e => this.infoActive = e.detail.active })),
39
- h("dso-info", { fixed: this.infoFixed, active: this.infoActive, onClose: () => this.infoActive = false },
40
- h("slot", { name: "info" }))))));
39
+ h("dso-info", { id: (hasInfo && this.infoFixed) ? this.describedById : undefined, fixed: this.infoFixed, active: this.infoActive, onClose: () => this.infoActive = false },
40
+ h("div", null,
41
+ h("slot", { name: "info" })))))));
41
42
  }
42
43
  getIdentifier() {
43
44
  var _a;
44
45
  return (_a = this.identifier) !== null && _a !== void 0 ? _a : this.fallbackIdentifier;
45
46
  }
46
47
  static get is() { return "dso-selectable"; }
47
- static get encapsulation() { return "shadow"; }
48
+ static get encapsulation() { return "scoped"; }
48
49
  static get originalStyleUrls() { return {
49
50
  "$": ["selectable.scss"]
50
51
  }; }
@@ -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"
@@ -1,170 +1,21 @@
1
1
  import { AlertType } from "@dso-toolkit/sources";
2
- import { html, nothing } from "lit-html";
3
- import { alertTemplate } from "../../alert/alert.template";
4
- import { anchorTemplate } from "../../anchor/anchor.template";
5
- import { badgeTemplate } from "../../badge/badge.template";
6
- import { buttonTemplate } from "../../button/button.template";
7
- import { definitionListTemplate } from "../../definition-list/definition-list.template";
8
- import { iconTemplate } from "../../icon/icon.template";
9
- import { labelTemplate } from "../../label/label.template";
10
- import { viewerGridTemplate } from "../templates/viewer-grid.template";
2
+ import { documentHeaderTemplate } from '@dso-toolkit/css/src/components/document-header/document-header.template';
3
+ import { status, features, statusContent } from '@dso-toolkit/css/src/components/document-header/document-header.content';
4
+ import { alertTemplate } from '../../alert/alert.template';
5
+ import { viewerGridTemplate } from '../templates/viewer-grid.template';
11
6
  export function viewerGridDocumentHeaderExampleTemplate({ documentHeaderFeaturesOpen, documentHeaderFeatureAction, documentHeaderStatusOpen }) {
12
- const features = {
13
- modifier: "dso-document-header-features",
14
- definitions: [
15
- {
16
- term: "Opschrift",
17
- descriptions: [
18
- {
19
- content: "Besluit van 3 juli 2018, houdende regels over activiteiten in de fysieke leefomgeving"
20
- },
21
- ],
22
- },
23
- {
24
- term: "Identificatie",
25
- descriptions: [
26
- {
27
- content: "/akn/nl/act/mnre1034/2021/BWBR0041330"
28
- }
29
- ],
30
- },
31
- {
32
- term: "Besluit",
33
- descriptions: [
34
- {
35
- content: anchorTemplate({
36
- label: "Bekijk besluit",
37
- url: "#",
38
- icon: {
39
- icon: "external-link",
40
- },
41
- iconMode: "after",
42
- })
43
- }
44
- ],
45
- },
46
- ],
47
- useSrOnlyColon: false,
48
- };
49
7
  return viewerGridTemplate({
50
- main: html `
51
- <div class="dso-document-header">
52
- <h1>Omgevingsplan gemeente Gouda</h1>
53
-
54
- <div class="dso-document-header-container">
55
- <p class="dso-document-header-type">Een omgevingsplan waar de omgeving mooier van wordt</p>
56
- <p class="dso-document-header-owner">Gemeente Gouda</p>
57
-
58
- ${buttonTemplate({
59
- label: "Actie",
60
- variant: null,
61
- modifier: "dso-document-header-map-action",
62
- icon: {
63
- icon: "map-location",
64
- },
65
- iconMode: "only",
66
- })}
67
-
68
- <div class="dso-document-header-features-wrapper">
69
- ${buttonTemplate({
70
- ariaExpanded: documentHeaderFeaturesOpen,
71
- onClick: documentHeaderFeatureAction,
72
- label: documentHeaderFeaturesOpen ? "Minder kenmerken" : "Meer kenmerken",
73
- variant: null,
74
- modifier: "dso-document-header-toggle-features",
75
- icon: {
76
- icon: documentHeaderFeaturesOpen ? "angle-up" : "angle-down",
77
- },
78
- iconMode: "after",
79
- })}
80
- ${documentHeaderFeaturesOpen ? definitionListTemplate(features) : nothing}
81
- </div>
82
-
83
- <div class="dso-document-header-status-wrapper">
84
- <p class="dso-document-header-status">
85
- Gepubliceerd 03-03-2021
86
- ${labelTemplate({
87
- status: "bright",
88
- label: "in werking",
89
- })}
90
- ${buttonTemplate({
91
- ariaExpanded: documentHeaderStatusOpen,
92
- onClick: documentHeaderFeatureAction,
93
- label: "overige versies",
94
- variant: null,
95
- modifier: "dso-document-header-toggle-status",
96
- icon: {
97
- icon: documentHeaderStatusOpen ? "angle-up" : "angle-down",
98
- },
99
- iconMode: "after",
100
- })}
101
- ${badgeTemplate({
102
- status: "warning",
103
- message: "3",
104
- })}
105
- ${badgeTemplate({
106
- status: "outline",
107
- message: "1",
108
- })}
109
- </p>
110
- ${documentHeaderStatusOpen ? html `
111
- <div class="dso-document-header-status-content">
112
- <h2>Versies</h2>
113
-
114
- <h3>Vastgesteld</h3>
115
- <div>
116
- ${iconTemplate({ icon: 'eye' })}
117
- <strong>Gepubliceerd op 01-03-2021</strong>
118
- ${labelTemplate({
119
- label: "In werking",
120
- })}
121
- </div>
122
- <div>
123
- ${iconTemplate({ icon: 'chevron-right' })}
124
- Gepubliceerd op 10-03-2021
125
- ${labelTemplate({
126
- status: "bright",
127
- label: "Toekomstige versie",
128
- })}
129
- datum in werking: 1-6-2022
130
- </div>
131
- ${anchorTemplate({ label: 'bekijk eerdere versies', url: '#' })}
132
-
133
- <h3>Ontwerpen binnen inzagetermijn</h3>
134
- <div>
135
- ${iconTemplate({ icon: 'chevron-right' })}
136
- Gepubliceerd op 09-02-2021
137
- ${labelTemplate({
138
- status: "warning",
139
- label: "Ontwerp",
140
- })}
141
- Eind inzagetermijn: 23-03-2022
142
- </div>
143
- <div>
144
- ${iconTemplate({ icon: 'chevron-right' })}
145
- Gepubliceerd op 01-02-2021
146
- ${labelTemplate({
147
- status: "warning",
148
- label: "Ontwerp",
149
- })}
150
- Eind inzagetermijn: 15-03-2022
151
- </div>
152
- <div>
153
- ${iconTemplate({ icon: 'chevron-right' })}
154
- Gepubliceerd op 20-01-2021
155
- ${labelTemplate({
156
- status: "warning",
157
- label: "Ontwerp",
158
- })}
159
- Eind inzagetermijn: 03-03-2022
160
- </div>
161
- ${anchorTemplate({ label: 'bekijk ontwerpen waarvan inzagetermijn voorbij is', url: '#' })}
162
- </div>
163
- ` : nothing}
164
- </div>
165
- </div>
166
- </div>
167
- `,
8
+ main: documentHeaderTemplate({
9
+ title: 'Omgevingsplan gemeente Gouda',
10
+ type: 'Een omgevingsplan waar de omgeving mooier van wordt',
11
+ owner: 'Gemeente Gouda',
12
+ features,
13
+ featureAction: documentHeaderFeatureAction,
14
+ featuresOpen: documentHeaderFeaturesOpen,
15
+ statusContentOpen: documentHeaderStatusOpen,
16
+ status: status(documentHeaderFeaturesOpen, documentHeaderFeatureAction),
17
+ statusContent
18
+ }),
168
19
  map: alertTemplate({ message: 'Dit is de kaart', status: AlertType.Info })
169
20
  });
170
21
  }
@@ -0,0 +1,12 @@
1
+ import { AlertType } from "@dso-toolkit/sources";
2
+ import { documentListStatusDemoContentMapper } from '@dso-toolkit/css/src/components/document-list/document-list.mapper';
3
+ import { documentListTemplate } from '@dso-toolkit/css/src/components/document-list/document-list.template';
4
+ import { alertTemplate } from "../../alert/alert.template";
5
+ import { viewerGridTemplate } from '../templates/viewer-grid.template';
6
+ export function viewerGridDocumentListExampleTemplate(documentList) {
7
+ return viewerGridTemplate({
8
+ main: documentListTemplate({ items: documentList.items.map(item => (Object.assign(Object.assign({}, item), { status: documentListStatusDemoContentMapper(item.status) }))) }),
9
+ map: alertTemplate({ message: 'Dit is de kaart', status: AlertType.Info })
10
+ });
11
+ }
12
+ ;