@bbn/bbn 1.0.12 → 1.0.13
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 +1174 -7
- package/dist/bundle.js +5197 -16
- package/dist/fn/_addLoader.d.ts +2 -0
- package/dist/fn/_addLoader.js +29 -0
- package/dist/fn/_compareValues.d.ts +2 -0
- package/dist/fn/_compareValues.js +40 -0
- package/dist/fn/_deleteLoader.d.ts +2 -0
- package/dist/fn/_deleteLoader.js +26 -0
- package/dist/fn/abort.d.ts +2 -0
- package/dist/fn/abort.js +5 -0
- package/dist/fn/abortURL.d.ts +2 -0
- package/dist/fn/abortURL.js +14 -0
- package/dist/fn/addColors.d.ts +2 -0
- package/dist/fn/addColors.js +17 -0
- package/dist/fn/addInputs.d.ts +3 -0
- package/dist/fn/addInputs.js +34 -0
- package/dist/fn/addStyle.d.ts +2 -0
- package/dist/fn/addStyle.js +6 -0
- package/dist/fn/adjustHeight.d.ts +2 -0
- package/dist/fn/adjustHeight.js +10 -0
- package/dist/fn/adjustSize.d.ts +2 -0
- package/dist/fn/adjustSize.js +8 -0
- package/dist/fn/adjustWidth.d.ts +2 -0
- package/dist/fn/adjustWidth.js +10 -0
- package/dist/fn/ajax.d.ts +2 -0
- package/dist/fn/ajax.js +103 -0
- package/dist/fn/analyzeFunction.d.ts +11 -0
- package/dist/fn/analyzeFunction.js +132 -0
- package/dist/fn/animateCss.d.ts +2 -0
- package/dist/fn/animateCss.js +13 -0
- package/dist/fn/arrayBuffer2String.d.ts +2 -0
- package/dist/fn/arrayBuffer2String.js +2 -0
- package/dist/fn/arrayFromProp.d.ts +2 -0
- package/dist/fn/arrayFromProp.js +4 -0
- package/dist/fn/autoExtend.d.ts +2 -0
- package/dist/fn/autoExtend.js +12 -0
- package/dist/fn/baseName.d.ts +2 -0
- package/dist/fn/baseName.js +17 -0
- package/dist/fn/br2nl.d.ts +2 -0
- package/dist/fn/br2nl.js +3 -0
- package/dist/fn/calendar.d.ts +2 -0
- package/dist/fn/calendar.js +16 -0
- package/dist/fn/callback.d.ts +2 -0
- package/dist/fn/callback.js +81 -0
- package/dist/fn/camelToCss.d.ts +2 -0
- package/dist/fn/camelToCss.js +2 -0
- package/dist/fn/camelize.d.ts +2 -0
- package/dist/fn/camelize.js +9 -0
- package/dist/fn/canvasToImage.d.ts +2 -0
- package/dist/fn/canvasToImage.js +2 -0
- package/dist/fn/center.d.ts +2 -0
- package/dist/fn/center.js +15 -0
- package/dist/fn/checkProps.d.ts +2 -0
- package/dist/fn/checkProps.js +3 -0
- package/dist/fn/checkPropsDetails.d.ts +5 -0
- package/dist/fn/checkPropsDetails.js +49 -0
- package/dist/fn/checkPropsOrDie.d.ts +2 -0
- package/dist/fn/checkPropsOrDie.js +9 -0
- package/dist/fn/checkType.d.ts +2 -0
- package/dist/fn/checkType.js +61 -0
- package/dist/fn/circularReplacer.d.ts +2 -0
- package/dist/fn/circularReplacer.js +33 -0
- package/dist/fn/clone.d.ts +3 -0
- package/dist/fn/clone.js +14 -0
- package/dist/fn/colorToHex.d.ts +2 -0
- package/dist/fn/colorToHex.js +2 -0
- package/dist/fn/compare.d.ts +2 -0
- package/dist/fn/compare.js +86 -0
- package/dist/fn/compareConditions.d.ts +3 -0
- package/dist/fn/compareConditions.js +40 -0
- package/dist/fn/copy.d.ts +2 -0
- package/dist/fn/copy.js +31 -0
- package/dist/fn/correctCase.d.ts +2 -0
- package/dist/fn/correctCase.js +2 -0
- package/dist/fn/count.d.ts +2 -0
- package/dist/fn/count.js +3 -0
- package/dist/fn/crc32.d.ts +2 -0
- package/dist/fn/crc32.js +9 -0
- package/dist/fn/createObject.d.ts +2 -0
- package/dist/fn/createObject.js +9 -0
- package/dist/fn/cssExists.d.ts +2 -0
- package/dist/fn/cssExists.js +25 -0
- package/dist/fn/date.d.ts +2 -0
- package/dist/fn/date.js +28 -0
- package/dist/fn/dateSQL.d.ts +2 -0
- package/dist/fn/dateSQL.js +4 -0
- package/dist/fn/daysInMonth.d.ts +2 -0
- package/dist/fn/daysInMonth.js +9 -0
- package/dist/fn/deepPath.d.ts +3 -0
- package/dist/fn/deepPath.js +21 -0
- package/dist/fn/defaultAjaxAbortFunction.d.ts +2 -0
- package/dist/fn/defaultAjaxAbortFunction.js +3 -0
- package/dist/fn/defaultAjaxErrorFunction.d.ts +2 -0
- package/dist/fn/defaultAjaxErrorFunction.js +3 -0
- package/dist/fn/defaultAlertFunction.d.ts +2 -0
- package/dist/fn/defaultAlertFunction.js +2 -0
- package/dist/fn/defaultConfirmFunction.d.ts +2 -0
- package/dist/fn/defaultConfirmFunction.js +14 -0
- package/dist/fn/defaultEndLoadingFunction.d.ts +2 -0
- package/dist/fn/defaultEndLoadingFunction.js +2 -0
- package/dist/fn/defaultErrorFunction.d.ts +2 -0
- package/dist/fn/defaultErrorFunction.js +3 -0
- package/dist/fn/defaultHistoryFunction.d.ts +2 -0
- package/dist/fn/defaultHistoryFunction.js +2 -0
- package/dist/fn/defaultLinkFunction.d.ts +2 -0
- package/dist/fn/defaultLinkFunction.js +2 -0
- package/dist/fn/defaultPostLinkFunction.d.ts +2 -0
- package/dist/fn/defaultPostLinkFunction.js +2 -0
- package/dist/fn/defaultPreLinkFunction.d.ts +2 -0
- package/dist/fn/defaultPreLinkFunction.js +2 -0
- package/dist/fn/defaultResizeFunction.d.ts +2 -0
- package/dist/fn/defaultResizeFunction.js +2 -0
- package/dist/fn/defaultStartLoadingFunction.d.ts +2 -0
- package/dist/fn/defaultStartLoadingFunction.js +2 -0
- package/dist/fn/deleteProp.d.ts +2 -0
- package/dist/fn/deleteProp.js +3 -0
- package/dist/fn/diffObj.d.ts +3 -0
- package/dist/fn/diffObj.js +77 -0
- package/dist/fn/dirName.d.ts +2 -0
- package/dist/fn/dirName.js +18 -0
- package/dist/fn/download.d.ts +2 -0
- package/dist/fn/download.js +35 -0
- package/dist/fn/downloadContent.d.ts +2 -0
- package/dist/fn/downloadContent.js +37 -0
- package/dist/fn/each.d.ts +2 -0
- package/dist/fn/each.js +23 -0
- package/dist/fn/eraseCookie.d.ts +2 -0
- package/dist/fn/eraseCookie.js +2 -0
- package/dist/fn/error.d.ts +2 -0
- package/dist/fn/error.js +13 -0
- package/dist/fn/escapeDquotes.d.ts +2 -0
- package/dist/fn/escapeDquotes.js +8 -0
- package/dist/fn/escapeRegExp.d.ts +2 -0
- package/dist/fn/escapeRegExp.js +2 -0
- package/dist/fn/escapeSquotes.d.ts +2 -0
- package/dist/fn/escapeSquotes.js +8 -0
- package/dist/fn/escapeTicks.d.ts +2 -0
- package/dist/fn/escapeTicks.js +8 -0
- package/dist/fn/escapeUrl.d.ts +2 -0
- package/dist/fn/escapeUrl.js +38 -0
- package/dist/fn/extend.d.ts +3 -0
- package/dist/fn/extend.js +67 -0
- package/dist/fn/extendOut.d.ts +3 -0
- package/dist/fn/extendOut.js +24 -0
- package/dist/fn/fdate.d.ts +2 -0
- package/dist/fn/fdate.js +18 -0
- package/dist/fn/fdatetime.d.ts +2 -0
- package/dist/fn/fdatetime.js +15 -0
- package/dist/fn/fieldValue.d.ts +2 -0
- package/dist/fn/fieldValue.js +24 -0
- package/dist/fn/fileExt.d.ts +2 -0
- package/dist/fn/fileExt.js +11 -0
- package/dist/fn/filter.d.ts +3 -0
- package/dist/fn/filter.js +42 -0
- package/dist/fn/filterToConditions.d.ts +3 -0
- package/dist/fn/filterToConditions.js +25 -0
- package/dist/fn/findAll.d.ts +3 -0
- package/dist/fn/findAll.js +16 -0
- package/dist/fn/fori.d.ts +2 -0
- package/dist/fn/fori.js +19 -0
- package/dist/fn/forir.d.ts +2 -0
- package/dist/fn/forir.js +19 -0
- package/dist/fn/format.d.ts +2 -0
- package/dist/fn/format.js +11 -0
- package/dist/fn/formatBytes.d.ts +2 -0
- package/dist/fn/formatBytes.js +8 -0
- package/dist/fn/formatDate.d.ts +2 -0
- package/dist/fn/formatDate.js +2 -0
- package/dist/fn/formatSize.d.ts +2 -0
- package/dist/fn/formatSize.js +12 -0
- package/dist/fn/formdata.d.ts +2 -0
- package/dist/fn/formdata.js +48 -0
- package/dist/fn/fromXml.d.ts +2 -0
- package/dist/fn/fromXml.js +44 -0
- package/dist/fn/ftime.d.ts +2 -0
- package/dist/fn/ftime.js +14 -0
- package/dist/fn/getAllTags.d.ts +2 -0
- package/dist/fn/getAllTags.js +3 -0
- package/dist/fn/getAncestors.d.ts +2 -0
- package/dist/fn/getAncestors.js +26 -0
- package/dist/fn/getAttributes.d.ts +2 -0
- package/dist/fn/getAttributes.js +10 -0
- package/dist/fn/getBrowserName.d.ts +2 -0
- package/dist/fn/getBrowserName.js +11 -0
- package/dist/fn/getBrowserVersion.d.ts +2 -0
- package/dist/fn/getBrowserVersion.js +11 -0
- package/dist/fn/getCookie.d.ts +2 -0
- package/dist/fn/getCookie.js +18 -0
- package/dist/fn/getCssVar.d.ts +2 -0
- package/dist/fn/getCssVar.js +7 -0
- package/dist/fn/getDay.d.ts +2 -0
- package/dist/fn/getDay.js +17 -0
- package/dist/fn/getDeviceType.d.ts +2 -0
- package/dist/fn/getDeviceType.js +11 -0
- package/dist/fn/getEventData.d.ts +2 -0
- package/dist/fn/getEventData.js +80 -0
- package/dist/fn/getField.d.ts +2 -0
- package/dist/fn/getField.js +9 -0
- package/dist/fn/getFieldValues.d.ts +2 -0
- package/dist/fn/getFieldValues.js +13 -0
- package/dist/fn/getHTMLOfSelection.d.ts +2 -0
- package/dist/fn/getHTMLOfSelection.js +28 -0
- package/dist/fn/getHtml.d.ts +2 -0
- package/dist/fn/getHtml.js +9 -0
- package/dist/fn/getLoader.d.ts +2 -0
- package/dist/fn/getLoader.js +10 -0
- package/dist/fn/getPath.d.ts +2 -0
- package/dist/fn/getPath.js +31 -0
- package/dist/fn/getProp.d.ts +2 -0
- package/dist/fn/getProp.js +3 -0
- package/dist/fn/getProperty.d.ts +2 -0
- package/dist/fn/getProperty.js +11 -0
- package/dist/fn/getRequestId.d.ts +2 -0
- package/dist/fn/getRequestId.js +12 -0
- package/dist/fn/getRow.d.ts +2 -0
- package/dist/fn/getRow.js +9 -0
- package/dist/fn/getScrollBarSize.d.ts +2 -0
- package/dist/fn/getScrollBarSize.js +21 -0
- package/dist/fn/getText.d.ts +2 -0
- package/dist/fn/getText.js +2 -0
- package/dist/fn/getTimeoff.d.ts +2 -0
- package/dist/fn/getTimeoff.js +8 -0
- package/dist/fn/happy.d.ts +2 -0
- package/dist/fn/happy.js +3 -0
- package/dist/fn/hash.d.ts +2 -0
- package/dist/fn/hash.js +35 -0
- package/dist/fn/hex2rgb.d.ts +6 -0
- package/dist/fn/hex2rgb.js +2 -0
- package/dist/fn/history.d.ts +2 -0
- package/dist/fn/history.js +2 -0
- package/dist/fn/html2text.d.ts +2 -0
- package/dist/fn/html2text.js +2 -0
- package/dist/fn/imageToCanvas.d.ts +2 -0
- package/dist/fn/imageToCanvas.js +2 -0
- package/dist/fn/imgToBase64.d.ts +2 -0
- package/dist/fn/imgToBase64.js +4 -0
- package/dist/fn/info.d.ts +2 -0
- package/dist/fn/info.js +3 -0
- package/dist/fn/init.d.ts +2 -0
- package/dist/fn/init.js +110 -0
- package/dist/fn/isActiveInterface.d.ts +2 -0
- package/dist/fn/isActiveInterface.js +9 -0
- package/dist/fn/isArray.d.ts +2 -0
- package/dist/fn/isArray.js +11 -0
- package/dist/fn/isBlob.d.ts +2 -0
- package/dist/fn/isBlob.js +11 -0
- package/dist/fn/isBoolean.d.ts +2 -0
- package/dist/fn/isBoolean.js +11 -0
- package/dist/fn/isCanvas.d.ts +2 -0
- package/dist/fn/isCanvas.js +11 -0
- package/dist/fn/isColor.d.ts +2 -0
- package/dist/fn/isColor.js +9 -0
- package/dist/fn/isComment.d.ts +2 -0
- package/dist/fn/isComment.js +11 -0
- package/dist/fn/isCp.d.ts +2 -0
- package/dist/fn/isCp.js +18 -0
- package/dist/fn/isDate.d.ts +2 -0
- package/dist/fn/isDate.js +11 -0
- package/dist/fn/isDesktopDevice.d.ts +2 -0
- package/dist/fn/isDesktopDevice.js +2 -0
- package/dist/fn/isDimension.d.ts +2 -0
- package/dist/fn/isDimension.js +8 -0
- package/dist/fn/isDom.d.ts +2 -0
- package/dist/fn/isDom.js +11 -0
- package/dist/fn/isEmail.d.ts +2 -0
- package/dist/fn/isEmail.js +9 -0
- package/dist/fn/isEmpty.d.ts +2 -0
- package/dist/fn/isEmpty.js +18 -0
- package/dist/fn/isEvent.d.ts +2 -0
- package/dist/fn/isEvent.js +11 -0
- package/dist/fn/isFocused.d.ts +2 -0
- package/dist/fn/isFocused.js +2 -0
- package/dist/fn/isFunction.d.ts +2 -0
- package/dist/fn/isFunction.js +11 -0
- package/dist/fn/isHostname.d.ts +2 -0
- package/dist/fn/isHostname.js +12 -0
- package/dist/fn/isIP.d.ts +2 -0
- package/dist/fn/isIP.js +6 -0
- package/dist/fn/isInside.d.ts +2 -0
- package/dist/fn/isInside.js +21 -0
- package/dist/fn/isInt.d.ts +2 -0
- package/dist/fn/isInt.js +11 -0
- package/dist/fn/isIterable.d.ts +2 -0
- package/dist/fn/isIterable.js +2 -0
- package/dist/fn/isMobile.d.ts +2 -0
- package/dist/fn/isMobile.js +4 -0
- package/dist/fn/isMobileDevice.d.ts +2 -0
- package/dist/fn/isMobileDevice.js +2 -0
- package/dist/fn/isNull.d.ts +2 -0
- package/dist/fn/isNull.js +11 -0
- package/dist/fn/isNumber.d.ts +2 -0
- package/dist/fn/isNumber.js +11 -0
- package/dist/fn/isObject.d.ts +2 -0
- package/dist/fn/isObject.js +11 -0
- package/dist/fn/isPercent.d.ts +2 -0
- package/dist/fn/isPercent.js +11 -0
- package/dist/fn/isPrimitive.d.ts +2 -0
- package/dist/fn/isPrimitive.js +11 -0
- package/dist/fn/isPromise.d.ts +2 -0
- package/dist/fn/isPromise.js +11 -0
- package/dist/fn/isPropSize.d.ts +2 -0
- package/dist/fn/isPropSize.js +6 -0
- package/dist/fn/isSQLDate.d.ts +2 -0
- package/dist/fn/isSQLDate.js +11 -0
- package/dist/fn/isSame.d.ts +3 -0
- package/dist/fn/isSame.js +30 -0
- package/dist/fn/isString.d.ts +2 -0
- package/dist/fn/isString.js +11 -0
- package/dist/fn/isSymbol.d.ts +2 -0
- package/dist/fn/isSymbol.js +11 -0
- package/dist/fn/isTabletDevice.d.ts +2 -0
- package/dist/fn/isTabletDevice.js +2 -0
- package/dist/fn/isURL.d.ts +2 -0
- package/dist/fn/isURL.js +3 -0
- package/dist/fn/isValidDimension.d.ts +2 -0
- package/dist/fn/isValidDimension.js +12 -0
- package/dist/fn/isValidName.d.ts +2 -0
- package/dist/fn/isValidName.js +13 -0
- package/dist/fn/isValue.d.ts +2 -0
- package/dist/fn/isValue.js +12 -0
- package/dist/fn/isVue.d.ts +2 -0
- package/dist/fn/isVue.js +27 -0
- package/dist/fn/iterate.d.ts +2 -0
- package/dist/fn/iterate.js +15 -0
- package/dist/fn/lightenDarkenHex.d.ts +2 -0
- package/dist/fn/lightenDarkenHex.js +27 -0
- package/dist/fn/link.d.ts +3 -0
- package/dist/fn/link.js +87 -0
- package/dist/fn/log.d.ts +2 -0
- package/dist/fn/log.js +34 -0
- package/dist/fn/makeReactive.d.ts +3 -0
- package/dist/fn/makeReactive.js +137 -0
- package/dist/fn/map.d.ts +3 -0
- package/dist/fn/map.js +11 -0
- package/dist/fn/md5.d.ts +2 -0
- package/dist/fn/md5.js +92 -0
- package/dist/fn/money.d.ts +2 -0
- package/dist/fn/money.js +63 -0
- package/dist/fn/move.d.ts +2 -0
- package/dist/fn/move.js +11 -0
- package/dist/fn/multiorder.d.ts +2 -0
- package/dist/fn/multiorder.js +22 -0
- package/dist/fn/nl2br.d.ts +2 -0
- package/dist/fn/nl2br.js +3 -0
- package/dist/fn/numProperties.d.ts +2 -0
- package/dist/fn/numProperties.js +7 -0
- package/dist/fn/objectToFormData.d.ts +2 -0
- package/dist/fn/objectToFormData.js +31 -0
- package/dist/fn/order.d.ts +2 -0
- package/dist/fn/order.js +8 -0
- package/dist/fn/outerHeight.d.ts +2 -0
- package/dist/fn/outerHeight.js +9 -0
- package/dist/fn/outerWidth.d.ts +2 -0
- package/dist/fn/outerWidth.js +9 -0
- package/dist/fn/percent.d.ts +2 -0
- package/dist/fn/percent.js +2 -0
- package/dist/fn/pickValue.d.ts +2 -0
- package/dist/fn/pickValue.js +4 -0
- package/dist/fn/post.d.ts +2 -0
- package/dist/fn/post.js +7 -0
- package/dist/fn/postOut.d.ts +2 -0
- package/dist/fn/postOut.js +30 -0
- package/dist/fn/printf.d.ts +2 -0
- package/dist/fn/printf.js +2 -0
- package/dist/fn/quotes2html.d.ts +2 -0
- package/dist/fn/quotes2html.js +11 -0
- package/dist/fn/randomInt.d.ts +2 -0
- package/dist/fn/randomInt.js +2 -0
- package/dist/fn/randomString.d.ts +2 -0
- package/dist/fn/randomString.js +38 -0
- package/dist/fn/removeAccents.d.ts +2 -0
- package/dist/fn/removeAccents.js +16 -0
- package/dist/fn/removeEmpty.d.ts +2 -0
- package/dist/fn/removeEmpty.js +31 -0
- package/dist/fn/removeExtraSpaces.d.ts +2 -0
- package/dist/fn/removeExtraSpaces.js +2 -0
- package/dist/fn/removeHtmlComments.d.ts +2 -0
- package/dist/fn/removeHtmlComments.js +8 -0
- package/dist/fn/removePrivateProp.d.ts +3 -0
- package/dist/fn/removePrivateProp.js +19 -0
- package/dist/fn/removeTrailingChars.d.ts +2 -0
- package/dist/fn/removeTrailingChars.js +16 -0
- package/dist/fn/repeat.d.ts +2 -0
- package/dist/fn/repeat.js +3 -0
- package/dist/fn/replaceAll.d.ts +2 -0
- package/dist/fn/replaceAll.js +9 -0
- package/dist/fn/replaceSelection.d.ts +2 -0
- package/dist/fn/replaceSelection.js +36 -0
- package/dist/fn/resize.d.ts +2 -0
- package/dist/fn/resize.js +38 -0
- package/dist/fn/rgb2hex.d.ts +2 -0
- package/dist/fn/rgb2hex.js +8 -0
- package/dist/fn/riterate.d.ts +2 -0
- package/dist/fn/riterate.js +3 -0
- package/dist/fn/roundDecimal.d.ts +2 -0
- package/dist/fn/roundDecimal.js +2 -0
- package/dist/fn/sanitize.d.ts +2 -0
- package/dist/fn/sanitize.js +17 -0
- package/dist/fn/search.d.ts +2 -0
- package/dist/fn/search.js +62 -0
- package/dist/fn/selectElementText.d.ts +2 -0
- package/dist/fn/selectElementText.js +23 -0
- package/dist/fn/selector.d.ts +2 -0
- package/dist/fn/selector.js +2 -0
- package/dist/fn/setCookie.d.ts +2 -0
- package/dist/fn/setCookie.js +11 -0
- package/dist/fn/setCssVar.d.ts +2 -0
- package/dist/fn/setCssVar.js +7 -0
- package/dist/fn/setNavigationVars.d.ts +2 -0
- package/dist/fn/setNavigationVars.js +39 -0
- package/dist/fn/setProp.d.ts +2 -0
- package/dist/fn/setProp.js +3 -0
- package/dist/fn/setProperty.d.ts +2 -0
- package/dist/fn/setProperty.js +23 -0
- package/dist/fn/shorten.d.ts +2 -0
- package/dist/fn/shorten.js +18 -0
- package/dist/fn/shortenObj.d.ts +3 -0
- package/dist/fn/shortenObj.js +17 -0
- package/dist/fn/shuffle.d.ts +0 -5
- package/dist/fn/shuffle.js +1 -11
- package/dist/fn/simpleHash.d.ts +2 -0
- package/dist/fn/simpleHash.js +4 -0
- package/dist/fn/simpleHash1.d.ts +2 -0
- package/dist/fn/simpleHash1.js +10 -0
- package/dist/fn/simpleHash2.d.ts +2 -0
- package/dist/fn/simpleHash2.js +10 -0
- package/dist/fn/startChrono.d.ts +2 -0
- package/dist/fn/startChrono.js +13 -0
- package/dist/fn/stat.d.ts +2 -0
- package/dist/fn/stat.js +48 -0
- package/dist/fn/stopChrono.d.ts +2 -0
- package/dist/fn/stopChrono.js +6 -0
- package/dist/fn/string2ArrayBuffer.d.ts +2 -0
- package/dist/fn/string2ArrayBuffer.js +9 -0
- package/dist/fn/submit.d.ts +2 -0
- package/dist/fn/submit.js +38 -0
- package/dist/fn/substr.d.ts +2 -0
- package/dist/fn/substr.js +18 -0
- package/dist/fn/sum.d.ts +2 -0
- package/dist/fn/sum.js +6 -0
- package/dist/fn/timestamp.d.ts +2 -0
- package/dist/fn/timestamp.js +2 -0
- package/dist/fn/toCSV.d.ts +2 -0
- package/dist/fn/toCSV.js +40 -0
- package/dist/fn/toggleFullScreen.d.ts +2 -0
- package/dist/fn/toggleFullScreen.js +37 -0
- package/dist/fn/translate.d.ts +2 -0
- package/dist/fn/translate.js +4 -0
- package/dist/fn/treatAjaxArguments.d.ts +2 -0
- package/dist/fn/treatAjaxArguments.js +67 -0
- package/dist/fn/trim.d.ts +2 -0
- package/dist/fn/trim.js +20 -0
- package/dist/fn/uniqString.d.ts +2 -0
- package/dist/fn/uniqString.js +30 -0
- package/dist/fn/unique.d.ts +2 -0
- package/dist/fn/unique.js +2 -0
- package/dist/fn/upload.d.ts +2 -0
- package/dist/fn/upload.js +26 -0
- package/dist/fn/warning.d.ts +2 -0
- package/dist/fn/warning.js +3 -0
- package/dist/index.d.ts +1 -6
- package/dist/index.js +458 -5
- package/package.json +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { bbn } from '../definitions';
|
|
2
|
+
import { error } from './error';
|
|
3
|
+
import { defaultLinkFunction } from './defaultLinkFunction';
|
|
4
|
+
import { insertContent } from './insertContent';
|
|
5
|
+
import { isFunction } from './isFunction';
|
|
6
|
+
import { log } from './log';
|
|
7
|
+
import { defaultPostLinkFunction } from './defaultPostLinkFunction';
|
|
8
|
+
import { defaultAlertFunction } from './defaultAlertFunction';
|
|
9
|
+
const callback = function (url, res, fn, fn2, ele) {
|
|
10
|
+
let tmp = false;
|
|
11
|
+
if (res) {
|
|
12
|
+
tmp = true;
|
|
13
|
+
let t = typeof res;
|
|
14
|
+
let isObj = t.toLowerCase() === 'object';
|
|
15
|
+
let errTitle;
|
|
16
|
+
if (isObj && res.prescript) {
|
|
17
|
+
try {
|
|
18
|
+
eval(res.prescript);
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
error(e.message || '');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (isObj && res.url === undefined) {
|
|
25
|
+
res.url = url;
|
|
26
|
+
}
|
|
27
|
+
if (fn) {
|
|
28
|
+
tmp = fn(res, ele);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
tmp = defaultLinkFunction(res, ele);
|
|
32
|
+
}
|
|
33
|
+
if (ele && isObj && (res.content !== undefined)) {
|
|
34
|
+
if (ele.is("input,textarea")) {
|
|
35
|
+
ele.val(res.content);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
insertContent(res.content, ele);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (tmp && isObj && res.script) {
|
|
42
|
+
if (isFunction(res.script)) {
|
|
43
|
+
tmp = res.script(res.data ? res.data : {}, ele ? ele : false);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
tmp = ((data, ele) => {
|
|
47
|
+
let r = null;
|
|
48
|
+
try {
|
|
49
|
+
r = eval(res.script);
|
|
50
|
+
if (isFunction(r)) {
|
|
51
|
+
r = r(data, ele);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
log(e, res);
|
|
56
|
+
error(isFunction(e.getMessage) ? e.getMessage() : null);
|
|
57
|
+
}
|
|
58
|
+
return r;
|
|
59
|
+
})(res.data ? res.data : {}, ele ? ele : false);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (tmp && fn2) {
|
|
63
|
+
fn2(res);
|
|
64
|
+
}
|
|
65
|
+
else if (isObj && defaultPostLinkFunction) {
|
|
66
|
+
defaultPostLinkFunction(res, ele);
|
|
67
|
+
}
|
|
68
|
+
if (tmp && isObj && res.postscript) {
|
|
69
|
+
eval(res.postscript);
|
|
70
|
+
}
|
|
71
|
+
if (isObj && res.error) {
|
|
72
|
+
errTitle = res.errorTitle || bbn.lng.server_response;
|
|
73
|
+
defaultAlertFunction(res.error, errTitle);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
defaultAlertFunction(bbn.lng.errorText, bbn.lng.error);
|
|
78
|
+
}
|
|
79
|
+
return tmp;
|
|
80
|
+
};
|
|
81
|
+
export { callback };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { log } from './log';
|
|
2
|
+
const center = function (ele) {
|
|
3
|
+
let parent = ele.parentNode, w = parent.clientWidth, h = parent.clientHeight;
|
|
4
|
+
while (parent && (!w || !h)) {
|
|
5
|
+
parent = ele.parentNode;
|
|
6
|
+
w = parent.clientWidth;
|
|
7
|
+
h = parent.clientHeight;
|
|
8
|
+
}
|
|
9
|
+
log("BBN_CENTER", w, h);
|
|
10
|
+
ele.style.position = "absolute";
|
|
11
|
+
ele.style.top = Math.max(0, ((h - ele.offsetHeight) / 2) + parent.scrollTop) + "px";
|
|
12
|
+
ele.style.left = Math.max(0, ((h - ele.offsetWidth) / 2) + parent.scrollLeft) + "px";
|
|
13
|
+
return ele;
|
|
14
|
+
};
|
|
15
|
+
export { center };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { bbn } from '../definitions';
|
|
2
|
+
import { isString } from './isString';
|
|
3
|
+
import { isArray } from './isArray';
|
|
4
|
+
import { isObject } from './isObject';
|
|
5
|
+
import { each } from './each';
|
|
6
|
+
import { substr } from './substr';
|
|
7
|
+
const checkPropsDetails = function (obj, props, checkEmpty) {
|
|
8
|
+
let res = { error: false, result: true };
|
|
9
|
+
if (isString(props)) {
|
|
10
|
+
props = [props];
|
|
11
|
+
}
|
|
12
|
+
if (!isArray(props)) {
|
|
13
|
+
res.error = bbn._("checkProps must receive a string or an array as props argument");
|
|
14
|
+
}
|
|
15
|
+
if (!isObject(obj)) {
|
|
16
|
+
res.error = bbn._("checkProps must receive an object as obj argument");
|
|
17
|
+
}
|
|
18
|
+
if (!res.error) {
|
|
19
|
+
let check;
|
|
20
|
+
each(props, varName => {
|
|
21
|
+
varName = varName.trim().split(':');
|
|
22
|
+
let type = varName[1] || false;
|
|
23
|
+
varName = varName[0];
|
|
24
|
+
if (obj[varName] === undefined) {
|
|
25
|
+
res.error = varName + ' ' + bbn._("is not defined");
|
|
26
|
+
}
|
|
27
|
+
else if (type) {
|
|
28
|
+
check = 'is' + substr(type, 0, 1).toUpperCase() + substr(type, 1).toLowerCase();
|
|
29
|
+
if (bbn.fn[check] === undefined) {
|
|
30
|
+
res.error = type + ' ' + bbn._("is not a valid type");
|
|
31
|
+
}
|
|
32
|
+
else if (!bbn.fn[check](obj[varName])) {
|
|
33
|
+
res.error = varName + ' ' + bbn._("is not a") + ' ' + type;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else if (checkEmpty && !obj[varName]) {
|
|
37
|
+
res.error = varName + ' ' + bbn._("is empty");
|
|
38
|
+
}
|
|
39
|
+
if (res.error) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (res.error) {
|
|
45
|
+
res.result = false;
|
|
46
|
+
}
|
|
47
|
+
return res;
|
|
48
|
+
};
|
|
49
|
+
export { checkPropsDetails };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { checkPropsDetails } from './checkPropsDetails';
|
|
2
|
+
const checkPropsOrDie = function (obj, props, checkEmpty) {
|
|
3
|
+
let res = checkPropsDetails(obj, props, checkEmpty);
|
|
4
|
+
if (res.error) {
|
|
5
|
+
throw new Error(res.error);
|
|
6
|
+
}
|
|
7
|
+
return true;
|
|
8
|
+
};
|
|
9
|
+
export { checkPropsOrDie };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { bbn } from '../definitions';
|
|
2
|
+
import { isArray } from './isArray';
|
|
3
|
+
import { each } from './each';
|
|
4
|
+
import { isFunction } from './isFunction';
|
|
5
|
+
import { isString } from './isString';
|
|
6
|
+
import { correctCase } from './correctCase';
|
|
7
|
+
import { error } from './error';
|
|
8
|
+
import { log } from './log';
|
|
9
|
+
const checkType = function (value, type, msg, ...logs) {
|
|
10
|
+
let ok = false;
|
|
11
|
+
if (!isArray(type)) {
|
|
12
|
+
type = [type];
|
|
13
|
+
}
|
|
14
|
+
const typesList = [];
|
|
15
|
+
each(type, t => {
|
|
16
|
+
var _a;
|
|
17
|
+
if (t === String) {
|
|
18
|
+
t = 'string';
|
|
19
|
+
}
|
|
20
|
+
else if (t === Number) {
|
|
21
|
+
t = 'number';
|
|
22
|
+
}
|
|
23
|
+
else if (t === Array) {
|
|
24
|
+
t = 'array';
|
|
25
|
+
}
|
|
26
|
+
else if (t === Boolean) {
|
|
27
|
+
t = 'boolean';
|
|
28
|
+
}
|
|
29
|
+
else if (t === Object) {
|
|
30
|
+
t = 'object';
|
|
31
|
+
}
|
|
32
|
+
else if (t === Function) {
|
|
33
|
+
t = 'function';
|
|
34
|
+
}
|
|
35
|
+
if (isFunction(t)) {
|
|
36
|
+
typesList.push(t.name || ((_a = t.constructor) === null || _a === void 0 ? void 0 : _a.name) || t.toString());
|
|
37
|
+
if (value instanceof t) {
|
|
38
|
+
ok = true;
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else if (!isString(t) || !isFunction(bbn.fn['is' + correctCase(t)])) {
|
|
43
|
+
error(`The type ${t} is not recognized`);
|
|
44
|
+
}
|
|
45
|
+
else if (bbn.fn['is' + correctCase(t)](value)) {
|
|
46
|
+
ok = true;
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
typesList.push(t);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
if (!ok) {
|
|
54
|
+
log(["Value given", value, "type", typeof value, "expected", typesList.join(' or ')]);
|
|
55
|
+
if (logs.length) {
|
|
56
|
+
log(logs);
|
|
57
|
+
}
|
|
58
|
+
throw new Error((msg ? msg + ' - ' : '') + bbn._("The value should be a %s", typesList.join(' ' + bbn._("or a") + ' ')));
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
export { checkType };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isDom } from './isDom';
|
|
2
|
+
import { isCp } from './isCp';
|
|
3
|
+
import { log } from './log';
|
|
4
|
+
const circularReplacer = function () {
|
|
5
|
+
const visited = new WeakSet();
|
|
6
|
+
return (key, value) => {
|
|
7
|
+
if ((typeof value === "object") && (value !== null)) {
|
|
8
|
+
if (visited.has(value)) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
visited.add(value);
|
|
12
|
+
if (![undefined, Object, Array, null].includes(value.constructor)) {
|
|
13
|
+
if (isDom(value)) {
|
|
14
|
+
if (value.bbnId) {
|
|
15
|
+
value = '__BBN_DOM__' + value.tagName + '/' + value.bbnId + value.bbnHash;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
value = '__BBN_DOM__' + value.tagName + '/' + value.className;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else if (isCp(value)) {
|
|
22
|
+
log("IS CP");
|
|
23
|
+
value = '__BBN_CP__' + value.$options.name + '/' + value.$cid;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
value = value.constructor.toString();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return value;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export { circularReplacer };
|
package/dist/fn/clone.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isArray } from './isArray';
|
|
2
|
+
import { isObject } from './isObject';
|
|
3
|
+
import { extend } from './extend';
|
|
4
|
+
const clone = function (obj) {
|
|
5
|
+
if (isArray(obj)) {
|
|
6
|
+
return obj.slice().map((a) => { return typeof (a) === 'object' ? clone(a) : a; });
|
|
7
|
+
}
|
|
8
|
+
if (isObject(obj)) {
|
|
9
|
+
const o = Object.create(Object.getPrototypeOf(obj));
|
|
10
|
+
return extend(true, o, obj);
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
};
|
|
14
|
+
export { clone };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { isEmpty } from './isEmpty';
|
|
2
|
+
import { removeAccents } from './removeAccents';
|
|
3
|
+
import { isNull } from './isNull';
|
|
4
|
+
import { isObject } from './isObject';
|
|
5
|
+
import { isSame } from './isSame';
|
|
6
|
+
const compare = function (v1, v2, operator) {
|
|
7
|
+
switch (operator) {
|
|
8
|
+
case "===":
|
|
9
|
+
case "=":
|
|
10
|
+
case "equal":
|
|
11
|
+
case "eq":
|
|
12
|
+
case "is": return v1 === v2;
|
|
13
|
+
case "!==":
|
|
14
|
+
case "notequal":
|
|
15
|
+
case "neq":
|
|
16
|
+
case "isnot": return v1 !== v2;
|
|
17
|
+
case "!=":
|
|
18
|
+
case "different": return v1 != v2;
|
|
19
|
+
case "contains":
|
|
20
|
+
case "contain":
|
|
21
|
+
case "icontains":
|
|
22
|
+
case "icontain":
|
|
23
|
+
if (isEmpty(v1) || isEmpty(v2)) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return removeAccents(v1).toLowerCase().indexOf(removeAccents(v2).toLowerCase()) !== -1;
|
|
27
|
+
case "doesnotcontain":
|
|
28
|
+
case "donotcontain":
|
|
29
|
+
if (isNull(v1) || isNull(v2)) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
return removeAccents(v1.toLowerCase()).indexOf(removeAccents(v2.toLowerCase())) === -1;
|
|
33
|
+
case "starts":
|
|
34
|
+
case "start":
|
|
35
|
+
if (isNull(v1) || isNull(v2)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if ((typeof (v1) !== 'string')) {
|
|
39
|
+
v1 = v1.toString() || '';
|
|
40
|
+
}
|
|
41
|
+
if ((typeof (v2) !== 'string')) {
|
|
42
|
+
v2 = v2.toString() || '';
|
|
43
|
+
}
|
|
44
|
+
return v1.indexOf(v2) === 0;
|
|
45
|
+
case "startswith":
|
|
46
|
+
case "startsi":
|
|
47
|
+
case "starti":
|
|
48
|
+
case "istarts":
|
|
49
|
+
case "istart":
|
|
50
|
+
if (isNull(v1) || isNull(v2)) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return removeAccents(v1).toLowerCase().indexOf(removeAccents(v2).toLowerCase()) === 0;
|
|
54
|
+
case "endswith":
|
|
55
|
+
case "endsi":
|
|
56
|
+
case "endi":
|
|
57
|
+
case "iends":
|
|
58
|
+
case "iend":
|
|
59
|
+
if (isNull(v1) || isNull(v2)) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
return v1.lastIndexOf(v2) === v1.length - v2.length;
|
|
63
|
+
case "like":
|
|
64
|
+
if (isNull(v1) || isNull(v2)) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
return removeAccents(v1).toLowerCase() === removeAccents(v2).toLowerCase();
|
|
68
|
+
case "gt":
|
|
69
|
+
case ">": return v1 > v2;
|
|
70
|
+
case "gte":
|
|
71
|
+
case ">=": return v1 >= v2;
|
|
72
|
+
case "lt":
|
|
73
|
+
case "<": return v1 < v2;
|
|
74
|
+
case "lte":
|
|
75
|
+
case "<=": return v1 <= v2;
|
|
76
|
+
case "isnull": return v1 === null;
|
|
77
|
+
case "isnotnull": return v1 !== null;
|
|
78
|
+
case "isempty": return v1 === '';
|
|
79
|
+
case "isnotempty": return v1 !== '';
|
|
80
|
+
case '==': if (isObject(v1, v2)) {
|
|
81
|
+
return isSame(v1, v2);
|
|
82
|
+
}
|
|
83
|
+
default: return v1 == v2;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
export { compare };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { isArray } from './isArray';
|
|
2
|
+
import { each } from './each';
|
|
3
|
+
import { getProperty } from './getProperty';
|
|
4
|
+
const compareConditions = function (data, filter) {
|
|
5
|
+
if (!filter.conditions || !filter.logic || !isArray(filter.conditions)) {
|
|
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
|
+
}
|
|
8
|
+
let ok = filter.logic === 'AND' ? true : false;
|
|
9
|
+
each(filter.conditions, (a) => {
|
|
10
|
+
let compare;
|
|
11
|
+
if (a.conditions && isArray(a.conditions)) {
|
|
12
|
+
compare = compareConditions(data, a);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
compare = compare(getProperty(data, a.field), a.value, a.operator);
|
|
16
|
+
if (compare) {
|
|
17
|
+
let bits = a.field.split('.');
|
|
18
|
+
let prop = bits.pop();
|
|
19
|
+
if (bits.length) {
|
|
20
|
+
each(bits, b => data = data[b]);
|
|
21
|
+
}
|
|
22
|
+
if ((getProperty(data, prop) === undefined) && (a.value !== undefined)) {
|
|
23
|
+
compare = false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (compare) {
|
|
28
|
+
if (filter.logic === 'OR') {
|
|
29
|
+
ok = true;
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else if (filter.logic === 'AND') {
|
|
34
|
+
ok = false;
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return ok;
|
|
39
|
+
};
|
|
40
|
+
export { compareConditions };
|
package/dist/fn/copy.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isObject } from './isObject';
|
|
2
|
+
import { isFunction } from './isFunction';
|
|
3
|
+
const copy = function (st) {
|
|
4
|
+
return new Promise(resolve => {
|
|
5
|
+
if (st) {
|
|
6
|
+
if (navigator && navigator.clipboard) {
|
|
7
|
+
if (st instanceof Blob) {
|
|
8
|
+
navigator.clipboard.write([new ClipboardItem({ [st.type.toString()]: st })]).then(() => { resolve(); });
|
|
9
|
+
}
|
|
10
|
+
else if (isObject(st) && isFunction(st.toBlob)) {
|
|
11
|
+
st.toBlob(blob => { navigator.clipboard.write([new ClipboardItem({ [blob.type.toString()]: blob })]).then(() => { resolve(); }); });
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
navigator.clipboard.writeText(st);
|
|
15
|
+
resolve();
|
|
16
|
+
}
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
let input = document.createElement("textarea");
|
|
20
|
+
input.style.opacity = 0;
|
|
21
|
+
input.value = st;
|
|
22
|
+
document.body.appendChild(input);
|
|
23
|
+
input.select();
|
|
24
|
+
document.execCommand('copy');
|
|
25
|
+
document.body.removeChild(input);
|
|
26
|
+
resolve();
|
|
27
|
+
}
|
|
28
|
+
resolve();
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export { copy };
|
package/dist/fn/count.js
ADDED
package/dist/fn/crc32.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { escapeRegExp } from './escapeRegExp';
|
|
2
|
+
const cssExists = function (f) {
|
|
3
|
+
var ok, rules, css = document.styleSheets;
|
|
4
|
+
for (var sx = 0; sx < css.length; sx++) {
|
|
5
|
+
ok = 1;
|
|
6
|
+
try {
|
|
7
|
+
rules = css[sx].rules || css[sx].cssRules;
|
|
8
|
+
}
|
|
9
|
+
catch (e) {
|
|
10
|
+
ok = false;
|
|
11
|
+
if (e.name !== 'SecurityError') {
|
|
12
|
+
throw e;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (ok) {
|
|
16
|
+
for (var cx = 0; cx < rules.length; cx++) {
|
|
17
|
+
if (new RegExp("(^|\\s)" + escapeRegExp(f) + "(\\{|\\s)", "g").test(rules[cx].selectorText)) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
};
|
|
25
|
+
export { cssExists };
|
package/dist/fn/date.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isNumber } from './isNumber';
|
|
2
|
+
import { substr } from './substr';
|
|
3
|
+
import { isDate } from './isDate';
|
|
4
|
+
const date = function (v) {
|
|
5
|
+
let d = false, t = typeof (v);
|
|
6
|
+
if (v === undefined) {
|
|
7
|
+
return new Date();
|
|
8
|
+
}
|
|
9
|
+
if ((t === 'number') || (isNumber(v) && (v !== ''))) {
|
|
10
|
+
if (v < 10000000000) {
|
|
11
|
+
v = v * 1000;
|
|
12
|
+
}
|
|
13
|
+
return (new Date(v));
|
|
14
|
+
}
|
|
15
|
+
if (t === 'string') {
|
|
16
|
+
if (v.length === 10) {
|
|
17
|
+
return (new Date(parseInt(substr(v, 0, 4)), parseInt(substr(v, 5, 2)) - 1, parseInt(substr(v, 8, 2)), 12));
|
|
18
|
+
}
|
|
19
|
+
else if (v.length === 19) {
|
|
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
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else if (isDate(v)) {
|
|
24
|
+
return v;
|
|
25
|
+
}
|
|
26
|
+
return d;
|
|
27
|
+
};
|
|
28
|
+
export { date };
|