Skip to content

Commit

Permalink
chore(deps): update taiga-ui (#660)
Browse files Browse the repository at this point in the history
Co-authored-by: splincode <[email protected]>
Co-authored-by: taiga-family-bot <[email protected]>
  • Loading branch information
3 people authored Nov 15, 2023
1 parent 31f2d6c commit 78958bb
Show file tree
Hide file tree
Showing 11 changed files with 277 additions and 132 deletions.
14 changes: 0 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,13 @@ module.exports = {
files: ['*'],
rules: {
'@typescript-eslint/quotes': ['error', 'single'],
'@angular-eslint/pipe-prefix': 'off',
'@taiga-ui/experience/strict-tui-doc-example': 'off',
'@taiga-ui/experience/prefer-inject-decorator': 'off',
'@taiga-ui/experience/no-typeof': 'off',
'@typescript-eslint/naming-convention': 'off', // TODO
'@typescript-eslint/consistent-type-assertions': 'off',
'no-irregular-whitespace': 'off',
'max-statements': 'off',
'no-restricted-syntax': 'off', // TODO
},
},
{
files: ['*.spec.ts', '*.spec.tsx'],
rules: {
'no-undef': 'off',
},
},
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: [require.resolve('./tsconfig.eslint.json')],
},
};
310 changes: 235 additions & 75 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@
"@nrwl/tao": "13.1.4",
"@nrwl/web": "13.4.2",
"@nrwl/workspace": "13.1.4",
"@taiga-ui/commitlint-config": "0.3.4",
"@taiga-ui/cspell-config": "0.19.0",
"@taiga-ui/eslint-plugin-experience": "0.19.4",
"@taiga-ui/prettier-config": "0.4.1",
"@taiga-ui/stylelint-config": "0.6.0",
"@taiga-ui/commitlint-config": "0.4.0",
"@taiga-ui/cspell-config": "0.20.0",
"@taiga-ui/eslint-plugin-experience": "0.28.1",
"@taiga-ui/prettier-config": "0.5.0",
"@taiga-ui/stylelint-config": "0.8.0",
"@tinkoff/eslint-config": "1.54.4",
"@tinkoff/eslint-config-react": "1.54.4",
"@types/estree": "0.0.52",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('getNotEmptySelection', () => {
expect(getNotEmptySelection(elementStateStub, true)).toEqual([2, 3]);
});

it('should return value length as end position, when value`s length less or equal then end position ', () => {
it('should return value length as end position, when value`s length less or equal then end position', () => {
const elementStateStub: ElementState = {
value: 'sx',
selection: [4, 4],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('Textarea (mask latin letters + digits)', () => {
{initialValue: '1', newValue: ''},
] as const;

for (const {initialValue, newValue} of tests) {
tests.forEach(({initialValue, newValue}) => {
it(`"${initialValue}|" => Ctrl + Backspace => "${newValue}|"`, () => {
cy.get('@textArea')
.type(initialValue)
Expand All @@ -92,7 +92,7 @@ describe('Textarea (mask latin letters + digits)', () => {
.should('have.prop', 'selectionStart', newValue.length)
.should('have.prop', 'selectionEnd', newValue.length);
});
}
});
});

it('Type `deleteWordBackward` of `InputEvent`', () => {
Expand Down
16 changes: 8 additions & 8 deletions projects/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"@ng-web-apis/universal": "3.0.7",
"@nguniversal/express-engine": "12.1.3",
"@stackblitz/sdk": "1.9.0",
"@taiga-ui/addon-doc": "3.53.0",
"@taiga-ui/addon-mobile": "3.53.0",
"@taiga-ui/cdk": "3.53.0",
"@taiga-ui/core": "3.53.0",
"@taiga-ui/icons": "3.53.0",
"@taiga-ui/kit": "3.53.0",
"@taiga-ui/styles": "3.53.0",
"@taiga-ui/testing": "3.53.0",
"@taiga-ui/addon-doc": "3.54.0",
"@taiga-ui/addon-mobile": "3.54.0",
"@taiga-ui/cdk": "3.54.0",
"@taiga-ui/core": "3.54.0",
"@taiga-ui/icons": "3.54.0",
"@taiga-ui/kit": "3.54.0",
"@taiga-ui/styles": "3.54.0",
"@taiga-ui/testing": "3.54.0",
"@tinkoff/ng-dompurify": "4.0.0",
"dompurify": "3.0.6",
"ngx-markdown": "10.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ describe('maskitoPrefixPostprocessorGenerator', () => {
).toEqual({value: 'kg 123', selection: [1, 1]});
});

// eslint-disable-next-line jest/valid-title
it(' 123 => kg |123', () => {
expect(
postprocessor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ describe('parseDateRangeString', () => {
['1302202314032025', ['13022023', '14032025']],
] as const;

for (const [dateRangeString, expectedParsedDates] of tests) {
tests.forEach(([dateRangeString, expectedParsedDates]) => {
it(`${dateRangeString} => ${JSON.stringify(expectedParsedDates)}`, () => {
expect(parseDateRangeString(dateRangeString, 'dd.mm.yyyy', ' – ')).toEqual(
expectedParsedDates,
);
});
}
});
});
2 changes: 1 addition & 1 deletion projects/vue/src/lib/maskito.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Maskito Vue package', () => {
}),
};

test('formats text', async () => {
it('formats text', async () => {
const mounted = mount(component);

await Promise.resolve();
Expand Down
12 changes: 5 additions & 7 deletions projects/vue/src/lib/maskito.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,17 @@ async function update(
teardown.set(element, new Maskito(predicateResult, options));
}

function unmount(element: HTMLElement): void {
teardown.get(element)?.destroy();
teardown.delete(element);
predicates.delete(element);
}

export const maskito: ObjectDirective<
HTMLElement,
MaskitoOptions & {
elementPredicate?: MaskitoElementPredicate | MaskitoElementPredicateAsync;
}
> = {
unmounted: element => unmount(element),
unmounted: element => {
teardown.get(element)?.destroy();
teardown.delete(element);
predicates.delete(element);
},
mounted: async (element, {value}) => update(element, value),
updated: async (element, {value, oldValue}) => {
if (value !== oldValue) {
Expand Down
34 changes: 17 additions & 17 deletions scripts/helpers/bump-maskito-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ export function bumpMaskitoDeps({
isPeerDependency?: boolean;
ignores: string[];
}): void {
const keys = Object.keys(deps).filter(key => isMaskitoPackageName(key, ignores));

for (const key of keys) {
if (typeof deps[key] === 'string') {
deps[key] = isPeerDependency
? (deps[key] as string)?.replace(prevVersion, newVersion)
: `^${newVersion}`;
} else if (Object.prototype.hasOwnProperty.call(deps[key], 'requires')) {
bumpMaskitoDeps({
deps: (deps[key] as Record<string, Record<string, string>>).requires,
isPeerDependency,
ignores,
prevVersion,
newVersion,
});
}
}
Object.keys(deps)
.filter(key => isMaskitoPackageName(key, ignores))
.forEach(key => {
if (typeof deps[key] === 'string') {
deps[key] = isPeerDependency
? (deps[key] as string)?.replace(prevVersion, newVersion)
: `^${newVersion}`;
} else if (Object.prototype.hasOwnProperty.call(deps[key], 'requires')) {
bumpMaskitoDeps({
deps: (deps[key] as Record<string, Record<string, string>>).requires,
isPeerDependency,
ignores,
prevVersion,
newVersion,
});
}
});
}

0 comments on commit 78958bb

Please sign in to comment.