@nectary/components 0.33.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/accordion/index.js +35 -10
  2. package/accordion/types.d.ts +3 -2
  3. package/accordion-item/index.js +8 -4
  4. package/action-menu/index.js +7 -8
  5. package/action-menu/types.d.ts +3 -3
  6. package/action-menu-option/index.js +23 -3
  7. package/action-menu-option/types.d.ts +2 -0
  8. package/alert/index.js +1 -1
  9. package/avatar/index.js +1 -1
  10. package/button/index.js +68 -4
  11. package/button/types.d.ts +6 -0
  12. package/checkbox/index.js +64 -6
  13. package/checkbox/types.d.ts +8 -2
  14. package/date-picker/index.js +37 -12
  15. package/date-picker/types.d.ts +4 -2
  16. package/dialog/index.d.ts +1 -0
  17. package/dialog/index.js +8 -12
  18. package/dialog/types.d.ts +3 -3
  19. package/dropdown/index.js +44 -28
  20. package/dropdown/types.d.ts +6 -4
  21. package/dropdown-checkbox-option/index.js +1 -1
  22. package/dropdown-checkbox-option/types.d.ts +0 -2
  23. package/dropdown-radio-option/index.js +1 -1
  24. package/dropdown-radio-option/types.d.ts +0 -2
  25. package/dropdown-text-option/index.js +1 -1
  26. package/dropdown-text-option/types.d.ts +0 -2
  27. package/horizontal-stepper/index.d.ts +13 -0
  28. package/horizontal-stepper/index.js +104 -0
  29. package/horizontal-stepper/types.d.ts +9 -0
  30. package/horizontal-stepper/types.js +1 -0
  31. package/horizontal-stepper-item/index.d.ts +13 -0
  32. package/horizontal-stepper-item/index.js +100 -0
  33. package/horizontal-stepper-item/types.d.ts +15 -0
  34. package/horizontal-stepper-item/types.js +1 -0
  35. package/horizontal-stepper-item/utils.d.ts +2 -0
  36. package/horizontal-stepper-item/utils.js +1 -0
  37. package/icon-button/index.js +67 -3
  38. package/icon-button/types.d.ts +6 -0
  39. package/icons/create-icon-class.js +1 -1
  40. package/icons/exclamation/index.d.ts +11 -0
  41. package/icons/exclamation/index.js +4 -0
  42. package/icons-branded/create-icon-class.js +3 -7
  43. package/icons-branded/types.d.ts +3 -0
  44. package/icons-channel/create-icon-class.js +3 -7
  45. package/icons-channel/types.d.ts +3 -0
  46. package/input/index.js +50 -19
  47. package/input/types.d.ts +8 -2
  48. package/link/index.js +81 -3
  49. package/link/types.d.ts +9 -0
  50. package/package.json +1 -1
  51. package/pagination/index.js +24 -8
  52. package/pagination/types.d.ts +3 -1
  53. package/popover/index.js +10 -13
  54. package/popover/types.d.ts +4 -3
  55. package/radio/index.js +36 -8
  56. package/radio/types.d.ts +3 -1
  57. package/radio-option/index.js +1 -1
  58. package/search/types.d.ts +0 -1
  59. package/segment-collapse/index.js +28 -12
  60. package/segment-collapse/types.d.ts +3 -1
  61. package/segmented-control/index.js +28 -23
  62. package/segmented-control/types.d.ts +3 -2
  63. package/segmented-control-option/index.js +59 -13
  64. package/segmented-control-option/types.d.ts +4 -0
  65. package/segmented-icon-control/index.js +27 -16
  66. package/segmented-icon-control/types.d.ts +5 -2
  67. package/segmented-icon-control-option/index.js +54 -12
  68. package/segmented-icon-control-option/types.d.ts +4 -0
  69. package/select/index.js +68 -9
  70. package/select/types.d.ts +41 -7
  71. package/stop-events/index.d.ts +1 -0
  72. package/stop-events/index.js +40 -0
  73. package/tabs/index.js +32 -8
  74. package/tabs/types.d.ts +3 -2
  75. package/tabs-option/index.js +2 -2
  76. package/textarea/index.js +58 -4
  77. package/textarea/types.d.ts +7 -2
  78. package/tile-control/index.d.ts +11 -0
  79. package/tile-control/index.js +181 -0
  80. package/tile-control/types.d.ts +38 -0
  81. package/tile-control/types.js +1 -0
  82. package/tile-control-option/index.d.ts +11 -0
  83. package/tile-control-option/index.js +161 -0
  84. package/tile-control-option/types.d.ts +37 -0
  85. package/tile-control-option/types.js +1 -0
  86. package/time-picker/index.js +17 -3
  87. package/time-picker/types.d.ts +4 -2
  88. package/toggle/index.js +63 -5
  89. package/toggle/types.d.ts +3 -1
  90. package/utils.d.ts +1 -0
  91. package/utils.js +3 -0
package/select/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
2
  import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
3
3
 
4
- var _$button, _$buttonContent, _$label, _$optionalText, _$additionalText, _$invalidText, _$dropdown, _$optionSlot, _$sh, _createElement, _updateButtonContent, _onValueChange, _getOptionWithValue, _onLabelClick, _onDropdownClick, _onDropdownClose;
4
+ var _$button, _$buttonContent, _$label, _$optionalText, _$additionalText, _$invalidText, _$dropdown, _$optionSlot, _$sh, _createElement, _updateButtonContent, _onValueChange, _getOptionWithValue, _onLabelClick, _onDropdownClick, _onDropdownClose, _onButtonFocus, _onButtonBlur, _onChangeReactHandler, _onFocusReactHandler, _onBlurReactHandler;
5
5
 
6
6
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
7
7
 
@@ -12,11 +12,11 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
12
12
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
13
13
 
