Skip to content

Commit

Permalink
add docs and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joakbjerk committed Nov 6, 2024
1 parent 7f53ea9 commit 602ee1e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ showTabs: true

import PropertiesTable from 'dnb-design-system-portal/src/shared/parts/PropertiesTable'
import { FieldEvents } from '@dnb/eufemia/src/extensions/forms/Field/FieldDocs'
import { DateEvents } from '@dnb/eufemia/src/extensions/forms/Field/Date/DateDocs'

## Events

<PropertiesTable props={FieldEvents} />

## Date Events

<PropertiesTable props={DateEvents} />
31 changes: 9 additions & 22 deletions packages/dnb-eufemia/src/extensions/forms/Field/Date/DateDocs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { PropertiesTableProps } from '../../../../shared/types'

// TODO: Merge with DatePickerProps after it's been camelCased
export const DateProperties: PropertiesTableProps = {
help: {
doc: 'Provide a help button. Object consisting of `title` and `content`.',
Expand Down Expand Up @@ -186,55 +187,41 @@ export const DateProperties: PropertiesTableProps = {
},
}

// TODO: Merge with DatePickerEvents after it's been camelCased
export const DateEvents: PropertiesTableProps = {
on_change: {
doc: 'Will be called on a date change event. Returns an `object`. See Returned Object below.',
type: 'function',
status: 'optional',
},
on_type: {
onType: {
doc: 'Will be called on every input and date picker interaction. Returns an `object`. See Returned Object below.',
type: 'function',
status: 'optional',
},
on_submit: {
onSubmit: {
doc: 'Will be called once a user presses the submit button.',
type: 'function',
status: 'optional',
},
on_cancel: {
onCancel: {
doc: 'Will be called once a user presses the cancel button.',
type: 'function',
status: 'optional',
},
on_reset: {
onReset: {
doc: 'Will be called once a user presses the reset button.',
type: 'function',
status: 'optional',
},
on_show: {
onShow: {
doc: 'Will be called once date-picker is visible.',
type: 'function',
status: 'optional',
},
on_hide: {
onHide: {
doc: 'Will be called once date-picker is hidden.',
type: 'function',
status: 'optional',
},
on_days_render: {
onDaysRender: {
doc: 'Will be called right before every new calendar view gets rendered. See the example above.',
type: 'function',
status: 'optional',
},
onFocus: {
doc: 'Will be called once the input gets focus.',
type: 'function',
status: 'optional',
},
onBlur: {
doc: 'Will be called once the input lose focus.',
type: 'function',
status: 'optional',
},
}

0 comments on commit 602ee1e

Please sign in to comment.