diff --git a/package.json b/package.json index 4d23b81..5fab0ba 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "eslint-config-airbnb-typescript": "^12.3.1", "eslint-plugin-import": "^2.24.0", "jest": "^27.0.6", + "prettier": "^2.5.1", "release-it": "^14.11.3", "ts-jest": "^27.0.4", "typescript": "^4.4.3", diff --git a/src/__tests__/addToArray.test.ts b/src/__tests__/addToArray.test.ts index 2a758c7..db87c78 100644 --- a/src/__tests__/addToArray.test.ts +++ b/src/__tests__/addToArray.test.ts @@ -8,12 +8,15 @@ describe('addToArray', () => { it('adds a new item for objects', () => { const arr = [{ a: 1 }, { b: '2' }, { three: '3' }]; - expect(addToArray(arr, { 'some-thing': { test: 1 } })) - .toEqual([{ a: 1 }, { b: '2' }, { three: '3' }, { 'some-thing': { test: 1 } }]); + expect(addToArray(arr, { 'some-thing': { test: 1 } })).toEqual([ + { a: 1 }, + { b: '2' }, + { three: '3' }, + { 'some-thing': { test: 1 } }, + ]); }); it('returns an array with the item if parameter is not an array', () => { - expect(addToArray(null, 'whatever')) - .toEqual(['whatever']); + expect(addToArray(null, 'whatever')).toEqual(['whatever']); }); }); diff --git a/src/__tests__/clone.test.ts b/src/__tests__/clone.test.ts index 0ffbf2d..08f7655 100644 --- a/src/__tests__/clone.test.ts +++ b/src/__tests__/clone.test.ts @@ -30,15 +30,20 @@ describe('clone', () => { }); it('makes a deep clone', () => { - const obj = [{ - a: 1, - test: 2, - something: { + const obj = [ + { a: 1, - hola: 'Mundo', - 'an-array': [1, { hello: 'wolrd', test: { foo: '1' } }, ['a', 'b', 'C']], + test: 2, + something: { + a: 1, + hola: 'Mundo', + 'an-array': [1, { hello: 'wolrd', test: { foo: '1' } }, ['a', 'b', 'C']], + }, }, - }, null, [], { a: 1, b: 2, c: 3 }]; + null, + [], + { a: 1, b: 2, c: 3 }, + ]; expect(clone(obj)).toEqual(obj); }); diff --git a/src/__tests__/dates/dayIsPartOfTheConditions.test.ts b/src/__tests__/dates/dayIsPartOfTheConditions.test.ts index ef64342..5992d1d 100644 --- a/src/__tests__/dates/dayIsPartOfTheConditions.test.ts +++ b/src/__tests__/dates/dayIsPartOfTheConditions.test.ts @@ -40,33 +40,21 @@ describe('dayIsPartOfTheConditions', () => { it('handles an array of conditions', () => { const date = new Date(2019, 0, 1); - const conditions = [ - (d: Date) => d.getFullYear() === 2019, - '2019-01-01', - new Date(2019, 0, 1), - ]; + const conditions = [(d: Date) => d.getFullYear() === 2019, '2019-01-01', new Date(2019, 0, 1)]; expect(dayIsPartOfTheConditions(date, conditions, dateParser, 'Y-m-d')).toBe(true); }); it('handles an array of conditions if one condition is false', () => { const date = new Date(2019, 0, 1); - const conditions = [ - (d: Date) => d.getFullYear() !== 2019, - '2019-01-01', - new Date(2019, 0, 1), - ]; + const conditions = [(d: Date) => d.getFullYear() !== 2019, '2019-01-01', new Date(2019, 0, 1)]; expect(dayIsPartOfTheConditions(date, conditions, dateParser, 'Y-m-d')).toBe(true); }); it('handles an array of conditions if all condition are false', () => { const date = new Date(2019, 0, 1); - const conditions = [ - (d: Date) => d.getFullYear() !== 2019, - '2019-02-01', - new Date(2010, 0, 1), - ]; + const conditions = [(d: Date) => d.getFullYear() !== 2019, '2019-02-01', new Date(2010, 0, 1)]; expect(dayIsPartOfTheConditions(date, conditions, dateParser, 'Y-m-d')).toBe(false); }); diff --git a/src/__tests__/dates/formatDate.test.ts b/src/__tests__/dates/formatDate.test.ts index 844267f..de4165b 100644 --- a/src/__tests__/dates/formatDate.test.ts +++ b/src/__tests__/dates/formatDate.test.ts @@ -151,7 +151,28 @@ describe('formatDate', () => { describe('Custom locale', () => { const allTokens = [ - 'D', 'F', 'G', 'H', 'J', 'K', 'M', 'S', 'U', 'W', 'Y', 'Z', 'd', 'h', 'i', 'j', 'l', 'm', 'n', 's', 'w', 'y', + 'D', + 'F', + 'G', + 'H', + 'J', + 'K', + 'M', + 'S', + 'U', + 'W', + 'Y', + 'Z', + 'd', + 'h', + 'i', + 'j', + 'l', + 'm', + 'n', + 's', + 'w', + 'y', ]; it('Spanish', () => { @@ -160,7 +181,9 @@ describe('formatDate', () => { ...defaultLocale, ...Spanish, }; - expect(formatDate(date, allTokens.join('-'), customLocale)).toEqual('Vie-Julio-08-08-2º-AM-Jul-08-1625231468-26-2021-2021-07-02T13:11:08.000Z-02-8-11-2-Viernes-07-7-8-5-21'); + expect(formatDate(date, allTokens.join('-'), customLocale)).toEqual( + 'Vie-Julio-08-08-2º-AM-Jul-08-1625231468-26-2021-2021-07-02T13:11:08.000Z-02-8-11-2-Viernes-07-7-8-5-21', + ); }); }); }); diff --git a/src/__tests__/dates/parseDate.test.ts b/src/__tests__/dates/parseDate.test.ts index 68602e0..454ae85 100644 --- a/src/__tests__/dates/parseDate.test.ts +++ b/src/__tests__/dates/parseDate.test.ts @@ -22,18 +22,28 @@ describe('parseDate', () => { }); it('returns today date if passed `today`', () => { - const today = new Date(new Date().getFullYear(), (new Date()).getMonth(), (new Date()).getDate(), 0, 0, 0, 0); + const today = new Date( + new Date().getFullYear(), + new Date().getMonth(), + new Date().getDate(), + 0, + 0, + 0, + 0, + ); expect(parseDate('today')).toEqual(today); }); it('parses gmt dates', () => { - expect(parseDate('Sat, 23 Oct 2021 20:58:00 GMT')) - .toEqual(new Date(Date.UTC(2021, 9, 23, 20, 58, 0, 0))); + expect(parseDate('Sat, 23 Oct 2021 20:58:00 GMT')).toEqual( + new Date(Date.UTC(2021, 9, 23, 20, 58, 0, 0)), + ); }); it('parses iso dates', () => { - expect(parseDate('2021-10-23T20:58:11.733Z')) - .toEqual(new Date(Date.UTC(2021, 9, 23, 20, 58, 11, 733))); + expect(parseDate('2021-10-23T20:58:11.733Z')).toEqual( + new Date(Date.UTC(2021, 9, 23, 20, 58, 11, 733)), + ); }); it('parses a date in the default format', () => { @@ -41,11 +51,15 @@ describe('parseDate', () => { }); it('parses a date ignoring time', () => { - expect(parseDate('2020-02-18 12:34:56', defaultFormat, timeless)).toEqual(new Date(2020, 1, 18, 0, 0, 0)); + expect(parseDate('2020-02-18 12:34:56', defaultFormat, timeless)).toEqual( + new Date(2020, 1, 18, 0, 0, 0), + ); }); it('escapes the token', () => { - expect(parseDate('2020Y-02-18 12m:34:56', 'Y\\Y-m-d H\\m:i:S')).toEqual(new Date(2020, 1, 18, 12, 34, 56)); + expect(parseDate('2020Y-02-18 12m:34:56', 'Y\\Y-m-d H\\m:i:S')).toEqual( + new Date(2020, 1, 18, 12, 34, 56), + ); }); it('returns undefined if using an invalid format', () => { @@ -66,9 +80,7 @@ describe('parseDate', () => { beforeEach(() => { baseDate = new Date('2021-01-01T06:00:00.000Z'); - jest - .useFakeTimers() - .setSystemTime(baseDate.getTime()); + jest.useFakeTimers().setSystemTime(baseDate.getTime()); }); afterEach(() => { @@ -141,7 +153,9 @@ describe('parseDate', () => { }); // Z / ISO Date format / 2017-03-04T01:23:43.000Z it('Z', () => { - expect(parseDate('2020-01-01T06:00:00.000', 'Z')).toEqual(new Date('2020-01-01T12:00:00.000Z')); + expect(parseDate('2020-01-01T06:00:00.000', 'Z')).toEqual( + new Date('2020-01-01T12:00:00.000Z'), + ); }); // H / Hours (24 hours) / 00 to 23 diff --git a/src/__tests__/filterOptions.test.ts b/src/__tests__/filterOptions.test.ts index 22d87d2..2c2dd76 100644 --- a/src/__tests__/filterOptions.test.ts +++ b/src/__tests__/filterOptions.test.ts @@ -38,9 +38,7 @@ describe('filterOptions', () => { { value: 1, text: 'Option 1', - children: [ - { value: 'red', text: 'Red' }, - ], + children: [{ value: 'red', text: 'Red' }], }, ], }, diff --git a/src/__tests__/getFocusableElements.test.ts b/src/__tests__/getFocusableElements.test.ts index 1b1e96c..c697c85 100644 --- a/src/__tests__/getFocusableElements.test.ts +++ b/src/__tests__/getFocusableElements.test.ts @@ -105,14 +105,7 @@ describe('elementIsTargetOrTargetChild', () => { it('doesnt return any element that is disabled ', () => { const el = document.createElement('div'); - const els = [ - 'a', - 'button', - 'input', - 'textarea', - 'select', - 'details', - ]; + const els = ['a', 'button', 'input', 'textarea', 'select', 'details']; els.forEach((tagName) => { const focusable = document.createElement(tagName); diff --git a/src/__tests__/isEqual.test.ts b/src/__tests__/isEqual.test.ts index 856e7fc..4401051 100644 --- a/src/__tests__/isEqual.test.ts +++ b/src/__tests__/isEqual.test.ts @@ -22,11 +22,15 @@ describe('isEqual', () => { }); it('considers that an array with same values to be equal', () => { - expect(isEqual([1, '12', 'string', true, undefined], [1, '12', 'string', true, undefined])).toBe(true); + expect( + isEqual([1, '12', 'string', true, undefined], [1, '12', 'string', true, undefined]), + ).toBe(true); }); it('considers that an array with same values in different order to no be equal', () => { - expect(isEqual([1, '12', 'string', true, undefined], ['12', 1, 'string', true, undefined])).toBe(false); + expect( + isEqual([1, '12', 'string', true, undefined], ['12', 1, 'string', true, undefined]), + ).toBe(false); }); it('considers that `undefined` is equal to `undefined`', () => { @@ -102,50 +106,74 @@ describe('isEqual', () => { }); it('makes a deep comparison', () => { - const a = [undefined, { - a: 1, - test: 2, - something: { + const a = [ + undefined, + { a: 1, - hola: 'Mundo', - 'an-array': [1, undefined, { hello: 'wolrd', test: { foo: '1' } }, ['a', 'b', 'C']], + test: 2, + something: { + a: 1, + hola: 'Mundo', + 'an-array': [1, undefined, { hello: 'wolrd', test: { foo: '1' } }, ['a', 'b', 'C']], + }, }, - }, null, [], { a: 1, b: 2, c: 3 }]; - - const b = [undefined, { - a: 1, - test: 2, - something: { + null, + [], + { a: 1, b: 2, c: 3 }, + ]; + + const b = [ + undefined, + { a: 1, - hola: 'Mundo', - 'an-array': [1, undefined, { hello: 'wolrd', test: { foo: '1' } }, ['a', 'b', 'C']], + test: 2, + something: { + a: 1, + hola: 'Mundo', + 'an-array': [1, undefined, { hello: 'wolrd', test: { foo: '1' } }, ['a', 'b', 'C']], + }, }, - }, null, [], { a: 1, b: 2, c: 3 }]; + null, + [], + { a: 1, b: 2, c: 3 }, + ]; expect(isEqual(a, b)).toBe(true); }); it('makes a deep comparison for something that is not equal', () => { - const a = [undefined, { - a: 1, - test: 2, - something: { + const a = [ + undefined, + { a: 1, - hola: 'Mundo', - 'an-array': [1, undefined, { hello: 'wolrd', test: { foo: '1' } }, ['a', 'b', 'C']], + test: 2, + something: { + a: 1, + hola: 'Mundo', + 'an-array': [1, undefined, { hello: 'wolrd', test: { foo: '1' } }, ['a', 'b', 'C']], + }, }, - }, null, [], { a: 1, b: 2, c: 3 }]; - - const b = [undefined, { - a: 1, - test: 2, - something: { + null, + [], + { a: 1, b: 2, c: 3 }, + ]; + + const b = [ + undefined, + { a: 1, - hola: 'Mundo', - // The 1 in foo is different - 'an-array': [1, undefined, { hello: 'wolrd', test: { foo: 1 } }, ['a', 'b', 'C']], + test: 2, + something: { + a: 1, + hola: 'Mundo', + // The 1 in foo is different + 'an-array': [1, undefined, { hello: 'wolrd', test: { foo: 1 } }, ['a', 'b', 'C']], + }, }, - }, null, [], { a: 1, b: 2, c: 3 }]; + null, + [], + { a: 1, b: 2, c: 3 }, + ]; expect(isEqual(a, b)).toBe(false); }); diff --git a/src/__tests__/mergeClasses.test.ts b/src/__tests__/mergeClasses.test.ts index a260e47..ef3bbd2 100644 --- a/src/__tests__/mergeClasses.test.ts +++ b/src/__tests__/mergeClasses.test.ts @@ -13,6 +13,26 @@ describe('merge classes function', () => { expect(mergeClasses(['hello'], ['world'])).toBe('hello world'); }); + it('allows functions that can manipulate the classes interactively', () => { + expect( + mergeClasses( + ['hello'], + ({ clear, add }) => { + clear(); + add('no'); + }, + ['world'], + ({ remove }) => { + remove('world'); + }, + ), + ).toBe('no'); + }); + + it('does not allowe duplicates', () => { + expect(mergeClasses(['hello'], ['hello'])).toBe('hello'); + }); + it('merges the truthy values from an object format', () => { expect( mergeClasses( @@ -23,7 +43,8 @@ describe('merge classes function', () => { { world: 1, universe: null, - }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any, ), ).toBe('hello world'); }); diff --git a/src/__tests__/parseVariantWithClassesList.test.ts b/src/__tests__/parseVariantWithClassesList.test.ts index 3c9c24c..37f4674 100644 --- a/src/__tests__/parseVariantWithClassesList.test.ts +++ b/src/__tests__/parseVariantWithClassesList.test.ts @@ -1,5 +1,5 @@ import { parseVariantWithClassesList } from '../index'; -import { ObjectWithClassesList, WithVariantPropsAndClassesList } from '../types'; +import { CSSClass, ObjectWithClassesList, WithVariantPropsAndClassesList } from '../types'; describe('parse variants with classes list function', () => { it('returns the same object if no variants passed', () => { @@ -255,11 +255,14 @@ describe('parse variants with classes list function', () => { expect(parseVariantWithClassesList(props, [], configuration)).toEqual(props); }); - it('uses the props over the configuration for classes list', () => { - const props = { + it('respects the props for classes list', () => { + const props: CSSClass = { classes: { - wrapper: 'p-3', - body: 'text-gray-500', + wrapper: 'm-3', + body: ({ clear, add }) => { + clear(); + add('text-gray-500'); + }, }, }; @@ -271,14 +274,18 @@ describe('parse variants with classes list function', () => { }; expect(parseVariantWithClassesList(props, ['wrapper', 'body'], configuration)).toEqual({ - classesList: props.classes, + classesList: { + wrapper: 'p-4 m-3', + body: 'text-gray-500', + }, }); }); - it('overrides only the props defined from the configuration', () => { + it('respects only the props defined from the configuration', () => { const props = { classes: { - wrapper: 'p-3', + wrapper: 'm-3', + inner: 'p-2', }, }; @@ -292,7 +299,8 @@ describe('parse variants with classes list function', () => { expect(parseVariantWithClassesList(props, ['wrapper', 'body'], configuration)).toEqual({ classesList: { body: 'text-red-500', - wrapper: 'p-3', + wrapper: 'p-4 m-3', + inner: undefined, }, }); }); @@ -308,14 +316,14 @@ describe('parse variants with classes list function', () => { const configuration = { classes: { wrapper: 'p-4', - body: 'text-red-500', + body: 'bg-red-500', }, }; expect(parseVariantWithClassesList(props, ['wrapper', 'body'], {}, configuration)).toEqual({ classesList: { wrapper: undefined, - body: 'text-gray-500', + body: 'bg-red-500 text-gray-500', }, }); }); @@ -420,11 +428,11 @@ describe('parse variants with classes list function', () => { }, }; - const defaultConfiguration = { + const defaultConfiguration = {}; - }; - - expect(parseVariantWithClassesList(props, ['wrapper', 'body'], configuration, defaultConfiguration)).toEqual({ + expect( + parseVariantWithClassesList(props, ['wrapper', 'body'], configuration, defaultConfiguration), + ).toEqual({ classesList: { wrapper: 'border p-3', }, @@ -436,9 +444,7 @@ describe('parse variants with classes list function', () => { variant: 'error', }; - const configuration = { - - }; + const configuration = {}; const defaultConfiguration = { variants: { @@ -453,7 +459,9 @@ describe('parse variants with classes list function', () => { }, }; - expect(parseVariantWithClassesList(props, ['wrapper', 'body'], configuration, defaultConfiguration)).toEqual({ + expect( + parseVariantWithClassesList(props, ['wrapper', 'body'], configuration, defaultConfiguration), + ).toEqual({ classesList: { wrapper: 'border p-3', }, @@ -721,6 +729,9 @@ describe('parse variants with classes list function', () => { const props: WithVariantPropsAndClassesList = { classes: { input: 'border-1', + label: ({ add }) => { + add('bg-green-500'); + }, }, }; @@ -744,7 +755,7 @@ describe('parse variants with classes list function', () => { classesList: { wrapper: 'flex items-center space-x-2', inputWrapper: 'inline-flex', - label: 'uppercase text-gray-500', + label: 'uppercase text-gray-500 bg-green-500', input: 'border-1', }, }); @@ -755,7 +766,12 @@ describe('parse variants with classes list function', () => { const props: WithVariantPropsAndClassesList = { classes: { - wrapper: 'flex items-center space-x-2', + wrapper: [ + ({ clear }) => { + clear(); + }, + 'flex items-center space-x-2', + ], }, }; diff --git a/src/__tests__/substractFromArray.test.ts b/src/__tests__/substractFromArray.test.ts index 504284f..375369a 100644 --- a/src/__tests__/substractFromArray.test.ts +++ b/src/__tests__/substractFromArray.test.ts @@ -14,13 +14,11 @@ describe('substractFromArray', () => { }); it('returns an empty array if is not array', () => { - expect(substractFromArray(null, 'whatever')) - .toEqual([]); + expect(substractFromArray(null, 'whatever')).toEqual([]); }); it('removes an existing item for objects', () => { const arr = [{ a: 1 }, { b: '2' }, { three: '3' }]; - expect(substractFromArray(arr, { b: '2' })) - .toEqual([{ a: 1 }, { three: '3' }]); + expect(substractFromArray(arr, { b: '2' })).toEqual([{ a: 1 }, { three: '3' }]); }); }); diff --git a/src/config/TAlertConfig.ts b/src/config/TAlertConfig.ts index 205d61f..db16056 100644 --- a/src/config/TAlertConfig.ts +++ b/src/config/TAlertConfig.ts @@ -3,11 +3,13 @@ import { enterAndLeave } from './transitions'; const TAlertConfig = { classes: { // @tw - wrapper: 'relative flex items-center p-4 border-l-4 border-blue-500 rounded shadow-sm bg-blue-50', + wrapper: + 'relative flex items-center p-4 border-l-4 border-blue-500 rounded shadow-sm bg-blue-50', // @tw body: 'flex-grow', // @tw - close: 'relative flex items-center justify-center flex-shrink-0 w-6 h-6 ml-4 text-blue-500 transition duration-100 ease-in-out rounded hover:bg-blue-200 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', + close: + 'relative flex items-center justify-center flex-shrink-0 w-6 h-6 ml-4 text-blue-500 transition duration-100 ease-in-out rounded hover:bg-blue-200 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', // @tw closeIcon: 'w-4 h-4', ...enterAndLeave, diff --git a/src/config/TDatepickerConfig.ts b/src/config/TDatepickerConfig.ts index 15276c4..609aae8 100644 --- a/src/config/TDatepickerConfig.ts +++ b/src/config/TDatepickerConfig.ts @@ -27,7 +27,8 @@ const TDatepickerConfig = { // @tw inputWrapper: '', // @tw - input: 'block w-full px-3 py-2 text-black placeholder-gray-400 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed', + input: + 'block w-full px-3 py-2 text-black placeholder-gray-400 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed', // @tw clearButton: 'text-gray-600 transition duration-100 ease-in-out rounded hover:bg-gray-100', // @tw @@ -43,7 +44,8 @@ const TDatepickerConfig = { // @tw navigator: 'px-3 pt-2', // @tw - navigatorViewButton: 'inline-flex px-2 py-1 -ml-1 transition duration-100 ease-in-out rounded-full cursor-pointer hover:bg-gray-100', + navigatorViewButton: + 'inline-flex px-2 py-1 -ml-1 transition duration-100 ease-in-out rounded-full cursor-pointer hover:bg-gray-100', // @tw navigatorViewButtonIcon: 'text-gray-400 fill-current', // @tw @@ -61,9 +63,11 @@ const TDatepickerConfig = { // @tw navigatorLabelYear: 'ml-1 text-gray-500', // @tw - navigatorPrevButton: 'inline-flex p-1 ml-2 ml-auto transition duration-100 ease-in-out rounded-full cursor-pointer hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed', + navigatorPrevButton: + 'inline-flex p-1 ml-2 ml-auto transition duration-100 ease-in-out rounded-full cursor-pointer hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed', // @tw - navigatorNextButton: 'inline-flex p-1 -mr-1 transition duration-100 ease-in-out rounded-full cursor-pointer hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed', + navigatorNextButton: + 'inline-flex p-1 -mr-1 transition duration-100 ease-in-out rounded-full cursor-pointer hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed', // @tw navigatorPrevButtonIcon: 'text-gray-400', // @tw @@ -75,7 +79,8 @@ const TDatepickerConfig = { // @tw calendarHeaderWrapper: '', // @tw - calendarHeaderWeekDay: 'flex items-center justify-center w-8 h-8 text-xs text-gray-500 uppercase', + calendarHeaderWeekDay: + 'flex items-center justify-center w-8 h-8 text-xs text-gray-500 uppercase', // @tw calendarDaysWrapper: '', // @tw @@ -83,7 +88,8 @@ const TDatepickerConfig = { // Day item // @tw - otherMonthDay: 'w-8 h-8 mx-auto text-sm text-gray-400 rounded-full hover:bg-blue-100 disabled:opacity-50 disabled:cursor-not-allowed', + otherMonthDay: + 'w-8 h-8 mx-auto text-sm text-gray-400 rounded-full hover:bg-blue-100 disabled:opacity-50 disabled:cursor-not-allowed', // @tw emptyDay: '', // @tw @@ -93,15 +99,19 @@ const TDatepickerConfig = { // @tw inRangeDay: 'w-full h-8 text-sm bg-blue-200 disabled:opacity-50 disabled:cursor-not-allowed', // @tw - selectedDay: 'w-8 h-8 mx-auto text-sm text-white bg-blue-500 rounded-full disabled:opacity-50 disabled:cursor-not-allowed', + selectedDay: + 'w-8 h-8 mx-auto text-sm text-white bg-blue-500 rounded-full disabled:opacity-50 disabled:cursor-not-allowed', // @tw - activeDay: 'w-8 h-8 mx-auto text-sm bg-blue-100 rounded-full disabled:opacity-50 disabled:cursor-not-allowed', + activeDay: + 'w-8 h-8 mx-auto text-sm bg-blue-100 rounded-full disabled:opacity-50 disabled:cursor-not-allowed', // @tw - highlightedDay: 'w-8 h-8 mx-auto text-sm bg-blue-200 rounded-full disabled:opacity-50 disabled:cursor-not-allowed', + highlightedDay: + 'w-8 h-8 mx-auto text-sm bg-blue-200 rounded-full disabled:opacity-50 disabled:cursor-not-allowed', // @tw day: 'w-8 h-8 mx-auto text-sm rounded-full hover:bg-blue-100 disabled:opacity-50 disabled:cursor-not-allowed', // @tw - today: 'w-8 h-8 mx-auto text-sm border border-blue-500 rounded-full hover:bg-blue-100 disabled:opacity-50 disabled:cursor-not-allowed', + today: + 'w-8 h-8 mx-auto text-sm border border-blue-500 rounded-full hover:bg-blue-100 disabled:opacity-50 disabled:cursor-not-allowed', // Months View // @tw @@ -129,29 +139,40 @@ const TDatepickerConfig = { // @tw timepickerTimeWrapper: 'flex items-center space-x-2', // @tw - timepickerTimeFieldsWrapper: 'flex items-center w-full text-right bg-gray-100 border border-gray-100 rounded-md focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', + timepickerTimeFieldsWrapper: + 'flex items-center w-full text-right bg-gray-100 border border-gray-100 rounded-md focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', // @tw - timepickerOkButton: 'text-sm font-semibold text-blue-600 uppercase transition duration-100 ease-in-out border border-transparent rounded cursor-pointer focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', + timepickerOkButton: + 'text-sm font-semibold text-blue-600 uppercase transition duration-100 ease-in-out border border-transparent rounded cursor-pointer focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', // @tw - timepickerInput: 'w-8 h-6 p-0 text-sm text-center transition duration-100 ease-in-out bg-transparent border border-transparent rounded focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', + timepickerInput: + 'w-8 h-6 p-0 text-sm text-center transition duration-100 ease-in-out bg-transparent border border-transparent rounded focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', // @tw timepickerTimeLabel: 'flex-grow text-sm text-gray-500', // @tw - timepickerAmPmWrapper: 'relative inline-flex flex-shrink-0 transition duration-200 ease-in-out bg-gray-100 border border-transparent rounded cursor-pointer focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', + timepickerAmPmWrapper: + 'relative inline-flex flex-shrink-0 transition duration-200 ease-in-out bg-gray-100 border border-transparent rounded cursor-pointer focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', // @tw - timepickerAmPmWrapperChecked: 'relative inline-flex flex-shrink-0 transition duration-200 ease-in-out bg-gray-100 border border-transparent rounded cursor-pointer focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', + timepickerAmPmWrapperChecked: + 'relative inline-flex flex-shrink-0 transition duration-200 ease-in-out bg-gray-100 border border-transparent rounded cursor-pointer focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', // @tw - timepickerAmPmWrapperDisabled: 'relative inline-flex flex-shrink-0 transition duration-200 ease-in-out opacity-50 cursor-not-allowed', + timepickerAmPmWrapperDisabled: + 'relative inline-flex flex-shrink-0 transition duration-200 ease-in-out opacity-50 cursor-not-allowed', // @tw - timepickerAmPmWrapperCheckedDisabled: 'relative inline-flex flex-shrink-0 transition duration-200 ease-in-out opacity-50 cursor-not-allowed', + timepickerAmPmWrapperCheckedDisabled: + 'relative inline-flex flex-shrink-0 transition duration-200 ease-in-out opacity-50 cursor-not-allowed', // @tw - timepickerAmPmButton: 'absolute flex items-center justify-center w-6 h-6 text-xs text-gray-800 transition duration-200 ease-in-out transform translate-x-0 bg-white rounded shadow', + timepickerAmPmButton: + 'absolute flex items-center justify-center w-6 h-6 text-xs text-gray-800 transition duration-200 ease-in-out transform translate-x-0 bg-white rounded shadow', // @tw - timepickerAmPmButtonChecked: 'absolute flex items-center justify-center w-6 h-6 text-xs text-gray-800 transition duration-200 ease-in-out transform translate-x-full bg-white rounded shadow', + timepickerAmPmButtonChecked: + 'absolute flex items-center justify-center w-6 h-6 text-xs text-gray-800 transition duration-200 ease-in-out transform translate-x-full bg-white rounded shadow', // @tw - timepickerAmPmCheckedPlaceholder: 'flex items-center justify-center w-6 h-6 text-xs text-gray-500 rounded-sm', + timepickerAmPmCheckedPlaceholder: + 'flex items-center justify-center w-6 h-6 text-xs text-gray-500 rounded-sm', // @tw - timepickerAmPmUncheckedPlaceholder: 'flex items-center justify-center w-6 h-6 text-xs text-gray-500 rounded-sm', + timepickerAmPmUncheckedPlaceholder: + 'flex items-center justify-center w-6 h-6 text-xs text-gray-500 rounded-sm', // ...enterAndLeave, }, }; diff --git a/src/config/TDialogConfig.ts b/src/config/TDialogConfig.ts index 87d74e7..50306d0 100644 --- a/src/config/TDialogConfig.ts +++ b/src/config/TDialogConfig.ts @@ -47,7 +47,8 @@ const TDialogConfig = { // @tw content: 'flex flex-col justify-center w-full', // @tw - iconWrapper: 'flex items-center justify-center flex-shrink-0 w-12 h-12 mx-auto mb-2 bg-gray-100 rounded-full', + iconWrapper: + 'flex items-center justify-center flex-shrink-0 w-12 h-12 mx-auto mb-2 bg-gray-100 rounded-full', // @tw icon: 'w-6 h-6 text-gray-700', // @tw @@ -62,9 +63,11 @@ const TDialogConfig = { // @tw buttons: 'flex justify-center p-3 space-x-4 bg-gray-100 rounded-b', // @tw - cancelButton: 'block w-full max-w-xs px-4 py-2 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm hover:bg-gray-100 focus:border-gray-100 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed', + cancelButton: + 'block w-full max-w-xs px-4 py-2 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm hover:bg-gray-100 focus:border-gray-100 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed', // @tw - okButton: 'block w-full max-w-xs px-4 py-2 text-white transition duration-100 ease-in-out bg-blue-500 border border-transparent rounded shadow-sm hover:bg-blue-600 focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed', + okButton: + 'block w-full max-w-xs px-4 py-2 text-white transition duration-100 ease-in-out bg-blue-500 border border-transparent rounded shadow-sm hover:bg-blue-600 focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed', // @tw inputWrapper: 'mt-3', @@ -76,7 +79,8 @@ const TDialogConfig = { errorMessage: 'block p-3 mb-3 -mx-3 -mt-3 text-sm text-center text-red-500 rounded-t bg-red-50', // @tw - busyWrapper: 'absolute top-0 left-0 flex items-center justify-center w-full h-full bg-white bg-opacity-75', + busyWrapper: + 'absolute top-0 left-0 flex items-center justify-center w-full h-full bg-white bg-opacity-75', // @tw busyIcon: 'w-6 h-6 text-gray-500', @@ -122,31 +126,35 @@ export enum DialogHideReason { } export type DialogResponse = { - hideReason: DialogHideReason; - isOk: boolean; - isCancel: boolean; - isDismissed: boolean; + hideReason: DialogHideReason + isOk: boolean + isCancel: boolean + isDismissed: boolean // eslint-disable-next-line @typescript-eslint/no-explicit-any - input?: any; + input?: any // eslint-disable-next-line @typescript-eslint/no-explicit-any - response?: any; + response?: any }; export type DialogShowFn = (name: string) => Promise; -export type DialogProgramaticallyShowFn = (titleOrDialogOptions: Options | string, text?: string, icon?: string) => Promise; +export type DialogProgramaticallyShowFn = ( + titleOrDialogOptions: Options | string, + text?: string, + icon?: string +) => Promise; export type DialogHideFn = (name: string) => void; export type DialogBeforeHideParams = { - cancel: PromiseRejectFn; - response?: DialogResponse; + cancel: PromiseRejectFn + response?: DialogResponse }; export type DialogBeforeShowParams = { - cancel: PromiseRejectFn; + cancel: PromiseRejectFn // eslint-disable-next-line @typescript-eslint/no-explicit-any - params?: any; + params?: any }; // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -154,7 +162,7 @@ export type DialogInputValidatorFn = (value: any) => string | Promise | // @TODO: see if was can get use a more specific typing // eslint-disable-next-line @typescript-eslint/no-explicit-any -export type DialogPreconfirmFn = ((input: any) => Promise | any); +export type DialogPreconfirmFn = (input: any) => Promise | any; export const TDialogClassesKeys = Object.keys(TDialogConfig.classes); diff --git a/src/config/TModalConfig.ts b/src/config/TModalConfig.ts index a608e87..72c4d54 100644 --- a/src/config/TModalConfig.ts +++ b/src/config/TModalConfig.ts @@ -13,7 +13,8 @@ export const TModalConfig = { // @tw wrapper: 'z-50 max-w-lg px-3 py-12', // @tw - close: 'absolute top-0 right-0 z-10 flex items-center justify-center w-8 h-8 -m-3 text-gray-700 transition ease-in-out bg-gray-100 rounded-full shadow duration-400 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 hover:bg-gray-200', + close: + 'absolute top-0 right-0 z-10 flex items-center justify-center w-8 h-8 -m-3 text-gray-700 transition ease-in-out bg-gray-100 rounded-full shadow duration-400 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 hover:bg-gray-200', // @tw closeIcon: 'w-4 h-4', // @tw diff --git a/src/config/TRichSelectConfig.ts b/src/config/TRichSelectConfig.ts index daffa88..1958854 100644 --- a/src/config/TRichSelectConfig.ts +++ b/src/config/TRichSelectConfig.ts @@ -7,7 +7,8 @@ const TRichSelectConfig = { // TDropdown Component // @tw - trigger: 'flex items-center justify-between w-full px-3 py-2 text-left text-black transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed', + trigger: + 'flex items-center justify-between w-full px-3 py-2 text-left text-black transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed', // @tw dropdown: 'z-10 bg-white rounded shadow-lg', // Dropdown content @@ -16,7 +17,8 @@ const TRichSelectConfig = { // Clear button // @tw - clearButton: 'absolute flex items-center justify-center w-6 h-6 text-gray-600 transition duration-100 ease-in-out rounded mt-2.5 mr-2 top-0 right-0 hover:bg-gray-100 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', + clearButton: + 'absolute flex items-center justify-center w-6 h-6 text-gray-600 transition duration-100 ease-in-out rounded mt-2.5 mr-2 top-0 right-0 hover:bg-gray-100 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', // Option list // @tw @@ -60,7 +62,8 @@ const TRichSelectConfig = { // @tw searchWrapper: 'inline-block w-full placeholder-gray-400', // @tw - searchInput: 'inline-block w-full px-3 py-2 text-sm border border-gray-300 rounded shadow-inner bg-gray-50 focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', + searchInput: + 'inline-block w-full px-3 py-2 text-sm border border-gray-300 rounded shadow-inner bg-gray-50 focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', // State texts // @tw @@ -92,7 +95,8 @@ const TRichSelectConfig = { // @tw tagLabel: 'px-3', // @tw - tagDeleteButton: '-ml-1.5 h-full hover:bg-blue-600 hover:shadow-sm inline-flex items-center px-2 transition focus:border-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-opacity-50 rounded-r', + tagDeleteButton: + '-ml-1.5 h-full hover:bg-blue-600 hover:shadow-sm inline-flex items-center px-2 transition focus:border-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-opacity-50 rounded-r', // @tw tagDeleteButtonIcon: 'w-3 h-3', diff --git a/src/config/TToggleConfig.ts b/src/config/TToggleConfig.ts index f4347ab..9884808 100644 --- a/src/config/TToggleConfig.ts +++ b/src/config/TToggleConfig.ts @@ -3,31 +3,43 @@ const TToggleConfig = { classes: { // @tw - wrapper: 'bg-gray-100 border-2 border-transparent rounded-full focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', + wrapper: + 'bg-gray-100 border-2 border-transparent rounded-full focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', // @tw - wrapperChecked: 'bg-blue-500 border-2 border-transparent rounded-full focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', + wrapperChecked: + 'bg-blue-500 border-2 border-transparent rounded-full focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', // @tw - wrapperDisabled: 'bg-gray-100 border-2 border-transparent rounded-full focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', + wrapperDisabled: + 'bg-gray-100 border-2 border-transparent rounded-full focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', // @tw - wrapperCheckedDisabled: 'bg-blue-500 border-2 border-transparent rounded-full focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', + wrapperCheckedDisabled: + 'bg-blue-500 border-2 border-transparent rounded-full focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50', // @tw - button: 'flex items-center justify-center w-5 h-5 text-xs text-gray-400 bg-white rounded-full shadow', + button: + 'flex items-center justify-center w-5 h-5 text-xs text-gray-400 bg-white rounded-full shadow', // @tw - buttonChecked: 'flex items-center justify-center w-5 h-5 text-xs text-blue-500 bg-white rounded-full shadow', + buttonChecked: + 'flex items-center justify-center w-5 h-5 text-xs text-blue-500 bg-white rounded-full shadow', // @tw - checkedPlaceholder: 'flex items-center justify-center w-5 h-5 text-xs text-gray-400 rounded-full', + checkedPlaceholder: + 'flex items-center justify-center w-5 h-5 text-xs text-gray-400 rounded-full', // @tw - uncheckedPlaceholder: 'flex items-center justify-center w-5 h-5 text-xs text-gray-400 rounded-full', + uncheckedPlaceholder: + 'flex items-center justify-center w-5 h-5 text-xs text-gray-400 rounded-full', }, fixedClasses: { // @tw - wrapper: 'relative inline-flex flex-shrink-0 items-center transition-colors duration-200 ease-in-out cursor-pointer', + wrapper: + 'relative inline-flex flex-shrink-0 items-center transition-colors duration-200 ease-in-out cursor-pointer', // @tw - wrapperChecked: 'relative inline-flex flex-shrink-0 items-center transition-colors duration-200 ease-in-out cursor-pointer', + wrapperChecked: + 'relative inline-flex flex-shrink-0 items-center transition-colors duration-200 ease-in-out cursor-pointer', // @tw - wrapperDisabled: 'relative inline-flex flex-shrink-0 items-center transition-colors duration-200 ease-in-out opacity-50 cursor-pointer cursor-not-allowed', + wrapperDisabled: + 'relative inline-flex flex-shrink-0 items-center transition-colors duration-200 ease-in-out opacity-50 cursor-pointer cursor-not-allowed', // @tw - wrapperCheckedDisabled: 'relative inline-flex flex-shrink-0 items-center transition-colors duration-200 ease-in-out opacity-50 cursor-pointer cursor-not-allowed', + wrapperCheckedDisabled: + 'relative inline-flex flex-shrink-0 items-center transition-colors duration-200 ease-in-out opacity-50 cursor-pointer cursor-not-allowed', // @tw button: 'absolute transition duration-200 ease-in-out transform translate-x-0', // @tw diff --git a/src/config/TWrappedCheckboxConfig.ts b/src/config/TWrappedCheckboxConfig.ts index 5b879ff..ed4b2a7 100644 --- a/src/config/TWrappedCheckboxConfig.ts +++ b/src/config/TWrappedCheckboxConfig.ts @@ -1,9 +1,24 @@ import { CSSClass } from '../types'; import TCheckboxConfig from './TCheckboxConfig'; -export const TWrappedCheckboxClassesKeys = ['wrapper', 'wrapperChecked', 'inputWrapper', 'inputWrapperChecked', 'input', 'label', 'labelChecked']; +export const TWrappedCheckboxClassesKeys = [ + 'wrapper', + 'wrapperChecked', + 'inputWrapper', + 'inputWrapperChecked', + 'input', + 'label', + 'labelChecked', +]; -export type TWrappedCheckboxClassesValidKeys = 'wrapper' | 'wrapperChecked' | 'inputWrapper' | 'inputWrapperChecked' | 'input' | 'label' | 'labelChecked'; +export type TWrappedCheckboxClassesValidKeys = + | 'wrapper' + | 'wrapperChecked' + | 'inputWrapper' + | 'inputWrapperChecked' + | 'input' + | 'label' + | 'labelChecked'; export const TWrappedCheckboxConfig: { classes: { diff --git a/src/config/TWrappedRadioConfig.ts b/src/config/TWrappedRadioConfig.ts index 00f71a2..169cdd7 100644 --- a/src/config/TWrappedRadioConfig.ts +++ b/src/config/TWrappedRadioConfig.ts @@ -2,9 +2,24 @@ import { CSSClass } from '../types/CSSClass'; import TRadioConfig from './TRadioConfig'; -export const TWrappedRadioClassesKeys = ['wrapper', 'wrapperChecked', 'inputWrapper', 'inputWrapperChecked', 'input', 'label', 'labelChecked']; +export const TWrappedRadioClassesKeys = [ + 'wrapper', + 'wrapperChecked', + 'inputWrapper', + 'inputWrapperChecked', + 'input', + 'label', + 'labelChecked', +]; -export type TWrappedRadioClassesValidKeys = 'wrapper' | 'wrapperChecked' | 'inputWrapper' | 'inputWrapperChecked' | 'input' | 'label' | 'labelChecked'; +export type TWrappedRadioClassesValidKeys = + | 'wrapper' + | 'wrapperChecked' + | 'inputWrapper' + | 'inputWrapperChecked' + | 'input' + | 'label' + | 'labelChecked'; export const TWrappedRadioConfig: { classes: { diff --git a/src/config/index.ts b/src/config/index.ts index 5747cda..292d010 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -7,18 +7,63 @@ export { default as TRadioConfig } from './TRadioConfig'; export { default as TTagConfig } from './TTagConfig'; export { default as TCardConfig, TCardClassesKeys, TCardClassesValidKeys } from './TCardConfig'; export { - default as TModalConfig, TModalClassesKeys, TModalClassesValidKeys, ModalShowFn, ModalHideFn, ModalHideReason, + default as TModalConfig, + TModalClassesKeys, + TModalClassesValidKeys, + ModalShowFn, + ModalHideFn, + ModalHideReason, } from './TModalConfig'; export { - default as TDialogConfig, TDialogClassesKeys, TDialogClassesValidKeys, DialogBeforeShowParams, DialogBeforeHideParams, DialogHideFn, DialogShowFn, DialogProgramaticallyShowFn, DialogResponse, DialogHideReason, DialogType, DialogIcon, DialogPreconfirmFn, DialogInputValidatorFn, + default as TDialogConfig, + TDialogClassesKeys, + TDialogClassesValidKeys, + DialogBeforeShowParams, + DialogBeforeHideParams, + DialogHideFn, + DialogShowFn, + DialogProgramaticallyShowFn, + DialogResponse, + DialogHideReason, + DialogType, + DialogIcon, + DialogPreconfirmFn, + DialogInputValidatorFn, } from './TDialogConfig'; export { default as TAlertConfig, TAlertClassesKeys, TAlertClassesValidKeys } from './TAlertConfig'; -export { default as TInputGroupConfig, TInputGroupClassesKeys, TInputGroupClassesValidKeys } from './TInputGroupConfig'; export { - default as TDropdownConfig, TDropdownPopperDefaultOptions, TDropdownClassesKeys, TDropdownClassesValidKeys, + default as TInputGroupConfig, + TInputGroupClassesKeys, + TInputGroupClassesValidKeys, +} from './TInputGroupConfig'; +export { + default as TDropdownConfig, + TDropdownPopperDefaultOptions, + TDropdownClassesKeys, + TDropdownClassesValidKeys, } from './TDropdownConfig'; -export { default as TRichSelectConfig, TRichSelectClassesKeys, TRichSelectClassesValidKeys } from './TRichSelectConfig'; -export { default as TDatepickerConfig, TDatepickerClassesKeys, TDatepickerClassesValidKeys } from './TDatepickerConfig'; -export { default as TToggleConfig, TToggleClassesKeys, TToggleClassesValidKeys } from './TToggleConfig'; -export { default as TWrappedRadioConfig, TWrappedRadioClassesKeys, TWrappedRadioClassesValidKeys } from './TWrappedRadioConfig'; -export { default as TWrappedCheckboxConfig, TWrappedCheckboxClassesKeys, TWrappedCheckboxClassesValidKeys } from './TWrappedCheckboxConfig'; +export { + default as TRichSelectConfig, + TRichSelectClassesKeys, + TRichSelectClassesValidKeys, +} from './TRichSelectConfig'; +export { + default as TDatepickerConfig, + TDatepickerClassesKeys, + TDatepickerClassesValidKeys, +} from './TDatepickerConfig'; +export { + default as TToggleConfig, + TToggleClassesKeys, + TToggleClassesValidKeys, +} from './TToggleConfig'; +export { + default as TWrappedRadioConfig, + TWrappedRadioClassesKeys, + TWrappedRadioClassesValidKeys, +} from './TWrappedRadioConfig'; +export { + default as TWrappedCheckboxConfig, + TWrappedCheckboxClassesKeys, + TWrappedCheckboxClassesValidKeys, +} from './TWrappedCheckboxConfig'; diff --git a/src/dates/addDays.ts b/src/dates/addDays.ts index a13fc90..dbc9cf9 100644 --- a/src/dates/addDays.ts +++ b/src/dates/addDays.ts @@ -1,6 +1,6 @@ import clone from '../helpers/clone'; -const addDays = (date: Date, amount = 1) : Date => { +const addDays = (date: Date, amount = 1): Date => { const result = clone(date); result.setDate(result.getDate() + amount); return result; diff --git a/src/dates/buildDateFormatter.ts b/src/dates/buildDateFormatter.ts index 7c8ec12..1f495fd 100644 --- a/src/dates/buildDateFormatter.ts +++ b/src/dates/buildDateFormatter.ts @@ -1,7 +1,7 @@ import formatDate from './formatDate'; import { DateLocale, DateFormatter } from '../types/Dates'; -const buildDateFormatter = (locale: DateLocale, customDateFormatter?: DateFormatter) : DateFormatter => (date: Date | null | undefined, format = 'Y-m-d H:i:S') => { +const buildDateFormatter = (locale: DateLocale, customDateFormatter?: DateFormatter): DateFormatter => (date: Date | null | undefined, format = 'Y-m-d H:i:S') => { if (customDateFormatter) { return customDateFormatter(date, format, locale); } diff --git a/src/dates/buildDateParser.ts b/src/dates/buildDateParser.ts index 9465cf5..9e75260 100644 --- a/src/dates/buildDateParser.ts +++ b/src/dates/buildDateParser.ts @@ -1,7 +1,7 @@ import parseDate from './parseDate'; import { DateLocale, DateValue, DateParser } from '../types/Dates'; -const buildDateParser = (locale: DateLocale, customDateParser?: DateParser) : DateParser => (date: DateValue | null | undefined, format = 'Y-m-d H:i:S', timeless?: boolean) => { +const buildDateParser = (locale: DateLocale, customDateParser?: DateParser): DateParser => (date: DateValue | null | undefined, format = 'Y-m-d H:i:S', timeless?: boolean) => { if (customDateParser) { return customDateParser(date, format, timeless, locale); } diff --git a/src/dates/dateIsPartOfTheRange.ts b/src/dates/dateIsPartOfTheRange.ts index 26a8c2b..65d4421 100644 --- a/src/dates/dateIsPartOfTheRange.ts +++ b/src/dates/dateIsPartOfTheRange.ts @@ -1,7 +1,13 @@ import { DateParser, DateValue } from '../types/Dates'; import parseDate from './parseDate'; -const dateIsPartOfTheRange = (date: Date, min: DateValue | undefined, max: DateValue | undefined, dateParser: DateParser = parseDate, dateFormat = 'Y-m-d H:i:S'): boolean => { +const dateIsPartOfTheRange = ( + date: Date, + min: DateValue | undefined, + max: DateValue | undefined, + dateParser: DateParser = parseDate, + dateFormat = 'Y-m-d H:i:S', +): boolean => { const minDate = min === undefined ? undefined : dateParser(min, dateFormat); const maxDate = max === undefined ? undefined : dateParser(max, dateFormat); diff --git a/src/dates/dayIsPartOfTheConditions.ts b/src/dates/dayIsPartOfTheConditions.ts index 767a9ac..012840f 100644 --- a/src/dates/dayIsPartOfTheConditions.ts +++ b/src/dates/dayIsPartOfTheConditions.ts @@ -2,7 +2,12 @@ import isSameDay from './isSameDay'; import { DateParser, DateConditions } from '../types/Dates'; -const dayIsPartOfTheConditions = (date: Date | null | undefined, condition: DateConditions | undefined, dateParser: DateParser, dateFormat?: string): boolean => { +const dayIsPartOfTheConditions = ( + date: Date | null | undefined, + condition: DateConditions | undefined, + dateParser: DateParser, + dateFormat?: string, +): boolean => { if (!date) { return false; } diff --git a/src/dates/formatDate.ts b/src/dates/formatDate.ts index 08d5c2a..1f56b5d 100644 --- a/src/dates/formatDate.ts +++ b/src/dates/formatDate.ts @@ -2,15 +2,11 @@ import { DateLocale, TokenFormattingFunctions, DateToken } from '../types/Dates' import { English } from './l10n/default'; -const boolToInt = (bool: boolean) : 1 | 0 => (bool === true ? 1 : 0); +const boolToInt = (bool: boolean): 1 | 0 => (bool === true ? 1 : 0); -const pad = (number: string | number, length = 2) : string => `000${number}`.slice(length * -1); +const pad = (number: string | number, length = 2): string => `000${number}`.slice(length * -1); -const monthToString = ( - monthNumber: number, - shorthand: boolean, - locale: DateLocale, -): string => locale.months[shorthand ? 'shorthand' : 'longhand'][monthNumber]; +const monthToString = (monthNumber: number, shorthand: boolean, locale: DateLocale): string => locale.months[shorthand ? 'shorthand' : 'longhand'][monthNumber]; export const tokenFormatingFunctions: TokenFormattingFunctions = { // get the date in UTC @@ -18,18 +14,12 @@ export const tokenFormatingFunctions: TokenFormattingFunctions = { // weekday name, short, e.g. Thu D(date: Date, locale: DateLocale) { - return locale.weekdays.shorthand[ - tokenFormatingFunctions.w(date, locale) as number - ]; + return locale.weekdays.shorthand[tokenFormatingFunctions.w(date, locale) as number]; }, // full month name e.g. January F(date: Date, locale: DateLocale) { - return monthToString( - (tokenFormatingFunctions.n(date, locale) as number) - 1, - false, - locale, - ); + return monthToString((tokenFormatingFunctions.n(date, locale) as number) - 1, false, locale); }, // padded hour 1-12 @@ -73,12 +63,9 @@ export const tokenFormatingFunctions: TokenFormattingFunctions = { // Adjust to Thursday in week 1 and count number of weeks from date to week1. return ( 1 - + Math.round( - ((date.getTime() - week1.getTime()) / 86400000 - - 3 - + ((week1.getDay() + 6) % 7)) - / 7, - ) + + Math.round( + ((date.getTime() - week1.getTime()) / 86400000 - 3 + ((week1.getDay() + 6) % 7)) / 7, + ) ); }, @@ -118,7 +105,11 @@ export const tokenFormatingFunctions: TokenFormattingFunctions = { y: (date: Date) => String(date.getFullYear()).substring(2), }; -const formatDate = (date: Date | null | undefined, format: string, customLocale?: DateLocale): string => { +const formatDate = ( + date: Date | null | undefined, + format: string, + customLocale?: DateLocale, +): string => { if (!date) { return ''; } @@ -130,7 +121,8 @@ const formatDate = (date: Date | null | undefined, format: string, customLocale? .map((char, i, arr) => { if (tokenFormatingFunctions[char as DateToken] && arr[i - 1] !== '\\') { return tokenFormatingFunctions[char as DateToken](date, locale); - } if (char !== '\\') { + } + if (char !== '\\') { return char; } return ''; diff --git a/src/dates/isSameDay.ts b/src/dates/isSameDay.ts index a4071b8..0ca6594 100644 --- a/src/dates/isSameDay.ts +++ b/src/dates/isSameDay.ts @@ -3,9 +3,11 @@ const isSameDay = (date1?: Date, date2?: Date): boolean => { return false; } - return date1.getDate() === date2.getDate() - && date1.getMonth() === date2.getMonth() - && date1.getFullYear() === date2.getFullYear(); + return ( + date1.getDate() === date2.getDate() + && date1.getMonth() === date2.getMonth() + && date1.getFullYear() === date2.getFullYear() + ); }; export default isSameDay; diff --git a/src/dates/isToday.ts b/src/dates/isToday.ts index c442b16..0394464 100644 --- a/src/dates/isToday.ts +++ b/src/dates/isToday.ts @@ -1,5 +1,5 @@ import isSameDay from './isSameDay'; -const isToday = (date: Date) : boolean => isSameDay(date, new Date()); +const isToday = (date: Date): boolean => isSameDay(date, new Date()); export default isToday; diff --git a/src/dates/l10n/ar.ts b/src/dates/l10n/ar.ts index 8b8ad00..37e0333 100644 --- a/src/dates/l10n/ar.ts +++ b/src/dates/l10n/ar.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Arabic: CustomDateLocale = { weekdays: { shorthand: ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], - longhand: [ - 'الأحد', - 'الاثنين', - 'الثلاثاء', - 'الأربعاء', - 'الخميس', - 'الجمعة', - 'السبت', - ], + longhand: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], }, months: { diff --git a/src/dates/l10n/at.ts b/src/dates/l10n/at.ts index b9ddf1b..d26dfea 100644 --- a/src/dates/l10n/at.ts +++ b/src/dates/l10n/at.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Austria: CustomDateLocale = { weekdays: { shorthand: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], - longhand: [ - 'Sonntag', - 'Montag', - 'Dienstag', - 'Mittwoch', - 'Donnerstag', - 'Freitag', - 'Samstag', - ], + longhand: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], }, months: { - shorthand: [ - 'Jän', - 'Feb', - 'Mär', - 'Apr', - 'Mai', - 'Jun', - 'Jul', - 'Aug', - 'Sep', - 'Okt', - 'Nov', - 'Dez', - ], + shorthand: ['Jän', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], longhand: [ 'Jänner', 'Februar', diff --git a/src/dates/l10n/az.ts b/src/dates/l10n/az.ts index ee9180b..5a2bb5b 100644 --- a/src/dates/l10n/az.ts +++ b/src/dates/l10n/az.ts @@ -16,20 +16,7 @@ export const Azerbaijan: CustomDateLocale = { }, months: { - shorthand: [ - 'Yan', - 'Fev', - 'Mar', - 'Apr', - 'May', - 'İyn', - 'İyl', - 'Avq', - 'Sen', - 'Okt', - 'Noy', - 'Dek', - ], + shorthand: ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avq', 'Sen', 'Okt', 'Noy', 'Dek'], longhand: [ 'Yanvar', 'Fevral', diff --git a/src/dates/l10n/be.ts b/src/dates/l10n/be.ts index 147af1d..7c042c1 100644 --- a/src/dates/l10n/be.ts +++ b/src/dates/l10n/be.ts @@ -4,31 +4,10 @@ import { CustomDateLocale } from '../../types/Dates'; export const Belarusian: CustomDateLocale = { weekdays: { shorthand: ['Нд', 'Пн', 'Аў', 'Ср', 'Чц', 'Пт', 'Сб'], - longhand: [ - 'Нядзеля', - 'Панядзелак', - 'Аўторак', - 'Серада', - 'Чацвер', - 'Пятніца', - 'Субота', - ], + longhand: ['Нядзеля', 'Панядзелак', 'Аўторак', 'Серада', 'Чацвер', 'Пятніца', 'Субота'], }, months: { - shorthand: [ - 'Сту', - 'Лют', - 'Сак', - 'Кра', - 'Тра', - 'Чэр', - 'Ліп', - 'Жні', - 'Вер', - 'Кас', - 'Ліс', - 'Сне', - ], + shorthand: ['Сту', 'Лют', 'Сак', 'Кра', 'Тра', 'Чэр', 'Ліп', 'Жні', 'Вер', 'Кас', 'Ліс', 'Сне'], longhand: [ 'Студзень', 'Люты', diff --git a/src/dates/l10n/bg.ts b/src/dates/l10n/bg.ts index 869f305..e8a836e 100644 --- a/src/dates/l10n/bg.ts +++ b/src/dates/l10n/bg.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Bulgarian: CustomDateLocale = { weekdays: { shorthand: ['Нд', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'], - longhand: [ - 'Неделя', - 'Понеделник', - 'Вторник', - 'Сряда', - 'Четвъртък', - 'Петък', - 'Събота', - ], + longhand: ['Неделя', 'Понеделник', 'Вторник', 'Сряда', 'Четвъртък', 'Петък', 'Събота'], }, months: { diff --git a/src/dates/l10n/bn.ts b/src/dates/l10n/bn.ts index 3df5951..1e4af06 100644 --- a/src/dates/l10n/bn.ts +++ b/src/dates/l10n/bn.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Bangla: CustomDateLocale = { weekdays: { shorthand: ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'], - longhand: [ - 'রবিবার', - 'সোমবার', - 'মঙ্গলবার', - 'বুধবার', - 'বৃহস্পতিবার', - 'শুক্রবার', - 'শনিবার', - ], + longhand: ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'], }, months: { diff --git a/src/dates/l10n/bs.ts b/src/dates/l10n/bs.ts index 6212f45..a3b7664 100644 --- a/src/dates/l10n/bs.ts +++ b/src/dates/l10n/bs.ts @@ -6,32 +6,11 @@ export const Bosnian: CustomDateLocale = { weekdays: { shorthand: ['Ned', 'Pon', 'Uto', 'Sri', 'Čet', 'Pet', 'Sub'], - longhand: [ - 'Nedjelja', - 'Ponedjeljak', - 'Utorak', - 'Srijeda', - 'Četvrtak', - 'Petak', - 'Subota', - ], + longhand: ['Nedjelja', 'Ponedjeljak', 'Utorak', 'Srijeda', 'Četvrtak', 'Petak', 'Subota'], }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'Maj', - 'Jun', - 'Jul', - 'Avg', - 'Sep', - 'Okt', - 'Nov', - 'Dec', - ], + shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Avg', 'Sep', 'Okt', 'Nov', 'Dec'], longhand: [ 'Januar', 'Februar', diff --git a/src/dates/l10n/cat.ts b/src/dates/l10n/cat.ts index c61a2f4..c414359 100644 --- a/src/dates/l10n/cat.ts +++ b/src/dates/l10n/cat.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Catalan: CustomDateLocale = { weekdays: { shorthand: ['Dg', 'Dl', 'Dt', 'Dc', 'Dj', 'Dv', 'Ds'], - longhand: [ - 'Diumenge', - 'Dilluns', - 'Dimarts', - 'Dimecres', - 'Dijous', - 'Divendres', - 'Dissabte', - ], + longhand: ['Diumenge', 'Dilluns', 'Dimarts', 'Dimecres', 'Dijous', 'Divendres', 'Dissabte'], }, months: { diff --git a/src/dates/l10n/cs.ts b/src/dates/l10n/cs.ts index 97a8e6f..d8c5bb8 100644 --- a/src/dates/l10n/cs.ts +++ b/src/dates/l10n/cs.ts @@ -4,31 +4,10 @@ import { CustomDateLocale } from '../../types/Dates'; export const Czech: CustomDateLocale = { weekdays: { shorthand: ['Ne', 'Po', 'Út', 'St', 'Čt', 'Pá', 'So'], - longhand: [ - 'Neděle', - 'Pondělí', - 'Úterý', - 'Středa', - 'Čtvrtek', - 'Pátek', - 'Sobota', - ], + longhand: ['Neděle', 'Pondělí', 'Úterý', 'Středa', 'Čtvrtek', 'Pátek', 'Sobota'], }, months: { - shorthand: [ - 'Led', - 'Ún', - 'Bře', - 'Dub', - 'Kvě', - 'Čer', - 'Čvc', - 'Srp', - 'Zář', - 'Říj', - 'Lis', - 'Pro', - ], + shorthand: ['Led', 'Ún', 'Bře', 'Dub', 'Kvě', 'Čer', 'Čvc', 'Srp', 'Zář', 'Říj', 'Lis', 'Pro'], longhand: [ 'Leden', 'Únor', diff --git a/src/dates/l10n/cy.ts b/src/dates/l10n/cy.ts index 8d21b39..eb1eed8 100644 --- a/src/dates/l10n/cy.ts +++ b/src/dates/l10n/cy.ts @@ -57,22 +57,13 @@ export const Welsh: CustomDateLocale = { if (nth === 5 || nth === 6) return 'ed'; - if ( - (nth >= 7 && nth <= 10) - || nth === 12 - || nth === 15 - || nth === 18 - || nth === 20 - ) { return 'fed'; } + if ((nth >= 7 && nth <= 10) || nth === 12 || nth === 15 || nth === 18 || nth === 20) { + return 'fed'; + } - if ( - nth === 11 - || nth === 13 - || nth === 14 - || nth === 16 - || nth === 17 - || nth === 19 - ) { return 'eg'; } + if (nth === 11 || nth === 13 || nth === 14 || nth === 16 || nth === 17 || nth === 19) { + return 'eg'; + } if (nth >= 21 && nth <= 39) return 'ain'; diff --git a/src/dates/l10n/da.ts b/src/dates/l10n/da.ts index 6ea8c7b..c51d2e3 100644 --- a/src/dates/l10n/da.ts +++ b/src/dates/l10n/da.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Danish: CustomDateLocale = { weekdays: { shorthand: ['søn', 'man', 'tir', 'ons', 'tors', 'fre', 'lør'], - longhand: [ - 'søndag', - 'mandag', - 'tirsdag', - 'onsdag', - 'torsdag', - 'fredag', - 'lørdag', - ], + longhand: ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'], }, months: { - shorthand: [ - 'jan', - 'feb', - 'mar', - 'apr', - 'maj', - 'jun', - 'jul', - 'aug', - 'sep', - 'okt', - 'nov', - 'dec', - ], + shorthand: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], longhand: [ 'januar', 'februar', diff --git a/src/dates/l10n/de.ts b/src/dates/l10n/de.ts index 0d0574d..8834f0e 100644 --- a/src/dates/l10n/de.ts +++ b/src/dates/l10n/de.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const German: CustomDateLocale = { weekdays: { shorthand: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], - longhand: [ - 'Sonntag', - 'Montag', - 'Dienstag', - 'Mittwoch', - 'Donnerstag', - 'Freitag', - 'Samstag', - ], + longhand: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mär', - 'Apr', - 'Mai', - 'Jun', - 'Jul', - 'Aug', - 'Sep', - 'Okt', - 'Nov', - 'Dez', - ], + shorthand: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], longhand: [ 'Januar', 'Februar', diff --git a/src/dates/l10n/default.ts b/src/dates/l10n/default.ts index 4e96011..09351c2 100644 --- a/src/dates/l10n/default.ts +++ b/src/dates/l10n/default.ts @@ -3,31 +3,10 @@ import { DateLocale } from '../../types/Dates'; export const English: DateLocale = { weekdays: { shorthand: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - longhand: [ - 'Sunday', - 'Monday', - 'Tuesday', - 'Wednesday', - 'Thursday', - 'Friday', - 'Saturday', - ], + longhand: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'May', - 'Jun', - 'Jul', - 'Aug', - 'Sep', - 'Oct', - 'Nov', - 'Dec', - ], + shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], longhand: [ 'January', 'February', diff --git a/src/dates/l10n/eo.ts b/src/dates/l10n/eo.ts index 00b2776..0757666 100644 --- a/src/dates/l10n/eo.ts +++ b/src/dates/l10n/eo.ts @@ -9,32 +9,11 @@ export const Esperanto: CustomDateLocale = { weekdays: { shorthand: ['Dim', 'Lun', 'Mar', 'Mer', 'Ĵaŭ', 'Ven', 'Sab'], - longhand: [ - 'dimanĉo', - 'lundo', - 'mardo', - 'merkredo', - 'ĵaŭdo', - 'vendredo', - 'sabato', - ], + longhand: ['dimanĉo', 'lundo', 'mardo', 'merkredo', 'ĵaŭdo', 'vendredo', 'sabato'], }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'Maj', - 'Jun', - 'Jul', - 'Aŭg', - 'Sep', - 'Okt', - 'Nov', - 'Dec', - ], + shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aŭg', 'Sep', 'Okt', 'Nov', 'Dec'], longhand: [ 'januaro', 'februaro', diff --git a/src/dates/l10n/es.ts b/src/dates/l10n/es.ts index 6d6e4a2..0658497 100644 --- a/src/dates/l10n/es.ts +++ b/src/dates/l10n/es.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Spanish: CustomDateLocale = { weekdays: { shorthand: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'], - longhand: [ - 'Domingo', - 'Lunes', - 'Martes', - 'Miércoles', - 'Jueves', - 'Viernes', - 'Sábado', - ], + longhand: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'], }, months: { - shorthand: [ - 'Ene', - 'Feb', - 'Mar', - 'Abr', - 'May', - 'Jun', - 'Jul', - 'Ago', - 'Sep', - 'Oct', - 'Nov', - 'Dic', - ], + shorthand: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'], longhand: [ 'Enero', 'Febrero', diff --git a/src/dates/l10n/et.ts b/src/dates/l10n/et.ts index 3855407..be0cc12 100644 --- a/src/dates/l10n/et.ts +++ b/src/dates/l10n/et.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Estonian: CustomDateLocale = { weekdays: { shorthand: ['P', 'E', 'T', 'K', 'N', 'R', 'L'], - longhand: [ - 'Pühapäev', - 'Esmaspäev', - 'Teisipäev', - 'Kolmapäev', - 'Neljapäev', - 'Reede', - 'Laupäev', - ], + longhand: ['Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev'], }, months: { diff --git a/src/dates/l10n/fa.ts b/src/dates/l10n/fa.ts index 2fe9f9e..db628a6 100644 --- a/src/dates/l10n/fa.ts +++ b/src/dates/l10n/fa.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Persian: CustomDateLocale = { weekdays: { shorthand: ['یک', 'دو', 'سه', 'چهار', 'پنج', 'جمعه', 'شنبه'], - longhand: [ - 'یک‌شنبه', - 'دوشنبه', - 'سه‌شنبه', - 'چهارشنبه', - 'پنچ‌شنبه', - 'جمعه', - 'شنبه', - ], + longhand: ['یک‌شنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنچ‌شنبه', 'جمعه', 'شنبه'], }, months: { diff --git a/src/dates/l10n/fo.ts b/src/dates/l10n/fo.ts index 9bd66fa..aa4ec64 100644 --- a/src/dates/l10n/fo.ts +++ b/src/dates/l10n/fo.ts @@ -16,20 +16,7 @@ export const Faroese: CustomDateLocale = { }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'Mai', - 'Jun', - 'Jul', - 'Aug', - 'Sep', - 'Okt', - 'Nov', - 'Des', - ], + shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], longhand: [ 'Januar', 'Februar', diff --git a/src/dates/l10n/fr.ts b/src/dates/l10n/fr.ts index f2bdece..cf33c21 100644 --- a/src/dates/l10n/fr.ts +++ b/src/dates/l10n/fr.ts @@ -6,15 +6,7 @@ export const French: CustomDateLocale = { weekdays: { shorthand: ['dim', 'lun', 'mar', 'mer', 'jeu', 'ven', 'sam'], - longhand: [ - 'dimanche', - 'lundi', - 'mardi', - 'mercredi', - 'jeudi', - 'vendredi', - 'samedi', - ], + longhand: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], }, months: { diff --git a/src/dates/l10n/ga.ts b/src/dates/l10n/ga.ts index cb473a8..fa1afe5 100644 --- a/src/dates/l10n/ga.ts +++ b/src/dates/l10n/ga.ts @@ -18,20 +18,7 @@ export const Irish: CustomDateLocale = { }, months: { - shorthand: [ - 'Ean', - 'Fea', - 'Már', - 'Aib', - 'Bea', - 'Mei', - 'Iúi', - 'Lún', - 'MFo', - 'DFo', - 'Sam', - 'Nol', - ], + shorthand: ['Ean', 'Fea', 'Már', 'Aib', 'Bea', 'Mei', 'Iúi', 'Lún', 'MFo', 'DFo', 'Sam', 'Nol'], longhand: [ 'Eanáir', 'Feabhra', diff --git a/src/dates/l10n/gr.ts b/src/dates/l10n/gr.ts index 576f069..5fb30cc 100644 --- a/src/dates/l10n/gr.ts +++ b/src/dates/l10n/gr.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Greek: CustomDateLocale = { weekdays: { shorthand: ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πέ', 'Πα', 'Σά'], - longhand: [ - 'Κυριακή', - 'Δευτέρα', - 'Τρίτη', - 'Τετάρτη', - 'Πέμπτη', - 'Παρασκευή', - 'Σάββατο', - ], + longhand: ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'], }, months: { - shorthand: [ - 'Ιαν', - 'Φεβ', - 'Μάρ', - 'Απρ', - 'Μάι', - 'Ιού', - 'Ιού', - 'Αύγ', - 'Σεπ', - 'Οκτ', - 'Νοέ', - 'Δεκ', - ], + shorthand: ['Ιαν', 'Φεβ', 'Μάρ', 'Απρ', 'Μάι', 'Ιού', 'Ιού', 'Αύγ', 'Σεπ', 'Οκτ', 'Νοέ', 'Δεκ'], longhand: [ 'Ιανουάριος', 'Φεβρουάριος', diff --git a/src/dates/l10n/hi.ts b/src/dates/l10n/hi.ts index 4205815..55e17c0 100644 --- a/src/dates/l10n/hi.ts +++ b/src/dates/l10n/hi.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Hindi: CustomDateLocale = { weekdays: { shorthand: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'], - longhand: [ - 'रविवार', - 'सोमवार', - 'मंगलवार', - 'बुधवार', - 'गुरुवार', - 'शुक्रवार', - 'शनिवार', - ], + longhand: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार'], }, months: { diff --git a/src/dates/l10n/hr.ts b/src/dates/l10n/hr.ts index ed00519..d5d7a83 100644 --- a/src/dates/l10n/hr.ts +++ b/src/dates/l10n/hr.ts @@ -6,15 +6,7 @@ export const Croatian: CustomDateLocale = { weekdays: { shorthand: ['Ned', 'Pon', 'Uto', 'Sri', 'Čet', 'Pet', 'Sub'], - longhand: [ - 'Nedjelja', - 'Ponedjeljak', - 'Utorak', - 'Srijeda', - 'Četvrtak', - 'Petak', - 'Subota', - ], + longhand: ['Nedjelja', 'Ponedjeljak', 'Utorak', 'Srijeda', 'Četvrtak', 'Petak', 'Subota'], }, months: { diff --git a/src/dates/l10n/hu.ts b/src/dates/l10n/hu.ts index c92bdc8..114d390 100644 --- a/src/dates/l10n/hu.ts +++ b/src/dates/l10n/hu.ts @@ -6,15 +6,7 @@ export const Hungarian: CustomDateLocale = { weekdays: { shorthand: ['V', 'H', 'K', 'Sz', 'Cs', 'P', 'Szo'], - longhand: [ - 'Vasárnap', - 'Hétfő', - 'Kedd', - 'Szerda', - 'Csütörtök', - 'Péntek', - 'Szombat', - ], + longhand: ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'], }, months: { diff --git a/src/dates/l10n/id.ts b/src/dates/l10n/id.ts index e8ec8f5..116e203 100644 --- a/src/dates/l10n/id.ts +++ b/src/dates/l10n/id.ts @@ -8,20 +8,7 @@ export const Indonesian: CustomDateLocale = { }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'Mei', - 'Jun', - 'Jul', - 'Agu', - 'Sep', - 'Okt', - 'Nov', - 'Des', - ], + shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des'], longhand: [ 'Januari', 'Februari', diff --git a/src/dates/l10n/is.ts b/src/dates/l10n/is.ts index 9c0eb33..d86d5af 100644 --- a/src/dates/l10n/is.ts +++ b/src/dates/l10n/is.ts @@ -16,20 +16,7 @@ export const Icelandic: CustomDateLocale = { }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'Maí', - 'Jún', - 'Júl', - 'Ágú', - 'Sep', - 'Okt', - 'Nóv', - 'Des', - ], + shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'Maí', 'Jún', 'Júl', 'Ágú', 'Sep', 'Okt', 'Nóv', 'Des'], longhand: [ 'Janúar', 'Febrúar', diff --git a/src/dates/l10n/it.ts b/src/dates/l10n/it.ts index 74ac227..5ac1fce 100644 --- a/src/dates/l10n/it.ts +++ b/src/dates/l10n/it.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Italian: CustomDateLocale = { weekdays: { shorthand: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'], - longhand: [ - 'Domenica', - 'Lunedì', - 'Martedì', - 'Mercoledì', - 'Giovedì', - 'Venerdì', - 'Sabato', - ], + longhand: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'], }, months: { - shorthand: [ - 'Gen', - 'Feb', - 'Mar', - 'Apr', - 'Mag', - 'Giu', - 'Lug', - 'Ago', - 'Set', - 'Ott', - 'Nov', - 'Dic', - ], + shorthand: ['Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic'], longhand: [ 'Gennaio', 'Febbraio', diff --git a/src/dates/l10n/ja.ts b/src/dates/l10n/ja.ts index 7016b63..427b9aa 100644 --- a/src/dates/l10n/ja.ts +++ b/src/dates/l10n/ja.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Japanese: CustomDateLocale = { weekdays: { shorthand: ['日', '月', '火', '水', '木', '金', '土'], - longhand: [ - '日曜日', - '月曜日', - '火曜日', - '水曜日', - '木曜日', - '金曜日', - '土曜日', - ], + longhand: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'], }, months: { diff --git a/src/dates/l10n/ka.ts b/src/dates/l10n/ka.ts index 97f8bed..52f9ea7 100644 --- a/src/dates/l10n/ka.ts +++ b/src/dates/l10n/ka.ts @@ -4,31 +4,10 @@ import { CustomDateLocale } from '../../types/Dates'; export const Georgian: CustomDateLocale = { weekdays: { shorthand: ['კვ', 'ორ', 'სა', 'ოთ', 'ხუ', 'პა', 'შა'], - longhand: [ - 'კვირა', - 'ორშაბათი', - 'სამშაბათი', - 'ოთხშაბათი', - 'ხუთშაბათი', - 'პარასკევი', - 'შაბათი', - ], + longhand: ['კვირა', 'ორშაბათი', 'სამშაბათი', 'ოთხშაბათი', 'ხუთშაბათი', 'პარასკევი', 'შაბათი'], }, months: { - shorthand: [ - 'იან', - 'თებ', - 'მარ', - 'აპრ', - 'მაი', - 'ივნ', - 'ივლ', - 'აგვ', - 'სექ', - 'ოქტ', - 'ნოე', - 'დეკ', - ], + shorthand: ['იან', 'თებ', 'მარ', 'აპრ', 'მაი', 'ივნ', 'ივლ', 'აგვ', 'სექ', 'ოქტ', 'ნოე', 'დეკ'], longhand: [ 'იანვარი', 'თებერვალი', diff --git a/src/dates/l10n/km.ts b/src/dates/l10n/km.ts index 864e341..1090c8b 100644 --- a/src/dates/l10n/km.ts +++ b/src/dates/l10n/km.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Khmer: CustomDateLocale = { weekdays: { shorthand: ['អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស.', 'សុក្រ', 'សៅរ៍'], - longhand: [ - 'អាទិត្យ', - 'ចន្ទ', - 'អង្គារ', - 'ពុធ', - 'ព្រហស្បតិ៍', - 'សុក្រ', - 'សៅរ៍', - ], + longhand: ['អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍'], }, months: { shorthand: [ diff --git a/src/dates/l10n/ko.ts b/src/dates/l10n/ko.ts index df72717..5e059ad 100644 --- a/src/dates/l10n/ko.ts +++ b/src/dates/l10n/ko.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Korean: CustomDateLocale = { weekdays: { shorthand: ['일', '월', '화', '수', '목', '금', '토'], - longhand: [ - '일요일', - '월요일', - '화요일', - '수요일', - '목요일', - '금요일', - '토요일', - ], + longhand: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'], }, months: { diff --git a/src/dates/l10n/kz.ts b/src/dates/l10n/kz.ts index cf0fff0..9d5d583 100644 --- a/src/dates/l10n/kz.ts +++ b/src/dates/l10n/kz.ts @@ -4,31 +4,10 @@ import { CustomDateLocale } from '../../types/Dates'; export const Kazakh: CustomDateLocale = { weekdays: { shorthand: ['Жс', 'Дс', 'Сc', 'Ср', 'Бс', 'Жм', 'Сб'], - longhand: [ - 'Жексенбi', - 'Дүйсенбi', - 'Сейсенбi', - 'Сәрсенбi', - 'Бейсенбi', - 'Жұма', - 'Сенбi', - ], + longhand: ['Жексенбi', 'Дүйсенбi', 'Сейсенбi', 'Сәрсенбi', 'Бейсенбi', 'Жұма', 'Сенбi'], }, months: { - shorthand: [ - 'Қаң', - 'Ақп', - 'Нау', - 'Сәу', - 'Мам', - 'Мау', - 'Шiл', - 'Там', - 'Қыр', - 'Қаз', - 'Қар', - 'Жел', - ], + shorthand: ['Қаң', 'Ақп', 'Нау', 'Сәу', 'Мам', 'Мау', 'Шiл', 'Там', 'Қыр', 'Қаз', 'Қар', 'Жел'], longhand: [ 'Қаңтар', 'Ақпан', diff --git a/src/dates/l10n/lt.ts b/src/dates/l10n/lt.ts index 9966c30..dbdef4e 100644 --- a/src/dates/l10n/lt.ts +++ b/src/dates/l10n/lt.ts @@ -16,20 +16,7 @@ export const Lithuanian: CustomDateLocale = { }, months: { - shorthand: [ - 'Sau', - 'Vas', - 'Kov', - 'Bal', - 'Geg', - 'Bir', - 'Lie', - 'Rgp', - 'Rgs', - 'Spl', - 'Lap', - 'Grd', - ], + shorthand: ['Sau', 'Vas', 'Kov', 'Bal', 'Geg', 'Bir', 'Lie', 'Rgp', 'Rgs', 'Spl', 'Lap', 'Grd'], longhand: [ 'Sausis', 'Vasaris', diff --git a/src/dates/l10n/lv.ts b/src/dates/l10n/lv.ts index 2105e06..8cc1d8a 100644 --- a/src/dates/l10n/lv.ts +++ b/src/dates/l10n/lv.ts @@ -18,20 +18,7 @@ export const Latvian: CustomDateLocale = { }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'Mai', - 'Jūn', - 'Jūl', - 'Aug', - 'Sep', - 'Okt', - 'Nov', - 'Dec', - ], + shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jūn', 'Jūl', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'], longhand: [ 'Janvāris', 'Februāris', diff --git a/src/dates/l10n/mk.ts b/src/dates/l10n/mk.ts index 3b618b5..4ac06d3 100644 --- a/src/dates/l10n/mk.ts +++ b/src/dates/l10n/mk.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Macedonian: CustomDateLocale = { weekdays: { shorthand: ['Не', 'По', 'Вт', 'Ср', 'Че', 'Пе', 'Са'], - longhand: [ - 'Недела', - 'Понеделник', - 'Вторник', - 'Среда', - 'Четврток', - 'Петок', - 'Сабота', - ], + longhand: ['Недела', 'Понеделник', 'Вторник', 'Среда', 'Четврток', 'Петок', 'Сабота'], }, months: { - shorthand: [ - 'Јан', - 'Фев', - 'Мар', - 'Апр', - 'Мај', - 'Јун', - 'Јул', - 'Авг', - 'Сеп', - 'Окт', - 'Ное', - 'Дек', - ], + shorthand: ['Јан', 'Фев', 'Мар', 'Апр', 'Мај', 'Јун', 'Јул', 'Авг', 'Сеп', 'Окт', 'Ное', 'Дек'], longhand: [ 'Јануари', 'Февруари', diff --git a/src/dates/l10n/ms.ts b/src/dates/l10n/ms.ts index 1b446e5..dcca0b3 100644 --- a/src/dates/l10n/ms.ts +++ b/src/dates/l10n/ms.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Malaysian: CustomDateLocale = { weekdays: { shorthand: ['Min', 'Isn', 'Sel', 'Rab', 'Kha', 'Jum', 'Sab'], - longhand: [ - 'Minggu', - 'Isnin', - 'Selasa', - 'Rabu', - 'Khamis', - 'Jumaat', - 'Sabtu', - ], + longhand: ['Minggu', 'Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu'], }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mac', - 'Apr', - 'Mei', - 'Jun', - 'Jul', - 'Ogo', - 'Sep', - 'Okt', - 'Nov', - 'Dis', - ], + shorthand: ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ogo', 'Sep', 'Okt', 'Nov', 'Dis'], longhand: [ 'Januari', 'Februari', diff --git a/src/dates/l10n/my.ts b/src/dates/l10n/my.ts index 294bada..e415abe 100644 --- a/src/dates/l10n/my.ts +++ b/src/dates/l10n/my.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Burmese: CustomDateLocale = { weekdays: { shorthand: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], - longhand: [ - 'တနင်္ဂနွေ', - 'တနင်္လာ', - 'အင်္ဂါ', - 'ဗုဒ္ဓဟူး', - 'ကြာသပတေး', - 'သောကြာ', - 'စနေ', - ], + longhand: ['တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ'], }, months: { diff --git a/src/dates/l10n/nl.ts b/src/dates/l10n/nl.ts index 9c56fc6..d4cf86e 100644 --- a/src/dates/l10n/nl.ts +++ b/src/dates/l10n/nl.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Dutch: CustomDateLocale = { weekdays: { shorthand: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], - longhand: [ - 'zondag', - 'maandag', - 'dinsdag', - 'woensdag', - 'donderdag', - 'vrijdag', - 'zaterdag', - ], + longhand: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], }, months: { diff --git a/src/dates/l10n/no.ts b/src/dates/l10n/no.ts index e223fc9..2d1b71d 100644 --- a/src/dates/l10n/no.ts +++ b/src/dates/l10n/no.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Norwegian: CustomDateLocale = { weekdays: { shorthand: ['Søn', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'Lør'], - longhand: [ - 'Søndag', - 'Mandag', - 'Tirsdag', - 'Onsdag', - 'Torsdag', - 'Fredag', - 'Lørdag', - ], + longhand: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag'], }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'Mai', - 'Jun', - 'Jul', - 'Aug', - 'Sep', - 'Okt', - 'Nov', - 'Des', - ], + shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], longhand: [ 'Januar', 'Februar', diff --git a/src/dates/l10n/pa.ts b/src/dates/l10n/pa.ts index 93a3915..93ee6d7 100644 --- a/src/dates/l10n/pa.ts +++ b/src/dates/l10n/pa.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Punjabi: CustomDateLocale = { weekdays: { shorthand: ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁੱਧ', 'ਵੀਰ', 'ਸ਼ੁੱਕਰ', 'ਸ਼ਨਿੱਚਰ'], - longhand: [ - 'ਐਤਵਾਰ', - 'ਸੋਮਵਾਰ', - 'ਮੰਗਲਵਾਰ', - 'ਬੁੱਧਵਾਰ', - 'ਵੀਰਵਾਰ', - 'ਸ਼ੁੱਕਰਵਾਰ', - 'ਸ਼ਨਿੱਚਰਵਾਰ', - ], + longhand: ['ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁੱਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨਿੱਚਰਵਾਰ'], }, months: { - shorthand: [ - 'ਜਨ', - 'ਫ਼ਰ', - 'ਮਾਰ', - 'ਅਪ੍ਰੈ', - 'ਮਈ', - 'ਜੂਨ', - 'ਜੁਲਾ', - 'ਅਗ', - 'ਸਤੰ', - 'ਅਕ', - 'ਨਵੰ', - 'ਦਸੰ', - ], + shorthand: ['ਜਨ', 'ਫ਼ਰ', 'ਮਾਰ', 'ਅਪ੍ਰੈ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾ', 'ਅਗ', 'ਸਤੰ', 'ਅਕ', 'ਨਵੰ', 'ਦਸੰ'], longhand: [ 'ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', diff --git a/src/dates/l10n/pl.ts b/src/dates/l10n/pl.ts index 25b2b46..b396eff 100644 --- a/src/dates/l10n/pl.ts +++ b/src/dates/l10n/pl.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Polish: CustomDateLocale = { weekdays: { shorthand: ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'], - longhand: [ - 'Niedziela', - 'Poniedziałek', - 'Wtorek', - 'Środa', - 'Czwartek', - 'Piątek', - 'Sobota', - ], + longhand: ['Niedziela', 'Poniedziałek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota'], }, months: { - shorthand: [ - 'Sty', - 'Lut', - 'Mar', - 'Kwi', - 'Maj', - 'Cze', - 'Lip', - 'Sie', - 'Wrz', - 'Paź', - 'Lis', - 'Gru', - ], + shorthand: ['Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrz', 'Paź', 'Lis', 'Gru'], longhand: [ 'Styczeń', 'Luty', diff --git a/src/dates/l10n/pt.ts b/src/dates/l10n/pt.ts index 9222630..9253aeb 100644 --- a/src/dates/l10n/pt.ts +++ b/src/dates/l10n/pt.ts @@ -16,20 +16,7 @@ export const Portuguese: CustomDateLocale = { }, months: { - shorthand: [ - 'Jan', - 'Fev', - 'Mar', - 'Abr', - 'Mai', - 'Jun', - 'Jul', - 'Ago', - 'Set', - 'Out', - 'Nov', - 'Dez', - ], + shorthand: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'], longhand: [ 'Janeiro', 'Fevereiro', diff --git a/src/dates/l10n/ro.ts b/src/dates/l10n/ro.ts index 7cc4eaf..1d57c32 100644 --- a/src/dates/l10n/ro.ts +++ b/src/dates/l10n/ro.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Romanian: CustomDateLocale = { weekdays: { shorthand: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'], - longhand: [ - 'Duminică', - 'Luni', - 'Marți', - 'Miercuri', - 'Joi', - 'Vineri', - 'Sâmbătă', - ], + longhand: ['Duminică', 'Luni', 'Marți', 'Miercuri', 'Joi', 'Vineri', 'Sâmbătă'], }, months: { - shorthand: [ - 'Ian', - 'Feb', - 'Mar', - 'Apr', - 'Mai', - 'Iun', - 'Iul', - 'Aug', - 'Sep', - 'Oct', - 'Noi', - 'Dec', - ], + shorthand: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun', 'Iul', 'Aug', 'Sep', 'Oct', 'Noi', 'Dec'], longhand: [ 'Ianuarie', 'Februarie', diff --git a/src/dates/l10n/ru.ts b/src/dates/l10n/ru.ts index 316acfa..0941c9c 100644 --- a/src/dates/l10n/ru.ts +++ b/src/dates/l10n/ru.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Russian: CustomDateLocale = { weekdays: { shorthand: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'], - longhand: [ - 'Воскресенье', - 'Понедельник', - 'Вторник', - 'Среда', - 'Четверг', - 'Пятница', - 'Суббота', - ], + longhand: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'], }, months: { shorthand: [ diff --git a/src/dates/l10n/si.ts b/src/dates/l10n/si.ts index aebf7e9..b09581b 100644 --- a/src/dates/l10n/si.ts +++ b/src/dates/l10n/si.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Sinhala: CustomDateLocale = { weekdays: { shorthand: ['ඉ', 'ස', 'අ', 'බ', 'බ්‍ර', 'සි', 'සෙ'], - longhand: [ - 'ඉරිදා', - 'සඳුදා', - 'අඟහරුවාදා', - 'බදාදා', - 'බ්‍රහස්පතින්දා', - 'සිකුරාදා', - 'සෙනසුරාදා', - ], + longhand: ['ඉරිදා', 'සඳුදා', 'අඟහරුවාදා', 'බදාදා', 'බ්‍රහස්පතින්දා', 'සිකුරාදා', 'සෙනසුරාදා'], }, months: { diff --git a/src/dates/l10n/sk.ts b/src/dates/l10n/sk.ts index a7924cc..9fec73d 100644 --- a/src/dates/l10n/sk.ts +++ b/src/dates/l10n/sk.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Slovak: CustomDateLocale = { weekdays: { shorthand: ['Ned', 'Pon', 'Ut', 'Str', 'Štv', 'Pia', 'Sob'], - longhand: [ - 'Nedeľa', - 'Pondelok', - 'Utorok', - 'Streda', - 'Štvrtok', - 'Piatok', - 'Sobota', - ], + longhand: ['Nedeľa', 'Pondelok', 'Utorok', 'Streda', 'Štvrtok', 'Piatok', 'Sobota'], }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'Máj', - 'Jún', - 'Júl', - 'Aug', - 'Sep', - 'Okt', - 'Nov', - 'Dec', - ], + shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'Máj', 'Jún', 'Júl', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'], longhand: [ 'Január', 'Február', diff --git a/src/dates/l10n/sl.ts b/src/dates/l10n/sl.ts index 6dbc792..125753d 100644 --- a/src/dates/l10n/sl.ts +++ b/src/dates/l10n/sl.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Slovenian: CustomDateLocale = { weekdays: { shorthand: ['Ned', 'Pon', 'Tor', 'Sre', 'Čet', 'Pet', 'Sob'], - longhand: [ - 'Nedelja', - 'Ponedeljek', - 'Torek', - 'Sreda', - 'Četrtek', - 'Petek', - 'Sobota', - ], + longhand: ['Nedelja', 'Ponedeljek', 'Torek', 'Sreda', 'Četrtek', 'Petek', 'Sobota'], }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'Maj', - 'Jun', - 'Jul', - 'Avg', - 'Sep', - 'Okt', - 'Nov', - 'Dec', - ], + shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Avg', 'Sep', 'Okt', 'Nov', 'Dec'], longhand: [ 'Januar', 'Februar', diff --git a/src/dates/l10n/sq.ts b/src/dates/l10n/sq.ts index 865ae4c..9cdbfcc 100644 --- a/src/dates/l10n/sq.ts +++ b/src/dates/l10n/sq.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Albanian: CustomDateLocale = { weekdays: { shorthand: ['Di', 'Hë', 'Ma', 'Më', 'En', 'Pr', 'Sh'], - longhand: [ - 'E Diel', - 'E Hënë', - 'E Martë', - 'E Mërkurë', - 'E Enjte', - 'E Premte', - 'E Shtunë', - ], + longhand: ['E Diel', 'E Hënë', 'E Martë', 'E Mërkurë', 'E Enjte', 'E Premte', 'E Shtunë'], }, months: { - shorthand: [ - 'Jan', - 'Shk', - 'Mar', - 'Pri', - 'Maj', - 'Qer', - 'Kor', - 'Gus', - 'Sht', - 'Tet', - 'Nën', - 'Dhj', - ], + shorthand: ['Jan', 'Shk', 'Mar', 'Pri', 'Maj', 'Qer', 'Kor', 'Gus', 'Sht', 'Tet', 'Nën', 'Dhj'], longhand: [ 'Janar', 'Shkurt', diff --git a/src/dates/l10n/sr-cyr.ts b/src/dates/l10n/sr-cyr.ts index ced236c..05a0d12 100644 --- a/src/dates/l10n/sr-cyr.ts +++ b/src/dates/l10n/sr-cyr.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const SerbianCyrillic: CustomDateLocale = { weekdays: { shorthand: ['Нед', 'Пон', 'Уто', 'Сре', 'Чет', 'Пет', 'Суб'], - longhand: [ - 'Недеља', - 'Понедељак', - 'Уторак', - 'Среда', - 'Четвртак', - 'Петак', - 'Субота', - ], + longhand: ['Недеља', 'Понедељак', 'Уторак', 'Среда', 'Четвртак', 'Петак', 'Субота'], }, months: { - shorthand: [ - 'Јан', - 'Феб', - 'Мар', - 'Апр', - 'Мај', - 'Јун', - 'Јул', - 'Авг', - 'Сеп', - 'Окт', - 'Нов', - 'Дец', - ], + shorthand: ['Јан', 'Феб', 'Мар', 'Апр', 'Мај', 'Јун', 'Јул', 'Авг', 'Сеп', 'Окт', 'Нов', 'Дец'], longhand: [ 'Јануар', 'Фебруар', diff --git a/src/dates/l10n/sr.ts b/src/dates/l10n/sr.ts index 11a758b..8147beb 100644 --- a/src/dates/l10n/sr.ts +++ b/src/dates/l10n/sr.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Serbian: CustomDateLocale = { weekdays: { shorthand: ['Ned', 'Pon', 'Uto', 'Sre', 'Čet', 'Pet', 'Sub'], - longhand: [ - 'Nedelja', - 'Ponedeljak', - 'Utorak', - 'Sreda', - 'Četvrtak', - 'Petak', - 'Subota', - ], + longhand: ['Nedelja', 'Ponedeljak', 'Utorak', 'Sreda', 'Četvrtak', 'Petak', 'Subota'], }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'Maj', - 'Jun', - 'Jul', - 'Avg', - 'Sep', - 'Okt', - 'Nov', - 'Dec', - ], + shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Avg', 'Sep', 'Okt', 'Nov', 'Dec'], longhand: [ 'Januar', 'Februar', diff --git a/src/dates/l10n/sv.ts b/src/dates/l10n/sv.ts index 8704298..bebff5c 100644 --- a/src/dates/l10n/sv.ts +++ b/src/dates/l10n/sv.ts @@ -7,32 +7,11 @@ export const Swedish: CustomDateLocale = { weekdays: { shorthand: ['Sön', 'Mån', 'Tis', 'Ons', 'Tor', 'Fre', 'Lör'], - longhand: [ - 'Söndag', - 'Måndag', - 'Tisdag', - 'Onsdag', - 'Torsdag', - 'Fredag', - 'Lördag', - ], + longhand: ['Söndag', 'Måndag', 'Tisdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lördag'], }, months: { - shorthand: [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'Maj', - 'Jun', - 'Jul', - 'Aug', - 'Sep', - 'Okt', - 'Nov', - 'Dec', - ], + shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'], longhand: [ 'Januari', 'Februari', diff --git a/src/dates/l10n/th.ts b/src/dates/l10n/th.ts index 5e56140..ab1fe0e 100644 --- a/src/dates/l10n/th.ts +++ b/src/dates/l10n/th.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Thai: CustomDateLocale = { weekdays: { shorthand: ['อา', 'จ', 'อ', 'พ', 'พฤ', 'ศ', 'ส'], - longhand: [ - 'อาทิตย์', - 'จันทร์', - 'อังคาร', - 'พุธ', - 'พฤหัสบดี', - 'ศุกร์', - 'เสาร์', - ], + longhand: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'], }, months: { diff --git a/src/dates/l10n/tr.ts b/src/dates/l10n/tr.ts index 2ca728b..47e9af9 100644 --- a/src/dates/l10n/tr.ts +++ b/src/dates/l10n/tr.ts @@ -4,32 +4,11 @@ import { CustomDateLocale } from '../../types/Dates'; export const Turkish: CustomDateLocale = { weekdays: { shorthand: ['Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt'], - longhand: [ - 'Pazar', - 'Pazartesi', - 'Salı', - 'Çarşamba', - 'Perşembe', - 'Cuma', - 'Cumartesi', - ], + longhand: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'], }, months: { - shorthand: [ - 'Oca', - 'Şub', - 'Mar', - 'Nis', - 'May', - 'Haz', - 'Tem', - 'Ağu', - 'Eyl', - 'Eki', - 'Kas', - 'Ara', - ], + shorthand: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'], longhand: [ 'Ocak', 'Şubat', diff --git a/src/dates/l10n/uk.ts b/src/dates/l10n/uk.ts index 3a68364..6629ac9 100644 --- a/src/dates/l10n/uk.ts +++ b/src/dates/l10n/uk.ts @@ -6,32 +6,11 @@ export const Ukrainian: CustomDateLocale = { weekdays: { shorthand: ['Нд', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'], - longhand: [ - 'Неділя', - 'Понеділок', - 'Вівторок', - 'Середа', - 'Четвер', - "П'ятниця", - 'Субота', - ], + longhand: ['Неділя', 'Понеділок', 'Вівторок', 'Середа', 'Четвер', "П'ятниця", 'Субота'], }, months: { - shorthand: [ - 'Січ', - 'Лют', - 'Бер', - 'Кві', - 'Тра', - 'Чер', - 'Лип', - 'Сер', - 'Вер', - 'Жов', - 'Лис', - 'Гру', - ], + shorthand: ['Січ', 'Лют', 'Бер', 'Кві', 'Тра', 'Чер', 'Лип', 'Сер', 'Вер', 'Жов', 'Лис', 'Гру'], longhand: [ 'Січень', 'Лютий', diff --git a/src/dates/l10n/uz.ts b/src/dates/l10n/uz.ts index 4555eb1..f997ccd 100644 --- a/src/dates/l10n/uz.ts +++ b/src/dates/l10n/uz.ts @@ -4,31 +4,10 @@ import { CustomDateLocale } from '../../types/Dates'; export const Uzbek: CustomDateLocale = { weekdays: { shorthand: ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'], - longhand: [ - 'Якшанба', - 'Душанба', - 'Сешанба', - 'Чоршанба', - 'Пайшанба', - 'Жума', - 'Шанба', - ], + longhand: ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'], }, months: { - shorthand: [ - 'Янв', - 'Фев', - 'Мар', - 'Апр', - 'Май', - 'Июн', - 'Июл', - 'Авг', - 'Сен', - 'Окт', - 'Ноя', - 'Дек', - ], + shorthand: ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'], longhand: [ 'Январ', 'Феврал', diff --git a/src/dates/l10n/uz_latn.ts b/src/dates/l10n/uz_latn.ts index 5da40a2..96188f9 100644 --- a/src/dates/l10n/uz_latn.ts +++ b/src/dates/l10n/uz_latn.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const UzbekLatin: CustomDateLocale = { weekdays: { shorthand: ['Ya', 'Du', 'Se', 'Cho', 'Pa', 'Ju', 'Sha'], - longhand: [ - 'Yakshanba', - 'Dushanba', - 'Seshanba', - 'Chorshanba', - 'Payshanba', - 'Juma', - 'Shanba', - ], + longhand: ['Yakshanba', 'Dushanba', 'Seshanba', 'Chorshanba', 'Payshanba', 'Juma', 'Shanba'], }, months: { shorthand: [ diff --git a/src/dates/l10n/vn.ts b/src/dates/l10n/vn.ts index 843ac27..5605366 100644 --- a/src/dates/l10n/vn.ts +++ b/src/dates/l10n/vn.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Vietnamese: CustomDateLocale = { weekdays: { shorthand: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], - longhand: [ - 'Chủ nhật', - 'Thứ hai', - 'Thứ ba', - 'Thứ tư', - 'Thứ năm', - 'Thứ sáu', - 'Thứ bảy', - ], + longhand: ['Chủ nhật', 'Thứ hai', 'Thứ ba', 'Thứ tư', 'Thứ năm', 'Thứ sáu', 'Thứ bảy'], }, months: { diff --git a/src/dates/l10n/zh-tw.ts b/src/dates/l10n/zh-tw.ts index 3a1d85d..3f2b644 100644 --- a/src/dates/l10n/zh-tw.ts +++ b/src/dates/l10n/zh-tw.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const MandarinTraditional: CustomDateLocale = { weekdays: { shorthand: ['週日', '週一', '週二', '週三', '週四', '週五', '週六'], - longhand: [ - '星期日', - '星期一', - '星期二', - '星期三', - '星期四', - '星期五', - '星期六', - ], + longhand: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], }, months: { shorthand: [ diff --git a/src/dates/l10n/zh.ts b/src/dates/l10n/zh.ts index 119860f..d5a6acf 100644 --- a/src/dates/l10n/zh.ts +++ b/src/dates/l10n/zh.ts @@ -4,15 +4,7 @@ import { CustomDateLocale } from '../../types/Dates'; export const Mandarin: CustomDateLocale = { weekdays: { shorthand: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], - longhand: [ - '星期日', - '星期一', - '星期二', - '星期三', - '星期四', - '星期五', - '星期六', - ], + longhand: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], }, months: { diff --git a/src/dates/parseDate.ts b/src/dates/parseDate.ts index 525a1b8..9eba041 100644 --- a/src/dates/parseDate.ts +++ b/src/dates/parseDate.ts @@ -1,12 +1,17 @@ import clone from '../helpers/clone'; import { - DateValue, DateLocale, TokenRegex, TokenParsingFunctions, TokenParsingFunction, DateToken, + DateValue, + DateLocale, + TokenRegex, + TokenParsingFunctions, + TokenParsingFunction, + DateToken, } from '../types/Dates'; import { English } from './l10n/default'; -const boolToInt = (bool: boolean) : 1 | 0 => (bool === true ? 1 : 0); +const boolToInt = (bool: boolean): 1 | 0 => (bool === true ? 1 : 0); const doNothing = (): undefined => undefined; @@ -26,8 +31,7 @@ const tokenParsingFunctions: TokenParsingFunctions = { }, K: (dateObj: Date, amPM: string, locale: DateLocale) => { dateObj.setHours( - (dateObj.getHours() % 12) - + 12 * boolToInt(new RegExp(locale.amPM[1], 'i').test(amPM)), + (dateObj.getHours() % 12) + 12 * boolToInt(new RegExp(locale.amPM[1], 'i').test(amPM)), ); }, M(dateObj: Date, shortMonth: string, locale: DateLocale) { @@ -40,15 +44,7 @@ const tokenParsingFunctions: TokenParsingFunctions = { W(dateObj: Date, weekNum: string, locale: DateLocale) { const weekNumber = parseInt(weekNum, 10); - const date = new Date( - dateObj.getFullYear(), - 0, - 2 + (weekNumber - 1) * 7, - 0, - 0, - 0, - 0, - ); + const date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0); date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek); return date; @@ -127,7 +123,11 @@ const isIsoString = (date: string): boolean => date.toLowerCase().endsWith('z'); const getIsBackSlash = (char: string | undefined): boolean => char === '\\'; -const getTokenParsingOperationsFromFormat = (date: string, format: string, locale: DateLocale): { fn: TokenParsingFunction; match: string }[] => { +const getTokenParsingOperationsFromFormat = ( + date: string, + format: string, + locale: DateLocale, +): { fn: TokenParsingFunction; match: string }[] => { // The regex used for the `K` token is different for English and other languages const localeTokenRegex = { ...tokenRegex }; // Generates something like `(AM|PM|am|pm)` @@ -181,7 +181,12 @@ const getToday = (): Date => { return today; }; -const parseDate = (date: DateValue | undefined | null, fromFormat = 'Y-m-d H:i:S', timeless?: boolean, customLocale?: DateLocale): Date | undefined => { +const parseDate = ( + date: DateValue | undefined | null, + fromFormat = 'Y-m-d H:i:S', + timeless?: boolean, + customLocale?: DateLocale, +): Date | undefined => { if (date !== 0 && !date) { return undefined; } diff --git a/src/dates/visibleDaysInMonthView.ts b/src/dates/visibleDaysInMonthView.ts index c03c3c8..05261ec 100644 --- a/src/dates/visibleDaysInMonthView.ts +++ b/src/dates/visibleDaysInMonthView.ts @@ -7,22 +7,28 @@ import getFirstDayOfPrevMonth from './getFirstDayOfPrevMonth'; import getLastDayOfMonth from './getLastDayOfMonth'; import getLastDayOfPrevMonth from './getLastDayOfPrevMonth'; -const getNextMonthDays = (firstDayOfNextMonth: Date, monthDays: Date[], prevMonthDays: Date[]): Date[] => { +const getNextMonthDays = ( + firstDayOfNextMonth: Date, + monthDays: Date[], + prevMonthDays: Date[], +): Date[] => { const nextMonthTotalDays = 7 - ((monthDays.length + prevMonthDays.length) % 7); if (nextMonthTotalDays === 7) { return []; } - return Array.from({ length: nextMonthTotalDays }, (_x, i) => i + 1) - .map((day) => getDateInDayNumber(firstDayOfNextMonth, day)); + return Array.from({ length: nextMonthTotalDays }, (_x, i) => i + 1).map((day) => getDateInDayNumber(firstDayOfNextMonth, day)); }; -const getMonthDays = (month: Date, lastDayOfMonth: Date): Date[] => Array - .from({ length: lastDayOfMonth.getDate() }, (_x, i) => i + 1) - .map((day) => getDateInDayNumber(month, day)); +const getMonthDays = (month: Date, lastDayOfMonth: Date): Date[] => Array.from({ length: lastDayOfMonth.getDate() }, (_x, i) => i + 1).map((day) => getDateInDayNumber(month, day)); -const getPreviousMonthDays = (month: Date, firstDayOfPrevMonth: Date, lastDayOfPrevMonth: Date, weekstart: WeekDay): Date[] => { +const getPreviousMonthDays = ( + month: Date, + firstDayOfPrevMonth: Date, + lastDayOfPrevMonth: Date, + weekstart: WeekDay, +): Date[] => { let prevMonthTotalDays = getFirstDayOfMonth(month).getDay() - weekstart; if (prevMonthTotalDays < 0) { prevMonthTotalDays = 7 + prevMonthTotalDays; @@ -39,7 +45,12 @@ const visibleDaysInMonthView = (month: Date, weekstart: WeekDay = WeekDay.Sunday const lastDayOfMonth = getLastDayOfMonth(month); const firstDayOfNextMonth = getFirstDayOfNextMonth(month); - const prevMonthDays = getPreviousMonthDays(month, firstDayOfPrevMonth, lastDayOfPrevMonth, weekstart); + const prevMonthDays = getPreviousMonthDays( + month, + firstDayOfPrevMonth, + lastDayOfPrevMonth, + weekstart, + ); const monthDays = getMonthDays(month, lastDayOfMonth); const nextMonthDays = getNextMonthDays(firstDayOfNextMonth, monthDays, prevMonthDays); diff --git a/src/filterOptions.ts b/src/filterOptions.ts index 360162c..f4965d8 100644 --- a/src/filterOptions.ts +++ b/src/filterOptions.ts @@ -18,7 +18,8 @@ const filterOptions = (options: NormalizedOptions, query: string): NormalizedOpt } return option; - }).filter((option: NormalizedOption): boolean => { + }) + .filter((option: NormalizedOption): boolean => { const foundText = String(option.text) .toUpperCase() .trim() diff --git a/src/helpers/clone.ts b/src/helpers/clone.ts index 7b6ff97..21f93ad 100644 --- a/src/helpers/clone.ts +++ b/src/helpers/clone.ts @@ -1,5 +1,5 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any -const clone =

(obj: P): P => { +const clone =

(obj: P): P => { if (obj instanceof Date) { return new Date(obj.valueOf()) as P; } diff --git a/src/helpers/debounce.ts b/src/helpers/debounce.ts index b26f285..33c5121 100644 --- a/src/helpers/debounce.ts +++ b/src/helpers/debounce.ts @@ -2,7 +2,7 @@ type DebounceFn = (...args: any[]) => void; export type DebouncedFn = { - cancel: () => void, + cancel: () => void } & DebounceFn; const debounce = (func: (...args: any[]) => void, wait = 200): DebouncedFn => { diff --git a/src/helpers/elementIsTargetOrTargetChild.ts b/src/helpers/elementIsTargetOrTargetChild.ts index 784ec09..469d1c7 100644 --- a/src/helpers/elementIsTargetOrTargetChild.ts +++ b/src/helpers/elementIsTargetOrTargetChild.ts @@ -1,4 +1,7 @@ -const elementIsTargetOrTargetChild = (target: EventTarget | null, wrapper: HTMLElement) : boolean => { +const elementIsTargetOrTargetChild = ( + target: EventTarget | null, + wrapper: HTMLElement, +): boolean => { if (!(target instanceof Element)) { return false; } diff --git a/src/helpers/get.ts b/src/helpers/get.ts index c50b9b5..9127a4c 100644 --- a/src/helpers/get.ts +++ b/src/helpers/get.ts @@ -1,5 +1,9 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -const get = (object: T, path: string | number | symbol, defaultValue?: unknown): K | undefined => { +const get = ( + object: T, + path: string | number | symbol, + defaultValue?: unknown, +): K | undefined => { const result = String(path) .replace(/\[/g, '.') .replace(/\]/g, '') diff --git a/src/helpers/getFocusableElements.ts b/src/helpers/getFocusableElements.ts index 97bcf73..11a6073 100644 --- a/src/helpers/getFocusableElements.ts +++ b/src/helpers/getFocusableElements.ts @@ -1,7 +1,7 @@ -const getFocusableElements = (element: HTMLElement): Array => Array - .from(element.querySelectorAll( +const getFocusableElements = (element: HTMLElement): Array => Array.from( + element.querySelectorAll( 'a, button, input, textarea, select, details, [contenteditable], [tabindex]:not([tabindex="-1"])', - )) - .filter((el) => !el.hasAttribute('disabled')) as Array; + ), +).filter((el) => !el.hasAttribute('disabled')) as Array; export default getFocusableElements; diff --git a/src/helpers/hasProperty.ts b/src/helpers/hasProperty.ts index af98060..2cc00f8 100644 --- a/src/helpers/hasProperty.ts +++ b/src/helpers/hasProperty.ts @@ -1,4 +1,7 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any -const hasProperty = (obj: X | undefined, prop: Y): obj is X & Record => obj !== null && typeof obj === 'object' && Object.prototype.hasOwnProperty.call(obj, prop); +const hasProperty = ( + obj: X | undefined, + prop: Y, +): obj is X & Record => obj !== null && typeof obj === 'object' && Object.prototype.hasOwnProperty.call(obj, prop); export default hasProperty; diff --git a/src/helpers/isObject.ts b/src/helpers/isObject.ts new file mode 100644 index 0000000..75ff499 --- /dev/null +++ b/src/helpers/isObject.ts @@ -0,0 +1,17 @@ +const isObject = , U>(value: T | U): value is T => { + if (!value) { + return false; + } + + if (typeof value !== 'object') { + return false; + } + + if (Array.isArray(value)) { + return false; + } + + return true; +}; + +export default isObject; diff --git a/src/helpers/pick.ts b/src/helpers/pick.ts index 2d07f5f..6a4e3e2 100644 --- a/src/helpers/pick.ts +++ b/src/helpers/pick.ts @@ -1,5 +1,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -const pick = (object: T, condition: (value: T[K], key: K) => boolean = (value) => !!value): T => { +const pick = ( + object: T, + condition: (value: T[K], key: K) => boolean = (value) => !!value, +): T => { const newObject = { ...object }; Object.keys(object) diff --git a/src/helpers/promisify.ts b/src/helpers/promisify.ts index 1bc8046..eb12c3c 100644 --- a/src/helpers/promisify.ts +++ b/src/helpers/promisify.ts @@ -1,4 +1,4 @@ -const promisify =

(value: Promise

| P) : Promise

=> { +const promisify =

(value: Promise

| P): Promise

=> { if (value instanceof Promise) { return value; } diff --git a/src/helpers/promisifyFunctionResult.ts b/src/helpers/promisifyFunctionResult.ts index d5af79b..8e01cc6 100644 --- a/src/helpers/promisifyFunctionResult.ts +++ b/src/helpers/promisifyFunctionResult.ts @@ -1,7 +1,10 @@ import promisify from './promisify'; /* eslint-disable @typescript-eslint/no-explicit-any */ -const promisifyFunctionResult =

(fn: (...args: P) => K | Promise, ...args: P) : Promise => { +const promisifyFunctionResult =

( + fn: (...args: P) => K | Promise, + ...args: P +): Promise => { const result = fn(...args); return promisify(result); diff --git a/src/helpers/throttle.ts b/src/helpers/throttle.ts index 111f17e..8301d7f 100644 --- a/src/helpers/throttle.ts +++ b/src/helpers/throttle.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -const throttle = (func: (...args: any[]) => void, wait = 200): (...args: any[]) => void => { +const throttle = (func: (...args: any[]) => void, wait = 200): ((...args: any[]) => void) => { let isCalled = false; return (...args: any[]) => { diff --git a/src/mergeClasses.ts b/src/mergeClasses.ts index 8cea21d..afa0add 100644 --- a/src/mergeClasses.ts +++ b/src/mergeClasses.ts @@ -1,21 +1,58 @@ -import { CSSClass, CSSClasses, CSSClassKeyValuePair } from './types/CSSClass'; +import { CSSClasses, CSSClassKeyValuePair } from './types/CSSClass'; export const selectClasses = (classesObject: CSSClassKeyValuePair): CSSClasses => Object.keys(classesObject).filter((className: string) => !!classesObject[className]); -const mergeClasses = (...classes: CSSClasses): string => classes - .map((className: CSSClass): string => { - if (typeof className === 'string' || className === undefined) { - return className || ''; - } - - if (Array.isArray(className)) { - return mergeClasses(...className); - } - - return mergeClasses(...selectClasses(className)); - }) - .join(' ') - .replace(/ +/g, ' ') - .trim(); +const mergeClasses = (...classes: CSSClasses): string => { + const mergedClasses = new Set(); + + // We use a local function to iterate over the classes so we can pass the + // currently mergeed classes to functional definitions + const merge = (...nestedClasses: CSSClasses) => { + nestedClasses.forEach((className) => { + if (!className) { + return; + } + + if (typeof className === 'boolean') { + return; + } + + if (typeof className === 'string') { + const classNames = className.replace(/ +/g, ' ').trim().split(' '); + if (classNames.length > 1) { + merge(...classNames); + } else { + mergedClasses.add(classNames[0]); + } + return; + } + + if (Array.isArray(className)) { + merge(...className); + return; + } + + if (typeof className === 'function') { + className({ + clear() { + mergedClasses.clear(); + }, + add(...cssClass: string[]) { + merge(...cssClass); + }, + remove(cssClass: string) { + mergedClasses.delete(cssClass); + }, + }); + return; + } + + merge(...selectClasses(className)); + }); + }; + merge(...classes); + + return Array.from(mergedClasses).join(' '); +}; export default mergeClasses; diff --git a/src/parseVariantWithClassesList.ts b/src/parseVariantWithClassesList.ts index 3b5ac19..f69dd16 100644 --- a/src/parseVariantWithClassesList.ts +++ b/src/parseVariantWithClassesList.ts @@ -9,14 +9,12 @@ import pick from './helpers/pick'; import mergeClasses from './mergeClasses'; import { CSSClassesList, CSSRawClassesList } from './types'; import hasProperty from './helpers/hasProperty'; +import isObject from './helpers/isObject'; -const getCustomPropsFromVariant = < - P extends ObjectWithClassesList, - ClassesKeys extends string, ->( - variants?: VariantsWithClassesList, - variant?: string, - ): WithVariantPropsAndClassesList | undefined => { +const getCustomPropsFromVariant =

( + variants?: VariantsWithClassesList, + variant?: string, +): WithVariantPropsAndClassesList | undefined => { if (variant !== undefined && variants) { return variants[variant]; } @@ -24,10 +22,11 @@ const getCustomPropsFromVariant = < return undefined; }; -const getShouldClearClasses = < - P extends ObjectWithClassesList, - ClassesKeys extends string, ->(props: WithVariantPropsAndClassesList, key: string, variant: string | undefined): boolean => { +const getShouldClearClasses =

( + props: WithVariantPropsAndClassesList, + key: string, + variant: string | undefined, +): boolean => { if (variant === undefined) { return hasProperty(props, key) && (props[key] === undefined || props[key] === null); } @@ -35,21 +34,21 @@ const getShouldClearClasses = < if (props.variants !== undefined && props.variants[variant] !== undefined) { const propsVariant = props.variants[variant] as WithVariantProps

; - return hasProperty(propsVariant, key) && (propsVariant[key] === undefined || propsVariant[key] === null); + return ( + hasProperty(propsVariant, key) + && (propsVariant[key] === undefined || propsVariant[key] === null) + ); } return false; }; -const parseVariantWithClassesList = < - P extends ObjectWithClassesList, - ClassesKeys extends string, ->( - props: WithVariantPropsAndClassesList, - classesListKeys: Readonly>, - globalConfiguration?: WithVariantPropsAndClassesList, - defaultConfiguration?: WithVariantPropsAndClassesList, - ): P => { +const parseVariantWithClassesList =

( + props: WithVariantPropsAndClassesList, + classesListKeys: Readonly>, + globalConfiguration?: WithVariantPropsAndClassesList, + defaultConfiguration?: WithVariantPropsAndClassesList, +): P => { const { variants, variant, ...mainProps } = { ...defaultConfiguration, ...globalConfiguration, @@ -69,31 +68,67 @@ const parseVariantWithClassesList = < }); } else { classesListKeys.forEach((classItemKey) => { - if (props.classes !== undefined && hasProperty(props.classes, classItemKey)) { - classes[classItemKey] = props.classes[classItemKey]; - } else if (globalConfiguration !== undefined && globalConfiguration.classes !== undefined && hasProperty(globalConfiguration.classes, classItemKey)) { + // Get classes from global configuration or alternatively from library configuration + if ( + globalConfiguration + && isObject(globalConfiguration.classes) + && classItemKey in globalConfiguration.classes + ) { classes[classItemKey] = globalConfiguration.classes[classItemKey]; - } else if (defaultConfiguration !== undefined && defaultConfiguration.classes !== undefined && hasProperty(defaultConfiguration.classes, classItemKey)) { + } else if ( + defaultConfiguration + && isObject(defaultConfiguration.classes) + && classItemKey in defaultConfiguration.classes + ) { classes[classItemKey] = defaultConfiguration.classes[classItemKey]; } + // Get classes from props and merge them with the previous ones + if (isObject(props.classes) && classItemKey in props.classes) { + if (typeof props.classes[classItemKey] !== 'undefined') { + classes[classItemKey] = [classes[classItemKey], props.classes[classItemKey]]; + } else { + classes[classItemKey] = undefined; + } + } + if (variant) { if (props.variants !== undefined && props.variants[variant] !== undefined) { const propsVariant = props.variants[variant] as WithVariantProps

; - if (propsVariant.classes && hasProperty(propsVariant.classes, classItemKey)) { + if (isObject(propsVariant.classes) && classItemKey in propsVariant.classes) { classes[classItemKey] = propsVariant.classes[classItemKey]; } - } else if (globalConfiguration !== undefined && globalConfiguration.variants !== undefined && globalConfiguration.variants[variant] !== undefined) { - const globalConfigurationVariant = globalConfiguration.variants[variant] as WithVariantProps

; - - if (globalConfigurationVariant.classes && hasProperty(globalConfigurationVariant.classes, classItemKey)) { + } else if ( + globalConfiguration + && isObject(globalConfiguration.variants) + && variant in globalConfiguration.variants + ) { + const globalConfigurationVariant = globalConfiguration.variants[ + variant + ] as WithVariantProps

; + + if ( + globalConfigurationVariant.classes + && isObject(globalConfigurationVariant.classes) + && classItemKey in globalConfigurationVariant.classes + ) { classes[classItemKey] = globalConfigurationVariant.classes[classItemKey]; } - } else if (defaultConfiguration !== undefined && defaultConfiguration.variants !== undefined && defaultConfiguration.variants[variant] !== undefined) { - const defaultConfigurationVariant = defaultConfiguration.variants[variant] as WithVariantProps

; - - if (defaultConfigurationVariant.classes && hasProperty(defaultConfigurationVariant.classes, classItemKey)) { + } else if ( + defaultConfiguration !== undefined + && defaultConfiguration.variants !== undefined + && defaultConfiguration.variants[variant] !== undefined + ) { + const defaultConfigurationVariant = defaultConfiguration.variants[ + variant + ] as WithVariantProps

; + + if ( + defaultConfigurationVariant.classes + && isObject(defaultConfigurationVariant.classes) + && classItemKey in defaultConfigurationVariant.classes + ) { classes[classItemKey] = defaultConfigurationVariant.classes[classItemKey]; } } @@ -107,31 +142,68 @@ const parseVariantWithClassesList = < }); } else { classesListKeys.forEach((classItemKey) => { - if (props.fixedClasses !== undefined && hasProperty(props.fixedClasses, classItemKey)) { - fixedClasses[classItemKey] = props.fixedClasses[classItemKey]; - } else if (globalConfiguration !== undefined && globalConfiguration.fixedClasses !== undefined && hasProperty(globalConfiguration.fixedClasses, classItemKey)) { + // Get classes from global configuration or alternatively from library configuration + if ( + globalConfiguration + && isObject(globalConfiguration.fixedClasses) + && classItemKey in globalConfiguration.fixedClasses + ) { fixedClasses[classItemKey] = globalConfiguration.fixedClasses[classItemKey]; - } else if (defaultConfiguration !== undefined && defaultConfiguration.fixedClasses !== undefined && hasProperty(defaultConfiguration.fixedClasses, classItemKey)) { + } else if ( + defaultConfiguration + && isObject(defaultConfiguration.fixedClasses) + && classItemKey in defaultConfiguration.fixedClasses + ) { fixedClasses[classItemKey] = defaultConfiguration.fixedClasses[classItemKey]; } + // Get classes from props and merge them with the previous ones + if (isObject(props.fixedClasses) && classItemKey in props.fixedClasses) { + if (typeof props.fixedClasses[classItemKey] !== 'undefined') { + fixedClasses[classItemKey] = [ + fixedClasses[classItemKey], + props.fixedClasses[classItemKey], + ]; + } else { + classes[classItemKey] = undefined; + } + } + if (variant) { if (props.variants !== undefined && props.variants[variant] !== undefined) { const propsVariant = props.variants[variant] as WithVariantProps

; - if (propsVariant.fixedClasses && hasProperty(propsVariant.fixedClasses, classItemKey)) { + if (isObject(propsVariant.fixedClasses) && classItemKey in propsVariant.fixedClasses) { fixedClasses[classItemKey] = propsVariant.fixedClasses[classItemKey]; } - } else if (globalConfiguration !== undefined && globalConfiguration.variants !== undefined && globalConfiguration.variants[variant] !== undefined) { - const globalConfigurationVariant = globalConfiguration.variants[variant] as WithVariantProps

; - - if (globalConfigurationVariant.fixedClasses && hasProperty(globalConfigurationVariant.fixedClasses, classItemKey)) { + } else if ( + globalConfiguration !== undefined + && globalConfiguration.variants !== undefined + && globalConfiguration.variants[variant] !== undefined + ) { + const globalConfigurationVariant = globalConfiguration.variants[ + variant + ] as WithVariantProps

; + + if ( + isObject(globalConfigurationVariant.fixedClasses) + && classItemKey in globalConfigurationVariant.fixedClasses + ) { fixedClasses[classItemKey] = globalConfigurationVariant.fixedClasses[classItemKey]; } - } else if (defaultConfiguration !== undefined && defaultConfiguration.variants !== undefined && defaultConfiguration.variants[variant] !== undefined) { - const defaultConfigurationVariant = defaultConfiguration.variants[variant] as WithVariantProps

; - - if (defaultConfigurationVariant.fixedClasses && hasProperty(defaultConfigurationVariant.fixedClasses, classItemKey)) { + } else if ( + defaultConfiguration !== undefined + && defaultConfiguration.variants !== undefined + && defaultConfiguration.variants[variant] !== undefined + ) { + const defaultConfigurationVariant = defaultConfiguration.variants[ + variant + ] as WithVariantProps

; + + if ( + isObject(defaultConfigurationVariant.fixedClasses) + && classItemKey in defaultConfigurationVariant.fixedClasses + ) { fixedClasses[classItemKey] = defaultConfigurationVariant.fixedClasses[classItemKey]; } } diff --git a/src/types/CSSClass.ts b/src/types/CSSClass.ts index 96f07f5..df744f8 100644 --- a/src/types/CSSClass.ts +++ b/src/types/CSSClass.ts @@ -1,11 +1,21 @@ export type CSSClassKeyValuePair = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - [key: string]: any + [key: string]: CSSClass }; export type CSSClasses = CSSClass[]; -export type CSSClass = CSSClassKeyValuePair | string | CSSClasses | undefined; +export type CSSClass = + | CSSClassKeyValuePair + | string + | CSSClasses + | undefined + | null + | boolean + | ((modifiers: { + clear: () => void + add: (...cssClass: string[]) => void + remove: (cssClass: string) => void + }) => void); export type CSSRawClassesList = { [key in ClassesKeys]?: CSSClass diff --git a/src/types/Dates.ts b/src/types/Dates.ts index b1652d9..712e334 100644 --- a/src/types/Dates.ts +++ b/src/types/Dates.ts @@ -15,9 +15,9 @@ export type DateValue = Date | string | number; export type DateLocale = { weekdays: { - shorthand: [string, string, string, string, string, string, string]; - longhand: [string, string, string, string, string, string, string]; - }; + shorthand: [string, string, string, string, string, string, string] + longhand: [string, string, string, string, string, string, string] + } months: { shorthand: [ string, @@ -32,7 +32,7 @@ export type DateLocale = { string, string, string, - ]; + ] longhand: [ string, string, @@ -46,8 +46,8 @@ export type DateLocale = { string, string, string, - ]; - }; + ] + } daysInMonth: [ number, number, @@ -61,38 +61,38 @@ export type DateLocale = { number, number, number, - ]; - firstDayOfWeek: number; - ordinal: (nth: number) => string; - rangeSeparator: string; - weekAbbreviation: string; - amPM: [string, string]; - yearAriaLabel: string; - monthAriaLabel: string; - hourAriaLabel: string; - minuteAriaLabel: string; - time24hr: boolean; - timeLabel: string; - okLabel: string; + ] + firstDayOfWeek: number + ordinal: (nth: number) => string + rangeSeparator: string + weekAbbreviation: string + amPM: [string, string] + yearAriaLabel: string + monthAriaLabel: string + hourAriaLabel: string + minuteAriaLabel: string + time24hr: boolean + timeLabel: string + okLabel: string }; export type CustomDateLocale = { - ordinal?: DateLocale['ordinal']; - daysInMonth?: DateLocale['daysInMonth']; - firstDayOfWeek?: DateLocale['firstDayOfWeek']; - rangeSeparator?: DateLocale['rangeSeparator']; - weekAbbreviation?: DateLocale['weekAbbreviation']; - yearAriaLabel?: string; - hourAriaLabel?: string; - minuteAriaLabel?: string; - amPM?: DateLocale['amPM']; - time24hr?: DateLocale['time24hr']; - timeLabel?: DateLocale['timeLabel']; - okLabel?: DateLocale['okLabel']; + ordinal?: DateLocale['ordinal'] + daysInMonth?: DateLocale['daysInMonth'] + firstDayOfWeek?: DateLocale['firstDayOfWeek'] + rangeSeparator?: DateLocale['rangeSeparator'] + weekAbbreviation?: DateLocale['weekAbbreviation'] + yearAriaLabel?: string + hourAriaLabel?: string + minuteAriaLabel?: string + amPM?: DateLocale['amPM'] + time24hr?: DateLocale['time24hr'] + timeLabel?: DateLocale['timeLabel'] + okLabel?: DateLocale['okLabel'] weekdays: { - shorthand: [string, string, string, string, string, string, string]; - longhand: [string, string, string, string, string, string, string]; - }; + shorthand: [string, string, string, string, string, string, string] + longhand: [string, string, string, string, string, string, string] + } months: { shorthand: [ string, @@ -107,7 +107,7 @@ export type CustomDateLocale = { string, string, string, - ]; + ] longhand: [ string, string, @@ -121,8 +121,8 @@ export type CustomDateLocale = { string, string, string, - ]; - }; + ] + } }; export type DateLocaleName = @@ -236,13 +236,13 @@ export type DateParser = ( date: DateValue | null | undefined, givenFormat?: string, timeless?: boolean, - customLocale?: DateLocale, + customLocale?: DateLocale ) => Date | undefined; export type DateFormatter = ( date: Date | null | undefined, format?: string, - overrideLocale?: DateLocale, + overrideLocale?: DateLocale ) => string; export type DateCondition = DateValue | ((date: Date) => boolean); diff --git a/src/types/Misc.ts b/src/types/Misc.ts index 1526cea..f4c2a14 100644 --- a/src/types/Misc.ts +++ b/src/types/Misc.ts @@ -1,6 +1,6 @@ type Measure = string | number; type Data = Record; // eslint-disable-next-line @typescript-eslint/no-explicit-any -type PromiseRejectFn = ((reason?: any) => void); +type PromiseRejectFn = (reason?: any) => void; export { Measure, Data, PromiseRejectFn }; diff --git a/yarn.lock b/yarn.lock index f071d66..46b946a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4344,6 +4344,11 @@ prepend-http@^2.0.0: resolved "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= +prettier@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" + integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== + pretty-format@^27.0.0, pretty-format@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.0.6.tgz#ab770c47b2c6f893a21aefc57b75da63ef49a11f"