nubomed-ui 2.0.35 → 2.0.37

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
+ /***/ 8513:
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-7bbf5e3c]{text-align:left}.el-pagination--center[data-v-7bbf5e3c]{text-align:center}.el-pagination--right[data-v-7bbf5e3c]{text-align:right}", ""]);
177
+ // Exports
178
+ /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
179
+
180
+
160
181
  /***/ }),
161
182
 
162
183
  /***/ 4988:
@@ -1466,6 +1487,22 @@ var update = add("1485bda7", content, true, {"sourceMap":false,"shadowMode":fals
1466
1487
 
1467
1488
  /***/ }),
1468
1489
 
1490
+ /***/ 7187:
1491
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1492
+
1493
+ // style-loader: Adds some css to the DOM by adding a <style> tag
1494
+
1495
+ // load the styles
1496
+ var content = __webpack_require__(8513);
1497
+ if(content.__esModule) content = content.default;
1498
+ if(typeof content === 'string') content = [[module.id, content, '']];
1499
+ if(content.locals) module.exports = content.locals;
1500
+ // add the styles to the DOM
1501
+ var add = (__webpack_require__(9548)/* ["default"] */ .A)
1502
+ var update = add("3f76f8d0", content, true, {"sourceMap":false,"shadowMode":false});
1503
+
1504
+ /***/ }),
1505
+
1469
1506
  /***/ 9190:
1470
1507
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
1471
1508
 
@@ -4368,10 +4405,7 @@ __webpack_require__.r(__webpack_exports__);
4368
4405
 
4369
4406
  // EXPORTS
4370
4407
  __webpack_require__.d(__webpack_exports__, {
4371
- components: function() { return /* reexport */ components; },
4372
- "default": function() { return /* binding */ entry_lib; },
4373
- i18n: function() { return /* reexport */ packages_i18n; },
4374
- locale: function() { return /* reexport */ locale; }
4408
+ "default": function() { return /* binding */ entry_lib; }
4375
4409
  });
4376
4410
 
4377
4411
  ;// ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
@@ -4529,6 +4563,283 @@ const i18n = function (fn) {
4529
4563
  t,
4530
4564
  i18n
4531
4565
  });
