@public-ui/sample-react 2.1.7-rc.2 → 2.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/1487.js +1 -1
  2. package/dist/1636.js +1 -1
  3. package/dist/1792.js +1 -1
  4. package/dist/1795.js +1 -1
  5. package/dist/2017.js +1 -1
  6. package/dist/2322.js +1 -1
  7. package/dist/2538.js +1 -1
  8. package/dist/2567.js +1 -1
  9. package/dist/263.js +1 -1
  10. package/dist/2719.js +1 -1
  11. package/dist/3064.js +1 -1
  12. package/dist/3077.js +1 -1
  13. package/dist/3238.js +1 -1
  14. package/dist/3395.js +1 -1
  15. package/dist/35.js +1 -1
  16. package/dist/3521.js +1 -1
  17. package/dist/356.js +1 -1
  18. package/dist/3714.js +1 -1
  19. package/dist/3735.js +1 -1
  20. package/dist/3766.js +1 -1
  21. package/dist/3994.js +1 -1
  22. package/dist/4025.js +1 -1
  23. package/dist/4118.js +1 -1
  24. package/dist/4182.js +1 -1
  25. package/dist/4188.js +1 -1
  26. package/dist/{5784.js → 4262.js} +2 -2
  27. package/dist/4332.js +1 -1
  28. package/dist/4402.js +1 -1
  29. package/dist/4818.js +1 -1
  30. package/dist/4892.js +1 -1
  31. package/dist/4933.js +1 -1
  32. package/dist/4943.js +1 -1
  33. package/dist/495.js +1 -1
  34. package/dist/5034.js +1 -1
  35. package/dist/5056.js +1 -1
  36. package/dist/5138.js +1 -1
  37. package/dist/5296.js +1 -1
  38. package/dist/5356.js +1 -1
  39. package/dist/5551.js +1 -1
  40. package/dist/5835.js +1 -1
  41. package/dist/5840.js +1 -1
  42. package/dist/5889.js +1 -1
  43. package/dist/5912.js +1 -1
  44. package/dist/6082.js +1 -1
  45. package/dist/6099.js +1 -1
  46. package/dist/6181.js +1 -1
  47. package/dist/619.js +1 -1
  48. package/dist/6671.js +1 -1
  49. package/dist/6775.js +1 -1
  50. package/dist/7274.js +1 -1
  51. package/dist/7795.js +1 -1
  52. package/dist/7802.js +1 -1
  53. package/dist/7860.js +1 -1
  54. package/dist/8092.js +1 -1
  55. package/dist/8111.js +1 -1
  56. package/dist/8146.js +1 -1
  57. package/dist/8427.js +1 -1
  58. package/dist/8495.js +1 -1
  59. package/dist/8672.js +1 -1
  60. package/dist/8710.js +2 -0
  61. package/dist/8737.js +1 -1
  62. package/dist/8786.js +1 -1
  63. package/dist/8796.js +1 -1
  64. package/dist/8977.js +1 -1
  65. package/dist/9333.js +1 -1
  66. package/dist/9389.js +1 -1
  67. package/dist/9561.js +1 -1
  68. package/dist/9599.js +1 -1
  69. package/dist/9612.js +1 -1
  70. package/dist/9890.js +1 -1
  71. package/dist/main.css +1 -1
  72. package/dist/main.js +1 -1
  73. package/package.json +4 -4
  74. package/src/components/modal/basic.tsx +37 -18
  75. package/src/components/split-button/routes.ts +2 -0
  76. package/src/components/split-button/with-context.tsx +37 -0
  77. package/src/components/table/interactive-child-elements.tsx +105 -0
  78. package/src/components/table/routes.ts +2 -0
  79. package/src/components/table/stateful-with-selection.tsx +4 -4
  80. package/src/components/table/stateful-with-single-selection.tsx +4 -4
  81. package/src/components/table/stateless-with-selection.tsx +4 -5
  82. package/src/components/table/stateless-with-single-selection.tsx +3 -4
  83. package/dist/3227.js +0 -2
  84. /package/dist/{3227.js.LICENSE.txt → 4262.js.LICENSE.txt} +0 -0
  85. /package/dist/{5784.js.LICENSE.txt → 8710.js.LICENSE.txt} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/sample-react",
3
- "version": "2.1.7-rc.2",
3
+ "version": "2.1.7",
4
4
  "description": "This app contains samples for the KoliBri/Public UI",
5
5
  "license": "EUPL-1.2",
