@sankhyalabs/ezui 5.20.0-dev.40 → 5.20.0-dev.41

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.
@@ -120825,21 +120825,29 @@ const EzGrid = class {
120825
120825
  return newConfig;
120826
120826
  }
120827
120827
  positionSelectionCounter() {
120828
- var _a;
120829
- if (this._gridSelectionCounter == undefined) {
120828
+ var _a, _b;
120829
+ if (!this._gridSelectionCounter)
120830
120830
  return;
120831
- }
120832
- if (this._showSelectionCounter) {
120833
- const boundingContainer = (_a = this._container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
120834
- if (boundingContainer == undefined) {
120835
- return;
120836
- }
120837
- const limitBottom = boundingContainer.bottom - 30;
120838
- this._gridSelectionCounter.style.bottom = document.body.clientHeight - limitBottom + 'px';
120839
- }
120840
- else {
120831
+ if (!this._showSelectionCounter) {
120841
120832
  this._gridSelectionCounter.style.bottom = '';
120833
+ return;
120842
120834
  }
120835
+ const containerRect = (_a = this._container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
120836
+ const selectionRect = (_b = this._gridSelectionCounter) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
120837
+ if (!containerRect || !selectionRect)
120838
+ return;
120839
+ const positionBottom = containerRect.bottom - 30;
120840
+ this._gridSelectionCounter.style.bottom = document.body.clientHeight - positionBottom + 'px';
120841
+ this._gridSelectionCounter.style.left = this.calculatePositionLeft(containerRect, selectionRect);
120842
+ }
120843
+ calculatePositionLeft(containerRect, selectionRect) {
120844
+ let selectionStart = containerRect.left + (containerRect.width / 2);
120845
+ const containerRightEdge = containerRect.left + this._container.clientWidth;
120846
+ const selectionEnd = (selectionStart - (selectionRect.width / 2)) + selectionRect.width;
120847
+ if (selectionEnd > containerRightEdge) {
120848
+ selectionStart = containerRightEdge - (selectionRect.width / 2);
120849
+ }
120850
+ return `${selectionStart}px`;
120843
120851
  }
120844
120852
  setEvents() {
120845
120853
  window.removeEventListener('scroll', this.positionSelectionCounter.bind(this));
@@ -76,22 +76,38 @@ const EzSplitButton = class {
76
76
  evt.stopPropagation();
77
77
  this.closeDropdown();
78
78
  }
79
+ resolveOffsetParentRect() {
80
+ var _a, _b;
81
+ const offsetParentRect = (_b = (_a = this.dropdownParent) === null || _a === void 0 ? void 0 : _a.offsetParent) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
82
+ const scrollLeft = window.scrollX || document.documentElement.scrollLeft;
83
+ const scrollTop = window.scrollY || document.documentElement.scrollTop;
84
+ const rectWithoutScroll = {
85
+ top: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.top) + scrollTop,
86
+ left: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.left) + scrollLeft,
87
+ bottom: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.bottom) + scrollTop,
88
+ right: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.right) + scrollLeft,
89
+ width: offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.width,
90
+ height: offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.height
91
+ };
92
+ this.offsetParentRect = rectWithoutScroll;
93
+ }
79
94
  /**
80
95
  * Método responsável em posicionar o dropdown na tela.
81
96
  * Faz com que o dropdown se ajuste automaticamente ao espaco na tela
82
97
  */