4566
+ ;// external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
4567
+ var external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject = require("vue");
4568
+ var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject);
4569
+ ;// ./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=7bbf5e3c&scoped=true
4570
+ var render = function render() {
4571
+ var _vm = this,
4572
+ _c = _vm._self._c;
4573
+ return _c('transition', {
4574
+ attrs: {
4575
+ "name": "el-notification-fade"
4576
+ }
4577
+ }, [_c('div', {
4578
+ directives: [{
4579
+ name: "show",
4580
+ rawName: "v-show",
4581
+ value: _vm.visible,
4582
+ expression: "visible"
4583
+ }],
4584
+ class: ['nb-notify', `nb-notify--${_vm.type}`],
4585
+ style: _vm.positionStyle,
4586
+ attrs: {
4587
+ "role": "alert"
4588
+ },
4589
+ on: {
4590
+ "mouseenter": function ($event) {
4591
+ return _vm.clearTimer();
4592
+ },
4593
+ "mouseleave": function ($event) {
4594
+ return _vm.startTimer();
4595
+ },
4596
+ "click": _vm.click
4597
+ }
4598
+ }, [_vm.type === 'success' ? _c('nb-icon', {
4599
+ staticClass: "nb-notify__icon",
4600
+ attrs: {
4601
+ "icon": "circle-check-filled"
4602
+ }
4603
+ }) : _vm._e(), _vm.type === 'error' ? _c('nb-icon', {
4604
+ staticClass: "nb-notify__icon",
4605
+ attrs: {
4606
+ "icon": "circle-close-filled"
4607
+ }
4608
+ }) : _vm._e(), _vm.type === 'warning' ? _c('nb-icon', {
4609
+ staticClass: "nb-notify__icon",
4610
+ attrs: {
4611
+ "icon": "warning-filled"
4612
+ }
4613
+ }) : _vm._e(), _c('div', {
4614
+ staticClass: "nb-notify__message",
4615
+ domProps: {
4616
+ "innerHTML": _vm._s(_vm.message)
4617
+ }
4618
+ })], 1)]);
4619
+ };
4620
+ var staticRenderFns = [];
4621
+
4622
+ ;// ./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
4623
+ /* harmony default export */ var srcvue_type_script_lang_js = ({
4624
+ name: 'NBNotify',
4625
+ data() {
4626
+ return {
4627
+ visible: false,
4628
+ message: '',
4629
+ duration: 3000,
4630
+ type: '',
4631
+ showClose: false,
4632
+ customClass: '',
4633
+ onClose: null,
4634
+ onClick: null,
4635
+ closed: false,
4636
+ verticalOffset: 248,
4637
+ timer: null,
4638
+ position: 'top-right'
4639
+ };
4640
+ },
4641
+ computed: {
4642
+ horizontalClass() {
4643
+ return this.position.indexOf('right') > -1 ? 'right' : 'left';
4644
+ },
4645
+ verticalProperty() {
4646
+ return /^top-/.test(this.position) ? 'top' : 'bottom';
4647
+ },
4648
+ positionStyle() {
4649
+ return {
4650
+ [this.verticalProperty]: `${this.verticalOffset}px`
4651
+ };
4652
+ }
4653
+ },
4654
+ watch: {
4655
+ closed(newVal) {
4656
+ if (newVal) {
4657
+ this.visible = false;
4658
+ this.$el.addEventListener('transitionend', this.destroyElement);
4659
+ }
4660
+ }
4661
+ },
4662
+ methods: {
4663
+ destroyElement() {
4664
+ this.$el.removeEventListener('transitionend', this.destroyElement);
4665
+ this.$destroy(true);
4666
+ this.$el.parentNode.removeChild(this.$el);
4667
+ },
4668
+ click() {
4669
+ if (typeof this.onClick === 'function') {
4670
+ this.onClick();
4671
+ }
4672
+ },
4673
+ close() {
4674
+ this.closed = true;
4675
+ if (typeof this.onClose === 'function') {
4676
+ this.onClose();
4677
+ }
4678
+ },
4679
+ clearTimer() {
4680
+ clearTimeout(this.timer);
4681
+ },
4682
+ startTimer() {
4683
+ if (this.duration > 0) {
4684
+ this.timer = setTimeout(() => {
4685
+ if (!this.closed) {
4686
+ this.close();
4687
+ }
4688
+ }, this.duration);
4689
+ }
4690
+ },
4691
+ keydown(e) {
4692
+ if (e.keyCode === 46 || e.keyCode === 8) {
4693
+ this.clearTimer(); // detele 取消倒计时
4694
+ } else if (e.keyCode === 27) {
4695
+ // esc关闭消息
4696
+ if (!this.closed) {
4697
+ this.close();
4698
+ }
4699
+ } else {
4700
+ this.startTimer(); // 恢复倒计时
4701
+ }
4702
+ }
4703
+ },
4704
+ mounted() {
4705
+ if (this.duration > 0) {
4706
+ this.timer = setTimeout(() => {
4707
+ if (!this.closed) {
4708
+ this.close();
4709
+ }
4710
+ }, this.duration);
4711
+ }
4712
+ document.addEventListener('keydown', this.keydown);
4713
+ },
4714
+ beforeDestroy() {
4715
+ document.removeEventListener('keydown', this.keydown);
4716
+ }
4717
+ });
4718
+ ;// ./packages/components/NBNotify/src/index.vue?vue&type=script&lang=js
4719
+ /* harmony default export */ var NBNotify_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
4720
+ // 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=7bbf5e3c&prod&lang=scss&scoped=true
4721
+ var srcvue_type_style_index_0_id_7bbf5e3c_prod_lang_scss_scoped_true = __webpack_require__(7187);
4722
+ ;// ./packages/components/NBNotify/src/index.vue?vue&type=style&index=0&id=7bbf5e3c&prod&lang=scss&scoped=true
4723
+
4724
+ // EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
4725
+ var componentNormalizer = __webpack_require__(1656);
4726
+ ;// ./packages/components/NBNotify/src/index.vue
4727
+
4728
+
4729
+
4730
+ ;
4731
+
4732
+
4733
+ /* normalize component */
4734
+
4735
+ var component = (0,componentNormalizer/* default */.A)(
4736
+ NBNotify_srcvue_type_script_lang_js,
4737
+ render,
4738
+ staticRenderFns,
4739
+ false,
4740
+ null,
4741
+ "7bbf5e3c",
4742
+ null
4743
+
4744
+ )
4745
+
4746
+ /* harmony default export */ var NBNotify_src = (component.exports);
4747
+ ;// ./packages/components/NBNotify/src/notify.js
4748
+
4749
+
4750
+
4751
+ /*
4752
+ * @Author: chenghuan.dong
4753
+ * @Date: 2024-11-14 09:44:58
4754
+ * @LastEditTime: 2024-11-14 14:03:08
4755
+ * @LastEditors: chenghuan.dong
4756
+ * @Description:
4757
+ * @FilePath: \nubomed-ui\packages\components\NBNotify\src\notify.js
4758
+ */
4759
+
4760
+
4761
+ // import merge from '../../../utils/merge'
4762
+ // import { PopupManager } from '../../../utils/popup'
4763
+ // import { isVNode } from '../../../utils/vdom'
4764
+
4765
+ let instance;
4766
+ let instances = [];
4767
+ let seed = 1;
4768
+ const Notify = function (options) {
4769
+ console.log('Vue', (external_commonjs_vue_commonjs2_vue_root_Vue_default()));
4770
+ if (!(external_commonjs_vue_commonjs2_vue_root_Vue_default())) {
4771
+ return;
4772
+ }
4773
+ if ((external_commonjs_vue_commonjs2_vue_root_Vue_default()).prototype.$isServer) return;
4774
+ options = Object.assign({}, options);
4775
+ const userOnClose = options.onClose;
4776
+ const id = 'notification_' + seed++;
4777
+ const position = options.position || 'top-right';
4778
+ options.onClose = function () {
4779
+ Notify.close(id, userOnClose);
4780
+ };
4781
+ const NotificationConstructor = external_commonjs_vue_commonjs2_vue_root_Vue_default().extend(NBNotify_src);
4782
+ instance = new NotificationConstructor({
4783
+ data: options
4784
+ });
4785
+ instance.$slots.default = [options.message];
4786
+ instance.id = id;
4787
+ instance.$mount();
4788
+ document.body.appendChild(instance.$el);
4789
+ instance.visible = true;
4790
+ instance.dom = instance.$el;
4791
+ // instance.dom.style.zIndex = PopupManager.nextZIndex()
4792
+
4793
+ let verticalOffset = options.offset || 248;
4794
+ instances.filter(item => item.position === position).forEach(item => {
4795
+ verticalOffset += item.$el.offsetHeight + 16;
4796
+ });
4797
+ verticalOffset += 16;
4798
+ instance.verticalOffset = verticalOffset;
4799
+ instances.push(instance);
4800
+ return instance;
4801
+ };
4802
+ ['success', 'warning', 'info', 'error'].forEach(type => {
4803
+ Notify[type] = options => {
4804
+ if (typeof options === 'string') {
4805
+ options = {
4806
+ message: options
4807
+ };
4808
+ }
4809
+ options.type = type;
4810
+ return Notify(options);
4811
+ };
4812
+ });
4813
+ Notify.close = function (id, userOnClose) {
4814
+ let index = -1;
4815
+ const len = instances.length;
4816
+ const instance = instances.filter((instance, i) => {
4817
+ if (instance.id === id) {
4818
+ index = i;
4819
+ return true;
4820
+ }
4821
+ return false;
4822
+ })[0];
4823
+ if (!instance) return;
4824
+ if (typeof userOnClose === 'function') {
4825
+ userOnClose(instance);
4826
+ }
4827
+ instances.splice(index, 1);
4828
+ if (len <= 1) return;
4829
+ const position = instance.position;
4830
+ const removedHeight = instance.dom.offsetHeight;
4831
+ for (let i = index; i < len - 1; i++) {
4832
+ if (instances[i].position === position) {
4833
+ instances[i].dom.style[instance.verticalProperty] = parseInt(instances[i].dom.style[instance.verticalProperty], 10) - removedHeight - 16 + 'px';
4834
+ }
4835
+ }
4836
+ };
4837
+ Notify.closeAll = function () {
4838
+ for (let i = instances.length - 1; i >= 0; i--) {
4839
+ instances[i].close();
4840
+ }
4841
+ };
4842
+ /* harmony default export */ var notify = (Notify);
4532
4843
  // EXTERNAL MODULE: ./packages/iconfont/iconfont.css
