@fluentui/react-utilities 9.9.1 → 9.9.3

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 (172) hide show
  1. package/CHANGELOG.json +31 -1
  2. package/CHANGELOG.md +20 -2
  3. package/dist/index.d.ts +1 -1
  4. package/lib/compose/constants.js +1 -2
  5. package/lib/compose/constants.js.map +1 -1
  6. package/lib/compose/getSlots.js +40 -36
  7. package/lib/compose/getSlots.js.map +1 -1
  8. package/lib/compose/getSlotsNext.js +30 -28
  9. package/lib/compose/getSlotsNext.js.map +1 -1
  10. package/lib/compose/index.js +0 -1
  11. package/lib/compose/index.js.map +1 -1
  12. package/lib/compose/isResolvedShorthand.js +2 -4
  13. package/lib/compose/isResolvedShorthand.js.map +1 -1
  14. package/lib/compose/resolveShorthand.js +21 -26
  15. package/lib/compose/resolveShorthand.js.map +1 -1
  16. package/lib/compose/types.js +0 -1
  17. package/lib/compose/types.js.map +1 -1
  18. package/lib/events/index.js +0 -1
  19. package/lib/events/index.js.map +1 -1
  20. package/lib/events/mouseTouchHelpers.js +27 -27
  21. package/lib/events/mouseTouchHelpers.js.map +1 -1
  22. package/lib/hooks/index.js +0 -1
  23. package/lib/hooks/index.js.map +1 -1
  24. package/lib/hooks/useControllableState.js +55 -42
  25. package/lib/hooks/useControllableState.js.map +1 -1
  26. package/lib/hooks/useEventCallback.js +15 -13
  27. package/lib/hooks/useEventCallback.js.map +1 -1
  28. package/lib/hooks/useFirstMount.js +7 -9
  29. package/lib/hooks/useFirstMount.js.map +1 -1
  30. package/lib/hooks/useForceUpdate.js +2 -4
  31. package/lib/hooks/useForceUpdate.js.map +1 -1
  32. package/lib/hooks/useId.js +32 -29
  33. package/lib/hooks/useId.js.map +1 -1
  34. package/lib/hooks/useIsomorphicLayoutEffect.js +1 -2
  35. package/lib/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  36. package/lib/hooks/useMergedRefs.js +17 -18
  37. package/lib/hooks/useMergedRefs.js.map +1 -1
  38. package/lib/hooks/useOnClickOutside.js +110 -114
  39. package/lib/hooks/useOnClickOutside.js.map +1 -1
  40. package/lib/hooks/useOnScrollOutside.js +25 -29
  41. package/lib/hooks/useOnScrollOutside.js.map +1 -1
  42. package/lib/hooks/usePrevious.js +8 -8
  43. package/lib/hooks/usePrevious.js.map +1 -1
  44. package/lib/hooks/useScrollbarWidth.js +24 -26
  45. package/lib/hooks/useScrollbarWidth.js.map +1 -1
  46. package/lib/hooks/useTimeout.js +22 -19
  47. package/lib/hooks/useTimeout.js.map +1 -1
  48. package/lib/index.js +0 -1
  49. package/lib/index.js.map +1 -1
  50. package/lib/ssr/SSRContext.js +40 -39
  51. package/lib/ssr/SSRContext.js.map +1 -1
  52. package/lib/ssr/canUseDOM.js +3 -5
  53. package/lib/ssr/canUseDOM.js.map +1 -1
  54. package/lib/ssr/index.js +0 -1
  55. package/lib/ssr/index.js.map +1 -1
  56. package/lib/trigger/applyTriggerPropsToChildren.js +20 -23
  57. package/lib/trigger/applyTriggerPropsToChildren.js.map +1 -1
  58. package/lib/trigger/getTriggerChild.js +7 -10
  59. package/lib/trigger/getTriggerChild.js.map +1 -1
  60. package/lib/trigger/index.js +0 -1
  61. package/lib/trigger/index.js.map +1 -1
  62. package/lib/trigger/isFluentTrigger.js +2 -4
  63. package/lib/trigger/isFluentTrigger.js.map +1 -1
  64. package/lib/trigger/types.js +0 -1
  65. package/lib/trigger/types.js.map +1 -1
  66. package/lib/utils/clamp.js +1 -2
  67. package/lib/utils/clamp.js.map +1 -1
  68. package/lib/utils/getNativeElementProps.js +38 -40
  69. package/lib/utils/getNativeElementProps.js.map +1 -1
  70. package/lib/utils/getRTLSafeKey.js +12 -13
  71. package/lib/utils/getRTLSafeKey.js.map +1 -1
  72. package/lib/utils/getReactCallbackName.js +16 -15
  73. package/lib/utils/getReactCallbackName.js.map +1 -1
  74. package/lib/utils/index.js +0 -1
  75. package/lib/utils/index.js.map +1 -1
  76. package/lib/utils/isHTMLElement.js +5 -6
  77. package/lib/utils/isHTMLElement.js.map +1 -1
  78. package/lib/utils/isInteractiveHTMLElement.js +13 -17
  79. package/lib/utils/isInteractiveHTMLElement.js.map +1 -1
  80. package/lib/utils/mergeCallbacks.js +5 -6
  81. package/lib/utils/mergeCallbacks.js.map +1 -1
  82. package/lib/utils/omit.js +7 -8
  83. package/lib/utils/omit.js.map +1 -1
  84. package/lib/utils/priorityQueue.js +85 -86
  85. package/lib/utils/priorityQueue.js.map +1 -1
  86. package/lib/utils/properties.js +292 -80
  87. package/lib/utils/properties.js.map +1 -1
  88. package/lib-commonjs/compose/constants.js +1 -3
  89. package/lib-commonjs/compose/constants.js.map +1 -1
  90. package/lib-commonjs/compose/getSlots.js +1 -3
  91. package/lib-commonjs/compose/getSlots.js.map +1 -1
  92. package/lib-commonjs/compose/getSlotsNext.js +2 -3
  93. package/lib-commonjs/compose/getSlotsNext.js.map +1 -1
  94. package/lib-commonjs/compose/index.js +0 -3
  95. package/lib-commonjs/compose/index.js.map +1 -1
  96. package/lib-commonjs/compose/isResolvedShorthand.js +1 -3
  97. package/lib-commonjs/compose/isResolvedShorthand.js.map +1 -1
  98. package/lib-commonjs/compose/resolveShorthand.js +1 -3
  99. package/lib-commonjs/compose/resolveShorthand.js.map +1 -1
  100. package/lib-commonjs/compose/types.js +0 -3
  101. package/lib-commonjs/compose/types.js.map +1 -1
  102. package/lib-commonjs/events/index.js +0 -3
  103. package/lib-commonjs/events/index.js.map +1 -1
  104. package/lib-commonjs/events/mouseTouchHelpers.js +1 -3
  105. package/lib-commonjs/events/mouseTouchHelpers.js.map +1 -1
  106. package/lib-commonjs/hooks/index.js +0 -3
  107. package/lib-commonjs/hooks/index.js.map +1 -1
  108. package/lib-commonjs/hooks/useControllableState.js +1 -3
  109. package/lib-commonjs/hooks/useControllableState.js.map +1 -1
  110. package/lib-commonjs/hooks/useEventCallback.js +1 -3
  111. package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
  112. package/lib-commonjs/hooks/useFirstMount.js +1 -3
  113. package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
  114. package/lib-commonjs/hooks/useForceUpdate.js +1 -3
  115. package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
  116. package/lib-commonjs/hooks/useId.js +1 -3
  117. package/lib-commonjs/hooks/useId.js.map +1 -1
  118. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js +1 -3
  119. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  120. package/lib-commonjs/hooks/useMergedRefs.js +2 -5
  121. package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
  122. package/lib-commonjs/hooks/useOnClickOutside.js +1 -3
  123. package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
  124. package/lib-commonjs/hooks/useOnScrollOutside.js +1 -3
  125. package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
  126. package/lib-commonjs/hooks/usePrevious.js +1 -3
  127. package/lib-commonjs/hooks/usePrevious.js.map +1 -1
  128. package/lib-commonjs/hooks/useScrollbarWidth.js +2 -4
  129. package/lib-commonjs/hooks/useScrollbarWidth.js.map +1 -1
  130. package/lib-commonjs/hooks/useTimeout.js +1 -3
  131. package/lib-commonjs/hooks/useTimeout.js.map +1 -1
  132. package/lib-commonjs/index.js +0 -3
  133. package/lib-commonjs/index.js.map +1 -1
  134. package/lib-commonjs/ssr/SSRContext.js +1 -3
  135. package/lib-commonjs/ssr/SSRContext.js.map +1 -1
  136. package/lib-commonjs/ssr/canUseDOM.js +1 -3
  137. package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
  138. package/lib-commonjs/ssr/index.js +0 -3
  139. package/lib-commonjs/ssr/index.js.map +1 -1
  140. package/lib-commonjs/trigger/applyTriggerPropsToChildren.js +1 -3
  141. package/lib-commonjs/trigger/applyTriggerPropsToChildren.js.map +1 -1
  142. package/lib-commonjs/trigger/getTriggerChild.js +2 -5
  143. package/lib-commonjs/trigger/getTriggerChild.js.map +1 -1
  144. package/lib-commonjs/trigger/index.js +0 -3
  145. package/lib-commonjs/trigger/index.js.map +1 -1
  146. package/lib-commonjs/trigger/isFluentTrigger.js +1 -3
  147. package/lib-commonjs/trigger/isFluentTrigger.js.map +1 -1
  148. package/lib-commonjs/trigger/types.js +0 -3
  149. package/lib-commonjs/trigger/types.js.map +1 -1
  150. package/lib-commonjs/utils/clamp.js +1 -3
  151. package/lib-commonjs/utils/clamp.js.map +1 -1
  152. package/lib-commonjs/utils/getNativeElementProps.js +1 -3
  153. package/lib-commonjs/utils/getNativeElementProps.js.map +1 -1
  154. package/lib-commonjs/utils/getRTLSafeKey.js +1 -3
  155. package/lib-commonjs/utils/getRTLSafeKey.js.map +1 -1
  156. package/lib-commonjs/utils/getReactCallbackName.js +1 -3
  157. package/lib-commonjs/utils/getReactCallbackName.js.map +1 -1
  158. package/lib-commonjs/utils/index.js +0 -3
  159. package/lib-commonjs/utils/index.js.map +1 -1
  160. package/lib-commonjs/utils/isHTMLElement.js +1 -3
  161. package/lib-commonjs/utils/isHTMLElement.js.map +1 -1
  162. package/lib-commonjs/utils/isInteractiveHTMLElement.js +1 -3
  163. package/lib-commonjs/utils/isInteractiveHTMLElement.js.map +1 -1
  164. package/lib-commonjs/utils/mergeCallbacks.js +1 -3
  165. package/lib-commonjs/utils/mergeCallbacks.js.map +1 -1
  166. package/lib-commonjs/utils/omit.js +1 -3
  167. package/lib-commonjs/utils/omit.js.map +1 -1
  168. package/lib-commonjs/utils/priorityQueue.js +5 -7
  169. package/lib-commonjs/utils/priorityQueue.js.map +1 -1
  170. package/lib-commonjs/utils/properties.js +30 -31
  171. package/lib-commonjs/utils/properties.js.map +1 -1
  172. package/package.json +1 -1
