inviton-powerduck 0.0.122 → 0.0.124

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.
@@ -59,7 +59,7 @@ export interface DaterangeChangedArgs {
59
59
  endTime: DateWrapper;
60
60
  }
61
61
 
62
- const DATE_FORMAT_FOR_RANGE_PICKER = (function () {
62
+ const DATE_FORMAT_FOR_RANGE_PICKER = (() => {
63
63
  const dummyDate = new Date(Date.UTC(
64
64
  2022,
65
65
  11,
@@ -488,6 +488,18 @@ class DaterangePickerComponent extends TsxComponent<DaterangePickerArgs> impleme
488
488
  });
489
489
  }
490
490
 
491
+ shouldAddModalClick() {
492
+ if (!PortalUtils.treatAsMobileDevice()) {
493
+ return false;
494
+ }
495
+
496
+ if (this.calendarPlacement == 'input-container-leftalign' || this.calendarPlacement == 'input-container-rightalign') {
497
+ return false;
498
+ }
499
+
500
+ return true;
501
+ }
502
+
491
503
  clearValue() {
492
504
  this._startDate = null;
493
505
  this._endDate = null;
@@ -500,8 +512,9 @@ class DaterangePickerComponent extends TsxComponent<DaterangePickerArgs> impleme
500
512
  render(h) {
501
513
  return (
502
514
  <FormItemWrapper label={this.label} cssClass={this.getCssClass()} mandatory={this.mandatory} wrap={this.wrap} appendIcon={this.appendIcon} prependIcon={this.prependIcon} hint={this.hint} marginType={this.marginType} appendClicked={this.appendClicked} prependClicked={this.prependClicked} prependIconClicked={this.prependIconClicked} appendIconClicked={this.appendIconClicked} validationState={this.validationState} labelButtons={this.labelButtons} subtitle={this.subtitle}>
503
- {PortalUtils.treatAsMobileDevice()
504
- && <div class="pd-daterange-picker-modalclick" onClick={(e) => { this.handleModalOpenClick(e); }}></div>}
515
+ {this.shouldAddModalClick()
516
+ && <div class="pd-daterange-picker-modalclick" onClick={(e) => { this.handleModalOpenClick(e); }}></div>}
517
+
505
518
  <div style="position: relative; display: flex; align-items: center;">
506
519
  {' '}
507
520
  {/* Added a wrapper for input and clear button */}
@@ -317,10 +317,10 @@ import './daterangepicker.css';
317
317
  leftOffset: null,
318
318
  showShortcuts: false,
319
319
  shortcuts: {
320
- // 'prev-days': [1,3,5,7],
321
- // 'next-days': [3,5,7],
322
- // 'prev' : ['week','month','year'],
323
- // 'next' : ['week','month','year']
320
+ // 'prev-days': [1,3,5,7],
321
+ // 'next-days': [3,5,7],
322
+ // 'prev' : ['week','month','year'],
323
+ // 'next' : ['week','month','year']
324
324
  },
325
325
  customShortcuts: [],
326
326
  calendarPlacement: 'body',
@@ -954,6 +954,10 @@ import './daterangepicker.css';
954
954
  }
955
955
 
956
956
  function changeTime(name: 'start' | 'end', date: DateWrapper) {
957
+ if ((date as any)?._dte == null) {
958
+ date = new DateWrapper(date);
959
+ }
960
+
957
961
  opt[name] = new DateWrapper(
958
962
  date.getFullYear(),
959
963
  date.getMonth(),
@@ -1866,14 +1870,12 @@ import './daterangepicker.css';
1866
1870
  + ` <thead>`
1867
1871
  + ` <tr class="caption">`
1868
1872
  + ` <th style="width:27px;">`
1869
- + ` <span class="prev">${
1870
- arrowPrev
1873
+ + ` <span class="prev">${arrowPrev
1871
1874
  } </span>`
1872
1875
  + ` </th>`
1873
1876
  + ` <th colspan="${_colspan}" class="month-name">`
1874
1877
  + ` </th>`
1875
- + ` <th style="width:27px;">${
1876
- opt.singleDate || !opt.stickyMonths ? `<span class="next">${arrowNext}</span>` : ''
1878
+ + ` <th style="width:27px;">${opt.singleDate || !opt.stickyMonths ? `<span class="next">${arrowNext}</span>` : ''
1877
1879
  } </th>`
1878
1880
  + ` </tr>`
1879
1881
  + ` <tr class="week-name">${getWeekHead()
@@ -1885,8 +1887,7 @@ import './daterangepicker.css';
1885
1887
  + `<table class="month2" cellspacing="0" border="0" cellpadding="0">`
1886
1888
  + ` <thead>`
1887
1889
  + ` <tr class="caption">`
1888
- + ` <th style="width:27px;">${
1889
- !opt.stickyMonths ? `<span class="prev">${arrowPrev}</span>` : ''
1890
+ + ` <th style="width:27px;">${!opt.stickyMonths ? `<span class="prev">${arrowPrev}</span>` : ''
1890
1891
  } </th>`
1891
1892
  + ` <th colspan="${_colspan}" class="month-name">`
1892
1893
  + ` </th>`
@@ -2288,4 +2289,4 @@ import './daterangepicker.css';
2288
2289
  showGap();
2289
2290
  }
2290
2291
  };
2291
- })($);
2292
+ })($);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "inviton-powerduck",
3
3
  "type": "module",
4
- "version": "0.0.122",
4
+ "version": "0.0.124",
5
5
  "files": [
6
6
  "app/",
7
7
  "common/",