@openng/optimus-ui-utils 1.0.0 → 2.0.0-rc.0
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/dist/classnames/index.d.mts +3 -1
- package/dist/classnames/index.mjs +1 -1
- package/dist/classnames/index.mjs.map +1 -1
- package/dist/dom/index.d.mts +197 -108
- package/dist/dom/index.mjs +13 -13
- package/dist/dom/index.mjs.map +1 -1
- package/dist/eventbus/index.d.mts +8 -6
- package/dist/eventbus/index.mjs +1 -1
- package/dist/eventbus/index.mjs.map +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +1 -2
- package/dist/mergeprops/index.d.mts +3 -1
- package/dist/mergeprops/index.mjs +1 -1
- package/dist/mergeprops/index.mjs.map +1 -1
- package/dist/object/index.d.mts +87 -43
- package/dist/object/index.mjs +1 -5
- package/dist/object-BnaHlJGK.mjs +4 -0
- package/dist/object-BnaHlJGK.mjs.map +1 -0
- package/dist/uuid/index.d.mts +3 -1
- package/dist/uuid/index.mjs +1 -1
- package/dist/uuid/index.mjs.map +1 -1
- package/dist/zindex/index.d.mts +8 -6
- package/dist/zindex/index.mjs +1 -1
- package/dist/zindex/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/index.mjs.map +0 -1
- package/dist/object/index.mjs.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/classnames/index.d.ts
|
|
1
2
|
declare function cn(...args: any[]): string | undefined;
|
|
2
3
|
/**
|
|
3
4
|
* @deprecated Use `cn` instead.
|
|
@@ -5,5 +6,6 @@ declare function cn(...args: any[]): string | undefined;
|
|
|
5
6
|
* @returns
|
|
6
7
|
*/
|
|
7
8
|
declare function classNames(...args: any[]): string | undefined;
|
|
8
|
-
|
|
9
|
+
//#endregion
|
|
9
10
|
export { classNames, cn };
|
|
11
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(...t){if(t){let n=[];for(let r=0;r<t.length;r++){let i=t[r];if(!i)continue;let a=typeof i;if(a===`string`||a===`number`)n.push(i);else if(a===`object`){let t=Array.isArray(i)?[e(...i)]:Object.entries(i).map(([e,t])=>t?e:void 0);n=t.length?n.concat(t.filter(e=>!!e)):n}}return n.join(` `).trim()}}function t(...t){return e(...t)}export{t as classNames,e as cn};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/classnames/index.ts"],"sourcesContent":["export function cn(...args: any[]): string | undefined {\n if (args) {\n let classes: any = [];\n\n for (let i = 0; i < args.length; i++) {\n const className = args[i];\n\n if (!className) {\n continue;\n }\n\n const type = typeof className;\n\n if (type === 'string' || type === 'number') {\n classes.push(className);\n } else if (type === 'object') {\n const _classes = Array.isArray(className) ? [cn(...className)] : Object.entries(className).map(([key, value]) => (value ? key : undefined));\n\n classes = _classes.length ? classes.concat(_classes.filter((c) => !!c)) : classes;\n }\n }\n\n return classes.join(' ').trim();\n }\n\n return undefined;\n}\n\n/**\n * @deprecated Use `cn` instead.\n * @param args\n * @returns\n */\nexport function classNames(...args: any[]): string | undefined {\n return cn(...args);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/classnames/index.ts"],"sourcesContent":["export function cn(...args: any[]): string | undefined {\n if (args) {\n let classes: any = [];\n\n for (let i = 0; i < args.length; i++) {\n const className = args[i];\n\n if (!className) {\n continue;\n }\n\n const type = typeof className;\n\n if (type === 'string' || type === 'number') {\n classes.push(className);\n } else if (type === 'object') {\n const _classes = Array.isArray(className) ? [cn(...className)] : Object.entries(className).map(([key, value]) => (value ? key : undefined));\n\n classes = _classes.length ? classes.concat(_classes.filter((c) => !!c)) : classes;\n }\n }\n\n return classes.join(' ').trim();\n }\n\n return undefined;\n}\n\n/**\n * @deprecated Use `cn` instead.\n * @param args\n * @returns\n */\nexport function classNames(...args: any[]): string | undefined {\n return cn(...args);\n}\n"],"mappings":"AAAA,SAAgB,EAAG,GAAG,EAAiC,CACnD,GAAI,EAAM,CACN,IAAI,EAAe,CAAC,EAEpB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,OAAQ,IAAK,CAClC,IAAM,EAAY,EAAK,GAEvB,GAAI,CAAC,EACD,SAGJ,IAAM,EAAO,OAAO,EAEpB,GAAI,IAAS,UAAY,IAAS,SAC9B,EAAQ,KAAK,CAAS,OACnB,GAAI,IAAS,SAAU,CAC1B,IAAM,EAAW,MAAM,QAAQ,CAAS,EAAI,CAAC,EAAG,GAAG,CAAS,CAAC,EAAI,OAAO,QAAQ,CAAS,CAAC,CAAC,KAAK,CAAC,EAAK,KAAY,EAAQ,EAAM,IAAA,EAAU,EAE1I,EAAU,EAAS,OAAS,EAAQ,OAAO,EAAS,OAAQ,GAAM,CAAC,CAAC,CAAC,CAAC,EAAI,CAC9E,CACJ,CAEA,OAAO,EAAQ,KAAK,GAAG,CAAC,CAAC,KAAK,CAClC,CAGJ,CAOA,SAAgB,EAAW,GAAG,EAAiC,CAC3D,OAAO,EAAG,GAAG,CAAI,CACrB"}
|
package/dist/dom/index.d.mts
CHANGED
|
@@ -1,166 +1,231 @@
|
|
|
1
|
+
//#region src/dom/helpers/blockBodyScroll.d.ts
|
|
1
2
|
interface BlockBodyScrollOptions {
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
className?: string;
|
|
4
|
+
variableName?: string;
|
|
4
5
|
}
|
|
5
6
|
declare function blockBodyScroll(option: string | BlockBodyScrollOptions | undefined): void;
|
|
6
|
-
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/dom/helpers/exportCSV.d.ts
|
|
7
9
|
declare function exportCSV(csv: any, filename: string): void;
|
|
8
|
-
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/dom/helpers/saveAs.d.ts
|
|
9
12
|
declare function saveAs(file: {
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
name: string;
|
|
14
|
+
src: string;
|
|
12
15
|
}): boolean;
|
|
13
|
-
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/dom/helpers/unblockBodyScroll.d.ts
|
|
14
18
|
interface UnblockBodyScrollOptions {
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
className?: string;
|
|
20
|
+
variableName?: string;
|
|
17
21
|
}
|
|
18
22
|
declare function unblockBodyScroll(option: string | UnblockBodyScrollOptions | undefined): void;
|
|
19
|
-
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/dom/methods/absolutePosition.d.ts
|
|
20
25
|
declare function absolutePosition(element: HTMLElement, target: HTMLElement, gutter?: boolean): void;
|
|
21
|
-
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/dom/methods/addClass.d.ts
|
|
22
28
|
declare function addClass(element: Element, className: string | undefined | null | (string | undefined | null)[]): void;
|
|
23
|
-
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/dom/methods/addStyle.d.ts
|
|
24
31
|
declare function addStyle(element: HTMLElement, style: string | object): void;
|
|
25
|
-
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/dom/methods/alignOverlay.d.ts
|
|
26
34
|
declare function alignOverlay(overlay: HTMLElement, target: HTMLElement, appendTo: string, calculateMinWidth?: boolean): void;
|
|
27
|
-
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/dom/methods/appendChild.d.ts
|
|
28
37
|
declare function appendChild(element: unknown, child: Node | Element): void;
|
|
29
|
-
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/dom/methods/calculateBodyScrollbarWidth.d.ts
|
|
30
40
|
declare function calculateBodyScrollbarWidth(): number;
|
|
31
|
-
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/dom/methods/calculateScrollbarHeight.d.ts
|
|
32
43
|
declare function calculateScrollbarHeight(element?: HTMLElement): number;
|
|
33
|
-
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/dom/methods/calculateScrollbarWidth.d.ts
|
|
34
46
|
declare function calculateScrollbarWidth(element?: HTMLElement): number;
|
|
35
|
-
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/dom/methods/clearSelection.d.ts
|
|
36
49
|
declare function clearSelection(): void;
|
|
37
|
-
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/dom/methods/createElement.d.ts
|
|
38
52
|
declare function createElement(type: string, attributes?: Record<string, unknown>, ...children: (string | Node)[]): HTMLElement | undefined;
|
|
39
|
-
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/dom/methods/createStyleAsString.d.ts
|
|
40
55
|
/**
|
|
41
56
|
* @deprecated Use `createStyleMarkup` instead.
|
|
42
57
|
*/
|
|
43
58
|
declare function createStyleAsString(css?: string, options?: Record<string, unknown>): string;
|
|
44
|
-
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/dom/methods/createStyleElement.d.ts
|
|
45
61
|
declare function createStyleElement(css: string, attributes?: Record<string, unknown>, container?: Element): HTMLStyleElement;
|
|
46
|
-
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/dom/methods/createStyleMarkup.d.ts
|
|
47
64
|
declare function createStyleMarkup(css?: string, attributes?: Record<string, unknown>): string;
|
|
48
|
-
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/dom/methods/createStyleTag.d.ts
|
|
49
67
|
/**
|
|
50
68
|
* @deprecated Use `createStyleElement` instead.
|
|
51
69
|
*/
|
|
52
70
|
declare function createStyleTag(attributes?: Record<string, unknown>, container?: Element): HTMLStyleElement;
|
|
53
|
-
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/dom/methods/fadeIn.d.ts
|
|
54
73
|
declare function fadeIn(element: HTMLElement, duration: number): void;
|
|
55
|
-
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/dom/methods/fadeOut.d.ts
|
|
56
76
|
declare function fadeOut(element: HTMLElement, duration: number): void;
|
|
57
|
-
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/dom/methods/find.d.ts
|
|
58
79
|
declare function find(element: Element, selector: string): Element[];
|
|
59
|
-
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/dom/methods/findSingle.d.ts
|
|
60
82
|
declare function findSingle(element: Element, selector: string): Element | null;
|
|
61
|
-
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/dom/methods/focus.d.ts
|
|
62
85
|
declare function focus(element: HTMLElement, options?: FocusOptions): void;
|
|
63
|
-
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/dom/methods/getAttribute.d.ts
|
|
64
88
|
declare function getAttribute(element: Element, name: string): any;
|
|
65
|
-
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/dom/methods/getBrowser.d.ts
|
|
66
91
|
type BrowserType = {
|
|
67
|
-
|
|
92
|
+
[key: string]: string | boolean | undefined;
|
|
68
93
|
};
|
|
69
94
|
declare function getBrowser(): BrowserType;
|
|
70
|
-
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/dom/methods/getBrowserLanguage.d.ts
|
|
71
97
|
declare function getBrowserLanguage(): string;
|
|
72
|
-
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/dom/methods/getCSSProperty.d.ts
|
|
73
100
|
declare function getCSSProperty(element?: HTMLElement, property?: string, inline?: boolean): string | null;
|
|
74
|
-
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/dom/methods/getCSSVariableByRegex.d.ts
|
|
75
103
|
declare function getCSSVariableByRegex(variableRegex: RegExp): {
|
|
76
|
-
|
|
77
|
-
|
|
104
|
+
name: string | undefined;
|
|
105
|
+
value: string | undefined;
|
|
78
106
|
} | null;
|
|
79
|
-
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/dom/methods/getCursorOffset.d.ts
|
|
80
109
|
declare function getCursorOffset(element: Element, prevText: string, nextText: string, currentText: string): {
|
|
81
|
-
|
|
82
|
-
|
|
110
|
+
top: number | string;
|
|
111
|
+
left: number | string;
|
|
83
112
|
};
|
|
84
|
-
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/dom/methods/getFirstFocusableElement.d.ts
|
|
85
115
|
declare function getFirstFocusableElement(element: Element, selector?: string): Element | null;
|
|
86
|
-
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/dom/methods/getFocusableElements.d.ts
|
|
87
118
|
declare function getFocusableElements(element: Element, selector?: string): Element[];
|
|
88
|
-
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/dom/methods/getHeight.d.ts
|
|
89
121
|
declare function getHeight(element: HTMLElement): number;
|
|
90
|
-
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/dom/methods/getHiddenElementDimensions.d.ts
|
|
91
124
|
declare function getHiddenElementDimensions(element?: HTMLElement): {
|
|
92
|
-
|
|
93
|
-
|
|
125
|
+
width: number;
|
|
126
|
+
height: number;
|
|
94
127
|
};
|
|
95
|
-
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/dom/methods/getHiddenElementOuterHeight.d.ts
|
|
96
130
|
declare function getHiddenElementOuterHeight(element: HTMLElement): number;
|
|
97
|
-
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/dom/methods/getHiddenElementOuterWidth.d.ts
|
|
98
133
|
declare function getHiddenElementOuterWidth(element: HTMLElement): number;
|
|
99
|
-
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/dom/methods/getIndex.d.ts
|
|
100
136
|
declare function getIndex(element: HTMLElement): number;
|
|
101
|
-
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/dom/methods/getInnerWidth.d.ts
|
|
102
139
|
declare function getInnerWidth(element: HTMLElement): number;
|
|
103
|
-
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/dom/methods/getLastFocusableElement.d.ts
|
|
104
142
|
declare function getLastFocusableElement(element: Element, selector?: string): Element | null;
|
|
105
|
-
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/dom/methods/getNextElementSibling.d.ts
|
|
106
145
|
declare function getNextElementSibling(element: Element, selector: string): Element | null;
|
|
107
|
-
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/dom/methods/getNextFocusableElement.d.ts
|
|
108
148
|
declare function getNextFocusableElement(container: Element, element: Element, selector?: string): Element | null;
|
|
109
|
-
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/dom/methods/getOffset.d.ts
|
|
110
151
|
declare function getOffset(element?: Element | null): {
|
|
111
|
-
|
|
112
|
-
|
|
152
|
+
top: number | string;
|
|
153
|
+
left: number | string;
|
|
113
154
|
};
|
|
114
|
-
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/dom/methods/getOuterHeight.d.ts
|
|
115
157
|
declare function getOuterHeight(element: HTMLElement, margin?: boolean): number;
|
|
116
|
-
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/dom/methods/getOuterWidth.d.ts
|
|
117
160
|
declare function getOuterWidth(element: unknown, margin?: boolean): number;
|
|
118
|
-
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/dom/methods/getParentNode.d.ts
|
|
119
163
|
declare function getParentNode(element: Node): ParentNode | null;
|
|
120
|
-
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/dom/methods/getParents.d.ts
|
|
121
166
|
declare function getParents(element: Node, parents?: ParentNode[]): ParentNode[];
|
|
122
|
-
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/dom/methods/getPreviousElementSibling.d.ts
|
|
123
169
|
declare function getPreviousElementSibling(element: Element, selector: string): Element | null;
|
|
124
|
-
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/dom/methods/getScrollLeft.d.ts
|
|
125
172
|
declare function getScrollLeft(element?: HTMLElement): number;
|
|
126
|
-
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/dom/methods/getScrollableParents.d.ts
|
|
127
175
|
declare function getScrollableParents(element: Element): Element[];
|
|
128
|
-
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/dom/methods/getSelection.d.ts
|
|
129
178
|
declare function getSelection(): string | undefined;
|
|
130
|
-
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/dom/methods/getTargetElement.d.ts
|
|
131
181
|
declare function getTargetElement(target: unknown, currentElement?: Element): Window | Document | Element | null | undefined;
|
|
132
|
-
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/dom/methods/getUserAgent.d.ts
|
|
133
184
|
declare function getUserAgent(): string;
|
|
134
|
-
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/dom/methods/getViewport.d.ts
|
|
135
187
|
declare function getViewport(): {
|
|
136
|
-
|
|
137
|
-
|
|
188
|
+
width: number;
|
|
189
|
+
height: number;
|
|
138
190
|
};
|
|
139
|
-
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/dom/methods/getWidth.d.ts
|
|
140
193
|
declare function getWidth(element: HTMLElement): number;
|
|
141
|
-
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/dom/methods/getWindowScrollLeft.d.ts
|
|
142
196
|
declare function getWindowScrollLeft(): number;
|
|
143
|
-
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/dom/methods/getWindowScrollTop.d.ts
|
|
144
199
|
declare function getWindowScrollTop(): number;
|
|
145
|
-
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/dom/methods/hasCSSAnimation.d.ts
|
|
146
202
|
declare function hasCSSAnimation(element: Element): boolean;
|
|
147
|
-
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/dom/methods/hasCSSTransition.d.ts
|
|
148
205
|
declare function hasCSSTransition(element: Element): boolean;
|
|
149
|
-
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region src/dom/methods/hasClass.d.ts
|
|
150
208
|
declare function hasClass(element: Element, className: string): boolean;
|
|
151
|
-
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/dom/methods/invokeElementMethod.d.ts
|
|
152
211
|
declare function invokeElementMethod<T extends keyof Element>(element: Element, methodName: T, args?: unknown[]): void;
|
|
153
|
-
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region src/dom/methods/isAndroid.d.ts
|
|
154
214
|
declare function isAndroid(): boolean;
|
|
155
|
-
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/dom/methods/isAttributeEquals.d.ts
|
|
156
217
|
declare function isAttributeEquals(element: Element, name: string, value: any): boolean;
|
|
157
|
-
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/dom/methods/isAttributeNotEquals.d.ts
|
|
158
220
|
declare function isAttributeNotEquals(element: Element, name: string, value: any): boolean;
|
|
159
|
-
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/dom/methods/isClickable.d.ts
|
|
160
223
|
declare function isClickable(element: Element): boolean;
|
|
161
|
-
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/dom/methods/isClient.d.ts
|
|
162
226
|
declare function isClient(): boolean;
|
|
163
|
-
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/dom/methods/isCssSupported.d.ts
|
|
164
229
|
/**
|
|
165
230
|
* Checks if a given CSS property-value pair is supported by the browser.
|
|
166
231
|
*
|
|
@@ -184,56 +249,79 @@ declare function isCssSupported(condition: string): boolean;
|
|
|
184
249
|
* @returns True if supported, false otherwise
|
|
185
250
|
*/
|
|
186
251
|
declare function isCssSupported(input: keyof CSSStyleDeclaration | string, value?: string): boolean;
|
|
187
|
-
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/dom/methods/isElement.d.ts
|
|
188
254
|
declare function isElement(element: unknown): element is Element;
|
|
189
|
-
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/dom/methods/isExist.d.ts
|
|
190
257
|
declare function isExist(element: Node): boolean;
|
|
191
|
-
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region src/dom/methods/isFocusableElement.d.ts
|
|
192
260
|
declare function isFocusableElement(element: unknown, selector?: string): boolean;
|
|
193
|
-
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region src/dom/methods/isHidden.d.ts
|
|
194
263
|
declare function isHidden(element: HTMLElement): boolean;
|
|
195
|
-
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/dom/methods/isIOS.d.ts
|
|
196
266
|
declare function isIOS(): boolean;
|
|
197
|
-
|
|
267
|
+
//#endregion
|
|
268
|
+
//#region src/dom/methods/isPrefersReducedMotion.d.ts
|
|
198
269
|
declare function isPrefersReducedMotion(): boolean;
|
|
199
|
-
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region src/dom/methods/isRTL.d.ts
|
|
200
272
|
declare function isRTL(element?: HTMLElement): boolean;
|
|
201
|
-
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region src/dom/methods/isServer.d.ts
|
|
202
275
|
declare function isServer(): boolean;
|
|
203
|
-
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/dom/methods/isTouchDevice.d.ts
|
|
204
278
|
declare function isTouchDevice(): boolean;
|
|
205
|
-
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region src/dom/methods/isVisible.d.ts
|
|
206
281
|
declare function isVisible(element?: HTMLElement): boolean;
|
|
207
|
-
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region src/dom/methods/nestedPosition.d.ts
|
|
208
284
|
declare function nestedPosition(element: HTMLElement, level: number): void;
|
|
209
|
-
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region src/dom/methods/nextFrame.d.ts
|
|
210
287
|
declare function nextFrame(): Promise<void>;
|
|
211
|
-
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region src/dom/methods/relativePosition.d.ts
|
|
212
290
|
declare function relativePosition(element: HTMLElement, target: HTMLElement, gutter?: boolean, fixedOrigin?: 'top' | 'bottom' | undefined): void;
|
|
213
|
-
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region src/dom/methods/remove.d.ts
|
|
214
293
|
declare function remove(element: Element): void;
|
|
215
|
-
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/dom/methods/removeChild.d.ts
|
|
216
296
|
declare function removeChild(element: unknown, child: Node): void;
|
|
217
|
-
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/dom/methods/removeClass.d.ts
|
|
218
299
|
declare function removeClass(element: Element, className: string | undefined | null | (string | undefined | null)[]): void;
|
|
219
|
-
|
|
300
|
+
//#endregion
|
|
301
|
+
//#region src/dom/methods/removeStyleTag.d.ts
|
|
220
302
|
declare function removeStyleTag(element: Node): Node | null;
|
|
221
|
-
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/dom/methods/resolveUserAgent.d.ts
|
|
222
305
|
declare function resolveUserAgent(): {
|
|
223
|
-
|
|
224
|
-
|
|
306
|
+
browser: string | undefined;
|
|
307
|
+
version: string | undefined;
|
|
225
308
|
};
|
|
226
|
-
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region src/dom/methods/scrollInView.d.ts
|
|
227
311
|
declare function scrollInView(container: HTMLElement, item: HTMLElement): void;
|
|
228
|
-
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/dom/methods/setAttribute.d.ts
|
|
229
314
|
declare function setAttribute(element: HTMLElement, attribute: string, value: any): void;
|
|
230
|
-
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/dom/methods/setAttributes.d.ts
|
|
231
317
|
declare function setAttributes(element: HTMLElement, attributes?: {
|
|
232
|
-
|
|
318
|
+
[key: string]: any;
|
|
233
319
|
}): void;
|
|
234
|
-
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region src/dom/methods/setCSSProperty.d.ts
|
|
235
322
|
declare function setCSSProperty(element?: HTMLElement, property?: string, value?: any, priority?: string): void;
|
|
236
|
-
|
|
323
|
+
//#endregion
|
|
324
|
+
//#region src/dom/methods/toElement.d.ts
|
|
237
325
|
/**
|
|
238
326
|
* Converts various framework-specific element references to a DOM HTMLElement
|
|
239
327
|
*
|
|
@@ -241,5 +329,6 @@ declare function setCSSProperty(element?: HTMLElement, property?: string, value?
|
|
|
241
329
|
* @returns The resolved HTMLElement or undefined if not found
|
|
242
330
|
*/
|
|
243
331
|
declare function toElement(ref: unknown): HTMLElement | undefined;
|
|
244
|
-
|
|
332
|
+
//#endregion
|
|
245
333
|
export { absolutePosition, addClass, addStyle, alignOverlay, appendChild, blockBodyScroll, calculateBodyScrollbarWidth, calculateScrollbarHeight, calculateScrollbarWidth, clearSelection, createElement, createStyleAsString, createStyleElement, createStyleMarkup, createStyleTag, exportCSV, fadeIn, fadeOut, find, findSingle, focus, getAttribute, getBrowser, getBrowserLanguage, getCSSProperty, getCSSVariableByRegex, getCursorOffset, getFirstFocusableElement, getFocusableElements, getHeight, getHiddenElementDimensions, getHiddenElementOuterHeight, getHiddenElementOuterWidth, getIndex, getInnerWidth, getLastFocusableElement, getNextElementSibling, getNextFocusableElement, getOffset, getOuterHeight, getOuterWidth, getParentNode, getParents, getPreviousElementSibling, getScrollLeft, getScrollableParents, getSelection, getTargetElement, getUserAgent, getViewport, getWidth, getWindowScrollLeft, getWindowScrollTop, hasCSSAnimation, hasCSSTransition, hasClass, invokeElementMethod, isAndroid, isAttributeEquals, isAttributeNotEquals, isClickable, isClient, isCssSupported, isElement, isExist, isFocusableElement, isHidden, isIOS, isPrefersReducedMotion, isRTL, isServer, isTouchDevice, isVisible, nestedPosition, nextFrame, relativePosition, remove, removeChild, removeClass, removeStyleTag, resolveUserAgent, saveAs, scrollInView, setAttribute, setAttributes, setCSSProperty, toElement, unblockBodyScroll };
|
|
334
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/dom/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
function R(t,e){return t?t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className):!1}function P(t,e){if(t&&e){let o=n=>{R(t,n)||(t.classList?t.classList.add(n):t.className+=" "+n)};[e].flat().filter(Boolean).forEach(n=>n.split(" ").forEach(o))}}function B(){return window.innerWidth-document.documentElement.offsetWidth}function lt(t){typeof t=="string"?P(document.body,t||"p-overflow-hidden"):(t!=null&&t.variableName&&document.body.style.setProperty(t.variableName,B()+"px"),P(document.body,(t==null?void 0:t.className)||"p-overflow-hidden"))}function k(t){if(t){let e=document.createElement("a");if(e.download!==void 0){let{name:o,src:n}=t;return e.setAttribute("href",n),e.setAttribute("download",o),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e),!0}}return!1}function at(t,e){let o=new Blob([t],{type:"application/csv;charset=utf-8;"});window.navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(o,e+".csv"):k({name:e+".csv",src:URL.createObjectURL(o)})||(t="data:text/csv;charset=utf-8,"+t,window.open(encodeURI(t)))}function M(t,e){if(t&&e){let o=n=>{t.classList?t.classList.remove(n):t.className=t.className.replace(new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi")," ")};[e].flat().filter(Boolean).forEach(n=>n.split(" ").forEach(o))}}function dt(t){typeof t=="string"?M(document.body,t||"p-overflow-hidden"):(t!=null&&t.variableName&&document.body.style.removeProperty(t.variableName),M(document.body,(t==null?void 0:t.className)||"p-overflow-hidden"))}function w(t){for(let e of document==null?void 0:document.styleSheets)try{for(let o of e==null?void 0:e.cssRules)for(let n of o==null?void 0:o.style)if(t.test(n))return{name:n,value:o.style.getPropertyValue(n).trim()}}catch(o){}return null}function S(t){let e={width:0,height:0};if(t){let[o,n]=[t.style.visibility,t.style.display],r=t.getBoundingClientRect();t.style.visibility="hidden",t.style.display="block",e.width=r.width||t.offsetWidth,e.height=r.height||t.offsetHeight,t.style.display=n,t.style.visibility=o}return e}function y(){let t=window,e=document,o=e.documentElement,n=e.getElementsByTagName("body")[0],r=t.innerWidth||o.clientWidth||n.clientWidth,i=t.innerHeight||o.clientHeight||n.clientHeight;return{width:r,height:i}}function E(t){return t?Math.abs(t.scrollLeft):0}function $(){let t=document.documentElement;return(window.pageXOffset||E(t))-(t.clientLeft||0)}function D(){let t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}function I(t){return t?getComputedStyle(t).direction==="rtl":!1}function V(t,e,o=!0){var n,r,i,s;if(t){let a=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:S(t),l=a.height,d=a.width,f=e.offsetHeight,c=e.offsetWidth,u=e.getBoundingClientRect(),g=D(),x=$(),st=y(),W,F,nt="top";u.top+f+l>st.height?(W=u.top+g-l,nt="bottom",W<0&&(W=g)):W=f+u.top+g,u.left+d>st.width?F=Math.max(0,u.left+x+c-d):F=u.left+x,I(t)?t.style.insetInlineEnd=F+"px":t.style.insetInlineStart=F+"px",t.style.top=W+"px",t.style.transformOrigin=nt,o&&(t.style.marginTop=nt==="bottom"?`calc(${(r=(n=w(/-anchor-gutter$/))==null?void 0:n.value)!=null?r:"2px"} * -1)`:(s=(i=w(/-anchor-gutter$/))==null?void 0:i.value)!=null?s:"")}}function v(t,e){t&&(typeof e=="string"?t.style.cssText=e:Object.entries(e||{}).forEach(([o,n])=>t.style[o]=n))}function T(t,e){if(t instanceof HTMLElement){let o=t.offsetWidth;if(e){let n=getComputedStyle(t);o+=parseFloat(n.marginLeft)+parseFloat(n.marginRight)}return o}return 0}function U(t,e,o=!0,n=void 0){var r;if(t){let i=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:S(t),s=e.offsetHeight,a=e.getBoundingClientRect(),l=y(),d,f,c=n!=null?n:"top";if(!n&&a.top+s+i.height>l.height?(d=-1*i.height,c="bottom",a.top+d<0&&(d=-1*a.top)):d=s,i.width>l.width?f=a.left*-1:a.left+i.width>l.width?f=(a.left+i.width-l.width)*-1:f=0,t.style.top=d+"px",t.style.insetInlineStart=f+"px",t.style.transformOrigin=c,o){let u=(r=w(/-anchor-gutter$/))==null?void 0:r.value;t.style.marginTop=c==="bottom"?`calc(${u!=null?u:"2px"} * -1)`:u!=null?u:""}}}function ft(t,e,o,n=!0){t&&e&&(o==="self"?U(t,e):(n&&(t.style.minWidth=T(e)+"px"),V(t,e)))}function h(t){if(t){let e=t.parentNode;return e&&e instanceof ShadowRoot&&e.host&&(e=e.host),e}return null}function C(t){return!!(t!==null&&typeof t!="undefined"&&t.nodeName&&h(t))}import{resolve as oe}from"@openng/optimus-ui-utils/object";function p(t){return typeof Element!="undefined"?t instanceof Element:t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"}function H(t){if(p(t))return t;if(!t||typeof t!="object")return;let e=t;return e=t.nativeElement,e=oe(e),p(e)?e:void 0}function j(t,e){var o,n,r;if(t)switch(t){case"document":return document;case"window":return window;case"body":return document.body;case"@next":return e==null?void 0:e.nextElementSibling;case"@prev":return e==null?void 0:e.previousElementSibling;case"@first":return e==null?void 0:e.firstElementChild;case"@last":return e==null?void 0:e.lastElementChild;case"@child":return(o=e==null?void 0:e.children)==null?void 0:o[0];case"@parent":return e==null?void 0:e.parentElement;case"@grandparent":return(n=e==null?void 0:e.parentElement)==null?void 0:n.parentElement;default:{if(typeof t=="string"){let l=t.match(/^@child\[(\d+)]/);return l?((r=e==null?void 0:e.children)==null?void 0:r[parseInt(l[1],10)])||null:document.querySelector(t)||null}let s=(l=>typeof l=="function"&&"call"in l&&"apply"in l)(t)?t():t,a=H(s);return C(a)?a:(s==null?void 0:s.nodeType)===9?s:void 0}}}function ut(t,e){let o=j(t,e);if(o)o.appendChild(e);else throw new Error("Cannot append "+e+" to "+t)}var rt;function pt(t){if(t){let e=getComputedStyle(t);return t.offsetHeight-t.clientHeight-parseFloat(e.borderTopWidth)-parseFloat(e.borderBottomWidth)}else{if(rt!=null)return rt;let e=document.createElement("div");v(e,{width:"100px",height:"100px",overflow:"scroll",position:"absolute",top:"-9999px"}),document.body.appendChild(e);let o=e.offsetHeight-e.clientHeight;return document.body.removeChild(e),rt=o,o}}var it;function A(t){if(t){let e=getComputedStyle(t);return t.offsetWidth-t.clientWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.borderRightWidth)}else{if(it!=null)return it;let e=document.createElement("div");v(e,{width:"100px",height:"100px",overflow:"scroll",position:"absolute",top:"-9999px"}),document.body.appendChild(e);let o=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),it=o,o}}function ct(){if(window.getSelection){let t=window.getSelection()||{};t.empty?t.empty():t.removeAllRanges&&t.rangeCount>0&&t.getRangeAt(0).getClientRects().length>0&&t.removeAllRanges()}}function O(t,e={}){if(p(t)){let o=(r,i)=>{var a,l;let s=(a=t==null?void 0:t.$attrs)!=null&&a[r]?[(l=t==null?void 0:t.$attrs)==null?void 0:l[r]]:[];return[i].flat().reduce((d,f)=>{if(f!=null){let c=typeof f;if(c==="string"||c==="number")d.push(f);else if(c==="object"){let u=Array.isArray(f)?o(r,f):Object.entries(f).map(([g,x])=>r==="style"&&(x||x===0)?`${g.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${x}`:x?g:void 0);d=u.length?d.concat(u.filter(g=>!!g)):d}}return d},s)},n=r=>{o("style",r).forEach(s=>{let a=s.indexOf(":");if(a<0)return;let l=s.slice(0,a).trim(),d=s.slice(a+1).trim();l&&t.style.setProperty(l,d)})};Object.entries(e).forEach(([r,i])=>{if(i!=null){let s=r.match(/^on(.+)/);s?t.addEventListener(s[1].toLowerCase(),i):r==="p-bind"||r==="pBind"?O(t,i):r==="style"?(n(i),(t.$attrs=t.$attrs||{})&&(t.$attrs[r]=t.style.cssText)):(i=r==="class"?[...new Set(o("class",i))].join(" ").trim():i,(t.$attrs=t.$attrs||{})&&(t.$attrs[r]=i),t.setAttribute(r,i))}})}}function q(t,e={},...o){if(t){let n=document.createElement(t);return O(n,e),n.append(...o),n}}function X(t,e={}){return t?`<style${Object.entries(e).reduce((o,[n,r])=>o+` ${n}="${r}"`,"")}>${t}</style>`:""}function mt(t,e={}){return X(t,e)}function z(t,e={},o){let n=q("style",e,t);return o==null||o.appendChild(n),n}function gt(t={},e){return z("",t,e||document.head)}function yt(t,e){if(t){t.style.opacity="0";let o=+new Date,n="0",r=function(){n=`${+t.style.opacity+(new Date().getTime()-o)/e}`,t.style.opacity=n,o=+new Date,+n<1&&("requestAnimationFrame"in window?requestAnimationFrame(r):setTimeout(r,16))};r()}}function ht(t,e){if(t){let o=1,n=50,r=n/e,i=setInterval(()=>{o-=r,o<=0&&(o=0,clearInterval(i)),t.style.opacity=o.toString()},n)}}function Y(t,e){return p(t)?Array.from(t.querySelectorAll(e)):[]}function Z(t,e){return p(t)?t.matches(e)?t:t.querySelector(e):null}function bt(t,e){t&&document.activeElement!==t&&t.focus(e)}function Q(t,e){if(p(t)){let o=t.getAttribute(e);return isNaN(o)?o==="true"||o==="false"?o==="true":o:+o}}function G(){let t=navigator.userAgent.toLowerCase(),e=/(chrome)[ ]([\w.]+)/.exec(t)||/(webkit)[ ]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[];return{browser:e[1]||"",version:e[2]||"0"}}var m=null;function xt(){if(!m){m={};let t=G();t.browser&&(m[t.browser]=!0,m.version=t.version),m.chrome?m.webkit=!0:m.webkit&&(m.safari=!0)}return m}function wt(){return navigator.languages&&navigator.languages.length&&navigator.languages[0]||navigator.language||"en"}function Et(t,e,o){var n;return t&&e?o?(n=t==null?void 0:t.style)==null?void 0:n.getPropertyValue(e):getComputedStyle(t).getPropertyValue(e):null}function St(t,e,o,n){if(t){let r=getComputedStyle(t),i=document.createElement("div");i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.visibility="hidden",i.style.pointerEvents="none",i.style.overflow=r.overflow,i.style.width=r.width,i.style.height=r.height,i.style.padding=r.padding,i.style.border=r.border,i.style.overflowWrap=r.overflowWrap,i.style.whiteSpace=r.whiteSpace,i.style.lineHeight=r.lineHeight,i.innerHTML=e.replace(/\r\n|\r|\n/g,"<br />");let s=document.createElement("span");s.textContent=n,i.appendChild(s);let a=document.createTextNode(o);i.appendChild(a),document.body.appendChild(i);let{offsetLeft:l,offsetTop:d,clientHeight:f}=s;return document.body.removeChild(i),{left:Math.abs(l-t.scrollLeft),top:Math.abs(d-t.scrollTop)+f}}return{top:"auto",left:"auto"}}function b(t,e=""){let o=Y(t,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e},
|
|
2
|
-
[href]:not([tabindex = "-1"]):not([style*="display:none"]):not([hidden])${
|
|
3
|
-
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${
|
|
4
|
-
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${
|
|
5
|
-
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${
|
|
6
|
-
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${
|
|
7
|
-
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${
|
|
8
|
-
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${
|
|
9
|
-
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${
|
|
10
|
-
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${
|
|
11
|
-
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${
|
|
12
|
-
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${
|
|
13
|
-
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${
|
|
1
|
+
import{resolve as e}from"@openng/optimus-ui-utils/object";function t(e,t){return e?e.classList?e.classList.contains(t):RegExp(`(^| )`+t+`( |$)`,`gi`).test(e.className):!1}function n(e,n){if(e&&n){let r=n=>{t(e,n)||(e.classList?e.classList.add(n):e.className+=` `+n)};[n].flat().filter(Boolean).forEach(e=>e.split(` `).forEach(r))}}function r(){return window.innerWidth-document.documentElement.offsetWidth}function i(e){typeof e==`string`?n(document.body,e||`p-overflow-hidden`):(e?.variableName&&document.body.style.setProperty(e.variableName,r()+`px`),n(document.body,e?.className||`p-overflow-hidden`))}function a(e){if(e){let t=document.createElement(`a`);if(t.download!==void 0){let{name:n,src:r}=e;return t.setAttribute(`href`,r),t.setAttribute(`download`,n),t.style.display=`none`,document.body.appendChild(t),t.click(),document.body.removeChild(t),!0}}return!1}function o(e,t){let n=new Blob([e],{type:`application/csv;charset=utf-8;`});window.navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(n,t+`.csv`):a({name:t+`.csv`,src:URL.createObjectURL(n)})||(e=`data:text/csv;charset=utf-8,`+e,window.open(encodeURI(e)))}function s(e,t){if(e&&t){let n=t=>{e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(^|\\b)`+t.split(` `).join(`|`)+`(\\b|$)`,`gi`),` `)};[t].flat().filter(Boolean).forEach(e=>e.split(` `).forEach(n))}}function c(e){typeof e==`string`?s(document.body,e||`p-overflow-hidden`):(e?.variableName&&document.body.style.removeProperty(e.variableName),s(document.body,e?.className||`p-overflow-hidden`))}function l(e){for(let t of document?.styleSheets)try{for(let n of t?.cssRules)for(let t of n?.style)if(e.test(t))return{name:t,value:n.style.getPropertyValue(t).trim()}}catch{}return null}function u(e){let t={width:0,height:0};if(e){let[n,r]=[e.style.visibility,e.style.display],i=e.getBoundingClientRect();e.style.visibility=`hidden`,e.style.display=`block`,t.width=i.width||e.offsetWidth,t.height=i.height||e.offsetHeight,e.style.display=r,e.style.visibility=n}return t}function d(){let e=window,t=document,n=t.documentElement,r=t.getElementsByTagName(`body`)[0];return{width:e.innerWidth||n.clientWidth||r.clientWidth,height:e.innerHeight||n.clientHeight||r.clientHeight}}function f(e){return e?Math.abs(e.scrollLeft):0}function p(){let e=document.documentElement;return(window.pageXOffset||f(e))-(e.clientLeft||0)}function m(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}function h(e){return e?getComputedStyle(e).direction===`rtl`:!1}function g(e,t,n=!0){if(e){let r=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:u(e),i=r.height,a=r.width,o=t.offsetHeight,s=t.offsetWidth,c=t.getBoundingClientRect(),f=m(),g=p(),_=d(),v,y,b=`top`;c.top+o+i>_.height?(v=c.top+f-i,b=`bottom`,v<0&&(v=f)):v=o+c.top+f,y=c.left+a>_.width?Math.max(0,c.left+g+s-a):c.left+g,h(e)?e.style.insetInlineEnd=y+`px`:e.style.insetInlineStart=y+`px`,e.style.top=v+`px`,e.style.transformOrigin=b,n&&(e.style.marginTop=b===`bottom`?`calc(${l(/-anchor-gutter$/)?.value??`2px`} * -1)`:l(/-anchor-gutter$/)?.value??``)}}function _(e,t){e&&(typeof t==`string`?e.style.cssText=t:Object.entries(t||{}).forEach(([t,n])=>e.style[t]=n))}function v(e,t){if(e instanceof HTMLElement){let n=e.offsetWidth;if(t){let t=getComputedStyle(e);n+=parseFloat(t.marginLeft)+parseFloat(t.marginRight)}return n}return 0}function y(e,t,n=!0,r=void 0){if(e){let i=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:u(e),a=t.offsetHeight,o=t.getBoundingClientRect(),s=d(),c,f,p=r??`top`;if(!r&&o.top+a+i.height>s.height?(c=-1*i.height,p=`bottom`,o.top+c<0&&(c=-1*o.top)):c=a,f=i.width>s.width?o.left*-1:o.left+i.width>s.width?(o.left+i.width-s.width)*-1:0,e.style.top=c+`px`,e.style.insetInlineStart=f+`px`,e.style.transformOrigin=p,n){let t=l(/-anchor-gutter$/)?.value;e.style.marginTop=p===`bottom`?`calc(${t??`2px`} * -1)`:t??``}}}function b(e,t,n,r=!0){e&&t&&(n===`self`?y(e,t):(r&&(e.style.minWidth=v(t)+`px`),g(e,t)))}function x(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function S(e){return!!(e!=null&&e.nodeName&&x(e))}function C(e){return typeof Element<`u`?e instanceof Element:typeof e==`object`&&!!e&&e.nodeType===1&&typeof e.nodeName==`string`}function w(t){if(C(t))return t;if(!t||typeof t!=`object`)return;let n=t;return n=t.nativeElement,n=e(n),C(n)?n:void 0}function T(e,t){if(e)switch(e){case`document`:return document;case`window`:return window;case`body`:return document.body;case`@next`:return t?.nextElementSibling;case`@prev`:return t?.previousElementSibling;case`@first`:return t?.firstElementChild;case`@last`:return t?.lastElementChild;case`@child`:return t?.children?.[0];case`@parent`:return t?.parentElement;case`@grandparent`:return t?.parentElement?.parentElement;default:{if(typeof e==`string`){let n=e.match(/^@child\[(\d+)]/);return n?t?.children?.[parseInt(n[1],10)]||null:document.querySelector(e)||null}let n=(e=>typeof e==`function`&&`call`in e&&`apply`in e)(e)?e():e,r=w(n);return S(r)?r:n?.nodeType===9?n:void 0}}}function ee(e,t){let n=T(e,t);if(n)n.appendChild(t);else throw Error(`Cannot append `+t+` to `+e)}let E;function D(e){if(e){let t=getComputedStyle(e);return e.offsetHeight-e.clientHeight-parseFloat(t.borderTopWidth)-parseFloat(t.borderBottomWidth)}else{if(E!=null)return E;let e=document.createElement(`div`);_(e,{width:`100px`,height:`100px`,overflow:`scroll`,position:`absolute`,top:`-9999px`}),document.body.appendChild(e);let t=e.offsetHeight-e.clientHeight;return document.body.removeChild(e),E=t,t}}let O;function k(e){if(e){let t=getComputedStyle(e);return e.offsetWidth-e.clientWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.borderRightWidth)}else{if(O!=null)return O;let e=document.createElement(`div`);_(e,{width:`100px`,height:`100px`,overflow:`scroll`,position:`absolute`,top:`-9999px`}),document.body.appendChild(e);let t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),O=t,t}}function te(){if(window.getSelection){let e=window.getSelection()||{};e.empty?e.empty():e.removeAllRanges&&e.rangeCount>0&&e.getRangeAt(0).getClientRects().length>0&&e.removeAllRanges()}}function A(e,t={}){if(C(e)){let n=(t,r)=>{let i=e?.$attrs?.[t]?[e?.$attrs?.[t]]:[];return[r].flat().reduce((e,r)=>{if(r!=null){let i=typeof r;if(i===`string`||i===`number`)e.push(r);else if(i===`object`){let i=Array.isArray(r)?n(t,r):Object.entries(r).map(([e,n])=>t===`style`&&(n||n===0)?`${e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}:${n}`:n?e:void 0);e=i.length?e.concat(i.filter(e=>!!e)):e}}return e},i)},r=t=>{n(`style`,t).forEach(t=>{let n=t.indexOf(`:`);if(n<0)return;let r=t.slice(0,n).trim(),i=t.slice(n+1).trim();r&&e.style.setProperty(r,i)})};Object.entries(t).forEach(([t,i])=>{if(i!=null){let a=t.match(/^on(.+)/);a?e.addEventListener(a[1].toLowerCase(),i):t===`p-bind`||t===`pBind`?A(e,i):t===`style`?(r(i),(e.$attrs=e.$attrs||{})&&(e.$attrs[t]=e.style.cssText)):(i=t===`class`?[...new Set(n(`class`,i))].join(` `).trim():i,(e.$attrs=e.$attrs||{})&&(e.$attrs[t]=i),e.setAttribute(t,i))}})}}function j(e,t={},...n){if(e){let r=document.createElement(e);return A(r,t),r.append(...n),r}}function M(e,t={}){return e?`<style${Object.entries(t).reduce((e,[t,n])=>e+` ${t}="${n}"`,``)}>${e}</style>`:``}function ne(e,t={}){return M(e,t)}function N(e,t={},n){let r=j(`style`,t,e);return n?.appendChild(r),r}function re(e={},t){return N(``,e,t||document.head)}function P(e,t){if(e){e.style.opacity=`0`;let n=+new Date,r=`0`,i=function(){r=`${+e.style.opacity+(new Date().getTime()-n)/t}`,e.style.opacity=r,n=+new Date,+r<1&&(`requestAnimationFrame`in window?requestAnimationFrame(i):setTimeout(i,16))};i()}}function F(e,t){if(e){let n=1,r=50/t,i=setInterval(()=>{n-=r,n<=0&&(n=0,clearInterval(i)),e.style.opacity=n.toString()},50)}}function I(e,t){return C(e)?Array.from(e.querySelectorAll(t)):[]}function L(e,t){return C(e)?e.matches(t)?e:e.querySelector(t):null}function ie(e,t){e&&document.activeElement!==e&&e.focus(t)}function R(e,t){if(C(e)){let n=e.getAttribute(t);return isNaN(n)?n===`true`||n===`false`?n===`true`:n:+n}}function z(){let e=navigator.userAgent.toLowerCase(),t=/(chrome)[ ]([\w.]+)/.exec(e)||/(webkit)[ ]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf(`compatible`)<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||``,version:t[2]||`0`}}let B=null;function ae(){if(!B){B={};let e=z();e.browser&&(B[e.browser]=!0,B.version=e.version),B.chrome?B.webkit=!0:B.webkit&&(B.safari=!0)}return B}function oe(){return navigator.languages&&navigator.languages.length&&navigator.languages[0]||navigator.language||`en`}function se(e,t,n){return e&&t?n?e?.style?.getPropertyValue(t):getComputedStyle(e).getPropertyValue(t):null}function V(e,t,n,r){if(e){let i=getComputedStyle(e),a=document.createElement(`div`);a.style.position=`absolute`,a.style.top=`0px`,a.style.left=`0px`,a.style.visibility=`hidden`,a.style.pointerEvents=`none`,a.style.overflow=i.overflow,a.style.width=i.width,a.style.height=i.height,a.style.padding=i.padding,a.style.border=i.border,a.style.overflowWrap=i.overflowWrap,a.style.whiteSpace=i.whiteSpace,a.style.lineHeight=i.lineHeight,a.innerHTML=t.replace(/\r\n|\r|\n/g,`<br />`);let o=document.createElement(`span`);o.textContent=r,a.appendChild(o);let s=document.createTextNode(n);a.appendChild(s),document.body.appendChild(a);let{offsetLeft:c,offsetTop:l,clientHeight:u}=o;return document.body.removeChild(a),{left:Math.abs(c-e.scrollLeft),top:Math.abs(l-e.scrollTop)+u}}return{top:`auto`,left:`auto`}}function H(e,t=``){let n=I(e,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
2
|
+
[href]:not([tabindex = "-1"]):not([style*="display:none"]):not([hidden])${t},
|
|
3
|
+
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
4
|
+
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
5
|
+
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
6
|
+
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
7
|
+
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}`),r=[];for(let e of n)getComputedStyle(e).display!=`none`&&getComputedStyle(e).visibility!=`hidden`&&r.push(e);return r}function U(e,t){let n=H(e,t);return n.length>0?n[0]:null}function W(e){if(e){let t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t}return 0}function G(e){if(e){let[t,n]=[e.style.visibility,e.style.display];e.style.visibility=`hidden`,e.style.display=`block`;let r=e.offsetHeight;return e.style.display=n,e.style.visibility=t,r}return 0}function K(e){if(e){let[t,n]=[e.style.visibility,e.style.display];e.style.visibility=`hidden`,e.style.display=`block`;let r=e.offsetWidth;return e.style.display=n,e.style.visibility=t,r}return 0}function ce(e){if(e){let t=x(e)?.childNodes,n=0;if(t)for(let r=0;r<t.length;r++){if(t[r]===e)return n;t[r].nodeType===1&&n++}}return-1}function le(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.borderLeft)+parseFloat(n.borderRight),t}return 0}function ue(e,t){let n=H(e,t);return n.length>0?n[n.length-1]:null}function de(e,t){let n=e.nextElementSibling;for(;n;)if(n.matches(t))return n;else n=n.nextElementSibling;return null}function fe(e,t,n){let r=H(e,n),i=r.length>0?r.findIndex(e=>e===t):-1,a=i>-1&&r.length>=i+1?i+1:-1;return a>-1?r[a]:null}function q(e){if(e){let t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:t.left+(window.pageXOffset||f(document.documentElement)||f(document.body)||0)}}return{top:`auto`,left:`auto`}}function J(e,t){if(e){let n=e.offsetHeight;if(t){let t=getComputedStyle(e);n+=parseFloat(t.marginTop)+parseFloat(t.marginBottom)}return n}return 0}function Y(e,t=[]){let n=x(e);return n===null?t:Y(n,t.concat([n]))}function pe(e,t){let n=e.previousElementSibling;for(;n;)if(n.matches(t))return n;else n=n.previousElementSibling;return null}function me(e){let t=[];if(e){let n=Y(e),r=/(auto|scroll)/,i=e=>{try{let t=window.getComputedStyle(e,null);return r.test(t.getPropertyValue(`overflow`))||r.test(t.getPropertyValue(`overflowX`))||r.test(t.getPropertyValue(`overflowY`))}catch{return!1}};for(let e of n){let n=e.nodeType===1&&e.dataset.scrollselectors;if(n){let r=n.split(`,`);for(let n of r){let r=L(e,n);r&&i(r)&&t.push(r)}}e.nodeType!==9&&i(e)&&t.push(e)}}return t}function he(){if(window.getSelection)return window.getSelection().toString();if(document.getSelection)return document.getSelection().toString()}function ge(){return navigator.userAgent}function _e(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),t}return 0}function ve(e){if(e){let t=getComputedStyle(e);return parseFloat(t.getPropertyValue(`animation-duration`)||`0`)>0}return!1}function ye(e){if(e){let t=getComputedStyle(e);return parseFloat(t.getPropertyValue(`transition-duration`)||`0`)>0}return!1}function be(e,t,n){let r=e[t];typeof r==`function`&&r.apply(e,n??[])}function xe(){return/(android)/i.test(navigator.userAgent)}function X(e,t,n){return C(e)?R(e,t)===n:!1}function Se(e,t,n){return!X(e,t,n)}function Ce(e){if(e){let t=e.nodeName,n=e.parentElement&&e.parentElement.nodeName;return t===`INPUT`||t===`TEXTAREA`||t===`BUTTON`||t===`A`||n===`INPUT`||n===`TEXTAREA`||n===`BUTTON`||n===`A`||!!e.closest(`.p-button, .p-checkbox, .p-radiobutton`)}return!1}function Z(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}function we(e,t){if(typeof CSS>`u`||!CSS.supports)return!1;if(t!==void 0){let n=e.toString().replace(/[A-Z]/g,e=>`-`+e.toLowerCase());return CSS.supports(n,t)}return CSS.supports(e.toString())}function Te(e,t=``){return C(e)?e.matches(`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
8
|
+
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
9
|
+
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
10
|
+
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
11
|
+
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
12
|
+
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
13
|
+
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}`):!1}function Q(e){return!!(e&&e.offsetParent!=null)}function Ee(e){return!Q(e)}function De(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!(`MSStream`in window)}function $(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Oe(){return!Z()}function ke(){return`ontouchstart`in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function Ae(e,t){if(e){let n=e.parentElement,r=q(n),i=d(),a=e.offsetParent?e.offsetWidth:K(e),o=e.offsetParent?e.offsetHeight:G(e),s=v(n?.children?.[0]),c=J(n?.children?.[0]),l=``,u=``;r.left+s+a>i.width-k()?r.left<a?t%2==1?l=r.left?`-`+r.left+`px`:`100%`:t%2==0&&(l=i.width-a-k()+`px`):l=`-100%`:l=`100%`,u=e.getBoundingClientRect().top+c+o>i.height?`-${o-c}px`:`0px`,e.style.top=u,e.style.insetInlineStart=l}}function je(){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(e)})})}function Me(e){e&&(`remove`in Element.prototype?e.remove():e.parentNode?.removeChild(e))}function Ne(e,t){let n=w(e);if(n)n.removeChild(t);else throw Error(`Cannot remove `+t+` from `+e)}function Pe(e){if(S(e)){try{e.parentNode?.removeChild(e)}catch{}return null}return e}function Fe(e,t){let n=getComputedStyle(e).getPropertyValue(`borderTopWidth`),r=n?parseFloat(n):0,i=getComputedStyle(e).getPropertyValue(`paddingTop`),a=i?parseFloat(i):0,o=e.getBoundingClientRect(),s=t.getBoundingClientRect().top+document.body.scrollTop-(o.top+document.body.scrollTop)-r-a,c=e.scrollTop,l=e.clientHeight,u=J(t);s<0?e.scrollTop=c+s:s+u>l&&(e.scrollTop=c+s-l+u)}function Ie(e,t=``,n){if(C(e)&&n!=null){if(t===`style`){typeof n==`string`?e.style.cssText=n:typeof n==`object`&&Object.entries(n).forEach(([t,n])=>{if(n==null)return;let r=t.startsWith(`--`)?t:t.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase();e.style.setProperty(r,String(n))});return}e.setAttribute(t,n)}}function Le(e,t,n=null,r){t&&e?.style?.setProperty(t,n,r)}export{g as absolutePosition,n as addClass,_ as addStyle,b as alignOverlay,ee as appendChild,i as blockBodyScroll,r as calculateBodyScrollbarWidth,D as calculateScrollbarHeight,k as calculateScrollbarWidth,te as clearSelection,j as createElement,ne as createStyleAsString,N as createStyleElement,M as createStyleMarkup,re as createStyleTag,o as exportCSV,P as fadeIn,F as fadeOut,I as find,L as findSingle,ie as focus,R as getAttribute,ae as getBrowser,oe as getBrowserLanguage,se as getCSSProperty,l as getCSSVariableByRegex,V as getCursorOffset,U as getFirstFocusableElement,H as getFocusableElements,W as getHeight,u as getHiddenElementDimensions,G as getHiddenElementOuterHeight,K as getHiddenElementOuterWidth,ce as getIndex,le as getInnerWidth,ue as getLastFocusableElement,de as getNextElementSibling,fe as getNextFocusableElement,q as getOffset,J as getOuterHeight,v as getOuterWidth,x as getParentNode,Y as getParents,pe as getPreviousElementSibling,f as getScrollLeft,me as getScrollableParents,he as getSelection,T as getTargetElement,ge as getUserAgent,d as getViewport,_e as getWidth,p as getWindowScrollLeft,m as getWindowScrollTop,ve as hasCSSAnimation,ye as hasCSSTransition,t as hasClass,be as invokeElementMethod,xe as isAndroid,X as isAttributeEquals,Se as isAttributeNotEquals,Ce as isClickable,Z as isClient,we as isCssSupported,C as isElement,S as isExist,Te as isFocusableElement,Ee as isHidden,De as isIOS,$ as isPrefersReducedMotion,h as isRTL,Oe as isServer,ke as isTouchDevice,Q as isVisible,Ae as nestedPosition,je as nextFrame,y as relativePosition,Me as remove,Ne as removeChild,s as removeClass,Pe as removeStyleTag,z as resolveUserAgent,a as saveAs,Fe as scrollInView,Ie as setAttribute,A as setAttributes,Le as setCSSProperty,w as toElement,c as unblockBodyScroll};
|
|
14
14
|
//# sourceMappingURL=index.mjs.map
|