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/font.js DELETED
@@ -1,60 +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" : "Font",
12
- "description" : "",
13
- "version" : "0.0.1",
14
- "command" : "font",
15
- "subCommand" : [
16
- {
17
- "name":"fitContainer",
18
- "description":""
19
- }
20
- ],
21
- "example" : "",
22
- "author" : "Dario Passariello",
23
- "active" : true
24
- };
25
-
26
- dphelper._list.scripts.push( description );
27
-
28
- /***********************************************************************/
29
-
30
- dphelper.font = {
31
-
32
- fitContainer: ( name ) => {
33
- if( !name ) return;
34
-
35
- function fitStart(){
36
- var divs = document.querySelectorAll( name );
37
- if( divs.length <= 0 ) return;
38
- for(var i = 0; i < divs.length; i++) {
39
- var fontSize = divs[i].offsetWidth * 0.05;
40
- divs[i].style.fontSize = fontSize+'px';
41
- }
42
- }
43
-
44
- dphelper.addListenerMulti( window , 'load resize', () => {
45
- fitStart( name );
46
- });
47
-
48
- }
49
-
50
- };
51
-
52
- Object.defineProperty( dphelper, 'font', {
53
- writable: false,
54
- configurable: false
55
- });
56
-
57
- //console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
58
-
59
-
60
-
package/scripts/form.js DELETED
@@ -1,211 +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" : "Form",
12
- "description" : "",
13
- "version" : "0.0.1",
14
- "command" : "form",
15
- "subCommand" : [
16
- {
17
- "name":"serialize",
18
- "description":"test"
19
- },{
20
- "name":"confirmType",
21
- "description":"test"
22
- },{
23
- "name":"required",
24
- "description":"test"
25
- },{
26
- "name":"minLength",
27
- "description":"test"
28
- },{
29
- "name":"maxLength",
30
- "description":"test"
31
- },{
32
- "name":"maxPhoneNumber",
33
- "description":"test"
34
- },{
35
- "name":"isNumeric",
36
- "description":"test"
37
- },{
38
- "name":"isEmail",
39
- "description":"test"
40
- }
41
- ],
42
- "example" : "",
43
- "author" : "Dario Passariello",
44
- "active" : true
45
- };
46
-
47
- dphelper._list.scripts.push( description );
48
-
49
- /***********************************************************************/
50
-
51
- dphelper.form = {
52
-
53
- serialize: ( form ) => {
54
-
55
- const $ = require("jquery");
56
- const el = this;
57
- //const el = $( form );
58
-
59
- var self = el,
60
-
61
- json = {},
62
- push_counters = {},
63
-
64
- patterns = {
65
- //"validate": /^[a-zA-Z][a-zA-Z0-9_]*(?:\[(?:\d*|[a-zA-Z0-9_]+)\])*$/,
66
- "validate": /[a-zA-Z][a-zA-Z0-9-_.]/, //{1,200}
67
- "key": /[a-zA-Z0-9_]+|(?=\[\])/g,
68
- "push": /^$/,
69
- "fixed": /^\d+$/,
70
- "named": /^[a-zA-Z0-9_]+$/
71
- };
72
-
73
- el.build = function(base, key, value) {
74
- base[key] = isNaN(value) || Array.isArray(value) ? value : Number(value);
75
- return base;
76
- };
77
-
78
- el.push_counter = function(key) {
79
- if (push_counters[key] === undefined) {
80
- push_counters[key] = 0;
81
- }
82
- return push_counters[key]++;
83
- };
84
-
85
- $.each( $(el).serializeArray(), function() {
86
-
87
- // skip invalid keys
88
- if (!patterns.validate.test(el.name)) {
89
- return;
90
- }
91
-
92
- var k,
93
- keys = el.name.match(patterns.key),
94
- merge = el.value,
95
- reverse_key = el.name;
96
-
97
- if( merge === 'false' ) merge = Boolean(false);
98
- if( merge === 'true' ) merge = Boolean(true);
99
- if( merge === 'off' ) merge = Boolean(false);
100
- if( merge === 'on' ) merge = Boolean(true);
101
- if( merge === '[]' ) merge = [];
102
- if( merge === '{}' ) merge = {};
103
- if( merge === 'undefined' ) merge = undefined;
104
- if( merge === 'null' ) merge = null;
105
- if( merge === '' ) merge = '';
106
-
107
- while ((k = keys.pop()) !== undefined) {
108
-
109
- // adjust reverse_key
110
- reverse_key = reverse_key.replace(new RegExp("\\[" + k + "\\]$"), '');
111
-
112
- // push
113
- if (k.match(patterns.push)) {
114
- merge = self.build([], self.push_counter(reverse_key), merge);
115
- }
116
-
117
- // fixed
118
- else if (k.match(patterns.fixed)) {
119
- merge = self.build([], k, merge);
120
- }
121
-
122
- // named
123
- else if (k.match(patterns.named)) {
124
- merge = self.build({}, k, merge);
125
- }
126
-
127
- }
128
-
129
- json = $.extend(true, json, merge);
130
- });
131
-
132
- return json;
133
- },
134
-
135
- confirmType: ( type, value ) => {
136
-
137
- // FIX NUMBERS
138
- if ( type === 'number' ) {
139
- const containsNum = new RegExp(/^\d+$/);
140
- // console.log(type, value, containsNum.test(value.toString()));
141
- return containsNum.test(value.toString());
142
- }
143
-
144
- // FIX EMAIL FORMAT
145
- if ( type === 'email' ) {
146
- const isEmail = new RegExp(
147
- /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
148
- )
149
- // console.log( type, value, isEmail.test(value.toString()) );
150
- return isEmail.test(value.toString().toLowerCase());
151
- }
152
-
153
- return true;
154
- },
155
-
156
- required: (value) => {
157
- if (value === null || value === undefined) {
158
- return "Required";
159
- } else {
160
- return undefined;
161
- }
162
- },
163
-
164
- minLength: ( value , num = 1 ) => {
165
- if (!value || value?.length < num ) {
166
- return "Must Enter a Value";
167
- } else {
168
- return undefined;
169
- }
170
- },
171
-
172
- maxLength: ( value , num = 10 ) => {
173
- if (value?.length > num ) {
174
- return "Exceeds Max Length";
175
- } else {
176
- return undefined;
177
- }
178
- },
179
-
180
- maxPhoneNumber: ( value , num = 10 ) => {
181
- if (value?.toString()?.length > num ) {
182
- return "Exceeds Max Length";
183
- } else {
184
- return undefined;
185
- }
186
- },
187
-
188
- isNumeric: ( value ) => {
189
- if ( isNaN(value) ) {
190
- return false;
191
- } else {
192
- return value;
193
- }
194
- },
195
-
196
- isEmail: ( value ) => {
197
- const isEmail = new RegExp(
198
- /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
199
- )
200
- return isEmail.test( value.toString().toLowerCase() );
201
- }
202
-
203
-
204
- };
205
-
206
- Object.defineProperty( dphelper, 'form', {
207
- writable: false,
208
- configurable: false
209
- });
210
-
211
- //console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
package/scripts/format.js DELETED
@@ -1,71 +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" : "Format",
12
- "description" : "",
13
- "version" : "0.0.1",
14
- "command" : "cormat",
15
- "subCommand" : [
16
- {
17
- "name":"currency",
18
- "description":"test"
19
- },{
20
- "name":"phoneNumber",
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.format = {
34
-
35
- currency: ( val, int = 'en-US', cur = 'USD' ) => {
36
- if( !val || isNaN( val ) ) val = 0;
37
- var formatter = new Intl.NumberFormat( int , {
38
- style: 'currency',
39
- currency: cur,
40
- });
41
- // return ( val ).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,')
42
- return formatter.format( val );
43
- },
44
-
45
- ////////////////////////////////////////////////////////////////////////////
46
-
47
- phoneNumber: (str) => {
48
- //Filter only numbers from the input
49
- let cleaned = ('' + str).replace(/\D/g, '');
50
-
51
- //Check if the input is of correct
52
- let match = cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/);
53
-
54
- if (match) {
55
- //Remove the matched extension code
56
- //Change this to format for any country code.
57
- let intlCode = (match[1] ? '+1 ' : '')
58
- return [intlCode, '(', match[2], ') ', match[3], '-', match[4]].join('')
59
- }
60
-
61
- return null;
62
- }
63
-
64
- };
65
-
66
- Object.defineProperty( dphelper, 'format', {
67
- writable: false,
68
- configurable: false
69
- });
70
-
71
- //console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )
@@ -1,55 +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" : "Func",
12
- "description" : "",
13
- "version" : "0.0.1",
14
- "command" : "func",
15
- "subCommand" : [
16
- {
17
- "name":"new",
18
- "description":"test"
19
- },{
20
- "name":"toObj.set",
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.func = {
34
-
35
- new: ( name , text ) => {
36
- args = [ name , "return" + text ];
37
- myFunc = Function.apply( null, args );
38
- },
39
-
40
- toObj: {
41
- set: ( value , key ) => {
42
- return [value , key];
43
- }
44
- // var dog = new dphelper.func.oop( "Dog", "Bobby" );
45
- // console.log( dog.getDetails());
46
- },
47
-
48
- };
49
-
50
- Object.defineProperty( dphelper, 'func', {
51
- writable: false,
52
- configurable: false
53
- });
54
-
55
- //console.log( Object.getOwnPropertyDescriptor( dphelper, 'socket' ) )