Skip to content

325 add angular wrappers - #355

Open
dafn wants to merge 79 commits into
mainfrom
325-add-angular-wrappers
Open

dafn wants to merge 79 commits into
mainfrom
325-add-angular-wrappers

Conversation

@dafn

@dafn dafn commented Jan 23, 2026 •

Copy link
Copy Markdown
Collaborator

These are some guidelines for web component development that generates the best wrappers:

  • Do not use @type in JSdocs since the manifest type is now generated from the ts types
  • Remember to use ! to declare a property/attribute mandatory
  • Do not use set/get for properties as they obscure the inital value
    • Do any extra processing in the update, updated or similar life cycle functions

@dafn dafn linked an issue Jan 23, 2026 that may be closed by this pull request
@dafn

dafn commented Jan 23, 2026

Copy link
Copy Markdown
Collaborator Author

Staging NPM Package published: @fhidev/pull-request-designsystem-355@0.0.598
View on GitHub Packages

@dafn

dafn commented Jan 23, 2026

Copy link
Copy Markdown
Collaborator Author

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-bush-054beb503-355.westeurope.5.azurestaticapps.net

@dafn

dafn commented Jan 25, 2026

Copy link
Copy Markdown
Collaborator Author

Staging NPM Package published: @fhidev/pull-request-designsystem-355@0.0.600
View on GitHub Packages

@dafn

dafn commented Jan 25, 2026

Copy link
Copy Markdown
Collaborator Author

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-bush-054beb503-355.westeurope.5.azurestaticapps.net

@dafn

dafn commented Feb 2, 2026

Copy link
Copy Markdown
Collaborator Author

Staging NPM Package published: @fhidev/pull-request-designsystem-355@0.0.609
View on GitHub Packages

@dafn

dafn commented Feb 2, 2026

Copy link
Copy Markdown
Collaborator Author

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-bush-054beb503-355.westeurope.5.azurestaticapps.net

@dafn

dafn commented Feb 3, 2026

Copy link
Copy Markdown
Collaborator Author

Staging NPM Package published: @fhidev/pull-request-designsystem-355@0.0.610
View on GitHub Packages

@dafn

dafn commented Feb 3, 2026

Copy link
Copy Markdown
Collaborator Author

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-bush-054beb503-355.westeurope.5.azurestaticapps.net

@dafn

dafn commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

Staging NPM Package published: @fhidev/pull-request-designsystem-355@0.0.974
View on GitHub Packages

@dafn

dafn commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-bush-054beb503-355.westeurope.5.azurestaticapps.net

@dafn

dafn commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

Staging NPM Package published: @fhidev/pull-request-designsystem-355@0.0.1006
View on GitHub Packages

@dafn

dafn commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-bush-054beb503-355.westeurope.5.azurestaticapps.net

@dafn

dafn commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

Staging NPM Package published: @fhidev/pull-request-designsystem-355@0.0.1007
View on GitHub Packages

@dafn

dafn commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-bush-054beb503-355.westeurope.5.azurestaticapps.net

@dafn

dafn commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

Staging NPM Package published: @fhidev/pull-request-designsystem-355@0.0.1010
View on GitHub Packages

@dafn

dafn commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-bush-054beb503-355.westeurope.5.azurestaticapps.net

@dafn

dafn commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

Staging NPM Package published: @fhidev/pull-request-designsystem-355@0.0.1011
View on GitHub Packages

@dafn

dafn commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-bush-054beb503-355.westeurope.5.azurestaticapps.net

@dafn

dafn commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Staging NPM Package published: @fhidev/pull-request-designsystem-355@0.0.1012
View on GitHub Packages

@dafn

dafn commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-bush-054beb503-355.westeurope.5.azurestaticapps.net

@dafn

dafn commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

Staging NPM Package published: @fhidev/pull-request-designsystem-355@0.0.1023
View on GitHub Packages

@dafn

dafn commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

Azure Static Web Apps: Your stage site is ready! Visit it here: https://nice-bush-054beb503-355.westeurope.5.azurestaticapps.net

Co-authored-by: Trygve Bernhardt Moen Haaland <51702336+trybern@users.noreply.github.com>
Co-authored-by: Trygve Bernhardt Moen Haaland <51702336+trybern@users.noreply.github.com>
Comment on lines +73 to +90
switch (webComponentTagName) {
case 'fhi-text-input':
case 'fhi-date-input':
case 'fhi-select':
stateProperty = 'value';
valueProperty = 'value';
break;
case 'fhi-checkbox':
case 'fhi-radio':
stateProperty = 'checked';
valueProperty = 'value';
break;
case 'fhi-button':
return '';
default:
throw new Error(
`No value location defined for web component ${webComponentTagName}`,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kunne det vært en ide å bruke manifestet her for å sjekke om et komponent er form associated, istedenfor å ha hardkodede tag navn man sjekker. Hvis det kommer et nytt komponent som er for skjema så må switchen oppdateres. F.eks. legge med komponent metadata i input og sjekke etter checked eller value?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jeg er litt usikker på hva du tenker her. Kan du utdype?

@HenrikFalla HenrikFalla Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tenkte man kan bruke metadata i manifestet for å sjekke properties for value og checked.

const getFormAccessorConfig = (componentClass) => {
  const properties = componentClass.members.filter(member => member.kind === 'field');
  const propertyNames = new Set(properties.map(property => property.name));
  
  if (propertyNames.has('checked') && propertyNames.has('value')) {
    return {
      stateProperty: 'checked',
      valueProperty: 'value',
    };
  }
  
  if (propertyNames.has('value')) {
    return {
      stateProperty: 'value',
      valueProperty: 'value',
    };
  }
  
  return null;
};

Så kan den brukes i starten av generateFormAccessor.

if (!formConfig) {
   return;
}
const { stateProperty, valueProperty } = formConfig;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, nå skjønner jeg hva du mener.

Det ser bra ut og jeg legger det til.

Det er to det kan være vært å notere seg:

  • Jeg kan ikke garantere at om en komponent har en property med navn checked så vil det alltid være state-en.
  • Jeg kan ikke garantere at om en komponent mangler en checked property så vil alltid value være state-en.

Så det er mulig dette kan brekke på et tidspunkt og må oppdateres, men det skal nok gå greit.

This branch had an error being deployed

1 failed deployment
development — 22268e38 Deployed Oct 11, 2026 by dafn via Build and Test #1064
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Angular wrappers

4 participants