@dso-toolkit/core 62.8.4 → 62.10.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.
- package/dist/cjs/dso-date-picker.cjs.entry.js +45 -22
- package/dist/cjs/dso-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-expandable.cjs.entry.js +14 -4
- package/dist/cjs/dso-expandable.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-list-button.cjs.entry.js +23 -9
- package/dist/cjs/dso-list-button.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-logo.cjs.entry.js +1 -1
- package/dist/cjs/dso-logo.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-modal.cjs.entry.js +3 -1
- package/dist/cjs/dso-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion.interfaces.js.map +1 -1
- package/dist/collection/components/accordion/accordion.js.map +1 -1
- package/dist/collection/components/accordion/components/accordion-section.interfaces.js.map +1 -1
- package/dist/collection/components/accordion/components/accordion-section.js.map +1 -1
- package/dist/collection/components/action-list/action-list.js.map +1 -1
- package/dist/collection/components/action-list/components/action-list-item.js.map +1 -1
- package/dist/collection/components/alert/alert.js.map +1 -1
- package/dist/collection/components/annotation-button/annotation-button.js.map +1 -1
- package/dist/collection/components/annotation-output/annotation-output.js.map +1 -1
- package/dist/collection/components/attachments-counter/attachments-counter.js.map +1 -1
- package/dist/collection/components/autosuggest/autosuggest.interfaces.js.map +1 -1
- package/dist/collection/components/autosuggest/autosuggest.js.map +1 -1
- package/dist/collection/components/badge/badge.js.map +1 -1
- package/dist/collection/components/banner/banner.js.map +1 -1
- package/dist/collection/components/card/card.interfaces.js.map +1 -1
- package/dist/collection/components/card/card.js.map +1 -1
- package/dist/collection/components/card-container/card-container.interfaces.js.map +1 -1
- package/dist/collection/components/card-container/card-container.js.map +1 -1
- package/dist/collection/components/date-picker/date-picker.interfaces.js.map +1 -1
- package/dist/collection/components/date-picker/date-picker.js +49 -26
- package/dist/collection/components/date-picker/date-picker.js.map +1 -1
- package/dist/collection/components/date-picker/date-utils.js.map +1 -1
- package/dist/collection/components/date-picker-legacy/date-localization.js.map +1 -1
- package/dist/collection/components/date-picker-legacy/date-picker-day.js.map +1 -1
- package/dist/collection/components/date-picker-legacy/date-picker-legacy.interfaces.js.map +1 -1
- package/dist/collection/components/date-picker-legacy/date-picker-legacy.js.map +1 -1
- package/dist/collection/components/date-picker-legacy/date-picker-month.js.map +1 -1
- package/dist/collection/components/date-picker-legacy/date-utils.js.map +1 -1
- package/dist/collection/components/date-picker-legacy/utils/month-range.js.map +1 -1
- package/dist/collection/components/date-picker-legacy/utils/range.js.map +1 -1
- package/dist/collection/components/document-component/document-component-heading.js.map +1 -1
- package/dist/collection/components/document-component/document-component.js.map +1 -1
- package/dist/collection/components/document-component/document-component.models.js.map +1 -1
- package/dist/collection/components/document-component-demo/document-component.demo.js.map +1 -1
- package/dist/collection/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/collection/components/expandable/expandable.css +4 -1
- package/dist/collection/components/expandable/expandable.js +16 -5
- package/dist/collection/components/expandable/expandable.js.map +1 -1
- package/dist/collection/components/header/header.interfaces.js.map +1 -1
- package/dist/collection/components/header/header.js.map +1 -1
- package/dist/collection/components/helpcenter-panel/helpcenter-panel.js.map +1 -1
- package/dist/collection/components/highlight-box/highlight-box.js.map +1 -1
- package/dist/collection/components/icon/icon.js.map +1 -1
- package/dist/collection/components/image-overlay/image-overlay.js.map +1 -1
- package/dist/collection/components/info/info.js.map +1 -1
- package/dist/collection/components/info-button/info-button.interfaces.js.map +1 -1
- package/dist/collection/components/info-button/info-button.js.map +1 -1
- package/dist/collection/components/label/label.js.map +1 -1
- package/dist/collection/components/list-button/list-button.interfaces.js.map +1 -1
- package/dist/collection/components/list-button/list-button.js +41 -10
- package/dist/collection/components/list-button/list-button.js.map +1 -1
- package/dist/collection/components/logo/logo.css +1 -1
- package/dist/collection/components/logo/logo.js +1 -1
- package/dist/collection/components/logo/logo.js.map +1 -1
- package/dist/collection/components/map-base-layers/map-base-layers.interfaces.js.map +1 -1
- package/dist/collection/components/map-base-layers/map-base-layers.js.map +1 -1
- package/dist/collection/components/map-controls/map-controls.interfaces.js.map +1 -1
- package/dist/collection/components/map-controls/map-controls.js.map +1 -1
- package/dist/collection/components/map-overlays/map-overlays.interfaces.js.map +1 -1
- package/dist/collection/components/map-overlays/map-overlays.js.map +1 -1
- package/dist/collection/components/mark-bar/mark-bar.interfaces.js.map +1 -1
- package/dist/collection/components/mark-bar/mark-bar.js.map +1 -1
- package/dist/collection/components/modal/modal.interfaces.js.map +1 -1
- package/dist/collection/components/modal/modal.js +3 -1
- package/dist/collection/components/modal/modal.js.map +1 -1
- package/dist/collection/components/ozon-content/get-node-name.function.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/al.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/bron.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/document.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/ext-ref.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/fallback.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/figuur.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/inhoud.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/inline-tekst-afbeelding.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/inline.nodes.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/int-io-ref.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/int-ref.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/lijst.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/nieuwe-tekst.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/noot.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/opschrift.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/table.node/colspec/colspec-mapper.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/table.node/colspec/colspec.interface.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/table.node/index.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table-cell.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table-colgroup.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table-rows.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/text.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/verwijderde-tekst.node.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content-context.interface.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content-mapper.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content-node-context.interface.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content-node-state.interface.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content-node.interface.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content.interfaces.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content.js.map +1 -1
- package/dist/collection/components/pagination/pagination.interfaces.js.map +1 -1
- package/dist/collection/components/pagination/pagination.js.map +1 -1
- package/dist/collection/components/progress-bar/progress-bar.js.map +1 -1
- package/dist/collection/components/progress-indicator/progress-indicator.js.map +1 -1
- package/dist/collection/components/responsive-element/responsive-element.interfaces.js.map +1 -1
- package/dist/collection/components/responsive-element/responsive-element.js.map +1 -1
- package/dist/collection/components/scrollable/scrollable.interfaces.js.map +1 -1
- package/dist/collection/components/scrollable/scrollable.js.map +1 -1
- package/dist/collection/components/selectable/selectable.interfaces.js.map +1 -1
- package/dist/collection/components/selectable/selectable.js.map +1 -1
- package/dist/collection/components/slide-toggle/slide-toggle.interfaces.js.map +1 -1
- package/dist/collection/components/slide-toggle/slide-toggle.js.map +1 -1
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/components/toggletip/toggletip.js.map +1 -1
- package/dist/collection/components/tooltip/tooltip.js.map +1 -1
- package/dist/collection/components/tree-view/tree-item.js.map +1 -1
- package/dist/collection/components/tree-view/tree-view.interfaces.js.map +1 -1
- package/dist/collection/components/tree-view/tree-view.js.map +1 -1
- package/dist/collection/components/viewer-grid/components/document-panel.js.map +1 -1
- package/dist/collection/components/viewer-grid/components/filterpanel.js.map +1 -1
- package/dist/collection/components/viewer-grid/components/index.js.map +1 -1
- package/dist/collection/components/viewer-grid/components/main-panel.js.map +1 -1
- package/dist/collection/components/viewer-grid/components/overlay.js.map +1 -1
- package/dist/collection/components/viewer-grid/components/sizing-buttons.js.map +1 -1
- package/dist/collection/components/viewer-grid/components/viewer-grid-filterpanel-buttons.js.map +1 -1
- package/dist/collection/components/viewer-grid/viewer-grid.interfaces.js.map +1 -1
- package/dist/collection/components/viewer-grid/viewer-grid.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/create-identifier.js.map +1 -1
- package/dist/collection/utils/has-overflow.js.map +1 -1
- package/dist/collection/utils/is-interactive-element.js.map +1 -1
- package/dist/collection/utils/is-modified-event.js.map +1 -1
- package/dist/components/dso-date-picker.js +45 -22
- package/dist/components/dso-date-picker.js.map +1 -1
- package/dist/components/dso-list-button.js +25 -10
- package/dist/components/dso-list-button.js.map +1 -1
- package/dist/components/dso-logo.js +2 -2
- package/dist/components/dso-logo.js.map +1 -1
- package/dist/components/dso-modal.js +3 -1
- package/dist/components/dso-modal.js.map +1 -1
- package/dist/components/expandable.js +17 -6
- package/dist/components/expandable.js.map +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js.map +1 -1
- package/dist/dso-toolkit/{p-2258933b.entry.js → p-1981592d.entry.js} +2 -2
- package/dist/dso-toolkit/p-1981592d.entry.js.map +1 -0
- package/dist/dso-toolkit/p-638ad5e5.entry.js +2 -0
- package/dist/dso-toolkit/p-638ad5e5.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-5f39d08c.entry.js → p-b36ab83a.entry.js} +2 -2
- package/dist/dso-toolkit/p-b36ab83a.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-78baffb7.entry.js → p-ea6ca8b2.entry.js} +2 -2
- package/dist/dso-toolkit/p-ea6ca8b2.entry.js.map +1 -0
- package/dist/dso-toolkit/p-f6d1d215.entry.js +2 -0
- package/dist/dso-toolkit/p-f6d1d215.entry.js.map +1 -0
- package/dist/esm/dso-date-picker.entry.js +45 -22
- package/dist/esm/dso-date-picker.entry.js.map +1 -1
- package/dist/esm/dso-expandable.entry.js +14 -4
- package/dist/esm/dso-expandable.entry.js.map +1 -1
- package/dist/esm/dso-list-button.entry.js +24 -10
- package/dist/esm/dso-list-button.entry.js.map +1 -1
- package/dist/esm/dso-logo.entry.js +1 -1
- package/dist/esm/dso-logo.entry.js.map +1 -1
- package/dist/esm/dso-modal.entry.js +3 -1
- package/dist/esm/dso-modal.entry.js.map +1 -1
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/scripts/readme.js +78 -0
- package/dist/scripts/readme.js.map +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker.interfaces.d.ts +5 -1
- package/dist/types/components/expandable/expandable.d.ts +4 -0
- package/dist/types/components/list-button/list-button.d.ts +8 -0
- package/dist/types/components.d.ts +12 -4
- package/dist/types/usr/src/app/packages/core/.stencil/scripts/readme.d.ts +1 -0
- package/package.json +4 -2
- package/dist/dso-toolkit/p-2258933b.entry.js.map +0 -1
- package/dist/dso-toolkit/p-5f39d08c.entry.js.map +0 -1
- package/dist/dso-toolkit/p-78baffb7.entry.js.map +0 -1
- package/dist/dso-toolkit/p-7b36db3a.entry.js +0 -2
- package/dist/dso-toolkit/p-7b36db3a.entry.js.map +0 -1
- package/dist/dso-toolkit/p-e2f7399e.entry.js +0 -2
- package/dist/dso-toolkit/p-e2f7399e.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../../src/components/alert/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,IAAI,MAAM,MAAM,CAAC;AAOxB,MAAM,OAAO,KAAK;;;;;EAoBhB,MAAM;IACJ,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,EAAE;MACX,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;KAClD;IAED,OAAO,CACL,WAAK,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;MAC3F,gBAAU,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC,MAAM,GAAa;MACpD,YAAM,KAAK,EAAC,SAAS;QAAE,MAAM;YAAS;MACtC,eAAa,CACT,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApBc,eAAS,GAAG,IAAI,GAAG,CAAiB;EACjD,CAAC,SAAS,EAAE,QAAQ,CAAC;EACrB,CAAC,MAAM,EAAE,WAAW,CAAC;EACrB,CAAC,SAAS,EAAE,cAAc,CAAC;EAC3B,CAAC,OAAO,EAAE,MAAM,CAAC;CAClB,CAAC,AALsB,CAKrB","sourcesContent":["import { Component, h, Prop } from \"@stencil/core\";\r\nimport clsx from \"clsx\";\r\n\r\n@Component({\r\n tag: \"dso-alert\",\r\n styleUrl: \"alert.scss\",\r\n shadow: true,\r\n})\r\nexport class Alert {\r\n /**\r\n * Set status of alert\r\n */\r\n @Prop()\r\n status!: \"success\" | \"info\" | \"warning\" | \"error\";\r\n\r\n /**\r\n * Whether or not to show the role attribute with value \"alert\". To control the tooltip add the `role-alert` attribute.\r\n */\r\n @Prop()\r\n roleAlert?: boolean;\r\n\r\n private static statusMap = new Map<string, string>([\r\n [\"success\", \"Gelukt\"],\r\n [\"info\", \"Opmerking\"],\r\n [\"warning\", \"Waarschuwing\"],\r\n [\"error\", \"Fout\"],\r\n ]);\r\n\r\n render() {\r\n const status = Alert.statusMap.get(this.status);\r\n if (!status) {\r\n throw new Error(`Invalid status ${this.status}`);\r\n }\r\n\r\n return (\r\n <div class={clsx(\"alert\", `alert-${this.status}`)} role={this.roleAlert ? \"alert\" : undefined}>\r\n <dso-icon icon={\"status-\" + this.status}></dso-icon>\r\n <span class=\"sr-only\">{status}:</span>\r\n <slot></slot>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation-button.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"annotation-button.js","sourceRoot":"","sources":["../../../../src/components/annotation-button/annotation-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAsB,KAAK,EAAE,IAAI,EAAgB,MAAM,eAAe,CAAC;AAY5F,MAAM,OAAO,gBAAgB;;IAmBnB,gBAAW,GAAG,CAAC,CAAa,EAAE,EAAE;MACtC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC;;gBAVK,KAAK;;EAYZ,MAAM;IACJ,OAAO,CACL,cACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,cAAc,mBACL,IAAI,CAAC,UAAU,mBACf,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EACnC,OAAO,EAAE,IAAI,CAAC,WAAW;MAEzB,gBAAU,IAAI,EAAC,OAAO,GAAY;MAClC,YAAM,KAAK,EAAC,SAAS,2BAA4B,CAC1C,CACV,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { h, Component, ComponentInterface, Event, Prop, EventEmitter } from \"@stencil/core\";\r\n\r\nexport interface AnnotationButtonClickEvent {\r\n originalEvent: Event;\r\n open: boolean;\r\n}\r\n\r\n@Component({\r\n tag: \"dso-annotation-button\",\r\n styleUrl: \"annotation-button.scss\",\r\n // No shadowdom for a11y reasons (aria-controls pointing to element inside another component)\r\n})\r\nexport class AnnotationButton implements ComponentInterface {\r\n /**\r\n * To link the Annotation Button with `aria-controls` to a different element, most likely an Annotation Output.\r\n */\r\n @Prop()\r\n identifier!: string | undefined;\r\n\r\n /**\r\n * Set to true when the annotation is open.\r\n */\r\n @Prop()\r\n open = false;\r\n\r\n /**\r\n * Emitted when user activates the button.\r\n */\r\n @Event({ bubbles: false })\r\n dsoClick!: EventEmitter<AnnotationButtonClickEvent>;\r\n\r\n private handleClick = (e: MouseEvent) => {\r\n this.dsoClick.emit({ originalEvent: e, open: !this.open });\r\n };\r\n\r\n render() {\r\n return (\r\n <button\r\n type=\"button\"\r\n class=\"dso-tertiary\"\r\n aria-controls={this.identifier}\r\n aria-expanded={this.open.toString()}\r\n onClick={this.handleClick}\r\n >\r\n <dso-icon icon=\"label\"></dso-icon>\r\n <span class=\"sr-only\">Toelichting bekijken</span>\r\n </button>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation-output.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"annotation-output.js","sourceRoot":"","sources":["../../../../src/components/annotation-output/annotation-output.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAsB,KAAK,EAAgB,IAAI,EAAE,MAAM,eAAe,CAAC;AAW5F,MAAM,OAAO,gBAAgB;;IAyBnB,kBAAa,GAAG,CAAC,CAAa,EAAE,EAAE;MACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC,CAAC;;;gBAVK,KAAK;;EAYZ,MAAM;IACJ,OAAO,CACL;MACE,sBAAgB,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI;QACjD,IAAI,CAAC,gBAAgB,IAAI,YAAM,KAAK,EAAC,uBAAuB,IAAE,IAAI,CAAC,gBAAgB,CAAQ;QAC5F,WAAK,KAAK,EAAC,uBAAuB;UAChC,YAAM,IAAI,EAAC,OAAO,GAAG;UACrB,YAAM,IAAI,EAAC,QAAQ,GAAG;UACtB,cAAQ,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,0CAA0C,EAAC,OAAO,EAAE,IAAI,CAAC,aAAa;YAChG,gBAAU,IAAI,EAAC,OAAO,GAAY;YAClC,YAAM,KAAK,EAAC,SAAS,0BAA2B,CACzC,CACL;QACN,WAAK,KAAK,EAAC,wBAAwB;UACjC,eAAQ,CACJ,CACS,CACM,CAC1B,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { h, Component, ComponentInterface, Event, EventEmitter, Prop } from \"@stencil/core\";\r\n\r\nexport interface AnnotationOutputCloseEvent {\r\n originalEvent: Event;\r\n}\r\n\r\n@Component({\r\n tag: \"dso-annotation-output\",\r\n styleUrl: \"annotation-output.scss\",\r\n // No shadowdom for a11y reasons (aria-controls being set inside another component)\r\n})\r\nexport class AnnotationOutput implements ComponentInterface {\r\n /**\r\n * The annotation-button that toggles this component should have the same identifier.\r\n */\r\n @Prop({ reflect: true })\r\n identifier!: string;\r\n\r\n /**\r\n * This text will be displayed above the annotation-output when opened\r\n */\r\n @Prop({ reflect: true })\r\n annotationPrefix?: string;\r\n\r\n /**\r\n * Set to `true` to show content.\r\n */\r\n @Prop({ reflect: true })\r\n open = false;\r\n\r\n /**\r\n * This event is emitted when the user activates the Annotation Button.\r\n */\r\n @Event({ bubbles: false })\r\n dsoClose!: EventEmitter<AnnotationOutputCloseEvent>;\r\n\r\n private toggleHandler = (e: MouseEvent) => {\r\n this.dsoClose.emit({ originalEvent: e });\r\n };\r\n\r\n render() {\r\n return (\r\n <dso-responsive-element>\r\n <dso-expandable id={this.identifier} open={this.open}>\r\n {this.annotationPrefix && <span class=\"dso-annotation-prefix\">{this.annotationPrefix}</span>}\r\n <div class=\"dso-annotation-header\">\r\n <slot name=\"title\" />\r\n <slot name=\"addons\" />\r\n <button type=\"button\" class=\"dso-tertiary dso-annotation-close-button\" onClick={this.toggleHandler}>\r\n <dso-icon icon=\"times\"></dso-icon>\r\n <span class=\"sr-only\">Toelichting sluiten</span>\r\n </button>\r\n </div>\r\n <div class=\"dso-annotation-content\">\r\n <slot />\r\n </div>\r\n </dso-expandable>\r\n </dso-responsive-element>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachments-counter.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"attachments-counter.js","sourceRoot":"","sources":["../../../../src/components/attachments-counter/attachments-counter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAOnD,MAAM,OAAO,kBAAkB;;;;EAO7B,MAAM;IACJ,OAAO,CACL,YAAM,KAAK,EAAC,iBAAiB;MAC1B,IAAI,CAAC,KAAK;;MAAE,YAAM,KAAK,EAAC,SAAS;;QAAS,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAQ;MAC9E,gBAAU,IAAI,EAAC,WAAW,GAAY,CACjC,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from \"@stencil/core\";\r\n\r\n@Component({\r\n tag: \"dso-attachments-counter\",\r\n styleUrl: \"attachments-counter.scss\",\r\n shadow: true,\r\n})\r\nexport class AttachmentsCounter {\r\n /**\r\n * The number of attachments.\r\n */\r\n @Prop()\r\n count!: number;\r\n\r\n render() {\r\n return (\r\n <span class=\"dso-attachments\">\r\n {this.count} <span class=\"sr-only\">bijlage{this.count !== 1 ? \"n\" : \"\"}</span>\r\n <dso-icon icon=\"paperclip\"></dso-icon>\r\n </span>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autosuggest.interfaces.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"autosuggest.interfaces.js","sourceRoot":"","sources":["../../../../src/components/autosuggest/autosuggest.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["export interface Suggestion {\r\n /**\r\n * The text that will be displayed as the suggestion.\r\n */\r\n value: string;\r\n\r\n /**\r\n * The type of suggestion.\r\n */\r\n type?: string;\r\n\r\n /**\r\n * A reference to the original object that was used to create the suggestion.\r\n */\r\n item?: unknown;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autosuggest.js","sourceRoot":"","sources":["../../../src/components/autosuggest/autosuggest.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAuB,KAAK,EAAE,MAAM,eAAe,CAAC;AACxH,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Listen, Prop, State, Fragment, Event, EventEmitter, VNode, Watch } from \"@stencil/core\";\r\nimport debounce from \"debounce\";\r\nimport { v4 } from \"uuid\";\r\nimport escapeStringRegexp from \"escape-string-regexp\";\r\n\r\nimport { Suggestion } from \"./autosuggest.interfaces\";\r\n\r\n@Component({\r\n tag: \"dso-autosuggest\",\r\n styleUrl: \"autosuggest.scss\",\r\n scoped: true,\r\n})\r\nexport class Autosuggest {\r\n /**\r\n * The suggestions for the value of the slotted input element. Optionally a\r\n * Suggestion can have a `type` and `item`.\r\n *\r\n * The `type` is used to style the suggestion. `item` can be use to reference\r\n * the original object that was used to create the suggestion.\r\n *\r\n * The value should be null when no suggestions have been fetched.\r\n */\r\n @Prop()\r\n readonly suggestions: Suggestion[] | null = null;\r\n\r\n /**\r\n * Shows progress indicator when fetching results.\r\n */\r\n @Prop()\r\n loading = false;\r\n\r\n /**\r\n * To override progress indicator's default loading label.\r\n */\r\n @Prop()\r\n loadingLabel?: string = \"Een moment geduld.\";\r\n\r\n /**\r\n * To delay progress indicator showing (in ms).\r\n */\r\n @Prop()\r\n loadingDelayed?: number;\r\n\r\n /**\r\n * To show text when no results are found.\r\n */\r\n @Prop()\r\n notFoundLabel?: string;\r\n\r\n /**\r\n * Whether the previous suggestions will be presented when the input gets focus again.\r\n */\r\n @Prop()\r\n suggestOnFocus = false;\r\n\r\n /**\r\n * Emitted when a suggestion is selected.\r\n * The `detail` property of the `CustomEvent` will contain the selected suggestion.\r\n */\r\n @Event()\r\n dsoSelect!: EventEmitter<Suggestion>;\r\n\r\n /**\r\n * This is emitted debounced for every change for the slotted input type=text element.\r\n */\r\n @Event()\r\n dsoChange!: EventEmitter<string>;\r\n\r\n /**\r\n * Emitted when enter is pressed.\r\n * The `detail` property of the `CustomEvent` will contain the input text.\r\n */\r\n @Event()\r\n dsoSearch!: EventEmitter<string>;\r\n\r\n @Element()\r\n host!: HTMLDsoAutosuggestElement;\r\n\r\n @State()\r\n showSuggestions = false;\r\n\r\n @State()\r\n selectedSuggestion: Suggestion | undefined;\r\n\r\n @State()\r\n notFound = false;\r\n\r\n @State()\r\n showLoading = false;\r\n\r\n @Watch(\"suggestions\")\r\n suggestionsWatcher() {\r\n this.resetSelectedSuggestion();\r\n\r\n if ((!this.showSuggestions || !this.notFound) && this.inputValue) {\r\n this.openSuggestions();\r\n } else if ((this.showSuggestions || this.notFound) && !this.inputValue) {\r\n this.closeSuggestions();\r\n }\r\n }\r\n\r\n private input?: HTMLInputElement;\r\n\r\n private listbox: HTMLUListElement | undefined;\r\n\r\n private listboxId: string = v4();\r\n\r\n private inputId: string = v4();\r\n\r\n private labelId: string = v4();\r\n\r\n private debouncedEmitValue = debounce((value: string) => {\r\n this.dsoChange.emit(value);\r\n this.debouncedShowLoading();\r\n }, 200);\r\n\r\n private debouncedShowLoading = debounce(() => {\r\n if (this.inputValue) {\r\n this.showLoading = true;\r\n }\r\n }, this.loadingDelayed);\r\n\r\n private inputValue = \"\";\r\n\r\n private onInput = (event: Event) => {\r\n if (!(event.target instanceof HTMLInputElement)) {\r\n return;\r\n // throw new Error(\"event.target is not instanceof HTMLInputElement\"); #2293\r\n }\r\n\r\n this.showLoading = !this.loadingDelayed;\r\n this.inputValue = event.target.value;\r\n this.debouncedEmitValue(event.target.value.match(/(\\S+)/g) ? event.target.value : \"\");\r\n };\r\n\r\n private onFocusIn = () => {\r\n if (this.suggestOnFocus) {\r\n this.openSuggestions();\r\n }\r\n };\r\n\r\n @Listen(\"click\", { target: \"document\" })\r\n onDocumentClick(event: MouseEvent) {\r\n if (\r\n (this.showSuggestions || this.notFound) &&\r\n this.listbox &&\r\n event.target instanceof Node &&\r\n !this.listbox.contains(event.target) &&\r\n this.input !== event.target\r\n ) {\r\n this.closeSuggestions();\r\n }\r\n }\r\n\r\n connectedCallback() {\r\n setTimeout(() => {\r\n const input = this.host.querySelector('input[type=\"text\"]');\r\n if (!(input instanceof HTMLInputElement)) {\r\n return;\r\n // throw new ReferenceError(\"Mandatory text input not found\"); #2293\r\n }\r\n\r\n this.input = input;\r\n if (input.id) {\r\n this.inputId = input.id;\r\n } else {\r\n input.id = this.inputId;\r\n }\r\n\r\n if (!this.input.labels || this.input.labels.length < 1) {\r\n return;\r\n // throw new ReferenceError(\"Mandatory label for text input not found\"); #2293\r\n }\r\n\r\n const label = this.input.labels[0];\r\n if (label?.id) {\r\n this.labelId = label.id;\r\n } else if (label) {\r\n label.id = this.labelId;\r\n }\r\n\r\n this.input.setAttribute(\"role\", \"combobox\");\r\n this.input.setAttribute(\"aria-haspopup\", \"listbox\");\r\n this.input.setAttribute(\"aria-controls\", this.listboxId);\r\n this.input.setAttribute(\"aria-expanded\", \"false\");\r\n this.input.setAttribute(\"autocomplete\", \"off\");\r\n this.input.setAttribute(\"aria-autocomplete\", \"list\");\r\n this.input.setAttribute(\"aria-activedescendant\", \"\");\r\n this.input.addEventListener(\"input\", this.onInput);\r\n this.input.addEventListener(\"keydown\", this.onKeyDown);\r\n this.input.addEventListener(\"focusin\", this.onFocusIn);\r\n });\r\n }\r\n\r\n disconnectedCallback() {\r\n this.input?.removeEventListener(\"input\", this.onInput);\r\n this.input?.removeEventListener(\"keydown\", this.onKeyDown);\r\n this.input?.removeEventListener(\"focusin\", this.onFocusIn);\r\n }\r\n\r\n private markTerms(suggestionValue: string, terms: string[]): (VNode | string)[] {\r\n if (!suggestionValue || !terms || terms.length === 0 || terms[0] === undefined) {\r\n return [\"\"];\r\n }\r\n\r\n const termRegex = new RegExp(`(${escapeStringRegexp(terms[0])})`, \"gi\");\r\n\r\n return suggestionValue.split(termRegex).map((valuePart: string) => {\r\n if (!valuePart) {\r\n return \"\";\r\n }\r\n\r\n if (termRegex.test(valuePart)) {\r\n return <mark>{valuePart}</mark>;\r\n }\r\n\r\n if (terms.length === 1) {\r\n return <span>{valuePart}</span>;\r\n }\r\n\r\n return this.markTerms(valuePart, terms.slice(1));\r\n });\r\n }\r\n\r\n private selectSuggestion(suggestion: Suggestion) {\r\n this.selectedSuggestion = suggestion;\r\n\r\n this.input?.setAttribute(\"aria-activedescendant\", this.listboxItemId(suggestion));\r\n }\r\n\r\n private selectFirstSuggestion() {\r\n if (!this.suggestions) {\r\n return;\r\n }\r\n\r\n this.selectedSuggestion = this.suggestions[0];\r\n\r\n if (this.selectedSuggestion) {\r\n this.input?.setAttribute(\"aria-activedescendant\", this.listboxItemId(this.selectedSuggestion));\r\n }\r\n }\r\n\r\n private selectLastSuggestion() {\r\n if (!this.suggestions) {\r\n return;\r\n }\r\n\r\n this.selectedSuggestion = this.suggestions[this.suggestions.length - 1];\r\n\r\n if (this.selectedSuggestion) {\r\n this.input?.setAttribute(\"aria-activedescendant\", this.listboxItemId(this.selectedSuggestion));\r\n }\r\n }\r\n\r\n private selectNextSuggestion() {\r\n if (!this.suggestions) {\r\n return;\r\n }\r\n\r\n const index = this.selectedSuggestion ? this.suggestions.indexOf(this.selectedSuggestion) : -1;\r\n\r\n this.selectedSuggestion = this.suggestions[index + 1] ?? this.suggestions[0];\r\n\r\n if (this.selectedSuggestion) {\r\n this.input?.setAttribute(\"aria-activedescendant\", this.listboxItemId(this.selectedSuggestion));\r\n }\r\n }\r\n\r\n private selectPreviousSuggestion() {\r\n if (!this.suggestions) {\r\n return;\r\n }\r\n\r\n const index = this.selectedSuggestion ? this.suggestions.indexOf(this.selectedSuggestion) : 0;\r\n\r\n this.selectedSuggestion = this.suggestions[index - 1] ?? this.suggestions[this.suggestions.length - 1];\r\n\r\n if (this.selectedSuggestion) {\r\n this.input?.setAttribute(\"aria-activedescendant\", this.listboxItemId(this.selectedSuggestion));\r\n }\r\n }\r\n\r\n private resetSelectedSuggestion() {\r\n this.showLoading = !this.loadingDelayed;\r\n this.notFound = false;\r\n this.selectedSuggestion = undefined;\r\n this.input?.setAttribute(\"aria-activedescendant\", \"\");\r\n }\r\n\r\n private openSuggestions(selectSuggestion?: \"first\" | \"last\") {\r\n this.showSuggestions = (this.suggestions && this.suggestions.length > 0) ?? false;\r\n this.notFound = this.suggestions?.length === 0 ?? false;\r\n this.input?.setAttribute(\"aria-expanded\", (this.showSuggestions || this.notFound).toString());\r\n\r\n if (this.showSuggestions && selectSuggestion === \"first\") {\r\n this.selectFirstSuggestion();\r\n } else if (this.showSuggestions && selectSuggestion === \"last\") {\r\n this.selectLastSuggestion();\r\n }\r\n }\r\n\r\n private closeSuggestions() {\r\n this.showSuggestions = false;\r\n this.notFound = false;\r\n this.input?.setAttribute(\"aria-expanded\", \"false\");\r\n this.selectFirstSuggestion();\r\n }\r\n\r\n private pickSelectedValue() {\r\n if (this.selectedSuggestion && this.showSuggestions) {\r\n this.dsoSelect.emit(this.selectedSuggestion);\r\n } else {\r\n this.dsoSearch.emit(this.input?.value);\r\n }\r\n\r\n this.closeSuggestions();\r\n }\r\n\r\n private onKeyDown = (event: KeyboardEvent) => {\r\n if (event.defaultPrevented || this.loading) {\r\n return;\r\n }\r\n\r\n switch (event.key) {\r\n case \"ArrowDown\":\r\n if (!this.showSuggestions) {\r\n this.openSuggestions(\"first\");\r\n } else {\r\n this.selectNextSuggestion();\r\n }\r\n\r\n break;\r\n\r\n case \"ArrowUp\":\r\n if (!this.showSuggestions) {\r\n this.openSuggestions(\"last\");\r\n } else {\r\n this.selectPreviousSuggestion();\r\n }\r\n\r\n break;\r\n\r\n case \"Tab\":\r\n this.closeSuggestions();\r\n return;\r\n\r\n case \"Escape\":\r\n this.closeSuggestions();\r\n break;\r\n\r\n case \"Enter\":\r\n this.pickSelectedValue();\r\n break;\r\n\r\n default:\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n };\r\n\r\n private listboxItemId(suggestion: Suggestion): string {\r\n if (!this.suggestions) {\r\n return \"\";\r\n }\r\n return `${this.inputId}-${this.suggestions.indexOf(suggestion) + 1}`;\r\n }\r\n\r\n render() {\r\n const terms = this.input?.value.split(\" \").filter((t) => t) ?? [];\r\n\r\n return (\r\n <>\r\n <slot />\r\n {this.loading && this.showLoading ? (\r\n <div class=\"autosuggest-progress-box\">\r\n <dso-progress-indicator label={this.loadingLabel}></dso-progress-indicator>\r\n </div>\r\n ) : (\r\n <ul\r\n role=\"listbox\"\r\n aria-live=\"polite\"\r\n id={this.listboxId}\r\n aria-labelledby={this.labelId}\r\n ref={(element) => (this.listbox = element)}\r\n hidden={!this.showSuggestions && !this.notFound}\r\n >\r\n {(this.showSuggestions &&\r\n this.suggestions &&\r\n this.suggestions.map((suggestion) => (\r\n <li\r\n role=\"option\"\r\n id={this.listboxItemId(suggestion)}\r\n key={suggestion.value}\r\n onMouseEnter={() => this.selectSuggestion(suggestion)}\r\n onMouseLeave={() => this.resetSelectedSuggestion()}\r\n onClick={() => this.pickSelectedValue()}\r\n aria-selected={(suggestion === this.selectedSuggestion).toString()}\r\n aria-label={suggestion.value}\r\n >\r\n <span class=\"value\">{this.markTerms(suggestion.value, terms)}</span>\r\n {suggestion.type ? <span class=\"type\">{suggestion.type}</span> : undefined}\r\n </li>\r\n ))) ||\r\n (this.notFound && (\r\n <li>\r\n <span class=\"value\">\r\n {!this.notFoundLabel ? (\r\n this.markTerms(`${this.inputValue} is niet gevonden.`, terms)\r\n ) : (\r\n <span>{this.notFoundLabel}</span>\r\n )}\r\n </span>\r\n </li>\r\n ))}\r\n </ul>\r\n )}\r\n </>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"autosuggest.js","sourceRoot":"","sources":["../../../../src/components/autosuggest/autosuggest.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAuB,KAAK,EAAE,MAAM,eAAe,CAAC;AAC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ACD,CACN,CACA,CACJ,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Listen, Prop, State, Fragment, Event, EventEmitter, VNode, Watch } from \"@stencil/core\";\r\nimport debounce from \"debounce\";\r\nimport { v4 } from \"uuid\";\r\nimport escapeStringRegexp from \"escape-string-regexp\";\r\n\r\nimport { Suggestion } from \"./autosuggest.interfaces\";\r\n\r\n@Component({\r\n tag: \"dso-autosuggest\",\r\n styleUrl: \"autosuggest.scss\",\r\n scoped: true,\r\n})\r\nexport class Autosuggest {\r\n /**\r\n * The suggestions for the value of the slotted input element. Optionally a\r\n * Suggestion can have a `type` and `item`.\r\n *\r\n * The `type` is used to style the suggestion. `item` can be use to reference\r\n * the original object that was used to create the suggestion.\r\n *\r\n * The value should be null when no suggestions have been fetched.\r\n */\r\n @Prop()\r\n readonly suggestions: Suggestion[] | null = null;\r\n\r\n /**\r\n * Shows progress indicator when fetching results.\r\n */\r\n @Prop()\r\n loading = false;\r\n\r\n /**\r\n * To override progress indicator's default loading label.\r\n */\r\n @Prop()\r\n loadingLabel?: string = \"Een moment geduld.\";\r\n\r\n /**\r\n * To delay progress indicator showing (in ms).\r\n */\r\n @Prop()\r\n loadingDelayed?: number;\r\n\r\n /**\r\n * To show text when no results are found.\r\n */\r\n @Prop()\r\n notFoundLabel?: string;\r\n\r\n /**\r\n * Whether the previous suggestions will be presented when the input gets focus again.\r\n */\r\n @Prop()\r\n suggestOnFocus = false;\r\n\r\n /**\r\n * Emitted when a suggestion is selected.\r\n * The `detail` property of the `CustomEvent` will contain the selected suggestion.\r\n */\r\n @Event()\r\n dsoSelect!: EventEmitter<Suggestion>;\r\n\r\n /**\r\n * This is emitted debounced for every change for the slotted input type=text element.\r\n */\r\n @Event()\r\n dsoChange!: EventEmitter<string>;\r\n\r\n /**\r\n * Emitted when enter is pressed.\r\n * The `detail` property of the `CustomEvent` will contain the input text.\r\n */\r\n @Event()\r\n dsoSearch!: EventEmitter<string>;\r\n\r\n @Element()\r\n host!: HTMLDsoAutosuggestElement;\r\n\r\n @State()\r\n showSuggestions = false;\r\n\r\n @State()\r\n selectedSuggestion: Suggestion | undefined;\r\n\r\n @State()\r\n notFound = false;\r\n\r\n @State()\r\n showLoading = false;\r\n\r\n @Watch(\"suggestions\")\r\n suggestionsWatcher() {\r\n this.resetSelectedSuggestion();\r\n\r\n if ((!this.showSuggestions || !this.notFound) && this.inputValue) {\r\n this.openSuggestions();\r\n } else if ((this.showSuggestions || this.notFound) && !this.inputValue) {\r\n this.closeSuggestions();\r\n }\r\n }\r\n\r\n private input?: HTMLInputElement;\r\n\r\n private listbox: HTMLUListElement | undefined;\r\n\r\n private listboxId: string = v4();\r\n\r\n private inputId: string = v4();\r\n\r\n private labelId: string = v4();\r\n\r\n private debouncedEmitValue = debounce((value: string) => {\r\n this.dsoChange.emit(value);\r\n this.debouncedShowLoading();\r\n }, 200);\r\n\r\n private debouncedShowLoading = debounce(() => {\r\n if (this.inputValue) {\r\n this.showLoading = true;\r\n }\r\n }, this.loadingDelayed);\r\n\r\n private inputValue = \"\";\r\n\r\n private onInput = (event: Event) => {\r\n if (!(event.target instanceof HTMLInputElement)) {\r\n return;\r\n // throw new Error(\"event.target is not instanceof HTMLInputElement\"); #2293\r\n }\r\n\r\n this.showLoading = !this.loadingDelayed;\r\n this.inputValue = event.target.value;\r\n this.debouncedEmitValue(event.target.value.match(/(\\S+)/g) ? event.target.value : \"\");\r\n };\r\n\r\n private onFocusIn = () => {\r\n if (this.suggestOnFocus) {\r\n this.openSuggestions();\r\n }\r\n };\r\n\r\n @Listen(\"click\", { target: \"document\" })\r\n onDocumentClick(event: MouseEvent) {\r\n if (\r\n (this.showSuggestions || this.notFound) &&\r\n this.listbox &&\r\n event.target instanceof Node &&\r\n !this.listbox.contains(event.target) &&\r\n this.input !== event.target\r\n ) {\r\n this.closeSuggestions();\r\n }\r\n }\r\n\r\n connectedCallback() {\r\n setTimeout(() => {\r\n const input = this.host.querySelector('input[type=\"text\"]');\r\n if (!(input instanceof HTMLInputElement)) {\r\n return;\r\n // throw new ReferenceError(\"Mandatory text input not found\"); #2293\r\n }\r\n\r\n this.input = input;\r\n if (input.id) {\r\n this.inputId = input.id;\r\n } else {\r\n input.id = this.inputId;\r\n }\r\n\r\n if (!this.input.labels || this.input.labels.length < 1) {\r\n return;\r\n // throw new ReferenceError(\"Mandatory label for text input not found\"); #2293\r\n }\r\n\r\n const label = this.input.labels[0];\r\n if (label?.id) {\r\n this.labelId = label.id;\r\n } else if (label) {\r\n label.id = this.labelId;\r\n }\r\n\r\n this.input.setAttribute(\"role\", \"combobox\");\r\n this.input.setAttribute(\"aria-haspopup\", \"listbox\");\r\n this.input.setAttribute(\"aria-controls\", this.listboxId);\r\n this.input.setAttribute(\"aria-expanded\", \"false\");\r\n this.input.setAttribute(\"autocomplete\", \"off\");\r\n this.input.setAttribute(\"aria-autocomplete\", \"list\");\r\n this.input.setAttribute(\"aria-activedescendant\", \"\");\r\n this.input.addEventListener(\"input\", this.onInput);\r\n this.input.addEventListener(\"keydown\", this.onKeyDown);\r\n this.input.addEventListener(\"focusin\", this.onFocusIn);\r\n });\r\n }\r\n\r\n disconnectedCallback() {\r\n this.input?.removeEventListener(\"input\", this.onInput);\r\n this.input?.removeEventListener(\"keydown\", this.onKeyDown);\r\n this.input?.removeEventListener(\"focusin\", this.onFocusIn);\r\n }\r\n\r\n private markTerms(suggestionValue: string, terms: string[]): (VNode | string)[] {\r\n if (!suggestionValue || !terms || terms.length === 0 || terms[0] === undefined) {\r\n return [\"\"];\r\n }\r\n\r\n const termRegex = new RegExp(`(${escapeStringRegexp(terms[0])})`, \"gi\");\r\n\r\n return suggestionValue.split(termRegex).map((valuePart: string) => {\r\n if (!valuePart) {\r\n return \"\";\r\n }\r\n\r\n if (termRegex.test(valuePart)) {\r\n return <mark>{valuePart}</mark>;\r\n }\r\n\r\n if (terms.length === 1) {\r\n return <span>{valuePart}</span>;\r\n }\r\n\r\n return this.markTerms(valuePart, terms.slice(1));\r\n });\r\n }\r\n\r\n private selectSuggestion(suggestion: Suggestion) {\r\n this.selectedSuggestion = suggestion;\r\n\r\n this.input?.setAttribute(\"aria-activedescendant\", this.listboxItemId(suggestion));\r\n }\r\n\r\n private selectFirstSuggestion() {\r\n if (!this.suggestions) {\r\n return;\r\n }\r\n\r\n this.selectedSuggestion = this.suggestions[0];\r\n\r\n if (this.selectedSuggestion) {\r\n this.input?.setAttribute(\"aria-activedescendant\", this.listboxItemId(this.selectedSuggestion));\r\n }\r\n }\r\n\r\n private selectLastSuggestion() {\r\n if (!this.suggestions) {\r\n return;\r\n }\r\n\r\n this.selectedSuggestion = this.suggestions[this.suggestions.length - 1];\r\n\r\n if (this.selectedSuggestion) {\r\n this.input?.setAttribute(\"aria-activedescendant\", this.listboxItemId(this.selectedSuggestion));\r\n }\r\n }\r\n\r\n private selectNextSuggestion() {\r\n if (!this.suggestions) {\r\n return;\r\n }\r\n\r\n const index = this.selectedSuggestion ? this.suggestions.indexOf(this.selectedSuggestion) : -1;\r\n\r\n this.selectedSuggestion = this.suggestions[index + 1] ?? this.suggestions[0];\r\n\r\n if (this.selectedSuggestion) {\r\n this.input?.setAttribute(\"aria-activedescendant\", this.listboxItemId(this.selectedSuggestion));\r\n }\r\n }\r\n\r\n private selectPreviousSuggestion() {\r\n if (!this.suggestions) {\r\n return;\r\n }\r\n\r\n const index = this.selectedSuggestion ? this.suggestions.indexOf(this.selectedSuggestion) : 0;\r\n\r\n this.selectedSuggestion = this.suggestions[index - 1] ?? this.suggestions[this.suggestions.length - 1];\r\n\r\n if (this.selectedSuggestion) {\r\n this.input?.setAttribute(\"aria-activedescendant\", this.listboxItemId(this.selectedSuggestion));\r\n }\r\n }\r\n\r\n private resetSelectedSuggestion() {\r\n this.showLoading = !this.loadingDelayed;\r\n this.notFound = false;\r\n this.selectedSuggestion = undefined;\r\n this.input?.setAttribute(\"aria-activedescendant\", \"\");\r\n }\r\n\r\n private openSuggestions(selectSuggestion?: \"first\" | \"last\") {\r\n this.showSuggestions = (this.suggestions && this.suggestions.length > 0) ?? false;\r\n this.notFound = this.suggestions?.length === 0 ?? false;\r\n this.input?.setAttribute(\"aria-expanded\", (this.showSuggestions || this.notFound).toString());\r\n\r\n if (this.showSuggestions && selectSuggestion === \"first\") {\r\n this.selectFirstSuggestion();\r\n } else if (this.showSuggestions && selectSuggestion === \"last\") {\r\n this.selectLastSuggestion();\r\n }\r\n }\r\n\r\n private closeSuggestions() {\r\n this.showSuggestions = false;\r\n this.notFound = false;\r\n this.input?.setAttribute(\"aria-expanded\", \"false\");\r\n this.selectFirstSuggestion();\r\n }\r\n\r\n private pickSelectedValue() {\r\n if (this.selectedSuggestion && this.showSuggestions) {\r\n this.dsoSelect.emit(this.selectedSuggestion);\r\n } else {\r\n this.dsoSearch.emit(this.input?.value);\r\n }\r\n\r\n this.closeSuggestions();\r\n }\r\n\r\n private onKeyDown = (event: KeyboardEvent) => {\r\n if (event.defaultPrevented || this.loading) {\r\n return;\r\n }\r\n\r\n switch (event.key) {\r\n case \"ArrowDown\":\r\n if (!this.showSuggestions) {\r\n this.openSuggestions(\"first\");\r\n } else {\r\n this.selectNextSuggestion();\r\n }\r\n\r\n break;\r\n\r\n case \"ArrowUp\":\r\n if (!this.showSuggestions) {\r\n this.openSuggestions(\"last\");\r\n } else {\r\n this.selectPreviousSuggestion();\r\n }\r\n\r\n break;\r\n\r\n case \"Tab\":\r\n this.closeSuggestions();\r\n return;\r\n\r\n case \"Escape\":\r\n this.closeSuggestions();\r\n break;\r\n\r\n case \"Enter\":\r\n this.pickSelectedValue();\r\n break;\r\n\r\n default:\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n };\r\n\r\n private listboxItemId(suggestion: Suggestion): string {\r\n if (!this.suggestions) {\r\n return \"\";\r\n }\r\n return `${this.inputId}-${this.suggestions.indexOf(suggestion) + 1}`;\r\n }\r\n\r\n render() {\r\n const terms = this.input?.value.split(\" \").filter((t) => t) ?? [];\r\n\r\n return (\r\n <>\r\n <slot />\r\n {this.loading && this.showLoading ? (\r\n <div class=\"autosuggest-progress-box\">\r\n <dso-progress-indicator label={this.loadingLabel}></dso-progress-indicator>\r\n </div>\r\n ) : (\r\n <ul\r\n role=\"listbox\"\r\n aria-live=\"polite\"\r\n id={this.listboxId}\r\n aria-labelledby={this.labelId}\r\n ref={(element) => (this.listbox = element)}\r\n hidden={!this.showSuggestions && !this.notFound}\r\n >\r\n {(this.showSuggestions &&\r\n this.suggestions &&\r\n this.suggestions.map((suggestion) => (\r\n <li\r\n role=\"option\"\r\n id={this.listboxItemId(suggestion)}\r\n key={suggestion.value}\r\n onMouseEnter={() => this.selectSuggestion(suggestion)}\r\n onMouseLeave={() => this.resetSelectedSuggestion()}\r\n onClick={() => this.pickSelectedValue()}\r\n aria-selected={(suggestion === this.selectedSuggestion).toString()}\r\n aria-label={suggestion.value}\r\n >\r\n <span class=\"value\">{this.markTerms(suggestion.value, terms)}</span>\r\n {suggestion.type ? <span class=\"type\">{suggestion.type}</span> : undefined}\r\n </li>\r\n ))) ||\r\n (this.notFound && (\r\n <li>\r\n <span class=\"value\">\r\n {!this.notFoundLabel ? (\r\n this.markTerms(`${this.inputValue} is niet gevonden.`, terms)\r\n ) : (\r\n <span>{this.notFoundLabel}</span>\r\n )}\r\n </span>\r\n </li>\r\n ))}\r\n </ul>\r\n )}\r\n </>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../../src/components/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,IAAI,MAAM,MAAM,CAAC;AAOxB,MAAM,OAAO,KAAK;;;;EAOhB,MAAM;IACJ,OAAO,CACL,YAAM,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,SAAS,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;MACvE,eAAa,CACR,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from \"@stencil/core\";\r\nimport clsx from \"clsx\";\r\n\r\n@Component({\r\n tag: \"dso-badge\",\r\n styleUrl: \"badge.scss\",\r\n shadow: true,\r\n})\r\nexport class Badge {\r\n /**\r\n * The status of the Badge.\r\n */\r\n @Prop()\r\n status?: \"primary\" | \"success\" | \"info\" | \"warning\" | \"danger\" | \"error\" | \"outline\" | \"attention\";\r\n\r\n render() {\r\n return (\r\n <span class={clsx(\"dso-badge\", { [`badge-${this.status}`]: this.status })}>\r\n <slot></slot>\r\n </span>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../../../src/components/banner/banner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,IAAI,MAAM,MAAM,CAAC;AAOxB,MAAM,OAAO,MAAM;;;mBAWP,KAAK;kBAQN,IAAI;;EAEb,MAAM;IACJ,OAAO,CACL,eACE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,IAAI,CAAC,MAAM,EAAE,EAAE;QAChD,aAAa,EAAE,IAAI,CAAC,OAAO;OAC5B,CAAC,EACF,IAAI,EAAC,OAAO;MAEZ,eAAa,CACL,CACX,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from \"@stencil/core\";\r\nimport clsx from \"clsx\";\r\n\r\n@Component({\r\n tag: \"dso-banner\",\r\n styleUrl: \"banner.scss\",\r\n shadow: true,\r\n})\r\nexport class Banner {\r\n /**\r\n * The status of the banner.\r\n */\r\n @Prop({ reflect: true })\r\n status!: \"danger\" | \"error\" | \"info\" | \"warning\";\r\n\r\n /**\r\n * compact mode.\r\n */\r\n @Prop()\r\n compact = false;\r\n\r\n /**\r\n * *Only available when `compact` is set to `true`.\r\n *\r\n * Option to show banner icon.\r\n */\r\n @Prop()\r\n noIcon = true;\r\n\r\n render() {\r\n return (\r\n <section\r\n class={clsx(\"dso-banner\", `alert-${this.status}`, {\r\n \"dso-compact\": this.compact,\r\n })}\r\n role=\"alert\"\r\n >\r\n <slot></slot>\r\n </section>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.interfaces.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"card.interfaces.js","sourceRoot":"","sources":["../../../../src/components/card/card.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["export interface DsoCardClickedEvent {\r\n originalEvent?: MouseEvent;\r\n /** True when user clicked the card while holding Ctrl, Alt or other modifiers, or when the card is right-clicked. Can be used to determine navigation. */\r\n isModifiedEvent: boolean;\r\n}\r\n\r\nexport type ImageShape = \"normal\" | \"wide\";\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../../../src/components/card/card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAsB,OAAO,EAAE,KAAK,EAAgB,IAAI,EA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AAI,CAAC,IAAI,EAAE,KAAK,EAAC,gBAAgB;UACxC,YAAM,IAAI,EAAC,SAAS,GAAG;UACvB,gBAAU,IAAI,EAAC,eAAe,GAAY,CACxC,CACL;QACA,IAAI,CAAC,0BAA0B,KAAK,IAAI,IAAI,YAAM,IAAI,EAAC,cAAc,GAAG,CACrE;MACN,WAAK,KAAK,EAAC,kBAAkB;QAC3B,YAAM,IAAI,EAAC,SAAS,GAAG,CACnB,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { h, Component, ComponentInterface, Element, Event, EventEmitter, Host, Prop, forceUpdate } from \"@stencil/core\";\r\n\r\nimport { isInteractiveElement } from \"../../utils/is-interactive-element\";\r\nimport { isModifiedEvent } from \"../../utils/is-modified-event\";\r\n\r\nimport { DsoCardClickedEvent, ImageShape } from \"./card.interfaces\";\r\n\r\n@Component({\r\n tag: \"dso-card\",\r\n styleUrl: \"card.scss\",\r\n shadow: true,\r\n})\r\nexport class Card implements ComponentInterface {\r\n @Element()\r\n host!: HTMLDsoCardElement;\r\n\r\n /**\r\n * Whether or not the Card is clickable. This is NOT a boolean attribute. Set to \"false\" to make the Card non-clickable.\r\n *\r\n * @deprecated Use `href` instead and `<ELEMENT_TYPE slot=\"heading\">` should NOT be of element type `a` (anchor).\r\n */\r\n @Prop({ reflect: true })\r\n clickable = true;\r\n\r\n /**\r\n * Presentation of image in header.\r\n * - \"normal\" (\"24 x 24\").\r\n * - \"wide\" (\"30 x 26\")\r\n */\r\n @Prop({ reflect: true })\r\n imageShape: ImageShape = \"normal\";\r\n\r\n /**\r\n * The URL to which the Card heading links.\r\n */\r\n @Prop({ reflect: true })\r\n href?: string;\r\n\r\n /**\r\n * Emitted when the Card is clickable and the user clicked the Card.\r\n */\r\n @Event()\r\n dsoCardClicked!: EventEmitter<DsoCardClickedEvent>;\r\n\r\n private mutationObserver?: MutationObserver;\r\n\r\n connectedCallback(): void {\r\n this.mutationObserver = new MutationObserver(() => forceUpdate(this.host));\r\n\r\n this.mutationObserver.observe(this.host, { attributes: true, childList: true });\r\n }\r\n\r\n disconnectedCallback(): void {\r\n this.mutationObserver?.disconnect();\r\n\r\n delete this.mutationObserver;\r\n }\r\n\r\n private clickEventHandler(e: MouseEvent) {\r\n if (!(e.target instanceof HTMLElement) || (!this.clickable && !this.href)) {\r\n return;\r\n }\r\n\r\n let element: HTMLElement | null = e.target;\r\n\r\n while (element !== this.host && element !== null) {\r\n if (isInteractiveElement(element) || element === null) {\r\n return;\r\n }\r\n\r\n if (element.parentNode instanceof ShadowRoot && element.parentNode.host instanceof HTMLElement) {\r\n element = element.parentNode.host;\r\n } else {\r\n element = element.parentElement;\r\n }\r\n }\r\n\r\n return this.dsoCardClicked.emit({ originalEvent: e, isModifiedEvent: isModifiedEvent(e) });\r\n }\r\n\r\n get selectableSlottedElement() {\r\n return this.host.querySelector(\"[slot='selectable']\");\r\n }\r\n\r\n get imageSlottedElement() {\r\n return this.host.querySelector(\"[slot='image']\");\r\n }\r\n\r\n get headingSlottedElement() {\r\n return this.host.querySelector(\"[slot='heading']\");\r\n }\r\n\r\n get interactionsSlottedElement() {\r\n return this.host.querySelector(\"[slot='interactions']\");\r\n }\r\n\r\n render() {\r\n const isSelectable = this.selectableSlottedElement !== null;\r\n const hasImage = this.imageSlottedElement !== null;\r\n\r\n return (\r\n <Host onClick={(e: MouseEvent) => this.clickEventHandler(e)} is-selectable={isSelectable} has-image={hasImage}>\r\n <div class=\"dso-card-selectable\" hidden={!isSelectable}>\r\n <slot name=\"selectable\" />\r\n </div>\r\n <div class=\"dso-card-image\" hidden={!hasImage}>\r\n <slot name=\"image\" />\r\n </div>\r\n <div class=\"dso-card-heading\">\r\n {this.headingSlottedElement instanceof HTMLAnchorElement || !this.href ? (\r\n <slot name=\"heading\" />\r\n ) : (\r\n <a href={this.href} class=\"heading-anchor\">\r\n <slot name=\"heading\" />\r\n <dso-icon icon=\"chevron-right\"></dso-icon>\r\n </a>\r\n )}\r\n {this.interactionsSlottedElement !== null && <slot name=\"interactions\" />}\r\n </div>\r\n <div class=\"dso-card-content\">\r\n <slot name=\"content\" />\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-container.interfaces.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"card-container.interfaces.js","sourceRoot":"","sources":["../../../../src/components/card-container/card-container.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["export type CardContainerMode = \"list\" | \"grid\";\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-container.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"card-container.js","sourceRoot":"","sources":["../../../../src/components/card-container/card-container.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAsB,QAAQ,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQjF,MAAM,OAAO,aAAa;;gBAKE,MAAM;;EAEhC,MAAM;IACJ,OAAO,CACL;MACG,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,CACvB,UAAI,KAAK,EAAC,eAAe;QACvB,eAAQ,CACL,CACN;MACA,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,CACvB,WAAK,KAAK,EAAC,eAAe;QACxB,eAAQ,CACJ,CACP,CACA,CACJ,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { h, Component, ComponentInterface, Fragment, Prop } from \"@stencil/core\";\r\nimport { CardContainerMode } from \"./card-container.interfaces\";\r\n\r\n@Component({\r\n tag: \"dso-card-container\",\r\n styleUrl: \"card-container.scss\",\r\n shadow: true,\r\n})\r\nexport class CardContainer implements ComponentInterface {\r\n /**\r\n * The mode of the Card Container.\r\n */\r\n @Prop({ reflect: true })\r\n mode: CardContainerMode = \"list\";\r\n\r\n render() {\r\n return (\r\n <>\r\n {this.mode === \"list\" && (\r\n <ul class=\"dso-card-list\">\r\n <slot />\r\n </ul>\r\n )}\r\n {this.mode === \"grid\" && (\r\n <div class=\"dso-card-grid\">\r\n <slot />\r\n </div>\r\n )}\r\n </>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.interfaces.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"date-picker.interfaces.js","sourceRoot":"","sources":["../../../../src/components/date-picker/date-picker.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["export interface DatePickerChangeEvent {\r\n component: \"dso-date-picker\";\r\n\r\n /**\r\n * The original event that the change event of the `<input type=\"date\">` emitted.\r\n */\r\n originalEvent: Event;\r\n\r\n /**\r\n * The entered date in DD-MM-YYYY.\r\n *\r\n * Also set if the entered date is out of bounds, but empty `\"\"` if the date is invalid.\r\n */\r\n value: string;\r\n\r\n /**\r\n * The entered date as Date object.\r\n *\r\n * `undefined` if the date is out of bounds or invalid.\r\n */\r\n valueAsDate: Date | undefined;\r\n\r\n /**\r\n * The original validity object. Only for convienience, this object equals `detail.originalEvent.target.validity`.\r\n */\r\n validity: ValidityState;\r\n\r\n /**\r\n * If the input causes an error this property is set:\r\n *\r\n * * `required`: If the date is required but no date is given. Equals `validity.valueMissing`.\r\n * * `min-range`: The entered date is sooner than the minimum date set in `min`. Equals `validity.rangeUnderflow`.\r\n * * `max-range`: The entered date is later than the maximum date set in `max`. Equals `validity.rangeOverflow`.\r\n * * `invalid`: If the entered date is invalid. Equals `validity.invalid === false`.\r\n *\r\n * For more data on the validity of the input, refer to the property `validity`.\r\n */\r\n error?: DatePickerError;\r\n}\r\n\r\nexport interface DatePickerFocusEvent {\r\n originalEvent: FocusEvent;\r\n component: \"dso-date-picker\";\r\n}\r\n\r\nexport interface DatePickerBlurEvent extends DatePickerChangeEvent {\r\n originalEvent: FocusEvent;\r\n}\r\n\r\nexport interface DatePickerKeyboardEvent {\r\n originalEvent: KeyboardEvent;\r\n component: \"dso-date-picker\";\r\n}\r\n\r\nexport type DatePickerError = \"required\" | \"min-range\" | \"max-range\" | \"invalid\";\r\n"]}
|
|
@@ -2,12 +2,24 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
import { parseToValueFormat, parseToDutchFormat } from "./date-utils";
|
|
3
3
|
export class DsoDatePicker {
|
|
4
4
|
constructor() {
|
|
5
|
-
this.handleBlur = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
this.handleBlur = (e) => {
|
|
6
|
+
e.stopPropagation();
|
|
7
|
+
const { target } = e;
|
|
8
|
+
if (!(target instanceof HTMLInputElement)) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const { validity } = target;
|
|
12
|
+
const { value, valueAsDate } = this.dateValues(target);
|
|
13
|
+
const error = this.validityToError(validity);
|
|
14
|
+
const event = {
|
|
9
15
|
component: "dso-date-picker",
|
|
10
|
-
|
|
16
|
+
originalEvent: e,
|
|
17
|
+
validity,
|
|
18
|
+
value,
|
|
19
|
+
valueAsDate,
|
|
20
|
+
error,
|
|
21
|
+
};
|
|
22
|
+
this.dsoBlur.emit(event);
|
|
11
23
|
};
|
|
12
24
|
this.handleFocus = (event) => {
|
|
13
25
|
event.stopPropagation();
|
|
@@ -35,28 +47,17 @@ export class DsoDatePicker {
|
|
|
35
47
|
if (!(target instanceof HTMLInputElement)) {
|
|
36
48
|
return;
|
|
37
49
|
}
|
|
38
|
-
const {
|
|
50
|
+
const { validity } = target;
|
|
51
|
+
const { value, valueAsDate } = this.dateValues(target);
|
|
52
|
+
const error = this.validityToError(validity);
|
|
39
53
|
const event = {
|
|
40
54
|
component: "dso-date-picker",
|
|
41
55
|
originalEvent: e,
|
|
42
56
|
validity,
|
|
43
|
-
value
|
|
44
|
-
valueAsDate
|
|
57
|
+
value,
|
|
58
|
+
valueAsDate,
|
|
59
|
+
error,
|
|
45
60
|
};
|
|
46
|
-
if (validity.valueMissing) {
|
|
47
|
-
event.error = "required";
|
|
48
|
-
}
|
|
49
|
-
else if (validity.rangeUnderflow) {
|
|
50
|
-
event.error = "min-range";
|
|
51
|
-
event.valueAsDate = undefined;
|
|
52
|
-
}
|
|
53
|
-
else if (validity.rangeOverflow) {
|
|
54
|
-
event.error = "max-range";
|
|
55
|
-
event.valueAsDate = undefined;
|
|
56
|
-
}
|
|
57
|
-
else if (!validity.valid) {
|
|
58
|
-
event.error = "invalid";
|
|
59
|
-
}
|
|
60
61
|
this.dsoDateChange.emit(event);
|
|
61
62
|
};
|
|
62
63
|
this.name = "dso-date";
|
|
@@ -70,6 +71,28 @@ export class DsoDatePicker {
|
|
|
70
71
|
this.min = undefined;
|
|
71
72
|
this.max = undefined;
|
|
72
73
|
}
|
|
74
|
+
dateValues(target) {
|
|
75
|
+
const { valueAsDate, validity } = target;
|
|
76
|
+
return {
|
|
77
|
+
value: parseToDutchFormat(valueAsDate),
|
|
78
|
+
valueAsDate: (!validity.rangeOverflow && !validity.rangeUnderflow && valueAsDate) || undefined,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
validityToError(validity) {
|
|
82
|
+
if (validity.valueMissing) {
|
|
83
|
+
return "required";
|
|
84
|
+
}
|
|
85
|
+
if (validity.rangeUnderflow) {
|
|
86
|
+
return "min-range";
|
|
87
|
+
}
|
|
88
|
+
if (validity.rangeOverflow) {
|
|
89
|
+
return "max-range";
|
|
90
|
+
}
|
|
91
|
+
if (!validity.valid) {
|
|
92
|
+
return "invalid";
|
|
93
|
+
}
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
73
96
|
render() {
|
|
74
97
|
var _a;
|
|
75
98
|
return (h("input", { type: "date", id: this.identifier, class: "dso-date__input", value: parseToValueFormat(this.value), name: this.name, min: parseToValueFormat(this.min), max: parseToValueFormat(this.max), disabled: this.disabled || undefined, required: this.required || undefined, "aria-autocomplete": "none", "aria-invalid": (_a = this.invalid) === null || _a === void 0 ? void 0 : _a.toString(), "aria-describedby": this.describedBy, autoComplete: "off", autofocus: this.dsoAutofocus || undefined, onBlur: this.handleBlur, onFocus: this.handleFocus, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown, onChange: this.handleInputChange }));
|
|
@@ -298,13 +321,13 @@ export class DsoDatePicker {
|
|
|
298
321
|
"text": "Event emitted the date picker input is blurred."
|
|
299
322
|
},
|
|
300
323
|
"complexType": {
|
|
301
|
-
"original": "
|
|
302
|
-
"resolved": "
|
|
324
|
+
"original": "DatePickerBlurEvent",
|
|
325
|
+
"resolved": "DatePickerBlurEvent",
|
|
303
326
|
"references": {
|
|
304
|
-
"
|
|
327
|
+
"DatePickerBlurEvent": {
|
|
305
328
|
"location": "import",
|
|
306
329
|
"path": "./date-picker.interfaces",
|
|
307
|
-
"id": "src/components/date-picker/date-picker.interfaces.ts::
|
|
330
|
+
"id": "src/components/date-picker/date-picker.interfaces.ts::DatePickerBlurEvent"
|
|
308
331
|
}
|
|
309
332
|
}
|
|
310
333
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../../../src/components/date-picker/date-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AASrG,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAQtE,MAAM,OAAO,aAAa;;IAwGhB,eAAU,GAAG,CAAC,CAAa,EAAE,EAAE;MACrC,CAAC,CAAC,eAAe,EAAE,CAAC;MAEpB,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;MAErB,IAAI,CAAC,CAAC,MAAM,YAAY,gBAAgB,CAAC,EAAE;QACzC,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KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EACrC,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,EACjC,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,EACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,SAAS,EACpC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,SAAS,uBAClB,MAAM,kBACV,MAAA,IAAI,CAAC,OAAO,0CAAE,QAAQ,EAAE,sBACpB,IAAI,CAAC,WAAW,EAClC,YAAY,EAAC,KAAK,EAClB,SAAS,EAAE,IAAI,CAAC,YAAY,IAAI,SAAS,EACzC,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,SAAS,EAAE,IAAI,CAAC,aAAa,EAC7B,QAAQ,EAAE,IAAI,CAAC,iBAAiB,GAChC,CACH,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, ComponentInterface, Prop, Element, h, Event, EventEmitter } from \"@stencil/core\";\r\n\r\nimport {\r\n DatePickerBlurEvent,\r\n DatePickerChangeEvent,\r\n DatePickerError,\r\n DatePickerFocusEvent,\r\n DatePickerKeyboardEvent,\r\n} from \"./date-picker.interfaces\";\r\nimport { parseToValueFormat, parseToDutchFormat } from \"./date-utils\";\r\n\r\n@Component({\r\n tag: \"dso-date-picker\",\r\n styleUrl: \"date-picker.scss\",\r\n shadow: false,\r\n scoped: true,\r\n})\r\nexport class DsoDatePicker implements ComponentInterface {\r\n /**\r\n * Reference to host HTML element.\r\n */\r\n @Element()\r\n element!: HTMLDsoDatePickerElement;\r\n\r\n /**\r\n * Name of the date picker input.\r\n */\r\n @Prop()\r\n name = \"dso-date\";\r\n\r\n /**\r\n * Adds a unique identifier for the date picker input. Use this instead of html `id` attribute.\r\n */\r\n @Prop()\r\n identifier: string | undefined;\r\n\r\n /**\r\n * Makes the date picker input component disabled. This prevents users from being able to\r\n * interact with the input, and conveys its inactive state to assistive technologies.\r\n */\r\n @Prop({ reflect: true })\r\n disabled = false;\r\n\r\n /**\r\n * Should the input be marked as required?\r\n */\r\n @Prop({ reflect: true })\r\n required = false;\r\n\r\n /**\r\n * Is input invalid?\r\n */\r\n @Prop({ reflect: true })\r\n invalid?: boolean;\r\n\r\n /**\r\n * ID of element that describes the input element\r\n */\r\n @Prop()\r\n describedBy?: string;\r\n\r\n /**\r\n * Should the input be focused on load?\r\n */\r\n @Prop()\r\n dsoAutofocus = false;\r\n\r\n /**\r\n * Date value. Must be in Dutch date format: DD-MM-YYYY.\r\n */\r\n @Prop({ reflect: true })\r\n value = \"\";\r\n\r\n /**\r\n * Minimum date allowed to be picked. Must be in Dutch date format: DD-MM-YYYY.\r\n * This setting can be used alone or together with the max property.\r\n */\r\n @Prop()\r\n min: string | undefined;\r\n\r\n /**\r\n * Maximum date allowed to be picked. Must be in Dutch date format: DD-MM-YYYY.\r\n * This setting can be used alone or together with the min property.\r\n */\r\n @Prop()\r\n max: string | undefined;\r\n\r\n /**\r\n * Events section.\r\n */\r\n\r\n /**\r\n * Event emitted when a date is selected.\r\n */\r\n @Event()\r\n dsoDateChange!: EventEmitter<DatePickerChangeEvent>;\r\n\r\n /**\r\n * Event emitted the date picker input is blurred.\r\n */\r\n @Event()\r\n dsoBlur!: EventEmitter<DatePickerBlurEvent>;\r\n\r\n /**\r\n * Event emitted on key up in the date picker input.\r\n */\r\n @Event()\r\n dsoKeyUp!: EventEmitter<DatePickerKeyboardEvent>;\r\n\r\n /**\r\n * Event emitted on key down in the date picker input.\r\n */\r\n @Event()\r\n dsoKeyDown!: EventEmitter<DatePickerKeyboardEvent>;\r\n\r\n /**\r\n * Event emitted the date picker input is focused.\r\n */\r\n @Event()\r\n dsoFocus!: EventEmitter<DatePickerFocusEvent>;\r\n\r\n private handleBlur = (e: FocusEvent) => {\r\n e.stopPropagation();\r\n\r\n const { target } = e;\r\n\r\n if (!(target instanceof HTMLInputElement)) {\r\n return;\r\n }\r\n\r\n const { validity } = target;\r\n const { value, valueAsDate } = this.dateValues(target);\r\n const error = this.validityToError(validity);\r\n\r\n const event: DatePickerBlurEvent = {\r\n component: \"dso-date-picker\",\r\n originalEvent: e,\r\n validity,\r\n value,\r\n valueAsDate,\r\n error,\r\n };\r\n\r\n this.dsoBlur.emit(event);\r\n };\r\n\r\n private handleFocus = (event: FocusEvent) => {\r\n event.stopPropagation();\r\n\r\n this.dsoFocus.emit({\r\n originalEvent: event,\r\n component: \"dso-date-picker\",\r\n });\r\n };\r\n\r\n private handleKeyUp = (event: KeyboardEvent) => {\r\n event.stopPropagation();\r\n\r\n this.dsoKeyUp.emit({\r\n component: \"dso-date-picker\",\r\n originalEvent: event,\r\n });\r\n };\r\n\r\n private handleKeyDown = (event: KeyboardEvent) => {\r\n event.stopPropagation();\r\n\r\n this.dsoKeyDown.emit({\r\n component: \"dso-date-picker\",\r\n originalEvent: event,\r\n });\r\n };\r\n\r\n private handleInputChange = (e: Event) => {\r\n const target = e.target;\r\n\r\n if (!(target instanceof HTMLInputElement)) {\r\n return;\r\n }\r\n\r\n const { validity } = target;\r\n const { value, valueAsDate } = this.dateValues(target);\r\n const error = this.validityToError(validity);\r\n\r\n const event: DatePickerChangeEvent = {\r\n component: \"dso-date-picker\",\r\n originalEvent: e,\r\n validity,\r\n value,\r\n valueAsDate,\r\n error,\r\n };\r\n\r\n this.dsoDateChange.emit(event);\r\n };\r\n\r\n private dateValues(target: HTMLInputElement): { value: string; valueAsDate: Date | undefined } {\r\n const { valueAsDate, validity } = target;\r\n\r\n return {\r\n value: parseToDutchFormat(valueAsDate),\r\n valueAsDate: (!validity.rangeOverflow && !validity.rangeUnderflow && valueAsDate) || undefined,\r\n };\r\n }\r\n\r\n private validityToError(validity: ValidityState): DatePickerError | undefined {\r\n if (validity.valueMissing) {\r\n return \"required\";\r\n }\r\n\r\n if (validity.rangeUnderflow) {\r\n return \"min-range\";\r\n }\r\n\r\n if (validity.rangeOverflow) {\r\n return \"max-range\";\r\n }\r\n\r\n if (!validity.valid) {\r\n return \"invalid\";\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n render() {\r\n return (\r\n <input\r\n type=\"date\"\r\n id={this.identifier}\r\n class=\"dso-date__input\"\r\n value={parseToValueFormat(this.value)}\r\n name={this.name}\r\n min={parseToValueFormat(this.min)}\r\n max={parseToValueFormat(this.max)}\r\n disabled={this.disabled || undefined}\r\n required={this.required || undefined}\r\n aria-autocomplete=\"none\"\r\n aria-invalid={this.invalid?.toString()}\r\n aria-describedby={this.describedBy}\r\n autoComplete=\"off\"\r\n autofocus={this.dsoAutofocus || undefined}\r\n onBlur={this.handleBlur}\r\n onFocus={this.handleFocus}\r\n onKeyUp={this.handleKeyUp}\r\n onKeyDown={this.handleKeyDown}\r\n onChange={this.handleInputChange}\r\n />\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-utils.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"date-utils.js","sourceRoot":"","sources":["../../../../src/components/date-picker/date-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAyB;EAC1D,IAAI,CAAC,KAAK,EAAE;IACV,OAAO;GACR;EAED,MAAM,O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AC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC","sourcesContent":["/**\r\n * dd-mm-yyyy to yyyy-mm-dd\r\n */\r\nexport function parseToValueFormat(value: string | undefined): string | undefined {\r\n if (!value) {\r\n return;\r\n }\r\n\r\n const matches = value.split(\"-\");\r\n\r\n if (\r\n matches.length === 3 &&\r\n typeof matches[0] === \"string\" &&\r\n typeof matches[1] === \"string\" &&\r\n typeof matches[2] === \"string\"\r\n ) {\r\n const [d, m, y] = matches;\r\n\r\n const dd = d.padStart(2, \"0\");\r\n const mm = m.padStart(2, \"0\");\r\n const yyyy = y.padStart(4, \"0\");\r\n\r\n return [yyyy, mm, dd].join(\"-\");\r\n }\r\n\r\n return value;\r\n}\r\n\r\n/**\r\n * yyyy-mm-dd to dd-mm-yyyy\r\n */\r\nexport function parseToDutchFormat(date: Date | null): string {\r\n if (!date) {\r\n return \"\";\r\n }\r\n\r\n const dd = date.getDate().toString(10).padStart(2, \"0\");\r\n const mm = (date.getMonth() + 1).toString(10).padStart(2, \"0\");\r\n const yyyy = date.getFullYear().toString(10).padStart(4, \"0\");\r\n\r\n return [dd, mm, yyyy].join(\"-\");\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-localization.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"date-localization.js","sourceRoot":"","sources":["../../../../src/components/date-picker-legacy/date-localization.ts"],"names":[],"mappings":"AAmBA,MAAM,YAAY,GAAqB;EACrC,WAAW,EAAE,YAAY;EACzB,WAAW,EAAE,YAAY;EACzB,mBAAmB,EAAE,wBAAwB;EAC7C,cAAc,EAAE,cAAc;EAC9B,cAAc,EAAE,gBAAgB;EAChC,gBAAgB,EAAE,OAAO;EACzB,eAAe,EAAE,MAAM;EACvB,UAAU,EAAE,SAAS;EACrB,mBAAmB,EAAE,iDAAiD;EACtE,eAAe,EAAE,gBAAgB;EACjC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC;EAC1F,UAAU,EAAE;IACV,SAAS;IACT,UAAU;IACV,OAAO;IACP,OAAO;IACP,KAAK;IACL,MAAM;IACN,MAAM;IACN,UAAU;IACV,WAAW;IACX,SAAS;IACT,UAAU;IACV,UAAU;GACX;EACD,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;CACtG,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["type MonthsNames = [string, string, string, string, string, string, string, string, string, string, string, string];\r\ntype DayNames = [string, string, string, string, string, string, string];\r\n\r\nexport type DsoLocalizedText = {\r\n buttonLabel: string;\r\n placeholder: string;\r\n selectedDateMessage: string;\r\n prevMonthLabel: string;\r\n nextMonthLabel: string;\r\n monthSelectLabel: string;\r\n yearSelectLabel: string;\r\n closeLabel: string;\r\n keyboardInstruction: string;\r\n calendarHeading: string;\r\n dayNames: DayNames;\r\n monthNames: MonthsNames;\r\n monthNamesShort: MonthsNames;\r\n};\r\n\r\nconst localization: DsoLocalizedText = {\r\n buttonLabel: \"Kies datum\",\r\n placeholder: \"dd-mm-jjjj\",\r\n selectedDateMessage: \"Geselecteerde datum is\",\r\n prevMonthLabel: \"Vorige maand\",\r\n nextMonthLabel: \"Volgende maand\",\r\n monthSelectLabel: \"Maand\",\r\n yearSelectLabel: \"Jaar\",\r\n closeLabel: \"Sluiten\",\r\n keyboardInstruction: \"Gebruik de pijltjestoetsen om een dag te kiezen\",\r\n calendarHeading: \"Kies een datum\",\r\n dayNames: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n monthNames: [\r\n \"Januari\",\r\n \"Februari\",\r\n \"Maart\",\r\n \"April\",\r\n \"Mei\",\r\n \"Juni\",\r\n \"Juli\",\r\n \"Augustus\",\r\n \"September\",\r\n \"Oktober\",\r\n \"November\",\r\n \"December\",\r\n ],\r\n monthNamesShort: [\"Jan\", \"Feb\", \"Mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n};\r\n\r\nexport default localization;\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-day.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"date-picker-day.js","sourceRoot":"","sources":["../../../../src/components/date-picker-legacy/date-picker-day.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAuB,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAYvD,MAAM,CAAC,MAAM,mBAAmB,GAAkD,CAAC,EACjF,UAAU,EACV,KAAK,EACL,GAAG,EACH,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,OAAO,GACR,EAAE,EAAE;EACH,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;EACpC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;EAC3C,MAAM,eAAe,GAAG,GAAG,CAAC,QAAQ,EAAE,KAAK,UAAU,CAAC,QAAQ,EAAE,CAAC;EACjE,MAAM,cAAc,GAAG,CAAC,OAAO,CAAC;EAEhC,SAAS,WAAW,CAAC,CAAa;IAChC,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;EACtB,CAAC;EAED,OAAO,CACL,cACE,KAAK,EAAE;MACL,eAAe,EAAE,IAAI;MACrB,UAAU,EAAE,OAAO;KACpB,EACD,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC5B,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,oBAAoB,EAC/B,QAAQ,EAAE,cAAc,IAAI,eAAe,EAC3C,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE;MACV,IAAI,SAAS,IAAI,EAAE,IAAI,aAAa,EAAE;QACpC,aAAa,CAAC,EAAE,CAAC,CAAC;OACnB;IACH,CAAC;IAED,2BAAkB,MAAM,IAAE,GAAG,CAAC,OAAO,EAAE,CAAQ;IAC/C,YAAM,KAAK,EAAC,mBAAmB,IAAE,cAAc,CAAC,GAAG,CAAC,CAAQ,CACrD,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { h, FunctionalComponent } from \"@stencil/core\";\r\nimport { isEqual, printDutchDate } from \"./date-utils\";\r\n\r\nexport type DatePickerLegacyDayProps = {\r\n focusedDay: Date;\r\n today: Date;\r\n day: Date;\r\n inRange: boolean;\r\n onDaySelect: (event: MouseEvent, day: Date) => void;\r\n onKeyboardNavigation: (event: KeyboardEvent) => void;\r\n focusedDayRef?: (element: HTMLButtonElement) => void;\r\n};\r\n\r\nexport const DatePickerLegacyDay: FunctionalComponent<DatePickerLegacyDayProps> = ({\r\n focusedDay,\r\n today,\r\n day,\r\n onDaySelect,\r\n onKeyboardNavigation,\r\n focusedDayRef,\r\n inRange,\r\n}) => {\r\n const isToday = isEqual(day, today);\r\n const isFocused = isEqual(day, focusedDay);\r\n const notCurrentMonth = day.getMonth() !== focusedDay.getMonth();\r\n const isOutsideRange = !inRange;\r\n\r\n function handleClick(e: MouseEvent) {\r\n onDaySelect(e, day);\r\n }\r\n\r\n return (\r\n <button\r\n class={{\r\n \"dso-date__day\": true,\r\n \"is-today\": isToday,\r\n }}\r\n tabIndex={isFocused ? 0 : -1}\r\n onClick={handleClick}\r\n onKeyDown={onKeyboardNavigation}\r\n disabled={isOutsideRange || notCurrentMonth}\r\n type=\"button\"\r\n ref={(el) => {\r\n if (isFocused && el && focusedDayRef) {\r\n focusedDayRef(el);\r\n }\r\n }}\r\n >\r\n <span aria-hidden=\"true\">{day.getDate()}</span>\r\n <span class=\"dso-date__vhidden\">{printDutchDate(day)}</span>\r\n </button>\r\n );\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-legacy.interfaces.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"date-picker-legacy.interfaces.js","sourceRoot":"","sources":["../../../../src/components/date-picker-legacy/date-picker-legacy.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["export type DsoDatePickerLegacyChangeEvent = {\r\n component: \"dso-date-picker-legacy\";\r\n valueAsDate: Date | undefined;\r\n value: string;\r\n error?: \"invalid\" | \"required\" | \"min-range\" | \"max-range\";\r\n};\r\n\r\nexport type DsoDatePickerLegacyFocusEvent = {\r\n component: \"dso-date-picker-legacy\";\r\n};\r\n\r\nexport type DsoDatePickerLegacyKeyboardEvent = {\r\n component: \"dso-date-picker-legacy\";\r\n originalEvent: KeyboardEvent;\r\n};\r\n\r\nexport type DsoDatePickerLegacyDirection = \"left\" | \"right\";\r\n"]}
|