Skip to content

Commit

Permalink
fix(antd/next/element): fix ArrayCards-like component errors with inl…
Browse files Browse the repository at this point in the history
…ine component (#3321)
  • Loading branch information
lumdzeehol committed Aug 10, 2022
1 parent 6af972d commit aa8ed99
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
10 changes: 5 additions & 5 deletions packages/antd/src/array-cards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ const isAdditionComponent = (schema: ISchema) => {
}

const isIndexComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Index') > -1
return schema['x-component']?.indexOf?.('Index') > -1
}

const isRemoveComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Remove') > -1
return schema['x-component']?.indexOf?.('Remove') > -1
}

const isCopyComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Copy') > -1
return schema['x-component']?.indexOf?.('Copy') > -1
}

const isMoveUpComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('MoveUp') > -1
return schema['x-component']?.indexOf?.('MoveUp') > -1
}

const isMoveDownComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('MoveDown') > -1
return schema['x-component']?.indexOf?.('MoveDown') > -1
}

const isOperationComponent = (schema: ISchema) => {
Expand Down
10 changes: 5 additions & 5 deletions packages/antd/src/array-collapse/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ type ComposedArrayCollapse = React.FC<
}

const isAdditionComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Addition') > -1
return schema['x-component']?.indexOf?.('Addition') > -1
}

const isIndexComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Index') > -1
return schema['x-component']?.indexOf?.('Index') > -1
}

const isRemoveComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Remove') > -1
return schema['x-component']?.indexOf?.('Remove') > -1
}

const isMoveUpComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('MoveUp') > -1
return schema['x-component']?.indexOf?.('MoveUp') > -1
}

const isMoveDownComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('MoveDown') > -1
return schema['x-component']?.indexOf?.('MoveDown') > -1
}

const isOperationComponent = (schema: ISchema) => {
Expand Down
10 changes: 5 additions & 5 deletions packages/element/src/array-cards/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ import { ArrayBase } from '../array-base'
import { composeExport } from '../__builtins__/shared'

const isAdditionComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Addition') > -1
return schema['x-component']?.indexOf?.('Addition') > -1
}

const isIndexComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Index') > -1
return schema['x-component']?.indexOf?.('Index') > -1
}

const isRemoveComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Remove') > -1
return schema['x-component']?.indexOf?.('Remove') > -1
}

const isMoveUpComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('MoveUp') > -1
return schema['x-component']?.indexOf?.('MoveUp') > -1
}

const isMoveDownComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('MoveDown') > -1
return schema['x-component']?.indexOf?.('MoveDown') > -1
}

const isOperationComponent = (schema: ISchema) => {
Expand Down
10 changes: 5 additions & 5 deletions packages/element/src/array-collapse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ export interface IArrayCollapseProps extends CollapseProps {
}

const isAdditionComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Addition') > -1
return schema['x-component']?.indexOf?.('Addition') > -1
}

const isIndexComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Index') > -1
return schema['x-component']?.indexOf?.('Index') > -1
}

const isRemoveComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Remove') > -1
return schema['x-component']?.indexOf?.('Remove') > -1
}

const isMoveUpComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('MoveUp') > -1
return schema['x-component']?.indexOf?.('MoveUp') > -1
}

const isMoveDownComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('MoveDown') > -1
return schema['x-component']?.indexOf?.('MoveDown') > -1
}

const isOperationComponent = (schema: ISchema) => {
Expand Down
12 changes: 6 additions & 6 deletions packages/next/src/array-cards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ type ComposedArrayCards = React.FC<React.PropsWithChildren<CardProps>> &
ArrayBaseMixins

const isAdditionComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Addition') > -1
return schema['x-component']?.indexOf?.('Addition') > -1
}

const isIndexComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Index') > -1
return schema['x-component']?.indexOf?.('Index') > -1
}

const isRemoveComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Remove') > -1
return schema['x-component']?.indexOf?.('Remove') > -1
}

const isCopyComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Copy') > -1
return schema['x-component']?.indexOf?.('Copy') > -1
}

const isMoveUpComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('MoveUp') > -1
return schema['x-component']?.indexOf?.('MoveUp') > -1
}

const isMoveDownComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('MoveDown') > -1
return schema['x-component']?.indexOf?.('MoveDown') > -1
}

const isOperationComponent = (schema: ISchema) => {
Expand Down
10 changes: 5 additions & 5 deletions packages/next/src/array-collapse/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ type ComposedArrayCollapse = React.FC<
}

const isAdditionComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Addition') > -1
return schema['x-component']?.indexOf?.('Addition') > -1
}

const isIndexComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Index') > -1
return schema['x-component']?.indexOf?.('Index') > -1
}

const isRemoveComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('Remove') > -1
return schema['x-component']?.indexOf?.('Remove') > -1
}

const isMoveUpComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('MoveUp') > -1
return schema['x-component']?.indexOf?.('MoveUp') > -1
}

const isMoveDownComponent = (schema: ISchema) => {
return schema['x-component']?.indexOf('MoveDown') > -1
return schema['x-component']?.indexOf?.('MoveDown') > -1
}

const isOperationComponent = (schema: ISchema) => {
Expand Down

0 comments on commit aa8ed99

Please sign in to comment.