From a8153b98d6701ac19475c02820c2531f8ad64fc1 Mon Sep 17 00:00:00 2001 From: Maksim Nedoshev Date: Tue, 2 May 2023 04:06:04 +0300 Subject: [PATCH] fix: types build and update ts to ^5.0 --- packages/ui/package.json | 3 +- .../VaTimePickerColumn/VaTimePickerColumn.vue | 2 +- .../ui/src/composables/useMaxSelections.ts | 2 +- packages/ui/src/composables/useParsable.ts | 4 +-- packages/ui/src/composables/useSyncProp.ts | 7 ++--- yarn.lock | 30 +++++++++---------- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/ui/package.json b/packages/ui/package.json index 90f7ba44c9..c19d7522b8 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -45,7 +45,8 @@ "@types/lodash": "^4.14.161", "cleave.js": "^1.6.0", "colortranslator": "^1.9.2", - "lodash": "^4.17.21" + "lodash": "^4.17.21", + "typescript": "^5" }, "devDependencies": { "@babel/core": "^7.12.3", diff --git a/packages/ui/src/components/va-time-picker/components/VaTimePickerColumn/VaTimePickerColumn.vue b/packages/ui/src/components/va-time-picker/components/VaTimePickerColumn/VaTimePickerColumn.vue index d3daacd587..1b2510a5a5 100644 --- a/packages/ui/src/components/va-time-picker/components/VaTimePickerColumn/VaTimePickerColumn.vue +++ b/packages/ui/src/components/va-time-picker/components/VaTimePickerColumn/VaTimePickerColumn.vue @@ -88,7 +88,7 @@ export default defineComponent({ const formatCell = (n: number | string): string => { if (!Number.isInteger(n)) { return n as string } - return n < 10 ? `0${n}` : `${n}` + return Number(n) < 10 ? `0${n}` : `${n}` } const { background } = useElementBackground(rootElement) diff --git a/packages/ui/src/composables/useMaxSelections.ts b/packages/ui/src/composables/useMaxSelections.ts index 9c3390b5be..d6c755d086 100644 --- a/packages/ui/src/composables/useMaxSelections.ts +++ b/packages/ui/src/composables/useMaxSelections.ts @@ -19,7 +19,7 @@ export function useMaxSelections ( ) { const exceedsMaxSelections = (): boolean => { if (maxSelections.value === undefined || isNaN(+maxSelections.value)) { return false } - return selections.value.length >= maxSelections.value + return selections.value.length >= Number(maxSelections.value) } const addOption = (optionToAdd: T) => { diff --git a/packages/ui/src/composables/useParsable.ts b/packages/ui/src/composables/useParsable.ts index 65d62a7bb7..3cf13cc89f 100644 --- a/packages/ui/src/composables/useParsable.ts +++ b/packages/ui/src/composables/useParsable.ts @@ -13,7 +13,7 @@ export const useParsable = any, - DefaultValue extends Props[PropName], - ReturnValue extends DefaultValue extends undefined ? Props[PropName] : DefaultValue -> (propName: PropName, props: Props, emit: Emit, defaultValue?: NonNullable) { + ReturnValue extends NonNullable +> (propName: PropName, props: Props, emit: Emit, defaultValue?: ReturnValue) { if (defaultValue === undefined) { return [ computed({ @@ -37,7 +36,7 @@ export function useSyncProp< ] } - const currentValue = props[propName] + const currentValue = props[propName] as ReturnValue const statefulValue = ref(currentValue === undefined ? defaultValue : currentValue) watch(() => props[propName], (newVal) => { diff --git a/yarn.lock b/yarn.lock index 67e0b47cce..e86e79f807 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7460,10 +7460,10 @@ entities@^4.2.0: resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== -entities@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4" - integrity sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q== +entities@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" + integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== env-paths@^2.2.0: version "2.2.1" @@ -11228,10 +11228,10 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== -linkify-it@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-4.0.1.tgz#01f1d5e508190d06669982ba31a7d9f56a5751ec" - integrity sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw== +linkify-it@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" + integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== dependencies: uc.micro "^1.0.1" @@ -11745,14 +11745,14 @@ markdown-it-attrs@^4.0.0: resolved "https://registry.yarnpkg.com/markdown-it-attrs/-/markdown-it-attrs-4.1.6.tgz#2bc331c7649d8c6396a0613c2bba1093f3e64da9" integrity sha512-O7PDKZlN8RFMyDX13JnctQompwrrILuz2y43pW2GagcwpIIElkAdfeek+erHfxUOlXWPsjFeWmZ8ch1xtRLWpA== -markdown-it@^13.0.1: - version "13.0.1" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-13.0.1.tgz#c6ecc431cacf1a5da531423fc6a42807814af430" - integrity sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q== +markdown-it@^12.3.2: + version "12.3.2" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" + integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== dependencies: argparse "^2.0.1" - entities "~3.0.1" - linkify-it "^4.0.1" + entities "~2.1.0" + linkify-it "^3.0.1" mdurl "^1.0.1" uc.micro "^1.0.5" @@ -17418,7 +17418,7 @@ typescript@^4.9.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== -typescript@^5.0.4: +typescript@^5, typescript@^5.0.4: version "5.0.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==