@sd-angular/core 1.0.1 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,6 @@ import { Subscription, merge } from 'rxjs';
26
26
  import { startWith } from 'rxjs/operators';
27
27
  import { SdSettingService } from '@sd-angular/core/setting';
28
28
  import hash from 'object-hash';
29
- import 'jquery-datetimepicker';
30
29
  import { MatSelectModule } from '@angular/material/select';
31
30
  import { MatCheckboxModule } from '@angular/material/checkbox';
32
31
  import { SdUtilityService } from '@sd-angular/core/utility';
@@ -2995,116 +2994,6 @@ SdGridSubInformation.propDecorators = {
2995
2994
  subItems: [{ type: Input }]
2996
2995
  };
2997
2996
 
2998
- // Document: https://xdsoft.net/jqplugins/datetimepicker/
2999
- class GridDatePickerControlComponent {
3000
- constructor(ref, deviceService) {
3001
- this.ref = ref;
3002
- this.initialized = false;
3003
- this.type = 'datetime';
3004
- this.sdChange = new EventEmitter();
3005
- this.modelChange = new EventEmitter();
3006
- this.onFocus = () => {
3007
- if (this.isMobileOrTablet) {
3008
- $(this.control.nativeElement).trigger('blur');
3009
- }
3010
- };
3011
- this.onChanges = () => {
3012
- this.date = this.pDate;
3013
- };
3014
- this.isMobileOrTablet = !deviceService.isDesktop();
3015
- }
3016
- set model(val) {
3017
- if (!Date.isDate(val)) {
3018
- this.pDate = null;
3019
- }
3020
- else {
3021
- if (this.type === 'datetime') {
3022
- this.pDate = Date.toFormat(val, 'dd/MM/yyyy HH:mm');
3023
- }
3024
- else if (this.type === 'date') {
3025
- this.pDate = Date.toFormat(val, 'dd/MM/yyyy');
3026
- }
3027
- else {
3028
- this.pDate = Date.toFormat(val, 'HH:mm');
3029
- }
3030
- }
3031
- if (this.initialized) {
3032
- this.onChanges();
3033
- }
3034
- this.ref.detectChanges();
3035
- }
3036
- ngOnInit() {
3037
- }
3038
- ngAfterViewInit() {
3039
- this.onChanges();
3040
- this.initialized = true;
3041
- this.setOption();
3042
- }
3043
- setOption() {
3044
- if (this.initialized) {
3045
- $(this.control.nativeElement).datetimepicker({
3046
- datepicker: this.type === 'datetime' || this.type === 'date',
3047
- timepicker: this.type === 'datetime' || this.type === 'time',
3048
- format: this.type === 'datetime' ? 'd/m/Y H:i' : (this.type === 'date' ? 'd/m/Y' : 'H:i'),
3049
- step: 15,
3050
- scrollMonth: false,
3051
- scrollTime: false,
3052
- scrollInput: false,
3053
- onChangeDateTime: (date) => {
3054
- if (!date && !this.date) {
3055
- return;
3056
- }
3057
- if (this.type === 'datetime') {
3058
- date = Date.toFormat(date, 'dd/MM/yyyy HH:mm');
3059
- }
3060
- else if (this.type === 'time') {
3061
- date = Date.toFormat(date, 'HH:mm');
3062
- }
3063
- else {
3064
- date = Date.toFormat(date, 'dd/MM/yyyy');
3065
- }
3066
- if (!this.equal(date, this.date)) {
3067
- this.model = this.parse(date);
3068
- this.modelChange.emit(this.parse(date));
3069
- this.sdChange.emit(this.parse(date));
3070
- }
3071
- this.ref.detectChanges();
3072
- }
3073
- });
3074
- }
3075
- }
3076
- parse(date) {
3077
- if (this.type === 'date') {
3078
- return Date.parseFrom(date, 'dd/MM/yyyy');
3079
- }
3080
- else if (this.type === 'time') {
3081
- return Date.parseFrom(date, 'HH:mm');
3082
- }
3083
- return Date.parseFrom(date, 'dd/MM/yyyy HH:mm');
3084
- }
3085
- equal(date1, date2) {
3086
- return Date.equal(this.parse(date1), this.parse(date2));
3087
- }
3088
- }
3089
- GridDatePickerControlComponent.decorators = [
3090
- { type: Component, args: [{
3091
- selector: 'sd-grid-date-picker-control',
3092
- template: "<div class=\"w-100 c-container\">\r\n <input #control class=\"form-control form-control-sm\" [ngModel]=\"date\" (focus)=\"onFocus()\">\r\n <i class=\"fa c-icon\" [ngClass]=\"{'fa-clock-o':type === 'time', 'fa-calendar':type !== 'time'}\"></i>\r\n</div>",
3093
- styles: [".c-container{position:relative}.c-icon{font-size:13px!important;position:absolute;right:7px;top:calc(50% - 6px)}"]
3094
- },] }
3095
- ];
3096
- GridDatePickerControlComponent.ctorParameters = () => [
3097
- { type: ChangeDetectorRef },
3098
- { type: DeviceDetectorService }
3099
- ];
3100
- GridDatePickerControlComponent.propDecorators = {
3101
- type: [{ type: Input }],
3102
- sdChange: [{ type: Output }],
3103
- model: [{ type: Input }],
3104
- modelChange: [{ type: Output }],
3105
- control: [{ type: ViewChild, args: ['control',] }]
3106
- };
3107
-
3108
2997
  class GridDesktopColumnChildrenViewComponent {
3109
2998
  constructor() { }
3110
2999
  }
