diff --git a/app/package.json b/app/package.json index 77adac82e7..20659f7e8d 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "@epam/app", - "version": "5.11.1-alpha.0", + "version": "5.11.1-rc.0", "description": "EPAM Unified UI landing", "author": "EPAM", "license": "MIT", @@ -17,19 +17,19 @@ "dependencies": { "@babel/plugin-proposal-private-property-in-object": "7.21.11", "@elastic/apm-rum": "^5.14.0", - "@epam/assets": "5.11.1-alpha.0", - "@epam/draft-rte": "5.11.1-alpha.0", - "@epam/electric": "5.11.1-alpha.0", + "@epam/assets": "5.11.1-rc.0", + "@epam/draft-rte": "5.11.1-rc.0", + "@epam/electric": "5.11.1-rc.0", "@epam/internal": "0.0.2", - "@epam/loveship": "5.11.1-alpha.0", - "@epam/promo": "5.11.1-alpha.0", - "@epam/uui": "5.11.1-alpha.0", - "@epam/uui-components": "5.11.1-alpha.0", - "@epam/uui-core": "5.11.1-alpha.0", - "@epam/uui-db": "5.11.1-alpha.0", - "@epam/uui-docs": "5.11.1-alpha.0", - "@epam/uui-editor": "5.11.1-alpha.0", - "@epam/uui-timeline": "5.11.1-alpha.0", + "@epam/loveship": "5.11.1-rc.0", + "@epam/promo": "5.11.1-rc.0", + "@epam/uui": "5.11.1-rc.0", + "@epam/uui-components": "5.11.1-rc.0", + "@epam/uui-core": "5.11.1-rc.0", + "@epam/uui-db": "5.11.1-rc.0", + "@epam/uui-docs": "5.11.1-rc.0", + "@epam/uui-editor": "5.11.1-rc.0", + "@epam/uui-timeline": "5.11.1-rc.0", "@tanstack/react-query": "^5.17.19", "@udecode/plate-common": "31.3.2", "amplitude-js": "8.9.1", @@ -40,7 +40,6 @@ "imask": "6.0.7", "lodash.assign": "4.2.0", "prismjs": "^1.19.0", - "prop-types": "15.7.2", "qhistory": "1.0.3", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/app/src/demo/tables/editableTable/ProjectTableDemo.tsx b/app/src/demo/tables/editableTable/ProjectTableDemo.tsx index 0b035c6153..15cddc4187 100644 --- a/app/src/demo/tables/editableTable/ProjectTableDemo.tsx +++ b/app/src/demo/tables/editableTable/ProjectTableDemo.tsx @@ -135,7 +135,7 @@ export function ProjectTableDemo() { }, []); const insertTask = useCallback((position: DropPosition, relativeTask: Task | null = null, existingTask: Task | null = null) => { - const taskToInsert: Task = existingTask ? { ...existingTask, type: 'task' } : { id: lastId--, name: '', type: 'task' }; + const taskToInsert: Task = existingTask ? { ...existingTask, type: 'task' } : { id: lastId--, name: '', type: 'task', parentId: null }; const task: Task = setTaskInsertPosition(taskToInsert, relativeTask, position, treeRef.current); setValue((currentValue) => { @@ -153,9 +153,11 @@ export function ProjectTableDemo() { } } - let currentItems = currentValue.items - .set(task.id, task) - .set(parentTask.id, parentTask); + let currentItems = currentValue.items.set(task.id, task); + + if (parentTask) { + currentValue.items.set(parentTask.id, parentTask); + } if (prevParentTask !== null && prevParentTask !== NOT_FOUND_RECORD) { currentItems = currentItems.set(prevParentTask.id, prevParentTask); diff --git a/app/src/demo/tables/editableTable/TimelineMode.tsx b/app/src/demo/tables/editableTable/TimelineMode.tsx index 4f5dd455b3..f81c4979f9 100644 --- a/app/src/demo/tables/editableTable/TimelineMode.tsx +++ b/app/src/demo/tables/editableTable/TimelineMode.tsx @@ -31,7 +31,6 @@ export function TimelineMode({ value={ tableState } onValueChange={ setTableState } dataTableFocusManager={ dataTableFocusManager } - showColumnsConfig allowColumnsResizing allowColumnsReordering headerSize="60" diff --git a/app/src/docs/_examples/alert/Sizes.example.tsx b/app/src/docs/_examples/alert/Sizes.example.tsx index 1752b2a689..1df0b99520 100644 --- a/app/src/docs/_examples/alert/Sizes.example.tsx +++ b/app/src/docs/_examples/alert/Sizes.example.tsx @@ -15,6 +15,7 @@ export default function BasicAlertExample() { {' '} alert('close action') } actions={ [{ name: 'ACTION 1', action: () => null }, { name: 'ACTION 2', action: () => null }] } > diff --git a/app/src/docs/_examples/multiSwitch/Basic.example.tsx b/app/src/docs/_examples/multiSwitch/Basic.example.tsx index 1c6a88d40c..22d22d9318 100644 --- a/app/src/docs/_examples/multiSwitch/Basic.example.tsx +++ b/app/src/docs/_examples/multiSwitch/Basic.example.tsx @@ -11,9 +11,10 @@ import { ReactComponent as ChatIcon } from '@epam/assets/icons/communication-cha import css from './BasicExample.module.scss'; export default function BasicExample() { - const [value, onValueChange] = useState(null); - const [view, setView] = useState(null); - const [filter, setFilter] = useState(null); + const [value, onValueChange] = useState('on'); + const [userType, userTypeOnValueChange] = useState(); + const [view, setView] = useState(1); + const [filter, setFilter] = useState(2); return ( @@ -28,8 +29,8 @@ export default function BasicExample() { items={ [ { id: 1, caption: 'Mentee' }, { id: 2, caption: 'Mentor' }, { id: 3, caption: 'Coordinator' }, ] } - value={ value } - onValueChange={ onValueChange } + value={ userType } + onValueChange={ userTypeOnValueChange } /> With Grey border Disabled Icon only diff --git a/app/src/docs/_examples/pickerInput/LazyTreeSearch.example.tsx b/app/src/docs/_examples/pickerInput/LazyTreeSearch.example.tsx index 83c23abee0..6cebce86b2 100644 --- a/app/src/docs/_examples/pickerInput/LazyTreeSearch.example.tsx +++ b/app/src/docs/_examples/pickerInput/LazyTreeSearch.example.tsx @@ -19,6 +19,7 @@ export default function LazyTreeSearch() { getId: (i) => i.id, getParentId: (i) => i.parentId, getChildCount: (l) => l.childCount, + selectAll: false, }, [], ); @@ -42,6 +43,7 @@ export default function LazyTreeSearch() { getId: (i) => i.id, getParentId: (i) => i.parentId, getChildCount: (l) => l.childCount, + selectAll: false, }, [], ); diff --git a/app/src/docs/_examples/richTextEditor/WithInnerScroll.example.tsx b/app/src/docs/_examples/richTextEditor/WithInnerScroll.example.tsx index 518b7348e4..0504a87709 100644 --- a/app/src/docs/_examples/richTextEditor/WithInnerScroll.example.tsx +++ b/app/src/docs/_examples/richTextEditor/WithInnerScroll.example.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { FileUploadResponse, useUuiContext } from '@epam/uui-core'; -import { ErrorNotification, Panel } from '@epam/promo'; +import { ErrorNotification, FlexRow } from '@epam/promo'; import { SlateEditor, defaultPlugins, imagePlugin, videoPlugin, attachmentPlugin, toDoListPlugin, baseMarksPlugin, linkPlugin, iframePlugin, notePlugin, separatorPlugin, uploadFilePlugin, tablePlugin, quotePlugin, colorPlugin, superscriptPlugin, headerPlugin, listPlugin, placeholderPlugin, EditorValue, codeBlockPlugin, @@ -56,7 +56,7 @@ export default function WithInnerScrollExample() { ]; return ( - + - + ); } diff --git a/app/src/docs/_examples/tables/PagedTable.example.tsx b/app/src/docs/_examples/tables/PagedTable.example.tsx index f9b69c25bd..55d0474381 100644 --- a/app/src/docs/_examples/tables/PagedTable.example.tsx +++ b/app/src/docs/_examples/tables/PagedTable.example.tsx @@ -1,5 +1,4 @@ -import React, { SetStateAction, useCallback, useMemo, useState } from 'react'; -import isEqual from 'react-fast-compare'; +import React, { useCallback, useMemo, useState } from 'react'; import { DataColumnProps, useLazyDataSource, DataSourceState, LazyDataSourceApiRequest, useUuiContext, LazyDataSourceApi } from '@epam/uui-core'; import { DataTable, Panel, Text, Paginator, FlexRow, FlexSpacer } from '@epam/uui'; import { Person } from '@epam/uui-docs'; @@ -11,20 +10,6 @@ export default function PagedTable() { page: 1, pageSize: 10, }); - const setTableState = useCallback((newState: SetStateAction) => { - setState((currentState) => { - const updatedState = typeof newState === 'function' ? newState(currentState) : newState; - const isFilterChanged = !isEqual(currentState.filter, updatedState.filter); - const isSearchChanged = currentState.search !== updatedState.search; - const isSortingChanged = !isEqual(currentState.sorting, updatedState.sorting); - - if (isFilterChanged || isSearchChanged || isSortingChanged) { - return { ...updatedState, checked: [] }; - } - return updatedState; - }); - }, []); - const columns: DataColumnProps[] = useMemo( () => [ { @@ -67,9 +52,10 @@ export default function PagedTable() { }, }, backgroundReload: true, + selectAll: false, }, []); - const view = dataSource.useView(state, setTableState, {}); + const view = dataSource.useView(state, setState, {}); const listProps = view.getListProps(); return ( @@ -78,7 +64,7 @@ export default function PagedTable() { { ...listProps } getRows={ view.getVisibleRows } value={ state } - onValueChange={ setTableState } + onValueChange={ setState } columns={ columns } headerTextCase="upper" /> @@ -86,7 +72,7 @@ export default function PagedTable() { setTableState({ ...state, page: newPage, scrollTo: { index: 0 } }) } + onValueChange={ (newPage) => setState({ ...state, page: newPage, scrollTo: { index: 0 } }) } totalPages={ Math.ceil((listProps.totalCount ?? 0) / state.pageSize) } /> diff --git a/app/src/docs/_examples/tables/TableGroupedHeader.example.tsx b/app/src/docs/_examples/tables/TableGroupedHeader.example.tsx new file mode 100644 index 0000000000..3466d93fc2 --- /dev/null +++ b/app/src/docs/_examples/tables/TableGroupedHeader.example.tsx @@ -0,0 +1,116 @@ +import React, { useState } from 'react'; +import { DataSourceState, DataColumnProps, useUuiContext, useLazyDataSource, DataColumnGroupProps } from '@epam/uui-core'; +import { Text, DataTable, Panel, FlexRow, Badge, BadgeProps } from '@epam/uui'; +import { Person } from '@epam/uui-docs'; + +import css from './TablesExamples.module.scss'; +import { TApi } from '../../../data'; + +export default function TableGroupedHeaderExample() { + const svc = useUuiContext(); + const [tableState, setTableState] = useState({}); + + // Define columns groups array + const columnGroups: DataColumnGroupProps[] = [ + { + key: 'location', + caption: 'Location', + textAlign: 'center', + }, + { + key: 'position', + caption: 'Position', + textAlign: 'center', + }, + ]; + + // Define columns config array + const personColumns: DataColumnProps[] = [ + { + key: 'name', + caption: 'Name', + render: (p) => {p.name}, + width: 130, + isSortable: true, + }, + { + key: 'profileStatus', + caption: 'Status', + render: (p) => ( + + + + ), + grow: 0, + width: 100, + minWidth: 90, + isSortable: true, + }, + { + key: 'countryName', + caption: 'Country', + group: 'location', // Specify group key + render: (p) => {p.countryName}, + grow: 0, + width: 110, + isSortable: true, + }, + { + key: 'cityName', + caption: 'City', + group: 'location', // Specify group key + render: (p) => {p.cityName}, + grow: 0, + width: 110, + isSortable: true, + }, + { + key: 'officeAddress', + caption: 'Office', + group: 'location', // Specify group key + render: (p) => {p.officeAddress}, + grow: 0, + width: 150, + isSortable: true, + }, + { + key: 'jobTitle', + caption: 'Title', + group: 'position', // Specify group key + render: (r) => {r.jobTitle}, + width: 180, + isSortable: true, + }, + { + key: 'titleLevel', + caption: 'Track & Level', + group: 'position', // Specify group key + render: (p) => {p.titleLevel}, + grow: 1, + width: 100, + isSortable: true, + }, + ]; + + const citiesDS = useLazyDataSource({ + api: svc.api.demo.persons, + backgroundReload: true, + }, []); + + const view = citiesDS.useView(tableState, setTableState); + + return ( + + + + ); +} diff --git a/app/src/docs/_examples/tables/useTableState/useTableState.example.tsx b/app/src/docs/_examples/tables/useTableState/useTableState.example.tsx index 79c66683d8..f2fae4d163 100644 --- a/app/src/docs/_examples/tables/useTableState/useTableState.example.tsx +++ b/app/src/docs/_examples/tables/useTableState/useTableState.example.tsx @@ -64,7 +64,7 @@ const initialPresets: ITablePreset[] = [ name: 'Red status', order: 'a', filter: { - profileStatusId: 1, + profileStatusId: [1], }, isReadonly: true, }, diff --git a/app/src/docs/_examples/tooltip/Basic.example.tsx b/app/src/docs/_examples/tooltip/Basic.example.tsx deleted file mode 100644 index aabc82db60..0000000000 --- a/app/src/docs/_examples/tooltip/Basic.example.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react'; -import { Button, FlexRow, Tooltip } from '@epam/uui'; - -export default function BasicTooltipExample() { - return ( - - - +
+ ACTION 1 +
+ +