Skip to content

Commit

Permalink
Merge branch 'master' of github.com:DevoInc/genesys-ui
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/table/src/columnPresets/date.ts
  • Loading branch information
soslayando committed Apr 4, 2024
2 parents 08dad20 + 86e93fb commit afafa55
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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<ChildrenValueContainer> = ({
multipleSubtle,
values,
children,
}) => (
<HFlex spacing="cmp-xxs">
{multipleSubtle && values.length > 0 && (
<Typography.Caption colorScheme="weaker">
({values.length})
</Typography.Caption>
)}
{children}
</HFlex>
);
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down Expand Up @@ -77,16 +75,12 @@ export const ValueContainer: React.FC<ValueContainerProps> = ({
return (
<div ref={containerRef} className={containerClass}>
<components.ValueContainer {...props}>
{props.selectProps.multipleSubtle && values.length > 0 ? (
<HFlex spacing="cmp-xxs">
<Typography.Caption colorScheme="weaker">
({values.length})
</Typography.Caption>
{children}
</HFlex>
) : (
children
)}
<ChildrenValueContainer
values={values}
multipleSubtle={props.selectProps.multipleSubtle}
>
{children}
</ChildrenValueContainer>
</components.ValueContainer>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const DateTimePicker: React.FC<DateTimePickerProps> = ({
placeholder,
size,
value: customValue,
autofocus = false,
...restDateTimeProps
}) => {
const value = toTimestamp(customValue);
Expand All @@ -47,7 +48,6 @@ export const DateTimePicker: React.FC<DateTimePickerProps> = ({
const onChangeCallback = React.useCallback((ts: number) => {
setDate(ts);
}, []);

return (
<VFlex alignItems={'stretch'}>
<InputControl
Expand All @@ -58,6 +58,7 @@ export const DateTimePicker: React.FC<DateTimePickerProps> = ({
onChange={onChange}
placeholder={placeholder}
size={size}
autoFocus={autofocus}
/>
<DateTime
{...restDateTimeProps}
Expand Down
4 changes: 2 additions & 2 deletions packages/table/src/columnPresets/date.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TColDef } from '../declarations';
// import { DateEditor } from '../editors';
import { DateEditor } from '../editors';
import { TextRenderer } from '../renderers';
import { dateFormatter } from '../valueFormatters/date';
import { enUS } from 'date-fns/locale';
Expand All @@ -8,7 +8,7 @@ export const date: TColDef = {
id: 'date',
cellRenderer: TextRenderer,
valueFormatter: dateFormatter,
// cellEditor: DateEditor,
cellEditor: DateEditor,
context: {
formatDate: 'dd/MM/yyyy HH:mm:ss',
tz: 'Europe/Madrid',
Expand Down
1 change: 1 addition & 0 deletions packages/table/src/editors/DateEditor/DateEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const DateEditor: React.FC<TCellEditor> = ({
onChange(event.currentTarget.value)
}
value={new Date(value as Date)}
autofocus={true}
/>
</Popover.Panel>
</Popover>
Expand Down

0 comments on commit afafa55

Please sign in to comment.