@@ -3993,7 +3882,6 @@ SdGridModule.decorators = [
3993
3882
  SdGridPopupQuickFilterDetail,
3994
3883
  SdGridSubInformation,
3995
3884
  SdGridImportExcel,
3996
- GridDatePickerControlComponent,
3997
3885
  GridDesktopColumnChildrenViewComponent,
3998
3886
  CellDesktopClassNamePipe,
3999
3887
  CellMobileClassNamePipe,
@@ -4043,5 +3931,5 @@ class QuickFilter {
4043
3931
  * Generated bundle index. Do not edit.
4044
3932
  */
4045
3933
 
4046
- export { CellDesktopClassNamePipe, CellMobileClassNamePipe, ColumnCommandFilterPipe, ColumnHtmlTemplatePipe, ColumnTitlePipe, ColumnValuesPipe, CommandDisabledPipe, CommandFilterPipe, CommandHidden, CommandIconPipe, CommandTitlePipe, EditorDynamicItemPipe, EditorHandlerPipe, EditorPopupVisiblePipe, EditorSubInformationHandlerPipe, EditorValidatePipe, FilterMobilePipe, GRID_CONFIG, GridDatePickerControlComponent, GridDesktopColumnChildrenViewComponent, HandlerDotnet, HandlerLocal, MobileCommandFilterPipe, MobileViewHtmlTemplatePipe, QuickFilter, SdCellDefDirective, SdCellEditorDefDirective, SdCellFooterDevDirective, SdDynamicItems, SdGrid, SdGridConfig, SdGridDesktopColumnEdit, SdGridDesktopColumnView, SdGridDesktopInlineFilter, SdGridImportExcel, SdGridMobileItemView, SdGridModule, SdGridPopupEditor, SdGridPopupExportExcel, SdGridPopupFilter, SdGridPopupQuickFilterDetail, SdGridSubInformation, SdSubHeaderDefDirective, ValueTransformPipe, defaultGridOption };
3934
+ export { CellDesktopClassNamePipe, CellMobileClassNamePipe, ColumnCommandFilterPipe, ColumnHtmlTemplatePipe, ColumnTitlePipe, ColumnValuesPipe, CommandDisabledPipe, CommandFilterPipe, CommandHidden, CommandIconPipe, CommandTitlePipe, EditorDynamicItemPipe, EditorHandlerPipe, EditorPopupVisiblePipe, EditorSubInformationHandlerPipe, EditorValidatePipe, FilterMobilePipe, GRID_CONFIG, GridDesktopColumnChildrenViewComponent, HandlerDotnet, HandlerLocal, MobileCommandFilterPipe, MobileViewHtmlTemplatePipe, QuickFilter, SdCellDefDirective, SdCellEditorDefDirective, SdCellFooterDevDirective, SdDynamicItems, SdGrid, SdGridConfig, SdGridDesktopColumnEdit, SdGridDesktopColumnView, SdGridDesktopInlineFilter, SdGridImportExcel, SdGridMobileItemView, SdGridModule, SdGridPopupEditor, SdGridPopupExportExcel, SdGridPopupFilter, SdGridPopupQuickFilterDetail, SdGridSubInformation, SdSubHeaderDefDirective, ValueTransformPipe, defaultGridOption };
4047
3935
  //# sourceMappingURL=sd-angular-core-grid.js.map