-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(arch): move && simplify component Modal
- Loading branch information
1 parent
ffc42c0
commit 639470a
Showing
68 changed files
with
353 additions
and
301 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
66 changes: 66 additions & 0 deletions
66
packages-new/components/modal/documentation/specifications/spec.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
* [**Interfaces**](#interfaces) | ||
* [**Classes**](#classes) | ||
* [**Type alias**](#type-alias) | ||
* [**Variables**](#variables) | ||
|
||
## Interfaces | ||
|
||
### OdsModalAttributes | ||
|name | Type | Required | Default | Description| | ||
|---|---|:---:|---|---| | ||
|**`color`** | `OdsThemeColorIntent` | ✴️ | | Color of the modal's header background| | ||
|**`dismissible`** | _boolean_ | | | Defines if the modal is dismissible (displays a close button)| | ||
|**`headline`** | _string_ | | | Text displayed as the modal's headline| | ||
|**`masked`** | _boolean_ | | | Defines if the modal is masked| | ||
|
||
### OdsModalMethods | ||
|name | Type | Required | Default | Description| | ||
|---|---|:---:|---|---| | ||
|**`close`** | _void_ | ✴️ | | close the modal| | ||
|**`open`** | _void_ | ✴️ | | open the modal| | ||
|
||
## Classes | ||
|
||
### OdsModalController | ||
_common controller logic for cmpnt component used by the different implementations._ | ||
_it contains all the glue between framework implementation and the third party service._ | ||
|
||
#### Methods | ||
> **close**() => _unknown_ | ||
|
||
> **open**() => _unknown_ | ||
|
||
> **validateAttributes**() => _unknown_ | ||
|
||
|
||
## Type alias | ||
|
||
### OdsModal | ||
|
||
interface description of all implementation of `ods-modal`. | ||
each implementation must have defined events, methods, attributes | ||
and one controller for the common behavior logic | ||
|
||
> - `OdsComponentGenericMethods` | ||
> - `OdsComponentGenericEvents` | ||
### OdsModalAttributes | ||
|
||
> _Based on `OdsComponentAttributes`_ | ||
### OdsModalEvents | ||
|
||
> _Based on `OdsComponentEvents`_ | ||
### OdsModalMethods | ||
|
||
> _Based on `OdsComponentMethods`_ | ||
## Variables | ||
|
||
### odsModalDefaultAttributes | ||
`OdsModalAttributes` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...components/modal/specifications-modal.mdx → ...n/specifications/specifications-modal.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
packages-new/components/modal/src/components/osds-modal/constants/default-attributes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { OdsModalAttribute } from '../interfaces/attributes'; | ||
import { OdsThemeColorIntent } from '@ovhcloud/ods-theming'; | ||
|
||
const DEFAULT_ATTRIBUTE: OdsModalAttribute = Object.freeze({ | ||
color: OdsThemeColorIntent.info, | ||
dismissible: true, | ||
headline: '', | ||
masked: false, | ||
}); | ||
|
||
export { | ||
DEFAULT_ATTRIBUTE, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages-new/components/modal/src/components/osds-modal/interfaces/methods.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
interface OdsModalMethod { | ||
/** | ||
* close && set display none to the modal | ||
*/ | ||
close(): Promise<void>; | ||
|
||
/** | ||
* open && display the modal | ||
*/ | ||
open(): Promise<void>; | ||
} | ||
|
||
export { | ||
OdsModalMethod, | ||
}; |
24 changes: 10 additions & 14 deletions
24
...s/osds-modal/osds-modal.e2e.screenshot.ts → ...s/osds-modal/osds-modal.e2e.screenshot.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 10 additions & 7 deletions
17
...c/components/osds-modal/osds-modal.e2e.ts → ...c/components/osds-modal/osds-modal.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.