@dso-toolkit/core 58.0.0 → 58.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dso-autosuggest.cjs.entry.js +6 -3
- package/dist/cjs/dso-autosuggest.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-banner.cjs.entry.js +6 -2
- package/dist/cjs/dso-banner.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/autosuggest/autosuggest.js +6 -3
- package/dist/collection/components/autosuggest/autosuggest.js.map +1 -1
- package/dist/collection/components/banner/banner.css +3 -0
- package/dist/collection/components/banner/banner.js +43 -3
- package/dist/collection/components/banner/banner.js.map +1 -1
- package/dist/components/dso-autosuggest.js +6 -3
- package/dist/components/dso-autosuggest.js.map +1 -1
- package/dist/components/dso-banner.js +9 -3
- package/dist/components/dso-banner.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-a4d423fd.entry.js +2 -0
- package/dist/dso-toolkit/p-a4d423fd.entry.js.map +1 -0
- package/dist/dso-toolkit/p-b911f052.entry.js +2 -0
- package/dist/dso-toolkit/p-b911f052.entry.js.map +1 -0
- package/dist/esm/dso-autosuggest.entry.js +6 -3
- package/dist/esm/dso-autosuggest.entry.js.map +1 -1
- package/dist/esm/dso-banner.entry.js +6 -2
- package/dist/esm/dso-banner.entry.js.map +1 -1
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/banner/banner.d.ts +11 -1
- package/dist/types/components.d.ts +18 -2
- package/package.json +2 -2
- package/dist/dso-toolkit/p-49bce8b2.entry.js +0 -2
- package/dist/dso-toolkit/p-49bce8b2.entry.js.map +0 -1
- package/dist/dso-toolkit/p-b76768a5.entry.js +0 -2
- package/dist/dso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AI,CAAC,OAAO,GAAG,OAAO,CAAC,EAC1C,MAAM,EAAE,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,QAAQ,IAE9C,CAAC,IAAI,CAAC,eAAe;MACpB,IAAI,CAAC,WAAW;MAChB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,MAC9B,UACE,IAAI,EAAC,QAAQ,EACb,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAClC,GAAG,EAAE,UAAU,CAAC,KAAK,EACrB,YAAY,EAAE,MAAM,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,EACrD,YAAY,EAAE,MAAM,IAAI,CAAC,uBAAuB,EAAE,EAClD,OAAO,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,mBACxB,CAAC,UAAU,KAAK,IAAI,CAAC,kBAAkB,EAAE,QAAQ,EAAE,gBACtD,UAAU,CAAC,KAAK,IAE5B,YAAM,KAAK,EAAC,OAAO,IAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAQ,EACnE,UAAU,CAAC,IAAI,GAAG,YAAM,KAAK,EAAC,MAAM,IAAE,UAAU,CAAC,IAAI,CAAQ,GAAG,SAAS,CACvE,CACN,CAAC;OACD,IAAI,CAAC,QAAQ,KACZ,cACE,YAAM,KAAK,EAAC,OAAO,IAChB,CAAC,IAAI,CAAC,aAAa,IAClB,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,UAAU,oBAAoB,EAAE,KAAK,CAAC,KAE7D,gBAAO,IAAI,CAAC,aAAa,CAAQ,CAClC,CACI,CACJ,CACN,CAAC,CACD,CACN,CACA,EACH;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["debounce"],"sources":["../../node_modules/escape-string-regexp/index.js","./src/components/autosuggest/autosuggest.scss?tag=dso-autosuggest&encapsulation=scoped","./src/components/autosuggest/autosuggest.tsx"],"sourcesContent":["export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","@use \"~dso-toolkit/src/variables/units\";\r\n@use \"~dso-toolkit/src/variables/colors\";\r\n@use \"~dso-toolkit/src/variables/scaffolding\";\r\n@use \"~dso-toolkit/src/variables/zindex\";\r\n\r\n@use \"autosuggest.variables\" as core-autosuggest-variables;\r\n\r\n:host {\r\n display: block;\r\n position: relative;\r\n}\r\n\r\nul,\r\n.autosuggest-progress-box {\r\n background-clip: padding-box;\r\n background-color: core-autosuggest-variables.$background-color;\r\n border: 1px solid core-autosuggest-variables.$border-color;\r\n border-radius: scaffolding.$border-radius-base;\r\n box-shadow: core-autosuggest-variables.$box-shadow;\r\n list-style-type: none;\r\n margin-top: 2px;\r\n padding: units.$u1 * 0.5 0;\r\n position: absolute;\r\n left: 0;\r\n right: 0;\r\n top: 100%;\r\n z-index: zindex.$autosuggest;\r\n}\r\n\r\n.autosuggest-progress-box {\r\n padding: units.$u1 * 1.5 units.$u1;\r\n}\r\n\r\nul {\r\n padding: units.$u1 0;\r\n\r\n li {\r\n display: flex;\r\n justify-content: space-between;\r\n padding: units.$u1 * 0.5 units.$u2;\r\n }\r\n}\r\n\r\nli[aria-selected=\"true\"] {\r\n cursor: pointer;\r\n background-color: colors.$grasgroen;\r\n\r\n &,\r\n .type {\r\n color: colors.$wit;\r\n }\r\n}\r\n\r\nmark {\r\n font-weight: 700;\r\n background-color: inherit;\r\n color: inherit;\r\n padding: 0;\r\n}\r\n\r\n.type {\r\n color: colors.$grijs-60;\r\n}\r\n","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 throw new Error(\"event.target is not instanceof HTMLInputElement\");\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 throw new ReferenceError(\"Mandatory text input not found\");\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 throw new ReferenceError(\"Mandatory label for text input not found\");\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 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"],"version":3}
|
|
1
|
+
{"file":"dso-autosuggest.js","mappings":";;;;;AAAe,SAAS,kBAAkB,CAAC,MAAM,EAAE;AACnD,CAAC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACjC,EAAE,MAAM,IAAI,SAAS,CAAC,mBAAmB,CAAC,CAAC;AAC3C,EAAE;AACF;AACA;AACA;AACA,CAAC,OAAO,MAAM;AACd,GAAG,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;AACzC,GAAG,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1B;;ACVA,MAAM,cAAc,GAAG,w4BAAw4B;;MCYl5B,WAAW;;;;;;;IA6Fd,cAAS,GAAW,EAAE,EAAE,CAAC;IAEzB,YAAO,GAAW,EAAE,EAAE,CAAC;IAEvB,YAAO,GAAW,EAAE,EAAE,CAAC;IAE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AAQ,EACnE,UAAU,CAAC,IAAI,GAAG,YAAM,KAAK,EAAC,MAAM,IAAE,UAAU,CAAC,IAAI,CAAQ,GAAG,SAAS,CACvE,CACN,CAAC;OACD,IAAI,CAAC,QAAQ,KACZ,cACE,YAAM,KAAK,EAAC,OAAO,IAChB,CAAC,IAAI,CAAC,aAAa,IAClB,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,UAAU,oBAAoB,EAAE,KAAK,CAAC,KAE7D,gBAAO,IAAI,CAAC,aAAa,CAAQ,CAClC,CACI,CACJ,CACN,CAAC,CACD,CACN,CACA,EACH;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["debounce"],"sources":["../../node_modules/escape-string-regexp/index.js","./src/components/autosuggest/autosuggest.scss?tag=dso-autosuggest&encapsulation=scoped","./src/components/autosuggest/autosuggest.tsx"],"sourcesContent":["export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","@use \"~dso-toolkit/src/variables/units\";\r\n@use \"~dso-toolkit/src/variables/colors\";\r\n@use \"~dso-toolkit/src/variables/scaffolding\";\r\n@use \"~dso-toolkit/src/variables/zindex\";\r\n\r\n@use \"autosuggest.variables\" as core-autosuggest-variables;\r\n\r\n:host {\r\n display: block;\r\n position: relative;\r\n}\r\n\r\nul,\r\n.autosuggest-progress-box {\r\n background-clip: padding-box;\r\n background-color: core-autosuggest-variables.$background-color;\r\n border: 1px solid core-autosuggest-variables.$border-color;\r\n border-radius: scaffolding.$border-radius-base;\r\n box-shadow: core-autosuggest-variables.$box-shadow;\r\n list-style-type: none;\r\n margin-top: 2px;\r\n padding: units.$u1 * 0.5 0;\r\n position: absolute;\r\n left: 0;\r\n right: 0;\r\n top: 100%;\r\n z-index: zindex.$autosuggest;\r\n}\r\n\r\n.autosuggest-progress-box {\r\n padding: units.$u1 * 1.5 units.$u1;\r\n}\r\n\r\nul {\r\n padding: units.$u1 0;\r\n\r\n li {\r\n display: flex;\r\n justify-content: space-between;\r\n padding: units.$u1 * 0.5 units.$u2;\r\n }\r\n}\r\n\r\nli[aria-selected=\"true\"] {\r\n cursor: pointer;\r\n background-color: colors.$grasgroen;\r\n\r\n &,\r\n .type {\r\n color: colors.$wit;\r\n }\r\n}\r\n\r\nmark {\r\n font-weight: 700;\r\n background-color: inherit;\r\n color: inherit;\r\n padding: 0;\r\n}\r\n\r\n.type {\r\n color: colors.$grijs-60;\r\n}\r\n","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 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"],"version":3}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { c as clsx } from './clsx.m.js';
|
|
3
3
|
|
|
4
|
-
const bannerCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}.dso-banner{padding:16px 0;position:relative}";
|
|
4
|
+
const bannerCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}.dso-banner{padding:16px 0;position:relative}.dso-banner.dso-compact{padding:12px 0}";
|
|
5
5
|
|
|
6
6
|
const Banner = /*@__PURE__*/ proxyCustomElement(class Banner extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -9,13 +9,19 @@ const Banner = /*@__PURE__*/ proxyCustomElement(class Banner extends HTMLElement
|
|
|
9
9
|
this.__registerHost();
|
|
10
10
|
this.__attachShadow();
|
|
11
11
|
this.status = undefined;
|
|
12
|
+
this.compact = false;
|
|
13
|
+
this.noIcon = true;
|
|
12
14
|
}
|
|
13
15
|
render() {
|
|
14
|
-
return (h("section", { class: clsx("dso-banner", `alert-${this.status}
|
|
16
|
+
return (h("section", { class: clsx("dso-banner", `alert-${this.status}`, {
|
|
17
|
+
"dso-compact": this.compact,
|
|
18
|
+
}), role: "alert" }, h("slot", null)));
|
|
15
19
|
}
|
|
16
20
|
static get style() { return bannerCss; }
|
|
17
21
|
}, [1, "dso-banner", {
|
|
18
|
-
"status": [513]
|
|
22
|
+
"status": [513],
|
|
23
|
+
"compact": [4],
|
|
24
|
+
"noIcon": [4, "no-icon"]
|
|
19
25
|
}]);
|
|
20
26
|
function defineCustomElement$1() {
|
|
21
27
|
if (typeof customElements === "undefined") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"dso-banner.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,
|
|
1
|
+
{"file":"dso-banner.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,qJAAqJ;;MCQ1J,MAAM;;;;;;mBAWP,KAAK;kBAQN,IAAI;;EAEb,MAAM;IACJ,QACE,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,IAEZ,eAAa,CACL,EACV;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/banner/banner.scss?tag=dso-banner&encapsulation=shadow","./src/components/banner/banner.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/components/banner\";\r\n\r\n:host {\r\n display: block;\r\n}\r\n\r\n@include utilities.box-sizing();\r\n\r\n.dso-banner {\r\n @include banner.root();\r\n}\r\n","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"],"version":3}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-1a1a43fd.js";export{s as setNonce}from"./p-1a1a43fd.js";const t=()=>{const o=import.meta.url;const t={};if(o!==""){t.resourcesUrl=new URL(".",o).href}return e(t)};t().then((e=>o([["p-22baee8e",[[0,"dsot-document-component-demo",{response:[32],open:[32],openedAnnotation:[32],filtered:[32],notApplicable:[32],activeAnnotationSelectables:[32]}]]],["p-1c721290",[[1,"dso-map-base-layers",{group:[1],baseLayers:[16]}]]],["p-51f19c06",[[1,"dso-map-overlays",{group:[1],overlays:[16]}]]],["p-3d4308ba",[[1,"dso-toggletip",{label:[1],position:[1],small:[4],secondary:[4],active:[32]}]]],["p-604eb60b",[[1,"dso-accordion-section",{handleTitle:[1,"handle-title"],heading:[1],handleUrl:[1,"handle-url"],status:[1],attachmentCount:[2,"attachment-count"],icon:[1],statusDescription:[1,"status-description"],open:[516],hasNestedAccordion:[32],hover:[32]}]]],["p-b9d441d5",[[6,"dso-header",{mainMenu:[16],useDropDownMenu:[1,"use-drop-down-menu"],authStatus:[1,"auth-status"],loginUrl:[1,"login-url"],logoutUrl:[1,"logout-url"],userProfileName:[1,"user-profile-name"],userProfileUrl:[1,"user-profile-url"],userHomeUrl:[1,"user-home-url"],userHomeActive:[4,"user-home-active"],showDropDown:[32],hasSubLogo:[32],overflowMenuItems:[32],dropdownOptionsOffset:[32]}]]],["p-bc9e3037",[[1,"dso-map-controls",{open:[1540],disableZoom:[1,"disable-zoom"],hideContent:[32],toggleVisibility:[64]}]]],["p-712fca2c",[[1,"dso-modal",{fullscreen:[516],modalTitle:[1,"modal-title"],role:[1],showCloseButton:[4,"show-close-button"],ariaId:[32],hasFooter:[32]}]]],["p-440fc4ae",[[1,"dso-pagination",{totalPages:[2,"total-pages"],currentPage:[2,"current-page"],formatHref:[16],availablePositions:[32]},[[0,"dsoSizeChange","sizeChangeHandler"]]]]],["p-745b6678",[[1,"dso-tree-view",{collection:[16],focusItem:[64]}]]],["p-54c65314",[[1,"dso-action-list-item",{step:[2],itemTitle:[1,"item-title"],flowLine:[4,"flow-line"],warning:[4],divider:[4]}]]],["p-5ee79846",[[1,"dso-attachments-counter",{count:[2]}]]],["p-
|
|
1
|
+
import{p as e,b as o}from"./p-1a1a43fd.js";export{s as setNonce}from"./p-1a1a43fd.js";const t=()=>{const o=import.meta.url;const t={};if(o!==""){t.resourcesUrl=new URL(".",o).href}return e(t)};t().then((e=>o([["p-22baee8e",[[0,"dsot-document-component-demo",{response:[32],open:[32],openedAnnotation:[32],filtered:[32],notApplicable:[32],activeAnnotationSelectables:[32]}]]],["p-1c721290",[[1,"dso-map-base-layers",{group:[1],baseLayers:[16]}]]],["p-51f19c06",[[1,"dso-map-overlays",{group:[1],overlays:[16]}]]],["p-3d4308ba",[[1,"dso-toggletip",{label:[1],position:[1],small:[4],secondary:[4],active:[32]}]]],["p-604eb60b",[[1,"dso-accordion-section",{handleTitle:[1,"handle-title"],heading:[1],handleUrl:[1,"handle-url"],status:[1],attachmentCount:[2,"attachment-count"],icon:[1],statusDescription:[1,"status-description"],open:[516],hasNestedAccordion:[32],hover:[32]}]]],["p-b9d441d5",[[6,"dso-header",{mainMenu:[16],useDropDownMenu:[1,"use-drop-down-menu"],authStatus:[1,"auth-status"],loginUrl:[1,"login-url"],logoutUrl:[1,"logout-url"],userProfileName:[1,"user-profile-name"],userProfileUrl:[1,"user-profile-url"],userHomeUrl:[1,"user-home-url"],userHomeActive:[4,"user-home-active"],showDropDown:[32],hasSubLogo:[32],overflowMenuItems:[32],dropdownOptionsOffset:[32]}]]],["p-bc9e3037",[[1,"dso-map-controls",{open:[1540],disableZoom:[1,"disable-zoom"],hideContent:[32],toggleVisibility:[64]}]]],["p-712fca2c",[[1,"dso-modal",{fullscreen:[516],modalTitle:[1,"modal-title"],role:[1],showCloseButton:[4,"show-close-button"],ariaId:[32],hasFooter:[32]}]]],["p-440fc4ae",[[1,"dso-pagination",{totalPages:[2,"total-pages"],currentPage:[2,"current-page"],formatHref:[16],availablePositions:[32]},[[0,"dsoSizeChange","sizeChangeHandler"]]]]],["p-745b6678",[[1,"dso-tree-view",{collection:[16],focusItem:[64]}]]],["p-54c65314",[[1,"dso-action-list-item",{step:[2],itemTitle:[1,"item-title"],flowLine:[4,"flow-line"],warning:[4],divider:[4]}]]],["p-5ee79846",[[1,"dso-attachments-counter",{count:[2]}]]],["p-a4d423fd",[[6,"dso-autosuggest",{suggestions:[16],loading:[4],loadingLabel:[1,"loading-label"],loadingDelayed:[2,"loading-delayed"],notFoundLabel:[1,"not-found-label"],suggestOnFocus:[4,"suggest-on-focus"],showSuggestions:[32],selectedSuggestion:[32],notFound:[32],showLoading:[32]},[[4,"click","onDocumentClick"]]]]],["p-4da2fa8b",[[2,"dso-date-picker",{name:[1],identifier:[1],disabled:[516],role:[1],direction:[1],required:[4],invalid:[516],describedBy:[1,"described-by"],dsoAutofocus:[4,"dso-autofocus"],value:[1537],min:[1],max:[1],activeFocus:[32],focusedDay:[32],open:[32],visible:[32],setFocus:[64],show:[64],hide:[64]},[[6,"click","handleDocumentClick"]]]]],["p-8b77b083",[[1,"dso-helpcenter-panel",{label:[1],url:[1],visibility:[32],isOpen:[32],slideState:[32],loadIframe:[32]},[[8,"keydown","keyDownListener"]]]]],["p-0dffb117",[[1,"dso-image-overlay",{active:[32],zoomable:[32]},[[2,"load","loadListener"]]]]],["p-98f7ede6",[[1,"dso-list-button",{label:[1],sublabel:[1],count:[2],min:[8],max:[8],checked:[516],disabled:[516],manual:[4],manualInputWrapperElement:[32],manualCount:[32]}]]],["p-5e5302ef",[[1,"dso-table",{noModal:[516,"no-modal"],isResponsive:[516,"is-responsive"],modalActive:[32],placeholderHeight:[32]}]]],["p-a00c4003",[[1,"dso-accordion",{variant:[513],reverseAlign:[516,"reverse-align"],_getState:[64]}]]],["p-420e0d23",[[1,"dso-action-list",{listTitle:[1,"list-title"]}]]],["p-b911f052",[[1,"dso-banner",{status:[513],compact:[4],noIcon:[4,"no-icon"]}]]],["p-a0798096",[[1,"dso-card",{isSelectable:[516,"is-selectable"],hasImage:[516,"has-image"],clickable:[4],imageShape:[513,"image-shape"]}]]],["p-a1060560",[[1,"dso-card-container",{mode:[513]}]]],["p-b34f24b4",[[1,"dso-highlight-box",{yellow:[4],border:[4],white:[4],dropShadow:[4,"drop-shadow"],step:[2]}]]],["p-7a6be9c1",[[1,"dso-progress-bar",{progress:[2],min:[2],max:[2]}]]],["p-918bcdbe",[[1,"dso-viewer-grid",{filterpanelOpen:[516,"filterpanel-open"],overlayOpen:[516,"overlay-open"],initialMainSize:[1,"initial-main-size"],mainSize:[32],tabView:[32],activeTab:[32]}]]],["p-3cbf8b97",[[1,"dso-dropdown-menu",{open:[1540],dropdownAlign:[1,"dropdown-align"],dropdownOptionsOffset:[2,"dropdown-options-offset"],checkable:[4],boundary:[1],strategy:[1]}]]],["p-423fa057",[[1,"dso-progress-indicator",{label:[1],size:[513],block:[4]}]]],["p-bcecc743",[[1,"dso-scrollable",{scrollPosition:[32],_setScrollState:[64]}]]],["p-4bc67e5c",[[1,"dso-expandable",{open:[516],enableAnimation:[4,"enable-animation"],minimumHeight:[2,"minimum-height"],animationReady:[32]}]]],["p-e69d7e62",[[1,"dso-responsive-element",{sizeAlias:[32],sizeWidth:[32],getSize:[64]}]]],["p-f21e4ccc",[[1,"dso-info-button",{active:[1540],secondary:[4],label:[1],hover:[32],setFocus:[64]}]]],["p-8f8dd254",[[1,"dso-tooltip",{descriptive:[516],position:[1],strategy:[1],noArrow:[4,"no-arrow"],stateless:[4],small:[4],active:[1540],hidden:[32],activate:[64],deactivate:[64]}]]],["p-4e86089d",[[1,"dso-icon",{icon:[1]}]]],["p-2ccbf58d",[[6,"dso-selectable",{type:[1],identifier:[1],name:[1],value:[1],invalid:[4],describedById:[1,"described-by-id"],labelledById:[1,"labelled-by-id"],disabled:[4],required:[4],checked:[4],indeterminate:[4],infoFixed:[4,"info-fixed"],infoActive:[32],keyboardFocus:[32],toggleInfo:[64]}],[1,"dso-info",{fixed:[516],active:[516]}]]],["p-669c3743",[[1,"dso-label",{compact:[4],removable:[4],status:[1],truncate:[4],removeHover:[32],removeFocus:[32],textHover:[32],textFocus:[32],isTruncated:[32],labelText:[32],_truncateLabel:[64]},[[4,"keydown","keyDownListener"]]],[1,"dso-alert",{status:[1],roleAlert:[4,"role-alert"]}],[0,"dso-annotation-button",{identifier:[1],open:[4]}],[1,"dso-badge",{status:[1]}],[1,"dso-ozon-content",{content:[1],inline:[516],deleted:[516],interactive:[520],state:[32]}]]],["p-14aa091d",[[1,"dso-document-component",{heading:[1],label:[1],nummer:[1],opschrift:[1],inhoud:[1],open:[516],filtered:[516],notApplicable:[516,"not-applicable"],genesteOntwerpInformatie:[516,"geneste-ontwerp-informatie"],bevatOntwerpInformatie:[516,"bevat-ontwerp-informatie"],annotated:[516],gereserveerd:[4],vervallen:[4],openAnnotation:[4,"open-annotation"],alternativeTitle:[1,"alternative-title"],type:[513],wijzigactie:[513]}],[4,"dso-annotation-output",{identifier:[513],annotationPrefix:[513,"annotation-prefix"],open:[516]}],[4,"dso-slide-toggle",{checked:[4],disabled:[4],accessibleLabel:[1,"accessible-label"],labelledbyId:[1,"labelledby-id"],identifier:[1],hasVisibleLabel:[32]}]]]],e)));
|
|
2
2
|
//# sourceMappingURL=dso-toolkit.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","response","open","openedAnnotation","filtered","notApplicable","activeAnnotationSelectables","group","baseLayers","overlays","label","position","small","secondary","active","handleTitle","heading","handleUrl","status","attachmentCount","icon","statusDescription","hasNestedAccordion","hover","mainMenu","useDropDownMenu","authStatus","loginUrl","logoutUrl","userProfileName","userProfileUrl","userHomeUrl","userHomeActive","showDropDown","hasSubLogo","overflowMenuItems","dropdownOptionsOffset","disableZoom","hideContent","toggleVisibility","fullscreen","modalTitle","role","showCloseButton","ariaId","hasFooter","totalPages","currentPage","formatHref","availablePositions","collection","focusItem","step","itemTitle","flowLine","warning","divider","count","suggestions","loading","loadingLabel","loadingDelayed","notFoundLabel","suggestOnFocus","showSuggestions","selectedSuggestion","notFound","showLoading","name","identifier","disabled","direction","required","invalid","describedBy","dsoAutofocus","value","min","max","activeFocus","focusedDay","visible","setFocus","show","hide","visibility","isOpen","slideState","loadIframe","zoomable","sublabel","checked","manual","manualInputWrapperElement","manualCount","noModal","isResponsive","modalActive","placeholderHeight","variant","reverseAlign","_getState","listTitle","isSelectable","hasImage","clickable","imageShape","mode","yellow","border","white","dropShadow","progress","filterpanelOpen","overlayOpen","initialMainSize","mainSize","tabView","activeTab","dropdownAlign","checkable","boundary","strategy","size","block","scrollPosition","_setScrollState","enableAnimation","minimumHeight","animationReady","sizeAlias","sizeWidth","getSize","descriptive","noArrow","stateless","hidden","activate","deactivate","type","describedById","labelledById","indeterminate","infoFixed","infoActive","keyboardFocus","toggleInfo","fixed","compact","removable","truncate","removeHover","removeFocus","textHover","textFocus","isTruncated","labelText","_truncateLabel","roleAlert","content","inline","deleted","interactive","state","nummer","opschrift","inhoud","genesteOntwerpInformatie","bevatOntwerpInformatie","annotated","gereserveerd","vervallen","openAnnotation","alternativeTitle","wijzigactie","annotationPrefix","accessibleLabel","labelledbyId","hasVisibleLabel"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v3.4.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n if (BUILD.cssVarShim) {\n // shim css vars\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = \n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n var _a;\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n // Apply CSP nonce to the script tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n script.setAttribute('nonce', nonce);\n }\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAmBA,MAAMA,EAAe,KAkCjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAiB3E,GAAuBF,IAAe,GAAI,CACtCE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IAGrD,CAcI,OAAOC,EAAeJ,EAAK,ECrF/BH,IAAeQ,MAAKC,GAEXC,EAAc,kDAAuC,CAAAC,SAAA,KAAAC,KAAA,KAAAC,iBAAA,KAAAC,SAAA,KAAAC,cAAA,KAAAC,4BAAA,kDAAAC,MAAA,IAAAC,WAAA,+CAAAD,MAAA,IAAAE,SAAA,4CAAAC,MAAA,IA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,MAAArI,OAAA,yCAAAsI,QAAA,IAAAC,UAAA,IAAAnI,OAAA,IAAAoI,SAAA,IAAAC,YAAA,KAAAC,YAAA,KAAAC,UAAA,KAAAC,UAAA,KAAAC,YAAA,KAAAC,UAAA,KAAAC,eAAA,yDAAA3I,OAAA,IAAA4I,UAAA,+CAAAzF,WAAA,IAAAnE,KAAA,sBAAAgB,OAAA,6BAAA6I,QAAA,IAAAC,OAAA,MAAAC,QAAA,MAAAC,YAAA,MAAAC,MAAA,qDAAAnJ,QAAA,IAAAN,MAAA,IAAA0J,OAAA,IAAAC,UAAA,IAAAC,OAAA,IAAApK,KAAA,MAAAE,SAAA,MAAAC,cAAA,uBAAAkK,yBAAA,mCAAAC,uBAAA,iCAAAC,UAAA,MAAAC,aAAA,IAAAC,UAAA,IAAAC,eAAA,sBAAAC,iBAAA,wBAAAlC,KAAA,MAAAmC,YAAA,oCAAAzG,WAAA,MAAA0G,iBAAA,0BAAA7K,KAAA,+BAAAyF,QAAA,IAAArB,SAAA,IAAA0G,gBAAA,uBAAAC,aAAA,oBAAA5G,WAAA,IAAA6G,gBAAA,UAAAnL"}
|
|
1
|
+
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","response","open","openedAnnotation","filtered","notApplicable","activeAnnotationSelectables","group","baseLayers","overlays","label","position","small","secondary","active","handleTitle","heading","handleUrl","status","attachmentCount","icon","statusDescription","hasNestedAccordion","hover","mainMenu","useDropDownMenu","authStatus","loginUrl","logoutUrl","userProfileName","userProfileUrl","userHomeUrl","userHomeActive","showDropDown","hasSubLogo","overflowMenuItems","dropdownOptionsOffset","disableZoom","hideContent","toggleVisibility","fullscreen","modalTitle","role","showCloseButton","ariaId","hasFooter","totalPages","currentPage","formatHref","availablePositions","collection","focusItem","step","itemTitle","flowLine","warning","divider","count","suggestions","loading","loadingLabel","loadingDelayed","notFoundLabel","suggestOnFocus","showSuggestions","selectedSuggestion","notFound","showLoading","name","identifier","disabled","direction","required","invalid","describedBy","dsoAutofocus","value","min","max","activeFocus","focusedDay","visible","setFocus","show","hide","visibility","isOpen","slideState","loadIframe","zoomable","sublabel","checked","manual","manualInputWrapperElement","manualCount","noModal","isResponsive","modalActive","placeholderHeight","variant","reverseAlign","_getState","listTitle","compact","noIcon","isSelectable","hasImage","clickable","imageShape","mode","yellow","border","white","dropShadow","progress","filterpanelOpen","overlayOpen","initialMainSize","mainSize","tabView","activeTab","dropdownAlign","checkable","boundary","strategy","size","block","scrollPosition","_setScrollState","enableAnimation","minimumHeight","animationReady","sizeAlias","sizeWidth","getSize","descriptive","noArrow","stateless","hidden","activate","deactivate","type","describedById","labelledById","indeterminate","infoFixed","infoActive","keyboardFocus","toggleInfo","fixed","removable","truncate","removeHover","removeFocus","textHover","textFocus","isTruncated","labelText","_truncateLabel","roleAlert","content","inline","deleted","interactive","state","nummer","opschrift","inhoud","genesteOntwerpInformatie","bevatOntwerpInformatie","annotated","gereserveerd","vervallen","openAnnotation","alternativeTitle","wijzigactie","annotationPrefix","accessibleLabel","labelledbyId","hasVisibleLabel"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v3.4.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n if (BUILD.cssVarShim) {\n // shim css vars\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = \n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n var _a;\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n // Apply CSP nonce to the script tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n script.setAttribute('nonce', nonce);\n }\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAmBA,MAAMA,EAAe,KAkCjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAiB3E,GAAuBF,IAAe,GAAI,CACtCE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IAGrD,CAcI,OAAOC,EAAeJ,EAAK,ECrF/BH,IAAeQ,MAAKC,GAEXC,EAAc,kDAAuC,CAAAC,SAAA,KAAAC,KAAA,KAAAC,iBAAA,KAAAC,SAAA,KAAAC,cAAA,KAAAC,4BAAA,kDAAAC,MAAA,IAAAC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qD,cAAA,IAAAC,UAAA,iBAAAC,WAAA,KAAAC,cAAA,KAAAC,WAAA,sBAAAC,MAAA,MAAAvI,OAAA,yCAAAyF,QAAA,IAAA+C,UAAA,IAAApI,OAAA,IAAAqI,SAAA,IAAAC,YAAA,KAAAC,YAAA,KAAAC,UAAA,KAAAC,UAAA,KAAAC,YAAA,KAAAC,UAAA,KAAAC,eAAA,yDAAA5I,OAAA,IAAA6I,UAAA,+CAAA1F,WAAA,IAAAnE,KAAA,sBAAAgB,OAAA,6BAAA8I,QAAA,IAAAC,OAAA,MAAAC,QAAA,MAAAC,YAAA,MAAAC,MAAA,qDAAApJ,QAAA,IAAAN,MAAA,IAAA2J,OAAA,IAAAC,UAAA,IAAAC,OAAA,IAAArK,KAAA,MAAAE,SAAA,MAAAC,cAAA,uBAAAmK,yBAAA,mCAAAC,uBAAA,iCAAAC,UAAA,MAAAC,aAAA,IAAAC,UAAA,IAAAC,eAAA,sBAAAC,iBAAA,wBAAAjC,KAAA,MAAAkC,YAAA,oCAAA1G,WAAA,MAAA2G,iBAAA,0BAAA9K,KAAA,+BAAAyF,QAAA,IAAArB,SAAA,IAAA2G,gBAAA,uBAAAC,aAAA,oBAAA7G,WAAA,IAAA8G,gBAAA,UAAApL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as s,c as t,h as i,F as e,a as h}from"./p-1a1a43fd.js";import{d as o}from"./p-1805f5b0.js";import{v as a}from"./p-5d7f4ff2.js";function n(s){if(typeof s!=="string"){throw new TypeError("Expected a string")}return s.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const r=".sc-dso-autosuggest-h{display:block;position:relative}ul.sc-dso-autosuggest,.autosuggest-progress-box.sc-dso-autosuggest{background-clip:padding-box;background-color:#fff;border:1px solid rgba(0, 0, 0, 0.15);border-radius:4px;box-shadow:0 6px 12px rgba(0, 0, 0, 0.175);list-style-type:none;margin-top:2px;padding:4px 0;position:absolute;left:0;right:0;top:100%;z-index:200}.autosuggest-progress-box.sc-dso-autosuggest{padding:12px 8px}ul.sc-dso-autosuggest{padding:8px 0}ul.sc-dso-autosuggest li.sc-dso-autosuggest{display:flex;justify-content:space-between;padding:4px 16px}li[aria-selected=true].sc-dso-autosuggest{cursor:pointer;background-color:#39870c}li[aria-selected=true].sc-dso-autosuggest,li[aria-selected=true].sc-dso-autosuggest .type.sc-dso-autosuggest{color:#fff}mark.sc-dso-autosuggest{font-weight:700;background-color:inherit;color:inherit;padding:0}.type.sc-dso-autosuggest{color:#666}";const l=class{constructor(i){s(this,i);this.dsoSelect=t(this,"dsoSelect",7);this.dsoChange=t(this,"dsoChange",7);this.dsoSearch=t(this,"dsoSearch",7);this.listboxId=a();this.inputId=a();this.labelId=a();this.debouncedEmitValue=o((s=>{this.dsoChange.emit(s);this.debouncedShowLoading()}),200);this.debouncedShowLoading=o((()=>{if(this.inputValue){this.showLoading=true}}),this.loadingDelayed);this.inputValue="";this.onInput=s=>{if(!(s.target instanceof HTMLInputElement)){return}this.showLoading=!this.loadingDelayed;this.inputValue=s.target.value;this.debouncedEmitValue(s.target.value.match(/(\S+)/g)?s.target.value:"")};this.onFocusIn=()=>{if(this.suggestOnFocus){this.openSuggestions()}};this.onKeyDown=s=>{if(s.defaultPrevented||this.loading){return}switch(s.key){case"ArrowDown":if(!this.showSuggestions){this.openSuggestions("first")}else{this.selectNextSuggestion()}break;case"ArrowUp":if(!this.showSuggestions){this.openSuggestions("last")}else{this.selectPreviousSuggestion()}break;case"Tab":this.closeSuggestions();return;case"Escape":this.closeSuggestions();break;case"Enter":this.pickSelectedValue();break;default:return}s.preventDefault()};this.suggestions=null;this.loading=false;this.loadingLabel="Een moment geduld.";this.loadingDelayed=undefined;this.notFoundLabel=undefined;this.suggestOnFocus=false;this.showSuggestions=false;this.selectedSuggestion=undefined;this.notFound=false;this.showLoading=false}suggestionsWatcher(){this.resetSelectedSuggestion();if((!this.showSuggestions||!this.notFound)&&this.inputValue){this.openSuggestions()}else if((this.showSuggestions||this.notFound)&&!this.inputValue){this.closeSuggestions()}}onDocumentClick(s){if((this.showSuggestions||this.notFound)&&this.listbox&&s.target instanceof Node&&!this.listbox.contains(s.target)&&this.input!==s.target){this.closeSuggestions()}}connectedCallback(){setTimeout((()=>{const s=this.host.querySelector('input[type="text"]');if(!(s instanceof HTMLInputElement)){return}this.input=s;if(s.id){this.inputId=s.id}else{s.id=this.inputId}if(!this.input.labels||this.input.labels.length<1){return}const t=this.input.labels[0];if(t===null||t===void 0?void 0:t.id){this.labelId=t.id}else if(t){t.id=this.labelId}this.input.setAttribute("role","combobox");this.input.setAttribute("aria-haspopup","listbox");this.input.setAttribute("aria-controls",this.listboxId);this.input.setAttribute("aria-expanded","false");this.input.setAttribute("autocomplete","off");this.input.setAttribute("aria-autocomplete","list");this.input.setAttribute("aria-activedescendant","");this.input.addEventListener("input",this.onInput);this.input.addEventListener("keydown",this.onKeyDown);this.input.addEventListener("focusin",this.onFocusIn)}))}disconnectedCallback(){var s,t,i;(s=this.input)===null||s===void 0?void 0:s.removeEventListener("input",this.onInput);(t=this.input)===null||t===void 0?void 0:t.removeEventListener("keydown",this.onKeyDown);(i=this.input)===null||i===void 0?void 0:i.removeEventListener("focusin",this.onFocusIn)}markTerms(s,t){if(!s||!t||t.length===0||t[0]===undefined){return[""]}const e=new RegExp(`(${n(t[0])})`,"gi");return s.split(e).map((s=>{if(!s){return""}if(e.test(s)){return i("mark",null,s)}if(t.length===1){return i("span",null,s)}return this.markTerms(s,t.slice(1))}))}selectSuggestion(s){var t;this.selectedSuggestion=s;(t=this.input)===null||t===void 0?void 0:t.setAttribute("aria-activedescendant",this.listboxItemId(s))}selectFirstSuggestion(){var s;if(!this.suggestions){return}this.selectedSuggestion=this.suggestions[0];if(this.selectedSuggestion){(s=this.input)===null||s===void 0?void 0:s.setAttribute("aria-activedescendant",this.listboxItemId(this.selectedSuggestion))}}selectLastSuggestion(){var s;if(!this.suggestions){return}this.selectedSuggestion=this.suggestions[this.suggestions.length-1];if(this.selectedSuggestion){(s=this.input)===null||s===void 0?void 0:s.setAttribute("aria-activedescendant",this.listboxItemId(this.selectedSuggestion))}}selectNextSuggestion(){var s,t;if(!this.suggestions){return}const i=this.selectedSuggestion?this.suggestions.indexOf(this.selectedSuggestion):-1;this.selectedSuggestion=(s=this.suggestions[i+1])!==null&&s!==void 0?s:this.suggestions[0];if(this.selectedSuggestion){(t=this.input)===null||t===void 0?void 0:t.setAttribute("aria-activedescendant",this.listboxItemId(this.selectedSuggestion))}}selectPreviousSuggestion(){var s,t;if(!this.suggestions){return}const i=this.selectedSuggestion?this.suggestions.indexOf(this.selectedSuggestion):0;this.selectedSuggestion=(s=this.suggestions[i-1])!==null&&s!==void 0?s:this.suggestions[this.suggestions.length-1];if(this.selectedSuggestion){(t=this.input)===null||t===void 0?void 0:t.setAttribute("aria-activedescendant",this.listboxItemId(this.selectedSuggestion))}}resetSelectedSuggestion(){var s;this.showLoading=!this.loadingDelayed;this.notFound=false;this.selectedSuggestion=undefined;(s=this.input)===null||s===void 0?void 0:s.setAttribute("aria-activedescendant","")}openSuggestions(s){var t,i,e,h;this.showSuggestions=(t=this.suggestions&&this.suggestions.length>0)!==null&&t!==void 0?t:false;this.notFound=(e=((i=this.suggestions)===null||i===void 0?void 0:i.length)===0)!==null&&e!==void 0?e:false;(h=this.input)===null||h===void 0?void 0:h.setAttribute("aria-expanded",(this.showSuggestions||this.notFound).toString());if(this.showSuggestions&&s==="first"){this.selectFirstSuggestion()}else if(this.showSuggestions&&s==="last"){this.selectLastSuggestion()}}closeSuggestions(){var s;this.showSuggestions=false;this.notFound=false;(s=this.input)===null||s===void 0?void 0:s.setAttribute("aria-expanded","false");this.selectFirstSuggestion()}pickSelectedValue(){var s;if(this.selectedSuggestion&&this.showSuggestions){this.dsoSelect.emit(this.selectedSuggestion)}else{this.dsoSearch.emit((s=this.input)===null||s===void 0?void 0:s.value)}this.closeSuggestions()}listboxItemId(s){if(!this.suggestions){return""}return`${this.inputId}-${this.suggestions.indexOf(s)+1}`}render(){var s,t;const h=(t=(s=this.input)===null||s===void 0?void 0:s.value.split(" ").filter((s=>s)))!==null&&t!==void 0?t:[];return i(e,null,i("slot",null),this.loading&&this.showLoading?i("div",{class:"autosuggest-progress-box"},i("dso-progress-indicator",{label:this.loadingLabel})):i("ul",{role:"listbox",id:this.listboxId,"aria-labelledby":this.labelId,ref:s=>this.listbox=s,hidden:!this.showSuggestions&&!this.notFound},this.showSuggestions&&this.suggestions&&this.suggestions.map((s=>i("li",{role:"option",id:this.listboxItemId(s),key:s.value,onMouseEnter:()=>this.selectSuggestion(s),onMouseLeave:()=>this.resetSelectedSuggestion(),onClick:()=>this.pickSelectedValue(),"aria-selected":(s===this.selectedSuggestion).toString(),"aria-label":s.value},i("span",{class:"value"},this.markTerms(s.value,h)),s.type?i("span",{class:"type"},s.type):undefined)))||this.notFound&&i("li",null,i("span",{class:"value"},!this.notFoundLabel?this.markTerms(`${this.inputValue} is niet gevonden.`,h):i("span",null,this.notFoundLabel)))))}get host(){return h(this)}static get watchers(){return{suggestions:["suggestionsWatcher"]}}};l.style=r;export{l as dso_autosuggest};
|
|
2
|
+
//# sourceMappingURL=p-a4d423fd.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["escapeStringRegexp","string","TypeError","replace","autosuggestCss","Autosuggest","this","listboxId","v4","inputId","labelId","debouncedEmitValue","debounce","value","dsoChange","emit","debouncedShowLoading","inputValue","showLoading","loadingDelayed","onInput","event","target","HTMLInputElement","match","onFocusIn","suggestOnFocus","openSuggestions","onKeyDown","defaultPrevented","loading","key","showSuggestions","selectNextSuggestion","selectPreviousSuggestion","closeSuggestions","pickSelectedValue","preventDefault","suggestionsWatcher","resetSelectedSuggestion","notFound","onDocumentClick","listbox","Node","contains","input","connectedCallback","setTimeout","host","querySelector","id","labels","length","label","setAttribute","addEventListener","disconnectedCallback","_a","removeEventListener","_b","_c","markTerms","suggestionValue","terms","undefined","termRegex","RegExp","split","map","valuePart","test","h","slice","selectSuggestion","suggestion","selectedSuggestion","listboxItemId","selectFirstSuggestion","suggestions","selectLastSuggestion","index","indexOf","_d","toString","dsoSelect","dsoSearch","render","filter","t","Fragment","class","loadingLabel","role","ref","element","hidden","onMouseEnter","onMouseLeave","onClick","type","notFoundLabel"],"sources":["../../node_modules/escape-string-regexp/index.js","./src/components/autosuggest/autosuggest.scss?tag=dso-autosuggest&encapsulation=scoped","./src/components/autosuggest/autosuggest.tsx"],"sourcesContent":["export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","@use \"~dso-toolkit/src/variables/units\";\r\n@use \"~dso-toolkit/src/variables/colors\";\r\n@use \"~dso-toolkit/src/variables/scaffolding\";\r\n@use \"~dso-toolkit/src/variables/zindex\";\r\n\r\n@use \"autosuggest.variables\" as core-autosuggest-variables;\r\n\r\n:host {\r\n display: block;\r\n position: relative;\r\n}\r\n\r\nul,\r\n.autosuggest-progress-box {\r\n background-clip: padding-box;\r\n background-color: core-autosuggest-variables.$background-color;\r\n border: 1px solid core-autosuggest-variables.$border-color;\r\n border-radius: scaffolding.$border-radius-base;\r\n box-shadow: core-autosuggest-variables.$box-shadow;\r\n list-style-type: none;\r\n margin-top: 2px;\r\n padding: units.$u1 * 0.5 0;\r\n position: absolute;\r\n left: 0;\r\n right: 0;\r\n top: 100%;\r\n z-index: zindex.$autosuggest;\r\n}\r\n\r\n.autosuggest-progress-box {\r\n padding: units.$u1 * 1.5 units.$u1;\r\n}\r\n\r\nul {\r\n padding: units.$u1 0;\r\n\r\n li {\r\n display: flex;\r\n justify-content: space-between;\r\n padding: units.$u1 * 0.5 units.$u2;\r\n }\r\n}\r\n\r\nli[aria-selected=\"true\"] {\r\n cursor: pointer;\r\n background-color: colors.$grasgroen;\r\n\r\n &,\r\n .type {\r\n color: colors.$wit;\r\n }\r\n}\r\n\r\nmark {\r\n font-weight: 700;\r\n background-color: inherit;\r\n color: inherit;\r\n padding: 0;\r\n}\r\n\r\n.type {\r\n color: colors.$grijs-60;\r\n}\r\n","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 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"],"mappings":"wIAAe,SAASA,EAAmBC,GAC1C,UAAWA,IAAW,SAAU,CAC/B,MAAM,IAAIC,UAAU,oBACtB,CAIC,OAAOD,EACLE,QAAQ,sBAAuB,QAC/BA,QAAQ,KAAM,QACjB,CCVA,MAAMC,EAAiB,y4B,MCYVC,EAAW,M,wIA6FdC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E,YAAYV,KAAKM,GACpBH,EAAA,MACEqB,KAAK,SACL1C,GAAI5C,KAAKsE,cAAcF,GACvB3C,IAAK2C,EAAW7D,MAChBmF,aAAc,IAAM1F,KAAKmE,iBAAiBC,GAC1CuB,aAAc,IAAM3F,KAAKiC,0BACzB2D,QAAS,IAAM5F,KAAK8B,oBAAmB,iBACvBsC,IAAepE,KAAKqE,oBAAoBQ,WAAU,aACtDT,EAAW7D,OAEvB0D,EAAA,QAAMmB,MAAM,SAASpF,KAAKuD,UAAUa,EAAW7D,MAAOkD,IACrDW,EAAWyB,KAAO5B,EAAA,QAAMmB,MAAM,QAAQhB,EAAWyB,MAAenC,cAGpE1D,KAAKkC,UACJ+B,EAAA,UACEA,EAAA,QAAMmB,MAAM,UACRpF,KAAK8F,cACL9F,KAAKuD,UAAU,GAAGvD,KAAKW,+BAAgC8C,GAEvDQ,EAAA,YAAOjE,KAAK8F,kB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as s,h as o}from"./p-1a1a43fd.js";import{c as r}from"./p-6a1980b4.js";const t=":host{display:block}*,*::after,*::before{box-sizing:border-box}.dso-banner{padding:16px 0;position:relative}.dso-banner.dso-compact{padding:12px 0}";const a=class{constructor(o){s(this,o);this.status=undefined;this.compact=false;this.noIcon=true}render(){return o("section",{class:r("dso-banner",`alert-${this.status}`,{"dso-compact":this.compact}),role:"alert"},o("slot",null))}};a.style=t;export{a as dso_banner};
|
|
2
|
+
//# sourceMappingURL=p-b911f052.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["bannerCss","Banner","render","h","class","clsx","this","status","compact","role"],"sources":["./src/components/banner/banner.scss?tag=dso-banner&encapsulation=shadow","./src/components/banner/banner.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/components/banner\";\r\n\r\n:host {\r\n display: block;\r\n}\r\n\r\n@include utilities.box-sizing();\r\n\r\n.dso-banner {\r\n @include banner.root();\r\n}\r\n","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"],"mappings":"+EAAA,MAAMA,EAAY,sJ,MCQLC,EAAM,M,4DAWP,M,YAQD,I,CAETC,SACE,OACEC,EAAA,WACEC,MAAOC,EAAK,aAAc,SAASC,KAAKC,SAAU,CAChD,cAAeD,KAAKE,UAEtBC,KAAK,SAELN,EAAA,a"}
|
|
@@ -37,7 +37,8 @@ const Autosuggest = class {
|
|
|
37
37
|
this.inputValue = "";
|
|
38
38
|
this.onInput = (event) => {
|
|
39
39
|
if (!(event.target instanceof HTMLInputElement)) {
|
|
40
|
-
|
|
40
|
+
return;
|
|
41
|
+
// throw new Error("event.target is not instanceof HTMLInputElement"); #2293
|
|
41
42
|
}
|
|
42
43
|
this.showLoading = !this.loadingDelayed;
|
|
43
44
|
this.inputValue = event.target.value;
|
|
@@ -116,7 +117,8 @@ const Autosuggest = class {
|
|
|
116
117
|
setTimeout(() => {
|
|
117
118
|
const input = this.host.querySelector('input[type="text"]');
|
|
118
119
|
if (!(input instanceof HTMLInputElement)) {
|
|
119
|
-
|
|
120
|
+
return;
|
|
121
|
+
// throw new ReferenceError("Mandatory text input not found"); #2293
|
|
120
122
|
}
|
|
121
123
|
this.input = input;
|
|
122
124
|
if (input.id) {
|
|
@@ -126,7 +128,8 @@ const Autosuggest = class {
|
|
|
126
128
|
input.id = this.inputId;
|
|
127
129
|
}
|
|
128
130
|
if (!this.input.labels || this.input.labels.length < 1) {
|
|
129
|
-
|
|
131
|
+
return;
|
|
132
|
+
// throw new ReferenceError("Mandatory label for text input not found"); #2293
|
|
130
133
|
}
|
|
131
134
|
const label = this.input.labels[0];
|
|
132
135
|
if (label === null || label === void 0 ? void 0 : label.id) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"dso-autosuggest.entry.js","mappings":";;;;AAAe,SAAS,kBAAkB,CAAC,MAAM,EAAE;AACnD,CAAC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACjC,EAAE,MAAM,IAAI,SAAS,CAAC,mBAAmB,CAAC,CAAC;AAC3C,EAAE;AACF;AACA;AACA;AACA,CAAC,OAAO,MAAM;AACd,GAAG,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;AACzC,GAAG,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1B;;ACVA,MAAM,cAAc,GAAG,w4BAAw4B;;MCYl5B,WAAW;;;;;;IA6Fd,cAAS,GAAW,EAAE,EAAE,CAAC;IAEzB,YAAO,GAAW,EAAE,EAAE,CAAC;IAEvB,YAAO,GAAW,EAAE,EAAE,CAAC;IAEvB,uBAAkB,GAAGA,UAAQ,CAAC,CAAC,KAAa;MAClD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;MAC3B,IAAI,CAAC,oBAAoB,EAAE,CAAC;KAC7B,EAAE,GAAG,CAAC,CAAC;IAEA,yBAAoB,GAAGA,UAAQ,CAAC;MACtC,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;OACzB;KACF,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAEhB,eAAU,GAAG,EAAE,CAAC;I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CAAC,UAAU,oBAAoB,EAAE,KAAK,CAAC,KAE7D,gBAAO,IAAI,CAAC,aAAa,CAAQ,CAClC,CACI,CACJ,CACN,CAAC,CACD,CACN,CACA,EACH;GACH;;;;;;;;;;","names":["debounce"],"sources":["../../node_modules/escape-string-regexp/index.js","./src/components/autosuggest/autosuggest.scss?tag=dso-autosuggest&encapsulation=scoped","./src/components/autosuggest/autosuggest.tsx"],"sourcesContent":["export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","@use \"~dso-toolkit/src/variables/units\";\r\n@use \"~dso-toolkit/src/variables/colors\";\r\n@use \"~dso-toolkit/src/variables/scaffolding\";\r\n@use \"~dso-toolkit/src/variables/zindex\";\r\n\r\n@use \"autosuggest.variables\" as core-autosuggest-variables;\r\n\r\n:host {\r\n display: block;\r\n position: relative;\r\n}\r\n\r\nul,\r\n.autosuggest-progress-box {\r\n background-clip: padding-box;\r\n background-color: core-autosuggest-variables.$background-color;\r\n border: 1px solid core-autosuggest-variables.$border-color;\r\n border-radius: scaffolding.$border-radius-base;\r\n box-shadow: core-autosuggest-variables.$box-shadow;\r\n list-style-type: none;\r\n margin-top: 2px;\r\n padding: units.$u1 * 0.5 0;\r\n position: absolute;\r\n left: 0;\r\n right: 0;\r\n top: 100%;\r\n z-index: zindex.$autosuggest;\r\n}\r\n\r\n.autosuggest-progress-box {\r\n padding: units.$u1 * 1.5 units.$u1;\r\n}\r\n\r\nul {\r\n padding: units.$u1 0;\r\n\r\n li {\r\n display: flex;\r\n justify-content: space-between;\r\n padding: units.$u1 * 0.5 units.$u2;\r\n }\r\n}\r\n\r\nli[aria-selected=\"true\"] {\r\n cursor: pointer;\r\n background-color: colors.$grasgroen;\r\n\r\n &,\r\n .type {\r\n color: colors.$wit;\r\n }\r\n}\r\n\r\nmark {\r\n font-weight: 700;\r\n background-color: inherit;\r\n color: inherit;\r\n padding: 0;\r\n}\r\n\r\n.type {\r\n color: colors.$grijs-60;\r\n}\r\n","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 throw new Error(\"event.target is not instanceof HTMLInputElement\");\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 throw new ReferenceError(\"Mandatory text input not found\");\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 throw new ReferenceError(\"Mandatory label for text input not found\");\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 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"],"version":3}
|
|
1
|
+
{"file":"dso-autosuggest.entry.js","mappings":";;;;AAAe,SAAS,kBAAkB,CAAC,MAAM,EAAE;AACnD,CAAC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACjC,EAAE,MAAM,IAAI,SAAS,CAAC,mBAAmB,CAAC,CAAC;AAC3C,EAAE;AACF;AACA;AACA;AACA,CAAC,OAAO,MAAM;AACd,GAAG,OAAO,CAAC,qBAAqB,E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BAAuB,EAAE,EAClD,OAAO,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,mBACxB,CAAC,UAAU,KAAK,IAAI,CAAC,kBAAkB,EAAE,QAAQ,EAAE,gBACtD,UAAU,CAAC,KAAK,IAE5B,YAAM,KAAK,EAAC,OAAO,IAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAQ,EACnE,UAAU,CAAC,IAAI,GAAG,YAAM,KAAK,EAAC,MAAM,IAAE,UAAU,CAAC,IAAI,CAAQ,GAAG,SAAS,CACvE,CACN,CAAC;OACD,IAAI,CAAC,QAAQ,KACZ,cACE,YAAM,KAAK,EAAC,OAAO,IAChB,CAAC,IAAI,CAAC,aAAa,IAClB,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,UAAU,oBAAoB,EAAE,KAAK,CAAC,KAE7D,gBAAO,IAAI,CAAC,aAAa,CAAQ,CAClC,CACI,CACJ,CACN,CAAC,CACD,CACN,CACA,EACH;GACH;;;;;;;;;;","names":["debounce"],"sources":["../../node_modules/escape-string-regexp/index.js","./src/components/autosuggest/autosuggest.scss?tag=dso-autosuggest&encapsulation=scoped","./src/components/autosuggest/autosuggest.tsx"],"sourcesContent":["export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","@use \"~dso-toolkit/src/variables/units\";\r\n@use \"~dso-toolkit/src/variables/colors\";\r\n@use \"~dso-toolkit/src/variables/scaffolding\";\r\n@use \"~dso-toolkit/src/variables/zindex\";\r\n\r\n@use \"autosuggest.variables\" as core-autosuggest-variables;\r\n\r\n:host {\r\n display: block;\r\n position: relative;\r\n}\r\n\r\nul,\r\n.autosuggest-progress-box {\r\n background-clip: padding-box;\r\n background-color: core-autosuggest-variables.$background-color;\r\n border: 1px solid core-autosuggest-variables.$border-color;\r\n border-radius: scaffolding.$border-radius-base;\r\n box-shadow: core-autosuggest-variables.$box-shadow;\r\n list-style-type: none;\r\n margin-top: 2px;\r\n padding: units.$u1 * 0.5 0;\r\n position: absolute;\r\n left: 0;\r\n right: 0;\r\n top: 100%;\r\n z-index: zindex.$autosuggest;\r\n}\r\n\r\n.autosuggest-progress-box {\r\n padding: units.$u1 * 1.5 units.$u1;\r\n}\r\n\r\nul {\r\n padding: units.$u1 0;\r\n\r\n li {\r\n display: flex;\r\n justify-content: space-between;\r\n padding: units.$u1 * 0.5 units.$u2;\r\n }\r\n}\r\n\r\nli[aria-selected=\"true\"] {\r\n cursor: pointer;\r\n background-color: colors.$grasgroen;\r\n\r\n &,\r\n .type {\r\n color: colors.$wit;\r\n }\r\n}\r\n\r\nmark {\r\n font-weight: 700;\r\n background-color: inherit;\r\n color: inherit;\r\n padding: 0;\r\n}\r\n\r\n.type {\r\n color: colors.$grijs-60;\r\n}\r\n","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 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"],"version":3}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-3e9ed0c5.js';
|
|
2
2
|
import { c as clsx } from './clsx.m-25174a58.js';
|
|
3
3
|
|
|
4
|
-
const bannerCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}.dso-banner{padding:16px 0;position:relative}";
|
|
4
|
+
const bannerCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}.dso-banner{padding:16px 0;position:relative}.dso-banner.dso-compact{padding:12px 0}";
|
|
5
5
|
|
|
6
6
|
const Banner = class {
|
|
7
7
|
constructor(hostRef) {
|
|
8
8
|
registerInstance(this, hostRef);
|
|
9
9
|
this.status = undefined;
|
|
10
|
+
this.compact = false;
|
|
11
|
+
this.noIcon = true;
|
|
10
12
|
}
|
|
11
13
|
render() {
|
|
12
|
-
return (h("section", { class: clsx("dso-banner", `alert-${this.status}
|
|
14
|
+
return (h("section", { class: clsx("dso-banner", `alert-${this.status}`, {
|
|
15
|
+
"dso-compact": this.compact,
|
|
16
|
+
}), role: "alert" }, h("slot", null)));
|
|
13
17
|
}
|
|
14
18
|
};
|
|
15
19
|
Banner.style = bannerCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"dso-banner.entry.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,
|
|
1
|
+
{"file":"dso-banner.entry.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,qJAAqJ;;MCQ1J,MAAM;;;;mBAWP,KAAK;kBAQN,IAAI;;EAEb,MAAM;IACJ,QACE,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,IAEZ,eAAa,CACL,EACV;GACH;;;;;;","names":[],"sources":["./src/components/banner/banner.scss?tag=dso-banner&encapsulation=shadow","./src/components/banner/banner.tsx"],"sourcesContent":["@use \"~dso-toolkit/src/utilities\";\r\n@use \"~dso-toolkit/src/components/banner\";\r\n\r\n:host {\r\n display: block;\r\n}\r\n\r\n@include utilities.box-sizing();\r\n\r\n.dso-banner {\r\n @include banner.root();\r\n}\r\n","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"],"version":3}
|