vxe-table 3.5.8 → 3.5.9-beta.10
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/README.md +1 -1
- package/lib/edit/src/mixin.js +18 -14
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/export/src/mixin.js +1 -1
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/filter/src/mixin.js +8 -5
- package/lib/filter/src/mixin.min.js +1 -1
- package/lib/filter/src/panel.js +7 -2
- package/lib/filter/src/panel.min.js +1 -1
- package/lib/form/src/form-config-item.js +2 -1
- package/lib/form/src/form-config-item.min.js +1 -1
- package/lib/form/src/form-item.js +3 -1
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +12 -7
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +1 -0
- package/lib/form/src/render.min.js +1 -1
- package/lib/form/style/style.css +2 -1
- package/lib/form/style/style.min.css +1 -1
- package/lib/grid/src/grid.js +14 -8
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +804 -496
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +20 -15
- package/lib/input/src/input.min.js +1 -1
- package/lib/list/src/list.js +12 -7
- package/lib/list/src/list.min.js +1 -1
- package/lib/loading/index.js +19 -0
- package/lib/loading/index.min.js +1 -0
- package/lib/loading/src/loading.js +36 -0
- package/lib/loading/src/loading.min.js +1 -0
- package/lib/locale/lang/en-US.js +5 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +5 -0
- package/lib/locale/lang/ja-JP.js +5 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +5 -0
- package/lib/locale/lang/zh-CN.js +5 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +5 -0
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +5 -0
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +5 -0
- package/lib/locale/lang/zh-TC.js +5 -0
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +5 -0
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +5 -0
- package/lib/modal/src/modal.js +28 -12
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/modal/style/style.css +1 -1
- package/lib/modal/style/style.min.css +1 -1
- package/lib/select/src/select.js +213 -33
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/style/style.css +17 -72
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +6 -3
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +3 -3
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -1
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +84 -62
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +12 -8
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +0 -68
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/style/style.css +13 -10
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/tools/utils.js +2 -2
- package/lib/tools/utils.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +6 -2
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/store.js +10 -5
- package/lib/v-x-e-table/src/store.min.js +1 -1
- package/lib/v-x-e-table/style/style.css +590 -0
- package/lib/v-x-e-table/style/style.min.css +1 -0
- package/package.json +1 -1
- package/packages/edit/src/mixin.js +17 -13
- package/packages/export/src/mixin.js +2 -2
- package/packages/filter/src/mixin.js +5 -5
- package/packages/filter/src/panel.js +13 -6
- package/packages/form/src/form-config-item.js +17 -9
- package/packages/form/src/form-item.js +16 -8
- package/packages/form/src/form.js +10 -9
- package/packages/form/src/render.js +1 -1
- package/packages/grid/src/grid.js +9 -7
- package/packages/input/src/input.js +17 -13
- package/packages/list/src/list.js +10 -9
- package/packages/loading/index.js +9 -0
- package/packages/loading/src/loading.js +31 -0
- package/packages/locale/lang/en-US.js +5 -0
- package/packages/locale/lang/ja-JP.js +5 -0
- package/packages/locale/lang/zh-CN.js +5 -0
- package/packages/locale/lang/zh-TC.js +5 -0
- package/packages/modal/src/modal.js +23 -14
- package/packages/select/src/select.js +139 -16
- package/packages/table/src/body.js +39 -24
- package/packages/table/src/cell.js +3 -3
- package/packages/table/src/columnInfo.js +1 -1
- package/packages/table/src/methods.js +68 -57
- package/packages/table/src/table.js +10 -9
- package/packages/tools/utils.js +2 -2
- package/packages/v-x-e-table/src/conf.js +6 -2
- package/packages/v-x-e-table/src/store.js +8 -4
- package/styles/form.scss +1 -0
- package/styles/{base/loading.scss → loading.scss} +17 -4
- package/styles/modal.scss +1 -1
- package/styles/modules.scss +1 -0
- package/styles/select.scss +24 -6
- package/styles/table.scss +0 -1
- package/styles/toolbar.scss +9 -5
- package/styles/v-x-e-table.scss +2 -0
- package/styles/variable.scss +0 -4
- package/types/form-item.d.ts +11 -8
- package/types/form.d.ts +5 -2
- package/types/table.d.ts +5 -0
- package/types/v-x-e-table/renderer.d.ts +15 -2
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
-moz-user-select: none;
|
|
210
210
|
-ms-user-select: none;
|
|
211
211
|
user-select: none; }
|
|
212
|
-
.vxe-modal--wrapper .vxe-modal--header.is--
|
|
212
|
+
.vxe-modal--wrapper .vxe-modal--header.is--draggable {
|
|
213
213
|
cursor: move; }
|
|
214
214
|
.vxe-modal--wrapper .vxe-modal--header.is--ellipsis {
|
|
215
215
|
overflow: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.vxe-modal--wrapper{display:none;position:fixed;top:0;left:0;line-height:1.5;width:calc(100% + 18px);height:calc(100% + 18px);color:#606266;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;-webkit-transition:top .4s ease-in-out;transition:top .4s ease-in-out}.vxe-modal--wrapper.is--active{display:block}.vxe-modal--wrapper.is--visible.is--mask:before{background-color:rgba(0,0,0,.5)}.vxe-modal--wrapper.is--visible.type--message .vxe-modal--box{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.vxe-modal--wrapper.is--visible .vxe-modal--box{opacity:1;visibility:visible}.vxe-modal--wrapper.is--loading .vxe-modal--footer,.vxe-modal--wrapper.is--loading .vxe-modal--header{position:relative;border-bottom-color:rgba(0,0,0,.2)}.vxe-modal--wrapper.is--loading .vxe-modal--footer:before,.vxe-modal--wrapper.is--loading .vxe-modal--header:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:rgba(0,0,0,.2)}.vxe-modal--wrapper:not(.lock--view){pointer-events:none}.vxe-modal--wrapper:not(.type--message).lock--scroll{overflow:hidden}.vxe-modal--wrapper:not(.type--message):not(.lock--scroll){overflow:auto}.vxe-modal--wrapper.is--mask:before,.vxe-modal--wrapper.lock--view:before{content:"";position:fixed;top:0;left:0;width:100%;height:100%;z-index:-1;pointer-events:auto}.vxe-modal--wrapper.is--mask:before{background-color:rgba(0,0,0,0)}.vxe-modal--wrapper.is--animat.is--mask:before{-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.vxe-modal--wrapper.is--animat.type--message .vxe-modal--box:not(.is--drag){-webkit-transition:all .4s ease-out;transition:all .4s ease-out}.vxe-modal--wrapper.type--alert .vxe-modal--body,.vxe-modal--wrapper.type--confirm .vxe-modal--body,.vxe-modal--wrapper.type--message .vxe-modal--body{white-space:normal;word-break:break-word}.vxe-modal--wrapper.type--message{text-align:center}.vxe-modal--wrapper.type--message .vxe-modal--box{display:inline-block;padding:2px 0;margin-top:0;width:auto;-webkit-box-shadow:0 0 8px 0 rgba(0,0,0,.1);box-shadow:0 0 8px 0 rgba(0,0,0,.1);opacity:0;-webkit-transform:translateY(-100%);transform:translateY(-100%)}.vxe-modal--wrapper.type--message .vxe-modal--box .vxe-modal--body:after{content:'';display:block;clear:both;height:0;overflow:hidden;visibility:hidden}.vxe-modal--wrapper.type--message .vxe-modal--box .vxe-modal--content{max-width:800px;float:left}.vxe-modal--wrapper.type--message .vxe-modal--status-wrapper{font-size:1.4em;padding-left:10px}.vxe-modal--wrapper.type--alert .vxe-modal--box,.vxe-modal--wrapper.type--confirm .vxe-modal--box,.vxe-modal--wrapper.type--modal .vxe-modal--box{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:fixed;left:50%;top:0;-webkit-box-shadow:0 0 10px 0 rgba(0,0,0,.2);box-shadow:0 0 10px 0 rgba(0,0,0,.2)}.vxe-modal--wrapper.type--alert .vxe-modal--body,.vxe-modal--wrapper.type--confirm .vxe-modal--body,.vxe-modal--wrapper.type--modal .vxe-modal--body{overflow:auto}.vxe-modal--wrapper.type--alert .vxe-modal--body .vxe-modal--content,.vxe-modal--wrapper.type--confirm .vxe-modal--body .vxe-modal--content,.vxe-modal--wrapper.type--modal .vxe-modal--body .vxe-modal--content{overflow:auto}.vxe-modal--wrapper.type--modal .vxe-modal--header{padding:.6em 4.6em .6em 1em}.vxe-modal--wrapper.type--alert .vxe-modal--status-wrapper,.vxe-modal--wrapper.type--confirm .vxe-modal--status-wrapper{font-size:1.6em;padding-left:10px}.vxe-modal--wrapper .vxe-modal--box{visibility:hidden;width:420px;background-color:#fff;border-radius:4px;border:1px solid #ebeef5;text-align:left;pointer-events:auto;opacity:0}.vxe-modal--wrapper .vxe-modal--box.is--drag{cursor:move}.vxe-modal--wrapper .vxe-modal--box.is--drag .vxe-modal--body:after,.vxe-modal--wrapper .vxe-modal--box.is--drag .vxe-modal--footer:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%}.vxe-modal--wrapper .vxe-modal--box.is--drag .vxe-modal--body{overflow:hidden}.vxe-modal--wrapper .vxe-modal--box.is--drag .vxe-modal--body .vxe-modal--content{overflow:hidden}.vxe-modal--wrapper.status--info .vxe-modal--status-wrapper{color:#909399}.vxe-modal--wrapper.status--question .vxe-modal--status-wrapper,.vxe-modal--wrapper.status--warning .vxe-modal--status-wrapper{color:#e6a23c}.vxe-modal--wrapper.status--success .vxe-modal--status-wrapper{color:#67c23a}.vxe-modal--wrapper.status--error .vxe-modal--status-wrapper{color:#f56c6c}.vxe-modal--wrapper.status--loading .vxe-modal--status-wrapper{color:#bfbfbf}.vxe-modal--wrapper .vxe-modal--status-wrapper{-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.vxe-modal--wrapper .vxe-modal--content{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;padding:.8em 1em;white-space:pre-line}.vxe-modal--wrapper .vxe-modal--body,.vxe-modal--wrapper .vxe-modal--footer,.vxe-modal--wrapper .vxe-modal--header{position:relative}.vxe-modal--wrapper .vxe-modal--body{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.vxe-modal--wrapper .vxe-modal--header{-ms-flex-negative:0;flex-shrink:0;font-size:1.1em;font-weight:700;padding:.6em 2.8em .6em 1em;border-bottom:1px solid #ebeef5;background-color:#f8f8f8;border-radius:4px 4px 0 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vxe-modal--wrapper .vxe-modal--header.is--
|
|
1
|
+
.vxe-modal--wrapper{display:none;position:fixed;top:0;left:0;line-height:1.5;width:calc(100% + 18px);height:calc(100% + 18px);color:#606266;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;-webkit-transition:top .4s ease-in-out;transition:top .4s ease-in-out}.vxe-modal--wrapper.is--active{display:block}.vxe-modal--wrapper.is--visible.is--mask:before{background-color:rgba(0,0,0,.5)}.vxe-modal--wrapper.is--visible.type--message .vxe-modal--box{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.vxe-modal--wrapper.is--visible .vxe-modal--box{opacity:1;visibility:visible}.vxe-modal--wrapper.is--loading .vxe-modal--footer,.vxe-modal--wrapper.is--loading .vxe-modal--header{position:relative;border-bottom-color:rgba(0,0,0,.2)}.vxe-modal--wrapper.is--loading .vxe-modal--footer:before,.vxe-modal--wrapper.is--loading .vxe-modal--header:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:rgba(0,0,0,.2)}.vxe-modal--wrapper:not(.lock--view){pointer-events:none}.vxe-modal--wrapper:not(.type--message).lock--scroll{overflow:hidden}.vxe-modal--wrapper:not(.type--message):not(.lock--scroll){overflow:auto}.vxe-modal--wrapper.is--mask:before,.vxe-modal--wrapper.lock--view:before{content:"";position:fixed;top:0;left:0;width:100%;height:100%;z-index:-1;pointer-events:auto}.vxe-modal--wrapper.is--mask:before{background-color:rgba(0,0,0,0)}.vxe-modal--wrapper.is--animat.is--mask:before{-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.vxe-modal--wrapper.is--animat.type--message .vxe-modal--box:not(.is--drag){-webkit-transition:all .4s ease-out;transition:all .4s ease-out}.vxe-modal--wrapper.type--alert .vxe-modal--body,.vxe-modal--wrapper.type--confirm .vxe-modal--body,.vxe-modal--wrapper.type--message .vxe-modal--body{white-space:normal;word-break:break-word}.vxe-modal--wrapper.type--message{text-align:center}.vxe-modal--wrapper.type--message .vxe-modal--box{display:inline-block;padding:2px 0;margin-top:0;width:auto;-webkit-box-shadow:0 0 8px 0 rgba(0,0,0,.1);box-shadow:0 0 8px 0 rgba(0,0,0,.1);opacity:0;-webkit-transform:translateY(-100%);transform:translateY(-100%)}.vxe-modal--wrapper.type--message .vxe-modal--box .vxe-modal--body:after{content:'';display:block;clear:both;height:0;overflow:hidden;visibility:hidden}.vxe-modal--wrapper.type--message .vxe-modal--box .vxe-modal--content{max-width:800px;float:left}.vxe-modal--wrapper.type--message .vxe-modal--status-wrapper{font-size:1.4em;padding-left:10px}.vxe-modal--wrapper.type--alert .vxe-modal--box,.vxe-modal--wrapper.type--confirm .vxe-modal--box,.vxe-modal--wrapper.type--modal .vxe-modal--box{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:fixed;left:50%;top:0;-webkit-box-shadow:0 0 10px 0 rgba(0,0,0,.2);box-shadow:0 0 10px 0 rgba(0,0,0,.2)}.vxe-modal--wrapper.type--alert .vxe-modal--body,.vxe-modal--wrapper.type--confirm .vxe-modal--body,.vxe-modal--wrapper.type--modal .vxe-modal--body{overflow:auto}.vxe-modal--wrapper.type--alert .vxe-modal--body .vxe-modal--content,.vxe-modal--wrapper.type--confirm .vxe-modal--body .vxe-modal--content,.vxe-modal--wrapper.type--modal .vxe-modal--body .vxe-modal--content{overflow:auto}.vxe-modal--wrapper.type--modal .vxe-modal--header{padding:.6em 4.6em .6em 1em}.vxe-modal--wrapper.type--alert .vxe-modal--status-wrapper,.vxe-modal--wrapper.type--confirm .vxe-modal--status-wrapper{font-size:1.6em;padding-left:10px}.vxe-modal--wrapper .vxe-modal--box{visibility:hidden;width:420px;background-color:#fff;border-radius:4px;border:1px solid #ebeef5;text-align:left;pointer-events:auto;opacity:0}.vxe-modal--wrapper .vxe-modal--box.is--drag{cursor:move}.vxe-modal--wrapper .vxe-modal--box.is--drag .vxe-modal--body:after,.vxe-modal--wrapper .vxe-modal--box.is--drag .vxe-modal--footer:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%}.vxe-modal--wrapper .vxe-modal--box.is--drag .vxe-modal--body{overflow:hidden}.vxe-modal--wrapper .vxe-modal--box.is--drag .vxe-modal--body .vxe-modal--content{overflow:hidden}.vxe-modal--wrapper.status--info .vxe-modal--status-wrapper{color:#909399}.vxe-modal--wrapper.status--question .vxe-modal--status-wrapper,.vxe-modal--wrapper.status--warning .vxe-modal--status-wrapper{color:#e6a23c}.vxe-modal--wrapper.status--success .vxe-modal--status-wrapper{color:#67c23a}.vxe-modal--wrapper.status--error .vxe-modal--status-wrapper{color:#f56c6c}.vxe-modal--wrapper.status--loading .vxe-modal--status-wrapper{color:#bfbfbf}.vxe-modal--wrapper .vxe-modal--status-wrapper{-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.vxe-modal--wrapper .vxe-modal--content{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;padding:.8em 1em;white-space:pre-line}.vxe-modal--wrapper .vxe-modal--body,.vxe-modal--wrapper .vxe-modal--footer,.vxe-modal--wrapper .vxe-modal--header{position:relative}.vxe-modal--wrapper .vxe-modal--body{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.vxe-modal--wrapper .vxe-modal--header{-ms-flex-negative:0;flex-shrink:0;font-size:1.1em;font-weight:700;padding:.6em 2.8em .6em 1em;border-bottom:1px solid #ebeef5;background-color:#f8f8f8;border-radius:4px 4px 0 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vxe-modal--wrapper .vxe-modal--header.is--draggable{cursor:move}.vxe-modal--wrapper .vxe-modal--header.is--ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vxe-modal--wrapper .vxe-modal--close-btn,.vxe-modal--wrapper .vxe-modal--zoom-btn{position:absolute;right:14px;top:.85em;z-index:1;cursor:pointer}.vxe-modal--wrapper .vxe-modal--close-btn:hover,.vxe-modal--wrapper .vxe-modal--zoom-btn:hover{color:#409eff}.vxe-modal--wrapper .vxe-modal--zoom-btn{right:44px}.vxe-modal--wrapper .vxe-modal--footer{-ms-flex-negative:0;flex-shrink:0;text-align:right;padding:.4em 1em .8em 1em}.vxe-modal--wrapper.is--maximize .vxe-modal--box .vxe-modal--header{cursor:default}.vxe-modal--wrapper.is--maximize .vxe-modal--resize .sb-resize,.vxe-modal--wrapper.is--maximize .vxe-modal--resize .selb-resize,.vxe-modal--wrapper.is--maximize .vxe-modal--resize .sest-resize,.vxe-modal--wrapper.is--maximize .vxe-modal--resize .st-resize,.vxe-modal--wrapper.is--maximize .vxe-modal--resize .swlb-resize,.vxe-modal--wrapper.is--maximize .vxe-modal--resize .swst-resize,.vxe-modal--wrapper.is--maximize .vxe-modal--resize .wl-resize,.vxe-modal--wrapper.is--maximize .vxe-modal--resize .wr-resize{display:none}.vxe-modal--wrapper .vxe-modal--resize .sb-resize,.vxe-modal--wrapper .vxe-modal--resize .selb-resize,.vxe-modal--wrapper .vxe-modal--resize .sest-resize,.vxe-modal--wrapper .vxe-modal--resize .st-resize,.vxe-modal--wrapper .vxe-modal--resize .swlb-resize,.vxe-modal--wrapper .vxe-modal--resize .swst-resize,.vxe-modal--wrapper .vxe-modal--resize .wl-resize,.vxe-modal--wrapper .vxe-modal--resize .wr-resize{position:absolute;z-index:100}.vxe-modal--wrapper .vxe-modal--resize .wl-resize,.vxe-modal--wrapper .vxe-modal--resize .wr-resize{width:8px;height:100%;top:0;cursor:w-resize}.vxe-modal--wrapper .vxe-modal--resize .wl-resize{left:-5px}.vxe-modal--wrapper .vxe-modal--resize .wr-resize{right:-5px}.vxe-modal--wrapper .vxe-modal--resize .selb-resize,.vxe-modal--wrapper .vxe-modal--resize .sest-resize,.vxe-modal--wrapper .vxe-modal--resize .swlb-resize,.vxe-modal--wrapper .vxe-modal--resize .swst-resize{width:10px;height:10px;z-index:101}.vxe-modal--wrapper .vxe-modal--resize .sest-resize,.vxe-modal--wrapper .vxe-modal--resize .swst-resize{top:-8px}.vxe-modal--wrapper .vxe-modal--resize .selb-resize,.vxe-modal--wrapper .vxe-modal--resize .swlb-resize{bottom:-8px}.vxe-modal--wrapper .vxe-modal--resize .sest-resize,.vxe-modal--wrapper .vxe-modal--resize .swlb-resize{cursor:sw-resize}.vxe-modal--wrapper .vxe-modal--resize .selb-resize,.vxe-modal--wrapper .vxe-modal--resize .swst-resize{cursor:se-resize}.vxe-modal--wrapper .vxe-modal--resize .swlb-resize,.vxe-modal--wrapper .vxe-modal--resize .swst-resize{left:-8px}.vxe-modal--wrapper .vxe-modal--resize .selb-resize,.vxe-modal--wrapper .vxe-modal--resize .sest-resize{right:-8px}.vxe-modal--wrapper .vxe-modal--resize .sb-resize,.vxe-modal--wrapper .vxe-modal--resize .st-resize{width:100%;height:8px;left:0;cursor:s-resize}.vxe-modal--wrapper .vxe-modal--resize .st-resize{top:-5px}.vxe-modal--wrapper .vxe-modal--resize .sb-resize{bottom:-5px}.vxe-modal--wrapper{font-size:14px}.vxe-modal--wrapper.size--medium{font-size:14px}.vxe-modal--wrapper.size--small{font-size:13px}.vxe-modal--wrapper.size--mini{font-size:12px}
|
package/lib/select/src/select.js
CHANGED
|
@@ -173,6 +173,15 @@ function findOption(_vm, optionValue) {
|
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
function getRemoteSelectLabel(_vm, value) {
|
|
177
|
+
var remoteValueList = _vm.remoteValueList;
|
|
178
|
+
var remoteItem = remoteValueList.find(function (item) {
|
|
179
|
+
return value === item.key;
|
|
180
|
+
});
|
|
181
|
+
var item = remoteItem ? remoteItem.result : null;
|
|
182
|
+
return _xeUtils.default.toValueString(item ? item[_vm.labelField] : value);
|
|
183
|
+
}
|
|
184
|
+
|
|
176
185
|
function getSelectLabel(_vm, value) {
|
|
177
186
|
var item = findOption(_vm, value);
|
|
178
187
|
return _xeUtils.default.toValueString(item ? item[_vm.labelField] : value);
|
|
@@ -209,7 +218,7 @@ function renderOption(h, _vm, list, group) {
|
|
|
209
218
|
mousedown: _vm.mousedownOptionEvent,
|
|
210
219
|
click: function click(evnt) {
|
|
211
220
|
if (!isDisabled) {
|
|
212
|
-
_vm.changeOptionEvent(evnt, optionValue);
|
|
221
|
+
_vm.changeOptionEvent(evnt, optionValue, option);
|
|
213
222
|
}
|
|
214
223
|
},
|
|
215
224
|
mouseenter: function mouseenter() {
|
|
@@ -259,7 +268,18 @@ function renderOptgroup(h, _vm) {
|
|
|
259
268
|
function renderOpts(h, _vm) {
|
|
260
269
|
var isGroup = _vm.isGroup,
|
|
261
270
|
visibleGroupList = _vm.visibleGroupList,
|
|
262
|
-
visibleOptionList = _vm.visibleOptionList
|
|
271
|
+
visibleOptionList = _vm.visibleOptionList,
|
|
272
|
+
searchLoading = _vm.searchLoading;
|
|
273
|
+
|
|
274
|
+
if (searchLoading) {
|
|
275
|
+
return [h('div', {
|
|
276
|
+
class: 'vxe-select--search-loading'
|
|
277
|
+
}, [h('i', {
|
|
278
|
+
class: ['vxe-select--search-icon', _conf.default.icon.SELECT_LOADED]
|
|
279
|
+
}), h('span', {
|
|
280
|
+
class: 'vxe-select--search-text'
|
|
281
|
+
}, _conf.default.i18n('vxe.select.loadingText'))])];
|
|
282
|
+
}
|
|
263
283
|
|
|
264
284
|
if (isGroup) {
|
|
265
285
|
if (visibleGroupList.length) {
|
|
@@ -306,6 +326,10 @@ var _default2 = {
|
|
|
306
326
|
return _conf.default.select.size || _conf.default.size;
|
|
307
327
|
}
|
|
308
328
|
},
|
|
329
|
+
filterable: Boolean,
|
|
330
|
+
filterMethod: Function,
|
|
331
|
+
remote: Boolean,
|
|
332
|
+
remoteMethod: Function,
|
|
309
333
|
emptyText: String,
|
|
310
334
|
// 已废弃,被 option-config.keyField 替换
|
|
311
335
|
optionId: {
|
|
@@ -347,13 +371,17 @@ var _default2 = {
|
|
|
347
371
|
fullOptionList: [],
|
|
348
372
|
visibleGroupList: [],
|
|
349
373
|
visibleOptionList: [],
|
|
374
|
+
remoteValueList: [],
|
|
350
375
|
panelIndex: 0,
|
|
351
376
|
panelStyle: null,
|
|
352
377
|
panelPlacement: null,
|
|
378
|
+
currentOption: null,
|
|
353
379
|
currentValue: null,
|
|
354
380
|
visiblePanel: false,
|
|
355
381
|
animatVisible: false,
|
|
356
|
-
isActivated: false
|
|
382
|
+
isActivated: false,
|
|
383
|
+
searchValue: '',
|
|
384
|
+
searchLoading: false
|
|
357
385
|
};
|
|
358
386
|
},
|
|
359
387
|
computed: {
|
|
@@ -391,10 +419,19 @@ var _default2 = {
|
|
|
391
419
|
|
|
392
420
|
var value = this.value,
|
|
393
421
|
multiple = this.multiple,
|
|
422
|
+
remote = this.remote,
|
|
394
423
|
multiMaxCharNum = this.multiMaxCharNum;
|
|
395
424
|
|
|
396
425
|
if (value && multiple) {
|
|
397
|
-
|
|
426
|
+
var vals = _xeUtils.default.isArray(value) ? value : [value];
|
|
427
|
+
|
|
428
|
+
if (remote) {
|
|
429
|
+
return vals.map(function (val) {
|
|
430
|
+
return getRemoteSelectLabel(_this, val);
|
|
431
|
+
}).join(', ');
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
return vals.map(function (val) {
|
|
398
435
|
var label = getSelectLabel(_this, val);
|
|
399
436
|
|
|
400
437
|
if (multiMaxCharNum > 0 && label.length > multiMaxCharNum) {
|
|
@@ -405,6 +442,10 @@ var _default2 = {
|
|
|
405
442
|
}).join(', ');
|
|
406
443
|
}
|
|
407
444
|
|
|
445
|
+
if (remote) {
|
|
446
|
+
return getRemoteSelectLabel(this, value);
|
|
447
|
+
}
|
|
448
|
+
|
|
408
449
|
return getSelectLabel(this, value);
|
|
409
450
|
}
|
|
410
451
|
},
|
|
@@ -472,19 +513,21 @@ var _default2 = {
|
|
|
472
513
|
render: function render(h) {
|
|
473
514
|
var _ref, _ref2;
|
|
474
515
|
|
|
475
|
-
var
|
|
516
|
+
var _e = this._e,
|
|
517
|
+
$scopedSlots = this.$scopedSlots,
|
|
476
518
|
vSize = this.vSize,
|
|
477
519
|
className = this.className,
|
|
478
520
|
inited = this.inited,
|
|
479
521
|
isActivated = this.isActivated,
|
|
480
522
|
loading = this.loading,
|
|
481
523
|
disabled = this.disabled,
|
|
482
|
-
visiblePanel = this.visiblePanel
|
|
524
|
+
visiblePanel = this.visiblePanel,
|
|
525
|
+
filterable = this.filterable;
|
|
483
526
|
var prefixSlot = $scopedSlots.prefix;
|
|
484
527
|
return h('div', {
|
|
485
528
|
class: ['vxe-select', className ? _xeUtils.default.isFunction(className) ? className({
|
|
486
529
|
$select: this
|
|
487
|
-
}) : className : '', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--visivle', visiblePanel), _defineProperty(_ref, 'is--disabled', disabled), _defineProperty(_ref, 'is--loading', loading), _defineProperty(_ref, 'is--active', isActivated), _ref)]
|
|
530
|
+
}) : className : '', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--visivle', visiblePanel), _defineProperty(_ref, 'is--disabled', disabled), _defineProperty(_ref, 'is--filter', filterable), _defineProperty(_ref, 'is--loading', loading), _defineProperty(_ref, 'is--active', isActivated), _ref)]
|
|
488
531
|
}, [h('div', {
|
|
489
532
|
class: 'vxe-select-slots',
|
|
490
533
|
ref: 'hideOption'
|
|
@@ -519,7 +562,26 @@ var _default2 = {
|
|
|
519
562
|
placement: this.panelPlacement
|
|
520
563
|
},
|
|
521
564
|
style: this.panelStyle
|
|
522
|
-
}, inited ? [h('div', {
|
|
565
|
+
}, inited ? [filterable ? h('div', {
|
|
566
|
+
class: 'vxe-select-filter--wrapper'
|
|
567
|
+
}, [h('vxe-input', {
|
|
568
|
+
ref: 'inpSearch',
|
|
569
|
+
class: 'vxe-select-filter--input',
|
|
570
|
+
props: {
|
|
571
|
+
value: this.searchValue,
|
|
572
|
+
type: 'text',
|
|
573
|
+
clearable: true,
|
|
574
|
+
placeholder: _conf.default.i18n('vxe.select.search'),
|
|
575
|
+
prefixIcon: _conf.default.icon.INPUT_SEARCH
|
|
576
|
+
},
|
|
577
|
+
on: {
|
|
578
|
+
modelValue: this.modelSearchEvent,
|
|
579
|
+
focus: this.focusSearchEvent,
|
|
580
|
+
keydown: this.keydownSearchEvent,
|
|
581
|
+
change: this.triggerSearchEvent,
|
|
582
|
+
search: this.triggerSearchEvent
|
|
583
|
+
}
|
|
584
|
+
})]) : _e(), h('div', {
|
|
523
585
|
ref: 'optWrapper',
|
|
524
586
|
class: 'vxe-select-option--wrapper'
|
|
525
587
|
}, renderOpts(h, this))] : null)]);
|
|
@@ -570,23 +632,57 @@ var _default2 = {
|
|
|
570
632
|
},
|
|
571
633
|
|
|
572
634
|
/**
|
|
573
|
-
*
|
|
635
|
+
* 刷新选项,当选项被搜索、动态显示/隐藏时可能会用到
|
|
574
636
|
*/
|
|
575
637
|
refreshOption: function refreshOption() {
|
|
576
638
|
var isGroup = this.isGroup,
|
|
577
639
|
fullOptionList = this.fullOptionList,
|
|
578
|
-
fullGroupList = this.fullGroupList
|
|
640
|
+
fullGroupList = this.fullGroupList,
|
|
641
|
+
filterable = this.filterable,
|
|
642
|
+
filterMethod = this.filterMethod,
|
|
643
|
+
searchValue = this.searchValue,
|
|
644
|
+
labelField = this.labelField,
|
|
645
|
+
groupLabelField = this.groupLabelField;
|
|
579
646
|
|
|
580
647
|
if (isGroup) {
|
|
581
|
-
|
|
648
|
+
if (filterable && filterMethod) {
|
|
649
|
+
this.visibleGroupList = fullGroupList.filter(function (group) {
|
|
650
|
+
return isOptionVisible(group) && filterMethod({
|
|
651
|
+
group: group,
|
|
652
|
+
option: null,
|
|
653
|
+
searchValue: searchValue
|
|
654
|
+
});
|
|
655
|
+
});
|
|
656
|
+
} else if (filterable) {
|
|
657
|
+
this.visibleGroupList = fullGroupList.filter(function (group) {
|
|
658
|
+
return isOptionVisible(group) && (!searchValue || "".concat(group[groupLabelField]).indexOf(searchValue) > -1);
|
|
659
|
+
});
|
|
660
|
+
} else {
|
|
661
|
+
this.visibleGroupList = fullGroupList.filter(isOptionVisible);
|
|
662
|
+
}
|
|
582
663
|
} else {
|
|
583
|
-
|
|
664
|
+
if (filterable && filterMethod) {
|
|
665
|
+
this.visibleOptionList = fullOptionList.filter(function (option) {
|
|
666
|
+
return isOptionVisible(option) && filterMethod({
|
|
667
|
+
group: null,
|
|
668
|
+
option: option,
|
|
669
|
+
searchValue: searchValue
|
|
670
|
+
});
|
|
671
|
+
});
|
|
672
|
+
} else if (filterable) {
|
|
673
|
+
this.visibleOptionList = fullOptionList.filter(function (option) {
|
|
674
|
+
return isOptionVisible(option) && (!searchValue || "".concat(option[labelField]).indexOf(searchValue) > -1);
|
|
675
|
+
});
|
|
676
|
+
} else {
|
|
677
|
+
this.visibleOptionList = fullOptionList.filter(isOptionVisible);
|
|
678
|
+
}
|
|
584
679
|
}
|
|
585
680
|
|
|
586
681
|
return this.$nextTick();
|
|
587
682
|
},
|
|
588
683
|
setCurrentOption: function setCurrentOption(option) {
|
|
589
684
|
if (option) {
|
|
685
|
+
this.currentOption = option;
|
|
590
686
|
this.currentValue = option[this.valueField];
|
|
591
687
|
}
|
|
592
688
|
},
|
|
@@ -621,6 +717,7 @@ var _default2 = {
|
|
|
621
717
|
this.hideOptionPanel();
|
|
622
718
|
},
|
|
623
719
|
clearValueEvent: function clearValueEvent(evnt, selectValue) {
|
|
720
|
+
this.remoteValueList = [];
|
|
624
721
|
this.changeEvent(evnt, selectValue);
|
|
625
722
|
this.$emit('clear', {
|
|
626
723
|
value: selectValue,
|
|
@@ -647,9 +744,10 @@ var _default2 = {
|
|
|
647
744
|
evnt.stopPropagation();
|
|
648
745
|
}
|
|
649
746
|
},
|
|
650
|
-
changeOptionEvent: function changeOptionEvent(evnt, selectValue) {
|
|
747
|
+
changeOptionEvent: function changeOptionEvent(evnt, selectValue, option) {
|
|
651
748
|
var value = this.value,
|
|
652
|
-
multiple = this.multiple
|
|
749
|
+
multiple = this.multiple,
|
|
750
|
+
remoteValueList = this.remoteValueList;
|
|
653
751
|
|
|
654
752
|
if (multiple) {
|
|
655
753
|
var multipleValue;
|
|
@@ -666,8 +764,25 @@ var _default2 = {
|
|
|
666
764
|
multipleValue = [selectValue];
|
|
667
765
|
}
|
|
668
766
|
|
|
767
|
+
var remoteItem = remoteValueList.find(function (item) {
|
|
768
|
+
return item.key === selectValue;
|
|
769
|
+
});
|
|
770
|
+
|
|
771
|
+
if (remoteItem) {
|
|
772
|
+
remoteItem.result = option;
|
|
773
|
+
} else {
|
|
774
|
+
remoteValueList.push({
|
|
775
|
+
key: selectValue,
|
|
776
|
+
result: option
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
|
|
669
780
|
this.changeEvent(evnt, multipleValue);
|
|
670
781
|
} else {
|
|
782
|
+
this.remoteValueList = [{
|
|
783
|
+
key: selectValue,
|
|
784
|
+
result: option
|
|
785
|
+
}];
|
|
671
786
|
this.changeEvent(evnt, selectValue);
|
|
672
787
|
this.hideOptionPanel();
|
|
673
788
|
}
|
|
@@ -704,6 +819,7 @@ var _default2 = {
|
|
|
704
819
|
handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) {
|
|
705
820
|
var visiblePanel = this.visiblePanel,
|
|
706
821
|
currentValue = this.currentValue,
|
|
822
|
+
currentOption = this.currentOption,
|
|
707
823
|
clearable = this.clearable,
|
|
708
824
|
disabled = this.disabled;
|
|
709
825
|
|
|
@@ -727,7 +843,7 @@ var _default2 = {
|
|
|
727
843
|
} else if (isEnter) {
|
|
728
844
|
evnt.preventDefault();
|
|
729
845
|
evnt.stopPropagation();
|
|
730
|
-
this.changeOptionEvent(evnt, currentValue);
|
|
846
|
+
this.changeOptionEvent(evnt, currentValue, currentOption);
|
|
731
847
|
} else if (isUpArrow || isDwArrow) {
|
|
732
848
|
evnt.preventDefault();
|
|
733
849
|
|
|
@@ -764,6 +880,17 @@ var _default2 = {
|
|
|
764
880
|
this.panelIndex = _utils.default.nextZIndex();
|
|
765
881
|
}
|
|
766
882
|
},
|
|
883
|
+
handleFocusSearch: function handleFocusSearch() {
|
|
884
|
+
var _this4 = this;
|
|
885
|
+
|
|
886
|
+
if (this.filterable) {
|
|
887
|
+
this.$nextTick(function () {
|
|
888
|
+
if (_this4.$refs.inpSearch) {
|
|
889
|
+
_this4.$refs.inpSearch.focus();
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
},
|
|
767
894
|
focusEvent: function focusEvent() {
|
|
768
895
|
if (!this.disabled) {
|
|
769
896
|
this.isActivated = true;
|
|
@@ -772,6 +899,47 @@ var _default2 = {
|
|
|
772
899
|
blurEvent: function blurEvent() {
|
|
773
900
|
this.isActivated = false;
|
|
774
901
|
},
|
|
902
|
+
modelSearchEvent: function modelSearchEvent(value) {
|
|
903
|
+
this.searchValue = value;
|
|
904
|
+
},
|
|
905
|
+
focusSearchEvent: function focusSearchEvent() {
|
|
906
|
+
this.isActivated = true;
|
|
907
|
+
},
|
|
908
|
+
keydownSearchEvent: function keydownSearchEvent(params) {
|
|
909
|
+
var $event = params.$event;
|
|
910
|
+
var isEnter = (0, _event.hasEventKey)($event, _event.EVENT_KEYS.ENTER);
|
|
911
|
+
|
|
912
|
+
if (isEnter) {
|
|
913
|
+
$event.preventDefault();
|
|
914
|
+
$event.stopPropagation();
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
triggerSearchEvent: _xeUtils.default.debounce(function () {
|
|
918
|
+
var _this5 = this;
|
|
919
|
+
|
|
920
|
+
var remote = this.remote,
|
|
921
|
+
remoteMethod = this.remoteMethod,
|
|
922
|
+
searchValue = this.searchValue;
|
|
923
|
+
|
|
924
|
+
if (remote && remoteMethod) {
|
|
925
|
+
this.searchLoading = true;
|
|
926
|
+
Promise.resolve(remoteMethod({
|
|
927
|
+
searchValue: searchValue
|
|
928
|
+
})).then(function () {
|
|
929
|
+
return _this5.$nextTick();
|
|
930
|
+
}).catch(function () {
|
|
931
|
+
return _this5.$nextTick();
|
|
932
|
+
}).finally(function () {
|
|
933
|
+
_this5.searchLoading = false;
|
|
934
|
+
|
|
935
|
+
_this5.refreshOption();
|
|
936
|
+
});
|
|
937
|
+
} else {
|
|
938
|
+
this.refreshOption();
|
|
939
|
+
}
|
|
940
|
+
}, 350, {
|
|
941
|
+
trailing: true
|
|
942
|
+
}),
|
|
775
943
|
isPanelVisible: function isPanelVisible() {
|
|
776
944
|
return this.visiblePanel;
|
|
777
945
|
},
|
|
@@ -809,12 +977,14 @@ var _default2 = {
|
|
|
809
977
|
}
|
|
810
978
|
},
|
|
811
979
|
showOptionPanel: function showOptionPanel() {
|
|
812
|
-
var
|
|
980
|
+
var _this6 = this;
|
|
813
981
|
|
|
814
982
|
var loading = this.loading,
|
|
815
|
-
disabled = this.disabled
|
|
983
|
+
disabled = this.disabled,
|
|
984
|
+
filterable = this.filterable;
|
|
816
985
|
|
|
817
986
|
if (!loading && !disabled) {
|
|
987
|
+
this.searchList = this.option;
|
|
818
988
|
clearTimeout(this.hidePanelTimeout);
|
|
819
989
|
|
|
820
990
|
if (!this.inited) {
|
|
@@ -827,38 +997,48 @@ var _default2 = {
|
|
|
827
997
|
|
|
828
998
|
this.isActivated = true;
|
|
829
999
|
this.animatVisible = true;
|
|
1000
|
+
|
|
1001
|
+
if (filterable) {
|
|
1002
|
+
this.refreshOption();
|
|
1003
|
+
}
|
|
1004
|
+
|
|
830
1005
|
setTimeout(function () {
|
|
831
|
-
var value =
|
|
832
|
-
multiple =
|
|
833
|
-
var currOption = findOption(
|
|
834
|
-
|
|
1006
|
+
var value = _this6.value,
|
|
1007
|
+
multiple = _this6.multiple;
|
|
1008
|
+
var currOption = findOption(_this6, multiple && value ? value[0] : value);
|
|
1009
|
+
_this6.visiblePanel = true;
|
|
835
1010
|
|
|
836
1011
|
if (currOption) {
|
|
837
|
-
|
|
1012
|
+
_this6.setCurrentOption(currOption);
|
|
838
1013
|
|
|
839
|
-
|
|
1014
|
+
_this6.scrollToOption(currOption);
|
|
840
1015
|
}
|
|
1016
|
+
|
|
1017
|
+
_this6.handleFocusSearch();
|
|
841
1018
|
}, 10);
|
|
842
1019
|
this.updateZindex();
|
|
843
1020
|
this.updatePlacement();
|
|
844
1021
|
}
|
|
845
1022
|
},
|
|
846
1023
|
hideOptionPanel: function hideOptionPanel() {
|
|
847
|
-
var
|
|
1024
|
+
var _this7 = this;
|
|
848
1025
|
|
|
1026
|
+
this.searchValue = '';
|
|
1027
|
+
this.searchLoading = false;
|
|
849
1028
|
this.visiblePanel = false;
|
|
850
1029
|
this.hidePanelTimeout = setTimeout(function () {
|
|
851
|
-
|
|
1030
|
+
_this7.animatVisible = false;
|
|
1031
|
+
_this7.searchValue = '';
|
|
852
1032
|
}, 350);
|
|
853
1033
|
},
|
|
854
1034
|
updatePlacement: function updatePlacement() {
|
|
855
|
-
var
|
|
1035
|
+
var _this8 = this;
|
|
856
1036
|
|
|
857
1037
|
return this.$nextTick().then(function () {
|
|
858
|
-
var $refs =
|
|
859
|
-
transfer =
|
|
860
|
-
placement =
|
|
861
|
-
panelIndex =
|
|
1038
|
+
var $refs = _this8.$refs,
|
|
1039
|
+
transfer = _this8.transfer,
|
|
1040
|
+
placement = _this8.placement,
|
|
1041
|
+
panelIndex = _this8.panelIndex;
|
|
862
1042
|
var targetElem = $refs.input.$el;
|
|
863
1043
|
var panelElem = $refs.panel;
|
|
864
1044
|
|
|
@@ -932,9 +1112,9 @@ var _default2 = {
|
|
|
932
1112
|
}
|
|
933
1113
|
}
|
|
934
1114
|
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
return
|
|
1115
|
+
_this8.panelStyle = panelStyle;
|
|
1116
|
+
_this8.panelPlacement = panelPlacement;
|
|
1117
|
+
return _this8.$nextTick();
|
|
938
1118
|
}
|
|
939
1119
|
});
|
|
940
1120
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,exports.renderOptgroup=renderOptgroup,exports.renderOption=renderOption;var _xeUtils=_interopRequireDefault(require("xe-utils")),_input=_interopRequireDefault(require("../../input/src/input")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_utils=_interopRequireWildcard(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_event=require("../../tools/event");function _getRequireWildcardCache(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(_getRequireWildcardCache=function(t){return t?i:e})(t)}function _interopRequireWildcard(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==_typeof(t)&&"function"!=typeof t)return{default:t};e=_getRequireWildcardCache(e);if(e&&e.has(t))return e.get(t);var i,n,o={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&((n=l?Object.getOwnPropertyDescriptor(t,i):null)&&(n.get||n.set)?Object.defineProperty(o,i,n):o[i]=t[i]);return o.default=t,e&&e.set(t,o),o}function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _defineProperty(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function isOptionVisible(t){return!1!==t.visible}function getOptUniqueId(){return _xeUtils.default.uniqueId("opt_")}function getOptkey(t){return t.optionOpts.keyField||t.optionId||"_X_OPTION_KEY"}function getOptid(t,e){t=e[getOptkey(t)];return t?encodeURIComponent(t):""}function findOffsetOption(t,e,i){var n,o,l,s,r=t.isGroup,u=t.visibleOptionList,a=t.visibleGroupList,p=t.valueField,f=t.groupOptionsField;if(r)for(var c=0;c<a.length;c++){var d=a[c],h=d[f],v=d.disabled;if(h)for(var b=0;b<h.length;b++){var O=h[b],g=isOptionVisible(O),m=v||O.disabled;if(n||m||(n=O),s&&g&&!m&&(l=O,!i))return{offsetOption:l};if(e===O[p]){if(s=O,i)return{offsetOption:o}}else g&&!m&&(o=O)}}else for(var _=0;_<u.length;_++){var x=u[_],y=x.disabled;if(n||y||(n=x),s&&!y&&(l=x,!i))return{offsetOption:l};if(e===x[p]){if(s=x,i)return{offsetOption:o}}else y||(o=x)}return{firstOption:n}}function findOption(t,e){var i=t.isGroup,n=t.fullOptionList,o=t.fullGroupList,l=t.valueField;if(i)for(var s=0;s<o.length;s++){var r=o[s];if(r.options)for(var u=0;u<r.options.length;u++){var a=r.options[u];if(e===a[l])return a}}return n.find(function(t){return e===t[l]})}function getSelectLabel(t,e){var i=findOption(t,e);return _xeUtils.default.toValueString(i?i[t.labelField]:e)}function renderOption(r,u,t,a){var p=u.isGroup,f=u.labelField,c=u.valueField,d=u.optionKey,h=u.value,v=u.multiple,b=u.currentValue,O=u.optionOpts.useKey;return t.map(function(t,e){var i=t.slots,n=!p||isOptionVisible(t),o=a&&a.disabled||t.disabled,l=t[c],s=getOptid(u,t),i=i?i.default:null;return n?r("div",{key:O||d?s:e,class:["vxe-select-option",t.className,{"is--disabled":o,"is--selected":v?h&&-1<h.indexOf(l):h===l,"is--hover":b===l}],attrs:{optid:s},on:{mousedown:u.mousedownOptionEvent,click:function(t){o||u.changeOptionEvent(t,l)},mouseenter:function(){o||u.setCurrentOption(t)}}},i?u.callSlot(i,{option:t,$select:u},r):_utils.default.formatText((0,_utils.getFuncText)(t[f]))):null})}function renderOptgroup(l,s){var r=s.optionKey,t=s.visibleGroupList,u=s.groupLabelField,a=s.groupOptionsField,p=s.optionOpts.useKey;return t.map(function(t,e){var i=t.slots,n=getOptid(s,t),o=t.disabled,i=i?i.default:null;return l("div",{key:p||r?n:e,class:["vxe-optgroup",t.className,{"is--disabled":o}],attrs:{optid:n}},[l("div",{class:"vxe-optgroup--title"},i?s.callSlot(i,{option:t,$select:s},l):(0,_utils.getFuncText)(t[u])),l("div",{class:"vxe-optgroup--wrapper"},renderOption(l,s,t[a],t))])})}function renderOpts(t,e){var i=e.isGroup,n=e.visibleGroupList,o=e.visibleOptionList;if(i){if(n.length)return renderOptgroup(t,e)}else if(o.length)return renderOption(t,e,o);return[t("div",{class:"vxe-select--empty-placeholder"},e.emptyText||_conf.default.i18n("vxe.select.emptyText"))]}var _default2={name:"VxeSelect",mixins:[_size.default],props:{value:null,clearable:Boolean,placeholder:String,loading:Boolean,disabled:Boolean,multiple:Boolean,multiCharOverflow:{type:[Number,String],default:function(){return _conf.default.select.multiCharOverflow}},prefixIcon:String,placement:String,options:Array,optionProps:Object,optionGroups:Array,optionGroupProps:Object,optionConfig:Object,className:[String,Function],size:{type:String,default:function(){return _conf.default.select.size||_conf.default.size}},emptyText:String,optionId:{type:String,default:function(){return _conf.default.select.optionId}},optionKey:Boolean,transfer:{type:Boolean,default:function(){return _conf.default.select.transfer}}},components:{VxeInput:_input.default},inject:{$xeform:{default:null},$xeformiteminfo:{default:null}},provide:function(){return{$xeselect:this}},data:function(){return{inited:!1,collectOption:[],fullGroupList:[],fullOptionList:[],visibleGroupList:[],visibleOptionList:[],panelIndex:0,panelStyle:null,panelPlacement:null,currentValue:null,visiblePanel:!1,animatVisible:!1,isActivated:!1}},computed:{propsOpts:function(){return this.optionProps||{}},groupPropsOpts:function(){return this.optionGroupProps||{}},labelField:function(){return this.propsOpts.label||"label"},valueField:function(){return this.propsOpts.value||"value"},groupLabelField:function(){return this.groupPropsOpts.label||"label"},groupOptionsField:function(){return this.groupPropsOpts.options||"options"},optionOpts:function(){return Object.assign({},_conf.default.select.optionConfig,this.optionConfig)},isGroup:function(){return this.fullGroupList.some(function(t){return t.options&&t.options.length})},multiMaxCharNum:function(){return _xeUtils.default.toNumber(this.multiCharOverflow)},selectLabel:function(){var e=this,t=this.value,i=this.multiple,n=this.multiMaxCharNum;return t&&i?(_xeUtils.default.isArray(t)?t:[t]).map(function(t){t=getSelectLabel(e,t);return 0<n&&t.length>n?"".concat(t.substring(0,n),"..."):t}).join(", "):getSelectLabel(this,t)}},watch:{collectOption:function(t){t.some(function(t){return t.options&&t.options.length})?(this.fullOptionList=[],this.fullGroupList=t):(this.fullGroupList=[],this.fullOptionList=t),this.cacheItemMap()},options:function(t){this.fullGroupList=[],this.fullOptionList=t,this.cacheItemMap()},optionGroups:function(t){this.fullOptionList=[],this.fullGroupList=t,this.cacheItemMap()}},created:function(){var t=this.options,e=this.optionGroups;e?this.fullGroupList=e:t&&(this.fullOptionList=t),this.cacheItemMap(),_event.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent),_event.GlobalEvent.on(this,"mousedown",this.handleGlobalMousedownEvent),_event.GlobalEvent.on(this,"keydown",this.handleGlobalKeydownEvent),_event.GlobalEvent.on(this,"blur",this.handleGlobalBlurEvent)},beforeDestroy:function(){var t=this.$refs.panel;t&&t.parentNode&&t.parentNode.removeChild(t)},destroyed:function(){_event.GlobalEvent.off(this,"mousewheel"),_event.GlobalEvent.off(this,"mousedown"),_event.GlobalEvent.off(this,"keydown"),_event.GlobalEvent.off(this,"blur")},render:function(t){var e=this.$scopedSlots,i=this.vSize,n=this.className,o=this.inited,l=this.isActivated,s=this.loading,r=this.disabled,u=this.visiblePanel,a=e.prefix;return t("div",{class:["vxe-select",n?_xeUtils.default.isFunction(n)?n({$select:this}):n:"",(_defineProperty(n={},"size--".concat(i),i),_defineProperty(n,"is--visivle",u),_defineProperty(n,"is--disabled",r),_defineProperty(n,"is--loading",s),_defineProperty(n,"is--active",l),n)]},[t("div",{class:"vxe-select-slots",ref:"hideOption"},this.$slots.default),t("vxe-input",{ref:"input",props:{clearable:this.clearable,placeholder:this.placeholder,readonly:!0,disabled:r,type:"text",prefixIcon:this.prefixIcon,suffixIcon:s?_conf.default.icon.SELECT_LOADED:u?_conf.default.icon.SELECT_OPEN:_conf.default.icon.SELECT_CLOSE,value:this.selectLabel},on:{clear:this.clearEvent,click:this.togglePanelEvent,focus:this.focusEvent,blur:this.blurEvent,"suffix-click":this.togglePanelEvent},scopedSlots:a?{prefix:function(){return a({})}}:{}}),t("div",{ref:"panel",class:["vxe-table--ignore-clear vxe-select--panel",(_defineProperty(r={},"size--".concat(i),i),_defineProperty(r,"is--transfer",this.transfer),_defineProperty(r,"animat--leave",!s&&this.animatVisible),_defineProperty(r,"animat--enter",!s&&u),r)],attrs:{placement:this.panelPlacement},style:this.panelStyle},o?[t("div",{ref:"optWrapper",class:"vxe-select-option--wrapper"},renderOpts(t,this))]:null)])},methods:{callSlot:function(t,e,i){if(t){var n=this.$scopedSlots;if(_xeUtils.default.isString(t)&&(t=n[t]||null),_xeUtils.default.isFunction(t))return t.call(this,e,i)}return[]},cacheItemMap:function(){function e(t){getOptid(i,t)||(t[l]=getOptUniqueId())}var i=this,t=this.fullOptionList,n=this.fullGroupList,o=this.groupOptionsField,l=getOptkey(this);n.length?n.forEach(function(t){e(t),t[o]&&t[o].forEach(e)}):t.length&&t.forEach(e),this.refreshOption()},refreshOption:function(){var t=this.isGroup,e=this.fullOptionList,i=this.fullGroupList;return t?this.visibleGroupList=i.filter(isOptionVisible):this.visibleOptionList=e.filter(isOptionVisible),this.$nextTick()},setCurrentOption:function(t){t&&(this.currentValue=t[this.valueField])},scrollToOption:function(n,o){var l=this;return this.$nextTick().then(function(){var t,e,i;n&&(t=(i=l.$refs).optWrapper,e=i.panel.querySelector("[optid='".concat(getOptid(l,n),"']")),t&&e&&(i=t.offsetHeight,o?e.offsetTop+e.offsetHeight-t.scrollTop>i&&(t.scrollTop=e.offsetTop+e.offsetHeight-i):(e.offsetTop+5<t.scrollTop||e.offsetTop+5>t.scrollTop+t.clientHeight)&&(t.scrollTop=e.offsetTop-5)))})},clearEvent:function(t,e){this.clearValueEvent(e,null),this.hideOptionPanel()},clearValueEvent:function(t,e){this.changeEvent(t,e),this.$emit("clear",{value:e,$event:t})},changeEvent:function(t,e){e!==this.value&&(this.$emit("input",e),this.$emit("change",{value:e,$event:t}),this.$xeform&&this.$xeformiteminfo&&this.$xeform.triggerItemEvent(t,this.$xeformiteminfo.itemConfig.field,e))},mousedownOptionEvent:function(t){0===t.button&&t.stopPropagation()},changeOptionEvent:function(t,e){var i=this.value;this.multiple?(i=i?-1===i.indexOf(e)?i.concat([e]):i.filter(function(t){return t!==e}):[e],this.changeEvent(t,i)):(this.changeEvent(t,e),this.hideOptionPanel())},handleGlobalMousewheelEvent:function(t){var e=this.$refs,i=this.disabled,n=this.visiblePanel;i||n&&(_dom.default.getEventTargetNode(t,e.panel).flag?this.updatePlacement():this.hideOptionPanel())},handleGlobalMousedownEvent:function(t){var e=this.$refs,i=this.$el,n=this.disabled,o=this.visiblePanel;n||(this.isActivated=_dom.default.getEventTargetNode(t,i).flag||_dom.default.getEventTargetNode(t,e.panel).flag,o&&!this.isActivated&&this.hideOptionPanel())},handleGlobalKeydownEvent:function(t){var e,i,n,o,l,s,r,u=this.visiblePanel,a=this.currentValue,p=this.clearable;this.disabled||(e=13===(s=t.keyCode),r=27===s,i=38===s,n=40===s,o=46===s,l=32===s,(s=9===s)&&(this.isActivated=!1),u?r||s?this.hideOptionPanel():e?(t.preventDefault(),t.stopPropagation(),this.changeOptionEvent(t,a)):i||n?(t.preventDefault(),s=(r=findOffsetOption(this,a,i)).firstOption,(r=r.offsetOption)||findOption(this,a)||(r=s),this.setCurrentOption(r),this.scrollToOption(r,n)):l&&t.preventDefault():(i||n||e||l)&&this.isActivated&&(t.preventDefault(),this.showOptionPanel()),this.isActivated&&o&&p&&this.clearValueEvent(t,null))},handleGlobalBlurEvent:function(){this.hideOptionPanel()},updateZindex:function(){this.panelIndex<_utils.default.getLastZIndex()&&(this.panelIndex=_utils.default.nextZIndex())},focusEvent:function(){this.disabled||(this.isActivated=!0)},blurEvent:function(){this.isActivated=!1},isPanelVisible:function(){return this.visiblePanel},togglePanel:function(){this.visiblePanel?this.hideOptionPanel():this.showOptionPanel(),this.$nextTick()},hidePanel:function(){this.visiblePanel&&this.hideOptionPanel(),this.$nextTick()},showPanel:function(){this.visiblePanel||this.showOptionPanel(),this.$nextTick()},togglePanelEvent:function(t){t.$event.preventDefault(),this.visiblePanel?this.hideOptionPanel():this.showOptionPanel()},showOptionPanel:function(){var i=this,t=this.loading,e=this.disabled;t||e||(clearTimeout(this.hidePanelTimeout),this.inited||(this.inited=!0,this.transfer&&document.body.appendChild(this.$refs.panel)),this.isActivated=!0,this.animatVisible=!0,setTimeout(function(){var t=i.value,e=i.multiple,t=findOption(i,e&&t?t[0]:t);i.visiblePanel=!0,t&&(i.setCurrentOption(t),i.scrollToOption(t))},10),this.updateZindex(),this.updatePlacement())},hideOptionPanel:function(){var t=this;this.visiblePanel=!1,this.hidePanelTimeout=setTimeout(function(){t.animatVisible=!1},350)},updatePlacement:function(){var c=this;return this.$nextTick().then(function(){var t=c.$refs,e=c.transfer,i=c.placement,n=c.panelIndex,o=t.input.$el,l=t.panel;if(l&&o){var s=o.offsetHeight,r=o.offsetWidth,u=l.offsetHeight,a=l.offsetWidth,p={zIndex:n},f=_dom.default.getAbsolutePos(o),t=f.boundingTop,l=f.boundingLeft,n=f.visibleHeight,o=f.visibleWidth,f="bottom";return e?(e=t+s,"top"===i?(f="top",e=t-u):i||(n<e+u+5&&(f="top",e=t-u),e<5&&(f="bottom",e=t+s)),o<(l=l)+a+5&&(l-=l+a+5-o),l<5&&(l=5),Object.assign(p,{left:"".concat(l,"px"),top:"".concat(e,"px"),minWidth:"".concat(r,"px")})):"top"===i?(f="top",p.bottom="".concat(s,"px")):i||n<t+s+u&&5<t-s-u&&(f="top",p.bottom="".concat(s,"px")),c.panelStyle=p,c.panelPlacement=f,c.$nextTick()}})},focus:function(){return this.isActivated=!0,this.$refs.input.focus(),this.$nextTick()},blur:function(){return this.hideOptionPanel(),this.$refs.input.blur(),this.$nextTick()}}};exports.default=_default2;
|
|
1
|
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,exports.renderOptgroup=renderOptgroup,exports.renderOption=renderOption;var _xeUtils=_interopRequireDefault(require("xe-utils")),_input=_interopRequireDefault(require("../../input/src/input")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_utils=_interopRequireWildcard(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_event=require("../../tools/event");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(_getRequireWildcardCache=function(e){return e?i:t})(e)}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var i,n,o={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&((n=l?Object.getOwnPropertyDescriptor(e,i):null)&&(n.get||n.set)?Object.defineProperty(o,i,n):o[i]=e[i]);return o.default=e,t&&t.set(e,o),o}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function isOptionVisible(e){return!1!==e.visible}function getOptUniqueId(){return _xeUtils.default.uniqueId("opt_")}function getOptkey(e){return e.optionOpts.keyField||e.optionId||"_X_OPTION_KEY"}function getOptid(e,t){e=t[getOptkey(e)];return e?encodeURIComponent(e):""}function findOffsetOption(e,t,i){var n,o,l,s,r=e.isGroup,a=e.visibleOptionList,u=e.visibleGroupList,c=e.valueField,f=e.groupOptionsField;if(r)for(var p=0;p<u.length;p++){var h=u[p],d=h[f],v=h.disabled;if(d)for(var b=0;b<d.length;b++){var O=d[b],g=isOptionVisible(O),m=v||O.disabled;if(n||m||(n=O),s&&g&&!m&&(l=O,!i))return{offsetOption:l};if(t===O[c]){if(s=O,i)return{offsetOption:o}}else g&&!m&&(o=O)}}else for(var x=0;x<a.length;x++){var _=a[x],y=_.disabled;if(n||y||(n=_),s&&!y&&(l=_,!i))return{offsetOption:l};if(t===_[c]){if(s=_,i)return{offsetOption:o}}else y||(o=_)}return{firstOption:n}}function findOption(e,t){var i=e.isGroup,n=e.fullOptionList,o=e.fullGroupList,l=e.valueField;if(i)for(var s=0;s<o.length;s++){var r=o[s];if(r.options)for(var a=0;a<r.options.length;a++){var u=r.options[a];if(t===u[l])return u}}return n.find(function(e){return t===e[l]})}function getRemoteSelectLabel(e,t){var i=e.remoteValueList.find(function(e){return t===e.key}),i=i?i.result:null;return _xeUtils.default.toValueString(i?i[e.labelField]:t)}function getSelectLabel(e,t){var i=findOption(e,t);return _xeUtils.default.toValueString(i?i[e.labelField]:t)}function renderOption(r,a,e,u){var c=a.isGroup,f=a.labelField,p=a.valueField,h=a.optionKey,d=a.value,v=a.multiple,b=a.currentValue,O=a.optionOpts.useKey;return e.map(function(t,e){var i=t.slots,n=!c||isOptionVisible(t),o=u&&u.disabled||t.disabled,l=t[p],s=getOptid(a,t),i=i?i.default:null;return n?r("div",{key:O||h?s:e,class:["vxe-select-option",t.className,{"is--disabled":o,"is--selected":v?d&&-1<d.indexOf(l):d===l,"is--hover":b===l}],attrs:{optid:s},on:{mousedown:a.mousedownOptionEvent,click:function(e){o||a.changeOptionEvent(e,l,t)},mouseenter:function(){o||a.setCurrentOption(t)}}},i?a.callSlot(i,{option:t,$select:a},r):_utils.default.formatText((0,_utils.getFuncText)(t[f]))):null})}function renderOptgroup(l,s){var r=s.optionKey,e=s.visibleGroupList,a=s.groupLabelField,u=s.groupOptionsField,c=s.optionOpts.useKey;return e.map(function(e,t){var i=e.slots,n=getOptid(s,e),o=e.disabled,i=i?i.default:null;return l("div",{key:c||r?n:t,class:["vxe-optgroup",e.className,{"is--disabled":o}],attrs:{optid:n}},[l("div",{class:"vxe-optgroup--title"},i?s.callSlot(i,{option:e,$select:s},l):(0,_utils.getFuncText)(e[a])),l("div",{class:"vxe-optgroup--wrapper"},renderOption(l,s,e[u],e))])})}function renderOpts(e,t){var i=t.isGroup,n=t.visibleGroupList,o=t.visibleOptionList;if(t.searchLoading)return[e("div",{class:"vxe-select--search-loading"},[e("i",{class:["vxe-select--search-icon",_conf.default.icon.SELECT_LOADED]}),e("span",{class:"vxe-select--search-text"},_conf.default.i18n("vxe.select.loadingText"))])];if(i){if(n.length)return renderOptgroup(e,t)}else if(o.length)return renderOption(e,t,o);return[e("div",{class:"vxe-select--empty-placeholder"},t.emptyText||_conf.default.i18n("vxe.select.emptyText"))]}var _default2={name:"VxeSelect",mixins:[_size.default],props:{value:null,clearable:Boolean,placeholder:String,loading:Boolean,disabled:Boolean,multiple:Boolean,multiCharOverflow:{type:[Number,String],default:function(){return _conf.default.select.multiCharOverflow}},prefixIcon:String,placement:String,options:Array,optionProps:Object,optionGroups:Array,optionGroupProps:Object,optionConfig:Object,className:[String,Function],size:{type:String,default:function(){return _conf.default.select.size||_conf.default.size}},filterable:Boolean,filterMethod:Function,remote:Boolean,remoteMethod:Function,emptyText:String,optionId:{type:String,default:function(){return _conf.default.select.optionId}},optionKey:Boolean,transfer:{type:Boolean,default:function(){return _conf.default.select.transfer}}},components:{VxeInput:_input.default},inject:{$xeform:{default:null},$xeformiteminfo:{default:null}},provide:function(){return{$xeselect:this}},data:function(){return{inited:!1,collectOption:[],fullGroupList:[],fullOptionList:[],visibleGroupList:[],visibleOptionList:[],remoteValueList:[],panelIndex:0,panelStyle:null,panelPlacement:null,currentOption:null,currentValue:null,visiblePanel:!1,animatVisible:!1,isActivated:!1,searchValue:"",searchLoading:!1}},computed:{propsOpts:function(){return this.optionProps||{}},groupPropsOpts:function(){return this.optionGroupProps||{}},labelField:function(){return this.propsOpts.label||"label"},valueField:function(){return this.propsOpts.value||"value"},groupLabelField:function(){return this.groupPropsOpts.label||"label"},groupOptionsField:function(){return this.groupPropsOpts.options||"options"},optionOpts:function(){return Object.assign({},_conf.default.select.optionConfig,this.optionConfig)},isGroup:function(){return this.fullGroupList.some(function(e){return e.options&&e.options.length})},multiMaxCharNum:function(){return _xeUtils.default.toNumber(this.multiCharOverflow)},selectLabel:function(){var t=this,e=this.value,i=this.multiple,n=this.remote,o=this.multiMaxCharNum;if(e&&i){i=_xeUtils.default.isArray(e)?e:[e];return n?i.map(function(e){return getRemoteSelectLabel(t,e)}).join(", "):i.map(function(e){e=getSelectLabel(t,e);return 0<o&&e.length>o?"".concat(e.substring(0,o),"..."):e}).join(", ")}return(n?getRemoteSelectLabel:getSelectLabel)(this,e)}},watch:{collectOption:function(e){e.some(function(e){return e.options&&e.options.length})?(this.fullOptionList=[],this.fullGroupList=e):(this.fullGroupList=[],this.fullOptionList=e),this.cacheItemMap()},options:function(e){this.fullGroupList=[],this.fullOptionList=e,this.cacheItemMap()},optionGroups:function(e){this.fullOptionList=[],this.fullGroupList=e,this.cacheItemMap()}},created:function(){var e=this.options,t=this.optionGroups;t?this.fullGroupList=t:e&&(this.fullOptionList=e),this.cacheItemMap(),_event.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent),_event.GlobalEvent.on(this,"mousedown",this.handleGlobalMousedownEvent),_event.GlobalEvent.on(this,"keydown",this.handleGlobalKeydownEvent),_event.GlobalEvent.on(this,"blur",this.handleGlobalBlurEvent)},beforeDestroy:function(){var e=this.$refs.panel;e&&e.parentNode&&e.parentNode.removeChild(e)},destroyed:function(){_event.GlobalEvent.off(this,"mousewheel"),_event.GlobalEvent.off(this,"mousedown"),_event.GlobalEvent.off(this,"keydown"),_event.GlobalEvent.off(this,"blur")},render:function(e){var t=this._e,i=this.$scopedSlots,n=this.vSize,o=this.className,l=this.inited,s=this.isActivated,r=this.loading,a=this.disabled,u=this.visiblePanel,c=this.filterable,f=i.prefix;return e("div",{class:["vxe-select",o?_xeUtils.default.isFunction(o)?o({$select:this}):o:"",(_defineProperty(o={},"size--".concat(n),n),_defineProperty(o,"is--visivle",u),_defineProperty(o,"is--disabled",a),_defineProperty(o,"is--filter",c),_defineProperty(o,"is--loading",r),_defineProperty(o,"is--active",s),o)]},[e("div",{class:"vxe-select-slots",ref:"hideOption"},this.$slots.default),e("vxe-input",{ref:"input",props:{clearable:this.clearable,placeholder:this.placeholder,readonly:!0,disabled:a,type:"text",prefixIcon:this.prefixIcon,suffixIcon:r?_conf.default.icon.SELECT_LOADED:u?_conf.default.icon.SELECT_OPEN:_conf.default.icon.SELECT_CLOSE,value:this.selectLabel},on:{clear:this.clearEvent,click:this.togglePanelEvent,focus:this.focusEvent,blur:this.blurEvent,"suffix-click":this.togglePanelEvent},scopedSlots:f?{prefix:function(){return f({})}}:{}}),e("div",{ref:"panel",class:["vxe-table--ignore-clear vxe-select--panel",(_defineProperty(a={},"size--".concat(n),n),_defineProperty(a,"is--transfer",this.transfer),_defineProperty(a,"animat--leave",!r&&this.animatVisible),_defineProperty(a,"animat--enter",!r&&u),a)],attrs:{placement:this.panelPlacement},style:this.panelStyle},l?[c?e("div",{class:"vxe-select-filter--wrapper"},[e("vxe-input",{ref:"inpSearch",class:"vxe-select-filter--input",props:{value:this.searchValue,type:"text",clearable:!0,placeholder:_conf.default.i18n("vxe.select.search"),prefixIcon:_conf.default.icon.INPUT_SEARCH},on:{modelValue:this.modelSearchEvent,focus:this.focusSearchEvent,keydown:this.keydownSearchEvent,change:this.triggerSearchEvent,search:this.triggerSearchEvent}})]):t(),e("div",{ref:"optWrapper",class:"vxe-select-option--wrapper"},renderOpts(e,this))]:null)])},methods:{callSlot:function(e,t,i){if(e){var n=this.$scopedSlots;if(_xeUtils.default.isString(e)&&(e=n[e]||null),_xeUtils.default.isFunction(e))return e.call(this,t,i)}return[]},cacheItemMap:function(){function t(e){getOptid(i,e)||(e[l]=getOptUniqueId())}var i=this,e=this.fullOptionList,n=this.fullGroupList,o=this.groupOptionsField,l=getOptkey(this);n.length?n.forEach(function(e){t(e),e[o]&&e[o].forEach(t)}):e.length&&e.forEach(t),this.refreshOption()},refreshOption:function(){var e=this.isGroup,t=this.fullOptionList,i=this.fullGroupList,n=this.filterable,o=this.filterMethod,l=this.searchValue,s=this.labelField,r=this.groupLabelField;return e?this.visibleGroupList=n&&o?i.filter(function(e){return isOptionVisible(e)&&o({group:e,option:null,searchValue:l})}):n?i.filter(function(e){return isOptionVisible(e)&&(!l||-1<"".concat(e[r]).indexOf(l))}):i.filter(isOptionVisible):this.visibleOptionList=n&&o?t.filter(function(e){return isOptionVisible(e)&&o({group:null,option:e,searchValue:l})}):n?t.filter(function(e){return isOptionVisible(e)&&(!l||-1<"".concat(e[s]).indexOf(l))}):t.filter(isOptionVisible),this.$nextTick()},setCurrentOption:function(e){e&&(this.currentOption=e,this.currentValue=e[this.valueField])},scrollToOption:function(n,o){var l=this;return this.$nextTick().then(function(){var e,t,i;n&&(e=(i=l.$refs).optWrapper,t=i.panel.querySelector("[optid='".concat(getOptid(l,n),"']")),e&&t&&(i=e.offsetHeight,o?t.offsetTop+t.offsetHeight-e.scrollTop>i&&(e.scrollTop=t.offsetTop+t.offsetHeight-i):(t.offsetTop+5<e.scrollTop||t.offsetTop+5>e.scrollTop+e.clientHeight)&&(e.scrollTop=t.offsetTop-5)))})},clearEvent:function(e,t){this.clearValueEvent(t,null),this.hideOptionPanel()},clearValueEvent:function(e,t){this.remoteValueList=[],this.changeEvent(e,t),this.$emit("clear",{value:t,$event:e})},changeEvent:function(e,t){t!==this.value&&(this.$emit("input",t),this.$emit("change",{value:t,$event:e}),this.$xeform&&this.$xeformiteminfo&&this.$xeform.triggerItemEvent(e,this.$xeformiteminfo.itemConfig.field,t))},mousedownOptionEvent:function(e){0===e.button&&e.stopPropagation()},changeOptionEvent:function(e,t,i){var n=this.value,o=this.multiple,l=this.remoteValueList;o?(o=n?-1===n.indexOf(t)?n.concat([t]):n.filter(function(e){return e!==t}):[t],(n=l.find(function(e){return e.key===t}))?n.result=i:l.push({key:t,result:i}),this.changeEvent(e,o)):(this.remoteValueList=[{key:t,result:i}],this.changeEvent(e,t),this.hideOptionPanel())},handleGlobalMousewheelEvent:function(e){var t=this.$refs,i=this.disabled,n=this.visiblePanel;i||n&&(_dom.default.getEventTargetNode(e,t.panel).flag?this.updatePlacement():this.hideOptionPanel())},handleGlobalMousedownEvent:function(e){var t=this.$refs,i=this.$el,n=this.disabled,o=this.visiblePanel;n||(this.isActivated=_dom.default.getEventTargetNode(e,i).flag||_dom.default.getEventTargetNode(e,t.panel).flag,o&&!this.isActivated&&this.hideOptionPanel())},handleGlobalKeydownEvent:function(e){var t,i,n,o,l,s,r,a=this.visiblePanel,u=this.currentValue,c=this.currentOption,f=this.clearable;this.disabled||(t=13===(r=e.keyCode),i=27===r,n=38===r,o=40===r,l=46===r,s=32===r,(r=9===r)&&(this.isActivated=!1),a?i||r?this.hideOptionPanel():t?(e.preventDefault(),e.stopPropagation(),this.changeOptionEvent(e,u,c)):n||o?(e.preventDefault(),c=(r=findOffsetOption(this,u,n)).firstOption,(r=r.offsetOption)||findOption(this,u)||(r=c),this.setCurrentOption(r),this.scrollToOption(r,o)):s&&e.preventDefault():(n||o||t||s)&&this.isActivated&&(e.preventDefault(),this.showOptionPanel()),this.isActivated&&l&&f&&this.clearValueEvent(e,null))},handleGlobalBlurEvent:function(){this.hideOptionPanel()},updateZindex:function(){this.panelIndex<_utils.default.getLastZIndex()&&(this.panelIndex=_utils.default.nextZIndex())},handleFocusSearch:function(){var e=this;this.filterable&&this.$nextTick(function(){e.$refs.inpSearch&&e.$refs.inpSearch.focus()})},focusEvent:function(){this.disabled||(this.isActivated=!0)},blurEvent:function(){this.isActivated=!1},modelSearchEvent:function(e){this.searchValue=e},focusSearchEvent:function(){this.isActivated=!0},keydownSearchEvent:function(e){e=e.$event;(0,_event.hasEventKey)(e,_event.EVENT_KEYS.ENTER)&&(e.preventDefault(),e.stopPropagation())},triggerSearchEvent:_xeUtils.default.debounce(function(){var e=this,t=this.remote,i=this.remoteMethod,n=this.searchValue;t&&i?(this.searchLoading=!0,Promise.resolve(i({searchValue:n})).then(function(){return e.$nextTick()}).catch(function(){return e.$nextTick()}).finally(function(){e.searchLoading=!1,e.refreshOption()})):this.refreshOption()},350,{trailing:!0}),isPanelVisible:function(){return this.visiblePanel},togglePanel:function(){this.visiblePanel?this.hideOptionPanel():this.showOptionPanel(),this.$nextTick()},hidePanel:function(){this.visiblePanel&&this.hideOptionPanel(),this.$nextTick()},showPanel:function(){this.visiblePanel||this.showOptionPanel(),this.$nextTick()},togglePanelEvent:function(e){e.$event.preventDefault(),this.visiblePanel?this.hideOptionPanel():this.showOptionPanel()},showOptionPanel:function(){var i=this,e=this.loading,t=this.disabled,n=this.filterable;e||t||(this.searchList=this.option,clearTimeout(this.hidePanelTimeout),this.inited||(this.inited=!0,this.transfer&&document.body.appendChild(this.$refs.panel)),this.isActivated=!0,this.animatVisible=!0,n&&this.refreshOption(),setTimeout(function(){var e=i.value,t=i.multiple,e=findOption(i,t&&e?e[0]:e);i.visiblePanel=!0,e&&(i.setCurrentOption(e),i.scrollToOption(e)),i.handleFocusSearch()},10),this.updateZindex(),this.updatePlacement())},hideOptionPanel:function(){var e=this;this.searchValue="",this.searchLoading=!1,this.visiblePanel=!1,this.hidePanelTimeout=setTimeout(function(){e.animatVisible=!1,e.searchValue=""},350)},updatePlacement:function(){var p=this;return this.$nextTick().then(function(){var e=p.$refs,t=p.transfer,i=p.placement,n=p.panelIndex,o=e.input.$el,l=e.panel;if(l&&o){var s=o.offsetHeight,r=o.offsetWidth,a=l.offsetHeight,u=l.offsetWidth,c={zIndex:n},f=_dom.default.getAbsolutePos(o),e=f.boundingTop,l=f.boundingLeft,n=f.visibleHeight,o=f.visibleWidth,f="bottom";return t?(t=e+s,"top"===i?(f="top",t=e-a):i||(n<t+a+5&&(f="top",t=e-a),t<5&&(f="bottom",t=e+s)),o<(l=l)+u+5&&(l-=l+u+5-o),l<5&&(l=5),Object.assign(c,{left:"".concat(l,"px"),top:"".concat(t,"px"),minWidth:"".concat(r,"px")})):"top"===i?(f="top",c.bottom="".concat(s,"px")):i||n<e+s+a&&5<e-s-a&&(f="top",c.bottom="".concat(s,"px")),p.panelStyle=c,p.panelPlacement=f,p.$nextTick()}})},focus:function(){return this.isActivated=!0,this.$refs.input.focus(),this.$nextTick()},blur:function(){return this.hideOptionPanel(),this.$refs.input.blur(),this.$nextTick()}}};exports.default=_default2;
|