Skip to content
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 76 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
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 Feb 17, 2023
449116b
chore(html): merge icon html rendering and hierarchy specs
TeyaVes Feb 17, 2023
cfcb254
chore(html): merge button html rendering and hierarchy specs
TeyaVes Feb 17, 2023
d5efcba
chore(html): merge input html rendering and hierarchy specs
TeyaVes Feb 17, 2023
737739c
chore(html): merge textbox html rendering and hierarchy specs
TeyaVes Feb 17, 2023
b2c68a9
chore(html): merge spinbutton html rendering and hierarchy specs
TeyaVes Feb 17, 2023
dd5f9b7
chore(html): merge numerictextbox html rendering and hierarchy specs
TeyaVes Feb 17, 2023
642feb5
chore(html): merge textarea html rendering and hierarchy specs
TeyaVes Feb 20, 2023
fc03704
chore(html): merge maskedtextbox html rendering and hierarchy specs
TeyaVes Feb 20, 2023
4202eca
chore(html): merge combobox html rendering and hierarchy specs
TeyaVes Feb 20, 2023
4b709bc
chore(html): merge action-buttons html rendering and hierarchy specs
TeyaVes Feb 20, 2023
621cbfd
chore(html): merge split-button html rendering and hierarchy specs
TeyaVes Feb 20, 2023
8cfc647
chore(html): merge checkbox html rendering and hierarchy specs
TeyaVes Feb 20, 2023
1b5ca85
chore(html): merge radio html rendering and hierarchy specs
TeyaVes Feb 20, 2023
4bff171
chore(html): merge switch html rendering and hierarchy specs
TeyaVes Feb 21, 2023
df3971a
chore(html): merge avatar html rendering and hierarchy specs
TeyaVes Feb 22, 2023
18edf2c
chore(html): merge chip html rendering and hierarchy specs
TeyaVes Feb 22, 2023
c121d24
chore(html): merge multiselect html rendering and hierarchy specs
TeyaVes Feb 23, 2023
c79e953
chore(html): merge picker html rendering and hierarchy specs
TeyaVes Feb 23, 2023
e2f2148
chore(html): merge dropdownlist html rendering and hierarchy specs
TeyaVes Feb 23, 2023
09b4ee0
chore(html): merge button-group html rendering and hierarchy specs
TeyaVes Feb 27, 2023
7225139
chore(html): merge list html rendering and hierarchy specs
TeyaVes Feb 28, 2023
8bf1bcb
chore(html): merge popup html rendering and hierarchy specs
TeyaVes Feb 28, 2023
0106404
chore(html): define component options as const
TeyaVes Mar 1, 2023
c211ba0
chore(html): merge floating-label html rendering and hierarchy specs
TeyaVes Mar 7, 2023
e13386f
chore(html): merge date-input html rendering and hierarchy specs
TeyaVes Mar 7, 2023
055266e
chore(html): merge datepicker html rendering and hierarchy specs
TeyaVes Mar 7, 2023
b5270ad
chore(html): merge datetimepicker html rendering and hierarchy specs
TeyaVes Mar 7, 2023
e02777e
chore(html): merge daterangepicker html rendering and hierarchy specs
TeyaVes Mar 7, 2023
3dcf55f
chore(html): merge timepicker html rendering and hierarchy specs
TeyaVes Mar 7, 2023
b555341
chore(html): merge autocomplete html rendering and hierarchy specs
TeyaVes Mar 7, 2023
56222be
chore(html): add opened state and dropdowns to inputs
TeyaVes Mar 7, 2023
b027057
chore(html): merge badge html rendering and hierarchy specs
TeyaVes Mar 7, 2023
5911f49
chore(html): merge treeview html rendering and hierarchy specs
TeyaVes Mar 9, 2023
658cd5c
chore(html): merge dropdowntree html rendering and hierarchy specs
TeyaVes Mar 9, 2023
437b245
chore(html): merge calendar html rendering and hierarchy specs
TeyaVes Mar 10, 2023
d2cbc88
chore(html): merge multiviewcalendar html rendering and hierarchy specs
TeyaVes Mar 10, 2023
6b89d39
chore(html): merge timeselector html rendering and hierarchy specs
TeyaVes Mar 13, 2023
1d5ea27
chore(html): merge datetimeselector html rendering and hierarchy specs
TeyaVes Mar 13, 2023
7c35a70
chore(html): add opened state and dropdowns to datepickers
TeyaVes Mar 10, 2023
71737db
chore(html): merge window html rendering and hierarchy specs
TeyaVes Mar 13, 2023
ec52a49
chore(html): merge dialog html rendering and hierarchy specs
TeyaVes Mar 13, 2023
a62aa8c
chore(html): merge menu and menu-button html rendering and hierarchy …
TeyaVes Mar 13, 2023
baa151e
chore(html): merge dropdowngrid html rendering and hierarchy specs
TeyaVes Mar 13, 2023
1dab71a
chore(html): merge timedurationpicker html rendering and hierarchy specs
TeyaVes Mar 13, 2023
751f764
chore(html): merge searchbox html rendering and hierarchy specs
TeyaVes Mar 14, 2023
8d8b6a2
chore(html): merge loader html rendering and hierarchy specs
TeyaVes Mar 14, 2023
6b62f36
chore(html): merge pager html rendering and hierarchy specs
TeyaVes Mar 14, 2023
d183768
chore(html): merge listview html rendering and hierarchy specs
TeyaVes Mar 14, 2023
5830e58
chore(html): merge fab html rendering and hierarchy specs
TeyaVes Mar 14, 2023
6f7ce79
chore(html): merge notification html rendering and hierarchy specs
TeyaVes Mar 14, 2023
05181f4
chore(html): merge appbar html rendering and hierarchy specs
TeyaVes Mar 14, 2023
614346e
chore(html): merge progressbar html rendering and hierarchy specs
TeyaVes Mar 14, 2023
2e0a2dd
chore(html): merge captcha html rendering and hierarchy specs
TeyaVes Mar 14, 2023
1aeb5cd
chore(html): merge toolbar html rendering and hierarchy specs
TeyaVes Mar 14, 2023
891fee7
chore(html): merge colorpicker, colorpalette and colorpreview html re…
TeyaVes Mar 15, 2023
eb6671e
chore(html): merge card html rendering and hierarchy specs
TeyaVes Mar 15, 2023
0287043
chore(html): merge popover html rendering and hierarchy specs
TeyaVes Mar 15, 2023
184262a
chore(html): merge orgchart html rendering and hierarchy specs
TeyaVes Mar 15, 2023
010380c
chore(html): merge upload html rendering and hierarchy specs
TeyaVes Mar 16, 2023
a1ec9e0
chore(html): merge typography html rendering and hierarchy specs
TeyaVes Mar 16, 2023
65bcd82
chore(html): merge action-sheet html rendering and hierarchy specs
TeyaVes Mar 16, 2023
cb13ace
chore(html): merge searchbar html rendering and hierarchy specs
TeyaVes Mar 16, 2023
767ac36
chore(html): merge editor html rendering and hierarchy specs
TeyaVes Mar 16, 2023
41ce0ee
chore(html): merge nodata html rendering and hierarchy specs
TeyaVes Mar 20, 2023
87afb44
chore(html): merge listbox html rendering and hierarchy specs
TeyaVes Mar 20, 2023
ba57d73
chore(html): merge signature html rendering and hierarchy specs
TeyaVes Mar 20, 2023
fc93401
chore(html): merge layout html rendering and hierarchy specs
TeyaVes Mar 20, 2023
63d691b
chore(html): replace old utils with utils-new
TeyaVes Mar 20, 2023
c33b92f
chore(html): remove react import from visual tests
TeyaVes Mar 20, 2023
ab5c641
chore(html): move opened dropdown tests to new files
TeyaVes Mar 20, 2023
8fb8fb0
chore(html): merge table html rendering and hierarchy specs
TeyaVes Mar 29, 2023
b3fa505
chore(html): remove html helpers readme files
TeyaVes Mar 29, 2023
56f53fe
chore(html): add readonly state to inputs and pickers
TeyaVes Apr 4, 2023
67b53e5
chore(html): allow usage of a custom palette in colorPalette spec
TeyaVes Apr 4, 2023
99b6cdc
chore: update visual previews
kendo-bot Apr 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
Expand Down
2 changes: 2 additions & 0 deletions packages/default/scss/calendar/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@

