Skip to content

Commit

Permalink
release of v10.58.1 (#4353)
Browse files Browse the repository at this point in the history
  • Loading branch information
langz authored Dec 2, 2024
2 parents 08baea4 + a3414f1 commit d1ec4fe
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 15 deletions.
23 changes: 12 additions & 11 deletions packages/dnb-eufemia/src/components/form-label/FormLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default function FormLabel(localProps: FormLabelAllProps) {
forElem?.closest('.dnb-input__border--root') ||
forElem?.closest('.dnb-input__border')

if (target) {
if (target && ref.current) {
const elem = ref.current

const buttonEnter = () => {
Expand All @@ -166,20 +166,21 @@ export default function FormLabel(localProps: FormLabelAllProps) {
const leave = () => {
target.classList.remove('hover')

elem
.querySelector('button')
?.removeEventListener?.('mouseenter', buttonEnter)
const button = elem.querySelector('button')
button?.removeEventListener?.('mouseenter', buttonEnter)
}

elem?.addEventListener?.('mouseenter', enter)
elem?.addEventListener?.('mouseleave', leave)
elem.addEventListener('mouseenter', enter)
elem.addEventListener('mouseleave', leave)

return () => {
elem?.removeEventListener?.('mouseenter', enter)
elem?.removeEventListener?.('mouseleave', leave)
elem
.querySelector('button')
?.removeEventListener?.('mouseleave', buttonLeave)
if (elem) {
elem.removeEventListener('mouseenter', enter)
elem.removeEventListener('mouseleave', leave)

const button = elem.querySelector('button')
button?.removeEventListener?.('mouseleave', buttonLeave)
}
}
}
}, [forId, ref])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const UploadFileListCell = ({
variant="tertiary"
onClick={onDeleteHandler}
icon_position="left"
disabled={isLoading}
>
{deleteButtonText}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,21 @@ describe('UploadFileListCell', () => {
).toBeInTheDocument()
})

it('renders the delete button as disabled when loading state', () => {
render(
<UploadFileListCell
{...defaultProps}
uploadFile={{
file: createMockFile('file.png', 100, 'image/png'),
isLoading: true,
}}
/>
)
const element = screen.getByRole('button')

expect(element).toBeDisabled()
})

it('does not render the loading state when not loading', () => {
render(
<UploadFileListCell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import FieldPropsProvider from '../../Field/Provider'
import SectionContainerProvider from './containers/SectionContainerProvider'
import ViewContainer from './ViewContainer'
import EditContainer from './EditContainer'
import Toolbar from './Toolbar'

import type { Props as DataContextProps } from '../../DataContext/Provider'
import type { ContainerMode } from './containers/SectionContainer'
import type { Path, FieldProps, OnChange } from '../../types'
import type { JsonObject } from '../../utils/json-pointer'
import type { SharedFieldBlockProps } from '../../FieldBlock'
import Toolbar from './Toolbar'

export type OverwritePropsDefaults = {
[key: Path]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
*
*/

import './dnb-section-theme-ui.scss'
import './dnb-form-section-theme-ui.scss'
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ $THEME_FALLBACK: 'ui';

@import '../../../extensions/forms/Field/Number/style/themes/dnb-number-theme-ui.scss';
@import '../../../extensions/forms/FieldBlock/style/themes/dnb-field-block-theme-ui.scss';
@import '../../../extensions/forms/Form/Section/style/themes/dnb-form-section-theme-ui.scss';
@import '../../../extensions/forms/Wizard/style/themes/dnb-wizard-layout-theme-ui.scss';
@import '../../../extensions/payment-card/style/themes/dnb-payment-card-theme-ui.scss';
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ $THEME_FALLBACK: 'ui';

@import '../../../extensions/forms/Field/Number/style/themes/dnb-number-theme-ui.scss';
@import '../../../extensions/forms/FieldBlock/style/themes/dnb-field-block-theme-ui.scss';
@import '../../../extensions/forms/Form/Section/style/themes/dnb-form-section-theme-ui.scss';
@import '../../../extensions/forms/Wizard/style/themes/dnb-wizard-layout-theme-ui.scss';
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ $THEME_FALLBACK: 'ui';

@import '../../../extensions/forms/Field/Number/style/themes/dnb-number-theme-sbanken.scss';
@import '../../../extensions/forms/FieldBlock/style/themes/dnb-field-block-theme-sbanken.scss';
@import '../../../extensions/forms/Form/Section/style/themes/dnb-form-section-theme-sbanken.scss';
@import '../../../extensions/forms/Wizard/style/themes/dnb-wizard-layout-theme-sbanken.scss';
@import '../../../extensions/payment-card/style/themes/dnb-payment-card-theme-ui.scss';
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ $THEME_FALLBACK: 'ui';

@import '../../../extensions/forms/Field/Number/style/themes/dnb-number-theme-sbanken.scss';
@import '../../../extensions/forms/FieldBlock/style/themes/dnb-field-block-theme-sbanken.scss';
@import '../../../extensions/forms/Form/Section/style/themes/dnb-form-section-theme-sbanken.scss';
@import '../../../extensions/forms/Wizard/style/themes/dnb-wizard-layout-theme-sbanken.scss';
@import '../../../extensions/forms/Form/Section/style/themes/dnb-section-theme-sbanken.scss';
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@

@import '../../../extensions/forms/Field/Number/style/themes/dnb-number-theme-ui.scss';
@import '../../../extensions/forms/FieldBlock/style/themes/dnb-field-block-theme-ui.scss';
@import '../../../extensions/forms/Form/Section/style/themes/dnb-form-section-theme-ui.scss';
@import '../../../extensions/forms/Wizard/style/themes/dnb-wizard-layout-theme-ui.scss';
@import '../../../extensions/payment-card/style/themes/dnb-payment-card-theme-ui.scss';
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ $THEME_FALLBACK: 'ui';

@import '../../../extensions/forms/Field/Number/style/themes/dnb-number-theme-ui.scss';
@import '../../../extensions/forms/FieldBlock/style/themes/dnb-field-block-theme-ui.scss';
@import '../../../extensions/forms/Form/Section/style/themes/dnb-form-section-theme-ui.scss';
@import '../../../extensions/forms/Wizard/style/themes/dnb-wizard-layout-theme-ui.scss';
@import '../../../extensions/forms/Form/Section/style/themes/dnb-section-theme-ui.scss';

0 comments on commit d1ec4fe

Please sign in to comment.