@@ -1,166 +1,380 @@
1
- const toObjectMap = (...items) => {
2
- const result = {};
3
- for (const item of items) {
4
- const keys = Array.isArray(item) ? item : Object.keys(item);
5
- for (const key of keys) {
6
- result[key] = 1;
1
+ const toObjectMap = (...items)=>{
2
+ const result = {};
3
+ for (const item of items){
4
+ const keys = Array.isArray(item) ? item : Object.keys(item);
5
+ for (const key of keys){
6
+ result[key] = 1;
7
+ }
7
8
  }
8
- }
9
- return result;
9
+ return result;
10
10
  };
11
11
  /**
12
12
  * An array of events that are allowed on every html element type.
13
13
  *
14
14
  * @public
15
- */
16
- export const baseElementEvents = /*#__PURE__*/toObjectMap(['onAuxClick', 'onCopy', 'onCut', 'onPaste', 'onCompositionEnd', 'onCompositionStart', 'onCompositionUpdate', 'onFocus', 'onFocusCapture', 'onBlur', 'onBlurCapture', 'onChange', 'onInput', 'onSubmit', 'onLoad', 'onError', 'onKeyDown', 'onKeyDownCapture', 'onKeyPress', 'onKeyUp', 'onAbort', 'onCanPlay', 'onCanPlayThrough', 'onDurationChange', 'onEmptied', 'onEncrypted', 'onEnded', 'onLoadedData', 'onLoadedMetadata', 'onLoadStart', 'onPause', 'onPlay', 'onPlaying', 'onProgress', 'onRateChange', 'onSeeked', 'onSeeking', 'onStalled', 'onSuspend', 'onTimeUpdate', 'onVolumeChange', 'onWaiting', 'onClick', 'onClickCapture', 'onContextMenu', 'onDoubleClick', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseDownCapture', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onMouseUpCapture', 'onSelect', 'onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'onScroll', 'onWheel', 'onPointerCancel', 'onPointerDown', 'onPointerEnter', 'onPointerLeave', 'onPointerMove', 'onPointerOut', 'onPointerOver', 'onPointerUp', 'onGotPointerCapture', 'onLostPointerCapture']);
15
+ */ export const baseElementEvents = toObjectMap([
16
+ 'onAuxClick',
17
+ 'onAnimationEnd',
18
+ 'onAnimationStart',
19
+ 'onCopy',
20
+ 'onCut',
21
+ 'onPaste',
22
+ 'onCompositionEnd',
23
+ 'onCompositionStart',
24
+ 'onCompositionUpdate',
25
+ 'onFocus',
26
+ 'onFocusCapture',
27
+ 'onBlur',
28
+ 'onBlurCapture',
29
+ 'onChange',
30
+ 'onInput',
31
+ 'onSubmit',
32
+ 'onLoad',
33
+ 'onError',
34
+ 'onKeyDown',
35
+ 'onKeyDownCapture',
36
+ 'onKeyPress',
37
+ 'onKeyUp',
38
+ 'onAbort',
39
+ 'onCanPlay',
40
+ 'onCanPlayThrough',
41
+ 'onDurationChange',
42
+ 'onEmptied',
43
+ 'onEncrypted',
44
+ 'onEnded',
45
+ 'onLoadedData',
46
+ 'onLoadedMetadata',
47
+ 'onLoadStart',
48
+ 'onPause',
49
+ 'onPlay',
50
+ 'onPlaying',
51
+ 'onProgress',
52
+ 'onRateChange',
53
+ 'onSeeked',
54
+ 'onSeeking',
55
+ 'onStalled',
56
+ 'onSuspend',
57
+ 'onTimeUpdate',
58
+ 'onVolumeChange',
59
+ 'onWaiting',
60
+ 'onClick',
61
+ 'onClickCapture',
62
+ 'onContextMenu',
63
+ 'onDoubleClick',
64
+ 'onDrag',
65
+ 'onDragEnd',
66
+ 'onDragEnter',
67
+ 'onDragExit',
68
+ 'onDragLeave',
69
+ 'onDragOver',
70
+ 'onDragStart',
71
+ 'onDrop',
72
+ 'onMouseDown',
73
+ 'onMouseDownCapture',
74
+ 'onMouseEnter',
75
+ 'onMouseLeave',
76
+ 'onMouseMove',
77
+ 'onMouseOut',
78
+ 'onMouseOver',
79
+ 'onMouseUp',
80
+ 'onMouseUpCapture',
81
+ 'onSelect',
82
+ 'onTouchCancel',
83
+ 'onTouchEnd',
84
+ 'onTouchMove',
85
+ 'onTouchStart',
86
+ 'onScroll',
87
+ 'onWheel',
88
+ 'onPointerCancel',
89
+ 'onPointerDown',
90
+ 'onPointerEnter',
91
+ 'onPointerLeave',
92
+ 'onPointerMove',
93
+ 'onPointerOut',
94
+ 'onPointerOver',
95
+ 'onPointerUp',
96
+ 'onGotPointerCapture',
97
+ 'onLostPointerCapture'
98
+ ]);
17
99
  /**
18
100
  * An array of element attributes which are allowed on every html element type.
19
101
  *
20
102
  * @public
21
- */
22
- export const baseElementProperties = /*#__PURE__*/toObjectMap(['accessKey', 'children', 'className', 'contentEditable', 'dir', 'draggable', 'hidden', 'htmlFor', 'id', 'lang', 'ref', 'role', 'style', 'tabIndex', 'title', 'translate', 'spellCheck', 'name']);
103
+ */ export const baseElementProperties = toObjectMap([
104
+ 'accessKey',
105
+ 'children',
106
+ 'className',
107
+ 'contentEditable',
108
+ 'dir',
109
+ 'draggable',
110
+ 'hidden',
111
+ 'htmlFor',
112
+ 'id',
113
+ 'lang',
114
+ 'ref',
115
+ 'role',
116
+ 'style',
117
+ 'tabIndex',
118
+ 'title',
119
+ 'translate',
120
+ 'spellCheck',
121
+ 'name'
122
+ ]);
23
123
  /**
24
124
  * An array of microdata attributes that are allowed on every html element type.
25
125
  *
26
126
  * @public
27
- */
28
- export const microdataProperties = /*#__PURE__*/toObjectMap(['itemID', 'itemProp', 'itemRef', 'itemScope', 'itemType']);
127
+ */ export const microdataProperties = toObjectMap([
128
+ 'itemID',
129
+ 'itemProp',
130
+ 'itemRef',
131
+ 'itemScope',
132
+ 'itemType'
133
+ ]);
29
134
  /**
30
135
  * An array of HTML element properties and events.
31
136
  *
32
137
  * @public
33
- */
34
- export const htmlElementProperties = /*#__PURE__*/toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);
138
+ */ export const htmlElementProperties = toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);
35
139
  /**
36
140
  * An array of LABEL tag properties and events.
37
141
  *
38
142
  * @public
39
- */
40
- export const labelProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['form']);
143
+ */ export const labelProperties = toObjectMap(htmlElementProperties, [
144
+ 'form'
145
+ ]);
41
146
  /**
42
147
  * An array of AUDIO tag properties and events.
43
148
 
44
149
  * @public
45
- */
46
- export const audioProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['height', 'loop', 'muted', 'preload', 'src', 'width']);
150
+ */ export const audioProperties = toObjectMap(htmlElementProperties, [
151
+ 'height',
152
+ 'loop',
153
+ 'muted',
154
+ 'preload',
155
+ 'src',
156
+ 'width'
157
+ ]);
47
158
  /**
48
159
  * An array of VIDEO tag properties and events.
49
160
  *
50
161
  * @public
51
- */
52
- export const videoProperties = /*#__PURE__*/toObjectMap(audioProperties, ['poster']);
162
+ */ export const videoProperties = toObjectMap(audioProperties, [
163
+ 'poster'
164
+ ]);
53
165
  /**
54
166
  * An array of OL tag properties and events.
55
167
  *
56
168
  * @public
57
- */
58
- export const olProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['start']);
169
+ */ export const olProperties = toObjectMap(htmlElementProperties, [
170
+ 'start'
171
+ ]);
59
172
  /**
60
173
  * An array of LI tag properties and events.
61
174
  *
62
175
  * @public
63
- */
64
- export const liProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['value']);
176
+ */ export const liProperties = toObjectMap(htmlElementProperties, [
177
+ 'value'
178
+ ]);
65
179
  /**
66
180
  * An array of A tag properties and events.
67
181
  *
68
182
  * @public
69
- */
70
- export const anchorProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['download', 'href', 'hrefLang', 'media', 'rel', 'target', 'type']);
183
+ */ export const anchorProperties = toObjectMap(htmlElementProperties, [
184
+ 'download',
185
+ 'href',
186
+ 'hrefLang',
187
+ 'media',
188
+ 'rel',
189
+ 'target',
190
+ 'type'
191
+ ]);
71
192
  /**
72
193
  * An array of TIME tag properties and events.
73
194
  *
74
195
  * @public
75
- */
76
- export const timeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['dateTime']);
196
+ */ export const timeProperties = toObjectMap(htmlElementProperties, [
197
+ 'dateTime'
198
+ ]);
77
199
  /**
78
200
  * An array of BUTTON tag properties and events.
79
201
  *
80
202
  * @public
81
- */
82
- export const buttonProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['autoFocus', 'disabled', 'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'type', 'value']);
203
+ */ export const buttonProperties = toObjectMap(htmlElementProperties, [
204
+ 'autoFocus',
205
+ 'disabled',
206
+ 'form',
207
+ 'formAction',
208
+ 'formEncType',
209
+ 'formMethod',
210
+ 'formNoValidate',
211
+ 'formTarget',
212
+ 'type',
213
+ 'value'
214
+ ]);
83
215
  /**
84
216
  * An array of INPUT tag properties and events.
85
217
  *
86
218
  * @public
87
- */
88
- export const inputProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['accept', 'alt', 'autoCapitalize', 'autoComplete', 'checked', 'dirname', 'form', 'height', 'inputMode', 'list', 'max', 'maxLength', 'min', 'multiple', 'pattern', 'placeholder', 'readOnly', 'required', 'src', 'step', 'size', 'type', 'value', 'width']);
219
+ */ export const inputProperties = toObjectMap(buttonProperties, [
220
+ 'accept',
221
+ 'alt',
222
+ 'autoCapitalize',
223
+ 'autoComplete',
224
+ 'checked',
225
+ 'dirname',
226
+ 'form',
227
+ 'height',
228
+ 'inputMode',
229
+ 'list',
230
+ 'max',
231
+ 'maxLength',
232
+ 'min',
233
+ 'multiple',
234
+ 'pattern',
235
+ 'placeholder',
236
+ 'readOnly',
237
+ 'required',
238
+ 'src',
239
+ 'step',
240
+ 'size',
241
+ 'type',
242
+ 'value',
243
+ 'width'
244
+ ]);
89
245
  /**
90
246
  * An array of TEXTAREA tag properties and events.
91
247
  *
92
248
  * @public
93
- */
94
- export const textAreaProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['autoCapitalize', 'cols', 'dirname', 'form', 'maxLength', 'placeholder', 'readOnly', 'required', 'rows', 'wrap']);
249
+ */ export const textAreaProperties = toObjectMap(buttonProperties, [
250
+ 'autoCapitalize',
251
+ 'cols',
252
+ 'dirname',
253
+ 'form',
254
+ 'maxLength',
255
+ 'placeholder',
256
+ 'readOnly',
257
+ 'required',
258
+ 'rows',
259
+ 'wrap'
260
+ ]);
95
261
  /**
96
262
  * An array of SELECT tag properties and events.
97
263
  *
98
264
  * @public
99
- */
100
- export const selectProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['form', 'multiple', 'required']);
101
- export const optionProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['selected', 'value']);
265
+ */ export const selectProperties = toObjectMap(buttonProperties, [
266
+ 'form',
267
+ 'multiple',
268
+ 'required'
269
+ ]);
270
+ export const optionProperties = toObjectMap(htmlElementProperties, [
271
+ 'selected',
272
+ 'value'
273
+ ]);
102
274
  /**
103
275
  * An array of TABLE tag properties and events.
104
276
  *
105
277
  * @public
106
- */
107
- export const tableProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['cellPadding', 'cellSpacing']);
278
+ */ export const tableProperties = toObjectMap(htmlElementProperties, [
279
+ 'cellPadding',
280
+ 'cellSpacing'
281
+ ]);
108
282
  /**
109
283
  * An array of TR tag properties and events.
110
284
  *
111
285
  * @public
112
- */
113
- export const trProperties = htmlElementProperties;
286
+ */ export const trProperties = htmlElementProperties;
114
287
  /**
115
288
  * An array of TH tag properties and events.
116
289
  *
117
290
  * @public
118
- */
119
- export const thProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['colSpan', 'rowSpan', 'scope']);
291
+ */ export const thProperties = toObjectMap(htmlElementProperties, [
292
+ 'colSpan',
293
+ 'rowSpan',
294
+ 'scope'
295
+ ]);
120
296
  /**
121
297
  * An array of TD tag properties and events.
122
298
  *
123
299
  * @public
124
- */
125
- export const tdProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['colSpan', 'headers', 'rowSpan', 'scope']);
126
- export const colGroupProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span']);
127
- export const colProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span']);
300
+ */ export const tdProperties = toObjectMap(htmlElementProperties, [
301
+ 'colSpan',
302
+ 'headers',
303
+ 'rowSpan',
304
+ 'scope'
305
+ ]);
306
+ export const colGroupProperties = toObjectMap(htmlElementProperties, [
307
+ 'span'
308
+ ]);
309
+ export const colProperties = toObjectMap(htmlElementProperties, [
310
+ 'span'
311
+ ]);
128
312
  /**
129
313
  * An array of FIELDSET tag properties and events.
130
314
  *
131
315
  * @public
132
- */
133
- export const fieldsetProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['disabled', 'form']);
316
+ */ export const fieldsetProperties = toObjectMap(htmlElementProperties, [
317
+ 'disabled',
318
+ 'form'
319
+ ]);
134
320
  /**
135
321
  * An array of FORM tag properties and events.
136
322
  *
137
323
  * @public
138
- */
139
- export const formProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['acceptCharset', 'action', 'encType', 'encType', 'method', 'noValidate', 'target']);
324
+ */ export const formProperties = toObjectMap(htmlElementProperties, [
325
+ 'acceptCharset',
326
+ 'action',
327
+ 'encType',
328
+ 'encType',
329
+ 'method',
330
+ 'noValidate',
331
+ 'target'
332
+ ]);
140
333
  /**
141
334
  * An array of IFRAME tag properties and events.
142
335
  *
143
336
  * @public
144
- */
145
- export const iframeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['allow', 'allowFullScreen', 'allowPaymentRequest', 'allowTransparency', 'csp', 'height', 'importance', 'referrerPolicy', 'sandbox', 'src', 'srcDoc', 'width']);
337
+ */ export const iframeProperties = toObjectMap(htmlElementProperties, [
338
+ 'allow',
339
+ 'allowFullScreen',
340
+ 'allowPaymentRequest',
341
+ 'allowTransparency',
342
+ 'csp',
343
+ 'height',
344
+ 'importance',
345
+ 'referrerPolicy',
346
+ 'sandbox',
347
+ 'src',
348
+ 'srcDoc',
349
+ 'width'
350
+ ]);
146
351
  /**
147
352
  * An array of IMAGE tag properties and events.
148
353
  *
149
354
  * @public
150
- */
151
- export const imgProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['alt', 'crossOrigin', 'height', 'src', 'srcSet', 'useMap', 'width']);
355
+ */ export const imgProperties = toObjectMap(htmlElementProperties, [
356
+ 'alt',
357
+ 'crossOrigin',
358
+ 'height',
359
+ 'src',
360
+ 'srcSet',
361
+ 'useMap',
362
+ 'width'
363
+ ]);
152
364
  /**
153
365
  * An array of DIALOG tag properties and events.
154
366
  *
155
367
  * @public
156
- */
157
- export const dialogProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['open', 'onCancel', 'onClose']);
368
+ */ export const dialogProperties = toObjectMap(htmlElementProperties, [
369
+ 'open',
370
+ 'onCancel',
371
+ 'onClose'
372
+ ]);
158
373
  /**
159
374
  * An array of DIV tag properties and events.
160
375
  *
161
376
  * @public
162
- */
163
- export const divProperties = htmlElementProperties;
377
+ */ export const divProperties = htmlElementProperties;
164
378
  /**
165
379
  * Gets native supported props for an html element provided the allowance set. Use one of the property
166
380
  * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given
@@ -176,25 +390,23 @@ export const divProperties = htmlElementProperties;
176
390
  * @param excludedPropNames
177
391
  * @returns The filtered props
178
392
  */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
