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

remove zIndex property from props and use increment for that #779

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'develop' into z-index-property
dzonidoo committed Jun 27, 2023
commit d9c3d0b77ef6f35ecb8b67d249597804b0786048
4 changes: 2 additions & 2 deletions app-typescript/components/Modal.tsx
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import * as React from 'react';
import { Dialog as PrimeDialog } from '@superdesk/primereact/dialog';
import classNames from 'classnames';
import {getNextZIndex} from './../zIndex';
import {noop} from 'lodash';

interface IProps {
id?: string;
@@ -18,7 +19,6 @@ interface IProps {
maximizable?: boolean;
headerTemplate?: JSX.Element | string;
footerTemplate?: JSX.Element | string;
closeOnEscape?: boolean;
onShow?(): void;
onHide?(): void;
}
@@ -47,8 +47,8 @@ export class Modal extends React.Component<IProps, {}> {
maximizable={this.props.maximizable}
contentClassName={classes}
onShow={this.props.onShow}
onHide={this.props.onHide}
zIndex={this.zIndex}
onHide={this.props.onHide ?? noop}
position={this.props.position}
closable={this.props.onHide != null ? true : false}
>
38 changes: 6 additions & 32 deletions app-typescript/components/MultiSelect.tsx
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@ import classNames from 'classnames';
import nextId from "react-id-generator";
import { InputWrapper } from "./Form";
import {getNextZIndex} from '../zIndex';
import {IInputWrapper} from './Form/InputWrapper';
import {SelectPreview} from './SelectPreview';

interface IProps<T> extends IInputWrapper {
value: Array<T>;
@@ -62,37 +64,9 @@ export class MultiSelect<T> extends React.Component<IProps<T>, IState<T>> {

return (
<InputWrapper
label={this.props.label}
error={this.props.error}
required={this.props.required}
disabled={this.props.disabled}
invalid={this.state.invalid}
info={this.props.info}
inlineLabel={this.props.inlineLabel}
labelHidden={this.props.labelHidden}
fullWidth={this.props.fullWidth}
htmlId={this.htmlId}
tabindex={this.props.tabindex}>
<PrimeMultiSelect
panelClassName={classes}
value={this.props.value}
options={this.props.options}
onChange={({value}) => this.props.onChange(value)}
display="chip"
zIndex={this.zIndex}
filter={this.props.filter}
appendTo={document.body}
placeholder={this.props.placeholder}
optionLabel={(option) => this.props.optionLabel(option)}
emptyFilterMessage={this.props.emptyFilterMessage}
filterPlaceholder={this.props.filterPlaceholder}
itemTemplate={this.props.itemTemplate}
selectedItemTemplate={this.props.selectedItemTemplate}
maxSelectedLabels={this.props.maxSelectedLabels ?? 4}
selectedItemsLabel={this.props.selectedItemsLabel}
ariaLabelledBy={this.htmlId + 'label'}
tabIndex={this.props.tabIndex ? this.props.tabIndex : '0'}
showClear={this.props.showClear}
label={this.props.label}
error={this.props.error}
required={this.props.required}
disabled={this.props.disabled}
info={this.props.info}
inlineLabel={this.props.inlineLabel}
@@ -106,7 +80,7 @@ export class MultiSelect<T> extends React.Component<IProps<T>, IState<T>> {
options={this.props.options}
onChange={({value}) => this.props.onChange(value)}
display="chip"
zIndex={this.props.zIndex}
zIndex={this.zIndex}
filter={this.props.filter}
appendTo={document.body}
placeholder={this.props.placeholder}
12 changes: 2 additions & 10 deletions app-typescript/components/TreeSelect.tsx
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ import { createPopper, Instance } from '@popperjs/core';
import {isEqual} from 'lodash';
import {getTextColor} from './Label';
import {getNextZIndex} from '../zIndex';
import {IInputWrapper} from './Form/InputWrapper';
import {SelectPreview} from './SelectPreview';

interface IState<T> {
value: Array<T>;
@@ -34,16 +36,6 @@ interface IPropsBase<T> extends IInputWrapper {
singleLevelSearch?: boolean;
placeholder?: string;
searchPlaceholder?: string;
invalid?: boolean;
inlineLabel?: boolean;
labelHidden?: boolean;
tabindex?: number;
fullWidth?: boolean;
info?: string;
error?: string;
required?: boolean;
label?: string;
disabled?: boolean;
getLabel(item: T): string;
getId(item: T): string;
getBackgroundColor?(item: T): string;
6 changes: 1 addition & 5 deletions examples/pages/react/MultiSelect.tsx
Original file line number Diff line number Diff line change
@@ -62,7 +62,6 @@ export class MultiselectDocs extends React.Component<{}, IState> {
<div className='docs-page__content-row docs-page__content-row--no-margin'>
<div className='form__row'>
<MultiSelect
preview
value={this.state.value}
options={ItemArr}
optionLabel={(option) => option.name}
@@ -71,12 +70,9 @@ export class MultiselectDocs extends React.Component<{}, IState> {
placeholder='Select a color'
filter
showSelectAll
placeholder='Select a color'
optionLabel={(option) => `${option.name} :: ${option.colorCode}`}
required
tabindex={1}
label={'This is Label'}
info={'This is info'}
onChange={(e: any) => this.setState({value: e})}
/>
</div>
</div>
You are viewing a condensed version of this merge commit. You can view the full changes here.