-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
79 changed files
with
386 additions
and
487 deletions.
There are no files selected for viewing
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,2 @@ | ||
export * from './ods-load-content'; | ||
export * from './ods-svg-validator'; |
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.
File renamed without changes.
74 changes: 74 additions & 0 deletions
74
packages-new/components/flag/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,74 @@ | ||
* [**Interfaces**](#interfaces) | ||
* [**Classes**](#classes) | ||
* [**Type alias**](#type-alias) | ||
* [**Variables**](#variables) | ||
|
||
## Interfaces | ||
|
||
### OdsFlagAttributes | ||
|name | Type | Required | Default | Description| | ||
|---|---|:---:|---|---| | ||
|**`assetPath`** | `undefined` \| `string` | ✴️ | | override the `ODS` directory path of the assets.if not set, the configured path in `ODS` will be used.| | ||
|**`iso`** | `undefined` \| `ODS_COUNTRY_ISO_CODE` | ✴️ | | Flag ISO country code| | ||
|**`lazy`** | _boolean_ | ✴️ | | allow to lazy load the content only when it's visible| | ||
|**`src`** | `undefined` \| `string` | ✴️ | | override with custom src to the svg file.| | ||
|
||
### OdsFlagBehavior | ||
|name | Type | Required | Default | Description| | ||
|---|---|:---:|---|---| | ||
|**`hostElement`** | `Host` | ✴️ | | reference to the host element of the component| | ||
|**`getAssetPath`** | _string_ | ✴️ | | get the asset directory path in witch the content is serve.could be like `build/` or empty.in addition, the `ODS` asset path will be used.| | ||
|**`load`** | _void_ | ✴️ | | trigger the content load.should be triggered when `iso`, `assetPath` and `src` attributes changed.should call controller's method `load` and change the svg content with the one received.should define the `aria-label` to use with `iso` code.| | ||
|**`onDestroy`** | _void_ | ✴️ | | clean up thing.should call controller's method `onDestroy`| | ||
|**`onInit`** | _void_ | ✴️ | | initialization of the component.should call the controller's `onInit` method and store the state of visibility.| | ||
|
||
## Classes | ||
|
||
### OdsFlagController | ||
_common controller logic for flag component used by the different implementations._ | ||
_it contains all the glue between framework implementation and the third party service._ | ||
|
||
#### Methods | ||
> **load**() => _unknown_ | ||
|
||
> **onDestroy**() => _unknown_ | ||
|
||
> **onInit**() => _unknown_ | ||
|
||
> **validateISO**() => _unknown_ | ||
|
||
|
||
### OdsFlagMock | ||
|
||
## Type alias | ||
|
||
### OdsFlag | ||
|
||
interface description of all implementation of `ods-flag`. | ||
each implementation must have defined events, methods, attributes | ||
and one controller for the common behavior logic | ||
|
||
> - `OdsComponentGenericMethods` | ||
> - `OdsComponentGenericEvents` | ||
### OdsFlagAttributes | ||
|
||
> _Based on `OdsComponentAttributes`_ | ||
### OdsFlagEvents | ||
|
||
> _Based on `OdsComponentEvents`_ | ||
### OdsFlagMethods | ||
|
||
> _Based on `OdsComponentMethods`_ | ||
## Variables | ||
|
||
### odsFlagDefaultAttributes | ||
`OdsFlagAttributes` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...s/flag/specifications-flag-properties.mdx → ...ations/specifications-flag-properties.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
| Name | Type | Default value | Description | | ||
|----------|----------------------------------------------|---------------|---------------------------------------------| | ||
| `iso` | **_COUNTRY_FLAG_ISO_CODE_** from `@ovhcloud/ods-core` | - | Country iso code for the corresponding flag | | ||
| `iso` | **_COUNTRY_FLAG_ISO_CODE_** from `@ovhcloud/ods-common-core` | - | Country iso code for the corresponding flag | |
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
packages-new/components/flag/documentation/specifications/specifications-flag.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {Description} from '@storybook/addon-docs'; | ||
import Specs from './spec.md'; | ||
import SpecsFlagContents from './specifications-flag-contents.mdx'; | ||
import SpecsFlagTests from './specifications-flag-tests.mdx'; | ||
|
||
## Description | ||
The flag component grow to the size of the parent's container | ||
|
||
<Description>{Specs}</Description> | ||
|
||
## Contents | ||
<SpecsFlagContents /> | ||
|
||
## Tests | ||
<SpecsFlagTests /> |
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.
16 changes: 16 additions & 0 deletions
16
packages-new/components/flag/src/components/osds-flag/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,16 @@ | ||
import type { OdsFlagAttribute } from '../interfaces/attributes'; | ||
import { ODS_COUNTRY_ISO_CODE } from '@ovhcloud/ods-common-core'; | ||
|
||
/** | ||
* default attribute values of flag | ||
*/ | ||
const DEFAULT_ATTRIBUTE: OdsFlagAttribute = Object.freeze({ | ||
iso: ODS_COUNTRY_ISO_CODE.FR, | ||
lazy: false, | ||
src: '', | ||
assetPath: '', | ||
}); | ||
|
||
export { | ||
DEFAULT_ATTRIBUTE, | ||
}; |
Oops, something went wrong.