|
1 |
| -"use strict"; |
| 1 | +import React from "react"; |
2 | 2 |
|
3 |
| -const React = require("react"); |
| 3 | +export function mergeStyles(styles) { |
| 4 | + return Object.assign.apply(null, [{}].concat(styles)); |
| 5 | +} |
4 | 6 |
|
5 |
| -exports.mergeStyles = (styles) => |
6 |
| - Object.assign.apply(null, [{}].concat(styles)); |
7 |
| - |
8 |
| -exports.unsafeCreateDOMComponent_ = (createElement) => (el) => { |
9 |
| - const flattenDataProp = (props, ref) => { |
10 |
| - var data = null; |
11 |
| - if (props._data != null) { |
12 |
| - data = { _data: undefined }; |
13 |
| - Object.entries(props._data).forEach(function (entry) { |
14 |
| - data["data-" + entry[0]] = entry[1]; |
15 |
| - }); |
16 |
| - } |
17 |
| - var aria = null; |
18 |
| - if (props._aria != null) { |
19 |
| - aria = { _aria: undefined }; |
20 |
| - Object.entries(props._aria).forEach(function (entry) { |
21 |
| - aria["aria-" + entry[0]] = entry[1]; |
22 |
| - }); |
23 |
| - } |
24 |
| - return Object.assign({ ref }, props, data, aria); |
25 |
| - }; |
26 |
| - return () => { |
27 |
| - const c = React.forwardRef((props, ref) => |
28 |
| - createElement(el)(flattenDataProp(props, ref)) |
29 |
| - ); |
30 |
| - c.displayName = el; |
31 |
| - return c; |
| 7 | +export function unsafeCreateDOMComponent_(createElement) { |
| 8 | + return (el) => { |
| 9 | + const flattenDataProp = (props, ref) => { |
| 10 | + var data = null; |
| 11 | + if (props._data != null) { |
| 12 | + data = { _data: undefined }; |
| 13 | + Object.entries(props._data).forEach(function (entry) { |
| 14 | + data["data-" + entry[0]] = entry[1]; |
| 15 | + }); |
| 16 | + } |
| 17 | + var aria = null; |
| 18 | + if (props._aria != null) { |
| 19 | + aria = { _aria: undefined }; |
| 20 | + Object.entries(props._aria).forEach(function (entry) { |
| 21 | + aria["aria-" + entry[0]] = entry[1]; |
| 22 | + }); |
| 23 | + } |
| 24 | + return Object.assign({ ref }, props, data, aria); |
| 25 | + }; |
| 26 | + return () => { |
| 27 | + const c = React.forwardRef((props, ref) => |
| 28 | + createElement(el)(flattenDataProp(props, ref)) |
| 29 | + ); |
| 30 | + c.displayName = el; |
| 31 | + return c; |
| 32 | + }; |
32 | 33 | };
|
33 |
| -}; |
| 34 | +} |
0 commit comments