-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(wc): add new 2.1.0 components #1014
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...templates/webcomponents/igc-ts/chip/default/files/src/app/__path__/__filePrefix__.test.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { expect } from '@open-wc/testing'; | ||
import $(ClassName) from './$(path).js'; | ||
|
||
describe('IgcChipComponent', () => { | ||
it('<app-$(path)> is an instance of $(ClassName)', async () => { | ||
const element = document.createElement('app-$(path)'); | ||
expect(element).to.be.instanceOf($(ClassName)); | ||
}); | ||
}); |
34 changes: 34 additions & 0 deletions
34
.../cli/templates/webcomponents/igc-ts/chip/default/files/src/app/__path__/__filePrefix__.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { html, LitElement } from 'lit'; | ||
import { customElement } from 'lit/decorators.js'; | ||
import { | ||
defineComponents, | ||
IgcChipComponent, | ||
registerIconFromText, | ||
} from 'igniteui-webcomponents'; | ||
|
||
defineComponents(IgcChipComponent); | ||
|
||
registerIconFromText( | ||
'select', | ||
'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>', | ||
); | ||
|
||
registerIconFromText( | ||
'cancel', | ||
'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>', | ||
); | ||
|
||
@customElement('app-$(path)') | ||
export default class $(ClassName) extends LitElement { | ||
render() { | ||
return html` | ||
<div style="width: 200px; padding: 20px;"> | ||
<igc-chip selectable removable> | ||
<span slot="select"><igc-icon name="select"></igc-icon></span> | ||
Custom Icons | ||
<span slot="remove"><igc-icon name="cancel"></igc-icon></span> | ||
</igc-chip> | ||
</div> | ||
`; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/cli/templates/webcomponents/igc-ts/chip/default/index.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { TypeScriptFileUpdate } from "@igniteui/cli-core"; | ||
import { IgniteUIForWebComponentsTemplate } from "../../../../../lib/templates/IgniteUIForWebComponentsTemplate"; | ||
|
||
class IgcChipTemplate extends IgniteUIForWebComponentsTemplate { | ||
constructor() { | ||
super(__dirname); | ||
this.components = ["Chip"]; | ||
this.controlGroup = "Data Entry & Display"; | ||
this.listInComponentTemplates = true; | ||
this.id = "chip"; | ||
this.projectType = "igc-ts"; | ||
this.name = "Chip"; | ||
this.description = "Basic IgcChip"; | ||
} | ||
protected addClassDeclaration(mainModule: TypeScriptFileUpdate, projPath: string, name: string, modulePath: string) { | ||
// not applicable with custom module | ||
} | ||
} | ||
module.exports = new IgcChipTemplate(); |
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,14 @@ | ||
import { BaseComponent } from "@igniteui/cli-core"; | ||
|
||
class IgcChipComponent extends BaseComponent { | ||
/** | ||
* | ||
*/ | ||
constructor() { | ||
super(__dirname); | ||
this.name = "Chip"; | ||
this.group = "Data Entry & Display"; | ||
this.description = `Customizable chip component`; | ||
} | ||
} | ||
module.exports = new IgcChipComponent(); |
9 changes: 9 additions & 0 deletions
9
...components/igc-ts/circular-progress/default/files/src/app/__path__/__filePrefix__.test.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { expect } from '@open-wc/testing'; | ||
import $(ClassName) from './$(path).js'; | ||
|
||
describe('IgcCircularProgressComponent', () => { | ||
it('<app-$(path)> is an instance of $(ClassName)', async () => { | ||
const element = document.createElement('app-$(path)'); | ||
expect(element).to.be.instanceOf($(ClassName)); | ||
}); | ||
}); |
35 changes: 35 additions & 0 deletions
35
...s/webcomponents/igc-ts/circular-progress/default/files/src/app/__path__/__filePrefix__.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { html, LitElement } from 'lit'; | ||
import { customElement } from 'lit/decorators.js'; | ||
import { | ||
defineComponents, | ||
IgcCircularProgressComponent, | ||
} from 'igniteui-webcomponents'; | ||
|
||
defineComponents(IgcCircularProgressComponent); | ||
|
||
@customElement('app-$(path)') | ||
export default class $(ClassName) extends LitElement { | ||
render() { | ||
return html` | ||
<div style="display: flex; align-items: center; gap: 16px"> | ||
<igc-circular-progress | ||
style="--diameter: 96px; --stroke-thickness: 12px;" | ||
animation-duration="1000" | ||
indeterminate="true" | ||
variant="danger"> | ||
</igc-circular-progress> | ||
<igc-circular-progress | ||
style="--diameter: 96px; --stroke-thickness: 12px;" | ||
value="92" | ||
animation-duration="500"> | ||
</igc-circular-progress> | ||
<igc-circular-progress | ||
style="--diameter: 96px; --stroke-thickness: 12px;" | ||
value="92" | ||
animation-duration="1500" | ||
variant="success"> | ||
</igc-circular-progress> | ||
</div> | ||
`; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/cli/templates/webcomponents/igc-ts/circular-progress/default/index.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { TypeScriptFileUpdate } from "@igniteui/cli-core"; | ||
import { IgniteUIForWebComponentsTemplate } from "../../../../../lib/templates/IgniteUIForWebComponentsTemplate"; | ||
|
||
class IgcCircularProgressTemplate extends IgniteUIForWebComponentsTemplate { | ||
constructor() { | ||
super(__dirname); | ||
this.components = ["Circular Progress"]; | ||
this.controlGroup = "Data Entry & Display"; | ||
this.listInComponentTemplates = true; | ||
this.id = "circular-progress"; | ||
this.projectType = "igc-ts"; | ||
this.name = "Circular Progress"; | ||
this.description = "Basic Circular Progress"; | ||
} | ||
protected addClassDeclaration(mainModule: TypeScriptFileUpdate, projPath: string, name: string, modulePath: string) { | ||
// not applicable with custom module | ||
} | ||
} | ||
module.exports = new IgcCircularProgressTemplate(); |
14 changes: 14 additions & 0 deletions
14
packages/cli/templates/webcomponents/igc-ts/circular-progress/index.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { BaseComponent } from "@igniteui/cli-core"; | ||
|
||
class IgcCircularProgressComponent extends BaseComponent { | ||
/** | ||
* | ||
*/ | ||
constructor() { | ||
super(__dirname); | ||
this.name = "Circular Progress"; | ||
this.group = "Data Entry & Display"; | ||
this.description = `Customizable Circular Progress component`; | ||
} | ||
} | ||
module.exports = new IgcCircularProgressComponent(); |
9 changes: 9 additions & 0 deletions
9
...ebcomponents/igc-ts/linear-progress/default/files/src/app/__path__/__filePrefix__.test.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { expect } from '@open-wc/testing'; | ||
import $(ClassName) from './$(path).js'; | ||
|
||
describe('IgcLinearProgressComponent', () => { | ||
it('<app-$(path)> is an instance of $(ClassName)', async () => { | ||
const element = document.createElement('app-$(path)'); | ||
expect(element).to.be.instanceOf($(ClassName)); | ||
}); | ||
}); |
24 changes: 24 additions & 0 deletions
24
...tes/webcomponents/igc-ts/linear-progress/default/files/src/app/__path__/__filePrefix__.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { html, LitElement } from 'lit'; | ||
import { customElement } from 'lit/decorators.js'; | ||
import { | ||
defineComponents, | ||
IgcLinearProgressComponent, | ||
} from 'igniteui-webcomponents'; | ||
|
||
defineComponents(IgcLinearProgressComponent); | ||
|
||
@customElement('app-$(path)') | ||
export default class $(ClassName) extends LitElement { | ||
render() { | ||
return html` | ||
<div style="width: 200px; padding: 20px;"> | ||
<igc-linear-progress | ||
value="92" | ||
animation-duration="1000" | ||
label-align="top-end" | ||
variant="success"> | ||
</igc-linear-progress> | ||
</div> | ||
`; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/cli/templates/webcomponents/igc-ts/linear-progress/default/index.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { TypeScriptFileUpdate } from "@igniteui/cli-core"; | ||
import { IgniteUIForWebComponentsTemplate } from "../../../../../lib/templates/IgniteUIForWebComponentsTemplate"; | ||
|
||
class IgcLinearProgressComponent extends IgniteUIForWebComponentsTemplate { | ||
constructor() { | ||
super(__dirname); | ||
this.components = ["Linear Progress"]; | ||
this.controlGroup = "Data Entry & Display"; | ||
this.listInComponentTemplates = true; | ||
this.id = "linear-progress"; | ||
this.projectType = "igc-ts"; | ||
this.name = "Linear Progress"; | ||
this.description = "Basic Linear Progress"; | ||
} | ||
protected addClassDeclaration(mainModule: TypeScriptFileUpdate, projPath: string, name: string, modulePath: string) { | ||
// not applicable with custom module | ||
} | ||
} | ||
module.exports = new IgcLinearProgressComponent(); |
14 changes: 14 additions & 0 deletions
14
packages/cli/templates/webcomponents/igc-ts/linear-progress/index.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { BaseComponent } from "@igniteui/cli-core"; | ||
|
||
class IgcLinearProgressComponent extends BaseComponent { | ||
/** | ||
* | ||
*/ | ||
constructor() { | ||
super(__dirname); | ||
this.name = "Linear Progress"; | ||
this.group = "Data Entry & Display"; | ||
this.description = `Customizable Linear Progress component`; | ||
} | ||
} | ||
module.exports = new IgcLinearProgressComponent(); |
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
9 changes: 9 additions & 0 deletions
9
...mplates/webcomponents/igc-ts/rating/default/files/src/app/__path__/__filePrefix__.test.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { expect } from '@open-wc/testing'; | ||
import $(ClassName) from './$(path).js'; | ||
|
||
describe('IgcRatingComponent', () => { | ||
it('<app-$(path)> is an instance of $(ClassName)', async () => { | ||
const element = document.createElement('app-$(path)'); | ||
expect(element).to.be.instanceOf($(ClassName)); | ||
}); | ||
}); |
17 changes: 17 additions & 0 deletions
17
...li/templates/webcomponents/igc-ts/rating/default/files/src/app/__path__/__filePrefix__.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { html, LitElement } from 'lit'; | ||
import { customElement } from 'lit/decorators.js'; | ||
import { | ||
defineComponents, | ||
IgcRatingComponent, | ||
} from 'igniteui-webcomponents'; | ||
|
||
defineComponents(IgcRatingComponent); | ||
|
||
@customElement('app-$(path)') | ||
export default class $(ClassName) extends LitElement { | ||
render() { | ||
return html` | ||
<igc-rating></igc-rating> | ||
`; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/cli/templates/webcomponents/igc-ts/rating/default/index.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { TypeScriptFileUpdate } from "@igniteui/cli-core"; | ||
import { IgniteUIForWebComponentsTemplate } from "../../../../../lib/templates/IgniteUIForWebComponentsTemplate"; | ||
|
||
class IgcRatingComponent extends IgniteUIForWebComponentsTemplate { | ||
constructor() { | ||
super(__dirname); | ||
this.components = ["Rating"]; | ||
this.controlGroup = "Data Entry & Display"; | ||
this.listInComponentTemplates = true; | ||
this.id = "rating"; | ||
this.projectType = "igc-ts"; | ||
this.name = "Rating"; | ||
this.description = "Basic Rating"; | ||
} | ||
protected addClassDeclaration(mainModule: TypeScriptFileUpdate, projPath: string, name: string, modulePath: string) { | ||
// not applicable with custom module | ||
} | ||
} | ||
module.exports = new IgcRatingComponent(); |
14 changes: 14 additions & 0 deletions
14
packages/cli/templates/webcomponents/igc-ts/rating/index.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { BaseComponent } from "@igniteui/cli-core"; | ||
|
||
class IgcRatingComponent extends BaseComponent { | ||
/** | ||
* | ||
*/ | ||
constructor() { | ||
super(__dirname); | ||
this.name = "Rating"; | ||
this.group = "Data Entry & Display"; | ||
this.description = `Customizable rating component`; | ||
} | ||
} | ||
module.exports = new IgcRatingComponent(); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an idea - we can use the chip template in Angular (igx-ts) as a guide for this one. Having multiple chips would give context for the "remove" buttons, for example.