6
6
  "repository": {
@@ -33,9 +33,9 @@
33
33
  "typescript": "5.5.4",
34
34
  "world_countries_lists": "2.9.0",
35
35
  "yup": "1.4.0",
36
- "@public-ui/components": "2.1.7-rc.2",
37
- "@public-ui/react": "2.1.7-rc.2",
38
- "@public-ui/themes": "2.1.7-rc.2"
36
+ "@public-ui/components": "2.1.7",
37
+ "@public-ui/react": "2.1.7",
38
+ "@public-ui/themes": "2.1.7"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@playwright/test": "1.45.3"
@@ -6,6 +6,7 @@ import { SampleDescription } from '../SampleDescription';
6
6
 
7
7
  export const ModalBasic: FC = () => {
8
8
  const modalElement = useRef<HTMLKolModalElement>(null);
9
+ const stackedModalElement = useRef<HTMLKolModalElement>(null);
9
10
 
10
11
  return (
11
12
  <>
@@ -17,29 +18,47 @@ export const ModalBasic: FC = () => {
17
18
  </SampleDescription>
18
19
 
19
20
  <div>
20
- <KolModal _label="" _width="80%" ref={modalElement} _on={{ onClose: () => console.log('Modal closed') }}>
21
- <KolCard _label="I am a modal." style={{ width: '100%' }}>
22
- <div>
23
- <KolButton
24
- _label="Close modal"
25
- _on={{
26
- onClick: () => {
27
- if (modalElement?.current) {
28
- modalElement.current._activeElement = null;
29
- }
30
- },
31
- }}
32
- />
33
- </div>
21
+ <KolModal _label="Primary modal" _width="80%" ref={modalElement} _on={{ onClose: () => console.log('Modal closed') }}>
22
+ <KolCard _label="I am a modal.">
23
+ <KolButton
24
+ _label="Open stacked modal"
25
+ className="mr"
26
+ _on={{
27
+ onClick: () => {
28
+ stackedModalElement.current?.openModal();
29
+ },
30
+ }}
31
+ />
32
+
33
+ <KolButton
34
+ _label="Close modal"
35
+ _on={{
36
+ onClick: () => {
37
+ modalElement.current?.closeModal();
38
+ },
39
+ }}
40
+ />
34
41
  </KolCard>
35
42
  </KolModal>
43
+
44
+ <KolModal _label="Stacked modal" _width="80%" ref={stackedModalElement}>
45
+ <KolCard _label="Stacked modal element">
46
+ <KolButton
47
+ _label="Close stacked modal"
48
+ _on={{
49
+ onClick: () => {
50
+ stackedModalElement.current?.closeModal();
51
+ },
52
+ }}
53
+ />
54
+ </KolCard>
55
+ </KolModal>
56
+
36
57
  <KolButton
37
58
  _label="Open modal"
38
59
  _on={{
39
- onClick: (event: Event) => {
40
- if (modalElement?.current) {
41
- modalElement.current._activeElement = event.target as HTMLElement;
42
- }
60
+ onClick: () => {
61
+ modalElement.current?.openModal();
43
62
  },
44
63
  }}
45
64
  />
@@ -1,8 +1,10 @@
1
1
  import { Routes } from '../../shares/types';
2
2
  import { SplitButtonBasic } from './basic';
3
+ import { SplitButtonWithContext } from './with-context';
3
4
 
4
5
  export const SPLIT_BUTTON_ROUTES: Routes = {
5
6
  'split-button': {
6
7
  basic: SplitButtonBasic,
8
+ 'with-context': SplitButtonWithContext,
7
9
  },
8
10
  };
@@ -0,0 +1,37 @@
1
+ /* eslint-disable jsx-a11y/no-static-element-interactions */
2
+ /* eslint-disable jsx-a11y/click-events-have-key-events */
3
+ import * as React from 'react';
4
+
5
+ import { KolButton, KolInputText, KolSplitButton } from '@public-ui/react';
6
+ import { SampleDescription } from '../SampleDescription';
7
+
8
+ import type { FC } from 'react';
9
+
10
+ export const SplitButtonWithContext: FC = () => {
11
+ const splitButtonRef = React.useRef<HTMLKolSplitButtonElement & { closePopup: any }>();
12
+
13
+ const handleCloseClick = () => {
14
+ splitButtonRef.current?.closePopup();
15
+ };
16
+
17
+ return (
18
+ <>
19
+ <SampleDescription>
20
+ <p>SplitButton renders a button with an additional context-menu, that can be opened by clicking the arrow icon.</p>
21
+ </SampleDescription>
22
+
23
+ <div className="flex gap-4">
24
+ <KolSplitButton ref={splitButtonRef as any} _label="Only the arrow opens">
25
+ <div style={{ width: 300, padding: 16, border: '1px solid #ccc' }} onClick={(e) => e.stopPropagation()}>
26
+ <p>SplitButton renders a button with an additional context-menu, that can be opened by clicking the arrow icon.</p>
27
+ <div style={{ gap: 16, display: 'flex', flexDirection: 'column' }}>
28
+ <KolInputText _label="User" />
29
+ <KolInputText _label="Role" />
30
+ <KolButton _label="Close" _on={{ onClick: handleCloseClick }} />
31
+ </div>
32
+ </div>
33
+ </KolSplitButton>
34
+ </div>
35
+ </>
36
+ );
37
+ };
@@ -0,0 +1,105 @@
1
+ import type { FC } from 'react';
2
+ import React from 'react';
3
+ import { createReactRenderElement, KolButton, KolButtonLink, KolLink, KolLinkButton, KolTableStateless } from '@public-ui/react';
4
+ import { SampleDescription } from '../SampleDescription';
5
+ import { getRoot } from '../../shares/react-roots';
6
+ import type { ButtonVariantPropType, KoliBriTableCell } from '@public-ui/components';
7
+ import type { KoliBriTableHeaderCell } from '@public-ui/components/src/schema';
8
+
9
+ const getButtonHeaderCell = (variant: ButtonVariantPropType): KoliBriTableHeaderCell => {
10
+ const capitalizedVariant = variant.charAt(0).toUpperCase() + variant.slice(1);
11
+ return {
12
+ label: capitalizedVariant,
13
+ key: variant,
14
+ textAlign: 'left',
15
+ render: (element: HTMLElement, cell: KoliBriTableCell) => {
16
+ const commonProps = {
17
+ _label: capitalizedVariant,
18
+ _variant: variant,
19
+ _icons: { right: 'codicon codicon-squirrel' },
20
+ };
21
+ getRoot(createReactRenderElement(element)).render(
22
+ cell.label === 'button' ? <KolButton {...commonProps} /> : <KolLinkButton _href="#/back-page" {...commonProps} />,
23
+ );
24
+ },
25
+ };
26
+ };
27
+
28
+ export const InteractiveChildElements: FC = () => (
29
+ <>
30
+ <SampleDescription>
31
+ <p>
32
+ This sample shows a KolTableStateless with different interactive child elements. It can be used to assure themes show these child elements correctly.
33
+ </p>
34
+ </SampleDescription>
35
+
36
+ <KolTableStateless
37
+ _label="Button styles"
38
+ _headerCells={{
39
+ horizontal: [
40
+ [
41
+ { label: '', asTd: true, width: '20ex' },
42
+ getButtonHeaderCell('primary'),
43
+ getButtonHeaderCell('secondary'),
44
+ getButtonHeaderCell('normal'),
45
+ getButtonHeaderCell('danger'),
46
+ getButtonHeaderCell('ghost'),
47
+ ],
48
+ ],
49
+ vertical: [[{ label: 'Button' }, { label: 'Link-Button' }]],
50
+ }}
51
+ _data={[
52
+ {
53
+ primary: 'button',
54
+ secondary: 'button',
55
+ normal: 'button',
56
+ danger: 'button',
57
+ ghost: 'button',
58
+ },
59
+ {
60
+ primary: 'link-button',
61
+ secondary: 'link-button',
62
+ normal: 'link-button',
63
+ danger: 'link-button',
64
+ ghost: 'link-button',
65
+ },
66
+ ]}
67
+ className="block"
68
+ />
69
+
70
+ <KolTableStateless
71
+ _label="Link styles"
72
+ _headerCells={{
73
+ horizontal: [
74
+ [
75
+ { label: '', asTd: true, width: '20ex' },
76
+ {
77
+ key: 'regular',
78
+ label: 'Regular',
79
+ textAlign: 'left',
80
+ render: (element: HTMLElement, cell: KoliBriTableCell) => {
81
+ const commonProps = {
82
+ _label: cell.label,
83
+ _icons: { right: 'codicon codicon-squirrel' },
84
+ };
85
+ getRoot(createReactRenderElement(element)).render(
86
+ cell.label === 'button-link' ? <KolButtonLink {...commonProps} /> : <KolLink _href="#/back-page" {...commonProps} />,
87
+ );
88
+ },
89
+ },
90
+ ],
91
+ ],
92
+ vertical: [[{ label: 'Link' }, { label: 'Button-Link' }]],
93
+ }}
94
+ _data={[
95
+ {
96
+ regular: 'link',
97
+ },
98
+ {
99
+ regular: 'button-link',
100
+ },
101
+ ]}
102
+ className="block mt"
103
+ />
104
+ </>
105
+ );
@@ -12,6 +12,7 @@ import { TableStatefulWithSingleSelection } from './stateful-with-single-selecti
12
12
  import { TableStatelessWithSelection } from './stateless-with-selection';
13
13
  import { TableStatelessWithSingleSelection } from './stateless-with-single-selection';
14
14
  import { TableWithPagination } from './with-pagination';
15
+ import { InteractiveChildElements } from './interactive-child-elements';
15
16
 
16
17
  export const TABLE_ROUTES: Routes = {
17
18
  table: {
@@ -27,6 +28,7 @@ export const TABLE_ROUTES: Routes = {
27
28
  'stateless-with-selection': TableStatelessWithSelection,
28
29
  'stateless-with-single-selection': TableStatelessWithSingleSelection,
29
30
  'with-pagination': TableWithPagination,
31
+ 'interactive-child-elements': InteractiveChildElements,
30
32
  stateless: TableStateless,
31
33
  },
32
34
  };
@@ -5,8 +5,8 @@ import { SampleDescription } from '../SampleDescription';
5
5
  import type { KoliBriTableDataType, KoliBriTableSelection } from '@public-ui/components';
6
6
 
7
7
  const DATA = [
8
- { id: '1001', name: 'Foo Bar' },
9
- { id: '1002', name: 'Foo Baz' },
8
+ { id: '1001', name: 'Foo Bar', internalIdentifier: `AAA1001` },
9
+ { id: '1002', name: 'Foo Baz', internalIdentifier: `AAA1002` },
10
10
  ];
11
11
  type Data = (typeof DATA)[0];
12
12
 
@@ -15,8 +15,8 @@ export const TableStatefulWithSelection: FC = () => {
15
15
 
16
16
  const selection: KoliBriTableSelection = {
17
17
  label: (row) => `Selection for ${(row as Data).name}`,
18
- selectedKeys: selectedValue ? selectedValue.map((element) => element.id) : [],
19
- keyPropertyName: 'id',
18
+ selectedKeys: selectedValue ? selectedValue.map((element) => element.internalIdentifier) : [],
19
+ keyPropertyName: 'internalIdentifier',
20
20
  };
21
21
 
22
22
  const kolTableStatefulRef = useRef<HTMLKolTableStatefulElement>(null);
@@ -5,8 +5,8 @@ import { SampleDescription } from '../SampleDescription';
5
5
  import type { KoliBriTableDataType, KoliBriTableSelection } from '@public-ui/components';
6
6
 
7
7
  const DATA = [
8
- { id: '1001', name: 'Foo Bar' },
9
- { id: '1002', name: 'Foo Baz' },
8
+ { id: '1001', name: 'Foo Bar', internalIdentifier: `AAA1001` },
9
+ { id: '1002', name: 'Foo Baz', internalIdentifier: `AAA1002` },
10
10
  ];
11
11
 
12
12
  type Data = (typeof DATA)[0];
@@ -17,8 +17,8 @@ export const TableStatefulWithSingleSelection: FC = () => {
17
17
  const selection: KoliBriTableSelection = {
18
18
  label: (row) => `Selection for ${(row as Data).name}`,
19
19
  multiple: false,
20
- selectedKeys: selectedValue ? [selectedValue.id] : [],
21
- keyPropertyName: 'id',
20
+ selectedKeys: selectedValue ? [selectedValue.internalIdentifier] : [],
21
+ keyPropertyName: 'internalIdentifier',
22
22
  };
23
23
 
24
24
  const kolTableStatefulRef = useRef<HTMLKolTableStatefulElement>(null);
@@ -5,25 +5,24 @@ import { SampleDescription } from '../SampleDescription';
5
5
  import type { KoliBriTableSelection } from '@public-ui/components';
6
6
 
7
7
  const DATA = [
8
- { id: '1001', name: 'Foo Bar' },
9
- { id: '1002', name: 'Foo Baz' },
8
+ { id: '1001', name: 'Foo Bar', internalIdentifier: `AAA1001` },
9
+ { id: '1002', name: 'Foo Baz', internalIdentifier: `AAA1002` },
10
10
  ];
11
11
  type Data = (typeof DATA)[0];
12
12
 
13
13
  export const TableStatelessWithSelection: FC = () => {
14
- const [selectedKeys, setSelectedKeys] = useState(['1002']);
14
+ const [selectedKeys, setSelectedKeys] = useState(['AAA1002']);
15
15
 
16
16
  const selection: KoliBriTableSelection = {
17
17
  label: (row) => `Selection for ${(row as Data).name}`,
18
18
  selectedKeys,
19
- keyPropertyName: 'id',
19
+ keyPropertyName: 'internalIdentifier',
20
20
  };
21
21
 
22
22
  const kolTableStatelessRef = useRef<HTMLKolTableStatelessElement>(null);
23
23
 
24
24
  const handleSelectionChangeEvent = ({ detail: selection }: { detail: string[] }) => {
25
25
  console.log('Selection change via event', selection);
26
- setSelectedKeys(selection);
27
26
  };
28
27
  const handleSelectionChangeCallback = (_event: Event, selection: string[] | string) => {
29
28
  console.log('Selection change via callback', selection);
@@ -5,8 +5,8 @@ import { SampleDescription } from '../SampleDescription';
5
5
  import type { KoliBriTableSelection } from '@public-ui/components';
6
6
 
7
7
  const DATA = [
8
- { id: '1001', name: 'Foo Bar' },
9
- { id: '1002', name: 'Foo Baz' },
8
+ { id: '1001', name: 'Foo Bar', internalIdentifier: `AAA1001` },
9
+ { id: '1002', name: 'Foo Baz', internalIdentifier: `AAA1002` },
10
10
  ];
11
11
  type Data = (typeof DATA)[0];
12
12
 
@@ -17,14 +17,13 @@ export const TableStatelessWithSingleSelection: FC = () => {
17
17
  label: (row) => `Selection for ${(row as Data).name}`,
18
18
  multiple: false,
19
19
  selectedKeys,
20
- keyPropertyName: 'id',
20
+ keyPropertyName: 'internalIdentifier',
21
21
  };
22
22
 
23
23
  const kolTableStatelessRef = useRef<HTMLKolTableStatelessElement>(null);
24
24
 
25
25
  const handleSelectionChangeEvent = ({ detail: selection }: { detail: string[] }) => {
26
26
  console.log('Selection change via event', selection);
27
- setSelectedKeys(selection);
28
27
  };
29
28
  const handleSelectionChangeCallback = (_event: Event, selection: string[] | string) => {
30
29
  console.log('Selection change via callback', selection);
package/dist/3227.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 3227.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_public_ui_sample_react=self.webpackChunk_public_ui_sample_react||[]).push([[3227],{224:(t,e,o)=>{o.d(e,{I:()=>n});var i=o(3790);const n=({accessKey:t,label:e})=>{let[o,...n]=e.split(t);return 0===n.length&&(t=t.toUpperCase(),[o,...n]=e.split(t)),0===n.length&&(t=t.toLowerCase(),[o,...n]=e.split(t)),(0,i.h)(i.F,null,o,n.length?(0,i.h)(i.F,null,(0,i.h)("u",null,t),n.join(t)):null)}},7914:(t,e,o)=>{o.d(e,{a:()=>a,v:()=>n});var i=o(479);const n=(t,e,o)=>{(0,i.w)(t,e,(t=>"string"==typeof t&&s.includes(t)),new Set(s),o,{defaultValue:"top"})},s=["left","right","top","bottom"],a=(t,e)=>{n(t,"_align",e)}},953:(t,e,o)=>{o.d(e,{A:()=>s});var i=o(6448),n=o(479);class s{constructor(t,e,o){var s,a,r,l;if(this.experimentalMode=(0,i.a)(),this.setFormAssociatedValue=t=>{var e;const o=null===(e=this.formAssociated)||void 0===e?void 0:e.getAttribute("name");null!==o&&""!==o||(0,n.j)(` The form field (${this.type}) must have a name attribute to be form-associated. Please define the _name attribute.`);const i=this.tryToStringifyValue(t);this.syncValue(t,i,this.formAssociated),this.syncValue(t,i,this.syncToOwnInput)},this.component=t,this.host=this.findHostWithShadowRoot(o),this.type=e,this.experimentalMode&&("KOL-BUTTON"===(l=null===(s=this.host)||void 0===s?void 0:s.tagName)||"KOL-COMBOBOX"===l||"KOL-INPUT-CHECKBOX"===l||"KOL-INPUT-COLOR"===l||"KOL-INPUT-DATE"===l||"KOL-INPUT-EMAIL"===l||"KOL-INPUT-FILE"===l||"KOL-INPUT-NUMBER"===l||"KOL-INPUT-PASSWORD"===l||"KOL-INPUT-RADIO"===l||"KOL-INPUT-RANGE"===l||"KOL-INPUT-TEXT"===l||"KOL-SELECT"===l||"KOL-SINGLE-SELECT"===l||"KOL-TEXTAREA"===l)&&t._name){switch(null===(a=this.host)||void 0===a||a.querySelectorAll("input,select,textarea").forEach((t=>{var e;null===(e=this.host)||void 0===e||e.removeChild(t)})),this.type){case"button":case"color":case"date":case"email":case"file":case"number":case"password":case"radio":case"range":case"text":this.formAssociated=document.createElement("input"),this.formAssociated.setAttribute("type",this.type);break;case"select":this.formAssociated=document.createElement("select"),this.formAssociated.setAttribute("multiple","");break;case"textarea":this.formAssociated=document.createElement("textarea");break;default:this.formAssociated=document.createElement("input"),this.formAssociated.setAttribute("type","hidden")}this.formAssociated.setAttribute("aria-hidden","true"),this.formAssociated.setAttribute("data-form-associated",""),this.formAssociated.setAttribute("hidden",""),null===(r=this.host)||void 0===r||r.appendChild(this.formAssociated)}}findHostWithShadowRoot(t){for(;null===(null==t?void 0:t.shadowRoot)&&t!==document.body;)(t=null==t?void 0:t.parentNode).host&&(t=t.host);return t}setAttribute(t,e,o){if(this.experimentalMode)try{if("boolean"!=typeof(o="object"==typeof o&&null!==o?JSON.stringify(o):o)&&"number"!=typeof o&&"string"!=typeof o)throw new Error("Invalid value type: "+typeof o);null==e||e.setAttribute(t,`${o}`)}catch(o){null==e||e.removeAttribute(t)}}tryToStringifyValue(t){try{return"object"==typeof t&&null!==t?JSON.stringify(t).toString():null==t?null:t.toString()}catch(t){return(0,n.l)(`The form field raw value is not able to stringify! ${t}`),""}}syncValue(t,e,o){if(o)switch(this.type){case"file":o.files=t;break;case"select":o.querySelectorAll("option").forEach((t=>{o.removeChild(t)})),Array.isArray(t)&&t.forEach((t=>{const e=this.tryToStringifyValue(t);if("string"==typeof e){const t=document.createElement("option");t.setAttribute("value",e),t.setAttribute("selected",""),o.appendChild(t)}}));break;case"radio":"string"==typeof e&&(o.setAttribute("value",e),o.setAttribute("checked",""),o.value=e);break;default:"string"==typeof e?(o.setAttribute("value",e),o.value=e):(o.removeAttribute("value"),o.value="")}}validateName(t){((t,e,o)=>{(0,n.i)(t,"_name",e,o)})(this.component,t,{hooks:{afterPatch:()=>{this.setAttribute("name",this.formAssociated,this.component.state._name)}}}),void 0===t&&(0,n.j)("A name on input fields or switches is not strictly required, but it might be relevant for the autocomplete function and for the static submission of the input field.")}validateSyncValueBySelector(t){if(this.experimentalMode&&"string"==typeof t){const e=document.querySelector(t);e&&(this.syncToOwnInput=e)}}componentWillLoad(){this.validateName(this.component._name),this.validateSyncValueBySelector(this.component._syncValueBySelector)}}},376:(t,e,o)=>{o.d(e,{I:()=>p,g:()=>d,v:()=>h});var i=o(6855),n=o(953),s=o(479),a=o(1618),r=o(5233),l=o(4388),c=o(6255);const h=(t,e)=>{(0,s.w)(t,"_msg",(t=>"object"==typeof t),new Set(["Object"]),e)},d=t=>{var e,o;const i=Boolean("error"===(null===(e=t._msg)||void 0===e?void 0:e._type)&&t._msg._description&&(null===(o=t._msg._description)||void 0===o?void 0:o.length)>0)&&!0===t._touched,n="string"==typeof t._hint&&t._hint.length>0,s=[];return!0===i&&s.push(`${t._id}-error`),!0===n&&s.push(`${t._id}-hint`),{hasError:i,hasHint:n,ariaDescribedBy:s}};class u extends n.A{constructor(t,e,o){super(t,e,o),this.component=t}validateAlert(t){(0,s.b)(this.component,"_alert",t)}validateTouched(t){((t,e)=>{(0,s.b)(t,"_touched",e)})(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateAlert(this.component._alert),this.validateTouched(this.component._touched)}}class p extends u{constructor(t,e,o){super(t,e,o),this.valueChangeListeners=[],this.onFacade={onBlur:this.onBlur.bind(this),onChange:this.onChange.bind(this),onClick:this.onClick.bind(this),onFocus:this.onFocus.bind(this),onInput:this.onInput.bind(this)},this.component=t}validateAccessKey(t){(0,s.i)(this.component,"_accessKey",t)}validateAdjustHeight(t){((t,e)=>{(0,s.b)(t,"_adjustHeight",e)})(this.component,t)}validateDisabled(t){(0,s.b)(this.component,"_disabled",t),!0===t&&(0,s.c)()}validateTooltipAlign(t){(0,c.v)(this.component,t)}validateError(t){const e={_description:t||"",_type:"error"};this.validateMsg(e)}validateHideError(t){((t,e,o)=>{(0,s.b)(t,"_hideError",e,o)})(this.component,t,{hooks:{afterPatch:()=>{this.component.state._hideError&&(0,s.a)("Property hide-error for inputs: Only use when the error message is shown outside of the input component.")}}})}validateHideLabel(t){(0,a.v)(this.component,t,{hooks:{afterPatch:()=>{this.component.state._hideLabel&&(0,s.a)("Property hide-label for inputs: Only use for exceptions like search inputs that are clearly identifiable by their context.")}}})}validateHint(t){(0,s.i)(this.component,"_hint",t)}validateId(t){(0,s.i)(this.component,"_id",t,{minLength:1}),""!==t&&void 0!==t||(0,s.j)("A unique ID on the input fields is not strictly required, but it might be relevant for E2E tests.")}validateLabel(t){(0,r.a)(this.component,t,{required:!0})}validateMsg(t){h(this.component,t)}validateOn(t){"object"==typeof t&&(0,s.s)(this.component,"_on",t)}validateSmartButton(t){(0,s.o)(t,(()=>{try{t=(0,s.p)(t)}catch(t){}(0,s.s)(this.component,"_smartButton",t)}))}validateTabIndex(t){(0,l.v)(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateAccessKey(this.component._accessKey),this.validateAdjustHeight(this.component._adjustHeight),this.validateError(this.component._error),this.validateMsg(this.component._msg),this.validateDisabled(this.component._disabled),this.validateHideError(this.component._hideError),this.validateHideLabel(this.component._hideLabel),this.validateHint(this.component._hint),this.validateId(this.component._id),this.validateLabel(this.component._label),this.validateSmartButton(this.component._smartButton),this.validateOn(this.component._on),this.validateTabIndex(this.component._tabIndex)}onBlur(t){var e;this.component._alert=!0,this.component._touched=!0,(0,i.s)(t),(0,i.t)("blur",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onBlur)&&this.component._on.onBlur(t)}onChange(t,e){var o;e=null!=e?e:t.target.value,(0,i.t)("change",this.host,e),"function"==typeof(null===(o=this.component._on)||void 0===o?void 0:o.onChange)&&this.component._on.onChange(t,e),this.valueChangeListeners.forEach((t=>t(e)))}onInput(t,e=!0,o){var n;o=null!=o?o:t.target.value,(0,i.s)(t),(0,i.t)("input",this.host,o),e&&this.setFormAssociatedValue(o),"function"==typeof(null===(n=this.component._on)||void 0===n?void 0:n.onInput)&&this.component._on.onInput(t,o)}onClick(t){var e;(0,i.s)(t),(0,i.t)("click",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onClick)&&this.component._on.onClick(t)}onFocus(t){var e;this.component._alert=!0,(0,i.s)(t),(0,i.t)("focus",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onFocus)&&this.component._on.onFocus(t)}addValueChangeListener(t){this.valueChangeListeners.push(t)}}},149:(t,e,o)=>{o.d(e,{i:()=>r,n:()=>c,r:()=>l});var i=o(3790),n=o(4997),s=o(6448);const a=()=>{let t=(0,s.d)().KoliBri;return void 0===t&&(t={},Object.defineProperty((0,s.d)(),"KoliBri",{value:t,writable:!1})),t},r=()=>{(()=>{const t=(0,s.g)().querySelector('meta[name="kolibri"]');if(t&&t.hasAttribute("content")){const e=t.getAttribute("content");"string"==typeof e&&((0,s.s)(e.includes("dev-mode=true")),(0,s.b)(e.includes("experimental-mode=true")),(0,s.c)(e.includes("color-contrast-analysis=true")))}})(),s.L.debug(`\n,--. ,--. ,--. ,--. ,-----. ,--.\n| .' / ,---. | | \`--' | |) /_ ,--.--. \`--'\n| . ' | .-. | | | ,--. | .-. \\ | .--' ,--.\n| |\\ \\ | '-' | | | | | | '--' / | | | |\n\`--' \`--´ \`---´ \`--' \`--' \`------´ \`--' \`--'\n🚹 The accessible HTML-Standard | 👉 https://public-ui.github.io | ${i.E.kolibriVersion}\n\t`,{forceLog:!0})},l=()=>{!0!==a().adviceShown&&(Object.defineProperty(a(),"adviceShown",{get:function(){return!0}}),s.L.debug("\nYou are using the KoliBri component library. If you have any suggestions for improvement or find a problem, please contact us:\n\nTicket: https://github.com/public-ui/kolibri/issues/new/choose (for privacy reasons, please use email)\nEmail: kolibri@itzbund.de\n"))};let c=()=>Math.floor(16777215*Math.random()).toString(16);"test"===n.p&&(c=()=>"nonce")},6855:(t,e,o)=>{function i(t){t.stopImmediatePropagation(),t.stopPropagation()}function n(t,e,o){e&&function(t,e,o){const i=t.dispatchEvent(function(t,e){return new CustomEvent(`kol-${t}`,{bubbles:!0,cancelable:!0,composed:!0,detail:e})}(e,o))}(e,t,o)}function s(t){t.preventDefault(),i(t)}o.d(e,{p:()=>s,s:()=>i,t:()=>n})},1618:(t,e,o)=>{o.d(e,{v:()=>n});var i=o(479);const n=(t,e,o={})=>{(0,i.b)(t,"_hideLabel",e,o)}},5233:(t,e,o)=>{o.d(e,{a:()=>d,b:()=>r,c:()=>l,h:()=>n,v:()=>h});var i=o(479);const n=[0,1,2,3,4,5,6],s=/[a-zA-Z0-9äöüÄÖÜß]/g,a=/^\d+$/;function r(t,e=1){return function(t){var e;return"string"==typeof t&&(null===(e=t.match(s))||void 0===e?void 0:e.length)||0}(t)>=e}function l(t){return a.test(t)}const c=new Set(["string"]),h=(t,e,o={})=>{(0,i.w)(t,"_label",(t=>"string"==typeof t),c,e,function(t){var e;return Object.assign(Object.assign({},t),{hooks:{afterPatch:(e,o,n,s)=>{var a,c;"function"==typeof(null===(a=t.hooks)||void 0===a?void 0:a.afterPatch)&&(null===(c=t.hooks)||void 0===c||c.afterPatch(e,o,n,s)),"string"==typeof e&&!1===r(e,3)&&!1===l(e)&&(0,i.a)(`The heading or label ("${e}") is not accessible. A label should consist of at least three readable characters.`),"string"==typeof e&&e.length>80&&(0,i.u)("A heading or label should not be longer than 80 characters.")},beforePatch:null===(e=t.hooks)||void 0===e?void 0:e.beforePatch}})}(o))},d=h},4997:(t,e,o)=>{o.d(e,{h:()=>n,p:()=>i,s:()=>s});let i="development";try{i="production"}catch(t){i="production"}const n=(t,e,o)=>{if(t&&e&&"string"==typeof o){const i=t.querySelector(`[slot="${o}"]`);i&&e.appendChild(i)}},s=t=>""===t},4388:(t,e,o)=>{o.d(e,{v:()=>s});var i=o(479);const n={hooks:{afterPatch:t=>{-1!==t&&0!==t&&(0,i.a)("Don't Use Tabindex Greater than 0: https://adrianroselli.com/2014/11/dont-use-tabindex-greater-than-0.html")}}},s=(t,e)=>{(0,i.k)(t,"_tabIndex",e,n)}},6255:(t,e,o)=>{o.d(e,{v:()=>n});var i=o(7914);const n=(t,e)=>{(0,i.v)(t,"_tooltipAlign",e)}}}]);