@v2coding/ui 0.1.47 → 0.1.49

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.
@@ -667,7 +667,91 @@ var Objects = {
667
667
 
668
668
  }
669
669
  };
670
- var DefaultSetting$1 = DefaultSetting;var downloadFile = function downloadFile(data, filename, mime) {
670
+ var DefaultSetting$1 = DefaultSetting;var defaultOptions = {
671
+ timeout: 30000,
672
+ jsonpCallback: 'callback',
673
+ jsonpCallbackFunction: null
674
+ };
675
+
676
+ function generateCallbackFunction() {
677
+ return "jsonp_".concat(Date.now(), "_").concat(Math.ceil(Math.random() * 100000));
678
+ }
679
+
680
+ function clearFunction(functionName) {
681
+ // IE8 throws an exception when you try to delete a property on window
682
+ // http://stackoverflow.com/a/1824228/751089
683
+ try {
684
+ delete window[functionName];
685
+ } catch (e) {
686
+ window[functionName] = undefined;
687
+ }
688
+ }
689
+
690
+ function removeScript(scriptId) {
691
+ var script = document.getElementById(scriptId);
692
+
693
+ if (script) {
694
+ document.getElementsByTagName('head')[0].removeChild(script);
695
+ }
696
+ }
697
+
698
+ function jsonp(_url) {
699
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
700
+ // to avoid param reassign
701
+ var url = _url;
702
+ var timeout = options.timeout || defaultOptions.timeout;
703
+ var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;
704
+ var timeoutId;
705
+ return new Promise(function (resolve, reject) {
706
+ var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();
707
+ var scriptId = "".concat(jsonpCallback, "_").concat(callbackFunction);
708
+
709
+ window[callbackFunction] = function (response) {
710
+ resolve({
711
+ ok: true,
712
+ // keep consistent with fetch API
713
+ json: function json() {
714
+ return Promise.resolve(response);
715
+ }
716
+ });
717
+ if (timeoutId) clearTimeout(timeoutId);
718
+ removeScript(scriptId);
719
+ clearFunction(callbackFunction);
720
+ }; // Check if the user set their own params, and if not add a ? to start a list of params
721
+
722
+
723
+ url += url.indexOf('?') === -1 ? '?' : '&';
724
+ var jsonpScript = document.createElement('script');
725
+ jsonpScript.src = "".concat(url).concat(jsonpCallback, "=").concat(callbackFunction);
726
+
727
+ if (options.nonce) {
728
+ jsonpScript.nonce = options.nonce;
729
+ }
730
+
731
+ if (options.referrerPolicy) {
732
+ jsonpScript.referrerPolicy = options.referrerPolicy;
733
+ }
734
+
735
+ jsonpScript.id = scriptId;
736
+ document.head.appendChild(jsonpScript);
737
+ timeoutId = setTimeout(function () {
738
+ reject(new Error("JSONP request to ".concat(_url, " timed out")));
739
+ clearFunction(callbackFunction);
740
+ removeScript(scriptId);
741
+
742
+ window[callbackFunction] = function () {
743
+ clearFunction(callbackFunction);
744
+ };
745
+ }, timeout); // Caught if got 404/500
746
+
747
+ jsonpScript.onerror = function () {
748
+ reject(new Error("JSONP request to ".concat(_url, " failed")));
749
+ clearFunction(callbackFunction);
750
+ removeScript(scriptId);
751
+ if (timeoutId) clearTimeout(timeoutId);
752
+ };
753
+ });
754
+ }var downloadFile = function downloadFile(data, filename, mime) {
671
755
  var blob = new Blob([data], {
672
756
  type: mime || data.type || 'application/octet-stream'
673
757
  });
@@ -846,6 +930,7 @@ var init$2 = function init(Vue) {
846
930
  instance.interceptors.response.use(onResponseSuccess, onResponseError);
847
931
  downloadInstance.interceptors.request.use(onRequestSuccess);
848
932
  downloadInstance.interceptors.response.use(onResponseSuccess, onResponseError);
933
+ instance.jsonp = jsonp;
849
934
  instance.download = initDownload(downloadInstance);
850
935
  instance.downloadServer = downloadInstance;
851
936
  Vue.prototype.$axios = instance;
@@ -8240,6 +8325,8 @@ var FormDialog = __vue_component__$f;//
8240
8325
  //
8241
8326
  //
8242
8327
  //
8328
+ //
8329
+ //
8243
8330
  var script$e = {
8244
8331
  name: 'ui-drawer',
8245
8332
  inheritAttrs: false,
@@ -8252,6 +8339,14 @@ var script$e = {
8252
8339
  },
8253
8340
  customClass: {
8254
8341
  type: String
8342
+ },
8343
+ wrapperClosable: {
8344
+ type: Boolean,
8345
+ default: false
8346
+ },
8347
+ closeOnPressEscape: {
8348
+ type: Boolean,
8349
+ default: false
8255
8350
  }
8256
8351
  },
8257
8352
  computed: {
@@ -8288,7 +8383,9 @@ var __vue_render__$d = function __vue_render__() {
8288
8383
  attrs: {
8289
8384
  "size": _vm.width,
8290
8385
  "visible": _vm.realVisible,
8291
- "custom-class": _vm.realCustomClass
8386
+ "custom-class": _vm.realCustomClass,
8387
+ "wrapper-closable": _vm.wrapperClosable,
8388
+ "close-on-press-escape": _vm.closeOnPressEscape
8292
8389
  },
8293
8390
  on: {
8294
8391
  "update:visible": _vm.onUpdateVisible
@@ -8301,7 +8398,7 @@ var __vue_staticRenderFns__$d = [];
8301
8398
 
8302
8399
  var __vue_inject_styles__$e = function __vue_inject_styles__(inject) {
8303
8400
  if (!inject) return;
8304
- inject("data-v-743600a7_0", {
8401
+ inject("data-v-0affe6b4_0", {
8305
8402
  source: ".ui-drawer .el-drawer__header{margin:0;padding:14px 16px;height:50px;border-bottom:1px solid #e8eaec;display:flex;flex-direction:row;align-items:center}.ui-drawer .el-drawer__header>span:first-child{color:#17233d}.ui-drawer .el-drawer__body{height:calc(100% - 51px);display:flex;flex-direction:column}",
8306
8403
  map: undefined,
8307
8404
  media: undefined
@@ -8313,7 +8410,7 @@ var __vue_inject_styles__$e = function __vue_inject_styles__(inject) {
8313
8410
  var __vue_scope_id__$e = undefined;
8314
8411
  /* module identifier */
8315
8412
 
8316
- var __vue_module_identifier__$e = "data-v-743600a7";
8413
+ var __vue_module_identifier__$e = "data-v-0affe6b4";
8317
8414
  /* functional template */
8318
8415
 
8319
8416
  var __vue_is_functional_template__$e = false;
@@ -11359,6 +11456,22 @@ var TableSelect = __vue_component__$7;var Table = {
11359
11456
  //
11360
11457
  //
11361
11458
  //
11459
+ //
11460
+ //
11461
+ //
11462
+ //
11463
+ //
11464
+ //
11465
+ //
11466
+ //
11467
+ //
11468
+ //
11469
+ //
11470
+ //
11471
+ //
11472
+ //
11473
+ //
11474
+ //
11362
11475
  var script$6 = {
11363
11476
  name: 'ui-dialog',
11364
11477
  props: {
@@ -11379,6 +11492,10 @@ var script$6 = {
11379
11492
  type: Boolean,
11380
11493
  default: false
11381
11494
  },
11495
+ closeOnPressEscape: {
11496
+ type: Boolean,
11497
+ default: false
11498
+ },
11382
11499
  destroyOnClose: {
11383
11500
  type: Boolean,
11384
11501
  default: true
@@ -11472,6 +11589,7 @@ var __vue_render__$6 = function __vue_render__() {
11472
11589
  "visible": _vm.visible,
11473
11590
  "width": _vm.width,
11474
11591
  "close-on-click-modal": _vm.closeOnClickModal,
11592
+ "close-on-press-escape": _vm.closeOnPressEscape,
11475
11593
  "destroy-on-close": _vm.destroyOnClose,
11476
11594
  "show-close": false
11477
11595
  },
@@ -11520,8 +11638,8 @@ var __vue_staticRenderFns__$6 = [];
11520
11638
 
11521
11639
  var __vue_inject_styles__$6 = function __vue_inject_styles__(inject) {
11522
11640
  if (!inject) return;
11523
- inject("data-v-2fef274f_0", {
11524
- source: ".ui-dialog[data-v-2fef274f] .el-dialog{margin-bottom:0}.ui-dialog[data-v-2fef274f] .el-dialog .title{position:relative;line-height:28px;padding:12px 48px 12px 24px;word-break:keep-all;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-bottom:1px solid #e8e8e8;color:#202124;font-weight:500;font-size:16px}.ui-dialog[data-v-2fef274f] .el-dialog .title .close{position:absolute;right:0;top:0;bottom:0;width:53px;height:53px;display:inline-block;text-align:center;cursor:pointer;transition:all .3s;user-select:none}.ui-dialog[data-v-2fef274f] .el-dialog .title .close:hover{color:var(--color-primary)}.ui-dialog[data-v-2fef274f] .el-dialog .title .close>i{font-size:20px;line-height:53px}[data-v-2fef274f] .el-form .ui-form-fieldset:first-child{margin-top:0}[data-v-2fef274f] .el-form .ui-form-fieldset:last-child{margin-bottom:0}[data-v-2fef274f] .el-dialog__header{padding:0;user-select:none}[data-v-2fef274f] .el-dialog__body{padding-bottom:20px}[data-v-2fef274f] .el-dialog__footer{padding:10px 20px;border-top:1px solid #dcdfe6}.el-dialog__footer .el-button[data-v-2fef274f]{border-radius:2px}@keyframes rotate-data-v-2fef274f{from{transform:rotate(0)}to{transform:rotate(360deg)}}",
11641
+ inject("data-v-9674bbd8_0", {
11642
+ source: ".ui-dialog[data-v-9674bbd8] .el-dialog{margin-bottom:0}.ui-dialog[data-v-9674bbd8] .el-dialog .title{position:relative;line-height:28px;padding:12px 48px 12px 24px;word-break:keep-all;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-bottom:1px solid #e8e8e8;color:#202124;font-weight:500;font-size:16px}.ui-dialog[data-v-9674bbd8] .el-dialog .title .close{position:absolute;right:0;top:0;bottom:0;width:53px;height:53px;display:inline-block;text-align:center;cursor:pointer;transition:all .3s;user-select:none}.ui-dialog[data-v-9674bbd8] .el-dialog .title .close:hover{color:var(--color-primary)}.ui-dialog[data-v-9674bbd8] .el-dialog .title .close>i{font-size:20px;line-height:53px}[data-v-9674bbd8] .el-form .ui-form-fieldset:first-child{margin-top:0}[data-v-9674bbd8] .el-form .ui-form-fieldset:last-child{margin-bottom:0}[data-v-9674bbd8] .el-dialog__header{padding:0;user-select:none}[data-v-9674bbd8] .el-dialog__body{padding-bottom:20px}[data-v-9674bbd8] .el-dialog__footer{padding:10px 20px;border-top:1px solid #dcdfe6}.el-dialog__footer .el-button[data-v-9674bbd8]{border-radius:2px}@keyframes rotate-data-v-9674bbd8{from{transform:rotate(0)}to{transform:rotate(360deg)}}",
11525
11643
  map: undefined,
11526
11644
  media: undefined
11527
11645
  });
@@ -11529,10 +11647,10 @@ var __vue_inject_styles__$6 = function __vue_inject_styles__(inject) {
11529
11647
  /* scoped */
11530
11648
 
11531
11649
 
11532
- var __vue_scope_id__$6 = "data-v-2fef274f";
11650
+ var __vue_scope_id__$6 = "data-v-9674bbd8";
11533
11651
  /* module identifier */
11534
11652
 
11535
- var __vue_module_identifier__$6 = "data-v-2fef274f";
11653
+ var __vue_module_identifier__$6 = "data-v-9674bbd8";
11536
11654
  /* functional template */
11537
11655
 
11538
11656
  var __vue_is_functional_template__$6 = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v2coding/ui",
3
- "version": "0.1.47",
3
+ "version": "0.1.49",
4
4
  "description": "",
5
5
 
6
6
  "main": "dist/v2coding-ui.ssr.js",