diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1c2ca2d..7af8497 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -18,9 +18,11 @@ import {TableDemoComponent} from './demo/view/tabledemo.component'; import {ListDemoComponent} from './demo/view/listdemo.component'; import {TreeDemoComponent} from './demo/view/treedemo.component'; import {AppCrudComponent} from './pages/app.crud.component'; +import {AppBlocksDemoComponent} from './demo/view/app.blocksdemo.component'; import {FloatLabelDemoComponent} from './demo/view/floatlabeldemo.component'; -import { InvalidStateDemoComponent } from './demo/view/invalidstatedemo.component'; -import { AppTimelineDemoComponent } from './pages/app.timelinedemo.component'; +import {InvalidStateDemoComponent} from './demo/view/invalidstatedemo.component'; +import {AppTimelineDemoComponent} from './pages/app.timelinedemo.component'; +import {IconsDemoComponent} from './demo/view/iconsdemo.component'; @NgModule({ imports: [ @@ -47,6 +49,8 @@ import { AppTimelineDemoComponent } from './pages/app.timelinedemo.component'; {path: 'pages/crud', component: AppCrudComponent}, {path: 'pages/timeline', component: AppTimelineDemoComponent}, {path: 'pages/empty', component: EmptyDemoComponent}, + {path: 'icons', component: IconsDemoComponent}, + {path: 'blocks', component: AppBlocksDemoComponent}, {path: 'documentation', component: DocumentationComponent} ] }, diff --git a/src/app/app.blockviewer.component.scss b/src/app/app.blockviewer.component.scss new file mode 100644 index 0000000..e45224f --- /dev/null +++ b/src/app/app.blockviewer.component.scss @@ -0,0 +1,148 @@ +.block-section { + margin-bottom: 4rem; + overflow: hidden; +} + +.block-header { + padding: 1rem 2rem; + background-color: var(--surface-section); + border-top-left-radius: 12px; + border-top-right-radius: 12px; + border:1px solid var(--surface-d); + display: flex; + align-items: center; + justify-content: space-between; + + .block-title { + font-weight: 700; + display: inline-flex; + align-items: center; + + .badge-free { + border-radius: 4px; + padding: .25rem .5rem; + background-color: var(--orange-500); + color: white; + margin-left: 1rem; + font-weight: 700; + font-size: .875rem; + } + } + + .block-actions { + display: flex; + align-items: center; + justify-content: space-between; + user-select: none; + margin-left: 1rem; + + a { + display: flex; + align-items: center; + margin-right: .75rem; + padding: .5rem 1rem; + border-radius: 4px; + font-weight: 600; + border: 1px solid transparent; + transition: background-color .2s; + cursor: pointer; + + &:last-child { + margin-right: 0; + } + + &:not(.block-action-disabled):hover { + background-color: var(--surface-c); + } + + &.block-action-active { + border-color: var(--primary-color); + color: var(--primary-color); + } + + &.block-action-copy { + i { + color: var(--primary-color); + font-size: 1.25rem; + } + } + + &.block-action-disabled { + opacity: .6; + cursor: auto !important; + } + + i { + margin-right: .5rem; + } + } + } +} + +.block-content { + padding: 0; + border:1px solid var(--surface-d); + border-top: 0 none; + border-bottom-left-radius: 12px; + border-bottom-right-radius: 12px; + overflow: hidden; +} + +pre[class*="language-"] { + margin: 0 !important; + + &:before, &:after { + display: none !important; + } + + code { + border-left: 0 none !important; + box-shadow: none !important; + background: var(--surface-e) !important; + margin: 0; + color: var(--text-color); + font-size: 14px; + padding: 0 2rem !important; + + .token { + &.tag, + &.keyword { + color: #2196F3 !important; + } + + &.attr-name, + &.attr-string { + color: #2196F3 !important; + } + + &.attr-value { + color: #4CAF50 !important; + } + + &.punctuation { + color: var(--text-color); + } + + &.operator, + &.string { + background: transparent; + } + } + } +} + +@media screen and (max-width: 575px) { + .block-header { + flex-direction: column; + align-items: start; + + .block-actions { + margin-top: 1rem; + margin-left: 0; + } + } +} +::ng-deep pre{ + margin: 0 !important; + padding: 0 !important; +} \ No newline at end of file diff --git a/src/app/app.blockviewer.component.ts b/src/app/app.blockviewer.component.ts new file mode 100644 index 0000000..9d8422a --- /dev/null +++ b/src/app/app.blockviewer.component.ts @@ -0,0 +1,78 @@ +import { Component, Input } from '@angular/core'; +import { environment } from '../environments/environment'; +enum BlockView { + PREVIEW, + CODE +} + +@Component({ + selector: 'block-viewer', + template: ` +
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+ + + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+ + + +Sakai has no direct dependency other than PrimeNG. More information about dependencies is available at Why PrimeNG Templates article.
-Once CLI is ready in your system, extract the contents of the Sakai zip file distribution, cd to the directory, install the libraries from npm and then execute "ng serve" to run the application in your local environment.
-The application should run at http://localhost:4200/, you may now start with the development of your application.
Following commands are derived from CLI.
-Sakai consists of 2 main parts; the application layout, layout resources. app.component.html inside app folder is the html template for the base layout, @@ -204,18 +204,18 @@ export class AppMenuComponent implements OnInit, AfterViewInit {
Install PrimeNG
-Add PrimeNG CSS at styles section in angular.json.
-Last part is adding theme and layout css files, in the CLI app they are defined using link tags in index.html so the demo can switch them on the fly by changing the path however if this is not a requirement, you may also add them to the styles configuration above so they go inside the bundle.
@@ -326,7 +326,6 @@ $menuTooltipTextColor:#ffffff !default;PrimeIcons use the pi pi-{icon} syntax such as pi pi-check. + A standalone icon can be displayed using an element such as i or span
+ +Size of the icons can easily be changed using font-size property.
+ +Special pi-spin class applies infinite rotate to an icon.
+ +Here is the current list of PrimeIcons, more icons will be added periodically. You may also request new icons at the issue tracker.
+Pagination, sorting, filtering and checkbox selection.
-Scrollable table with gridlines (.p-datatable-gridlines), striped rows (.p-datatable-striped) and smaller paddings (p-datatable-sm).
-