@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.
@@ -648,6 +648,30 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.bytenew-select-box[data-v-12683c88]{w
648
648
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
649
649
 
650
650
 
651
+ /***/ },
652
+
653
+ /***/ 3657
654
+ (module, __webpack_exports__, __webpack_require__) {
655
+
656
+ "use strict";
657
+ __webpack_require__.r(__webpack_exports__);
658
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
659
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
660
+ /* harmony export */ });
661
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1601);
662
+ /* 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__);
663
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6314);
664
+ /* 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__);
665
+ // Imports
666
+
667
+
668
+ 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()));
669
+ // Module
670
+ ___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}`, ""]);
671
+ // Exports
672
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
673
+
674
+
651
675
  /***/ },
652
676
 
653
677
  /***/ 5925
@@ -1235,6 +1259,22 @@ var update = add("10123774", content, true, {"sourceMap":false,"shadowMode":fals
1235
1259
 
1236
1260
  /***/ },
1237
1261
 
1262
+ /***/ 357
1263
+ (module, __unused_webpack_exports, __webpack_require__) {
1264
+
1265
+ // style-loader: Adds some css to the DOM by adding a <style> tag
1266
+
1267
+ // load the styles
1268
+ var content = __webpack_require__(3657);
1269
+ if(content.__esModule) content = content.default;
1270
+ if(typeof content === 'string') content = [[module.id, content, '']];
1271
+ if(content.locals) module.exports = content.locals;
1272
+ // add the styles to the DOM
1273
+ var add = (__webpack_require__(9548)/* ["default"] */ .A)
1274
+ var update = add("7d47f81c", content, true, {"sourceMap":false,"shadowMode":false});
1275
+
1276
+ /***/ },
1277
+
1238
1278
  /***/ 9548
1239
1279
  (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1240
1280
 
@@ -10494,6 +10534,7 @@ __webpack_require__.d(__webpack_exports__, {
10494
10534
  BnInputNum: () => (/* reexport */ BnInputNum),
10495
10535
  BnRuleCondition: () => (/* reexport */ bnRuleCondition),
10496
10536
  BnSelect: () => (/* reexport */ BnSelect_select),
10537
+ BnVirtPopover: () => (/* reexport */ BnVirtPopover),
10497
10538
  addressParse: () => (/* reexport */ addressParse),
10498
10539
  "default": () => (/* binding */ entry_lib),
10499
10540
  idsToTexts: () => (/* reexport */ idsToTexts)
@@ -21069,6 +21110,344 @@ var BnFiTaxAutoComplete_component = normalizeComponent(
21069
21110
  )
21070
21111
 
21071
21112
  /* harmony default export */ const BnFiTaxAutoComplete = (BnFiTaxAutoComplete_component.exports);
21113
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.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
21114
+ var BnVirtPopovervue_type_template_id_387cfe9e_scoped_true_render = function render() {
21115
+ var _vm = this,
21116
+ _c = _vm._self._c;
21117
+ return _c('transition', {
21118
+ attrs: {
21119
+ "appear": "",
21120
+ "name": _vm.popoverPosition == 'bottom' ? 'el-zoom-in-top' : 'el-zoom-in-bottom'
21121
+ }
21122
+ }, [_c('div', {
21123
+ directives: [{
21124
+ name: "show",
21125
+ rawName: "v-show",
21126
+ value: _vm.modal,
21127
+ expression: "modal"
21128
+ }],
21129
+ ref: "customPopover",
21130
+ staticClass: "virtualPopover",
21131
+ "class": _vm.popoverClass,
21132
+ style: _vm.popoverStyle,
21133
+ on: {
21134
+ "mouseover": _vm.onMouseEvent,
21135
+ "mouseleave": _vm.onMouseEvent
21136
+ }
21137
+ }, [_c('div', {
21138
+ "class": _vm.arrowClass,
21139
+ style: _vm.arrowStyle
21140
+ }), _c('div', {
21141
+ staticClass: "virtualPopover-modal",
21142
+ on: {
21143
+ "click": function click($event) {
21144
+ $event.stopPropagation();
21145
+ }
21146
+ }
21147
+ }, [_vm._t("default")], 2)])]);
21148
+ };
21149
+ var BnVirtPopovervue_type_template_id_387cfe9e_scoped_true_staticRenderFns = [];
21150
+
21151
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
21152
+ var es_string_trim = __webpack_require__(2762);
21153
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.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
21154
+
21155
+
21156
+
21157
+
21158
+
21159
+
21160
+
21161
+
21162
+
21163
+
21164
+
21165
+
21166
+
21167
+
21168
+
21169
+
21170
+ /* harmony default export */ const BnVirtPopovervue_type_script_lang_js = ({
21171
+ name: "BnVirtPopover",
21172
+ props: {
21173
+ // popover的宽度,支持数字或字符串(如'200px')
21174
+ width: {
21175
+ type: [Number, String],
21176
+ "default": 220
21177
+ },
21178
+ // popover的显示位置,支持 'top' 或 'bottom'
21179
+ popoverPosition: {
21180
+ type: String,
21181
+ "default": "bottom"
21182
+ }
21183
+ },
21184
+ data: function data() {
21185
+ return {
21186
+ modal: false,
21187
+ // 控制 popover 的显示/隐藏
21188
+ popoverStyle: {},
21189
+ // popover 的样式对象
21190
+ popoverClass: [],
21191
+ // popover 的类名数组
21192
+ arrowStyle: {},
21193
+ // 箭头的样式对象
21194
+ arrowClass: [],
21195
+ // 箭头的类名数组
21196
+ targetEvent: undefined,
21197
+ // 存储触发事件的对象
21198
+ closeTimer: null // 关闭延时器
21199
+ };
21200
+ },
21201
+ computed: {
21202
+ /** 将 width 转为数字(px),用于位置计算;非纯数字返回 null */numericWidth: function numericWidth() {
21203
+ var w = this.width;
21204
+ if (typeof w === 'number' && !isNaN(w)) return w;
21205
+ if (typeof w === 'string' && /^\d+(\.\d+)?$/.test(w.trim())) return parseFloat(w);
21206
+ return null;
21207
+ }
21208
+ },
21209
+ beforeDestroy: function beforeDestroy() {
21210
+ clearTimeout(this.closeTimer);
21211
+ window.removeEventListener('click', this.close);
21212
+ window.removeEventListener('mouseup', this.onMouseup);
21213
+ },
21214
+ methods: {
21215
+ /**
21216
+ * 切换 popover 的显示状态
21217
+ * 如果当前显示且点击同一个触发元素,则关闭
21218
+ * 如果当前显示且点击不同触发元素,则更新位置
21219
+ * 如果当前隐藏,则显示
21220
+ * @param {Event} e - 触发事件对象
21221
+ */
21222
+ toggle: function toggle(e) {
21223
+ if (!e) {
21224
+ alert('把事件对象传进来');
21225
+ }
21226
+ this.targetEvent = e;
21227
+ // 鼠标悬浮事件
21228
+ if (e.type.indexOf('mouse') >= 0) {
21229
+ // 鼠标离开事件
21230
+ if (e.type == 'mouseleave') {
21231
+ this.close(e);
21232
+ } else {
21233
+ this.openPopover(e);
21234
+ }
21235
+ }
21236
+ //点击事件 或 其他
21237
+ else {
21238
+ if (this.modal) {
21239
+ this.close(e);
21240
+ } else {
21241
+ this.openPopover(e);
21242
+ }
21243
+ }
21244
+ },
21245
+ /**
21246
+ * 打开 popover
21247
+ * @param {Event} e - 触发事件对象
21248
+ */
21249
+ openPopover: function openPopover(e) {
21250
+ var _this = this;
21251
+ this.targetEvent = e;
21252
+ this.open();
21253
+ // 等待 DOM 更新后初始化位置
21254
+ this.$nextTick(function () {
21255
+ _this.initPosition();
21256
+ });
21257
+ // 阻止事件冒泡
21258
+ e && e.stopPropagation();
21259
+ // 添加全局事件监听
21260
+ window.addEventListener("click", this.close);
21261
+ window.addEventListener("mouseup", this.onMouseup);
21262
+ },
21263
+ /**
21264
+ * 初始化 popover 位置
21265
+ * 包括:
21266
+ * 1. 计算 popover 的位置和大小
21267
+ * 2. 处理屏幕边界情况
21268
+ * 3. 计算箭头位置
21269
+ * 4. 判断显示方向(上/下)
21270
+ */
21271
+ initPosition: function initPosition() {
21272
+ var triggerEl = this.getTriggerEl();
21273
+ if (triggerEl && triggerEl.getBoundingClientRect) {
21274
+ // 获取触发 dom 位置(优先 currentTarget,避免 el-button 内层子元素导致偏移)
21275
+ var _triggerEl$getBoundin = triggerEl.getBoundingClientRect(),
21276
+ left = _triggerEl$getBoundin.left,
21277
+ top = _triggerEl$getBoundin.top,
21278
+ width = _triggerEl$getBoundin.width,
21279
+ height = _triggerEl$getBoundin.height;
21280
+ // 初始样式
21281
+ this.popoverStyle = {};
21282
+ this.popoverClass = ["virtualPopover"];
21283
+ this.arrowClass = ["virtualPopover-arrow"];
21284
+ // 获取屏幕宽高
21285
+ var clientWidth = window.innerWidth;
21286
+ var clientHeight = window.innerHeight;
21287
+ // 计算变量
21288
+ var arrowWidth = 6;
21289
+ var popWidth = this.numericWidth;
21290
+ var popoverGap = popWidth && width > popWidth ? 0 : 10; // 最小边距
21291
+ var popoverLeft = left - popoverGap; // 距离左侧距离
21292
+
21293
+ // 计算 popover 的最终位置
21294
+ var finalPopoverLeft = popoverLeft;
21295
+ if (popWidth && popoverLeft + popWidth > clientWidth) {
21296
+ // 如果超出右边界,将 popover 靠右对齐
21297
+ finalPopoverLeft = clientWidth - popWidth - popoverGap;
21298
+ this.popoverStyle.left = "".concat(finalPopoverLeft, "px");
21299
+ } else {
21300
+ this.popoverStyle.left = "".concat(popoverLeft, "px");
21301
+ }
21302
+
21303
+ // 计算箭头位置,使其始终指向触发元素的中心
21304
+ var targetCenter = left + width / 2;
21305
+ var arrowLeft = targetCenter - finalPopoverLeft - arrowWidth;
21306
+
21307
+ // 确保箭头不会超出 popover 的边界
21308
+ var minArrowLeft = arrowWidth * 2;
21309
+ var maxArrowLeft = popWidth ? popWidth - arrowWidth * 3 : 200;
21310
+ this.arrowStyle.left = "".concat(Math.min(Math.max(arrowLeft, minArrowLeft), maxArrowLeft), "px");
21311
+
21312
+ // 判断popover宽度是否超出屏幕宽度,超出则减少为最小宽度,出现滚动条
21313
+ if (popWidth == null) {
21314
+ this.popoverStyle.width = "".concat(this.width);
21315
+ } else {
21316
+ if (popWidth + popoverGap * 2 > clientWidth) {
21317
+ this.popoverStyle.width = "".concat(clientWidth - popoverGap * 2, "px");
21318
+ } else this.popoverStyle.minWidth = "".concat(popWidth, "px");
21319
+ }
21320
+ // 获取popover的dom位置
21321
+ var _this$$refs$customPop = this.$refs.customPopover.getBoundingClientRect(),
21322
+ popoverBottom = _this$$refs$customPop.bottom,
21323
+ popoverHeight = _this$$refs$customPop.height;
21324
+ // 判断popover是在上方还是下方
21325
+ var bottomDistance = clientHeight - popoverBottom; // 与底部距离
21326
+ var popoverPosition = this.popoverPosition;
21327
+ if (top > bottomDistance && (popoverHeight === 0 || this.modal || popoverHeight >= bottomDistance)) {
21328
+ popoverPosition = "top";
21329
+ }
21330
+ // 内容高度大于屏幕剩高度,并且上方区域大于下方区域
21331
+ if (popoverPosition === "top") {
21332
+ this.popoverStyle.bottom = "".concat(clientHeight - top, "px");
21333
+ } else {
21334
+ this.popoverStyle.top = "".concat(top + height, "px");
21335
+ }
21336
+ this.arrowClass.push(popoverPosition);
21337
+ this.popoverClass.push(popoverPosition);
21338
+ }
21339
+ },
21340
+ /**
21341
+ * 监听鼠标抬起事件
21342
+ * 用于判断点击位置是否在 popover 外部,决定是否关闭
21343
+ * @param {MouseEvent} param0 - 鼠标事件对象,解构获取坐标
21344
+ */
21345
+ onMouseup: function onMouseup(_ref) {
21346
+ var x = _ref.x,
21347
+ y = _ref.y;
21348
+ if (this.$refs.customPopover && this.modal) {
21349
+ var triggerEl = this.getTriggerEl();
21350
+ if (triggerEl && triggerEl.getBoundingClientRect) {
21351
+ var _triggerEl$getBoundin2 = triggerEl.getBoundingClientRect(),
21352
+ _left = _triggerEl$getBoundin2.left,
21353
+ _right = _triggerEl$getBoundin2.right,
21354
+ _top = _triggerEl$getBoundin2.top,
21355
+ _bottom = _triggerEl$getBoundin2.bottom;
21356
+ if (!(x < _left || x > _right || y < _top || y > _bottom)) return;
21357
+ }
21358
+ var _this$$refs$customPop2 = this.$refs.customPopover.getBoundingClientRect(),
21359
+ left = _this$$refs$customPop2.left,
21360
+ right = _this$$refs$customPop2.right,
21361
+ top = _this$$refs$customPop2.top,
21362
+ bottom = _this$$refs$customPop2.bottom;
21363
+ if (x < left || x > right || y < top || y > bottom) {
21364
+ this.close();
21365
+ }
21366
+ ;
21367
+ }
21368
+ },
21369
+ /**
21370
+ * 开启
21371
+ */
21372
+ open: function open() {
21373
+ clearTimeout(this.closeTimer);
21374
+ this.closeTimer = null;
21375
+ this.modal = true;
21376
+ },
21377
+ /**
21378
+ * 关闭
21379
+ */
21380
+ close: function close() {
21381
+ var _this2 = this;
21382
+ clearTimeout(this.closeTimer);
21383
+ // 当触发是点击事件时,直接关闭,不延时
21384
+ if (this.targetEvent && this.targetEvent.type == 'click') {
21385
+ this.modal = false;
21386
+ window.removeEventListener("click", this.close);
21387
+ window.removeEventListener("mouseup", this.onMouseup);
21388
+ } else {
21389
+ this.closeTimer = setTimeout(function () {
21390
+ _this2.modal = false;
21391
+ window.removeEventListener("click", _this2.close);
21392
+ window.removeEventListener("mouseup", _this2.onMouseup);
21393
+ }, 300);
21394
+ }
21395
+ },
21396
+ /**
21397
+ * 处理鼠标移入移出事件
21398
+ * 用于实现 hover 效果
21399
+ * 移入时清除关闭定时器
21400
+ * 移出时设置延迟关闭
21401
+ * @param {MouseEvent} e - 鼠标事件对象
21402
+ */
21403
+ onMouseEvent: function onMouseEvent(e) {
21404
+ if (!this.targetEvent) return;
21405
+ if (e.type === 'mouseover' && this.targetEvent.type !== 'click') {
21406
+ clearTimeout(this.closeTimer);
21407
+ this.closeTimer = null;
21408
+ this.modal = true;
21409
+ }
21410
+ // 只有触发事件是鼠标悬浮时,从pop移开才关闭
21411
+ else if (this.targetEvent.type.indexOf('mouse') >= 0 && e.type === 'mouseleave') {
21412
+ clearTimeout(this.closeTimer);
21413
+ this.modal = false;
21414
+ window.removeEventListener("click", this.close);
21415
+ window.removeEventListener("mouseup", this.onMouseup);
21416
+ }
21417
+ },
21418
+ /** 获取触发元素:Vue2 组件上 .native 绑定时 currentTarget 为组件根节点 */getTriggerEl: function getTriggerEl() {
21419
+ if (!this.targetEvent) return null;
21420
+ return this.targetEvent.currentTarget || this.targetEvent.target;
21421
+ }
21422
+ }
21423
+ });
21424
+ ;// ./packages/BnVirtPopover/index.vue?vue&type=script&lang=js
21425
+ /* harmony default export */ const packages_BnVirtPopovervue_type_script_lang_js = (BnVirtPopovervue_type_script_lang_js);
21426
+ // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.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
21427
+ var BnVirtPopovervue_type_style_index_0_id_387cfe9e_prod_lang_scss_scoped_true = __webpack_require__(357);
21428
+ ;// ./packages/BnVirtPopover/index.vue?vue&type=style&index=0&id=387cfe9e&prod&lang=scss&scoped=true
21429
+
21430
+ ;// ./packages/BnVirtPopover/index.vue
21431
+
21432
+
21433
+
21434
+ ;
21435
+
21436
+
21437
+ /* normalize component */
21438
+
21439
+ var BnVirtPopover_component = normalizeComponent(
21440
+ packages_BnVirtPopovervue_type_script_lang_js,
21441
+ BnVirtPopovervue_type_template_id_387cfe9e_scoped_true_render,
21442
+ BnVirtPopovervue_type_template_id_387cfe9e_scoped_true_staticRenderFns,
21443
+ false,
21444
+ null,
21445
+ "387cfe9e",
21446
+ null
21447
+
21448
+ )
21449
+
21450
+ /* harmony default export */ const BnVirtPopover = (BnVirtPopover_component.exports);
21072
21451
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.map.js
21073
21452
  var es_map = __webpack_require__(6033);
21074
21453
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.map.get-or-insert.js
@@ -21159,8 +21538,6 @@ function getApiBaseUrl() {
21159
21538
  });
21160
21539
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.sort.js
21161
21540
  var es_array_sort = __webpack_require__(6910);
21162
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
21163
- var es_string_trim = __webpack_require__(2762);
21164
21541
  ;// ../../packages/utils/addressParse.js
21165
21542
 
21166
21543
 
@@ -23613,6 +23990,7 @@ function mainAppRouterPush(route) {
23613
23990
 
23614
23991
 
23615
23992
 
23993
+
23616
23994
  const BnAppletUi = {
23617
23995
  install: (Vue) => {
23618
23996
  Vue.component("BnAddress", BnAddress);
@@ -23629,6 +24007,7 @@ const BnAppletUi = {
23629
24007
  Vue.component("BnRuleCondition", bnRuleCondition);
23630
24008
  Vue.component("BnSelect", BnSelect_select);
23631
24009
  Vue.component("BnFiTaxAutoComplete", BnFiTaxAutoComplete);
24010
+ Vue.component("BnVirtPopover", BnVirtPopover);
23632
24011
  }
23633
24012
  };
23634
24013