Skip to content

Commit

Permalink
feat: Add missing Accordion attributes for angular (#195)
Browse files Browse the repository at this point in the history
* Updated carbon components react export package version

Signed-off-by: Moiz Masud <[email protected]>

* Updated disabled

Signed-off-by: Moiz Masud <[email protected]>

* Changed disabled input in angular export

Signed-off-by: Moiz Masud <[email protected]>

Signed-off-by: Moiz Masud <[email protected]>
  • Loading branch information
MoizMasud authored Nov 30, 2022
1 parent 17e7bbf commit 35554b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/fragment-components/accordion/a-accordion-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ export const componentInfo: ComponentInfo = {
image,
codeExport: {
angular: {
inputs: ({ json }) => `@Input() ${nameStringToVariableString(json.codeContext?.name)}Title = "${json.title}";`,
inputs: ({ json }) => `@Input() ${nameStringToVariableString(json.codeContext?.name)}Title = "${json.title}";
@Input() ${nameStringToVariableString(json.codeContext?.name)}Disabled = ${!!json.disabled}`,
outputs: ({ json }) => `@Output() ${nameStringToVariableString(json.codeContext?.name)}Selected = new EventEmitter();`,
imports: ['AccordionModule'],
// NOTE: Angular accordion item currently does not support 'disabled'.
// issue being tracked here: https://github.com/IBM/carbon-components-angular/issues/2021
code: ({ json, fragments, jsonToTemplate }) => {
return `<ibm-accordion-item
[disabled]="${nameStringToVariableString(json.codeContext?.name)}Disabled"
[title]="${nameStringToVariableString(json.codeContext?.name)}Title"
(selected)="${nameStringToVariableString(json.codeContext?.name)}Selected.emit($event)"
${angularClassNamesFromComponentObj(json)}>
Expand Down
8 changes: 3 additions & 5 deletions src/fragment-components/accordion/a-accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ export const componentInfo: ComponentInfo = {
image,
codeExport: {
angular: {
inputs: ({ json }) => `@Input() ${nameStringToVariableString(json.codeContext?.name)}Align = "${json.align}";`,
inputs: ({ json }) => `@Input() ${nameStringToVariableString(json.codeContext?.name)}Align = "${json.align}";
@Input() ${nameStringToVariableString(json.codeContext?.name)}Size = "${json.size}";`,
outputs: () => '',
imports: ['AccordionModule'],
// NOTE: Angular accordion does not support size yet.
// Issue being tracked here: https://github.com/IBM/carbon-components-angular/issues/2022
// NOTE: Angular accordion align end does not behave as expected.
// Issue being tracked here: https://github.com/IBM/carbon-components-angular/issues/2023
code: ({ json, fragments, jsonToTemplate }) => {
return `<ibm-accordion
[size]="${nameStringToVariableString(json.codeContext?.name)}Size"
[align]="${nameStringToVariableString(json.codeContext?.name)}Align"
${angularClassNamesFromComponentObj(json)}>
${json.items.map((element: any) => jsonToTemplate(element, fragments)).join('\n')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ export const createAngularApp = (fragment: any, fragments: any[]) => {
'tslib': '2.3.0',
'sass': '1.45.0',
'zone.js': '0.11.4',
'carbon-components-angular': '4.56.3',
'carbon-components': '10.50.0'
'carbon-components-angular': '4.63.0',
'carbon-components': '10.58.0'
}
};

Expand Down

0 comments on commit 35554b3

Please sign in to comment.