@kizmann/pico-js 2.0.0 → 2.0.1
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 +1 -2
- package/src/dom/DomAttribute.js +13 -11
- package/src/dom/DomBuilder.js +9 -7
- package/src/dom/DomEvent.js +11 -9
- package/src/dom/DomFinder.js +7 -5
- package/src/dom/DomForm.js +5 -3
- package/src/dom/DomGlobal.js +7 -5
- package/src/dom/DomInview.js +4 -2
- package/src/dom/DomMeta.js +5 -3
- package/src/dom/DomObserver.js +5 -3
- package/src/dom/DomRectangle.js +7 -6
- package/src/format/FormatFile.js +4 -2
- package/src/format/FormatOption.js +4 -2
- package/src/format/FormatParam.js +4 -2
- package/src/format/FormatParser.js +4 -2
- package/src/format/FormatUrl.js +4 -2
- package/src/index.browser.js +30 -9
- package/src/index.esm.js +46 -68
- package/src/now/NowDefault.js +4 -2
- package/src/now/NowFormat.js +4 -2
- package/src/now/NowGrid.js +4 -2
- package/src/now/NowHuman.js +4 -2
- package/src/now/NowMatch.js +4 -2
- package/src/now/NowRange.js +4 -2
- package/src/now/NowWalker.js +4 -2
- package/src/utils/Array.js +1 -1
- package/src/utils/Cookie.js +1 -1
- package/src/utils/Data.js +1 -1
- package/src/utils/Dom.js +28 -28
- package/src/utils/Event.js +2 -2
- package/src/utils/Format.js +10 -10
- package/src/utils/Hash.js +1 -1
- package/src/utils/Locale.js +1 -1
- package/src/utils/Mixed.js +1 -1
- package/src/utils/Now.js +15 -15
- package/src/utils/Number.js +1 -1
- package/src/utils/Object.js +1 -1
- package/src/utils/Route.js +1 -1
- package/src/utils/Runner.js +4 -4
- package/src/utils/String.js +1 -1
- package/src/wip/Element.js +4 -4
- package/src/wip/Map.js +4 -4
- package/types/dom/DomAttribute.d.ts +21 -20
- package/types/dom/DomBuilder.d.ts +12 -11
- package/types/dom/DomEvent.d.ts +17 -16
- package/types/dom/DomFinder.d.ts +8 -7
- package/types/dom/DomForm.d.ts +4 -3
- package/types/dom/DomGlobal.d.ts +8 -7
- package/types/dom/DomInview.d.ts +2 -1
- package/types/dom/DomMeta.d.ts +4 -3
- package/types/dom/DomObserver.d.ts +4 -3
- package/types/dom/DomRectangle.d.ts +9 -8
- package/types/format/FormatFile.d.ts +2 -1
- package/types/format/FormatOption.d.ts +2 -1
- package/types/format/FormatParam.d.ts +2 -1
- package/types/format/FormatParser.d.ts +2 -1
- package/types/format/FormatUrl.d.ts +2 -1
- package/types/index.esm.d.ts +67 -41
- package/types/now/NowDefault.d.ts +2 -1
- package/types/now/NowFormat.d.ts +2 -1
- package/types/now/NowGrid.d.ts +2 -1
- package/types/now/NowHuman.d.ts +2 -1
- package/types/now/NowMatch.d.ts +2 -1
- package/types/now/NowRange.d.ts +2 -1
- package/types/now/NowWalker.d.ts +2 -1
- package/types/utils/Array.d.ts +6 -6
- package/types/utils/Dom.d.ts +35 -35
- package/types/utils/Event.d.ts +2 -2
- package/types/utils/Format.d.ts +11 -11
- package/types/utils/Now.d.ts +14 -14
- package/types/utils/Runner.d.ts +6 -6
- package/types/wip/Element.d.ts +8 -8
- package/types/wip/Map.d.ts +8 -8
- package/types/index.browser.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kizmann/pico-js",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"sass-loader": "^12.0.0",
|
|
50
50
|
"terser-webpack-plugin": "^4.2.3",
|
|
51
51
|
"tinybench": "^6.0.0",
|
|
52
|
-
"tsc-alias": "^1.8.16",
|
|
53
52
|
"typescript": "^5.9.3",
|
|
54
53
|
"webpack": "^5.0.0",
|
|
55
54
|
"webpack-cli": "^4.0.0",
|
package/src/dom/DomAttribute.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Arr, Dom, For, Mix, Obj } from "
|
|
1
|
+
import { Arr, Dom, For, Mix, Obj } from "../index.esm.js";
|
|
2
|
+
import { PicoDom } from "../utils/Dom.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @memberof PicoDom
|
|
@@ -22,7 +23,7 @@ export class PicoDomAttributeInstance
|
|
|
22
23
|
* @param {string} key Attr key
|
|
23
24
|
* @param {any} [value] Attr value
|
|
24
25
|
* @param {any} [fallback] Fallback value
|
|
25
|
-
* @returns {any|
|
|
26
|
+
* @returns {any|PicoDom} Attr value or instance
|
|
26
27
|
*/
|
|
27
28
|
attr(key, value = undefined, fallback = null)
|
|
28
29
|
{
|
|
@@ -61,7 +62,7 @@ export class PicoDomAttributeInstance
|
|
|
61
62
|
* @param {string} key Data key
|
|
62
63
|
* @param {any} [value] Data value
|
|
63
64
|
* @param {any} [fallback] Fallback value
|
|
64
|
-
* @returns {any|
|
|
65
|
+
* @returns {any|PicoDom} Data value or instance
|
|
65
66
|
*/
|
|
66
67
|
data(key, value = undefined, fallback = null)
|
|
67
68
|
{
|
|
@@ -103,7 +104,7 @@ export class PicoDomAttributeInstance
|
|
|
103
104
|
*
|
|
104
105
|
* @param {any} [value] Style value
|
|
105
106
|
* @param {boolean} [combine] Combine style
|
|
106
|
-
* @returns {any|
|
|
107
|
+
* @returns {any|PicoDom} Style or instance
|
|
107
108
|
*/
|
|
108
109
|
style(value = undefined, combine = true)
|
|
109
110
|
{
|
|
@@ -141,7 +142,7 @@ export class PicoDomAttributeInstance
|
|
|
141
142
|
*
|
|
142
143
|
* @param {any} [value] Class value
|
|
143
144
|
* @param {boolean} [combine] Combine classes
|
|
144
|
-
* @returns {any|
|
|
145
|
+
* @returns {any|PicoDom} Classes or instance
|
|
145
146
|
*/
|
|
146
147
|
class(value = undefined, combine = false)
|
|
147
148
|
{
|
|
@@ -178,7 +179,7 @@ export class PicoDomAttributeInstance
|
|
|
178
179
|
* @example Dom.find("div").html("<span></span>")
|
|
179
180
|
*
|
|
180
181
|
* @param {any} [html] HTML content
|
|
181
|
-
* @returns {string|
|
|
182
|
+
* @returns {string|PicoDom} HTML or instance
|
|
182
183
|
*/
|
|
183
184
|
html(html = undefined)
|
|
184
185
|
{
|
|
@@ -238,7 +239,7 @@ export class PicoDomAttributeInstance
|
|
|
238
239
|
* @example Dom.find("div").addClass("active")
|
|
239
240
|
*
|
|
240
241
|
* @param {any} cls Class name
|
|
241
|
-
* @returns {
|
|
242
|
+
* @returns {PicoDom} Current instance
|
|
242
243
|
*/
|
|
243
244
|
addClass(cls)
|
|
244
245
|
{
|
|
@@ -269,7 +270,7 @@ export class PicoDomAttributeInstance
|
|
|
269
270
|
* @example Dom.find("div").remClass("active")
|
|
270
271
|
*
|
|
271
272
|
* @param {any} cls Class name
|
|
272
|
-
* @returns {
|
|
273
|
+
* @returns {PicoDom} Current instance
|
|
273
274
|
*/
|
|
274
275
|
remClass(cls)
|
|
275
276
|
{
|
|
@@ -300,7 +301,7 @@ export class PicoDomAttributeInstance
|
|
|
300
301
|
* @example Dom.find("div").toggleClass("active")
|
|
301
302
|
*
|
|
302
303
|
* @param {any} cls Class name
|
|
303
|
-
* @returns {
|
|
304
|
+
* @returns {PicoDom} Current instance
|
|
304
305
|
*/
|
|
305
306
|
toggleClass(cls)
|
|
306
307
|
{
|
|
@@ -322,7 +323,7 @@ export class PicoDomAttributeInstance
|
|
|
322
323
|
*
|
|
323
324
|
* @param {any} cls Class name
|
|
324
325
|
* @param {boolean} [state] Target state
|
|
325
|
-
* @returns {
|
|
326
|
+
* @returns {PicoDom} Current instance
|
|
326
327
|
*/
|
|
327
328
|
stateClass(cls, state = true)
|
|
328
329
|
{
|
|
@@ -356,7 +357,8 @@ PicoDomAttributeInstance.prototype.removeClass = function (...args) {
|
|
|
356
357
|
};
|
|
357
358
|
|
|
358
359
|
/**
|
|
359
|
-
* @
|
|
360
|
+
* @param {typeof PicoDom} self
|
|
361
|
+
* @returns {typeof PicoDom}
|
|
360
362
|
*/
|
|
361
363
|
export const PicoDomAttributePlugin = function (self) {
|
|
362
364
|
|
package/src/dom/DomBuilder.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Arr, Dom, Mix, Obj } from "
|
|
1
|
+
import { Arr, Dom, Mix, Obj } from "../index.esm.js";
|
|
2
|
+
import { PicoDom } from "../utils/Dom.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @memberof PicoDom
|
|
@@ -52,7 +53,7 @@ export class PicoDomBuilderInstance
|
|
|
52
53
|
* @example Dom.find("div").prepend("<span></span>")
|
|
53
54
|
*
|
|
54
55
|
* @param {any} value Prepend value
|
|
55
|
-
* @returns {
|
|
56
|
+
* @returns {PicoDom} Current instance
|
|
56
57
|
*/
|
|
57
58
|
prepend(value)
|
|
58
59
|
{
|
|
@@ -69,7 +70,7 @@ export class PicoDomBuilderInstance
|
|
|
69
70
|
* @example Dom.find("span").prependTo("div")
|
|
70
71
|
*
|
|
71
72
|
* @param {any} value Target element
|
|
72
|
-
* @returns {
|
|
73
|
+
* @returns {PicoDom} Current instance
|
|
73
74
|
*/
|
|
74
75
|
prependTo(value)
|
|
75
76
|
{
|
|
@@ -86,7 +87,7 @@ export class PicoDomBuilderInstance
|
|
|
86
87
|
* @example Dom.find("div").append("<span></span>")
|
|
87
88
|
*
|
|
88
89
|
* @param {any} value Append value
|
|
89
|
-
* @returns {
|
|
90
|
+
* @returns {PicoDom} Current instance
|
|
90
91
|
*/
|
|
91
92
|
append(value)
|
|
92
93
|
{
|
|
@@ -103,7 +104,7 @@ export class PicoDomBuilderInstance
|
|
|
103
104
|
* @example Dom.find("span").appendTo("div")
|
|
104
105
|
*
|
|
105
106
|
* @param {any} value Target element
|
|
106
|
-
* @returns {
|
|
107
|
+
* @returns {PicoDom} Current instance
|
|
107
108
|
*/
|
|
108
109
|
appendTo(value)
|
|
109
110
|
{
|
|
@@ -120,7 +121,7 @@ export class PicoDomBuilderInstance
|
|
|
120
121
|
* @example Dom.find("div").replace("<span></span>")
|
|
121
122
|
*
|
|
122
123
|
* @param {any} value Replacement value
|
|
123
|
-
* @returns {
|
|
124
|
+
* @returns {PicoDom} Current instance
|
|
124
125
|
*/
|
|
125
126
|
replace(value)
|
|
126
127
|
{
|
|
@@ -134,7 +135,8 @@ export class PicoDomBuilderInstance
|
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
/**
|
|
137
|
-
* @
|
|
138
|
+
* @param {typeof PicoDom} self
|
|
139
|
+
* @returns {typeof PicoDom}
|
|
138
140
|
*/
|
|
139
141
|
export const PicoDomBuilderPlugin = function (self) {
|
|
140
142
|
|
package/src/dom/DomEvent.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Arr, Hash, Mix, Obj, Dom } from "
|
|
1
|
+
import { Arr, Hash, Mix, Obj, Dom } from "../index.esm.js";
|
|
2
|
+
import { PicoDom } from "../utils/Dom.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @memberof PicoDom
|
|
@@ -26,7 +27,7 @@ export class PicoDomEventInstance
|
|
|
26
27
|
* @param {string} [selector] Event selector
|
|
27
28
|
* @param {boolean} [pause] Pause listener
|
|
28
29
|
* @param {any} [options] Listener options
|
|
29
|
-
* @returns {
|
|
30
|
+
* @returns {PicoDom} Current instance
|
|
30
31
|
*/
|
|
31
32
|
bind(el, event, cb, selector = null, pause = false, options = {})
|
|
32
33
|
{
|
|
@@ -52,7 +53,7 @@ export class PicoDomEventInstance
|
|
|
52
53
|
* @param {string} event Event name
|
|
53
54
|
* @param {string} [selector] Event selector
|
|
54
55
|
* @param {any} [options] Listener options
|
|
55
|
-
* @returns {
|
|
56
|
+
* @returns {PicoDom} Current instance
|
|
56
57
|
*/
|
|
57
58
|
unbind(el, event, selector = null, options = {})
|
|
58
59
|
{
|
|
@@ -91,7 +92,7 @@ export class PicoDomEventInstance
|
|
|
91
92
|
* @param {any} [options] Listener options
|
|
92
93
|
* @param {boolean} [pause] Pause listener
|
|
93
94
|
* @param {string} [selector] Event selector
|
|
94
|
-
* @returns {
|
|
95
|
+
* @returns {PicoDom} Current instance
|
|
95
96
|
*/
|
|
96
97
|
on(event, cb, options = {}, pause = false, selector = null)
|
|
97
98
|
{
|
|
@@ -122,7 +123,7 @@ export class PicoDomEventInstance
|
|
|
122
123
|
* @param {any} event Event name
|
|
123
124
|
* @param {string} [selector] Event selector
|
|
124
125
|
* @param {any} [options] Listener options
|
|
125
|
-
* @returns {
|
|
126
|
+
* @returns {PicoDom} Current instance
|
|
126
127
|
*/
|
|
127
128
|
off(event, selector = null, options = {})
|
|
128
129
|
{
|
|
@@ -149,7 +150,7 @@ export class PicoDomEventInstance
|
|
|
149
150
|
* @param {any} event Event name
|
|
150
151
|
* @param {function} cb Callback fn
|
|
151
152
|
* @param {any} [options] Listener options
|
|
152
|
-
* @returns {
|
|
153
|
+
* @returns {PicoDom} Current instance
|
|
153
154
|
*/
|
|
154
155
|
once(event, cb, options = {})
|
|
155
156
|
{
|
|
@@ -172,7 +173,7 @@ export class PicoDomEventInstance
|
|
|
172
173
|
* @param {function} cb Callback fn
|
|
173
174
|
* @param {any} [options] Listener options
|
|
174
175
|
* @param {boolean} [pause] Pause listener
|
|
175
|
-
* @returns {
|
|
176
|
+
* @returns {PicoDom} Current instance
|
|
176
177
|
*/
|
|
177
178
|
live(event, selector, cb, options = {}, pause = false)
|
|
178
179
|
{
|
|
@@ -198,7 +199,7 @@ export class PicoDomEventInstance
|
|
|
198
199
|
* @example Dom.find("div").fire("click")
|
|
199
200
|
*
|
|
200
201
|
* @param {string} event Event name
|
|
201
|
-
* @returns {
|
|
202
|
+
* @returns {PicoDom} Current instance
|
|
202
203
|
*/
|
|
203
204
|
fire(event)
|
|
204
205
|
{
|
|
@@ -235,7 +236,8 @@ PicoDomEventInstance.prototype.unpause = function () {
|
|
|
235
236
|
};
|
|
236
237
|
|
|
237
238
|
/**
|
|
238
|
-
* @
|
|
239
|
+
* @param {typeof PicoDom} self
|
|
240
|
+
* @returns {typeof PicoDom}
|
|
239
241
|
*/
|
|
240
242
|
export const PicoDomEventPlugin = function (self) {
|
|
241
243
|
|
package/src/dom/DomFinder.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Arr, Mix, Obj, Dom } from "
|
|
1
|
+
import { Arr, Mix, Obj, Dom } from "../index.esm.js";
|
|
2
|
+
import { PicoDom } from "../utils/Dom.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @memberof PicoDom
|
|
@@ -209,7 +210,7 @@ export class PicoDomFinderInstance
|
|
|
209
210
|
* @example Dom.find("div").sanatize(1)
|
|
210
211
|
*
|
|
211
212
|
* @param {number} [filter] Node type
|
|
212
|
-
* @returns {
|
|
213
|
+
* @returns {PicoDom} Current instance
|
|
213
214
|
*/
|
|
214
215
|
sanatize(filter = 1)
|
|
215
216
|
{
|
|
@@ -332,7 +333,7 @@ export class PicoDomFinderInstance
|
|
|
332
333
|
* @example Dom.find("div").each((el) => console.log(el))
|
|
333
334
|
*
|
|
334
335
|
* @param {function} cb Callback fn
|
|
335
|
-
* @returns {
|
|
336
|
+
* @returns {PicoDom} Current instance
|
|
336
337
|
*/
|
|
337
338
|
each(cb)
|
|
338
339
|
{
|
|
@@ -346,7 +347,7 @@ export class PicoDomFinderInstance
|
|
|
346
347
|
*
|
|
347
348
|
* @param {function} cb Callback fn
|
|
348
349
|
* @param {any} [boundry] Loop limit
|
|
349
|
-
* @returns {
|
|
350
|
+
* @returns {PicoDom} Current instance
|
|
350
351
|
*/
|
|
351
352
|
loopParent(cb, boundry = null)
|
|
352
353
|
{
|
|
@@ -651,7 +652,8 @@ PicoDomFinderInstance.prototype.getNot = () => {
|
|
|
651
652
|
};
|
|
652
653
|
|
|
653
654
|
/**
|
|
654
|
-
* @
|
|
655
|
+
* @param {typeof PicoDom} self
|
|
656
|
+
* @returns {typeof PicoDom}
|
|
655
657
|
*/
|
|
656
658
|
export const PicoDomFinderPlugin = function (self) {
|
|
657
659
|
|
package/src/dom/DomForm.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mix, Obj } from "../index.esm.js";
|
|
2
|
+
import { PicoDom } from "../utils/Dom.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @memberof PicoDom
|
|
@@ -21,7 +22,7 @@ export class PicoDomFormInstance
|
|
|
21
22
|
* @example Dom.find("input").value("hello")
|
|
22
23
|
*
|
|
23
24
|
* @param {any} [value] Input value
|
|
24
|
-
* @returns {any|
|
|
25
|
+
* @returns {any|PicoDom} Value or instance
|
|
25
26
|
*/
|
|
26
27
|
value(value = undefined)
|
|
27
28
|
{
|
|
@@ -39,7 +40,8 @@ export class PicoDomFormInstance
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
|
-
* @
|
|
43
|
+
* @param {typeof PicoDom} self
|
|
44
|
+
* @returns {typeof PicoDom}
|
|
43
45
|
*/
|
|
44
46
|
export const PicoDomFormPlugin = function (self) {
|
|
45
47
|
|
package/src/dom/DomGlobal.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Run, Mix, Obj, Dom } from "
|
|
1
|
+
import { Run, Mix, Obj, Dom } from "../index.esm.js";
|
|
2
|
+
import { PicoDom } from "../utils/Dom.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @memberof PicoDom
|
|
@@ -55,7 +56,7 @@ export class PicoDomGlobalStatic
|
|
|
55
56
|
* @param {function} cb Callback fn
|
|
56
57
|
* @param {number} [delay] Execution delay
|
|
57
58
|
* @param {number} [limit] Wait limit
|
|
58
|
-
* @returns {
|
|
59
|
+
* @returns {PicoDom} Static class
|
|
59
60
|
*/
|
|
60
61
|
static ready(cb, delay = 0, limit = 6000)
|
|
61
62
|
{
|
|
@@ -88,7 +89,7 @@ export class PicoDomGlobalStatic
|
|
|
88
89
|
* @param {function} cb Callback fn
|
|
89
90
|
* @param {number} [delay] Execution delay
|
|
90
91
|
* @param {number} [limit] Wait limit
|
|
91
|
-
* @returns {
|
|
92
|
+
* @returns {PicoDom} Static class
|
|
92
93
|
*/
|
|
93
94
|
static complete(cb, delay = 0, limit = 6000)
|
|
94
95
|
{
|
|
@@ -156,7 +157,7 @@ export class PicoDomGlobalInstance
|
|
|
156
157
|
*
|
|
157
158
|
* @param {function} cb Callback fn
|
|
158
159
|
* @param {number} [limit] Wait limit
|
|
159
|
-
* @returns {
|
|
160
|
+
* @returns {PicoDom} Current instance
|
|
160
161
|
*/
|
|
161
162
|
loaded(cb, limit = 6000)
|
|
162
163
|
{
|
|
@@ -175,7 +176,8 @@ export class PicoDomGlobalInstance
|
|
|
175
176
|
}
|
|
176
177
|
|
|
177
178
|
/**
|
|
178
|
-
* @
|
|
179
|
+
* @param {typeof PicoDom} self
|
|
180
|
+
* @returns {typeof PicoDom}
|
|
179
181
|
*/
|
|
180
182
|
export const PicoDomGlobalPlugin = function (self) {
|
|
181
183
|
|
package/src/dom/DomInview.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Arr, Dom, Mix, Obj } from "
|
|
1
|
+
import { Arr, Dom, Mix, Obj } from "../index.esm.js";
|
|
2
|
+
import { PicoDom } from "../utils/Dom.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @memberof PicoDom
|
|
@@ -314,7 +315,8 @@ PicoDomInviewInstance.prototype.inviewWidth = function (...args) {
|
|
|
314
315
|
}
|
|
315
316
|
|
|
316
317
|
/**
|
|
317
|
-
* @
|
|
318
|
+
* @param {typeof PicoDom} self
|
|
319
|
+
* @returns {typeof PicoDom}
|
|
318
320
|
*/
|
|
319
321
|
export const PicoDomInviewPlugin = function (self) {
|
|
320
322
|
|
package/src/dom/DomMeta.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Arr, Mix, Obj, Dom, Locale } from "
|
|
1
|
+
import { Arr, Mix, Obj, Dom, Locale } from "../index.esm.js";
|
|
2
|
+
import { PicoDom } from "../utils/Dom.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @memberof PicoDom
|
|
@@ -14,7 +15,7 @@ export class PicoDomMetaStatic
|
|
|
14
15
|
*
|
|
15
16
|
* @param {string} value New title
|
|
16
17
|
* @param {string} [glue] Title glue
|
|
17
|
-
* @returns {
|
|
18
|
+
* @returns {PicoDom} Static class
|
|
18
19
|
*/
|
|
19
20
|
static setMetaTitle(value, glue = ':value - :title')
|
|
20
21
|
{
|
|
@@ -48,7 +49,8 @@ export class PicoDomMetaInstance
|
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
* @
|
|
52
|
+
* @param {typeof PicoDom} self
|
|
53
|
+
* @returns {typeof PicoDom}
|
|
52
54
|
*/
|
|
53
55
|
export const PicoDomMetaPlugin = function (self) {
|
|
54
56
|
|
package/src/dom/DomObserver.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Arr, Mix, Obj, Dom } from "
|
|
1
|
+
import { Arr, Mix, Obj, Dom } from "../index.esm.js";
|
|
2
|
+
import { PicoDom } from "../utils/Dom.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @memberof PicoDom
|
|
@@ -21,7 +22,7 @@ export class PicoDomObserverInstance
|
|
|
21
22
|
* @example Dom.find("input").value("hello")
|
|
22
23
|
*
|
|
23
24
|
* @param {any} [value] New value
|
|
24
|
-
* @returns {any|
|
|
25
|
+
* @returns {any|PicoDom} Value or instance
|
|
25
26
|
*/
|
|
26
27
|
value(value = undefined)
|
|
27
28
|
{
|
|
@@ -39,7 +40,8 @@ export class PicoDomObserverInstance
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
|
-
* @
|
|
43
|
+
* @param {typeof PicoDom} self
|
|
44
|
+
* @returns {typeof PicoDom}
|
|
43
45
|
*/
|
|
44
46
|
export const PicoDomObserverPlugin = function (self) {
|
|
45
47
|
|
package/src/dom/DomRectangle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Arr, Dom, Mix, Obj } from "
|
|
2
|
-
|
|
1
|
+
import { Arr, Dom, Mix, Obj } from "../index.esm.js";
|
|
2
|
+
import { PicoDom } from "../utils/Dom.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @memberof PicoDom
|
|
@@ -409,7 +409,7 @@ export class PicoDomRectangleInstance
|
|
|
409
409
|
*
|
|
410
410
|
* @param {function} cb Callback fn
|
|
411
411
|
* @param {any} [boundry] Loop limit
|
|
412
|
-
* @returns {
|
|
412
|
+
* @returns {PicoDom} Current instance
|
|
413
413
|
*/
|
|
414
414
|
loopOffset(cb, boundry = null)
|
|
415
415
|
{
|
|
@@ -529,7 +529,7 @@ export class PicoDomRectangleInstance
|
|
|
529
529
|
*
|
|
530
530
|
* @param {any} [value] Scroll value
|
|
531
531
|
* @param {any} [boundry] View boundry
|
|
532
|
-
* @returns {number|
|
|
532
|
+
* @returns {number|PicoDom} Value or instance
|
|
533
533
|
*/
|
|
534
534
|
scrollTop(value = null, boundry = null)
|
|
535
535
|
{
|
|
@@ -551,7 +551,7 @@ export class PicoDomRectangleInstance
|
|
|
551
551
|
*
|
|
552
552
|
* @param {any} [value] Scroll value
|
|
553
553
|
* @param {any} [boundry] View boundry
|
|
554
|
-
* @returns {number|
|
|
554
|
+
* @returns {number|PicoDom} Value or instance
|
|
555
555
|
*/
|
|
556
556
|
scrollLeft(value = null, boundry = null)
|
|
557
557
|
{
|
|
@@ -639,7 +639,8 @@ PicoDomRectangleInstance.prototype.scrollLeftGlobal = function () {
|
|
|
639
639
|
};
|
|
640
640
|
|
|
641
641
|
/**
|
|
642
|
-
* @
|
|
642
|
+
* @param {typeof PicoDom} self
|
|
643
|
+
* @returns {typeof PicoDom}
|
|
643
644
|
*/
|
|
644
645
|
export const PicoDomRectanglePlugin = function (self) {
|
|
645
646
|
|
package/src/format/FormatFile.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Mix, Obj, Num } from "
|
|
1
|
+
import { Mix, Obj, Num } from "../index.esm.js";
|
|
2
|
+
import { PicoFormat } from "../utils/Format.js";
|
|
2
3
|
|
|
3
4
|
export const FILE_UNITS = [
|
|
4
5
|
'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'
|
|
@@ -42,7 +43,8 @@ export class PicoFormatFileStatic
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
|
-
* @
|
|
46
|
+
* @param {typeof PicoFormat} self
|
|
47
|
+
* @returns {typeof PicoFormat}
|
|
46
48
|
*/
|
|
47
49
|
export const PicoFormatFilePlugin = function (self) {
|
|
48
50
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Arr, For, Mix, Obj } from "
|
|
1
|
+
import { Arr, For, Mix, Obj } from "../index.esm.js";
|
|
2
|
+
import { PicoFormat } from "../utils/Format.js";
|
|
2
3
|
|
|
3
4
|
export const OPTION_REGEX = {
|
|
4
5
|
entry: /(^|;)(\s*(?<key>.*?)\s*:\s*(?<val>".*?"|'.*?'|.*?)\s*)(?=;|$)/g
|
|
@@ -96,7 +97,8 @@ export class PicoFormatOptionStatic
|
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
/**
|
|
99
|
-
* @
|
|
100
|
+
* @param {typeof PicoFormat} self
|
|
101
|
+
* @returns {typeof PicoFormat}
|
|
100
102
|
*/
|
|
101
103
|
export const PicoFormatOptionPlugin = function (self) {
|
|
102
104
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Arr, Mix, Obj, For } from "
|
|
1
|
+
import { Arr, Mix, Obj, For } from "../index.esm.js";
|
|
2
|
+
import { PicoFormat } from "../utils/Format.js";
|
|
2
3
|
|
|
3
4
|
export const PARAM_REGEX = {
|
|
4
5
|
entry: /(?<=^|&|\?)(\s*(?<key>.*?)\s*=\s*(?<val>".*?"|'.*?'|.*?)\s*)(?=&|$)/g
|
|
@@ -95,7 +96,8 @@ export class PicoFormatParamStatic
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
/**
|
|
98
|
-
* @
|
|
99
|
+
* @param {typeof PicoFormat} self
|
|
100
|
+
* @returns {typeof PicoFormat}
|
|
99
101
|
*/
|
|
100
102
|
export const PicoFormatParamPlugin = function (self) {
|
|
101
103
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Mix, Obj } from "
|
|
1
|
+
import { Mix, Obj } from "../index.esm.js";
|
|
2
|
+
import { PicoFormat } from "../utils/Format.js";
|
|
2
3
|
|
|
3
4
|
export const TYPE_PARSERS = [
|
|
4
5
|
{ // null
|
|
@@ -144,7 +145,8 @@ export class PicoFormatParserStatic
|
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
/**
|
|
147
|
-
* @
|
|
148
|
+
* @param {typeof PicoFormat} self
|
|
149
|
+
* @returns {typeof PicoFormat}
|
|
148
150
|
*/
|
|
149
151
|
export const PicoFormatParserPlugin = function (self) {
|
|
150
152
|
|
package/src/format/FormatUrl.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Arr, Mix, Obj } from "
|
|
1
|
+
import { Arr, Mix, Obj } from "../index.esm.js";
|
|
2
|
+
import { PicoFormat } from "../utils/Format.js";
|
|
2
3
|
|
|
3
4
|
export const SLUG_CONVERT = [
|
|
4
5
|
['à', 'a'],
|
|
@@ -63,7 +64,8 @@ export class PicoFormatUrlStatic
|
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
/**
|
|
66
|
-
* @
|
|
67
|
+
* @param {typeof PicoFormat} self
|
|
68
|
+
* @returns {typeof PicoFormat}
|
|
67
69
|
*/
|
|
68
70
|
export const PicoFormatUrlPlugin = function (self) {
|
|
69
71
|
|
package/src/index.browser.js
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
|
-
import * as pi from "
|
|
1
|
+
import * as pi from "./index.esm.js";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {Object} PicoLibrary
|
|
5
|
+
* @property {function(): *} [go]
|
|
6
|
+
* @property {function(): void} [browser]
|
|
7
|
+
* @property {function(): void} [device]
|
|
8
|
+
* @property {PicoMixed} [Any]
|
|
9
|
+
* @property {PicoArray} [Arr]
|
|
10
|
+
* @property {PicoDom} [Dom]
|
|
11
|
+
* @property {PicoFormat} [For]
|
|
12
|
+
* @property {PicoMap} [Map]
|
|
13
|
+
* @property {PicoMixed} [Mix]
|
|
14
|
+
* @property {PicoNow} [Now]
|
|
15
|
+
* @property {PicoNumber} [Num]
|
|
16
|
+
* @property {PicoObject} [Obj]
|
|
17
|
+
* @property {PicoRunner} [Run]
|
|
18
|
+
* @property {PicoString} [Str]
|
|
19
|
+
* @property {PicoHash} [Hash]
|
|
20
|
+
* @property {PicoEvent} [Event]
|
|
21
|
+
* @property {PicoLocale} [Locale]
|
|
22
|
+
* @property {PicoCookie} [Cookie]
|
|
23
|
+
* @property {PicoData} [Data]
|
|
24
|
+
* @property {PicoRoute} [Route]
|
|
25
|
+
* @property {PicoElement} [Element]
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @type {PicoLibrary}
|
|
30
|
+
*/
|
|
31
|
+
globalThis.pi = pi;
|