bm-admin-ui 1.0.38-alpha → 1.0.40-alpha

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.
Files changed (64) hide show
  1. package/es/components/__tests__/util/domHook.d.ts +6 -0
  2. package/es/components/feedback/index.js +2 -2
  3. package/es/components/float-table/index.js +36 -27
  4. package/es/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +4 -4
  5. package/es/components/form-create/index.js +215 -107
  6. package/es/components/form-designer/index.js +86 -47
  7. package/es/components/input-tags-display/index.js +30 -13
  8. package/es/components/input-tags-display/src/input-tags-display.vue.d.ts +9 -0
  9. package/es/components/over-tooltips/index.js +27 -20
  10. package/es/components/search-filter/index.js +18 -10
  11. package/es/components/select-all/index.js +17 -9
  12. package/es/components/shops-filter/index.js +19 -13
  13. package/es/components/staffs-selector/index.js +116 -82
  14. package/es/components/timeline/__tests__/index.test.d.ts +1 -0
  15. package/es/components/timeline/index.js +8 -7
  16. package/es/components/upload/__tests__/mock.d.ts +2 -0
  17. package/es/components/upload/__tests__/requests.d.ts +7 -0
  18. package/es/components/upload/__tests__/upload.test.d.ts +1 -0
  19. package/es/components/upload/index.js +115 -78
  20. package/index.esm.js +41000 -4676
  21. package/index.js +40999 -4675
  22. package/lib/components/__tests__/util/domHook.d.ts +6 -0
  23. package/lib/components/feedback/index.js +1 -1
  24. package/lib/components/float-table/index.js +36 -27
  25. package/lib/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +4 -4
  26. package/lib/components/form-create/index.js +214 -106
  27. package/lib/components/form-designer/index.js +86 -47
  28. package/lib/components/input-tags-display/index.js +30 -13
  29. package/lib/components/input-tags-display/src/input-tags-display.vue.d.ts +9 -0
  30. package/lib/components/over-tooltips/index.js +27 -20
  31. package/lib/components/search-filter/index.js +18 -10
  32. package/lib/components/select-all/index.js +17 -9
  33. package/lib/components/shops-filter/index.js +19 -13
  34. package/lib/components/staffs-selector/index.js +116 -82
  35. package/lib/components/timeline/__tests__/index.test.d.ts +1 -0
  36. package/lib/components/timeline/index.js +8 -7
  37. package/lib/components/upload/__tests__/mock.d.ts +2 -0
  38. package/lib/components/upload/__tests__/requests.d.ts +7 -0
  39. package/lib/components/upload/__tests__/upload.test.d.ts +1 -0
  40. package/lib/components/upload/index.js +115 -78
  41. package/package.json +1 -1
  42. package/theme-chalk/button.css +1 -1
  43. package/theme-chalk/feedback.css +1 -1
  44. package/theme-chalk/float-table.css +1 -1
  45. package/theme-chalk/floating-vue.css +1 -1
  46. package/theme-chalk/flow-designer.css +1 -1
  47. package/theme-chalk/form-create.css +1 -1
  48. package/theme-chalk/form-designer.css +1 -1
  49. package/theme-chalk/index.css +1 -1
  50. package/theme-chalk/input-tags-display.css +1 -1
  51. package/theme-chalk/modal.css +1 -1
  52. package/theme-chalk/over-tooltips.css +1 -1
  53. package/theme-chalk/search-filter.css +1 -1
  54. package/theme-chalk/select-all.css +1 -1
  55. package/theme-chalk/staffs-selector.css +1 -1
  56. package/theme-chalk/timeline.css +1 -1
  57. package/theme-chalk/upload.css +1 -1
  58. package/types/components/__tests__/util/domHook.d.ts +6 -0
  59. package/types/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +4 -4
  60. package/types/components/input-tags-display/src/input-tags-display.vue.d.ts +9 -0
  61. package/types/components/timeline/__tests__/index.test.d.ts +1 -0
  62. package/types/components/upload/__tests__/mock.d.ts +2 -0
  63. package/types/components/upload/__tests__/requests.d.ts +7 -0
  64. package/types/components/upload/__tests__/upload.test.d.ts +1 -0
@@ -116,39 +116,50 @@ const _sfc_main$3 = defineComponent({
116
116
  return data ? data.title : "\u672A\u77E5";
117
117
  }
118
118
  };