14
14
  import '../dropdown';
15
- import { defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute, updateIntegerAttribute } from '../utils';
16
- const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0;--sinch-color-icon:var(--sinch-color-stormy-500)}#wrapper{position:relative}sinch-dropdown{display:block}#button{all:initial;display:flex;align-items:center;gap:8px;border:1px solid var(--sinch-color-stormy-200);border-radius:var(--sinch-shape-radius-s);box-sizing:border-box;width:100%;height:48px;padding:8px 12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-100);cursor:pointer}#button:focus{border-color:var(--sinch-color-stormy-600)}#dropdown-icon{fill:var(--sinch-color-stormy-500)}#button>*{pointer-events:none}#button[data-unselected]{color:var(--sinch-color-text-muted)}#button:disabled{border-color:var(--sinch-color-snow-500);color:var(--sinch-color-stormy-100);cursor:initial}#button:disabled #dropdown-icon{fill:var(--sinch-color-stormy-100)}:host([invalidtext]:not([invalidtext=""])) #button:not(:disabled){border-color:var(--sinch-color-text-invalid)}#content{flex:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#bottom,#top{display:flex;align-items:baseline}#top{height:24px;margin-bottom:2px}#additional,#invalid,#label,#optional{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#label{font:var(--sinch-font-title-s);color:var(--sinch-color-text-default)}#optional{flex:1;text-align:right;font:var(--sinch-font-small-text);color:var(--sinch-color-text-muted)}#additional{flex:1;text-align:right;font:var(--sinch-font-extra-small-text);color:var(--sinch-color-text-muted);line-height:20px;margin-top:2px}#additional:empty{display:none}#invalid{font:var(--sinch-font-extra-small-text);color:var(--sinch-color-text-invalid);line-height:20px;margin-top:2px}#invalid:empty{display:none}::slotted(sinch-help-tooltip){align-self:center;margin:0 8px}:host([disabled]:not([disabled=false])) :is(#label,#additional,#optional,#invalid){color:var(--sinch-color-stormy-100)}:host([disabled]:not([disabled=false])){--sinch-color-icon:var(--sinch-color-stormy-100)}</style><div id="wrapper"><div id="top"><label id="label" for="button"></label><slot name="tooltip"></slot><span id="optional"></span></div><sinch-dropdown id="dropdown" modal orientation="bottom"><button slot="target" id="button"><span id="content"></span> <svg id="dropdown-icon" width="12" height="8" aria-hidden="true"><path d="M1.41.59 6 5.17 10.59.59 12 2 6 8 0 2 1.41.59Z"/></svg></button><slot name="option" slot="option"></slot></sinch-dropdown><div id="bottom"><span id="invalid"></span> <span id="additional"></span></div></div>';
15
+ import { defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, getReactEventHandler, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute, updateIntegerAttribute } from '../utils';
16
+ const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0;--sinch-color-icon:var(--sinch-color-stormy-500)}#wrapper{position:relative}sinch-dropdown{display:block}#button{all:initial;display:flex;align-items:center;gap:8px;border:1px solid var(--sinch-color-stormy-200);border-radius:var(--sinch-shape-radius-s);box-sizing:border-box;width:100%;height:48px;padding:8px 12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);background-color:var(--sinch-color-snow-100);cursor:pointer}#button:focus{border-color:var(--sinch-color-stormy-600)}#dropdown-icon{fill:var(--sinch-color-stormy-500)}#button>*{pointer-events:none}#button[data-unselected]{color:var(--sinch-color-text-muted)}#button:disabled{border-color:var(--sinch-color-snow-500);color:var(--sinch-color-stormy-100);cursor:initial}#button:disabled #dropdown-icon{fill:var(--sinch-color-stormy-100)}:host([invalidtext]:not([invalidtext=""])) #button:not(:disabled){border-color:var(--sinch-color-text-invalid)}#content{flex:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#bottom,#top{display:flex;align-items:baseline}#top{height:24px;margin-bottom:2px}#additional,#invalid,#label,#optional{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#label{font:var(--sinch-font-title-s);color:var(--sinch-color-text-default)}#optional{flex:1;text-align:right;font:var(--sinch-font-small-text);color:var(--sinch-color-text-muted)}#additional{flex:1;text-align:right;font:var(--sinch-font-extra-small-text);color:var(--sinch-color-text-muted);line-height:20px;margin-top:2px}#additional:empty{display:none}#invalid{font:var(--sinch-font-extra-small-text);color:var(--sinch-color-text-invalid);line-height:20px;margin-top:2px}#invalid:empty{display:none}::slotted(sinch-help-tooltip){align-self:center;margin:0 8px}:host([disabled]:not([disabled=false])) :is(#label,#additional,#optional,#invalid){color:var(--sinch-color-stormy-100)}:host([disabled]:not([disabled=false])){--sinch-color-icon:var(--sinch-color-stormy-100)}</style><div id="wrapper"><div id="top"><label id="label" for="button"></label><slot name="tooltip"></slot><span id="optional"></span></div><sinch-dropdown id="dropdown" modal orientation="bottom"><button slot="target" id="button"><span id="content"></span><svg id="dropdown-icon" width="12" height="8" aria-hidden="true"><path d="M1.41.59 6 5.17 10.59.59 12 2 6 8 0 2 1.41.59Z"/></svg></button><slot name="option" slot="option"></slot></sinch-dropdown><div id="bottom"><span id="invalid"></span><span id="additional"></span></div></div>';
17
17
  const template = document.createElement('template');
18
18
  template.innerHTML = templateHTML;
