nubomed-ui 2.0.31 → 2.0.32

Sign up to get free protection for your applications and to get access to all the features.
@@ -157,6 +157,27 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".iconfont[data-v-1d7955de]{display:inl
157
157
  /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
158
158
 
159
159
 
160
+ /***/ }),
161
+
162
+ /***/ 7034:
163
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
164
+
165
+ "use strict";
166
+ __webpack_require__.r(__webpack_exports__);
167
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1601);
168
+ /* 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__);
169
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6314);
170
+ /* 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__);
171
+ // Imports
172
+
173
+
174
+ 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()));
175
+ // Module
176
+ ___CSS_LOADER_EXPORT___.push([module.id, ".el-pagination--left[data-v-15e54efa]{text-align:left}.el-pagination--center[data-v-15e54efa]{text-align:center}.el-pagination--right[data-v-15e54efa]{text-align:right}", ""]);
177
+ // Exports
178
+ /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
179
+
180
+
160
181
  /***/ }),
161
182
 
162
183
  /***/ 4988:
@@ -1112,6 +1133,346 @@ src.install = function (Vue) {
1112
1133
 
1113
1134
  /***/ }),
1114
1135
 
1136
+ /***/ 6785:
1137
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1138
+
1139
+ "use strict";
1140
+ __webpack_require__.r(__webpack_exports__);
1141
+ /* harmony import */ var _src_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9287);
1142
+ /*
1143
+ * @Author: chenghuan.dong
1144
+ * @Date: 2024-11-14 09:43:03
1145
+ * @LastEditTime: 2024-11-14 09:54:03
1146
+ * @LastEditors: chenghuan.dong
1147
+ * @Description:
1148
+ * @FilePath: \nubomed-ui\packages\components\NBNotify\index.js
1149
+ */
1150
+
1151
+ /* harmony default export */ __webpack_exports__["default"] = (_src_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
1152
+
1153
+ /***/ }),
1154
+
1155
+ /***/ 9287:
1156
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1157
+
1158
+ "use strict";
1159
+ // ESM COMPAT FLAG
1160
+ __webpack_require__.r(__webpack_exports__);
1161
+
1162
+ // EXPORTS
1163
+ __webpack_require__.d(__webpack_exports__, {
1164
+ "default": function() { return /* binding */ NBNotify_src; }
1165
+ });
1166
+
1167
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
1168
+ var es_array_push = __webpack_require__(4114);
1169
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.constructor.js
1170
+ var esnext_iterator_constructor = __webpack_require__(8992);
1171
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.for-each.js
1172
+ var esnext_iterator_for_each = __webpack_require__(3949);
1173
+ ;// external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
1174
+ var external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject = require("vue");
1175
+ var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject);
1176
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./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/components/NBNotify/src/index.vue?vue&type=template&id=15e54efa&scoped=true
1177
+ var render = function render() {
1178
+ var _vm = this,
1179
+ _c = _vm._self._c;
1180
+ return _c('transition', {
1181
+ attrs: {
1182
+ "name": "el-notification-fade"
1183
+ }
1184
+ }, [_c('div', {
1185
+ directives: [{
1186
+ name: "show",
1187
+ rawName: "v-show",
1188
+ value: _vm.visible,
1189
+ expression: "visible"
1190
+ }],
1191
+ class: ['el-notification', 'nb-notification'],
1192
+ style: _vm.positionStyle,
1193
+ attrs: {
1194
+ "role": "alert"
1195
+ },
1196
+ on: {
1197
+ "mouseenter": function ($event) {
1198
+ return _vm.clearTimer();
1199
+ },
1200
+ "mouseleave": function ($event) {
1201
+ return _vm.startTimer();
1202
+ },
1203
+ "click": _vm.click
1204
+ }
1205
+ }, [_vm.type || _vm.iconClass ? _c('i', {
1206
+ staticClass: "el-notification__icon",
1207
+ class: [_vm.typeClass, _vm.iconClass]
1208
+ }) : _vm._e(), _c('div', {
1209
+ staticClass: "el-notification__group",
1210
+ class: {
1211
+ 'is-with-icon': _vm.typeClass || _vm.iconClass
1212
+ }
1213
+ }, [_c('h2', {
1214
+ staticClass: "el-notification__title",
1215
+ domProps: {
1216
+ "textContent": _vm._s(_vm.title)
1217
+ }
1218
+ }), _c('div', {
1219
+ directives: [{
1220
+ name: "show",
1221
+ rawName: "v-show",
1222
+ value: _vm.message,
1223
+ expression: "message"
1224
+ }],
1225
+ staticClass: "el-notification__content"
1226
+ }, [_vm._t("default", function () {
1227
+ return [!_vm.dangerouslyUseHTMLString ? _c('p', [_vm._v(_vm._s(_vm.message))]) : _vm._e(), _c('p', {
1228
+ domProps: {
1229
+ "innerHTML": _vm._s(_vm.message)
1230
+ }
1231
+ })];
1232
+ })], 2), _vm.showClose ? _c('div', {
1233
+ staticClass: "el-notification__closeBtn el-icon-close",
1234
+ on: {
1235
+ "click": function ($event) {
1236
+ $event.stopPropagation();
1237
+ return _vm.close.apply(null, arguments);
1238
+ }
1239
+ }
1240
+ }) : _vm._e()])])]);
1241
+ };
1242
+ var staticRenderFns = [];
1243
+
1244
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/components/NBNotify/src/index.vue?vue&type=script&lang=js
1245
+ let typeMap = {
1246
+ success: 'success',
1247
+ info: 'info',
1248
+ warning: 'warning',
1249
+ error: 'error'
1250
+ };
1251
+ /* harmony default export */ var srcvue_type_script_lang_js = ({
1252
+ name: 'NBNotify',
1253
+ data() {
1254
+ return {
1255
+ visible: false,
1256
+ title: '',
1257
+ message: '',
1258
+ duration: 4500,
1259
+ type: '',
1260
+ showClose: false,
1261
+ customClass: '',
1262
+ iconClass: '',
1263
+ onClose: null,
1264
+ onClick: null,
1265
+ closed: false,
1266
+ verticalOffset: 0,
1267
+ timer: null,
1268
+ dangerouslyUseHTMLString: true,
1269
+ position: 'top-right'
1270
+ };
1271
+ },
1272
+ computed: {
1273
+ typeClass() {
1274
+ return this.type && typeMap[this.type] ? `el-icon-${typeMap[this.type]}` : '';
1275
+ },
1276
+ horizontalClass() {
1277
+ return this.position.indexOf('right') > -1 ? 'right' : 'left';
1278
+ },
1279
+ verticalProperty() {
1280
+ return /^top-/.test(this.position) ? 'top' : 'bottom';
1281
+ },
1282
+ positionStyle() {
1283
+ return {
1284
+ [this.verticalProperty]: `${this.verticalOffset}px`
1285
+ };
1286
+ }
1287
+ },
1288
+ watch: {
1289
+ closed(newVal) {
1290
+ if (newVal) {
1291
+ this.visible = false;
1292
+ this.$el.addEventListener('transitionend', this.destroyElement);
1293
+ }
1294
+ }
1295
+ },
1296
+ methods: {
1297
+ destroyElement() {
1298
+ this.$el.removeEventListener('transitionend', this.destroyElement);
1299
+ this.$destroy(true);
1300
+ this.$el.parentNode.removeChild(this.$el);
1301
+ },
1302
+ click() {
1303
+ if (typeof this.onClick === 'function') {
1304
+ this.onClick();
1305
+ }
1306
+ },
1307
+ close() {
1308
+ this.closed = true;
1309
+ if (typeof this.onClose === 'function') {
1310
+ this.onClose();
1311
+ }
1312
+ },
1313
+ clearTimer() {
1314
+ clearTimeout(this.timer);
1315
+ },
1316
+ startTimer() {
1317
+ if (this.duration > 0) {
1318
+ this.timer = setTimeout(() => {
1319
+ if (!this.closed) {
1320
+ this.close();
1321
+ }
1322
+ }, this.duration);
1323
+ }
1324
+ },
1325
+ keydown(e) {
1326
+ if (e.keyCode === 46 || e.keyCode === 8) {
1327
+ this.clearTimer(); // detele 取消倒计时
1328
+ } else if (e.keyCode === 27) {
1329
+ // esc关闭消息
1330
+ if (!this.closed) {
1331
+ this.close();
1332
+ }
1333
+ } else {
1334
+ this.startTimer(); // 恢复倒计时
1335
+ }
1336
+ }
1337
+ },
1338
+ mounted() {
1339
+ if (this.duration > 0) {
1340
+ this.timer = setTimeout(() => {
1341
+ if (!this.closed) {
1342
+ this.close();
1343
+ }
1344
+ }, this.duration);
1345
+ }
1346
+ document.addEventListener('keydown', this.keydown);
1347
+ },
1348
+ beforeDestroy() {
1349
+ document.removeEventListener('keydown', this.keydown);
1350
+ }
1351
+ });
1352
+ ;// ./packages/components/NBNotify/src/index.vue?vue&type=script&lang=js
1353
+ /* harmony default export */ var NBNotify_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
1354
+ // 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/components/NBNotify/src/index.vue?vue&type=style&index=0&id=15e54efa&prod&lang=scss&scoped=true
1355
+ var srcvue_type_style_index_0_id_15e54efa_prod_lang_scss_scoped_true = __webpack_require__(5240);
1356
+ ;// ./packages/components/NBNotify/src/index.vue?vue&type=style&index=0&id=15e54efa&prod&lang=scss&scoped=true
1357
+
1358
+ // EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
1359
+ var componentNormalizer = __webpack_require__(1656);
1360
+ ;// ./packages/components/NBNotify/src/index.vue
1361
+
1362
+
1363
+
1364
+ ;
1365
+
1366
+
1367
+ /* normalize component */
1368
+
1369
+ var component = (0,componentNormalizer/* default */.A)(
1370
+ NBNotify_srcvue_type_script_lang_js,
1371
+ render,
1372
+ staticRenderFns,
1373
+ false,
1374
+ null,
1375
+ "15e54efa",
1376
+ null
1377
+
1378
+ )
1379
+
1380
+ /* harmony default export */ var src = (component.exports);
1381
+ ;// ./packages/components/NBNotify/src/index.js
1382
+
1383
+
1384
+
1385
+ /*
1386
+ * @Author: chenghuan.dong
1387
+ * @Date: 2024-11-14 09:44:58
1388
+ * @LastEditTime: 2024-11-14 10:06:12
1389
+ * @LastEditors: chenghuan.dong
1390
+ * @Description:
1391
+ * @FilePath: \nubomed-ui\packages\components\NBNotify\src\index.js
1392
+ */
1393
+
1394
+
1395
+ // import merge from '../../../utils/merge'
1396
+ // import { PopupManager } from '../../../utils/popup'
1397
+ // import { isVNode } from '../../../utils/vdom'
1398
+ const NotificationConstructor = external_commonjs_vue_commonjs2_vue_root_Vue_default().extend(src);
1399
+ let instance;
1400
+ let instances = [];
1401
+ let seed = 1;
1402
+ const Notification = function (options) {
1403
+ if ((external_commonjs_vue_commonjs2_vue_root_Vue_default()).prototype.$isServer) return;
1404
+ options = Object.assign({}, options);
1405
+ const userOnClose = options.onClose;
1406
+ const id = 'notification_' + seed++;
1407
+ const position = options.position || 'top-right';
1408
+ options.onClose = function () {
1409
+ Notification.close(id, userOnClose);
1410
+ };
1411
+ instance = new NotificationConstructor({
1412
+ data: options
1413
+ });
1414
+ instance.$slots.default = [options.message];
1415
+ options.message = 'REPLACED_BY_VNODE';
1416
+ instance.id = id;
1417
+ instance.$mount();
1418
+ document.body.appendChild(instance.$el);
1419
+ instance.visible = true;
1420
+ instance.dom = instance.$el;
1421
+ // instance.dom.style.zIndex = PopupManager.nextZIndex()
1422
+
1423
+ let verticalOffset = options.offset || 0;
1424
+ instances.filter(item => item.position === position).forEach(item => {
1425
+ verticalOffset += item.$el.offsetHeight + 16;
1426
+ });
1427
+ verticalOffset += 16;
1428
+ instance.verticalOffset = verticalOffset;
1429
+ instances.push(instance);
1430
+ return instance;
1431
+ };
1432
+ ['success', 'warning', 'info', 'error'].forEach(type => {
1433
+ Notification[type] = options => {
1434
+ if (typeof options === 'string') {
1435
+ options = {
1436
+ message: options
1437
+ };
1438
+ }
1439
+ options.type = type;
1440
+ return Notification(options);
1441
+ };
1442
+ });
1443
+ Notification.close = function (id, userOnClose) {
1444
+ let index = -1;
1445
+ const len = instances.length;
1446
+ const instance = instances.filter((instance, i) => {
1447
+ if (instance.id === id) {
1448
+ index = i;
1449
+ return true;
1450
+ }
1451
+ return false;
1452
+ })[0];
1453
+ if (!instance) return;
1454
+ if (typeof userOnClose === 'function') {
1455
+ userOnClose(instance);
1456
+ }
1457
+ instances.splice(index, 1);
1458
+ if (len <= 1) return;
1459
+ const position = instance.position;
1460
+ const removedHeight = instance.dom.offsetHeight;
1461
+ for (let i = index; i < len - 1; i++) {
1462
+ if (instances[i].position === position) {
1463
+ instances[i].dom.style[instance.verticalProperty] = parseInt(instances[i].dom.style[instance.verticalProperty], 10) - removedHeight - 16 + 'px';
1464
+ }
1465
+ }
1466
+ };
1467
+ Notification.closeAll = function () {
1468
+ for (let i = instances.length - 1; i >= 0; i--) {
1469
+ instances[i].close();
1470
+ }
1471
+ };
1472
+ /* harmony default export */ var NBNotify_src = (Notification);
1473
+
1474
+ /***/ }),
1475
+
1115
1476
  /***/ 5449:
