@anguless/angulux 22.6.6 → 22.6.8
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.
- package/README.md +12 -9
- package/fesm2022/anguless-angulux-autofocus.mjs +2 -2
- package/fesm2022/anguless-angulux-autofocus.mjs.map +1 -1
- package/fesm2022/anguless-angulux-confirmdialog.mjs +9 -3
- package/fesm2022/anguless-angulux-confirmdialog.mjs.map +1 -1
- package/fesm2022/anguless-angulux-dialog.mjs +2 -2
- package/fesm2022/anguless-angulux-dialog.mjs.map +1 -1
- package/fesm2022/anguless-angulux-dom.mjs +240 -155
- package/fesm2022/anguless-angulux-dom.mjs.map +1 -1
- package/fesm2022/anguless-angulux-fileupload.mjs +13 -1
- package/fesm2022/anguless-angulux-fileupload.mjs.map +1 -1
- package/fesm2022/anguless-angulux-menu.mjs +2 -2
- package/fesm2022/anguless-angulux-menu.mjs.map +1 -1
- package/fesm2022/anguless-angulux-motion.mjs +17 -0
- package/fesm2022/anguless-angulux-motion.mjs.map +1 -1
- package/fesm2022/anguless-angulux-multiselect.mjs +5 -5
- package/fesm2022/anguless-angulux-multiselect.mjs.map +1 -1
- package/fesm2022/anguless-angulux-overlay.mjs +10 -6
- package/fesm2022/anguless-angulux-overlay.mjs.map +1 -1
- package/fesm2022/anguless-angulux-password.mjs +2 -2
- package/fesm2022/anguless-angulux-password.mjs.map +1 -1
- package/fesm2022/anguless-angulux-progressbar.mjs +8 -3
- package/fesm2022/anguless-angulux-progressbar.mjs.map +1 -1
- package/fesm2022/anguless-angulux-table.mjs +73 -75
- package/fesm2022/anguless-angulux-table.mjs.map +1 -1
- package/fesm2022/anguless-angulux-tieredmenu.mjs +2 -2
- package/fesm2022/anguless-angulux-tieredmenu.mjs.map +1 -1
- package/fesm2022/anguless-angulux-toast.mjs +14 -1
- package/fesm2022/anguless-angulux-toast.mjs.map +1 -1
- package/fesm2022/anguless-angulux-treetable.mjs +4 -3
- package/fesm2022/anguless-angulux-treetable.mjs.map +1 -1
- package/fesm2022/anguless-angulux-utils.mjs +32 -12
- package/fesm2022/anguless-angulux-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/types/anguless-angulux-confirmdialog.d.ts +4 -0
- package/types/anguless-angulux-dom.d.ts +36 -2
- package/types/anguless-angulux-fileupload.d.ts +1 -2
- package/types/anguless-angulux-table.d.ts +2 -2
- package/types/anguless-angulux-toast.d.ts +1 -2
- package/types/anguless-angulux-utils.d.ts +5 -2
|
@@ -2,6 +2,213 @@ import * as utils from '@anguless/angulux-utils';
|
|
|
2
2
|
import { getCSSVariableByRegex } from '@anguless/angulux-utils';
|
|
3
3
|
import { $dt } from '@anguless/angulux-styled';
|
|
4
4
|
|
|
5
|
+
/** DomHandler.zindex lives here so a caller can advance it without holding the class. */
|
|
6
|
+
const zIndexState = { current: 1000 };
|
|
7
|
+
function ɵnextZIndex() {
|
|
8
|
+
return ++zIndexState.current;
|
|
9
|
+
}
|
|
10
|
+
function ɵaddClass(element, className) {
|
|
11
|
+
if (element && className) {
|
|
12
|
+
if (element.classList)
|
|
13
|
+
element.classList.add(className);
|
|
14
|
+
else
|
|
15
|
+
element.className += ' ' + className;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function ɵremoveClass(element, className) {
|
|
19
|
+
if (element && className) {
|
|
20
|
+
if (element.classList)
|
|
21
|
+
element.classList.remove(className);
|
|
22
|
+
else
|
|
23
|
+
element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function ɵsiblings(element) {
|
|
27
|
+
return Array.prototype.filter.call(element.parentNode.children, function (child) {
|
|
28
|
+
return child !== element;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function ɵfind(element, selector) {
|
|
32
|
+
return Array.from(element.querySelectorAll(selector));
|
|
33
|
+
}
|
|
34
|
+
function ɵfindSingle(element, selector) {
|
|
35
|
+
return ɵisElement(element) ? element.querySelector(selector) : null;
|
|
36
|
+
}
|
|
37
|
+
function ɵindex(element) {
|
|
38
|
+
let children = element.parentNode.childNodes;
|
|
39
|
+
let num = 0;
|
|
40
|
+
for (var i = 0; i < children.length; i++) {
|
|
41
|
+
if (children[i] == element)
|
|
42
|
+
return num;
|
|
43
|
+
if (children[i].nodeType == 1)
|
|
44
|
+
num++;
|
|
45
|
+
}
|
|
46
|
+
return -1;
|
|
47
|
+
}
|
|
48
|
+
function ɵindexWithinGroup(element, attributeName) {
|
|
49
|
+
let children = (element.parentNode ? element.parentNode.childNodes : []);
|
|
50
|
+
let num = 0;
|
|
51
|
+
for (var i = 0; i < children.length; i++) {
|
|
52
|
+
if (children[i] == element)
|
|
53
|
+
return num;
|
|
54
|
+
if (children[i].attributes && children[i].attributes[attributeName] && children[i].nodeType == 1)
|
|
55
|
+
num++;
|
|
56
|
+
}
|
|
57
|
+
return -1;
|
|
58
|
+
}
|
|
59
|
+
function ɵgetParents(element, parents = []) {
|
|
60
|
+
return element['parentNode'] === null ? parents : ɵgetParents(element.parentNode, parents.concat([element.parentNode]));
|
|
61
|
+
}
|
|
62
|
+
function ɵgetScrollableParents(element) {
|
|
63
|
+
let scrollableParents = [];
|
|
64
|
+
if (element) {
|
|
65
|
+
let parents = ɵgetParents(element);
|
|
66
|
+
// Inside a shadow root the walk ends at the root, which is not an element and has no
|
|
67
|
+
// computed style: getComputedStyle threw, and the listeners bound after this one never
|
|
68
|
+
// were (upstream 22.1.3, held under P3.a, fixed under P3.c on 2026-11-17). The walk goes
|
|
69
|
+
// on from the host, whose ancestors can scroll as well.
|
|
70
|
+
const last = parents[parents.length - 1];
|
|
71
|
+
if (last && last.nodeType === 11 && last.host) {
|
|
72
|
+
parents = parents.concat([last.host], ɵgetParents(last.host));
|
|
73
|
+
}
|
|
74
|
+
const overflowRegex = /(auto|scroll)/;
|
|
75
|
+
const overflowCheck = (node) => {
|
|
76
|
+
let styleDeclaration = window['getComputedStyle'](node, null);
|
|
77
|
+
return overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowX')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowY'));
|
|
78
|
+
};
|
|
79
|
+
for (let parent of parents) {
|
|
80
|
+
let scrollSelectors = parent.nodeType === 1 && parent.dataset['scrollselectors'];
|
|
81
|
+
if (scrollSelectors) {
|
|
82
|
+
let selectors = scrollSelectors.split(',');
|
|
83
|
+
for (let selector of selectors) {
|
|
84
|
+
let el = ɵfindSingle(parent, selector);
|
|
85
|
+
if (el && overflowCheck(el)) {
|
|
86
|
+
scrollableParents.push(el);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (parent.nodeType === 1 && overflowCheck(parent)) {
|
|
91
|
+
scrollableParents.push(parent);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return scrollableParents;
|
|
96
|
+
}
|
|
97
|
+
function ɵgetHiddenElementOuterHeight(element) {
|
|
98
|
+
element.style.visibility = 'hidden';
|
|
99
|
+
element.style.display = 'block';
|
|
100
|
+
let elementHeight = element.offsetHeight;
|
|
101
|
+
element.style.display = 'none';
|
|
102
|
+
element.style.visibility = 'visible';
|
|
103
|
+
return elementHeight;
|
|
104
|
+
}
|
|
105
|
+
function ɵgetHiddenElementOuterWidth(element) {
|
|
106
|
+
element.style.visibility = 'hidden';
|
|
107
|
+
element.style.display = 'block';
|
|
108
|
+
let elementWidth = element.offsetWidth;
|
|
109
|
+
element.style.display = 'none';
|
|
110
|
+
element.style.visibility = 'visible';
|
|
111
|
+
return elementWidth;
|
|
112
|
+
}
|
|
113
|
+
function ɵgetOuterWidth(el, margin) {
|
|
114
|
+
let width = el.offsetWidth;
|
|
115
|
+
if (margin) {
|
|
116
|
+
let style = getComputedStyle(el);
|
|
117
|
+
width += parseFloat(style.marginLeft) + parseFloat(style.marginRight);
|
|
118
|
+
}
|
|
119
|
+
return width;
|
|
120
|
+
}
|
|
121
|
+
function ɵgetOuterHeight(el, margin) {
|
|
122
|
+
let height = el.offsetHeight;
|
|
123
|
+
if (margin) {
|
|
124
|
+
let style = getComputedStyle(el);
|
|
125
|
+
height += parseFloat(style.marginTop) + parseFloat(style.marginBottom);
|
|
126
|
+
}
|
|
127
|
+
return height;
|
|
128
|
+
}
|
|
129
|
+
function ɵgetOffset(el) {
|
|
130
|
+
var rect = el.getBoundingClientRect();
|
|
131
|
+
return {
|
|
132
|
+
top: rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
|
|
133
|
+
left: rect.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0)
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function ɵisTouchDevice() {
|
|
137
|
+
return 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
138
|
+
}
|
|
139
|
+
function ɵisElement(obj) {
|
|
140
|
+
return typeof HTMLElement === 'object' ? obj instanceof HTMLElement : obj && typeof obj === 'object' && obj.nodeType === 1 && typeof obj.nodeName === 'string';
|
|
141
|
+
}
|
|
142
|
+
function ɵinvokeElementMethod(element, methodName, args) {
|
|
143
|
+
element[methodName].apply(element, args);
|
|
144
|
+
}
|
|
145
|
+
function ɵclearSelection() {
|
|
146
|
+
if (window.getSelection && window.getSelection()) {
|
|
147
|
+
if (window.getSelection()?.empty) {
|
|
148
|
+
window.getSelection()?.empty();
|
|
149
|
+
}
|
|
150
|
+
else if (window.getSelection()?.removeAllRanges && (window.getSelection()?.rangeCount || 0) > 0 && (window.getSelection()?.getRangeAt(0)?.getClientRects()?.length || 0) > 0) {
|
|
151
|
+
window.getSelection()?.removeAllRanges();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
else if (document['selection'] && document['selection'].empty) {
|
|
155
|
+
try {
|
|
156
|
+
document['selection'].empty();
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
//ignore IE bug
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function ɵisVisible(element) {
|
|
164
|
+
return element && element.offsetParent != null;
|
|
165
|
+
}
|
|
166
|
+
function ɵfocus(element, options) {
|
|
167
|
+
element && document.activeElement !== element && element.focus(options);
|
|
168
|
+
}
|
|
169
|
+
function ɵgetFocusableSelectorString(selector = '') {
|
|
170
|
+
return `button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
171
|
+
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
172
|
+
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
173
|
+
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
174
|
+
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
175
|
+
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
176
|
+
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
177
|
+
.p-inputtext:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
178
|
+
.p-button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector}`;
|
|
179
|
+
}
|
|
180
|
+
function ɵgetFocusableElements(element, selector = '') {
|
|
181
|
+
let focusableElements = ɵfind(element, ɵgetFocusableSelectorString(selector));
|
|
182
|
+
let visibleFocusableElements = [];
|
|
183
|
+
for (let focusableElement of focusableElements) {
|
|
184
|
+
const computedStyle = getComputedStyle(focusableElement);
|
|
185
|
+
if (ɵisVisible(focusableElement) && computedStyle.display != 'none' && computedStyle.visibility != 'hidden')
|
|
186
|
+
visibleFocusableElements.push(focusableElement);
|
|
187
|
+
}
|
|
188
|
+
return visibleFocusableElements;
|
|
189
|
+
}
|
|
190
|
+
function ɵgetFirstFocusableElement(element, selector = '') {
|
|
191
|
+
const focusableElements = ɵgetFocusableElements(element, selector);
|
|
192
|
+
return focusableElements.length > 0 ? focusableElements[0] : null;
|
|
193
|
+
}
|
|
194
|
+
function ɵgetAttribute(element, name) {
|
|
195
|
+
if (element) {
|
|
196
|
+
const value = element.getAttribute(name);
|
|
197
|
+
if (!isNaN(value)) {
|
|
198
|
+
return +value;
|
|
199
|
+
}
|
|
200
|
+
if (value === 'true' || value === 'false') {
|
|
201
|
+
return value === 'true';
|
|
202
|
+
}
|
|
203
|
+
return value;
|
|
204
|
+
}
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
function ɵsetAttribute(element, attribute = '', value) {
|
|
208
|
+
if (ɵisElement(element) && value !== null && value !== undefined) {
|
|
209
|
+
element.setAttribute(attribute, value);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
5
212
|
/**
|
|
6
213
|
* @dynamic is for runtime initializing DomHandler.browser
|
|
7
214
|
*
|
|
@@ -12,17 +219,17 @@ import { $dt } from '@anguless/angulux-styled';
|
|
|
12
219
|
*/
|
|
13
220
|
// @dynamic
|
|
14
221
|
class DomHandler {
|
|
15
|
-
static zindex
|
|
222
|
+
static get zindex() {
|
|
223
|
+
return zIndexState.current;
|
|
224
|
+
}
|
|
225
|
+
static set zindex(value) {
|
|
226
|
+
zIndexState.current = value;
|
|
227
|
+
}
|
|
16
228
|
static calculatedScrollbarWidth = null;
|
|
17
229
|
static calculatedScrollbarHeight = null;
|
|
18
230
|
static browser;
|
|
19
231
|
static addClass(element, className) {
|
|
20
|
-
|
|
21
|
-
if (element.classList)
|
|
22
|
-
element.classList.add(className);
|
|
23
|
-
else
|
|
24
|
-
element.className += ' ' + className;
|
|
25
|
-
}
|
|
232
|
+
ɵaddClass(element, className);
|
|
26
233
|
}
|
|
27
234
|
static addMultipleClasses(element, className) {
|
|
28
235
|
if (element && className) {
|
|
@@ -41,12 +248,7 @@ class DomHandler {
|
|
|
41
248
|
}
|
|
42
249
|
}
|
|
43
250
|
static removeClass(element, className) {
|
|
44
|
-
|
|
45
|
-
if (element.classList)
|
|
46
|
-
element.classList.remove(className);
|
|
47
|
-
else
|
|
48
|
-
element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
|
|
49
|
-
}
|
|
251
|
+
ɵremoveClass(element, className);
|
|
50
252
|
}
|
|
51
253
|
static removeMultipleClasses(element, classNames) {
|
|
52
254
|
if (element && classNames) {
|
|
@@ -66,37 +268,19 @@ class DomHandler {
|
|
|
66
268
|
return false;
|
|
67
269
|
}
|
|
68
270
|
static siblings(element) {
|
|
69
|
-
return
|
|
70
|
-
return child !== element;
|
|
71
|
-
});
|
|
271
|
+
return ɵsiblings(element);
|
|
72
272
|
}
|
|
73
273
|
static find(element, selector) {
|
|
74
|
-
return
|
|
274
|
+
return ɵfind(element, selector);
|
|
75
275
|
}
|
|
76
276
|
static findSingle(element, selector) {
|
|
77
|
-
return
|
|
277
|
+
return ɵfindSingle(element, selector);
|
|
78
278
|
}
|
|
79
279
|
static index(element) {
|
|
80
|
-
|
|
81
|
-
let num = 0;
|
|
82
|
-
for (var i = 0; i < children.length; i++) {
|
|
83
|
-
if (children[i] == element)
|
|
84
|
-
return num;
|
|
85
|
-
if (children[i].nodeType == 1)
|
|
86
|
-
num++;
|
|
87
|
-
}
|
|
88
|
-
return -1;
|
|
280
|
+
return ɵindex(element);
|
|
89
281
|
}
|
|
90
282
|
static indexWithinGroup(element, attributeName) {
|
|
91
|
-
|
|
92
|
-
let num = 0;
|
|
93
|
-
for (var i = 0; i < children.length; i++) {
|
|
94
|
-
if (children[i] == element)
|
|
95
|
-
return num;
|
|
96
|
-
if (children[i].attributes && children[i].attributes[attributeName] && children[i].nodeType == 1)
|
|
97
|
-
num++;
|
|
98
|
-
}
|
|
99
|
-
return -1;
|
|
283
|
+
return ɵindexWithinGroup(element, attributeName);
|
|
100
284
|
}
|
|
101
285
|
static appendOverlay(overlay, target, appendTo = 'self') {
|
|
102
286
|
if (appendTo !== 'self' && overlay && target) {
|
|
@@ -205,58 +389,16 @@ class DomHandler {
|
|
|
205
389
|
gutter && (element.style.marginTop = origin === 'bottom' ? 'calc(var(--p-anchor-gutter) * -1)' : 'calc(var(--p-anchor-gutter))');
|
|
206
390
|
}
|
|
207
391
|
static getParents(element, parents = []) {
|
|
208
|
-
return
|
|
392
|
+
return ɵgetParents(element, parents);
|
|
209
393
|
}
|
|
210
394
|
static getScrollableParents(element) {
|
|
211
|
-
|
|
212
|
-
if (element) {
|
|
213
|
-
let parents = this.getParents(element);
|
|
214
|
-
// Inside a shadow root the walk ends at the root, which is not an element and has no
|
|
215
|
-
// computed style: getComputedStyle threw, and the listeners bound after this one never
|
|
216
|
-
// were (upstream 22.1.3, held under P3.a, fixed under P3.c on 2026-11-17). The walk goes
|
|
217
|
-
// on from the host, whose ancestors can scroll as well.
|
|
218
|
-
const last = parents[parents.length - 1];
|
|
219
|
-
if (last && last.nodeType === 11 && last.host) {
|
|
220
|
-
parents = parents.concat([last.host], this.getParents(last.host));
|
|
221
|
-
}
|
|
222
|
-
const overflowRegex = /(auto|scroll)/;
|
|
223
|
-
const overflowCheck = (node) => {
|
|
224
|
-
let styleDeclaration = window['getComputedStyle'](node, null);
|
|
225
|
-
return overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowX')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowY'));
|
|
226
|
-
};
|
|
227
|
-
for (let parent of parents) {
|
|
228
|
-
let scrollSelectors = parent.nodeType === 1 && parent.dataset['scrollselectors'];
|
|
229
|
-
if (scrollSelectors) {
|
|
230
|
-
let selectors = scrollSelectors.split(',');
|
|
231
|
-
for (let selector of selectors) {
|
|
232
|
-
let el = this.findSingle(parent, selector);
|
|
233
|
-
if (el && overflowCheck(el)) {
|
|
234
|
-
scrollableParents.push(el);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
if (parent.nodeType === 1 && overflowCheck(parent)) {
|
|
239
|
-
scrollableParents.push(parent);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return scrollableParents;
|
|
395
|
+
return ɵgetScrollableParents(element);
|
|
244
396
|
}
|
|
245
397
|
static getHiddenElementOuterHeight(element) {
|
|
246
|
-
element
|
|
247
|
-
element.style.display = 'block';
|
|
248
|
-
let elementHeight = element.offsetHeight;
|
|
249
|
-
element.style.display = 'none';
|
|
250
|
-
element.style.visibility = 'visible';
|
|
251
|
-
return elementHeight;
|
|
398
|
+
return ɵgetHiddenElementOuterHeight(element);
|
|
252
399
|
}
|
|
253
400
|
static getHiddenElementOuterWidth(element) {
|
|
254
|
-
element
|
|
255
|
-
element.style.display = 'block';
|
|
256
|
-
let elementWidth = element.offsetWidth;
|
|
257
|
-
element.style.display = 'none';
|
|
258
|
-
element.style.visibility = 'visible';
|
|
259
|
-
return elementWidth;
|
|
401
|
+
return ɵgetHiddenElementOuterWidth(element);
|
|
260
402
|
}
|
|
261
403
|
static getHiddenElementDimensions(element) {
|
|
262
404
|
let dimensions = {};
|
|
@@ -334,12 +476,7 @@ class DomHandler {
|
|
|
334
476
|
return f.call(element, selector);
|
|
335
477
|
}
|
|
336
478
|
static getOuterWidth(el, margin) {
|
|
337
|
-
|
|
338
|
-
if (margin) {
|
|
339
|
-
let style = getComputedStyle(el);
|
|
340
|
-
width += parseFloat(style.marginLeft) + parseFloat(style.marginRight);
|
|
341
|
-
}
|
|
342
|
-
return width;
|
|
479
|
+
return ɵgetOuterWidth(el, margin);
|
|
343
480
|
}
|
|
344
481
|
static getHorizontalPadding(el) {
|
|
345
482
|
let style = getComputedStyle(el);
|
|
@@ -368,12 +505,7 @@ class DomHandler {
|
|
|
368
505
|
return height;
|
|
369
506
|
}
|
|
370
507
|
static getOuterHeight(el, margin) {
|
|
371
|
-
|
|
372
|
-
if (margin) {
|
|
373
|
-
let style = getComputedStyle(el);
|
|
374
|
-
height += parseFloat(style.marginTop) + parseFloat(style.marginBottom);
|
|
375
|
-
}
|
|
376
|
-
return height;
|
|
508
|
+
return ɵgetOuterHeight(el, margin);
|
|
377
509
|
}
|
|
378
510
|
static getHeight(el) {
|
|
379
511
|
let height = el.offsetHeight;
|
|
@@ -392,11 +524,7 @@ class DomHandler {
|
|
|
392
524
|
return { width: w, height: h };
|
|
393
525
|
}
|
|
394
526
|
static getOffset(el) {
|
|
395
|
-
|
|
396
|
-
return {
|
|
397
|
-
top: rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
|
|
398
|
-
left: rect.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0)
|
|
399
|
-
};
|
|
527
|
+
return ɵgetOffset(el);
|
|
400
528
|
}
|
|
401
529
|
static replaceElementWith(element, replacementElement) {
|
|
402
530
|
let parentNode = element.parentNode;
|
|
@@ -437,7 +565,7 @@ class DomHandler {
|
|
|
437
565
|
return /(android)/i.test(navigator.userAgent);
|
|
438
566
|
}
|
|
439
567
|
static isTouchDevice() {
|
|
440
|
-
return
|
|
568
|
+
return ɵisTouchDevice();
|
|
441
569
|
}
|
|
442
570
|
static appendChild(element, target) {
|
|
443
571
|
if (this.isElement(target))
|
|
@@ -462,7 +590,7 @@ class DomHandler {
|
|
|
462
590
|
element.remove();
|
|
463
591
|
}
|
|
464
592
|
static isElement(obj) {
|
|
465
|
-
return
|
|
593
|
+
return ɵisElement(obj);
|
|
466
594
|
}
|
|
467
595
|
static calculateScrollbarWidth(el) {
|
|
468
596
|
if (el) {
|
|
@@ -493,25 +621,10 @@ class DomHandler {
|
|
|
493
621
|
return scrollbarHeight;
|
|
494
622
|
}
|
|
495
623
|
static invokeElementMethod(element, methodName, args) {
|
|
496
|
-
|
|
624
|
+
ɵinvokeElementMethod(element, methodName, args);
|
|
497
625
|
}
|
|
498
626
|
static clearSelection() {
|
|
499
|
-
|
|
500
|
-
if (window.getSelection()?.empty) {
|
|
501
|
-
window.getSelection()?.empty();
|
|
502
|
-
}
|
|
503
|
-
else if (window.getSelection()?.removeAllRanges && (window.getSelection()?.rangeCount || 0) > 0 && (window.getSelection()?.getRangeAt(0)?.getClientRects()?.length || 0) > 0) {
|
|
504
|
-
window.getSelection()?.removeAllRanges();
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
else if (document['selection'] && document['selection'].empty) {
|
|
508
|
-
try {
|
|
509
|
-
document['selection'].empty();
|
|
510
|
-
}
|
|
511
|
-
catch (error) {
|
|
512
|
-
//ignore IE bug
|
|
513
|
-
}
|
|
514
|
-
}
|
|
627
|
+
ɵclearSelection();
|
|
515
628
|
}
|
|
516
629
|
static getBrowser() {
|
|
517
630
|
if (!this.browser) {
|
|
@@ -550,34 +663,19 @@ class DomHandler {
|
|
|
550
663
|
return !element || element.offsetParent === null;
|
|
551
664
|
}
|
|
552
665
|
static isVisible(element) {
|
|
553
|
-
return element
|
|
666
|
+
return ɵisVisible(element);
|
|
554
667
|
}
|
|
555
668
|
static isExist(element) {
|
|
556
669
|
return element !== null && typeof element !== 'undefined' && element.nodeName && element.parentNode;
|
|
557
670
|
}
|
|
558
671
|
static focus(element, options) {
|
|
559
|
-
element
|
|
672
|
+
ɵfocus(element, options);
|
|
560
673
|
}
|
|
561
674
|
static getFocusableSelectorString(selector = '') {
|
|
562
|
-
return
|
|
563
|
-
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
564
|
-
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
565
|
-
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
566
|
-
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
567
|
-
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
568
|
-
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
569
|
-
.p-inputtext:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector},
|
|
570
|
-
.p-button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${selector}`;
|
|
675
|
+
return ɵgetFocusableSelectorString(selector);
|
|
571
676
|
}
|
|
572
677
|
static getFocusableElements(element, selector = '') {
|
|
573
|
-
|
|
574
|
-
let visibleFocusableElements = [];
|
|
575
|
-
for (let focusableElement of focusableElements) {
|
|
576
|
-
const computedStyle = getComputedStyle(focusableElement);
|
|
577
|
-
if (this.isVisible(focusableElement) && computedStyle.display != 'none' && computedStyle.visibility != 'hidden')
|
|
578
|
-
visibleFocusableElements.push(focusableElement);
|
|
579
|
-
}
|
|
580
|
-
return visibleFocusableElements;
|
|
678
|
+
return ɵgetFocusableElements(element, selector);
|
|
581
679
|
}
|
|
582
680
|
static getFocusableElement(element, selector = '') {
|
|
583
681
|
let focusableElement = this.findSingle(element, this.getFocusableSelectorString(selector));
|
|
@@ -589,8 +687,7 @@ class DomHandler {
|
|
|
589
687
|
return null;
|
|
590
688
|
}
|
|
591
689
|
static getFirstFocusableElement(element, selector = '') {
|
|
592
|
-
|
|
593
|
-
return focusableElements.length > 0 ? focusableElements[0] : null;
|
|
690
|
+
return ɵgetFirstFocusableElement(element, selector);
|
|
594
691
|
}
|
|
595
692
|
static getLastFocusableElement(element, selector) {
|
|
596
693
|
const focusableElements = this.getFocusableElements(element, selector);
|
|
@@ -661,17 +758,7 @@ class DomHandler {
|
|
|
661
758
|
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
662
759
|
}
|
|
663
760
|
static getAttribute(element, name) {
|
|
664
|
-
|
|
665
|
-
const value = element.getAttribute(name);
|
|
666
|
-
if (!isNaN(value)) {
|
|
667
|
-
return +value;
|
|
668
|
-
}
|
|
669
|
-
if (value === 'true' || value === 'false') {
|
|
670
|
-
return value === 'true';
|
|
671
|
-
}
|
|
672
|
-
return value;
|
|
673
|
-
}
|
|
674
|
-
return undefined;
|
|
761
|
+
return ɵgetAttribute(element, name);
|
|
675
762
|
}
|
|
676
763
|
static calculateBodyScrollbarWidth() {
|
|
677
764
|
return window.innerWidth - document.documentElement.offsetWidth;
|
|
@@ -694,9 +781,7 @@ class DomHandler {
|
|
|
694
781
|
return undefined;
|
|
695
782
|
}
|
|
696
783
|
static setAttribute(element, attribute = '', value) {
|
|
697
|
-
|
|
698
|
-
element.setAttribute(attribute, value);
|
|
699
|
-
}
|
|
784
|
+
return ɵsetAttribute(element, attribute, value);
|
|
700
785
|
}
|
|
701
786
|
static setAttributes(element, attributes = {}) {
|
|
702
787
|
if (this.isElement(element)) {
|
|
@@ -765,7 +850,7 @@ class ConnectedOverlayScrollHandler {
|
|
|
765
850
|
this.listener = listener;
|
|
766
851
|
}
|
|
767
852
|
bindScrollListener() {
|
|
768
|
-
this.scrollableParents =
|
|
853
|
+
this.scrollableParents = ɵgetScrollableParents(this.element);
|
|
769
854
|
for (let i = 0; i < this.scrollableParents.length; i++) {
|
|
770
855
|
this.scrollableParents[i].addEventListener('scroll', this.listener);
|
|
771
856
|
}
|
|
@@ -789,5 +874,5 @@ class ConnectedOverlayScrollHandler {
|
|
|
789
874
|
* Generated bundle index. Do not edit.
|
|
790
875
|
*/
|
|
791
876
|
|
|
792
|
-
export { ConnectedOverlayScrollHandler, DomHandler, blockBodyScroll, unblockBodyScroll };
|
|
877
|
+
export { ConnectedOverlayScrollHandler, DomHandler, blockBodyScroll, unblockBodyScroll, ɵaddClass, ɵclearSelection, ɵfind, ɵfindSingle, ɵfocus, ɵgetAttribute, ɵgetFirstFocusableElement, ɵgetFocusableElements, ɵgetFocusableSelectorString, ɵgetHiddenElementOuterHeight, ɵgetHiddenElementOuterWidth, ɵgetOffset, ɵgetOuterHeight, ɵgetOuterWidth, ɵgetParents, ɵgetScrollableParents, ɵindex, ɵindexWithinGroup, ɵinvokeElementMethod, ɵisElement, ɵisTouchDevice, ɵisVisible, ɵnextZIndex, ɵremoveClass, ɵsetAttribute, ɵsiblings };
|
|
793
878
|
//# sourceMappingURL=anguless-angulux-dom.mjs.map
|