@bytenew/bn-applet-ui 1.1.32 → 1.1.33

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.
@@ -638,6 +638,30 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.bytenew-select-box[data-v-12683c88]{w
638
638
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
639
639
 
640
640
 
641
+ /***/ },
642
+
643
+ /***/ 6105
644
+ (module, __webpack_exports__, __webpack_require__) {
645
+
646
+ "use strict";
647
+ __webpack_require__.r(__webpack_exports__);
648
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
649
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
650
+ /* harmony export */ });
651
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1601);
652
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
653
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6314);
654
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
655
+ // Imports
656
+
657
+
658
+ var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
659
+ // Module
660
+ ___CSS_LOADER_EXPORT___.push([module.id, `.virtualPopover[data-v-387cfe9e]{position:fixed;z-index:9999;padding-top:6px}.virtualPopover-modal[data-v-387cfe9e]{position:relative;background:#fff;box-shadow:0 12px 48px 16px rgba(0,0,0,.02),0 9px 28px 0 rgba(0,0,0,.02),0 6px 16px -8px rgba(0,0,0,.04)}.virtualPopover-arrow[data-v-387cfe9e]{position:absolute}.virtualPopover-arrow[data-v-387cfe9e]:after,.virtualPopover-arrow[data-v-387cfe9e]:before{content:"";display:block;width:0;height:0;top:0;border:6px solid transparent;position:absolute;z-index:1}.virtualPopover-arrow[data-v-387cfe9e]:before{z-index:2}.virtualPopover-arrow.bottom[data-v-387cfe9e]{top:-6px}.virtualPopover-arrow.bottom[data-v-387cfe9e]:before{border-bottom-color:#fff}.virtualPopover-arrow.bottom[data-v-387cfe9e]:after{border-bottom-color:rgba(0,0,0,.08);top:-1px}.virtualPopover-arrow.top[data-v-387cfe9e]{bottom:0}.virtualPopover-arrow.top[data-v-387cfe9e]:before{border-top-color:#fff}.virtualPopover-arrow.top[data-v-387cfe9e]:after{border-top-color:rgba(0,0,0,.08);top:1px}.virtualPopover.bottom[data-v-387cfe9e]{margin-top:6px}.virtualPopover.top[data-v-387cfe9e]{margin-bottom:6px}`, ""]);
661
+ // Exports
662
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
663
+
664
+
641
665
  /***/ },
642
666
 
643
667
  /***/ 4911
