@kizmann/pico-js 0.5.4 → 1.0.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/README.md +1 -1
- package/dist/pico-js.js +1 -1
- package/dist/pico-js.js.map +1 -1
- package/package.json +24 -6
- package/src/utility/object.js +10 -2
- package/babel.config.cjs +0 -16
- package/docs/cookie.html +0 -53
- package/docs/element/ready.html +0 -74
- package/docs/element/resizer.html +0 -85
- package/docs/index.html +0 -12
- package/docs/library/map.html +0 -312
- package/docs/store.html +0 -80
- package/docs/style.css +0 -41
- package/docs/utility/any.md +0 -427
- package/mix-manifest.json +0 -4
- package/pico.svg +0 -52
- package/tsconfig.json +0 -14
- package/types/index.d.ts +0 -25
- package/types/utility/any.d.ts +0 -66
- package/types/utility/array.d.ts +0 -46
- package/types/utility/now.d.ts +0 -148
- package/types/utility/number.d.ts +0 -31
- package/types/utility/object.d.ts +0 -54
- package/types/utility/string.d.ts +0 -33
- package/webpack.config.cjs +0 -83
- package/webservy.json +0 -8
- /package/{.nojekyll → dist/.ignore.js} +0 -0
package/types/utility/any.d.ts
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
// types/utility/any.d.ts
|
2
|
-
|
3
|
-
|
4
|
-
import { Arr } from "./array";
|
5
|
-
import { Obj } from "./object";
|
6
|
-
import { Now } from "./now";
|
7
|
-
|
8
|
-
declare class Any {
|
9
|
-
static isEmpty(val : any) : boolean;
|
10
|
-
|
11
|
-
static isNull(val : any) : boolean;
|
12
|
-
|
13
|
-
static isEqual(obj : any, val : any) : boolean;
|
14
|
-
|
15
|
-
static isString(val : any) : boolean;
|
16
|
-
|
17
|
-
static isNumber(val : any) : boolean;
|
18
|
-
|
19
|
-
static isBool(val : any) : boolean;
|
20
|
-
|
21
|
-
static isFunction(val : any) : boolean;
|
22
|
-
|
23
|
-
static isObject(val : any) : boolean;
|
24
|
-
|
25
|
-
static isPlain(val : any) : boolean;
|
26
|
-
|
27
|
-
static isArray(val : any) : boolean;
|
28
|
-
|
29
|
-
static isDate(val : any) : boolean;
|
30
|
-
|
31
|
-
static string(val : any) : string;
|
32
|
-
|
33
|
-
static convertString(val : any, empty? : string) : string;
|
34
|
-
|
35
|
-
static integer(val : any) : number;
|
36
|
-
|
37
|
-
static float(val : any) : number;
|
38
|
-
|
39
|
-
static bool(val : any) : boolean;
|
40
|
-
|
41
|
-
static boolean(val : any) : boolean;
|
42
|
-
|
43
|
-
static convertBool(val : any, yes? : string, no? : string) : string;
|
44
|
-
|
45
|
-
static convertBoolean(val : any, yes? : string, no? : string) : string;
|
46
|
-
|
47
|
-
static convertDatetime(val : any, format? : string, empty? : string) : string;
|
48
|
-
|
49
|
-
static vals(obj : any) : any[];
|
50
|
-
|
51
|
-
static keys(obj : any) : string[];
|
52
|
-
|
53
|
-
static async(callback : (...args : any[]) => void, ...args : any[]) : Any;
|
54
|
-
|
55
|
-
static delay(callback : (...args : any[]) => void, delay? : number, ...args : any[]) : Any;
|
56
|
-
|
57
|
-
static debounce(callback : (...args : any[]) => void, delay? : number, ref? : any) : (...args : any[]) => void;
|
58
|
-
|
59
|
-
static throttle(callback : (...args : any[]) => void, delay? : number, ref? : any) : (...args : any[]) => void;
|
60
|
-
|
61
|
-
static framerate(callback : (...args : any[]) => void, rate? : number, ref? : any) : (...args : any[]) => void;
|
62
|
-
|
63
|
-
static form(obj : any) : FormData;
|
64
|
-
}
|
65
|
-
|
66
|
-
export default Any;
|
package/types/utility/array.d.ts
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
// types/utility/array.d.ts
|
2
|
-
|
3
|
-
declare class Arr {
|
4
|
-
static make(count: number): number[];
|
5
|
-
static all<T>(arr: T | T[]): T[];
|
6
|
-
static get<T>(arr: T[], index: number, fallback?: T): T;
|
7
|
-
static set<T>(arr: T[], index: number, value: T): T;
|
8
|
-
static first<T>(arr: T[], fallback?: T): T;
|
9
|
-
static second<T>(arr: T[], fallback?: T): T;
|
10
|
-
static third<T>(arr: T[], fallback?: T): T;
|
11
|
-
static last<T>(arr: T[], fallback?: T): T;
|
12
|
-
static prepend<T>(arr: T[], val: T): T[];
|
13
|
-
static append<T>(arr: T[], val: T): T[];
|
14
|
-
static sort<T>(obj: AnyObject, key: string | ((a: T, b: T) => number)): T[];
|
15
|
-
static sortString<T>(obj: AnyObject, key: string): T[];
|
16
|
-
static filter<T>(arr: T[], filter: any): T[];
|
17
|
-
static filterIndex(arr: any[], filter: any): number[];
|
18
|
-
static find<T>(arr: T[], val: any, fallback?: T): T;
|
19
|
-
static findIndex(arr: any[], val: any, fallback?: number): number;
|
20
|
-
static has<T>(arr: T[], val: any): boolean;
|
21
|
-
static add<T>(arr: T[], val: T, finder?: any): T[];
|
22
|
-
static replace<T>(arr: T[], val: T, finder?: any): T[];
|
23
|
-
static remove<T>(arr: T[], val: any): T[];
|
24
|
-
static toggle<T>(arr: T[], val: T): T[];
|
25
|
-
static removeIndex<T>(arr: T[], val: number): T[];
|
26
|
-
static insert<T>(arr: T[], key: number, val: T): T[];
|
27
|
-
static slice<T>(arr: T[], key: number, count?: number): T[];
|
28
|
-
static splice<T>(arr: T[], key: number, count?: number): T[];
|
29
|
-
static equal<T>(arr1: T[], arr2: T[]): boolean;
|
30
|
-
static includes<T>(arr: T[], val: T): boolean;
|
31
|
-
static contains<T>(arr: T[], val: T[]): boolean;
|
32
|
-
static concat<T>(arr: T[], ...args: T[]): T[];
|
33
|
-
static clone<T>(arr: T[]): T[];
|
34
|
-
static merge<T>(arr: T[], ...args: T[]): T[];
|
35
|
-
static push<T>(arr: T[], ...args: T[]): T[];
|
36
|
-
static diff<T>(arr: T[], val: T[]): T[];
|
37
|
-
static intersect<T>(...args: T[][]): T[];
|
38
|
-
static chunk<T>(arr: T[], chunk?: number): T[][];
|
39
|
-
static reduce<T, U>(arr: T[], callback: (accumulator: U, currentValue: T, currentIndex: number, array: T[]) => U, accumulator: U): U;
|
40
|
-
static extract<T>(arr: T[], path: string): any[];
|
41
|
-
static each<T>(arr: T[], callback: (val: T, key: number | string) => any): any[];
|
42
|
-
static map<T>(arr: T[], callback: (val: T, key: number | string) => any): T[];
|
43
|
-
static recursive<T>(arr: T[], key: string, callback: (val: any, cascade: any[]) => any, cascade?: any[]): T[];
|
44
|
-
}
|
45
|
-
|
46
|
-
export default Arr;
|
package/types/utility/now.d.ts
DELETED
@@ -1,148 +0,0 @@
|
|
1
|
-
// types/utility/now.d.ts
|
2
|
-
|
3
|
-
import { Num } from "./number";
|
4
|
-
import { Arr } from "./array";
|
5
|
-
import { Any } from "./any";
|
6
|
-
|
7
|
-
declare class Now {
|
8
|
-
initialDate : string | null;
|
9
|
-
moment : any;
|
10
|
-
|
11
|
-
constructor(date? : any, format? : string);
|
12
|
-
|
13
|
-
static make(date? : any, format? : string) : Now;
|
14
|
-
|
15
|
-
get() : any;
|
16
|
-
|
17
|
-
valid() : boolean;
|
18
|
-
|
19
|
-
clone() : Now;
|
20
|
-
|
21
|
-
code(format? : string) : number;
|
22
|
-
|
23
|
-
format(format? : string, force? : boolean) : string;
|
24
|
-
|
25
|
-
before(before? : any) : boolean;
|
26
|
-
|
27
|
-
beforeDate(before? : any) : boolean;
|
28
|
-
|
29
|
-
beforeTime(before? : any) : boolean;
|
30
|
-
|
31
|
-
after(after? : any) : boolean;
|
32
|
-
|
33
|
-
afterDate(after? : any) : boolean;
|
34
|
-
|
35
|
-
afterTime(after? : any) : boolean;
|
36
|
-
|
37
|
-
equal(equal? : any, format? : string) : boolean;
|
38
|
-
|
39
|
-
equalDate(equal? : any, format? : string) : boolean;
|
40
|
-
|
41
|
-
equalTime(equal? : any, format? : string) : boolean;
|
42
|
-
|
43
|
-
between(fromDate? : any, toDate? : any, format? : string) : boolean;
|
44
|
-
|
45
|
-
decade() : number;
|
46
|
-
|
47
|
-
prevDecade() : Now;
|
48
|
-
|
49
|
-
nextDecade() : Now;
|
50
|
-
|
51
|
-
addDecades(count? : number) : Now;
|
52
|
-
|
53
|
-
subDecades(count? : number) : Now;
|
54
|
-
|
55
|
-
year(year? : number | null) : number | Now;
|
56
|
-
|
57
|
-
prevYear() : Now;
|
58
|
-
|
59
|
-
nextYear() : Now;
|
60
|
-
|
61
|
-
addYears(count? : number) : Now;
|
62
|
-
|
63
|
-
subYears(count? : number) : Now;
|
64
|
-
|
65
|
-
month(month? : number | null) : number | Now;
|
66
|
-
|
67
|
-
addMonths(count? : number) : Now;
|
68
|
-
|
69
|
-
subMonths(count? : number) : Now;
|
70
|
-
|
71
|
-
prevMonth() : Now;
|
72
|
-
|
73
|
-
nextMonth() : Now;
|
74
|
-
|
75
|
-
date(date? : number | null) : number | Now;
|
76
|
-
|
77
|
-
addDates(count? : number) : Now;
|
78
|
-
|
79
|
-
subDates(count? : number) : Now;
|
80
|
-
|
81
|
-
prevDate() : Now;
|
82
|
-
|
83
|
-
nextDate() : Now;
|
84
|
-
|
85
|
-
lastDate() : number;
|
86
|
-
|
87
|
-
day(day? : number | null) : number | Now;
|
88
|
-
|
89
|
-
hour(hour? : number | null) : number | Now;
|
90
|
-
|
91
|
-
addHour(count? : number) : Now;
|
92
|
-
|
93
|
-
subHour(count? : number) : Now;
|
94
|
-
|
95
|
-
prevHour() : Now;
|
96
|
-
|
97
|
-
nextHour() : Now;
|
98
|
-
|
99
|
-
minute(minute? : number | null) : number | Now;
|
100
|
-
|
101
|
-
addMinute(count? : number) : Now;
|
102
|
-
|
103
|
-
subMinute(count? : number) : Now;
|
104
|
-
|
105
|
-
prevMinute() : Now;
|
106
|
-
|
107
|
-
nextMinute() : Now;
|
108
|
-
|
109
|
-
second(second? : number | null) : number | Now;
|
110
|
-
|
111
|
-
addSecond(count? : number) : Now;
|
112
|
-
|
113
|
-
subSecond(count? : number) : Now;
|
114
|
-
|
115
|
-
prevSecond() : Now;
|
116
|
-
|
117
|
-
nextSecond() : Now;
|
118
|
-
|
119
|
-
humanDay() : number;
|
120
|
-
|
121
|
-
humanMonth() : number;
|
122
|
-
|
123
|
-
getMonths() : Now[];
|
124
|
-
|
125
|
-
getYears() : Now[];
|
126
|
-
|
127
|
-
getYearsGrid(size? : number) : Now[];
|
128
|
-
|
129
|
-
getDates() : Now[];
|
130
|
-
|
131
|
-
getDatesRange(target? : any) : Now[];
|
132
|
-
|
133
|
-
getDatesGrid(start? : number, end? : number) : Now[];
|
134
|
-
|
135
|
-
getHours(interval? : number) : Now[];
|
136
|
-
|
137
|
-
getMinutes(interval? : number) : Now[];
|
138
|
-
|
139
|
-
getSeconds(interval? : number) : Now[];
|
140
|
-
|
141
|
-
resetTime() : Now;
|
142
|
-
|
143
|
-
applyDate(now : any, format? : string) : void;
|
144
|
-
|
145
|
-
applyTime(now : any, format? : string) : void;
|
146
|
-
}
|
147
|
-
|
148
|
-
export default Now;
|
@@ -1,31 +0,0 @@
|
|
1
|
-
// types/utility/number.d.ts
|
2
|
-
|
3
|
-
import { Any } from "./any";
|
4
|
-
import { Arr } from "./array";
|
5
|
-
import { Obj } from "./object";
|
6
|
-
|
7
|
-
declare class Num {
|
8
|
-
static int(num : any) : number;
|
9
|
-
|
10
|
-
static float(num : any) : number;
|
11
|
-
|
12
|
-
static ceil(num : number) : number;
|
13
|
-
|
14
|
-
static round(num : number) : number;
|
15
|
-
|
16
|
-
static floor(num : number) : number;
|
17
|
-
|
18
|
-
static fixed(num : number, fixed? : number) : string;
|
19
|
-
|
20
|
-
static random(start? : number, end? : number) : number;
|
21
|
-
|
22
|
-
static matrix(num : number, limit? : number, base? : number[]) : number[];
|
23
|
-
|
24
|
-
static combine(arr : number[]) : number;
|
25
|
-
|
26
|
-
static distance(cord1 : { lat : number; lng : number }, cord2 : { lat : number; lng : number }, miles? : boolean) : number;
|
27
|
-
|
28
|
-
static format(num : number | null, decimal? : string, thousand? : string, fixed? : number | null) : string | null;
|
29
|
-
}
|
30
|
-
|
31
|
-
export default Num;
|
@@ -1,54 +0,0 @@
|
|
1
|
-
// types/utility/object.d.ts
|
2
|
-
|
3
|
-
import { Arr } from "./array";
|
4
|
-
import { Any } from "./any";
|
5
|
-
|
6
|
-
declare class Obj {
|
7
|
-
static has(obj : any, keys : string | string[]) : boolean;
|
8
|
-
|
9
|
-
static empty(obj : any, key : string) : boolean;
|
10
|
-
|
11
|
-
static get(obj : any, keys : string | string[], fallback? : any) : any;
|
12
|
-
|
13
|
-
static set(obj : any, keys : string | string[], val : any) : any;
|
14
|
-
|
15
|
-
static unset(obj : any, keys : string | string[]) : any;
|
16
|
-
|
17
|
-
static pluck(obj : any, keys : string | string[], fallback? : any) : any;
|
18
|
-
|
19
|
-
static only(obj : any, keys : string[], assign? : any) : any;
|
20
|
-
|
21
|
-
static except(obj : any, keys : string[], assign? : any) : any;
|
22
|
-
|
23
|
-
static includes(obj : any, val : any) : boolean;
|
24
|
-
|
25
|
-
static matches(obj : any, val : any) : boolean;
|
26
|
-
|
27
|
-
static sort(obj : any, key : string | ((a : any, b : any) => number)) : any[];
|
28
|
-
|
29
|
-
static sortString(obj : any, key : string) : any[];
|
30
|
-
|
31
|
-
static filter(obj : any, filter : any) : any[];
|
32
|
-
|
33
|
-
static filterIndex(obj : any, filter : any) : string[];
|
34
|
-
|
35
|
-
static find(arr : any[], obj : any, fallback? : any) : any;
|
36
|
-
|
37
|
-
static findIndex(arr : any[], obj : any, fallback? : number) : number;
|
38
|
-
|
39
|
-
static clone(obj : any) : any;
|
40
|
-
|
41
|
-
static assign(...args : any[]) : any;
|
42
|
-
|
43
|
-
static remove(obj : any, keys : string[]) : any;
|
44
|
-
|
45
|
-
static each(obj : any, callback : (value : any, key : string) => void) : any;
|
46
|
-
|
47
|
-
static map(obj : any, callback : (value : any, key : string) => any) : any;
|
48
|
-
|
49
|
-
static values(obj : any) : any[];
|
50
|
-
|
51
|
-
static flatten(obj : any) : any;
|
52
|
-
}
|
53
|
-
|
54
|
-
export default Obj;
|
@@ -1,33 +0,0 @@
|
|
1
|
-
// types/utility/string.d.ts
|
2
|
-
|
3
|
-
declare module "@kizmann/pico-js/src/utility/string" {
|
4
|
-
import { Arr } from "@kizmann/pico-js/src/utility/array";
|
5
|
-
import { Obj } from "@kizmann/pico-js/src/utility/object";
|
6
|
-
import { Num } from "@kizmann/pico-js/src/utility/number";
|
7
|
-
import { Any } from "@kizmann/pico-js/src/utility/any";
|
8
|
-
|
9
|
-
export class Str {
|
10
|
-
static regexEscape(val: string): string;
|
11
|
-
static upper(val: string): string;
|
12
|
-
static lower(val: string): string;
|
13
|
-
static camelcase(val: string): string;
|
14
|
-
static humancase(val: string): string;
|
15
|
-
static slugify(val: string): string;
|
16
|
-
static ucfirst(val: string): string;
|
17
|
-
static lcfirst(val: string): string;
|
18
|
-
static has(val: string, search: string): boolean;
|
19
|
-
static filesize(val: number, decimals?: number): string | null;
|
20
|
-
static array(value: string, fallback?: any[]): any[];
|
21
|
-
static real(value: string): any;
|
22
|
-
static objectify(value: any, mode?: 'options' | 'params', isArray?: boolean): any;
|
23
|
-
static stringify(value: any, mode?: 'options' | 'params'): string;
|
24
|
-
static options(params: any, quota?: string | null): string;
|
25
|
-
static fromOptions(value: string, isArray?: boolean): any;
|
26
|
-
private static convertFromOptions(result: any, match: string): any;
|
27
|
-
static params(params: any, quota?: string | null): string;
|
28
|
-
static fromParams(value: string, isArray?: boolean): any;
|
29
|
-
private static convertFromParams(result: any, match: string): any;
|
30
|
-
}
|
31
|
-
|
32
|
-
export default Str;
|
33
|
-
}
|
package/webpack.config.cjs
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
const path = require("path");
|
2
|
-
const webpack = require("webpack");
|
3
|
-
const TerserPlugin = require("terser-webpack-plugin");
|
4
|
-
|
5
|
-
let config = {
|
6
|
-
entry: ["./src/index.js"],
|
7
|
-
module: {
|
8
|
-
rules: [
|
9
|
-
{
|
10
|
-
test: /.js$/,
|
11
|
-
include: [
|
12
|
-
path.resolve(__dirname, './src')
|
13
|
-
],
|
14
|
-
loader: 'babel-loader',
|
15
|
-
options: {
|
16
|
-
configFile: path.resolve('./babel.config.cjs')
|
17
|
-
},
|
18
|
-
}
|
19
|
-
]
|
20
|
-
},
|
21
|
-
// externals: {
|
22
|
-
// 'moment': {
|
23
|
-
// root: 'moment', commonjs2: 'moment', commonjs: 'moment', amd: 'moment'
|
24
|
-
// },
|
25
|
-
// },
|
26
|
-
plugins: []
|
27
|
-
};
|
28
|
-
|
29
|
-
module.exports = function (env, argv) {
|
30
|
-
|
31
|
-
config.mode = argv.mode;
|
32
|
-
|
33
|
-
if ( argv.mode === 'development' ) {
|
34
|
-
config.devtool = 'eval-source-map';
|
35
|
-
}
|
36
|
-
|
37
|
-
if ( argv.mode === 'production' ) {
|
38
|
-
config.devtool = 'source-map';
|
39
|
-
}
|
40
|
-
|
41
|
-
/**
|
42
|
-
* @const __dirname
|
43
|
-
*/
|
44
|
-
|
45
|
-
let bundlerPackage = Object.assign({
|
46
|
-
|
47
|
-
output:{
|
48
|
-
filename: "pico-js.js",
|
49
|
-
path: path.resolve(__dirname, "dist"),
|
50
|
-
library: 'Pico',
|
51
|
-
libraryTarget: "umd",
|
52
|
-
},
|
53
|
-
|
54
|
-
}, config);
|
55
|
-
|
56
|
-
if ( argv.mode === 'development' ) {
|
57
|
-
return [bundlerPackage];
|
58
|
-
}
|
59
|
-
|
60
|
-
let loaderOptions = new webpack.LoaderOptionsPlugin({
|
61
|
-
minimize: true
|
62
|
-
});
|
63
|
-
|
64
|
-
bundlerPackage.plugins.push(loaderOptions);
|
65
|
-
|
66
|
-
let terserOptions = {
|
67
|
-
mangle: true
|
68
|
-
}
|
69
|
-
|
70
|
-
let terser = new TerserPlugin({
|
71
|
-
terserOptions, extractComments: false,
|
72
|
-
});
|
73
|
-
|
74
|
-
let optimization = {
|
75
|
-
minimize: true, minimizer: []
|
76
|
-
};
|
77
|
-
|
78
|
-
optimization.minimizer.push(terser);
|
79
|
-
|
80
|
-
bundlerPackage.optimization = optimization;
|
81
|
-
|
82
|
-
return [bundlerPackage];
|
83
|
-
}
|
package/webservy.json
DELETED
File without changes
|