Skip to content

Commit

Permalink
fix(refactor): expose size attribute in circular progress component
Browse files Browse the repository at this point in the history
  • Loading branch information
manojava-gk committed Jun 1, 2024
1 parent 7073d80 commit ad81020
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.0.17

- Expose size property in circular progress component

## 3.0.16

- Add new Vertical Table for code optimization
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@catena-x/portal-shared-components",
"version": "3.0.16",
"version": "3.0.17",
"description": "Catena-X Portal Shared Components",
"author": "Catena-X Contributors",
"license": "Apache-2.0",
Expand Down Expand Up @@ -96,4 +96,4 @@
"start:storybook": "storybook dev -p 3006",
"build:storybook": "storybook build -o ./storybook"
}
}
}
1 change: 1 addition & 0 deletions src/components/basic/Progress/CircleProgress/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { useState, useEffect } from 'react'

interface CircleProgressProps extends Omit<CircularProgressProps, 'variant'> {
step?: number
size?: number
interval?: number
iteration?: boolean
variant: 'determinate' | 'indeterminate'
Expand Down
21 changes: 10 additions & 11 deletions src/components/basic/StaticTable/EditField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ export const EditField = ({
value,
handleEdit,
isValid,
errorMessage
errorMessage,
}: {
value: EditFieldType
handleEdit: (value: EditFieldType) => void | Promise<void>
isValid?: (value: string) => unknown
errorMessage?: string
}) => {

const [inputField, setInputField] = useState(false)
const [inputValue, setInputValue] = useState('')
const [inputErrorMessage, setInputErrorMessage] = useState('')
Expand All @@ -52,9 +51,7 @@ export const EditField = ({
const addInputValue = (value: string) => {
setInputValue(value)
isValid &&
setInputErrorMessage(
!isValid(value.trim()) ? errorMessage ?? '' : ''
)
setInputErrorMessage(!isValid(value.trim()) ? errorMessage ?? '' : '')
}

const renderInputField = () => {
Expand All @@ -65,12 +62,14 @@ export const EditField = ({
onChange={(e) => {
addInputValue(e.target.value)
}}
onKeyPress={(event) => {void (async() => {
if (event.key === 'Enter' && !inputErrorMessage) {
setInputField(false)
await handleEdit(inputValue)
}
})()}}
onKeyPress={(event) => {
void (async () => {
if (event.key === 'Enter' && !inputErrorMessage) {
setInputField(false)
await handleEdit(inputValue)
}
})()
}}
onClick={(e) => {
e.stopPropagation()
}}
Expand Down
3 changes: 1 addition & 2 deletions src/components/basic/StaticTable/VerticalTableNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ export interface VerticalTableType {
>
}


export const VerticalTableNew = ({ data }: { data: VerticalTableType }) => {
return (
<table style={{borderCollapse: 'collapse', width: '100%'}}>
<table style={{ borderCollapse: 'collapse', width: '100%' }}>
<thead>
<tr>
{data.head.map((col, c) => (
Expand Down
5 changes: 4 additions & 1 deletion src/components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ export type { CardItems } from './content/Cards'
export type { NavigationProps } from './content/Navigation'
export type { PageNotificationsProps } from './basic/Notifications/PageNotification'
export type { TableType } from './basic/StaticTable/types'
export type { VerticalTableType, TableCellType } from './basic/StaticTable/VerticalTableNew'
export type {
VerticalTableType,
TableCellType,
} from './basic/StaticTable/VerticalTableNew'
export type { ImageType } from './basic/ImageGallery/types'
export type { DateType } from './basic/Datepicker'
export { StatusVariants } from './content/Cards/CardChip'
Expand Down

0 comments on commit ad81020

Please sign in to comment.