Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release of v10.57 #4295

Merged
merged 33 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1cafd1e
chore(Field.Date): add docs example on how to enable auto close (#4287)
joakbjerk Nov 18, 2024
7ccdabd
docs(Field.Upload): adds asyncFileHandler property
langz Nov 18, 2024
bbab4c8
chore(Field.Upload): adds a tests
langz Nov 18, 2024
f1485ee
chore(Field.Upload): adds asyncFileHandler tests (#4289)
langz Nov 18, 2024
fb09758
docs(Field.Upload): adds `asyncFileHandler` property (#4288)
langz Nov 18, 2024
09a050d
chore(Field.Upload): adds asyncFileHandler test (#4291)
whitneymarkov Nov 18, 2024
2cc816a
feat(Field.Upload): adds support for async and sync fn in `fileHandle…
langz Nov 19, 2024
8786d5d
feat(DrawerList, Dropdown, Autocomplete, Field.Selection, Field.Array…
snorrekim Nov 19, 2024
82e939e
chore: update version in changelog
langz Nov 19, 2024
b862dc8
chore(Field.Upload): improves example (#4296)
langz Nov 19, 2024
664e88e
chore: minor spelling improvements (#4306)
langz Nov 20, 2024
ed9db4b
chore: adds headings to helper docs (#4297)
langz Nov 20, 2024
a15cf4b
chore(Flex.Container): move desc to below import (#4298)
langz Nov 20, 2024
69bbdaf
chore(Flex): adds import (#4299)
langz Nov 20, 2024
b25736d
chore(Forms): rename internal process name (#4301)
tujoworker Nov 20, 2024
0e2d918
chore(Forms): remove unnecessary checks in useFieldProps (#4302)
tujoworker Nov 20, 2024
c585491
fix(Forms): show indicator with async onBlurValidator call when `vali…
tujoworker Nov 20, 2024
235b823
fix(Icon): ensure icon name is rendered as `data-testid` (#4304)
tujoworker Nov 20, 2024
f14bacc
fix(Forms): safeguard errorMessages to avoid infinite loops when not …
tujoworker Nov 20, 2024
54cd00d
chore: move blocks out of beta (#3994)
langz Nov 20, 2024
e726e20
fix(Forms): ensure fields inside composition share submit indicator (…
tujoworker Nov 20, 2024
53cd4e6
chore(Fragments): adds description header (#4313)
langz Nov 20, 2024
e0ad211
chore: renames bankaccount to bank account (#4315)
langz Nov 21, 2024
a58c999
chore: adds Indeterminate to list of base fields components (#4300)
langz Nov 21, 2024
4a8880f
chore: be continued -> continue (#4316)
langz Nov 21, 2024
5a06b2e
feat(Forms): deprecate `validator` in favor of `onChangeValidator` (#…
langz Nov 21, 2024
6008d9a
feat(Card, Section): add `outset` property for moderate layout breako…
tujoworker Nov 21, 2024
9dfe66d
feat(Typography): add general `.dnb-t` helper classes and add typogra…
snorrekim Nov 21, 2024
b6621c2
fix(Forms): align Value.SummaryList when Value.* has no label (#4311)
langz Nov 21, 2024
46f68ae
feat(Forms): add `labelSrOnly` to Value.* components (#4319)
tujoworker Nov 21, 2024
7bbc0ca
feat(Forms): add `Form.Card` with different default appearance than C…
tujoworker Nov 22, 2024
6e29f8d
chore: adds changelog for v10.57.0 (#4310)
langz Nov 22, 2024
61be7b2
chore(Card): adds outset prop docs (#4320)
langz Nov 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,9 @@ const errorMessages = {

- Got removed. Simply provide your error message as a object in the `errorMessages` property with an `useMemo` hook.

## DrawerList

- replace type `DrawerListDataObjectUnion` with `DrawerListDataArrayItem`.
- replace type `DrawerListDataObject` with `DrawerListDataArrayObject`.

_February, 6. 2024_
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,50 @@ export const AutocompleteDisabledExample = () => (
</Wrapper>
)

export const AutocompleteDisabledOptionsExample = () => (
<Wrapper>
<ComponentBox data-visual-test="autocomplete-disabled-options">
<Autocomplete
show_submit_button
data={[
{
disabled: true,
content: (
<Autocomplete.HorizontalItem>
<IconPrimary size="medium" icon="bell" right="x-small" />
The Shawshank Redemption
</Autocomplete.HorizontalItem>
),
year: 1994,
},
{
disabled: true,
content: ['The Godfather', 'Line with more info'],
year: 1972,
},
{
disabled: true,
content: [
'The Godfather: Part II',
<a key="a-1" className="dnb-anchor" href="/">
Anchor 1
</a>,
<a key="a-2" className="dnb-anchor" href="/">
Anchor 2
</a>,
'Line with more info',
],
year: 1974,
},
{ disabled: true, content: 'The Dark Knight', year: 2008 },
]}
label="Label"
bottom
/>
</ComponentBox>
</Wrapper>
)

export const AutocompleteContentAsArrayExample = () => (
<Wrapper>
<ComponentBox hidePreview>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import TranslationsTable from 'dnb-design-system-portal/src/shared/parts/Transla
import PropertiesTable from 'dnb-design-system-portal/src/shared/parts/PropertiesTable'
import { autocompleteProperties } from '@dnb/eufemia/src/components/autocomplete/AutocompleteDocs'
import { DrawerListProperties } from '@dnb/eufemia/src/fragments/drawer-list/DrawerListDocs'
import DrawerListDataDoc from '../fragments/drawer-list/_prop-data.mdx'

## Properties

Expand All @@ -17,59 +18,7 @@ You may check out the [DrawerList Properties](#drawerlist-properties) down below

<PropertiesTable props={DrawerListProperties} />

## Data structure

```js
// 1. as array
const data = [
// Every data item can, beside "content" - contain what ever
{
// (optional) can be what ever
selected_key: 'key_0',

// (optional) is show instead of "content", once selected
selected_value: 'Item 1 Value',
suffix_value: 'Addition 1',

// Item content as a string, array or React Element
content: 'Item 1 Content',
},

// more items ...
{
selected_key: 'key_1',
content: (
<>
<IconPrimary icon="bell" />
<span className="dnb-typo-bold">Searchable content</span>
</>
),
},
{
selected_key: 'key_2',
selected_value: 'Item 3 Value',
suffix_value: 'Addition 3',
content: (
<Autocomplete.HorizontalItem>
<IconPrimary icon="bell" />
<span className="dnb-typo-bold">Searchable content</span>
</Autocomplete.HorizontalItem>
),
},
{
selected_key: 'key_3',
selected_value: 'Item 4 Value',
suffix_value: 'Addition 4',
content: ['Item 4 Content A', <>Custom Component</>],
},
]

// 2. as object
const data = {
a: 'A',
b: 'B',
}
```
<DrawerListDataDoc />

## Translations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ draft: true
import {
AutocompleteOpened,
AutocompleteDisabledExample,
AutocompleteDisabledOptionsExample,
} from 'Docs/uilib/components/autocomplete/Examples'

<VisibleWhenVisualTest>
<AutocompleteOpened />
<AutocompleteDisabledExample />
<AutocompleteDisabledOptionsExample />
</VisibleWhenVisualTest>
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,26 @@ export const DropdownDisabled = () => (
</Wrapper>
)

export const DropdownDisabledOptions = () => (
<Wrapper>
<ComponentBox data-visual-test="dropdown-disabled-options">
<Dropdown
data={[
{
content: 'Item 1 Content',
},
{ content: 'Item 2 Content', disabled: true },
{ content: 'Item 3 Content', disabled: true },
{
content: 'Item 4 Content A',
},
]}
label="Label"
/>
</ComponentBox>
</Wrapper>
)

export const DropdownDisabledTertiary = () => (
<Wrapper>
<ComponentBox data-visual-test="dropdown-disabled-tertiary">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
DropdownTertiaryRight,
DropdownMoreMenu,
DropdownDisabled,
DropdownDisabledOptions,
DropdownCustomEvent,
DropdownSizes,
DropdownCustomWidth,
Expand Down Expand Up @@ -87,6 +88,10 @@ With long list to make it scrollable and searchable

<DropdownDisabled />

Individual options can also be disabled.

<DropdownDisabledOptions />

### Disabled tertiary dropdown

<DropdownDisabledTertiary />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ showTabs: true

## Events

| Events | Description |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `on_change` | _(optional)_ will be called on state changes made by the user. Returns an object with the new selected `data` item `{ data, event, attributes, value }`. |
| `on_select` | _(optional)_ will be called once the user selects an item by a click or keyboard navigation. Returns an object with the new selected `data` item `{ data, event, attributes, value, active_item }`. The **active_item** property is the currently selected item by keyboard navigation |
| `on_show` | _(optional)_ will be called once the user presses the dropdown. Returns the data item `{ data, attributes }`. |
| `on_hide` | _(optional)_ will be called once the user presses the dropdown again, or clicks somewhere else. Returns the data item `{ data, attributes }`. |
| Events | Description |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `on_change` | _(optional)_ will be called on state changes made by the user. Returns an object with the new selected `data` item `{ data, event, attributes, value }`. |
| `on_select` | _(optional)_ will be called once the user focuses or selects an item by a click or keyboard navigation. Returns an object with the new selected `data` item `{ data, event, attributes, value, active_item }`. The **active_item** property is the currently selected item by keyboard navigation |
| `on_show` | _(optional)_ will be called once the user presses the dropdown. Returns the data item `{ data, attributes }`. |
| `on_hide` | _(optional)_ will be called once the user presses the dropdown again, or clicks somewhere else. Returns the data item `{ data, attributes }`. |

### The `on_change` vs `on_select` difference

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ showTabs: true
import TranslationsTable from 'dnb-design-system-portal/src/shared/parts/TranslationsTable'
import PropertiesTable from 'dnb-design-system-portal/src/shared/parts/PropertiesTable'
import { DrawerListProperties } from '@dnb/eufemia/src/fragments/drawer-list/DrawerListDocs'
import DrawerListDataDoc from '../fragments/drawer-list/_prop-data.mdx'

## Properties

Expand Down Expand Up @@ -54,49 +55,7 @@ Should either be an index (integer) of the data array or a key – defined by `s

If `data` is an object, use the object key as the `value` to define the selected item. Can be a string or integer.

## Data structure

```js
// 1. as array
const data = [
// Every data item can, beside "content" - contain what ever
{
// (optional) can be what ever
selectedKey: 'key_0',

// (optional) is show instead of "content", once selected
selected_value: 'Item 1 Value',
suffix_value: 'Addition 1',

// Item content as a string or array
content: 'Item 1 Content',
},

// more items ...
{
selectedKey: 'key_1',
content: ['Item 2 Value', 'Item 2 Content'],
},
{
selectedKey: 'key_2',
selected_value: 'Item 3 Value',
suffix_value: 'Addition 3',
content: ['Item 3 Content A', 'Item 3 Content B'],
},
{
selectedKey: 'key_3',
selected_value: 'Item 4 Value',
suffix_value: 'Addition 4',
content: ['Item 4 Content A', <>Custom Component</>],
},
]

// 2. as object
const data = {
a: 'A',
b: 'B',
}
```
<DrawerListDataDoc />

## Translations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,31 @@ export const DrawerListExampleDefault = () => (
</Wrapper>
)

export const DrawerListExampleDisabled = () => (
<Wrapper>
<ComponentBox data-visual-test="drawer-list-disabled">
<DrawerList
skip_portal
opened
prevent_close
data={[
{
content: 'Item 1',
},
{
content: 'Item 2, disabled',
disabled: true,
},
{
content: 'Item 3',
},
]}
observer_element=".dnb-live-preview" // prevents direction to change when scrolling in this example
/>
</ComponentBox>
</Wrapper>
)

export const DrawerListExampleSingleItem = () => (
<Wrapper>
<ComponentBox scope={{ data }} data-visual-test="drawer-list-events">
Expand Down
Loading
Loading