Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schemapicker: Elements attributes definition #2

Open
JakobVogelsang opened this issue Aug 25, 2022 · 0 comments
Open

Schemapicker: Elements attributes definition #2

JakobVogelsang opened this issue Aug 25, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@JakobVogelsang
Copy link
Contributor

JakobVogelsang commented Aug 25, 2022

As a user of open-scd-core I want to have an algorithm that returns the definition attributes for a given SCL element including its restriction defined by a given SCL schema.

Background
When receiving a wizard event for an element that is not added to the wizard library, we need to have a fallback mode wizard. Such a wizard is constructed of inputs for each of the attitudes of the element. Each of the attributes can have restriction defined in the schema that shall be added of the inputs in the wizard.

Requirements

  • return an object for each attribute of a given SCL element, including its restrictions based on a given schema

Proposed interfaces

function getAttributes(tagName: string, schema:XMLDocument): Record<string, Attribute>

interface Attribute {
  base: string;
  namespaceURI?: string;
  value?: string | null;
  defaultValue?: string;
  enumeration?: string[];
  required?: boolean;
  pattern?: string;
  maxLength?:string;
  minLength?: string;
}
@JakobVogelsang JakobVogelsang added the enhancement New feature or request label Aug 25, 2022
@JakobVogelsang JakobVogelsang transferred this issue from openscd/open-scd-core Sep 2, 2022
@JakobVogelsang JakobVogelsang changed the title Add schema picker Schemapicker API Sep 2, 2022
@JakobVogelsang JakobVogelsang changed the title Schemapicker API Schemapicker API: Elements attributes definition Sep 3, 2022
@JakobVogelsang JakobVogelsang changed the title Schemapicker API: Elements attributes definition Schemapicker: Elements attributes definition Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant