@kizmann/pico-js 2.0.9 → 2.0.11
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.ts +8 -2
- package/src/dom/DomEvent.ts +19 -12
- package/src/dom/DomFinder.ts +21 -6
- package/src/dom/DomGlobal.ts +8 -4
- package/src/dom/DomMeta.ts +1 -0
- package/src/dom/DomObserver.ts +0 -1
- package/src/dom/DomPopover.ts +39 -0
- package/src/dom/DomRectangle.ts +8 -0
- package/src/format/FormatFile.ts +1 -2
- package/src/format/FormatOption.ts +0 -1
- package/src/format/FormatParam.ts +0 -1
- package/src/now/NowDefault.ts +80 -32
- package/src/now/NowGrid.ts +30 -12
- package/src/now/NowMatch.ts +1 -1
- package/src/now/NowRange.ts +5 -2
- package/src/now/NowWalker.ts +0 -1
- package/src/tool/scope.ts +6 -0
- package/src/utils/Array.ts +130 -21
- package/src/utils/Dom.ts +1 -1
- package/src/utils/Locale.ts +3 -3
- package/src/utils/Mixed.ts +59 -13
- package/src/utils/Now.ts +5 -2
- package/src/utils/Number.ts +8 -2
- package/src/utils/Object.ts +26 -5
- package/src/utils/Signal.ts +1 -1
- package/src/utils/String.ts +24 -18
- package/src/wip/Map.ts +131 -101
- package/types/dom/DomEvent.d.ts +1 -1
- package/types/dom/DomGlobal.d.ts +4 -0
- package/types/dom/DomPopover.d.ts +39 -0
- package/types/dom/DomRectangle.d.ts +8 -0
- package/types/tool/scope.d.ts +6 -0
- package/types/utils/Array.d.ts +55 -4
- package/types/utils/Locale.d.ts +1 -1
- package/types/utils/Mixed.d.ts +10 -0
- package/types/utils/Object.d.ts +9 -0
package/package.json
CHANGED
package/src/dom/DomAttribute.ts
CHANGED
|
@@ -360,14 +360,20 @@ export class PicoDomAttribute
|
|
|
360
360
|
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
+
/**
|
|
364
|
+
* @deprecated use Dom.style instead
|
|
365
|
+
*/
|
|
363
366
|
// @ts-ignore
|
|
364
|
-
PicoDomAttribute.prototype.css = function
|
|
367
|
+
PicoDomAttribute.prototype.css = function(...args : Parameters<typeof PicoDomAttribute.prototype.style>) : any {
|
|
365
368
|
console.warn('Dom.css() is deprecated, use Dom.style() instead.');
|
|
366
369
|
return this.style(...args);
|
|
367
370
|
};
|
|
368
371
|
|
|
372
|
+
/**
|
|
373
|
+
* @deprecated use Dom.remClass instead
|
|
374
|
+
*/
|
|
369
375
|
// @ts-ignore
|
|
370
|
-
PicoDomAttribute.prototype.removeClass = function
|
|
376
|
+
PicoDomAttribute.prototype.removeClass = function(...args : Parameters<typeof PicoDomAttribute.prototype.remClass>) : any {
|
|
371
377
|
console.warn('Dom.removeClass() is deprecated, use Dom.remClass() instead.');
|
|
372
378
|
return this.remClass(...args);
|
|
373
379
|
};
|
package/src/dom/DomEvent.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arr, Hash, Mix,
|
|
1
|
+
import { Arr, Hash, Mix, Dom, Run } from "../index.esm.ts";
|
|
2
2
|
import { PicoDom, PicoDomInterface } from "../utils/Dom.ts";
|
|
3
3
|
import PicoDomFinder from "./DomFinder.js";
|
|
4
4
|
import PicoDomRectangle from "./DomRectangle.js";
|
|
@@ -43,12 +43,7 @@ export class PicoDomEvent
|
|
|
43
43
|
el, event, cb, selector, pause, options
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
el.addEventListener(event, cb, options);
|
|
49
|
-
} catch (e) {
|
|
50
|
-
console.log('ERRROR', this.els, el, e);
|
|
51
|
-
}
|
|
46
|
+
el.addEventListener(event, cb, options);
|
|
52
47
|
|
|
53
48
|
return <PicoDom> <unknown> this;
|
|
54
49
|
}
|
|
@@ -135,7 +130,7 @@ export class PicoDomEvent
|
|
|
135
130
|
* @example Dom.find("div").off("click")
|
|
136
131
|
*
|
|
137
132
|
* @param {any} event Event name
|
|
138
|
-
* @param {
|
|
133
|
+
* @param {any} [selector] Event selector
|
|
139
134
|
* @param {any} [options] Listener options
|
|
140
135
|
* @returns {PicoDom} Current instance
|
|
141
136
|
*/
|
|
@@ -284,24 +279,36 @@ export class PicoDomEvent
|
|
|
284
279
|
|
|
285
280
|
}
|
|
286
281
|
|
|
282
|
+
/**
|
|
283
|
+
* @deprecated use Dom.once instead
|
|
284
|
+
*/
|
|
287
285
|
// @ts-ignore
|
|
288
|
-
PicoDomEvent.prototype.one = function
|
|
286
|
+
PicoDomEvent.prototype.one = function(...args : Parameters<typeof PicoDomEvent.prototype.once>) : any {
|
|
289
287
|
console.warn('Dom.one() is deprecated, use Dom.once() instead.');
|
|
290
288
|
return this.once(...args);
|
|
291
289
|
};
|
|
292
290
|
|
|
291
|
+
/**
|
|
292
|
+
* @deprecated not implemented anymore
|
|
293
|
+
*/
|
|
293
294
|
// @ts-ignore
|
|
294
|
-
PicoDomEvent.prototype.delayed = function
|
|
295
|
+
PicoDomEvent.prototype.delayed = function() : void {
|
|
295
296
|
console.error('Dom.delayed() is not implemented anymore.');
|
|
296
297
|
};
|
|
297
298
|
|
|
299
|
+
/**
|
|
300
|
+
* @deprecated not implemented anymore
|
|
301
|
+
*/
|
|
298
302
|
// @ts-ignore
|
|
299
|
-
PicoDomEvent.prototype.pause = function
|
|
303
|
+
PicoDomEvent.prototype.pause = function() : void {
|
|
300
304
|
console.error('Dom.pause() is not implemented anymore.');
|
|
301
305
|
};
|
|
302
306
|
|
|
307
|
+
/**
|
|
308
|
+
* @deprecated not implemented anymore
|
|
309
|
+
*/
|
|
303
310
|
// @ts-ignore
|
|
304
|
-
PicoDomEvent.prototype.unpause = function
|
|
311
|
+
PicoDomEvent.prototype.unpause = function() : void {
|
|
305
312
|
console.error('Dom.unpause() is not implemented anymore.');
|
|
306
313
|
};
|
|
307
314
|
|
package/src/dom/DomFinder.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arr, Mix,
|
|
1
|
+
import { Arr, Mix, Dom } from "../index.esm.ts";
|
|
2
2
|
import { PicoDomInterface, PicoDom } from "../utils/Dom.ts";
|
|
3
3
|
|
|
4
4
|
export interface PicoDomFinder extends PicoDomInterface
|
|
@@ -610,32 +610,47 @@ export class PicoDomFinder
|
|
|
610
610
|
|
|
611
611
|
}
|
|
612
612
|
|
|
613
|
+
/**
|
|
614
|
+
* @deprecated use Dom.above instead
|
|
615
|
+
*/
|
|
613
616
|
// @ts-ignore
|
|
614
|
-
PicoDomFinder.prototype.isParent = function
|
|
617
|
+
PicoDomFinder.prototype.isParent = function(...args : Parameters<typeof PicoDomFinder.prototype.above>) : any {
|
|
615
618
|
console.warn('Dom.isParent() is deprecated, use Dom.above() instead.');
|
|
616
619
|
return this.above(...args);
|
|
617
620
|
};
|
|
618
621
|
|
|
622
|
+
/**
|
|
623
|
+
* @deprecated use Dom.prev instead
|
|
624
|
+
*/
|
|
619
625
|
// @ts-ignore
|
|
620
|
-
PicoDomFinder.prototype.previous = function
|
|
626
|
+
PicoDomFinder.prototype.previous = function() : any {
|
|
621
627
|
console.warn('Dom.previous() is deprecated, use Dom.prev() instead.');
|
|
622
628
|
return this.prev();
|
|
623
629
|
};
|
|
624
630
|
|
|
631
|
+
/**
|
|
632
|
+
* @deprecated use Dom.filter instead
|
|
633
|
+
*/
|
|
625
634
|
// @ts-ignore
|
|
626
|
-
PicoDomFinder.prototype.where = function
|
|
635
|
+
PicoDomFinder.prototype.where = function(...args : Parameters<typeof PicoDomFinder.prototype.filter>) : any {
|
|
627
636
|
console.warn('Dom.where() is deprecated, use Dom.filter() instead.');
|
|
628
637
|
return this.filter(...args);
|
|
629
638
|
};
|
|
630
639
|
|
|
640
|
+
/**
|
|
641
|
+
* @deprecated use Dom.except instead
|
|
642
|
+
*/
|
|
631
643
|
// @ts-ignore
|
|
632
|
-
PicoDomFinder.prototype.not = function
|
|
644
|
+
PicoDomFinder.prototype.not = function(...args : Parameters<typeof PicoDomFinder.prototype.except>) : any {
|
|
633
645
|
console.warn('Dom.not() is deprecated, use Dom.except() instead.');
|
|
634
646
|
return this.except(...args);
|
|
635
647
|
};
|
|
636
648
|
|
|
649
|
+
/**
|
|
650
|
+
* @deprecated not implemented anymore
|
|
651
|
+
*/
|
|
637
652
|
// @ts-ignore
|
|
638
|
-
PicoDomFinder.prototype.getNot = ()
|
|
653
|
+
PicoDomFinder.prototype.getNot = function() : void {
|
|
639
654
|
console.error('Dom.getNot() is not implemented anymore.');
|
|
640
655
|
};
|
|
641
656
|
|
package/src/dom/DomGlobal.ts
CHANGED
|
@@ -168,11 +168,15 @@ export class PicoDomGlobal
|
|
|
168
168
|
|
|
169
169
|
return <PicoDom> <unknown> this;
|
|
170
170
|
}
|
|
171
|
-
|
|
171
|
+
/**
|
|
172
|
+
* @deprecated not implemented anymore
|
|
173
|
+
*/
|
|
174
|
+
// @ts-ignore
|
|
175
|
+
static required() : void
|
|
176
|
+
{
|
|
177
|
+
console.error('Dom.required() is not implemented anymore.');
|
|
178
|
+
}
|
|
172
179
|
|
|
173
|
-
// @ts-ignore
|
|
174
|
-
PicoDomGlobal.required = () => {
|
|
175
|
-
console.error('Dom.required() is not implemented anymore.');
|
|
176
180
|
}
|
|
177
181
|
|
|
178
182
|
export default PicoDomGlobal;
|
package/src/dom/DomMeta.ts
CHANGED
package/src/dom/DomObserver.ts
CHANGED
package/src/dom/DomPopover.ts
CHANGED
|
@@ -14,6 +14,16 @@ export interface PicoDomPopover extends PicoDomInterface,
|
|
|
14
14
|
export class PicoDomPopover
|
|
15
15
|
{
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Calculate popover position
|
|
19
|
+
*
|
|
20
|
+
* @example Dom.find(".popover").popover(".target", "bottom-center")
|
|
21
|
+
*
|
|
22
|
+
* @param {any} target Target element
|
|
23
|
+
* @param {string} [position] Popover position
|
|
24
|
+
* @param {any} [options] Popover options
|
|
25
|
+
* @returns {any} Position result
|
|
26
|
+
*/
|
|
17
27
|
popover(target : any, position : string = 'botttom-center', options : any = {}) : any
|
|
18
28
|
{
|
|
19
29
|
if ( /^(top|bottom)-/.test(position) ) {
|
|
@@ -25,6 +35,16 @@ export class PicoDomPopover
|
|
|
25
35
|
}
|
|
26
36
|
}
|
|
27
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Calculate vertical popover position
|
|
40
|
+
*
|
|
41
|
+
* @example Dom.find(".popover").popoverY(".target", "bottom-center")
|
|
42
|
+
*
|
|
43
|
+
* @param {any} target Target element
|
|
44
|
+
* @param {string} [position] Popover position
|
|
45
|
+
* @param {any} [options] Popover options
|
|
46
|
+
* @returns {any} Position result
|
|
47
|
+
*/
|
|
28
48
|
popoverY(target : any, position : string = 'bottom-center', options : any = {}) : any
|
|
29
49
|
{
|
|
30
50
|
target = Dom.find(target);
|
|
@@ -120,6 +140,16 @@ export class PicoDomPopover
|
|
|
120
140
|
return { ...result, position };
|
|
121
141
|
}
|
|
122
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Calculate horizontal popover position
|
|
145
|
+
*
|
|
146
|
+
* @example Dom.find(".popover").popoverX(".target", "left-center")
|
|
147
|
+
*
|
|
148
|
+
* @param {any} target Target element
|
|
149
|
+
* @param {string} [position] Popover position
|
|
150
|
+
* @param {any} [options] Popover options
|
|
151
|
+
* @returns {any} Position result
|
|
152
|
+
*/
|
|
123
153
|
popoverX(target : any, position : string = 'left-center', options : any = {}) : any
|
|
124
154
|
{
|
|
125
155
|
target = Dom.find(target);
|
|
@@ -199,6 +229,15 @@ export class PicoDomPopover
|
|
|
199
229
|
return { ...result, position };
|
|
200
230
|
}
|
|
201
231
|
|
|
232
|
+
/**
|
|
233
|
+
* Normalize popover position
|
|
234
|
+
*
|
|
235
|
+
* @param {any} offset Current offset
|
|
236
|
+
* @param {any} self Popover size
|
|
237
|
+
* @param {any} rect Target rect
|
|
238
|
+
* @param {any} win Window size
|
|
239
|
+
* @returns {any} Normalized position
|
|
240
|
+
*/
|
|
202
241
|
popoverNormalize(offset : any, self : any, rect : any, win : any)
|
|
203
242
|
{
|
|
204
243
|
const scroll = Dom.find(document.body).scroll();
|
package/src/dom/DomRectangle.ts
CHANGED
|
@@ -32,6 +32,14 @@ export class PicoDomRectangle
|
|
|
32
32
|
return Mix.num(value, 0);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Get bounding rectangle
|
|
37
|
+
*
|
|
38
|
+
* @example Dom.find("div").rect()
|
|
39
|
+
*
|
|
40
|
+
* @param {any} [fallback] Fallback value
|
|
41
|
+
* @returns {any} Rect object
|
|
42
|
+
*/
|
|
35
43
|
rect(fallback : any = { left: 0, top: 0, width: 0, height: 0 })
|
|
36
44
|
{
|
|
37
45
|
if ( !this.el.getBoundingClientRect ) {
|
package/src/format/FormatFile.ts
CHANGED
package/src/now/NowDefault.ts
CHANGED
|
@@ -401,100 +401,148 @@ export class PicoNowDefault
|
|
|
401
401
|
|
|
402
402
|
}
|
|
403
403
|
|
|
404
|
+
/**
|
|
405
|
+
* @deprecated use Now.add instead
|
|
406
|
+
*/
|
|
404
407
|
// @ts-ignore
|
|
405
|
-
PicoNowDefault.prototype.addSecond = function
|
|
408
|
+
PicoNowDefault.prototype.addSecond = function(value : any) : PicoNow {
|
|
406
409
|
console.warn('Now.addSecond() is deprecated, use Now.add(value, \'second\') instead.');
|
|
407
410
|
return this.add(value, 'second');
|
|
408
|
-
}
|
|
411
|
+
};
|
|
409
412
|
|
|
413
|
+
/**
|
|
414
|
+
* @deprecated use Now.sub instead
|
|
415
|
+
*/
|
|
410
416
|
// @ts-ignore
|
|
411
|
-
PicoNowDefault.prototype.subSecond = function
|
|
417
|
+
PicoNowDefault.prototype.subSecond = function(value : any) : PicoNow {
|
|
412
418
|
console.warn('Now.subSecond() is deprecated, use Now.sub(value, \'second\') instead.');
|
|
413
419
|
return this.sub(value, 'second');
|
|
414
|
-
}
|
|
420
|
+
};
|
|
415
421
|
|
|
422
|
+
/**
|
|
423
|
+
* @deprecated use Now.add instead
|
|
424
|
+
*/
|
|
416
425
|
// @ts-ignore
|
|
417
|
-
PicoNowDefault.prototype.addMinute = function
|
|
426
|
+
PicoNowDefault.prototype.addMinute = function(value : any) : PicoNow {
|
|
418
427
|
console.warn('Now.addMinute() is deprecated, use Now.add(value, \'minute\') instead.');
|
|
419
428
|
return this.add(value, 'minute');
|
|
420
|
-
}
|
|
429
|
+
};
|
|
421
430
|
|
|
431
|
+
/**
|
|
432
|
+
* @deprecated use Now.sub instead
|
|
433
|
+
*/
|
|
422
434
|
// @ts-ignore
|
|
423
|
-
PicoNowDefault.prototype.subMinute = function
|
|
435
|
+
PicoNowDefault.prototype.subMinute = function(value : any) : PicoNow {
|
|
424
436
|
console.warn('Now.subMinute() is deprecated, use Now.sub(value, \'minute\') instead.');
|
|
425
437
|
return this.sub(value, 'minute');
|
|
426
|
-
}
|
|
438
|
+
};
|
|
427
439
|
|
|
440
|
+
/**
|
|
441
|
+
* @deprecated use Now.add instead
|
|
442
|
+
*/
|
|
428
443
|
// @ts-ignore
|
|
429
|
-
PicoNowDefault.prototype.addHour = function
|
|
444
|
+
PicoNowDefault.prototype.addHour = function(value : any) : PicoNow {
|
|
430
445
|
console.warn('Now.addHour() is deprecated, use Now.add(value, \'hour\') instead.');
|
|
431
446
|
return this.add(value, 'hour');
|
|
432
|
-
}
|
|
447
|
+
};
|
|
433
448
|
|
|
449
|
+
/**
|
|
450
|
+
* @deprecated use Now.sub instead
|
|
451
|
+
*/
|
|
434
452
|
// @ts-ignore
|
|
435
|
-
PicoNowDefault.prototype.subHour = function
|
|
453
|
+
PicoNowDefault.prototype.subHour = function(value : any) : PicoNow {
|
|
436
454
|
console.warn('Now.subHour() is deprecated, use Now.sub(value, \'hour\') instead.');
|
|
437
455
|
return this.sub(value, 'hour');
|
|
438
|
-
}
|
|
456
|
+
};
|
|
439
457
|
|
|
458
|
+
/**
|
|
459
|
+
* @deprecated use Now.add instead
|
|
460
|
+
*/
|
|
440
461
|
// @ts-ignore
|
|
441
|
-
PicoNowDefault.prototype.addDates = function
|
|
462
|
+
PicoNowDefault.prototype.addDates = function(value : any) : PicoNow {
|
|
442
463
|
console.warn('Now.addDates() is deprecated, use Now.add(value, \'date\') instead.');
|
|
443
464
|
return this.add(value, 'date');
|
|
444
|
-
}
|
|
465
|
+
};
|
|
445
466
|
|
|
467
|
+
/**
|
|
468
|
+
* @deprecated use Now.sub instead
|
|
469
|
+
*/
|
|
446
470
|
// @ts-ignore
|
|
447
|
-
PicoNowDefault.prototype.subDates = function
|
|
471
|
+
PicoNowDefault.prototype.subDates = function(value : any) : PicoNow {
|
|
448
472
|
console.warn('Now.subDates() is deprecated, use Now.sub(value, \'date\') instead.');
|
|
449
473
|
return this.sub(value, 'date');
|
|
450
|
-
}
|
|
474
|
+
};
|
|
451
475
|
|
|
476
|
+
/**
|
|
477
|
+
* @deprecated use Now.add instead
|
|
478
|
+
*/
|
|
452
479
|
// @ts-ignore
|
|
453
|
-
PicoNowDefault.prototype.addMonths = function
|
|
480
|
+
PicoNowDefault.prototype.addMonths = function(value : any) : PicoNow {
|
|
454
481
|
console.warn('Now.addMonths() is deprecated, use Now.add(value, \'month\') instead.');
|
|
455
482
|
return this.add(value, 'month');
|
|
456
|
-
}
|
|
483
|
+
};
|
|
457
484
|
|
|
485
|
+
/**
|
|
486
|
+
* @deprecated use Now.sub instead
|
|
487
|
+
*/
|
|
458
488
|
// @ts-ignore
|
|
459
|
-
PicoNowDefault.prototype.subMonths = function
|
|
489
|
+
PicoNowDefault.prototype.subMonths = function(value : any) : PicoNow {
|
|
460
490
|
console.warn('Now.subMonths() is deprecated, use Now.sub(value, \'month\') instead.');
|
|
461
491
|
return this.sub(value, 'month');
|
|
462
|
-
}
|
|
492
|
+
};
|
|
463
493
|
|
|
494
|
+
/**
|
|
495
|
+
* @deprecated use Now.add instead
|
|
496
|
+
*/
|
|
464
497
|
// @ts-ignore
|
|
465
|
-
PicoNowDefault.prototype.addYears = function
|
|
498
|
+
PicoNowDefault.prototype.addYears = function(value : any) : PicoNow {
|
|
466
499
|
console.warn('Now.addYears() is deprecated, use Now.add(value, \'year\') instead.');
|
|
467
500
|
return this.add(value, 'year');
|
|
468
|
-
}
|
|
501
|
+
};
|
|
469
502
|
|
|
503
|
+
/**
|
|
504
|
+
* @deprecated use Now.sub instead
|
|
505
|
+
*/
|
|
470
506
|
// @ts-ignore
|
|
471
|
-
PicoNowDefault.prototype.subYears = function
|
|
507
|
+
PicoNowDefault.prototype.subYears = function(value : any) : PicoNow {
|
|
472
508
|
console.warn('Now.subYears() is deprecated, use Now.sub(value, \'year\') instead.');
|
|
473
509
|
return this.sub(value, 'year');
|
|
474
|
-
}
|
|
510
|
+
};
|
|
475
511
|
|
|
512
|
+
/**
|
|
513
|
+
* @deprecated use Now.add instead
|
|
514
|
+
*/
|
|
476
515
|
// @ts-ignore
|
|
477
|
-
PicoNowDefault.prototype.addDecades = function
|
|
516
|
+
PicoNowDefault.prototype.addDecades = function(value : any) : PicoNow {
|
|
478
517
|
console.warn('Now.addDecades() is deprecated, use Now.grid(10 * value, \'year\') instead.');
|
|
479
518
|
return this.add(10 * value, 'year');
|
|
480
|
-
}
|
|
519
|
+
};
|
|
481
520
|
|
|
521
|
+
/**
|
|
522
|
+
* @deprecated use Now.sub instead
|
|
523
|
+
*/
|
|
482
524
|
// @ts-ignore
|
|
483
|
-
PicoNowDefault.prototype.subDecades = function
|
|
525
|
+
PicoNowDefault.prototype.subDecades = function(value : any) : PicoNow {
|
|
484
526
|
console.warn('Now.subDecades() is deprecated, use Now.grid(10 * value, \'year\') instead.');
|
|
485
527
|
return this.sub(10 * value, 'year');
|
|
486
|
-
}
|
|
528
|
+
};
|
|
487
529
|
|
|
530
|
+
/**
|
|
531
|
+
* @deprecated use Now.day instead
|
|
532
|
+
*/
|
|
488
533
|
// @ts-ignore
|
|
489
|
-
PicoNowDefault.prototype.humanDay = function
|
|
534
|
+
PicoNowDefault.prototype.humanDay = function() : number {
|
|
490
535
|
console.warn('Now.humanDay() is deprecated, use Now.day() instead.');
|
|
491
536
|
return this.day();
|
|
492
|
-
}
|
|
537
|
+
};
|
|
493
538
|
|
|
539
|
+
/**
|
|
540
|
+
* @deprecated use Now.month instead
|
|
541
|
+
*/
|
|
494
542
|
// @ts-ignore
|
|
495
|
-
PicoNowDefault.prototype.humanMonth = function
|
|
543
|
+
PicoNowDefault.prototype.humanMonth = function() : number {
|
|
496
544
|
console.warn('Now.humanMonth() is deprecated, use Now.month() instead.');
|
|
497
545
|
return this.month();
|
|
498
|
-
}
|
|
546
|
+
};
|
|
499
547
|
|
|
500
548
|
export default PicoNowDefault;
|
package/src/now/NowGrid.ts
CHANGED
|
@@ -197,40 +197,58 @@ export class PicoNowGrid
|
|
|
197
197
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
+
/**
|
|
201
|
+
* @deprecated use Now.grid instead
|
|
202
|
+
*/
|
|
200
203
|
// @ts-ignore
|
|
201
|
-
PicoNowGrid.prototype.getYears = function
|
|
204
|
+
PicoNowGrid.prototype.getYears = function() : Array<PicoNowInterface> {
|
|
202
205
|
console.warn('Now.getYears() is deprecated, use Now.grid(\'years\') instead.');
|
|
203
206
|
return this.grid('years');
|
|
204
|
-
}
|
|
207
|
+
};
|
|
205
208
|
|
|
209
|
+
/**
|
|
210
|
+
* @deprecated use Now.grid instead
|
|
211
|
+
*/
|
|
206
212
|
// @ts-ignore
|
|
207
|
-
PicoNowGrid.prototype.getMonths = function
|
|
213
|
+
PicoNowGrid.prototype.getMonths = function() : Array<PicoNowInterface> {
|
|
208
214
|
console.warn('Now.getMonths() is deprecated, use Now.grid(\'months\') instead.');
|
|
209
215
|
return this.grid('months');
|
|
210
|
-
}
|
|
216
|
+
};
|
|
211
217
|
|
|
218
|
+
/**
|
|
219
|
+
* @deprecated use Now.grid instead
|
|
220
|
+
*/
|
|
212
221
|
// @ts-ignore
|
|
213
|
-
PicoNowGrid.prototype.getDates = function
|
|
222
|
+
PicoNowGrid.prototype.getDates = function() : Array<PicoNowInterface> {
|
|
214
223
|
console.warn('Now.getDates() is deprecated, use Now.grid(\'dates\') instead.');
|
|
215
224
|
return this.grid('dates');
|
|
216
|
-
}
|
|
225
|
+
};
|
|
217
226
|
|
|
227
|
+
/**
|
|
228
|
+
* @deprecated use Now.grid instead
|
|
229
|
+
*/
|
|
218
230
|
// @ts-ignore
|
|
219
|
-
PicoNowGrid.prototype.getHours = function
|
|
231
|
+
PicoNowGrid.prototype.getHours = function() : Array<PicoNowInterface> {
|
|
220
232
|
console.warn('Now.getHours() is deprecated, use Now.grid(\'hours\') instead.');
|
|
221
233
|
return this.grid('hours');
|
|
222
|
-
}
|
|
234
|
+
};
|
|
223
235
|
|
|
236
|
+
/**
|
|
237
|
+
* @deprecated use Now.grid instead
|
|
238
|
+
*/
|
|
224
239
|
// @ts-ignore
|
|
225
|
-
PicoNowGrid.prototype.getMinutes = function
|
|
240
|
+
PicoNowGrid.prototype.getMinutes = function() : Array<PicoNowInterface> {
|
|
226
241
|
console.warn('Now.getMinutes() is deprecated, use Now.grid(\'minutes\') instead.');
|
|
227
242
|
return this.grid('minutes');
|
|
228
|
-
}
|
|
243
|
+
};
|
|
229
244
|
|
|
245
|
+
/**
|
|
246
|
+
* @deprecated use Now.grid instead
|
|
247
|
+
*/
|
|
230
248
|
// @ts-ignore
|
|
231
|
-
PicoNowGrid.prototype.getSeconds = function
|
|
249
|
+
PicoNowGrid.prototype.getSeconds = function() : Array<PicoNowInterface> {
|
|
232
250
|
console.warn('Now.getSeconds() is deprecated, use Now.grid(\'seconds\') instead.');
|
|
233
251
|
return this.grid('seconds');
|
|
234
|
-
}
|
|
252
|
+
};
|
|
235
253
|
|
|
236
254
|
export default PicoNowGrid;
|
package/src/now/NowMatch.ts
CHANGED
package/src/now/NowRange.ts
CHANGED
|
@@ -54,10 +54,13 @@ export class PicoNowRange
|
|
|
54
54
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated use Now.range instead
|
|
59
|
+
*/
|
|
57
60
|
// @ts-ignore
|
|
58
|
-
PicoNowRange.prototype.getDatesRange = function
|
|
61
|
+
PicoNowRange.prototype.getDatesRange = function(...args:Parameters<typeof PicoNowRange.prototype.range>) : Array<PicoNow> {
|
|
59
62
|
console.warn('Now.getDatesRange() is deprecated, use Now.range() instead.');
|
|
60
63
|
return this.range(...args);
|
|
61
|
-
}
|
|
64
|
+
};
|
|
62
65
|
|
|
63
66
|
export default PicoNowRange;
|
package/src/now/NowWalker.ts
CHANGED
package/src/tool/scope.ts
CHANGED
|
@@ -105,6 +105,12 @@ export function device() : void
|
|
|
105
105
|
scope.piudv = result;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Trait multiple classes
|
|
110
|
+
*
|
|
111
|
+
* @param {any[]} values Class array
|
|
112
|
+
* @returns {any} Traited class
|
|
113
|
+
*/
|
|
108
114
|
export function trait(values : any[]) {
|
|
109
115
|
|
|
110
116
|
const traited : any = values[0];
|