@kizmann/pico-js 2.0.7 → 2.0.9
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/pico-js.browser.js +1 -1
- package/dist/pico-js.browser.js.map +1 -1
- package/dist/pico-js.esm.js +1 -1
- package/dist/pico-js.esm.js.map +1 -1
- package/package.json +4 -6
- package/src/dom/{DomAttribute.js → DomAttribute.ts} +40 -63
- package/src/dom/{DomBuilder.js → DomBuilder.ts} +27 -44
- package/src/dom/{DomEvent.js → DomEvent.ts} +101 -76
- package/src/dom/{DomFinder.js → DomFinder.ts} +103 -139
- package/src/dom/DomForm.ts +38 -0
- package/src/dom/{DomGlobal.js → DomGlobal.ts} +34 -51
- package/src/dom/{DomInview.js → DomInview.ts} +37 -57
- package/src/dom/DomMeta.ts +48 -0
- package/src/dom/DomObserver.ts +17 -0
- package/src/dom/{DomPopover.js → DomPopover.ts} +20 -39
- package/src/dom/{DomRectangle.js → DomRectangle.ts} +70 -87
- package/src/format/{FormatFile.js → FormatFile.ts} +12 -23
- package/src/format/{FormatOption.js → FormatOption.ts} +15 -24
- package/src/format/{FormatParam.js → FormatParam.ts} +14 -25
- package/src/format/{FormatParser.js → FormatParser.ts} +29 -39
- package/src/format/{FormatUrl.js → FormatUrl.ts} +9 -21
- package/src/index.browser.ts +32 -0
- package/src/index.esm.ts +64 -0
- package/src/now/{NowDefault.js → NowDefault.ts} +86 -121
- package/src/now/{NowFormat.js → NowFormat.ts} +23 -28
- package/src/now/{NowGrid.js → NowGrid.ts} +41 -58
- package/src/now/{NowHuman.js → NowHuman.ts} +18 -27
- package/src/now/{NowMatch.js → NowMatch.ts} +22 -28
- package/src/now/{NowRange.js → NowRange.ts} +13 -22
- package/src/now/{NowWalker.js → NowWalker.ts} +65 -71
- package/src/tool/{scope.js → scope.ts} +41 -11
- package/src/utils/{Array.js → Array.ts} +187 -152
- package/src/utils/{Cookie.js → Cookie.ts} +15 -12
- package/src/utils/{Data.js → Data.ts} +17 -17
- package/src/utils/Dom.ts +204 -0
- package/src/utils/Format.ts +48 -0
- package/src/utils/{Hash.js → Hash.ts} +20 -20
- package/src/utils/{Locale.js → Locale.ts} +21 -21
- package/src/utils/{Mixed.js → Mixed.ts} +104 -61
- package/src/utils/{Now.js → Now.ts} +68 -69
- package/src/utils/{Number.js → Number.ts} +34 -36
- package/src/utils/{Object.js → Object.ts} +68 -122
- package/src/utils/{Route.js → Route.ts} +11 -9
- package/src/utils/{Runner.js → Runner.ts} +89 -77
- package/src/utils/{Signal.js → Signal.ts} +35 -22
- package/src/utils/{String.js → String.ts} +79 -69
- package/src/wip/{Element.js → Element.ts} +2 -2
- package/src/wip/{Map.js → Map.ts} +1 -1
- package/types/dom/DomAttribute.d.ts +16 -27
- package/types/dom/DomBuilder.d.ts +6 -9
- package/types/dom/DomEvent.d.ts +19 -24
- package/types/dom/DomFinder.d.ts +38 -61
- package/types/dom/DomForm.d.ts +7 -10
- package/types/dom/DomGlobal.d.ts +8 -15
- package/types/dom/DomInview.d.ts +9 -19
- package/types/dom/DomMeta.d.ts +9 -16
- package/types/dom/DomObserver.d.ts +4 -8
- package/types/dom/DomPopover.d.ts +8 -11
- package/types/dom/DomRectangle.d.ts +21 -35
- package/types/format/FormatFile.d.ts +5 -8
- package/types/format/FormatOption.d.ts +6 -8
- package/types/format/FormatParam.d.ts +6 -9
- package/types/format/FormatParser.d.ts +10 -18
- package/types/format/FormatUrl.d.ts +5 -8
- package/types/index.esm.d.ts +25 -37
- package/types/now/NowDefault.d.ts +30 -99
- package/types/now/NowFormat.d.ts +8 -21
- package/types/now/NowGrid.d.ts +24 -46
- package/types/now/NowHuman.d.ts +10 -11
- package/types/now/NowMatch.d.ts +6 -4
- package/types/now/NowRange.d.ts +5 -8
- package/types/now/NowWalker.d.ts +6 -4
- package/types/tool/scope.d.ts +11 -3
- package/types/utils/Array.d.ts +83 -101
- package/types/utils/Cookie.d.ts +11 -8
- package/types/utils/Data.d.ts +7 -7
- package/types/utils/Dom.d.ts +63 -96
- package/types/utils/Format.d.ts +15 -28
- package/types/utils/Hash.d.ts +21 -21
- package/types/utils/Locale.d.ts +9 -9
- package/types/utils/Mixed.d.ts +19 -32
- package/types/utils/Now.d.ts +51 -56
- package/types/utils/Number.d.ts +9 -20
- package/types/utils/Object.d.ts +21 -36
- package/types/utils/Route.d.ts +5 -2
- package/types/utils/Runner.d.ts +45 -38
- package/types/utils/Signal.d.ts +16 -16
- package/types/utils/String.d.ts +40 -76
- package/src/dom/DomForm.js +0 -59
- package/src/dom/DomMeta.js +0 -68
- package/src/dom/DomObserver.js +0 -38
- package/src/index.browser.js +0 -36
- package/src/index.esm.js +0 -80
- package/src/utils/Dom.js +0 -214
- package/src/utils/Format.js +0 -62
- package/types/wip/Element.d.ts +0 -119
- package/types/wip/Map.d.ts +0 -254
package/types/dom/DomEvent.d.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
static $events: any[];
|
|
1
|
+
import { PicoDom, PicoDomInterface } from "../utils/Dom.ts";
|
|
2
|
+
import PicoDomFinder from "./DomFinder.js";
|
|
3
|
+
import PicoDomRectangle from "./DomRectangle.js";
|
|
4
|
+
export interface PicoDomEvent extends PicoDomInterface, PicoDomFinder, PicoDomRectangle {
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
8
7
|
* @memberof PicoDom
|
|
9
|
-
* @extends {PicoDom}
|
|
10
8
|
*/
|
|
11
|
-
export class
|
|
9
|
+
export declare class PicoDomEvent {
|
|
10
|
+
/**
|
|
11
|
+
* @type {any[]}
|
|
12
|
+
*/
|
|
13
|
+
static $events: any[];
|
|
12
14
|
/**
|
|
13
15
|
* Bind event listener
|
|
14
16
|
*
|
|
15
17
|
* @example Dom.bind(el, "click", cb)
|
|
16
18
|
*
|
|
17
|
-
* @param {
|
|
19
|
+
* @param {any} el Target element
|
|
18
20
|
* @param {string} event Event name
|
|
19
21
|
* @param {function} cb Callback fn
|
|
20
22
|
* @param {string} [selector] Event selector
|
|
@@ -22,26 +24,26 @@ export class PicoDomEventInstance {
|
|
|
22
24
|
* @param {any} [options] Listener options
|
|
23
25
|
* @returns {PicoDom} Current instance
|
|
24
26
|
*/
|
|
25
|
-
bind(el:
|
|
27
|
+
bind(el: any, event: string, cb: Function, selector?: string, pause?: boolean, options?: any): PicoDom;
|
|
26
28
|
/**
|
|
27
29
|
* Unbind event listener
|
|
28
30
|
*
|
|
29
31
|
* @example Dom.unbind(el, "click")
|
|
30
32
|
*
|
|
31
|
-
* @param {
|
|
33
|
+
* @param {any} el Target element
|
|
32
34
|
* @param {string} event Event name
|
|
33
35
|
* @param {string} [selector] Event selector
|
|
34
36
|
* @param {any} [options] Listener options
|
|
35
37
|
* @returns {PicoDom} Current instance
|
|
36
38
|
*/
|
|
37
|
-
unbind(el:
|
|
39
|
+
unbind(el: any, event: string, selector?: string, options?: any): PicoDom;
|
|
38
40
|
/**
|
|
39
41
|
* Listen to event
|
|
40
42
|
*
|
|
41
43
|
* @example Dom.find("div").on("click", cb)
|
|
42
44
|
*
|
|
43
45
|
* @param {any} event Event name
|
|
44
|
-
* @param {
|
|
46
|
+
* @param {Function} cb Callback fn
|
|
45
47
|
* @param {any} [options] Listener options
|
|
46
48
|
* @param {boolean} [pause] Pause listener
|
|
47
49
|
* @param {string} [selector] Event selector
|
|
@@ -74,7 +76,7 @@ export class PicoDomEventInstance {
|
|
|
74
76
|
* @example Dom.find("div").once("click", cb)
|
|
75
77
|
*
|
|
76
78
|
* @param {any} event Event name
|
|
77
|
-
* @param {
|
|
79
|
+
* @param {Function} cb Callback fn
|
|
78
80
|
* @param {any} [options] Listener options
|
|
79
81
|
* @returns {PicoDom} Current instance
|
|
80
82
|
*/
|
|
@@ -86,7 +88,7 @@ export class PicoDomEventInstance {
|
|
|
86
88
|
*
|
|
87
89
|
* @param {any} event Event name
|
|
88
90
|
* @param {string} selector Event selector
|
|
89
|
-
* @param {
|
|
91
|
+
* @param {Function} cb Callback fn
|
|
90
92
|
* @param {any} [options] Listener options
|
|
91
93
|
* @param {boolean} [pause] Pause listener
|
|
92
94
|
* @returns {PicoDom} Current instance
|
|
@@ -101,14 +103,7 @@ export class PicoDomEventInstance {
|
|
|
101
103
|
* @param {object} [detail] Event detail
|
|
102
104
|
* @returns {PicoDom} Current instance
|
|
103
105
|
*/
|
|
104
|
-
fire(event: string, detail?:
|
|
105
|
-
|
|
106
|
-
* @see PicoDom.once
|
|
107
|
-
*/
|
|
108
|
-
one(...args: any[]): PicoDom;
|
|
109
|
-
delayed(): void;
|
|
110
|
-
pause(): void;
|
|
111
|
-
unpause(): void;
|
|
106
|
+
fire(event: string, detail?: any): PicoDom;
|
|
107
|
+
pointerdown(button?: number): this;
|
|
112
108
|
}
|
|
113
|
-
export
|
|
114
|
-
import { PicoDom } from "../utils/Dom.js";
|
|
109
|
+
export default PicoDomEvent;
|
package/types/dom/DomFinder.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { PicoDomInterface, PicoDom } from "../utils/Dom.ts";
|
|
2
|
+
export interface PicoDomFinder extends PicoDomInterface {
|
|
3
|
+
}
|
|
1
4
|
/**
|
|
2
5
|
* @memberof PicoDom
|
|
3
6
|
*/
|
|
4
|
-
export class
|
|
7
|
+
export declare class PicoDomFinder {
|
|
5
8
|
/**
|
|
6
9
|
* Filter nodes by type
|
|
7
10
|
*
|
|
@@ -9,19 +12,18 @@ export class PicoDomFinderStatic {
|
|
|
9
12
|
*
|
|
10
13
|
* @param {any} nodes Source nodes
|
|
11
14
|
* @param {number} [filter] Node type
|
|
12
|
-
* @returns {Array<
|
|
15
|
+
* @returns {Array<any>} Filtered nodes
|
|
13
16
|
*/
|
|
14
|
-
static filterNodes(nodes: any, filter?: number): Array<
|
|
17
|
+
static filterNodes(nodes: any, filter?: number): Array<any>;
|
|
15
18
|
/**
|
|
16
19
|
* Get nodes at point
|
|
17
20
|
*
|
|
18
21
|
* @example Dom.getNodePoint(100, 100)
|
|
19
22
|
*
|
|
20
|
-
* @param {
|
|
21
|
-
* @
|
|
22
|
-
* @returns {Array<Element>} Nodes at point
|
|
23
|
+
* @param {any} event Event data
|
|
24
|
+
* @returns {Array<any>} Nodes at point
|
|
23
25
|
*/
|
|
24
|
-
static getNodePoint(
|
|
26
|
+
static getNodePoint(event: any): Array<any>;
|
|
25
27
|
/**
|
|
26
28
|
* Get target by selector
|
|
27
29
|
*
|
|
@@ -29,24 +31,9 @@ export class PicoDomFinderStatic {
|
|
|
29
31
|
*
|
|
30
32
|
* @param {string} selector Node selector
|
|
31
33
|
* @param {any} [event] Event object
|
|
32
|
-
* @returns {
|
|
33
|
-
*/
|
|
34
|
-
static getNodeEvent(selector: string, event?: any): Element;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* @memberof PicoDom
|
|
38
|
-
* @extends {PicoDom}
|
|
39
|
-
*/
|
|
40
|
-
export class PicoDomFinderInstance {
|
|
41
|
-
/**
|
|
42
|
-
* Resolve input elements
|
|
43
|
-
*
|
|
44
|
-
* @example Dom._constructFinder(".item")
|
|
45
|
-
*
|
|
46
|
-
* @param {any} el Input value
|
|
47
|
-
* @returns {any} Resolved elements
|
|
34
|
+
* @returns {any} Found element
|
|
48
35
|
*/
|
|
49
|
-
static
|
|
36
|
+
static getNodeEvent(selector: string, event?: any): any;
|
|
50
37
|
/**
|
|
51
38
|
* Get node type
|
|
52
39
|
*
|
|
@@ -90,9 +77,9 @@ export class PicoDomFinderInstance {
|
|
|
90
77
|
*
|
|
91
78
|
* @param {number} [type] Node type
|
|
92
79
|
* @param {any} [fallback] Fallback value
|
|
93
|
-
* @returns {Array<
|
|
80
|
+
* @returns {Array<any>} Child nodes
|
|
94
81
|
*/
|
|
95
|
-
getNodeChilds(type?: number, fallback?: any): Array<
|
|
82
|
+
getNodeChilds(type?: number, fallback?: any): Array<any>;
|
|
96
83
|
/**
|
|
97
84
|
* Filter instances nodes
|
|
98
85
|
*
|
|
@@ -102,25 +89,24 @@ export class PicoDomFinderInstance {
|
|
|
102
89
|
* @returns {PicoDom} Current instance
|
|
103
90
|
*/
|
|
104
91
|
sanatize(filter?: number): PicoDom;
|
|
105
|
-
els: any;
|
|
106
92
|
/**
|
|
107
93
|
* Filter elements by selector
|
|
108
94
|
*
|
|
109
95
|
* @example Dom.find("div").filter(".active")
|
|
110
96
|
*
|
|
111
97
|
* @param {any} selector Filter selector
|
|
112
|
-
* @returns {Array<
|
|
98
|
+
* @returns {Array<any>} Filtered nodes
|
|
113
99
|
*/
|
|
114
|
-
filter(selector: any): Array<
|
|
100
|
+
filter(selector: any): Array<any>;
|
|
115
101
|
/**
|
|
116
102
|
* Exclude elements by selector
|
|
117
103
|
*
|
|
118
104
|
* @example Dom.find("div").except(".active")
|
|
119
105
|
*
|
|
120
106
|
* @param {any} selector Exclude selector
|
|
121
|
-
* @returns {Array<
|
|
107
|
+
* @returns {Array<any>} Filtered nodes
|
|
122
108
|
*/
|
|
123
|
-
except(selector: any): Array<
|
|
109
|
+
except(selector: any): Array<any>;
|
|
124
110
|
/**
|
|
125
111
|
* Find elements in instance
|
|
126
112
|
*
|
|
@@ -133,7 +119,7 @@ export class PicoDomFinderInstance {
|
|
|
133
119
|
/**
|
|
134
120
|
* Get element by index
|
|
135
121
|
*
|
|
136
|
-
* @example Dom.find("div").get(0) // =>
|
|
122
|
+
* @example Dom.find("div").get(0) // => HTMLElement
|
|
137
123
|
*
|
|
138
124
|
* @param {number} [index] Node index
|
|
139
125
|
* @returns {any} Found element
|
|
@@ -142,7 +128,7 @@ export class PicoDomFinderInstance {
|
|
|
142
128
|
/**
|
|
143
129
|
* Get first element
|
|
144
130
|
*
|
|
145
|
-
* @example Dom.find("div").first() // =>
|
|
131
|
+
* @example Dom.find("div").first() // => HTMLElement
|
|
146
132
|
*
|
|
147
133
|
* @param {number} [offset] Node offset
|
|
148
134
|
* @returns {any} Found element
|
|
@@ -151,7 +137,7 @@ export class PicoDomFinderInstance {
|
|
|
151
137
|
/**
|
|
152
138
|
* Get last element
|
|
153
139
|
*
|
|
154
|
-
* @example Dom.find("div").last() // =>
|
|
140
|
+
* @example Dom.find("div").last() // => HTMLElement
|
|
155
141
|
*
|
|
156
142
|
* @param {number} [offset] Node offset
|
|
157
143
|
* @returns {any} Found element
|
|
@@ -162,7 +148,7 @@ export class PicoDomFinderInstance {
|
|
|
162
148
|
*
|
|
163
149
|
* @example Dom.find("div").each((el) => console.log(el))
|
|
164
150
|
*
|
|
165
|
-
* @param {
|
|
151
|
+
* @param {Function} cb Callback fn
|
|
166
152
|
* @returns {PicoDom} Current instance
|
|
167
153
|
*/
|
|
168
154
|
each(cb: Function): PicoDom;
|
|
@@ -171,7 +157,7 @@ export class PicoDomFinderInstance {
|
|
|
171
157
|
*
|
|
172
158
|
* @example Dom.find("div").loopParent((el) => console.log(el))
|
|
173
159
|
*
|
|
174
|
-
* @param {
|
|
160
|
+
* @param {Function} cb Callback fn
|
|
175
161
|
* @param {any} [boundry] Loop limit
|
|
176
162
|
* @returns {PicoDom} Current instance
|
|
177
163
|
*/
|
|
@@ -193,7 +179,7 @@ export class PicoDomFinderInstance {
|
|
|
193
179
|
* @param {number} [filter] Node type
|
|
194
180
|
* @returns {PicoDom} Child instance
|
|
195
181
|
*/
|
|
196
|
-
child(selector
|
|
182
|
+
child(selector?: any, filter?: number): PicoDom;
|
|
197
183
|
/**
|
|
198
184
|
* Get child elements
|
|
199
185
|
*
|
|
@@ -201,18 +187,26 @@ export class PicoDomFinderInstance {
|
|
|
201
187
|
*
|
|
202
188
|
* @param {any} [selector] Child selector
|
|
203
189
|
* @param {number} [filter] Node type
|
|
204
|
-
* @returns {Array<
|
|
190
|
+
* @returns {Array<any>} Child elements
|
|
205
191
|
*/
|
|
206
|
-
childs(selector?: any, filter?: number): Array<
|
|
192
|
+
childs(selector?: any, filter?: number): Array<any>;
|
|
207
193
|
/**
|
|
208
194
|
* Get closest element
|
|
209
195
|
*
|
|
210
196
|
* @example Dom.find("div").closest(".container")
|
|
211
197
|
*
|
|
212
198
|
* @param {any} selector Target selector
|
|
213
|
-
* @returns {
|
|
199
|
+
* @returns {any} Found element
|
|
200
|
+
*/
|
|
201
|
+
closest(selector: any): any;
|
|
202
|
+
/**
|
|
203
|
+
* Get closest instance
|
|
204
|
+
*
|
|
205
|
+
* @example Dom.find("div").upnode(".container")
|
|
206
|
+
*
|
|
207
|
+
* @param {any} selector
|
|
208
|
+
* @returns {PicoDom}
|
|
214
209
|
*/
|
|
215
|
-
closest(selector: any): Element;
|
|
216
210
|
upnode(selector: any): PicoDom;
|
|
217
211
|
/**
|
|
218
212
|
* Get previous element
|
|
@@ -246,9 +240,10 @@ export class PicoDomFinderInstance {
|
|
|
246
240
|
* @example Dom.find("div").is(".active") // => true
|
|
247
241
|
*
|
|
248
242
|
* @param {any} selector Test selector
|
|
243
|
+
* @param {boolean} [empty] Test selector
|
|
249
244
|
* @returns {boolean} True if matches
|
|
250
245
|
*/
|
|
251
|
-
is(selector: any): boolean;
|
|
246
|
+
is(selector: any, empty?: boolean): boolean;
|
|
252
247
|
/**
|
|
253
248
|
* Check if contains match
|
|
254
249
|
*
|
|
@@ -301,23 +296,5 @@ export class PicoDomFinderInstance {
|
|
|
301
296
|
* @returns {boolean} True if contains
|
|
302
297
|
*/
|
|
303
298
|
contains(selector: any): boolean;
|
|
304
|
-
/**
|
|
305
|
-
* @see PicoDom.above
|
|
306
|
-
*/
|
|
307
|
-
isParent(...args: any[]): boolean;
|
|
308
|
-
/**
|
|
309
|
-
* @see PicoDom.prev
|
|
310
|
-
*/
|
|
311
|
-
previous(): PicoDom;
|
|
312
|
-
/**
|
|
313
|
-
* @see PicoDom.filter
|
|
314
|
-
*/
|
|
315
|
-
where(...args: any[]): Element[];
|
|
316
|
-
/**
|
|
317
|
-
* @see PicoDom.except
|
|
318
|
-
*/
|
|
319
|
-
not(...args: any[]): Element[];
|
|
320
|
-
getNot(): void;
|
|
321
299
|
}
|
|
322
|
-
export
|
|
323
|
-
import { PicoDom } from "../utils/Dom.js";
|
|
300
|
+
export default PicoDomFinder;
|
package/types/dom/DomForm.d.ts
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export class PicoDomFormStatic {
|
|
1
|
+
import { PicoDomInterface } from "../utils/Dom.ts";
|
|
2
|
+
import PicoDomFinder from "./DomFinder.js";
|
|
3
|
+
export interface PicoDomForm extends PicoDomInterface, PicoDomFinder {
|
|
5
4
|
}
|
|
6
5
|
/**
|
|
7
6
|
* @memberof PicoDom
|
|
8
|
-
* @extends {PicoDom}
|
|
9
7
|
*/
|
|
10
|
-
export class
|
|
8
|
+
export declare class PicoDomForm {
|
|
11
9
|
/**
|
|
12
10
|
* Get or set input value
|
|
13
11
|
*
|
|
14
12
|
* @example Dom.find("input").value("hello")
|
|
15
13
|
*
|
|
16
14
|
* @param {any} [value] Input value
|
|
17
|
-
* @returns {any
|
|
15
|
+
* @returns {any} Value or instance
|
|
18
16
|
*/
|
|
19
|
-
value(value?: any): any
|
|
17
|
+
value(value?: any): any;
|
|
20
18
|
}
|
|
21
|
-
export
|
|
22
|
-
import { PicoDom } from "../utils/Dom.js";
|
|
19
|
+
export default PicoDomForm;
|
package/types/dom/DomGlobal.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { PicoDom, PicoDomInterface } from "../utils/Dom.ts";
|
|
2
|
+
export interface PicoDomGlobal extends PicoDomInterface {
|
|
3
|
+
}
|
|
1
4
|
/**
|
|
2
5
|
* @memberof PicoDom
|
|
3
6
|
*/
|
|
4
|
-
export class
|
|
7
|
+
export declare class PicoDomGlobal {
|
|
5
8
|
/**
|
|
6
9
|
* Get document ready state
|
|
7
10
|
*
|
|
@@ -31,7 +34,7 @@ export class PicoDomGlobalStatic {
|
|
|
31
34
|
*
|
|
32
35
|
* @example Dom.ready(cb)
|
|
33
36
|
*
|
|
34
|
-
* @param {
|
|
37
|
+
* @param {Function} cb Callback fn
|
|
35
38
|
* @param {number} [delay] Execution delay
|
|
36
39
|
* @param {number} [limit] Wait limit
|
|
37
40
|
* @returns {PicoDom} Static class
|
|
@@ -42,21 +45,12 @@ export class PicoDomGlobalStatic {
|
|
|
42
45
|
*
|
|
43
46
|
* @example Dom.complete(cb)
|
|
44
47
|
*
|
|
45
|
-
* @param {
|
|
48
|
+
* @param {Function} cb Callback fn
|
|
46
49
|
* @param {number} [delay] Execution delay
|
|
47
50
|
* @param {number} [limit] Wait limit
|
|
48
51
|
* @returns {PicoDom} Static class
|
|
49
52
|
*/
|
|
50
53
|
static complete(cb: Function, delay?: number, limit?: number): PicoDom;
|
|
51
|
-
}
|
|
52
|
-
export namespace PicoDomGlobalStatic {
|
|
53
|
-
function required(): void;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* @memberof PicoDom
|
|
57
|
-
* @extends {PicoDom}
|
|
58
|
-
*/
|
|
59
|
-
export class PicoDomGlobalInstance {
|
|
60
54
|
/**
|
|
61
55
|
* Check if node is complete
|
|
62
56
|
*
|
|
@@ -70,11 +64,10 @@ export class PicoDomGlobalInstance {
|
|
|
70
64
|
*
|
|
71
65
|
* @example Dom.find("img").loaded(cb)
|
|
72
66
|
*
|
|
73
|
-
* @param {
|
|
67
|
+
* @param {Function} cb Callback fn
|
|
74
68
|
* @param {number} [limit] Wait limit
|
|
75
69
|
* @returns {PicoDom} Current instance
|
|
76
70
|
*/
|
|
77
71
|
loaded(cb: Function, limit?: number): PicoDom;
|
|
78
72
|
}
|
|
79
|
-
export
|
|
80
|
-
import { PicoDom } from "../utils/Dom.js";
|
|
73
|
+
export default PicoDomGlobal;
|
package/types/dom/DomInview.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
import { PicoDomInterface } from "../utils/Dom.ts";
|
|
2
|
+
import PicoDomFinder from "./DomFinder.js";
|
|
3
|
+
import PicoDomRectangle from "./DomRectangle.js";
|
|
4
|
+
export interface PicoDomInview extends PicoDomInterface, PicoDomFinder, PicoDomRectangle {
|
|
5
|
+
}
|
|
1
6
|
/**
|
|
2
7
|
* @memberof PicoDom
|
|
3
8
|
*/
|
|
4
|
-
export class
|
|
9
|
+
export declare class PicoDomInview {
|
|
5
10
|
/**
|
|
6
11
|
* Get first inview element Y
|
|
7
12
|
*
|
|
8
13
|
* @example Dom.inviewMaxY(".item")
|
|
9
14
|
*
|
|
10
15
|
* @param {any} options Find options
|
|
11
|
-
* @param {
|
|
16
|
+
* @param {Function} [cb] Success callback
|
|
12
17
|
* @returns {any} Found element
|
|
13
18
|
*/
|
|
14
19
|
static inviewMaxY(options: any, cb?: Function): any;
|
|
@@ -18,16 +23,10 @@ export class PicoDomInviewStatic {
|
|
|
18
23
|
* @example Dom.inviewMaxX(".item")
|
|
19
24
|
*
|
|
20
25
|
* @param {any} options Find options
|
|
21
|
-
* @param {
|
|
26
|
+
* @param {Function} [cb] Success callback
|
|
22
27
|
* @returns {any} Found element
|
|
23
28
|
*/
|
|
24
29
|
static inviewMaxX(options: any, cb?: Function): any;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @memberof PicoDom
|
|
28
|
-
* @extends {PicoDom}
|
|
29
|
-
*/
|
|
30
|
-
export class PicoDomInviewInstance {
|
|
31
30
|
/**
|
|
32
31
|
* Get X view offset
|
|
33
32
|
*
|
|
@@ -102,14 +101,5 @@ export class PicoDomInviewInstance {
|
|
|
102
101
|
* @returns {boolean} True if inview
|
|
103
102
|
*/
|
|
104
103
|
isInviewY(threshold?: number, mode?: string, boundry?: any): boolean;
|
|
105
|
-
/**
|
|
106
|
-
* @see PicoDom.inviewY
|
|
107
|
-
*/
|
|
108
|
-
inviewHeight(...args: any[]): number;
|
|
109
|
-
/**
|
|
110
|
-
* @see PicoDom.inviewX
|
|
111
|
-
*/
|
|
112
|
-
inviewWidth(...args: any[]): number;
|
|
113
104
|
}
|
|
114
|
-
export
|
|
115
|
-
import { PicoDom } from "../utils/Dom.js";
|
|
105
|
+
export default PicoDomInview;
|
package/types/dom/DomMeta.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { PicoDom, PicoDomInterface } from "../utils/Dom.ts";
|
|
2
|
+
export interface PicoDomMeta extends PicoDomInterface {
|
|
3
|
+
}
|
|
1
4
|
/**
|
|
2
5
|
* @memberof PicoDom
|
|
3
6
|
*/
|
|
4
|
-
export class
|
|
5
|
-
|
|
7
|
+
export declare class PicoDomMeta {
|
|
8
|
+
/**
|
|
9
|
+
* @type {any}
|
|
10
|
+
*/
|
|
11
|
+
static $meta: any;
|
|
6
12
|
/**
|
|
7
13
|
* Set document title
|
|
8
14
|
*
|
|
@@ -14,17 +20,4 @@ export class PicoDomMetaStatic {
|
|
|
14
20
|
*/
|
|
15
21
|
static setMetaTitle(value: string, glue?: string): PicoDom;
|
|
16
22
|
}
|
|
17
|
-
export
|
|
18
|
-
/**
|
|
19
|
-
* @see PicoDom.setMetaTitle
|
|
20
|
-
*/
|
|
21
|
-
function title(value: any): any;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @memberof PicoDom
|
|
25
|
-
* @extends {PicoDom}
|
|
26
|
-
*/
|
|
27
|
-
export class PicoDomMetaInstance {
|
|
28
|
-
}
|
|
29
|
-
export function PicoDomMetaPlugin(self: typeof PicoDom): typeof PicoDom;
|
|
30
|
-
import { PicoDom } from "../utils/Dom.js";
|
|
23
|
+
export default PicoDomMeta;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
export class PicoDomObserverStatic {
|
|
1
|
+
import { PicoDomInterface } from "../utils/Dom.ts";
|
|
2
|
+
export interface PicoDomObserver extends PicoDomInterface {
|
|
5
3
|
}
|
|
6
4
|
/**
|
|
7
5
|
* @memberof PicoDom
|
|
8
|
-
* @extends {PicoDom}
|
|
9
6
|
*/
|
|
10
|
-
export class
|
|
7
|
+
export declare class PicoDomObserver {
|
|
11
8
|
}
|
|
12
|
-
export
|
|
13
|
-
import { PicoDom } from "../utils/Dom.js";
|
|
9
|
+
export default PicoDomObserver;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export class PicoDomPopoverStatic {
|
|
1
|
+
import { PicoDomInterface } from "../utils/Dom.ts";
|
|
2
|
+
import PicoDomRectangle from "./DomRectangle.js";
|
|
3
|
+
export interface PicoDomPopover extends PicoDomInterface, PicoDomRectangle {
|
|
5
4
|
}
|
|
6
5
|
/**
|
|
7
6
|
* @memberof PicoDom
|
|
8
|
-
* @extends {PicoDom}
|
|
9
7
|
*/
|
|
10
|
-
export class
|
|
11
|
-
popover(target: any, position?: string, options?:
|
|
12
|
-
popoverY(target: any, position?: string, options?:
|
|
13
|
-
popoverX(target: any, position?: string, options?:
|
|
8
|
+
export declare class PicoDomPopover {
|
|
9
|
+
popover(target: any, position?: string, options?: any): any;
|
|
10
|
+
popoverY(target: any, position?: string, options?: any): any;
|
|
11
|
+
popoverX(target: any, position?: string, options?: any): any;
|
|
14
12
|
popoverNormalize(offset: any, self: any, rect: any, win: any): any;
|
|
15
13
|
}
|
|
16
|
-
export
|
|
17
|
-
import { PicoDom } from "../utils/Dom.js";
|
|
14
|
+
export default PicoDomPopover;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { PicoDom, PicoDomInterface } from "../utils/Dom.ts";
|
|
2
|
+
import PicoDomFinder from "./DomFinder.js";
|
|
3
|
+
import PicoDomAttribute from "./DomAttribute.js";
|
|
4
|
+
export interface PicoDomRectangle extends PicoDomInterface, PicoDomFinder, PicoDomAttribute {
|
|
5
|
+
}
|
|
1
6
|
/**
|
|
2
7
|
* @memberof PicoDom
|
|
3
8
|
*/
|
|
4
|
-
export class
|
|
9
|
+
export declare class PicoDomRectangle {
|
|
5
10
|
/**
|
|
6
11
|
* Cast value to number
|
|
7
12
|
*
|
|
@@ -11,13 +16,7 @@ export class PicoDomRectangleStatic {
|
|
|
11
16
|
* @returns {number} Number value
|
|
12
17
|
*/
|
|
13
18
|
static num(value: any): number;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @memberof PicoDom
|
|
17
|
-
* @extends {PicoDom}
|
|
18
|
-
*/
|
|
19
|
-
export class PicoDomRectangleInstance {
|
|
20
|
-
rect(fallback?: {}): any;
|
|
19
|
+
rect(fallback?: any): any;
|
|
21
20
|
/**
|
|
22
21
|
* Get margin values
|
|
23
22
|
*
|
|
@@ -76,9 +75,9 @@ export class PicoDomRectangleInstance {
|
|
|
76
75
|
* @example Dom.find("div").realHeight({ display: "block" })
|
|
77
76
|
*
|
|
78
77
|
* @param {any} [style] Temp style
|
|
79
|
-
* @returns {
|
|
78
|
+
* @returns {any} Height value
|
|
80
79
|
*/
|
|
81
|
-
realHeight(style?: any):
|
|
80
|
+
realHeight(style?: any): any;
|
|
82
81
|
/**
|
|
83
82
|
* Evaluate target height
|
|
84
83
|
*
|
|
@@ -86,9 +85,9 @@ export class PicoDomRectangleInstance {
|
|
|
86
85
|
*
|
|
87
86
|
* @param {any} [target] Target element
|
|
88
87
|
* @param {boolean} [apply] Apply style
|
|
89
|
-
* @returns {
|
|
88
|
+
* @returns {any} Height value
|
|
90
89
|
*/
|
|
91
|
-
evaluateHeight(target?: any, apply?: boolean):
|
|
90
|
+
evaluateHeight(target?: any, apply?: boolean): any;
|
|
92
91
|
/**
|
|
93
92
|
* Get element width
|
|
94
93
|
*
|
|
@@ -127,9 +126,9 @@ export class PicoDomRectangleInstance {
|
|
|
127
126
|
* @example Dom.find("div").realWidth({ display: "block" })
|
|
128
127
|
*
|
|
129
128
|
* @param {any} [style] Temp style
|
|
130
|
-
* @returns {
|
|
129
|
+
* @returns {any} Width value
|
|
131
130
|
*/
|
|
132
|
-
realWidth(style?:
|
|
131
|
+
realWidth(style?: {}): any;
|
|
133
132
|
/**
|
|
134
133
|
* Evaluate target width
|
|
135
134
|
*
|
|
@@ -137,9 +136,9 @@ export class PicoDomRectangleInstance {
|
|
|
137
136
|
*
|
|
138
137
|
* @param {any} [target] Target element
|
|
139
138
|
* @param {boolean} [apply] Apply style
|
|
140
|
-
* @returns {
|
|
139
|
+
* @returns {any} Width value
|
|
141
140
|
*/
|
|
142
|
-
evaluateWidth(target?: any, apply?: boolean):
|
|
141
|
+
evaluateWidth(target?: any, apply?: boolean): any;
|
|
143
142
|
/**
|
|
144
143
|
* Get element offset
|
|
145
144
|
*
|
|
@@ -191,7 +190,7 @@ export class PicoDomRectangleInstance {
|
|
|
191
190
|
*
|
|
192
191
|
* @example Dom.find("div").loopOffset((el) => console.log(el))
|
|
193
192
|
*
|
|
194
|
-
* @param {
|
|
193
|
+
* @param {Function} cb Callback fn
|
|
195
194
|
* @param {any} [boundry] Loop limit
|
|
196
195
|
* @returns {PicoDom} Current instance
|
|
197
196
|
*/
|
|
@@ -233,9 +232,9 @@ export class PicoDomRectangleInstance {
|
|
|
233
232
|
*
|
|
234
233
|
* @param {any} [value] Scroll value
|
|
235
234
|
* @param {any} [boundry] View boundry
|
|
236
|
-
* @returns {
|
|
235
|
+
* @returns {any} Value or instance
|
|
237
236
|
*/
|
|
238
|
-
scrollTop(value?: any, boundry?: any):
|
|
237
|
+
scrollTop(value?: any, boundry?: any): any;
|
|
239
238
|
/**
|
|
240
239
|
* Get or set scroll left
|
|
241
240
|
*
|
|
@@ -243,9 +242,9 @@ export class PicoDomRectangleInstance {
|
|
|
243
242
|
*
|
|
244
243
|
* @param {any} [value] Scroll value
|
|
245
244
|
* @param {any} [boundry] View boundry
|
|
246
|
-
* @returns {
|
|
245
|
+
* @returns {any} Value or instance
|
|
247
246
|
*/
|
|
248
|
-
scrollLeft(value?: any, boundry?: any):
|
|
247
|
+
scrollLeft(value?: any, boundry?: any): any;
|
|
249
248
|
/**
|
|
250
249
|
* Get relative scroll
|
|
251
250
|
*
|
|
@@ -255,18 +254,5 @@ export class PicoDomRectangleInstance {
|
|
|
255
254
|
* @returns {any} Scroll values
|
|
256
255
|
*/
|
|
257
256
|
getScroll(boundry?: any): any;
|
|
258
|
-
/**
|
|
259
|
-
* @see PicoDom.loopOffsetParent
|
|
260
|
-
*/
|
|
261
|
-
loopOffsetParent(...args: any[]): PicoDom;
|
|
262
|
-
/**
|
|
263
|
-
* @see PicoDom.scrollTopGlobal
|
|
264
|
-
*/
|
|
265
|
-
scrollTopGlobal(): any;
|
|
266
|
-
/**
|
|
267
|
-
* @see PicoDom.scrollLeftGlobal
|
|
268
|
-
*/
|
|
269
|
-
scrollLeftGlobal(): any;
|
|
270
257
|
}
|
|
271
|
-
export
|
|
272
|
-
import { PicoDom } from "../utils/Dom.js";
|
|
258
|
+
export default PicoDomRectangle;
|