dpzvc-ui 1.2.1 → 1.2.3

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/dist/dpzvc.js CHANGED
@@ -5804,7 +5804,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `
5804
5804
  justify-content: center;
5805
5805
  flex-direction: column;
5806
5806
  }
5807
- `, "",{"version":3,"sources":["webpack://./src/components/radioBox/radiobox-group.vue"],"names":[],"mappings":";AA0EA;IACA,aAAA;IACA,uBAAA;IACA,sBAAA;AACA","sourcesContent":["<template>\n <div :class=\"classes\">\n <slot></slot>\n </div>\n</template>\n\n<script>\n\n import {findComponentsDownward} from \"../../utils/util\"\n const prefixCls = 'dpzvc-radioBoxGroup'\n export default {\n name:'radioBoxGroup',\n props:{\n value:{\n type:[String,Boolean,Number]\n },\n vertical:{\n type:Boolean,\n default:false\n }\n },\n mounted(){\n this.updateModel()\n },\n data(){\n return {\n currentValue:this.value,\n children:findComponentsDownward(this,'radioBox')\n }\n },\n computed:{\n classes(){\n return [\n `${prefixCls}`,\n {\n [`${prefixCls}-vertical`]:this.vertical\n }\n ]\n\n }\n },\n methods:{\n change(data){\n this.currentValue = data.value;\n this.updateModel();\n this.$emit('input',data.value);\n this.$emit('on-change',data.value);\n this.$emit('on-form-change',data.value)\n },\n updateModel(){\n let value = this.value;\n this.children = findComponentsDownward(this,'radioBox');\n this.children.forEach((child)=>{\n child.model = value == child.label;\n child.isGroup = true;\n\n })\n }\n },\n watch:{\n value(){\n this.updateModel();\n },\n }\n }\n</script>\n\n<style scoped >\n .dpzvc-radioBoxGroup-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n</style>"],"sourceRoot":""}]);
5807
+ `, "",{"version":3,"sources":["webpack://./radiobox-group.vue"],"names":[],"mappings":";AA0EA;IACA,aAAA;IACA,uBAAA;IACA,sBAAA;AACA","sourcesContent":["<template>\n <div :class=\"classes\">\n <slot></slot>\n </div>\n</template>\n\n<script>\n\n import {findComponentsDownward} from \"../../utils/util\"\n const prefixCls = 'dpzvc-radioBoxGroup'\n export default {\n name:'radioBoxGroup',\n props:{\n value:{\n type:[String,Boolean,Number]\n },\n vertical:{\n type:Boolean,\n default:false\n }\n },\n mounted(){\n this.updateModel()\n },\n data(){\n return {\n currentValue:this.value,\n children:findComponentsDownward(this,'radioBox')\n }\n },\n computed:{\n classes(){\n return [\n `${prefixCls}`,\n {\n [`${prefixCls}-vertical`]:this.vertical\n }\n ]\n\n }\n },\n methods:{\n change(data){\n this.currentValue = data.value;\n this.updateModel();\n this.$emit('input',data.value);\n this.$emit('on-change',data.value);\n this.$emit('on-form-change',data.value)\n },\n updateModel(){\n let value = this.value;\n this.children = findComponentsDownward(this,'radioBox');\n this.children.forEach((child)=>{\n child.model = value == child.label;\n child.isGroup = true;\n\n })\n }\n },\n watch:{\n value(){\n this.updateModel();\n },\n }\n }\n</script>\n\n<style scoped >\n .dpzvc-radioBoxGroup-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n</style>"],"sourceRoot":""}]);
5808
5808
  // Exports
5809
5809
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
5810
5810
 
@@ -5969,7 +5969,7 @@ __webpack_require__.d(__webpack_exports__, {
5969
5969
  Indicator: () => (/* reexport */ components_Indicator),
5970
5970
  LoadMore: () => (/* reexport */ loadMore),
5971
5971
  Message: () => (/* reexport */ components_message),
5972
- Modal: () => (/* reexport */ modal),
5972
+ Modal: () => (/* reexport */ components_modal),
5973
5973
  Picker: () => (/* reexport */ components_picker),
5974
5974
  Popup: () => (/* reexport */ components_popup),
5975
5975
  Progress: () => (/* reexport */ components_progress),
@@ -7505,6 +7505,9 @@ var header_component = normalizeComponent(
7505
7505
  */
7506
7506
 
7507
7507
  /* harmony default export */ const Header = (header);
7508
+ // EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
7509
+ var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(154);
7510
+ var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default = /*#__PURE__*/__webpack_require__.n(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_);
7508
7511
  ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/message/messageGroup.vue?vue&type=template&id=1acd65df
7509
7512
  var messageGroupvue_type_template_id_1acd65df_render = function render() {
7510
7513
  var _vm = this,
@@ -7735,45 +7738,48 @@ var messageGroup_component = normalizeComponent(
7735
7738
  )
7736
7739
 
7737
7740
  /* harmony default export */ const messageGroup = (messageGroup_component.exports);
7738
- // EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
7739
- var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(154);
7740
- var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default = /*#__PURE__*/__webpack_require__.n(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_);
7741
7741
  ;// ./src/components/message/confirm.js
7742
+
7743
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7744
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7742
7745
  /**
7743
- * Created by admin on 2017/5/8.
7746
+ * messageGroup.js
7747
+ * 兼容 Vue 2.7 runtime-only 构建
7744
7748
  */
7745
7749
 
7746
7750
 
7751
+ // 你的 Vue 组件
7747
7752
 
7748
-
7749
- messageGroup.newInstance = function (props) {
7750
- var _props = props || {};
7751
- var _prop = '';
7752
- Object.keys(_props).forEach(function (prop) {
7753
- _prop += ' :' + camelcaseToHyphen(prop) + '=' + prop;
7754
- });
7753
+ messageGroup.newInstance = function () {
7754
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7755
7755
  var div = document.createElement('div');
7756
7756
  document.body.appendChild(div);
7757
- var message = new (external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default())({
7758
- el: div,
7759
- data: _props,
7760
- template: "<Message-group ".concat(_prop, " ></Message-group>"),
7761
- components: {
7762
- MessageGroup: messageGroup
7757
+
7758
+ // 使用 render 函数代替 template,兼容 runtime-only
7759
+ var messageVm = new (external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default())({
7760
+ data: function data() {
7761
+ return _objectSpread({}, props);
7762
+ },
7763
+ render: function render(h) {
7764
+ return h(messageGroup, {
7765
+ props: props
7766
+ });
7763
7767
  }
7764
- }).$children[0];
7768
+ }).$mount(div);
7769
+ var instance = messageVm.$children[0]; // 确保实例存在
7770
+
7765
7771
  return {
7766
- add: function add(props) {
7767
- message.add(props);
7772
+ add: function add(options) {
7773
+ if (instance) instance.add(options);
7768
7774
  },
7769
- remove: function remove(props) {
7770
- message.remove(props);
7775
+ remove: function remove(options) {
7776
+ if (instance) instance.remove(options);
7771
7777
  },
7772
- component: message,
7778
+ component: instance,
7773
7779
  destroy: function destroy() {
7774
- message.closeAll();
7780
+ if (instance) instance.closeAll();
7775
7781
  setTimeout(function () {
7776
- document.body.removeChild(document.getElementsByClassName('dpzvc-message')[0].parentElement);
7782
+ if (div.parentNode) div.parentNode.removeChild(div);
7777
7783
  }, 500);
7778
7784
  }
7779
7785
  };
@@ -8066,57 +8072,96 @@ var modal_component = normalizeComponent(
8066
8072
 
8067
8073
  )
8068
8074
 
8069
- /* harmony default export */ const modal_modal = (modal_component.exports);
8075
+ /* harmony default export */ const modal = (modal_component.exports);
8070
8076
  ;// ./src/components/modal/confirm.js
8071
8077
  /**
8072
- * Created by admin on 2017/3/30.
8078
+ * confirm.js - 适配 Vue 2.7 runtime-only
8073
8079
  */
8074
8080
 
8075
8081
 
8076
8082
 
8077
8083
 
8078
8084
  var confirm_prefixCls = 'dpzvc-modal';
8079
- modal_modal.newInstance = function (properties) {
8080
- var _props = properties || {};
8081
- var props = '';
8082
- Object.keys(_props).forEach(function (prop) {
8083
- props += ' :' + camelcaseToHyphen(prop) + '=' + prop;
8084
- });
8085
- var div = document.createElement('div');
8086
- document.body.appendChild(div);
8087
- var modal = new (external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default())({
8088
- el: div,
8089
- template: "<Modal ".concat(props, " v-model=\"visible\" :width=\"width\" >\n <div class=\"").concat(confirm_prefixCls, "-header-inner ellipse-fir\" v-html=\"title\" slot=\"header\"></div>\n <div class=\"").concat(confirm_prefixCls, "-body-inner\" v-html=\"body\" slot=\"body\"></div>\n <template slot=\"footer\">\n <v-button type=\"primary\" :radius=\"false\" @click=\"cancle\" v-if=\"showCancle\">{{cancleText}}</v-button>\n <v-button type=\"normal\" :radius=\"false\" @click=\"ok\" :loading=\"buttonLoading\">{{okText}}</v-button>\n </template>\n </Modal>"),
8085
+ modal.newInstance = function () {
8086
+ var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8087
+ // 创建一个新的 Vue 构造函数
8088
+ var ModalConstructor = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default().extend({
8090
8089
  components: {
8091
- Modal: modal_modal,
8090
+ Modal: modal,
8092
8091
  VButton: components_button
8093
8092
  },
8094
- data: Object.assign(_props, {
8095
- visible: false,
8096
- width: '70%',
8097
- body: '',
8098
- title: '',
8099
- okText: '确定',
8100
- cancleText: '取消',
8101
- loading: false,
8102
- buttonLoading: false,
8103
- showCancle: true,
8104
- showHead: true,
8105
- onOk: function onOk() {},
8106
- onCancle: function onCancle() {},
8107
- onRemove: function onRemove() {}
8108
- }),
8093
+ data: function data() {
8094
+ return Object.assign({
8095
+ visible: false,
8096
+ width: '70%',
8097
+ body: '',
8098
+ title: '',
8099
+ okText: '确定',
8100
+ cancleText: '取消',
8101
+ loading: false,
8102
+ buttonLoading: false,
8103
+ showCancle: true,
8104
+ showHead: true,
8105
+ onOk: function onOk() {},
8106
+ onCancle: function onCancle() {},
8107
+ onRemove: function onRemove() {}
8108
+ }, properties);
8109
+ },
8110
+ render: function render(h) {
8111
+ var footer = [this.showCancle ? h('v-button', {
8112
+ props: {
8113
+ type: 'primary',
8114
+ radius: false
8115
+ },
8116
+ on: {
8117
+ click: this.cancle
8118
+ }
8119
+ }, this.cancleText) : null, h('v-button', {
8120
+ props: {
8121
+ type: 'normal',
8122
+ radius: false,
8123
+ loading: this.buttonLoading
8124
+ },
8125
+ on: {
8126
+ click: this.ok
8127
+ }
8128
+ }, this.okText)];
8129
+ return h(modal, {
8130
+ props: {
8131
+ value: this.visible,
8132
+ width: this.width,
8133
+ showHead: this.showHead,
8134
+ footerHide: false
8135
+ },
8136
+ on: {
8137
+ 'on-ok': this.ok,
8138
+ 'on-cancle': this.cancle
8139
+ }
8140
+ }, [h('div', {
8141
+ slot: 'header',
8142
+ domProps: {
8143
+ innerHTML: this.title
8144
+ },
8145
+ "class": "".concat(confirm_prefixCls, "-header-inner ellipse-fir")
8146
+ }), h('div', {
8147
+ slot: 'body',
8148
+ domProps: {
8149
+ innerHTML: this.body
8150
+ },
8151
+ "class": "".concat(confirm_prefixCls, "-body-inner")
8152
+ }), h('template', {
8153
+ slot: 'footer'
8154
+ }, footer)]);
8155
+ },
8109
8156
  methods: {
8110
8157
  cancle: function cancle() {
8111
- this.$children[0].visible = false;
8158
+ this.visible = false;
8112
8159
  this.onCancle();
8113
8160
  this.remove();
8114
8161
  },
8115
8162
  ok: function ok() {
8116
- console.log('asd');
8117
8163
  if (this.loading) {
8118
8164
  this.buttonLoading = true;
8119
- this.$children[0].buttonLoading = true;
8120
8165
  } else {
8121
8166
  this.visible = false;
8122
8167
  this.remove();
@@ -8125,73 +8170,42 @@ modal_modal.newInstance = function (properties) {
8125
8170
  },
8126
8171
  remove: function remove() {
8127
8172
  var _this = this;
8128
- this.$children[0].visible = false;
8173
+ this.visible = false;
8129
8174
  setTimeout(function () {
8130
- _this.destroy();
8175
+ return _this.destroy();
8131
8176
  }, 300);
8132
8177
  },
8133
8178
  destroy: function destroy() {
8134
8179
  this.$destroy();
8135
- document.body.removeChild(this.$el);
8180
+ if (this.$el && this.$el.parentNode) {
8181
+ this.$el.parentNode.removeChild(this.$el);
8182
+ }
8136
8183
  this.onRemove();
8137
8184
  }
8138
8185
  }
8139
- }).$children[0];
8186
+ });
8187
+
8188
+ // 实例化并挂载到 DOM
8189
+ var div = document.createElement('div');
8190
+ document.body.appendChild(div);
8191
+ var instance = new ModalConstructor().$mount(div);
8140
8192
  return {
8141
- show: function show(props) {
8142
- // if ('width' in props) {
8143
- // modal.$parent.width = props.width
8144
- // }
8145
- //
8146
- // if ('title' in props) {
8147
- // modal.$parent.title = props.title
8148
- // }
8149
- //
8150
- // if ('showHead' in props) {
8151
- // modal.$parent.showHead = props.showHead
8152
- // }
8153
- //
8154
- // if ('okText' in props) {
8155
- // modal.$parent.okText = props.okText
8156
- // }
8157
- //
8158
- // if ('cancleText' in props) {
8159
- // modal.$parent.cancleText = props.cancleText
8160
- // }
8161
- //
8162
- //
8163
- // if ('onCancle' in props) {
8164
- // modal.$parent.onCancle = props.onCancle
8165
- // }
8166
- //
8167
- // if ('onOk' in props) {
8168
- // modal.$parent.onOk = props.onOk
8169
- // }
8170
- //
8171
- // if ('loading' in props) {
8172
- // modal.$parent.loading = props.loading
8173
- // }
8174
- //
8175
- // if ('body' in props) {
8176
- // modal.$parent.body = props.body
8177
- // }
8178
-
8179
- Object.keys(props).forEach(function (item) {
8180
- modal.$parent[item] = props[item];
8193
+ show: function show() {
8194
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8195
+ Object.keys(props).forEach(function (key) {
8196
+ if (key in instance) {
8197
+ instance[key] = props[key];
8198
+ }
8181
8199
  });
8182
- modal.$parent.showCancle = props.showCancle;
8183
- modal.$parent.onRemove = props.onRemove;
8184
- modal.visible = true;
8200
+ instance.visible = true;
8185
8201
  },
8186
8202
  remove: function remove() {
8187
- modal.visible = false;
8188
- modal.$parent.buttonLoading = false;
8189
- modal.$parent.remove();
8203
+ instance.remove();
8190
8204
  },
8191
- component: modal
8205
+ component: instance
8192
8206
  };
8193
8207
  };
8194
- /* harmony default export */ const modal_confirm = (modal_modal);
8208
+ /* harmony default export */ const modal_confirm = (modal);
8195
8209
  ;// ./src/components/modal/index.js
8196
8210
  /**
8197
8211
  * Created by admin on 2017/3/30.
@@ -8234,7 +8248,7 @@ modal_confirm.remove = function () {
8234
8248
  var instance = getModalInstance();
8235
8249
  instance.remove();
8236
8250
  };
8237
- /* harmony default export */ const modal = (modal_confirm);
8251
+ /* harmony default export */ const components_modal = (modal_confirm);
8238
8252
  ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/picker/picker.vue?vue&type=template&id=c9eb303a
8239
8253
  var pickervue_type_template_id_c9eb303a_render = function render() {
8240
8254
  var _vm = this,
@@ -10728,7 +10742,7 @@ var textBar_component = normalizeComponent(
10728
10742
  };
10729
10743
  },
10730
10744
  components: {
10731
- Modal: modal_modal,
10745
+ Modal: modal,
10732
10746
  TextBar: textBar,
10733
10747
  VButton: button_button
10734
10748
  },
@@ -10803,31 +10817,28 @@ var prompt_component = normalizeComponent(
10803
10817
 
10804
10818
  /* harmony default export */ const prompt_prompt = (prompt_component.exports);
10805
10819
  ;// ./src/components/prompt/confirm.js
10820
+
10821
+ function confirm_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10822
+ function confirm_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? confirm_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : confirm_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10806
10823
  /**
10807
- * Created by admin on 2017/5/10.
10824
+ * Created by admin on 2025/12/10
10825
+ * Rewritten for Vue 2.7 + Vue CLI (runtime-only)
10808
10826
  */
10809
10827
 
10810
10828
 
10811
10829
 
10812
- var prompt_confirm_prefixCls = 'v-lc-modal';
10813
- prompt_prompt.newInstance = function (properties) {
10814
- var _props = properties || {};
10815
- var props = '';
10816
- Object.keys(_props).forEach(function (prop) {
10817
- props += ' :' + camelcaseToHyphen(prop) + '=' + prop;
10818
- });
10819
- var div = document.createElement('div');
10820
- document.body.appendChild(div);
10821
- var propmt = new (external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default())({
10822
- el: div,
10823
- template: "<Prompt ".concat(props, " v-model=\"visible\" \n :width=\"width\" \n :text=\"text\" \n :title=\"title\" \n :ok-text=\"okText\" \n :cancle-text=\"cancleText\" \n :loading=\"loading\" \n :spec=\"spec\" \n :message=\"message\" \n :validator=\"validator\"\n :on-ok=\"onOk\" \n :on-cancle=\"onCancle\"> </Prompt>"),
10824
- components: {
10825
- Prompt: prompt_prompt
10826
- },
10827
- data: Object.assign(_props, {
10830
+ prompt_prompt.newInstance = function () {
10831
+ var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10832
+ // 1. 创建构造器
10833
+ var PromptConstructor = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default().extend(prompt_prompt);
10834
+
10835
+ // 2. 初始化 props(等价你之前 data + v-model)
10836
+ var instance = new PromptConstructor({
10837
+ propsData: confirm_objectSpread(confirm_objectSpread({}, properties), {}, {
10838
+ // 默认值(保持你原来的语义)
10839
+ visible: false,
10828
10840
  text: '',
10829
10841
  placeholderText: '请输入',
10830
- visible: false,
10831
10842
  width: '70%',
10832
10843
  title: '',
10833
10844
  okText: '确定',
@@ -10838,91 +10849,43 @@ prompt_prompt.newInstance = function (properties) {
10838
10849
  message: '',
10839
10850
  validator: null,
10840
10851
  onOk: function onOk() {},
10841
- onCancle: function onCancle(prop) {},
10842
- onRemove: function onRemove() {}
10843
- }),
10844
- methods: {
10845
- cancle: function cancle() {
10846
- this.$children[0].visible = false;
10847
- this.onCancle();
10848
- this.remove();
10849
- },
10850
- ok: function ok() {
10851
- if (this.loading) {
10852
- this.buttonLoading = true;
10853
- } else {
10854
- this.visible = false;
10855
- this.remove();
10856
- }
10857
- this.onOk();
10858
- },
10859
- remove: function remove() {
10860
- var _this = this;
10861
- this.$children[0].visible = false;
10862
- setTimeout(function () {
10863
- _this.destroy();
10864
- }, 300);
10865
- },
10866
- destroy: function destroy() {
10867
- this.$destroy();
10868
- document.body.removeChild(this.$el);
10869
- this.onRemove();
10870
- },
10871
- mounted: function mounted() {}
10872
- }
10873
- }).$children[0];
10852
+ onCancle: function onCancle() {}
10853
+ })
10854
+ });
10855
+
10856
+ // 3. 挂载到 DOM
10857
+ instance.$mount();
10858
+ document.body.appendChild(instance.$el);
10859
+
10860
+ // 4. 移除逻辑(统一)
10861
+ var destroy = function destroy() {
10862
+ instance.visible = false;
10863
+ setTimeout(function () {
10864
+ instance.$destroy();
10865
+ instance.$el && document.body.removeChild(instance.$el);
10866
+ instance.onRemove && instance.onRemove();
10867
+ }, 300);
10868
+ };
10874
10869
  return {
10875
- show: function show(props) {
10876
- propmt.$parent.showCancle = props.showCancle;
10877
- propmt.$parent.onRemove = props.onRemove;
10878
- propmt.visible = true;
10879
- if ('width' in props) {
10880
- propmt.$parent.width = props.width;
10881
- }
10882
- if ('text' in props) {
10883
- propmt.$parent.text = props.text;
10884
- }
10885
- if ('spec' in props) {
10886
- propmt.$parent.spec = props.spec;
10887
- }
10888
- if ('title' in props) {
10889
- propmt.$parent.title = props.title;
10890
- }
10891
- if ('placeholderText' in props) {
10892
- propmt.$parent.placeholderText = props.placeholderText;
10893
- }
10894
- if ('content' in props) {
10895
- propmt.$parent.body = props.body;
10896
- }
10897
- if ('okText' in props) {
10898
- propmt.$parent.okText = props.okText;
10899
- }
10900
- if ('cancleText' in props) {
10901
- propmt.$parent.cancleText = props.cancleText;
10902
- }
10903
- if ('onCancle' in props) {
10904
- propmt.$parent.onCancle = props.onCancle;
10905
- }
10906
- if ('onOk' in props) {
10907
- propmt.$parent.onOk = props.onOk;
10908
- }
10909
- if ('loading' in props) {
10910
- propmt.$parent.loading = props.loading;
10911
- }
10912
- if ('message' in props) {
10913
- propmt.$parent.message = props.message;
10914
- }
10915
- if ('validator' in props) {
10916
- propmt.$parent.validator = props.validator;
10917
- }
10918
- console.log(propmt.$parent);
10870
+ /**
10871
+ * 显示 Prompt
10872
+ */
10873
+ show: function show() {
10874
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10875
+ Object.keys(props).forEach(function (key) {
10876
+ instance[key] = props[key];
10877
+ });
10878
+ instance.visible = true;
10919
10879
  },
10880
+ /**
10881
+ * 关闭 Prompt
10882
+ */
10920
10883
  remove: function remove() {
10921
- propmt.visible = false;
10922
- propmt.$parent.buttonLoading = false;
10923
- propmt.$parent.remove();
10884
+ instance.visible = false;
10885
+ instance.buttonLoading = false;
10886
+ destroy();
10924
10887
  },
10925
- component: propmt
10888
+ component: instance
10926
10889
  };
10927
10890
  };
10928
10891
  /* harmony default export */ const prompt_confirm = (prompt_prompt);
@@ -12587,117 +12550,82 @@ var Indicator_component = normalizeComponent(
12587
12550
 
12588
12551
  /* harmony default export */ const Indicator = (Indicator_component.exports);
12589
12552
  ;// ./src/components/Indicator/index.js
12553
+
12554
+ function Indicator_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12555
+ function Indicator_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Indicator_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Indicator_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12590
12556
  /**
12591
- * Created by admin on 2017/6/22.
12557
+ * Indicator - Vue 2.7 CLI 适配版
12592
12558
  */
12593
12559
 
12594
12560
 
12595
12561
 
12596
- var instance;
12597
- Indicator.newInstance = function (properties) {
12598
- var _props = properties || {};
12599
- var props = '';
12600
- Object.keys(_props).forEach(function (prop) {
12601
- props += ' :' + camelcaseToHyphen(prop) + '=' + prop;
12602
- });
12603
- var div = document.createElement('div');
12604
- document.body.appendChild(div);
12605
- var indicator = new (external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default())({
12606
- el: div,
12607
- template: "<Indicator ".concat(props, " v-model=\"visible\" ></Indicator>"),
12608
- components: {
12609
- Indicator: Indicator
12610
- },
12611
- data: Object.assign(_props, {
12612
- visible: false,
12562
+ var instance = null;
12563
+ function createInstance() {
12564
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12565
+ var IndicatorConstructor = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default().extend(Indicator);
12566
+ var vm = new IndicatorConstructor({
12567
+ propsData: Indicator_objectSpread({
12613
12568
  size: 45,
12614
12569
  type: 'snake',
12615
12570
  color: '#ffffff',
12616
- text: '加载中...',
12617
- onRemove: function onRemove() {}
12618
- }),
12619
- methods: {
12620
- remove: function remove() {
12621
- var _this = this;
12622
- this.$children[0].visible = false;
12623
- setTimeout(function () {
12624
- _this.destroy();
12625
- }, 300);
12626
- },
12627
- destroy: function destroy() {
12628
- this.$destroy();
12629
-
12630
- // if (!this.$el) return;
12631
- document.body.removeChild(this.$el);
12632
- this.onRemove();
12633
- }
12634
- }
12635
- }).$children[0];
12636
- return {
12637
- open: function open(options) {
12638
- indicator.$parent.visible = true;
12639
- indicator.$parent.onRemove = options.onRemove;
12640
- if ('size' in options) {
12641
- indicator.$parent.size = options.size;
12642
- }
12643
- if ('type' in options) {
12644
- indicator.$parent.type = options.type;
12645
- }
12646
- if ('color' in options) {
12647
- indicator.$parent.color = options.color;
12648
- }
12649
- if ('text' in options) {
12650
- indicator.$parent.text = options.text;
12651
- }
12652
- },
12653
- remove: function remove() {
12654
- indicator.visible = false;
12655
- indicator.$parent.remove();
12656
- },
12657
- component: indicator
12658
- };
12659
- };
12660
- function Indicator_confirm(options) {
12661
- instance = instance || Indicator.newInstance({
12662
- size: 45,
12663
- color: '#ffffff',
12664
- text: '正在加载...',
12665
- type: 'snake'
12571
+ text: '加载中...'
12572
+ }, props)
12666
12573
  });
12667
- options.onRemove = function () {
12668
- instance = null;
12669
- };
12670
- instance.open(options);
12574
+ vm.$mount();
12575
+ document.body.appendChild(vm.$el);
12576
+ vm.visible = false;
12577
+ vm.$on('remove', function () {
12578
+ destroyInstance();
12579
+ });
12580
+ return vm;
12671
12581
  }
12672
- Indicator.blade = function () {
12673
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12674
- props.type = 'blade';
12675
- return Indicator_confirm(props);
12676
- };
12582
+ function destroyInstance() {
12583
+ if (!instance) return;
12584
+ instance.$destroy();
12585
+ if (instance.$el && instance.$el.parentNode) {
12586
+ instance.$el.parentNode.removeChild(instance.$el);
12587
+ }
12588
+ instance = null;
12589
+ }
12590
+ function Indicator_open() {
12591
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12592
+ if (!instance) {
12593
+ instance = createInstance(options);
12594
+ }
12595
+ Object.keys(options).forEach(function (key) {
12596
+ instance.$props[key] = options[key];
12597
+ });
12598
+ instance.visible = true;
12599
+ }
12600
+ function Indicator_close() {
12601
+ if (!instance) return;
12602
+ instance.visible = false;
12603
+ destroyInstance();
12604
+ }
12605
+
12606
+ /* ================== 对外 API ================== */
12607
+
12608
+ Indicator.open = Indicator_open;
12609
+ Indicator.remove = Indicator_close;
12677
12610
  Indicator.snake = function () {
12678
12611
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12679
12612
  props.type = 'snake';
12680
- return Indicator_confirm(props);
12613
+ Indicator_open(props);
12614
+ };
12615
+ Indicator.blade = function () {
12616
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12617
+ props.type = 'blade';
12618
+ Indicator_open(props);
12681
12619
  };
12682
12620
  Indicator.circle = function () {
12683
12621
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12684
12622
  props.type = 'fading-circle';
12685
- return Indicator_confirm(props);
12623
+ Indicator_open(props);
12686
12624
  };
12687
12625
  Indicator.bounce = function () {
12688
12626
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12689
12627
  props.type = 'double-bounce';
12690
- return Indicator_confirm(props);
12691
- };
12692
- Indicator.remove = function () {
12693
- if (!instance) return false;
12694
- instance = instance || Indicator.newInstance({
12695
- size: 45,
12696
- color: '#ffffff',
12697
- text: '正在加载...',
12698
- type: 'snake'
12699
- });
12700
- instance.remove();
12628
+ Indicator_open(props);
12701
12629
  };
12702
12630
  /* harmony default export */ const components_Indicator = (Indicator);
12703
12631
  ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/progress/progress.vue?vue&type=template&id=7444ee7d
@@ -13521,7 +13449,7 @@ var components = {
13521
13449
 
13522
13450
  var services = {
13523
13451
  Message: components_message,
13524
- Modal: modal,
13452
+ Modal: components_modal,
13525
13453
  Prompt: components_prompt,
13526
13454
  Indicator: components_Indicator
13527
13455
  };