From 7074e4518d1ac56ea11b90c643086b4be43b2836 Mon Sep 17 00:00:00 2001 From: Kenneth Date: Tue, 9 Sep 2025 13:48:56 +0700 Subject: [PATCH 1/4] build: change package.json --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index cccfe87..23fa0d8 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,12 @@ { "name": "1byte-react-design", - "version": "1.6.1", + "version": "1.6.2-2", "main": "dist/index.js", "module": "dist/index.js", "types": "dist/index.d.ts", + "files": [ + "dist" + ], "license": "MIT", "scripts": { "build": "webpack --config webpack.config.js", From 421ebc5c40bb8eda347778cec82b5aaa4a3e13ad Mon Sep 17 00:00:00 2001 From: Kenneth Date: Tue, 9 Sep 2025 14:14:10 +0700 Subject: [PATCH 2/4] feature: Add prop for component --- .../DashboardTemplate/DashboardTemplate.tsx | 18 ++++++++----- src/templates/DashboardTemplate/styles.tsx | 26 ++++++++++++++++--- src/templates/DashboardTemplate/types.ts | 2 +- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/src/templates/DashboardTemplate/DashboardTemplate.tsx b/src/templates/DashboardTemplate/DashboardTemplate.tsx index 4251e99..3ab1f3b 100644 --- a/src/templates/DashboardTemplate/DashboardTemplate.tsx +++ b/src/templates/DashboardTemplate/DashboardTemplate.tsx @@ -3,25 +3,31 @@ import { Layout } from '../../molecules'; import DashboardTemplateFooter from './Footer'; import DashboardTemplateHeader from './Header'; import DashboardTemplateSider from './Sider'; -import { DashboardTemplateContent, DashboardTemplateStyles } from './styles'; +import { + DashboardTemplateContent, + DashboardTemplateSkeletonLayout, + DashboardTemplateStyles, +} from './styles'; import { RdDashboardTemplateComponent, RdDashboardTemplateCompoundedComponent } from './types'; const DashboardTemplateInternal: RdDashboardTemplateComponent = forwardRef((props, ref) => { - const { headerProps, siderProps, footerProps, ...restProps } = props; + const { headerProps, siderProps, footerProps, fitScreen = false, ...restProps } = props; return ( - + {headerProps && } {siderProps && } - - {props.children} + + + {props.children} + {footerProps !== false && ( )} - + ); diff --git a/src/templates/DashboardTemplate/styles.tsx b/src/templates/DashboardTemplate/styles.tsx index 70c3258..0b6aba0 100644 --- a/src/templates/DashboardTemplate/styles.tsx +++ b/src/templates/DashboardTemplate/styles.tsx @@ -5,16 +5,36 @@ import { getAliasToken, getComponentToken } from '../../utils'; export const DashboardTemplateStyles = styled(Layout, { label: 'rd-dashboard-template', -})` +})<{ + fitScreen: boolean; +}>` ${() => css` background: ${getAliasToken('DashboardTemplate', 'colorBgLayout')}; `} + + ${({ fitScreen }) => + fitScreen && + css` + height: 100vh; + `} `; +export const DashboardTemplateSkeletonLayout = styled(Layout, { + label: 'rd-dashboard-template-skeleton', +})``; + export const DashboardTemplateContent = styled(Layout.Content, { label: 'rd-dashboard-template-content', -})` +})<{ + fitScreen: boolean; +}>` ${() => css` - padding: ${getComponentToken('CenteredTemplate', 'contentPadding') || '32px 32px'}; + padding: ${getComponentToken('DashboardTemplate', 'contentPadding') || '32px 32px'}; `} + + ${({ fitScreen }) => + fitScreen && + css` + overflow: auto; + `} `; diff --git a/src/templates/DashboardTemplate/types.ts b/src/templates/DashboardTemplate/types.ts index c3cc12b..704cdd3 100644 --- a/src/templates/DashboardTemplate/types.ts +++ b/src/templates/DashboardTemplate/types.ts @@ -16,7 +16,7 @@ type DashboardTemplatePropsExtend = { headerProps?: RdDashboardTemplateHeaderProps | false; siderProps?: RdDashboardTemplateSiderProps | false; footerProps?: RdDashboardTemplateFooterProps | false; - test?: boolean; + fitScreen?: boolean; }; type DashboardTemplateRefExtend = {}; From 41bf8369b6b3157362edad0c0f4e7f450d120b61 Mon Sep 17 00:00:00 2001 From: Kenneth Date: Tue, 9 Sep 2025 14:14:47 +0700 Subject: [PATCH 3/4] feature: update 1.6.2 version --- CHANGELOG.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d80595d..8cfcd73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.6.2] + +### Added + +- Add `fitScreen` prop for `DashboardTemplate` component. + ## [1.6.1] ### Added @@ -14,12 +20,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- +- ### Fixed -- Fix unnecessary rerender for Table. -- Fix UploadDragger to Upload.Dragger +- Fix unnecessary rerender for Table. +- Fix UploadDragger to Upload.Dragger ### Deprecated From c088583dbca68ba30a98e3e62b51dcf2bb7e325c Mon Sep 17 00:00:00 2001 From: Kenneth Date: Tue, 9 Sep 2025 14:16:19 +0700 Subject: [PATCH 4/4] build: update 1.6.2-3 version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 23fa0d8..de70254 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "1byte-react-design", - "version": "1.6.2-2", + "version": "1.6.2-3", "main": "dist/index.js", "module": "dist/index.js", "types": "dist/index.d.ts",