119
- watch(() => state.listChecked, () => {
120
- let list = [];
121
- for (let [key, value] of Object.entries(state.listChecked)) {
122
- value && list.push(key);
123
- }
124
- if (props.limit > 0 && list.length >= props.limit)
125
- state.isFulfill = true;
126
- else
127
- state.isFulfill = false;
128
- methods.setState();
129
- emit("update:selected", list);
130
- }, { deep: true });
131
- watch(() => state.departmentChecked, () => {
132
- let flatMap = props.dataMap;
133
- let curlistKeys = props.curlistKeys;
134
- let hadselected = new Set(props.selected);
135
- let curselect = new Set(state.departmentChecked);
136
- for (let key of hadselected) {
137
- if (curlistKeys.has(key) && (!curselect.has(key) || curselect.has(key) && curselect.has(flatMap.get(key)["parent"]))) {
138
- hadselected.delete(key);
119
+ watch(
120
+ () => state.listChecked,
121
+ () => {
122
+ let list = [];
123
+ for (let [key, value] of Object.entries(state.listChecked)) {
124
+ value && list.push(key);
139
125
  }
140
- }
141
- for (let key of curselect) {
142
- let obj = flatMap.get(key);
143
- if (obj && !curselect.has(obj["parent"])) {
144
- hadselected.add(key);
126
+ if (props.limit > 0 && list.length >= props.limit)
127
+ state.isFulfill = true;
128
+ else
129
+ state.isFulfill = false;
130
+ methods.setState();
131
+ emit("update:selected", list);
132
+ },
133
+ { deep: true }
134
+ );
135
+ watch(
136
+ () => state.departmentChecked,
137
+ () => {
138
+ let flatMap = props.dataMap;
139
+ let curlistKeys = props.curlistKeys;
140
+ let hadselected = new Set(props.selected);
141
+ let curselect = new Set(state.departmentChecked);
142
+ for (let key of hadselected) {
143
+ if (curlistKeys.has(key) && (!curselect.has(key) || curselect.has(key) && curselect.has(flatMap.get(key)["parent"]))) {
144
+ hadselected.delete(key);
145
+ }
145
146
  }
147
+ for (let key of curselect) {
148
+ let obj = flatMap.get(key);
149
+ if (obj && !curselect.has(obj["parent"])) {
150
+ hadselected.add(key);
151
+ }
152
+ }
153
+ emit("update:selected", Array.from(hadselected));
154
+ },
155
+ { deep: true }
156
+ );
157
+ watch(
158
+ () => props.list,
159
+ () => {
160
+ !props.isTree && methods.setState();
146
161
  }
147
- emit("update:selected", Array.from(hadselected));
148
- }, { deep: true });
149
- watch(() => props.list, () => {
150
- !props.isTree && methods.setState();
151
- });
162
+ );
152
163
  onMounted(() => {
153
164
  let list = props.selected;
154
165
  list && list.forEach((key) => {
@@ -484,57 +495,73 @@ const _sfc_main$1 = defineComponent({
484
495
  return data ? data.title : "\u672A\u77E5";
485
496
  }
486
497
  };
487
- watch(() => departmentChecked, () => {
488
- let flatMap = props.dataMap;
489
- let curlistKeys = props.curlistKeys;
490
- let hadselected = new Set(props.selected);
491
- let curselect = new Set(departmentChecked.value);
492
- for (let key of hadselected) {
493
- if (curlistKeys.has(key) && (!curselect.has(key) || curselect.has(key) && curselect.has(flatMap.get(key)["parent"]))) {
494
- hadselected.delete(key);
498
+ watch(
499
+ () => departmentChecked,
500
+ () => {
501
+ let flatMap = props.dataMap;
502
+ let curlistKeys = props.curlistKeys;
503
+ let hadselected = new Set(props.selected);
504
+ let curselect = new Set(departmentChecked.value);
505
+ for (let key of hadselected) {
506
+ if (curlistKeys.has(key) && (!curselect.has(key) || curselect.has(key) && curselect.has(flatMap.get(key)["parent"]))) {
507
+ hadselected.delete(key);
508
+ }
495
509
  }
496
- }
497
- for (let key of curselect) {
498
- let obj = flatMap.get(key);
499
- if (obj && !curselect.has(obj["parent"])) {
500
- hadselected.add(key);
510
+ for (let key of curselect) {
511
+ let obj = flatMap.get(key);
512
+ if (obj && !curselect.has(obj["parent"])) {
513
+ hadselected.add(key);
514
+ }
501
515
  }
502
- }
503
- emit("update:selected", Array.from(hadselected));
504
- }, { deep: true });
505
- watch(() => staffsChecked, () => {
506
- let set = new Set(props.selected.length ? props.selected : null);
507
- for (let [key, value] of Object.entries(staffsChecked.value)) {
508
- if (value) {
509
- set.add(key);
510
- } else {
511
- set.has(key) && set.delete(key);
516
+ emit("update:selected", Array.from(hadselected));
517
+ },
518
+ { deep: true }
519
+ );
520
+ watch(
521
+ () => staffsChecked,
522
+ () => {
523
+ let set = new Set(props.selected.length ? props.selected : null);
524
+ for (let [key, value] of Object.entries(staffsChecked.value)) {
525
+ if (value) {
526
+ set.add(key);
527
+ } else {
528
+ set.has(key) && set.delete(key);
529
+ }
512
530
  }
513
- }
514
- emit("update:selected", Array.from(set));
515
- }, { deep: true });
516
- watch(() => shopChecked, () => {
517
- let set = new Set(props.selected.length ? props.selected : null);
518
- for (let [key, value] of Object.entries(shopChecked.value)) {
519
- if (value) {
520
- set.add(key);
521
- } else {
522
- set.has(key) && set.delete(key);
531
+ emit("update:selected", Array.from(set));
532
+ },
533
+ { deep: true }
534
+ );
535
+ watch(
536
+ () => shopChecked,
537
+ () => {
538
+ let set = new Set(props.selected.length ? props.selected : null);
539
+ for (let [key, value] of Object.entries(shopChecked.value)) {
540
+ if (value) {
541
+ set.add(key);
542
+ } else {
543
+ set.has(key) && set.delete(key);
544
+ }
523
545
  }
524
- }
525
- emit("update:selected", Array.from(set));
526
- }, { deep: true });
527
- watch(() => groupChecked, () => {
528
- let set = new Set(props.selected.length ? props.selected : null);
529
- for (let [key, value] of Object.entries(groupChecked.value)) {
530
- if (value) {
531
- set.add(key);
532
- } else {
533
- set.has(key) && set.delete(key);
546
+ emit("update:selected", Array.from(set));
547
+ },
548
+ { deep: true }
549
+ );
550
+ watch(
551
+ () => groupChecked,
552
+ () => {
553
+ let set = new Set(props.selected.length ? props.selected : null);
554
+ for (let [key, value] of Object.entries(groupChecked.value)) {
555
+ if (value) {
556
+ set.add(key);
557
+ } else {
558
+ set.has(key) && set.delete(key);
559
+ }
534
560
  }
535
- }
536
- emit("update:selected", Array.from(set));
537
- }, { deep: true });
561
+ emit("update:selected", Array.from(set));
562
+ },
563
+ { deep: true }
564
+ );
538
565
  onMounted(() => {
539
566
  let list = props.selected;
540
567
  list && list.forEach((key) => {
@@ -820,7 +847,10 @@ const _sfc_main = defineComponent({
820
847
  if (["string", "number"].includes(typeof state.selected)) {
821
848
  emit("update:select", [state.dataMap.get(state.selected)]);
822
849
  } else if (state.selected instanceof Array) {
823
- emit("update:select", state.selected.map((item) => state.dataMap.get(item)));
850
+ emit(
851
+ "update:select",
852
+ state.selected.map((item) => state.dataMap.get(item))
853
+ );
824
854
  } else ;
825
855
  state.list = [];
826
856
  methods.modalCancel();
@@ -841,11 +871,15 @@ const _sfc_main = defineComponent({
841
871
  return 648;
842
872
  })
843
873
  });
844
- watch(() => props.visible, (val) => {
845
- if (val && props.immediateFetch) {
846
- methods.fetch({});
847
- }
848
- }, { immediate: true });
874
+ watch(
875
+ () => props.visible,
876
+ (val) => {
877
+ if (val && props.immediateFetch) {
878
+ methods.fetch({});
879
+ }
880
+ },
881
+ { immediate: true }
882
+ );
849
883
  return {
850
884
  ...methods,
851
885
  ...toRefs(state)
@@ -0,0 +1 @@
1
+ export {};
@@ -34,17 +34,17 @@ function isPlainObject(o) {
34
34
  return true;
35
35
  }
36
36
 
37
- function t(){return t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);}return e},t.apply(this,arguments)}function r(e,t){if(null==e)return {};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}const n={silent:!1,logLevel:"warn"},i=["validator"],o=Object.prototype,a=o.toString,s=o.hasOwnProperty,u=/^\s*function (\w+)/;function l(e){var t;const r=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(r){const e=r.toString().match(u);return e?e[1]:""}return ""}const c=isPlainObject,f=e=>e;let d=f;if("production"!==process.env.NODE_ENV){const e="undefined"!=typeof console;d=e?function(e,t=n.logLevel){!1===n.silent&&console[t](`[VueTypes warn]: ${e}`);}:f;}const p=(e,t)=>s.call(e,t),y=Number.isInteger||function(e){return "number"==typeof e&&isFinite(e)&&Math.floor(e)===e},v=Array.isArray||function(e){return "[object Array]"===a.call(e)},h=e=>"[object Function]"===a.call(e),b=e=>c(e)&&p(e,"_vueTypes_name"),g=e=>c(e)&&(p(e,"type")||["_vueTypes_name","validator","default","required"].some(t=>p(e,t)));function O(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function m(e,t,r=!1){let n,i=!0,o="";n=c(e)?e:{type:e};const a=b(n)?n._vueTypes_name+" - ":"";if(g(n)&&null!==n.type){if(void 0===n.type||!0===n.type)return i;if(!n.required&&void 0===t)return i;v(n.type)?(i=n.type.some(e=>!0===m(e,t,!0)),o=n.type.map(e=>l(e)).join(" or ")):(o=l(n),i="Array"===o?v(t):"Object"===o?c(t):"String"===o||"Number"===o||"Boolean"===o||"Function"===o?function(e){if(null==e)return "";const t=e.constructor.toString().match(u);return t?t[1]:""}(t)===o:t instanceof n.type);}if(!i){const e=`${a}value "${t}" should be of type "${o}"`;return !1===r?(d(e),!1):e}if(p(n,"validator")&&h(n.validator)){const e=d,o=[];if(d=e=>{o.push(e);},i=n.validator(t),d=e,!i){const e=(o.length>1?"* ":"")+o.join("\n* ");return o.length=0,!1===r?(d(e),i):e}}return i}function j(e,t){const r=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?(p(this,"default")&&delete this.default,this):h(e)||!0===m(this,e,!0)?(this.default=v(e)?()=>[...e]:c(e)?()=>Object.assign({},e):e,this):(d(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:n}=r;return h(n)&&(r.validator=O(n,r)),r}function _(e,t){const r=j(e,t);return Object.defineProperty(r,"validate",{value(e){return h(this.validator)&&d(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=O(e,this),this}})}function T(e,t,n){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach(r=>{t[r]=Object.getOwnPropertyDescriptor(e,r);}),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!c(n))return o;const{validator:a}=n,s=r(n,i);if(h(a)){let{validator:e}=o;e&&(e=null!==(l=(u=e).__original)&&void 0!==l?l:u),o.validator=O(e?function(t){return e.call(this,t)&&a.call(this,t)}:a,o);}var u,l;return Object.assign(o,s)}function $(e){return e.replace(/^(?!\s*$)/gm," ")}const w=()=>_("any",{}),P=()=>_("function",{type:Function}),x=()=>_("boolean",{type:Boolean}),E=()=>_("string",{type:String}),N=()=>_("number",{type:Number}),q=()=>_("array",{type:Array}),A=()=>_("object",{type:Object}),V=()=>j("integer",{type:Number,validator:e=>y(e)}),S=()=>j("symbol",{validator:e=>"symbol"==typeof e});function k(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return j(e.name||"<<anonymous function>>",{type:null,validator(r){const n=e(r);return n||d(`${this._vueTypes_name} - ${t}`),n}})}function D(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.join('", "')}".`,r=e.reduce((e,t)=>{if(null!=t){const r=t.constructor;-1===e.indexOf(r)&&e.push(r);}return e},[]);return j("oneOf",{type:r.length>0?r:void 0,validator(r){const n=-1!==e.indexOf(r);return n||d(t),n}})}function L(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,r=[];for(let n=0;n<e.length;n+=1){const i=e[n];if(g(i)){if(b(i)&&"oneOf"===i._vueTypes_name&&i.type){r=r.concat(i.type);continue}if(h(i.validator)&&(t=!0),!0===i.type||!i.type){d('oneOfType - invalid usage of "true" or "null" as types.');continue}r=r.concat(i.type);}else r.push(i);}r=r.filter((e,t)=>r.indexOf(e)===t);const n=r.length>0?r:null;return j("oneOfType",t?{type:n,validator(t){const r=[],n=e.some(e=>{const n=m(b(e)&&"oneOf"===e._vueTypes_name?e.type||null:e,t,!0);return "string"==typeof n&&r.push(n),!0===n});return n||d(`oneOfType - provided value does not match any of the ${r.length} passed-in validators:\n${$(r.join("\n"))}`),n}}:{type:n})}function F(e){return j("arrayOf",{type:Array,validator(t){let r="";const n=t.every(t=>(r=m(e,t,!0),!0===r));return n||d(`arrayOf - value validation error:\n${$(r)}`),n}})}function Y(e){return j("instanceOf",{type:e})}function B(e){return j("objectOf",{type:Object,validator(t){let r="";const n=Object.keys(t).every(n=>(r=m(e,t[n],!0),!0===r));return n||d(`objectOf - value validation error:\n${$(r)}`),n}})}function I(e){const t=Object.keys(e),r=t.filter(t=>{var r;return !(null===(r=e[t])||void 0===r||!r.required)}),n=j("shape",{type:Object,validator(n){if(!c(n))return !1;const i=Object.keys(n);if(r.length>0&&r.some(e=>-1===i.indexOf(e))){const e=r.filter(e=>-1===i.indexOf(e));return d(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return i.every(r=>{if(-1===t.indexOf(r))return !0===this._vueTypes_isLoose||(d(`shape - shape definition does not include a "${r}" property. Allowed keys: "${t.join('", "')}".`),!1);const i=m(e[r],n[r],!0);return "string"==typeof i&&d(`shape - "${r}" property validation error:\n ${$(i)}`),!0===i})}});return Object.defineProperty(n,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(n,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),n}const J=["name","validate","getter"],M=/*#__PURE__*/(()=>{var e,t;return t=e=class{static get any(){return w()}static get func(){return P().def(this.defaults.func)}static get bool(){return x().def(this.defaults.bool)}static get string(){return E().def(this.defaults.string)}static get number(){return N().def(this.defaults.number)}static get array(){return q().def(this.defaults.array)}static get object(){return A().def(this.defaults.object)}static get integer(){return V().def(this.defaults.integer)}static get symbol(){return S()}static extend(e){if(v(e))return e.forEach(e=>this.extend(e)),this;const{name:t,validate:n=!1,getter:i=!1}=e,o=r(e,J);if(p(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:a}=o;if(b(a))return delete o.type,Object.defineProperty(this,t,i?{get:()=>T(t,a,o)}:{value(...e){const r=T(t,a,o);return r.validator&&(r.validator=r.validator.bind(r,...e)),r}});let s;return s=i?{get(){const e=Object.assign({},o);return n?_(t,e):j(t,e)},enumerable:!0}:{value(...e){const r=Object.assign({},o);let i;return i=n?_(t,r):j(t,r),r.validator&&(i.validator=r.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,s)}},e.defaults={},e.sensibleDefaults=void 0,e.config=n,e.custom=k,e.oneOf=D,e.instanceOf=Y,e.oneOfType=L,e.arrayOf=F,e.objectOf=B,e.shape=I,e.utils={validate:(e,t)=>!0===m(t,e,!0),toType:(e,t,r=!1)=>r?_(e,t):j(e,t)},t})();function R(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){var r,n;return n=r=class extends M{static get sensibleDefaults(){return t({},this.defaults)}static set sensibleDefaults(r){this.defaults=!1!==r?t({},!0!==r?r:e):{};}},r.defaults=t({},e),n}class z extends(R()){}
37
+ function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);}return e},t.apply(this,arguments)}function r(e,t){if(null==e)return {};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}const n={silent:!1,logLevel:"warn"},i=["validator"],o=Object.prototype,a=o.toString,s=o.hasOwnProperty,u=/^\s*function (\w+)/;function l(e){var t;const r=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(r){const e=r.toString().match(u);return e?e[1]:""}return ""}const c=isPlainObject,f=e=>e;let d=f;if("production"!==process.env.NODE_ENV){const e="undefined"!=typeof console;d=e?function(e,t=n.logLevel){!1===n.silent&&console[t](`[VueTypes warn]: ${e}`);}:f;}const p=(e,t)=>s.call(e,t),y=Number.isInteger||function(e){return "number"==typeof e&&isFinite(e)&&Math.floor(e)===e},v=Array.isArray||function(e){return "[object Array]"===a.call(e)},h=e=>"[object Function]"===a.call(e),b=e=>c(e)&&p(e,"_vueTypes_name"),g=e=>c(e)&&(p(e,"type")||["_vueTypes_name","validator","default","required"].some(t=>p(e,t)));function O(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function m(e,t,r=!1){let n,i=!0,o="";n=c(e)?e:{type:e};const a=b(n)?n._vueTypes_name+" - ":"";if(g(n)&&null!==n.type){if(void 0===n.type||!0===n.type)return i;if(!n.required&&void 0===t)return i;v(n.type)?(i=n.type.some(e=>!0===m(e,t,!0)),o=n.type.map(e=>l(e)).join(" or ")):(o=l(n),i="Array"===o?v(t):"Object"===o?c(t):"String"===o||"Number"===o||"Boolean"===o||"Function"===o?function(e){if(null==e)return "";const t=e.constructor.toString().match(u);return t?t[1]:""}(t)===o:t instanceof n.type);}if(!i){const e=`${a}value "${t}" should be of type "${o}"`;return !1===r?(d(e),!1):e}if(p(n,"validator")&&h(n.validator)){const e=d,o=[];if(d=e=>{o.push(e);},i=n.validator(t),d=e,!i){const e=(o.length>1?"* ":"")+o.join("\n* ");return o.length=0,!1===r?(d(e),i):e}}return i}function j(e,t){const r=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?(p(this,"default")&&delete this.default,this):h(e)||!0===m(this,e,!0)?(this.default=v(e)?()=>[...e]:c(e)?()=>Object.assign({},e):e,this):(d(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:n}=r;return h(n)&&(r.validator=O(n,r)),r}function _(e,t){const r=j(e,t);return Object.defineProperty(r,"validate",{value(e){return h(this.validator)&&d(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=O(e,this),this}})}function T(e,t,n){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach(r=>{t[r]=Object.getOwnPropertyDescriptor(e,r);}),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!c(n))return o;const{validator:a}=n,s=r(n,i);if(h(a)){let{validator:e}=o;e&&(e=null!==(l=(u=e).__original)&&void 0!==l?l:u),o.validator=O(e?function(t){return e.call(this,t)&&a.call(this,t)}:a,o);}var u,l;return Object.assign(o,s)}function $(e){return e.replace(/^(?!\s*$)/gm," ")}const w=()=>_("any",{}),P=()=>_("function",{type:Function}),x=()=>_("boolean",{type:Boolean}),E=()=>_("string",{type:String}),N=()=>_("number",{type:Number}),q=()=>_("array",{type:Array}),A=()=>_("object",{type:Object}),V=()=>j("integer",{type:Number,validator:e=>y(e)}),S=()=>j("symbol",{validator:e=>"symbol"==typeof e});function D(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return j(e.name||"<<anonymous function>>",{type:null,validator(r){const n=e(r);return n||d(`${this._vueTypes_name} - ${t}`),n}})}function L(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.join('", "')}".`,r=e.reduce((e,t)=>{if(null!=t){const r=t.constructor;-1===e.indexOf(r)&&e.push(r);}return e},[]);return j("oneOf",{type:r.length>0?r:void 0,validator(r){const n=-1!==e.indexOf(r);return n||d(t),n}})}function F(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,r=[];for(let n=0;n<e.length;n+=1){const i=e[n];if(g(i)){if(b(i)&&"oneOf"===i._vueTypes_name&&i.type){r=r.concat(i.type);continue}if(h(i.validator)&&(t=!0),!0===i.type||!i.type){d('oneOfType - invalid usage of "true" or "null" as types.');continue}r=r.concat(i.type);}else r.push(i);}r=r.filter((e,t)=>r.indexOf(e)===t);const n=r.length>0?r:null;return j("oneOfType",t?{type:n,validator(t){const r=[],n=e.some(e=>{const n=m(b(e)&&"oneOf"===e._vueTypes_name?e.type||null:e,t,!0);return "string"==typeof n&&r.push(n),!0===n});return n||d(`oneOfType - provided value does not match any of the ${r.length} passed-in validators:\n${$(r.join("\n"))}`),n}}:{type:n})}function Y(e){return j("arrayOf",{type:Array,validator(t){let r="";const n=t.every(t=>(r=m(e,t,!0),!0===r));return n||d(`arrayOf - value validation error:\n${$(r)}`),n}})}function B(e){return j("instanceOf",{type:e})}function I(e){return j("objectOf",{type:Object,validator(t){let r="";const n=Object.keys(t).every(n=>(r=m(e,t[n],!0),!0===r));return n||d(`objectOf - value validation error:\n${$(r)}`),n}})}function J(e){const t=Object.keys(e),r=t.filter(t=>{var r;return !(null===(r=e[t])||void 0===r||!r.required)}),n=j("shape",{type:Object,validator(n){if(!c(n))return !1;const i=Object.keys(n);if(r.length>0&&r.some(e=>-1===i.indexOf(e))){const e=r.filter(e=>-1===i.indexOf(e));return d(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return i.every(r=>{if(-1===t.indexOf(r))return !0===this._vueTypes_isLoose||(d(`shape - shape definition does not include a "${r}" property. Allowed keys: "${t.join('", "')}".`),!1);const i=m(e[r],n[r],!0);return "string"==typeof i&&d(`shape - "${r}" property validation error:\n ${$(i)}`),!0===i})}});return Object.defineProperty(n,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(n,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),n}const M=["name","validate","getter"],R=/*#__PURE__*/(()=>{var e;return (e=class{static get any(){return w()}static get func(){return P().def(this.defaults.func)}static get bool(){return x().def(this.defaults.bool)}static get string(){return E().def(this.defaults.string)}static get number(){return N().def(this.defaults.number)}static get array(){return q().def(this.defaults.array)}static get object(){return A().def(this.defaults.object)}static get integer(){return V().def(this.defaults.integer)}static get symbol(){return S()}static get nullable(){return {type:null}}static extend(e){if(v(e))return e.forEach(e=>this.extend(e)),this;const{name:t,validate:n=!1,getter:i=!1}=e,o=r(e,M);if(p(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:a}=o;if(b(a))return delete o.type,Object.defineProperty(this,t,i?{get:()=>T(t,a,o)}:{value(...e){const r=T(t,a,o);return r.validator&&(r.validator=r.validator.bind(r,...e)),r}});let s;return s=i?{get(){const e=Object.assign({},o);return n?_(t,e):j(t,e)},enumerable:!0}:{value(...e){const r=Object.assign({},o);let i;return i=n?_(t,r):j(t,r),r.validator&&(i.validator=r.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,s)}}).defaults={},e.sensibleDefaults=void 0,e.config=n,e.custom=D,e.oneOf=L,e.instanceOf=B,e.oneOfType=F,e.arrayOf=Y,e.objectOf=I,e.shape=J,e.utils={validate:(e,t)=>!0===m(t,e,!0),toType:(e,t,r=!1)=>r?_(e,t):j(e,t)},e})();function z(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){var r;return (r=class extends R{static get sensibleDefaults(){return t({},this.defaults)}static set sensibleDefaults(r){this.defaults=!1!==r?t({},!0!==r?r:e):{};}}).defaults=t({},e),r}class C extends(z()){}
38
38
 
39
39
  const timelineProps = () => ({
40
- mode: z.oneOf(['left', 'right']).def('left'),
41
- size: z.oneOf(['normal', 'small']).def('normal'),
42
- labelWidth: z.string.def(''),
40
+ mode: C.oneOf(['left', 'right']).def('left'),
41
+ size: C.oneOf(['normal', 'small']).def('normal'),
42
+ labelWidth: C.string.def(''),
43
43
  });
44
44
  const timelineItemProps = () => ({
45
- color: z.oneOf(['blue', 'red', 'green', 'gray']).def('blue'),
46
- dot: z.any.def(''),
47
- label: z.any.def(''),
45
+ color: C.oneOf(['blue', 'red', 'green', 'gray']).def('blue'),
46
+ dot: C.any.def(''),
47
+ label: C.any.def(''),
48
48
  });
49
49
 
50
50
  var _export_sfc = (sfc, props) => {
@@ -161,6 +161,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
161
161
  });
162
162
  var TimelineItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "timeline-item.vue"]]);
163
163
 
164
+ Timeline.Item = TimelineItem;
164
165
  const BmTimeline = withInstall(Timeline);
165
166
  const BmTimelineItem = withInstall(TimelineItem);
166
167
 
@@ -0,0 +1,2 @@
1
+ export function setup(): void;
2
+ export const teardown: () => import("xhr-mock/lib/XHRMock").XHRMock;
@@ -0,0 +1,7 @@
1
+ export function successRequest({ onSuccess, file }: {
2
+ onSuccess: any;
3
+ file: any;
4
+ }): void;
5
+ export function errorRequest({ onError }: {
6
+ onError: any;
7
+ }): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -40,16 +40,19 @@ const _sfc_main$1 = {
40
40
  isShow: false,
41
41
  openShow: false
42
42
  });
43
- const observer = new IntersectionObserver((entries) => {
44
- entries.forEach((item) => {
45
- if (item.intersectionRatio > 0.3) {
46
- observerDom();
47
- observer.disconnect();
48
- }
49
- });
50
- }, {
51
- threshold: 0.3
52
- });
43
+ const observer = new IntersectionObserver(
44
+ (entries) => {
45
+ entries.forEach((item) => {
46
+ if (item.intersectionRatio > 0.3) {
47
+ observerDom();
48
+ observer.disconnect();
49
+ }
50
+ });
51
+ },
52
+ {
53
+ threshold: 0.3
54
+ }
55
+ );
53
56
  function observerDom() {
54
57
  if (props.line === 1) {
55
58
  if (mySelf.value.scrollWidth > mySelf.value.clientWidth) {
@@ -65,16 +68,20 @@ const _sfc_main$1 = {
65
68
  observer.disconnect();
66
69
  });
67
70
  let mySelf = ref();
68
- watch(() => props.showAlways, function(showAlways) {
69
- if (showAlways)
70
- state.openShow = showAlways;
71
- mySelf.value && observer.unobserve(mySelf.value);
72
- nextTick(function() {
73
- mySelf.value && observer.observe(mySelf.value);
74
- });
75
- }, {
76
- immediate: true
77
- });
71
+ watch(
72
+ () => props.showAlways,
73
+ function(showAlways) {
74
+ if (showAlways)
75
+ state.openShow = showAlways;
76
+ mySelf.value && observer.unobserve(mySelf.value);
77
+ nextTick(function() {
78
+ mySelf.value && observer.observe(mySelf.value);
79
+ });
80
+ },
81
+ {
82
+ immediate: true
83
+ }
84
+ );
78
85
  const handleVisibleChange = (val) => {
79
86
  state.isShow = !state.openShow ? false : val;
80
87
  };
@@ -273,15 +280,25 @@ const _sfc_main = {
273
280
  disabled: false,
274
281
  async customRequest({ file, fileField, data }) {
275
282
  if (file.size > state.extraConfigs.maxSize * 1024 * 1024) {
276
- return methods.uploadError(new Error(props.customErrors?.maxSize || `\u4E0D\u80FD\u4E0A\u4F20\u5927\u4E8E${state.extraConfigs.maxSize}M\u7684\u6587\u4EF6`));
283
+ return methods.uploadError(
284
+ new Error(
285
+ props.customErrors?.maxSize || `\u4E0D\u80FD\u4E0A\u4F20\u5927\u4E8E${state.extraConfigs.maxSize}M\u7684\u6587\u4EF6`
286
+ )
287
+ );
277
288
  }
278
289
  if (Object.keys(state.fileList).length >= state.extraConfigs.maxCount) {
279
- return methods.uploadError(new Error(props.customErrors?.maxCount || `\u4E0D\u80FD\u4E0A\u4F20\u591A\u4E8E${state.extraConfigs.maxCount}\u4E2A\u6587\u4EF6`));
290
+ return methods.uploadError(
291
+ new Error(
292
+ props.customErrors?.maxCount || `\u4E0D\u80FD\u4E0A\u4F20\u591A\u4E8E${state.extraConfigs.maxCount}\u4E2A\u6587\u4EF6`
293
+ )
294
+ );
280
295
  }
281
296
  let name = file.name;
282
297
  let fileFormat = name.split(".").pop();
283
298
  if (!state.uploadConfigs.accept.includes(`.${fileFormat}`)) {
284
- return methods.uploadError(new Error(props.customErrors?.format || `\u4E0D\u80FD\u4E0A\u4F20\u8BE5\u7C7B\u578B\u6587\u4EF6`));
299
+ return methods.uploadError(
300
+ new Error(props.customErrors?.format || `\u4E0D\u80FD\u4E0A\u4F20\u8BE5\u7C7B\u578B\u6587\u4EF6`)
301
+ );
285
302
  }
286
303
  state.fileList[file.uid] = {
287
304
  uid: file.uid,
@@ -378,7 +395,9 @@ const _sfc_main = {
378
395
  async deleteFile(uid) {
379
396
  let targetFile = state.fileList[uid];
380
397
  delete state.fileList[uid];
381
- const index = state.uploadedList.findIndex((ele) => ele.url === targetFile.url);
398
+ const index = state.uploadedList.findIndex(
399
+ (ele) => ele.url === targetFile.url
400
+ );
382
401
  if (index !== -1) {
383
402
  state.uploadedList.splice(index, 1);
384
403
  }
@@ -444,64 +463,78 @@ const _sfc_main = {
444
463
  }
445
464
  },
446
465
  handleReject(e) {
447
- return methods.uploadError(new Error(props.customErrors?.format || `\u4E0D\u80FD\u4E0A\u4F20\u8BE5\u7C7B\u578B\u6587\u4EF6`));
466
+ return methods.uploadError(
467
+ new Error(props.customErrors?.format || `\u4E0D\u80FD\u4E0A\u4F20\u8BE5\u7C7B\u578B\u6587\u4EF6`)
468
+ );
448
469
  }
449
470
  };
450
- watch(() => props.defaultList, function(list) {
451
- if (list?.length) {
452
- list.forEach((item) => {
453
- if (!item.uid) {
454
- item.uid = utils.getuid();
455
- }
456
- });
457
- list.forEach(function(item) {
458
- let uid = item.uid || utils.getuid();
459
- if (!item.url.includes("http") && !item.url.includes(CLOUND_PRE))
460
- item.url = props.cloudReadUrl + item.url;
461
- state.fileList[uid] = {
462
- uid,
463
- name: item.name,
464
- url: item.url,
465
- type: item.type || "png",
466
- progress: 100,
467
- isDoneDeloy: true
468
- };
469
- if (!state.uploadedList.find((item2) => item2.uid === uid)) {
470
- state.uploadedList.push(item);
471
- }
472
- });
473
- } else {
474
- state.fileList = {};
475
- state.uploadedList = [];
471
+ watch(
472
+ () => props.defaultList,
473
+ function(list) {
474
+ if (list?.length) {
475
+ list.forEach((item) => {
476
+ if (!item.uid) {
477
+ item.uid = utils.getuid();
478
+ }
479
+ });
480
+ list.forEach(function(item) {
481
+ let uid = item.uid || utils.getuid();
482
+ if (!item.url.includes("http") && !item.url.includes(CLOUND_PRE))
483
+ item.url = props.cloudReadUrl + item.url;
484
+ state.fileList[uid] = {
485
+ uid,
486
+ name: item.name,
487
+ url: item.url,
488
+ type: item.type || "png",
489
+ progress: 100,
490
+ isDoneDeloy: true
491
+ };
492
+ if (!state.uploadedList.find((item2) => item2.uid === uid)) {
493
+ state.uploadedList.push(item);
494
+ }
495
+ });
496
+ } else {
497
+ state.fileList = {};
498
+ state.uploadedList = [];
499
+ }
500
+ },
501
+ {
502
+ immediate: true
476
503
  }
477
- }, {
478
- immediate: true
479
- });
480
- watch([() => props.uploadProps, () => props.extraProps], function([config, extra]) {
481
- state.uploadConfigs = {
482
- ...state.uploadConfigs,
483
- ...config,
484
- showUploadList: false
485
- };
486
- state.extraConfigs = {
487
- ...state.extraConfigs,
488
- ...extra
489
- };
490
- }, {
491
- immediate: true,
492
- deep: true
493
- });
504
+ );
505
+ watch(
506
+ [() => props.uploadProps, () => props.extraProps],
507
+ function([config, extra]) {
508
+ state.uploadConfigs = {
509
+ ...state.uploadConfigs,
510
+ ...config,
511
+ showUploadList: false
512
+ };
513
+ state.extraConfigs = {
514
+ ...state.extraConfigs,
515
+ ...extra
516
+ };
517
+ },
518
+ {
519
+ immediate: true,
520
+ deep: true
521
+ }
522
+ );
494
523
  const uploadDisabled = computed(() => {
495
524
  if (props.uploadProps.disabled || Object.keys(state.fileList).length >= state.extraConfigs.maxCount) {
496
525
  return true;
497
526
  }
498
527
  return false;
499
528
  });
500
- watch(() => uploadDisabled.value, (value) => {
501
- emit("updateDisabledStatus", value);
502
- }, {
503
- immediate: true
504
- });
529
+ watch(
530
+ () => uploadDisabled.value,
531
+ (value) => {
532
+ emit("updateDisabledStatus", value);
533
+ },
534
+ {
535
+ immediate: true
536
+ }
537
+ );
505
538
  const isUploading = computed(() => {
506
539
  let ret = false;
507
540
  let fileList = state.fileList || {};
@@ -512,11 +545,15 @@ const _sfc_main = {
512
545
  });
513
546
  return ret;
514
547
  });
515
- watch(() => isUploading.value, (value) => {
516
- emit("updateIsUploadingStatus", value);
517
- }, {
518
- immediate: true
519
- });
548
+ watch(
549
+ () => isUploading.value,
550
+ (value) => {
551
+ emit("updateIsUploadingStatus", value);
552
+ },
553
+ {
554
+ immediate: true
555
+ }
556
+ );
520
557
  return {
521
558
  ...toRefs(state),
522
559
  icons,