Skip to content

Commit

Permalink
feat: add product variant form
Browse files Browse the repository at this point in the history
  • Loading branch information
belsman committed Aug 17, 2024
1 parent 86429d6 commit dc83065
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,39 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
</vcl-select>
</vcl-form-control-group>
</div>
<!-- <div class="row justify-content-end w-100p mt-2">
<div class="loose-button-group">
<button vcl-button>Add variant</button>
</div>
</div> -->
<div class="divider divider-horizontal row justify-center">
<div class="divider-rule"></div>
<div class="icogram divider-element">
<div class="text">Product variant</div>
</div>
</div>
<app-module-product-variant-form />
<div class="row justify-content-end w-100p mt-2">
<div class="loose-button-group">
<button
vcl-button
type="button"
class="transparent"
>
Cancel
</button>
<button
vcl-button
type="submit"
>
Save
</button>
</div>
</div>
</div>
`,
selector: 'app-module-product-creation-form',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { ChangeDetectionStrategy, Component, HostBinding } from '@angular/core';

@Component({
template: `
<div class="row">
<div class="flex-12">
<vcl-form-control-group>
<vcl-label>Name</vcl-label>
<vcl-input-field>
<input vclInput />
</vcl-input-field>
</vcl-form-control-group>
<vcl-form-control-group>
<vcl-label>Description</vcl-label>
<vcl-input-field class="auto-height">
<textarea
vclInput
[autogrow]="true"
[minRows]="5"
[maxRows]="10"
></textarea>
</vcl-input-field>
</vcl-form-control-group>
</div>
</div>
`,
selector: 'app-module-product-variant-form',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ProductVariantFormComponent {
@HostBinding('class') className = 'w-100p';
}
2 changes: 2 additions & 0 deletions packages/modules/product/src/lib/modules-product.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ProductCreateComponent } from './components/product-create.component';
import { ProductCreationFormComponent } from './components/product-creation-form.component';
import { ProductEditComponent } from './components/product-edit.component';
import { ProductIndexComponent } from './components/product-index.component';
import { ProductVariantFormComponent } from './components/product-variant-form.component';
import { ProductViewComponent } from './components/product-view.component';
import { ProductTemplateComponent } from './components/template/product-template.component';
import { modulesProductRoutes } from './lib.routes';
Expand All @@ -19,6 +20,7 @@ import { modulesProductRoutes } from './lib.routes';
ProductEditComponent,
ProductViewComponent,
ProductCreationFormComponent,
ProductVariantFormComponent,
],
imports: [
ModulesUiModule.forChild(),
Expand Down

0 comments on commit dc83065

Please sign in to comment.