@opentiny/vue-renderless 3.10.7 → 3.11.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/action-menu/index.js +1 -1
- package/action-menu/vue.js +7 -9
- package/action-sheet/index.js +4 -1
- package/action-sheet/vue.js +1 -1
- package/alert/index.js +1 -1
- package/alert/vue.js +1 -1
- package/amount/index.js +1 -1
- package/amount/vue.js +1 -1
- package/anchor/index.js +39 -28
- package/anchor/vue.js +38 -10
- package/area/index.js +1 -1
- package/area/vue.js +1 -1
- package/async-flowchart/index.js +66 -0
- package/async-flowchart/vue.js +40 -0
- package/autocomplete/index.js +1 -1
- package/autocomplete/vue.js +1 -1
- package/autonavi-map/index.js +1 -1
- package/avatar/index.js +1 -1
- package/avatar/vue.js +1 -1
- package/badge/index.js +1 -1
- package/badge/vue.js +1 -1
- package/baidu-map/index.js +1 -1
- package/breadcrumb/index.js +2 -2
- package/breadcrumb/vue.js +2 -1
- package/breadcrumb-item/index.js +1 -1
- package/breadcrumb-item/vue.js +1 -1
- package/bulletin-board/index.js +1 -1
- package/bulletin-board/vue.js +1 -1
- package/button/index.js +2 -2
- package/button/vue.js +2 -2
- package/button-group/index.js +2 -2
- package/button-group/vue.js +1 -1
- package/calendar/index.js +15 -15
- package/calendar/vue.js +1 -1
- package/calendar-bar/index.js +4 -4
- package/calendar-bar/vue.js +1 -1
- package/calendar-view/index.js +600 -0
- package/calendar-view/vue.js +289 -0
- package/card/index.js +1 -1
- package/card/vue.js +1 -1
- package/card-group/index.js +1 -1
- package/card-group/vue.js +1 -1
- package/card-template/index.js +1 -1
- package/card-template/vue.js +1 -1
- package/carousel/index.js +1 -1
- package/carousel/vue.js +1 -1
- package/carousel-item/index.js +1 -1
- package/carousel-item/vue.js +1 -1
- package/cascader/index.js +3 -5
- package/cascader/vue.js +2 -1
- package/cascader-menu/index.js +11 -3
- package/cascader-menu/vue.js +1 -1
- package/cascader-mobile/index.js +1 -1
- package/cascader-mobile/vue.js +1 -1
- package/cascader-node/index.js +2 -2
- package/cascader-node/vue.js +1 -1
- package/cascader-panel/index.js +22 -17
- package/cascader-panel/node.js +14 -5
- package/cascader-panel/store.js +18 -1
- package/cascader-panel/vue.js +16 -3
- package/cascader-select/index.js +1 -1
- package/cascader-select/vue.js +1 -1
- package/cell/vue.js +1 -1
- package/chart-bar/index.js +1 -1
- package/chart-boxplot/index.js +2 -1
- package/chart-candle/index.js +1 -1
- package/chart-core/deps/constants.js +1 -1
- package/chart-core/deps/numerify.js +1 -1
- package/chart-core/deps/utils.js +1 -1
- package/chart-core/index.js +1 -1
- package/chart-core/modules/animation.js +1 -1
- package/chart-core/modules/extend.js +1 -1
- package/chart-core/modules/mark.js +1 -1
- package/chart-core/vue.js +1 -1
- package/chart-funnel/index.js +1 -1
- package/chart-gauge/index.js +1 -1
- package/chart-graph/index.js +1 -1
- package/chart-heatmap/index.js +1 -1
- package/chart-line/index.js +1 -1
- package/chart-liquidfill/index.js +1 -1
- package/chart-map/index.js +1 -1
- package/chart-pie/index.js +1 -1
- package/chart-radar/index.js +1 -1
- package/chart-sankey/index.js +1 -1
- package/chart-scatter/index.js +1 -1
- package/chart-sunburst/index.js +1 -1
- package/chart-tree/index.js +1 -1
- package/chart-waterfall/index.js +1 -1
- package/chart-wordcloud/index.js +1 -1
- package/checkbox/index.js +23 -6
- package/checkbox/vue.js +15 -2
- package/checkbox-button/index.js +1 -1
- package/checkbox-button/vue.js +1 -1
- package/checkbox-group/index.js +1 -1
- package/checkbox-group/vue.js +1 -1
- package/col/index.js +8 -7
- package/col/vue.js +1 -1
- package/collapse/index.js +1 -1
- package/collapse/vue.js +2 -2
- package/collapse-item/index.js +1 -1
- package/collapse-item/vue.js +1 -1
- package/color-picker/alpha-select/index.js +24 -0
- package/color-picker/alpha-select/vue.js +58 -0
- package/color-picker/color-select/index.js +73 -0
- package/color-picker/color-select/vue.js +67 -0
- package/color-picker/index.js +52 -0
- package/color-picker/utils/color.js +96 -0
- package/color-picker/utils/use-drag.js +38 -0
- package/color-picker/vue.js +63 -0
- package/color-select-panel/alpha-select/index.js +24 -0
- package/color-select-panel/alpha-select/vue.js +59 -0
- package/color-select-panel/hue-select/index.js +73 -0
- package/color-select-panel/hue-select/vue.js +67 -0
- package/color-select-panel/index.js +74 -0
- package/color-select-panel/utils/color.js +97 -0
- package/color-select-panel/utils/use-drag.js +38 -0
- package/color-select-panel/vue.js +92 -0
- package/column-list-group/vue.js +1 -1
- package/column-list-item/index.js +1 -1
- package/column-list-item/vue.js +1 -1
- package/common/array.js +1 -1
- package/common/bigInt.js +12 -3
- package/common/browser.js +1 -1
- package/common/calendar/calendar.js +97 -0
- package/common/dataset/index.js +1 -1
- package/common/date.js +3 -3
- package/common/decimal.js +1 -1
- package/common/deps/ResizeObserver.js +1 -1
- package/common/deps/after-leave.js +1 -1
- package/common/deps/clickoutside.js +1 -1
- package/common/deps/date-util.js +1 -1
- package/common/deps/date.js +3 -3
- package/common/deps/debounce.js +1 -1
- package/common/deps/dom.js +21 -70
- package/common/deps/eSpaceCtrl.js +1 -1
- package/common/deps/fastdom/async.js +1 -1
- package/common/deps/fastdom/index.js +1 -1
- package/common/deps/fastdom/sandbox.js +1 -1
- package/common/deps/fastdom/singleton.js +2 -2
- package/common/deps/fullscreen/apis.js +1 -1
- package/common/deps/fullscreen/screenfull.js +1 -1
- package/common/deps/infinite-scroll.js +1 -1
- package/common/deps/letter-only.js +1 -1
- package/common/deps/memorize.js +4 -4
- package/common/deps/modal-queue.js +1 -1
- package/common/deps/number-only.js +1 -1
- package/common/deps/observe-visibility.js +1 -1
- package/common/deps/popper.js +344 -449
- package/common/deps/popup-manager.js +56 -37
- package/common/deps/repeat-click.js +1 -1
- package/common/deps/requestAnimationFrame.js +1 -1
- package/common/deps/resize-event.js +1 -1
- package/common/deps/scroll-into-view.js +1 -1
- package/common/deps/scrollbar-width.js +1 -1
- package/common/deps/throttle.js +3 -3
- package/common/deps/touch.js +2 -1
- package/common/deps/tree-model/node.js +1 -1
- package/common/deps/tree-model/tree-store.js +1 -1
- package/common/deps/tree-model/util.js +1 -1
- package/common/deps/upload-ajax.js +1 -1
- package/common/deps/vue-emitter.js +1 -1
- package/common/deps/vue-popper.js +89 -220
- package/common/deps/vue-popup.js +65 -81
- package/common/event.js +9 -2
- package/common/index.js +2 -2
- package/common/object.js +20 -22
- package/common/runtime.js +2 -2
- package/common/string.js +14 -4
- package/common/type.js +2 -2
- package/common/validate/index.js +1 -1
- package/common/validate/messages.js +1 -1
- package/common/validate/rules/enum.js +1 -1
- package/common/validate/rules/index.js +1 -1
- package/common/validate/rules/pattern.js +1 -1
- package/common/validate/rules/range.js +1 -1
- package/common/validate/rules/required.js +1 -1
- package/common/validate/rules/type.js +1 -1
- package/common/validate/rules/whitespace.js +1 -1
- package/common/validate/schema.js +8 -1
- package/common/validate/util.js +4 -4
- package/common/validate/validations/array.js +1 -1
- package/common/validate/validations/date.js +1 -1
- package/common/validate/validations/enum.js +1 -1
- package/common/validate/validations/float.js +1 -1
- package/common/validate/validations/index.js +1 -1
- package/common/validate/validations/integer.js +1 -1
- package/common/validate/validations/method.js +1 -1
- package/common/validate/validations/number.js +1 -1
- package/common/validate/validations/pattern.js +1 -1
- package/common/validate/validations/required.js +1 -1
- package/common/validate/validations/string.js +1 -1
- package/common/validate/validations/type.js +1 -1
- package/common/xss.js +4 -156
- package/company/index.js +1 -1
- package/company/vue.js +1 -1
- package/container/index.js +1 -1
- package/container/vue.js +1 -1
- package/country/index.js +1 -1
- package/country/vue.js +1 -1
- package/credit-card/index.js +1 -1
- package/credit-card/vue.js +1 -1
- package/credit-card-form/index.js +1 -1
- package/credit-card-form/vue.js +3 -3
- package/crop/index.js +1 -1
- package/crop/vue.js +1 -1
- package/currency/index.js +1 -1
- package/currency/vue.js +1 -1
- package/date-panel/index.js +4 -4
- package/date-panel/vue.js +3 -3
- package/date-picker/index.js +1 -1
- package/date-picker/vue.js +1 -1
- package/date-picker-mobile/index.js +127 -85
- package/date-picker-mobile/vue.js +42 -23
- package/date-picker-mobile/year-month.js +53 -0
- package/date-range/index.js +7 -7
- package/date-range/vue.js +3 -3
- package/date-table/index.js +2 -2
- package/date-table/vue.js +1 -1
- package/dept/index.js +1 -1
- package/dept/vue.js +1 -1
- package/detail-page/index.js +1 -1
- package/detail-page/vue.js +1 -1
- package/dialog-box/index.js +28 -8
- package/dialog-box/vue.js +12 -16
- package/dialog-select/index.js +1 -1
- package/dialog-select/vue.js +1 -1
- package/divider/vue.js +9 -0
- package/drawer/index.js +2 -2
- package/drawer/vue.js +1 -1
- package/drop-roles/index.js +1 -1
- package/drop-roles/vue.js +1 -1
- package/drop-times/index.js +1 -1
- package/drop-times/vue.js +1 -1
- package/dropdown/index.js +33 -24
- package/dropdown/vue.js +8 -8
- package/dropdown-item/index.js +1 -1
- package/dropdown-item/mf.js +1 -1
- package/dropdown-item/vue.js +3 -3
- package/dropdown-menu/index.js +7 -5
- package/dropdown-menu/vue.js +3 -3
- package/dynamic-scroller/index.js +1 -1
- package/dynamic-scroller/vue.js +1 -1
- package/dynamic-scroller-item/index.js +1 -1
- package/dynamic-scroller-item/vue.js +1 -1
- package/espace/index.js +1 -1
- package/espace/vue.js +1 -1
- package/exception/index.js +1 -1
- package/exception/vue.js +1 -1
- package/fall-menu/index.js +1 -1
- package/fall-menu/vue.js +1 -1
- package/file-upload/index.js +213 -31
- package/file-upload/vue.js +13 -7
- package/filter/index.js +1 -1
- package/filter/tag-group.js +1 -1
- package/filter/vue.js +1 -1
- package/filter-bar/index.js +1 -1
- package/filter-bar/vue.js +1 -1
- package/filter-box/index.js +1 -1
- package/filter-box/vue.js +1 -1
- package/filter-panel/index.js +1 -1
- package/filter-panel/vue.js +1 -1
- package/floatbar/index.js +1 -1
- package/floatbar/vue.js +1 -1
- package/floating-button/index.js +1 -1
- package/floating-button/vue.js +1 -1
- package/flowchart/index.js +648 -227
- package/flowchart/node.js +52 -0
- package/flowchart/vue.js +25 -9
- package/form/index.js +37 -5
- package/form/vue.js +16 -3
- package/form-item/index.js +56 -27
- package/form-item/vue.js +25 -9
- package/fullscreen/index.js +1 -1
- package/fullscreen/vue.js +2 -1
- package/grid/core/index.js +1 -1
- package/grid/core/interceptor.js +1 -1
- package/grid/core/storeMap.js +1 -1
- package/grid/plugins/export.js +1 -1
- package/grid/plugins/exportExcel.js +4 -1
- package/grid/plugins/header.js +1 -1
- package/grid/plugins/resize.js +1 -1
- package/grid/static/array/arrayEach.js +1 -1
- package/grid/static/array/arrayIndexOf.js +1 -1
- package/grid/static/array/eachTree.js +1 -1
- package/grid/static/array/every.js +1 -1
- package/grid/static/array/filterTree.js +1 -1
- package/grid/static/array/find.js +1 -1
- package/grid/static/array/findTree.js +1 -1
- package/grid/static/array/helperCreateIterateHandle.js +1 -1
- package/grid/static/array/helperCreateTreeFunc.js +1 -1
- package/grid/static/array/includes.js +1 -1
- package/grid/static/array/lastArrayEach.js +1 -1
- package/grid/static/array/map.js +1 -1
- package/grid/static/array/mapTree.js +1 -1
- package/grid/static/array/slice.js +1 -1
- package/grid/static/array/sortBy.js +1 -1
- package/grid/static/array/sum.js +1 -1
- package/grid/static/array/toArray.js +1 -1
- package/grid/static/array/toTreeArray.js +1 -1
- package/grid/static/base/clear.js +1 -1
- package/grid/static/base/clone.js +1 -1
- package/grid/static/base/destructuring.js +1 -1
- package/grid/static/base/each.js +1 -1
- package/grid/static/base/eqNull.js +1 -1
- package/grid/static/base/findIndexOf.js +1 -1
- package/grid/static/base/get.js +1 -1
- package/grid/static/base/has.js +1 -1
- package/grid/static/base/hasOwnProp.js +1 -1
- package/grid/static/base/helperCreateGetObjects.js +1 -1
- package/grid/static/base/helperCreateInInObjectString.js +1 -1
- package/grid/static/base/helperCreateInTypeof.js +1 -1
- package/grid/static/base/helperCreateIndexOf.js +1 -1
- package/grid/static/base/helperCreateiterateIndexOf.js +1 -1
- package/grid/static/base/helperDefaultCompare.js +1 -1
- package/grid/static/base/helperDeleteProperty.js +1 -1
- package/grid/static/base/helperEqualCompare.js +1 -1
- package/grid/static/base/helperGetHGSKeys.js +5 -2
- package/grid/static/base/indexOf.js +1 -1
- package/grid/static/base/isArray.js +1 -1
- package/grid/static/base/isBoolean.js +1 -1
- package/grid/static/base/isDate.js +1 -1
- package/grid/static/base/isEmpty.js +1 -1
- package/grid/static/base/isEqual.js +1 -1
- package/grid/static/base/isFunction.js +1 -1
- package/grid/static/base/isNaN.js +1 -1
- package/grid/static/base/isNull.js +1 -1
- package/grid/static/base/isNumber.js +1 -1
- package/grid/static/base/isObject.js +1 -1
- package/grid/static/base/isPlainObject.js +1 -1
- package/grid/static/base/isRegExp.js +1 -1
- package/grid/static/base/isSet.js +1 -1
- package/grid/static/base/isString.js +1 -1
- package/grid/static/base/isUndefined.js +1 -1
- package/grid/static/base/keys.js +1 -1
- package/grid/static/base/lastEach.js +1 -1
- package/grid/static/base/remove.js +1 -1
- package/grid/static/base/set.js +1 -1
- package/grid/static/base/toJSONString.js +1 -1
- package/grid/static/base/toStringJSON.js +1 -1
- package/grid/static/base/uniqueId.js +1 -1
- package/grid/static/browse/browse.js +1 -1
- package/grid/static/function/property.js +1 -1
- package/grid/static/function/throttle.js +1 -1
- package/grid/static/index.js +1 -1
- package/grid/static/number/helperCreateToNumber.js +1 -1
- package/grid/static/number/toNumber.js +1 -1
- package/grid/static/object/assign.js +1 -1
- package/grid/static/object/extend.js +1 -1
- package/grid/static/object/lastObjectEach.js +1 -1
- package/grid/static/object/objectEach.js +1 -1
- package/grid/static/object/objectMap.js +1 -1
- package/grid/static/object/values.js +1 -1
- package/grid/static/static/staticDocument.js +1 -1
- package/grid/static/static/staticHGKeyRE.js +1 -1
- package/grid/static/static/staticParseInt.js +1 -1
- package/grid/static/static/staticStrUndefined.js +1 -1
- package/grid/static/static/staticWindow.js +1 -1
- package/grid/static/string/template.js +1 -1
- package/grid/static/string/toString.js +1 -1
- package/grid/utils/column.js +1 -1
- package/grid/utils/common.js +1 -1
- package/grid/utils/dom.js +3 -2
- package/grid/utils/event.js +1 -1
- package/grid/utils/index.js +1 -1
- package/guide/index.js +4 -3
- package/guide/vue.js +1 -1
- package/hrapprover/index.js +1 -1
- package/hrapprover/vue.js +1 -1
- package/image/index.js +6 -3
- package/image/vue.js +19 -3
- package/image-viewer/index.js +327 -42
- package/image-viewer/vue.js +64 -19
- package/index-bar/index.js +1 -2
- package/index-bar/vue.js +1 -1
- package/index-bar-anchor/vue.js +1 -1
- package/input/index.js +19 -6
- package/input/vue.js +43 -5
- package/ip-address/index.js +1 -1
- package/ip-address/vue.js +1 -1
- package/layout/vue.js +1 -1
- package/link/index.js +1 -1
- package/link/vue.js +1 -1
- package/link-menu/index.js +1 -1
- package/link-menu/vue.js +1 -1
- package/list/index.js +1 -1
- package/list/vue.js +1 -1
- package/loading/index.js +1 -1
- package/loading/vue.js +1 -1
- package/locales/index.js +2 -2
- package/locales/vue.js +1 -1
- package/logon-user/index.js +1 -1
- package/logon-user/vue.js +1 -1
- package/logout/index.js +1 -1
- package/logout/vue.js +1 -1
- package/milestone/index.js +3 -3
- package/milestone/vue.js +4 -4
- package/mini-picker/index.js +1 -1
- package/mini-picker/vue.js +1 -1
- package/modal/index.js +210 -107
- package/modal/vue.js +10 -7
- package/month-range/index.js +2 -2
- package/month-range/vue.js +3 -3
- package/month-table/index.js +3 -3
- package/month-table/vue.js +1 -1
- package/multi-select/index.js +1 -1
- package/multi-select/vue.js +1 -1
- package/nav-menu/index.js +103 -20
- package/nav-menu/vue.js +19 -9
- package/notify/index.js +1 -1
- package/notify/vue.js +1 -1
- package/numeric/index.js +28 -5
- package/numeric/vue.js +21 -11
- package/option/index.js +1 -1
- package/option/vue.js +1 -1
- package/option-group/index.js +1 -1
- package/option-group/vue.js +1 -1
- package/package.json +5 -4
- package/pager/vue.js +1 -1
- package/pager-item/index.js +1 -1
- package/pager-item/vue.js +1 -1
- package/panel/index.js +1 -1
- package/panel/vue.js +1 -1
- package/picker/index.js +8 -19
- package/picker/timezone.js +1 -1
- package/picker/vue.js +25 -30
- package/picker-column/index.js +1 -1
- package/picker-column/vue.js +1 -1
- package/pop-upload/index.js +1 -1
- package/pop-upload/vue.js +1 -1
- package/popconfirm/index.js +1 -1
- package/popconfirm/vue.js +1 -1
- package/popeditor/index.js +4 -1
- package/popeditor/vue.js +1 -1
- package/popover/index.js +21 -9
- package/popover/vue.js +49 -9
- package/popup/index.js +1 -1
- package/popup/vue.js +1 -1
- package/progress/index.js +1 -1
- package/progress/vue.js +1 -1
- package/pull-refresh/index.js +1 -3
- package/pull-refresh/vue.js +1 -1
- package/query-builder/index.js +1 -1
- package/query-builder/vue.js +1 -1
- package/radio/index.js +29 -6
- package/radio/vue.js +2 -2
- package/radio-button/index.js +26 -12
- package/radio-button/vue.js +14 -6
- package/radio-group/index.js +3 -3
- package/radio-group/vue.js +2 -2
- package/rate/index.js +1 -1
- package/rate/vue.js +1 -1
- package/record/index.js +1 -1
- package/record/vue.js +1 -1
- package/recycle-scroller/index.js +2 -1
- package/recycle-scroller/vue.js +1 -1
- package/rich-text-edtior/index.js +254 -0
- package/rich-text-edtior/vue.js +320 -0
- package/river/index.js +1 -1
- package/river/river.js +1 -1
- package/river/vue.js +1 -1
- package/roles/index.js +1 -1
- package/roles/vue.js +1 -1
- package/row/index.js +1 -1
- package/row/vue.js +1 -1
- package/scroll-text/index.js +1 -1
- package/scroll-text/vue.js +1 -1
- package/scrollbar/index.js +1 -1
- package/scrollbar/vue-bar.js +1 -1
- package/scrollbar/vue.js +1 -1
- package/search/index.js +12 -9
- package/search/vue.js +7 -7
- package/select/index.js +42 -22
- package/select/vue.js +7 -4
- package/select-dropdown/index.js +3 -3
- package/select-dropdown/vue.js +1 -1
- package/select-mobile/index.js +1 -1
- package/select-mobile/vue.js +1 -1
- package/select-view/index.js +1 -1
- package/select-view/vue.js +1 -1
- package/selected-box/index.js +1 -1
- package/selected-box/vue.js +1 -1
- package/slide-bar/index.js +1 -1
- package/slide-bar/vue.js +1 -1
- package/slider/index.js +36 -13
- package/slider/vue.js +5 -2
- package/slider-button/index.js +1 -1
- package/slider-button/vue.js +1 -1
- package/slider-button-group/slide-button.js +1 -1
- package/slider-button-group/vue.js +1 -1
- package/split/index.js +65 -22
- package/split/vue.js +48 -41
- package/standard-list-item/index.js +1 -1
- package/standard-list-item/vue.js +1 -1
- package/steps/index.js +1 -1
- package/steps/slide-bar.js +2 -1
- package/steps/vue.js +3 -2
- package/switch/index.js +4 -10
- package/switch/vue.js +4 -6
- package/tab-bar/index.js +33 -31
- package/tab-bar/vue.js +1 -1
- package/tab-dropdown/index.js +1 -1
- package/tab-dropdown/vue.js +1 -1
- package/tab-item/index.js +1 -1
- package/tab-item/vue.js +1 -1
- package/tab-item-mf/vue.js +1 -1
- package/tab-nav/index.js +19 -8
- package/tab-nav/vue.js +3 -2
- package/tabbar/index.js +36 -3
- package/tabbar/vue.js +34 -9
- package/tabbar-item/index.js +11 -6
- package/tabbar-item/vue.js +13 -8
- package/table/index.js +1 -1
- package/table/vue.js +1 -1
- package/tabs/index.js +22 -8
- package/tabs/vue.js +9 -2
- package/tabs-mf/index.js +1 -1
- package/tabs-mf/vue-bar.js +1 -1
- package/tabs-mf/vue-nav-item.js +1 -1
- package/tabs-mf/vue-nav.js +1 -1
- package/tabs-mf/vue.js +1 -1
- package/tabs-mf/wheel.js +1 -1
- package/tag/index.js +2 -2
- package/tag/vue.js +1 -1
- package/tag-group/index.js +1 -1
- package/tag-group/vue.js +1 -1
- package/tall-storage/index.js +1 -1
- package/tall-storage/vue-storage-box.js +1 -1
- package/tall-storage/vue.js +1 -1
- package/text-popup/index.js +1 -1
- package/text-popup/vue.js +1 -1
- package/time/index.js +2 -2
- package/time/vue.js +4 -4
- package/time-line/index.js +2 -2
- package/time-line/vue.js +5 -4
- package/time-panel/index.js +1 -1
- package/time-panel/scrollIntoView.js +1 -1
- package/time-panel/vue.js +1 -1
- package/time-picker-mobile/index.js +1 -1
- package/time-picker-mobile/vue.js +1 -1
- package/time-range/index.js +5 -5
- package/time-range/vue.js +4 -4
- package/time-spinner/index.js +1 -1
- package/time-spinner/vue.js +3 -3
- package/timeline-item/index.js +14 -15
- package/timeline-item/vue.js +7 -6
- package/toggle-menu/index.js +1 -1
- package/toggle-menu/vue.js +2 -1
- package/tooltip/index.js +6 -11
- package/tooltip/vue.js +5 -10
- package/top-box/index.js +1 -1
- package/top-box/vue.js +1 -1
- package/transfer/index.js +1 -1
- package/transfer/vue.js +1 -1
- package/transfer-panel/index.js +1 -1
- package/transfer-panel/vue.js +1 -1
- package/tree/index.js +2 -1
- package/tree/vue.js +1 -1
- package/tree-menu/index.js +6 -6
- package/tree-menu/vue.js +3 -3
- package/tree-node/index.js +5 -3
- package/tree-node/vue.js +6 -6
- package/types/action-menu.type.d.mts +88 -0
- package/types/action-sheet.type.d.mts +2 -0
- package/types/alert.type.d.mts +112 -0
- package/types/amount.type.d.mts +2 -0
- package/types/anchor.type.d.mts +87 -0
- package/types/area.type.d.mts +2 -0
- package/types/autocomplete.type.d.mts +2 -0
- package/types/autonavi-map.type.d.mts +2 -0
- package/types/avatar.type.d.mts +2 -0
- package/types/badge.type.d.mts +82 -0
- package/types/baidu-map.type.d.mts +2 -0
- package/types/breadcrumb-item.type.d.mts +31 -0
- package/types/breadcrumb.type.d.mts +57 -0
- package/types/bulletin-board.type.d.mts +2 -0
- package/types/button-group.type.d.mts +87 -0
- package/types/button.type.d.mts +90 -0
- package/types/calendar-bar.type.d.mts +2 -0
- package/types/calendar.type.d.mts +2 -0
- package/types/card-group.type.d.mts +2 -0
- package/types/card-template.type.d.mts +2 -0
- package/types/card.type.d.mts +2 -0
- package/types/carousel-item.type.d.mts +2 -0
- package/types/carousel.type.d.mts +2 -0
- package/types/cascader-menu.type.d.mts +49 -0
- package/types/cascader-mobile.type.d.mts +2 -0
- package/types/cascader-node.type.d.mts +53 -0
- package/types/cascader-panel.type.d.mts +241 -0
- package/types/cascader-select.type.d.mts +2 -0
- package/types/cascader.type.d.mts +2 -0
- package/types/cell.type.d.mts +2 -0
- package/types/chart-bar.type.d.mts +2 -0
- package/types/chart-boxplot.type.d.mts +2 -0
- package/types/chart-candle.type.d.mts +2 -0
- package/types/chart-core.type.d.mts +2 -0
- package/types/chart-funnel.type.d.mts +2 -0
- package/types/chart-gauge.type.d.mts +2 -0
- package/types/chart-graph.type.d.mts +2 -0
- package/types/chart-heatmap.type.d.mts +2 -0
- package/types/chart-line.type.d.mts +2 -0
- package/types/chart-liquidfill.type.d.mts +2 -0
- package/types/chart-map.type.d.mts +2 -0
- package/types/chart-pie.type.d.mts +2 -0
- package/types/chart-radar.type.d.mts +2 -0
- package/types/chart-sankey.type.d.mts +2 -0
- package/types/chart-scatter.type.d.mts +2 -0
- package/types/chart-sunburst.type.d.mts +2 -0
- package/types/chart-tree.type.d.mts +2 -0
- package/types/chart-waterfall.type.d.mts +2 -0
- package/types/chart-wordcloud.type.d.mts +2 -0
- package/types/checkbox-button.type.d.mts +2 -0
- package/types/checkbox-group.type.d.mts +2 -0
- package/types/checkbox.type.d.mts +154 -0
- package/types/col.type.d.mts +2 -0
- package/types/collapse-item.type.d.mts +60 -0
- package/types/collapse.type.d.mts +56 -0
- package/types/color-picker.type.d.mts +5 -0
- package/types/color-select-panel.type.d.mts +5 -0
- package/types/column-list-group.type.d.mts +2 -0
- package/types/column-list-item.type.d.mts +2 -0
- package/types/common.type.d.mts +2 -0
- package/types/company.type.d.mts +2 -0
- package/types/container.type.d.mts +2 -0
- package/types/country.type.d.mts +2 -0
- package/types/credit-card-form.type.d.mts +2 -0
- package/types/credit-card.type.d.mts +2 -0
- package/types/crop.type.d.mts +2 -0
- package/types/currency.type.d.mts +2 -0
- package/types/date-panel.type.d.mts +2 -0
- package/types/date-picker-mobile.type.d.mts +2 -0
- package/types/date-picker.type.d.mts +212 -0
- package/types/date-range.type.d.mts +2 -0
- package/types/date-table.type.d.mts +138 -0
- package/types/dept.type.d.mts +2 -0
- package/types/detail-page.type.d.mts +2 -0
- package/types/dialog-box.type.d.mts +250 -0
- package/types/dialog-select.type.d.mts +2 -0
- package/types/drawer.type.d.mts +2 -0
- package/types/drop-roles.type.d.mts +2 -0
- package/types/drop-times.type.d.mts +2 -0
- package/types/dropdown-item.type-e59174b8.d.ts +336 -0
- package/types/dropdown-item.type.d.mts +4 -0
- package/types/dropdown-menu.type.d.mts +4 -0
- package/types/dropdown.type.d.mts +142 -0
- package/types/dynamic-scroller-item.type.d.mts +2 -0
- package/types/dynamic-scroller.type.d.mts +2 -0
- package/types/espace.type.d.mts +2 -0
- package/types/exception.type.d.mts +2 -0
- package/types/fall-menu.type.d.mts +2 -0
- package/types/file-upload.type.d.mts +3 -0
- package/types/filter-bar.type.d.mts +2 -0
- package/types/filter-box.type.d.mts +2 -0
- package/types/filter-panel.type.d.mts +2 -0
- package/types/filter.type.d.mts +2 -0
- package/types/floatbar.type.d.mts +45 -0
- package/types/floating-button.type.d.mts +2 -0
- package/types/flowchart.type.d.mts +2 -0
- package/types/form-item.type.d.mts +3 -0
- package/types/form.type-004ecf93.d.ts +394 -0
- package/types/form.type.d.mts +3 -0
- package/types/fullscreen.type.d.mts +2 -0
- package/types/grid.type.d.mts +2 -0
- package/types/guide.type.d.mts +2 -0
- package/types/hrapprover.type.d.mts +2 -0
- package/types/image-viewer.type.d.mts +2 -0
- package/types/image.type.d.mts +176 -0
- package/types/index-bar-anchor.type.d.mts +2 -0
- package/types/index-bar.type.d.mts +2 -0
- package/types/index-e0250f63.d.ts +43 -0
- package/types/input.type.d.mts +294 -0
- package/types/ip-address.type.d.mts +2 -0
- package/types/layout.type.d.mts +2 -0
- package/types/link-menu.type.d.mts +2 -0
- package/types/link.type.d.mts +40 -0
- package/types/list.type.d.mts +2 -0
- package/types/loading.type.d.mts +90 -0
- package/types/locales.type.d.mts +2 -0
- package/types/logon-user.type.d.mts +2 -0
- package/types/logout.type.d.mts +2 -0
- package/types/milestone.type.d.mts +144 -0
- package/types/mini-picker.type.d.mts +2 -0
- package/types/modal.type.d.mts +264 -0
- package/types/month-range.type.d.mts +2 -0
- package/types/month-table.type.d.mts +2 -0
- package/types/multi-select.type.d.mts +2 -0
- package/types/nav-menu.type.d.mts +124 -0
- package/types/notify.type.d.mts +2 -0
- package/types/numeric.type.d.mts +275 -0
- package/types/option-group.type.d.mts +2 -0
- package/types/option.type.d.mts +2 -0
- package/types/pager-item.type.d.mts +2 -0
- package/types/pager.type.d.mts +2 -0
- package/types/panel.type.d.mts +2 -0
- package/types/picker-column.type.d.mts +2 -0
- package/types/picker.type.d.mts +191 -0
- package/types/pop-upload.type.d.mts +2 -0
- package/types/popconfirm.type.d.mts +2 -0
- package/types/popeditor.type.d.mts +275 -0
- package/types/popover.type.d.mts +164 -0
- package/types/popup.type.d.mts +2 -0
- package/types/progress.type.d.mts +216 -0
- package/types/pull-refresh.type.d.mts +2 -0
- package/types/query-builder.type.d.mts +2 -0
- package/types/radio-button.type.d.mts +90 -0
- package/types/radio-group.type.d.mts +67 -0
- package/types/radio.type.d.mts +103 -0
- package/types/rate.type.d.mts +2 -0
- package/types/record.type.d.mts +2 -0
- package/types/recycle-scroller.type.d.mts +2 -0
- package/types/river.type.d.mts +2 -0
- package/types/roles.type.d.mts +2 -0
- package/types/row.type.d.mts +2 -0
- package/types/scroll-text.type.d.mts +2 -0
- package/types/scrollbar.type.d.mts +2 -0
- package/types/search.type.d.mts +40 -0
- package/types/select-dropdown.type.d.mts +2 -0
- package/types/select-mobile.type.d.mts +2 -0
- package/types/select-view.type.d.mts +2 -0
- package/types/select.type.d.mts +2 -0
- package/types/selected-box.type.d.mts +2 -0
- package/types/shared.type.d.mts +178 -0
- package/types/slide-bar.type.d.mts +2 -0
- package/types/slider-button-group.type.d.mts +2 -0
- package/types/slider-button.type.d.mts +2 -0
- package/types/slider.type.d.mts +199 -0
- package/types/split.type.d.mts +2 -0
- package/types/standard-list-item.type.d.mts +2 -0
- package/types/steps.type.d.mts +78 -0
- package/types/switch.type.d.mts +113 -0
- package/types/tab-bar.type.d.mts +42 -0
- package/types/tab-dropdown.type.d.mts +2 -0
- package/types/tab-item-mf.type.d.mts +2 -0
- package/types/tab-item.type.d.mts +71 -0
- package/types/tab-nav.type.d.mts +106 -0
- package/types/tabbar-item.type.d.mts +2 -0
- package/types/tabbar.type.d.mts +2 -0
- package/types/table.type.d.mts +2 -0
- package/types/tabs-mf.type.d.mts +2 -0
- package/types/tabs.type.d.mts +148 -0
- package/types/tag-group.type.d.mts +2 -0
- package/types/tag.type.d.mts +51 -0
- package/types/tall-storage.type.d.mts +2 -0
- package/types/text-popup.type.d.mts +2 -0
- package/types/time-line.type-4a01d597.d.ts +280 -0
- package/types/time-line.type.d.mts +3 -0
- package/types/time-panel.type.d.mts +2 -0
- package/types/time-picker-mobile.type.d.mts +2 -0
- package/types/time-range.type.d.mts +2 -0
- package/types/time-spinner.type.d.mts +2 -0
- package/types/time.type.d.mts +2 -0
- package/types/timeline-item.type.d.mts +3 -0
- package/types/toggle-menu.type.d.mts +2 -0
- package/types/tooltip.type.d.mts +189 -0
- package/types/top-box.type.d.mts +2 -0
- package/types/transfer-panel.type.d.mts +2 -0
- package/types/transfer.type.d.mts +2 -0
- package/types/tree-menu.type.d.mts +2 -0
- package/types/tree-node.type.d.mts +2 -0
- package/types/tree.type.d.mts +2 -0
- package/types/upload-dragger.type.d.mts +50 -0
- package/types/upload-list.type-aa21a42e.d.ts +1130 -0
- package/types/upload-list.type.d.mts +3 -0
- package/types/upload.type.d.mts +3 -0
- package/types/user-account.type.d.mts +2 -0
- package/types/user-contact.type.d.mts +2 -0
- package/types/user-head-group.type.d.mts +2 -0
- package/types/user-head.type.d.mts +2 -0
- package/types/user-link.type.d.mts +2 -0
- package/types/user.type.d.mts +2 -0
- package/types/wheel.type.d.mts +2 -0
- package/types/wizard.type.d.mts +95 -0
- package/types/year-range.type.d.mts +2 -0
- package/types/year-table.type.d.mts +2 -0
- package/upload/index.js +103 -25
- package/upload/vue.js +4 -1
- package/upload-dragger/index.js +3 -2
- package/upload-dragger/vue.js +1 -1
- package/upload-list/index.js +7 -5
- package/upload-list/vue.js +3 -2
- package/user/index.js +5 -3
- package/user/vue.js +2 -2
- package/user-account/index.js +1 -1
- package/user-account/vue.js +1 -1
- package/user-contact/index.js +1 -1
- package/user-contact/vue.js +1 -1
- package/user-head/index.js +26 -31
- package/user-head/vue.js +16 -13
- package/user-head-group/index.js +20 -0
- package/user-head-group/vue.js +18 -5
- package/user-link/index.js +1 -1
- package/user-link/vue.js +1 -1
- package/wheel/index.js +1 -1
- package/wheel/vue.js +1 -1
- package/wizard/index.js +1 -1
- package/wizard/vue.js +1 -2
- package/year-range/index.js +2 -2
- package/year-range/vue.js +4 -4
- package/year-table/index.js +3 -3
- package/year-table/vue.js +1 -1
- /package/{chunk-PKUHTIDK.js → chunk-G2ADBYYC.js} +0 -0
package/common/deps/popper.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-G2ADBYYC.js";
|
|
4
4
|
import { on, off } from "./dom";
|
|
5
5
|
import PopupManager from "./popup-manager";
|
|
6
6
|
import { typeOf } from "../type";
|
|
7
|
-
import { xss } from "../xss";
|
|
8
7
|
const positions = ["left", "right", "top", "bottom"];
|
|
9
8
|
const modifiers = ["shift", "offset", "preventOverflow", "keepTogether", "arrow", "flip", "applyStyle"];
|
|
10
9
|
const DEFAULTS = {
|
|
@@ -13,16 +12,16 @@ const DEFAULTS = {
|
|
|
13
12
|
boundariesElement: "viewport",
|
|
14
13
|
boundariesPadding: 5,
|
|
15
14
|
flipBehavior: "flip",
|
|
15
|
+
// 全局没有修改过它,所以它一直是flip
|
|
16
16
|
forceAbsolute: false,
|
|
17
17
|
gpuAcceleration: true,
|
|
18
|
+
// 这个用不到了,默认使用tranform3d
|
|
18
19
|
offset: 0,
|
|
19
20
|
placement: "bottom",
|
|
20
21
|
preventOverflowOrder: positions,
|
|
21
|
-
modifiers
|
|
22
|
-
|
|
22
|
+
modifiers
|
|
23
|
+
// 此处是string数组, 构造函数调用之后转为函数数组
|
|
23
24
|
};
|
|
24
|
-
const getRealWindow = () => window.tinyGetRealWindow ? window.tinyGetRealWindow() : window;
|
|
25
|
-
const getRealElement = (el) => el.jquery ? el[0] : el;
|
|
26
25
|
const setStyle = (el, styles) => {
|
|
27
26
|
const isNumeric = (n) => n !== "" && !isNaN(parseFloat(n)) && isFinite(n);
|
|
28
27
|
Object.keys(styles).forEach((prop) => {
|
|
@@ -33,28 +32,6 @@ const setStyle = (el, styles) => {
|
|
|
33
32
|
el.style[prop] = styles[prop] + unit;
|
|
34
33
|
});
|
|
35
34
|
};
|
|
36
|
-
const getSupportedPropertyName = (property) => {
|
|
37
|
-
let prefixes = ["", "ms", "webkit", "moz", "o"];
|
|
38
|
-
let bodyEl = window.document.body;
|
|
39
|
-
for (let i = 0; i < prefixes.length; i++) {
|
|
40
|
-
let toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;
|
|
41
|
-
if (typeof bodyEl.style[toCheck] !== "undefined") {
|
|
42
|
-
return toCheck;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return null;
|
|
46
|
-
};
|
|
47
|
-
const addClassNames = (el, classNames) => {
|
|
48
|
-
classNames.forEach((className) => {
|
|
49
|
-
el.classList.add(className);
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
const addAttributes = (el, attributes) => {
|
|
53
|
-
attributes.forEach((attribute) => {
|
|
54
|
-
const attrs = attribute.split(":");
|
|
55
|
-
el.setAttribute(attrs[0], attrs[1] || "");
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
35
|
const getOffsetParent = (el) => {
|
|
59
36
|
let offsetParent = el.offsetParent;
|
|
60
37
|
return offsetParent === window.document.body || !offsetParent ? window.document.documentElement : offsetParent;
|
|
@@ -76,16 +53,14 @@ const isFixed = (el) => {
|
|
|
76
53
|
return el.parentNode ? isFixed(el.parentNode) : false;
|
|
77
54
|
};
|
|
78
55
|
const getBoundingClientRect = (el) => {
|
|
79
|
-
let
|
|
80
|
-
let isIE = navigator.userAgent.includes("MSIE");
|
|
81
|
-
let rectTop = isIE && el.tagName === "HTML" ? -el.scrollTop : rectObj.top;
|
|
56
|
+
let rect = el.getBoundingClientRect();
|
|
82
57
|
return {
|
|
83
|
-
left:
|
|
84
|
-
top:
|
|
85
|
-
right:
|
|
86
|
-
bottom:
|
|
87
|
-
width:
|
|
88
|
-
height:
|
|
58
|
+
left: rect.left,
|
|
59
|
+
top: rect.top,
|
|
60
|
+
right: rect.right,
|
|
61
|
+
bottom: rect.bottom,
|
|
62
|
+
width: rect.right - rect.left,
|
|
63
|
+
height: rect.bottom - rect.top
|
|
89
64
|
};
|
|
90
65
|
};
|
|
91
66
|
const isScrollElement = (el) => {
|
|
@@ -106,7 +81,7 @@ const getScrollParent = (el) => {
|
|
|
106
81
|
if (isScrollElement(parent)) {
|
|
107
82
|
return parent;
|
|
108
83
|
}
|
|
109
|
-
return getScrollParent(
|
|
84
|
+
return getScrollParent(parent);
|
|
110
85
|
};
|
|
111
86
|
const getOffsetRectRelativeToCustomParent = (el, parent, fixed) => {
|
|
112
87
|
let { top, left, width, height } = getBoundingClientRect(el);
|
|
@@ -161,16 +136,6 @@ const getPopperClientRect = (popperOffsets) => {
|
|
|
161
136
|
offsets.bottom = offsets.top + offsets.height;
|
|
162
137
|
return offsets;
|
|
163
138
|
};
|
|
164
|
-
const getArrayKeyIndex = (arr, keyToFind) => {
|
|
165
|
-
let i = 0;
|
|
166
|
-
for (let value of arr) {
|
|
167
|
-
if (value === keyToFind) {
|
|
168
|
-
return i;
|
|
169
|
-
}
|
|
170
|
-
i++;
|
|
171
|
-
}
|
|
172
|
-
return null;
|
|
173
|
-
};
|
|
174
139
|
const getAllScrollParents = (el, parents = []) => {
|
|
175
140
|
const parent = el.parentNode;
|
|
176
141
|
if (parent) {
|
|
@@ -183,446 +148,376 @@ const getAllScrollParents = (el, parents = []) => {
|
|
|
183
148
|
return parents;
|
|
184
149
|
};
|
|
185
150
|
const getOffsetRect = (el) => {
|
|
186
|
-
|
|
151
|
+
const elementRect = {
|
|
187
152
|
width: el.offsetWidth,
|
|
188
153
|
height: el.offsetHeight,
|
|
189
154
|
left: el.offsetLeft,
|
|
190
|
-
top: el.offsetTop
|
|
155
|
+
top: el.offsetTop,
|
|
156
|
+
right: 0,
|
|
157
|
+
bottom: 0
|
|
191
158
|
};
|
|
192
159
|
elementRect.right = elementRect.left + elementRect.width;
|
|
193
160
|
elementRect.bottom = elementRect.top + elementRect.height;
|
|
194
161
|
return elementRect;
|
|
195
162
|
};
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
this._popper =
|
|
203
|
-
|
|
204
|
-
this.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
163
|
+
class Popper {
|
|
164
|
+
constructor(reference, popper, options) {
|
|
165
|
+
this.modifiers = {};
|
|
166
|
+
/** 每次update, 计算popper的大小并缓存 */
|
|
167
|
+
this.popperOuterSize = null;
|
|
168
|
+
this._reference = reference;
|
|
169
|
+
this._popper = popper;
|
|
170
|
+
this.state = {};
|
|
171
|
+
this._options = __spreadValues(__spreadValues({}, DEFAULTS), options);
|
|
172
|
+
this._options.modifierFns = modifiers.map((modifier) => {
|
|
173
|
+
return this[modifier];
|
|
174
|
+
});
|
|
175
|
+
this._popper.setAttribute("x-placement", this._options.placement);
|
|
176
|
+
this.state.position = this._getPopperPositionByRefernce(this._reference);
|
|
177
|
+
setStyle(this._popper, { position: this.state.position, top: 0 });
|
|
178
|
+
this.update();
|
|
179
|
+
this._setupEventListeners();
|
|
180
|
+
}
|
|
181
|
+
destroy() {
|
|
182
|
+
this._popper.removeAttribute("x-placement");
|
|
183
|
+
this._popper.style.display = "none";
|
|
184
|
+
this._removeEventListeners();
|
|
185
|
+
this._options.removeOnDestroy && this._popper.remove();
|
|
186
|
+
return this;
|
|
187
|
+
}
|
|
188
|
+
onUpdate(callback) {
|
|
189
|
+
this.state.updateCallback = callback;
|
|
190
|
+
return this;
|
|
191
|
+
}
|
|
192
|
+
update() {
|
|
193
|
+
let data = { instance: this, styles: {} };
|
|
194
|
+
this.popperOuterSize = null;
|
|
195
|
+
data.placement = data._originalPlacement = this._options.placement;
|
|
196
|
+
data.offsets = this._getRefPopOffsets(this._popper, this._reference, data.placement);
|
|
197
|
+
data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);
|
|
198
|
+
data = this.runModifiers(data, this._options.modifierFns);
|
|
199
|
+
typeof this.state.updateCallback === "function" && this.state.updateCallback(data);
|
|
200
|
+
}
|
|
201
|
+
/** 按顺序执行Modifiers, 如果传入终点modifier,则执行到指定位置 */
|
|
202
|
+
runModifiers(data, modifiers2, ends) {
|
|
203
|
+
let modifiersToRun = modifiers2.slice();
|
|
204
|
+
const _options = this._options;
|
|
205
|
+
if (ends !== void 0) {
|
|
206
|
+
modifiersToRun = this._options.modifierFns.slice(
|
|
207
|
+
0,
|
|
208
|
+
_options.modifierFns.findIndex((m) => m == ends)
|
|
209
|
+
);
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
setStyle(this._popper, { position: this.state.position, top: 0 });
|
|
218
|
-
this.update();
|
|
219
|
-
this._setupEventListeners();
|
|
220
|
-
this._oldreference = this._reference;
|
|
221
|
-
this._oldreference._popper = this._popper.style || {};
|
|
222
|
-
return this;
|
|
223
|
-
}
|
|
224
|
-
Popper.prototype.destroy = function() {
|
|
225
|
-
this._popper.removeAttribute("x-placement");
|
|
226
|
-
const popperStyle = this._reference === this._oldreference && this._oldreference._popper || {};
|
|
227
|
-
this._popper.style.display = "none";
|
|
228
|
-
this._popper.style.position = "";
|
|
229
|
-
this._popper.style.top = popperStyle.top || "";
|
|
230
|
-
this._popper.style.left = popperStyle.left || "";
|
|
231
|
-
this._popper.style[getSupportedPropertyName("transform")] = "";
|
|
232
|
-
this._removeEventListeners();
|
|
233
|
-
this._options.removeOnDestroy && this._popper.remove();
|
|
234
|
-
return this;
|
|
235
|
-
};
|
|
236
|
-
Popper.prototype.onCreate = function(callback) {
|
|
237
|
-
callback(this);
|
|
238
|
-
return this;
|
|
239
|
-
};
|
|
240
|
-
Popper.prototype.onUpdate = function(callback) {
|
|
241
|
-
this.state.updateCallback = callback;
|
|
242
|
-
return this;
|
|
243
|
-
};
|
|
244
|
-
Popper.prototype.update = function() {
|
|
245
|
-
let data = { instance: this, styles: {} };
|
|
246
|
-
this.popperOuterSize = null;
|
|
247
|
-
data.placement = data._originalPlacement = this._options.placement;
|
|
248
|
-
data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
|
|
249
|
-
data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);
|
|
250
|
-
data = this.runModifiers(data, this._options.modifiers);
|
|
251
|
-
typeof this.state.updateCallback === "function" && this.state.updateCallback(data);
|
|
252
|
-
};
|
|
253
|
-
Popper.prototype.parse = function(config) {
|
|
254
|
-
let defaultConfig = {
|
|
255
|
-
attributes: [],
|
|
256
|
-
arrowTagName: "div",
|
|
257
|
-
arrowClassNames: ["popper__arrow"],
|
|
258
|
-
arrowAttributes: ["x-arrow"],
|
|
259
|
-
classNames: ["popper"],
|
|
260
|
-
content: "",
|
|
261
|
-
contentType: "text",
|
|
262
|
-
parent: window.document.body,
|
|
263
|
-
tagName: "div"
|
|
264
|
-
};
|
|
265
|
-
config = __spreadValues(__spreadValues({}, defaultConfig), config);
|
|
266
|
-
const { tagName, classNames, attributes, contentType, content, arrowTagName } = config;
|
|
267
|
-
let docEl = window.document;
|
|
268
|
-
let popper = docEl.createElement(tagName);
|
|
269
|
-
addClassNames(popper, classNames);
|
|
270
|
-
addAttributes(popper, attributes);
|
|
271
|
-
if (contentType === "node") {
|
|
272
|
-
popper.appendChild(getRealElement(content));
|
|
273
|
-
} else if (contentType === "html") {
|
|
274
|
-
popper.innerHTML = xss.filterHtml(content);
|
|
275
|
-
} else {
|
|
276
|
-
popper.textContent = content;
|
|
277
|
-
}
|
|
278
|
-
if (arrowTagName) {
|
|
279
|
-
let arrow = docEl.createElement(arrowTagName);
|
|
280
|
-
addClassNames(arrow, config.arrowClassNames);
|
|
281
|
-
addAttributes(arrow, config.arrowAttributes);
|
|
282
|
-
popper.appendChild(arrow);
|
|
211
|
+
modifiersToRun.forEach((modifier) => {
|
|
212
|
+
if (typeOf(modifier) === "function") {
|
|
213
|
+
data = modifier.call(this, data);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
return data;
|
|
283
217
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
|
|
218
|
+
// 此时才把offsets.popper 赋值给popper dom, offsets.array赋值给array dom
|
|
219
|
+
applyStyle(data) {
|
|
220
|
+
let styles = { position: data.offsets.popper.position };
|
|
221
|
+
let left = Math.round(data.offsets.popper.left);
|
|
222
|
+
let top = Math.round(data.offsets.popper.top);
|
|
223
|
+
styles.transform = `translate3d(${left}px, ${top}px, 0)`;
|
|
224
|
+
Object.assign(styles, { top: 0, left: 0 });
|
|
225
|
+
Object.assign(styles, data.styles);
|
|
226
|
+
setStyle(this._popper, styles);
|
|
227
|
+
this._popper.setAttribute("x-placement", data.placement);
|
|
228
|
+
if (data.offsets.arrow) {
|
|
229
|
+
setStyle(data.arrowElement, data.offsets.arrow);
|
|
291
230
|
}
|
|
231
|
+
return data;
|
|
292
232
|
}
|
|
293
|
-
|
|
294
|
-
|
|
233
|
+
// 判断 placement是不是2段式的,是则处理一下偏移。 修改data.offsets.popper的值
|
|
234
|
+
shift(data) {
|
|
235
|
+
let placement = data.placement;
|
|
236
|
+
let basePlacement = placement.split("-")[0];
|
|
237
|
+
let shiftVariation = placement.split("-")[1];
|
|
238
|
+
if (shiftVariation) {
|
|
239
|
+
let { top, left, height, width } = data.offsets.reference;
|
|
240
|
+
let popper = getPopperClientRect(data.offsets.popper);
|
|
241
|
+
let shiftOffsets = {
|
|
242
|
+
y: {
|
|
243
|
+
start: { top },
|
|
244
|
+
end: { top: top + height - popper.height }
|
|
245
|
+
},
|
|
246
|
+
x: {
|
|
247
|
+
start: { left },
|
|
248
|
+
end: { left: left + width - popper.width }
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
let axis = ~["bottom", "top"].indexOf(basePlacement) ? "x" : "y";
|
|
252
|
+
data.offsets.popper = Object.assign(popper, shiftOffsets[axis][shiftVariation]);
|
|
253
|
+
}
|
|
254
|
+
return data;
|
|
295
255
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
256
|
+
// 校正popper的位置在boundaries 的内部
|
|
257
|
+
preventOverflow(data) {
|
|
258
|
+
let order = this._options.preventOverflowOrder;
|
|
259
|
+
let popper = getPopperClientRect(data.offsets.popper);
|
|
260
|
+
let check = {
|
|
261
|
+
top: () => {
|
|
262
|
+
let { top } = popper;
|
|
263
|
+
if (top < data.boundaries.top) {
|
|
264
|
+
top = Math.max(top, data.boundaries.top);
|
|
265
|
+
}
|
|
266
|
+
return { top };
|
|
267
|
+
},
|
|
268
|
+
right: () => {
|
|
269
|
+
let { left } = popper;
|
|
270
|
+
if (popper.right > data.boundaries.right) {
|
|
271
|
+
left = Math.min(left, data.boundaries.right - popper.width);
|
|
272
|
+
}
|
|
273
|
+
return { left };
|
|
274
|
+
},
|
|
275
|
+
bottom: () => {
|
|
276
|
+
let { top } = popper;
|
|
277
|
+
if (popper.bottom > data.boundaries.bottom) {
|
|
278
|
+
top = Math.min(top, data.boundaries.bottom - popper.height);
|
|
279
|
+
}
|
|
280
|
+
return { top };
|
|
281
|
+
},
|
|
282
|
+
left: () => {
|
|
283
|
+
let { left } = popper;
|
|
284
|
+
if (popper.left < data.boundaries.left) {
|
|
285
|
+
left = Math.max(left, data.boundaries.left);
|
|
286
|
+
}
|
|
287
|
+
return { left };
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
order.forEach((direction) => {
|
|
291
|
+
data.offsets.popper = Object.assign(popper, check[direction]());
|
|
292
|
+
});
|
|
293
|
+
return data;
|
|
302
294
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
popperOffsets.position = this.state.position;
|
|
310
|
-
let isParentFixed = popperOffsets.position === "fixed";
|
|
311
|
-
let referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
|
|
312
|
-
let { width, height } = this.popperOuterSize ? this.popperOuterSize : this.popperOuterSize = getOuterSizes(popper);
|
|
313
|
-
if (~["right", "left"].indexOf(placement)) {
|
|
314
|
-
popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - height / 2;
|
|
315
|
-
if (placement === "left") {
|
|
316
|
-
popperOffsets.left = referenceOffsets.left - width;
|
|
317
|
-
} else {
|
|
318
|
-
popperOffsets.left = referenceOffsets.right;
|
|
295
|
+
// 校正popper的位置在reference的边上。 如果2个分离了,重新调整popper的位置。 可能是担心 modifiers.offset 带来的副作用吧
|
|
296
|
+
keepTogether(data) {
|
|
297
|
+
let popper = getPopperClientRect(data.offsets.popper);
|
|
298
|
+
let reference = data.offsets.reference;
|
|
299
|
+
if (popper.right < Math.floor(reference.left)) {
|
|
300
|
+
data.offsets.popper.left = Math.floor(reference.left) - popper.width;
|
|
319
301
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
if (placement === "top") {
|
|
323
|
-
popperOffsets.top = referenceOffsets.top - height;
|
|
324
|
-
} else {
|
|
325
|
-
popperOffsets.top = referenceOffsets.bottom;
|
|
302
|
+
if (popper.left > Math.floor(reference.right)) {
|
|
303
|
+
data.offsets.popper.left = Math.floor(reference.right);
|
|
326
304
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
popperOffsets.height = height;
|
|
330
|
-
return {
|
|
331
|
-
popper: popperOffsets,
|
|
332
|
-
reference: referenceOffsets
|
|
333
|
-
};
|
|
334
|
-
};
|
|
335
|
-
Popper.prototype._setupEventListeners = function() {
|
|
336
|
-
this.state.updateBound = this.update.bind(this);
|
|
337
|
-
on(window, "resize", this.state.updateBound);
|
|
338
|
-
if (this._options.boundariesElement !== "window") {
|
|
339
|
-
let target = getScrollParent(this._reference);
|
|
340
|
-
if (target === window.document.body || target === window.document.documentElement) {
|
|
341
|
-
target = window;
|
|
305
|
+
if (popper.bottom < Math.floor(reference.top)) {
|
|
306
|
+
data.offsets.popper.top = Math.floor(reference.top) - popper.height;
|
|
342
307
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
let targets = getAllScrollParents(this._reference);
|
|
346
|
-
this.state.scrollTargets = targets || [];
|
|
347
|
-
targets.forEach((target2) => {
|
|
348
|
-
on(target2, "scroll", this.state.updateBound);
|
|
349
|
-
});
|
|
350
|
-
} else {
|
|
351
|
-
on(target, "scroll", this.state.updateBound);
|
|
308
|
+
if (popper.top > Math.floor(reference.bottom)) {
|
|
309
|
+
data.offsets.popper.top = Math.floor(reference.bottom);
|
|
352
310
|
}
|
|
311
|
+
return data;
|
|
353
312
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
off(this.state.scrollTarget, "scroll", this.state.updateBound);
|
|
359
|
-
this.state.scrollTarget = null;
|
|
360
|
-
if (this._options.bubbling || PopupManager.globalScroll) {
|
|
361
|
-
let targets = this.state.scrollTargets || [];
|
|
362
|
-
targets.forEach((target) => {
|
|
363
|
-
off(target, "scroll", this.state.updateBound);
|
|
364
|
-
});
|
|
365
|
-
this.state.scrollTargets = null;
|
|
313
|
+
// 根据flip的策略,计算当前应该显示的位置。 空间不够要计算出flip的位置。 可能是担心preventOverflow 时,造成pop, reference会重叠。 重叠了就要flip一下
|
|
314
|
+
flip(data) {
|
|
315
|
+
if (data.flipped && data.placement === data._originalPlacement) {
|
|
316
|
+
return data;
|
|
366
317
|
}
|
|
318
|
+
const placements = data.placement.split("-");
|
|
319
|
+
let placement = placements[0];
|
|
320
|
+
let placementOpposite = getOppositePlacement(placement);
|
|
321
|
+
let variation = placements[1] || "";
|
|
322
|
+
let flipOrderArr = [placement, placementOpposite];
|
|
323
|
+
flipOrderArr.forEach((step, index) => {
|
|
324
|
+
if (placement !== step || flipOrderArr.length === index + 1) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
placement = data.placement.split("-")[0];
|
|
328
|
+
placementOpposite = getOppositePlacement(placement);
|
|
329
|
+
let popperOffsets = getPopperClientRect(data.offsets.popper);
|
|
330
|
+
let a = ~["right", "bottom"].indexOf(placement);
|
|
331
|
+
let p = Math.floor(data.offsets.reference[placement]);
|
|
332
|
+
let po = Math.floor(popperOffsets[placementOpposite]);
|
|
333
|
+
if (a && p > po || !a && p < po) {
|
|
334
|
+
data.flipped = true;
|
|
335
|
+
data.placement = flipOrderArr[index + 1];
|
|
336
|
+
if (variation) {
|
|
337
|
+
data.placement += `-${variation}`;
|
|
338
|
+
}
|
|
339
|
+
data.offsets.popper = this._getRefPopOffsets(this._popper, this._reference, data.placement).popper;
|
|
340
|
+
data = this.runModifiers(data, this._options.modifierFns, this.flip);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
return data;
|
|
367
344
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
let offsetParentRect = getOffsetRect(offsetParent);
|
|
381
|
-
let isFixed2 = data.offsets.popper.position === "fixed";
|
|
382
|
-
let scrollTop = isFixed2 ? 0 : getScrollTopValue(scrollParent);
|
|
383
|
-
let scrollLeft = isFixed2 ? 0 : getScrollLeftValue(scrollParent);
|
|
384
|
-
const viewportWindow = getRealWindow();
|
|
385
|
-
boundaries = {
|
|
386
|
-
top: 0 - (offsetParentRect.top - scrollTop),
|
|
387
|
-
right: viewportWindow.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),
|
|
388
|
-
bottom: viewportWindow.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),
|
|
389
|
-
left: 0 - (offsetParentRect.left - scrollLeft)
|
|
390
|
-
};
|
|
391
|
-
} else {
|
|
392
|
-
if (getOffsetParent(this._popper) === boundariesElement) {
|
|
393
|
-
const { clientWidth, clientHeight } = boundariesElement;
|
|
394
|
-
boundaries = {
|
|
395
|
-
right: clientWidth,
|
|
396
|
-
bottom: clientHeight,
|
|
397
|
-
top: 0,
|
|
398
|
-
left: 0
|
|
399
|
-
};
|
|
400
|
-
} else {
|
|
401
|
-
boundaries = getOffsetRect(boundariesElement);
|
|
345
|
+
// 根据入参option上的offset, 给data.offset.popper进行校正
|
|
346
|
+
offset(data) {
|
|
347
|
+
let offset = this._options.offset;
|
|
348
|
+
let popper = data.offsets.popper;
|
|
349
|
+
if (~data.placement.indexOf("left")) {
|
|
350
|
+
popper.top -= offset;
|
|
351
|
+
} else if (~data.placement.indexOf("right")) {
|
|
352
|
+
popper.top += offset;
|
|
353
|
+
} else if (~data.placement.indexOf("top")) {
|
|
354
|
+
popper.left -= offset;
|
|
355
|
+
} else if (~data.placement.indexOf("bottom")) {
|
|
356
|
+
popper.left += offset;
|
|
402
357
|
}
|
|
358
|
+
return data;
|
|
403
359
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
Popper.prototype.isModifierRequired = function(requesting, requested) {
|
|
411
|
-
let index = getArrayKeyIndex(this._options.modifiers, requesting);
|
|
412
|
-
return !!this._options.modifiers.slice(0, index).filter((modifier) => modifier === requested).length;
|
|
413
|
-
};
|
|
414
|
-
Popper.prototype.runModifiers = function(data, modifiers2, ends) {
|
|
415
|
-
let modifiersToRun = modifiers2.slice();
|
|
416
|
-
const _options = this._options;
|
|
417
|
-
if (ends !== void 0) {
|
|
418
|
-
modifiersToRun = _options.modifiers.slice(0, getArrayKeyIndex(_options.modifiers, ends));
|
|
419
|
-
}
|
|
420
|
-
modifiersToRun.forEach((modifier) => {
|
|
421
|
-
if (typeOf(modifier) === "function") {
|
|
422
|
-
data = modifier.call(this, data);
|
|
360
|
+
// 计算arrow的位置,保存在data.offsets.arrow ={top,left}
|
|
361
|
+
arrow(data) {
|
|
362
|
+
let arrow = this._options.arrowElement;
|
|
363
|
+
let arrowOffset = this._options.arrowOffset;
|
|
364
|
+
if (typeof arrow === "string") {
|
|
365
|
+
arrow = this._popper.querySelector(arrow);
|
|
423
366
|
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
let styles = { position: data.offsets.popper.position };
|
|
430
|
-
let left = Math.round(data.offsets.popper.left);
|
|
431
|
-
let top = Math.round(data.offsets.popper.top);
|
|
432
|
-
let prefixedProperty;
|
|
433
|
-
if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName("transform"))) {
|
|
434
|
-
styles[prefixedProperty] = `translate3d(${left}px, ${top}px, 0)`;
|
|
435
|
-
Object.assign(styles, { top: 0, left: 0 });
|
|
436
|
-
} else {
|
|
437
|
-
Object.assign(styles, { top, left });
|
|
438
|
-
}
|
|
439
|
-
Object.assign(styles, data.styles);
|
|
440
|
-
setStyle(this._popper, styles);
|
|
441
|
-
this._popper.setAttribute("x-placement", data.placement);
|
|
442
|
-
const modifiers2 = this.modifiers;
|
|
443
|
-
if (this.isModifierRequired(modifiers2.applyStyle, modifiers2.arrow) && data.offsets.arrow) {
|
|
444
|
-
setStyle(data.arrowElement, data.offsets.arrow);
|
|
445
|
-
}
|
|
446
|
-
return data;
|
|
447
|
-
};
|
|
448
|
-
Popper.prototype.modifiers.shift = function(data) {
|
|
449
|
-
let placement = data.placement;
|
|
450
|
-
let basePlacement = placement.split("-")[0];
|
|
451
|
-
let shiftVariation = placement.split("-")[1];
|
|
452
|
-
if (shiftVariation) {
|
|
453
|
-
let { top, left, height, width } = data.offsets.reference;
|
|
367
|
+
if (!arrow || !this._popper.contains(arrow)) {
|
|
368
|
+
return data;
|
|
369
|
+
}
|
|
370
|
+
let arrowStyle = {};
|
|
371
|
+
let placement = data.placement.split("-")[0];
|
|
454
372
|
let popper = getPopperClientRect(data.offsets.popper);
|
|
455
|
-
let
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
373
|
+
let reference = data.offsets.reference;
|
|
374
|
+
let isVertical = ~["left", "right"].indexOf(placement);
|
|
375
|
+
let calcProp = isVertical ? "height" : "width";
|
|
376
|
+
let opSide = isVertical ? "bottom" : "right";
|
|
377
|
+
let altSide = isVertical ? "left" : "top";
|
|
378
|
+
let side = isVertical ? "top" : "left";
|
|
379
|
+
let popperRect = this.popperOuterSize ? this.popperOuterSize : this.popperOuterSize = getOuterSizes(this._popper);
|
|
380
|
+
let arrowRect = getOuterSizes(arrow);
|
|
381
|
+
let arrowSize = arrowRect[calcProp];
|
|
382
|
+
if (reference[opSide] - arrowSize < popper[side]) {
|
|
383
|
+
data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
|
|
384
|
+
}
|
|
385
|
+
if (reference[side] + arrowSize > popper[opSide]) {
|
|
386
|
+
data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
|
|
387
|
+
}
|
|
388
|
+
let center = reference[side] + (arrowOffset || reference[calcProp] / 2 - arrowSize / 2);
|
|
389
|
+
let sideValue = center - popper[side];
|
|
390
|
+
sideValue = Math.max(Math.min(popper[calcProp] - arrowSize - 8, sideValue), 8);
|
|
391
|
+
arrowStyle[side] = sideValue;
|
|
392
|
+
arrowStyle[altSide] = "";
|
|
393
|
+
const params = this._options.placement.split("-");
|
|
394
|
+
if (this._options.adjustArrow && ~["top", "bottom"].indexOf(params[0]) && side === "left") {
|
|
395
|
+
if (params[1] === "start") {
|
|
396
|
+
arrowStyle.left = 8;
|
|
397
|
+
} else if (!params[1]) {
|
|
398
|
+
arrowStyle.left = (popperRect.width - arrowRect.width) / 2;
|
|
463
399
|
}
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
data.
|
|
400
|
+
}
|
|
401
|
+
data.offsets.arrow = arrowStyle;
|
|
402
|
+
data.arrowElement = arrow;
|
|
403
|
+
return data;
|
|
467
404
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
405
|
+
/** 判断 reference 的 offsetParent 元素是fix还是abs, 这个值会赋值给popper 的dom */
|
|
406
|
+
_getPopperPositionByRefernce(reference) {
|
|
407
|
+
if (this._options.forceAbsolute) {
|
|
408
|
+
return "absolute";
|
|
409
|
+
}
|
|
410
|
+
let isParentFixed = isFixed(reference);
|
|
411
|
+
return isParentFixed ? "fixed" : "absolute";
|
|
412
|
+
}
|
|
413
|
+
/** 实时计算一下popper, reference的 位置信息, 用于 */
|
|
414
|
+
_getRefPopOffsets(popper, reference, placement) {
|
|
415
|
+
placement = placement.split("-")[0];
|
|
416
|
+
let popperOffsets = { position: this.state.position };
|
|
417
|
+
let isParentFixed = popperOffsets.position === "fixed";
|
|
418
|
+
let referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
|
|
419
|
+
const { width, height } = this.popperOuterSize ? this.popperOuterSize : this.popperOuterSize = getOuterSizes(popper);
|
|
420
|
+
if (~["right", "left"].indexOf(placement)) {
|
|
421
|
+
popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - height / 2;
|
|
422
|
+
if (placement === "left") {
|
|
423
|
+
popperOffsets.left = referenceOffsets.left - width;
|
|
424
|
+
} else {
|
|
425
|
+
popperOffsets.left = referenceOffsets.right;
|
|
478
426
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
427
|
+
} else {
|
|
428
|
+
popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - width / 2;
|
|
429
|
+
if (placement === "top") {
|
|
430
|
+
popperOffsets.top = referenceOffsets.top - height;
|
|
431
|
+
} else {
|
|
432
|
+
popperOffsets.top = referenceOffsets.bottom;
|
|
485
433
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
434
|
+
}
|
|
435
|
+
popperOffsets.width = width;
|
|
436
|
+
popperOffsets.height = height;
|
|
437
|
+
return {
|
|
438
|
+
popper: popperOffsets,
|
|
439
|
+
reference: referenceOffsets
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
_setupEventListeners() {
|
|
443
|
+
this.state.updateBoundFn = this.update.bind(this);
|
|
444
|
+
on(window, "resize", this.state.updateBoundFn);
|
|
445
|
+
if (this._options.boundariesElement !== "window") {
|
|
446
|
+
let target = getScrollParent(this._reference);
|
|
447
|
+
if (target === window.document.body || target === window.document.documentElement) {
|
|
448
|
+
target = window;
|
|
492
449
|
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
450
|
+
this.state.scrollTarget = target;
|
|
451
|
+
if (this._options.bubbling || PopupManager.globalScroll) {
|
|
452
|
+
let targets = getAllScrollParents(this._reference);
|
|
453
|
+
this.state.scrollTargets = targets || [];
|
|
454
|
+
targets.forEach((target2) => {
|
|
455
|
+
on(target2, "scroll", this.state.updateBoundFn);
|
|
456
|
+
});
|
|
457
|
+
} else {
|
|
458
|
+
on(target, "scroll", this.state.updateBoundFn);
|
|
499
459
|
}
|
|
500
|
-
return { left };
|
|
501
460
|
}
|
|
502
|
-
};
|
|
503
|
-
order.forEach((direction) => {
|
|
504
|
-
data.offsets.popper = Object.assign(popper, check[direction]());
|
|
505
|
-
});
|
|
506
|
-
return data;
|
|
507
|
-
};
|
|
508
|
-
Popper.prototype.modifiers.keepTogether = function(data) {
|
|
509
|
-
let popper = getPopperClientRect(data.offsets.popper);
|
|
510
|
-
let reference = data.offsets.reference;
|
|
511
|
-
if (popper.right < Math.floor(reference.left)) {
|
|
512
|
-
data.offsets.popper.left = Math.floor(reference.left) - popper.width;
|
|
513
|
-
}
|
|
514
|
-
if (popper.left > Math.floor(reference.right)) {
|
|
515
|
-
data.offsets.popper.left = Math.floor(reference.right);
|
|
516
|
-
}
|
|
517
|
-
if (popper.bottom < Math.floor(reference.top)) {
|
|
518
|
-
data.offsets.popper.top = Math.floor(reference.top) - popper.height;
|
|
519
|
-
}
|
|
520
|
-
if (popper.top > Math.floor(reference.bottom)) {
|
|
521
|
-
data.offsets.popper.top = Math.floor(reference.bottom);
|
|
522
|
-
}
|
|
523
|
-
return data;
|
|
524
|
-
};
|
|
525
|
-
Popper.prototype.modifiers.flip = function(data) {
|
|
526
|
-
if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {
|
|
527
|
-
return data;
|
|
528
461
|
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
flipOrderArr = this._options.flipBehavior;
|
|
541
|
-
}
|
|
542
|
-
flipOrderArr.forEach((step, index) => {
|
|
543
|
-
if (placement !== step || flipOrderArr.length === index + 1) {
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
placement = data.placement.split("-")[0];
|
|
547
|
-
placementOpposite = getOppositePlacement(placement);
|
|
548
|
-
let popperOffsets = getPopperClientRect(data.offsets.popper);
|
|
549
|
-
let a = ~["right", "bottom"].indexOf(placement);
|
|
550
|
-
let p = Math.floor(data.offsets.reference[placement]);
|
|
551
|
-
let po = Math.floor(popperOffsets[placementOpposite]);
|
|
552
|
-
if (a && p > po || !a && p < po) {
|
|
553
|
-
data.flipped = true;
|
|
554
|
-
data.placement = flipOrderArr[index + 1];
|
|
555
|
-
if (variation) {
|
|
556
|
-
data.placement += `-${variation}`;
|
|
462
|
+
_removeEventListeners() {
|
|
463
|
+
off(window, "resize", this.state.updateBoundFn);
|
|
464
|
+
if (this._options.boundariesElement !== "window" && this.state.scrollTarget) {
|
|
465
|
+
off(this.state.scrollTarget, "scroll", this.state.updateBoundFn);
|
|
466
|
+
this.state.scrollTarget = null;
|
|
467
|
+
if (this._options.bubbling || PopupManager.globalScroll) {
|
|
468
|
+
let targets = this.state.scrollTargets || [];
|
|
469
|
+
targets.forEach((target) => {
|
|
470
|
+
off(target, "scroll", this.state.updateBoundFn);
|
|
471
|
+
});
|
|
472
|
+
this.state.scrollTargets = null;
|
|
557
473
|
}
|
|
558
|
-
data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;
|
|
559
|
-
data = this.runModifiers(data, this._options.modifiers, this._flip);
|
|
560
474
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
let arrowRect = getOuterSizes(arrow);
|
|
598
|
-
let arrowSize = arrowRect[calcProp];
|
|
599
|
-
if (reference[opSide] - arrowSize < popper[side]) {
|
|
600
|
-
data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowSize);
|
|
601
|
-
}
|
|
602
|
-
if (reference[side] + arrowSize > popper[opSide]) {
|
|
603
|
-
data.offsets.popper[side] += reference[side] + arrowSize - popper[opSide];
|
|
604
|
-
}
|
|
605
|
-
let center = reference[side] + (arrowOffset || reference[calcProp] / 2 - arrowSize / 2);
|
|
606
|
-
let sideValue = center - popper[side];
|
|
607
|
-
sideValue = Math.max(Math.min(popper[calcProp] - arrowSize - 8, sideValue), 8);
|
|
608
|
-
arrowStyle[side] = sideValue;
|
|
609
|
-
arrowStyle[altSide] = "";
|
|
610
|
-
const popperOptions = this._options;
|
|
611
|
-
const params = popperOptions.placement.split("-");
|
|
612
|
-
if (popperOptions.adjustArrow && ~["top", "bottom"].indexOf(params[0]) && side === "left") {
|
|
613
|
-
if (params[1] === "start") {
|
|
614
|
-
arrowStyle.left = 8;
|
|
615
|
-
} else if (!params[1]) {
|
|
616
|
-
arrowStyle.left = (popperRect.width - arrowRect.width) / 2;
|
|
475
|
+
this.state.updateBoundFn = null;
|
|
476
|
+
}
|
|
477
|
+
/** 实时计算一下Boundary的位置 */
|
|
478
|
+
_getBoundaries(data, padding, boundariesElement) {
|
|
479
|
+
let boundaries = { right: 0, left: 0, top: 0, bottom: 0 };
|
|
480
|
+
if (boundariesElement === "window" || boundariesElement === "body") {
|
|
481
|
+
let body = window.document.body;
|
|
482
|
+
let html = window.document.documentElement;
|
|
483
|
+
let { width, height } = getMaxWH(body, html);
|
|
484
|
+
boundaries = { top: 0, right: width, bottom: height, left: 0 };
|
|
485
|
+
} else if (boundariesElement === "viewport") {
|
|
486
|
+
let offsetParent = getOffsetParent(this._popper);
|
|
487
|
+
let scrollParent = getScrollParent(this._popper);
|
|
488
|
+
let offsetParentRect = getOffsetRect(offsetParent);
|
|
489
|
+
let isFixed2 = data.offsets.popper.position === "fixed";
|
|
490
|
+
let scrollTop = isFixed2 ? 0 : getScrollTopValue(scrollParent);
|
|
491
|
+
let scrollLeft = isFixed2 ? 0 : getScrollLeftValue(scrollParent);
|
|
492
|
+
const viewportWindow = PopupManager.viewportWindow || window;
|
|
493
|
+
boundaries = {
|
|
494
|
+
top: 0 - (offsetParentRect.top - scrollTop),
|
|
495
|
+
right: viewportWindow.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),
|
|
496
|
+
bottom: viewportWindow.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),
|
|
497
|
+
left: 0 - (offsetParentRect.left - scrollLeft)
|
|
498
|
+
};
|
|
499
|
+
} else {
|
|
500
|
+
if (getOffsetParent(this._popper) === boundariesElement) {
|
|
501
|
+
const { clientWidth, clientHeight } = boundariesElement;
|
|
502
|
+
boundaries = {
|
|
503
|
+
right: clientWidth,
|
|
504
|
+
bottom: clientHeight,
|
|
505
|
+
top: 0,
|
|
506
|
+
left: 0
|
|
507
|
+
};
|
|
508
|
+
} else {
|
|
509
|
+
boundaries = getOffsetRect(boundariesElement);
|
|
510
|
+
}
|
|
617
511
|
}
|
|
512
|
+
boundaries.right -= padding;
|
|
513
|
+
boundaries.left += padding;
|
|
514
|
+
boundaries.bottom = boundaries.bottom - padding;
|
|
515
|
+
boundaries.top = boundaries.top + padding;
|
|
516
|
+
return boundaries;
|
|
618
517
|
}
|
|
619
|
-
|
|
620
|
-
data.arrowElement = arrow;
|
|
621
|
-
return data;
|
|
622
|
-
};
|
|
518
|
+
}
|
|
623
519
|
var popper_default = Popper;
|
|
624
520
|
export {
|
|
625
521
|
popper_default as default,
|
|
626
|
-
getAllScrollParents,
|
|
627
522
|
getScrollParent
|
|
628
523
|
};
|