-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component specs #4297
Merged
Merged
Component specs #4297
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
5256f93
chore(html): change html package infrastucture to support new jsx specs
TeyaVes 449116b
chore(html): merge icon html rendering and hierarchy specs
TeyaVes cfcb254
chore(html): merge button html rendering and hierarchy specs
TeyaVes d5efcba
chore(html): merge input html rendering and hierarchy specs
TeyaVes 737739c
chore(html): merge textbox html rendering and hierarchy specs
TeyaVes b2c68a9
chore(html): merge spinbutton html rendering and hierarchy specs
TeyaVes dd5f9b7
chore(html): merge numerictextbox html rendering and hierarchy specs
TeyaVes 642feb5
chore(html): merge textarea html rendering and hierarchy specs
TeyaVes fc03704
chore(html): merge maskedtextbox html rendering and hierarchy specs
TeyaVes 4202eca
chore(html): merge combobox html rendering and hierarchy specs
TeyaVes 4b709bc
chore(html): merge action-buttons html rendering and hierarchy specs
TeyaVes 621cbfd
chore(html): merge split-button html rendering and hierarchy specs
TeyaVes 8cfc647
chore(html): merge checkbox html rendering and hierarchy specs
TeyaVes 1b5ca85
chore(html): merge radio html rendering and hierarchy specs
TeyaVes 4bff171
chore(html): merge switch html rendering and hierarchy specs
TeyaVes df3971a
chore(html): merge avatar html rendering and hierarchy specs
TeyaVes 18edf2c
chore(html): merge chip html rendering and hierarchy specs
TeyaVes c121d24
chore(html): merge multiselect html rendering and hierarchy specs
TeyaVes c79e953
chore(html): merge picker html rendering and hierarchy specs
TeyaVes e2f2148
chore(html): merge dropdownlist html rendering and hierarchy specs
TeyaVes 09b4ee0
chore(html): merge button-group html rendering and hierarchy specs
TeyaVes 7225139
chore(html): merge list html rendering and hierarchy specs
TeyaVes 8bf1bcb
chore(html): merge popup html rendering and hierarchy specs
TeyaVes 0106404
chore(html): define component options as const
TeyaVes c211ba0
chore(html): merge floating-label html rendering and hierarchy specs
TeyaVes e13386f
chore(html): merge date-input html rendering and hierarchy specs
TeyaVes 055266e
chore(html): merge datepicker html rendering and hierarchy specs
TeyaVes b5270ad
chore(html): merge datetimepicker html rendering and hierarchy specs
TeyaVes e02777e
chore(html): merge daterangepicker html rendering and hierarchy specs
TeyaVes 3dcf55f
chore(html): merge timepicker html rendering and hierarchy specs
TeyaVes b555341
chore(html): merge autocomplete html rendering and hierarchy specs
TeyaVes 56222be
chore(html): add opened state and dropdowns to inputs
TeyaVes b027057
chore(html): merge badge html rendering and hierarchy specs
TeyaVes 5911f49
chore(html): merge treeview html rendering and hierarchy specs
TeyaVes 658cd5c
chore(html): merge dropdowntree html rendering and hierarchy specs
TeyaVes 437b245
chore(html): merge calendar html rendering and hierarchy specs
TeyaVes d2cbc88
chore(html): merge multiviewcalendar html rendering and hierarchy specs
TeyaVes 6b89d39
chore(html): merge timeselector html rendering and hierarchy specs
TeyaVes 1d5ea27
chore(html): merge datetimeselector html rendering and hierarchy specs
TeyaVes 7c35a70
chore(html): add opened state and dropdowns to datepickers
TeyaVes 71737db
chore(html): merge window html rendering and hierarchy specs
TeyaVes ec52a49
chore(html): merge dialog html rendering and hierarchy specs
TeyaVes a62aa8c
chore(html): merge menu and menu-button html rendering and hierarchy …
TeyaVes baa151e
chore(html): merge dropdowngrid html rendering and hierarchy specs
TeyaVes 1dab71a
chore(html): merge timedurationpicker html rendering and hierarchy specs
TeyaVes 751f764
chore(html): merge searchbox html rendering and hierarchy specs
TeyaVes 8d8b6a2
chore(html): merge loader html rendering and hierarchy specs
TeyaVes 6b62f36
chore(html): merge pager html rendering and hierarchy specs
TeyaVes d183768
chore(html): merge listview html rendering and hierarchy specs
TeyaVes 5830e58
chore(html): merge fab html rendering and hierarchy specs
TeyaVes 6f7ce79
chore(html): merge notification html rendering and hierarchy specs
TeyaVes 05181f4
chore(html): merge appbar html rendering and hierarchy specs
TeyaVes 614346e
chore(html): merge progressbar html rendering and hierarchy specs
TeyaVes 2e0a2dd
chore(html): merge captcha html rendering and hierarchy specs
TeyaVes 1aeb5cd
chore(html): merge toolbar html rendering and hierarchy specs
TeyaVes 891fee7
chore(html): merge colorpicker, colorpalette and colorpreview html re…
TeyaVes eb6671e
chore(html): merge card html rendering and hierarchy specs
TeyaVes 0287043
chore(html): merge popover html rendering and hierarchy specs
TeyaVes 184262a
chore(html): merge orgchart html rendering and hierarchy specs
TeyaVes 010380c
chore(html): merge upload html rendering and hierarchy specs
TeyaVes a1ec9e0
chore(html): merge typography html rendering and hierarchy specs
TeyaVes 65bcd82
chore(html): merge action-sheet html rendering and hierarchy specs
TeyaVes cb13ace
chore(html): merge searchbar html rendering and hierarchy specs
TeyaVes 767ac36
chore(html): merge editor html rendering and hierarchy specs
TeyaVes 41ce0ee
chore(html): merge nodata html rendering and hierarchy specs
TeyaVes 87afb44
chore(html): merge listbox html rendering and hierarchy specs
TeyaVes ba57d73
chore(html): merge signature html rendering and hierarchy specs
TeyaVes fc93401
chore(html): merge layout html rendering and hierarchy specs
TeyaVes 63d691b
chore(html): replace old utils with utils-new
TeyaVes c33b92f
chore(html): remove react import from visual tests
TeyaVes ab5c641
chore(html): move opened dropdown tests to new files
TeyaVes 8fb8fb0
chore(html): merge table html rendering and hierarchy specs
TeyaVes b3fa505
chore(html): remove html helpers readme files
TeyaVes 56f53fe
chore(html): add readonly state to inputs and pickers
TeyaVes 67b53e5
chore(html): allow usage of a custom palette in colorPalette spec
TeyaVes 99b6cdc
chore: update visual previews
kendo-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { classNames } from '../utils'; | ||
|
||
export const ACTIONBUTTONS_CLASSNAME = `k-actions`; | ||
|
||
const states = []; | ||
|
||
const options = {}; | ||
|
||
export type KendoActionButtonsProps = { | ||
alignment?: 'start' | 'center' | 'end' | 'stretched'; | ||
orientation?: 'horizontal' | 'vertical'; | ||
}; | ||
|
||
const defaultProps = { | ||
alignment: 'start', | ||
orientation: 'horizontal' | ||
}; | ||
|
||
export const ActionButtons = ( | ||
props: KendoActionButtonsProps & | ||
React.HTMLAttributes<HTMLDivElement> | ||
) => { | ||
const { | ||
alignment = defaultProps.alignment, | ||
orientation = defaultProps.orientation, | ||
...other | ||
} = props; | ||
|
||
return ( | ||
<div | ||
{...other} | ||
className={classNames( | ||
ACTIONBUTTONS_CLASSNAME, | ||
{ | ||
[`${ACTIONBUTTONS_CLASSNAME}-${alignment}`]: alignment, | ||
[`${ACTIONBUTTONS_CLASSNAME}-${orientation}`]: orientation | ||
}, | ||
props.className | ||
)}> | ||
{props.children} | ||
</div> | ||
); | ||
}; | ||
|
||
ActionButtons.states = states; | ||
ActionButtons.options = options; | ||
ActionButtons.className = ACTIONBUTTONS_CLASSNAME; | ||
|
||
export default ActionButtons; |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './action-buttons'; | ||
export * from './action-buttons.spec'; |
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,123 @@ | ||
import { classNames } from '../utils'; | ||
import { ActionSheetHeader, ActionSheetItems, ActionSheetFooter } from '../action-sheet'; | ||
|
||
export const ACTIONSHEET_CLASSNAME = `k-actionsheet`; | ||
|
||
const states = []; | ||
|
||
const options = {}; | ||
|
||
export type KendoActionSheetProps = { | ||
children: JSX.Element | JSX.Element[], | ||
title?: string; | ||
header?: typeof ActionSheetHeader; | ||
footer?: string | typeof ActionSheetFooter; | ||
actions?: string[]; | ||
fullscreen?: boolean; | ||
adaptive?: boolean; | ||
side?: 'top' | 'right' | 'bottom' | 'left'; | ||
} | ||
|
||
const defaultProps = { | ||
side: 'bottom', | ||
fullscreen: false, | ||
adaptive: false | ||
}; | ||
|
||
// eslint-disable-next-line complexity | ||
export const ActionSheet = ( | ||
props: KendoActionSheetProps & | ||
React.HTMLAttributes<HTMLDivElement> | ||
) => { | ||
const { | ||
children, | ||
title, | ||
header, | ||
footer, | ||
actions, | ||
side = defaultProps.side, | ||
fullscreen = defaultProps.fullscreen, | ||
adaptive = defaultProps.adaptive, | ||
...other | ||
} = props; | ||
|
||
// eslint-disable-next-line no-nested-ternary | ||
const _ActionSheetHeader = title | ||
? <ActionSheetHeader title={title} /> | ||
: header | ||
? header | ||
: Array.isArray(children) && children.find((child) => child.type === ActionSheetHeader); | ||
|
||
// eslint-disable-next-line no-nested-ternary | ||
const _ActionSheetFooter = actions | ||
? <ActionSheetFooter className="k-actions" actions={actions} /> | ||
// eslint-disable-next-line no-nested-ternary | ||
: footer | ||
? typeof footer === 'string' | ||
? <ActionSheetFooter>{footer}</ActionSheetFooter> | ||
: footer | ||
: Array.isArray(children) && children.find((child) => child.type === ActionSheetFooter); | ||
|
||
// eslint-disable-next-line no-nested-ternary | ||
const _ActionSheetContent = Array.isArray(children) | ||
? children.filter(child => { | ||
switch (child.type) { | ||
case ActionSheetHeader: | ||
case ActionSheetFooter: | ||
return false; | ||
default: | ||
return true; | ||
} | ||
return true; | ||
}) | ||
: children.type === ActionSheetItems | ||
? children | ||
: <></>; | ||
|
||
return ( | ||
<div className="k-actionsheet-container"> | ||
<div className="k-overlay"></div> | ||
<div className="k-animation-container"> | ||
<div className="k-child-animation-container" | ||
style={{ | ||
[`${ fullscreen === true ? 'top' : side }`]: 0, | ||
[`${ fullscreen === true ? 'width' : null }`]: '100%', | ||
[`${ fullscreen === true ? 'height' : null }`]: '100%', | ||
[`${ side === 'top' || side === 'bottom' ? 'width' : null }`]: '100%', | ||
[`${ side === 'left' || side === 'right' ? 'height' : null }`]: '100%' | ||
}}> | ||
<div | ||
{...other} | ||
className={classNames( | ||
props.className, | ||
ACTIONSHEET_CLASSNAME, | ||
{ | ||
[`k-actionsheet-${side}`]: fullscreen === false, | ||
'k-actionsheet-fullscreen': fullscreen === true, | ||
'k-adaptive-actionsheet': adaptive | ||
}, | ||
)}> | ||
<> | ||
{_ActionSheetHeader} | ||
<div className={classNames( | ||
'k-actionsheet-content', | ||
{ | ||
'!k-overflow-hidden': adaptive | ||
} | ||
)}> | ||
{_ActionSheetContent} | ||
</div> | ||
{_ActionSheetFooter} | ||
</> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
ActionSheet.states = states; | ||
ActionSheet.options = options; | ||
ActionSheet.className = ACTIONSHEET_CLASSNAME; | ||
|
||
export default ActionSheet; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this based on the current implementation of the
ActionSheet
?Let's revisit this at a later stage. Overall I would advocate against different rendering modes based on the children or their type (e.g.
string
vscomponent
). Seems to be present in multiple components (e.g. List, Page, OrgChart)