-
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
53 changed files
with
106 additions
and
1,954 deletions.
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
packages-new/components/code/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,82 @@ | ||
* [**Interfaces**](#interfaces) | ||
* [**Types**](#types) | ||
* [**Classes**](#classes) | ||
* [**Type alias**](#type-alias) | ||
* [**Variables**](#variables) | ||
|
||
## Interfaces | ||
|
||
### OdsCodeAttributes | ||
|name | Type | Required | Default | Description| | ||
|---|---|:---:|---|---| | ||
|**`color`** | `OdsThemeColorIntent` | | | main color: see component principles| | ||
|**`contrasted`** | _boolean_ | | | contrasted or not: see component principles| | ||
|**`size`** | `md` | | | size: see component principles| | ||
|
||
### OdsCodeBehavior | ||
|name | Type | Required | Default | Description| | ||
|---|---|:---:|---|---| | ||
|**`codeEl`** | `HTMLElement` | ✴️ | | reference to the vanilla code element.| | ||
|**`el`** | `HTMLElement` | ✴️ | | reference to the host element.| | ||
|**`beforeInit`** | _void_ | ✴️ | | before init component function.should be called before component init.should autocomplete the content with an ods-button and an ods-icon| | ||
|**`createCopyIconElement`** | `HTMLElement` | ✴️ | | create an element that is an ods icon.Used when the OdsCodeController need to automatically create an icon.| | ||
|**`emitCopy`** | _void_ | ✴️ | | emit code copy| | ||
|**`onCopyClick`** | _void_ | ✴️ | | on click on the copy button, it should copy the contentby calling `controller.copyCode`| | ||
|
||
### OdsCodeEvents | ||
|name | Type | Required | Default | Description| | ||
|---|---|:---:|---|---| | ||
|**`odsCodeCopy`** | _void_ | ✴️ | | Event triggered on code content copy| | ||
|
||
## Types | ||
|
||
### OdsCodeSize | ||
| | | ||
|:---:| | ||
| `md` | | ||
|
||
## Classes | ||
|
||
### OdsCodeController | ||
_common controller logic for code component used by the different implementations._ | ||
_it contains all the glue between framework implementation and the third party service._ | ||
|
||
#### Methods | ||
> **autocompleteCopySlot**() => _unknown_ | ||
|
||
> **copyCode**() => _unknown_ | ||
|
||
|
||
### OdsCodeMock | ||
|
||
## Type alias | ||
|
||
### OdsCode | ||
|
||
interface description of all implementation of `ods-code`. | ||
each implementation must have defined events, methods, attributes | ||
and one controller for the common behavior logic | ||
|
||
> - `OdsComponentGenericMethods` | ||
> - `OdsComponentGenericEvents` | ||
### OdsCodeMethods | ||
|
||
### OdsCodeAttributes | ||
|
||
> _Based on `OdsComponentAttributes`_ | ||
### OdsCodeEvents | ||
|
||
> _Based on `OdsComponentEvents`_ | ||
## Variables | ||
|
||
### odsCodeDefaultAttributes | ||
`OdsCodeAttributes` | ||
|
||
### odsCodeDefaultAttributesDoc | ||
`OdsCodeAttributes` |
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
2 changes: 1 addition & 1 deletion
2
packages-new/components/code/src/components/osds-code/interfaces/events.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
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
1 change: 1 addition & 0 deletions
1
packages-new/components/code/src/components/osds-code/public-api.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export type { OdsCodeAttribute } from './interfaces/attributes'; | ||
export type { OdsCodeEvent } from './interfaces/events'; | ||
export { ODS_CODE_SIZE, ODS_CODE_SIZES } from './constants/code-size'; | ||
export { OsdsCode } from './osds-code'; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.