From 6d66a853aeab6a516695ee3de36eae91eeb7c8e7 Mon Sep 17 00:00:00 2001 From: Radoslav Karaivanov Date: Thu, 25 Apr 2024 14:09:21 +0300 Subject: [PATCH 1/3] build: Updated dependencies (#1183) --- package-lock.json | 80 +++++++++++++++++++++++------------------------ package.json | 4 +-- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/package-lock.json b/package-lock.json index 03f26dbe9..919a62496 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,8 +14,8 @@ "lit": "^3.1.3" }, "devDependencies": { - "@biomejs/biome": "1.7.0", - "@custom-elements-manifest/analyzer": "^0.9.4", + "@biomejs/biome": "1.7.1", + "@custom-elements-manifest/analyzer": "^0.9.6", "@igniteui/material-icons-extended": "^3.0.2", "@open-wc/testing": "^4.0.0", "@storybook/addon-a11y": "^8.0.9", @@ -2020,9 +2020,9 @@ } }, "node_modules/@biomejs/biome": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.7.0.tgz", - "integrity": "sha512-mejiRhnAq6UrXtYvjWJUKdstcT58n0/FfKemFf3d2Ou0HxOdS88HQmWtQ/UgyZvOEPD572YbFTb6IheyROpqkw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.7.1.tgz", + "integrity": "sha512-wb2UNoFXcgaMdKXKT5ytsYntaogl2FSTjDt20CZynF3v7OXQUcIpTrr+be3XoOGpoZRj3Ytq9TSpmplUREXmeA==", "dev": true, "hasInstallScript": true, "bin": { @@ -2036,20 +2036,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.7.0", - "@biomejs/cli-darwin-x64": "1.7.0", - "@biomejs/cli-linux-arm64": "1.7.0", - "@biomejs/cli-linux-arm64-musl": "1.7.0", - "@biomejs/cli-linux-x64": "1.7.0", - "@biomejs/cli-linux-x64-musl": "1.7.0", - "@biomejs/cli-win32-arm64": "1.7.0", - "@biomejs/cli-win32-x64": "1.7.0" + "@biomejs/cli-darwin-arm64": "1.7.1", + "@biomejs/cli-darwin-x64": "1.7.1", + "@biomejs/cli-linux-arm64": "1.7.1", + "@biomejs/cli-linux-arm64-musl": "1.7.1", + "@biomejs/cli-linux-x64": "1.7.1", + "@biomejs/cli-linux-x64-musl": "1.7.1", + "@biomejs/cli-win32-arm64": "1.7.1", + "@biomejs/cli-win32-x64": "1.7.1" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.7.0.tgz", - "integrity": "sha512-12TaeaKHU4SAZt0fQJ2bYk1jUb4foope7LmgDE5p3c0uMxd3mFkg1k7G721T+K6UHYULcSOQDsNNM8DhYi8Irg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.7.1.tgz", + "integrity": "sha512-qfLrIIB58dkgiY/1tgG6fSCBK22PZaSIf6blweZBsG6iMij05mEuJt50ne+zPnNFNUmt8t43NC/qOXT3iFHQBA==", "cpu": [ "arm64" ], @@ -2063,9 +2063,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.7.0.tgz", - "integrity": "sha512-6Qq1BSIB0cpp0cQNqO/+EiUV7FE3jMpF6w7+AgIBXp0oJxUWb2Ff0RDZdO9bfzkimXD58j0vGpNHMGnCcjDV2Q==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.7.1.tgz", + "integrity": "sha512-OGeyNsEcp5VnKbF9/TBjPCTHNEOm7oHegEve07U3KZmzqfpw2Oe3i9DVW8t6vvj1TYbrwWYCld25H34kBDY7Vg==", "cpu": [ "x64" ], @@ -2079,9 +2079,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.7.0.tgz", - "integrity": "sha512-GwSci7xBJ2j1CrdDXDUVXnUtrvypEz/xmiYPpFeVdlX5p95eXx+7FekPPbJfhGGw5WKSsKZ+V8AAlbN+kUwJWw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.7.1.tgz", + "integrity": "sha512-MQDf5wErj1iBvlcxCyOa0XqZYN8WJrupVgbNnqhntO3yVATg8GxduVUn1fDSaolznkDRsj7Pz3Xu1esBFwvfmg==", "cpu": [ "arm64" ], @@ -2095,9 +2095,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.7.0.tgz", - "integrity": "sha512-pwIY80nU7SAxrVVZ6HD9ah1pruwh9ZqlSR0Nvbg4ZJqQa0POhiB+RJx7+/1Ml2mTZdrl8kb/YiwQpD16uwb5wg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.7.1.tgz", + "integrity": "sha512-giH0/CzLOJ+wbxLxd5Shnr5xQf5fGnTRWLDe3lzjaF7IplVydNCEeZJtncB01SvyA6DAFJsvQ4LNxzAOQfEVCg==", "cpu": [ "arm64" ], @@ -2111,9 +2111,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.7.0.tgz", - "integrity": "sha512-1y+odKQsyHcw0JCGRuqhbx7Y6jxOVSh4lGIVDdJxW1b55yD22DY1kcMEfhUte6f95OIc2uqfkwtiI6xQAiZJdw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.7.1.tgz", + "integrity": "sha512-3wmCsGcC3KZ4pfTknXHfyMMlXPMhgfXVAcG5GlrR+Tq2JGiAw0EUydaLpsSBEbcG7IxH6OiUZEJZ95kAycCHBA==", "cpu": [ "x64" ], @@ -2127,9 +2127,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.7.0.tgz", - "integrity": "sha512-KzCA0mW4LSbCd7XZWaEJvTOTTBjfJoVEXkfq1fsXxww1HB+ww5PGMbhbIcbYCsj2CTJUifeD5hOkyuBVppU1xQ==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.7.1.tgz", + "integrity": "sha512-ySNDtPhsLxU125IFHHAxfpoHBpkM56s4mEXeO70GZtgZay/o1h8IUPWCWf5Z7gKgc4jwgYN1U1U9xabI3hZVAg==", "cpu": [ "x64" ], @@ -2143,9 +2143,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.7.0.tgz", - "integrity": "sha512-AvLDUYZBpOUFgS/mni4VruIoVV3uSGbKSkZQBPXsHgL0w4KttLll3NBrVanmWxOHsom6C6ocHLyfAY8HUc8TXg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.7.1.tgz", + "integrity": "sha512-8hIDakEqZn0i6+388noYKdZ0ZrovTwnvMU/Qp/oJou0G7EPVdXupOe0oxiQSdRN0W7f6CS/yjPCYuVGzDG6r0g==", "cpu": [ "arm64" ], @@ -2159,9 +2159,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.7.0.tgz", - "integrity": "sha512-Pylm00BAAuLVb40IH9PC17432BTsY8K4pSUvhvgR1eaalnMaD6ug9SYJTTzKDbT6r24MPAGCTiSZERyhGkGzFQ==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.7.1.tgz", + "integrity": "sha512-3W9k3uH6Ea6VOpAS9xkkAlS0LTfnGQjmIUCegZ8SDtK2NgJ1gO+qdEkGJb0ltahusFTN1QxJ107dM7ASA9IUEg==", "cpu": [ "x64" ], @@ -2277,9 +2277,9 @@ } }, "node_modules/@custom-elements-manifest/analyzer": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/@custom-elements-manifest/analyzer/-/analyzer-0.9.4.tgz", - "integrity": "sha512-XPjEbfkq71oQl6tIfDy1ashdvOf42p3BtqebEaUohqTEPAyBuShGwQiB2B7xjsUwi3VfSQCnPlGwmigIDPjtWg==", + "version": "0.9.6", + "resolved": "https://registry.npmjs.org/@custom-elements-manifest/analyzer/-/analyzer-0.9.6.tgz", + "integrity": "sha512-ryvrkmo02vOJikOLonMiB8z/7BQpeDnj9YC0R19Ikkd/UyWLTznfGXlCqsudGtvwb7PGJZAh1KHGFTfwjOVDWw==", "dev": true, "dependencies": { "@custom-elements-manifest/find-dependencies": "^0.0.5", diff --git a/package.json b/package.json index 9e35675f1..b1856d1b2 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,8 @@ "lit": "^3.1.3" }, "devDependencies": { - "@biomejs/biome": "1.7.0", - "@custom-elements-manifest/analyzer": "^0.9.4", + "@biomejs/biome": "1.7.1", + "@custom-elements-manifest/analyzer": "^0.9.6", "@igniteui/material-icons-extended": "^3.0.2", "@open-wc/testing": "^4.0.0", "@storybook/addon-a11y": "^8.0.9", From 7a574702695d8df8fb3e41df8a0f5b2b7bc2e767 Mon Sep 17 00:00:00 2001 From: Zdravko Kolev Date: Thu, 25 Apr 2024 14:12:17 +0300 Subject: [PATCH 2/3] Update README with slider docs reference (#1180) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aad31dd6b..f55711d47 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,8 @@ Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | |Snackbar|:white_check_mark:|[Docs](https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/notifications/snackbar)|[2.1.0](https://github.com/IgniteUI/igniteui-webcomponents/releases/tag/2.1.0)| |Toast|:white_check_mark:|[Docs](https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/notifications/toast)|[2.1.0](https://github.com/IgniteUI/igniteui-webcomponents/releases/tag/2.1.0)| |Rating|:white_check_mark:|[Docs](https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/inputs/rating)|[2.1.0](https://github.com/IgniteUI/igniteui-webcomponents/releases/tag/2.1.0)| -|Slider|:white_check_mark:|[Docs]()|[2.0.0](https://github.com/IgniteUI/igniteui-webcomponents/releases/tag/2.0.0)| -|Range Slider|:white_check_mark:|[Docs]()|[2.0.0](https://github.com/IgniteUI/igniteui-webcomponents/releases/tag/2.0.0)| +|Slider|:white_check_mark:|[Docs](https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/inputs/slider)|[2.0.0](https://github.com/IgniteUI/igniteui-webcomponents/releases/tag/2.0.0)| +|Range Slider|:white_check_mark:|[Docs](https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/inputs/slider)|[2.0.0](https://github.com/IgniteUI/igniteui-webcomponents/releases/tag/2.0.0)| |Avatar|:white_check_mark:|[Docs](https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/layouts/avatar)|[1.0.0](https://github.com/IgniteUI/igniteui-webcomponents/releases/tag/1.0.0)| |Badge|:white_check_mark:|[Docs](https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/inputs/badge)|[1.0.0](https://github.com/IgniteUI/igniteui-webcomponents/releases/tag/1.0.0)| |Button|:white_check_mark:|[Docs](https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/inputs/button)|[1.0.0](https://github.com/IgniteUI/igniteui-webcomponents/releases/tag/1.0.0)| From 07f7ef21013c5ca7c0800ce4c07e10d324ffb2d2 Mon Sep 17 00:00:00 2001 From: Radoslav Karaivanov Date: Thu, 25 Apr 2024 16:06:15 +0300 Subject: [PATCH 3/3] fix(date-time input): Label in Material with read-only (#1182) --- CHANGELOG.md | 3 ++ .../date-time-input/date-time-input.ts | 51 +++++++------------ tsconfig.json | 2 +- 3 files changed, 23 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 243292591..d3178d285 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Dropdown `positionStrategy` property. The dropdown now uses the Popover API to render its container in the top layer of the browser viewport, making the property obsolete. +### Fixed +- Date-time input - Label in Material theme is broken when component is in read-only mode [#1166](https://github.com/IgniteUI/igniteui-webcomponents/issues/1166) + ## [4.8.2] - 2024-04-15 ### Fixed - Textarea - resize handle position for non-suffixed textarea [#1094](https://github.com/IgniteUI/igniteui-webcomponents/issues/1094) diff --git a/src/components/date-time-input/date-time-input.ts b/src/components/date-time-input/date-time-input.ts index 2d8ce6a41..fedc46e3c 100644 --- a/src/components/date-time-input/date-time-input.ts +++ b/src/components/date-time-input/date-time-input.ts @@ -554,8 +554,9 @@ export default class IgcDateTimeInputComponent extends EventEmitterMixin< '0' ); - this._mask = - newMask.indexOf('tt') !== -1 ? newMask.replace(/tt/g, 'LL') : newMask; + this._mask = newMask.includes('tt') + ? newMask.replace(/tt/g, 'LL') + : newMask; this.parser.mask = this._mask; this.parser.prompt = this.prompt; @@ -566,15 +567,9 @@ export default class IgcDateTimeInputComponent extends EventEmitterMixin< } private parseDate(val: string) { - if (!val) { - return null; - } - - return DateTimeUtil.parseValueFromMask( - val, - this._inputDateParts, - this.prompt - ); + return val + ? DateTimeUtil.parseValueFromMask(val, this._inputDateParts, this.prompt) + : null; } private getMaskedValue(): string { @@ -606,17 +601,13 @@ export default class IgcDateTimeInputComponent extends EventEmitterMixin< } private isComplete(): boolean { - return this.maskedValue.indexOf(this.prompt) === -1; + return !this.maskedValue.includes(this.prompt); } private updateValue(): void { if (this.isComplete()) { const parsedDate = this.parseDate(this.maskedValue); - if (DateTimeUtil.isValidDate(parsedDate)) { - this.value = parsedDate; - } else { - this.value = null; - } + this.value = DateTimeUtil.isValidDate(parsedDate) ? parsedDate : null; } else { this.value = null; } @@ -627,29 +618,25 @@ export default class IgcDateTimeInputComponent extends EventEmitterMixin< } private getNewPosition(value: string, direction = 0): number { - const literals = this._inputDateParts.filter( - (p) => p.type === DateParts.Literal - ); - let cursorPos = this.selection.start; + const cursorPos = this.selection.start; if (!direction) { - do { - cursorPos = cursorPos > 0 ? --cursorPos : cursorPos; - } while (!literals.some((l) => l.end === cursorPos) && cursorPos > 0); - return cursorPos; + // Last literal before the current cursor position or start of input value + const part = this._inputDateParts.findLast( + (part) => part.type === DateParts.Literal && part.end < cursorPos + ); + return part?.end ?? 0; } - do { - cursorPos++; - } while ( - !literals.some((l) => l.start === cursorPos) && - cursorPos < value.length + + // First literal after the current cursor position or end of input value + const part = this._inputDateParts.find( + (part) => part.type === DateParts.Literal && part.start > cursorPos ); - return cursorPos; + return part?.start ?? value.length; } protected override async handleFocus() { this.focused = true; - this.updateMask(); super.handleFocus(); if (this.readOnly) { diff --git a/tsconfig.json b/tsconfig.json index 14b05d1fd..1f41b4cb7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "es2021", "module": "es2020", - "lib": ["es2022", "DOM", "DOM.Iterable"], + "lib": ["es2023", "DOM", "DOM.Iterable"], "outDir": "dist", "rootDir": "./", "declaration": true,