dphelper 0.2.89 → 0.2.91

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.
Files changed (119) hide show
  1. package/{CHANGELOG.txt → CHANGELOG.md} +0 -0
  2. package/{LICENSE.txt → LICENSE.md} +0 -0
  3. package/SECURITY.md +3 -3
  4. package/{public/assets → assets}/images/banner.png +0 -0
  5. package/{public/assets → assets}/logos/logo.svg +0 -0
  6. package/{public/documents → documents}/iDB/list.html +2 -2
  7. package/{public/documents → documents}/iDB/toState.html +0 -0
  8. package/index.js +2 -12
  9. package/index.js.LICENSE.txt +31 -0
  10. package/package.json +27 -35
  11. package/.editorconfig +0 -13
  12. package/.env +0 -3
  13. package/.eslintignore +0 -13
  14. package/.eslintrc.json +0 -87
  15. package/.eslintrc.legacy.json +0 -91
  16. package/.gitattributes +0 -2
  17. package/.hintrc +0 -11
  18. package/.jsbeautifyrc +0 -25
  19. package/.jshintrc +0 -16
  20. package/.prettierignore +0 -2
  21. package/.prettierrc.json +0 -8
  22. package/.stylelintignore +0 -0
  23. package/.stylelintrc.json +0 -468
  24. package/.vscode/launch.json +0 -34
  25. package/.vscode/settings.json +0 -58
  26. package/3party/shortcut.js +0 -224
  27. package/__mocks__/fileMock.js +0 -3
  28. package/__mocks__/styleMock.js +0 -3
  29. package/babel.config.js +0 -30
  30. package/backup.bat +0 -43
  31. package/coverage/coverage-final.json +0 -1
  32. package/coverage/lcov-report/base.css +0 -224
  33. package/coverage/lcov-report/block-navigation.js +0 -87
  34. package/coverage/lcov-report/favicon.png +0 -0
  35. package/coverage/lcov-report/index.html +0 -101
  36. package/coverage/lcov-report/prettify.css +0 -1
  37. package/coverage/lcov-report/prettify.js +0 -2
  38. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  39. package/coverage/lcov-report/sorter.js +0 -196
  40. package/coverage/lcov.info +0 -0
  41. package/data/list.json +0 -19
  42. package/dist/LICENSE.txt +0 -209
  43. package/dist/README.md +0 -79
  44. package/elements/button/component.js +0 -0
  45. package/elements/code/component.js +0 -0
  46. package/elements/costants.tsx +0 -13
  47. package/elements/fieldset/component.js +0 -0
  48. package/elements/input/checkbox/component.js +0 -0
  49. package/elements/input/date/component.js +0 -27
  50. package/elements/input/number/component.js +0 -0
  51. package/elements/input/radio/component.js +0 -0
  52. package/elements/input/search/component.js +0 -0
  53. package/elements/input/select/component.js +0 -0
  54. package/elements/input/slider/component.js +0 -0
  55. package/elements/input/switch/component.js +0 -0
  56. package/elements/tab/component.js +0 -0
  57. package/elements/table/component.js +0 -0
  58. package/elements/tags.less +0 -0
  59. package/elements/textarea/component.js +0 -0
  60. package/elements/x-foo/define.js +0 -33
  61. package/elements/x-foo/namespace.d.ts +0 -7
  62. package/init.js +0 -87
  63. package/jest.config.js +0 -81
  64. package/node/createTag.js +0 -7
  65. package/node/gitDeploy.js +0 -7
  66. package/node/goLive.js +0 -7
  67. package/scripts/.OLD/import.js +0 -48
  68. package/scripts/.OLD/onBeforeUnLoad.js +0 -120
  69. package/scripts/.OLD/purge.js +0 -53
  70. package/scripts/.OLD/string.js +0 -27
  71. package/scripts/anchor.js +0 -73
  72. package/scripts/array.js +0 -203
  73. package/scripts/avoid.js +0 -48
  74. package/scripts/browser.js +0 -100
  75. package/scripts/color.js +0 -121
  76. package/scripts/console.js +0 -97
  77. package/scripts/console.mapped.js +0 -160
  78. package/scripts/coods.js +0 -57
  79. package/scripts/cookie.js +0 -105
  80. package/scripts/date.js +0 -179
  81. package/scripts/disable.js +0 -91
  82. package/scripts/errors.js +0 -3
  83. package/scripts/event.js +0 -57
  84. package/scripts/font.js +0 -60
  85. package/scripts/form.js +0 -211
  86. package/scripts/format.js +0 -71
  87. package/scripts/function.js +0 -55
  88. package/scripts/iDB.js +0 -688
  89. package/scripts/json.js +0 -84
  90. package/scripts/load.js +0 -112
  91. package/scripts/math.js +0 -100
  92. package/scripts/obj.js +0 -118
  93. package/scripts/path.js +0 -101
  94. package/scripts/promise.js +0 -56
  95. package/scripts/screen.js +0 -82
  96. package/scripts/scrollbar.js +0 -293
  97. package/scripts/shortcut.js +0 -83
  98. package/scripts/socket.js +0 -184
  99. package/scripts/state.js +0 -87
  100. package/scripts/storage.js +0 -93
  101. package/scripts/store.js +0 -115
  102. package/scripts/svg.js +0 -380
  103. package/scripts/text.js +0 -116
  104. package/scripts/time.js +0 -43
  105. package/scripts/timer.js +0 -54
  106. package/scripts/tool.js +0 -73
  107. package/scripts/trigger.js +0 -57
  108. package/scripts/type.js +0 -76
  109. package/scripts/ui.js +0 -41
  110. package/scripts/window.js +0 -244
  111. package/styles/console.less +0 -95
  112. package/tests/setupJest.tsx +0 -4
  113. package/typings/.OLD/cordova.d.ts +0 -12
  114. package/typings/.OLD/layerpro.d.ts +0 -20
  115. package/typings/.OLD/menupro.d.ts +0 -20
  116. package/typings/dphelper.d.ts +0 -26
  117. package/typings/image.d.ts +0 -5
  118. package/typings/styles.d.ts +0 -23
  119. package/webpack.config.js +0 -249
