@bbn/bbn 1.0.25 → 1.0.26
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/bundle.d.ts +224 -238
- package/dist/bundle.js +939 -906
- package/dist/fn/_addLoader.js +1 -1
- package/dist/fn/_deleteLoader.d.ts +1 -1
- package/dist/fn/_deleteLoader.js +2 -2
- package/dist/fn/abort.js +4 -4
- package/dist/fn/abortURL.js +2 -2
- package/dist/fn/addColors.d.ts +1 -1
- package/dist/fn/addColors.js +23 -6
- package/dist/fn/addInputs.d.ts +1 -2
- package/dist/fn/addInputs.js +4 -5
- package/dist/fn/adjustHeight.js +1 -1
- package/dist/fn/adjustSize.js +1 -1
- package/dist/fn/adjustWidth.js +1 -1
- package/dist/fn/ajax.d.ts +1 -1
- package/dist/fn/ajax.js +8 -7
- package/dist/fn/analyzeFunction.js +5 -5
- package/dist/fn/animateCss.js +8 -7
- package/dist/fn/baseName.d.ts +1 -1
- package/dist/fn/baseName.js +1 -1
- package/dist/fn/br2nl.d.ts +1 -1
- package/dist/fn/br2nl.js +1 -1
- package/dist/fn/calendar.js +1 -1
- package/dist/fn/callback.d.ts +1 -1
- package/dist/fn/callback.js +5 -5
- package/dist/fn/camelToCss.js +4 -2
- package/dist/fn/canvasToImage.js +1 -1
- package/dist/fn/center.js +3 -5
- package/dist/fn/checkProps.d.ts +1 -1
- package/dist/fn/checkProps.js +1 -1
- package/dist/fn/checkPropsDetails.d.ts +1 -4
- package/dist/fn/checkPropsDetails.js +10 -11
- package/dist/fn/checkPropsOrDie.d.ts +1 -1
- package/dist/fn/checkPropsOrDie.js +1 -1
- package/dist/fn/checkType.d.ts +1 -1
- package/dist/fn/checkType.js +3 -3
- package/dist/fn/chrono.d.ts +3 -0
- package/dist/fn/chrono.js +23 -0
- package/dist/fn/circularReplacer.js +2 -2
- package/dist/fn/clone.d.ts +0 -1
- package/dist/fn/clone.js +1 -1
- package/dist/fn/colorToHex.js +1 -1
- package/dist/fn/compare.js +44 -44
- package/dist/fn/compareConditions.d.ts +0 -1
- package/dist/fn/compareConditions.js +3 -3
- package/dist/fn/copy.js +9 -9
- package/dist/fn/correctCase.js +1 -1
- package/dist/fn/count.d.ts +1 -1
- package/dist/fn/count.js +2 -2
- package/dist/fn/crc32.js +11 -3
- package/dist/fn/createObject.d.ts +1 -1
- package/dist/fn/createObject.js +3 -3
- package/dist/fn/cssExists.js +7 -4
- package/dist/fn/date.js +5 -5
- package/dist/fn/dateSQL.js +4 -3
- package/dist/fn/deepPath.d.ts +1 -2
- package/dist/fn/defaultAjaxAbortFunction.d.ts +1 -1
- package/dist/fn/defaultAjaxAbortFunction.js +1 -1
- package/dist/fn/defaultAjaxErrorFunction.d.ts +1 -1
- package/dist/fn/defaultAjaxErrorFunction.js +0 -12
- package/dist/fn/defaultAlertFunction.d.ts +1 -1
- package/dist/fn/defaultAlertFunction.js +2 -3
- package/dist/fn/defaultConfirmFunction.d.ts +1 -1
- package/dist/fn/defaultEndLoadingFunction.d.ts +1 -1
- package/dist/fn/defaultEndLoadingFunction.js +1 -17
- package/dist/fn/defaultPostLinkFunction.d.ts +1 -1
- package/dist/fn/defaultPostLinkFunction.js +1 -1
- package/dist/fn/defaultPreLinkFunction.d.ts +1 -1
- package/dist/fn/defaultPreLinkFunction.js +2 -10
- package/dist/fn/defaultStartLoadingFunction.d.ts +1 -1
- package/dist/fn/defaultStartLoadingFunction.js +2 -13
- package/dist/fn/deleteProp.d.ts +1 -1
- package/dist/fn/deleteProp.js +3 -2
- package/dist/fn/diffObj.d.ts +1 -2
- package/dist/fn/diffObj.js +13 -14
- package/dist/fn/dirName.d.ts +1 -1
- package/dist/fn/download.d.ts +1 -1
- package/dist/fn/download.js +3 -5
- package/dist/fn/downloadContent.d.ts +1 -1
- package/dist/fn/each.js +1 -1
- package/dist/fn/error.js +2 -2
- package/dist/fn/escapeRegExp.js +1 -1
- package/dist/fn/escapeTicks.js +1 -1
- package/dist/fn/escapeUrl.js +1 -1
- package/dist/fn/extend.d.ts +1 -2
- package/dist/fn/extend.js +11 -11
- package/dist/fn/extendOut.d.ts +1 -2
- package/dist/fn/extendOut.js +3 -3
- package/dist/fn/fdate.d.ts +1 -1
- package/dist/fn/fdatetime.d.ts +1 -1
- package/dist/fn/fdatetime.js +1 -1
- package/dist/fn/fieldValue.js +2 -2
- package/dist/fn/fileExt.js +1 -1
- package/dist/fn/filter.d.ts +1 -2
- package/dist/fn/filter.js +13 -12
- package/dist/fn/filterToConditions.d.ts +11 -3
- package/dist/fn/filterToConditions.js +6 -6
- package/dist/fn/findAll.d.ts +0 -1
- package/dist/fn/findAll.js +1 -1
- package/dist/fn/fori.d.ts +1 -1
- package/dist/fn/fori.js +2 -2
- package/dist/fn/forir.d.ts +1 -1
- package/dist/fn/forir.js +2 -2
- package/dist/fn/formdata.d.ts +1 -1
- package/dist/fn/formdata.js +12 -13
- package/dist/fn/fromXml.js +6 -6
- package/dist/fn/ftime.js +1 -1
- package/dist/fn/getAllTags.d.ts +1 -1
- package/dist/fn/getAllTags.js +1 -1
- package/dist/fn/getAncestors.d.ts +1 -1
- package/dist/fn/getAncestors.js +7 -8
- package/dist/fn/getAttributes.js +2 -2
- package/dist/fn/getBrowserName.js +9 -9
- package/dist/fn/getBrowserVersion.js +2 -2
- package/dist/fn/getCookie.js +1 -1
- package/dist/fn/getDeviceType.js +3 -3
- package/dist/fn/getEventData.js +11 -8
- package/dist/fn/getField.d.ts +1 -1
- package/dist/fn/getField.js +4 -3
- package/dist/fn/getFieldValues.d.ts +1 -1
- package/dist/fn/getFieldValues.js +2 -2
- package/dist/fn/getHTMLOfSelection.d.ts +1 -1
- package/dist/fn/getHTMLOfSelection.js +9 -19
- package/dist/fn/getLoader.d.ts +1 -1
- package/dist/fn/getPath.d.ts +1 -1
- package/dist/fn/getPath.js +4 -4
- package/dist/fn/getProp.js +3 -2
- package/dist/fn/getProperty.js +1 -1
- package/dist/fn/getRow.d.ts +1 -1
- package/dist/fn/getRow.js +1 -1
- package/dist/fn/getScrollBarSize.js +9 -7
- package/dist/fn/getText.d.ts +1 -1
- package/dist/fn/getTimeoff.js +1 -1
- package/dist/fn/happy.js +1 -1
- package/dist/fn/hash.d.ts +1 -1
- package/dist/fn/hash.js +1 -1
- package/dist/fn/hex2rgb.js +7 -5
- package/dist/fn/html2text.d.ts +1 -1
- package/dist/fn/imageToCanvas.js +2 -2
- package/dist/fn/imgToBase64.d.ts +1 -1
- package/dist/fn/imgToBase64.js +3 -3
- package/dist/fn/info.js +1 -1
- package/dist/fn/init.js +29 -29
- package/dist/fn/isActiveInterface.js +2 -2
- package/dist/fn/isColor.d.ts +1 -1
- package/dist/fn/isColor.js +11 -4
- package/dist/fn/isCp.js +7 -7
- package/dist/fn/isDimension.d.ts +1 -1
- package/dist/fn/isDimension.js +11 -4
- package/dist/fn/isEmail.d.ts +1 -1
- package/dist/fn/isEmail.js +11 -4
- package/dist/fn/isEmpty.js +1 -1
- package/dist/fn/isFocused.d.ts +1 -1
- package/dist/fn/isFocused.js +1 -1
- package/dist/fn/isHostname.js +1 -1
- package/dist/fn/isIP.js +1 -1
- package/dist/fn/isInside.js +1 -1
- package/dist/fn/isIterable.js +1 -1
- package/dist/fn/isNumber.js +1 -1
- package/dist/fn/isPercent.js +1 -1
- package/dist/fn/isPrimitive.js +1 -1
- package/dist/fn/isPropSize.js +1 -1
- package/dist/fn/isSQLDate.js +1 -1
- package/dist/fn/isSame.d.ts +1 -2
- package/dist/fn/isSame.js +3 -3
- package/dist/fn/isURL.js +1 -1
- package/dist/fn/isValidDimension.js +2 -3
- package/dist/fn/isValue.js +1 -1
- package/dist/fn/isVue.d.ts +1 -1
- package/dist/fn/isVue.js +5 -5
- package/dist/fn/iterate.d.ts +1 -1
- package/dist/fn/iterate.js +3 -3
- package/dist/fn/lightenDarkenHex.js +2 -2
- package/dist/fn/link.d.ts +1 -2
- package/dist/fn/link.js +17 -19
- package/dist/fn/log.js +4 -4
- package/dist/fn/makeReactive.d.ts +0 -1
- package/dist/fn/makeReactive.js +35 -23
- package/dist/fn/map.d.ts +0 -1
- package/dist/fn/md5.js +30 -10
- package/dist/fn/money.d.ts +1 -1
- package/dist/fn/money.js +47 -34
- package/dist/fn/move.d.ts +1 -1
- package/dist/fn/move.js +1 -1
- package/dist/fn/multiorder.d.ts +1 -1
- package/dist/fn/multiorder.js +5 -5
- package/dist/fn/nl2br.d.ts +1 -1
- package/dist/fn/nl2br.js +1 -1
- package/dist/fn/numProperties.d.ts +1 -1
- package/dist/fn/numProperties.js +1 -1
- package/dist/fn/objectToFormData.d.ts +1 -1
- package/dist/fn/objectToFormData.js +3 -3
- package/dist/fn/outerHeight.d.ts +1 -1
- package/dist/fn/outerHeight.js +5 -4
- package/dist/fn/outerWidth.d.ts +1 -1
- package/dist/fn/outerWidth.js +1 -2
- package/dist/fn/pickValue.d.ts +1 -1
- package/dist/fn/post.d.ts +1 -1
- package/dist/fn/post.js +3 -3
- package/dist/fn/postOut.d.ts +1 -1
- package/dist/fn/postOut.js +2 -2
- package/dist/fn/printf.js +1 -3
- package/dist/fn/quotes2html.d.ts +1 -1
- package/dist/fn/quotes2html.js +3 -3
- package/dist/fn/randomInt.d.ts +1 -1
- package/dist/fn/randomString.d.ts +1 -1
- package/dist/fn/randomString.js +9 -8
- package/dist/fn/removeAccents.d.ts +1 -1
- package/dist/fn/removeAccents.js +1 -1
- package/dist/fn/removeEmpty.d.ts +1 -1
- package/dist/fn/removeExtraSpaces.d.ts +1 -1
- package/dist/fn/removeHtmlComments.d.ts +1 -1
- package/dist/fn/removePrivateProp.d.ts +1 -2
- package/dist/fn/removePrivateProp.js +6 -6
- package/dist/fn/removeTrailingChars.d.ts +1 -1
- package/dist/fn/repeat.d.ts +1 -1
- package/dist/fn/repeat.js +1 -6
- package/dist/fn/replaceAll.d.ts +1 -1
- package/dist/fn/replaceAll.js +1 -4
- package/dist/fn/replaceSelection.js +1 -1
- package/dist/fn/resize.js +9 -7
- package/dist/fn/rgb2hex.js +6 -4
- package/dist/fn/riterate.d.ts +1 -1
- package/dist/fn/roundDecimal.d.ts +1 -1
- package/dist/fn/roundDecimal.js +1 -1
- package/dist/fn/sanitize.js +3 -1
- package/dist/fn/search.d.ts +2 -1
- package/dist/fn/search.js +24 -21
- package/dist/fn/selectElementText.d.ts +1 -1
- package/dist/fn/selectElementText.js +1 -1
- package/dist/fn/selector.d.ts +1 -1
- package/dist/fn/selector.js +1 -1
- package/dist/fn/setCookie.js +4 -4
- package/dist/fn/setCssVar.js +2 -1
- package/dist/fn/setNavigationVars.d.ts +1 -1
- package/dist/fn/setNavigationVars.js +6 -5
- package/dist/fn/setProp.d.ts +1 -1
- package/dist/fn/setProp.js +1 -3
- package/dist/fn/setProperty.d.ts +1 -1
- package/dist/fn/setProperty.js +2 -2
- package/dist/fn/shorten.d.ts +1 -1
- package/dist/fn/shorten.js +3 -3
- package/dist/fn/shortenObj.d.ts +1 -2
- package/dist/fn/shortenObj.js +2 -2
- package/dist/fn/shuffle.d.ts +1 -1
- package/dist/fn/shuffle.js +1 -3
- package/dist/fn/simpleHash.d.ts +1 -1
- package/dist/fn/simpleHash1.d.ts +1 -1
- package/dist/fn/simpleHash1.js +1 -1
- package/dist/fn/simpleHash2.d.ts +1 -1
- package/dist/fn/stat.d.ts +1 -1
- package/dist/fn/stat.js +8 -8
- package/dist/fn/string2ArrayBuffer.d.ts +1 -1
- package/dist/fn/submit.d.ts +1 -1
- package/dist/fn/submit.js +6 -21
- package/dist/fn/substr.d.ts +1 -1
- package/dist/fn/substr.js +1 -1
- package/dist/fn/sum.d.ts +1 -1
- package/dist/fn/sum.js +2 -3
- package/dist/fn/timestamp.d.ts +1 -1
- package/dist/fn/timestamp.js +1 -1
- package/dist/fn/toCSV.d.ts +1 -1
- package/dist/fn/toCSV.js +1 -1
- package/dist/fn/toggleFullScreen.js +13 -13
- package/dist/fn/translate.d.ts +1 -1
- package/dist/fn/treatAjaxArguments.d.ts +1 -1
- package/dist/fn/treatAjaxArguments.js +16 -14
- package/dist/fn/uniqString.js +3 -3
- package/dist/fn/unique.d.ts +1 -1
- package/dist/fn/upload.d.ts +1 -1
- package/dist/fn/upload.js +6 -6
- package/dist/fn/warning.d.ts +1 -1
- package/dist/fn/warning.js +6 -6
- package/dist/index.d.ts +106 -108
- package/dist/index.js +5 -6
- package/package.json +3 -1
package/dist/fn/compare.js
CHANGED
|
@@ -5,88 +5,88 @@ import { isObject } from './isObject';
|
|
|
5
5
|
import { isSame } from './isSame';
|
|
6
6
|
const compare = function (v1, v2, operator) {
|
|
7
7
|
switch (operator) {
|
|
8
|
-
case
|
|
9
|
-
case
|
|
10
|
-
case
|
|
11
|
-
case
|
|
12
|
-
case
|
|
8
|
+
case '===':
|
|
9
|
+
case '=':
|
|
10
|
+
case 'equal':
|
|
11
|
+
case 'eq':
|
|
12
|
+
case 'is':
|
|
13
13
|
return v1 === v2;
|
|
14
|
-
case
|
|
15
|
-
case
|
|
16
|
-
case
|
|
17
|
-
case
|
|
14
|
+
case '!==':
|
|
15
|
+
case 'notequal':
|
|
16
|
+
case 'neq':
|
|
17
|
+
case 'isnot':
|
|
18
18
|
return v1 !== v2;
|
|
19
|
-
case
|
|
20
|
-
case
|
|
19
|
+
case '!=':
|
|
20
|
+
case 'different':
|
|
21
21
|
return v1 != v2;
|
|
22
|
-
case
|
|
23
|
-
case
|
|
24
|
-
case
|
|
25
|
-
case
|
|
22
|
+
case 'contains':
|
|
23
|
+
case 'contain':
|
|
24
|
+
case 'icontains':
|
|
25
|
+
case 'icontain':
|
|
26
26
|
if (isEmpty(v1) || isEmpty(v2)) {
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
29
|
return removeAccents(v1).toLowerCase().indexOf(removeAccents(v2).toLowerCase()) !== -1;
|
|
30
|
-
case
|
|
31
|
-
case
|
|
30
|
+
case 'doesnotcontain':
|
|
31
|
+
case 'donotcontain':
|
|
32
32
|
if (isNull(v1) || isNull(v2)) {
|
|
33
33
|
return true;
|
|
34
34
|
}
|
|
35
35
|
return removeAccents(v1.toLowerCase()).indexOf(removeAccents(v2.toLowerCase())) === -1;
|
|
36
|
-
case
|
|
37
|
-
case
|
|
36
|
+
case 'starts':
|
|
37
|
+
case 'start':
|
|
38
38
|
if (isNull(v1) || isNull(v2)) {
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
|
-
if (
|
|
41
|
+
if (typeof v1 !== 'string') {
|
|
42
42
|
v1 = v1.toString() || '';
|
|
43
43
|
}
|
|
44
|
-
if (
|
|
44
|
+
if (typeof v2 !== 'string') {
|
|
45
45
|
v2 = v2.toString() || '';
|
|
46
46
|
}
|
|
47
47
|
return v1.indexOf(v2) === 0;
|
|
48
|
-
case
|
|
49
|
-
case
|
|
50
|
-
case
|
|
51
|
-
case
|
|
52
|
-
case
|
|
48
|
+
case 'startswith':
|
|
49
|
+
case 'startsi':
|
|
50
|
+
case 'starti':
|
|
51
|
+
case 'istarts':
|
|
52
|
+
case 'istart':
|
|
53
53
|
if (isNull(v1) || isNull(v2)) {
|
|
54
54
|
return false;
|
|
55
55
|
}
|
|
56
56
|
return removeAccents(v1).toLowerCase().indexOf(removeAccents(v2).toLowerCase()) === 0;
|
|
57
|
-
case
|
|
58
|
-
case
|
|
59
|
-
case
|
|
60
|
-
case
|
|
61
|
-
case
|
|
57
|
+
case 'endswith':
|
|
58
|
+
case 'endsi':
|
|
59
|
+
case 'endi':
|
|
60
|
+
case 'iends':
|
|
61
|
+
case 'iend':
|
|
62
62
|
if (isNull(v1) || isNull(v2)) {
|
|
63
63
|
return false;
|
|
64
64
|
}
|
|
65
65
|
return v1.lastIndexOf(v2) === v1.length - v2.length;
|
|
66
|
-
case
|
|
66
|
+
case 'like':
|
|
67
67
|
if (isNull(v1) || isNull(v2)) {
|
|
68
68
|
return false;
|
|
69
69
|
}
|
|
70
70
|
return removeAccents(v1).toLowerCase() === removeAccents(v2).toLowerCase();
|
|
71
|
-
case
|
|
72
|
-
case
|
|
71
|
+
case 'gt':
|
|
72
|
+
case '>':
|
|
73
73
|
return v1 > v2;
|
|
74
|
-
case
|
|
75
|
-
case
|
|
74
|
+
case 'gte':
|
|
75
|
+
case '>=':
|
|
76
76
|
return v1 >= v2;
|
|
77
|
-
case
|
|
78
|
-
case
|
|
77
|
+
case 'lt':
|
|
78
|
+
case '<':
|
|
79
79
|
return v1 < v2;
|
|
80
|
-
case
|
|
81
|
-
case
|
|
80
|
+
case 'lte':
|
|
81
|
+
case '<=':
|
|
82
82
|
return v1 <= v2;
|
|
83
|
-
case
|
|
83
|
+
case 'isnull':
|
|
84
84
|
return v1 === null;
|
|
85
|
-
case
|
|
85
|
+
case 'isnotnull':
|
|
86
86
|
return v1 !== null;
|
|
87
|
-
case
|
|
87
|
+
case 'isempty':
|
|
88
88
|
return v1 === '';
|
|
89
|
-
case
|
|
89
|
+
case 'isnotempty':
|
|
90
90
|
return v1 !== '';
|
|
91
91
|
case '==':
|
|
92
92
|
if (isObject(v1, v2)) {
|
|
@@ -3,7 +3,7 @@ import { each } from './each';
|
|
|
3
3
|
import { getProperty } from './getProperty';
|
|
4
4
|
const compareConditions = function (data, filter) {
|
|
5
5
|
if (!filter.conditions || !filter.logic || !isArray(filter.conditions)) {
|
|
6
|
-
throw new Error(
|
|
6
|
+
throw new Error('Error in compareConditions: the filter should an abject with conditions and logic properties and conditions should be an array of objects');
|
|
7
7
|
}
|
|
8
8
|
let ok = filter.logic === 'AND' ? true : false;
|
|
9
9
|
each(filter.conditions, (a) => {
|
|
@@ -17,10 +17,10 @@ const compareConditions = function (data, filter) {
|
|
|
17
17
|
let bits = a.field.split('.');
|
|
18
18
|
let prop = bits.pop();
|
|
19
19
|
if (bits.length) {
|
|
20
|
-
each(bits, b => data = data[b]);
|
|
20
|
+
each(bits, (b) => (data = data[b]));
|
|
21
21
|
}
|
|
22
22
|
// Case where both are undefined: value and prop which doesn't exist; they are not the same!
|
|
23
|
-
if (
|
|
23
|
+
if (getProperty(data, prop) === undefined && a.value !== undefined) {
|
|
24
24
|
compare = false;
|
|
25
25
|
}
|
|
26
26
|
}
|
package/dist/fn/copy.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { isObject } from './isObject';
|
|
2
2
|
import { isFunction } from './isFunction';
|
|
3
3
|
const copy = function (st) {
|
|
4
|
-
return new Promise(resolve => {
|
|
4
|
+
return new Promise((resolve) => {
|
|
5
5
|
if (st) {
|
|
6
6
|
if (navigator && navigator.clipboard) {
|
|
7
7
|
if (st instanceof Blob) {
|
|
8
8
|
navigator.clipboard.write([new ClipboardItem({ [st.type.toString()]: st })]).then(() => {
|
|
9
|
-
resolve();
|
|
9
|
+
resolve(true);
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
else if (isObject(st) && isFunction(st.toBlob)) {
|
|
13
|
-
st.toBlob(blob => {
|
|
13
|
+
st.toBlob((blob) => {
|
|
14
14
|
navigator.clipboard.write([new ClipboardItem({ [blob.type.toString()]: blob })]).then(() => {
|
|
15
|
-
resolve();
|
|
15
|
+
resolve(true);
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
20
20
|
navigator.clipboard.writeText(st);
|
|
21
|
-
resolve();
|
|
21
|
+
resolve(true);
|
|
22
22
|
}
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
let input = document.createElement(
|
|
26
|
-
input.style.opacity = 0;
|
|
25
|
+
let input = document.createElement('textarea');
|
|
26
|
+
input.style.opacity = '0';
|
|
27
27
|
input.value = st;
|
|
28
28
|
document.body.appendChild(input);
|
|
29
29
|
input.select();
|
|
30
30
|
document.execCommand('copy');
|
|
31
31
|
document.body.removeChild(input);
|
|
32
|
-
resolve();
|
|
32
|
+
resolve(true);
|
|
33
33
|
}
|
|
34
|
-
resolve();
|
|
34
|
+
resolve(false);
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
export { copy };
|
package/dist/fn/correctCase.js
CHANGED
package/dist/fn/count.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const count: (arr: any, prop:
|
|
1
|
+
declare const count: (arr: any[], prop: object | string, val?: any, operator?: string) => number;
|
|
2
2
|
export { count };
|
package/dist/fn/count.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { filter } from './filter';
|
|
2
|
-
const count = function (arr, prop, val, operator) {
|
|
3
|
-
return filter(arr, prop, val, operator
|
|
2
|
+
const count = function (arr, prop, val = null, operator = '=') {
|
|
3
|
+
return filter(arr, prop, val, operator).length || 0;
|
|
4
4
|
};
|
|
5
5
|
export { count };
|
package/dist/fn/crc32.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
// this is a test
|
|
2
|
+
const crc32Table = [];
|
|
3
|
+
for (let i = 0; i < 256; i++) {
|
|
4
|
+
let c = i;
|
|
5
|
+
for (let j = 0; j < 8; j++) {
|
|
6
|
+
c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
7
|
+
}
|
|
8
|
+
crc32Table.push(c);
|
|
9
|
+
}
|
|
2
10
|
const crc32 = function (str) {
|
|
3
|
-
let crc = 0 ^
|
|
11
|
+
let crc = 0 ^ -1;
|
|
4
12
|
for (let i = 0; i < str.length; i++) {
|
|
5
13
|
const charCode = str.charCodeAt(i);
|
|
6
|
-
crc = (crc >>> 8) ^ crc32Table[(crc ^ charCode) &
|
|
14
|
+
crc = (crc >>> 8) ^ crc32Table[(crc ^ charCode) & 0xff];
|
|
7
15
|
}
|
|
8
|
-
return (crc ^
|
|
16
|
+
return (crc ^ -1) >>> 0; // Make sure the result is a 32-bit positive integer
|
|
9
17
|
};
|
|
10
18
|
export { crc32 };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const createObject: () => any;
|
|
1
|
+
declare const createObject: (...args: any[]) => any;
|
|
2
2
|
export { createObject };
|
package/dist/fn/createObject.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { extend } from './extend';
|
|
2
|
-
const createObject = function () {
|
|
2
|
+
const createObject = function (...args) {
|
|
3
3
|
const obj = Object.create(null);
|
|
4
|
-
if (
|
|
5
|
-
extend(obj, ...
|
|
4
|
+
if (args.length) {
|
|
5
|
+
extend(obj, ...args);
|
|
6
6
|
}
|
|
7
7
|
return obj;
|
|
8
8
|
};
|
package/dist/fn/cssExists.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
//import { log } from './log';
|
|
1
2
|
import { escapeRegExp } from './escapeRegExp';
|
|
2
3
|
const cssExists = function (f) {
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
let ok;
|
|
5
|
+
let rules;
|
|
6
|
+
let css = document.styleSheets;
|
|
7
|
+
for (let sx = 0; sx < css.length; sx++) {
|
|
5
8
|
ok = 1;
|
|
6
9
|
try {
|
|
7
10
|
rules = css[sx].rules || css[sx].cssRules;
|
|
@@ -14,9 +17,9 @@ const cssExists = function (f) {
|
|
|
14
17
|
}
|
|
15
18
|
if (ok) {
|
|
16
19
|
//log(rules);
|
|
17
|
-
for (
|
|
20
|
+
for (let cx = 0; cx < rules.length; cx++) {
|
|
18
21
|
//log(rules[cx].selectorText);
|
|
19
|
-
if (new RegExp(
|
|
22
|
+
if (new RegExp('(^|\\s)' + escapeRegExp(f) + '(\\{|\\s)', 'g').test(rules[cx].selectorText)) {
|
|
20
23
|
return true;
|
|
21
24
|
}
|
|
22
25
|
}
|
package/dist/fn/date.js
CHANGED
|
@@ -2,22 +2,22 @@ import { isNumber } from './isNumber';
|
|
|
2
2
|
import { substr } from './substr';
|
|
3
3
|
import { isDate } from './isDate';
|
|
4
4
|
const date = function (v) {
|
|
5
|
-
let d = false, t = typeof
|
|
5
|
+
let d = false, t = typeof v;
|
|
6
6
|
if (v === undefined) {
|
|
7
7
|
return new Date();
|
|
8
8
|
}
|
|
9
|
-
if (
|
|
9
|
+
if (t === 'number' || (isNumber(v) && v !== '')) {
|
|
10
10
|
if (v < 10000000000) {
|
|
11
11
|
v = v * 1000;
|
|
12
12
|
}
|
|
13
|
-
return
|
|
13
|
+
return new Date(v);
|
|
14
14
|
}
|
|
15
15
|
if (t === 'string') {
|
|
16
16
|
if (v.length === 10) {
|
|
17
|
-
return
|
|
17
|
+
return new Date(parseInt(substr(v, 0, 4)), parseInt(substr(v, 5, 2)) - 1, parseInt(substr(v, 8, 2)), 12);
|
|
18
18
|
}
|
|
19
19
|
else if (v.length === 19) {
|
|
20
|
-
return
|
|
20
|
+
return new Date(parseInt(substr(v, 0, 4)), parseInt(substr(v, 5, 2)) - 1, parseInt(substr(v, 8, 2)), parseInt(substr(v, 11, 2)), parseInt(substr(v, 14, 2)), parseInt(substr(v, 17, 2)));
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
else if (isDate(v)) {
|
package/dist/fn/dateSQL.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { date } from './date';
|
|
1
2
|
const dateSQL = function (v, dayOnly) {
|
|
2
|
-
let
|
|
3
|
-
if (
|
|
4
|
-
return dayjs(
|
|
3
|
+
let value = date(v);
|
|
4
|
+
if (value) {
|
|
5
|
+
return dayjs(value).format('YYYY-MM-DD' + (dayOnly ? '' : ' HH:mm:ss'));
|
|
5
6
|
}
|
|
6
7
|
};
|
|
7
8
|
export { dateSQL };
|
package/dist/fn/deepPath.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const defaultAjaxAbortFunction: (message:
|
|
1
|
+
declare const defaultAjaxAbortFunction: (message: string, url?: string) => void;
|
|
2
2
|
export { defaultAjaxAbortFunction };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const defaultAjaxErrorFunction: (jqXHR: any, textStatus
|
|
1
|
+
declare const defaultAjaxErrorFunction: (jqXHR: any, textStatus?: string, errorThrown?: Error) => boolean;
|
|
2
2
|
export { defaultAjaxErrorFunction };
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import { isCp } from './isCp';
|
|
2
1
|
const defaultAjaxErrorFunction = function (jqXHR, textStatus, errorThrown) {
|
|
3
|
-
var _a;
|
|
4
|
-
/** @todo */
|
|
5
|
-
if ((_a = window.appui) === null || _a === void 0 ? void 0 : _a.status) {
|
|
6
|
-
this.$nextTick(() => {
|
|
7
|
-
const loadBar = this.getRef('loading');
|
|
8
|
-
if (isCp(loadBar)) {
|
|
9
|
-
loadBar.$forceUpdate();
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
appui.error({ title: textStatus, content: errorThrown }, 4);
|
|
14
2
|
return false;
|
|
15
3
|
};
|
|
16
4
|
export { defaultAjaxErrorFunction };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const defaultAlertFunction: (
|
|
1
|
+
declare const defaultAlertFunction: (msg: string, title?: string) => void;
|
|
2
2
|
export { defaultAlertFunction };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const defaultConfirmFunction: (text:
|
|
1
|
+
declare const defaultConfirmFunction: (text: string, yesFn: () => any, noFn: () => any) => void;
|
|
2
2
|
export { defaultConfirmFunction };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const defaultEndLoadingFunction: (url:
|
|
1
|
+
declare const defaultEndLoadingFunction: (url: string, timestamp: number, data?: object, res?: object) => boolean;
|
|
2
2
|
export { defaultEndLoadingFunction };
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
import { numProperties } from './numProperties';
|
|
2
|
-
import { log } from './log';
|
|
3
|
-
import { isCp } from './isCp';
|
|
4
1
|
const defaultEndLoadingFunction = function (url, timestamp, data, res) {
|
|
5
|
-
|
|
6
|
-
if (res && res.data && (numProperties(res.data) === 1) && res.data.disconnected) {
|
|
7
|
-
window.location.reload();
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
if ((_a = window.appui) === null || _a === void 0 ? void 0 : _a.status) {
|
|
11
|
-
this.$nextTick(() => {
|
|
12
|
-
log("UPDATE LOADBAR");
|
|
13
|
-
const loadBar = this.getRef('loading');
|
|
14
|
-
if (isCp(loadBar)) {
|
|
15
|
-
loadBar.$updateAllComputed();
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
2
|
+
return true;
|
|
19
3
|
};
|
|
20
4
|
export { defaultEndLoadingFunction };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const defaultPostLinkFunction: (r:
|
|
1
|
+
declare const defaultPostLinkFunction: (r: object, ele?: HTMLElement) => boolean;
|
|
2
2
|
export { defaultPostLinkFunction };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const defaultPreLinkFunction: (url:
|
|
1
|
+
declare const defaultPreLinkFunction: (url: string, force?: boolean, ele?: HTMLElement) => string;
|
|
2
2
|
export { defaultPreLinkFunction };
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
let router = appui.getRef('router');
|
|
4
|
-
if (router) {
|
|
5
|
-
if (isFunction(router.route) && !router.disabled) {
|
|
6
|
-
router.route(url);
|
|
7
|
-
}
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
return true;
|
|
1
|
+
const defaultPreLinkFunction = function (url, force, ele) {
|
|
2
|
+
return url;
|
|
11
3
|
};
|
|
12
4
|
export { defaultPreLinkFunction };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const defaultStartLoadingFunction: () =>
|
|
1
|
+
declare const defaultStartLoadingFunction: (url: string, tst: number, data?: object, requestId?: string) => boolean;
|
|
2
2
|
export { defaultStartLoadingFunction };
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const defaultStartLoadingFunction = function () {
|
|
4
|
-
var _a;
|
|
5
|
-
if ((_a = window.appui) === null || _a === void 0 ? void 0 : _a.status) {
|
|
6
|
-
this.$nextTick(() => {
|
|
7
|
-
log("UPDATE LOADBAR");
|
|
8
|
-
const loadBar = this.getRef('loading');
|
|
9
|
-
if (isCp(loadBar)) {
|
|
10
|
-
loadBar.$updateAllComputed();
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
}
|
|
1
|
+
const defaultStartLoadingFunction = function (url, tst, data, requestId = null) {
|
|
2
|
+
return true;
|
|
14
3
|
};
|
|
15
4
|
export { defaultStartLoadingFunction };
|
package/dist/fn/deleteProp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const deleteProp: (obj:
|
|
1
|
+
declare const deleteProp: (obj: object, prop: string) => void;
|
|
2
2
|
export { deleteProp };
|
package/dist/fn/deleteProp.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { checkType } from './checkType';
|
|
1
2
|
const deleteProp = function (obj, prop) {
|
|
2
|
-
checkType(obj,
|
|
3
|
-
checkType(prop,
|
|
3
|
+
checkType(obj, 'object', bbn._('The obj must be an object in setProp'));
|
|
4
|
+
checkType(prop, 'string', bbn._('The prop must be a string in setProp'));
|
|
4
5
|
delete obj[prop];
|
|
5
6
|
};
|
|
6
7
|
export { deleteProp };
|
package/dist/fn/diffObj.d.ts
CHANGED
package/dist/fn/diffObj.js
CHANGED
|
@@ -4,7 +4,8 @@ import { isFunction } from './isFunction';
|
|
|
4
4
|
import { isValue } from './isValue';
|
|
5
5
|
import { isDom } from './isDom';
|
|
6
6
|
import { numProperties } from './numProperties';
|
|
7
|
-
|
|
7
|
+
let diffObjProcessed = [];
|
|
8
|
+
const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
|
|
8
9
|
if (!notRoot) {
|
|
9
10
|
diffObjProcessed = [];
|
|
10
11
|
}
|
|
@@ -12,15 +13,13 @@ const diffObj = function (obj1, obj2, unchanged, notRoot) {
|
|
|
12
13
|
if (value1 === value2) {
|
|
13
14
|
return VALUE_UNCHANGED;
|
|
14
15
|
}
|
|
15
|
-
if (isDate(value1) &&
|
|
16
|
-
isDate(value2) &&
|
|
17
|
-
(value1.getTime() === value2.getTime())) {
|
|
16
|
+
if (isDate(value1) && isDate(value2) && value1.getTime() === value2.getTime()) {
|
|
18
17
|
return VALUE_UNCHANGED;
|
|
19
18
|
}
|
|
20
|
-
if ('undefined' == typeof
|
|
19
|
+
if ('undefined' == typeof value1) {
|
|
21
20
|
return VALUE_CREATED;
|
|
22
21
|
}
|
|
23
|
-
if ('undefined' == typeof
|
|
22
|
+
if ('undefined' == typeof value2) {
|
|
24
23
|
return VALUE_DELETED;
|
|
25
24
|
}
|
|
26
25
|
return VALUE_UPDATED;
|
|
@@ -32,24 +31,24 @@ const diffObj = function (obj1, obj2, unchanged, notRoot) {
|
|
|
32
31
|
if (!isFunction(obj1) && !isFunction(obj2)) {
|
|
33
32
|
if (isValue(obj1) || isValue(obj2)) {
|
|
34
33
|
let res = _compareValues(obj1, obj2);
|
|
35
|
-
if (unchanged ||
|
|
34
|
+
if (unchanged || res !== VALUE_UNCHANGED) {
|
|
36
35
|
let ret = createObject();
|
|
37
36
|
Object.defineProperty(ret, 'type', {
|
|
38
37
|
value: res,
|
|
39
|
-
enumerable: false
|
|
38
|
+
enumerable: false,
|
|
40
39
|
});
|
|
41
40
|
Object.defineProperty(ret, 'data', {
|
|
42
|
-
value:
|
|
43
|
-
enumerable: false
|
|
41
|
+
value: obj1 === undefined ? obj2 : obj1,
|
|
42
|
+
enumerable: false,
|
|
44
43
|
});
|
|
45
44
|
Object.defineProperty(ret, '_bbnDiffObjProof', {
|
|
46
45
|
value: true,
|
|
47
|
-
enumerable: false
|
|
46
|
+
enumerable: false,
|
|
48
47
|
});
|
|
49
48
|
if (obj1 !== undefined) {
|
|
50
49
|
Object.defineProperty(ret, 'newData', {
|
|
51
50
|
value: obj2,
|
|
52
|
-
enumerable: false
|
|
51
|
+
enumerable: false,
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
54
|
return ret;
|
|
@@ -69,7 +68,7 @@ const diffObj = function (obj1, obj2, unchanged, notRoot) {
|
|
|
69
68
|
continue;
|
|
70
69
|
}
|
|
71
70
|
let value2 = undefined;
|
|
72
|
-
if ('undefined' != typeof
|
|
71
|
+
if ('undefined' != typeof obj2[key]) {
|
|
73
72
|
value2 = obj2[key];
|
|
74
73
|
}
|
|
75
74
|
let res = diffObj(obj1[key], value2, unchanged, true);
|
|
@@ -78,7 +77,7 @@ const diffObj = function (obj1, obj2, unchanged, notRoot) {
|
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
for (let key in obj2) {
|
|
81
|
-
if (isFunction(obj2[key]) ||
|
|
80
|
+
if (isFunction(obj2[key]) || 'undefined' != typeof obj1[key]) {
|
|
82
81
|
continue;
|
|
83
82
|
}
|
|
84
83
|
let res = diffObj(undefined, obj2[key], unchanged, true);
|
package/dist/fn/dirName.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const dirName: (path: any) =>
|
|
1
|
+
declare const dirName: (path: any) => string;
|
|
2
2
|
export { dirName };
|
package/dist/fn/download.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const download: (url:
|
|
1
|
+
declare const download: (url: string, filename?: string | object, params?: object) => any;
|
|
2
2
|
export { download };
|
package/dist/fn/download.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isObject } from './isObject';
|
|
2
1
|
import { ajax } from './ajax';
|
|
3
2
|
import { substr } from './substr';
|
|
4
3
|
import { baseName } from './baseName';
|
|
@@ -8,14 +7,14 @@ import { downloadContent } from './downloadContent';
|
|
|
8
7
|
import { defaultAjaxErrorFunction } from './defaultAjaxErrorFunction';
|
|
9
8
|
const download = function (url, filename, params) {
|
|
10
9
|
// We can intervert the arguments
|
|
11
|
-
if (
|
|
10
|
+
if (filename && (typeof (filename) === 'object')) {
|
|
12
11
|
params = filename;
|
|
13
12
|
filename = null;
|
|
14
13
|
}
|
|
15
14
|
return ajax(url, 'blob', params || { _bbn_download: 1 }, (d, headers) => {
|
|
16
15
|
if (!filename) {
|
|
17
16
|
let cd = 'attachment; filename=';
|
|
18
|
-
if (headers && headers['content-disposition'] &&
|
|
17
|
+
if (headers && headers['content-disposition'] && headers['content-disposition'].indexOf(cd) === 0) {
|
|
19
18
|
filename = substr(headers['content-disposition'], cd.length + 1, headers['content-disposition'].length - cd.length - 2);
|
|
20
19
|
}
|
|
21
20
|
else {
|
|
@@ -25,12 +24,11 @@ const download = function (url, filename, params) {
|
|
|
25
24
|
if (isBlob(d)) {
|
|
26
25
|
let extension = fileExt(filename);
|
|
27
26
|
let htmlExtensions = ['php', 'html'];
|
|
28
|
-
if ((d.type !== 'text/html') || htmlExtensions.includes(extension)) {
|
|
27
|
+
if ((typeof filename === 'string') && ((('type' in d) && (d.type !== 'text/html')) || htmlExtensions.includes(extension))) {
|
|
29
28
|
downloadContent(filename, d);
|
|
30
29
|
return;
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
|
-
defaultAjaxErrorFunction(e);
|
|
34
32
|
}, e => {
|
|
35
33
|
defaultAjaxErrorFunction(e);
|
|
36
34
|
});
|