@@ -1225,6 +1249,22 @@ var update = add("506589a0", content, true, {"sourceMap":false,"shadowMode":fals
1225
1249
 
1226
1250
  /***/ },
1227
1251
 
1252
+ /***/ 9587
1253
+ (module, __unused_webpack_exports, __webpack_require__) {
1254
+
1255
+ // style-loader: Adds some css to the DOM by adding a <style> tag
1256
+
1257
+ // load the styles
1258
+ var content = __webpack_require__(6105);
1259
+ if(content.__esModule) content = content.default;
1260
+ if(typeof content === 'string') content = [[module.id, content, '']];
1261
+ if(content.locals) module.exports = content.locals;
1262
+ // add the styles to the DOM
1263
+ var add = (__webpack_require__(9548)/* ["default"] */ .A)
1264
+ var update = add("c518d294", content, true, {"sourceMap":false,"shadowMode":false});
1265
+
1266
+ /***/ },
1267
+
1228
1268
  /***/ 9548
1229
1269
  (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1230
1270
 
@@ -10476,6 +10516,7 @@ __webpack_require__.d(__webpack_exports__, {
10476
10516
  BnInputNum: () => (/* reexport */ BnInputNum),
10477
10517
  BnRuleCondition: () => (/* reexport */ bnRuleCondition),
10478
10518
  BnSelect: () => (/* reexport */ BnSelect_select),
10519
+ BnVirtPopover: () => (/* reexport */ BnVirtPopover),
10479
10520
  addressParse: () => (/* reexport */ addressParse),
10480
10521
  "default": () => (/* binding */ entry_lib),
10481
10522
  idsToTexts: () => (/* reexport */ idsToTexts)
@@ -21051,6 +21092,344 @@ var BnFiTaxAutoComplete_component = normalizeComponent(
21051
21092
  )
21052
21093
 
21053
21094
  /* harmony default export */ const BnFiTaxAutoComplete = (BnFiTaxAutoComplete_component.exports);
21095
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/babel-loader/lib/index.js!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/BnVirtPopover/index.vue?vue&type=template&id=387cfe9e&scoped=true
21096
+ var BnVirtPopovervue_type_template_id_387cfe9e_scoped_true_render = function render() {
21097
+ var _vm = this,
21098
+ _c = _vm._self._c;
21099
+ return _c('transition', {
21100
+ attrs: {
21101
+ "appear": "",
21102
+ "name": _vm.popoverPosition == 'bottom' ? 'el-zoom-in-top' : 'el-zoom-in-bottom'
21103
+ }
21104
+ }, [_c('div', {
21105
+ directives: [{
21106
+ name: "show",
21107
+ rawName: "v-show",
21108
+ value: _vm.modal,
21109
+ expression: "modal"
21110
+ }],
21111
+ ref: "customPopover",
21112
+ staticClass: "virtualPopover",
21113
+ "class": _vm.popoverClass,
21114
+ style: _vm.popoverStyle,
21115
+ on: {
21116
+ "mouseover": _vm.onMouseEvent,
21117
+ "mouseleave": _vm.onMouseEvent
21118
+ }
21119
+ }, [_c('div', {
21120
+ "class": _vm.arrowClass,
21121
+ style: _vm.arrowStyle
21122
+ }), _c('div', {
21123
+ staticClass: "virtualPopover-modal",
21124
+ on: {
21125
+ "click": function click($event) {
21126
+ $event.stopPropagation();
21127
+ }
21128
+ }
21129
+ }, [_vm._t("default")], 2)])]);
21130
+ };
21131
+ var BnVirtPopovervue_type_template_id_387cfe9e_scoped_true_staticRenderFns = [];
21132
+
21133
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
21134
+ var es_string_trim = __webpack_require__(2762);
21135
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/babel-loader/lib/index.js!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/BnVirtPopover/index.vue?vue&type=script&lang=js
21136
+
21137
+
21138
+
21139
+
21140
+
21141
+
21142
+
21143
+
21144
+
21145
+
21146
+
21147
+
21148
+
21149
+
21150
+
21151
+
21152
+ /* harmony default export */ const BnVirtPopovervue_type_script_lang_js = ({
21153
+ name: "BnVirtPopover",
21154
+ props: {
21155
+ // popover的宽度,支持数字或字符串(如'200px')
21156
+ width: {
21157
+ type: [Number, String],
21158
+ "default": 220
21159
+ },
21160
+ // popover的显示位置,支持 'top' 或 'bottom'
21161
+ popoverPosition: {
21162
+ type: String,
21163
+ "default": "bottom"
21164
+ }
21165
+ },
21166
+ data: function data() {
21167
+ return {
21168
+ modal: false,
21169
+ // 控制 popover 的显示/隐藏
21170
+ popoverStyle: {},
21171
+ // popover 的样式对象
21172
+ popoverClass: [],
21173
+ // popover 的类名数组
21174
+ arrowStyle: {},
21175
+ // 箭头的样式对象
21176
+ arrowClass: [],
21177
+ // 箭头的类名数组
21178
+ targetEvent: undefined,
21179
+ // 存储触发事件的对象
21180
+ closeTimer: null // 关闭延时器
21181
+ };
21182
+ },
21183
+ computed: {
21184
+ /** 将 width 转为数字(px),用于位置计算;非纯数字返回 null */numericWidth: function numericWidth() {
21185
+ var w = this.width;
21186
+ if (typeof w === 'number' && !isNaN(w)) return w;
21187
+ if (typeof w === 'string' && /^\d+(\.\d+)?$/.test(w.trim())) return parseFloat(w);
21188
+ return null;
21189
+ }
21190
+ },
21191
+ beforeDestroy: function beforeDestroy() {
21192
+ clearTimeout(this.closeTimer);
21193
+ window.removeEventListener('click', this.close);
21194
+ window.removeEventListener('mouseup', this.onMouseup);
21195
+ },
21196
+ methods: {
21197
+ /**
21198
+ * 切换 popover 的显示状态
21199
+ * 如果当前显示且点击同一个触发元素,则关闭
21200
+ * 如果当前显示且点击不同触发元素,则更新位置
21201
+ * 如果当前隐藏,则显示
21202
+ * @param {Event} e - 触发事件对象
21203
+ */
21204
+ toggle: function toggle(e) {
21205
+ if (!e) {
21206
+ alert('把事件对象传进来');
21207
+ }
21208
+ this.targetEvent = e;
21209
+ // 鼠标悬浮事件
21210
+ if (e.type.indexOf('mouse') >= 0) {
21211
+ // 鼠标离开事件
21212
+ if (e.type == 'mouseleave') {
21213
+ this.close(e);
21214
+ } else {
21215
+ this.openPopover(e);
21216
+ }
21217
+ }
21218
+ //点击事件 或 其他
21219
+ else {
21220
+ if (this.modal) {
21221
+ this.close(e);
21222
+ } else {
21223
+ this.openPopover(e);
21224
+ }
21225
+ }
21226
+ },
21227
+ /**
21228
+ * 打开 popover
21229
+ * @param {Event} e - 触发事件对象
21230
+ */
21231
+ openPopover: function openPopover(e) {
21232
+ var _this = this;
21233
+ this.targetEvent = e;
21234
+ this.open();
21235
+ // 等待 DOM 更新后初始化位置
21236
+ this.$nextTick(function () {
21237
+ _this.initPosition();
21238
+ });
21239
+ // 阻止事件冒泡
21240
+ e && e.stopPropagation();
21241
+ // 添加全局事件监听
21242
+ window.addEventListener("click", this.close);
21243
+ window.addEventListener("mouseup", this.onMouseup);
21244
+ },
21245
+ /**
21246
+ * 初始化 popover 位置
21247
+ * 包括:
21248
+ * 1. 计算 popover 的位置和大小
21249
+ * 2. 处理屏幕边界情况
21250
+ * 3. 计算箭头位置
21251
+ * 4. 判断显示方向(上/下)
21252
+ */
21253
+ initPosition: function initPosition() {
21254
+ var triggerEl = this.getTriggerEl();
21255
+ if (triggerEl && triggerEl.getBoundingClientRect) {
21256
+ // 获取触发 dom 位置(优先 currentTarget,避免 el-button 内层子元素导致偏移)
21257
+ var _triggerEl$getBoundin = triggerEl.getBoundingClientRect(),
21258
+ left = _triggerEl$getBoundin.left,
21259
+ top = _triggerEl$getBoundin.top,
21260
+ width = _triggerEl$getBoundin.width,
21261
+ height = _triggerEl$getBoundin.height;
21262
+ // 初始样式
21263
+ this.popoverStyle = {};
21264
+ this.popoverClass = ["virtualPopover"];
21265
+ this.arrowClass = ["virtualPopover-arrow"];
21266
+ // 获取屏幕宽高
21267
+ var clientWidth = window.innerWidth;
21268
+ var clientHeight = window.innerHeight;
21269
+ // 计算变量
21270
+ var arrowWidth = 6;
21271
+ var popWidth = this.numericWidth;
21272
+ var popoverGap = popWidth && width > popWidth ? 0 : 10; // 最小边距
21273
+ var popoverLeft = left - popoverGap; // 距离左侧距离
21274
+
21275
+ // 计算 popover 的最终位置
21276
+ var finalPopoverLeft = popoverLeft;
21277
+ if (popWidth && popoverLeft + popWidth > clientWidth) {
21278
+ // 如果超出右边界,将 popover 靠右对齐
21279
+ finalPopoverLeft = clientWidth - popWidth - popoverGap;
21280
+ this.popoverStyle.left = "".concat(finalPopoverLeft, "px");
21281
+ } else {
21282
+ this.popoverStyle.left = "".concat(popoverLeft, "px");
21283
+ }
21284
+
21285
+ // 计算箭头位置,使其始终指向触发元素的中心
21286
+ var targetCenter = left + width / 2;
21287
+ var arrowLeft = targetCenter - finalPopoverLeft - arrowWidth;
21288
+
21289
+ // 确保箭头不会超出 popover 的边界
21290
+ var minArrowLeft = arrowWidth * 2;
21291
+ var maxArrowLeft = popWidth ? popWidth - arrowWidth * 3 : 200;
21292
+ this.arrowStyle.left = "".concat(Math.min(Math.max(arrowLeft, minArrowLeft), maxArrowLeft), "px");
21293
+
21294
+ // 判断popover宽度是否超出屏幕宽度,超出则减少为最小宽度,出现滚动条
21295
+ if (popWidth == null) {
21296
+ this.popoverStyle.width = "".concat(this.width);
21297
+ } else {
21298
+ if (popWidth + popoverGap * 2 > clientWidth) {
21299
+ this.popoverStyle.width = "".concat(clientWidth - popoverGap * 2, "px");
21300
+ } else this.popoverStyle.minWidth = "".concat(popWidth, "px");
21301
+ }
21302
+ // 获取popover的dom位置
21303
+ var _this$$refs$customPop = this.$refs.customPopover.getBoundingClientRect(),
21304
+ popoverBottom = _this$$refs$customPop.bottom,
21305
+ popoverHeight = _this$$refs$customPop.height;
21306
+ // 判断popover是在上方还是下方
21307
+ var bottomDistance = clientHeight - popoverBottom; // 与底部距离
21308
+ var popoverPosition = this.popoverPosition;
21309
+ if (top > bottomDistance && (popoverHeight === 0 || this.modal || popoverHeight >= bottomDistance)) {
21310
+ popoverPosition = "top";
21311
+ }
21312
+ // 内容高度大于屏幕剩高度,并且上方区域大于下方区域
21313
+ if (popoverPosition === "top") {
21314
+ this.popoverStyle.bottom = "".concat(clientHeight - top, "px");
21315
+ } else {
21316
+ this.popoverStyle.top = "".concat(top + height, "px");
21317
+ }
21318
+ this.arrowClass.push(popoverPosition);
21319
+ this.popoverClass.push(popoverPosition);
21320
+ }
21321
+ },
21322
+ /**
21323
+ * 监听鼠标抬起事件
21324
+ * 用于判断点击位置是否在 popover 外部,决定是否关闭
21325
+ * @param {MouseEvent} param0 - 鼠标事件对象,解构获取坐标
21326
+ */
21327
+ onMouseup: function onMouseup(_ref) {
21328
+ var x = _ref.x,
21329
+ y = _ref.y;
21330
+ if (this.$refs.customPopover && this.modal) {
21331
+ var triggerEl = this.getTriggerEl();
21332
+ if (triggerEl && triggerEl.getBoundingClientRect) {
21333
+ var _triggerEl$getBoundin2 = triggerEl.getBoundingClientRect(),
21334
+ _left = _triggerEl$getBoundin2.left,
21335
+ _right = _triggerEl$getBoundin2.right,
21336
+ _top = _triggerEl$getBoundin2.top,
21337
+ _bottom = _triggerEl$getBoundin2.bottom;
21338
+ if (!(x < _left || x > _right || y < _top || y > _bottom)) return;
21339
+ }
21340
+ var _this$$refs$customPop2 = this.$refs.customPopover.getBoundingClientRect(),
21341
+ left = _this$$refs$customPop2.left,
21342
+ right = _this$$refs$customPop2.right,
21343
+ top = _this$$refs$customPop2.top,
21344
+ bottom = _this$$refs$customPop2.bottom;
21345
+ if (x < left || x > right || y < top || y > bottom) {
21346
+ this.close();
21347
+ }
21348
+ ;
21349
+ }
21350
+ },
21351
+ /**
21352
+ * 开启
21353
+ */
21354
+ open: function open() {
21355
+ clearTimeout(this.closeTimer);
21356
+ this.closeTimer = null;
21357
+ this.modal = true;
21358
+ },
21359
+ /**
21360
+ * 关闭
21361
+ */
21362
+ close: function close() {
21363
+ var _this2 = this;
21364
+ clearTimeout(this.closeTimer);
21365
+ // 当触发是点击事件时,直接关闭,不延时
21366
+ if (this.targetEvent && this.targetEvent.type == 'click') {
21367
+ this.modal = false;
21368
+ window.removeEventListener("click", this.close);
21369
+ window.removeEventListener("mouseup", this.onMouseup);
21370
+ } else {
21371
+ this.closeTimer = setTimeout(function () {
21372
+ _this2.modal = false;
21373
+ window.removeEventListener("click", _this2.close);
21374
+ window.removeEventListener("mouseup", _this2.onMouseup);
21375
+ }, 300);
21376
+ }
21377
+ },
21378
+ /**
21379
+ * 处理鼠标移入移出事件
21380
+ * 用于实现 hover 效果
21381
+ * 移入时清除关闭定时器
21382
+ * 移出时设置延迟关闭
21383
+ * @param {MouseEvent} e - 鼠标事件对象
21384
+ */
21385
+ onMouseEvent: function onMouseEvent(e) {
21386
+ if (!this.targetEvent) return;
21387
+ if (e.type === 'mouseover' && this.targetEvent.type !== 'click') {
21388
+ clearTimeout(this.closeTimer);
21389
+ this.closeTimer = null;
21390
+ this.modal = true;
21391
+ }
21392
+ // 只有触发事件是鼠标悬浮时,从pop移开才关闭
21393
+ else if (this.targetEvent.type.indexOf('mouse') >= 0 && e.type === 'mouseleave') {
21394
+ clearTimeout(this.closeTimer);
21395
+ this.modal = false;
21396
+ window.removeEventListener("click", this.close);
21397
+ window.removeEventListener("mouseup", this.onMouseup);
21398
+ }
21399
+ },
21400
+ /** 获取触发元素:Vue2 组件上 .native 绑定时 currentTarget 为组件根节点 */getTriggerEl: function getTriggerEl() {
21401
+ if (!this.targetEvent) return null;
21402
+ return this.targetEvent.currentTarget || this.targetEvent.target;
21403
+ }
21404
+ }
21405
+ });
21406
+ ;// ./packages/BnVirtPopover/index.vue?vue&type=script&lang=js
21407
+ /* harmony default export */ const packages_BnVirtPopovervue_type_script_lang_js = (BnVirtPopovervue_type_script_lang_js);
21408
+ // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/BnVirtPopover/index.vue?vue&type=style&index=0&id=387cfe9e&prod&lang=scss&scoped=true
21409
+ var BnVirtPopovervue_type_style_index_0_id_387cfe9e_prod_lang_scss_scoped_true = __webpack_require__(9587);
21410
+ ;// ./packages/BnVirtPopover/index.vue?vue&type=style&index=0&id=387cfe9e&prod&lang=scss&scoped=true
21411
+
21412
+ ;// ./packages/BnVirtPopover/index.vue
21413
+
21414
+
21415
+
21416
+ ;
21417
+
21418
+
21419
+ /* normalize component */
21420
+
21421
+ var BnVirtPopover_component = normalizeComponent(
21422
+ packages_BnVirtPopovervue_type_script_lang_js,
21423
+ BnVirtPopovervue_type_template_id_387cfe9e_scoped_true_render,
21424
+ BnVirtPopovervue_type_template_id_387cfe9e_scoped_true_staticRenderFns,
21425
+ false,
21426
+ null,
21427
+ "387cfe9e",
21428
+ null
21429
+
21430
+ )
21431
+
21432
+ /* harmony default export */ const BnVirtPopover = (BnVirtPopover_component.exports);
21054
21433
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.map.js
21055
21434
  var es_map = __webpack_require__(6033);
21056
21435
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.map.get-or-insert.js
@@ -21141,8 +21520,6 @@ function getApiBaseUrl() {
21141
21520
  });
21142
21521
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.sort.js
21143
21522
  var es_array_sort = __webpack_require__(6910);
21144
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
21145
- var es_string_trim = __webpack_require__(2762);
21146
21523
  ;// ../../packages/utils/addressParse.js
21147
21524
 
21148
21525
 
@@ -23595,6 +23972,7 @@ function mainAppRouterPush(route) {
23595
23972
 
23596
23973
 
23597
23974
 
23975
+
23598
23976
  const BnAppletUi = {
23599
23977
  install: (Vue) => {
23600
23978
  Vue.component("BnAddress", BnAddress);
@@ -23611,6 +23989,7 @@ const BnAppletUi = {
23611
23989
  Vue.component("BnRuleCondition", bnRuleCondition);
23612
23990
  Vue.component("BnSelect", BnSelect_select);
23613
23991
  Vue.component("BnFiTaxAutoComplete", BnFiTaxAutoComplete);
23992
+ Vue.component("BnVirtPopover", BnVirtPopover);
23614
23993
  }
23615
23994
  };
23616
23995