// RTL
.k-rtl .k-calendar,
[dir="rtl"] .k-calendar,
.k-calendar.k-rtl,
.k-calendar[dir="rtl"] {

.k-calendar-nav-prev,
Expand Down
13 changes: 5 additions & 8 deletions packages/default/scss/datetimepicker/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,14 @@
transform: translateX(-100%);
}


// RTL
.k-datetimepicker {
.k-time-tab .k-datetime-selector {
&.k-rtl,
&[dir="rtl"],
.k-rtl & {
.k-time-tab .k-datetime-selector {
transform: translateX(100%);
}
.k-rtl &,
[dir="rtl"] & {
transform: translateX(100%);
}
}

}


Expand Down
2 changes: 2 additions & 0 deletions packages/default/scss/treeview/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@

// RTL
.k-rtl .k-treeview,
[dir="rtl"] .k-treeview,
.k-treeview.k-rtl,
.k-treeview[dir="rtl"] {

// Treeview item
Expand Down
2 changes: 2 additions & 0 deletions packages/fluent/scss/calendar/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@

// RTL
.k-rtl .k-calendar,
[dir="rtl"] .k-calendar,
.k-calendar.k-rtl,
.k-calendar[dir="rtl"] {

.k-calendar-nav-prev,
Expand Down
10 changes: 5 additions & 5 deletions packages/fluent/scss/datetimepicker/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
transform: translateX(-100%);
}

k-datetimepicker {
.k-time-tab .k-datetime-selector {
&.k-rtl,
&[dir="rtl"],
.k-rtl & {
.k-time-tab .k-datetime-selector {
transform: translateX(100%);
}
.k-rtl &,
[dir="rtl"] & {
transform: translateX(100%);
}
}
}
2 changes: 1 addition & 1 deletion packages/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"scripts": {
"build": "node ./scripts/build.js",
"build:tests": "node ./scripts/build-tests.js",
"check-types": "npx tsc src/index.ts --noEmit --emitDeclarationOnly false --jsx react",
"check-types": "npx tsc src/index.ts --noEmit --emitDeclarationOnly false --jsx react-jsx",
"prepublishOnly": "npm run build"
},
"dependencies": {
Expand Down
49 changes: 49 additions & 0 deletions packages/html/src/action-buttons/action-buttons.spec.tsx
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;
43 changes: 0 additions & 43 deletions packages/html/src/action-buttons/action-buttons.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/html/src/action-buttons/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './action-buttons';
export * from './action-buttons.spec';
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { ActionButtons } from '../../action-buttons';
import { Button } from '../../button';
Expand Down
123 changes: 123 additions & 0 deletions packages/html/src/action-sheet/action-sheet.spec.tsx
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
: <></>;
Comment on lines +44 to +75
Copy link
Contributor

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 vs component). Seems to be present in multiple components (e.g. List, Page, OrgChart)


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;
Loading