1116
1477
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1117
1478
 
@@ -1466,6 +1827,22 @@ var update = add("1485bda7", content, true, {"sourceMap":false,"shadowMode":fals
1466
1827
 
1467
1828
  /***/ }),
1468
1829
 
1830
+ /***/ 5240:
1831
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1832
+
1833
+ // style-loader: Adds some css to the DOM by adding a <style> tag
1834
+
1835
+ // load the styles
1836
+ var content = __webpack_require__(7034);
1837
+ if(content.__esModule) content = content.default;
1838
+ if(typeof content === 'string') content = [[module.id, content, '']];
1839
+ if(content.locals) module.exports = content.locals;
1840
+ // add the styles to the DOM
1841
+ var add = (__webpack_require__(9548)/* ["default"] */ .A)
1842
+ var update = add("6179b8be", content, true, {"sourceMap":false,"shadowMode":false});
1843
+
1844
+ /***/ }),
1845
+
1469
1846
  /***/ 9190:
1470
1847
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1471
1848
 
@@ -1789,6 +2166,8 @@ var map = {
1789
2166
  "./NBFullDialog/index.js": 6054,
1790
2167
  "./NBHeader/index.js": 9812,
1791
2168
  "./NBIcon/index.js": 5963,
2169
+ "./NBNotify/index.js": 6785,
2170
+ "./NBNotify/src/index.js": 9287,
1792
2171
  "./NBPagination/index.js": 5449,
1793
2172
  "./NBSummaryBar/index.js": 8626,
1794
2173
  "./NBTag/index.js": 3705
@@ -4403,65 +4782,8 @@ var esnext_iterator_for_each = __webpack_require__(3949);
4403
4782
  function camelToKebab(camelCaseStr) {
4404
4783
  return camelCaseStr.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
4405
4784
  }
4406
- ;// external "ELEMENT"
4407
- var external_ELEMENT_namespaceObject = require("ELEMENT");
4408
- ;// ./packages/feedback/nb-notify.js
4409
- /*
4410
- * @Author: chenghuan.dong
4411
- * @Date: 2024-11-12 17:58:53
4412
- * @LastEditTime: 2024-11-14 09:27:35
4413
- * @LastEditors: chenghuan.dong
4414
- * @Description: 对应样式styles/element-ui/notification.scss
4415
- * @FilePath: \nubomed-ui\packages\feedback\nb-notify.js
4416
- */
4417
-
4418
-
4419
- // console.log('1')
4420
-
4421
- /**
4422
- * @param {string} obj.type 图标类型, 可选值: success warning error
4423
- * @param {string} obj.title 标题,支持换行显示,用<br>隔开
4424
- * @param {string} obj.customClass 自定义样式
4425
- * @param {string} obj.duration 显示时间, 毫秒。设为 0 则不会自动关闭
4426
- */
4427
-
4428
- const nbNotify = obj => {
4429
- console.log('nbNotify', obj);
4430
- return (0,external_ELEMENT_namespaceObject.Notification)({
4431
- duration: obj.duration === undefined ? 2000 : obj.duration,
4432
- center: true,
4433
- dangerouslyUseHTMLString: true,
4434
- showClose: false,
4435
- customClass: `nb-notification nb-notification--${obj.type} ${obj.customClass ? obj.customClass : ''}`,
4436
- position: 'top-left',
4437
- message: obj.message,
4438
- type: obj.type,
4439
- offset: 284,
4440
- onClose: () => {
4441
- if (obj.onClose) {
4442
- obj.onClose();
4443
- }
4444
- }
4445
- });
4446
- };
4447
-
4448
- // 可直接通过$notify[type]的形式调用
4449
- const types = ['success', 'warning', 'error'];
4450
- types.forEach(type => {
4451
- nbNotify[type] = obj => {
4452
- if (typeof obj === 'string') {
4453
- obj = {
4454
- message: obj
4455
- };
4456
- }
4457
- if (typeof obj === 'object' && obj.title) {
4458
- obj.message = obj.title;
4459
- }
4460
- obj.type = type;
4461
- return nbNotify(obj);
4462
- };
4463
- });
4464
- /* harmony default export */ var nb_notify = (nbNotify);
4785
+ // EXTERNAL MODULE: ./packages/components/NBNotify/index.js
4786
+ var NBNotify = __webpack_require__(6785);
4465
4787
  // EXTERNAL MODULE: ./packages/iconfont/iconfont.css
4466
4788
  var iconfont = __webpack_require__(1970);
4467
4789
  ;// ./locale/lang/zh-CN.js
@@ -4594,7 +4916,7 @@ const i18n = function (fn) {
4594
4916
  /*
4595
4917
  * @Author: chenghuan.dong
4596
4918
  * @Date: 2024-11-08 17:23:47
4597
- * @LastEditTime: 2024-11-13 20:47:32
4919
+ * @LastEditTime: 2024-11-14 09:53:15
4598
4920
  * @LastEditors: chenghuan.dong
4599
4921
  * @Description: 主index.js导出全部组件
4600
4922
  * @FilePath: \nubomed-ui\packages\index.js
@@ -4630,7 +4952,7 @@ const install = function (Vue, options = {}) {
4630
4952
  });
4631
4953
 
4632
4954
  // 全局
4633
- Vue.prototype.$nbNotify = nb_notify;
4955
+ Vue.prototype.$nbNotify = NBNotify["default"];
4634
4956
  };
4635
4957
 
4636
4958
  // if (typeof window !== 'undefined' && window.Vue) {
@@ -4642,8 +4964,7 @@ const packages_i18n = locale.i18n;
4642
4964
  install,
4643
4965
  ...components,
4644
4966
  locale: locale,
4645
- i18n: packages_i18n,
4646
- nbNotify: nb_notify
4967
+ i18n: packages_i18n
4647
4968
  });
4648
4969
  ;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
4649
4970