-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea145f7
commit 5ba8015
Showing
22 changed files
with
580 additions
and
265 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,24 @@ | ||
import { isDependentString } from '../../dependent/utils' | ||
|
||
/** | ||
* In order to support dependent value from the repeater, we have | ||
* to render the title as an element so that it's wrapped inside | ||
* a new dependent wrapper that can access repeater values | ||
*/ | ||
const renderTitle = (item, i, title, name, renderItem) => { | ||
|
||
const text = title ? title : ('Item ' + (i + 1)) | ||
|
||
if( ! isDependentString(text) ) return text; | ||
|
||
const element = { | ||
type : 'wrapper', | ||
name : `_repeater-title-${name}-${item.key}`, | ||
content : title, | ||
dependent : true | ||
} | ||
|
||
return renderItem(element, item, i) | ||
} | ||
|
||
export { renderTitle } |
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 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
Oops, something went wrong.