@kizmann/pico-js 2.0.6 → 2.0.7
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 -1
- package/src/dom/DomAttribute.js +22 -0
- package/src/dom/DomEvent.js +14 -7
- package/src/dom/DomFinder.js +8 -1
- package/src/dom/DomObserver.js +1 -22
- package/src/dom/DomPopover.js +264 -0
- package/src/dom/DomRectangle.js +11 -0
- package/src/format/FormatOption.js +3 -3
- package/src/index.browser.js +7 -1
- package/src/index.esm.js +12 -2
- package/src/now/NowFormat.js +5 -2
- package/src/utils/Array.js +9 -1
- package/src/utils/Dom.js +6 -0
- package/src/utils/Mixed.js +8 -0
- package/src/utils/Runner.js +5 -6
- package/src/utils/{Event.js → Signal.js} +8 -7
- package/types/dom/DomEvent.d.ts +2 -1
- package/types/dom/DomFinder.d.ts +1 -0
- package/types/dom/DomObserver.d.ts +0 -9
- package/types/dom/DomPopover.d.ts +17 -0
- package/types/dom/DomRectangle.d.ts +1 -0
- package/types/index.esm.d.ts +6 -2
- package/types/now/NowFormat.d.ts +3 -0
- package/types/utils/Dom.d.ts +6 -0
- package/types/utils/{Event.d.ts → Signal.d.ts} +12 -12
package/types/dom/DomEvent.d.ts
CHANGED
|
@@ -98,9 +98,10 @@ export class PicoDomEventInstance {
|
|
|
98
98
|
* @example Dom.find("div").fire("click")
|
|
99
99
|
*
|
|
100
100
|
* @param {string} event Event name
|
|
101
|
+
* @param {object} [detail] Event detail
|
|
101
102
|
* @returns {PicoDom} Current instance
|
|
102
103
|
*/
|
|
103
|
-
fire(event: string): PicoDom;
|
|
104
|
+
fire(event: string, detail?: object): PicoDom;
|
|
104
105
|
/**
|
|
105
106
|
* @see PicoDom.once
|
|
106
107
|
*/
|
package/types/dom/DomFinder.d.ts
CHANGED
|
@@ -8,15 +8,6 @@ export class PicoDomObserverStatic {
|
|
|
8
8
|
* @extends {PicoDom}
|
|
9
9
|
*/
|
|
10
10
|
export class PicoDomObserverInstance {
|
|
11
|
-
/**
|
|
12
|
-
* Get or set element value
|
|
13
|
-
*
|
|
14
|
-
* @example Dom.find("input").value("hello")
|
|
15
|
-
*
|
|
16
|
-
* @param {any} [value] New value
|
|
17
|
-
* @returns {any|PicoDom} Value or instance
|
|
18
|
-
*/
|
|
19
|
-
value(value?: any): any | PicoDom;
|
|
20
11
|
}
|
|
21
12
|
export function PicoDomObserverPlugin(self: typeof PicoDom): typeof PicoDom;
|
|
22
13
|
import { PicoDom } from "../utils/Dom.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @memberof PicoDom
|
|
3
|
+
*/
|
|
4
|
+
export class PicoDomPopoverStatic {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @memberof PicoDom
|
|
8
|
+
* @extends {PicoDom}
|
|
9
|
+
*/
|
|
10
|
+
export class PicoDomPopoverInstance {
|
|
11
|
+
popover(target: any, position?: string, options?: {}): any;
|
|
12
|
+
popoverY(target: any, position?: string, options?: {}): any;
|
|
13
|
+
popoverX(target: any, position?: string, options?: {}): any;
|
|
14
|
+
popoverNormalize(offset: any, self: any, rect: any, win: any): any;
|
|
15
|
+
}
|
|
16
|
+
export function PicoDomPopoverPlugin(self: typeof PicoDom): typeof PicoDom;
|
|
17
|
+
import { PicoDom } from "../utils/Dom.js";
|
package/types/index.esm.d.ts
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* @type {typeof PicoMixed}
|
|
3
3
|
*/
|
|
4
4
|
export const Any: typeof PicoMixed;
|
|
5
|
+
/**
|
|
6
|
+
* @type {typeof PicoMixed}
|
|
7
|
+
*/
|
|
8
|
+
export const Event: typeof PicoMixed;
|
|
5
9
|
export function UUID(): string;
|
|
6
10
|
/**
|
|
7
11
|
* @type {typeof PicoDom}
|
|
@@ -22,7 +26,7 @@ import { default as Arr } from "./utils/Array.js";
|
|
|
22
26
|
import { default as Obj } from "./utils/Object.js";
|
|
23
27
|
import { default as Mix } from "./utils/Mixed.js";
|
|
24
28
|
import { default as Hash } from "./utils/Hash.js";
|
|
25
|
-
import { default as
|
|
29
|
+
import { default as Signal } from "./utils/Signal.js";
|
|
26
30
|
import { default as Locale } from "./utils/Locale.js";
|
|
27
31
|
import { default as Cookie } from "./utils/Cookie.js";
|
|
28
32
|
import { go } from "./tool/scope.js";
|
|
@@ -36,4 +40,4 @@ import { PicoMixed } from "./utils/Mixed.js";
|
|
|
36
40
|
import { PicoDom } from "./utils/Dom.js";
|
|
37
41
|
import { PicoNow } from "./utils/Now.js";
|
|
38
42
|
import { PicoFormat } from "./utils/Format.js";
|
|
39
|
-
export { Run, Str, Num, Arr, Obj, Mix, Hash,
|
|
43
|
+
export { Run, Str, Num, Arr, Obj, Mix, Hash, Signal, Locale, Cookie, go, browser, device, Map, Data, Route, Element };
|
package/types/now/NowFormat.d.ts
CHANGED
package/types/utils/Dom.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export const PicoDomPlugins: ((self: typeof PicoDom) => typeof PicoDom)[];
|
|
|
23
23
|
* @typedef {import('../dom/DomMeta.js').PicoDomMetaInstance} PicoDomMetaInstance
|
|
24
24
|
* @typedef {import('../dom/DomObserver.js').PicoDomObserverStatic} PicoDomObserverStatic
|
|
25
25
|
* @typedef {import('../dom/DomObserver.js').PicoDomObserverInstance} PicoDomObserverInstance
|
|
26
|
+
* @typedef {import('../dom/DomPopover.js').PicoDomPopoverStatic} PicoDomPopoverStatic
|
|
27
|
+
* @typedef {import('../dom/DomPopover.js').PicoDomPopoverInstance} PicoDomPopoverInstance
|
|
26
28
|
*
|
|
27
29
|
* @mixes PicoDomFinderStatic
|
|
28
30
|
* @mixes PicoDomGlobalStatic
|
|
@@ -34,6 +36,7 @@ export const PicoDomPlugins: ((self: typeof PicoDom) => typeof PicoDom)[];
|
|
|
34
36
|
* @mixes PicoDomInviewStatic
|
|
35
37
|
* @mixes PicoDomMetaStatic
|
|
36
38
|
* @mixes PicoDomObserverStatic
|
|
39
|
+
* @mixes PicoDomPopoverStatic
|
|
37
40
|
*
|
|
38
41
|
* @extends PicoDomFinderInstance
|
|
39
42
|
* @extends PicoDomGlobalInstance
|
|
@@ -45,6 +48,7 @@ export const PicoDomPlugins: ((self: typeof PicoDom) => typeof PicoDom)[];
|
|
|
45
48
|
* @extends PicoDomInviewInstance
|
|
46
49
|
* @extends PicoDomMetaInstance
|
|
47
50
|
* @extends PicoDomObserverInstance
|
|
51
|
+
* @extends PicoDomPopoverInstance
|
|
48
52
|
*/
|
|
49
53
|
export class PicoDom {
|
|
50
54
|
/**
|
|
@@ -136,3 +140,5 @@ export type PicoDomMetaStatic = import("../dom/DomMeta.js").PicoDomMetaStatic;
|
|
|
136
140
|
export type PicoDomMetaInstance = import("../dom/DomMeta.js").PicoDomMetaInstance;
|
|
137
141
|
export type PicoDomObserverStatic = import("../dom/DomObserver.js").PicoDomObserverStatic;
|
|
138
142
|
export type PicoDomObserverInstance = import("../dom/DomObserver.js").PicoDomObserverInstance;
|
|
143
|
+
export type PicoDomPopoverStatic = import("../dom/DomPopover.js").PicoDomPopoverStatic;
|
|
144
|
+
export type PicoDomPopoverInstance = import("../dom/DomPopover.js").PicoDomPopoverInstance;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class
|
|
1
|
+
export class PicoSignal {
|
|
2
2
|
static $events: any[];
|
|
3
3
|
/**
|
|
4
4
|
* Bind callback to event name
|
|
@@ -10,9 +10,9 @@ export class PicoEvent {
|
|
|
10
10
|
* @param {function} cb Event callback
|
|
11
11
|
* @param {any} [options] Listener options
|
|
12
12
|
* @param {boolean} [paused] Start paused
|
|
13
|
-
* @returns {typeof
|
|
13
|
+
* @returns {typeof PicoSignal} Event class
|
|
14
14
|
*/
|
|
15
|
-
static bind(event: any, cb: Function, options?: any, paused?: boolean): typeof
|
|
15
|
+
static bind(event: any, cb: Function, options?: any, paused?: boolean): typeof PicoSignal;
|
|
16
16
|
/**
|
|
17
17
|
* Unbind callback(s) from event
|
|
18
18
|
*
|
|
@@ -21,9 +21,9 @@ export class PicoEvent {
|
|
|
21
21
|
*
|
|
22
22
|
* @param {any} event Event name(s)
|
|
23
23
|
* @param {any} [options] Listener options
|
|
24
|
-
* @returns {typeof
|
|
24
|
+
* @returns {typeof PicoSignal} Event class
|
|
25
25
|
*/
|
|
26
|
-
static unbind(event: any, options?: any): typeof
|
|
26
|
+
static unbind(event: any, options?: any): typeof PicoSignal;
|
|
27
27
|
/**
|
|
28
28
|
* Fire event with arguments
|
|
29
29
|
*
|
|
@@ -31,9 +31,9 @@ export class PicoEvent {
|
|
|
31
31
|
*
|
|
32
32
|
* @param {string} event Event name
|
|
33
33
|
* @param {...any} args Event args
|
|
34
|
-
* @returns {typeof
|
|
34
|
+
* @returns {typeof PicoSignal} Event class
|
|
35
35
|
*/
|
|
36
|
-
static fire(event: string, ...args: any[]): typeof
|
|
36
|
+
static fire(event: string, ...args: any[]): typeof PicoSignal;
|
|
37
37
|
/**
|
|
38
38
|
* Pause listeners for event
|
|
39
39
|
*
|
|
@@ -41,9 +41,9 @@ export class PicoEvent {
|
|
|
41
41
|
*
|
|
42
42
|
* @param {any} event Event name(s)
|
|
43
43
|
* @param {any} [options] Listener options
|
|
44
|
-
* @returns {typeof
|
|
44
|
+
* @returns {typeof PicoSignal} Event class
|
|
45
45
|
*/
|
|
46
|
-
static pause(event: any, options?: any): typeof
|
|
46
|
+
static pause(event: any, options?: any): typeof PicoSignal;
|
|
47
47
|
/**
|
|
48
48
|
* Unpause listeners for event
|
|
49
49
|
*
|
|
@@ -51,8 +51,8 @@ export class PicoEvent {
|
|
|
51
51
|
*
|
|
52
52
|
* @param {any} event Event name(s)
|
|
53
53
|
* @param {any} [options] Listener options
|
|
54
|
-
* @returns {typeof
|
|
54
|
+
* @returns {typeof PicoSignal} Event class
|
|
55
55
|
*/
|
|
56
|
-
static unpause(event: any, options?: any): typeof
|
|
56
|
+
static unpause(event: any, options?: any): typeof PicoSignal;
|
|
57
57
|
}
|
|
58
|
-
export default
|
|
58
|
+
export default PicoSignal;
|