179
- export function getNativeProps(
180
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
393
+ export function getNativeProps(// eslint-disable-next-line @typescript-eslint/no-explicit-any
181
394
  props, allowedPropNames, excludedPropNames) {
182
- // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for
183
- // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.
184
- // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then
185
- // return native props.
186
- // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797
187
- const isArray = Array.isArray(allowedPropNames);
188
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
189
- const result = {};
190
- const keys = Object.keys(props);
191
- for (const key of keys) {
192
- const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;
193
- if (isNativeProp && (!excludedPropNames || (excludedPropNames === null || excludedPropNames === void 0 ? void 0 : excludedPropNames.indexOf(key)) === -1)) {
194
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
195
- result[key] = props[key];
395
+ // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for
396
+ // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.
397
+ // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then
398
+ // return native props.
399
+ // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797
400
+ const isArray = Array.isArray(allowedPropNames);
401
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
402
+ const result = {};
403
+ const keys = Object.keys(props);
404
+ for (const key of keys){
405
+ const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;
406
+ if (isNativeProp && (!excludedPropNames || (excludedPropNames === null || excludedPropNames === void 0 ? void 0 : excludedPropNames.indexOf(key)) === -1)) {
407
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
408
+ result[key] = props[key];
409
+ }
196
410
  }
197
- }
198
- return result;
411
+ return result;
199
412
  }
200
- //# sourceMappingURL=properties.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["toObjectMap","items","result","item","keys","Array","isArray","Object","key","baseElementEvents","baseElementProperties","microdataProperties","htmlElementProperties","labelProperties","audioProperties","videoProperties","olProperties","liProperties","anchorProperties","timeProperties","buttonProperties","inputProperties","textAreaProperties","selectProperties","optionProperties","tableProperties","trProperties","thProperties","tdProperties","colGroupProperties","colProperties","fieldsetProperties","formProperties","iframeProperties","imgProperties","dialogProperties","divProperties","getNativeProps","props","allowedPropNames","excludedPropNames","isNativeProp","indexOf"],"sources":["../../src/utils/properties.ts"],"sourcesContent":["const toObjectMap = (...items: (string[] | Record<string, number>)[]) => {\n const result: Record<string, number> = {};\n\n for (const item of items) {\n const keys = Array.isArray(item) ? item : Object.keys(item);\n\n for (const key of keys) {\n result[key] = 1;\n }\n }\n\n return result;\n};\n\n/**\n * An array of events that are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementEvents = toObjectMap([\n 'onAuxClick',\n 'onCopy',\n 'onCut',\n 'onPaste',\n 'onCompositionEnd',\n 'onCompositionStart',\n 'onCompositionUpdate',\n 'onFocus',\n 'onFocusCapture',\n 'onBlur',\n 'onBlurCapture',\n 'onChange',\n 'onInput',\n 'onSubmit',\n 'onLoad',\n 'onError',\n 'onKeyDown',\n 'onKeyDownCapture',\n 'onKeyPress',\n 'onKeyUp',\n 'onAbort',\n 'onCanPlay',\n 'onCanPlayThrough',\n 'onDurationChange',\n 'onEmptied',\n 'onEncrypted',\n 'onEnded',\n 'onLoadedData',\n 'onLoadedMetadata',\n 'onLoadStart',\n 'onPause',\n 'onPlay',\n 'onPlaying',\n 'onProgress',\n 'onRateChange',\n 'onSeeked',\n 'onSeeking',\n 'onStalled',\n 'onSuspend',\n 'onTimeUpdate',\n 'onVolumeChange',\n 'onWaiting',\n 'onClick',\n 'onClickCapture',\n 'onContextMenu',\n 'onDoubleClick',\n 'onDrag',\n 'onDragEnd',\n 'onDragEnter',\n 'onDragExit',\n 'onDragLeave',\n 'onDragOver',\n 'onDragStart',\n 'onDrop',\n 'onMouseDown',\n 'onMouseDownCapture',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onMouseUpCapture',\n 'onSelect',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onScroll',\n 'onWheel',\n 'onPointerCancel',\n 'onPointerDown',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerMove',\n 'onPointerOut',\n 'onPointerOver',\n 'onPointerUp',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n]);\n\n/**\n * An array of element attributes which are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementProperties = toObjectMap([\n 'accessKey', // global\n 'children', // global\n 'className', // global\n 'contentEditable', // global\n 'dir', // global\n 'draggable', // global\n 'hidden', // global\n 'htmlFor', // global\n 'id', // global\n 'lang', // global\n 'ref', // global\n 'role', // global\n 'style', // global\n 'tabIndex', // global\n 'title', // global\n 'translate', // global\n 'spellCheck', // global\n 'name', // global\n]);\n\n/**\n * An array of microdata attributes that are allowed on every html element type.\n *\n * @public\n */\nexport const microdataProperties = toObjectMap([\n 'itemID', // global\n 'itemProp', // global\n 'itemRef', // global\n 'itemScope', // global\n 'itemType', // global\n]);\n\n/**\n * An array of HTML element properties and events.\n *\n * @public\n */\nexport const htmlElementProperties = toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);\n\n/**\n * An array of LABEL tag properties and events.\n *\n * @public\n */\nexport const labelProperties = toObjectMap(htmlElementProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of AUDIO tag properties and events.\n\n * @public\n */\nexport const audioProperties = toObjectMap(htmlElementProperties, [\n 'height', // canvas, embed, iframe, img, input, object, video\n 'loop', // audio, video\n 'muted', // audio, video\n 'preload', // audio, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of VIDEO tag properties and events.\n *\n * @public\n */\nexport const videoProperties = toObjectMap(audioProperties, [\n 'poster', // video\n]);\n\n/**\n * An array of OL tag properties and events.\n *\n * @public\n */\nexport const olProperties = toObjectMap(htmlElementProperties, [\n 'start', // ol\n]);\n\n/**\n * An array of LI tag properties and events.\n *\n * @public\n */\nexport const liProperties = toObjectMap(htmlElementProperties, [\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of A tag properties and events.\n *\n * @public\n */\nexport const anchorProperties = toObjectMap(htmlElementProperties, [\n 'download', // a, area\n 'href', // a, area, base, link\n 'hrefLang', // a, area, link\n 'media', // a, area, link, source, style\n 'rel', // a, area, link\n 'target', // a, area, base, form\n 'type', // a, button, input, link, menu, object, script, source, style\n]);\n\n/**\n * An array of TIME tag properties and events.\n *\n * @public\n */\nexport const timeProperties = toObjectMap(htmlElementProperties, [\n 'dateTime', // time\n]);\n\n/**\n * An array of BUTTON tag properties and events.\n *\n * @public\n */\nexport const buttonProperties = toObjectMap(htmlElementProperties, [\n 'autoFocus', // button, input, select, textarea\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'formAction', // input, button\n 'formEncType', // input, button\n 'formMethod', // input, button\n 'formNoValidate', // input, button\n 'formTarget', // input, button\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param,\n]);\n\n/**\n * An array of INPUT tag properties and events.\n *\n * @public\n */\nexport const inputProperties = toObjectMap(buttonProperties, [\n 'accept', // input\n 'alt', // area, img, input\n 'autoCapitalize', // input, textarea\n 'autoComplete', // form, input\n 'checked', // input\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'height', // canvas, embed, iframe, img, input, object, video\n 'inputMode', // input\n 'list', // input\n 'max', // input, meter\n 'maxLength', // input, textarea\n 'min', // input, meter\n 'multiple', // input, select\n 'pattern', // input\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'step', // input\n 'size', // input\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of TEXTAREA tag properties and events.\n *\n * @public\n */\nexport const textAreaProperties = toObjectMap(buttonProperties, [\n 'autoCapitalize', // input, textarea\n 'cols', // textarea\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'maxLength', // input, textarea\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'rows', // textarea\n 'wrap', // textarea\n]);\n\n/**\n * An array of SELECT tag properties and events.\n *\n * @public\n */\nexport const selectProperties = toObjectMap(buttonProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'multiple', // input, select\n 'required', // input, select, textarea\n]);\n\nexport const optionProperties = toObjectMap(htmlElementProperties, [\n 'selected', // option\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of TABLE tag properties and events.\n *\n * @public\n */\nexport const tableProperties = toObjectMap(htmlElementProperties, [\n 'cellPadding', // table\n 'cellSpacing', // table\n]);\n\n/**\n * An array of TR tag properties and events.\n *\n * @public\n */\nexport const trProperties = htmlElementProperties;\n\n/**\n * An array of TH tag properties and events.\n *\n * @public\n */\nexport const thProperties = toObjectMap(htmlElementProperties, [\n 'colSpan', // td, th\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\n/**\n * An array of TD tag properties and events.\n *\n * @public\n */\nexport const tdProperties = toObjectMap(htmlElementProperties, [\n 'colSpan', // td\n 'headers', // td\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\nexport const colGroupProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\nexport const colProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\n/**\n * An array of FIELDSET tag properties and events.\n *\n * @public\n */\nexport const fieldsetProperties = toObjectMap(htmlElementProperties, [\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of FORM tag properties and events.\n *\n * @public\n */\nexport const formProperties = toObjectMap(htmlElementProperties, [\n 'acceptCharset', // form\n 'action', // form\n 'encType', // form\n 'encType', // form\n 'method', // form\n 'noValidate', // form\n 'target', // form\n]);\n\n/**\n * An array of IFRAME tag properties and events.\n *\n * @public\n */\nexport const iframeProperties = toObjectMap(htmlElementProperties, [\n 'allow', // iframe\n 'allowFullScreen', // iframe\n 'allowPaymentRequest', // iframe\n 'allowTransparency', // iframe\n 'csp', // iframe\n 'height', // canvas, embed, iframe, img, input, object, video\n 'importance', // iframe\n 'referrerPolicy', // iframe\n 'sandbox', // iframe\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcDoc', // iframe\n 'width', // canvas, embed, iframe, img, input, object, video,\n]);\n\n/**\n * An array of IMAGE tag properties and events.\n *\n * @public\n */\nexport const imgProperties = toObjectMap(htmlElementProperties, [\n 'alt', // area, img, input\n 'crossOrigin', // img\n 'height', // canvas, embed, iframe, img, input, object, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcSet', // img, source\n 'useMap', // img, object,\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of DIALOG tag properties and events.\n *\n * @public\n */\nexport const dialogProperties = toObjectMap(htmlElementProperties, ['open', 'onCancel', 'onClose']);\n\n/**\n * An array of DIV tag properties and events.\n *\n * @public\n */\nexport const divProperties = htmlElementProperties;\n\n/**\n * Gets native supported props for an html element provided the allowance set. Use one of the property\n * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given\n * props set. Note that all data- and aria- prefixed attributes will be allowed.\n * NOTE: getNativeProps should always be applied first when adding props to a react component. The\n * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.\n * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to\n * the component after an onClick function is added, then the getNativeProps onClick will override it.\n *\n * @public\n * @param props - The unfiltered input props\n * @param allowedPropNames - The array or record of allowed prop names.\n * @param excludedPropNames\n * @returns The filtered props\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeProps<T extends Record<string, any>>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: Record<string, any>,\n allowedPropNames: string[] | Record<string, number>,\n excludedPropNames?: string[],\n): T {\n // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for\n // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.\n // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then\n // return native props.\n // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797\n\n const isArray = Array.isArray(allowedPropNames);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n const keys = Object.keys(props);\n\n for (const key of keys) {\n const isNativeProp =\n (!isArray && (allowedPropNames as Record<string, number>)[key]) ||\n (isArray && (allowedPropNames as string[]).indexOf(key) >= 0) ||\n key.indexOf('data-') === 0 ||\n key.indexOf('aria-') === 0;\n\n if (isNativeProp && (!excludedPropNames || excludedPropNames?.indexOf(key) === -1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result[key] = props![key] as any;\n }\n }\n\n return result as T;\n}\n"],"mappings":"AAAA,MAAMA,WAAA,GAAcA,CAAC,GAAGC,KAAA,KAAiD;EACvE,MAAMC,MAAA,GAAiC,CAAC;EAExC,KAAK,MAAMC,IAAA,IAAQF,KAAA,EAAO;IACxB,MAAMG,IAAA,GAAOC,KAAA,CAAMC,OAAO,CAACH,IAAA,IAAQA,IAAA,GAAOI,MAAA,CAAOH,IAAI,CAACD,IAAA,CAAK;IAE3D,KAAK,MAAMK,GAAA,IAAOJ,IAAA,EAAM;MACtBF,MAAM,CAACM,GAAA,CAAI,GAAG;IAChB;EACF;EAEA,OAAON,MAAA;AACT;AAEA;;;;;AAKA,OAAO,MAAMO,iBAAA,gBAAoBT,WAAA,CAAY,CAC3C,cACA,UACA,SACA,WACA,oBACA,sBACA,uBACA,WACA,kBACA,UACA,iBACA,YACA,WACA,YACA,UACA,WACA,aACA,oBACA,cACA,WACA,WACA,aACA,oBACA,oBACA,aACA,eACA,WACA,gBACA,oBACA,eACA,WACA,UACA,aACA,cACA,gBACA,YACA,aACA,aACA,aACA,gBACA,kBACA,aACA,WACA,kBACA,iBACA,iBACA,UACA,aACA,eACA,cACA,eACA,cACA,eACA,UACA,eACA,sBACA,gBACA,gBACA,eACA,cACA,eACA,aACA,oBACA,YACA,iBACA,cACA,eACA,gBACA,YACA,WACA,mBACA,iBACA,kBACA,kBACA,iBACA,gBACA,iBACA,eACA,uBACA,uBACD;AAED;;;;;AAKA,OAAO,MAAMU,qBAAA,gBAAwBV,WAAA,CAAY,CAC/C,aACA,YACA,aACA,mBACA,OACA,aACA,UACA,WACA,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;AAED;;;;;AAKA,OAAO,MAAMuB,gBAAA,gBAAmBnC,WAAA,CAAYY,qBAAA,EAAuB,CAAC,QAAQ,YAAY,UAAU;AAElG;;;;;AAKA,OAAO,MAAMwB,aAAA,GAAgBxB,qBAAA;AAE7B;;;;;;;;;;;;;;GAAA,CAeA;AACA,OAAO,SAASyB;AACd;AACAC,KAA0B,EAC1BC,gBAAmD,EACnDC,iBAA4B,EACzB;EACH;EACA;EACA;EACA;EACA;EAEA,MAAMlC,OAAA,GAAUD,KAAA,CAAMC,OAAO,CAACiC,gBAAA;EAC9B;EACA,MAAMrC,MAAA,GAA8B,CAAC;EACrC,MAAME,IAAA,GAAOG,MAAA,CAAOH,IAAI,CAACkC,KAAA;EAEzB,KAAK,MAAM9B,GAAA,IAAOJ,IAAA,EAAM;IACtB,MAAMqC,YAAA,GACJ,CAAEnC,OAAA,IAAWiC,gBAA4C,CAAC/B,GAAA,CAAI,IAC7DF,OAAA,IAAWiC,gBAAC,CAA8BG,OAAO,CAAClC,GAAA,KAAQ,KAC3DA,GAAA,CAAIkC,OAAO,CAAC,aAAa,KACzBlC,GAAA,CAAIkC,OAAO,CAAC,aAAa;IAE3B,IAAID,YAAA,KAAiB,CAACD,iBAAA,IAAqB,CAAAA,iBAAA,aAAAA,iBAAA,uBAAAA,iBAAA,CAAmBE,OAAO,CAAClC,GAAA,OAAS,CAAC,IAAI;MAClF;MACAN,MAAM,CAACM,GAAA,CAAI,GAAG8B,KAAM,CAAC9B,GAAA,CAAI;IAC3B;EACF;EAEA,OAAON,MAAA;AACT"}
1
+ {"version":3,"sources":["properties.ts"],"sourcesContent":["const toObjectMap = (...items: (string[] | Record<string, number>)[]) => {\n const result: Record<string, number> = {};\n\n for (const item of items) {\n const keys = Array.isArray(item) ? item : Object.keys(item);\n\n for (const key of keys) {\n result[key] = 1;\n }\n }\n\n return result;\n};\n\n/**\n * An array of events that are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementEvents = toObjectMap([\n 'onAuxClick',\n 'onAnimationEnd',\n 'onAnimationStart',\n 'onCopy',\n 'onCut',\n 'onPaste',\n 'onCompositionEnd',\n 'onCompositionStart',\n 'onCompositionUpdate',\n 'onFocus',\n 'onFocusCapture',\n 'onBlur',\n 'onBlurCapture',\n 'onChange',\n 'onInput',\n 'onSubmit',\n 'onLoad',\n 'onError',\n 'onKeyDown',\n 'onKeyDownCapture',\n 'onKeyPress',\n 'onKeyUp',\n 'onAbort',\n 'onCanPlay',\n 'onCanPlayThrough',\n 'onDurationChange',\n 'onEmptied',\n 'onEncrypted',\n 'onEnded',\n 'onLoadedData',\n 'onLoadedMetadata',\n 'onLoadStart',\n 'onPause',\n 'onPlay',\n 'onPlaying',\n 'onProgress',\n 'onRateChange',\n 'onSeeked',\n 'onSeeking',\n 'onStalled',\n 'onSuspend',\n 'onTimeUpdate',\n 'onVolumeChange',\n 'onWaiting',\n 'onClick',\n 'onClickCapture',\n 'onContextMenu',\n 'onDoubleClick',\n 'onDrag',\n 'onDragEnd',\n 'onDragEnter',\n 'onDragExit',\n 'onDragLeave',\n 'onDragOver',\n 'onDragStart',\n 'onDrop',\n 'onMouseDown',\n 'onMouseDownCapture',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onMouseUpCapture',\n 'onSelect',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onScroll',\n 'onWheel',\n 'onPointerCancel',\n 'onPointerDown',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerMove',\n 'onPointerOut',\n 'onPointerOver',\n 'onPointerUp',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n]);\n\n/**\n * An array of element attributes which are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementProperties = toObjectMap([\n 'accessKey', // global\n 'children', // global\n 'className', // global\n 'contentEditable', // global\n 'dir', // global\n 'draggable', // global\n 'hidden', // global\n 'htmlFor', // global\n 'id', // global\n 'lang', // global\n 'ref', // global\n 'role', // global\n 'style', // global\n 'tabIndex', // global\n 'title', // global\n 'translate', // global\n 'spellCheck', // global\n 'name', // global\n]);\n\n/**\n * An array of microdata attributes that are allowed on every html element type.\n *\n * @public\n */\nexport const microdataProperties = toObjectMap([\n 'itemID', // global\n 'itemProp', // global\n 'itemRef', // global\n 'itemScope', // global\n 'itemType', // global\n]);\n\n/**\n * An array of HTML element properties and events.\n *\n * @public\n */\nexport const htmlElementProperties = toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);\n\n/**\n * An array of LABEL tag properties and events.\n *\n * @public\n */\nexport const labelProperties = toObjectMap(htmlElementProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of AUDIO tag properties and events.\n\n * @public\n */\nexport const audioProperties = toObjectMap(htmlElementProperties, [\n 'height', // canvas, embed, iframe, img, input, object, video\n 'loop', // audio, video\n 'muted', // audio, video\n 'preload', // audio, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of VIDEO tag properties and events.\n *\n * @public\n */\nexport const videoProperties = toObjectMap(audioProperties, [\n 'poster', // video\n]);\n\n/**\n * An array of OL tag properties and events.\n *\n * @public\n */\nexport const olProperties = toObjectMap(htmlElementProperties, [\n 'start', // ol\n]);\n\n/**\n * An array of LI tag properties and events.\n *\n * @public\n */\nexport const liProperties = toObjectMap(htmlElementProperties, [\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of A tag properties and events.\n *\n * @public\n */\nexport const anchorProperties = toObjectMap(htmlElementProperties, [\n 'download', // a, area\n 'href', // a, area, base, link\n 'hrefLang', // a, area, link\n 'media', // a, area, link, source, style\n 'rel', // a, area, link\n 'target', // a, area, base, form\n 'type', // a, button, input, link, menu, object, script, source, style\n]);\n\n/**\n * An array of TIME tag properties and events.\n *\n * @public\n */\nexport const timeProperties = toObjectMap(htmlElementProperties, [\n 'dateTime', // time\n]);\n\n/**\n * An array of BUTTON tag properties and events.\n *\n * @public\n */\nexport const buttonProperties = toObjectMap(htmlElementProperties, [\n 'autoFocus', // button, input, select, textarea\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'formAction', // input, button\n 'formEncType', // input, button\n 'formMethod', // input, button\n 'formNoValidate', // input, button\n 'formTarget', // input, button\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param,\n]);\n\n/**\n * An array of INPUT tag properties and events.\n *\n * @public\n */\nexport const inputProperties = toObjectMap(buttonProperties, [\n 'accept', // input\n 'alt', // area, img, input\n 'autoCapitalize', // input, textarea\n 'autoComplete', // form, input\n 'checked', // input\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'height', // canvas, embed, iframe, img, input, object, video\n 'inputMode', // input\n 'list', // input\n 'max', // input, meter\n 'maxLength', // input, textarea\n 'min', // input, meter\n 'multiple', // input, select\n 'pattern', // input\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'step', // input\n 'size', // input\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of TEXTAREA tag properties and events.\n *\n * @public\n */\nexport const textAreaProperties = toObjectMap(buttonProperties, [\n 'autoCapitalize', // input, textarea\n 'cols', // textarea\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'maxLength', // input, textarea\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'rows', // textarea\n 'wrap', // textarea\n]);\n\n/**\n * An array of SELECT tag properties and events.\n *\n * @public\n */\nexport const selectProperties = toObjectMap(buttonProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'multiple', // input, select\n 'required', // input, select, textarea\n]);\n\nexport const optionProperties = toObjectMap(htmlElementProperties, [\n 'selected', // option\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of TABLE tag properties and events.\n *\n * @public\n */\nexport const tableProperties = toObjectMap(htmlElementProperties, [\n 'cellPadding', // table\n 'cellSpacing', // table\n]);\n\n/**\n * An array of TR tag properties and events.\n *\n * @public\n */\nexport const trProperties = htmlElementProperties;\n\n/**\n * An array of TH tag properties and events.\n *\n * @public\n */\nexport const thProperties = toObjectMap(htmlElementProperties, [\n 'colSpan', // td, th\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\n/**\n * An array of TD tag properties and events.\n *\n * @public\n */\nexport const tdProperties = toObjectMap(htmlElementProperties, [\n 'colSpan', // td\n 'headers', // td\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\nexport const colGroupProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\nexport const colProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\n/**\n * An array of FIELDSET tag properties and events.\n *\n * @public\n */\nexport const fieldsetProperties = toObjectMap(htmlElementProperties, [\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of FORM tag properties and events.\n *\n * @public\n */\nexport const formProperties = toObjectMap(htmlElementProperties, [\n 'acceptCharset', // form\n 'action', // form\n 'encType', // form\n 'encType', // form\n 'method', // form\n 'noValidate', // form\n 'target', // form\n]);\n\n/**\n * An array of IFRAME tag properties and events.\n *\n * @public\n */\nexport const iframeProperties = toObjectMap(htmlElementProperties, [\n 'allow', // iframe\n 'allowFullScreen', // iframe\n 'allowPaymentRequest', // iframe\n 'allowTransparency', // iframe\n 'csp', // iframe\n 'height', // canvas, embed, iframe, img, input, object, video\n 'importance', // iframe\n 'referrerPolicy', // iframe\n 'sandbox', // iframe\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcDoc', // iframe\n 'width', // canvas, embed, iframe, img, input, object, video,\n]);\n\n/**\n * An array of IMAGE tag properties and events.\n *\n * @public\n */\nexport const imgProperties = toObjectMap(htmlElementProperties, [\n 'alt', // area, img, input\n 'crossOrigin', // img\n 'height', // canvas, embed, iframe, img, input, object, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcSet', // img, source\n 'useMap', // img, object,\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of DIALOG tag properties and events.\n *\n * @public\n */\nexport const dialogProperties = toObjectMap(htmlElementProperties, ['open', 'onCancel', 'onClose']);\n\n/**\n * An array of DIV tag properties and events.\n *\n * @public\n */\nexport const divProperties = htmlElementProperties;\n\n/**\n * Gets native supported props for an html element provided the allowance set. Use one of the property\n * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given\n * props set. Note that all data- and aria- prefixed attributes will be allowed.\n * NOTE: getNativeProps should always be applied first when adding props to a react component. The\n * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.\n * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to\n * the component after an onClick function is added, then the getNativeProps onClick will override it.\n *\n * @public\n * @param props - The unfiltered input props\n * @param allowedPropNames - The array or record of allowed prop names.\n * @param excludedPropNames\n * @returns The filtered props\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeProps<T extends Record<string, any>>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: Record<string, any>,\n allowedPropNames: string[] | Record<string, number>,\n excludedPropNames?: string[],\n): T {\n // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for\n // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.\n // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then\n // return native props.\n // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797\n\n const isArray = Array.isArray(allowedPropNames);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n const keys = Object.keys(props);\n\n for (const key of keys) {\n const isNativeProp =\n (!isArray && (allowedPropNames as Record<string, number>)[key]) ||\n (isArray && (allowedPropNames as string[]).indexOf(key) >= 0) ||\n key.indexOf('data-') === 0 ||\n key.indexOf('aria-') === 0;\n\n if (isNativeProp && (!excludedPropNames || excludedPropNames?.indexOf(key) === -1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result[key] = props![key] as any;\n }\n }\n\n return result as T;\n}\n"],"names":["toObjectMap","items","result","item","keys","Array","isArray","Object","key","baseElementEvents","baseElementProperties","microdataProperties","htmlElementProperties","labelProperties","audioProperties","videoProperties","olProperties","liProperties","anchorProperties","timeProperties","buttonProperties","inputProperties","textAreaProperties","selectProperties","optionProperties","tableProperties","trProperties","thProperties","tdProperties","colGroupProperties","colProperties","fieldsetProperties","formProperties","iframeProperties","imgProperties","dialogProperties","divProperties","getNativeProps","props","allowedPropNames","excludedPropNames","isNativeProp","indexOf"],"mappings":"AAAA,MAAMA,cAAc,CAAC,GAAGC,QAAiD;IACvE,MAAMC,SAAiC,CAAC;IAExC,KAAK,MAAMC,QAAQF,MAAO;QACxB,MAAMG,OAAOC,MAAMC,OAAO,CAACH,QAAQA,OAAOI,OAAOH,IAAI,CAACD,KAAK;QAE3D,KAAK,MAAMK,OAAOJ,KAAM;YACtBF,MAAM,CAACM,IAAI,GAAG;QAChB;IACF;IAEA,OAAON;AACT;AAEA;;;;CAIC,GACD,OAAO,MAAMO,oBAAoBT,YAAY;IAC3C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;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E;AAEH;;;;CAIC,GACD,OAAO,MAAMuB,mBAAmBnC,YAAYY,uBAAuB;IAAC;IAAQ;IAAY;CAAU,EAAE;AAEpG;;;;CAIC,GACD,OAAO,MAAMwB,gBAAgBxB,sBAAsB;AAEnD;;;;;;;;;;;;;;CAcC,GACD,8DAA8D;AAC9D,OAAO,SAASyB,eACd,8DAA8D;AAC9DC,KAA0B,EAC1BC,gBAAmD,EACnDC,iBAA4B,EACzB;IACH,6GAA6G;IAC7G,2GAA2G;IAC3G,2GAA2G;IAC3G,uBAAuB;IACvB,0GAA0G;IAE1G,MAAMlC,UAAUD,MAAMC,OAAO,CAACiC;IAC9B,8DAA8D;IAC9D,MAAMrC,SAA8B,CAAC;IACrC,MAAME,OAAOG,OAAOH,IAAI,CAACkC;IAEzB,KAAK,MAAM9B,OAAOJ,KAAM;QACtB,MAAMqC,eACJ,AAAC,CAACnC,WAAW,AAACiC,gBAA2C,CAAC/B,IAAI,IAC7DF,WAAW,AAACiC,iBAA8BG,OAAO,CAAClC,QAAQ,KAC3DA,IAAIkC,OAAO,CAAC,aAAa,KACzBlC,IAAIkC,OAAO,CAAC,aAAa;QAE3B,IAAID,gBAAiB,CAAA,CAACD,qBAAqBA,CAAAA,8BAAAA,+BAAAA,KAAAA,IAAAA,kBAAmBE,OAAO,CAAClC,UAAS,CAAC,CAAA,GAAI;YAClF,8DAA8D;YAC9DN,MAAM,CAACM,IAAI,GAAG8B,KAAM,CAAC9B,IAAI;QAC3B,CAAC;IACH;IAEA,OAAON;AACT,CAAC"}
@@ -9,6 +9,4 @@ Object.defineProperty(exports, "SLOT_RENDER_FUNCTION_SYMBOL", {
9
9
  enumerable: true,
10
10
  get: ()=>SLOT_RENDER_FUNCTION_SYMBOL
11
11
  });
12
- const SLOT_RENDER_FUNCTION_SYMBOL = /*#__PURE__*/ Symbol('fui.slotRenderFunction'); //# sourceMappingURL=constants.js.map
13
-
14
- //# sourceMappingURL=constants.js.map
12
+ const SLOT_RENDER_FUNCTION_SYMBOL = Symbol('fui.slotRenderFunction');
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/compose/constants.js"],"sourcesContent":["/**\n * @internal\n * Internal reference for the render function\n */export const SLOT_RENDER_FUNCTION_SYMBOL = /*#__PURE__*/Symbol('fui.slotRenderFunction');\n//# sourceMappingURL=constants.js.map"],"names":["SLOT_RENDER_FUNCTION_SYMBOL","Symbol"],"mappings":"AAAA;;;CAGC;;;;+BAAeA;;aAAAA;;AAAN,MAAMA,8BAA8B,WAAW,GAAEC,OAAO,2BAClE,qCAAqC"}
1
+ {"version":3,"sources":["constants.js"],"sourcesContent":["/**\n * @internal\n * Internal reference for the render function\n */ export const SLOT_RENDER_FUNCTION_SYMBOL = Symbol('fui.slotRenderFunction');\n"],"names":["SLOT_RENDER_FUNCTION_SYMBOL","Symbol"],"mappings":"AAAA;;;CAGC;;;;+BAAgBA;;aAAAA;;AAAN,MAAMA,8BAA8BC,OAAO"}
@@ -52,6 +52,4 @@ function getSlot(state, slotName) {
52
52
  slot,
53
53
  slotProps
54
54
  ];
55
- } //# sourceMappingURL=getSlots.js.map
56
-
57
- //# sourceMappingURL=getSlots.js.map
55
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/compose/getSlots.js"],"sourcesContent":["import * as React from 'react';\nimport { omit } from '../utils/omit';\nimport { SLOT_RENDER_FUNCTION_SYMBOL } from './constants';\n/**\n * Given the state and an array of slot names, will break out `slots` and `slotProps`\n * collections.\n *\n * The root is derived from a mix of `components` props and `as` prop.\n *\n * Slots will render as null if they are rendered as primitives with undefined children.\n *\n * The slotProps will always omit the `as` prop within them, and for slots that are string\n * primitives, the props will be filtered according to the slot type by the type system.\n * For example, if the slot is rendered `as: 'a'`, the props will be filtered for acceptable\n * anchor props. Note that this is only enforced at build time by Typescript -- there is no\n * runtime code filtering props in this function.\n *\n * @param state - State including slot definitions\n * @returns An object containing the `slots` map and `slotProps` map.\n */\nexport function getSlots(state) {\n const slots = {};\n const slotProps = {};\n const slotNames = Object.keys(state.components);\n for (const slotName of slotNames) {\n const [slot, props] = getSlot(state, slotName);\n slots[slotName] = slot;\n slotProps[slotName] = props;\n }\n return {\n slots,\n slotProps: slotProps\n };\n}\nfunction getSlot(state, slotName) {\n var _state_components, _state_components1;\n const props = state[slotName];\n if (props === undefined) {\n return [null, undefined];\n }\n const {\n children,\n as: asProp,\n [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction,\n ...rest\n } = props;\n const slot = ((_state_components = state.components) === null || _state_components === void 0 ? void 0 : _state_components[slotName]) === undefined || typeof state.components[slotName] === 'string' ? asProp || ((_state_components1 = state.components) === null || _state_components1 === void 0 ? void 0 : _state_components1[slotName]) || 'div' : state.components[slotName];\n if (renderFunction || typeof children === 'function') {\n const render = renderFunction || children;\n return [React.Fragment, {\n children: render(slot, rest)\n }];\n }\n const shouldOmitAsProp = typeof slot === 'string' && asProp;\n const slotProps = shouldOmitAsProp ? omit(props, ['as']) : props;\n return [slot, slotProps];\n}\n//# sourceMappingURL=getSlots.js.map"],"names":["getSlots","state","slots","slotProps","slotNames","Object","keys","components","slotName","slot","props","getSlot","_state_components","_state_components1","undefined","children","as","asProp","SLOT_RENDER_FUNCTION_SYMBOL","renderFunction","rest","render","React","Fragment","shouldOmitAsProp","omit"],"mappings":";;;;+BAoBgBA;;aAAAA;;;6DApBO;sBACF;2BACuB;AAkBrC,SAASA,SAASC,KAAK,EAAE;IAC9B,MAAMC,QAAQ,CAAC;IACf,MAAMC,YAAY,CAAC;IACnB,MAAMC,YAAYC,OAAOC,IAAI,CAACL,MAAMM,UAAU;IAC9C,KAAK,MAAMC,YAAYJ,UAAW;QAChC,MAAM,CAACK,MAAMC,MAAM,GAAGC,QAAQV,OAAOO;QACrCN,KAAK,CAACM,SAAS,GAAGC;QAClBN,SAAS,CAACK,SAAS,GAAGE;IACxB;IACA,OAAO;QACLR;QACAC,WAAWA;IACb;AACF;AACA,SAASQ,QAAQV,KAAK,EAAEO,QAAQ,EAAE;IAChC,IAAII,mBAAmBC;IACvB,MAAMH,QAAQT,KAAK,CAACO,SAAS;IAC7B,IAAIE,UAAUI,WAAW;QACvB,OAAO;YAAC,IAAI;YAAEA;SAAU;IAC1B,CAAC;IACD,MAAM,EACJC,SAAQ,EACRC,IAAIC,OAAM,EACV,CAACC,sCAA2B,CAAC,EAAEC,eAAc,EAC7C,GAAGC,MACJ,GAAGV;IACJ,MAAMD,OAAO,AAAC,CAAA,AAACG,CAAAA,oBAAoBX,MAAMM,UAAU,AAAD,MAAO,IAAI,IAAIK,sBAAsB,KAAK,IAAI,KAAK,IAAIA,iBAAiB,CAACJ,SAAS,AAAD,MAAOM,aAAa,OAAOb,MAAMM,UAAU,CAACC,SAAS,KAAK,WAAWS,UAAW,CAAA,AAACJ,CAAAA,qBAAqBZ,MAAMM,UAAU,AAAD,MAAO,IAAI,IAAIM,uBAAuB,KAAK,IAAI,KAAK,IAAIA,kBAAkB,CAACL,SAAS,AAAD,KAAM,QAAQP,MAAMM,UAAU,CAACC,SAAS;IACnX,IAAIW,kBAAkB,OAAOJ,aAAa,YAAY;QACpD,MAAMM,SAASF,kBAAkBJ;QACjC,OAAO;YAACO,OAAMC,QAAQ;YAAE;gBACtBR,UAAUM,OAAOZ,MAAMW;YACzB;SAAE;IACJ,CAAC;IACD,MAAMI,mBAAmB,OAAOf,SAAS,YAAYQ;IACrD,MAAMd,YAAYqB,mBAAmBC,IAAAA,UAAI,EAACf,OAAO;QAAC;KAAK,IAAIA,KAAK;IAChE,OAAO;QAACD;QAAMN;KAAU;AAC1B,EACA,oCAAoC"}
1
+ {"version":3,"sources":["getSlots.js"],"sourcesContent":["import * as React from 'react';\nimport { omit } from '../utils/omit';\nimport { SLOT_RENDER_FUNCTION_SYMBOL } from './constants';\n/**\n * Given the state and an array of slot names, will break out `slots` and `slotProps`\n * collections.\n *\n * The root is derived from a mix of `components` props and `as` prop.\n *\n * Slots will render as null if they are rendered as primitives with undefined children.\n *\n * The slotProps will always omit the `as` prop within them, and for slots that are string\n * primitives, the props will be filtered according to the slot type by the type system.\n * For example, if the slot is rendered `as: 'a'`, the props will be filtered for acceptable\n * anchor props. Note that this is only enforced at build time by Typescript -- there is no\n * runtime code filtering props in this function.\n *\n * @param state - State including slot definitions\n * @returns An object containing the `slots` map and `slotProps` map.\n */ export function getSlots(state) {\n const slots = {};\n const slotProps = {};\n const slotNames = Object.keys(state.components);\n for (const slotName of slotNames){\n const [slot, props] = getSlot(state, slotName);\n slots[slotName] = slot;\n slotProps[slotName] = props;\n }\n return {\n slots,\n slotProps: slotProps\n };\n}\nfunction getSlot(state, slotName) {\n var _state_components, _state_components1;\n const props = state[slotName];\n if (props === undefined) {\n return [\n null,\n undefined\n ];\n }\n const { children , as: asProp , [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction , ...rest } = props;\n const slot = ((_state_components = state.components) === null || _state_components === void 0 ? void 0 : _state_components[slotName]) === undefined || typeof state.components[slotName] === 'string' ? asProp || ((_state_components1 = state.components) === null || _state_components1 === void 0 ? void 0 : _state_components1[slotName]) || 'div' : state.components[slotName];\n if (renderFunction || typeof children === 'function') {\n const render = renderFunction || children;\n return [\n React.Fragment,\n {\n children: render(slot, rest)\n }\n ];\n }\n const shouldOmitAsProp = typeof slot === 'string' && asProp;\n const slotProps = shouldOmitAsProp ? omit(props, [\n 'as'\n ]) : props;\n return [\n slot,\n slotProps\n ];\n}\n"],"names":["getSlots","state","slots","slotProps","slotNames","Object","keys","components","slotName","slot","props","getSlot","_state_components","_state_components1","undefined","children","as","asProp","SLOT_RENDER_FUNCTION_SYMBOL","renderFunction","rest","render","React","Fragment","shouldOmitAsProp","omit"],"mappings":";;;;+BAmBoBA;;aAAAA;;;6DAnBG;sBACF;2BACuB;AAiBjC,SAASA,SAASC,KAAK,EAAE;IAChC,MAAMC,QAAQ,CAAC;IACf,MAAMC,YAAY,CAAC;IACnB,MAAMC,YAAYC,OAAOC,IAAI,CAACL,MAAMM,UAAU;IAC9C,KAAK,MAAMC,YAAYJ,UAAU;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