mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-01-28 04:06:11 +01:00
refactor: layout & form
This commit is contained in:
parent
da3cd140f5
commit
da8bcf7b32
26 changed files with 877 additions and 671 deletions
|
|
@ -1,38 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
|
||||
import { ThemeModule } from '../../../@theme/theme.module';
|
||||
import { DefaultButtonsComponent } from './default-buttons/default-buttons.component';
|
||||
import { HeroButtonComponent } from './hero-buttons/hero-buttons.component';
|
||||
import { ShapeButtonsComponent } from './shape-buttons/shape-buttons.component';
|
||||
import { SizeButtonsComponent } from './size-buttons/size-buttons.component';
|
||||
import { ButtonsComponent } from './buttons.component';
|
||||
import { ActionGroupsComponent } from './action-groups/action-groups.component';
|
||||
import { LabeledActionsGroupComponent } from './labeled-actions-group/labeled-actions-group.component';
|
||||
import { OutlineButtonsComponent } from './outline-buttons/outline-buttons.component';
|
||||
import { ButtonElementsComponent } from './button-elements/button-elements.component';
|
||||
|
||||
const components = [
|
||||
ButtonsComponent,
|
||||
DefaultButtonsComponent,
|
||||
OutlineButtonsComponent,
|
||||
HeroButtonComponent,
|
||||
ShapeButtonsComponent,
|
||||
SizeButtonsComponent,
|
||||
ActionGroupsComponent,
|
||||
LabeledActionsGroupComponent,
|
||||
ButtonElementsComponent,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
ThemeModule,
|
||||
],
|
||||
exports: [
|
||||
...components,
|
||||
],
|
||||
declarations: [
|
||||
...components,
|
||||
],
|
||||
providers: [],
|
||||
})
|
||||
export class ButtonsModule { }
|
||||
|
|
@ -17,9 +17,6 @@
|
|||
<div class="input-group">
|
||||
<input type="password" nbInput fullWidth placeholder="Password">
|
||||
</div>
|
||||
<div class="input-group has-person-icon">
|
||||
<input type="text" placeholder="With Icon" class="form-control"/>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<input type="text" nbInput fullWidth shape="rectangle" placeholder="Rectangle border">
|
||||
</div>
|
||||
|
|
@ -49,6 +46,19 @@
|
|||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
|
||||
<nb-card>
|
||||
<nb-card-header>Select</nb-card-header>
|
||||
<nb-card-body>
|
||||
<div class="form-group">
|
||||
<nb-select selected="1">
|
||||
<nb-option value="1">Option 1</nb-option>
|
||||
<nb-option value="2">Option 2</nb-option>
|
||||
</nb-select>
|
||||
</div>
|
||||
</nb-card-body>
|
||||
</nb-card>
|
||||
|
||||
<nb-card>
|
||||
<nb-card-header>Validation States</nb-card-header>
|
||||
<nb-card-body>
|
||||
|
|
@ -56,18 +66,18 @@
|
|||
<input type="text" nbInput fullWidth status="info" placeholder="Input with Info">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" nbInput fullWidth status="success" placeholder="Input with Warning">
|
||||
<input type="text" nbInput fullWidth status="success" placeholder="Warning Input">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" nbInput fullWidth status="warning" placeholder="Input with Danger">
|
||||
<input type="text" nbInput fullWidth status="warning" placeholder="Danger Input">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" nbInput fullWidth status="danger" placeholder="Input with Danger">
|
||||
<input type="text" nbInput fullWidth status="danger" placeholder="Danger Input">
|
||||
</div>
|
||||
<div class="form-group validation-checkboxes row">
|
||||
<nb-checkbox status="success" class="col-sm-4">Checkbox with Success</nb-checkbox>
|
||||
<nb-checkbox status="warning" class="col-sm-4">Checkbox with Warning</nb-checkbox>
|
||||
<nb-checkbox status="danger" class="col-sm-4">Checkbox with Danger</nb-checkbox>
|
||||
<nb-checkbox status="success" class="col-sm-4">Success Checkbox</nb-checkbox>
|
||||
<nb-checkbox status="warning" class="col-sm-4">Warning Checkbox</nb-checkbox>
|
||||
<nb-checkbox status="danger" class="col-sm-4">Danger Checkbox</nb-checkbox>
|
||||
</div>
|
||||
</nb-card-body>
|
||||
</nb-card>
|
||||
|
|
@ -76,11 +86,11 @@
|
|||
<nb-card-header>Checkboxes & Radios</nb-card-header>
|
||||
<nb-card-body>
|
||||
<div class="row demo-checkboxes-radio">
|
||||
<div class="demo-checkboxes col-sm-4">
|
||||
<div class="demo-items col-sm-4">
|
||||
<nb-checkbox>Checkbox 1</nb-checkbox>
|
||||
<nb-checkbox [value]="true">Checkbox 2</nb-checkbox>
|
||||
</div>
|
||||
<div class="demo-radio col-sm-4">
|
||||
<div class="demo-items col-sm-4">
|
||||
<nb-radio-group [(value)]="radioGroupValue">
|
||||
<nb-radio
|
||||
[value]="'This is value 1'">
|
||||
|
|
@ -96,7 +106,7 @@
|
|||
</nb-radio>
|
||||
</nb-radio-group>
|
||||
</div>
|
||||
<div class="demo-disabled-checkbox-radio col-sm-4">
|
||||
<div class="demo-items col-sm-4">
|
||||
<nb-checkbox disabled>Disabled Checkbox</nb-checkbox>
|
||||
<nb-radio-group disabled>
|
||||
<nb-radio
|
||||
|
|
|
|||
|
|
@ -1,130 +1,35 @@
|
|||
@import '../../../@theme/styles/themes';
|
||||
@import '~bootstrap/scss/mixins/breakpoints';
|
||||
@import '~@nebular/theme/styles/global/breakpoints';
|
||||
|
||||
@include nb-install-component() {
|
||||
|
||||
nb-card-body {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.validation-checkboxes {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.custom-control {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.demo-checkboxes {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.demo-radio {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.demo-disabled-checkbox-radio {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.demo-checkboxes-radio {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.demo-rating {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.star {
|
||||
font-size: 1.5rem;
|
||||
color: nb-theme(color-fg);
|
||||
}
|
||||
|
||||
.filled {
|
||||
color: nb-theme(color-fg);
|
||||
}
|
||||
|
||||
// TODO: Replace with the card header styles mixin
|
||||
.rating-header {
|
||||
line-height: 2rem;
|
||||
font-size: 1.25rem;
|
||||
font-family: nb-theme(font-secondary);
|
||||
font-weight: nb-theme(font-weight-bolder);
|
||||
color: nb-theme(color-fg-heading);
|
||||
}
|
||||
|
||||
.current-rate {
|
||||
font-size: 1.5rem;
|
||||
@include nb-ltr(padding-left, 1rem);
|
||||
@include nb-rtl(padding-right, 1rem);
|
||||
color: nb-theme(color-fg-heading);
|
||||
}
|
||||
|
||||
.full-name-inputs {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.input-group.has-person-icon {
|
||||
position: relative;
|
||||
|
||||
.form-control {
|
||||
|
||||
padding-left: 3rem;
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: '\F47D';
|
||||
font-family: 'Ionicons';
|
||||
font-size: 2rem;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
left: 1rem;
|
||||
top: 0.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
min-width: 7rem;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
padding: 0 0 0.75rem;
|
||||
}
|
||||
|
||||
ngb-rating {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
ngb-rating i {
|
||||
color: nb-theme(color-success);
|
||||
@include nb-for-theme(cosmic) {
|
||||
color: nb-theme(color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
@include media-breakpoint-down(xs) {
|
||||
button:not(.btn-icon) {
|
||||
padding: 0.75rem 1rem;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
}
|
||||
nb-card-body {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.validation-checkboxes {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.demo-items {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.demo-checkboxes-radio {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.full-name-inputs {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
padding: 0 0 0.75rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,10 @@
|
|||
<nb-card-header>Inline form</nb-card-header>
|
||||
<nb-card-body>
|
||||
<form class="form-inline">
|
||||
<input type="text" class="form-control full-width" placeholder="Jane Doe">
|
||||
<div class="input-group full-width">
|
||||
<div class="input-group-addon">@</div>
|
||||
<input type="text" class="form-control" placeholder="Email">
|
||||
</div>
|
||||
<input type="text" nbInput fullWidth placeholder="Jane Doe">
|
||||
<input type="text" nbInput fullWidth placeholder="Email">
|
||||
<nb-checkbox>Remember me</nb-checkbox>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
<button type="submit" nbButton status="primary">Submit</button>
|
||||
</form>
|
||||
</nb-card-body>
|
||||
</nb-card>
|
||||
|
|
@ -24,46 +21,30 @@
|
|||
<nb-card-body>
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
<label for="inputEmail1" class="col-sm-3 col-form-label">Email</label>
|
||||
<label for="inputEmail1" class="label col-sm-3 col-form-label">Email</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="email" class="form-control" id="inputEmail1" placeholder="Email">
|
||||
<input type="email" nbInput fullWidth id="inputEmail1" placeholder="Email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="inputPassword2" class="col-sm-3 col-form-label">Password</label>
|
||||
<label for="inputPassword2" class="label col-sm-3 col-form-label">Password</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="password" class="form-control" id="inputPassword2" placeholder="Password">
|
||||
<input type="password" nbInput fullWidth id="inputPassword2" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3">Radios</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-radio">
|
||||
<input type="radio" class="custom-control-input" name="gridRadios" checked>
|
||||
<span class="custom-control-indicator"></span>
|
||||
<span class="custom-control-description">Option one is this and that—be sure to include why it's great</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<label class="custom-control custom-radio">
|
||||
<input type="radio" class="custom-control-input" name="gridRadios">
|
||||
<span class="custom-control-indicator"></span>
|
||||
<span class="custom-control-description">Option two can be something else and selecting it will deselect option one</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check disabled">
|
||||
<label class="custom-control custom-radio">
|
||||
<input type="radio" class="custom-control-input" name="gridRadios" disabled>
|
||||
<span class="custom-control-indicator"></span>
|
||||
<span class="custom-control-description">Option three is disabled</span>
|
||||
</label>
|
||||
</div>
|
||||
<nb-radio-group>
|
||||
<nb-radio>Option 1</nb-radio>
|
||||
<nb-radio>Option 2</nb-radio>
|
||||
<nb-radio disabled>Disabled Option</nb-radio>
|
||||
</nb-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="offset-sm-3 col-sm-9">
|
||||
<button type="submit" class="btn btn-primary">Sign in</button>
|
||||
<button type="submit" nbButton status="primary">Sign in</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -75,15 +56,15 @@
|
|||
<nb-card-body>
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Recipients">
|
||||
<input type="text" nbInput fullWidth placeholder="Recipients">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Subject">
|
||||
<input type="text" nbInput fullWidth placeholder="Subject">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" placeholder="Message"></textarea>
|
||||
<textarea nbInput placeholder="Message"></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success">Send</button>
|
||||
<button type="submit" nbButton status="success">Send</button>
|
||||
</form>
|
||||
</nb-card-body>
|
||||
</nb-card>
|
||||
|
|
@ -95,17 +76,17 @@
|
|||
<nb-card-body>
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Email address</label>
|
||||
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
|
||||
<label for="exampleInputEmail1" class="label">Email address</label>
|
||||
<input type="email" nbInput fullWidth id="exampleInputEmail1" placeholder="Email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputPassword1">Password</label>
|
||||
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
|
||||
<label for="exampleInputPassword1" class="label">Password</label>
|
||||
<input type="password" nbInput fullWidth id="exampleInputPassword1" placeholder="Password">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<nb-checkbox>Check me out</nb-checkbox>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-danger">Submit</button>
|
||||
<button type="submit" nbButton status="danger">Submit</button>
|
||||
</form>
|
||||
</nb-card-body>
|
||||
</nb-card>
|
||||
|
|
@ -116,32 +97,32 @@
|
|||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<label for="inputFirstName">First Name</label>
|
||||
<input type="text" class="form-control" id="inputFirstName" placeholder="First Name">
|
||||
<label for="inputFirstName" class="label">First Name</label>
|
||||
<input type="text" nbInput fullWidth id="inputFirstName" placeholder="First Name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<label for="inputLastName">Last Name</label>
|
||||
<input type="text" class="form-control" id="inputLastName" placeholder="Last Name">
|
||||
<label for="inputLastName" class="label">Last Name</label>
|
||||
<input type="text" nbInput fullWidth id="inputLastName" placeholder="Last Name">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<label for="inputEmail">Email</label>
|
||||
<input type="email" class="form-control" id="inputEmail" placeholder="Email">
|
||||
<label for="inputEmail" class="label">Email</label>
|
||||
<input type="email" nbInput fullWidth id="inputEmail" placeholder="Email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<label for="inputWebsite">Website</label>
|
||||
<input type="text" class="form-control" id="inputWebsite" placeholder="Website">
|
||||
<label for="inputWebsite" class="label">Website</label>
|
||||
<input type="text" nbInput fullWidth id="inputWebsite" placeholder="Website">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
<button type="submit" nbButton>Submit</button>
|
||||
</nb-card-body>
|
||||
</nb-card>
|
||||
</div>
|
||||
|
|
@ -154,15 +135,15 @@
|
|||
<nb-card-body>
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group row">
|
||||
<label for="inputEmail3" class="col-sm-3 form-control-label">Email</label>
|
||||
<label for="inputEmail3" class="label col-sm-3 form-control-label">Email</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="email" class="form-control" id="inputEmail3" placeholder="Email">
|
||||
<input type="email" nbInput fullWidth id="inputEmail3" placeholder="Email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="inputPassword3" class="col-sm-3 form-control-label">Password</label>
|
||||
<label for="inputPassword3" class="label col-sm-3 form-control-label">Password</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="password" class="form-control" id="inputPassword3" placeholder="Password">
|
||||
<input type="password" nbInput fullWidth id="inputPassword3" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
|
|
@ -174,7 +155,7 @@
|
|||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="offset-sm-3 col-sm-9">
|
||||
<button type="submit" class="btn btn-warning">Sign in</button>
|
||||
<button type="submit" nbButton status="warning">Sign in</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,15 @@
|
|||
@import '../../../@theme/styles/themes';
|
||||
|
||||
@include nb-install-component() {
|
||||
.full-width {
|
||||
flex: 1;
|
||||
min-width: 220px;
|
||||
}
|
||||
|
||||
nb-checkbox {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.form-inline > * {
|
||||
@include nb-ltr(margin, 0 1.5rem 1.5rem 0);
|
||||
@include nb-rtl(margin, 0 0 1.5rem 1.5rem);
|
||||
}
|
||||
|
||||
nb-card.inline-form-card nb-card-body {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
nb-checkbox {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.form-inline [fullWidth] {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.form-inline > * {
|
||||
margin: 0 1.5rem 1.5rem 0;
|
||||
}
|
||||
|
||||
nb-card.inline-form-card nb-card-body {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,55 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import {
|
||||
NbActionsModule,
|
||||
NbButtonModule,
|
||||
NbCardModule,
|
||||
NbCheckboxModule, NbDatepickerModule,
|
||||
NbInputModule,
|
||||
NbRadioModule, NbSelectModule,
|
||||
NbUserModule,
|
||||
} from '@nebular/theme';
|
||||
|
||||
import { ThemeModule } from '../../@theme/theme.module';
|
||||
import { FormsRoutingModule } from './forms-routing.module';
|
||||
import { ButtonsModule } from './buttons/buttons.module';
|
||||
import { FormsComponent } from './forms.component';
|
||||
import { FormInputsComponent } from './form-inputs/form-inputs.component';
|
||||
import { FormLayoutsComponent } from './form-layouts/form-layouts.component';
|
||||
import { DatepickerComponent } from './datepicker/datepicker.component';
|
||||
import { NbInputModule } from '@nebular/theme';
|
||||
import { ButtonsComponent } from './buttons/buttons.component';
|
||||
import { DefaultButtonsComponent } from './buttons/default-buttons/default-buttons.component';
|
||||
import { OutlineButtonsComponent } from './buttons/outline-buttons/outline-buttons.component';
|
||||
import { HeroButtonComponent } from './buttons/hero-buttons/hero-buttons.component';
|
||||
import { ShapeButtonsComponent } from './buttons/shape-buttons/shape-buttons.component';
|
||||
import { SizeButtonsComponent } from './buttons/size-buttons/size-buttons.component';
|
||||
import { ActionGroupsComponent } from './buttons/action-groups/action-groups.component';
|
||||
import { LabeledActionsGroupComponent } from './buttons/labeled-actions-group/labeled-actions-group.component';
|
||||
import { ButtonElementsComponent } from './buttons/button-elements/button-elements.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
ThemeModule,
|
||||
NbInputModule,
|
||||
NbCardModule,
|
||||
NbButtonModule,
|
||||
NbActionsModule,
|
||||
NbUserModule,
|
||||
NbCheckboxModule,
|
||||
NbRadioModule,
|
||||
NbDatepickerModule,
|
||||
FormsRoutingModule,
|
||||
ButtonsModule,
|
||||
NbSelectModule,
|
||||
],
|
||||
declarations: [
|
||||
FormsComponent,
|
||||
ButtonsComponent,
|
||||
DefaultButtonsComponent,
|
||||
OutlineButtonsComponent,
|
||||
HeroButtonComponent,
|
||||
ShapeButtonsComponent,
|
||||
SizeButtonsComponent,
|
||||
ActionGroupsComponent,
|
||||
LabeledActionsGroupComponent,
|
||||
ButtonElementsComponent,
|
||||
FormInputsComponent,
|
||||
FormLayoutsComponent,
|
||||
DatepickerComponent,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue