From 35554b3967dfc59ff1e998b192b257f49ef6a652 Mon Sep 17 00:00:00 2001 From: Moiz Masud Date: Wed, 30 Nov 2022 14:14:15 -0500 Subject: [PATCH] feat: Add missing Accordion attributes for angular (#195) * Updated carbon components react export package version Signed-off-by: Moiz Masud * Updated disabled Signed-off-by: Moiz Masud * Changed disabled input in angular export Signed-off-by: Moiz Masud Signed-off-by: Moiz Masud --- src/fragment-components/accordion/a-accordion-item.tsx | 6 +++--- src/fragment-components/accordion/a-accordion.tsx | 8 +++----- .../share-options/exports/frameworks/angular-fragment.ts | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/fragment-components/accordion/a-accordion-item.tsx b/src/fragment-components/accordion/a-accordion-item.tsx index 1f42347ba..0df56c7dc 100644 --- a/src/fragment-components/accordion/a-accordion-item.tsx +++ b/src/fragment-components/accordion/a-accordion-item.tsx @@ -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 ` diff --git a/src/fragment-components/accordion/a-accordion.tsx b/src/fragment-components/accordion/a-accordion.tsx index 2ee14491a..5a12cfaf4 100644 --- a/src/fragment-components/accordion/a-accordion.tsx +++ b/src/fragment-components/accordion/a-accordion.tsx @@ -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 ` ${json.items.map((element: any) => jsonToTemplate(element, fragments)).join('\n')} diff --git a/src/routes/edit/share-options/exports/frameworks/angular-fragment.ts b/src/routes/edit/share-options/exports/frameworks/angular-fragment.ts index 848423d8f..d1116ce5d 100644 --- a/src/routes/edit/share-options/exports/frameworks/angular-fragment.ts +++ b/src/routes/edit/share-options/exports/frameworks/angular-fragment.ts @@ -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' } };