4533
4844
  var iconfont = __webpack_require__(1970);
4534
4845
  ;// ./packages/index.js
@@ -4538,7 +4849,7 @@ var iconfont = __webpack_require__(1970);
4538
4849
  /*
4539
4850
  * @Author: chenghuan.dong
4540
4851
  * @Date: 2024-11-08 17:23:47
4541
- * @LastEditTime: 2024-11-14 12:08:59
4852
+ * @LastEditTime: 2024-11-14 14:00:53
4542
4853
  * @LastEditors: chenghuan.dong
4543
4854
  * @Description: 主index.js导出全部组件
4544
4855
  * @FilePath: \nubomed-ui\packages\index.js
@@ -4546,7 +4857,7 @@ var iconfont = __webpack_require__(1970);
4546
4857
 
4547
4858
 
4548
4859
 
4549
- // import nbNotify from './components/NBNotify/src/notify.js'
4860
+
4550
4861
 
4551
4862
  // 使用iconfont图标
4552
4863
 
@@ -4557,64 +4868,41 @@ const req = __webpack_require__(3798);
4557
4868
  req.keys().forEach(v => {
4558
4869
  components.push(req(v).default);
4559
4870
  });
4560
- console.log('components', components);
4561
4871
  const install = function (Vue, options = {}) {
4562
4872
  //设置多语言
4563
4873
  locale.use(options.locale);
4564
4874
  locale.i18n(options.i18n);
4875
+
4565
4876
  // 组件
4566
4877
  if (install.installed) return;
4567
4878
  components.forEach(component => {
4568
4879
  const name = 'nb-' + camelToKebab(component.name.slice(2));
4569
- const installNames = ['nb-icon', 'nb-tag', 'nb-empty', 'nb-header', 'nb-summary-bar', 'nb-pagination']; //
4570
- console.log((installNames.includes(name) ? '√ ' : '? ') + name);
4880
+ const installNames = ['nb-icon', 'nb-tag', 'nb-empty', 'nb-header', 'nb-summary-bar', 'nb-pagination'];
4571
4881
  if (installNames.includes(name)) {
4572
- Vue.component(name, component);
4882
+ console.log('%c' + '√ ' + name, 'color: #00A572;');
4883
+ } else {
4884
+ console.log('? ' + name);
4885
+ }
4886
+ if (installNames.includes(name)) {
4887
+ Vue.component('nb-' + camelToKebab(component.name.slice(2)), component);
4573
4888
  }
4574
4889
  });
4575
4890
 
4576
- // Vue.prototype.$nbNotify = nbNotify
4577
- };
4578
- const packages_i18n = locale.i18n;
4579
- const API = {
4580
- install
4891
+ // 全局
4892
+ Vue.prototype.$nbNotify = notify;
4581
4893
  };
4582
- /* harmony default export */ var packages_0 = (API);
4583
4894
 
