From 9a02d0a6145144c247c4377566ad31ca7e5a0563 Mon Sep 17 00:00:00 2001 From: "santiago.trigo" Date: Tue, 26 Mar 2024 17:15:41 +0100 Subject: [PATCH 1/4] fix: Select menu doesn't close on click outside sometimes in multipleSubtle variant - ValueContainer to use ChildrenValueContainer for conditional rendering --- .../components/ChildrenValueContainer.tsx | 26 +++++++++++++++++++ .../components/ValueContainer.tsx | 20 +++++--------- 2 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 packages/core/src/components/SelectControl/components/ChildrenValueContainer.tsx diff --git a/packages/core/src/components/SelectControl/components/ChildrenValueContainer.tsx b/packages/core/src/components/SelectControl/components/ChildrenValueContainer.tsx new file mode 100644 index 00000000..bd937ddc --- /dev/null +++ b/packages/core/src/components/SelectControl/components/ChildrenValueContainer.tsx @@ -0,0 +1,26 @@ +import * as React from 'react'; + +import { Typography } from '../../Typography'; +import { HFlex } from '../../HFlex'; +import { TSelectOption } from '../declarations'; + +type ChildrenValueContainer = { + multipleSubtle: boolean; + values: TSelectOption[]; + children: React.ReactNode; +}; + +export const ChildrenValueContainer: React.FC = ({ + multipleSubtle, + values, + children, +}) => ( + + {multipleSubtle && values.length > 0 && ( + + ({values.length}) + + )} + {children} + +); diff --git a/packages/core/src/components/SelectControl/components/ValueContainer.tsx b/packages/core/src/components/SelectControl/components/ValueContainer.tsx index 7ff04568..f52a1a21 100644 --- a/packages/core/src/components/SelectControl/components/ValueContainer.tsx +++ b/packages/core/src/components/SelectControl/components/ValueContainer.tsx @@ -9,10 +9,8 @@ import { DragEndEvent } from '@dnd-kit/core'; import type { TSelectOption } from '../declarations'; import { SelectControlContext } from '../context'; - -import { Typography } from '../../Typography'; -import { HFlex } from '../../HFlex'; import { SortableList } from './SorteableList'; +import { ChildrenValueContainer } from './ChildrenValueContainer'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ValueContainerProps extends RSValueContainerProps {} @@ -77,16 +75,12 @@ export const ValueContainer: React.FC = ({ return (
- {props.selectProps.multipleSubtle && values.length > 0 ? ( - - - ({values.length}) - - {children} - - ) : ( - children - )} + + {children} +
); From 8db5348b8367df789690cf056be4255939f68938 Mon Sep 17 00:00:00 2001 From: "santiago.trigo" Date: Wed, 27 Mar 2024 11:26:21 +0100 Subject: [PATCH 2/4] fix: Date cell editor with autofocus - Add autofocus support to DateTimePicker and enable DateEditor in table column presets --- .../datetime/src/components/DateTimePicker/DateTimePicker.tsx | 3 ++- packages/table/src/columnPresets/date.ts | 4 ++-- packages/table/src/editors/DateEditor/DateEditor.tsx | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/datetime/src/components/DateTimePicker/DateTimePicker.tsx b/packages/datetime/src/components/DateTimePicker/DateTimePicker.tsx index bedc5a59..b1823131 100644 --- a/packages/datetime/src/components/DateTimePicker/DateTimePicker.tsx +++ b/packages/datetime/src/components/DateTimePicker/DateTimePicker.tsx @@ -34,6 +34,7 @@ export const DateTimePicker: React.FC = ({ placeholder, size, value: customValue, + autofocus = false, ...restDateTimeProps }) => { const value = toTimestamp(customValue); @@ -47,7 +48,6 @@ export const DateTimePicker: React.FC = ({ const onChangeCallback = React.useCallback((ts: number) => { setDate(ts); }, []); - return ( = ({ onChange={onChange} placeholder={placeholder} size={size} + autoFocus={autofocus} /> = ({ onChange(event.currentTarget.value) } value={new Date(value as Date)} + autofocus={true} /> From 4b1e3b6139f8d659abad81a94f0685178c73263f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 19:41:00 +0000 Subject: [PATCH 3/4] vuln(deps-dev): bump express from 4.18.3 to 4.19.2 Bumps [express](https://github.com/expressjs/express) from 4.18.3 to 4.19.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.18.3...4.19.2) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index dba41243..64107276 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11099,9 +11099,9 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", "dev": true, "engines": { "node": ">= 0.6" @@ -13208,9 +13208,9 @@ } }, "node_modules/express": { - "version": "4.18.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.3.tgz", - "integrity": "sha512-6VyCijWQ+9O7WuVMTRBTl+cjNNIzD5cY5mQ1WM8r/LEkI2u8EYpOotESNwzNlyCn3g+dmjKYI6BmNneSr/FSRw==", + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", "dev": true, "dependencies": { "accepts": "~1.3.8", @@ -13218,7 +13218,7 @@ "body-parser": "1.20.2", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.5.0", + "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", From d63e09f10a1ef6d55a22111cefea2f7ff87ad24d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 00:01:07 +0000 Subject: [PATCH 4/4] build(deps): bump actions/configure-pages from 4 to 5 Bumps [actions/configure-pages](https://github.com/actions/configure-pages) from 4 to 5. - [Release notes](https://github.com/actions/configure-pages/releases) - [Commits](https://github.com/actions/configure-pages/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/configure-pages dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd52f103..1a9bb82c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,7 +138,7 @@ jobs: run: npm run build-storybook - name: Setup Pages - uses: actions/configure-pages@v4 + uses: actions/configure-pages@v5 - name: Upload artifact uses: actions/upload-pages-artifact@v3