Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
feat(datepicker): Added datepicker component.
Browse files Browse the repository at this point in the history
Fixes #894
  • Loading branch information
thomaspink authored and nimrod13 committed Nov 12, 2020
1 parent 4c5b4e6 commit 244043b
Show file tree
Hide file tree
Showing 66 changed files with 3,442 additions and 2 deletions.
33 changes: 33 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,39 @@
},
"schematics": {}
},
"datepicker": {
"projectType": "library",
"root": "libs/barista-components/experimental/datepicker",
"sourceRoot": "libs/barista-components/experimental/datepicker/src",
"prefix": "dt",
"architect": {
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/barista-components/experimental/datepicker/tsconfig.lib.json",
"libs/barista-components/experimental/datepicker/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"!libs/barista-components/experimantal/datepicker/**"
]
}
},
"lint-styles": {
"builder": "./dist/libs/workspace:stylelint",
"options": {
"stylelintConfig": ".stylelintrc",
"reportFile": "dist/stylelint/report.xml",
"exclude": ["**/node_modules/**"],
"files": [
"libs/barista-components/experimental/datepicker/**/*.scss"
]
}
}
},
"schematics": {}
},
"drawer": {
"projectType": "library",
"root": "libs/barista-components/drawer",
Expand Down
7 changes: 7 additions & 0 deletions apps/demos/src/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,12 @@ import {
DtExampleTreeTableSimple,
DtExampleComboboxCustomOptionHeight,
DtExampleFilterFieldInfiniteDataDepth,
<<<<<<< HEAD
DtExampleSelectCustomValueTemplate,
=======
DtExampleDatepickerDark,
DtExampleDatepickerDefault
>>>>>>> d2067af36... feat(datepicker): Added datepicker component.
} from '@dynatrace/examples';

// The Routing Module replaces the routing configuration in the root or feature module.
Expand Down Expand Up @@ -581,6 +586,8 @@ const ROUTES: Routes = [
{ path: 'drawer-dynamic-example', component: DtExampleDrawerDynamic },
{ path: 'drawer-nested-example', component: DtExampleDrawerNested },
{ path: 'drawer-over-example', component: DtExampleDrawerOver },
{ path: 'datepicker-dark-example', component: DtExampleDatepickerDark},
{ path: 'datepicker-default-example', component: DtExampleDatepickerDefault},
{
path: 'drawer-table-default-example',
component: DtExampleDrawerTableDefault,
Expand Down
13 changes: 13 additions & 0 deletions apps/demos/src/nav-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,19 @@ export const DT_DEMOS_EXAMPLE_NAV_ITEMS = [
},
],
},
{
name: 'datepicker',
examples: [
{
name: 'datepicker-dark-example',
route: '/datepicker-dark-example',
},
{
name: 'datepicker-default-example',
route: '/datepicker-default-example',
},
],
},
{
name: 'drawer',
examples: [
Expand Down
11 changes: 10 additions & 1 deletion apps/dev/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { ConsumptionDemo } from './consumption/consumption-demo.component';
import { ContainerBreakpointObserverDemo } from './container-breakpoint-observer/container-breakpoint-observer-demo.component';
import { ContextDialogDemo } from './context-dialog/context-dialog-demo.component';
import { CopyToClipboardDemo } from './copy-to-clipboard/copy-to-clipboard-demo.component';
import { DatepickerDemo } from './datepicker/datepicker-demo.component';
import { DrawerDemo } from './drawer/drawer-demo.component';
import { DrawerTableDemo } from './drawer-table/drawer-table-demo.component';
import { EmptyStateDemo } from './empty-state/empty-state-demo';
Expand Down Expand Up @@ -94,6 +95,9 @@ import { DtIconModule } from '@dynatrace/barista-components/icon';
import {
DT_DEFAULT_UI_TEST_CONFIG,
DT_UI_TEST_CONFIG,
DtNativeDateModule,
DT_OVERLAY_THEMING_CONFIG,
DT_DEFAULT_DARK_THEMING_CONFIG,
} from '@dynatrace/barista-components/core';
import { ComboboxDemo } from './combobox/combobox-demo.component';

Expand All @@ -111,6 +115,7 @@ export class NoopRouteComponent {}
DtIconModule.forRoot({ svgIconLocation: '/assets/icons/{{name}}.svg' }),
DevAppDynatraceModule,
DragDropModule,
DtNativeDateModule,
],
declarations: [
DevApp,
Expand All @@ -127,7 +132,7 @@ export class NoopRouteComponent {}
ConfirmationDialogDemo,
ContextDialogDemo,
CopyToClipboardDemo,

DatepickerDemo,
DrawerDemo,
DrawerTableDemo,
ExpandablePanelDemo,
Expand Down Expand Up @@ -184,6 +189,10 @@ export class NoopRouteComponent {}
Location,
{ provide: LocationStrategy, useClass: PathLocationStrategy },
{ provide: DT_UI_TEST_CONFIG, useValue: DT_DEFAULT_UI_TEST_CONFIG },
{
provide: DT_OVERLAY_THEMING_CONFIG,
useValue: DT_DEFAULT_DARK_THEMING_CONFIG,
},
{ provide: STEPPER_GLOBAL_OPTIONS, useValue: { showError: true } },
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
Expand Down
58 changes: 58 additions & 0 deletions apps/dev/src/datepicker/datepicker-demo.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<h1>Datepicker</h1>

<h2>Full datepicker</h2>

<dt-datepicker
[startAt]="startAt"
[disabled]="isDatepickerDisabled"
[isTimeEnabled]="isDatepickerTimeEnabled"
></dt-datepicker>

<dt-checkbox [(ngModel)]="isDatepickerDisabled">Disabled</dt-checkbox>
<dt-checkbox [(ngModel)]="isDatepickerTimeEnabled"
>Enabled Time Mode</dt-checkbox
>

<h2>Calendar</h2>

<dt-calendar [startAt]="startAt"></dt-calendar>

<h2>Calendar body only</h2>

<dt-calendar-body [activeDate]="startAt"></dt-calendar-body>

<h2>Timepicker</h2>

<dt-timepicker [disabled]="isTimepickerDisabled"></dt-timepicker>

<dt-checkbox [(ngModel)]="isTimepickerDisabled">Disabled</dt-checkbox>

<div dtTheme=":dark" class="dt-example-dark">
<h2>Full Dark Mode Datepicker</h2>

<dt-datepicker
[startAt]="startAt"
[disabled]="isDarkDatepickerDisabled"
[isTimeEnabled]="isDarkDatepickerTimeEnabled"
></dt-datepicker>
<dt-checkbox [(ngModel)]="isDarkDatepickerDisabled">Disabled</dt-checkbox>
<dt-checkbox [(ngModel)]="isDarkDatepickerTimeEnabled"
>Enabled Time Mode</dt-checkbox
>

<h2>Dark Mode Calendar</h2>

<dt-calendar [startAt]="startAt"></dt-calendar>

<h2>Dark Mode Calendar Body Only</h2>

<dt-calendar-body [activeDate]="startAt"></dt-calendar-body>

<h2>Dark Mode Timepicker</h2>

<dt-timepicker
dtTheme=":dark"
[disabled]="isDarkTimepickerDisabled"
></dt-timepicker>
<dt-checkbox [(ngModel)]="isDarkTimepickerDisabled">Disabled</dt-checkbox>
</div>
7 changes: 7 additions & 0 deletions apps/dev/src/datepicker/datepicker-demo.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.dt-checkbox {
margin-top: 10px;
}

.dt-example-dark h2 {
color: white;
}
32 changes: 32 additions & 0 deletions apps/dev/src/datepicker/datepicker-demo.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* @license
* Copyright 2020 Dynatrace LLC
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { Component } from '@angular/core';

@Component({
selector: 'demo-component',
templateUrl: 'datepicker-demo.component.html',
styleUrls: ['datepicker-demo.component.scss'],
})
export class DatepickerDemo {
startAt = new Date(2020, 7, 31);
isDatepickerDisabled = false;
isTimepickerDisabled = false;
isDarkDatepickerDisabled = false;
isDarkTimepickerDisabled = false;
isDatepickerTimeEnabled = true;
isDarkDatepickerTimeEnabled = true;
}
2 changes: 2 additions & 0 deletions apps/dev/src/devapp-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { ConsumptionDemo } from './consumption/consumption-demo.component';
import { ContainerBreakpointObserverDemo } from './container-breakpoint-observer/container-breakpoint-observer-demo.component';
import { ContextDialogDemo } from './context-dialog/context-dialog-demo.component';
import { CopyToClipboardDemo } from './copy-to-clipboard/copy-to-clipboard-demo.component';
import { DatepickerDemo } from './datepicker/datepicker-demo.component';
import { DrawerDemo } from './drawer/drawer-demo.component';
import { DrawerTableDemo } from './drawer-table/drawer-table-demo.component';
import { EmptyStateDemo } from './empty-state/empty-state-demo';
Expand Down Expand Up @@ -95,6 +96,7 @@ const routes: Routes = [
{ path: 'context-dialog', component: ContextDialogDemo },
{ path: 'confirmation-dialog', component: ConfirmationDialogDemo },
{ path: 'copy-to-clipboard', component: CopyToClipboardDemo },
{ path: 'datepicker', component: DatepickerDemo },
{ path: 'drawer', component: DrawerDemo },
{ path: 'drawer-table', component: DrawerTableDemo },
{ path: 'empty-state', component: EmptyStateDemo },
Expand Down
1 change: 1 addition & 0 deletions apps/dev/src/devapp.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export class DevApp implements AfterContentInit, OnDestroy {
},
{ name: 'Context-dialog', route: '/context-dialog' },
{ name: 'Copy-to-clipboard', route: '/copy-to-clipboard' },
{ name: 'Datepicker', route: '/datepicker' },
{ name: 'Drawer', route: '/drawer' },
{ name: 'Drawer-table', route: '/drawer-table' },
{ name: 'Empty-state', route: '/empty-state' },
Expand Down
2 changes: 2 additions & 0 deletions apps/dev/src/dt-components.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { DtConsumptionModule } from '@dynatrace/barista-components/consumption';
import { DtContainerBreakpointObserverModule } from '@dynatrace/barista-components/container-breakpoint-observer';
import { DtContextDialogModule } from '@dynatrace/barista-components/context-dialog';
import { DtCopyToClipboardModule } from '@dynatrace/barista-components/copy-to-clipboard';
import { DtDatepickerModule } from '@dynatrace/barista-components/experimental/datepicker';
import { DtDrawerModule } from '@dynatrace/barista-components/drawer';
import { DtDrawerTableModule } from '@dynatrace/barista-components/experimental/drawer-table';
import { DtEmptyStateModule } from '@dynatrace/barista-components/empty-state';
Expand Down Expand Up @@ -95,6 +96,7 @@ import { DtComboboxModule } from '@dynatrace/barista-components/experimental/com
DtConfirmationDialogModule,
DtContextDialogModule,
DtCopyToClipboardModule,
DtDatepickerModule,
DtDrawerModule,
DtDrawerTableModule,
DtExpandablePanelModule,
Expand Down
1 change: 1 addition & 0 deletions libs/barista-components/config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ COMPONENTS = [
"expandable-section",
"expandable-text",
"experimental/combobox",
"experimental/datepicker",
"experimental/drawer-table",
"quick-filter",
"filter-field",
Expand Down
1 change: 1 addition & 0 deletions libs/barista-components/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ export * from './src/tree/index';
export * from './src/animations/index';
export * from './src/overlay/index';
export * from './src/testing/index';
export * from './src/date/index';
Loading

0 comments on commit 244043b

Please sign in to comment.