-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Provider): rewrite to TypeScript (#1436)
* feat(Provider): rewrite to TypeScript * Update packages/dnb-eufemia/src/components/form-row/FormRowHelpers.tsx Co-authored-by: Anders <anderslangseth@gmail.com> * Update packages/dnb-eufemia/src/components/form-row/FormRowHelpers.tsx Co-authored-by: Anders <anderslangseth@gmail.com> Co-authored-by: Anders <anderslangseth@gmail.com>
- Loading branch information
1 parent
a535b94
commit 66416d9
Showing
13 changed files
with
358 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/dnb-eufemia/src/components/form-row/FormRowHelpers.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { isTrue } from '../../shared/component-helper' | ||
|
||
type FormRowProps = { | ||
label_direction?: 'vertical' | 'horizontal' | ||
vertical?: string | boolean | ||
} | ||
|
||
export const prepareFormRowContext = (props: FormRowProps) => { | ||
if (typeof props.label_direction === 'undefined') { | ||
props.label_direction = isTrue(props.vertical) | ||
? 'vertical' | ||
: props.label_direction | ||
} | ||
return props | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// to replace icon names | ||
export const iconCase = (name) => | ||
name | ||
.replace(/((?!^)[A-Z])/g, '_$1') | ||
.toLowerCase() | ||
.replace(/^[0-9]/g, '$1') | ||
.replace(/[^a-z0-9_]/gi, '_') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.