Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
Deprecated Ramda function
Browse files Browse the repository at this point in the history
  • Loading branch information
dmt0 committed Oct 9, 2019
1 parent 3066b8b commit aa313da
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion demo/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class App extends Component<any, any> {
return (newProps: any) => {
Logger.debug('--->', newProps);
this.setState((prevState: any) => ({
tableProps: R.merge(prevState.tableProps, newProps)
tableProps: R.mergeRight(prevState.tableProps, newProps)
}));
};
});
Expand Down
6 changes: 3 additions & 3 deletions demo/AppMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const BasicModes = [
function getBaseTableProps(mock: IDataMock): Partial<IProps> {
return {
id: 'table',
columns: mock.columns.map((col: any) => R.merge(col, {
columns: mock.columns.map((col: any) => R.mergeRight(col, {
name: col.name || col.id,
on_change: {
action: ChangeAction.None
Expand Down Expand Up @@ -107,7 +107,7 @@ function getDefaultState(

return {
filter_query: '',
tableProps: R.merge(getBaseTableProps(mock), {
tableProps: R.mergeRight(getBaseTableProps(mock), {
data: mock.data,
editable: true,
sort_action: TableAction.Native,
Expand Down Expand Up @@ -258,7 +258,7 @@ function getVirtualizedState() {

return {
filter_query: '',
tableProps: R.merge(getBaseTableProps(mock), {
tableProps: R.mergeRight(getBaseTableProps(mock), {
data: mock.data,
editable: true,
fill_width: false,
Expand Down
2 changes: 1 addition & 1 deletion src/dash-table/components/CellFactory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export default class CellFactory {
) => {
return React.cloneElement(wrapper, {
children: [content],
style: R.merge(style, { borderBottom, borderLeft, borderRight, borderTop })
style: R.mergeRight(style, { borderBottom, borderLeft, borderRight, borderTop })
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/dash-table/components/Table/controlledPropsHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default () => {
uiViewport,
virtualization,
visibleColumns
} = R.merge(props, state) as (SanitizedAndDerivedProps & StandaloneState);
} = R.mergeRight(props, state) as (SanitizedAndDerivedProps & StandaloneState);

const virtual = getVirtual(
visibleColumns,
Expand Down
2 changes: 1 addition & 1 deletion src/dash-table/dash/Sanitizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default class Sanitizer {
headerFormat = ExportHeaders.Ids;
}

return R.merge(props, {
return R.mergeRight(props, {
columns,
export_headers: headerFormat,
fixed_columns: getFixedColumns(props.fixed_columns, props.row_deletable, props.row_selectable),
Expand Down
2 changes: 1 addition & 1 deletion src/dash-table/derived/cell/wrapperStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const getter = (
return;
}

styles[i][j] = R.merge(styles[i][j], SELECTED_CELL_STYLE);
styles[i][j] = R.mergeRight(styles[i][j], SELECTED_CELL_STYLE);
}, selectedCells);

return styles;
Expand Down
2 changes: 1 addition & 1 deletion src/dash-table/derived/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const handleSetFilter = (
function propsAndMapFn(propsFn: () => ControlledTableProps, setFilter: any) {
const props = propsFn();

return R.merge(props, { map: props.workFilter.map, setFilter });
return R.mergeRight(props, { map: props.workFilter.map, setFilter });
}

export default (propsFn: () => ControlledTableProps) => {
Expand Down
44 changes: 22 additions & 22 deletions src/dash-table/syntax-tree/lexeme/relational.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const LEXEME_BASE = {
type: LexemeType.RelationalOperator
};

export const contains: IUnboundedLexeme = R.merge({
export const contains: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
!R.isNil(exp) &&
!R.isNil(op) &&
Expand All @@ -76,7 +76,7 @@ export const contains: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const equal: IUnboundedLexeme = R.merge({
export const equal: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op === +exp :
Expand All @@ -88,15 +88,15 @@ export const equal: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const greaterOrEqual: IUnboundedLexeme = R.merge({
export const greaterOrEqual: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) => op >= exp),
subType: RelationalOperator.GreaterOrEqual,
case: 'default',
regexp: /^(>=|(ge)(?=\s|$))/i,
regexpMatch: 1
}, LEXEME_BASE);

export const greaterThan: IUnboundedLexeme = R.merge({
export const greaterThan: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) => op > exp),
subType: RelationalOperator.GreaterThan,
case: 'default',
Expand All @@ -108,7 +108,7 @@ const DATE_OPTIONS: IDateValidation = {
allow_YY: true
};

export const dateStartsWith: IUnboundedLexeme = R.merge({
export const dateStartsWith: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) => {
op = typeof op === 'number' ? op.toString() : op;
exp = typeof exp === 'number' ? exp.toString() : exp;
Expand All @@ -126,31 +126,31 @@ export const dateStartsWith: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const lessOrEqual: IUnboundedLexeme = R.merge({
export const lessOrEqual: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) => op <= exp),
subType: RelationalOperator.LessOrEqual,
case: 'default',
regexp: /^(<=|(le)(?=\s|$))/i,
regexpMatch: 1
}, LEXEME_BASE);

export const lessThan: IUnboundedLexeme = R.merge({
export const lessThan: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) => op < exp),
subType: RelationalOperator.LessThan,
case: 'default',
regexp: /^(<|(lt)(?=\s|$))/i,
regexpMatch: 1
}, LEXEME_BASE);

export const notEqual: IUnboundedLexeme = R.merge({
export const notEqual: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) => op !== exp),
subType: RelationalOperator.NotEqual,
case: 'default',
regexp: /^(!=|(ne)(?=\s|$))/i,
regexpMatch: 1
}, LEXEME_BASE);

export const icontains: IUnboundedLexeme = R.merge({
export const icontains: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
!R.isNil(exp) &&
!R.isNil(op) &&
Expand All @@ -163,7 +163,7 @@ export const icontains: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const iequal: IUnboundedLexeme = R.merge({
export const iequal: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op === +exp :
Expand All @@ -175,7 +175,7 @@ export const iequal: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const igreaterOrEqual: IUnboundedLexeme = R.merge({
export const igreaterOrEqual: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op >= +exp :
Expand All @@ -186,7 +186,7 @@ export const igreaterOrEqual: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const igreaterThan: IUnboundedLexeme = R.merge({
export const igreaterThan: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op > +exp :
Expand All @@ -197,7 +197,7 @@ export const igreaterThan: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const ilessOrEqual: IUnboundedLexeme = R.merge({
export const ilessOrEqual: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op <= +exp :
Expand All @@ -208,7 +208,7 @@ export const ilessOrEqual: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const ilessThan: IUnboundedLexeme = R.merge({
export const ilessThan: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op < +exp :
Expand All @@ -219,7 +219,7 @@ export const ilessThan: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const inotEqual: IUnboundedLexeme = R.merge({
export const inotEqual: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op !== +exp :
Expand All @@ -230,7 +230,7 @@ export const inotEqual: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const scontains: IUnboundedLexeme = R.merge({
export const scontains: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
!R.isNil(exp) &&
!R.isNil(op) &&
Expand All @@ -243,7 +243,7 @@ export const scontains: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const sequal: IUnboundedLexeme = R.merge({
export const sequal: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op === +exp :
Expand All @@ -255,7 +255,7 @@ export const sequal: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const sgreaterOrEqual: IUnboundedLexeme = R.merge({
export const sgreaterOrEqual: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op >= +exp :
Expand All @@ -266,7 +266,7 @@ export const sgreaterOrEqual: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const sgreaterThan: IUnboundedLexeme = R.merge({
export const sgreaterThan: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op > +exp :
Expand All @@ -277,7 +277,7 @@ export const sgreaterThan: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const slessOrEqual: IUnboundedLexeme = R.merge({
export const slessOrEqual: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op <= +exp :
Expand All @@ -288,7 +288,7 @@ export const slessOrEqual: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const slessThan: IUnboundedLexeme = R.merge({
export const slessThan: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op < +exp :
Expand All @@ -299,7 +299,7 @@ export const slessThan: IUnboundedLexeme = R.merge({
regexpMatch: 1
}, LEXEME_BASE);

export const snotEqual: IUnboundedLexeme = R.merge({
export const snotEqual: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(([op, exp]) =>
(isNumeric(op) && isNumeric(exp)) ?
+op !== +exp :
Expand Down
18 changes: 9 additions & 9 deletions src/dash-table/syntax-tree/lexeme/unary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,47 +65,47 @@ export const not: IUnboundedLexeme = {
}
};

export const isBool: IUnboundedLexeme = R.merge({
export const isBool: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(opValue => typeof opValue === 'boolean'),
regexp: /^(is bool)/i
}, LEXEME_BASE);

export const isEven: IUnboundedLexeme = R.merge({
export const isEven: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(opValue => typeof opValue === 'number' && opValue % 2 === 0),
regexp: /^(is even)/i
}, LEXEME_BASE);

export const isBlank: IUnboundedLexeme = R.merge({
export const isBlank: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(opValue => opValue === undefined || opValue === null || opValue === ''),
regexp: /^(is blank)/i
}, LEXEME_BASE);

export const isNil: IUnboundedLexeme = R.merge({
export const isNil: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(opValue => opValue === undefined || opValue === null),
regexp: /^(is nil)/i
}, LEXEME_BASE);

export const isNum: IUnboundedLexeme = R.merge({
export const isNum: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(opValue => typeof opValue === 'number'),
regexp: /^(is num)/i
}, LEXEME_BASE);

export const isObject: IUnboundedLexeme = R.merge({
export const isObject: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(opValue => opValue !== null && typeof opValue === 'object'),
regexp: /^(is object)/i
}, LEXEME_BASE);

export const isOdd: IUnboundedLexeme = R.merge({
export const isOdd: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(opValue => typeof opValue === 'number' && opValue % 2 === 1),
regexp: /^(is odd)/i
}, LEXEME_BASE);

export const isPrime: IUnboundedLexeme = R.merge({
export const isPrime: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(opValue => typeof opValue === 'number' && checkPrimality(opValue)),
regexp: /^(is prime)/i
}, LEXEME_BASE);

export const isStr: IUnboundedLexeme = R.merge({
export const isStr: IUnboundedLexeme = R.mergeRight({
evaluate: relationalEvaluator(opValue => typeof opValue === 'string'),
regexp: /^(is str)/i
}, LEXEME_BASE);
2 changes: 1 addition & 1 deletion tests/visual/percy-storybook/Style.percy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ storiesOf('DashTable/Style type condition', module)
.add('paging', () => (<DataTable
id='styling-20'
data= {mock.data}
columns={ mock.columns.map((col: any) => R.merge(col, {
columns={ mock.columns.map((col: any) => R.mergeRight(col, {
name: col.name,
deletable: true
}))}
Expand Down
8 changes: 4 additions & 4 deletions tests/visual/percy-storybook/Width.empty.percy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ storiesOf('DashTable/Empty', module)
{...props}
/>))
.add('with column filters -- invalid query', () => (<DataTable
{...R.merge(props, {
{...R.mergeRight(props, {
filter_query: '{a} !'
})}
/>))
.add('with column filters -- single query', () => (<DataTable
{...R.merge(props, {
{...R.mergeRight(props, {
filter_query: '{a} ge 0'
})}
/>))
.add('with column filters -- multi query', () => (<DataTable
{...R.merge(props, {
{...R.mergeRight(props, {
filter_query: '{a} ge 0 && {b} ge 0'
})}
/>))
.add('with column filters -- multi query, no data', () => (<DataTable
{...R.merge(props, {
{...R.mergeRight(props, {
filter_query: '{a} gt 1000 && {b} gt 1000'
})}
/>));

0 comments on commit aa313da

Please sign in to comment.