package/scripts/array.js DELETED
@@ -1,203 +0,0 @@
1
- /*!
2
- dpHelper
3
- Copyright (c) 2021 Dario Passariello <dariopassariello@gmail.com>
4
- Licensed under the Apache-2.0, see
5
- https://dario.passariello.ca
6
- */
7
-
8
- /***********************************************************************/
9
-
10
- var description = {
11
- "name" : "Array",
12
- "version" : "0.0.1",
13
- "command" : "array",
14
- "example" : "",
15
- "author" : "Dario Passariello",
16
- "creationDate" : "20110101",
17
- "lastMod" : "20110101",
18
- "type" : "object",
19
- "active" : true,
20
- "description" : "",
21
- "subCommand" : [
22
- {
23
- "name":"find",
24
- "version" : "0.0.1",
25
- "example" : "",
26
- "type" : "function",
27
- "active": true,
28
- "description":"test",
29
- "subCommand" : []
30
- },{
31
- "name":"unique",
32
- "version" : "0.0.1",
33
- "example" : "",
34
- "type" : "function",
35
- "active": true,
36
- "description":"test",
37
- "subCommand" : []
38
- },{
39
- "name":"delete",
40
- "version" : "0.0.1",
41
- "example" : "",
42
- "type" : "function",
43
- "active": true,
44
- "description":"test",
45
- "subCommand" : []
46
- },{
47
- "name":"merge",
48
- "version" : "0.0.1",
49
- "example" : "",
50
- "type" : "function",
51
- "active": true,
52
- "description":"test",
53
- "subCommand" : []
54
- },{
55
- "name":"asc",
56
- "version" : "0.0.1",
57
- "example" : "",
58
- "type" : "function",
59
- "active": true,
60
- "description":"test",
61
- "subCommand" : []
62
- },{
63
- "name":"desc",
64
- "version" : "0.0.1",
65
- "example" : "",
66
- "type" : "function",
67
- "active": true,
68
- "description":"test",
69
- "subCommand" : []
70
- },{
71
- "name":"duplicates",
72
- "version" : "0.0.1",
73
- "example" : "",
74
- "type" : "function",
75
- "active": true,
76
- "description":"test",
77
- "subCommand" : []
78
- },{
79
- "name":"even",
80
- "version" : "0.0.1",
81
- "example" : "",
82
- "type" : "function",
83
- "active": true,
84
- "description":"test",
85
- "subCommand" : []
86
- },{
87
- "name":"odd",
88
- "version" : "0.0.1",
89
- "example" : "",
90
- "type" : "function",
91
- "active": true,
92
- "description":"test",
93
- "subCommand" : []
94
- }
95
- ],
96
-
97
- };
98
-
99
- dphelper._list.scripts.push( description );
100
-
101
- /***********************************************************************/
102
-
103
- dphelper.array = {
104
-
105
- // FIND
106
- find: ( id, array )=>{
107
- for (let node of array) {
108
- if (node.id === id) return node;
109
-
110
- if (node.children) {
111
- let finalNode = dphelper.array.find(id, node.children);
112
- if (finalNode) return finalNode;
113
- }
114
- }
115
- return false;
116
- },
117
-
118
- // UNIQUE
119
- unique: ( array ) => {
120
- let unique = [...new Set( array )];
121
- return unique;
122
- },
123
-
124
- // DELETE
125
- delete: ( array , id ) => {
126
- array.some(function iter (o,i,a) {
127
-
128
- if (o.Id === id) {
129
- a.splice(i, 1);
130
- return true;
131
- }
132
-
133
- for (let key of Object.keys(o)) {
134
- let value = o[key];
135
- if(value.length && typeof value === 'object') return value && value.map(iter);
136
- }
137
-
138
- // OLD SCHOOL WAY
139
- //var key = Object.keys(o);
140
- // for (var p=0; p < key.length; ++p){
141
- // if( o[key[p]]?.length && typeof o[key[p]] === 'object') return o[key[p]] && o[key[p]].some(iter);
142
- // }
143
-
144
- });
145
-
146
- },
147
-
148
- // MERGE
149
- merge: ( arrayA, arrayB ) => {
150
- for (const key of Object.keys(arrayA)) {
151
- if (arrayA[key] instanceof Object && arrayB[key]) Object.assign(arrayA[key], dphelper.mergeArrays(arrayB[key], arrayA[key]));
152
- }
153
-
154
- Object.assign(arrayB || {}, arrayA);
155
- return arrayB;
156
- },
157
-
158
- // ASCENDING
159
- asc: ( array ) => {
160
- array.sort((a, b) => a - b);
161
- return array;
162
- },
163
-
164
- // ASCENDING
165
- desc: ( array ) => {
166
- array.sort(function(a, b){ return b-a; });
167
- return array;
168
- },
169
-
170
- // FIND DUPLICATES
171
- duplicates: ( array ) => {
172
- const toFindDuplicates = arr => arr.filter( (item, index) => arr.indexOf( item ) !== index);
173
- const duplicateElements = toFindDuplicates( array );
174
- return duplicateElements;
175
- },
176
-
177
- even: ( array ) => {
178
- var cur = [];
179
- for (var i = 0; i < array.length; i++) {
180
- if (array[i] % 2 === 0 ) cur.push(array[i]);
181
- } return cur;
182
- },
183
-
184
- odd: ( array ) => {
185
- var cur = [];
186
- for (var i = 0; i < array.length; i++) {
187
- if (array[i] % 2) cur.push(array[i]);
188
- } return cur;
189
- },
190
-
191
- toObj: ( array ) => {
192
- return Object.assign({}, array);
193
- }
194
-
195
- };
196
-
197
- Object.defineProperty( dphelper, 'array', {
198
- writable: false,
199
- configurable: false
200
- });
201
-
202
- //console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
203
-
package/scripts/avoid.js DELETED
@@ -1,48 +0,0 @@
1
- /*!
2
- dpHelper
3
- Copyright (c) 2021 Dario Passariello <dariopassariello@gmail.com>
4
- Licensed under the Apache-2.0, see
5
- https://dario.passariello.ca
6
- */
7
-
8
- /***********************************************************************/
9
-
10
- var description = {
11
- "name" : "Avoid",
12
- "description" : "",
13
- "version" : "0.0.1",
14
- "command" : "avoid",
15
- "subCommand" : [
16
- {
17
- "name":"cache",
18
- "version" : "0.0.1",
19
- "example" : "dphelper.avoid.cache",
20
- "type" : "function",
21
- "active": true,
22
- "description":"test",
23
- "subCommand" : []
24
- },
25
- ],
26
- "example" : "",
27
- "author" : "Dario Passariello",
28
- "active" : true
29
- };
30
-
31
- dphelper._list.scripts.push( description );
32
-
33
- /***********************************************************************/
34
-
35
- dphelper.avoid = {
36
-
37
- cache: (uri) => {
38
- return uri.concat( /\?/.test(uri) ? '&' : '?', 't=', dphelper.rnd() );
39
- }
40
-
41
- };
42
-
43
- Object.defineProperty( dphelper, 'avoid', {
44
- writable: false,
45
- configurable: false
46
- });
47
-
48
- //console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
@@ -1,100 +0,0 @@
1
- /*!
2
- dpHelper
3
- Copyright (c) 2021 Dario Passariello <dariopassariello@gmail.com>
4
- Licensed under the Apache-2.0, see
5
- https://dario.passariello.ca
6
- */
7
-
8
- /***********************************************************************/
9
-
10
- var description = {
11
- "name" : "Browser",
12
- "version" : "0.0.1",
13
- "command" : "browser",
14
- "author" : "Dario Passariello",
15
- "active" : true,
16
- "example" : "",
17
- "type" : "object",
18
- "description":"test",
19
- "subCommand" : [
20
- {
21
- "name":"state",
22
- "version" : "0.0.1",
23
- "example" : "",
24
- "type" : "function",
25
- "active": true,
26
- "description":"test",
27
- "subCommand" : []
28
- },{
29
- "name":"forw",
30
- "version" : "0.0.1",
31
- "example" : "",
32
- "type" : "function",
33
- "active": true,
34
- "description":"test",
35
- "subCommand" : []
36
- },{
37
- "name":"back",
38
- "version" : "0.0.1",
39
- "example" : "",
40
- "type" : "function",
41
- "active": true,
42
- "description":"test",
43
- "subCommand" : []
44
- },{
45
- "name":"reload",
46
- "version" : "0.0.1",
47
- "example" : "",
48
- "type" : "function",
49
- "active": true,
50
- "description":"test",
51
- "subCommand" : []
52
- },{
53
- "name":"href",
54
- "version" : "0.0.1",
55
- "example" : "",
56
- "type" : "function",
57
- "active": true,
58
- "description":"test",
59
- "subCommand" : []
60
- }
61
- ]
62
-
63
- };
64
-
65
- dphelper._list.scripts.push( description );
66
-
67
- /***********************************************************************/
68
-
69
- dphelper.browser = {
70
-
71
- state: (state, title, url) => {
72
- return history.pushState( state, title, url );
73
- },
74
-
75
- forw: ( times ) => {
76
- return history.go( times );
77
- },
78
-
79
- back: ( times ) => {
80
- return history.go( -Math.abs( times ) );
81
- },
82
-
83
- reload: () => {
84
- // DISCARD POST
85
- return window.location.href = window.location.href;
86
- },
87
-
88
- href: ( url ) => {
89
- // DISCARD POST
90
- return window.location.href = url;
91
- }
92
-
93
- };
94
-
95
- Object.defineProperty( dphelper, 'browser', {
96
- writable: false,
97
- configurable: false
98
- });
99
-
100
- //console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
package/scripts/color.js DELETED
@@ -1,121 +0,0 @@
1
- /*!
2
- dpHelper
3
- Copyright (c) 2021 Dario Passariello <dariopassariello@gmail.com>
4
- Licensed under the Apache-2.0, see
5
- https://dario.passariello.ca
6
- */
7
-
8
- /***********************************************************************/
9
-
10
- var description = {
11
- "name" : "Color",
12
- "version" : "0.0.1",
13
- "command" : "color",
14
- "author" : "Dario Passariello",
15
- "active" : true,
16
- "example" : "",
17
- "type" : "object",
18
- "description":"test",
19
- "subCommand" : [
20
- {
21
- "name":"hex",
22
- "version" : "0.0.1",
23
- "example" : "",
24
- "type" : "function",
25
- "active": true,
26
- "description":"test",
27
- "subCommand" : []
28
- },{
29
- "name":"toHex",
30
- "version" : "0.0.1",
31
- "example" : "",
32
- "type" : "function",
33
- "active": true,
34
- "description":"test",
35
- "subCommand" : []
36
- },{
37
- "name":"toRGB",
38
- "version" : "0.0.1",
39
- "example" : "",
40
- "type" : "function",
41
- "active": true,
42
- "description":"test",
43
- "subCommand" : []
44
- },{
45
- "name":"gradient",
46
- "version" : "0.0.1",
47
- "example" : "",
48
- "type" : "function",
49
- "active": true,
50
- "description":"test",
51
- "subCommand" : []
52
- },
53
- ]
54
-
55
- };
56
-
57
- dphelper._list.scripts.push( description );
58
-
59
- /***********************************************************************/
60
-
61
- dphelper.color = {
62
-
63
- hex: (c) => {
64
- var s = "0123456789abcdef";
65
- var i = parseInt (c);
66
-
67
- if (i == 0 || isNaN (c)) return "00";
68
-
69
- i = Math.round (Math.min (Math.max (0, i), 255));
70
- return s.charAt ((i - i % 16) / 16) + s.charAt (i % 16);
71
- },
72
-
73
- /* Convert an RGB triplet to a hex string */
74
- toHex: (rgb) => {
75
- return dphelper.color.hex(rgb[0]) +
76
- dphelper.color.hex(rgb[1]) +
77
- dphelper.color.hex(rgb[2]);
78
- },
79
-
80
- /* Convert a hex string to an RGB triplet */
81
- toRGB: (hex) => {
82
- var color = [];
83
- color[0] = parseInt (( dphelper.text.trim( hex, '#', 1, 7 ) ).substring (0, 2), 16);
84
- color[1] = parseInt (( dphelper.text.trim( hex, '#', 1, 7 ) ).substring (2, 4), 16);
85
- color[2] = parseInt (( dphelper.text.trim( hex, '#', 1, 7 ) ).substring (4, 6), 16);
86
- return color;
87
- },
88
-
89
- gradient: ( colorStart, colorEnd, colorCount ) => {
90
-
91
- var start = dphelper.color.toRGB (colorStart);
92
- var end = dphelper.color.toRGB (colorEnd);
93
- var len = colorCount;
94
- var alpha = 0.0;
95
- var colors = [];
96
-
97
- for (var i = 0; i < len; i++) {
98
-
99
- var c = [];
100
- alpha += (1.0/len);
101
-
102
- c[0] = start[0] * alpha + (1 - alpha) * end[0];
103
- c[1] = start[1] * alpha + (1 - alpha) * end[1];
104
- c[2] = start[2] * alpha + (1 - alpha) * end[2];
105
-
106
- colors.push( dphelper.color.toHex (c) );
107
-
108
- }
109
-
110
- return colors;
111
-
112
- }
113
-
114
- };
115
-
116
- Object.defineProperty( dphelper, 'color', {
117
- writable: false,
118
- configurable: false
119
- });
120
-
121
- //console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
@@ -1,97 +0,0 @@
1
- /*!
2
- dpHelper
3
- Copyright (c) 2021 Dario Passariello <dariopassariello@gmail.com>
4
- Licensed under the Apache-2.0, see
5
- https://dario.passariello.ca
6
- */
7
-
8
- /***********************************************************************/
9
-
10
- var description = {
11
- "name" : "Console",
12
- "description" : "",
13
- "version" : "0.0.1",
14
- "command" : "console",
15
- "subCommand" : [
16
- {
17
- "name":"info",
18
- "description":"test"
19
- },{
20
- "name":"stop",
21
- "description":"test"
22
- }
23
- ],
24
- "example" : "",
25
- "author" : "Dario Passariello",
26
- "active" : true
27
- };
28
-
29
- dphelper._list.scripts.push( description );
30
-
31
- /***********************************************************************/
32
-
33
- // dphelper.printInfo = () => {
34
- // console.debug( 'dpHelper: Please use "dphelper.path.rail()"' );
35
- // return dphelper.console.info();
36
- // };
37
-
38
- /***********************************************************************/
39
-
40
- dphelper.console = {
41
-
42
- info: ( name, message, func ) => {
43
- console.groupCollapsed('%c'+ name +':%c', "color:orange", "");
44
- console.debug( message, dphelper[ func ] );
45
- console.groupEnd();
46
- },
47
-
48
- stop: ( options = [
49
- 'assert',
50
- 'clear',
51
- 'count',
52
- 'debug',
53
- 'dir',
54
- 'dirxml',
55
- 'error',
56
- 'exception',
57
- 'group',
58
- 'groupCollapsed',
59
- 'groupEnd',
60
- 'info',
61
- 'log',
62
- 'markTimeline',
63
- 'profile',
64
- 'profileEnd',
65
- 'table',
66
- 'time',
67
- 'timeEnd',
68
- 'timeline',
69
- 'timelineEnd',
70
- 'timeStamp',
71
- 'trace',
72
- 'warn',
73
- 'verbose'
74
- ]) => {
75
-
76
- console.clear();
77
- console.disableYellowBox = true;
78
- console = {};
79
- console.log = function(){};
80
- window.console = console;
81
- if(!window.console) window.console = {};
82
- const noop = () => {};
83
-
84
- options.forEach( ( method ) => {
85
- window.console[ method ] = noop;
86
- });
87
-
88
- }
89
-
90
- };
91
-
92
- Object.defineProperty( dphelper, 'console', {
93
- writable: false,
94
- configurable: false
95
- });
96
-
97
- //console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )