diff --git a/src/api/docs/components/menu.html b/src/api/docs/components/menu.html index b2299c8a5..26b9efdab 100644 --- a/src/api/docs/components/menu.html +++ b/src/api/docs/components/menu.html @@ -4,6 +4,10 @@
import { color } from '@alyle/ui/color';
-const Yellow = color(255, 255, 0); // rgb
-const Black = color(0); // number
-const White = color(0xffffff); // hex
-const Text = color(0, 0, 0, .87); // rgba
+const Yellow = color(255, 255, 0); // rgb
+const Black = color(0); // number
+const White = color(0xffffff); // hex
+const Text = color(0, 0, 0, .87); // rgba
Note that a 6-digit hexadecimal is different from a 3-digit hexadecimal.
-color(0xffffff).css() !== color(0xfff).css(); // true
+color(0xffffff).css() !== color(0xfff).css(); // true
How to use color
color
and the previously mentioned methods returns an immutable Color
.
import { color } from '@alyle/ui/color';
-const Yellow = color(255, 255, 0);
+const Yellow = color(255, 255, 0);
Using methods:
-const Yellow = color(255, 255, 0);
+const Yellow = color(255, 255, 0);
Yellow.darken(2).alpha(.94).css(); // --> rgba(145,156,0,0.94)
-color(0xffffff).luminance(); // --> 1
-color(0xffffff).luminance(0.5); // --> rgb(194,194,0)
+color(0xffffff).luminance(); // --> 1
+color(0xffffff).luminance(0.5); // --> rgb(194,194,0)
\ No newline at end of file
diff --git a/src/api/docs/customization/theming.html b/src/api/docs/customization/theming.html
index 7b221268e..74932f49a 100644
--- a/src/api/docs/customization/theming.html
+++ b/src/api/docs/customization/theming.html
@@ -25,12 +25,12 @@ Overwriting the variables of a the
export class CustomMinimaLight implements PartialThemeVariables {
name = 'minima-light';
primary = {
- default: color(0x2196f3),
- contrast: color(0xffffff)
+ default: color(0x2196f3),
+ contrast: color(0xffffff)
};
accent = {
- default: color(0xe91e63),
- contrast: color(0xffffff)
+ default: color(0xe91e63),
+ contrast: color(0xffffff)
};
}
@@ -41,12 +41,12 @@ Overwriting the variables of a the
export class CustomMinimaDark implements PartialThemeVariables {
name = 'minima-dark';
primary = {
- default: color(0x9c27b0),
- contrast: color(0xffffff)
+ default: color(0x9c27b0),
+ contrast: color(0xffffff)
};
accent = {
- default: color(0x69f0ae),
- contrast: color(0x202020)
+ default: color(0x69f0ae),
+ contrast: color(0x202020)
};
}
diff --git a/src/api/docs/demos/field-playground.component.html.html b/src/api/docs/demos/field-playground.component.html.html
index cd2195d3d..aea162ad2 100644
--- a/src/api/docs/demos/field-playground.component.html.html
+++ b/src/api/docs/demos/field-playground.component.html.html
@@ -82,4 +82,37 @@
</ly-field>
</ly-grid>
</ly-grid>
-
\ No newline at end of file
+
+
+<ly-grid container>
+ <ly-grid item [col]="'3'">
+ </ly-grid>
+ <ly-grid item [col]="'6'">
+ <ly-field appearance="outlined" [width]="1">
+ <input lyNativeControl [formControl]="accountNumberFormData" value="{{'id'}}"
+ type="text">
+ <ly-label>Account_Number<ly-icon>favorite</ly-icon></ly-label>
+ <ly-icon lySuffix (click)="openAccSearchDialog()">search</ly-icon>
+ <ly-hint>Account_Number</ly-hint>
+ <ly-error>Account_Number_Required</ly-error>
+ </ly-field>
+ <button ly-button>I'm a button</button>
+ </ly-grid>
+ <ly-grid item [col]="'3'">
+ </ly-grid>
+
+ <ly-grid item [col]="'3'">
+ </ly-grid>
+ <ly-grid item [col]="'6'">
+ <ly-field appearance="outlined" [width]="1">
+ <input lyNativeControl [formControl]="accountNumberFormData" value="{{'id'}}"
+ type="text">
+ <ly-label>Account_Number<ly-icon>favorite</ly-icon></ly-label>
+ <ly-icon lySuffix (click)="openAccSearchDialog()">search</ly-icon>
+ <ly-hint>Long text long text long text long text long text long text long text long text long text long text</ly-hint>
+ </ly-field>
+ <button ly-button>I'm a button</button>
+ </ly-grid>
+ <ly-grid item [col]="'3'">
+ </ly-grid>
+</ly-grid>
\ No newline at end of file
diff --git a/src/api/docs/demos/field-playground.component.ts.html b/src/api/docs/demos/field-playground.component.ts.html
index a62b741e1..9c9bcc6ff 100644
--- a/src/api/docs/demos/field-playground.component.ts.html
+++ b/src/api/docs/demos/field-playground.component.ts.html
@@ -12,5 +12,9 @@
isReadonly = new FormControl();
isDisabled = new FormControl();
password = new FormControl('', [Validators.required, Validators.minLength(8)]);
+ accountNumberFormData = new FormControl('', [Validators.required]);
+ openAccSearchDialog() {
+ console.log('test');
+ }
}
\ No newline at end of file
diff --git a/src/api/docs/demos/menu-playground.component.html.html b/src/api/docs/demos/menu-playground.component.html.html
index 747dd4134..7f52e1397 100644
--- a/src/api/docs/demos/menu-playground.component.html.html
+++ b/src/api/docs/demos/menu-playground.component.html.html
@@ -1,5 +1,5 @@
<button ly-button [openOnHover]="openOnHover" [lyMenuTriggerFor]="_myMenu">
- I am a button
+ I'm a button
</button>
<ng-template #_myMenu let-M>
@@ -11,7 +11,7 @@
[xAxis]="xAxis"
[yAxis]="yAxis"
>
- <button ly-button ly-menu-item *ngFor="let item of [null, null, null]; index as i">
+ <button ly-button ly-menu-item *ngFor="let item of [0, 0, 0, 0]; index as i">
<span>Item {{ i + 1 }}</span>
</button>
</ly-menu>
diff --git a/src/api/docs/demos/menu.lazy.module.ts.html b/src/api/docs/demos/menu.lazy.module.ts.html
index eef76ce71..e6ae13c46 100644
--- a/src/api/docs/demos/menu.lazy.module.ts.html
+++ b/src/api/docs/demos/menu.lazy.module.ts.html
@@ -4,16 +4,20 @@
import { MenuDemo01Module } from './menu-demo-01/menu-demo-01.module';
import { MenuPlaygroundComponent } from './menu-playground/menu-playground.component';
import { MenuPlaygroundModule } from './menu-playground/menu-playground.module';
+import { NestedMenuModule } from './nested-menu/nested-menu.module';
+import { NestedMenuComponent } from './nested-menu/nested-menu.component';
const entryComponents = [
MenuDemo01Component,
- MenuPlaygroundComponent
+ MenuPlaygroundComponent,
+ NestedMenuComponent
];
@NgModule({
imports: [
MenuDemo01Module,
- MenuPlaygroundModule
+ MenuPlaygroundModule,
+ NestedMenuModule
],
entryComponents
})
diff --git a/src/api/docs/demos/nested-menu.component.html.html b/src/api/docs/demos/nested-menu.component.html.html
new file mode 100644
index 000000000..61ea1c4b6
--- /dev/null
+++ b/src/api/docs/demos/nested-menu.component.html.html
@@ -0,0 +1,44 @@
+<button ly-button [lyMenuTriggerFor]="rootMenu">menu</button>
+
+<ng-template #rootMenu let-M>
+ <ly-menu
+ [ref]="M"
+ >
+ <button ly-button ly-menu-item [lyMenuTriggerFor]="subMenu">Sub menu</button>
+ <button ly-button ly-menu-item [lyMenuTriggerFor]="subMenu2">Sub menu 2</button>
+ <button ly-button ly-menu-item *ngFor="let item of [0, 0, 0, 0]; index as i">
+ <span>Item {{ i + 1 }}</span>
+ </button>
+ </ly-menu>
+</ng-template>
+
+<ng-template #subMenu let-T>
+ <ly-menu
+ [ref]="T"
+ >
+ <button ly-button ly-menu-item *ngFor="let item of [0, 0, 0, 0]; index as i">
+ <span>Item {{ i + 1 }}</span>
+ </button>
+ </ly-menu>
+</ng-template>
+
+<ng-template #subMenu2 let-T>
+ <ly-menu
+ [ref]="T"
+ >
+ <button ly-button ly-menu-item [lyMenuTriggerFor]="subMenu3">Sub menu 3</button>
+ <button ly-button ly-menu-item *ngFor="let item of [0, 0, 0, 0]; index as i">
+ <span>Item {{ i + 1 }}</span>
+ </button>
+ </ly-menu>
+</ng-template>
+
+<ng-template #subMenu3 let-T>
+ <ly-menu
+ [ref]="T"
+ >
+ <button ly-button ly-menu-item *ngFor="let item of [0, 0, 0, 0]; index as i">
+ <span>Item {{ i + 1 }}</span>
+ </button>
+ </ly-menu>
+</ng-template>
\ No newline at end of file
diff --git a/src/api/docs/demos/nested-menu.component.ts.html b/src/api/docs/demos/nested-menu.component.ts.html
new file mode 100644
index 000000000..676c4a8d8
--- /dev/null
+++ b/src/api/docs/demos/nested-menu.component.ts.html
@@ -0,0 +1,16 @@
+import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
+
+@Component({
+ selector: 'aui-nested-menu',
+ templateUrl: './nested-menu.component.html',
+ changeDetection: ChangeDetectionStrategy.OnPush
+})
+export class NestedMenuComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
+
\ No newline at end of file
diff --git a/src/api/docs/demos/nested-menu.module.ts.html b/src/api/docs/demos/nested-menu.module.ts.html
new file mode 100644
index 000000000..57155115f
--- /dev/null
+++ b/src/api/docs/demos/nested-menu.module.ts.html
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { LyMenuModule } from '@alyle/ui/menu';
+import { LyButtonModule } from '@alyle/ui/button';
+
+import { NestedMenuComponent } from './nested-menu.component';
+
+
+
+@NgModule({
+ declarations: [NestedMenuComponent],
+ imports: [
+ CommonModule,
+ LyMenuModule,
+ LyButtonModule
+ ],
+ exports: [NestedMenuComponent]
+})
+export class NestedMenuModule { }
+
\ No newline at end of file
diff --git a/src/app/docs/components/menu-demo/menu.lazy.module.ts b/src/app/docs/components/menu-demo/menu.lazy.module.ts
index 8682778ce..ee8a8eb7c 100644
--- a/src/app/docs/components/menu-demo/menu.lazy.module.ts
+++ b/src/app/docs/components/menu-demo/menu.lazy.module.ts
@@ -4,16 +4,20 @@ import { MenuDemo01Component } from './menu-demo-01/menu-demo-01.component';
import { MenuDemo01Module } from './menu-demo-01/menu-demo-01.module';
import { MenuPlaygroundComponent } from './menu-playground/menu-playground.component';
import { MenuPlaygroundModule } from './menu-playground/menu-playground.module';
+import { NestedMenuModule } from './nested-menu/nested-menu.module';
+import { NestedMenuComponent } from './nested-menu/nested-menu.component';
const entryComponents = [
MenuDemo01Component,
- MenuPlaygroundComponent
+ MenuPlaygroundComponent,
+ NestedMenuComponent
];
@NgModule({
imports: [
MenuDemo01Module,
- MenuPlaygroundModule
+ MenuPlaygroundModule,
+ NestedMenuModule
],
entryComponents
})
diff --git a/src/app/docs/components/menu-demo/menu.md b/src/app/docs/components/menu-demo/menu.md
index 602b79cf4..89d827809 100644
--- a/src/app/docs/components/menu-demo/menu.md
+++ b/src/app/docs/components/menu-demo/menu.md
@@ -7,6 +7,12 @@ Menus allow users make a selection from multiple options.