Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion example/src/mocks/AgendaItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isEmpty from 'lodash/isEmpty';
import { isEmpty } from 'es-toolkit/compat';
import React, {useCallback} from 'react';
import {StyleSheet, Alert, View, Text, TouchableOpacity, Button} from 'react-native';
import testIDs from '../testIDs';
Expand Down
2 changes: 1 addition & 1 deletion example/src/mocks/agendaItems.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isEmpty from 'lodash/isEmpty';
import { isEmpty } from 'es-toolkit/compat';
import {MarkedDates} from '../../../src/types';

const today = new Date().toISOString().split('T')[0];
Expand Down
2 changes: 1 addition & 1 deletion example/src/screens/calendarPlaygroundScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import times from 'lodash/times';
import { times } from 'es-toolkit/compat';
import React, {useState, useCallback, useMemo, useRef} from 'react';
import {StyleSheet, View, ScrollView, Text, TouchableOpacity, Switch, Alert} from 'react-native';
import {Calendar, CalendarUtils} from 'react-native-calendars';
Expand Down
5 changes: 1 addition & 4 deletions example/src/screens/timelineCalendarScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import groupBy from 'lodash/groupBy';
import filter from 'lodash/filter';
import find from 'lodash/find';

import React, {Component} from 'react';
import {Alert} from 'react-native';
import {
Expand All @@ -14,6 +10,7 @@ import {
} from 'react-native-calendars';

import {timelineEvents, getDate} from '../mocks/timelineEvents';
import { filter, find, groupBy } from 'es-toolkit/compat';

const INITIAL_TIME = {hour: 9, minutes: 0};
const EVENTS: TimelineEventProps[] = timelineEvents;
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"author": "Wix.com",
"license": "MIT",
"dependencies": {
"es-toolkit": "^1.39.5",
"hoist-non-react-statics": "^3.3.1",
"lodash": "^4.17.15",
"memoize-one": "^5.2.1",
"prop-types": "^15.5.10",
"react-native-safe-area-context": "4.5.0",
Expand All @@ -54,7 +54,6 @@
"@testing-library/react-native": "^11.0.0",
"@tsconfig/docusaurus": "^1.0.4",
"@types/jest": "^29.2.1",
"@types/lodash": "^4.14.170",
"@types/react": "^18.2.6",
"@types/react-native": "^0.64.19",
"@types/react-test-renderer": "^18.2.0",
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-docs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const _ = require('lodash');
const childProcess = require('child_process');
const { last, split } = require('es-toolkit/compat');
const fs = require('fs');

const COMPONENTS_DOCS_DIR = './docsRNC/docs';
Expand Down Expand Up @@ -28,7 +28,7 @@ if (components) {
if (component.extendsLink) {
extendsText = `[${extendsText}](${component.extendsLink})`;
} else {
const extendedComponentName = _.last(_.split(extendsText, '/'));
const extendedComponentName = last(split(extendsText, '/'));
extendsText = `[${extendedComponentName}](/docs/${extendsText})`;
}
content += `:::info\n`;
Expand Down
4 changes: 2 additions & 2 deletions scripts/release.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable no-console */
const _ = require('lodash');
const fs = require('fs');
const semver = require('semver');
const exec = require('shell-utils').exec;
const cp = require('child_process');
const { includes } = require('es-toolkit/compat');

let IS_SNAPSHOT;
let IS_HOTFIX;
Expand Down Expand Up @@ -91,7 +91,7 @@ function tryPublishAndTag(version) {
console.log(`Released version ${theCandidate}`);
return;
} catch (err) {
const alreadyPublished = _.includes(err.toString(), 'You cannot publish over the previously published version');
const alreadyPublished = includes(err.toString(), 'You cannot publish over the previously published version');
if (!alreadyPublished) {
throw err;
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-e2e.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-console */
const includes = require('lodash/includes');
const { includes } = require('es-toolkit/compat');
const exec = require('shell-utils').exec;

const release = includes(process.argv, '--release');
Expand Down
2 changes: 1 addition & 1 deletion src/agenda/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import isFunction from 'lodash/isFunction';
import PropTypes from 'prop-types';
import XDate from 'xdate';
import memoize from 'memoize-one';
import { isFunction } from 'es-toolkit/compat';

import React, {Component} from 'react';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/agenda/reservation-list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import isFunction from 'lodash/isFunction';
import PropTypes from 'prop-types';
import XDate from 'xdate';
import { isFunction } from 'es-toolkit/compat';

import React, {Component} from 'react';
import {ActivityIndicator, View, FlatList, StyleProp, ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, LayoutChangeEvent} from 'react-native';
Expand Down
2 changes: 1 addition & 1 deletion src/agenda/reservation-list/reservation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isFunction from 'lodash/isFunction';
import { isFunction } from 'es-toolkit/compat';
import PropTypes from 'prop-types';
import XDate from 'xdate';

Expand Down
3 changes: 1 addition & 2 deletions src/calendar-list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import findIndex from 'lodash/findIndex';
import { findIndex, isEqual } from 'es-toolkit/compat';
import PropTypes from 'prop-types';
import XDate from 'xdate';
import React, {forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react';
Expand All @@ -14,7 +14,6 @@ import styleConstructor from './style';
import Calendar, {CalendarProps} from '../calendar';
import CalendarListItem from './item';
import CalendarHeader from '../calendar/header/index';
import isEqual from 'lodash/isEqual';

const CALENDAR_WIDTH = constants.screenWidth;
const CALENDAR_HEIGHT = 360;
Expand Down
4 changes: 1 addition & 3 deletions src/calendar/day/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import omit from 'lodash/omit';
import isEqual from 'lodash/isEqual';
import some from 'lodash/some';
import { isEqual, omit, some } from 'es-toolkit/compat';
import XDate from 'xdate';
import React, {useMemo} from 'react';

Expand Down
2 changes: 1 addition & 1 deletion src/calendar/day/marking/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import filter from 'lodash/filter';
import { filter } from 'es-toolkit/compat';
import React, {useRef} from 'react';
import {View, ViewStyle, TextStyle, StyleProp} from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion src/calendar/header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import includes from 'lodash/includes';
import { includes } from 'es-toolkit/compat';
import XDate from 'xdate';

import React, {Fragment, ReactNode, useCallback, useMemo, forwardRef, useImperativeHandle, useRef} from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/calendar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import XDate from 'xdate';
import isEmpty from 'lodash/isEmpty';
import { isEmpty } from 'es-toolkit/compat';
import React, {useRef, useState, useEffect, useCallback, useMemo} from 'react';
import {AccessibilityInfo, View, ViewStyle, StyleProp} from 'react-native';
// @ts-expect-error
Expand Down
8 changes: 2 additions & 6 deletions src/componentUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import {ReservationListProps} from './agenda/reservation-list';

import {MarkingProps} from './calendar/day/marking';

const get = require('lodash/get');
const omit = require('lodash/omit');
const pickBy = require('lodash/pickBy');
const isEqual = require('lodash/isEqual');
const includes = require('lodash/includes');
import { get, includes, isEqual, omit, pickBy } from 'es-toolkit/compat';

export function shouldUpdate(props: any, newProps: any, paths: string[]) {
for (let i = 0; i < paths.length; i++) {
Expand All @@ -28,7 +24,7 @@ export function extractComponentProps(component: any, props: any, ignoreProps?:
const keys = Object.keys(componentPropTypes);
const componentProps = omit(
pickBy(props, (_value: any, key: any) => includes(keys, key)),
ignoreProps
ignoreProps || []
);
return componentProps;
}
Expand Down
8 changes: 1 addition & 7 deletions src/expandableCalendar/AgendaList/agendaList.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { debounce, get, isFunction, isUndefined, map } from 'es-toolkit/compat';
import PropTypes from 'prop-types';

import get from 'lodash/get';
import map from 'lodash/map';
import isFunction from 'lodash/isFunction';
import isUndefined from 'lodash/isUndefined';
import debounce from 'lodash/debounce';

import XDate from 'xdate';

import React, {forwardRef, useCallback, useContext, useEffect, useMemo, useRef} from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/expandableCalendar/AgendaList/commons.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isEqual from 'lodash/isEqual';
import { isEqual } from 'es-toolkit';
import React from 'react';
import {DefaultSectionT, SectionListProps, Text, TextProps, ViewStyle} from 'react-native';
import {Theme} from '../../types';
Expand Down
6 changes: 2 additions & 4 deletions src/expandableCalendar/AgendaList/infiniteAgendaList.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { debounce, isUndefined } from 'es-toolkit/compat';
import PropTypes from 'prop-types';
import XDate from 'xdate';

import isUndefined from 'lodash/isUndefined';
import debounce from 'lodash/debounce';
import InfiniteList from '../../infinite-list';

import XDate from 'xdate';

import React, {useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';
import {
DefaultSectionT,
Expand Down
2 changes: 1 addition & 1 deletion src/expandableCalendar/Context/Provider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {includes} from 'lodash';
import { includes } from 'es-toolkit/compat';
import XDate from 'xdate';

import React, {useRef, useState, useCallback, useMemo} from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/expandableCalendar/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { times } from 'es-toolkit/compat';
import {ExpandableCalendarProps, Positions} from '../index';
import {toMarkingFormat, xdateToData} from '../../interface';
import {ExpandableCalendarDriver} from '../driver';
import {generateExpandableCalendarWithContext, testIdExpandableCalendar} from './expandableCalendarTestKit';
import {getMonthTitle} from '../../testUtils';
import {UpdateSources} from '../commons';
import times from 'lodash/times';
import {NUMBER_OF_PAGES} from '../WeekCalendar';
import {CalendarContextProviderProps} from 'react-native-calendars';

Expand Down
6 changes: 1 addition & 5 deletions src/expandableCalendar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import first from 'lodash/first';
import isFunction from 'lodash/isFunction';
import isNumber from 'lodash/isNumber';
import throttle from 'lodash/throttle';

import { first, isFunction, isNumber, throttle } from 'es-toolkit/compat';
import XDate from 'xdate';

import React, {
Expand Down
2 changes: 1 addition & 1 deletion src/expandableCalendar/week.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isEqual } from 'es-toolkit/compat';
import XDate from 'xdate';
import React, {useRef, useMemo, useCallback} from 'react';
import {View} from 'react-native';
import isEqual from 'lodash/isEqual';

import {getPartialWeekDates, getWeekDates, sameMonth} from '../dateutils';
import {parseDate, toMarkingFormat} from '../interface';
Expand Down
4 changes: 1 addition & 3 deletions src/infinite-list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import inRange from 'lodash/inRange';
import debounce from 'lodash/debounce';
import noop from 'lodash/noop';
import { debounce, inRange, noop } from 'es-toolkit/compat';
import React, {forwardRef, useCallback, useEffect, useMemo, useRef} from 'react';
import {ScrollViewProps} from 'react-native';
import {DataProvider, LayoutProvider, RecyclerListView, RecyclerListViewProps} from 'recyclerlistview';
Expand Down
5 changes: 1 addition & 4 deletions src/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import isUndefined from 'lodash/isUndefined';
import isDate from 'lodash/isDate';
import isString from 'lodash/isString';
import isNumber from 'lodash/isNumber';
import { isDate, isNumber, isString, isUndefined } from 'es-toolkit/compat';
import XDate from 'xdate';

const {getLocale} = require('../dateutils');
Expand Down
5 changes: 2 additions & 3 deletions src/timeline-list/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import throttle from 'lodash/throttle';
import flatten from 'lodash/flatten';
import dropRight from 'lodash/dropRight';

import { dropRight, flatten, throttle } from 'es-toolkit/compat';
import React, {useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';
import {isToday, generateDay} from '../dateutils';
import InfiniteList from '../infinite-list';
Expand Down
4 changes: 1 addition & 3 deletions src/timeline-list/useTimelinePages.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {RefObject, useCallback, useEffect, useRef, useState} from 'react';

import inRange from 'lodash/inRange';
import times from 'lodash/times';
import debounce from 'lodash/debounce';
import { debounce, inRange, times } from 'es-toolkit/compat';

import constants from '../commons/constants';
import {generateDay} from '../dateutils';
Expand Down
2 changes: 1 addition & 1 deletion src/timeline/Packer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import inRange from 'lodash/inRange';
import { inRange } from 'es-toolkit/compat';
import XDate from 'xdate';
import constants from '../commons/constants';
import {Event, PackedEvent} from './EventBlock';
Expand Down
6 changes: 1 addition & 5 deletions src/timeline/Timeline.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import min from 'lodash/min';
import map from 'lodash/map';
import times from 'lodash/times';
import groupBy from 'lodash/groupBy';

import { groupBy, map, min, times } from 'es-toolkit/compat';
import React, {useCallback, useEffect, useMemo, useRef} from 'react';
import {View, ScrollView} from 'react-native';

Expand Down
4 changes: 1 addition & 3 deletions src/timeline/TimelineHours.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import range from 'lodash/range';
import times from 'lodash/times';

import { range, times } from 'es-toolkit/compat';
import React, {useCallback, useMemo, useRef} from 'react';
import {View, Text, TouchableWithoutFeedback, ViewStyle, TextStyle, StyleSheet} from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion src/timeline/__tests__/Packer.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sortBy from 'lodash/sortBy';
import { sortBy } from 'es-toolkit/compat';
import * as uut from '../Packer';

describe('Timeline Packer utils', () => {
Expand Down
Loading