4584
-
4585
- // const install = function (Vue, options = {}) {
4586
- // //设置多语言
4587
- // locale.use(options.locale)
4588
- // locale.i18n(options.i18n)
4589
-
4590
- // // 组件
4591
- // if (install.installed) return
4592
- // components.forEach((component) => {
4593
- // const name = 'nb-' + camelToKebab(component.name.slice(2))
4594
- // const installNames = ['nb-icon', 'nb-tag', 'nb-empty', 'nb-header', 'nb-summary-bar', 'nb-pagination'] //
4595
- // console.log((installNames.includes(name) ? '√ ' : '? ') + name)
4596
-
4597
- // if (installNames.includes(name)) {
4598
- // Vue.component('nb-' + camelToKebab(component.name.slice(2)), component)
4599
- // }
4600
- // })
4601
-
4602
- // // 全局
4603
- // Vue.prototype.$nbNotify = nbNotify
4895
+ // if (typeof window !== 'undefined' && window.Vue) {
4896
+ // install(window.Vue)
4604
4897
  // }
4605
4898
 
4606
- // // if (typeof window !== 'undefined' && window.Vue) {
4607
- // // install(window.Vue)
4608
- // // }
4609
-
4610
- // const i18n = locale.i18n
4611
-
4612
- // export default {
4613
- // install,
4614
- // ...components,
4615
- // locale,
4616
- // i18n
4617
- // }
4899
+ const packages_i18n = locale.i18n;
4900
+ /* harmony default export */ var packages_0 = ({
4901
+ install,
4902
+ ...components,
4903
+ locale: locale,
4904
+ i18n: packages_i18n
4905
+ });
4618
4906
  ;// ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
4619
4907
 
4620
4908