From 8b2b32f2e0f5ef1b802af0eb325771b6ee342b66 Mon Sep 17 00:00:00 2001 From: IhorKorenets Date: Tue, 5 Dec 2023 12:04:05 +0200 Subject: [PATCH 1/4] [TextArea]: deprecated size 48 --- changelog.md | 5 ++++ public/docs/docsGenOutput/docsGenOutput.json | 18 +++++-------- uui/components/inputs/TextArea.tsx | 27 +++++++++++++++----- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/changelog.md b/changelog.md index f841ff03e7..f7a02f357d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +# 5.4.2 - ... + +* [TextArea]: size `48` is deprecated and will be removed in future release. Please, use size `42` instead. + + # 5.4.1 - 30.11.2023 **What's New** diff --git a/public/docs/docsGenOutput/docsGenOutput.json b/public/docs/docsGenOutput/docsGenOutput.json index 89167c5f76..ae90696d9b 100644 --- a/public/docs/docsGenOutput/docsGenOutput.json +++ b/public/docs/docsGenOutput/docsGenOutput.json @@ -1,5 +1,5 @@ { - "timestamp": "2023-12-01", + "timestamp": "2023-12-05", "docsGenTypes": { "@epam/uui-core:AcceptDropParams": { "summary": { @@ -91091,7 +91091,7 @@ "raw": "TextAreaMods", "print": [ "interface TextAreaMods extends types.IHasEditMode {", - " /** @default '36' */", + " /** @default '36', but size '48' is deprecated, and will be removed in future release */", " size?: types.ControlSize;", "}" ] @@ -91102,11 +91102,8 @@ "name": "size", "comment": { "raw": [ - "@default '36'" - ], - "tags": { - "@default": "36" - } + "@default '36', but size '48' is deprecated, and will be removed in future release" + ] }, "typeValue": { "raw": "'36' | '48' | '24' | '30' | '42' | 'none'" @@ -91511,11 +91508,8 @@ "name": "size", "comment": { "raw": [ - "@default '36'" - ], - "tags": { - "@default": "36" - } + "@default '36', but size '48' is deprecated, and will be removed in future release" + ] }, "typeValue": { "raw": "'36' | '48' | '24' | '30' | '42' | 'none'" diff --git a/uui/components/inputs/TextArea.tsx b/uui/components/inputs/TextArea.tsx index ae2b57f16e..d694200628 100644 --- a/uui/components/inputs/TextArea.tsx +++ b/uui/components/inputs/TextArea.tsx @@ -1,4 +1,4 @@ -import { withMods } from '@epam/uui-core'; +import { devLogger, withMods } from '@epam/uui-core'; import { TextArea as uuiTextArea, TextAreaProps as UuiTextAreaProps } from '@epam/uui-components'; import * as types from '../types'; import css from './TextArea.module.scss'; @@ -7,7 +7,7 @@ const defaultSize = '36'; const defaultMode = types.EditMode.FORM; export interface TextAreaMods extends types.IHasEditMode { - /** @default '36' */ + /** @default '36', but size '48' is deprecated, and will be removed in future release */ size?: types.ControlSize; } @@ -19,7 +19,22 @@ export function applyTextAreaMods(mods: TextAreaMods) { export type TextAreaProps = UuiTextAreaProps & TextAreaMods; -export const TextArea = withMods(uuiTextArea, applyTextAreaMods, (props) => ({ - autoSize: props.mode === types.EditMode.CELL ? true : props.autoSize, - maxLength: props.mode === types.EditMode.CELL ? undefined : props.maxLength, -})); +export const TextArea = withMods( + uuiTextArea, + applyTextAreaMods, + (props) => { + if (__DEV__) { + devLogger.warnAboutDeprecatedPropValue({ + component: 'TextArea', + propName: 'size', + propValue: '48', + propValueUseInstead: '42', + condition: () => props.size === '48', + }); + } + return { + autoSize: props.mode === types.EditMode.CELL ? true : props.autoSize, + maxLength: props.mode === types.EditMode.CELL ? undefined : props.maxLength, + }; + }, +); From 1654e51f8c891db1cbdf2f446d93a8b0cd95ec1a Mon Sep 17 00:00:00 2001 From: IhorKorenets Date: Wed, 6 Dec 2023 16:15:02 +0200 Subject: [PATCH 2/4] [TextArea]: fixed typeDoc --- uui/components/inputs/TextArea.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uui/components/inputs/TextArea.tsx b/uui/components/inputs/TextArea.tsx index d694200628..813a20fdc3 100644 --- a/uui/components/inputs/TextArea.tsx +++ b/uui/components/inputs/TextArea.tsx @@ -7,7 +7,10 @@ const defaultSize = '36'; const defaultMode = types.EditMode.FORM; export interface TextAreaMods extends types.IHasEditMode { - /** @default '36', but size '48' is deprecated, and will be removed in future release */ + /** + * @default '36'. + * Size '48' is deprecated, and will be removed in future release + * */ size?: types.ControlSize; } From 5ed988b623faaedf6aaabcfc3ae88bda6cf0d198 Mon Sep 17 00:00:00 2001 From: IhorKorenets Date: Fri, 8 Dec 2023 08:48:59 +0200 Subject: [PATCH 3/4] Updated docsGen --- public/docs/docsGenOutput/docsGenOutput.d.ts | 1 + public/docs/docsGenOutput/docsGenOutput.json | 251 ++++++++++++++----- public/docs/docsGenOutput/docsGenStats.json | 29 ++- 3 files changed, 202 insertions(+), 79 deletions(-) diff --git a/public/docs/docsGenOutput/docsGenOutput.d.ts b/public/docs/docsGenOutput/docsGenOutput.d.ts index 6301b32c71..0a16ce03ea 100644 --- a/public/docs/docsGenOutput/docsGenOutput.d.ts +++ b/public/docs/docsGenOutput/docsGenOutput.d.ts @@ -94,6 +94,7 @@ type Autogenerated_TDocsGenExportedTypeRef = '@epam/uui-core:AcceptDropParams' | '@epam/uui-core:IContextProviderSsrProps' | '@epam/uui-core:IDataSource' | '@epam/uui-core:IDataSourceView' | +'@epam/uui-core:IDataSourceViewConfig' | '@epam/uui-core:IDisableable' | '@epam/uui-core:IDndActor' | '@epam/uui-core:IDndContext' | diff --git a/public/docs/docsGenOutput/docsGenOutput.json b/public/docs/docsGenOutput/docsGenOutput.json index 8ca8050a6f..a2313d372f 100644 --- a/public/docs/docsGenOutput/docsGenOutput.json +++ b/public/docs/docsGenOutput/docsGenOutput.json @@ -1,5 +1,5 @@ { - "timestamp": "2023-12-06", + "timestamp": "2023-12-08", "docsGenTypes": { "@epam/uui-core:AcceptDropParams": { "summary": { @@ -15115,6 +15115,7 @@ "print": [ "// eslint-disable-next-line @typescript-eslint/no-unused-vars", "type IDataSourceView = {", + " getConfig(): IDataSourceViewConfig;", " getById(id: TId, index: number): DataRowProps;", " getListProps(): DataSourceListProps;", " getVisibleRows(): DataRowProps[];", @@ -15123,6 +15124,7 @@ " reload(): void;", " destroy(): void;", " loadData(): void;", + " clearAllChecked(): void;", " _forceUpdate(): void;", " selectAll?: ICheckable;", "};" @@ -15131,6 +15133,17 @@ "props": [ { "uid": 1, + "name": "getConfig", + "typeValue": { + "raw": "() => IDataSourceViewConfig" + }, + "editor": { + "type": "func" + }, + "required": true + }, + { + "uid": 2, "name": "getById", "typeValue": { "raw": "(id: TId, index: number) => DataRowProps" @@ -15141,7 +15154,7 @@ "required": true }, { - "uid": 2, + "uid": 3, "name": "getListProps", "typeValue": { "raw": "() => DataSourceListProps" @@ -15152,7 +15165,7 @@ "required": true }, { - "uid": 3, + "uid": 4, "name": "getVisibleRows", "typeValue": { "raw": "() => DataRowProps[]" @@ -15163,7 +15176,7 @@ "required": true }, { - "uid": 4, + "uid": 5, "name": "getSelectedRows", "typeValue": { "raw": "(range?: VirtualListRange | undefined) => DataRowProps[]" @@ -15174,7 +15187,7 @@ "required": true }, { - "uid": 5, + "uid": 6, "name": "getSelectedRowsCount", "typeValue": { "raw": "() => number" @@ -15185,7 +15198,7 @@ "required": true }, { - "uid": 6, + "uid": 7, "name": "reload", "typeValue": { "raw": "() => void" @@ -15196,7 +15209,7 @@ "required": true }, { - "uid": 7, + "uid": 8, "name": "destroy", "typeValue": { "raw": "() => void" @@ -15207,7 +15220,7 @@ "required": true }, { - "uid": 8, + "uid": 9, "name": "loadData", "typeValue": { "raw": "() => void" @@ -15218,7 +15231,18 @@ "required": true }, { - "uid": 9, + "uid": 10, + "name": "clearAllChecked", + "typeValue": { + "raw": "() => void" + }, + "editor": { + "type": "func" + }, + "required": true + }, + { + "uid": 11, "name": "_forceUpdate", "typeValue": { "raw": "() => void" @@ -15229,7 +15253,7 @@ "required": true }, { - "uid": 10, + "uid": 12, "name": "selectAll", "typeValue": { "raw": "ICheckable" @@ -15240,6 +15264,96 @@ "propsFromUnion": false } }, + "@epam/uui-core:IDataSourceViewConfig": { + "summary": { + "module": "@epam/uui-core", + "typeName": { + "name": "IDataSourceViewConfig", + "nameFull": "IDataSourceViewConfig" + }, + "src": "uui-core/src/types/dataSources.ts", + "exported": true + }, + "details": { + "kind": 264, + "typeValue": { + "raw": "IDataSourceViewConfig", + "print": [ + "type IDataSourceViewConfig = {", + " complexIds?: boolean;", + " cascadeSelection?: CascadeSelection;", + " selectAll?: true | false;", + " backgroundReload?: boolean;", + " flattenSearchResults?: boolean;", + "};" + ] + }, + "props": [ + { + "uid": 1, + "name": "complexIds", + "typeValue": { + "raw": "boolean" + }, + "editor": { + "type": "bool" + }, + "required": false + }, + { + "uid": 2, + "name": "cascadeSelection", + "typeValue": { + "raw": "boolean | 'implicit' | 'explicit'" + }, + "editor": { + "type": "oneOf", + "options": [ + false, + true, + "implicit", + "explicit" + ] + }, + "required": false + }, + { + "uid": 3, + "name": "selectAll", + "typeValue": { + "raw": "boolean" + }, + "editor": { + "type": "bool" + }, + "required": false + }, + { + "uid": 4, + "name": "backgroundReload", + "typeValue": { + "raw": "boolean" + }, + "editor": { + "type": "bool" + }, + "required": false + }, + { + "uid": 5, + "name": "flattenSearchResults", + "typeValue": { + "raw": "boolean" + }, + "editor": { + "type": "bool" + }, + "required": false + } + ], + "propsFromUnion": false + } + }, "@epam/uui-core:IDisableable": { "summary": { "module": "@epam/uui-core", @@ -39760,8 +39874,8 @@ "interface DropdownContainerProps extends IHasCX, IHasChildren, IHasStyleAttrs, IHasRawProps>, IHasForwardedRef, IDropdownBodyProps {", " /** Defines width in 'px' or 'auto'. If 'auto' provided, will be used width of the content. */", " width?: number | 'auto';", - " /** Defines maximum width in 'px'. */", - " maxWidth?: number;", + " /** Defines maximum width in 'px'. If 'auto' provided, will be used width of the content. */", + " maxWidth?: number | 'auto';", " /** Defines height in 'px'. */", " height?: number;", " /** If true, arrow tip will be shown", @@ -39829,14 +39943,11 @@ "name": "maxWidth", "comment": { "raw": [ - "Defines maximum width in 'px'." + "Defines maximum width in 'px'. If 'auto' provided, will be used width of the content." ] }, "typeValue": { - "raw": "number" - }, - "editor": { - "type": "number" + "raw": "number | 'auto'" }, "required": false }, @@ -47061,7 +47172,7 @@ "typeValue": { "raw": "PaginatorParams", "print": [ - "interface PaginatorParams extends IHasRawProps> {", + "interface PaginatorParams extends IHasRawProps> {", " size: '24' | '30';", " pages: PaginatorItem[];", " goToNext(): void;", @@ -47148,7 +47259,7 @@ ] }, "typeValue": { - "raw": "React.ReactHTMLElement & Record<`data-${string}`, string>" + "raw": "React.HTMLAttributes & Record<`data-${string}`, string>" }, "from": "@epam/uui-core:IHasRawProps", "required": false @@ -47172,7 +47283,7 @@ "typeValue": { "raw": "PaginatorProps", "print": [ - "interface PaginatorProps extends IEditable, IAnalyticableOnChange, IHasRawProps> {", + "interface PaginatorProps extends IEditable, IAnalyticableOnChange, IHasRawProps> {", " /** Component size */", " size: '24' | '30';", " /** Total number of pages */", @@ -47393,7 +47504,7 @@ ] }, "typeValue": { - "raw": "React.ReactHTMLElement & Record<`data-${string}`, string>" + "raw": "React.HTMLAttributes & Record<`data-${string}`, string>" }, "from": "@epam/uui-core:IHasRawProps", "required": false @@ -69969,6 +70080,7 @@ " editMode?: 'dropdown' | 'modal';", " searchSize?: ControlSize;", " selectionMode?: 'single' | 'multi';", + " maxWidth?: number;", "}" ] }, @@ -70035,6 +70147,17 @@ }, { "uid": 5, + "name": "maxWidth", + "typeValue": { + "raw": "number" + }, + "editor": { + "type": "number" + }, + "required": false + }, + { + "uid": 6, "name": "onKeyDown", "typeValue": { "raw": "(e: React.KeyboardEvent) => void" @@ -70046,7 +70169,7 @@ "required": false }, { - "uid": 6, + "uid": 7, "name": "renderNotFound", "typeValue": { "raw": "() => React.ReactNode" @@ -70058,7 +70181,7 @@ "required": false }, { - "uid": 7, + "uid": 8, "name": "rows", "typeValue": { "raw": "React.ReactNode[]" @@ -70067,7 +70190,7 @@ "required": true }, { - "uid": 8, + "uid": 9, "name": "scheduleUpdate", "typeValue": { "raw": "() => void" @@ -70079,7 +70202,7 @@ "required": false }, { - "uid": 9, + "uid": 10, "name": "search", "typeValue": { "raw": "IEditable" @@ -70088,7 +70211,7 @@ "required": true }, { - "uid": 10, + "uid": 11, "name": "showSearch", "typeValue": { "raw": "boolean | 'auto'" @@ -70105,7 +70228,7 @@ "required": false }, { - "uid": 11, + "uid": 12, "name": "fixedBodyPosition", "typeValue": { "raw": "boolean" @@ -70117,7 +70240,7 @@ "required": false }, { - "uid": 12, + "uid": 13, "name": "searchDebounceDelay", "typeValue": { "raw": "number" @@ -70129,7 +70252,7 @@ "required": false }, { - "uid": 13, + "uid": 14, "name": "selectAll", "comment": { "raw": [ @@ -70144,7 +70267,7 @@ "required": false }, { - "uid": 14, + "uid": 15, "name": "isReloading", "comment": { "raw": [ @@ -70161,7 +70284,7 @@ "required": false }, { - "uid": 15, + "uid": 16, "name": "rowsCount", "comment": { "raw": [ @@ -70179,7 +70302,7 @@ "required": false }, { - "uid": 16, + "uid": 17, "name": "exactRowsCount", "comment": { "raw": [ @@ -70196,7 +70319,7 @@ "required": false }, { - "uid": 17, + "uid": 18, "name": "knownRowsCount", "comment": { "raw": [ @@ -70215,7 +70338,7 @@ "required": false }, { - "uid": 18, + "uid": 19, "name": "totalCount", "comment": { "raw": [ @@ -70232,7 +70355,7 @@ "required": false }, { - "uid": 19, + "uid": 20, "name": "value", "comment": { "raw": [ @@ -70246,7 +70369,7 @@ "required": true }, { - "uid": 20, + "uid": 21, "name": "onValueChange", "comment": { "raw": [ @@ -70263,7 +70386,7 @@ "required": true }, { - "uid": 21, + "uid": 22, "name": "isInvalid", "comment": { "raw": [ @@ -70280,7 +70403,7 @@ "required": false }, { - "uid": 22, + "uid": 23, "name": "validationMessage", "comment": { "raw": [ @@ -70295,7 +70418,7 @@ "required": false }, { - "uid": 23, + "uid": 24, "name": "validationProps", "comment": { "raw": [ @@ -70309,7 +70432,7 @@ "required": false }, { - "uid": 24, + "uid": 25, "name": "isDisabled", "comment": { "raw": [ @@ -70326,7 +70449,7 @@ "required": false }, { - "uid": 25, + "uid": 26, "name": "isReadonly", "comment": { "raw": [ @@ -70343,7 +70466,7 @@ "required": false }, { - "uid": 26, + "uid": 27, "name": "isRequired", "comment": { "raw": [ @@ -70360,7 +70483,7 @@ "required": false }, { - "uid": 27, + "uid": 28, "name": "rawProps", "comment": { "raw": [ @@ -73013,14 +73136,11 @@ "name": "maxWidth", "comment": { "raw": [ - "Defines maximum width in 'px'." + "Defines maximum width in 'px'. If 'auto' provided, will be used width of the content." ] }, "typeValue": { - "raw": "number" - }, - "editor": { - "type": "number" + "raw": "number | 'auto'" }, "from": "@epam/uui-components:DropdownContainerProps", "required": false @@ -90936,7 +91056,10 @@ "raw": "TextAreaMods", "print": [ "interface TextAreaMods extends types.IHasEditMode {", - " /** @default '36' */", + " /**", + " * @default '36'.", + " * Size '48' is deprecated, and will be removed in future release", + " * */", " size?: types.ControlSize;", "}" ] @@ -90947,11 +91070,9 @@ "name": "size", "comment": { "raw": [ - "@default '36'" - ], - "tags": { - "@default": "36" - } + "@default '36'.", + " Size '48' is deprecated, and will be removed in future release" + ] }, "typeValue": { "raw": "'36' | '48' | '24' | '30' | '42' | 'none'" @@ -91356,11 +91477,9 @@ "name": "size", "comment": { "raw": [ - "@default '36'" - ], - "tags": { - "@default": "36" - } + "@default '36'.", + " Size '48' is deprecated, and will be removed in future release" + ] }, "typeValue": { "raw": "'36' | '48' | '24' | '30' | '42' | 'none'" @@ -96633,14 +96752,11 @@ "name": "maxWidth", "comment": { "raw": [ - "Defines maximum width in 'px'." + "Defines maximum width in 'px'. If 'auto' provided, will be used width of the content." ] }, "typeValue": { - "raw": "number" - }, - "editor": { - "type": "number" + "raw": "number | 'auto'" }, "from": "@epam/uui-components:DropdownContainerProps", "required": false @@ -106437,14 +106553,11 @@ "name": "maxWidth", "comment": { "raw": [ - "Defines maximum width in 'px'." + "Defines maximum width in 'px'. If 'auto' provided, will be used width of the content." ] }, "typeValue": { - "raw": "number" - }, - "editor": { - "type": "number" + "raw": "number | 'auto'" }, "from": "@epam/uui-components:DropdownContainerProps", "required": false diff --git a/public/docs/docsGenOutput/docsGenStats.json b/public/docs/docsGenOutput/docsGenStats.json index b592fbe038..30eb835b36 100644 --- a/public/docs/docsGenOutput/docsGenStats.json +++ b/public/docs/docsGenOutput/docsGenStats.json @@ -1,7 +1,7 @@ { "missingPropComment": { "totals": { - "amountProps": 615, + "amountProps": 622, "amountTypes": 210 }, "value": [ @@ -174,8 +174,10 @@ "typeRef": "@epam/uui-core:IDataSourceView", "value": [ "_forceUpdate", + "clearAllChecked", "destroy", "getById", + "getConfig", "getListProps", "getSelectedRows", "getSelectedRowsCount", @@ -185,6 +187,16 @@ "selectAll" ] }, + { + "typeRef": "@epam/uui-core:IDataSourceViewConfig", + "value": [ + "backgroundReload", + "cascadeSelection", + "complexIds", + "flattenSearchResults", + "selectAll" + ] + }, { "typeRef": "@epam/uui-core:IDndContext", "value": [ @@ -910,6 +922,7 @@ "value": [ "editMode", "maxHeight", + "maxWidth", "searchSize", "selectionMode" ] @@ -1257,12 +1270,6 @@ "color" ] }, - { - "typeRef": "@epam/uui:TextAreaMods", - "value": [ - "size" - ] - }, { "typeRef": "@epam/uui:TextInputMods", "value": [ @@ -1674,7 +1681,7 @@ }, "missingTypeComment": { "totals": { - "amountTypes": 484 + "amountTypes": 485 }, "value": [ "@epam/uui-core:AcceptDropParams", @@ -1746,6 +1753,7 @@ "@epam/uui-core:IContextProviderSsrProps", "@epam/uui-core:IDataSource", "@epam/uui-core:IDataSourceView", + "@epam/uui-core:IDataSourceViewConfig", "@epam/uui-core:IDndContext", "@epam/uui-core:IErrorContext", "@epam/uui-core:IFilterConfig", @@ -3053,9 +3061,9 @@ }, "includedExports": { "totals": { - "allExports": 566, + "allExports": 567, "byModule": { - "@epam/uui-core": 201, + "@epam/uui-core": 202, "@epam/uui-components": 88, "@epam/uui": 138, "@epam/promo": 55, @@ -3240,6 +3248,7 @@ "IColumnConfig", "Icon", "IDataSourceView", + "IDataSourceViewConfig", "IFilterConfig", "IFilterItemBodyProps", "IFilterPredicate", From 48e1679845b48fecdfd386864679c4dbc8cb984c Mon Sep 17 00:00:00 2001 From: IhorKorenets Date: Fri, 8 Dec 2023 10:17:55 +0200 Subject: [PATCH 4/4] Add electric skin to TextArea PE --- app/src/docs/TextArea.doc.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/docs/TextArea.doc.tsx b/app/src/docs/TextArea.doc.tsx index 0e38637e05..09c57be2e7 100644 --- a/app/src/docs/TextArea.doc.tsx +++ b/app/src/docs/TextArea.doc.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import * as uui from '@epam/uui'; import * as loveship from '@epam/loveship'; import * as promo from '@epam/promo'; +import * as electric from '@epam/electric'; import { DocBuilder, TDocConfig, TDocContext, TSkin } from '@epam/uui-docs'; import { EditableDocContent, DocExample, BaseDocsBlock } from '../common'; @@ -15,6 +16,7 @@ export class TextAreaDoc extends BaseDocsBlock { [TSkin.Loveship]: { type: '@epam/uui:TextAreaProps', component: loveship.TextArea }, [TSkin.Promo]: { type: '@epam/uui:TextAreaProps', component: promo.TextArea }, [TSkin.UUI]: { type: '@epam/uui:TextAreaProps', component: uui.TextArea }, + [TSkin.Electric]: { type: '@epam/uui:TextAreaProps', component: electric.TextArea }, }, doc: (doc: DocBuilder) => { doc.merge('mode', { defaultValue: 'form' });