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

chore(release): release alpha #1430

Merged
merged 27 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7ae9f3e
Merge pull request #1402 from dhis2/master
Birkbjo Sep 9, 2023
abcdce7
Merge branch 'master' into alpha
Birkbjo Sep 11, 2023
d3e74c5
fix(types): add type declarations for components (#1399)
Birkbjo Oct 12, 2023
19f3e00
chore(release): cut 8.14.2-alpha.1 [skip release]
dhis2-bot Oct 12, 2023
2e9d91a
feat(types): add types for forms collection (#1415)
Birkbjo Oct 19, 2023
dbcec60
chore(release): cut 8.15.0-alpha.1 [skip release]
dhis2-bot Oct 19, 2023
71f4537
fix: minor type fixes (#1416)
Birkbjo Oct 20, 2023
aaf5b32
chore(release): cut 8.15.0-alpha.2 [skip release]
dhis2-bot Oct 20, 2023
e56247e
Merge branch 'master' into alpha
Birkbjo Nov 15, 2023
6012942
chore(changelog): merge changelog correctly
Birkbjo Nov 15, 2023
e16036b
fix(package): include types in exports field
Birkbjo Nov 15, 2023
4f83a6a
Merge pull request #1423 from dhis2/fix/types-exports
Birkbjo Nov 20, 2023
702002b
chore(release): cut 8.15.0-alpha.3 [skip release]
dhis2-bot Nov 20, 2023
3f5831e
Merge branch 'master' into alpha-merge-master
Birkbjo Nov 24, 2023
8c665c7
chore(changelog): merge changelog
Birkbjo Nov 24, 2023
6cca99a
Merge branch 'master' into alpha [skip release]
Birkbjo Nov 28, 2023
6f96588
chore(release): cut 8.16.0-alpha.1 [skip release]
dhis2-bot Nov 28, 2023
5e1068d
fix(types): minor type fixes (#1434) [skip release]
Birkbjo Nov 29, 2023
c46ed79
Merge branch 'master' into alpha
Birkbjo Nov 29, 2023
c835a83
chore(changelog): align changelog with master
Birkbjo Nov 29, 2023
00334c5
chore(release): cut 8.16.0-alpha.2 [skip release]
dhis2-bot Nov 29, 2023
d4dc535
fix(constants): remove buttonVariantProptype from constants (#1436)
Birkbjo Dec 6, 2023
9c83313
chore(release): cut 9.0.0-alpha.1 [skip release]
dhis2-bot Dec 6, 2023
56e6c4f
Merge branch 'master' into merge-master
Birkbjo Dec 8, 2023
a687b8c
chore: merge changelog
Birkbjo Dec 8, 2023
bd17a0a
Merge pull request #1438 from dhis2/merge-master
Birkbjo Dec 8, 2023
3467423
chore(release): cut 9.0.0-alpha.2 [skip release]
dhis2-bot Dec 8, 2023
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.yarn/
utilities/icons/src/react/**/*.js
**/locales/
*.d.ts
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const config = {
'*.stories*.js',
'**/__stories__/*.js',
'**/__stories__/**/*.js',
'*.d.ts',
],
rules: {
'import/no-extraneous-dependencies': 'error',
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# [8.16.0-alpha.2](https://github.com/dhis2/ui/compare/v8.16.0-alpha.1...v8.16.0-alpha.2) (2023-11-29)


### Bug Fixes

* **prop-type:** fix deprecation of buttonVariantPropType ([#1433](https://github.com/dhis2/ui/issues/1433)) ([81644a8](https://github.com/dhis2/ui/commit/81644a8e54cf7a4f29ff33536029df6e2bad9437))
* **types:** minor type fixes ([#1434](https://github.com/dhis2/ui/issues/1434)) [skip release] ([5e1068d](https://github.com/dhis2/ui/commit/5e1068d5ce6be0e52bee1d98ace752b1bf08f683))

## [8.15.1](https://github.com/dhis2/ui/compare/v8.15.0...v8.15.1) (2023-11-28)


Expand Down
27 changes: 15 additions & 12 deletions collections/forms/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@dhis2/ui-forms",
"version": "8.15.1",
"version": "8.16.0-alpha.2",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"sideEffects": [
"build/es/locales/index.js",
"build/cjs/locales/index.js"
],
"exports": {
"types": "./types/index.d.ts",
"import": "./build/es/index.js",
"require": "./build/cjs/index.js"
},
Expand All @@ -34,25 +35,27 @@
},
"dependencies": {
"@dhis2/prop-types": "^3.1.2",
"@dhis2-ui/button": "8.15.1",
"@dhis2-ui/checkbox": "8.15.1",
"@dhis2-ui/field": "8.15.1",
"@dhis2-ui/file-input": "8.15.1",
"@dhis2-ui/input": "8.15.1",
"@dhis2-ui/radio": "8.15.1",
"@dhis2-ui/select": "8.15.1",
"@dhis2-ui/switch": "8.15.1",
"@dhis2-ui/text-area": "8.15.1",
"@dhis2-ui/button": "8.16.0-alpha.2",
"@dhis2-ui/checkbox": "8.16.0-alpha.2",
"@dhis2-ui/field": "8.16.0-alpha.2",
"@dhis2-ui/file-input": "8.16.0-alpha.2",
"@dhis2-ui/input": "8.16.0-alpha.2",
"@dhis2-ui/radio": "8.16.0-alpha.2",
"@dhis2-ui/select": "8.16.0-alpha.2",
"@dhis2-ui/switch": "8.16.0-alpha.2",
"@dhis2-ui/text-area": "8.16.0-alpha.2",
"classnames": "^2.3.1",
"final-form": "^4.20.2",
"prop-types": "^15.7.2",
"react-final-form": "^6.5.3"
},
"files": [
"build"
"build",
"types"
],
"devDependencies": {
"react": "16.13",
"react-dom": "16.13"
}
},
"types": "types"
}
16 changes: 16 additions & 0 deletions collections/forms/types/CheckboxFieldFF/CheckboxFieldFF.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { FieldRenderProps } from 'react-final-form'
import type { CheckboxFieldProps } from '@dhis2-ui/checkbox'
import React from 'react'

type CheckBoxValue = CheckboxFieldProps['value']
type CheckboxRestProps = Omit<
CheckboxFieldProps,
'onChange' | 'value' | 'checked' | 'name'
>

export type CheckboxFieldFFProps = FieldRenderProps<CheckBoxValue> &
CheckboxRestProps & {
showValidStatus?: boolean
}

export const CheckboxFieldFF: React.FC<CheckboxFieldFFProps>
9 changes: 9 additions & 0 deletions collections/forms/types/FieldGroupFF/FieldGroupFF.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'
import type { FieldGroupProps } from '@dhis2-ui/field'

export type FieldGroupFFProps = Omit<
FieldGroupProps,
'children' | 'label' | 'name' | 'required'
>

export const FieldGroupFF: React.FC<FieldGroupFFProps>
18 changes: 18 additions & 0 deletions collections/forms/types/FileInputFieldFF/FileInputFieldFF.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react'
import type { FileInputFieldProps } from '@dhis2-ui/file-input'
import type { FieldRenderProps } from 'react-final-form'

export type FilesValue = File[] | undefined | null | ''

type FileInputRestProps = Omit<
FileInputFieldProps,
'onChange' | 'multiple' | 'name'
>

export type FileInputFieldFFProps = FieldRenderProps<FilesValue> &
FileInputRestProps & {
showValidStatus?: boolean
multifile: FileInputFieldProps['multiple']
}

export const FileInputFieldFF: React.FC<FileInputFieldFFProps>
15 changes: 15 additions & 0 deletions collections/forms/types/InputFieldFF/InputFieldFF.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react'
import type { InputFieldProps } from '@dhis2-ui/input'
import type { FieldRenderProps } from 'react-final-form'

export type InputValue = InputFieldProps['value']

type InputFieldRestProps = Omit<InputFieldProps, 'onChange' | 'value' | 'name'>

export type InputFieldFFProps = FieldRenderProps<InputValue> &
InputFieldRestProps & {
showLoadingStatus?: boolean
showValidStatus?: boolean
}

export const InputFieldFF: React.FC<InputFieldFFProps>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react'
import type { FieldRenderProps } from 'react-final-form'
import type {
MultiSelectOptionProps,
MultiSelectFieldProps,
} from '@dhis2-ui/select'

type InputValue = MultiSelectFieldProps['selected'] | ''

type MultiSelectFieldRestProps = Omit<
MultiSelectFieldProps,
'onChange' | 'value'
>

type MultiSelectOptions = Array<Pick<MultiSelectOptionProps, 'value' | 'label'>>

export type MultiSelectFieldFFProps = FieldRenderProps<InputValue> &
MultiSelectFieldRestProps & {
showLoadingStatus?: boolean
showValidStatus?: boolean
options: MultiSelectOptions
}

export const MultiSelectFieldFF: React.FC<MultiSelectFieldFFProps>
17 changes: 17 additions & 0 deletions collections/forms/types/RadioFieldFF/RadioFieldFF.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react'
import type { FieldRenderProps } from 'react-final-form'
import type { RadioProps } from '@dhis2-ui/radio'

type InputValue = RadioProps['value']

type RadioRestProps = Omit<
RadioProps,
'onChange' | 'value' | 'checked' | 'name'
>

export type RadioFieldFFProps = FieldRenderProps<InputValue> &
RadioRestProps & {
showValidStatus?: boolean
}

export const RadioFieldFF: React.FC<RadioFieldFFProps>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react'
import type { FieldRenderProps } from 'react-final-form'
import type {
SingleSelectOptionProps,
SingleSelectFieldProps,
} from '@dhis2-ui/select'

type InputValue = SingleSelectFieldProps['selected']

type SingleSelectOptions = Array<
Pick<SingleSelectOptionProps, 'value' | 'label'>
>

type SingleSelectRestProps = Omit<
SingleSelectFieldProps,
'onChange' | 'value' | 'name'
>

export type SingleSelectFieldFFProps = FieldRenderProps<InputValue> &
SingleSelectRestProps & {
showLoadingStatus?: boolean
showValidStatus?: boolean
options: SingleSelectOptions
}

export const SingleSelectFieldFF: React.FC<SingleSelectFieldFFProps>
15 changes: 15 additions & 0 deletions collections/forms/types/SwitchFieldFF/SwitchFieldFF.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react'
import type { FieldRenderProps } from 'react-final-form'
import type { SwitchFieldProps } from '@dhis2-ui/switch'

type InputValue = SwitchFieldProps['value']

type SwitchFieldRestProps = Omit<
SwitchFieldProps,
'onChange' | 'checked' | 'value' | 'name'
>

export type SwitchFieldFFProps = FieldRenderProps<InputValue> &
SwitchFieldRestProps

export const SwitchFieldFF: React.FC<SwitchFieldFFProps>
15 changes: 15 additions & 0 deletions collections/forms/types/TextAreaFieldFF/TextAreaFieldFF.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react'
import type { FieldRenderProps } from 'react-final-form'
import type { TextAreaFieldProps } from '@dhis2-ui/text-area'

type InputValue = TextAreaFieldProps['value']

type TextAreaFieldRestProps = Omit<
TextAreaFieldProps,
'onChange' | 'value' | 'name'
>

export type TextAreaFieldFFProps = FieldRenderProps<InputValue> &
TextAreaFieldRestProps

export const TextAreaFieldFF: React.FC<TextAreaFieldFFProps>
28 changes: 28 additions & 0 deletions collections/forms/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as FinalForm from 'final-form'
import * as ReactFinalForm from 'react-final-form'

export { CheckboxFieldFF } from './CheckboxFieldFF/CheckboxFieldFF'
export { FileInputFieldFF } from './FileInputFieldFF/FileInputFieldFF'
export { InputFieldFF } from './InputFieldFF/InputFieldFF'
export { MultiSelectFieldFF } from './MultiSelectFieldFF/MutliSelectFieldFF'
export { SingleSelectFieldFF } from './SingleSelectFieldFF/SingleSelectFieldFF'
export { RadioFieldFF } from './RadioFieldFF/RadioFieldFF'
export { SwitchFieldFF } from './SwitchFieldFF/SwitchFieldFF'
export { TextAreaFieldFF } from './TextAreaFieldFF/TextAreaFieldFF'
export { FieldGroupFF } from './FieldGroupFF/FieldGroupFF'

export * from './transformers'
export * from './validators'

/**
* Allows direct access to the FinalForm library. Please note that this is considered advanced
* usage and that you need to stay up to date with breaking changes in the FinalForm library.
*/
export { FinalForm }

/**
* Allows direct access to the ReactFinalForm library. Please note that this is considered
* advanced usage and that you need to stay up to date with breaking changes in the FinalForm
* library.
*/
export { ReactFinalForm }
6 changes: 6 additions & 0 deletions collections/forms/types/transformers/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export type ValuesWithId = Array<{ id: string }> | undefined

export const arrayWithIdObjects: {
format: (value: ValuesWithId) => string
pars: (value: string) => ValuesWithId
}
31 changes: 31 additions & 0 deletions collections/forms/types/validators/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export type Validator = (value: unknown) => string | undefined

export const alphaNumeric: Validator
export const boolean: Validator
export const composeValidators: (...validators: Validator[]) => Validator

export const createCharacterLengthRange: (
lowerBound: number,
upperBound: number,
customMessage?: string
) => Validator
export const createEqualTo: (key: string, description?: string) => Validator
export const createMaxCharacterLength: (upperBound: number) => Validator
export const createMaxNumber: (upperBound: number) => Validator
export const createMinCharacterLength: (lowerBound: number) => Validator
export const createMinNumber: (lowerBound: number) => Validator
export const createNumberRange: (
lowerBound: number,
upperBound: number,
customMessage?: string
) => Validator
export const createPattern: (pattern: RegExp, message?: string) => Validator
export const dhis2Password: Validator
export const dhis2Username: Validator
export const email: Validator
export const hasValue: Validator
export const integer: Validator
export const internationalPhoneNumber: Validator
export const number: Validator
export const string: Validator
export const url: Validator
49 changes: 43 additions & 6 deletions collections/ui/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ import { DropdownButton } from '@dhis2/ui'
|className|string||||
|component|element|||Component to show/hide when button is clicked|
|dataTest|string|`'dhis2-uicore-dropdownbutton'`|||
|destructive|boolean|||Applies 'destructive' button appearance, implying a dangerous action.|
|destructive|custom|||Button variant. Mutually exclusive with `primary` and `secondary` props|
|disabled|boolean|||Make the button non-interactive|
|icon|element||||
|initialFocus|boolean|||Grants button initial focus on the page|
|large|custom|||Button size. Mutually exclusive with `small` prop|
|name|string||||
|open|boolean|||Controls popper visibility. When implementing this prop the component becomes a controlled component|
|primary|boolean|||Applies 'primary' button appearance, implying the most important action.|
|secondary|boolean|||Applies 'secondary' button appearance.|
|primary|custom|||Button variant. Mutually exclusive with `destructive` and `secondary` props|
|secondary|custom|||Button variant. Mutually exclusive with `primary` and `destructive` props|
|small|custom|||Button size. Mutually exclusive with `large` prop|
|tabIndex|string||||
|type|'submit' │ 'reset' │ 'button'|||Type of button. Can take advantage of different default behavior|
Expand All @@ -190,14 +190,14 @@ import { SplitButton } from '@dhis2/ui'
|className|string||||
|component|element|||Component to render when the dropdown is opened|
|dataTest|string|`'dhis2-uicore-splitbutton'`|||
|destructive|boolean|||Applies 'destructive' button appearance, implying a dangerous action.|
|destructive|custom|||Applies 'destructive' appearance to indicate purpose. Mutually exclusive with `primary` and `secondary` props|
|disabled|boolean|||Disables the button and makes it uninteractive|
|icon|element|||An icon to add inside the button|
|initialFocus|boolean|||Grants the button the initial focus|
|large|custom|||Changes button size. Mutually exclusive with `small` prop|
|name|string||||
|primary|boolean|||Applies 'primary' button appearance, implying the most important action.|
|secondary|boolean|||Applies 'secondary' button appearance.|
|primary|custom|||Applies 'primary' appearance to indicate purpose. Mutually exclusive with `destructive` and `secondary` props|
|secondary|custom|||Applies 'secondary' appearance to indicate purpose. Mutually exclusive with `primary` and `destructive` props|
|small|custom|||Changes button size. Mutually exclusive with `large` prop|
|tabIndex|string||||
|type|'submit' │ 'reset' │ 'button'|||Type of button. Applied to html `button` element|
Expand Down Expand Up @@ -1282,6 +1282,43 @@ import { NoticeBox } from '@dhis2/ui'
|valid|custom|||Applies 'valid' message styles. Mutually exclusive with the `error` and `warning` props|
|warning|custom|||Applies 'warning' message styles. Mutually exclusive with the `error` and `valid` props|

### OrganisationUnitTreeRootError

#### Usage

**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.


```js
import { OrganisationUnitTreeRootError } from '@dhis2/ui'
```


#### Props

|Name|Type|Default|Required|Description|
|---|---|---|---|---|
|error|string||*||
|dataTest|string|`'dhis2-uiwidgets-orgunittree-error'`|||

### OrganisationUnitTreeRootLoading

#### Usage

**Note**: If possible, import the component from the main UI (`@dhis2/ui`) package.


```js
import { OrganisationUnitTreeRootLoading } from '@dhis2/ui'
```


#### Props

|Name|Type|Default|Required|Description|
|---|---|---|---|---|
|dataTest|string|`'dhis2-uiwidgets-orgunittree-loading'`|||

### OrganisationUnitTree

#### Usage
Expand Down
Loading
Loading