Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F123336488
createWithBsPrefix.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jul 26, 16:14
Size
953 B
Mime Type
text/x-java
Expires
Mon, Jul 28, 16:14 (2 d)
Engine
blob
Format
Raw Data
Handle
27667573
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
createWithBsPrefix.js
View Options
import
classNames
from
'classnames'
;
import
camelize
from
'dom-helpers/camelize'
;
import
*
as
React
from
'react'
;
import
{
useBootstrapPrefix
}
from
'./ThemeProvider'
;
import
{
jsx
as
_jsx
}
from
"react/jsx-runtime"
;
const
pascalCase
=
str
=>
str
[
0
].
toUpperCase
()
+
camelize
(
str
).
slice
(
1
);
// TODO: emstricten & fix the typing here! `createWithBsPrefix<TElementType>...`
export
default
function
createWithBsPrefix
(
prefix
,
{
displayName
=
pascalCase
(
prefix
),
Component
,
defaultProps
}
=
{})
{
const
BsComponent
=
/*#__PURE__*/
React
.
forwardRef
(({
className
,
bsPrefix
,
as
:
Tag
=
Component
||
'div'
,
...
props
},
ref
)
=>
{
const
resolvedPrefix
=
useBootstrapPrefix
(
bsPrefix
,
prefix
);
return
/*#__PURE__*/
_jsx
(
Tag
,
{
ref
:
ref
,
className
:
classNames
(
className
,
resolvedPrefix
),
...
props
});
});
BsComponent
.
defaultProps
=
defaultProps
;
BsComponent
.
displayName
=
displayName
;
return
BsComponent
;
}
Event Timeline
Log In to Comment