inviton-powerduck 0.0.204 → 0.0.206

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.
@@ -21,11 +21,54 @@ export default class ScrollUtils {
21
21
  (PowerduckState as any)._lastValidationScroll = now;
22
22
  }
23
23
 
24
- this.scrollToElem(scrollContext.first()[0]);
24
+ ScrollUtils.scrollIntoViewWithOffset(
25
+ scrollContext.first()[0],
26
+ 10,
27
+ 'smooth',
28
+ );
25
29
  }
26
30
  }, 10);
27
31
  }
28
32
 
33
+ static scrollIntoViewWithOffset(
34
+ elem,
35
+ offset = 0,
36
+ behavior: ScrollBehavior = 'smooth',
37
+ ) {
38
+ if (!elem) {
39
+ return;
40
+ }
41
+
42
+ // Find the nearest scrollable parent
43
+ let scrollParent = elem.parentElement;
44
+ while (scrollParent) {
45
+ const overflowY = getComputedStyle(scrollParent).overflowY;
46
+ if (overflowY === 'auto' || overflowY === 'scroll') {
47
+ break;
48
+ }
49
+
50
+ scrollParent = scrollParent.parentElement;
51
+ }
52
+
53
+ // Fallback to window scroll if no scrollable parent
54
+ if (!scrollParent) {
55
+ const elemTop = elem.getBoundingClientRect().top + window.pageYOffset;
56
+ window.scrollTo({
57
+ top: elemTop - offset,
58
+ behavior,
59
+ });
60
+ } else {
61
+ const parentRect = scrollParent.getBoundingClientRect();
62
+ const elemRect = elem.getBoundingClientRect();
63
+ const top = elemRect.top - parentRect.top + scrollParent.scrollTop;
64
+
65
+ scrollParent.scrollTo({
66
+ top: top - offset,
67
+ behavior,
68
+ });
69
+ }
70
+ }
71
+
29
72
  /**
30
73
  * Scrolls to element
31
74
  * @param elem
@@ -1,3 +1,6 @@
1
+ /* eslint-disable node/handle-callback-err */
2
+ /* eslint-disable no-new */
3
+ /* eslint-disable ts/no-this-alias */
1
4
  import type { Temporal } from '@js-temporal/polyfill';
2
5
  import type { IWebApiClient, WebClientApiMethod } from '../../common/IWebClient';
3
6
  import type { DropdownButtonItemArgs } from '../dropdown-button/dropdown-button-item';
@@ -350,6 +353,7 @@ export class DataTableFilterItemCollection extends Array<DataTableFilterItem> {
350
353
 
351
354
  export class DataTableConfig {
352
355
  static filterMarking = true;
356
+ static defaultMobileBehavior = DataTableMobileBehavior.MobileLayout;
353
357
  }
354
358
 
355
359
  @Component
@@ -542,7 +546,6 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
542
546
 
543
547
  if (!this.initialized && !this.initDataLoaded) {
544
548
  this.initDataLoaded = true;
545
- const self = this;
546
549
  this.reloadDataPromise().then(() => {
547
550
  setTimeout(() => {
548
551
  this.initialized = true;
@@ -1813,7 +1816,7 @@ class DataTableComponent extends TsxComponent<DataTableArgs> implements DataTabl
1813
1816
  }
1814
1817
 
1815
1818
  getMobileBehavior(): DataTableMobileBehavior {
1816
- return this.currentMobileBehavior || DataTableMobileBehavior.MobileLayout;
1819
+ return this.currentMobileBehavior ?? DataTableConfig.defaultMobileBehavior;
1817
1820
  }
1818
1821
 
1819
1822
  getVisibleColumns(): TableColumn[] {
@@ -9,34 +9,34 @@
9
9
  padding-bottom: 20px;
10
10
  }
11
11
 
12
- .modal-header.modal-has-headericon > h5 {
12
+ .modal-header.modal-has-headericon>h5 {
13
13
  display: flex;
14
14
  width: 100%;
15
15
  min-height: 60px;
16
16
  align-items: center;
17
17
  }
18
18
 
19
- .modal-header.modal-has-headericon > .modal-header-icon {
19
+ .modal-header.modal-has-headericon>.modal-header-icon {
20
20
  position: absolute;
21
21
  top: 0;
22
22
  left: 22px;
23
23
  }
24
24
 
25
- .modal-header.modal-has-headericon > .modal-header-icon .swal2-transform-resize {
25
+ .modal-header.modal-has-headericon>.modal-header-icon .swal2-transform-resize {
26
26
  transform: scale(0.75);
27
27
  }
28
28
 
29
- .modal-header.modal-has-headericon > .modal-header-icon .swal2-transform-resize.swal2-icon,
30
- .modal-header.modal-has-headericon > .modal-header-icon .swal2-transform-resize .swal2-icon {
29
+ .modal-header.modal-has-headericon>.modal-header-icon .swal2-transform-resize.swal2-icon,
30
+ .modal-header.modal-has-headericon>.modal-header-icon .swal2-transform-resize .swal2-icon {
31
31
  margin-top: 10px;
32
32
  margin-left: -10px;
33
33
  }
34
34
 
35
- .modal-header.modal-has-headericon > .modal-header-icon .swal2-transform-resize .success-icon-stub {
35
+ .modal-header.modal-has-headericon>.modal-header-icon .swal2-transform-resize .success-icon-stub {
36
36
  border-color: #b9f0b7;
37
37
  }
38
38
 
39
- .modal-header.modal-has-headericon > .modal-header-icon .swal2-standard-resize {
39
+ .modal-header.modal-has-headericon>.modal-header-icon .swal2-standard-resize {
40
40
  font-size: 40px;
41
41
  line-height: 60px;
42
42
  text-align: center;
@@ -44,7 +44,7 @@
44
44
  height: 60px;
45
45
  }
46
46
 
47
- .modal-header.modal-has-headericon > .modal-header-icon > .swal2-icon {
47
+ .modal-header.modal-has-headericon>.modal-header-icon>.swal2-icon {
48
48
  overflow: hidden;
49
49
  }
50
50
 
@@ -73,6 +73,9 @@
73
73
  .modal-bottom-sheet .modal-dialog .modal-content {
74
74
  border-top-left-radius: 16px;
75
75
  border-top-right-radius: 16px;
76
+ border-bottom-left-radius: 0;
77
+ border-bottom-right-radius: 0;
78
+ max-height: calc(100dvh - 10px);
76
79
  padding-top: 0;
77
80
  }
78
81
 
@@ -124,7 +127,6 @@
124
127
  }
125
128
 
126
129
  .modal.modal-bottom-sheet .modal-body {
127
- max-height: 80vh;
128
130
  overflow: auto;
129
131
  }
130
132
 
@@ -148,4 +150,4 @@
148
150
  z-index: 1;
149
151
  background: inherit;
150
152
  }
151
- }
153
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "inviton-powerduck",
3
3
  "type": "module",
4
- "version": "0.0.204",
4
+ "version": "0.0.206",
5
5
  "files": [
6
6
  "app/",
7
7
  "common/",