19
- defineCustomElement('sinch-select', (_$button = new WeakMap(), _$buttonContent = new WeakMap(), _$label = new WeakMap(), _$optionalText = new WeakMap(), _$additionalText = new WeakMap(), _$invalidText = new WeakMap(), _$dropdown = new WeakMap(), _$optionSlot = new WeakMap(), _$sh = new WeakMap(), _createElement = new WeakSet(), _updateButtonContent = new WeakSet(), _onValueChange = new WeakMap(), _getOptionWithValue = new WeakSet(), _onLabelClick = new WeakMap(), _onDropdownClick = new WeakMap(), _onDropdownClose = new WeakMap(), class extends NectaryElement {
19
+ defineCustomElement('sinch-select', (_$button = new WeakMap(), _$buttonContent = new WeakMap(), _$label = new WeakMap(), _$optionalText = new WeakMap(), _$additionalText = new WeakMap(), _$invalidText = new WeakMap(), _$dropdown = new WeakMap(), _$optionSlot = new WeakMap(), _$sh = new WeakMap(), _createElement = new WeakSet(), _updateButtonContent = new WeakSet(), _onValueChange = new WeakMap(), _getOptionWithValue = new WeakSet(), _onLabelClick = new WeakMap(), _onDropdownClick = new WeakMap(), _onDropdownClose = new WeakMap(), _onButtonFocus = new WeakMap(), _onButtonBlur = new WeakMap(), _onChangeReactHandler = new WeakMap(), _onFocusReactHandler = new WeakMap(), _onBlurReactHandler = new WeakMap(), class extends NectaryElement {
20
20
  constructor() {
21
21
  super();
22
22
 
@@ -74,11 +74,15 @@ defineCustomElement('sinch-select', (_$button = new WeakMap(), _$buttonContent =
74
74
  _classPrivateFieldInitSpec(this, _onValueChange, {
75
75
  writable: true,
76
76
  value: e => {
77
+ const detail = e.detail;
77
78
  _classPrivateFieldGet(this, _$dropdown).open = false;
78
79
  this.dispatchEvent(new CustomEvent('change', {
79
- detail: e.detail,
80
+ detail,
80
81
  bubbles: true
81
82
  }));
83
+ this.dispatchEvent(new CustomEvent('-change', {
84
+ detail
85
+ }));
82
86
  }
83
87
  });
84
88
 
@@ -103,6 +107,41 @@ defineCustomElement('sinch-select', (_$button = new WeakMap(), _$buttonContent =
103
107
  }
104
108
  });
105
109
 
110
+ _classPrivateFieldInitSpec(this, _onButtonFocus, {
111
+ writable: true,
112
+ value: () => {
113
+ this.dispatchEvent(new CustomEvent('-focus'));
114
+ }
115
+ });
116
+
117
+ _classPrivateFieldInitSpec(this, _onButtonBlur, {
118
+ writable: true,
119
+ value: () => {
120
+ this.dispatchEvent(new CustomEvent('-blur'));
121
+ }
122
+ });
123
+
124
+ _classPrivateFieldInitSpec(this, _onChangeReactHandler, {
125
+ writable: true,
126
+ value: e => {
127
+ getReactEventHandler(this, 'on-change')?.(e);
128
+ }
129
+ });
130
+
131
+ _classPrivateFieldInitSpec(this, _onFocusReactHandler, {
132
+ writable: true,
133
+ value: () => {
134
+ getReactEventHandler(this, 'on-focus')?.();
135
+ }
136
+ });
137
+
138
+ _classPrivateFieldInitSpec(this, _onBlurReactHandler, {
139
+ writable: true,
140
+ value: () => {
141
+ getReactEventHandler(this, 'on-blur')?.();
142
+ }
143
+ });
144
+
106
145
  const shadowRoot = this.attachShadow();
107
146
  shadowRoot.appendChild(template.content.cloneNode(true));
108
147
 
@@ -129,23 +168,39 @@ defineCustomElement('sinch-select', (_$button = new WeakMap(), _$buttonContent =
129
168
  this.setAttribute('role', 'listbox');
130
169
  this.setAttribute('aria-haspopup', 'listbox');
131
170
 
132
- _classPrivateFieldGet(this, _$dropdown).addEventListener('change', _classPrivateFieldGet(this, _onValueChange));
171
+ _classPrivateFieldGet(this, _$dropdown).addEventListener('-change', _classPrivateFieldGet(this, _onValueChange));
133
172
 
134
- _classPrivateFieldGet(this, _$dropdown).addEventListener('close', _classPrivateFieldGet(this, _onDropdownClose));
173
+ _classPrivateFieldGet(this, _$dropdown).addEventListener('-close', _classPrivateFieldGet(this, _onDropdownClose));
135
174
 
136
175
  _classPrivateFieldGet(this, _$button).addEventListener('click', _classPrivateFieldGet(this, _onDropdownClick));
137
176
 
177
+ _classPrivateFieldGet(this, _$button).addEventListener('focus', _classPrivateFieldGet(this, _onButtonFocus));
178
+
179
+ _classPrivateFieldGet(this, _$button).addEventListener('blur', _classPrivateFieldGet(this, _onButtonBlur));
180
+
138
181
  _classPrivateFieldGet(this, _$label).addEventListener('click', _classPrivateFieldGet(this, _onLabelClick));
182
+
183
+ this.addEventListener('-change', _classPrivateFieldGet(this, _onChangeReactHandler));
184
+ this.addEventListener('-focus', _classPrivateFieldGet(this, _onFocusReactHandler));
185
+ this.addEventListener('-blur', _classPrivateFieldGet(this, _onBlurReactHandler));
139
186
  }
140
187
 
141
188
  disconnectedCallback() {
142
- _classPrivateFieldGet(this, _$dropdown).removeEventListener('change', _classPrivateFieldGet(this, _onValueChange));
189
+ _classPrivateFieldGet(this, _$dropdown).removeEventListener('-change', _classPrivateFieldGet(this, _onValueChange));
143
190
 
144
- _classPrivateFieldGet(this, _$dropdown).removeEventListener('close', _classPrivateFieldGet(this, _onDropdownClose));
191
+ _classPrivateFieldGet(this, _$dropdown).removeEventListener('-close', _classPrivateFieldGet(this, _onDropdownClose));
145
192
 
146
193
  _classPrivateFieldGet(this, _$button).removeEventListener('click', _classPrivateFieldGet(this, _onDropdownClick));
147
194
 
195
+ _classPrivateFieldGet(this, _$button).removeEventListener('focus', _classPrivateFieldGet(this, _onButtonFocus));
196
+
197
+ _classPrivateFieldGet(this, _$button).removeEventListener('blur', _classPrivateFieldGet(this, _onButtonBlur));
198
+
148
199
  _classPrivateFieldGet(this, _$label).removeEventListener('click', _classPrivateFieldGet(this, _onLabelClick));
200
+
201
+ this.removeEventListener('-change', _classPrivateFieldGet(this, _onChangeReactHandler));
202
+ this.removeEventListener('-focus', _classPrivateFieldGet(this, _onFocusReactHandler));
203
+ this.removeEventListener('-blur', _classPrivateFieldGet(this, _onBlurReactHandler));
149
204
  }
150
205
 
151
206
  static get observedAttributes() {
@@ -225,6 +280,10 @@ defineCustomElement('sinch-select', (_$button = new WeakMap(), _$buttonContent =
225
280
  }
226
281
 
227
282
  attributeChangedCallback(name, oldVal, newVal) {
283
+ if (newVal === oldVal) {
284
+ return;
285
+ }
286
+
228
287
  switch (name) {
229
288
  case 'value':
230
289
  {
package/select/types.d.ts CHANGED
@@ -1,33 +1,67 @@
1
1
  import type { TRect, TSinchElementReact } from '../types';
2
2
  import type { SyntheticEvent } from 'react';
3
3
  export declare type TSinchSelectElement = HTMLElement & {
4
+ /** Value that matches one of the options `value` */
4
5
  value: string;
6
+ /** Label */
5
7
  label: string;
8
+ /** Text that appears when it has no value set */
6
9
  placeholder: string | null;
10
+ /** Optional text */
7
11
  optionalText: string | null;
8
- invalidText: string | null;
12
+ /** Additional text */
9
13
  additionalText: string | null;
10
- maxVisibleItems: number | null;
14
+ /** Invalid text, controls the overall invalid state */
15
+ invalidText: string | null;
16
+ /** Disabled */
11
17
  disabled: boolean;
18
+ /** Number of visible at the same time options in the list */
19
+ maxVisibleItems: number | null;
12
20
  readonly dropdownRect: TRect;
13
- addEventListener(type: 'change', listener: (e: CustomEvent<string>) => void): void;
21
+ /** Change value event */
22
+ addEventListener(type: '-change', listener: (e: CustomEvent<string>) => void): void;
23
+ addEventListener(type: '-focus', listener: (e: CustomEvent<void>) => void): void;
24
+ addEventListener(type: '-blur', listener: (e: CustomEvent<void>) => void): void;
25
+ /** Value that matches one of the options `value` */
14
26
  setAttribute(name: 'value', value: string): void;
27
+ /** Label */
15
28
  setAttribute(name: 'label', value: string): void;
29
+ /** Text that appears when it has no value set */
16
30
  setAttribute(name: 'placeholder', value: string): void;
31
+ /** Optional text */
17
32
  setAttribute(name: 'optionaltext', value: string): void;
33
+ /** Additional text */
18
34
  setAttribute(name: 'additionaltext', value: string): void;
19
- setAttribute(name: 'maxvisibleitems', value: string): void;
35
+ /** Invalid text, controls the overall invalid state */
36
+ setAttribute(name: 'invalidtext', value: string): void;
37
+ /** Disabled */
20
38
  setAttribute(name: 'disabled', value: ''): void;
39
+ /** Number of visible at the same time options in the list */
40
+ setAttribute(name: 'maxvisibleitems', value: string): void;
21
41
  };
22
42
  export declare type TSinchSelectReact = TSinchElementReact<TSinchSelectElement> & {
43
+ /** Value that matches one of the options `value` */
23
44
  value: string;
45
+ /** Label */
24
46
  label: string;
47
+ /** Label that is used for a11y – might be different from `label` */
48
+ 'aria-label': string;
49
+ /** Text that appears when it has no value set */
25
50
  placeholder?: string;
51
+ /** Optional text */
26
52
  optionalText?: string;
27
- invalidText?: string;
53
+ /** Additional text */
28
54
  additionalText?: string;
55
+ /** Invalid text, controls the overall invalid state */
56
+ invalidText?: string;
57
+ /** Disabled */
29
58
  disabled?: boolean;
59
+ /** Number of visible at the same time options in the list */
30
60
  maxVisibleItems?: number;
31
- 'aria-label': string;
32
- onChange: (e: SyntheticEvent<TSinchSelectElement, CustomEvent<string>>) => void;
61
+ /** Change value handler */
62
+ onChange?: (e: SyntheticEvent<TSinchSelectElement, CustomEvent<string>>) => void;
63
+ /** Change value handler */
64
+ 'on-change'?: (e: CustomEvent<string>) => void;
65
+ 'on-focus'?: (e: CustomEvent<void>) => void;
66
+ 'on-blur'?: (e: CustomEvent<void>) => void;
33
67
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,40 @@
1
+ import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
+
3
+ var _stopEvent;
4
+
5
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
6
+
7
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
8
+
9
+ import { defineCustomElement, getCsvSet } from '../utils';
10
+ defineCustomElement('sinch-stop-events', (_stopEvent = new WeakMap(), class extends HTMLElement {
11
+ constructor() {
12
+ super();
13
+
14
+ _classPrivateFieldInitSpec(this, _stopEvent, {
15
+ writable: true,
16
+ value: e => {
17
+ e.stopPropagation();
18
+ }
19
+ });
20
+
21
+ this.style.display = 'contents';
22
+ }
23
+
24
+ connectedCallback() {
25
+ const events = getCsvSet(this.getAttribute('events'));
26
+
27
+ for (const event of events) {
28
+ this.addEventListener(event, _classPrivateFieldGet(this, _stopEvent));
29
+ }
30
+ }
31
+
32
+ disconnectedCallback() {
33
+ const events = getCsvSet(this.getAttribute('events'));
34
+
35
+ for (const event of events) {
36
+ this.removeEventListener(event, _classPrivateFieldGet(this, _stopEvent));
37
+ }
38
+ }
39
+
40
+ }));
package/tabs/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
2
1
  import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
+ import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
3
3
 
4
- var _$slot, _onOptionKeyDown, _onSlotChange, _onOptionChange, _onValueChange, _dispatchChangeEvent, _getFirstOption, _getLastOption, _getNextOption, _getPrevOption, _getEnabledRadioElements;
4
+ var _$slot, _onOptionKeyDown, _onSlotChange, _onOptionChange, _onValueChange, _dispatchChangeEvent, _getFirstOption, _getLastOption, _getNextOption, _getPrevOption, _getEnabledRadioElements, _onChangeReactHandler;
5
5
 
6
6
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
7
7
 
@@ -11,7 +11,7 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
11
11
 
12
12
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
13
13
 
14
- import { defineCustomElement, getAttribute, getBooleanAttribute, NectaryElement, updateAttribute, updateBooleanAttribute } from '../utils';
14
+ import { defineCustomElement, getAttribute, getBooleanAttribute, getReactEventHandler, NectaryElement, updateAttribute, updateBooleanAttribute } from '../utils';
15
15
  const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:row;height:44px;width:100%;box-sizing:border-box}</style><div id="wrapper"><slot></slot></div>';
16
16
 
17
17
  const findSelectedOption = elements => {
@@ -20,7 +20,7 @@ const findSelectedOption = elements => {
20
20
 
21
21
  const template = document.createElement('template');
22
22
  template.innerHTML = templateHTML;
23
- defineCustomElement('sinch-tabs', (_$slot = new WeakMap(), _onOptionKeyDown = new WeakMap(), _onSlotChange = new WeakMap(), _onOptionChange = new WeakMap(), _onValueChange = new WeakSet(), _dispatchChangeEvent = new WeakSet(), _getFirstOption = new WeakSet(), _getLastOption = new WeakSet(), _getNextOption = new WeakSet(), _getPrevOption = new WeakSet(), _getEnabledRadioElements = new WeakSet(), class extends NectaryElement {
23
+ defineCustomElement('sinch-tabs', (_$slot = new WeakMap(), _onOptionKeyDown = new WeakMap(), _onSlotChange = new WeakMap(), _onOptionChange = new WeakMap(), _onValueChange = new WeakSet(), _dispatchChangeEvent = new WeakSet(), _getFirstOption = new WeakSet(), _getLastOption = new WeakSet(), _getNextOption = new WeakSet(), _getPrevOption = new WeakSet(), _getEnabledRadioElements = new WeakSet(), _onChangeReactHandler = new WeakMap(), class extends NectaryElement {
24
24
  constructor() {
25
25
  super();
26
26
 
@@ -98,18 +98,39 @@ defineCustomElement('sinch-tabs', (_$slot = new WeakMap(), _onOptionKeyDown = ne
98
98
  }
99
99
  });
100
100
 
101
+ _classPrivateFieldInitSpec(this, _onChangeReactHandler, {
102
+ writable: true,
103
+ value: e => {
104
+ getReactEventHandler(this, 'on-change')?.(e);
105
+ }
106
+ });
107
+
101
108
  const shadowRoot = this.attachShadow();
102
109
  shadowRoot.appendChild(template.content.cloneNode(true));
103
- shadowRoot.addEventListener('keydown', _classPrivateFieldGet(this, _onOptionKeyDown));
104
- shadowRoot.addEventListener('change', _classPrivateFieldGet(this, _onOptionChange));
105
110
 
106
111
  _classPrivateFieldSet(this, _$slot, shadowRoot.querySelector('slot'));
107
-
108
- _classPrivateFieldGet(this, _$slot).addEventListener('slotchange', _classPrivateFieldGet(this, _onSlotChange));
109
112
  }
110
113
 
111
114
  connectedCallback() {
112
115
  this.setAttribute('role', 'tablist');
116
+
117
+ _classPrivateFieldGet(this, _$slot).addEventListener('keydown', _classPrivateFieldGet(this, _onOptionKeyDown));
118
+
119
+ _classPrivateFieldGet(this, _$slot).addEventListener('option-change', _classPrivateFieldGet(this, _onOptionChange));
120
+
121
+ _classPrivateFieldGet(this, _$slot).addEventListener('slotchange', _classPrivateFieldGet(this, _onSlotChange));
122
+
123
+ this.addEventListener('-change', _classPrivateFieldGet(this, _onChangeReactHandler));
124
+ }
125
+
126
+ disconnectedCallback() {
127
+ _classPrivateFieldGet(this, _$slot).removeEventListener('keydown', _classPrivateFieldGet(this, _onOptionKeyDown));
128
+
129
+ _classPrivateFieldGet(this, _$slot).removeEventListener('option-change', _classPrivateFieldGet(this, _onOptionChange));
130
+
131
+ _classPrivateFieldGet(this, _$slot).removeEventListener('slotchange', _classPrivateFieldGet(this, _onSlotChange));
132
+
133
+ this.removeEventListener('-change', _classPrivateFieldGet(this, _onChangeReactHandler));
113
134
  }
114
135
 
115
136
  static get observedAttributes() {
@@ -153,6 +174,9 @@ function _dispatchChangeEvent2(value) {
153
174
  detail: value,
154
175
  bubbles: true
155
176
  }));
177
+ this.dispatchEvent(new CustomEvent('-change', {
178
+ detail: value
179
+ }));
156
180
  }
157
181
 
158
182
  function _getFirstOption2() {
package/tabs/types.d.ts CHANGED
@@ -2,11 +2,12 @@ import type { TSinchElementReact } from '../types';
2
2
  import type { SyntheticEvent } from 'react';
3
3
  export declare type TSinchTabsElement = HTMLElement & {
4
4
  value: string;
5
- addEventListener(type: 'change', listener: (e: CustomEvent<string>) => void): void;
5
+ addEventListener(type: '-change', listener: (e: CustomEvent<string>) => void): void;
6
6
  setAttribute(name: 'value', value: string): void;
7
7
  };
8
8
  export declare type TSinchTabsReact = TSinchElementReact<TSinchTabsElement> & {
9
9
  value: string;
10
10
  'aria-label': string;
11
- onChange: (event: SyntheticEvent<TSinchTabsElement, CustomEvent<string>>) => void;
11
+ onChange?: (event: SyntheticEvent<TSinchTabsElement, CustomEvent<string>>) => void;
12
+ 'on-change'?: (e: CustomEvent<string>) => void;
12
13
  };
@@ -8,7 +8,7 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedec
8
8
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
9
9
 
10
10
  import { defineCustomElement, getAttribute, getBooleanAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
11
- const templateHTML = '<style>:host{display:block;outline:0}:host()>*{pointer-events:none}#wrapper{display:flex;flex-direction:row;align-items:center;gap:12px;position:relative;width:100%;height:42px;padding:8px 20px;box-sizing:border-box;box-shadow:0 1px 0 0 var(--sinch-color-stormy-100);color:var(--sinch-color-stormy-500);background-color:var(--sinch-color-snow-100);--sinch-color-icon:var(--sinch-color-stormy-500);--sinch-size-icon:16px}#content{font:var(--sinch-font-title-s);flex-shrink:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([checked]:not([checked=false])) #wrapper{box-shadow:0 2px 0 0 var(--sinch-color-stormy-500)}#button{all:initial;position:absolute;left:0;top:0;box-sizing:border-box;width:100%;height:100%;cursor:pointer}#button:disabled{cursor:unset}:host([disabled]:not([disabled=false])) #wrapper{color:var(--sinch-color-stormy-100);--sinch-color-icon:var(--sinch-color-stormy-100)}</style><div id="wrapper"><slot name="icon"></slot><label for="input" id="content"></label> <button id="button" type="radio"/></div>';
11
+ const templateHTML = '<style>:host{display:block;outline:0}:host()>*{pointer-events:none}#wrapper{display:flex;flex-direction:row;align-items:center;gap:12px;position:relative;width:100%;height:42px;padding:8px 20px;box-sizing:border-box;box-shadow:0 1px 0 0 var(--sinch-color-stormy-100);color:var(--sinch-color-stormy-500);background-color:var(--sinch-color-snow-100);--sinch-color-icon:var(--sinch-color-stormy-500);--sinch-size-icon:16px}#content{font:var(--sinch-font-title-s);flex-shrink:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([checked]:not([checked=false])) #wrapper{box-shadow:0 2px 0 0 var(--sinch-color-stormy-500)}#button{all:initial;position:absolute;left:0;top:0;box-sizing:border-box;width:100%;height:100%;cursor:pointer}#button:disabled{cursor:unset}:host([disabled]:not([disabled=false])) #wrapper{color:var(--sinch-color-stormy-100);--sinch-color-icon:var(--sinch-color-stormy-100)}</style><div id="wrapper"><slot name="icon"></slot><label for="input" id="content"></label><button id="button" type="radio"/></div>';
12
12
  const template = document.createElement('template');
13
13
  template.innerHTML = templateHTML;
14
14
  defineCustomElement('sinch-tabs-option', (_$button = new WeakMap(), _$label = new WeakMap(), _onClick = new WeakMap(), class extends NectaryElement {
@@ -29,7 +29,7 @@ defineCustomElement('sinch-tabs-option', (_$button = new WeakMap(), _$label = ne
29
29
  writable: true,
30
30
  value: e => {
31
31
  e.stopPropagation();
32
- this.dispatchEvent(new CustomEvent('change', {
32
+ this.dispatchEvent(new CustomEvent('option-change', {
33
33
  bubbles: true,
34
34
  detail: this.value
35
35
  }));
package/textarea/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
2
  import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
3
3
 
4
- var _$input, _$label, _$optionalText, _$additionalText, _$invalidText, _cursorPos, _isPendingDk, _onCompositionStart, _onSelectionChange, _onInput;
4
+ var _$input, _$label, _$optionalText, _$additionalText, _$invalidText, _cursorPos, _isPendingDk, _onCompositionStart, _onSelectionChange, _onInput, _onInputFocus, _onInputBlur, _onChangeReactHandler, _onFocusReactHandler, _onBlurReactHandler;
5
5
 
6
6
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
7
7
 
8
8
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
9
9
 
10
- import { defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
11
- const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0;--sinch-color-icon:var(--sinch-color-stormy-500)}#wrapper{width:100%;box-sizing:border-box}#input{all:initial;border:1px solid var(--sinch-color-stormy-200);box-sizing:border-box;border-radius:var(--sinch-shape-radius-s);width:100%;padding:8px 12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);caret-color:var(--sinch-caret-color,auto);background-color:var(--sinch-color-snow-100);resize:none}#input::placeholder{font:var(--sinch-font-body);color:var(--sinch-color-text-muted)}#input:disabled{border-color:var(--sinch-color-snow-500);color:var(--sinch-color-stormy-100)}#input:disabled::placeholder{color:var(--sinch-color-snow-500)}#input:focus{border-color:var(--sinch-color-stormy-600)}:host([resizable]:not([resizable=false])) #input{resize:vertical}:host([invalidtext]:not([invalidtext=""])) #input:not(:disabled){border-color:var(--sinch-color-text-invalid)}#bottom,#top{display:flex;align-items:baseline}#top{height:24px;margin-bottom:2px}#additional,#invalid,#label,#optional{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#label{font:var(--sinch-font-title-s);color:var(--sinch-color-text-default)}#optional{flex:1;text-align:right;font:var(--sinch-font-small-text);color:var(--sinch-color-text-muted)}#additional{flex:1;text-align:right;font:var(--sinch-font-extra-small-text);color:var(--sinch-color-text-muted);line-height:20px;margin-top:2px}#additional:empty{display:none}#invalid{font:var(--sinch-font-extra-small-text);color:var(--sinch-color-text-invalid);line-height:20px;margin-top:2px}#invalid:empty{display:none}::slotted(sinch-help-tooltip){align-self:center;margin:0 8px}:host([disabled]:not([disabled=false])) :is(#label,#additional,#optional,#invalid){color:var(--sinch-color-stormy-100)}:host([disabled]:not([disabled=false])){--sinch-color-icon:var(--sinch-color-stormy-100)}</style><div id="wrapper"><div id="top"><label id="label" for="input"></label><slot name="tooltip"></slot><span id="optional"></span></div><textarea id="input"></textarea><div id="bottom"><span id="invalid"></span> <span id="additional"></span></div></div>';
10
+ import { defineCustomElement, getAttribute, getBooleanAttribute, getIntegerAttribute, getReactEventHandler, isAttrTrue, NectaryElement, updateAttribute, updateBooleanAttribute, updateExplicitBooleanAttribute } from '../utils';
11
+ const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0;--sinch-color-icon:var(--sinch-color-stormy-500)}#wrapper{width:100%;box-sizing:border-box}#input{all:initial;display:block;border:1px solid var(--sinch-color-stormy-200);box-sizing:border-box;border-radius:var(--sinch-shape-radius-s);width:100%;padding:8px 12px;font:var(--sinch-font-body);color:var(--sinch-color-text-default);caret-color:var(--sinch-caret-color,auto);background-color:var(--sinch-color-snow-100);resize:none}#input::placeholder{font:var(--sinch-font-body);color:var(--sinch-color-text-muted)}#input:disabled{border-color:var(--sinch-color-snow-500);color:var(--sinch-color-stormy-100)}#input:disabled::placeholder{color:var(--sinch-color-snow-500)}#input:focus{border-color:var(--sinch-color-stormy-600)}:host([resizable]:not([resizable=false])) #input{resize:vertical}:host([invalidtext]:not([invalidtext=""])) #input:not(:disabled){border-color:var(--sinch-color-text-invalid)}#bottom,#top{display:flex;align-items:baseline}#top{height:24px;margin-bottom:2px}#additional,#invalid,#label,#optional{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#label{font:var(--sinch-font-title-s);color:var(--sinch-color-text-default)}#optional{flex:1;text-align:right;font:var(--sinch-font-small-text);color:var(--sinch-color-text-muted)}#additional{flex:1;text-align:right;font:var(--sinch-font-extra-small-text);color:var(--sinch-color-text-muted);line-height:20px;margin-top:2px}#additional:empty{display:none}#invalid{font:var(--sinch-font-extra-small-text);color:var(--sinch-color-text-invalid);line-height:20px;margin-top:2px}#invalid:empty{display:none}::slotted(sinch-help-tooltip){align-self:center;margin:0 8px}:host([disabled]:not([disabled=false])) :is(#label,#additional,#optional,#invalid){color:var(--sinch-color-stormy-100)}:host([disabled]:not([disabled=false])){--sinch-color-icon:var(--sinch-color-stormy-100)}</style><div id="wrapper"><div id="top"><label id="label" for="input"></label><slot name="tooltip"></slot><span id="optional"></span></div><textarea id="input"></textarea><div id="bottom"><span id="invalid"></span><span id="additional"></span></div></div>';
12
12
  const template = document.createElement('template');
13
13
  template.innerHTML = templateHTML;
14
- defineCustomElement('sinch-textarea', (_$input = new WeakMap(), _$label = new WeakMap(), _$optionalText = new WeakMap(), _$additionalText = new WeakMap(), _$invalidText = new WeakMap(), _cursorPos = new WeakMap(), _isPendingDk = new WeakMap(), _onCompositionStart = new WeakMap(), _onSelectionChange = new WeakMap(), _onInput = new WeakMap(), class extends NectaryElement {
14
+ defineCustomElement('sinch-textarea', (_$input = new WeakMap(), _$label = new WeakMap(), _$optionalText = new WeakMap(), _$additionalText = new WeakMap(), _$invalidText = new WeakMap(), _cursorPos = new WeakMap(), _isPendingDk = new WeakMap(), _onCompositionStart = new WeakMap(), _onSelectionChange = new WeakMap(), _onInput = new WeakMap(), _onInputFocus = new WeakMap(), _onInputBlur = new WeakMap(), _onChangeReactHandler = new WeakMap(), _onFocusReactHandler = new WeakMap(), _onBlurReactHandler = new WeakMap(), class extends NectaryElement {
15
15
  constructor() {
16
16
  super();
17
17
 
@@ -96,10 +96,48 @@ defineCustomElement('sinch-textarea', (_$input = new WeakMap(), _$label = new We
96
96
  detail: nextValue,
97
97
  bubbles: true
98
98
  }));
99
+ this.dispatchEvent(new CustomEvent('-change', {
100
+ detail: nextValue
101
+ }));
99
102
  }
100
103
  }
101
104
  });
102
105
 
106
+ _classPrivateFieldInitSpec(this, _onInputFocus, {
107
+ writable: true,
108
+ value: () => {
109
+ this.dispatchEvent(new CustomEvent('-focus'));
110
+ }
111
+ });
112
+
113
+ _classPrivateFieldInitSpec(this, _onInputBlur, {
114
+ writable: true,
115
+ value: () => {
116
+ this.dispatchEvent(new CustomEvent('-blur'));
117
+ }
118
+ });
119
+
120
+ _classPrivateFieldInitSpec(this, _onChangeReactHandler, {
121
+ writable: true,
122
+ value: e => {
123
+ getReactEventHandler(this, 'on-change')?.(e);
124
+ }
125
+ });
126
+
127
+ _classPrivateFieldInitSpec(this, _onFocusReactHandler, {
128
+ writable: true,
129
+ value: () => {
130
+ getReactEventHandler(this, 'on-focus')?.();
131
+ }
132
+ });
133
+
134
+ _classPrivateFieldInitSpec(this, _onBlurReactHandler, {
135
+ writable: true,
136
+ value: () => {
137
+ getReactEventHandler(this, 'on-blur')?.();
138
+ }
139
+ });
140
+
103
141
  const shadowRoot = this.attachShadow();
104
142
  shadowRoot.appendChild(template.content.cloneNode(true));
105
143
 
@@ -125,6 +163,14 @@ defineCustomElement('sinch-textarea', (_$input = new WeakMap(), _$label = new We
125
163
  _classPrivateFieldGet(this, _$input).addEventListener('mousedown', _classPrivateFieldGet(this, _onSelectionChange));
126
164
 
127
165
  _classPrivateFieldGet(this, _$input).addEventListener('keydown', _classPrivateFieldGet(this, _onSelectionChange));
166
+
167
+ _classPrivateFieldGet(this, _$input).addEventListener('focus', _classPrivateFieldGet(this, _onInputFocus));
168
+
169
+ _classPrivateFieldGet(this, _$input).addEventListener('blur', _classPrivateFieldGet(this, _onInputBlur));
170
+
171
+ this.addEventListener('-change', _classPrivateFieldGet(this, _onChangeReactHandler));
172
+ this.addEventListener('-focus', _classPrivateFieldGet(this, _onFocusReactHandler));
173
+ this.addEventListener('-blur', _classPrivateFieldGet(this, _onBlurReactHandler));
128
174
  }
129
175
 
130
176
  disconnectedCallback() {
@@ -135,6 +181,14 @@ defineCustomElement('sinch-textarea', (_$input = new WeakMap(), _$label = new We
135
181
  _classPrivateFieldGet(this, _$input).removeEventListener('mousedown', _classPrivateFieldGet(this, _onSelectionChange));
136
182
 
137
183
  _classPrivateFieldGet(this, _$input).removeEventListener('keydown', _classPrivateFieldGet(this, _onSelectionChange));
184
+
185
+ _classPrivateFieldGet(this, _$input).removeEventListener('focus', _classPrivateFieldGet(this, _onInputFocus));
186
+
187
+ _classPrivateFieldGet(this, _$input).removeEventListener('blur', _classPrivateFieldGet(this, _onInputBlur));
188
+
189
+ this.removeEventListener('-change', _classPrivateFieldGet(this, _onChangeReactHandler));
190
+ this.removeEventListener('-focus', _classPrivateFieldGet(this, _onFocusReactHandler));
191
+ this.removeEventListener('-blur', _classPrivateFieldGet(this, _onBlurReactHandler));
138
192
  }
139
193
 
140
194
  static get observedAttributes() {
@@ -13,7 +13,9 @@ export declare type TSinchTextareaElement = HTMLElement & {
13
13
  selectionDirection: HTMLTextAreaElement['selectionDirection'];
14
14
  rows: HTMLTextAreaElement['rows'];
15
15
  resizable: boolean;
16
- addEventListener(type: 'change', listener: (e: CustomEvent<string>) => void): void;
16
+ addEventListener(type: '-change', listener: (e: CustomEvent<string>) => void): void;
17
+ addEventListener(type: '-focus', listener: (e: CustomEvent<void>) => void): void;
18
+ addEventListener(type: '-blur', listener: (e: CustomEvent<void>) => void): void;
17
19
  setAttribute(name: 'value', value: string): void;
18
20
  setAttribute(name: 'label', value: string): void;
19
21
  setAttribute(name: 'placeholder', value: string): void;
@@ -35,5 +37,8 @@ export declare type TSinchTextareaReact = TSinchElementReact<TSinchTextareaEleme
35
37
  'aria-label': string;
36
38
  rows?: number;
37
39
  resizable?: boolean;
38
- onChange: (e: SyntheticEvent<TSinchTextareaElement, CustomEvent<string>>) => void;
40
+ onChange?: (e: SyntheticEvent<TSinchTextareaElement, CustomEvent<string>>) => void;
41
+ 'on-change'?: (e: CustomEvent<string>) => void;
42
+ 'on-focus'?: (e: CustomEvent<void>) => void;
43
+ 'on-blur'?: (e: CustomEvent<void>) => void;
39
44
  };
@@ -0,0 +1,11 @@
1
+ import type { TSinchTileControlElement, TSinchTileControlReact } from './types';
2
+ declare global {
3
+ namespace JSX {
4
+ interface IntrinsicElements {
5
+ 'sinch-tile-control': TSinchTileControlReact;
6
+ }
7
+ }
8
+ interface HTMLElementTagNameMap {
9
+ 'sinch-tile-control': TSinchTileControlElement;
10
+ }
11
+ }