various fixes; doesnt work in runtime
This commit is contained in:
parent
9efeab2f44
commit
b99a21dd26
@ -50,6 +50,7 @@
|
|||||||
"@isp/xdce-arch-core": "1.50.30",
|
"@isp/xdce-arch-core": "1.50.30",
|
||||||
"@isp/xdce-arch-core-base": "1.21.8",
|
"@isp/xdce-arch-core-base": "1.21.8",
|
||||||
"@isp/xdce-widget": "1.125.2",
|
"@isp/xdce-widget": "1.125.2",
|
||||||
|
"@ng-bootstrap/ng-bootstrap": "4.0.0",
|
||||||
"ag-grid-angular": "22.1.1",
|
"ag-grid-angular": "22.1.1",
|
||||||
"ag-grid-community": "22.1.1",
|
"ag-grid-community": "22.1.1",
|
||||||
"@ag-grid-community/all-modules": "22.1.1",
|
"@ag-grid-community/all-modules": "22.1.1",
|
||||||
|
142
src/index.ts
142
src/index.ts
@ -1,71 +1,71 @@
|
|||||||
import { ModuleWithProviders, NgModule } from "@angular/core";
|
import { ModuleWithProviders, NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
|
||||||
|
|
||||||
import { NbpBreadCrumbsComponent } from "./widgetfideuram/components/nbp-bread-crumbs/nbp-bread-crumbs.component";
|
|
||||||
export { NbpBreadCrumbsComponent } from "./widgetfideuram/components/nbp-bread-crumbs/nbp-bread-crumbs.component";
|
|
||||||
import { NbpFidBarChartComponent } from "./widgetfideuram/components/nbp-fid-bar-chart/nbp-fid-bar-chart.component";
|
|
||||||
export { NbpFidBarChartComponent } from "./widgetfideuram/components/nbp-fid-bar-chart/nbp-fid-bar-chart.component";
|
|
||||||
import { NbpFidButtonBarComponent } from "./widgetfideuram/components/nbp-fid-button-bar/nbp-fid-button-bar.component";
|
|
||||||
export { NbpFidButtonBarComponent } from "./widgetfideuram/components/nbp-fid-button-bar/nbp-fid-button-bar.component";
|
|
||||||
import { NbpFidDonutChartComponent } from "./widgetfideuram/components/nbp-fid-donut-chart/nbp-fid-donut-chart.component";
|
|
||||||
export { NbpFidDonutChartComponent } from "./widgetfideuram/components/nbp-fid-donut-chart/nbp-fid-donut-chart.component";
|
|
||||||
import { NbpFidPyramidChartComponent } from "./widgetfideuram/components/nbp-fid-pyramid-chart/nbp-fid-pyramid-chart.component";
|
|
||||||
export { NbpFidPyramidChartComponent } from "./widgetfideuram/components/nbp-fid-pyramid-chart/nbp-fid-pyramid-chart.component";
|
|
||||||
import { NbpFidSidePopupComponent } from "./widgetfideuram/components/nbp-fid-side-popup/nbp-fid-side-popup.component";
|
|
||||||
export { NbpFidSidePopupComponent } from "./widgetfideuram/components/nbp-fid-side-popup/nbp-fid-side-popup.component";
|
|
||||||
import { NbpFidTableComponent } from "./widgetfideuram/components/nbp-fid-table/nbp-fid-table.component";
|
|
||||||
export { NbpFidTableComponent } from "./widgetfideuram/components/nbp-fid-table/nbp-fid-table.component";
|
|
||||||
import { NbpFidToggleTabComponentA11Y } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tab.component.a11y";
|
|
||||||
export { NbpFidToggleTabComponentA11Y } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tab.component.a11y";
|
|
||||||
import { NbpFidToggleTabComponentNOA11Y } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tab.component.noa11y";
|
|
||||||
export { NbpFidToggleTabComponentNOA11Y } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tab.component.noa11y";
|
|
||||||
import { NbpFidToggleTabComponent } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tab.component";
|
|
||||||
export { NbpFidToggleTabComponent } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tab.component";
|
|
||||||
import { NbpFidToggleTabsetComponentA11Y } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tabset.component.a11y";
|
|
||||||
export { NbpFidToggleTabsetComponentA11Y } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tabset.component.a11y";
|
|
||||||
import { NbpFidToggleTabsetComponentNOA11Y } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tabset.component.noa11y";
|
|
||||||
export { NbpFidToggleTabsetComponentNOA11Y } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tabset.component.noa11y";
|
|
||||||
import { NbpFidToggleTabsetComponent } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tabset.component";
|
|
||||||
export { NbpFidToggleTabsetComponent } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tabset.component";
|
|
||||||
import { NbpFidComboComponent } from "./widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component";
|
|
||||||
export { NbpFidComboComponent } from "./widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component";
|
|
||||||
|
|
||||||
import { ShowcaseComponent } from "./widgetfideuram/components/showcase/showcase.component";
|
|
||||||
export { ShowcaseComponent } from "./widgetfideuram/components/showcase/showcase.component";
|
|
||||||
import { Showcase1Component } from "./widgetfideuram/components/showcase/showcase1.component";
|
|
||||||
export { Showcase1Component } from "./widgetfideuram/components/showcase/showcase1.component";
|
|
||||||
import { WidgetFideuramShowcaseComponent } from "./widgetfideuram/components/widget-fideuram-showcase/widget-fideuram-showcase.component";
|
|
||||||
export { WidgetFideuramShowcaseComponent } from "./widgetfideuram/components/widget-fideuram-showcase/widget-fideuram-showcase.component";
|
|
||||||
|
|
||||||
import { NbpFidCalendarGeneric } from "./widgetfideuram/components/nbp-fid-calendar-generic/nbp-fid-calendar-generic.component";
|
|
||||||
export { NbpFidCalendarGeneric } from "./widgetfideuram/components/nbp-fid-calendar-generic/nbp-fid-calendar-generic.component";
|
|
||||||
import { FormsModule } from "@angular/forms";
|
import { FormsModule } from "@angular/forms";
|
||||||
|
import { XdceArchModule } from "@isp/xdce-arch-core";
|
||||||
|
import { NbpModule } from "@isp/xdce-widget";
|
||||||
|
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
|
||||||
import {
|
import {
|
||||||
AgGridModule,
|
AgGridModule,
|
||||||
AngularFrameworkComponentWrapper,
|
AngularFrameworkComponentWrapper,
|
||||||
AngularFrameworkOverrides,
|
AngularFrameworkOverrides,
|
||||||
} from "ag-grid-angular";
|
} from "ag-grid-angular";
|
||||||
import { NbpModule } from "@isp/xdce-widget";
|
import { NbpBreadCrumbsComponent } from "./widgetfideuram/components/nbp-bread-crumbs/nbp-bread-crumbs.component";
|
||||||
import { XdceArchModule } from "@isp/xdce-arch-core";
|
import { NbpFidBarChartComponent } from "./widgetfideuram/components/nbp-fid-bar-chart/nbp-fid-bar-chart.component";
|
||||||
|
import { NbpFidButtonBarComponent } from "./widgetfideuram/components/nbp-fid-button-bar/nbp-fid-button-bar.component";
|
||||||
|
import { FidRplCalendarNOA11Y } from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap-noa11y/datepicker/datepicker";
|
||||||
|
import { NgbFidInputDatepickerNOA11Y } from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap-noa11y/datepicker/datepicker-input";
|
||||||
|
import { NgbFidDatepickerRoutingViewNOA11Y } from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap-noa11y/datepicker/datepicker-routing-view";
|
||||||
|
import { FidRplCalendar } from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap/datepicker/datepicker";
|
||||||
|
import { NgbFidInputDatepicker } from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap/datepicker/datepicker-input";
|
||||||
|
import { NgbFidDatepickerRoutingView } from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap/datepicker/datepicker-routing-view";
|
||||||
import { NbpCalendarGenericComponentA11Y } from "./widgetfideuram/components/nbp-fid-calendar-generic/nbp-calendar-generic.component.a11y";
|
import { NbpCalendarGenericComponentA11Y } from "./widgetfideuram/components/nbp-fid-calendar-generic/nbp-calendar-generic.component.a11y";
|
||||||
import { NbpCalendarGenericComponentNOA11Y } from "./widgetfideuram/components/nbp-fid-calendar-generic/nbp-calendar-generic.component.noa11y";
|
import { NbpCalendarGenericComponentNOA11Y } from "./widgetfideuram/components/nbp-fid-calendar-generic/nbp-calendar-generic.component.noa11y";
|
||||||
export { NbpCalendarGenericComponentA11Y } from "./widgetfideuram/components/nbp-fid-calendar-generic/nbp-calendar-generic.component.a11y";
|
import { NbpFidCalendarGeneric } from "./widgetfideuram/components/nbp-fid-calendar-generic/nbp-fid-calendar-generic.component";
|
||||||
export { NbpCalendarGenericComponentNOA11Y } from "./widgetfideuram/components/nbp-fid-calendar-generic/nbp-calendar-generic.component.noa11y";
|
import { NbpFidComboComponent } from "./widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component";
|
||||||
import { NgbInputDatepicker } from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap/datepicker/datepicker-input";
|
import { NbpFidDonutChartComponent } from "./widgetfideuram/components/nbp-fid-donut-chart/nbp-fid-donut-chart.component";
|
||||||
export { NgbInputDatepicker } from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap/datepicker/datepicker-input";
|
import { NbpFidPyramidChartComponent } from "./widgetfideuram/components/nbp-fid-pyramid-chart/nbp-fid-pyramid-chart.component";
|
||||||
import { RplCalendarNOA11Y } from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap-noa11y/datepicker/datepicker";
|
import { NbpFidSidePopupComponent } from "./widgetfideuram/components/nbp-fid-side-popup/nbp-fid-side-popup.component";
|
||||||
export { RplCalendarNOA11Y } from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap-noa11y/datepicker/datepicker";
|
import { NbpFidTableComponent } from "./widgetfideuram/components/nbp-fid-table/nbp-fid-table.component";
|
||||||
export { AgGridModule } from "ag-grid-angular";
|
import { NbpFidToggleTabComponent } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tab.component";
|
||||||
|
import { NbpFidToggleTabComponentA11Y } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tab.component.a11y";
|
||||||
|
import { NbpFidToggleTabComponentNOA11Y } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tab.component.noa11y";
|
||||||
|
import { NbpFidToggleTabsetComponent } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tabset.component";
|
||||||
|
import { NbpFidToggleTabsetComponentA11Y } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tabset.component.a11y";
|
||||||
|
import { NbpFidToggleTabsetComponentNOA11Y } from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tabset.component.noa11y";
|
||||||
|
import { ShowcaseComponent } from "./widgetfideuram/components/showcase/showcase.component";
|
||||||
|
import { Showcase1Component } from "./widgetfideuram/components/showcase/showcase1.component";
|
||||||
|
import { WidgetFideuramShowcaseComponent } from "./widgetfideuram/components/widget-fideuram-showcase/widget-fideuram-showcase.component";
|
||||||
|
import { NgbDatepickerService, NgbDatepickerServiceNOA11Y } from '@isp/xdce-widget';
|
||||||
|
|
||||||
export {
|
export { AgGridModule } from "ag-grid-angular";
|
||||||
DATE_STRING_FORMAT,
|
export * from "./widgetfideuram/components/nbp-bread-crumbs/nbp-bread-crumbs.component";
|
||||||
formatDate,
|
export * from "./widgetfideuram/components/nbp-fid-bar-chart/nbp-fid-bar-chart.component";
|
||||||
formatNumber,
|
export * from "./widgetfideuram/components/nbp-fid-button-bar/nbp-fid-button-bar.component";
|
||||||
setSpinnerMessage,
|
export * from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap-noa11y/datepicker/datepicker";
|
||||||
clearSpinnerMessage,
|
export * from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap-noa11y/datepicker/datepicker-input";
|
||||||
} from "./widgetfideuram/Utils";
|
export * from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap/datepicker/datepicker";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-calendar-generic/@ng-bootstrap/datepicker/datepicker-input";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-calendar-generic/nbp-calendar-generic.component.a11y";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-calendar-generic/nbp-calendar-generic.component.noa11y";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-calendar-generic/nbp-fid-calendar-generic.component";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-donut-chart/nbp-fid-donut-chart.component";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-pyramid-chart/nbp-fid-pyramid-chart.component";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-side-popup/nbp-fid-side-popup.component";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-table/nbp-fid-table.component";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tab.component";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tab.component.a11y";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tab.component.noa11y";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tabset.component";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tabset.component.a11y";
|
||||||
|
export * from "./widgetfideuram/components/nbp-fid-toggle-tabset/nbp-fid-toggle-tabset.component.noa11y";
|
||||||
|
export * from "./widgetfideuram/components/showcase/showcase.component";
|
||||||
|
export * from "./widgetfideuram/components/showcase/showcase1.component";
|
||||||
|
export * from "./widgetfideuram/components/widget-fideuram-showcase/widget-fideuram-showcase.component";
|
||||||
|
|
||||||
|
export * from "./widgetfideuram/Utils";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [XdceArchModule, NbpModule, AgGridModule, FormsModule],
|
imports: [XdceArchModule, NbpModule, AgGridModule, FormsModule, NgbModule],
|
||||||
declarations: [
|
declarations: [
|
||||||
NbpBreadCrumbsComponent,
|
NbpBreadCrumbsComponent,
|
||||||
NbpFidBarChartComponent,
|
NbpFidBarChartComponent,
|
||||||
@ -85,11 +85,14 @@ export {
|
|||||||
Showcase1Component,
|
Showcase1Component,
|
||||||
WidgetFideuramShowcaseComponent,
|
WidgetFideuramShowcaseComponent,
|
||||||
NbpFidCalendarGeneric,
|
NbpFidCalendarGeneric,
|
||||||
NgbInputDatepicker,
|
NgbFidInputDatepicker,
|
||||||
RplCalendarNOA11Y,
|
FidRplCalendarNOA11Y,
|
||||||
NbpCalendarGenericComponentNOA11Y,
|
NbpCalendarGenericComponentNOA11Y,
|
||||||
NbpCalendarGenericComponentA11Y,
|
NbpCalendarGenericComponentA11Y,
|
||||||
|
FidRplCalendar,
|
||||||
|
NgbFidInputDatepickerNOA11Y,
|
||||||
|
NgbFidDatepickerRoutingView,
|
||||||
|
NgbFidDatepickerRoutingViewNOA11Y
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
NbpBreadCrumbsComponent,
|
NbpBreadCrumbsComponent,
|
||||||
@ -111,9 +114,19 @@ export {
|
|||||||
WidgetFideuramShowcaseComponent,
|
WidgetFideuramShowcaseComponent,
|
||||||
AgGridModule,
|
AgGridModule,
|
||||||
NbpFidCalendarGeneric,
|
NbpFidCalendarGeneric,
|
||||||
RplCalendarNOA11Y
|
FidRplCalendarNOA11Y,
|
||||||
|
FidRplCalendar,
|
||||||
|
NgbFidDatepickerRoutingView,
|
||||||
|
NgbFidDatepickerRoutingViewNOA11Y,
|
||||||
|
NgbFidInputDatepickerNOA11Y,
|
||||||
|
NgbFidInputDatepicker
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
AngularFrameworkOverrides,
|
||||||
|
AngularFrameworkComponentWrapper,
|
||||||
|
{ provide: 'NgbDatepickerServiceNOA11Y', useClass: NgbDatepickerServiceNOA11Y },
|
||||||
|
{ provide: 'NgbDatepickerService', useClass: NgbDatepickerService }
|
||||||
],
|
],
|
||||||
providers: [AngularFrameworkOverrides, AngularFrameworkComponentWrapper],
|
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
NbpFidToggleTabComponentA11Y,
|
NbpFidToggleTabComponentA11Y,
|
||||||
NbpFidToggleTabComponentNOA11Y,
|
NbpFidToggleTabComponentNOA11Y,
|
||||||
@ -123,7 +136,12 @@ export {
|
|||||||
NbpFidToggleTabsetComponent,
|
NbpFidToggleTabsetComponent,
|
||||||
NbpCalendarGenericComponentA11Y,
|
NbpCalendarGenericComponentA11Y,
|
||||||
NbpCalendarGenericComponentNOA11Y,
|
NbpCalendarGenericComponentNOA11Y,
|
||||||
|
FidRplCalendarNOA11Y,
|
||||||
|
FidRplCalendar,
|
||||||
|
NgbFidDatepickerRoutingView,
|
||||||
|
NgbFidDatepickerRoutingViewNOA11Y
|
||||||
],
|
],
|
||||||
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
})
|
})
|
||||||
export class XdceWidgetFideuramModule {
|
export class XdceWidgetFideuramModule {
|
||||||
static forRoot(): ModuleWithProviders {
|
static forRoot(): ModuleWithProviders {
|
||||||
|
@ -22,36 +22,33 @@ import {
|
|||||||
NG_VALUE_ACCESSOR,
|
NG_VALUE_ACCESSOR,
|
||||||
Validator,
|
Validator,
|
||||||
} from "@angular/forms";
|
} from "@angular/forms";
|
||||||
|
|
||||||
import {
|
|
||||||
NgbDatepickerNavigateEventNOA11Y,
|
|
||||||
RplCalendarNOA11Y,
|
|
||||||
} from "./datepicker";
|
|
||||||
|
|
||||||
import { Positioning } from "@isp/xdce-widget/user-input/isp-typeahead/ng-bootstrap/positioning";
|
|
||||||
|
|
||||||
import { EventManager } from "@isp/xdce-arch-core-base";
|
import { EventManager } from "@isp/xdce-arch-core-base";
|
||||||
import {
|
import {
|
||||||
NgbDatepickerServiceNOA11Y,
|
|
||||||
NgbDate,
|
|
||||||
DayTemplateContextNOA11Y,
|
DayTemplateContextNOA11Y,
|
||||||
NgbDateStruct,
|
|
||||||
NbpCalendarPattern,
|
NbpCalendarPattern,
|
||||||
NbpDateSeparator,
|
|
||||||
NbpCalendarPosition,
|
NbpCalendarPosition,
|
||||||
NgbDateParserFormatterNOA11Y,
|
NbpDateSeparator,
|
||||||
NgbCalendarNOA11Y,
|
NgbCalendarNOA11Y,
|
||||||
|
NgbDate,
|
||||||
|
NgbDateParserFormatterNOA11Y,
|
||||||
|
NgbDateStruct,
|
||||||
|
NgbDatepickerNavigateEventNOA11Y,
|
||||||
|
NgbDatepickerServiceNOA11Y,
|
||||||
} from "@isp/xdce-widget";
|
} from "@isp/xdce-widget";
|
||||||
|
import { Positioning } from "../util/positioning";
|
||||||
|
import {
|
||||||
|
FidRplCalendarNOA11Y,
|
||||||
|
} from "./datepicker";
|
||||||
|
|
||||||
const NGB_DATEPICKER_VALUE_ACCESSOR = {
|
const NGB_DATEPICKER_VALUE_ACCESSOR = {
|
||||||
provide: NG_VALUE_ACCESSOR,
|
provide: NG_VALUE_ACCESSOR,
|
||||||
useExisting: forwardRef(() => NgbInputDatepickerNOA11Y),
|
useExisting: forwardRef(() => NgbFidInputDatepickerNOA11Y),
|
||||||
multi: true,
|
multi: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const NGB_DATEPICKER_VALIDATOR = {
|
const NGB_DATEPICKER_VALIDATOR = {
|
||||||
provide: NG_VALIDATORS,
|
provide: NG_VALIDATORS,
|
||||||
useExisting: forwardRef(() => NgbInputDatepickerNOA11Y),
|
useExisting: forwardRef(() => NgbFidInputDatepickerNOA11Y),
|
||||||
multi: true,
|
multi: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -60,8 +57,8 @@ const NGB_DATEPICKER_VALIDATOR = {
|
|||||||
* Manages integration with the input field itself (data entry) and ngModel (validation etc.).
|
* Manages integration with the input field itself (data entry) and ngModel (validation etc.).
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: "input[rplCalendarNOA11Y]",
|
selector: "input[fidRplCalendarNOA11Y]",
|
||||||
exportAs: "rplCalendarNOA11Y",
|
exportAs: "fidRplCalendarNOA11Y",
|
||||||
host: {
|
host: {
|
||||||
"(input)": "waitForFormat($event.target.value)",
|
"(input)": "waitForFormat($event.target.value)",
|
||||||
"(change)": "manualDateChange($event.target.value, true)",
|
"(change)": "manualDateChange($event.target.value, true)",
|
||||||
@ -75,10 +72,10 @@ const NGB_DATEPICKER_VALIDATOR = {
|
|||||||
NgbDatepickerServiceNOA11Y,
|
NgbDatepickerServiceNOA11Y,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class NgbInputDatepickerNOA11Y
|
export class NgbFidInputDatepickerNOA11Y
|
||||||
implements OnChanges, OnDestroy, ControlValueAccessor, Validator
|
implements OnChanges, OnDestroy, ControlValueAccessor, Validator
|
||||||
{
|
{
|
||||||
private _cRef: ComponentRef<RplCalendarNOA11Y> = null;
|
private _cRef: ComponentRef<FidRplCalendarNOA11Y> = null;
|
||||||
private _model: NgbDate;
|
private _model: NgbDate;
|
||||||
private _zoneSubscription: any;
|
private _zoneSubscription: any;
|
||||||
|
|
||||||
@ -432,7 +429,7 @@ export class NgbInputDatepickerNOA11Y
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const cf = this._cfr.resolveComponentFactory(RplCalendarNOA11Y);
|
const cf = this._cfr.resolveComponentFactory(FidRplCalendarNOA11Y);
|
||||||
this._cRef = this._vcRef.createComponent(cf);
|
this._cRef = this._vcRef.createComponent(cf);
|
||||||
|
|
||||||
this._applyPopupStyling(this._cRef.location.nativeElement);
|
this._applyPopupStyling(this._cRef.location.nativeElement);
|
||||||
@ -567,7 +564,7 @@ export class NgbInputDatepickerNOA11Y
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _applyDatepickerInputs(datepickerInstance: RplCalendarNOA11Y): void {
|
private _applyDatepickerInputs(datepickerInstance: FidRplCalendarNOA11Y): void {
|
||||||
[
|
[
|
||||||
"dayTemplate",
|
"dayTemplate",
|
||||||
"displayMonths",
|
"displayMonths",
|
||||||
@ -594,7 +591,7 @@ export class NgbInputDatepickerNOA11Y
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _subscribeForDatepickerOutputs(
|
private _subscribeForDatepickerOutputs(
|
||||||
datepickerInstance: RplCalendarNOA11Y
|
datepickerInstance: FidRplCalendarNOA11Y
|
||||||
) {
|
) {
|
||||||
datepickerInstance.navigate.subscribe((date: any) =>
|
datepickerInstance.navigate.subscribe((date: any) =>
|
||||||
this.navigate.emit(date)
|
this.navigate.emit(date)
|
||||||
|
@ -1,40 +1,39 @@
|
|||||||
import {
|
import {
|
||||||
Component,
|
|
||||||
EventEmitter,
|
|
||||||
Input,
|
|
||||||
OnInit,
|
|
||||||
Output,
|
|
||||||
TemplateRef,
|
|
||||||
ChangeDetectionStrategy,
|
ChangeDetectionStrategy,
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
SimpleChanges,
|
Component,
|
||||||
|
ElementRef,
|
||||||
|
EventEmitter,
|
||||||
|
Input,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
Output,
|
||||||
|
SimpleChanges,
|
||||||
|
TemplateRef,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
ElementRef,
|
|
||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
|
|
||||||
import { CalendarItemNOA11Y } from "./datepicker";
|
|
||||||
import { Subscription } from "rxjs";
|
|
||||||
import {
|
import {
|
||||||
|
CalendarItemNOA11Y,
|
||||||
DayTemplateContextNOA11Y,
|
DayTemplateContextNOA11Y,
|
||||||
NgbDataTemplateStruct,
|
DayViewModel,
|
||||||
MonthViewModel,
|
MonthViewModel,
|
||||||
|
NgbDataTemplateStruct,
|
||||||
NgbDate,
|
NgbDate,
|
||||||
NgbDatepickerI18nNOA11Y,
|
NgbDatepickerI18nNOA11Y,
|
||||||
NgbDatepickerServiceNOA11Y,
|
NgbDatepickerServiceNOA11Y,
|
||||||
DayViewModel,
|
WeekViewModel
|
||||||
WeekViewModel,
|
|
||||||
} from "@isp/xdce-widget";
|
} from "@isp/xdce-widget";
|
||||||
|
import { Subscription } from "rxjs";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "ngb-datepicker-routing-view",
|
selector: "ngb-datepicker-routing-view",
|
||||||
host: { class: "d-block" },
|
host: { class: "d-block" },
|
||||||
templateUrl: "./datepicker-routing-view.html",
|
templateUrl: './datepicker-routing-view.html',
|
||||||
styleUrls: ["./datepicker-routing-view.scss"],
|
styleUrls: ["./datepicker-routing-view.scss"],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class NgbDatepickerRoutingViewNOA11Y
|
export class NgbFidDatepickerRoutingViewNOA11Y
|
||||||
implements OnInit, OnChanges, OnDestroy
|
implements OnInit, OnChanges, OnDestroy
|
||||||
{
|
{
|
||||||
@Input() dayTemplate: TemplateRef<DayTemplateContextNOA11Y>;
|
@Input() dayTemplate: TemplateRef<DayTemplateContextNOA11Y>;
|
||||||
|
@ -1,24 +1,20 @@
|
|||||||
import { Subscription } from "rxjs";
|
|
||||||
import {
|
import {
|
||||||
ChangeDetectionStrategy,
|
ChangeDetectionStrategy,
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
Component,
|
Component,
|
||||||
|
ElementRef,
|
||||||
|
EventEmitter,
|
||||||
|
forwardRef,
|
||||||
Input,
|
Input,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
TemplateRef,
|
|
||||||
forwardRef,
|
|
||||||
OnInit,
|
|
||||||
SimpleChanges,
|
|
||||||
EventEmitter,
|
|
||||||
Output,
|
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
ElementRef,
|
OnInit,
|
||||||
ViewChild,
|
Output,
|
||||||
ViewChildren,
|
SimpleChanges,
|
||||||
|
TemplateRef,
|
||||||
|
ViewChild
|
||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
import { NG_VALUE_ACCESSOR, ControlValueAccessor } from "@angular/forms";
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
|
||||||
|
|
||||||
import { NgbDatepickerRoutingViewNOA11Y } from "./datepicker-routing-view";
|
|
||||||
import {
|
import {
|
||||||
DatepickerViewModel,
|
DatepickerViewModel,
|
||||||
DayTemplateContextNOA11Y,
|
DayTemplateContextNOA11Y,
|
||||||
@ -31,40 +27,22 @@ import {
|
|||||||
NgbDatepickerConfigNOA11Y,
|
NgbDatepickerConfigNOA11Y,
|
||||||
NgbDatepickerI18nNOA11Y,
|
NgbDatepickerI18nNOA11Y,
|
||||||
NgbDatepickerKeyMapServiceNOA11Y,
|
NgbDatepickerKeyMapServiceNOA11Y,
|
||||||
|
RplCalendarNavigateEventNOA11Y,
|
||||||
NgbDatepickerServiceNOA11Y,
|
NgbDatepickerServiceNOA11Y,
|
||||||
NgbDateStruct,
|
NgbDateStruct,
|
||||||
|
NgbDatepickerNavigateEventNOA11Y,
|
||||||
|
CalendarItemNOA11Y
|
||||||
} from "@isp/xdce-widget";
|
} from "@isp/xdce-widget";
|
||||||
import { toInteger } from "@isp/xdce-widget/user-input/isp-typeahead/ng-bootstrap/util";
|
import { toInteger } from "../util/util";
|
||||||
|
import { Subscription } from "rxjs";
|
||||||
|
import { NgbFidDatepickerRoutingViewNOA11Y } from "./datepicker-routing-view";
|
||||||
|
|
||||||
const NGB_CALENDAR_VALUE_ACCESSOR = {
|
const NGB_CALENDAR_VALUE_ACCESSOR = {
|
||||||
provide: NG_VALUE_ACCESSOR,
|
provide: NG_VALUE_ACCESSOR,
|
||||||
useExisting: forwardRef(() => RplCalendarNOA11Y),
|
useExisting: forwardRef(() => FidRplCalendarNOA11Y),
|
||||||
multi: true,
|
multi: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* The payload of the datepicker navigation event
|
|
||||||
*/
|
|
||||||
export interface RplCalendarNavigateEventNOA11Y {
|
|
||||||
/**
|
|
||||||
* Currently displayed month
|
|
||||||
*/
|
|
||||||
current: { year: number; month: number };
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Month we're navigating to
|
|
||||||
*/
|
|
||||||
next: { year: number; month: number };
|
|
||||||
}
|
|
||||||
|
|
||||||
export class CalendarItemNOA11Y {
|
|
||||||
name: string;
|
|
||||||
number: number;
|
|
||||||
focused: boolean;
|
|
||||||
disabled: boolean;
|
|
||||||
selected: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A lightweight and highly configurable datepicker directive
|
* A lightweight and highly configurable datepicker directive
|
||||||
*/
|
*/
|
||||||
@ -89,15 +67,15 @@ export class CalendarItemNOA11Y {
|
|||||||
NgbDatepickerKeyMapServiceNOA11Y,
|
NgbDatepickerKeyMapServiceNOA11Y,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class RplCalendarNOA11Y
|
export class FidRplCalendarNOA11Y
|
||||||
implements OnDestroy, OnChanges, OnInit, ControlValueAccessor
|
implements OnDestroy, OnChanges, OnInit, ControlValueAccessor
|
||||||
{
|
{
|
||||||
model: DatepickerViewModel;
|
model: DatepickerViewModel;
|
||||||
|
|
||||||
@ViewChild(forwardRef(() => NgbDatepickerRoutingViewNOA11Y))
|
@ViewChild(forwardRef(() => NgbFidDatepickerRoutingViewNOA11Y))
|
||||||
datepickerRoutingView: NgbDatepickerRoutingViewNOA11Y;
|
datepickerRoutingView: NgbFidDatepickerRoutingViewNOA11Y;
|
||||||
@ViewChild(forwardRef(() => NgbDatepickerRoutingViewNOA11Y))
|
@ViewChild(forwardRef(() => NgbFidDatepickerRoutingViewNOA11Y))
|
||||||
datepickerHeader: NgbDatepickerRoutingViewNOA11Y;
|
datepickerHeader: NgbFidDatepickerRoutingViewNOA11Y;
|
||||||
|
|
||||||
private _subscription: Subscription;
|
private _subscription: Subscription;
|
||||||
/**
|
/**
|
||||||
@ -784,17 +762,3 @@ export class RplCalendarNOA11Y
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The payload of the calendar navigation event
|
|
||||||
*/
|
|
||||||
export interface NgbDatepickerNavigateEventNOA11Y {
|
|
||||||
/**
|
|
||||||
* Currently displayed month
|
|
||||||
*/
|
|
||||||
current: { year: number; month: number };
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Month we're navigating to
|
|
||||||
*/
|
|
||||||
next: { year: number; month: number };
|
|
||||||
}
|
|
||||||
|
@ -0,0 +1,151 @@
|
|||||||
|
// previous version:
|
||||||
|
// https://github.com/angular-ui/bootstrap/blob/07c31d0731f7cb068a1932b8e01d2312b796b4ec/src/position/position.js
|
||||||
|
export class Positioning {
|
||||||
|
private getStyle(element: HTMLElement, prop: string): string { return window.getComputedStyle(element)[prop]; }
|
||||||
|
|
||||||
|
private isStaticPositioned(element: HTMLElement): boolean {
|
||||||
|
return (this.getStyle(element, 'position') || 'static') === 'static';
|
||||||
|
}
|
||||||
|
|
||||||
|
private offsetParent(element: HTMLElement): HTMLElement {
|
||||||
|
let offsetParentEl = <HTMLElement>element.offsetParent || document.documentElement;
|
||||||
|
|
||||||
|
while (offsetParentEl && offsetParentEl !== document.documentElement && this.isStaticPositioned(offsetParentEl)) {
|
||||||
|
offsetParentEl = <HTMLElement>offsetParentEl.offsetParent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return offsetParentEl || document.documentElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
position(element: HTMLElement, round = true): ClientRect {
|
||||||
|
let elPosition: ClientRect;
|
||||||
|
let parentOffset: ClientRect = {width: 0, height: 0, top: 0, bottom: 0, left: 0, right: 0};
|
||||||
|
|
||||||
|
if (this.getStyle(element, 'position') === 'fixed') {
|
||||||
|
elPosition = element.getBoundingClientRect();
|
||||||
|
} else {
|
||||||
|
const offsetParentEl = this.offsetParent(element);
|
||||||
|
|
||||||
|
elPosition = this.offset(element, false);
|
||||||
|
|
||||||
|
if (offsetParentEl !== document.documentElement) {
|
||||||
|
parentOffset = this.offset(offsetParentEl, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
parentOffset.top += offsetParentEl.clientTop;
|
||||||
|
parentOffset.left += offsetParentEl.clientLeft;
|
||||||
|
}
|
||||||
|
|
||||||
|
elPosition.top -= parentOffset.top;
|
||||||
|
elPosition.bottom -= parentOffset.top;
|
||||||
|
elPosition.left -= parentOffset.left;
|
||||||
|
elPosition.right -= parentOffset.left;
|
||||||
|
|
||||||
|
if (round) {
|
||||||
|
elPosition.top = Math.round(elPosition.top);
|
||||||
|
elPosition.bottom = Math.round(elPosition.bottom);
|
||||||
|
elPosition.left = Math.round(elPosition.left);
|
||||||
|
elPosition.right = Math.round(elPosition.right);
|
||||||
|
}
|
||||||
|
|
||||||
|
return elPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
offset(element: HTMLElement, round = true): ClientRect {
|
||||||
|
const elBcr = element.getBoundingClientRect();
|
||||||
|
const viewportOffset = {
|
||||||
|
top: window.pageYOffset - document.documentElement.clientTop,
|
||||||
|
left: window.pageXOffset - document.documentElement.clientLeft
|
||||||
|
};
|
||||||
|
|
||||||
|
let elOffset = {
|
||||||
|
height: elBcr.height || element.offsetHeight,
|
||||||
|
width: elBcr.width || element.offsetWidth,
|
||||||
|
top: elBcr.top + viewportOffset.top,
|
||||||
|
bottom: elBcr.bottom + viewportOffset.top,
|
||||||
|
left: elBcr.left + viewportOffset.left,
|
||||||
|
right: elBcr.right + viewportOffset.left
|
||||||
|
};
|
||||||
|
|
||||||
|
if (round) {
|
||||||
|
elOffset.height = Math.round(elOffset.height);
|
||||||
|
elOffset.width = Math.round(elOffset.width);
|
||||||
|
elOffset.top = Math.round(elOffset.top);
|
||||||
|
elOffset.bottom = Math.round(elOffset.bottom);
|
||||||
|
elOffset.left = Math.round(elOffset.left);
|
||||||
|
elOffset.right = Math.round(elOffset.right);
|
||||||
|
}
|
||||||
|
|
||||||
|
return elOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
positionElements(hostElement: HTMLElement, targetElement: HTMLElement, placement: string, appendToBody?: boolean):
|
||||||
|
ClientRect {
|
||||||
|
const hostElPosition = appendToBody ? this.offset(hostElement, false) : this.position(hostElement, false);
|
||||||
|
const targetElBCR = targetElement.getBoundingClientRect();
|
||||||
|
const placementPrimary = placement.split('-')[0] || 'top';
|
||||||
|
const placementSecondary = placement.split('-')[1] || 'center';
|
||||||
|
|
||||||
|
let targetElPosition: ClientRect = {
|
||||||
|
'height': targetElBCR.height || targetElement.offsetHeight,
|
||||||
|
'width': targetElBCR.width || targetElement.offsetWidth,
|
||||||
|
'top': 0,
|
||||||
|
'bottom': targetElBCR.height || targetElement.offsetHeight,
|
||||||
|
'left': 0,
|
||||||
|
'right': targetElBCR.width || targetElement.offsetWidth
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (placementPrimary) {
|
||||||
|
case 'top':
|
||||||
|
targetElPosition.top = hostElPosition.top - targetElement.offsetHeight;
|
||||||
|
break;
|
||||||
|
case 'bottom':
|
||||||
|
targetElPosition.top = hostElPosition.top + hostElPosition.height;
|
||||||
|
break;
|
||||||
|
case 'left':
|
||||||
|
targetElPosition.left = hostElPosition.left - targetElement.offsetWidth;
|
||||||
|
break;
|
||||||
|
case 'right':
|
||||||
|
targetElPosition.left = hostElPosition.left + hostElPosition.width;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (placementSecondary) {
|
||||||
|
case 'top':
|
||||||
|
targetElPosition.top = hostElPosition.top;
|
||||||
|
break;
|
||||||
|
case 'bottom':
|
||||||
|
targetElPosition.top = hostElPosition.top + hostElPosition.height - targetElement.offsetHeight;
|
||||||
|
break;
|
||||||
|
case 'left':
|
||||||
|
targetElPosition.left = hostElPosition.left;
|
||||||
|
break;
|
||||||
|
case 'right':
|
||||||
|
targetElPosition.left = hostElPosition.left + hostElPosition.width - targetElement.offsetWidth;
|
||||||
|
break;
|
||||||
|
case 'center':
|
||||||
|
if (placementPrimary === 'top' || placementPrimary === 'bottom') {
|
||||||
|
targetElPosition.left = hostElPosition.left + hostElPosition.width / 2 - targetElement.offsetWidth / 2;
|
||||||
|
} else {
|
||||||
|
targetElPosition.top = hostElPosition.top + hostElPosition.height / 2 - targetElement.offsetHeight / 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
targetElPosition.top = Math.round(targetElPosition.top);
|
||||||
|
targetElPosition.bottom = Math.round(targetElPosition.bottom);
|
||||||
|
targetElPosition.left = Math.round(targetElPosition.left);
|
||||||
|
targetElPosition.right = Math.round(targetElPosition.right);
|
||||||
|
|
||||||
|
return targetElPosition;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const positionService = new Positioning();
|
||||||
|
export function positionElements(
|
||||||
|
hostElement: HTMLElement, targetElement: HTMLElement, placement: string, appendToBody?: boolean): void {
|
||||||
|
const pos = positionService.positionElements(hostElement, targetElement, placement, appendToBody);
|
||||||
|
|
||||||
|
targetElement.style.top = `${pos.top}px`;
|
||||||
|
targetElement.style.left = `${pos.left}px`;
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
export function toInteger(value: any): number {
|
||||||
|
return parseInt(`${value}`, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function toString(value: any): string {
|
||||||
|
return (value !== undefined && value !== null) ? `${value}` : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getValueInRange(value: number, max: number, min = 0): number {
|
||||||
|
return Math.max(Math.min(value, max), min);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isString(value: any): value is string {
|
||||||
|
return typeof value === 'string';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isNumber(value: any): value is number {
|
||||||
|
return !isNaN(toInteger(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isInteger(value: any): value is number {
|
||||||
|
return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isDefined(value: any): boolean {
|
||||||
|
return value !== undefined && value !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function padNumber(value: number) {
|
||||||
|
if (isNumber(value)) {
|
||||||
|
return `0${value}`.slice(-2);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function regExpEscape(text) {
|
||||||
|
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
import { Injector } from "@angular/core";
|
||||||
|
import {
|
||||||
|
NgbDatepickerNavigation,
|
||||||
|
NgbDatepickerNavigationSelect,
|
||||||
|
NgbDatepickerDayView,
|
||||||
|
NgbDatepickerReplyMonthView,
|
||||||
|
NgbDatepickerReplyYearsView,
|
||||||
|
NgbDatepickerI18n,
|
||||||
|
NgbCalendar,
|
||||||
|
NgbDatepickerService
|
||||||
|
} from "@isp/xdce-widget";
|
||||||
|
|
||||||
|
export class NgbFidDatepickerNavigation extends NgbDatepickerNavigation {
|
||||||
|
constructor(i18n: NgbDatepickerI18n, _calendar: NgbCalendar, injector: Injector, _service: NgbDatepickerService, translate: TranslateService, elementRef: ElementRef) {
|
||||||
|
super(i18n, _calendar, injector, _service, translate, elementRef);
|
||||||
|
}
|
||||||
|
}
|
@ -22,7 +22,7 @@ import {
|
|||||||
NG_VALUE_ACCESSOR,
|
NG_VALUE_ACCESSOR,
|
||||||
Validator,
|
Validator,
|
||||||
} from "@angular/forms";
|
} from "@angular/forms";
|
||||||
|
import { EventManager } from "@isp/xdce-arch-core-base";
|
||||||
import {
|
import {
|
||||||
DayTemplateContext,
|
DayTemplateContext,
|
||||||
NbpCalendarPattern,
|
NbpCalendarPattern,
|
||||||
@ -35,20 +35,18 @@ import {
|
|||||||
NgbDatepickerNavigateEvent,
|
NgbDatepickerNavigateEvent,
|
||||||
NgbDatepickerService,
|
NgbDatepickerService,
|
||||||
} from "@isp/xdce-widget";
|
} from "@isp/xdce-widget";
|
||||||
import { RplCalendar } from "./datepicker";
|
import { Positioning } from "../util/positioning";
|
||||||
|
import { FidRplCalendar } from "./datepicker";
|
||||||
import { EventManager } from "@isp/xdce-arch-core-base";
|
|
||||||
import { Positioning } from "@isp/xdce-widget/user-input/isp-typeahead/ng-bootstrap/positioning";
|
|
||||||
|
|
||||||
const NGB_DATEPICKER_VALUE_ACCESSOR = {
|
const NGB_DATEPICKER_VALUE_ACCESSOR = {
|
||||||
provide: NG_VALUE_ACCESSOR,
|
provide: NG_VALUE_ACCESSOR,
|
||||||
useExisting: forwardRef(() => NgbInputDatepicker),
|
useExisting: forwardRef(() => NgbFidInputDatepicker),
|
||||||
multi: true,
|
multi: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const NGB_DATEPICKER_VALIDATOR = {
|
const NGB_DATEPICKER_VALIDATOR = {
|
||||||
provide: NG_VALIDATORS,
|
provide: NG_VALIDATORS,
|
||||||
useExisting: forwardRef(() => NgbInputDatepicker),
|
useExisting: forwardRef(() => NgbFidInputDatepicker),
|
||||||
multi: true,
|
multi: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -57,7 +55,7 @@ const NGB_DATEPICKER_VALIDATOR = {
|
|||||||
* Manages integration with the input field itself (data entry) and ngModel (validation etc.).
|
* Manages integration with the input field itself (data entry) and ngModel (validation etc.).
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: "input[fidRplCalendar]",
|
selector: 'input[fidRplCalendar]',
|
||||||
exportAs: "fidRplCalendar",
|
exportAs: "fidRplCalendar",
|
||||||
host: {
|
host: {
|
||||||
"(input)": "waitForFormat($event.target.value)",
|
"(input)": "waitForFormat($event.target.value)",
|
||||||
@ -72,10 +70,10 @@ const NGB_DATEPICKER_VALIDATOR = {
|
|||||||
NgbDatepickerService,
|
NgbDatepickerService,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class NgbInputDatepicker
|
export class NgbFidInputDatepicker
|
||||||
implements OnChanges, OnDestroy, ControlValueAccessor, Validator
|
implements OnChanges, OnDestroy, ControlValueAccessor, Validator
|
||||||
{
|
{
|
||||||
private _cRef: ComponentRef<RplCalendar> = null;
|
private _cRef: ComponentRef<FidRplCalendar> = null;
|
||||||
private _model: NgbDate;
|
private _model: NgbDate;
|
||||||
private _zoneSubscription: any;
|
private _zoneSubscription: any;
|
||||||
|
|
||||||
@ -438,7 +436,7 @@ export class NgbInputDatepicker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const cf = this._cfr.resolveComponentFactory(RplCalendar);
|
const cf = this._cfr.resolveComponentFactory(FidRplCalendar);
|
||||||
this._cRef = this._vcRef.createComponent(cf);
|
this._cRef = this._vcRef.createComponent(cf);
|
||||||
|
|
||||||
this._applyPopupStyling(this._cRef.location.nativeElement);
|
this._applyPopupStyling(this._cRef.location.nativeElement);
|
||||||
@ -592,7 +590,7 @@ export class NgbInputDatepicker
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _applyDatepickerInputs(datepickerInstance: RplCalendar): void {
|
private _applyDatepickerInputs(datepickerInstance: FidRplCalendar): void {
|
||||||
[
|
[
|
||||||
"dayTemplate",
|
"dayTemplate",
|
||||||
"displayMonths",
|
"displayMonths",
|
||||||
@ -618,7 +616,7 @@ export class NgbInputDatepicker
|
|||||||
this._renderer.setStyle(nativeElement, "padding", "0");
|
this._renderer.setStyle(nativeElement, "padding", "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
private _subscribeForDatepickerOutputs(datepickerInstance: RplCalendar) {
|
private _subscribeForDatepickerOutputs(datepickerInstance: FidRplCalendar) {
|
||||||
datepickerInstance.navigate.subscribe((date: any) =>
|
datepickerInstance.navigate.subscribe((date: any) =>
|
||||||
this.navigate.emit(date)
|
this.navigate.emit(date)
|
||||||
);
|
);
|
||||||
|
@ -15,7 +15,6 @@ import {
|
|||||||
ViewChild,
|
ViewChild,
|
||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
import {
|
import {
|
||||||
CalendarItem,
|
|
||||||
DayTemplateContext,
|
DayTemplateContext,
|
||||||
DayViewModel,
|
DayViewModel,
|
||||||
MonthViewModel,
|
MonthViewModel,
|
||||||
@ -23,18 +22,18 @@ import {
|
|||||||
NgbDate,
|
NgbDate,
|
||||||
NgbDatepickerI18n,
|
NgbDatepickerI18n,
|
||||||
NgbDatepickerService,
|
NgbDatepickerService,
|
||||||
WeekViewModel,
|
WeekViewModel
|
||||||
} from "@isp/xdce-widget";
|
} from "@isp/xdce-widget";
|
||||||
import { Subscription } from "rxjs";
|
import { Subscription } from "rxjs";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "ngb-fid-datepicker-routing-view",
|
selector: 'ngb-fid-datepicker-routing-view',
|
||||||
host: { class: "d-block" },
|
host: { class: "d-block" },
|
||||||
templateUrl: "./datepicker-routing-view.html",
|
templateUrl: './datepicker-routing-view.html',
|
||||||
styleUrls: ["./datepicker-routing-view.scss"],
|
styleUrls: ["./datepicker-routing-view.scss"],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class NgbDatepickerRoutingView implements OnInit, OnChanges, OnDestroy {
|
export class NgbFidDatepickerRoutingView implements OnInit, OnChanges, OnDestroy {
|
||||||
@Input() dayTemplate: TemplateRef<DayTemplateContext>;
|
@Input() dayTemplate: TemplateRef<DayTemplateContext>;
|
||||||
@Input() monthTemplate: TemplateRef<DayTemplateContext>;
|
@Input() monthTemplate: TemplateRef<DayTemplateContext>;
|
||||||
@Input() yearsTemplate: TemplateRef<DayTemplateContext>;
|
@Input() yearsTemplate: TemplateRef<DayTemplateContext>;
|
||||||
@ -413,7 +412,7 @@ export class NgbDatepickerRoutingView implements OnInit, OnChanges, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private resetMesi() {
|
private resetMesi() {
|
||||||
let months: CalendarItem[][] = [];
|
let months: [][] = [];
|
||||||
months = this.mesi.map((row) => {
|
months = this.mesi.map((row) => {
|
||||||
return row.map((m) => {
|
return row.map((m) => {
|
||||||
const res = { ...m };
|
const res = { ...m };
|
||||||
@ -430,7 +429,7 @@ export class NgbDatepickerRoutingView implements OnInit, OnChanges, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private resetAnni() {
|
private resetAnni() {
|
||||||
let yrs: CalendarItem[][] = [];
|
let yrs: [][] = [];
|
||||||
yrs = this.years.map((row) => {
|
yrs = this.years.map((row) => {
|
||||||
return row.map((y) => {
|
return row.map((y) => {
|
||||||
const res = { ...y };
|
const res = { ...y };
|
||||||
|
@ -16,6 +16,7 @@ import {
|
|||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
|
||||||
import {
|
import {
|
||||||
|
CalendarItem,
|
||||||
DatepickerViewModel,
|
DatepickerViewModel,
|
||||||
DayTemplateContext,
|
DayTemplateContext,
|
||||||
EnabledRangeService,
|
EnabledRangeService,
|
||||||
@ -27,48 +28,26 @@ import {
|
|||||||
NgbDatepickerConfig,
|
NgbDatepickerConfig,
|
||||||
NgbDatepickerI18n,
|
NgbDatepickerI18n,
|
||||||
NgbDatepickerKeyMapService,
|
NgbDatepickerKeyMapService,
|
||||||
|
NgbDatepickerNavigateEvent,
|
||||||
NgbDatepickerService,
|
NgbDatepickerService,
|
||||||
NgbDateStruct,
|
NgbDateStruct
|
||||||
} from "@isp/xdce-widget";
|
} from "@isp/xdce-widget";
|
||||||
import { toInteger } from "@isp/xdce-widget/user-input/isp-typeahead/ng-bootstrap/util";
|
|
||||||
import { Subscription } from "rxjs";
|
import { Subscription } from "rxjs";
|
||||||
import { NgbDatepickerRoutingView } from "./datepicker-routing-view";
|
import { toInteger } from "../util/util";
|
||||||
|
import { NgbFidDatepickerRoutingView } from "./datepicker-routing-view";
|
||||||
|
|
||||||
const NGB_CALENDAR_VALUE_ACCESSOR = {
|
const NGB_CALENDAR_VALUE_ACCESSOR = {
|
||||||
provide: NG_VALUE_ACCESSOR,
|
provide: NG_VALUE_ACCESSOR,
|
||||||
useExisting: forwardRef(() => RplCalendar),
|
useExisting: forwardRef(() => FidRplCalendar),
|
||||||
multi: true,
|
multi: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* The payload of the datepicker navigation event
|
|
||||||
*/
|
|
||||||
export interface RplCalendarNavigateEvent {
|
|
||||||
/**
|
|
||||||
* Currently displayed month
|
|
||||||
*/
|
|
||||||
current: { year: number; month: number };
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Month we're navigating to
|
|
||||||
*/
|
|
||||||
next: { year: number; month: number };
|
|
||||||
}
|
|
||||||
|
|
||||||
export class CalendarItem {
|
|
||||||
name: string;
|
|
||||||
number: number;
|
|
||||||
focused: boolean;
|
|
||||||
disabled: boolean;
|
|
||||||
selected: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A lightweight and highly configurable datepicker directive
|
* A lightweight and highly configurable datepicker directive
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
exportAs: "rplCalendar",
|
exportAs: "fidRplCalendar",
|
||||||
selector: "rpl-calendar",
|
selector: 'fid-rpl-calendar',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
host: {
|
host: {
|
||||||
class: "d-inline-block rounded",
|
class: "d-inline-block rounded",
|
||||||
@ -90,15 +69,15 @@ export class CalendarItem {
|
|||||||
NgbDatepickerKeyMapService,
|
NgbDatepickerKeyMapService,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class RplCalendar
|
export class FidRplCalendar
|
||||||
implements OnDestroy, OnChanges, OnInit, ControlValueAccessor
|
implements OnDestroy, OnChanges, OnInit, ControlValueAccessor
|
||||||
{
|
{
|
||||||
model: DatepickerViewModel;
|
model: DatepickerViewModel;
|
||||||
|
|
||||||
@ViewChild(forwardRef(() => NgbDatepickerRoutingView))
|
@ViewChild(forwardRef(() => NgbFidDatepickerRoutingView))
|
||||||
datepickerRoutingView: NgbDatepickerRoutingView;
|
datepickerRoutingView: NgbFidDatepickerRoutingView;
|
||||||
@ViewChild(forwardRef(() => NgbDatepickerRoutingView))
|
@ViewChild(forwardRef(() => NgbFidDatepickerRoutingView))
|
||||||
datepickerHeader: NgbDatepickerRoutingView;
|
datepickerHeader: NgbFidDatepickerRoutingView;
|
||||||
|
|
||||||
private _subscription: Subscription;
|
private _subscription: Subscription;
|
||||||
/**
|
/**
|
||||||
@ -851,17 +830,3 @@ export class RplCalendar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* The payload of the calendar navigation event
|
|
||||||
*/
|
|
||||||
export interface NgbDatepickerNavigateEvent {
|
|
||||||
/**
|
|
||||||
* Currently displayed month
|
|
||||||
*/
|
|
||||||
current: { year: number; month: number };
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Month we're navigating to
|
|
||||||
*/
|
|
||||||
next: { year: number; month: number };
|
|
||||||
}
|
|
||||||
|
@ -0,0 +1,151 @@
|
|||||||
|
// previous version:
|
||||||
|
// https://github.com/angular-ui/bootstrap/blob/07c31d0731f7cb068a1932b8e01d2312b796b4ec/src/position/position.js
|
||||||
|
export class Positioning {
|
||||||
|
private getStyle(element: HTMLElement, prop: string): string { return window.getComputedStyle(element)[prop]; }
|
||||||
|
|
||||||
|
private isStaticPositioned(element: HTMLElement): boolean {
|
||||||
|
return (this.getStyle(element, 'position') || 'static') === 'static';
|
||||||
|
}
|
||||||
|
|
||||||
|
private offsetParent(element: HTMLElement): HTMLElement {
|
||||||
|
let offsetParentEl = <HTMLElement>element.offsetParent || document.documentElement;
|
||||||
|
|
||||||
|
while (offsetParentEl && offsetParentEl !== document.documentElement && this.isStaticPositioned(offsetParentEl)) {
|
||||||
|
offsetParentEl = <HTMLElement>offsetParentEl.offsetParent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return offsetParentEl || document.documentElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
position(element: HTMLElement, round = true): ClientRect {
|
||||||
|
let elPosition: ClientRect;
|
||||||
|
let parentOffset: ClientRect = {width: 0, height: 0, top: 0, bottom: 0, left: 0, right: 0};
|
||||||
|
|
||||||
|
if (this.getStyle(element, 'position') === 'fixed') {
|
||||||
|
elPosition = element.getBoundingClientRect();
|
||||||
|
} else {
|
||||||
|
const offsetParentEl = this.offsetParent(element);
|
||||||
|
|
||||||
|
elPosition = this.offset(element, false);
|
||||||
|
|
||||||
|
if (offsetParentEl !== document.documentElement) {
|
||||||
|
parentOffset = this.offset(offsetParentEl, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
parentOffset.top += offsetParentEl.clientTop;
|
||||||
|
parentOffset.left += offsetParentEl.clientLeft;
|
||||||
|
}
|
||||||
|
|
||||||
|
elPosition.top -= parentOffset.top;
|
||||||
|
elPosition.bottom -= parentOffset.top;
|
||||||
|
elPosition.left -= parentOffset.left;
|
||||||
|
elPosition.right -= parentOffset.left;
|
||||||
|
|
||||||
|
if (round) {
|
||||||
|
elPosition.top = Math.round(elPosition.top);
|
||||||
|
elPosition.bottom = Math.round(elPosition.bottom);
|
||||||
|
elPosition.left = Math.round(elPosition.left);
|
||||||
|
elPosition.right = Math.round(elPosition.right);
|
||||||
|
}
|
||||||
|
|
||||||
|
return elPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
offset(element: HTMLElement, round = true): ClientRect {
|
||||||
|
const elBcr = element.getBoundingClientRect();
|
||||||
|
const viewportOffset = {
|
||||||
|
top: window.pageYOffset - document.documentElement.clientTop,
|
||||||
|
left: window.pageXOffset - document.documentElement.clientLeft
|
||||||
|
};
|
||||||
|
|
||||||
|
let elOffset = {
|
||||||
|
height: elBcr.height || element.offsetHeight,
|
||||||
|
width: elBcr.width || element.offsetWidth,
|
||||||
|
top: elBcr.top + viewportOffset.top,
|
||||||
|
bottom: elBcr.bottom + viewportOffset.top,
|
||||||
|
left: elBcr.left + viewportOffset.left,
|
||||||
|
right: elBcr.right + viewportOffset.left
|
||||||
|
};
|
||||||
|
|
||||||
|
if (round) {
|
||||||
|
elOffset.height = Math.round(elOffset.height);
|
||||||
|
elOffset.width = Math.round(elOffset.width);
|
||||||
|
elOffset.top = Math.round(elOffset.top);
|
||||||
|
elOffset.bottom = Math.round(elOffset.bottom);
|
||||||
|
elOffset.left = Math.round(elOffset.left);
|
||||||
|
elOffset.right = Math.round(elOffset.right);
|
||||||
|
}
|
||||||
|
|
||||||
|
return elOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
positionElements(hostElement: HTMLElement, targetElement: HTMLElement, placement: string, appendToBody?: boolean):
|
||||||
|
ClientRect {
|
||||||
|
const hostElPosition = appendToBody ? this.offset(hostElement, false) : this.position(hostElement, false);
|
||||||
|
const targetElBCR = targetElement.getBoundingClientRect();
|
||||||
|
const placementPrimary = placement.split('-')[0] || 'top';
|
||||||
|
const placementSecondary = placement.split('-')[1] || 'center';
|
||||||
|
|
||||||
|
let targetElPosition: ClientRect = {
|
||||||
|
'height': targetElBCR.height || targetElement.offsetHeight,
|
||||||
|
'width': targetElBCR.width || targetElement.offsetWidth,
|
||||||
|
'top': 0,
|
||||||
|
'bottom': targetElBCR.height || targetElement.offsetHeight,
|
||||||
|
'left': 0,
|
||||||
|
'right': targetElBCR.width || targetElement.offsetWidth
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (placementPrimary) {
|
||||||
|
case 'top':
|
||||||
|
targetElPosition.top = hostElPosition.top - targetElement.offsetHeight;
|
||||||
|
break;
|
||||||
|
case 'bottom':
|
||||||
|
targetElPosition.top = hostElPosition.top + hostElPosition.height;
|
||||||
|
break;
|
||||||
|
case 'left':
|
||||||
|
targetElPosition.left = hostElPosition.left - targetElement.offsetWidth;
|
||||||
|
break;
|
||||||
|
case 'right':
|
||||||
|
targetElPosition.left = hostElPosition.left + hostElPosition.width;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (placementSecondary) {
|
||||||
|
case 'top':
|
||||||
|
targetElPosition.top = hostElPosition.top;
|
||||||
|
break;
|
||||||
|
case 'bottom':
|
||||||
|
targetElPosition.top = hostElPosition.top + hostElPosition.height - targetElement.offsetHeight;
|
||||||
|
break;
|
||||||
|
case 'left':
|
||||||
|
targetElPosition.left = hostElPosition.left;
|
||||||
|
break;
|
||||||
|
case 'right':
|
||||||
|
targetElPosition.left = hostElPosition.left + hostElPosition.width - targetElement.offsetWidth;
|
||||||
|
break;
|
||||||
|
case 'center':
|
||||||
|
if (placementPrimary === 'top' || placementPrimary === 'bottom') {
|
||||||
|
targetElPosition.left = hostElPosition.left + hostElPosition.width / 2 - targetElement.offsetWidth / 2;
|
||||||
|
} else {
|
||||||
|
targetElPosition.top = hostElPosition.top + hostElPosition.height / 2 - targetElement.offsetHeight / 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
targetElPosition.top = Math.round(targetElPosition.top);
|
||||||
|
targetElPosition.bottom = Math.round(targetElPosition.bottom);
|
||||||
|
targetElPosition.left = Math.round(targetElPosition.left);
|
||||||
|
targetElPosition.right = Math.round(targetElPosition.right);
|
||||||
|
|
||||||
|
return targetElPosition;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const positionService = new Positioning();
|
||||||
|
export function positionElements(
|
||||||
|
hostElement: HTMLElement, targetElement: HTMLElement, placement: string, appendToBody?: boolean): void {
|
||||||
|
const pos = positionService.positionElements(hostElement, targetElement, placement, appendToBody);
|
||||||
|
|
||||||
|
targetElement.style.top = `${pos.top}px`;
|
||||||
|
targetElement.style.left = `${pos.left}px`;
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
export function toInteger(value: any): number {
|
||||||
|
return parseInt(`${value}`, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function toString(value: any): string {
|
||||||
|
return (value !== undefined && value !== null) ? `${value}` : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getValueInRange(value: number, max: number, min = 0): number {
|
||||||
|
return Math.max(Math.min(value, max), min);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isString(value: any): value is string {
|
||||||
|
return typeof value === 'string';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isNumber(value: any): value is number {
|
||||||
|
return !isNaN(toInteger(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isInteger(value: any): value is number {
|
||||||
|
return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isDefined(value: any): boolean {
|
||||||
|
return value !== undefined && value !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function padNumber(value: number) {
|
||||||
|
if (isNumber(value)) {
|
||||||
|
return `0${value}`.slice(-2);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function regExpEscape(text) {
|
||||||
|
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||||
|
}
|
@ -19,8 +19,6 @@ import {
|
|||||||
SimpleChanges,
|
SimpleChanges,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
// import forEach from 'lodash/foreach';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
NG_ASYNC_VALIDATORS,
|
NG_ASYNC_VALIDATORS,
|
||||||
NG_VALIDATORS,
|
NG_VALIDATORS,
|
||||||
@ -36,31 +34,28 @@ import {
|
|||||||
import {
|
import {
|
||||||
AsyncValidatorArray,
|
AsyncValidatorArray,
|
||||||
coerceBooleanProperty,
|
coerceBooleanProperty,
|
||||||
|
DateValidator, EnabledRangeService,
|
||||||
FormTouchService,
|
FormTouchService,
|
||||||
|
I18n,
|
||||||
INbpInput,
|
INbpInput,
|
||||||
NbpFormContainerComponent,
|
|
||||||
NbpInputElementBase,
|
|
||||||
NbpStyle,
|
|
||||||
ValidatorArray,
|
|
||||||
WidgetMode,
|
|
||||||
} from "@isp/xdce-widget/base";
|
|
||||||
|
|
||||||
import {
|
|
||||||
DateValidator, EnabledRangeService, I18n,
|
|
||||||
NbpCalendarPattern,
|
NbpCalendarPattern,
|
||||||
NbpCalendarPosition,
|
NbpCalendarPosition,
|
||||||
NbpDatepickerConfiguration,
|
NbpDatepickerConfiguration,
|
||||||
NbpDatepickerItI18n,
|
NbpDatepickerItI18n,
|
||||||
NbpDateSeparator,
|
NbpDateSeparator,
|
||||||
|
NbpFormContainerComponent,
|
||||||
|
NbpInputElementBase,
|
||||||
NbpItDateParserFormatter,
|
NbpItDateParserFormatter,
|
||||||
|
NbpStyle,
|
||||||
NgbDate,
|
NgbDate,
|
||||||
NgbDateParserFormatter,
|
NgbDateParserFormatter,
|
||||||
NgbDatepickerI18n,
|
NgbDatepickerI18n,
|
||||||
NgbDateStruct,
|
NgbDateStruct,
|
||||||
NgbInputDatepicker,
|
ValidatorArray,
|
||||||
|
WidgetMode,
|
||||||
} from "@isp/xdce-widget";
|
} from "@isp/xdce-widget";
|
||||||
import { TranslateService } from "@ngx-translate/core";
|
import { TranslateService } from "@ngx-translate/core";
|
||||||
|
import { NgbFidInputDatepicker } from "./@ng-bootstrap/datepicker/datepicker-input";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -412,8 +407,8 @@ export class NbpCalendarGenericComponentA11Y
|
|||||||
this._tax = value ? value : this._tax;
|
this._tax = value ? value : this._tax;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewChild("rplCalendar", { read: NgbInputDatepicker })
|
@ViewChild("rplCalendar", { read: NgbFidInputDatepicker })
|
||||||
rplCalendar: NgbInputDatepicker;
|
rplCalendar: NgbFidInputDatepicker;
|
||||||
@ViewChild(NgModel) model: NgModel;
|
@ViewChild(NgModel) model: NgModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,8 +17,6 @@ import {
|
|||||||
SimpleChanges,
|
SimpleChanges,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
// import forEach from 'lodash/foreach';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
NG_ASYNC_VALIDATORS,
|
NG_ASYNC_VALIDATORS,
|
||||||
NG_VALIDATORS,
|
NG_VALIDATORS,
|
||||||
@ -26,41 +24,24 @@ import {
|
|||||||
NgControl,
|
NgControl,
|
||||||
NgModel,
|
NgModel,
|
||||||
} from "@angular/forms";
|
} from "@angular/forms";
|
||||||
import { coerceBooleanProperty } from "@isp/xdce-widget/base";
|
|
||||||
import { Observable } from "rxjs";
|
|
||||||
import {
|
import {
|
||||||
EventManager,
|
|
||||||
ApplicationContextManagerInterface,
|
|
||||||
APPLICATION_CONTEXT_MANAGER,
|
APPLICATION_CONTEXT_MANAGER,
|
||||||
SESSION_MANAGER,
|
ApplicationContextManagerInterface,
|
||||||
|
EventManager
|
||||||
} from "@isp/xdce-arch-core-base";
|
} from "@isp/xdce-arch-core-base";
|
||||||
import {
|
import {
|
||||||
NbpFormContainerComponent,
|
AsyncValidatorArray, coerceBooleanProperty, DateValidator, EnabledRangeService, FormTouchService,
|
||||||
AsyncValidatorArray,
|
|
||||||
ValidatorArray,
|
|
||||||
FormTouchService,
|
|
||||||
NbpStyle,
|
|
||||||
WidgetMode,
|
|
||||||
NbpInputElementBase,
|
|
||||||
INbpInput,
|
|
||||||
} from "@isp/xdce-widget/base";
|
|
||||||
|
|
||||||
import { EnabledRangeService, NgbDate, NgbDateParserFormatterNOA11Y, NgbDatepickerI18nNOA11Y, NgbDateStruct, NgbInputDatepickerNOA11Y } from "@isp/xdce-widget";
|
|
||||||
|
|
||||||
import { DateValidator } from "@isp/xdce-widget";
|
|
||||||
|
|
||||||
import {
|
|
||||||
I18nNOA11Y,
|
I18nNOA11Y,
|
||||||
NbpDatepickerConfigurationNOA11Y,
|
INbpInput, NbpCalendarPattern,
|
||||||
NbpDatepickerItI18nNOA11Y,
|
NbpCalendarPosition, NbpDatepickerConfigurationNOA11Y,
|
||||||
|
NbpDatepickerItI18nNOA11Y, NbpDateSeparator, NbpFormContainerComponent,
|
||||||
|
NbpInputElementBase,
|
||||||
NbpItDateParserFormatterNOA11Y,
|
NbpItDateParserFormatterNOA11Y,
|
||||||
|
NbpStyle, NgbDate, NgbDateParserFormatterNOA11Y, NgbDatepickerI18nNOA11Y, NgbDateStruct, ValidatorArray,
|
||||||
|
WidgetMode
|
||||||
} from "@isp/xdce-widget";
|
} from "@isp/xdce-widget";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
import {
|
import { NgbFidInputDatepickerNOA11Y } from "./@ng-bootstrap-noa11y/datepicker/datepicker-input";
|
||||||
NbpCalendarPattern,
|
|
||||||
NbpCalendarPosition,
|
|
||||||
NbpDateSeparator,
|
|
||||||
} from "@isp/xdce-widget";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,8 +89,7 @@ let nextId = 0;
|
|||||||
})
|
})
|
||||||
export class NbpCalendarGenericComponentNOA11Y
|
export class NbpCalendarGenericComponentNOA11Y
|
||||||
extends NbpInputElementBase<any>
|
extends NbpInputElementBase<any>
|
||||||
implements INbpInput, AfterViewInit, OnDestroy
|
implements INbpInput, AfterViewInit, OnDestroy {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* (opzionale ) Boolean for keeping the value of the date
|
* (opzionale ) Boolean for keeping the value of the date
|
||||||
* when the input is disabled
|
* when the input is disabled
|
||||||
@ -385,8 +365,8 @@ export class NbpCalendarGenericComponentNOA11Y
|
|||||||
this._tax = value ? value : this._tax;
|
this._tax = value ? value : this._tax;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewChild("rplCalendar", { read: NgbInputDatepickerNOA11Y })
|
@ViewChild("rplCalendar", { read: NgbFidInputDatepickerNOA11Y })
|
||||||
rplCalendar: NgbInputDatepickerNOA11Y;
|
rplCalendar: NgbFidInputDatepickerNOA11Y;
|
||||||
@ViewChild(NgModel) model: NgModel;
|
@ViewChild(NgModel) model: NgModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -740,10 +720,10 @@ export class NbpCalendarGenericComponentNOA11Y
|
|||||||
private parseDateStructFromDate(value: Date) {
|
private parseDateStructFromDate(value: Date) {
|
||||||
return value && value instanceof Date
|
return value && value instanceof Date
|
||||||
? {
|
? {
|
||||||
day: value.getDate(),
|
day: value.getDate(),
|
||||||
month: value.getMonth() + 1,
|
month: value.getMonth() + 1,
|
||||||
year: value.getFullYear(),
|
year: value.getFullYear(),
|
||||||
}
|
}
|
||||||
: value;
|
: value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import { NG_ASYNC_VALIDATORS, NG_VALIDATORS, NG_VALUE_ACCESSOR } from '@angular/
|
|||||||
import { AsyncValidatorArray, FormTouchService, NbpFormContainerComponent, NbpInputElementBase, NbpInputElementBaseComponentA11YWrapper, NbpStyle, ValidatorArray } from '@isp/xdce-widget/base';
|
import { AsyncValidatorArray, FormTouchService, NbpFormContainerComponent, NbpInputElementBase, NbpInputElementBaseComponentA11YWrapper, NbpStyle, ValidatorArray } from '@isp/xdce-widget/base';
|
||||||
|
|
||||||
import { APPLICATION_CONTEXT_MANAGER, ApplicationContextManagerInterface, EventManager } from '@isp/xdce-arch-core-base';
|
import { APPLICATION_CONTEXT_MANAGER, ApplicationContextManagerInterface, EventManager } from '@isp/xdce-arch-core-base';
|
||||||
import { EnabledRangeService, NbpCalendarGenericComponent, NbpCalendarPattern, NbpDateSeparator, NgbDateStruct } from '@isp/xdce-widget';
|
import { EnabledRangeService, NbpCalendarPattern, NbpDateSeparator, NgbDateStruct } from '@isp/xdce-widget';
|
||||||
import { NbpCalendarGenericComponentA11Y } from './nbp-calendar-generic.component.a11y';
|
import { NbpCalendarGenericComponentA11Y } from './nbp-calendar-generic.component.a11y';
|
||||||
import { NbpCalendarGenericComponentNOA11Y } from './nbp-calendar-generic.component.noa11y';
|
import { NbpCalendarGenericComponentNOA11Y } from './nbp-calendar-generic.component.noa11y';
|
||||||
|
|
||||||
@ -14,13 +14,13 @@ import { NbpCalendarGenericComponentNOA11Y } from './nbp-calendar-generic.compon
|
|||||||
|
|
||||||
export const NBP_CALENDAR_CONTROL_VALUE_ACCESSOR: any = {
|
export const NBP_CALENDAR_CONTROL_VALUE_ACCESSOR: any = {
|
||||||
provide: NG_VALUE_ACCESSOR,
|
provide: NG_VALUE_ACCESSOR,
|
||||||
useExisting: forwardRef(() => NbpCalendarGenericComponent), // un riferimento al futuro componente corrente
|
useExisting: forwardRef(() => NbpFidCalendarGeneric), // un riferimento al futuro componente corrente
|
||||||
multi: true
|
multi: true
|
||||||
};
|
};
|
||||||
|
|
||||||
export const NBP_INPUT_CALENDAR_ELEMENT_BASE: any = {
|
export const NBP_INPUT_CALENDAR_ELEMENT_BASE: any = {
|
||||||
provide: NbpInputElementBase,
|
provide: NbpInputElementBase,
|
||||||
useExisting: forwardRef(() => NbpCalendarGenericComponent), // un riferimento al futuro componente corrente
|
useExisting: forwardRef(() => NbpFidCalendarGeneric), // un riferimento al futuro componente corrente
|
||||||
multi: true
|
multi: true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user