83
98
  positionDropdown() {
99
+ var _a, _b, _c, _d, _e, _f;
84
100
  const { rightButton: _rightButton, dropdownParent: _dropdownParent } = this;
85
101
  const rightButtonRect = _rightButton.getBoundingClientRect();
86
102
  const dropdownParentRect = _dropdownParent.getBoundingClientRect();
87
- const spaceBelow = window.innerHeight - rightButtonRect.bottom;
88
- const spaceAbove = rightButtonRect.top;
89
- const spaceRight = window.innerWidth - rightButtonRect.right;
103
+ const spaceBelow = window.innerHeight - (rightButtonRect.bottom + ((_a = this.offsetParentRect) === null || _a === void 0 ? void 0 : _a.top));
104
+ const spaceAbove = rightButtonRect.top + ((_b = this.offsetParentRect) === null || _b === void 0 ? void 0 : _b.top);
105
+ const spaceRight = window.innerWidth - (rightButtonRect.left + ((_c = this.offsetParentRect) === null || _c === void 0 ? void 0 : _c.left));
90
106
  const spaceLeft = rightButtonRect.left;
91
107
  const hasSpaceBelow = spaceBelow < dropdownParentRect.height && spaceAbove > dropdownParentRect.height;
92
108
  const hasSpaceRight = spaceRight < dropdownParentRect.width && spaceLeft > dropdownParentRect.width;
93
- let top = `${rightButtonRect.bottom + window.scrollY}px`;
94
- let left = `${rightButtonRect.left + window.scrollX}px`;
109
+ let top = `${rightButtonRect.bottom - ((_d = this.offsetParentRect) === null || _d === void 0 ? void 0 : _d.top) + window.scrollY}px`;
110
+ let left = `${rightButtonRect.left - ((_e = this.offsetParentRect) === null || _e === void 0 ? void 0 : _e.left) + window.scrollX}px`;
95
111
  let bottom = 'auto';
96
112
  if (hasSpaceBelow) {
97
113
  bottom = `${window.innerHeight - rightButtonRect.top - window.scrollY}px`;
@@ -99,7 +115,7 @@ const EzSplitButton = class {
99
115
  _dropdownParent.style.maxHeight = `${spaceAbove}px`;
100
116
  }
101
117
  if (hasSpaceRight) {
102
- left = `${rightButtonRect.right - dropdownParentRect.width + window.scrollX}px`;
118
+ left = `${rightButtonRect.right - dropdownParentRect.width - ((_f = this.offsetParentRect) === null || _f === void 0 ? void 0 : _f.left) + window.scrollX}px`;
103
119
  }
104
120
  _dropdownParent.style.top = top;
105
121
  _dropdownParent.style.bottom = bottom;
@@ -112,6 +128,9 @@ const EzSplitButton = class {
112
128
  componentWillLoad() {
113
129
  this.setEvents();
114
130
  }
131
+ componentWillRender() {
132
+ this.resolveOffsetParentRect();
133
+ }
115
134
  componentDidLoad() {
116
135
  if (this._element)
117
136
  core.ElementIDUtils.addIDInfo(this._element);
@@ -152,21 +152,29 @@ export class EzGrid {
152
152
  return newConfig;
153
153
  }
154
154
  positionSelectionCounter() {
155
- var _a;
156
- if (this._gridSelectionCounter == undefined) {
155
+ var _a, _b;
156
+ if (!this._gridSelectionCounter)
157
157
  return;
158
- }
159
- if (this._showSelectionCounter) {
160
- const boundingContainer = (_a = this._container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
161
- if (boundingContainer == undefined) {
162
- return;
163
- }
164
- const limitBottom = boundingContainer.bottom - 30;
165
- this._gridSelectionCounter.style.bottom = document.body.clientHeight - limitBottom + 'px';
166
- }
167
- else {
158
+ if (!this._showSelectionCounter) {
168
159
  this._gridSelectionCounter.style.bottom = '';
160
+ return;
161
+ }
162
+ const containerRect = (_a = this._container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
163
+ const selectionRect = (_b = this._gridSelectionCounter) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
164
+ if (!containerRect || !selectionRect)
165
+ return;
166
+ const positionBottom = containerRect.bottom - 30;
167
+ this._gridSelectionCounter.style.bottom = document.body.clientHeight - positionBottom + 'px';
168
+ this._gridSelectionCounter.style.left = this.calculatePositionLeft(containerRect, selectionRect);
169
+ }
170
+ calculatePositionLeft(containerRect, selectionRect) {
171
+ let selectionStart = containerRect.left + (containerRect.width / 2);
172
+ const containerRightEdge = containerRect.left + this._container.clientWidth;
173
+ const selectionEnd = (selectionStart - (selectionRect.width / 2)) + selectionRect.width;
174
+ if (selectionEnd > containerRightEdge) {
175
+ selectionStart = containerRightEdge - (selectionRect.width / 2);
169
176
  }
177
+ return `${selectionStart}px`;
170
178
  }
171
179
  setEvents() {
172
180
  window.removeEventListener('scroll', this.positionSelectionCounter.bind(this));
@@ -65,22 +65,38 @@ export class EzSplitButton {
65
65
  evt.stopPropagation();
66
66
  this.closeDropdown();
67
67
  }
68
+ resolveOffsetParentRect() {
69
+ var _a, _b;
70
+ const offsetParentRect = (_b = (_a = this.dropdownParent) === null || _a === void 0 ? void 0 : _a.offsetParent) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
71
+ const scrollLeft = window.scrollX || document.documentElement.scrollLeft;
72
+ const scrollTop = window.scrollY || document.documentElement.scrollTop;
73
+ const rectWithoutScroll = {
74
+ top: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.top) + scrollTop,
75
+ left: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.left) + scrollLeft,
76
+ bottom: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.bottom) + scrollTop,
77
+ right: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.right) + scrollLeft,
78
+ width: offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.width,
79
+ height: offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.height
80
+ };
81
+ this.offsetParentRect = rectWithoutScroll;
82
+ }
68
83
  /**
69
84
  * Método responsável em posicionar o dropdown na tela.
70
85
  * Faz com que o dropdown se ajuste automaticamente ao espaco na tela
71
86
  */
72
87
  positionDropdown() {
88
+ var _a, _b, _c, _d, _e, _f;
73
89
  const { rightButton: _rightButton, dropdownParent: _dropdownParent } = this;
74
90
  const rightButtonRect = _rightButton.getBoundingClientRect();
75
91
  const dropdownParentRect = _dropdownParent.getBoundingClientRect();
76
- const spaceBelow = window.innerHeight - rightButtonRect.bottom;
77
- const spaceAbove = rightButtonRect.top;
78
- const spaceRight = window.innerWidth - rightButtonRect.right;
92
+ const spaceBelow = window.innerHeight - (rightButtonRect.bottom + ((_a = this.offsetParentRect) === null || _a === void 0 ? void 0 : _a.top));
93
+ const spaceAbove = rightButtonRect.top + ((_b = this.offsetParentRect) === null || _b === void 0 ? void 0 : _b.top);
94
+ const spaceRight = window.innerWidth - (rightButtonRect.left + ((_c = this.offsetParentRect) === null || _c === void 0 ? void 0 : _c.left));
79
95
  const spaceLeft = rightButtonRect.left;
80
96
  const hasSpaceBelow = spaceBelow < dropdownParentRect.height && spaceAbove > dropdownParentRect.height;
81
97
  const hasSpaceRight = spaceRight < dropdownParentRect.width && spaceLeft > dropdownParentRect.width;
82
- let top = `${rightButtonRect.bottom + window.scrollY}px`;
83
- let left = `${rightButtonRect.left + window.scrollX}px`;
98
+ let top = `${rightButtonRect.bottom - ((_d = this.offsetParentRect) === null || _d === void 0 ? void 0 : _d.top) + window.scrollY}px`;
99
+ let left = `${rightButtonRect.left - ((_e = this.offsetParentRect) === null || _e === void 0 ? void 0 : _e.left) + window.scrollX}px`;
84
100
  let bottom = 'auto';
85
101
  if (hasSpaceBelow) {
86
102
  bottom = `${window.innerHeight - rightButtonRect.top - window.scrollY}px`;
@@ -88,7 +104,7 @@ export class EzSplitButton {
88
104
  _dropdownParent.style.maxHeight = `${spaceAbove}px`;
89
105
  }
90
106
  if (hasSpaceRight) {
91
- left = `${rightButtonRect.right - dropdownParentRect.width + window.scrollX}px`;
107
+ left = `${rightButtonRect.right - dropdownParentRect.width - ((_f = this.offsetParentRect) === null || _f === void 0 ? void 0 : _f.left) + window.scrollX}px`;
92
108
  }
93
109
  _dropdownParent.style.top = top;
94
110
  _dropdownParent.style.bottom = bottom;
@@ -101,6 +117,9 @@ export class EzSplitButton {
101
117
  componentWillLoad() {
102
118
  this.setEvents();
103
119
  }
120
+ componentWillRender() {
121
+ this.resolveOffsetParentRect();
122
+ }
104
123
  componentDidLoad() {
105
124
  if (this._element)
106
125
  ElementIDUtils.addIDInfo(this._element);
@@ -125738,21 +125738,29 @@ const EzGrid$1 = class extends HTMLElement$1 {
125738
125738
  return newConfig;
125739
125739
  }
125740
125740
  positionSelectionCounter() {
125741
- var _a;
125742
- if (this._gridSelectionCounter == undefined) {
125741
+ var _a, _b;
125742
+ if (!this._gridSelectionCounter)
125743
125743
  return;
125744
- }
125745
- if (this._showSelectionCounter) {
125746
- const boundingContainer = (_a = this._container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
125747
- if (boundingContainer == undefined) {
125748
- return;
125749
- }
125750
- const limitBottom = boundingContainer.bottom - 30;
125751
- this._gridSelectionCounter.style.bottom = document.body.clientHeight - limitBottom + 'px';
125752
- }
125753
- else {
125744
+ if (!this._showSelectionCounter) {
125754
125745
  this._gridSelectionCounter.style.bottom = '';
125746
+ return;
125747
+ }
125748
+ const containerRect = (_a = this._container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
125749
+ const selectionRect = (_b = this._gridSelectionCounter) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
125750
+ if (!containerRect || !selectionRect)
125751
+ return;
125752
+ const positionBottom = containerRect.bottom - 30;
125753
+ this._gridSelectionCounter.style.bottom = document.body.clientHeight - positionBottom + 'px';
125754
+ this._gridSelectionCounter.style.left = this.calculatePositionLeft(containerRect, selectionRect);
125755
+ }
125756
+ calculatePositionLeft(containerRect, selectionRect) {
125757
+ let selectionStart = containerRect.left + (containerRect.width / 2);
125758
+ const containerRightEdge = containerRect.left + this._container.clientWidth;
125759
+ const selectionEnd = (selectionStart - (selectionRect.width / 2)) + selectionRect.width;
125760
+ if (selectionEnd > containerRightEdge) {
125761
+ selectionStart = containerRightEdge - (selectionRect.width / 2);
125755
125762
  }
125763
+ return `${selectionStart}px`;
125756
125764
  }
125757
125765
  setEvents() {
125758
125766
  window.removeEventListener('scroll', this.positionSelectionCounter.bind(this));
@@ -128461,22 +128469,38 @@ const EzSplitButton$1 = class extends HTMLElement$1 {
128461
128469
  evt.stopPropagation();
128462
128470
  this.closeDropdown();
128463
128471
  }
128472
+ resolveOffsetParentRect() {
128473
+ var _a, _b;
128474
+ const offsetParentRect = (_b = (_a = this.dropdownParent) === null || _a === void 0 ? void 0 : _a.offsetParent) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
128475
+ const scrollLeft = window.scrollX || document.documentElement.scrollLeft;
128476
+ const scrollTop = window.scrollY || document.documentElement.scrollTop;
128477
+ const rectWithoutScroll = {
128478
+ top: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.top) + scrollTop,
128479
+ left: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.left) + scrollLeft,
128480
+ bottom: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.bottom) + scrollTop,
128481
+ right: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.right) + scrollLeft,
128482
+ width: offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.width,
128483
+ height: offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.height
128484
+ };
128485
+ this.offsetParentRect = rectWithoutScroll;
128486
+ }
128464
128487
  /**
128465
128488
  * Método responsável em posicionar o dropdown na tela.
128466
128489
  * Faz com que o dropdown se ajuste automaticamente ao espaco na tela
128467
128490
  */
128468
128491
  positionDropdown() {
128492
+ var _a, _b, _c, _d, _e, _f;
128469
128493
  const { rightButton: _rightButton, dropdownParent: _dropdownParent } = this;
128470
128494
  const rightButtonRect = _rightButton.getBoundingClientRect();
128471
128495
  const dropdownParentRect = _dropdownParent.getBoundingClientRect();
128472
- const spaceBelow = window.innerHeight - rightButtonRect.bottom;
128473
- const spaceAbove = rightButtonRect.top;
128474
- const spaceRight = window.innerWidth - rightButtonRect.right;
128496
+ const spaceBelow = window.innerHeight - (rightButtonRect.bottom + ((_a = this.offsetParentRect) === null || _a === void 0 ? void 0 : _a.top));
128497
+ const spaceAbove = rightButtonRect.top + ((_b = this.offsetParentRect) === null || _b === void 0 ? void 0 : _b.top);
128498
+ const spaceRight = window.innerWidth - (rightButtonRect.left + ((_c = this.offsetParentRect) === null || _c === void 0 ? void 0 : _c.left));
128475
128499
  const spaceLeft = rightButtonRect.left;
128476
128500
  const hasSpaceBelow = spaceBelow < dropdownParentRect.height && spaceAbove > dropdownParentRect.height;
128477
128501
  const hasSpaceRight = spaceRight < dropdownParentRect.width && spaceLeft > dropdownParentRect.width;
128478
- let top = `${rightButtonRect.bottom + window.scrollY}px`;
128479
- let left = `${rightButtonRect.left + window.scrollX}px`;
128502
+ let top = `${rightButtonRect.bottom - ((_d = this.offsetParentRect) === null || _d === void 0 ? void 0 : _d.top) + window.scrollY}px`;
128503
+ let left = `${rightButtonRect.left - ((_e = this.offsetParentRect) === null || _e === void 0 ? void 0 : _e.left) + window.scrollX}px`;
128480
128504
  let bottom = 'auto';
128481
128505
  if (hasSpaceBelow) {
128482
128506
  bottom = `${window.innerHeight - rightButtonRect.top - window.scrollY}px`;
@@ -128484,7 +128508,7 @@ const EzSplitButton$1 = class extends HTMLElement$1 {
128484
128508
  _dropdownParent.style.maxHeight = `${spaceAbove}px`;
128485
128509
  }
128486
128510
  if (hasSpaceRight) {
128487
- left = `${rightButtonRect.right - dropdownParentRect.width + window.scrollX}px`;
128511
+ left = `${rightButtonRect.right - dropdownParentRect.width - ((_f = this.offsetParentRect) === null || _f === void 0 ? void 0 : _f.left) + window.scrollX}px`;
128488
128512
  }
128489
128513
  _dropdownParent.style.top = top;
128490
128514
  _dropdownParent.style.bottom = bottom;
@@ -128497,6 +128521,9 @@ const EzSplitButton$1 = class extends HTMLElement$1 {
128497
128521
  componentWillLoad() {
128498
128522
  this.setEvents();
128499
128523
  }
128524
+ componentWillRender() {
128525
+ this.resolveOffsetParentRect();
128526
+ }
128500
128527
  componentDidLoad() {
128501
128528
  if (this._element)
128502
128529
  ElementIDUtils.addIDInfo(this._element);
@@ -120821,21 +120821,29 @@ const EzGrid = class {
120821
120821
  return newConfig;
120822
120822
  }
120823
120823
  positionSelectionCounter() {
120824
- var _a;
120825
- if (this._gridSelectionCounter == undefined) {
120824
+ var _a, _b;
120825
+ if (!this._gridSelectionCounter)
120826
120826
  return;
120827
- }
120828
- if (this._showSelectionCounter) {
120829
- const boundingContainer = (_a = this._container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
120830
- if (boundingContainer == undefined) {
120831
- return;
120832
- }
120833
- const limitBottom = boundingContainer.bottom - 30;
120834
- this._gridSelectionCounter.style.bottom = document.body.clientHeight - limitBottom + 'px';
120835
- }
120836
- else {
120827
+ if (!this._showSelectionCounter) {
120837
120828
  this._gridSelectionCounter.style.bottom = '';
120829
+ return;
120838
120830
  }
120831
+ const containerRect = (_a = this._container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
120832
+ const selectionRect = (_b = this._gridSelectionCounter) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
120833
+ if (!containerRect || !selectionRect)
120834
+ return;
120835
+ const positionBottom = containerRect.bottom - 30;
120836
+ this._gridSelectionCounter.style.bottom = document.body.clientHeight - positionBottom + 'px';
120837
+ this._gridSelectionCounter.style.left = this.calculatePositionLeft(containerRect, selectionRect);
120838
+ }
120839
+ calculatePositionLeft(containerRect, selectionRect) {
120840
+ let selectionStart = containerRect.left + (containerRect.width / 2);
120841
+ const containerRightEdge = containerRect.left + this._container.clientWidth;
120842
+ const selectionEnd = (selectionStart - (selectionRect.width / 2)) + selectionRect.width;
120843
+ if (selectionEnd > containerRightEdge) {
120844
+ selectionStart = containerRightEdge - (selectionRect.width / 2);
120845
+ }
120846
+ return `${selectionStart}px`;
120839
120847
  }
120840
120848
  setEvents() {
120841
120849
  window.removeEventListener('scroll', this.positionSelectionCounter.bind(this));
@@ -72,22 +72,38 @@ const EzSplitButton = class {
72
72
  evt.stopPropagation();
73
73
  this.closeDropdown();
74
74
  }
75
+ resolveOffsetParentRect() {
76
+ var _a, _b;
77
+ const offsetParentRect = (_b = (_a = this.dropdownParent) === null || _a === void 0 ? void 0 : _a.offsetParent) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
78
+ const scrollLeft = window.scrollX || document.documentElement.scrollLeft;
79
+ const scrollTop = window.scrollY || document.documentElement.scrollTop;
80
+ const rectWithoutScroll = {
81
+ top: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.top) + scrollTop,
82
+ left: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.left) + scrollLeft,
83
+ bottom: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.bottom) + scrollTop,
84
+ right: (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.right) + scrollLeft,
85
+ width: offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.width,
86
+ height: offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.height
87
+ };
88
+ this.offsetParentRect = rectWithoutScroll;
89
+ }
75
90
  /**
76
91
  * Método responsável em posicionar o dropdown na tela.
77
92
  * Faz com que o dropdown se ajuste automaticamente ao espaco na tela
78
93
  */
79
94
  positionDropdown() {
95
+ var _a, _b, _c, _d, _e, _f;
80
96
  const { rightButton: _rightButton, dropdownParent: _dropdownParent } = this;
81
97
  const rightButtonRect = _rightButton.getBoundingClientRect();
82
98
  const dropdownParentRect = _dropdownParent.getBoundingClientRect();
83
- const spaceBelow = window.innerHeight - rightButtonRect.bottom;
84
- const spaceAbove = rightButtonRect.top;
85
- const spaceRight = window.innerWidth - rightButtonRect.right;
99
+ const spaceBelow = window.innerHeight - (rightButtonRect.bottom + ((_a = this.offsetParentRect) === null || _a === void 0 ? void 0 : _a.top));
100
+ const spaceAbove = rightButtonRect.top + ((_b = this.offsetParentRect) === null || _b === void 0 ? void 0 : _b.top);
101
+ const spaceRight = window.innerWidth - (rightButtonRect.left + ((_c = this.offsetParentRect) === null || _c === void 0 ? void 0 : _c.left));
86
102
  const spaceLeft = rightButtonRect.left;
87
103
  const hasSpaceBelow = spaceBelow < dropdownParentRect.height && spaceAbove > dropdownParentRect.height;
88
104
  const hasSpaceRight = spaceRight < dropdownParentRect.width && spaceLeft > dropdownParentRect.width;
89
- let top = `${rightButtonRect.bottom + window.scrollY}px`;
90
- let left = `${rightButtonRect.left + window.scrollX}px`;
105
+ let top = `${rightButtonRect.bottom - ((_d = this.offsetParentRect) === null || _d === void 0 ? void 0 : _d.top) + window.scrollY}px`;
106
+ let left = `${rightButtonRect.left - ((_e = this.offsetParentRect) === null || _e === void 0 ? void 0 : _e.left) + window.scrollX}px`;
91
107
  let bottom = 'auto';
92
108
  if (hasSpaceBelow) {
93
109
  bottom = `${window.innerHeight - rightButtonRect.top - window.scrollY}px`;
@@ -95,7 +111,7 @@ const EzSplitButton = class {
95
111
  _dropdownParent.style.maxHeight = `${spaceAbove}px`;
96
112
  }
97
113
  if (hasSpaceRight) {
98
- left = `${rightButtonRect.right - dropdownParentRect.width + window.scrollX}px`;
114
+ left = `${rightButtonRect.right - dropdownParentRect.width - ((_f = this.offsetParentRect) === null || _f === void 0 ? void 0 : _f.left) + window.scrollX}px`;
99
115
  }
100
116
  _dropdownParent.style.top = top;
101
117
  _dropdownParent.style.bottom = bottom;
@@ -108,6 +124,9 @@ const EzSplitButton = class {
108
124
  componentWillLoad() {
109
125
  this.setEvents();
110
126
  }
127
+ componentWillRender() {
128
+ this.resolveOffsetParentRect();
129
+ }
111
130
  componentDidLoad() {
112
131
  if (this._element)
113
132
  ElementIDUtils.addIDInfo(this._element);
@@ -1 +1 @@
1
- import{p as e,b as o}from"./p-23a36bb6.js";export{s as setNonce}from"./p-23a36bb6.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o(JSON.parse('[["p-1dede1b2",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"selectionToastConfig":[16],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"columnfilterDataSource":[16],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[32],"_hasLeftButtons":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64],"locateColumn":[64],"filterColumns":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-6e429cff",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"openGuideNavidator":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["p-8e7031a0",[[1,"ez-alert-list",{"alerts":[1040],"enableDragAndDrop":[516,"enable-drag-and-drop"],"enableExpand":[516,"enable-expand"],"itemRightSlotBuilder":[16],"opened":[1540],"expanded":[1540]}]]],["p-99ead599",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"showActions":[64],"isOpened":[64]}]]],["p-1e7a8633",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["p-49456b34",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"beforeClose":[1040],"show":[64]},[[8,"keydown","handleKeyDown"]]]]],["p-58fae29b",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]},[[8,"keydown","handleKeyDown"]]]]],["p-b9fbf4e7",[[1,"ez-split-button",{"enabled":[516],"iconName":[513,"icon-name"],"image":[513],"items":[16],"label":[513],"leftTitle":[513,"left-title"],"rightTitle":[513,"right-title"],"mode":[513],"size":[513],"show":[32],"setBlur":[64],"setLeftButtonFocus":[64],"setRightButtonFocus":[64]},[[2,"click","clickListener"]]]]],["p-7a636dfc",[[4,"ez-split-item",{"label":[1],"enableExpand":[516,"enable-expand"],"size":[1],"_expanded":[32]}]]],["p-1f50fa05",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["p-650e4b6d",[[1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"hasSlot":[32]}]]],["p-17be134a",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"],"setFocus":[64],"setBlur":[64]}]]],["p-555c9018",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["p-bc2f844e",[[0,"ez-application"]]],["p-5ed81457",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["p-5e1d036e",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"heightMode":[1,"height-mode"],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"],"scrim":[1]}]]],["p-8c82374d",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]},[[8,"keydown","handleKeyDown"]]]]],["p-9f5fa3f9",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["p-85c8baae",[[0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]]],["p-d7d7423a",[[0,"ez-split-panel",{"direction":[1],"anchorToExpand":[4,"anchor-to-expand"],"rebuildLayout":[64]}]]],["p-8df1ca33",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["p-44caad9a",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["p-cc2dc4f4",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["p-0447d17c",[[1,"ez-collapsible-box",{"value":[1540],"boxBordered":[4,"box-bordered"],"label":[513],"subtitle":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["p-bae3d0aa",[[1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-e85c48d7",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-b567fa8c",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-a80b1287",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64]}]]],["p-8defa6d3",[[1,"ez-list",{"dataSource":[1040],"listMode":[1,"list-mode"],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"itemLeftSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64],"removeSelection":[64]}]]],["p-0306dff7",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"fitHorizontal":[64],"hide":[64]},[[11,"scroll","scrollListener"]]]]],["p-5bd5e68f",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"password":[4],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-784fe207",[[2,"ez-multi-selection-list",{"columnName":[1,"column-name"],"dataSource":[16],"useOptions":[1028,"use-options"],"options":[1040],"isTextSearch":[4,"is-text-search"],"filteredOptions":[32],"displayOptions":[32],"viewScenario":[32],"displayOptionToCheckAllItems":[32],"clearFilteredOptions":[64]}]]],["p-baf80b13",[[0,"filter-column",{"opened":[4],"columnName":[1,"column-name"],"columnLabel":[1,"column-label"],"gridHeaderHidden":[4,"grid-header-hidden"],"noHeaderTaskBar":[1028,"no-header-task-bar"],"dataSource":[16],"dataUnit":[16],"options":[1040],"selectedItems":[32],"fieldDescriptor":[32],"useOptions":[32],"isTextSearch":[32],"hide":[64],"show":[64]}]]],["p-9f1e89c9",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-af95cd16",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-072e6347",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]},[[4,"click","handleClickOutside"]]]]],["p-9050d2cd",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"enableResize":[516,"enable-resize"],"appendTextToSelection":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-77a4bd35",[[1,"ez-upload",{"label":[1],"subtitle":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["p-20ec22c0",[[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["p-91f626d3",[[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["p-2eb8f73b",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"],"options":[1040],"suppressSearch":[4,"suppress-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-bf79aaa1",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4],"getMode":[64],"setFocus":[64]}]]],["p-7bc07c31",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["p-b041333c",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["p-7af81663",[[0,"multi-selection-box-message",{"message":[1]}],[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-card-item",{"item":[16],"enableKey":[4,"enable-key"]}]]],["p-db77a984",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["p-2a1a0e04",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"validate":[64]}]]]]'),e)));
1
+ import{p as e,b as o}from"./p-23a36bb6.js";export{s as setNonce}from"./p-23a36bb6.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o(JSON.parse('[["p-fb5adf9e",[[6,"ez-grid",{"multipleSelection":[4,"multiple-selection"],"config":[1040],"selectionToastConfig":[16],"serverUrl":[1,"server-url"],"dataUnit":[16],"statusResolver":[16],"columnfilterDataSource":[16],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"_paginationInfo":[32],"_paginationChangedByKeyboard":[32],"_showSelectionCounter":[32],"_isAllSelection":[32],"_currentPageSelected":[32],"_selectionCount":[32],"_hasLeftButtons":[32],"setColumnsDef":[64],"addColumnMenuItem":[64],"setColumnsState":[64],"setData":[64],"getSelection":[64],"getColumnsState":[64],"getColumns":[64],"quickFilter":[64],"locateColumn":[64],"filterColumns":[64]},[[0,"ezSelectionChange","onSelectionChange"]]]]],["p-6e429cff",[[1,"ez-guide-navigator",{"open":[1540],"selectedId":[1537,"selected-id"],"items":[16],"tooltipResolver":[16],"filterText":[32],"disableItem":[64],"openGuideNavidator":[64],"enableItem":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"selectGuide":[64],"getParent":[64]}]]],["p-8e7031a0",[[1,"ez-alert-list",{"alerts":[1040],"enableDragAndDrop":[516,"enable-drag-and-drop"],"enableExpand":[516,"enable-expand"],"itemRightSlotBuilder":[16],"opened":[1540],"expanded":[1540]}]]],["p-99ead599",[[1,"ez-actions-button",{"enabled":[516],"actions":[1040],"size":[513],"showLabel":[516,"show-label"],"displayIcon":[513,"display-icon"],"checkOption":[516,"check-option"],"value":[513],"isTransparent":[516,"is-transparent"],"arrowActive":[516,"arrow-active"],"_selectedAction":[32],"hideActions":[64],"showActions":[64],"isOpened":[64]}]]],["p-1e7a8633",[[1,"ez-breadcrumb",{"items":[1040],"fillMode":[1025,"fill-mode"],"maxItems":[1026,"max-items"],"positionEllipsis":[1026,"position-ellipsis"],"visibleItems":[32],"hiddenItems":[32],"showDropdown":[32],"collapseConfigPosition":[32]}]]],["p-49456b34",[[1,"ez-dialog",{"confirm":[1028],"dialogType":[1025,"dialog-type"],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"beforeClose":[1040],"show":[64]},[[8,"keydown","handleKeyDown"]]]]],["p-58fae29b",[[6,"ez-modal-container",{"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"showTitleBar":[4,"show-title-bar"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"cancelButtonStatus":[1,"cancel-button-status"],"okButtonStatus":[1,"ok-button-status"]},[[8,"keydown","handleKeyDown"]]]]],["p-3faa2b46",[[1,"ez-split-button",{"enabled":[516],"iconName":[513,"icon-name"],"image":[513],"items":[16],"label":[513],"leftTitle":[513,"left-title"],"rightTitle":[513,"right-title"],"mode":[513],"size":[513],"show":[32],"setBlur":[64],"setLeftButtonFocus":[64],"setRightButtonFocus":[64]},[[2,"click","clickListener"]]]]],["p-7a636dfc",[[4,"ez-split-item",{"label":[1],"enableExpand":[516,"enable-expand"],"size":[1],"_expanded":[32]}]]],["p-1f50fa05",[[1,"ez-alert",{"alertType":[513,"alert-type"]}]]],["p-650e4b6d",[[1,"ez-badge",{"size":[513],"label":[513],"iconLeft":[513,"icon-left"],"iconRight":[513,"icon-right"],"position":[1040],"hasSlot":[32]}]]],["p-17be134a",[[1,"ez-chip",{"label":[513],"enabled":[516],"removePosition":[513,"remove-position"],"mode":[513],"value":[1540],"showNativeTooltip":[4,"show-native-tooltip"],"setFocus":[64],"setBlur":[64]}]]],["p-555c9018",[[1,"ez-file-item",{"canRemove":[4,"can-remove"],"fileName":[1,"file-name"],"iconName":[1,"icon-name"],"fileSize":[2,"file-size"],"progress":[2]}]]],["p-bc2f844e",[[0,"ez-application"]]],["p-5ed81457",[[1,"ez-loading-bar",{"_showLoading":[32],"hide":[64],"show":[64]}]]],["p-5e1d036e",[[1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"heightMode":[1,"height-mode"],"opened":[1028],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"],"scrim":[1]}]]],["p-8c82374d",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[516,"use-header"],"heightMode":[513,"height-mode"],"ezTitle":[1,"ez-title"]},[[8,"keydown","handleKeyDown"]]]]],["p-9f5fa3f9",[[1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]]],["p-85c8baae",[[0,"ez-skeleton",{"count":[2],"variant":[1],"width":[1],"height":[1],"marginBottom":[1,"margin-bottom"],"animation":[1]}]]],["p-d7d7423a",[[0,"ez-split-panel",{"direction":[1],"anchorToExpand":[4,"anchor-to-expand"],"rebuildLayout":[64]}]]],["p-8df1ca33",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"canClose":[1028,"can-close"],"show":[64]}]]],["p-44caad9a",[[0,"ez-view-stack",{"show":[64],"getSelectedIndex":[64]}]]],["p-cc2dc4f4",[[1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]]],["p-0447d17c",[[1,"ez-collapsible-box",{"value":[1540],"boxBordered":[4,"box-bordered"],"label":[513],"subtitle":[513],"headerSize":[513,"header-size"],"iconPlacement":[513,"icon-placement"],"headerAlign":[513,"header-align"],"removable":[516],"editable":[516],"conditionalSave":[16],"_activeEditText":[32],"showHide":[64],"applyFocusTextEdit":[64],"cancelEdition":[64]}]]],["p-bae3d0aa",[[1,"ez-combo-box",{"limitCharsToSearch":[2,"limit-chars-to-search"],"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errorMessage":[1537,"error-message"],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressSearch":[4,"suppress-search"],"optionLoader":[16],"suppressEmptyOption":[4,"suppress-empty-option"],"canShowError":[516,"can-show-error"],"mode":[513],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-e85c48d7",[[1,"ez-time-input",{"label":[513],"value":[1026],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-b567fa8c",[[1,"ez-number-input",{"label":[1],"value":[1538],"enabled":[4],"canShowError":[516,"can-show-error"],"errorMessage":[1537,"error-message"],"precision":[2],"prettyPrecision":[2,"pretty-precision"],"mode":[513],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-a80b1287",[[1,"ez-popover",{"autoClose":[516,"auto-close"],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"],"overlayType":[513,"overlay-type"],"updatePosition":[64],"show":[64],"showUnder":[64],"hide":[64]}]]],["p-8defa6d3",[[1,"ez-list",{"dataSource":[1040],"listMode":[1,"list-mode"],"useGroups":[1540,"use-groups"],"ezDraggable":[1028,"ez-draggable"],"ezSelectable":[1028,"ez-selectable"],"itemSlotBuilder":[1040],"itemLeftSlotBuilder":[1040],"hoverFeedback":[1028,"hover-feedback"],"_listItems":[32],"_listGroupItems":[32],"clearHistory":[64],"scrollToTop":[64],"setSelection":[64],"getSelection":[64],"getList":[64],"removeSelection":[64]}]]],["p-0306dff7",[[1,"ez-calendar",{"value":[1040],"floating":[516],"time":[516],"showSeconds":[516,"show-seconds"],"show":[64],"fitVertical":[64],"fitHorizontal":[64],"hide":[64]},[[11,"scroll","scrollListener"]]]]],["p-5bd5e68f",[[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"mask":[1],"canShowError":[516,"can-show-error"],"restrict":[1],"mode":[513],"noBorder":[516,"no-border"],"password":[4],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-784fe207",[[2,"ez-multi-selection-list",{"columnName":[1,"column-name"],"dataSource":[16],"useOptions":[1028,"use-options"],"options":[1040],"isTextSearch":[4,"is-text-search"],"filteredOptions":[32],"displayOptions":[32],"viewScenario":[32],"displayOptionToCheckAllItems":[32],"clearFilteredOptions":[64]}]]],["p-baf80b13",[[0,"filter-column",{"opened":[4],"columnName":[1,"column-name"],"columnLabel":[1,"column-label"],"gridHeaderHidden":[4,"grid-header-hidden"],"noHeaderTaskBar":[1028,"no-header-task-bar"],"dataSource":[16],"dataUnit":[16],"options":[1040],"selectedItems":[32],"fieldDescriptor":[32],"useOptions":[32],"isTextSearch":[32],"hide":[64],"show":[64]}]]],["p-9f1e89c9",[[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-af95cd16",[[1,"ez-date-time-input",{"label":[513],"value":[1040],"enabled":[516],"errorMessage":[1537,"error-message"],"showSeconds":[516,"show-seconds"],"mode":[513],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"getValueAsync":[64]}]]],["p-072e6347",[[1,"ez-dropdown",{"items":[1040],"value":[1040],"itemBuilder":[16]},[[4,"click","handleClickOutside"]]]]],["p-9050d2cd",[[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513],"enableResize":[516,"enable-resize"],"appendTextToSelection":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64]}]]],["p-77a4bd35",[[1,"ez-upload",{"label":[1],"subtitle":[1],"enabled":[4],"maxFileSize":[2,"max-file-size"],"maxFiles":[2,"max-files"],"requestHeaders":[8,"request-headers"],"urlUpload":[1,"url-upload"],"urlDelete":[1,"url-delete"],"value":[1040],"addFiles":[64],"setFocus":[64],"setBlur":[64]}]]],["p-20ec22c0",[[1,"ez-text-edit",{"value":[1],"styled":[16],"_newValue":[32],"applyFocusSelect":[64]}]]],["p-91f626d3",[[1,"ez-tree",{"items":[1040],"value":[1040],"selectedId":[1537,"selected-id"],"iconResolver":[16],"tooltipResolver":[16],"_tree":[32],"_waintingForLoad":[32],"selectItem":[64],"openItem":[64],"disableItem":[64],"enableItem":[64],"addChild":[64],"applyFilter":[64],"updateItem":[64],"getItem":[64],"getCurrentPath":[64],"getParent":[64]},[[2,"keydown","onKeyDownListener"]]],[1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isActive":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]],[1,"ez-sidebar-button"]]],["p-2eb8f73b",[[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513],"canShowError":[516,"can-show-error"],"hideErrorOnFocusOut":[4,"hide-error-on-focus-out"],"listOptionsPosition":[16],"isTextSearch":[4,"is-text-search"],"ignoreLimitCharsToSearch":[4,"ignore-limit-chars-to-search"],"options":[1040],"suppressSearch":[4,"suppress-search"],"_preSelection":[32],"_visibleOptions":[32],"_startLoading":[32],"_showLoading":[32],"_criteria":[32],"getValueAsync":[64],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"clearValue":[64]},[[11,"scroll","scrollListener"]]]]],["p-bf79aaa1",[[1,"ez-check",{"label":[513],"value":[1540],"enabled":[1540],"indeterminate":[1540],"mode":[513],"compact":[4],"getMode":[64],"setFocus":[64]}]]],["p-7bc07c31",[[1,"ez-icon",{"size":[513],"href":[513],"iconName":[513,"icon-name"]}]]],["p-b041333c",[[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513],"iconName":[513,"icon-name"],"size":[513],"setFocus":[64],"setBlur":[64]},[[2,"click","clickListener"]]]]],["p-7af81663",[[0,"multi-selection-box-message",{"message":[1]}],[1,"ez-filter-input",{"label":[1],"value":[1537],"enabled":[4],"errorMessage":[1537,"error-message"],"restrict":[1],"mode":[513],"asyncSearch":[516,"async-search"],"canShowError":[516,"can-show-error"],"setFocus":[64],"setBlur":[64],"isInvalid":[64],"setValue":[64],"endSearch":[64]}],[1,"ez-card-item",{"item":[16],"enableKey":[4,"enable-key"]}]]],["p-db77a984",[[2,"ez-form-view",{"fields":[16],"showUp":[64]}]]],["p-2a1a0e04",[[2,"ez-form",{"dataUnit":[1040],"config":[16],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"validate":[64]}]]]]'),e)));
@@ -0,0 +1 @@
1
+ import{r as t,c as o,h as i,g as e}from"./p-23a36bb6.js";import{ElementIDUtils as n}from"@sankhyalabs/core";const l=class{constructor(i){t(this,i),this.buttonClick=o(this,"buttonClick",7),this.dropdownItemClick=o(this,"dropdownItemClick",7),this.dropdownSubActionClick=o(this,"dropdownSubActionClick",7),this.rightDefaultTitle="Mais opções",this.show=!1,this.enabled=!0,this.iconName=void 0,this.image=void 0,this.items=void 0,this.label=void 0,this.leftTitle=void 0,this.rightTitle="Mais opções",this.mode="default",this.size="medium"}async setBlur(){this.leftButton.blur(),this.rightButton.blur()}async setLeftButtonFocus(){this.leftButton.focus()}async setRightButtonFocus(){this.rightButton.focus()}clickListener(t){this.enabled||(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}getIconSize(t="medium"){var o;const i=null===(o=this.size)||void 0===o?void 0:o.toLowerCase();return["medium","large"].includes(i)?i:t}closeDropdown(){this.show=!1}toggleDropdown(){this.show=!this.show}handleButtonClick(){this.buttonClick.emit()}handleDropdownItemClick(t){this.dropdownItemClick.emit(t.detail),t.stopPropagation(),this.closeDropdown()}handleDropdownSubActionClick(t){this.dropdownSubActionClick.emit(t.detail),t.stopPropagation(),this.closeDropdown()}resolveOffsetParentRect(){var t,o;const i=null===(o=null===(t=this.dropdownParent)||void 0===t?void 0:t.offsetParent)||void 0===o?void 0:o.getBoundingClientRect(),e=window.scrollX||document.documentElement.scrollLeft,n=window.scrollY||document.documentElement.scrollTop;this.offsetParentRect={top:(null==i?void 0:i.top)+n,left:(null==i?void 0:i.left)+e,bottom:(null==i?void 0:i.bottom)+n,right:(null==i?void 0:i.right)+e,width:null==i?void 0:i.width,height:null==i?void 0:i.height}}positionDropdown(){var t,o,i,e,n,l;const{rightButton:r,dropdownParent:s}=this,d=r.getBoundingClientRect(),a=s.getBoundingClientRect(),u=window.innerHeight-(d.bottom+(null===(t=this.offsetParentRect)||void 0===t?void 0:t.top)),b=d.top+(null===(o=this.offsetParentRect)||void 0===o?void 0:o.top),p=window.innerWidth-(d.left+(null===(i=this.offsetParentRect)||void 0===i?void 0:i.left))<a.width&&d.left>a.width;let c=`${d.bottom-(null===(e=this.offsetParentRect)||void 0===e?void 0:e.top)+window.scrollY}px`,h=`${d.left-(null===(n=this.offsetParentRect)||void 0===n?void 0:n.left)+window.scrollX}px`,v="auto";u<a.height&&b>a.height&&(v=window.innerHeight-d.top-window.scrollY+"px",c="auto",s.style.maxHeight=`${b}px`),p&&(h=`${d.right-a.width-(null===(l=this.offsetParentRect)||void 0===l?void 0:l.left)+window.scrollX}px`),s.style.top=c,s.style.bottom=v,s.style.left=h}setEvents(){window.removeEventListener("scroll",this.positionDropdown.bind(this)),window.addEventListener("scroll",this.positionDropdown.bind(this))}componentWillLoad(){this.setEvents()}componentWillRender(){this.resolveOffsetParentRect()}componentDidLoad(){this._element&&n.addIDInfo(this._element),this.leftButton&&n.addIDInfo(this.leftButton,"left-button",{id:"embedded"}),this.rightButton&&n.addIDInfo(this.rightButton,"right-button",{id:"embedded"}),this.positionDropdown()}componentDidUpdate(){this.positionDropdown()}render(){const t=this.shouldShowIconOnLeftButton(),o=this.shouldShowLabelOnLeftButton(),e=this.getIconSize();return i("div",{class:"label-icon"},i("button",{class:`ez-split-button__left-button ${e} ${this.mode}`,title:this.leftTitle||this.label,type:"button",disabled:!this.enabled,onClick:()=>{this.handleButtonClick()},ref:t=>this.leftButton=t},t&&i("ez-icon",{href:this.image,iconName:this.iconName,size:e}),o&&i("label",{title:this.leftTitle||this.label},this.label)),i("div",{class:"dropdown"},i("button",{class:`ez-split-button__right-button ${e} ez-split-button__right-button--${e} ez-split-button__right-button--divider`,title:this.rightTitle||this.rightDefaultTitle,type:"button",disabled:!this.enabled,onClick:()=>{this.toggleDropdown()},ref:t=>this.rightButton=t},i("ez-icon",{class:"ez-split-button__right-button-container "+(e?`btn-icon--${e}`:""),iconName:"chevron-down",size:e})),i("div",{class:`dropdown-content dropdown-content--${this.size}`,ref:t=>this.dropdownParent=t},this.show&&i("ez-dropdown",{items:this.items,onClick:t=>{t.stopPropagation()},onEzOutsideClick:()=>{this.closeDropdown()},onEzClick:t=>{this.handleDropdownItemClick(t)},onEzSubActionClick:t=>{this.handleDropdownSubActionClick(t)}}))))}shouldShowLabelOnLeftButton(){return["icon-left","default"].includes(this.mode)}shouldShowIconOnLeftButton(){return["icon-left","icon-only"].includes(this.mode)}get _element(){return e(this)}};l.style=":host{--ez-split-button--min-width:24;--ez-split-button--width:'auto';--ez-split-button__medium--height:32px;--ez-split-button__large--height:42px;--ez-split-button__medium-icon--width:40px;--ez-split-button__large-icon--width:44px;--ez-split-button__inline__icon--gap:6px;--ez-split-button__label--padding-top:0px;--ez-split-button__label--padding-bottom:0px;--ez-split-button__right-button--padding-left:8px;--ez-split-button--color:var(--title--primary, #FFF);--ez-split-button--font-size:var(--text--medium, 14px);--ez-split-button--font-family:var(--font-pattern, Arial);--ez-split-button--font-weight:var(--text-weight--large);--ez-split-button--background-color:var(--background--medium, #008561);--ez-split-button--border-radius:var(--border--radius-large, 12px);--ez-split-button--border:none;--ez-split-button--justify-content:center;--ez-split-button--hover-color:var(--color--primary-600);--ez-split-button--hover--background-color:var(--background--medium, var(--ez-split-button--background-color));--ez-split-button--disabled-color:var(--text--disable);--ez-split-button--disabled--background-color:var(--color--disable-secondary);--ez-split-button--focus--border:var(--border--medium, 2px) var(--color--primary-300);--ez-split-button--focus--box-shadow:none;--ez-split-button--active-color:var(--color--primary-700);--ez-split-button--active--background-color:var(--background--strong)}ez-icon{--ez-icon--color:inherit}button{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-split-button--min-width);width:var(--ez-split-button--width);height:var(--ez-split-button__medium--height);font-family:var(--ez-split-button--font-family);font-size:var(--ez-split-button--font-size);font-weight:var(--ez-split-button--font-weight);padding:var(--ez-split-button__label--padding-top) 0 var(--ez-split-button__label--padding-bottom) 0;border-top-left-radius:var(--ez-split-button--border-radius);border-bottom-left-radius:var(--ez-split-button--border-radius);background-color:var(--ez-split-button--background-color);color:var(--ez-split-button--color);fill:var(--ez-split-button--color);border:var(--ez-split-button--border);justify-content:var(--ez-split-button--justify-content)}label{cursor:pointer}button:active{outline:none;box-shadow:none;background-color:var(--ez-split-button--active--background-color);color:var(--ez-split-button--active-color);fill:var(--ez-split-button--active-color);--ez-icon--color:var(--ez-split-button--active-color)}.ez-split-button__left-button:focus,.ez-split-button__right-button:focus{outline:var(--ez-split-button--focus--border);box-shadow:var(--ez-split-button--focus--box-shadow)}.ez-split-button__left-button:hover,.ez-split-button__right-button:hover{outline:none;background-color:var(--ez-split-button--hover--background-color);color:var(--ez-split-button--hover-color);fill:var(--ez-split-button--hover-color);--ez-icon--color:var(--ez-split-button--hover-color)}.ez-split-button__left-button:disabled,.ez-split-button__left-button:disabled label,.ez-split-button__right-button:disabled{background-color:var(--ez-split-button--disabled--background-color);color:var(--ez-split-button--disabled-color);fill:var(--ez-split-button--disabled-color);border:none;--ez-icon--color:var(--ez-split-button--disabled-color);cursor:not-allowed}button.large{height:var(--ez-split-button__large--height)}button.medium{height:var(--ez-split-button__medium--height)}.default label{padding:var(--ez-split-button__label--padding-top) 12px var(--ez-split-button__label--padding-bottom) 20px}.icon-left{gap:var(--ez-split-button__inline__icon--gap)}.icon-left label{padding-right:12px}.icon-left ez-icon{padding-left:20px}.icon-only{padding-left:12px;padding-right:12px}.ez-split-button__right-button{border-top-right-radius:var(--ez-split-button--border-radius);border-bottom-right-radius:var(--ez-split-button--border-radius);border-top-left-radius:0;border-bottom-left-radius:0}.ez-split-button__right-button--medium{min-width:var(--ez-split-button__medium-icon--width)}.ez-split-button__right-button--large{min-width:var(--ez-split-button__large-icon--width)}.ez-split-button__right-button--divider{top:10%;bottom:10%}.ez-split-button__right-button--divider:before{content:\"\";position:absolute;left:0;border-left:1px solid rgba(0, 0, 0, 20%);border-radius:2px;height:75%}.btn-icon--medium{min-width:--ez-split-button__medium-icon--width}.btn-icon--large{min-width:--ez-split-button__large-icon--width}.ez-split-button__right-button-container{position:absolute;left:0;padding-left:var(--ez-split-button__right-button--padding-left)}.label-icon{display:flex;flex-direction:row;align-items:center;color:var(--ez-split-button--color)}.label-icon:active{color:var(--ez-split-button--active-color);fill:var(--ez-split-button--active-color);--ez-icon--color:var(--ez-split-button--active-color)}.dropdown{display:flex}.dropdown-content{display:block;position:absolute;background-color:#f1f1f1;min-width:160px;z-index:--ez-elevation--8;border-radius:var(--ez-split-button--border-radius)}.dropdown-content>ez-dropdown{position:relative}";export{l as ez_split_button}