Skip to content

Commit

Permalink
chore: loading prop has been added to Action Button (#344)
Browse files Browse the repository at this point in the history
Co-authored-by: mparticle-automation <[email protected]>
Co-authored-by: jdickman <[email protected]>
  • Loading branch information
3 people authored Jul 31, 2024
1 parent 2c9d13e commit d51205b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [1.22.0](https://github.com/mParticle/aquarium/compare/v1.21.1...v1.22.0) (2024-07-26)
# [1.22.0-chore-loading-prop-queryitem-action.1](https://github.com/mParticle/aquarium/compare/v1.21.1...v1.22.0-chore-loading-prop-queryitem-action.1) (2024-07-30)

### Features

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mparticle/aquarium",
"version": "1.22.0",
"version": "1.22.0-chore-loading-prop-queryitem-action.1",
"description": "mParticle Component Library",
"license": "Apache-2.0",
"keywords": [
Expand Down
7 changes: 7 additions & 0 deletions src/components/data-entry/QueryItem/Action.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,10 @@ export const OnClick: Story = {
},
},
}
export const Loading: Story = {
args: {
text: 'Loading',
type: 'disabled',
loading: true,
},
}
5 changes: 3 additions & 2 deletions src/components/data-entry/QueryItem/Action.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

import { Icon, Button, type IButtonProps } from 'src/components'
import './query-item.css'

export interface IActionProps {
type?: 'disabled' | 'primary' | 'default'
text?: string
onClick?: () => void
loading?: IButtonProps['loading']
}

const Action = (props: IActionProps) => {
Expand All @@ -18,6 +18,7 @@ const Action = (props: IActionProps) => {
type: props.type === 'disabled' ? 'default' : 'primary',
disabled: props.type === 'disabled',
onClick: props.onClick,
loading: props.loading,
}

let iconColor: 'primary' | 'default' = 'primary'
Expand All @@ -34,4 +35,4 @@ const Action = (props: IActionProps) => {
)
}

export default Action
export default Action
6 changes: 3 additions & 3 deletions src/components/data-entry/QueryItem/Cascader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface ICascaderOption {
disabled?: boolean
}

export interface ICascaderProps {
export interface IQueryItemCascaderProps {
options: ICascaderOption[]
icon?: keyof Pick<typeof Icons, 'empty' | 'event' | 'userAttribute' | 'eventAttribute'>
errorMessage?: string
Expand All @@ -30,7 +30,7 @@ export interface ICascaderProps {
value?: Array<number | string>
}

const Cascader = (props: ICascaderProps) => {
const Cascader = (props: IQueryItemCascaderProps) => {
type DefaultOptionType = GetProp<IBaseCascaderProps, 'options'>[number]

const options: ICascaderOption[] = []
Expand Down Expand Up @@ -74,7 +74,7 @@ const Cascader = (props: ICascaderProps) => {

const baseProps: IBaseCascaderProps = {
getPopupContainer: triggerNode => triggerNode.parentElement,
searchValue: searchValue,
searchValue,
value: selectedValue,
onChange: (values: Array<number | string>, selectedOptions: any): void => {
setSelectedValue(values as string[])
Expand Down
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export { TimePicker, type ITimePickerProps } from './data-entry/TimePicker/TimeP
export { Transfer, type ITransferProps } from './data-entry/Transfer/Transfer'
export { QueryItem } from './data-entry/QueryItem/QueryItem'
export type { IQueryItemQualifierOption } from './data-entry/QueryItem/Qualifier'
export type { IQueryItemCascaderProps } from './data-entry/QueryItem/Cascader'
export type { INumberInputProps } from './data-entry/QueryItem/NumberInput'
export type { ITextInputProps } from './data-entry/QueryItem/TextInput'
export { Collapse, type ICollapseProps } from './data-display/Collapse/Collapse'
Expand Down

0 comments on commit d51205b

Please sign in to comment.