@opentinyvue/vue-renderless 3.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +16 -0
- package/action-menu/index.js +59 -0
- package/action-menu/vue.js +38 -0
- package/action-sheet/index.js +96 -0
- package/action-sheet/vue.js +66 -0
- package/alert/index.js +83 -0
- package/alert/vue.js +54 -0
- package/amount/index.js +306 -0
- package/amount/vue.js +208 -0
- package/anchor/index.js +192 -0
- package/anchor/vue.js +68 -0
- package/area/index.js +102 -0
- package/area/vue.js +32 -0
- package/async-flowchart/index.js +79 -0
- package/async-flowchart/vue.js +40 -0
- package/autocomplete/index.js +183 -0
- package/autocomplete/vue.js +151 -0
- package/autonavi-map/index.js +18 -0
- package/avatar/index.js +30 -0
- package/avatar/vue.js +22 -0
- package/badge/index.js +25 -0
- package/badge/vue.js +24 -0
- package/baidu-map/index.js +18 -0
- package/base-select/index.js +1450 -0
- package/base-select/vue.js +555 -0
- package/breadcrumb/index.js +15 -0
- package/breadcrumb/vue.js +22 -0
- package/breadcrumb-item/index.js +21 -0
- package/breadcrumb-item/vue.js +21 -0
- package/bulletin-board/index.js +25 -0
- package/bulletin-board/vue.js +30 -0
- package/button/index.js +27 -0
- package/button/vue.js +37 -0
- package/button-group/index.js +38 -0
- package/button-group/vue.js +39 -0
- package/calendar/index.js +160 -0
- package/calendar/vue.js +113 -0
- package/calendar-bar/index.js +509 -0
- package/calendar-bar/vue.js +161 -0
- package/calendar-view/index.js +606 -0
- package/calendar-view/vue.js +305 -0
- package/card/index.js +99 -0
- package/card/vue.js +72 -0
- package/card-group/vue.js +19 -0
- package/card-template/index.js +31 -0
- package/card-template/vue.js +22 -0
- package/carousel/index.js +289 -0
- package/carousel/vue.js +199 -0
- package/carousel-item/index.js +97 -0
- package/carousel-item/vue.js +74 -0
- package/cascader/index.js +546 -0
- package/cascader/vue.js +260 -0
- package/cascader-menu/index.js +42 -0
- package/cascader-menu/vue.js +26 -0
- package/cascader-mobile/index.js +316 -0
- package/cascader-mobile/vue.js +109 -0
- package/cascader-node/index.js +58 -0
- package/cascader-node/vue.js +41 -0
- package/cascader-panel/index.js +301 -0
- package/cascader-panel/node.js +136 -0
- package/cascader-panel/store.js +72 -0
- package/cascader-panel/vue.js +157 -0
- package/cascader-select/column-index.js +158 -0
- package/cascader-select/column.js +123 -0
- package/cascader-select/index.js +48 -0
- package/cascader-select/usePicker.js +252 -0
- package/cascader-select/useTouch.js +65 -0
- package/cascader-select/vue.js +64 -0
- package/cascader-view/index.js +363 -0
- package/cascader-view/vue.js +130 -0
- package/cell/vue.js +17 -0
- package/chart-bar/index.js +222 -0
- package/chart-boxplot/index.js +130 -0
- package/chart-candle/index.js +183 -0
- package/chart-core/deps/constants.js +131 -0
- package/chart-core/deps/numerify.js +244 -0
- package/chart-core/deps/utils.js +202 -0
- package/chart-core/index.js +473 -0
- package/chart-core/modules/animation.js +12 -0
- package/chart-core/modules/extend.js +48 -0
- package/chart-core/modules/mark.js +11 -0
- package/chart-core/vue.js +93 -0
- package/chart-funnel/index.js +76 -0
- package/chart-gauge/index.js +81 -0
- package/chart-graph/index.js +27 -0
- package/chart-heatmap/index.js +168 -0
- package/chart-line/index.js +166 -0
- package/chart-liquidfill/index.js +54 -0
- package/chart-map/index.js +118 -0
- package/chart-pie/index.js +146 -0
- package/chart-radar/index.js +105 -0
- package/chart-sankey/index.js +80 -0
- package/chart-scatter/index.js +173 -0
- package/chart-sunburst/index.js +28 -0
- package/chart-tree/index.js +65 -0
- package/chart-waterfall/index.js +99 -0
- package/chart-wordcloud/index.js +60 -0
- package/checkbox/index.js +147 -0
- package/checkbox/vue.js +120 -0
- package/checkbox-button/index.js +68 -0
- package/checkbox-button/vue.js +79 -0
- package/checkbox-group/index.js +7 -0
- package/checkbox-group/vue.js +29 -0
- package/chunk-G2ADBYYC.js +37 -0
- package/col/index.js +104 -0
- package/col/vue.js +25 -0
- package/collapse/index.js +36 -0
- package/collapse/vue.js +27 -0
- package/collapse-item/index.js +42 -0
- package/collapse-item/vue.js +40 -0
- package/color-picker/index.js +30 -0
- package/color-picker/utils/color.js +377 -0
- package/color-picker/utils/hsv-to-rgb.js +59 -0
- package/color-picker/vue.js +71 -0
- package/color-select-panel/alpha-select/index.js +71 -0
- package/color-select-panel/alpha-select/vue.js +43 -0
- package/color-select-panel/hue-select/index.js +57 -0
- package/color-select-panel/hue-select/vue.js +40 -0
- package/color-select-panel/index.js +243 -0
- package/color-select-panel/sv-select/index.js +68 -0
- package/color-select-panel/sv-select/vue.js +32 -0
- package/color-select-panel/utils/color.js +365 -0
- package/color-select-panel/utils/getClientXY.js +54 -0
- package/color-select-panel/utils/use-drag.js +38 -0
- package/color-select-panel/vue.js +63 -0
- package/column-list-group/index.js +0 -0
- package/column-list-group/vue.js +14 -0
- package/column-list-item/index.js +80 -0
- package/column-list-item/vue.js +55 -0
- package/common/array.js +115 -0
- package/common/bigInt.js +315 -0
- package/common/browser.js +81 -0
- package/common/calendar/calendar.js +97 -0
- package/common/dataset/index.js +99 -0
- package/common/date.js +354 -0
- package/common/decimal.js +155 -0
- package/common/deps/ResizeObserver.js +456 -0
- package/common/deps/after-leave.js +27 -0
- package/common/deps/clickoutside.js +75 -0
- package/common/deps/date-util.js +255 -0
- package/common/deps/date.js +286 -0
- package/common/deps/debounce.js +8 -0
- package/common/deps/dom.js +217 -0
- package/common/deps/eSpaceCtrl.js +304 -0
- package/common/deps/fastdom/async.js +41 -0
- package/common/deps/fastdom/index.js +9 -0
- package/common/deps/fastdom/sandbox.js +53 -0
- package/common/deps/fastdom/singleton.js +88 -0
- package/common/deps/fullscreen/apis.js +143 -0
- package/common/deps/fullscreen/screenfull.js +165 -0
- package/common/deps/infinite-scroll.js +176 -0
- package/common/deps/memorize.js +124 -0
- package/common/deps/observe-visibility.js +106 -0
- package/common/deps/popper.js +613 -0
- package/common/deps/popup-manager.js +205 -0
- package/common/deps/repeat-click.js +29 -0
- package/common/deps/resize-event.js +39 -0
- package/common/deps/scroll-into-view.js +29 -0
- package/common/deps/scrollbar-width.js +33 -0
- package/common/deps/throttle.js +45 -0
- package/common/deps/touch-emulator.js +103 -0
- package/common/deps/touch.js +37 -0
- package/common/deps/tree-model/node.js +475 -0
- package/common/deps/tree-model/tree-store.js +312 -0
- package/common/deps/tree-model/util.js +24 -0
- package/common/deps/upload-ajax.js +81 -0
- package/common/deps/useEventListener.js +54 -0
- package/common/deps/useInstanceSlots.js +22 -0
- package/common/deps/useRect.js +25 -0
- package/common/deps/useRelation.js +89 -0
- package/common/deps/useTouch.js +68 -0
- package/common/deps/useUserAgent.js +16 -0
- package/common/deps/useWindowSize.js +23 -0
- package/common/deps/vue-emitter.js +34 -0
- package/common/deps/vue-popper.js +177 -0
- package/common/deps/vue-popup.js +138 -0
- package/common/event.js +46 -0
- package/common/form/const.js +10 -0
- package/common/function.js +28 -0
- package/common/global.js +11 -0
- package/common/index.js +259 -0
- package/common/object.js +227 -0
- package/common/prop-util.js +43 -0
- package/common/runtime.js +79 -0
- package/common/string.js +417 -0
- package/common/type.js +66 -0
- package/common/validate/index.js +10 -0
- package/common/validate/messages.js +65 -0
- package/common/validate/rules/enum.js +12 -0
- package/common/validate/rules/index.js +18 -0
- package/common/validate/rules/pattern.js +20 -0
- package/common/validate/rules/range.js +52 -0
- package/common/validate/rules/required.js +11 -0
- package/common/validate/rules/type.js +100 -0
- package/common/validate/rules/whitespace.js +10 -0
- package/common/validate/schema.js +290 -0
- package/common/validate/util.js +211 -0
- package/common/validate/validations/array.js +22 -0
- package/common/validate/validations/date.js +31 -0
- package/common/validate/validations/enum.js +22 -0
- package/common/validate/validations/float.js +22 -0
- package/common/validate/validations/index.js +46 -0
- package/common/validate/validations/integer.js +22 -0
- package/common/validate/validations/method.js +21 -0
- package/common/validate/validations/number.js +25 -0
- package/common/validate/validations/pattern.js +21 -0
- package/common/validate/validations/required.js +11 -0
- package/common/validate/validations/string.js +33 -0
- package/common/validate/validations/type.js +29 -0
- package/company/index.js +41 -0
- package/company/vue.js +29 -0
- package/container/index.js +100 -0
- package/container/vue.js +47 -0
- package/country/index.js +40 -0
- package/country/vue.js +30 -0
- package/crop/index.js +170 -0
- package/crop/vue.js +183 -0
- package/currency/index.js +127 -0
- package/currency/vue.js +46 -0
- package/date-panel/index.js +485 -0
- package/date-panel/vue.js +221 -0
- package/date-picker/index.js +267 -0
- package/date-picker/vue.js +123 -0
- package/date-picker-mobile/index.js +308 -0
- package/date-picker-mobile/vue.js +111 -0
- package/date-picker-mobile/year-month.js +53 -0
- package/date-range/index.js +443 -0
- package/date-range/vue.js +195 -0
- package/date-table/index.js +362 -0
- package/date-table/vue.js +77 -0
- package/dept/index.js +230 -0
- package/dept/vue.js +102 -0
- package/dialog-box/index.js +283 -0
- package/dialog-box/vue.js +184 -0
- package/dialog-select/index.js +475 -0
- package/dialog-select/vue.js +143 -0
- package/divider/index.js +47 -0
- package/divider/vue.js +30 -0
- package/drawer/index.js +143 -0
- package/drawer/vue.js +67 -0
- package/drop-roles/index.js +54 -0
- package/drop-roles/vue.js +30 -0
- package/drop-times/index.js +22 -0
- package/drop-times/vue.js +24 -0
- package/dropdown/index.js +228 -0
- package/dropdown/vue.js +77 -0
- package/dropdown-item/index.js +138 -0
- package/dropdown-item/mf.js +76 -0
- package/dropdown-item/vue.js +116 -0
- package/dropdown-menu/index.js +178 -0
- package/dropdown-menu/vue.js +66 -0
- package/dynamic-scroller/index.js +117 -0
- package/dynamic-scroller/vue.js +88 -0
- package/dynamic-scroller-item/index.js +147 -0
- package/dynamic-scroller-item/vue.js +92 -0
- package/espace/index.js +110 -0
- package/espace/vue.js +38 -0
- package/exception/index.js +5 -0
- package/exception/vue.js +17 -0
- package/fall-menu/index.js +100 -0
- package/fall-menu/vue.js +79 -0
- package/file-upload/index.js +2208 -0
- package/file-upload/vue.js +339 -0
- package/filter/index.js +132 -0
- package/filter/tag-group.js +43 -0
- package/filter/vue.js +71 -0
- package/filter-bar/index.js +9 -0
- package/filter-bar/vue.js +16 -0
- package/filter-box/index.js +18 -0
- package/filter-box/vue.js +22 -0
- package/filter-panel/index.js +42 -0
- package/filter-panel/vue.js +33 -0
- package/float-button/index.js +42 -0
- package/float-button/vue.js +101 -0
- package/floatbar/index.js +13 -0
- package/floatbar/vue.js +14 -0
- package/floating-button/index.js +119 -0
- package/floating-button/vue.js +53 -0
- package/flowchart/index.js +1252 -0
- package/flowchart/node.js +61 -0
- package/flowchart/vue.js +109 -0
- package/fluent-editor/index.js +702 -0
- package/fluent-editor/options.js +300 -0
- package/fluent-editor/vue.js +192 -0
- package/form/index.js +209 -0
- package/form/vue.js +104 -0
- package/form-item/index.js +403 -0
- package/form-item/vue.js +166 -0
- package/fullscreen/index.js +113 -0
- package/fullscreen/vue.js +65 -0
- package/grid/core/index.js +7 -0
- package/grid/core/interceptor.js +43 -0
- package/grid/core/storeMap.js +23 -0
- package/grid/plugins/export.js +141 -0
- package/grid/plugins/exportExcel.js +502 -0
- package/grid/plugins/header.js +59 -0
- package/grid/plugins/resize.js +65 -0
- package/grid/static/array/arrayEach.js +16 -0
- package/grid/static/array/arrayIndexOf.js +15 -0
- package/grid/static/array/eachTree.js +28 -0
- package/grid/static/array/every.js +6 -0
- package/grid/static/array/filterTree.js +21 -0
- package/grid/static/array/find.js +7 -0
- package/grid/static/array/findTree.js +35 -0
- package/grid/static/array/helperCreateIterateHandle.js +51 -0
- package/grid/static/array/helperCreateTreeFunc.js +20 -0
- package/grid/static/array/includes.js +7 -0
- package/grid/static/array/lastArrayEach.js +10 -0
- package/grid/static/array/map.js +24 -0
- package/grid/static/array/mapTree.js +29 -0
- package/grid/static/array/slice.js +14 -0
- package/grid/static/array/sortBy.js +67 -0
- package/grid/static/array/sum.js +29 -0
- package/grid/static/array/toArray.js +7 -0
- package/grid/static/array/toTreeArray.js +22 -0
- package/grid/static/base/clear.js +48 -0
- package/grid/static/base/clone.js +12 -0
- package/grid/static/base/destructuring.js +22 -0
- package/grid/static/base/each.js +13 -0
- package/grid/static/base/eqNull.js +8 -0
- package/grid/static/base/findIndexOf.js +14 -0
- package/grid/static/base/get.js +46 -0
- package/grid/static/base/has.js +61 -0
- package/grid/static/base/hasOwnProp.js +6 -0
- package/grid/static/base/helperCreateGetObjects.js +30 -0
- package/grid/static/base/helperCreateInInObjectString.js +11 -0
- package/grid/static/base/helperCreateInTypeof.js +9 -0
- package/grid/static/base/helperCreateIndexOf.js +22 -0
- package/grid/static/base/helperCreateiterateIndexOf.js +22 -0
- package/grid/static/base/helperDefaultCompare.js +8 -0
- package/grid/static/base/helperDeleteProperty.js +12 -0
- package/grid/static/base/helperEqualCompare.js +58 -0
- package/grid/static/base/helperGetHGSKeys.js +9 -0
- package/grid/static/base/indexOf.js +7 -0
- package/grid/static/base/isArray.js +7 -0
- package/grid/static/base/isBoolean.js +6 -0
- package/grid/static/base/isDate.js +7 -0
- package/grid/static/base/isEmpty.js +12 -0
- package/grid/static/base/isEqual.js +11 -0
- package/grid/static/base/isFunction.js +6 -0
- package/grid/static/base/isNaN.js +7 -0
- package/grid/static/base/isNull.js +6 -0
- package/grid/static/base/isNumber.js +6 -0
- package/grid/static/base/isObject.js +6 -0
- package/grid/static/base/isPlainObject.js +6 -0
- package/grid/static/base/isRegExp.js +7 -0
- package/grid/static/base/isSet.js +7 -0
- package/grid/static/base/isString.js +6 -0
- package/grid/static/base/isUndefined.js +6 -0
- package/grid/static/base/keys.js +7 -0
- package/grid/static/base/lastEach.js +13 -0
- package/grid/static/base/remove.js +44 -0
- package/grid/static/base/set.js +47 -0
- package/grid/static/base/toJSONString.js +6 -0
- package/grid/static/base/toStringJSON.js +18 -0
- package/grid/static/base/uniqueId.js +7 -0
- package/grid/static/browse/browse.js +57 -0
- package/grid/static/function/property.js +7 -0
- package/grid/static/function/throttle.js +47 -0
- package/grid/static/index.js +111 -0
- package/grid/static/number/helperCreateToNumber.js +14 -0
- package/grid/static/number/toNumber.js +7 -0
- package/grid/static/object/assign.js +41 -0
- package/grid/static/object/extend.js +7 -0
- package/grid/static/object/lastObjectEach.js +12 -0
- package/grid/static/object/objectEach.js +15 -0
- package/grid/static/object/objectMap.js +24 -0
- package/grid/static/object/values.js +17 -0
- package/grid/static/static/staticDocument.js +7 -0
- package/grid/static/static/staticHGKeyRE.js +6 -0
- package/grid/static/static/staticParseInt.js +6 -0
- package/grid/static/static/staticStrUndefined.js +6 -0
- package/grid/static/static/staticWindow.js +7 -0
- package/grid/static/string/template.js +14 -0
- package/grid/static/string/toString.js +16 -0
- package/grid/utils/column.js +73 -0
- package/grid/utils/common.js +136 -0
- package/grid/utils/dom.js +224 -0
- package/grid/utils/event.js +40 -0
- package/grid/utils/index.js +8 -0
- package/grid-select/index.js +82 -0
- package/grid-select/vue.js +30 -0
- package/guide/index.js +185 -0
- package/guide/vue.js +38 -0
- package/hrapprover/index.js +95 -0
- package/hrapprover/vue.js +57 -0
- package/image/index.js +135 -0
- package/image/vue.js +111 -0
- package/image-viewer/index.js +681 -0
- package/image-viewer/vue.js +237 -0
- package/index-bar/index.js +66 -0
- package/index-bar/vue.js +73 -0
- package/index-bar-anchor/vue.js +16 -0
- package/input/index.js +413 -0
- package/input/vue.js +353 -0
- package/ip-address/index.js +271 -0
- package/ip-address/vue.js +143 -0
- package/label/index.js +56 -0
- package/label/vue.js +26 -0
- package/layout/vue.js +7 -0
- package/link/index.js +9 -0
- package/link/vue.js +20 -0
- package/link-menu/index.js +104 -0
- package/link-menu/vue.js +95 -0
- package/list/index.js +13 -0
- package/list/vue.js +17 -0
- package/load-list/index.js +43 -0
- package/load-list/vue.js +69 -0
- package/loading/index.js +30 -0
- package/loading/vue.js +32 -0
- package/locales/index.js +82 -0
- package/locales/vue.js +28 -0
- package/logon-user/index.js +20 -0
- package/logon-user/vue.js +19 -0
- package/logout/index.js +84 -0
- package/logout/vue.js +18 -0
- package/mask/index.js +13 -0
- package/mask/vue.js +18 -0
- package/menu/index.js +140 -0
- package/menu/vue.js +99 -0
- package/menu-node/index.js +12 -0
- package/menu-node/vue.js +42 -0
- package/milestone/index.js +123 -0
- package/milestone/vue.js +46 -0
- package/mind-map/index.js +47 -0
- package/mind-map/vue.js +53 -0
- package/mini-picker/index.js +165 -0
- package/mini-picker/vue.js +122 -0
- package/modal/index.js +716 -0
- package/modal/vue.js +122 -0
- package/month-range/index.js +134 -0
- package/month-range/vue.js +88 -0
- package/month-table/index.js +194 -0
- package/month-table/vue.js +50 -0
- package/multi-select/index.js +394 -0
- package/multi-select/vue.js +113 -0
- package/multi-select-item/index.js +23 -0
- package/multi-select-item/vue.js +31 -0
- package/nav-menu/index.js +508 -0
- package/nav-menu/vue.js +153 -0
- package/notify/index.js +69 -0
- package/notify/vue.js +63 -0
- package/numeric/index.js +397 -0
- package/numeric/vue.js +153 -0
- package/option/index.js +67 -0
- package/option/vue.js +132 -0
- package/option-group/index.js +28 -0
- package/option-group/vue.js +45 -0
- package/package.json +41 -0
- package/pager/index.js +409 -0
- package/pager/vue.js +155 -0
- package/pager-item/index.js +107 -0
- package/pager-item/vue.js +44 -0
- package/panel/index.js +24 -0
- package/panel/vue.js +20 -0
- package/picker/index.js +1119 -0
- package/picker/mb.js +47 -0
- package/picker/timezone.js +1174 -0
- package/picker/vue.js +291 -0
- package/picker-column/index.js +215 -0
- package/picker-column/vue.js +104 -0
- package/pop-upload/index.js +174 -0
- package/pop-upload/vue.js +165 -0
- package/popconfirm/index.js +38 -0
- package/popconfirm/vue.js +35 -0
- package/popeditor/index.js +709 -0
- package/popeditor/vue.js +223 -0
- package/popover/index.js +207 -0
- package/popover/vue.js +165 -0
- package/popup/index.js +101 -0
- package/popup/vue.js +69 -0
- package/progress/index.js +151 -0
- package/progress/vue.js +87 -0
- package/pull-refresh/index.js +123 -0
- package/pull-refresh/vue.js +76 -0
- package/pull-refresh-mobile-first/index.js +243 -0
- package/pull-refresh-mobile-first/vue.js +116 -0
- package/qr-code/index.js +54 -0
- package/qr-code/vue.js +31 -0
- package/quarter-panel/index.js +61 -0
- package/quarter-panel/vue.js +46 -0
- package/query-builder/index.js +9 -0
- package/query-builder/vue.js +18 -0
- package/radio/index.js +74 -0
- package/radio/vue.js +56 -0
- package/radio-button/index.js +61 -0
- package/radio-button/vue.js +60 -0
- package/radio-group/index.js +49 -0
- package/radio-group/vue.js +34 -0
- package/rate/index.js +223 -0
- package/rate/vue.js +131 -0
- package/record/index.js +300 -0
- package/record/vue.js +61 -0
- package/recycle-scroller/index.js +486 -0
- package/recycle-scroller/vue.js +141 -0
- package/rich-text/clipboard.js +54 -0
- package/rich-text/index.js +205 -0
- package/rich-text/module/file-upload.js +107 -0
- package/rich-text/module/image-drop.js +63 -0
- package/rich-text/module/image-upload.js +89 -0
- package/rich-text/options.js +141 -0
- package/rich-text/table-module.js +383 -0
- package/rich-text/vue.js +104 -0
- package/rich-text-editor/index.js +234 -0
- package/rich-text-editor/vue.js +297 -0
- package/river/index.js +371 -0
- package/river/river.js +352 -0
- package/river/vue.js +77 -0
- package/roles/index.js +58 -0
- package/roles/vue.js +27 -0
- package/row/index.js +18 -0
- package/row/vue.js +25 -0
- package/scroll-text/index.js +19 -0
- package/scroll-text/vue.js +22 -0
- package/scrollbar/index.js +99 -0
- package/scrollbar/vue-bar.js +42 -0
- package/scrollbar/vue.js +35 -0
- package/search/index.js +97 -0
- package/search/vue.js +99 -0
- package/select/index.js +1847 -0
- package/select/vue.js +642 -0
- package/select-dropdown/index.js +76 -0
- package/select-dropdown/vue.js +146 -0
- package/select-mobile/index.js +124 -0
- package/select-mobile/vue.js +67 -0
- package/select-view/index.js +156 -0
- package/select-view/vue.js +79 -0
- package/selected-box/index.js +220 -0
- package/selected-box/vue.js +102 -0
- package/signature/index.js +241 -0
- package/signature/vue.js +88 -0
- package/skeleton/index.js +14 -0
- package/skeleton/vue.js +15 -0
- package/skeleton-item/vue.js +15 -0
- package/slider/index.js +527 -0
- package/slider/vue.js +200 -0
- package/slider-button/index.js +50 -0
- package/slider-button/vue.js +41 -0
- package/slider-button-group/index.js +52 -0
- package/slider-button-group/slide-button.js +142 -0
- package/slider-button-group/vue.js +71 -0
- package/split/index.js +135 -0
- package/split/vue.js +95 -0
- package/standard-list-item/index.js +38 -0
- package/standard-list-item/vue.js +24 -0
- package/statistic/index.js +32 -0
- package/statistic/vue.js +20 -0
- package/steps/index.js +61 -0
- package/steps/slide-bar.js +129 -0
- package/steps/vue.js +35 -0
- package/sticky/index.js +89 -0
- package/sticky/vue.js +74 -0
- package/switch/index.js +36 -0
- package/switch/vue.js +42 -0
- package/tab-bar/index.js +57 -0
- package/tab-bar/vue.js +19 -0
- package/tab-dropdown/index.js +12 -0
- package/tab-dropdown/vue.js +20 -0
- package/tab-item/index.js +22 -0
- package/tab-item/vue.js +30 -0
- package/tab-item-mf/index.js +0 -0
- package/tab-item-mf/vue.js +27 -0
- package/tab-nav/index.js +348 -0
- package/tab-nav/vue.js +105 -0
- package/tabbar/index.js +61 -0
- package/tabbar/vue.js +62 -0
- package/tabbar-item/index.js +48 -0
- package/tabbar-item/vue.js +34 -0
- package/table/index.js +77 -0
- package/table/vue.js +42 -0
- package/tabs/index.js +213 -0
- package/tabs/vue.js +116 -0
- package/tabs-mf/index.js +286 -0
- package/tabs-mf/vue-bar.js +50 -0
- package/tabs-mf/vue-nav-item.js +23 -0
- package/tabs-mf/vue-nav.js +44 -0
- package/tabs-mf/vue-swipe.js +20 -0
- package/tabs-mf/vue.js +100 -0
- package/tabs-mf/wheel.js +77 -0
- package/tag/index.js +20 -0
- package/tag/vue.js +24 -0
- package/tag-group/index.js +38 -0
- package/tag-group/vue.js +36 -0
- package/tall-storage/index.js +141 -0
- package/tall-storage/vue-storage-box.js +19 -0
- package/tall-storage/vue.js +30 -0
- package/text-popup/index.js +55 -0
- package/text-popup/vue.js +32 -0
- package/time/index.js +89 -0
- package/time/vue.js +87 -0
- package/time-line/index.js +91 -0
- package/time-line/vue.js +52 -0
- package/time-line-new/index.js +53 -0
- package/time-line-new/vue.js +41 -0
- package/time-panel/index.js +133 -0
- package/time-panel/scrollIntoView.js +25 -0
- package/time-panel/vue.js +82 -0
- package/time-picker-mobile/index.js +58 -0
- package/time-picker-mobile/vue.js +42 -0
- package/time-range/index.js +147 -0
- package/time-range/vue.js +90 -0
- package/time-spinner/index.js +221 -0
- package/time-spinner/vue.js +111 -0
- package/timeline-item/index.js +92 -0
- package/timeline-item/vue.js +55 -0
- package/toast/index.js +7 -0
- package/toast/vue.js +19 -0
- package/toggle-menu/index.js +85 -0
- package/toggle-menu/vue.js +86 -0
- package/tooltip/index.js +175 -0
- package/tooltip/vue.js +123 -0
- package/top-box/index.js +48 -0
- package/top-box/vue.js +61 -0
- package/transfer/index.js +219 -0
- package/transfer/vue.js +64 -0
- package/transfer-panel/index.js +275 -0
- package/transfer-panel/vue.js +152 -0
- package/tree/index.js +796 -0
- package/tree/vue.js +288 -0
- package/tree-menu/index.js +170 -0
- package/tree-menu/vue.js +117 -0
- package/tree-node/index.js +279 -0
- package/tree-node/vue.js +150 -0
- package/tree-select/index.js +118 -0
- package/tree-select/vue.js +35 -0
- package/types/action-menu.type.d.ts +129 -0
- package/types/action-sheet.type.d.ts +119 -0
- package/types/alert.type.d.ts +134 -0
- package/types/amount.type.d.ts +169 -0
- package/types/anchor.type.d.ts +91 -0
- package/types/area.type.d.ts +135 -0
- package/types/async-flowchart.type.d.ts +72 -0
- package/types/autocomplete.type.d.ts +204 -0
- package/types/autonavi-map.type.d.ts +2 -0
- package/types/avatar.type.d.ts +2 -0
- package/types/badge.type.d.ts +84 -0
- package/types/baidu-map.type.d.ts +2 -0
- package/types/breadcrumb-item.type.d.ts +33 -0
- package/types/breadcrumb.type.d.ts +59 -0
- package/types/bulletin-board.type.d.ts +2 -0
- package/types/button-group.type.d.ts +90 -0
- package/types/button.type.d.ts +120 -0
- package/types/calendar-bar.type.d.ts +2 -0
- package/types/calendar.type.d.ts +2 -0
- package/types/card-group.type.d.ts +2 -0
- package/types/card-template.type.d.ts +2 -0
- package/types/card.type.d.ts +2 -0
- package/types/carousel-item.type.d.ts +2 -0
- package/types/carousel.type.d.ts +2 -0
- package/types/cascader-menu.type.d.ts +48 -0
- package/types/cascader-mobile.type.d.ts +2 -0
- package/types/cascader-node.type.d.ts +56 -0
- package/types/cascader-panel.type-8f58e628.d.ts +241 -0
- package/types/cascader-panel.type.d.ts +3 -0
- package/types/cascader-select.type.d.ts +2 -0
- package/types/cascader.type.d.ts +330 -0
- package/types/cell.type.d.ts +2 -0
- package/types/chart-bar.type.d.ts +2 -0
- package/types/chart-boxplot.type.d.ts +2 -0
- package/types/chart-candle.type.d.ts +2 -0
- package/types/chart-core.type.d.ts +2 -0
- package/types/chart-funnel.type.d.ts +2 -0
- package/types/chart-gauge.type.d.ts +2 -0
- package/types/chart-graph.type.d.ts +2 -0
- package/types/chart-heatmap.type.d.ts +2 -0
- package/types/chart-line.type.d.ts +2 -0
- package/types/chart-liquidfill.type.d.ts +2 -0
- package/types/chart-map.type.d.ts +2 -0
- package/types/chart-pie.type.d.ts +2 -0
- package/types/chart-radar.type.d.ts +2 -0
- package/types/chart-sankey.type.d.ts +2 -0
- package/types/chart-scatter.type.d.ts +2 -0
- package/types/chart-sunburst.type.d.ts +2 -0
- package/types/chart-tree.type.d.ts +2 -0
- package/types/chart-waterfall.type.d.ts +2 -0
- package/types/chart-wordcloud.type.d.ts +2 -0
- package/types/checkbox-button.type.d.ts +2 -0
- package/types/checkbox-group.type.d.ts +2 -0
- package/types/checkbox.type.d.ts +169 -0
- package/types/col.type.d.ts +2 -0
- package/types/collapse-item.type.d.ts +63 -0
- package/types/collapse.type.d.ts +73 -0
- package/types/color-picker.type.d.ts +5 -0
- package/types/color-select-panel.type.d.ts +27 -0
- package/types/column-list-group.type.d.ts +2 -0
- package/types/column-list-item.type.d.ts +2 -0
- package/types/common.type.d.ts +2 -0
- package/types/company.type.d.ts +2 -0
- package/types/container.type.d.ts +2 -0
- package/types/country.type.d.ts +2 -0
- package/types/credit-card-form.type.d.ts +2 -0
- package/types/credit-card.type.d.ts +2 -0
- package/types/crop.type.d.ts +2 -0
- package/types/currency.type.d.ts +2 -0
- package/types/date-panel.type.d.ts +2 -0
- package/types/date-picker-mobile.type.d.ts +2 -0
- package/types/date-picker.type.d.ts +256 -0
- package/types/date-range.type.d.ts +2 -0
- package/types/date-table.type.d.ts +151 -0
- package/types/dept.type.d.ts +2 -0
- package/types/detail-page.type.d.ts +2 -0
- package/types/dialog-box.type.d.ts +270 -0
- package/types/dialog-select.type.d.ts +2 -0
- package/types/divider.type.d.ts +94 -0
- package/types/drawer.type.d.ts +146 -0
- package/types/drop-roles.type.d.ts +2 -0
- package/types/drop-times.type.d.ts +2 -0
- package/types/dropdown-item.type-c9badbc1.d.ts +336 -0
- package/types/dropdown-item.type.d.ts +4 -0
- package/types/dropdown-menu.type.d.ts +4 -0
- package/types/dropdown.type.d.ts +145 -0
- package/types/dynamic-scroller-item.type.d.ts +2 -0
- package/types/dynamic-scroller.type.d.ts +2 -0
- package/types/espace.type.d.ts +2 -0
- package/types/exception.type.d.ts +2 -0
- package/types/fall-menu.type.d.ts +96 -0
- package/types/file-upload.type.d.ts +3 -0
- package/types/filter-bar.type.d.ts +2 -0
- package/types/filter-box.type.d.ts +2 -0
- package/types/filter-panel.type.d.ts +2 -0
- package/types/filter.type.d.ts +2 -0
- package/types/float-button.type.d.ts +123 -0
- package/types/floatbar.type.d.ts +45 -0
- package/types/floating-button.type.d.ts +2 -0
- package/types/flowchart.type.d.ts +2 -0
- package/types/form-item.type.d.ts +3 -0
- package/types/form.type-4e0ec0a1.d.ts +421 -0
- package/types/form.type.d.ts +3 -0
- package/types/fullscreen.type.d.ts +2 -0
- package/types/grid.type.d.ts +2 -0
- package/types/guide.type.d.ts +2 -0
- package/types/hrapprover.type.d.ts +2 -0
- package/types/image-viewer.type.d.ts +2 -0
- package/types/image.type.d.ts +184 -0
- package/types/index-a975a7a2.d.ts +54 -0
- package/types/index-bar-anchor.type.d.ts +2 -0
- package/types/index-bar.type.d.ts +2 -0
- package/types/input.type.d.ts +330 -0
- package/types/ip-address.type.d.ts +156 -0
- package/types/label.type.d.ts +81 -0
- package/types/layout.type.d.ts +2 -0
- package/types/link-menu.type.d.ts +2 -0
- package/types/link.type.d.ts +48 -0
- package/types/list.type.d.ts +2 -0
- package/types/load-list.type.d.ts +58 -0
- package/types/loading.type.d.ts +97 -0
- package/types/locales.type.d.ts +2 -0
- package/types/logon-user.type.d.ts +2 -0
- package/types/logout.type.d.ts +2 -0
- package/types/milestone.type.d.ts +170 -0
- package/types/mind-map.type.d.ts +20 -0
- package/types/mini-picker.type.d.ts +2 -0
- package/types/modal.type.d.ts +292 -0
- package/types/month-range.type.d.ts +2 -0
- package/types/month-table.type.d.ts +2 -0
- package/types/multi-select.type.d.ts +2 -0
- package/types/nav-menu.type.d.ts +125 -0
- package/types/notify.type.d.ts +2 -0
- package/types/numeric.type.d.ts +312 -0
- package/types/option-group.type.d.ts +2 -0
- package/types/option.type.d.ts +2 -0
- package/types/pager-item.type.d.ts +2 -0
- package/types/pager.type.d.ts +180 -0
- package/types/panel.type.d.ts +2 -0
- package/types/picker-column.type.d.ts +2 -0
- package/types/picker.type.d.ts +216 -0
- package/types/pop-upload.type.d.ts +2 -0
- package/types/popconfirm.type.d.ts +95 -0
- package/types/popeditor.type.d.ts +279 -0
- package/types/popover.type.d.ts +164 -0
- package/types/popup.type.d.ts +2 -0
- package/types/progress.type.d.ts +218 -0
- package/types/pull-refresh.type.d.ts +2 -0
- package/types/query-builder.type.d.ts +2 -0
- package/types/radio-button.type.d.ts +90 -0
- package/types/radio-group.type.d.ts +71 -0
- package/types/radio.type.d.ts +99 -0
- package/types/rate.type.d.ts +237 -0
- package/types/record.type.d.ts +2 -0
- package/types/recycle-scroller.type.d.ts +2 -0
- package/types/river.type.d.ts +2 -0
- package/types/roles.type.d.ts +2 -0
- package/types/row.type.d.ts +2 -0
- package/types/scroll-text.type.d.ts +2 -0
- package/types/scrollbar.type.d.ts +2 -0
- package/types/search.type.d.ts +129 -0
- package/types/select-dropdown.type.d.ts +2 -0
- package/types/select-mobile.type.d.ts +2 -0
- package/types/select-view.type.d.ts +2 -0
- package/types/select.type.d.ts +2 -0
- package/types/selected-box.type.d.ts +2 -0
- package/types/shared.type.d.ts +178 -0
- package/types/skeleton-item.type.d.ts +38 -0
- package/types/skeleton.type.d.ts +45 -0
- package/types/slide-bar.type.d.ts +2 -0
- package/types/slider-button-group.type.d.ts +2 -0
- package/types/slider-button.type.d.ts +2 -0
- package/types/slider.type.d.ts +246 -0
- package/types/split.type.d.ts +2 -0
- package/types/standard-list-item.type.d.ts +2 -0
- package/types/statistic.type.d.ts +52 -0
- package/types/steps.type.d.ts +95 -0
- package/types/switch.type.d.ts +117 -0
- package/types/tab-bar.type.d.ts +43 -0
- package/types/tab-dropdown.type.d.ts +2 -0
- package/types/tab-item-mf.type.d.ts +2 -0
- package/types/tab-item.type.d.ts +70 -0
- package/types/tab-nav.type.d.ts +112 -0
- package/types/tabbar-item.type.d.ts +2 -0
- package/types/tabbar.type.d.ts +2 -0
- package/types/table.type.d.ts +2 -0
- package/types/tabs-mf.type.d.ts +2 -0
- package/types/tabs.type.d.ts +161 -0
- package/types/tag-group.type.d.ts +65 -0
- package/types/tag.type.d.ts +67 -0
- package/types/tall-storage.type.d.ts +2 -0
- package/types/text-popup.type.d.ts +2 -0
- package/types/time-line.type-9fb16096.d.ts +327 -0
- package/types/time-line.type.d.ts +4 -0
- package/types/time-panel.type.d.ts +2 -0
- package/types/time-picker-mobile.type.d.ts +2 -0
- package/types/time-range.type.d.ts +2 -0
- package/types/time-spinner.type.d.ts +2 -0
- package/types/time.type.d.ts +2 -0
- package/types/timeline-item.type.d.ts +4 -0
- package/types/toast.type.d.ts +63 -0
- package/types/toggle-menu.type.d.ts +2 -0
- package/types/tooltip.type.d.ts +185 -0
- package/types/top-box.type.d.ts +2 -0
- package/types/transfer-panel.type.d.ts +2 -0
- package/types/transfer.type.d.ts +186 -0
- package/types/tree-menu.type.d.ts +242 -0
- package/types/tree-node.type.d.ts +2 -0
- package/types/tree.type.d.ts +2 -0
- package/types/upload-dragger.type.d.ts +50 -0
- package/types/upload-list.type-eaf82b7a.d.ts +1213 -0
- package/types/upload-list.type.d.ts +3 -0
- package/types/upload.type.d.ts +3 -0
- package/types/user-account.type.d.ts +2 -0
- package/types/user-contact.type.d.ts +128 -0
- package/types/user-head-group.type.d.ts +2 -0
- package/types/user-head.type.d.ts +151 -0
- package/types/user-link.type.d.ts +2 -0
- package/types/user.type.d.ts +2 -0
- package/types/watermark.type.d.ts +33 -0
- package/types/wheel.type.d.ts +2 -0
- package/types/wizard.type.d.ts +96 -0
- package/types/year-range.type.d.ts +2 -0
- package/types/year-table.type.d.ts +2 -0
- package/upload/index.js +405 -0
- package/upload/vue.js +81 -0
- package/upload-dragger/index.js +72 -0
- package/upload-dragger/vue.js +26 -0
- package/upload-list/index.js +256 -0
- package/upload-list/vue.js +128 -0
- package/user/index.js +532 -0
- package/user/vue.js +76 -0
- package/user-account/index.js +18 -0
- package/user-account/vue.js +22 -0
- package/user-contact/index.js +57 -0
- package/user-contact/vue.js +29 -0
- package/user-head/index.js +73 -0
- package/user-head/vue.js +39 -0
- package/user-head-group/index.js +20 -0
- package/user-head-group/vue.js +30 -0
- package/user-link/index.js +42 -0
- package/user-link/vue.js +42 -0
- package/virtual-scroll-box/index.js +294 -0
- package/virtual-scroll-box/vue.js +43 -0
- package/virtual-tree/index.js +168 -0
- package/virtual-tree/vue.js +53 -0
- package/watermark/index.js +213 -0
- package/watermark/vue.js +27 -0
- package/wheel/index.js +165 -0
- package/wheel/vue.js +79 -0
- package/wizard/index.js +107 -0
- package/wizard/vue.js +48 -0
- package/year-range/index.js +125 -0
- package/year-range/vue.js +88 -0
- package/year-table/index.js +185 -0
- package/year-table/vue.js +43 -0
package/common/array.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadValues
|
|
3
|
+
} from "../chunk-G2ADBYYC.js";
|
|
4
|
+
import { SORT } from "./index";
|
|
5
|
+
import { isSame } from "./type";
|
|
6
|
+
import { getObj } from "./object";
|
|
7
|
+
const indexOf = (arr, data, predicate = isSame) => {
|
|
8
|
+
if (Array.isArray(arr) && typeof predicate === "function") {
|
|
9
|
+
for (let i = 0, len = arr.length; i < len; i++) {
|
|
10
|
+
if (predicate(arr[i], data)) {
|
|
11
|
+
return i;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return -1;
|
|
16
|
+
};
|
|
17
|
+
const find = (arr, predicate) => {
|
|
18
|
+
const index = indexOf(arr, void 0, predicate);
|
|
19
|
+
return index !== -1 ? arr[index] : void 0;
|
|
20
|
+
};
|
|
21
|
+
const remove = (arr, data, count = 1) => {
|
|
22
|
+
if (Array.isArray(arr) && arr.length) {
|
|
23
|
+
const index = indexOf(arr, data);
|
|
24
|
+
if (index > -1) {
|
|
25
|
+
arr.splice(index, count);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return arr;
|
|
29
|
+
};
|
|
30
|
+
const sort = (arr, field, sort2 = SORT.Asc) => {
|
|
31
|
+
if (Array.isArray(arr) && arr.length > 1) {
|
|
32
|
+
arr.sort((x, y) => {
|
|
33
|
+
const compare = sort2 === SORT.Asc ? [1, -1] : [-1, 1];
|
|
34
|
+
const xField = getObj(x, field);
|
|
35
|
+
const yField = getObj(y, field);
|
|
36
|
+
if (isNaN(xField)) {
|
|
37
|
+
return sort2 === SORT.Asc ? 1 : -1;
|
|
38
|
+
} else if (isNaN(yField)) {
|
|
39
|
+
return -1;
|
|
40
|
+
}
|
|
41
|
+
return xField > yField ? compare[0] : compare[1];
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return arr;
|
|
45
|
+
};
|
|
46
|
+
const push = (arr, data) => {
|
|
47
|
+
if (Array.isArray(arr) && !arr.some((value) => isSame(value, data))) {
|
|
48
|
+
arr.push(data);
|
|
49
|
+
}
|
|
50
|
+
return arr;
|
|
51
|
+
};
|
|
52
|
+
const unique = (arr) => {
|
|
53
|
+
if (Array.isArray(arr)) {
|
|
54
|
+
const array = [];
|
|
55
|
+
for (let i = 0, len = arr.length; i < len; i++) {
|
|
56
|
+
const value = arr[i];
|
|
57
|
+
if (indexOf(array, value) === -1) {
|
|
58
|
+
array.push(value);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return array;
|
|
62
|
+
}
|
|
63
|
+
return arr;
|
|
64
|
+
};
|
|
65
|
+
const extend = (to, _from) => {
|
|
66
|
+
Object.keys(_from).forEach((key) => to[key] = _from[key]);
|
|
67
|
+
return to;
|
|
68
|
+
};
|
|
69
|
+
const toObject = (arr) => {
|
|
70
|
+
const res = {};
|
|
71
|
+
for (let i = 0; i < arr.length; i++) {
|
|
72
|
+
if (arr[i]) {
|
|
73
|
+
extend(res, arr[i]);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return res;
|
|
77
|
+
};
|
|
78
|
+
const transformPidToChildren = (data, pidName = "pId", childrenName = "children", idName = "id") => {
|
|
79
|
+
const result = [];
|
|
80
|
+
Array.isArray(data) && data.forEach((item) => {
|
|
81
|
+
if (item[pidName] == "0") {
|
|
82
|
+
result.push(item);
|
|
83
|
+
} else {
|
|
84
|
+
const parent = find(data, (i) => i[idName] == item[pidName]);
|
|
85
|
+
if (!parent) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (!parent[childrenName]) {
|
|
89
|
+
parent[childrenName] = [];
|
|
90
|
+
}
|
|
91
|
+
parent[childrenName].push(item);
|
|
92
|
+
}
|
|
93
|
+
delete item[pidName];
|
|
94
|
+
});
|
|
95
|
+
return result;
|
|
96
|
+
};
|
|
97
|
+
const transformTreeData = (data, key = "id", parentKey = "pId") => {
|
|
98
|
+
if (!Array.isArray(data)) {
|
|
99
|
+
data = [data];
|
|
100
|
+
}
|
|
101
|
+
data = data.map((item) => __spreadValues({}, item));
|
|
102
|
+
const treeData = transformPidToChildren(data, parentKey, "children", key);
|
|
103
|
+
return treeData;
|
|
104
|
+
};
|
|
105
|
+
export {
|
|
106
|
+
find,
|
|
107
|
+
indexOf,
|
|
108
|
+
push,
|
|
109
|
+
remove,
|
|
110
|
+
sort,
|
|
111
|
+
toObject,
|
|
112
|
+
transformPidToChildren,
|
|
113
|
+
transformTreeData,
|
|
114
|
+
unique
|
|
115
|
+
};
|
package/common/bigInt.js
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { fillChar } from "./string";
|
|
3
|
+
import { isBrowser } from "./browser";
|
|
4
|
+
const BigInt = isBrowser ? window.BigInt : global.BigInt;
|
|
5
|
+
function supportBigInt() {
|
|
6
|
+
return typeof BigInt === "function";
|
|
7
|
+
}
|
|
8
|
+
function trimNumber(numStr) {
|
|
9
|
+
let string = numStr.toString().trim();
|
|
10
|
+
let negative = string.startsWith("-");
|
|
11
|
+
if (negative) {
|
|
12
|
+
string = string.slice(1);
|
|
13
|
+
}
|
|
14
|
+
string = string.replace(/(\.\d*[^0])0*$/, "$1").replace(/\.0*$/, "").replace(/^0+/, "");
|
|
15
|
+
if (string.startsWith(".")) {
|
|
16
|
+
string = "0".concat(string);
|
|
17
|
+
}
|
|
18
|
+
let trimStr = string || "0";
|
|
19
|
+
let splitNumber = trimStr.split(".");
|
|
20
|
+
let integerStr = splitNumber[0] || "0";
|
|
21
|
+
let decimalStr = splitNumber[1] || "0";
|
|
22
|
+
if (integerStr === "0" && decimalStr === "0") {
|
|
23
|
+
negative = false;
|
|
24
|
+
}
|
|
25
|
+
let negativeStr = negative ? "-" : "";
|
|
26
|
+
return {
|
|
27
|
+
negative,
|
|
28
|
+
negativeStr,
|
|
29
|
+
trimStr,
|
|
30
|
+
integerStr,
|
|
31
|
+
decimalStr,
|
|
32
|
+
fullStr: "".concat(negativeStr).concat(trimStr)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function isE(number) {
|
|
36
|
+
let str = String(number);
|
|
37
|
+
return !isNaN(Number(str)) && ~str.indexOf("e");
|
|
38
|
+
}
|
|
39
|
+
function validateNumber(num) {
|
|
40
|
+
if (typeof num === "number") {
|
|
41
|
+
return !isNaN(num);
|
|
42
|
+
}
|
|
43
|
+
if (!num) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return (
|
|
47
|
+
// Normal type: 11.28
|
|
48
|
+
/^\s*-?\d+(\.\d+)?\s*$/.test(num) || // Pre-number: 1.
|
|
49
|
+
/^\s*-?\d+\.\s*$/.test(num) || // Post-number: .1
|
|
50
|
+
/^\s*-?\.\d+\s*$/.test(num)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function getNumberPrecision(number) {
|
|
54
|
+
let numStr = String(number);
|
|
55
|
+
if (isE(number)) {
|
|
56
|
+
let precision = Number(numStr.slice(numStr.indexOf("e-") + 2));
|
|
57
|
+
let decimalMatch = numStr.match(/\.(\d+)/);
|
|
58
|
+
if (decimalMatch === null || decimalMatch === void 0 ? void 0 : decimalMatch[1]) {
|
|
59
|
+
precision += decimalMatch[1].length;
|
|
60
|
+
}
|
|
61
|
+
return precision;
|
|
62
|
+
}
|
|
63
|
+
return ~numStr.indexOf(".") && validateNumber(numStr) ? numStr.length - numStr.indexOf(".") - 1 : 0;
|
|
64
|
+
}
|
|
65
|
+
function num2str(number) {
|
|
66
|
+
let numStr = String(number);
|
|
67
|
+
if (isE(number)) {
|
|
68
|
+
if (number > Number.MAX_SAFE_INTEGER) {
|
|
69
|
+
return String(supportBigInt() ? BigInt(number).toString() : Number.MAX_SAFE_INTEGER);
|
|
70
|
+
}
|
|
71
|
+
if (number < Number.MIN_SAFE_INTEGER) {
|
|
72
|
+
return String(supportBigInt() ? BigInt(number).toString() : Number.MIN_SAFE_INTEGER);
|
|
73
|
+
}
|
|
74
|
+
numStr = number.toFixed(getNumberPrecision(numStr));
|
|
75
|
+
}
|
|
76
|
+
return trimNumber(numStr).fullStr;
|
|
77
|
+
}
|
|
78
|
+
function pluginDecimal(decimal) {
|
|
79
|
+
if (!decimal.add) {
|
|
80
|
+
Object.assign(decimal, {
|
|
81
|
+
add: decimal.plus,
|
|
82
|
+
lessEquals: decimal.isLessThan,
|
|
83
|
+
equals: decimal.isEqualTo
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return decimal;
|
|
87
|
+
}
|
|
88
|
+
const DecimalCls = {
|
|
89
|
+
CLS: null
|
|
90
|
+
};
|
|
91
|
+
let setDecimalClass;
|
|
92
|
+
function getMiniDecimal(value, decimal) {
|
|
93
|
+
if (!DecimalCls.CLS) {
|
|
94
|
+
setDecimalClass(decimal);
|
|
95
|
+
}
|
|
96
|
+
return pluginDecimal(new DecimalCls.CLS(value));
|
|
97
|
+
}
|
|
98
|
+
class BigIntDecimal {
|
|
99
|
+
constructor(value) {
|
|
100
|
+
if (!value && value !== 0 || !String(value).trim()) {
|
|
101
|
+
this.empty = true;
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
this.origin = String(value);
|
|
105
|
+
this.negative = void 0;
|
|
106
|
+
this.integer = void 0;
|
|
107
|
+
this.decimal = void 0;
|
|
108
|
+
this.decimalLen = void 0;
|
|
109
|
+
this.empty = void 0;
|
|
110
|
+
this.nan = void 0;
|
|
111
|
+
if (value === "-") {
|
|
112
|
+
this.nan = true;
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
let mergedValue = isE(value) ? Number(value) : value;
|
|
116
|
+
if (typeof mergedValue !== "string") {
|
|
117
|
+
num2str(mergedValue);
|
|
118
|
+
}
|
|
119
|
+
const f = Function;
|
|
120
|
+
const convertBigInt = (str) => {
|
|
121
|
+
const validStr = str.replace(/^0+/, "") || "0";
|
|
122
|
+
return f(`return BigInt('${validStr}')`)();
|
|
123
|
+
};
|
|
124
|
+
if (validateNumber(mergedValue)) {
|
|
125
|
+
const trimRet = trimNumber(mergedValue);
|
|
126
|
+
this.negative = trimRet.negative;
|
|
127
|
+
const numbers = trimRet.trimStr.split(".");
|
|
128
|
+
this.integer = !numbers[0].includes("e") ? BigInt(numbers[0]) : numbers[0];
|
|
129
|
+
const decimalStr = numbers[1] || "0";
|
|
130
|
+
this.decimal = decimalStr.includes("e") ? convertBigInt(decimalStr) : BigInt(decimalStr);
|
|
131
|
+
this.decimalLen = decimalStr.length;
|
|
132
|
+
} else {
|
|
133
|
+
this.nan = true;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
getDecimalStr() {
|
|
137
|
+
return this.decimal.toString().padStart(this.decimalLen, "0");
|
|
138
|
+
}
|
|
139
|
+
getIntegerStr() {
|
|
140
|
+
return this.integer.toString();
|
|
141
|
+
}
|
|
142
|
+
getMark() {
|
|
143
|
+
return this.negative ? "-" : "";
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Align BigIntDecimal with same decimal length. e.g. 12.3 + 5 = 1230000
|
|
147
|
+
* This is used for add function only.
|
|
148
|
+
*/
|
|
149
|
+
alignDecimal(decimalLength) {
|
|
150
|
+
const string = `${this.getMark()}${this.getIntegerStr()}${this.getDecimalStr().padEnd(decimalLength, "0")}`;
|
|
151
|
+
return BigInt(string);
|
|
152
|
+
}
|
|
153
|
+
add(value) {
|
|
154
|
+
if (this.isInvalidate()) {
|
|
155
|
+
return new BigIntDecimal(value);
|
|
156
|
+
}
|
|
157
|
+
const offsetObj = new BigIntDecimal(value);
|
|
158
|
+
if (offsetObj.isInvalidate()) {
|
|
159
|
+
return this;
|
|
160
|
+
}
|
|
161
|
+
const maxDecimalLength = Math.max(this.getDecimalStr().length, offsetObj.getDecimalStr().length);
|
|
162
|
+
const offsetAlignedDecimal = offsetObj.alignDecimal(maxDecimalLength);
|
|
163
|
+
const myAlignedDecimal = this.alignDecimal(maxDecimalLength);
|
|
164
|
+
const valueStr = `${myAlignedDecimal + offsetAlignedDecimal}`;
|
|
165
|
+
const { negativeStr: str, trimStr } = trimNumber(valueStr);
|
|
166
|
+
const hydrateValueStr = `${str}${trimStr.padStart(maxDecimalLength + 1, "0")}`;
|
|
167
|
+
return getMiniDecimal(`${hydrateValueStr.slice(0, -maxDecimalLength)}.${hydrateValueStr.slice(-maxDecimalLength)}`);
|
|
168
|
+
}
|
|
169
|
+
negate() {
|
|
170
|
+
const clone = new BigIntDecimal(this.toString());
|
|
171
|
+
clone.negative = !clone.negative;
|
|
172
|
+
return clone;
|
|
173
|
+
}
|
|
174
|
+
isNaN() {
|
|
175
|
+
return this.nan;
|
|
176
|
+
}
|
|
177
|
+
isEmpty() {
|
|
178
|
+
return this.empty;
|
|
179
|
+
}
|
|
180
|
+
isInvalidate() {
|
|
181
|
+
return this.isEmpty() || this.isNaN();
|
|
182
|
+
}
|
|
183
|
+
lessEquals(target) {
|
|
184
|
+
return this.add(target.negate().toString()).toNumber() <= 0;
|
|
185
|
+
}
|
|
186
|
+
equals(target) {
|
|
187
|
+
return this.toString() === (target && target.toString());
|
|
188
|
+
}
|
|
189
|
+
toNumber() {
|
|
190
|
+
if (this.isNaN()) {
|
|
191
|
+
return NaN;
|
|
192
|
+
}
|
|
193
|
+
return Number(this.toString());
|
|
194
|
+
}
|
|
195
|
+
toString(safe = true) {
|
|
196
|
+
if (!safe) {
|
|
197
|
+
return this.origin;
|
|
198
|
+
}
|
|
199
|
+
if (this.isInvalidate()) {
|
|
200
|
+
return "";
|
|
201
|
+
}
|
|
202
|
+
return trimNumber(`${this.getMark()}${this.getIntegerStr()}.${this.getDecimalStr()}`).fullStr;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
class NumberDecimal {
|
|
206
|
+
constructor(value = "") {
|
|
207
|
+
if (!value && value !== 0 || !String(value).trim()) {
|
|
208
|
+
this.empty = true;
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
this.origin = "";
|
|
212
|
+
this.number = void 0;
|
|
213
|
+
this.empty = void 0;
|
|
214
|
+
this.origin = String(value);
|
|
215
|
+
this.number = Number(value);
|
|
216
|
+
}
|
|
217
|
+
negate() {
|
|
218
|
+
return new NumberDecimal(-this.toNumber());
|
|
219
|
+
}
|
|
220
|
+
add(value) {
|
|
221
|
+
if (this.isInvalidate()) {
|
|
222
|
+
return new NumberDecimal(value);
|
|
223
|
+
}
|
|
224
|
+
const target = Number(value);
|
|
225
|
+
if (isNaN(target)) {
|
|
226
|
+
return this;
|
|
227
|
+
}
|
|
228
|
+
const number = this.number + target;
|
|
229
|
+
if (number < Number.MIN_SAFE_INTEGER) {
|
|
230
|
+
return new NumberDecimal(Number.MIN_SAFE_INTEGER);
|
|
231
|
+
}
|
|
232
|
+
if (number > Number.MAX_SAFE_INTEGER) {
|
|
233
|
+
return new NumberDecimal(Number.MAX_SAFE_INTEGER);
|
|
234
|
+
}
|
|
235
|
+
const maxPrecision = Math.max(getNumberPrecision(target), getNumberPrecision(this.number));
|
|
236
|
+
return new NumberDecimal(number.toFixed(maxPrecision));
|
|
237
|
+
}
|
|
238
|
+
isNaN() {
|
|
239
|
+
return isNaN(this.number);
|
|
240
|
+
}
|
|
241
|
+
isEmpty() {
|
|
242
|
+
return this.empty;
|
|
243
|
+
}
|
|
244
|
+
isInvalidate() {
|
|
245
|
+
return this.isEmpty() || this.isNaN();
|
|
246
|
+
}
|
|
247
|
+
equals(target) {
|
|
248
|
+
return this.toNumber() === (target && target.toNumber());
|
|
249
|
+
}
|
|
250
|
+
lessEquals(target) {
|
|
251
|
+
return this.add(target.negate().toString()).toNumber() <= 0;
|
|
252
|
+
}
|
|
253
|
+
toNumber() {
|
|
254
|
+
return this.number;
|
|
255
|
+
}
|
|
256
|
+
toString(safe = true) {
|
|
257
|
+
if (!safe) {
|
|
258
|
+
return this.origin;
|
|
259
|
+
}
|
|
260
|
+
if (this.isInvalidate()) {
|
|
261
|
+
return "";
|
|
262
|
+
}
|
|
263
|
+
return num2str(this.number);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
setDecimalClass = function(decimaljs) {
|
|
267
|
+
DecimalCls.CLS = supportBigInt() ? BigIntDecimal : typeof decimaljs === "function" ? decimaljs : NumberDecimal;
|
|
268
|
+
};
|
|
269
|
+
function lessEquals(value1, value2) {
|
|
270
|
+
return getMiniDecimal(value1).lessEquals(getMiniDecimal(value2));
|
|
271
|
+
}
|
|
272
|
+
function equalsDecimal(value1, value2) {
|
|
273
|
+
return getMiniDecimal(value1).equals(getMiniDecimal(value2));
|
|
274
|
+
}
|
|
275
|
+
function toFixed(numStr, precision, rounding = 5) {
|
|
276
|
+
if (numStr === "") {
|
|
277
|
+
return "";
|
|
278
|
+
}
|
|
279
|
+
const separatorStr = ".";
|
|
280
|
+
const { negativeStr, integerStr, decimalStr } = trimNumber(numStr);
|
|
281
|
+
const precisionDecimalStr = `${separatorStr}${decimalStr}`;
|
|
282
|
+
const numberWithoutDecimal = `${negativeStr}${integerStr}`;
|
|
283
|
+
if (precision >= 0) {
|
|
284
|
+
const advancedNum = Number(decimalStr[precision]);
|
|
285
|
+
if (advancedNum >= rounding && rounding !== 0) {
|
|
286
|
+
const advancedDecimal = getMiniDecimal(`${integerStr}${separatorStr}${decimalStr}`).add(
|
|
287
|
+
`0.${fillChar("", precision, true)}${10 - advancedNum}`
|
|
288
|
+
);
|
|
289
|
+
return toFixed(negativeStr + advancedDecimal.toString(), precision, 0);
|
|
290
|
+
}
|
|
291
|
+
if (precision === 0) {
|
|
292
|
+
return numberWithoutDecimal;
|
|
293
|
+
}
|
|
294
|
+
return `${numberWithoutDecimal}${separatorStr}${fillChar(decimalStr, precision, true).slice(0, precision)}`;
|
|
295
|
+
}
|
|
296
|
+
if (precisionDecimalStr === ".0") {
|
|
297
|
+
return numberWithoutDecimal;
|
|
298
|
+
}
|
|
299
|
+
return `${numberWithoutDecimal}${precisionDecimalStr}`;
|
|
300
|
+
}
|
|
301
|
+
export {
|
|
302
|
+
BigIntDecimal,
|
|
303
|
+
NumberDecimal,
|
|
304
|
+
equalsDecimal,
|
|
305
|
+
getMiniDecimal,
|
|
306
|
+
getNumberPrecision,
|
|
307
|
+
isE,
|
|
308
|
+
lessEquals,
|
|
309
|
+
num2str,
|
|
310
|
+
setDecimalClass,
|
|
311
|
+
supportBigInt,
|
|
312
|
+
toFixed,
|
|
313
|
+
trimNumber,
|
|
314
|
+
validateNumber
|
|
315
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
const getIEVersion = () => {
|
|
3
|
+
let version = 8;
|
|
4
|
+
if (!!document.addEventListener && !!window.performance) {
|
|
5
|
+
version = 9;
|
|
6
|
+
if (!!window.atob && !!window.matchMedia) {
|
|
7
|
+
version = 10;
|
|
8
|
+
if (!window.attachEvent && !document.all) {
|
|
9
|
+
version = 11;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return version;
|
|
14
|
+
};
|
|
15
|
+
const isEdge = (browser) => {
|
|
16
|
+
if (browser.chrome && ~navigator.userAgent.indexOf("Edg")) {
|
|
17
|
+
browser.name = "edge";
|
|
18
|
+
browser.edge = true;
|
|
19
|
+
delete browser.chrome;
|
|
20
|
+
} else if (!document.documentMode && !!window.StyleMedia) {
|
|
21
|
+
browser.name = "edge";
|
|
22
|
+
browser.edge = true;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document;
|
|
26
|
+
const globalEnvironment = isBrowser ? window : global;
|
|
27
|
+
var browser_default = (() => {
|
|
28
|
+
const browser = {
|
|
29
|
+
name: void 0,
|
|
30
|
+
version: void 0,
|
|
31
|
+
isDoc: typeof document !== "undefined",
|
|
32
|
+
isMobile: false,
|
|
33
|
+
isPC: true,
|
|
34
|
+
isNode: typeof window === "undefined"
|
|
35
|
+
};
|
|
36
|
+
if (isBrowser) {
|
|
37
|
+
const isMobile = /(Android|webOS|iPhone|iPad|iPod|SymbianOS|BlackBerry|Windows Phone)/.test(navigator.userAgent);
|
|
38
|
+
browser.isMobile = isMobile;
|
|
39
|
+
browser.isPC = !isMobile;
|
|
40
|
+
let matches;
|
|
41
|
+
if (!!window.chrome && (!!window.chrome.webstore || /^Google\b/.test(window.navigator.vendor))) {
|
|
42
|
+
browser.name = "chrome";
|
|
43
|
+
browser.chrome = true;
|
|
44
|
+
matches = navigator.userAgent.match(/chrome\/(\d+)/i);
|
|
45
|
+
browser.version = !!matches && !!matches[1] && parseInt(matches[1], 10);
|
|
46
|
+
matches = void 0;
|
|
47
|
+
} else if (!!document.all || !!document.documentMode) {
|
|
48
|
+
browser.name = "ie";
|
|
49
|
+
browser.version = getIEVersion();
|
|
50
|
+
browser.ie = true;
|
|
51
|
+
} else if (typeof window.InstallTrigger !== "undefined") {
|
|
52
|
+
browser.name = "firefox";
|
|
53
|
+
browser.firefox = true;
|
|
54
|
+
} else if (Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") > 0) {
|
|
55
|
+
browser.name = "safari";
|
|
56
|
+
browser.safari = true;
|
|
57
|
+
} else if (!!window.opr && !!window.opr.addons || !!window.opera) {
|
|
58
|
+
browser.name = "opera";
|
|
59
|
+
browser.opera = true;
|
|
60
|
+
}
|
|
61
|
+
isEdge(browser);
|
|
62
|
+
if (!~["ie", "chrome"].indexOf(browser.name)) {
|
|
63
|
+
const reg = browser.name + "/(\\d+)";
|
|
64
|
+
matches = navigator.userAgent.match(new RegExp(reg, "i"));
|
|
65
|
+
browser.version = !!matches && !!matches[1] && parseInt(matches[1], 10);
|
|
66
|
+
matches = void 0;
|
|
67
|
+
}
|
|
68
|
+
if (browser.isDoc) {
|
|
69
|
+
const bodyEl = document.body || document.documentElement;
|
|
70
|
+
["webkit", "khtml", "moz", "ms", "o"].forEach((core) => {
|
|
71
|
+
browser["-" + core] = !!bodyEl[core + "MatchesSelector"];
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return browser;
|
|
76
|
+
})();
|
|
77
|
+
export {
|
|
78
|
+
browser_default as default,
|
|
79
|
+
globalEnvironment,
|
|
80
|
+
isBrowser
|
|
81
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import "../../chunk-G2ADBYYC.js";
|
|
2
|
+
import { isLeapYear } from "../date";
|
|
3
|
+
const getDays = (year, month) => {
|
|
4
|
+
return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];
|
|
5
|
+
};
|
|
6
|
+
const getWeek = (year, month, day) => (/* @__PURE__ */ new Date(`${year}/${month}/${day}`)).getDay();
|
|
7
|
+
const lastMonth = (year, month) => {
|
|
8
|
+
year = +year;
|
|
9
|
+
month = +month;
|
|
10
|
+
if (month === 1) {
|
|
11
|
+
year--;
|
|
12
|
+
month = 12;
|
|
13
|
+
} else {
|
|
14
|
+
month--;
|
|
15
|
+
}
|
|
16
|
+
return { year, month };
|
|
17
|
+
};
|
|
18
|
+
const nextMonth = (year, month) => {
|
|
19
|
+
year = +year;
|
|
20
|
+
month = +month;
|
|
21
|
+
if (month === 12) {
|
|
22
|
+
year++;
|
|
23
|
+
month = 1;
|
|
24
|
+
} else {
|
|
25
|
+
month++;
|
|
26
|
+
}
|
|
27
|
+
return { year, month };
|
|
28
|
+
};
|
|
29
|
+
const getCalendar = (year, month) => {
|
|
30
|
+
if (year && month && month <= 12) {
|
|
31
|
+
const days = getDays(year, month);
|
|
32
|
+
const firstWeek = getWeek(year, month, 1);
|
|
33
|
+
const lastWeek = getWeek(year, month, days);
|
|
34
|
+
const last = lastMonth(year, month);
|
|
35
|
+
const next = nextMonth(year, month);
|
|
36
|
+
const lastDays = getDays(last.year, last.month);
|
|
37
|
+
let remainDays = 0;
|
|
38
|
+
const totalDays = days + firstWeek + 7 - lastWeek - 1;
|
|
39
|
+
if (totalDays / 7 < 6 && totalDays / 7 >= 5) {
|
|
40
|
+
remainDays = 6 * 7 - totalDays;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
last: {
|
|
44
|
+
year: last.year,
|
|
45
|
+
month: last.month,
|
|
46
|
+
start: lastDays - (firstWeek - 1),
|
|
47
|
+
end: lastDays
|
|
48
|
+
},
|
|
49
|
+
current: {
|
|
50
|
+
year,
|
|
51
|
+
month,
|
|
52
|
+
start: 1,
|
|
53
|
+
end: days
|
|
54
|
+
},
|
|
55
|
+
next: {
|
|
56
|
+
year: next.year,
|
|
57
|
+
month: next.month,
|
|
58
|
+
start: 1,
|
|
59
|
+
end: 7 - lastWeek - 1 + remainDays
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const transformArray = (array) => {
|
|
65
|
+
const result = [];
|
|
66
|
+
let index = 0;
|
|
67
|
+
if (array && array.length) {
|
|
68
|
+
const length = array.length / 7;
|
|
69
|
+
for (let i = 0; i < length; i++) {
|
|
70
|
+
result[i] = [];
|
|
71
|
+
for (let j = 0; j < 7; j++) {
|
|
72
|
+
result[i][j] = array[index++];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
};
|
|
78
|
+
const parseDate = (time) => {
|
|
79
|
+
const date = new Date(time && typeof time === "number" ? time : 0);
|
|
80
|
+
return {
|
|
81
|
+
year: date.getFullYear(),
|
|
82
|
+
month: date.getMonth() + 1,
|
|
83
|
+
day: date.getDate(),
|
|
84
|
+
hours: date.getHours(),
|
|
85
|
+
minutes: date.getMinutes(),
|
|
86
|
+
seconds: date.getSeconds()
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
getCalendar,
|
|
91
|
+
getDays,
|
|
92
|
+
getWeek,
|
|
93
|
+
lastMonth,
|
|
94
|
+
nextMonth,
|
|
95
|
+
parseDate,
|
|
96
|
+
transformArray
|
|
97
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../chunk-G2ADBYYC.js";
|
|
5
|
+
import { format } from "../string";
|
|
6
|
+
import { isObject } from "../type";
|
|
7
|
+
import { transformTreeData } from "../array";
|
|
8
|
+
const getFilterStr = (filters) => {
|
|
9
|
+
const filterArr = {};
|
|
10
|
+
Object.keys(filters).forEach((property) => {
|
|
11
|
+
const { type, value } = filters[property];
|
|
12
|
+
if (type === "enum") {
|
|
13
|
+
filterArr[property] = { type: value.map(() => 0), value };
|
|
14
|
+
if (value.length > 1) {
|
|
15
|
+
filters[property].relation = "or";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (type === "input") {
|
|
19
|
+
const { relation, text } = value;
|
|
20
|
+
filterArr[property] = {
|
|
21
|
+
type: [relation === "startwith" ? 8 : relation === "equals" ? 0 : 6],
|
|
22
|
+
value: text
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return JSON.stringify(filterArr);
|
|
27
|
+
};
|
|
28
|
+
const getNsObj = (obj, names) => {
|
|
29
|
+
const arr = Array.isArray(names) ? names : names.split(".");
|
|
30
|
+
const curkey = arr.shift();
|
|
31
|
+
const curObj = obj[curkey];
|
|
32
|
+
if (isObject(curObj) && arr.length) {
|
|
33
|
+
return getNsObj(curObj, arr);
|
|
34
|
+
}
|
|
35
|
+
return curObj;
|
|
36
|
+
};
|
|
37
|
+
const handlerArgs = (options, args) => {
|
|
38
|
+
if (args) {
|
|
39
|
+
const { page, sort, filters } = args;
|
|
40
|
+
const { currentPage, pageSize } = page || {};
|
|
41
|
+
const filterStr = getFilterStr(filters || {});
|
|
42
|
+
const orderBy = sort && sort.property ? sort.property + " " + sort.order : "";
|
|
43
|
+
options.url = format(options.url, {
|
|
44
|
+
curPage: currentPage,
|
|
45
|
+
pageSize,
|
|
46
|
+
filterStr,
|
|
47
|
+
orderBy
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const transForm = (response, tree) => {
|
|
52
|
+
const { result, pageVO } = response;
|
|
53
|
+
const { key = "id", parentKey } = tree || {};
|
|
54
|
+
let data = result || response;
|
|
55
|
+
if (parentKey) {
|
|
56
|
+
data = transformTreeData(data, key, parentKey);
|
|
57
|
+
}
|
|
58
|
+
return pageVO ? { result: data, page: { total: pageVO.totalRows } } : data;
|
|
59
|
+
};
|
|
60
|
+
const getDataset = ({ dataset, service, tree }, args) => new Promise((resolve, reject) => {
|
|
61
|
+
const { source, value, api } = dataset || {};
|
|
62
|
+
const $service = service || dataset && dataset.service;
|
|
63
|
+
if (Array.isArray(dataset)) {
|
|
64
|
+
return resolve(transForm(dataset, tree));
|
|
65
|
+
}
|
|
66
|
+
if (Array.isArray(value)) {
|
|
67
|
+
return resolve(transForm(value, tree));
|
|
68
|
+
}
|
|
69
|
+
if (!$service) {
|
|
70
|
+
return resolve([]);
|
|
71
|
+
}
|
|
72
|
+
if (isObject(source) && source.url) {
|
|
73
|
+
const _a = source, { type = "GET", data, beforeRequest, afterRequest, success, hideErr, url, method } = _a, options = __objRest(_a, ["type", "data", "beforeRequest", "afterRequest", "success", "hideErr", "url", "method"]);
|
|
74
|
+
options.url = url;
|
|
75
|
+
options.method = method || type.toLocaleLowerCase();
|
|
76
|
+
const mergeTarget = options.method === "get" ? "params" : "data";
|
|
77
|
+
options[mergeTarget] = data || {};
|
|
78
|
+
const afterRequestFn = afterRequest || success;
|
|
79
|
+
const config = __spreadValues({}, options);
|
|
80
|
+
handlerArgs(config, args);
|
|
81
|
+
beforeRequest && beforeRequest(config, args);
|
|
82
|
+
$service.network.request(config).then((response) => {
|
|
83
|
+
afterRequestFn && afterRequestFn(response.data);
|
|
84
|
+
resolve(transForm(response.data, tree));
|
|
85
|
+
}).catch((error) => {
|
|
86
|
+
hideErr || reject(error);
|
|
87
|
+
});
|
|
88
|
+
} else if (api) {
|
|
89
|
+
const fetchFn = getNsObj($service, api.name);
|
|
90
|
+
fetchFn && fetchFn(__spreadValues(__spreadValues({}, api.data), args)).then((response) => {
|
|
91
|
+
resolve(transForm(response, tree));
|
|
92
|
+
}).catch((error) => {
|
|
93
|
+
reject(error);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
export {
|
|
98
|
+
getDataset
|
|
99
|
+
};
|