bm-admin-ui 1.2.29-alpha → 1.2.31-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 (82) hide show
  1. package/es/components/attachment/index.d.ts +1 -1
  2. package/es/components/attachment/src/attachment.vue.d.ts +1 -1
  3. package/es/components/button/index.d.ts +1 -1
  4. package/es/components/button/src/button.vue.d.ts +1 -1
  5. package/es/components/cascader/index.d.ts +1 -1
  6. package/es/components/cascader/src/cascader.vue.d.ts +1 -1
  7. package/es/components/edit-form/index.d.ts +2 -2
  8. package/es/components/edit-form/src/edit-form.vue.d.ts +2 -2
  9. package/es/components/editor/index.d.ts +3 -3
  10. package/es/components/editor/src/editor.vue.d.ts +3 -3
  11. package/es/components/feedback/index.d.ts +12 -12
  12. package/es/components/feedback/src/bmAlert.vue.d.ts +5 -5
  13. package/es/components/feedback/src/bmModal.vue.d.ts +7 -7
  14. package/es/components/flow-designer/index.js +32 -10
  15. package/es/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
  16. package/es/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
  17. package/es/components/form-create/index.js +748 -198
  18. package/es/components/form-designer/index.js +118 -22
  19. package/es/components/over-tooltips/index.d.ts +1 -1
  20. package/es/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
  21. package/es/components/search-filter/index.js +4 -2
  22. package/es/components/staffs-selector/index.d.ts +8 -8
  23. package/es/components/staffs-selector/index.js +2 -2
  24. package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
  25. package/es/components/upload/index.d.ts +1 -1
  26. package/es/components/upload/src/upload.vue.d.ts +1 -1
  27. package/es/utils/index.d.ts +7 -0
  28. package/es/utils/index.js +62 -0
  29. package/es/utils/isNull.js +1 -1
  30. package/lib/components/attachment/index.d.ts +1 -1
  31. package/lib/components/attachment/src/attachment.vue.d.ts +1 -1
  32. package/lib/components/button/index.d.ts +1 -1
  33. package/lib/components/button/src/button.vue.d.ts +1 -1
  34. package/lib/components/cascader/index.d.ts +1 -1
  35. package/lib/components/cascader/src/cascader.vue.d.ts +1 -1
  36. package/lib/components/edit-form/index.d.ts +2 -2
  37. package/lib/components/edit-form/src/edit-form.vue.d.ts +2 -2
  38. package/lib/components/editor/index.d.ts +3 -3
  39. package/lib/components/editor/src/editor.vue.d.ts +3 -3
  40. package/lib/components/feedback/index.d.ts +12 -12
  41. package/lib/components/feedback/src/bmAlert.vue.d.ts +5 -5
  42. package/lib/components/feedback/src/bmModal.vue.d.ts +7 -7
  43. package/lib/components/flow-designer/index.js +32 -10
  44. package/lib/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
  45. package/lib/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
  46. package/lib/components/form-create/index.js +751 -198
  47. package/lib/components/form-designer/index.js +117 -21
  48. package/lib/components/over-tooltips/index.d.ts +1 -1
  49. package/lib/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
  50. package/lib/components/search-filter/index.js +3 -1
  51. package/lib/components/staffs-selector/index.d.ts +8 -8
  52. package/lib/components/staffs-selector/index.js +2 -2
  53. package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
  54. package/lib/components/upload/index.d.ts +1 -1
  55. package/lib/components/upload/src/upload.vue.d.ts +1 -1
  56. package/lib/utils/index.d.ts +7 -0
  57. package/lib/utils/index.js +64 -0
  58. package/lib/utils/isNull.js +1 -1
  59. package/package.json +1 -1
  60. package/theme-chalk/index.css +1 -1
  61. package/types/components/attachment/index.d.ts +1 -1
  62. package/types/components/attachment/src/attachment.vue.d.ts +1 -1
  63. package/types/components/button/index.d.ts +1 -1
  64. package/types/components/button/src/button.vue.d.ts +1 -1
  65. package/types/components/cascader/index.d.ts +1 -1
  66. package/types/components/cascader/src/cascader.vue.d.ts +1 -1
  67. package/types/components/edit-form/index.d.ts +2 -2
  68. package/types/components/edit-form/src/edit-form.vue.d.ts +2 -2
  69. package/types/components/editor/index.d.ts +3 -3
  70. package/types/components/editor/src/editor.vue.d.ts +3 -3
  71. package/types/components/feedback/index.d.ts +12 -12
  72. package/types/components/feedback/src/bmAlert.vue.d.ts +5 -5
  73. package/types/components/feedback/src/bmModal.vue.d.ts +7 -7
  74. package/types/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +14 -0
  75. package/types/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +1 -0
  76. package/types/components/over-tooltips/index.d.ts +1 -1
  77. package/types/components/over-tooltips/src/over-tooltips.vue.d.ts +1 -1
  78. package/types/components/staffs-selector/index.d.ts +8 -8
  79. package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +8 -8
  80. package/types/components/upload/index.d.ts +1 -1
  81. package/types/components/upload/src/upload.vue.d.ts +1 -1
  82. package/types/utils/index.d.ts +7 -0
@@ -682,6 +682,9 @@ const label$e = '数字输入框';
682
682
  const fieldsMap$e = {
683
683
  'title.title': 'title.title',
684
684
  'props.placeholder': 'props.placeholder',
685
+ 'props.precision': 'props.precision',
686
+ 'props.min': 'props.min',
687
+ 'props.addonAfter': 'props.addonAfter',
685
688
  value: 'value',
686
689
  'config.fieldRatio': 'config.fieldRatio',
687
690
  'config.count': 'config.count',
@@ -790,6 +793,9 @@ var numInput = {
790
793
  },
791
794
  props: {
792
795
  placeholder: rule.props.placeholder,
796
+ precision: rule.props.precision,
797
+ min: rule.props.min,
798
+ addonAfter: rule.props.addonAfter,
793
799
  },
794
800
  value: rule.value,
795
801
  config: {
@@ -1308,7 +1314,8 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
1308
1314
  default: vue.withCtx(() => [
1309
1315
  vue.createVNode(vue.unref(antDesignVue.Radio), { value: 0 }, {
1310
1316
  default: vue.withCtx(() => [
1311
- vue.createTextVNode(" \u5F53\u524D\u65F6\u95F4(\u5E74/\u6708/\u65E5) "),
1317
+ vue.createTextVNode(" \u5F53\u524D\u65F6\u95F4"),
1318
+ vue.createCommentVNode(" (\u5E74/\u6708/\u65E5) "),
1312
1319
  vue.createVNode(vue.unref(antDesignVue.Tooltip), null, {
1313
1320
  title: vue.withCtx(() => [
1314
1321
  vue.createTextVNode(" \u83B7\u53D6\u7528\u6237\u5B9E\u9645\u586B\u5199\u65F6\u7684\u65F6\u95F4 ")
@@ -1889,11 +1896,11 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
1889
1896
  emits("mouseleave");
1890
1897
  }
1891
1898
  function emitSetActiveRuleEvt(rule) {
1899
+ if (rule?.config.immutable)
1900
+ return;
1892
1901
  emits("set-active-rule", rule, tableRule.value);
1893
1902
  }
1894
1903
  function handleClick(element) {
1895
- if (element?.config.immutable)
1896
- return;
1897
1904
  emitSetActiveRuleEvt(element);
1898
1905
  }
1899
1906
  function handleUpdate({ newIndex }) {
@@ -2795,7 +2802,7 @@ var materialTemp = {
2795
2802
  const _hoisted_1$7 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-product-info-item__title" }, "\u5546\u54C1\u7F16\u53F7", -1);
2796
2803
  const _hoisted_2$5 = { class: "bm-product-info-item__content" };
2797
2804
  const _hoisted_3$4 = { class: "bm-product-info-item__title" };
2798
- const _hoisted_4$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-product-info-item__content" }, "\u7CFB\u7EDF\u81EA\u52A8\u5E26\u51FA", -1);
2805
+ const _hoisted_4$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bm-product-info-item__content" }, "\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6", -1);
2799
2806
  const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
2800
2807
  __name: "product-info",
2801
2808
  props: ["formCreateInject"],
@@ -3558,10 +3565,6 @@ const formDesignerProps = {
3558
3565
  type: Boolean,
3559
3566
  default: false,
3560
3567
  },
3561
- dragCheckFunc: {
3562
- type: Function,
3563
- default: (underlying_vm) => true,
3564
- },
3565
3568
  formRulePipe: {
3566
3569
  type: Function,
3567
3570
  default: (obj) => obj,
@@ -3570,9 +3573,13 @@ const formDesignerProps = {
3570
3573
  type: Function,
3571
3574
  default: (pushRuleWidget, pushRowWidget, pushTableWidget) => null,
3572
3575
  },
3573
- deleteFormItemCheck: {
3576
+ resetCmpRatio: {
3574
3577
  type: Function,
3575
- default: (targetRule, parentRule) => true,
3578
+ default: (ruleName, parentRuleName) => 0,
3579
+ },
3580
+ dragingCallback: {
3581
+ type: Object,
3582
+ default: () => ({}),
3576
3583
  },
3577
3584
  };
3578
3585
 
@@ -3644,6 +3651,18 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
3644
3651
  });
3645
3652
  var CheckboxSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "checkbox-switch.vue"]]);
3646
3653
 
3654
+ function checkRuleConfigObj(obj) {
3655
+ if (!lodashEs.isObject(obj))
3656
+ return false;
3657
+ const parses = ['icon', 'label', 'name', 'parse', 'props', 'rule'];
3658
+ for (const parse of parses) {
3659
+ if (!obj[parse]) {
3660
+ console.error(`控件配置对象缺少【${parse}】字段,请补充完整`);
3661
+ return false;
3662
+ }
3663
+ }
3664
+ return true;
3665
+ }
3647
3666
  const widgetsTableAccept = {
3648
3667
  [input.name]: input,
3649
3668
  [textarea.name]: textarea,
@@ -3675,8 +3694,20 @@ const widgetNamesRowAccept = [
3675
3694
  shop.name,
3676
3695
  materialType.name,
3677
3696
  ];
3697
+ const tableWidgetsProxy = new Proxy(widgetsTableAccept, {
3698
+ get(target, prop) {
3699
+ return target[String(prop)];
3700
+ },
3701
+ set(target, prop, value) {
3702
+ if (!checkRuleConfigObj(value)) {
3703
+ return false;
3704
+ }
3705
+ target[String(prop)] = value;
3706
+ return true;
3707
+ },
3708
+ });
3678
3709
  function pushTableWidgets(key, config) {
3679
- widgetsTableAccept[key] = config;
3710
+ tableWidgetsProxy[key] = config;
3680
3711
  }
3681
3712
  function pushRowWidgets(key) {
3682
3713
  widgetNamesRowAccept.push(key);
@@ -3701,8 +3732,20 @@ const rules = {
3701
3732
  [shop.name]: shop,
3702
3733
  [materialType.name]: materialType,
3703
3734
  };
3735
+ const rulesProxy = new Proxy(rules, {
3736
+ get(target, prop) {
3737
+ return target[String(prop)];
3738
+ },
3739
+ set(target, prop, value) {
3740
+ if (!checkRuleConfigObj(value)) {
3741
+ return false;
3742
+ }
3743
+ target[String(prop)] = value;
3744
+ return true;
3745
+ },
3746
+ });
3704
3747
  function pushRuleWidgets(key, config) {
3705
- rules[key] = config;
3748
+ rulesProxy[key] = config;
3706
3749
  }
3707
3750
 
3708
3751
  const _hoisted_1$1 = {
@@ -3924,6 +3967,19 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
3924
3967
  department: "\u9664\u201C\u5FC5\u586B\u3001\u9009\u9879\u201D\u5185\u5BB9\u8BBE\u7F6E\u4E0D\u53EF\u4FEE\u6539\uFF0C\u5176\u4ED6\u4FE1\u606F\u53EF\u4FEE\u6539"
3925
3968
  };
3926
3969
  const tabData = typeof props.formRulePipe === "function" ? props.formRulePipe(createTab()) : [];
3970
+ (() => {
3971
+ if (!(tabData instanceof Array)) {
3972
+ console.error("formRulePipe\u5C5E\u6027\u8FD4\u56DE\u53C2\u6570\u7C7B\u578B\u5E94\u4E3AArray");
3973
+ }
3974
+ tabData.some((tab) => {
3975
+ if (!tab["key"] || !tab["tab"] || !tab["menuList"] || !(tab["menuList"] instanceof Array)) {
3976
+ console.error(
3977
+ "\u8BF7\u6B63\u786E\u914D\u7F6EformRulePipe\u8FD4\u56DE\u6570\u7EC4\u7C7B\u578B:{key:string, tab:string, menuList: {name:string, title: string, list: any[]}[]}[]"
3978
+ );
3979
+ return true;
3980
+ }
3981
+ });
3982
+ })();
3927
3983
  typeof props.addWidgetFunc === "function" && props.addWidgetFunc(pushRuleWidgets, pushRowWidgets, pushTableWidgets);
3928
3984
  const activeKey = vue.ref("controlLibrary");
3929
3985
  const widgetFormRules = vue.reactive([]);
@@ -3931,6 +3987,18 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
3931
3987
  const cacheProps = vue.reactive({});
3932
3988
  const fApi = vue.ref();
3933
3989
  const activeParentRule = vue.ref();
3990
+ const defaultCallbackfun = {
3991
+ movingCallback: (config) => true,
3992
+ deleteCallback: (targetRule, parentRule) => true,
3993
+ afterAdded: (targetRule, parentRule) => null,
3994
+ rearrangeCallback: (config) => true
3995
+ };
3996
+ function executeCallback(func) {
3997
+ if (!props.dragingCallback[func] || typeof props.dragingCallback[func] !== "function") {
3998
+ return defaultCallbackfun[func];
3999
+ }
4000
+ return props.dragingCallback[func];
4001
+ }
3934
4002
  const menuList = vue.computed(
3935
4003
  () => tabData.find((tab) => tab.key === activeKey.value)?.menuList
3936
4004
  );
@@ -3963,10 +4031,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
3963
4031
  }
3964
4032
  }
3965
4033
  function moveMenuItem(evt) {
3966
- return props?.dragCheckFunc(evt?.dragged?._underlying_vm_) && checkDragMove(evt);
4034
+ return executeCallback("movingCallback")(
4035
+ evt?.dragged?._underlying_vm_?.config?.config
4036
+ ) && checkDragMove(evt);
3967
4037
  }
3968
4038
  function moveFormItem(evt) {
3969
- return props?.dragCheckFunc(evt?.dragged?._underlying_vm_) && checkDragMove(evt);
4039
+ return executeCallback("rearrangeCallback")(
4040
+ evt?.dragged?._underlying_vm_?.config?.config
4041
+ ) && checkDragMove(evt);
3970
4042
  }
3971
4043
  function handleMenuItemDragStart(evt) {
3972
4044
  const item = evt.item.children[0];
@@ -3990,7 +4062,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
3990
4062
  const rule = makeRule(config);
3991
4063
  const activeParentRuleName = activeParentRule.value?.config?.config?.name;
3992
4064
  if (!widgetNamesRowAccept.includes(config.name) && activeParentRuleName === "row" || !Object.keys(widgetsTableAccept).includes(config.name) && activeParentRuleName === "table") {
3993
- disabledTip(activeParentRule.value.config.config.name);
4065
+ disabledTip(activeParentRule.value?.config?.config?.name);
4066
+ } else if (!executeCallback("movingCallback")(config)) {
4067
+ return;
3994
4068
  } else {
3995
4069
  const index = activeRuleInList.value.findIndex(
3996
4070
  (item) => item.field === activeRule.value.field
@@ -4026,6 +4100,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4026
4100
  }
4027
4101
  function handleFormItemAdd({ newIndex }) {
4028
4102
  const rule = widgetFormRules[newIndex];
4103
+ executeCallback("afterAdded")(rule, void 0);
4029
4104
  dragAdd(rule);
4030
4105
  hideShowDragTip();
4031
4106
  }
@@ -4061,6 +4136,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4061
4136
  return newRule;
4062
4137
  }
4063
4138
  function handleFormItemCopy(rule, parentRule) {
4139
+ if (!executeCallback("movingCallback")(rule.config.config)) {
4140
+ return;
4141
+ }
4064
4142
  const newRule = copyRule(
4065
4143
  rule,
4066
4144
  rule.config.config,
@@ -4069,7 +4147,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4069
4147
  setActiveRule(newRule, parentRule);
4070
4148
  }
4071
4149
  function handleFormItemDelete(targetRule, parentRule) {
4072
- const customerCheck = props.deleteFormItemCheck(targetRule, parentRule);
4150
+ const customerCheck = executeCallback("deleteCallback")(
4151
+ targetRule,
4152
+ parentRule
4153
+ );
4073
4154
  if (!customerCheck) {
4074
4155
  return;
4075
4156
  }
@@ -4089,8 +4170,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4089
4170
  delete cacheProps[targetRule.field];
4090
4171
  if (targetRule.field === activeRule.value.field) {
4091
4172
  const newIndex = Math.min(parentList.length - 1, index);
4092
- if (newIndex >= 0) {
4093
- setActiveRule(parentList[newIndex]);
4173
+ const next = parentList[newIndex];
4174
+ if (newIndex >= 0 && !next?.config?.immutable) {
4175
+ setActiveRule(next);
4094
4176
  } else if (parentRule) {
4095
4177
  setActiveRule(parentRule);
4096
4178
  } else {
@@ -4165,6 +4247,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4165
4247
  });
4166
4248
  }
4167
4249
  function handleWidgetAdd(rule, parentRule) {
4250
+ executeCallback("afterAdded")(rule, parentRule);
4168
4251
  dragAdd(rule, parentRule);
4169
4252
  }
4170
4253
  function handlePropsSetActive(rule) {
@@ -4183,10 +4266,23 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
4183
4266
  if (!parentRuleType) {
4184
4267
  rule.config.fieldRatio = "100%";
4185
4268
  } else if (parentRuleType === WidgetType.RowWidget) {
4186
- const ruleName = rule.config.config.name;
4187
- rule.config.fieldRatio = ruleName === "table" || ruleName === "product" ? 24 : 12;
4269
+ const customRadio = props.resetCmpRatio(
4270
+ rule.config.config.name,
4271
+ parentRuleType
4272
+ );
4273
+ if (customRadio) {
4274
+ rule.config.fieldRatio = customRadio;
4275
+ return;
4276
+ }
4277
+ rule.config.fieldRatio = ["table", "product"].includes(
4278
+ rule.config.config.name
4279
+ ) ? 24 : 12;
4188
4280
  } else if (parentRuleType === WidgetType.TableWidget) {
4189
- rule.config.fieldRatio = "140px";
4281
+ const customRadio = props.resetCmpRatio(
4282
+ rule.config.config.name,
4283
+ parentRuleType
4284
+ );
4285
+ rule.config.fieldRatio = customRadio || "140px";
4190
4286
  }
4191
4287
  }
4192
4288
  function getFormRule() {
@@ -14,7 +14,7 @@ declare const BmOverTooltips: import("bm-admin-ui/es/utils/with-install").SFCWit
14
14
  default: number;
15
15
  };
16
16
  width: {
17
- type: (NumberConstructor | StringConstructor)[];
17
+ type: (StringConstructor | NumberConstructor)[];
18
18
  default: number;
19
19
  };
20
20
  showAlways: {
@@ -14,7 +14,7 @@ declare const _default: {
14
14
  default: number;
15
15
  };
16
16
  width: {
17
- type: (NumberConstructor | StringConstructor)[];
17
+ type: (StringConstructor | NumberConstructor)[];
18
18
  default: number;
19
19
  };
20
20
  showAlways: {
@@ -448,7 +448,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
448
448
  let defaultConfig = {
449
449
  title: "\u786E\u5B9A\u8BBE\u7F6E\u5F53\u524D\u67E5\u8BE2\u6761\u4EF6\u4E3A\u9ED8\u8BA4\u67E5\u8BE2\u5417\uFF1F",
450
450
  okText: "\u786E\u8BA4",
451
- cancelText: "\u53D6\u6D88"
451
+ cancelText: "\u53D6\u6D88",
452
+ centered: true,
453
+ icon: vue.createVNode(iconsVue.ExclamationCircleFilled)
452
454
  };
453
455
  Modal__default["default"].confirm({
454
456
  ...defaultConfig,
@@ -82,8 +82,8 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
82
82
  default: string;
83
83
  };
84
84
  }>> & {
85
- onChange?: ((...args: any[]) => any) | undefined;
86
85
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
86
+ onChange?: ((...args: any[]) => any) | undefined;
87
87
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
88
88
  }>>;
89
89
  emit: (event: "change" | "update:visible" | "update:select", ...args: any[]) => void;
@@ -144,7 +144,7 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
144
144
  type: BooleanConstructor;
145
145
  default: any;
146
146
  };
147
- width: (NumberConstructor | StringConstructor)[];
147
+ width: (StringConstructor | NumberConstructor)[];
148
148
  footer: import("vue-types").VueTypeValidableDef<any>;
149
149
  okText: import("vue-types").VueTypeValidableDef<any>;
150
150
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -290,7 +290,7 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
290
290
  modalRender: import("vue").PropType<(arg: {
291
291
  originVNode: import("ant-design-vue/lib/_util/type").VueNode;
292
292
  }) => import("ant-design-vue/lib/_util/type").VueNode>;
293
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "keyboard" | "confirmLoading" | "closable" | "centered" | "maskClosable" | "forceRender" | "destroyOnClose" | "getContainer" | "bodyStyle" | "maskStyle" | "mask" | "focusTriggerAfterClose">;
293
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "confirmLoading" | "closable" | "centered" | "maskClosable" | "forceRender" | "destroyOnClose" | "getContainer" | "bodyStyle" | "maskStyle" | "mask" | "keyboard" | "focusTriggerAfterClose">;
294
294
  $attrs: {
295
295
  [x: string]: unknown;
296
296
  };
@@ -329,7 +329,7 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
329
329
  type: BooleanConstructor;
330
330
  default: any;
331
331
  };
332
- width: (NumberConstructor | StringConstructor)[];
332
+ width: (StringConstructor | NumberConstructor)[];
333
333
  footer: import("vue-types").VueTypeValidableDef<any>;
334
334
  okText: import("vue-types").VueTypeValidableDef<any>;
335
335
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -534,7 +534,7 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
534
534
  type: BooleanConstructor;
535
535
  default: any;
536
536
  };
537
- width: (NumberConstructor | StringConstructor)[];
537
+ width: (StringConstructor | NumberConstructor)[];
538
538
  footer: import("vue-types").VueTypeValidableDef<any>;
539
539
  okText: import("vue-types").VueTypeValidableDef<any>;
540
540
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -709,7 +709,7 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
709
709
  type: BooleanConstructor;
710
710
  default: any;
711
711
  };
712
- width: (NumberConstructor | StringConstructor)[];
712
+ width: (StringConstructor | NumberConstructor)[];
713
713
  footer: import("vue-types").VueTypeValidableDef<any>;
714
714
  okText: import("vue-types").VueTypeValidableDef<any>;
715
715
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -1043,12 +1043,12 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
1043
1043
  default: string;
1044
1044
  };
1045
1045
  }>> & {
1046
- onChange?: ((...args: any[]) => any) | undefined;
1047
1046
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1047
+ onChange?: ((...args: any[]) => any) | undefined;
1048
1048
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
1049
1049
  }, {
1050
- title: string;
1051
1050
  visible: boolean;
1051
+ title: string;
1052
1052
  mode: string;
1053
1053
  showCount: boolean;
1054
1054
  unitStr: string;
@@ -195,13 +195,13 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
195
195
  value: _ctx.searchVal,
196
196
  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.searchVal = $event),
197
197
  placeholder: "\u8BF7\u8F93\u5165\u59D3\u540D",
198
- onBlur: _ctx.search
198
+ onChange: _ctx.search
199
199
  }, {
200
200
  suffix: vue.withCtx(() => [
201
201
  vue.createVNode(_component_search_outlined, { style: { color: "#9393A3" } })
202
202
  ]),
203
203
  _: 1
204
- }, 8, ["value", "onBlur"]),
204
+ }, 8, ["value", "onChange"]),
205
205
  vue.createElementVNode("div", _hoisted_4$3, [
206
206
  vue.createElementVNode("div", _hoisted_5$3, [
207
207
  vue.withDirectives(vue.createVNode(_component_Checkbox, {
@@ -82,8 +82,8 @@ declare const _default: import("vue").DefineComponent<{
82
82
  default: string;
83
83
  };
84
84
  }>> & {
85
- onChange?: ((...args: any[]) => any) | undefined;
86
85
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
86
+ onChange?: ((...args: any[]) => any) | undefined;
87
87
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
88
88
  }>>;
89
89
  emit: (event: "change" | "update:visible" | "update:select", ...args: any[]) => void;
@@ -144,7 +144,7 @@ declare const _default: import("vue").DefineComponent<{
144
144
  type: BooleanConstructor;
145
145
  default: any;
146
146
  };
147
- width: (NumberConstructor | StringConstructor)[];
147
+ width: (StringConstructor | NumberConstructor)[];
148
148
  footer: import("vue-types").VueTypeValidableDef<any>;
149
149
  okText: import("vue-types").VueTypeValidableDef<any>;
150
150
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -290,7 +290,7 @@ declare const _default: import("vue").DefineComponent<{
290
290
  modalRender: import("vue").PropType<(arg: {
291
291
  originVNode: import("ant-design-vue/lib/_util/type").VueNode;
292
292
  }) => import("ant-design-vue/lib/_util/type").VueNode>;
293
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "keyboard" | "confirmLoading" | "closable" | "centered" | "maskClosable" | "forceRender" | "destroyOnClose" | "getContainer" | "bodyStyle" | "maskStyle" | "mask" | "focusTriggerAfterClose">;
293
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "confirmLoading" | "closable" | "centered" | "maskClosable" | "forceRender" | "destroyOnClose" | "getContainer" | "bodyStyle" | "maskStyle" | "mask" | "keyboard" | "focusTriggerAfterClose">;
294
294
  $attrs: {
295
295
  [x: string]: unknown;
296
296
  };
@@ -329,7 +329,7 @@ declare const _default: import("vue").DefineComponent<{
329
329
  type: BooleanConstructor;
330
330
  default: any;
331
331
  };
332
- width: (NumberConstructor | StringConstructor)[];
332
+ width: (StringConstructor | NumberConstructor)[];
333
333
  footer: import("vue-types").VueTypeValidableDef<any>;
334
334
  okText: import("vue-types").VueTypeValidableDef<any>;
335
335
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -534,7 +534,7 @@ declare const _default: import("vue").DefineComponent<{
534
534
  type: BooleanConstructor;
535
535
  default: any;
536
536
  };
537
- width: (NumberConstructor | StringConstructor)[];
537
+ width: (StringConstructor | NumberConstructor)[];
538
538
  footer: import("vue-types").VueTypeValidableDef<any>;
539
539
  okText: import("vue-types").VueTypeValidableDef<any>;
540
540
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -709,7 +709,7 @@ declare const _default: import("vue").DefineComponent<{
709
709
  type: BooleanConstructor;
710
710
  default: any;
711
711
  };
712
- width: (NumberConstructor | StringConstructor)[];
712
+ width: (StringConstructor | NumberConstructor)[];
713
713
  footer: import("vue-types").VueTypeValidableDef<any>;
714
714
  okText: import("vue-types").VueTypeValidableDef<any>;
715
715
  okType: import("vue").PropType<import("ant-design-vue/lib/button/buttonTypes").LegacyButtonType>;
@@ -1043,12 +1043,12 @@ declare const _default: import("vue").DefineComponent<{
1043
1043
  default: string;
1044
1044
  };
1045
1045
  }>> & {
1046
- onChange?: ((...args: any[]) => any) | undefined;
1047
1046
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1047
+ onChange?: ((...args: any[]) => any) | undefined;
1048
1048
  "onUpdate:select"?: ((...args: any[]) => any) | undefined;
1049
1049
  }, {
1050
- title: string;
1051
1050
  visible: boolean;
1051
+ title: string;
1052
1052
  mode: string;
1053
1053
  showCount: boolean;
1054
1054
  unitStr: string;
@@ -19,7 +19,7 @@ declare const BmUpload: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
19
19
  default: number;
20
20
  };
21
21
  width: {
22
- type: (NumberConstructor | StringConstructor)[];
22
+ type: (StringConstructor | NumberConstructor)[];
23
23
  default: number;
24
24
  };
25
25
  showAlways: {
@@ -19,7 +19,7 @@ declare const _default: {
19
19
  default: number;
20
20
  };
21
21
  width: {
22
- type: (NumberConstructor | StringConstructor)[];
22
+ type: (StringConstructor | NumberConstructor)[];
23
23
  default: number;
24
24
  };
25
25
  showAlways: {
@@ -0,0 +1,7 @@
1
+ declare const utils: {
2
+ confirmModal(content: string | string[], title?: string, type?: string, config?: {}, cate?: string): Promise<unknown>;
3
+ toThousands(num: string | number): string;
4
+ toFixNumHasDefault(value: string | number | undefined, num?: number, isMoney?: boolean, defaultValue?: string): string;
5
+ wait(ms?: number): Promise<void>;
6
+ };
7
+ export default utils;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ant_design_vue_1 = require("ant-design-vue");
4
+ const vue_1 = require("vue");
5
+ const icons_vue_1 = require("@ant-design/icons-vue");
6
+ const utils = {
7
+ confirmModal(content, title = '提示', type = 'info', config = {}, cate = 'confirm') {
8
+ content = content || '确定提交吗?';
9
+ const icon = {
10
+ info: icons_vue_1.InfoCircleFilled,
11
+ warning: icons_vue_1.ExclamationCircleFilled,
12
+ success: icons_vue_1.CheckCircleFilled,
13
+ error: icons_vue_1.CloseCircleFilled,
14
+ };
15
+ const iconStyles = {
16
+ info: 'color:#FF9019;',
17
+ warning: 'color:#FF9019;',
18
+ success: 'color:#29CC7A;',
19
+ error: 'color:#E64C2E;',
20
+ };
21
+ return new Promise((resolve) => {
22
+ ant_design_vue_1.Modal[cate](Object.assign(Object.assign({ class: `bm-confirm-modal bm-confirm-modal-${type}`, closable: false, title, centered: true, icon: (0, vue_1.createVNode)(icon[type], { style: iconStyles[type] }), content: typeof content === 'object'
23
+ ? (0, vue_1.h)('div', { style: 'color:#555;' }, content.map((ele) => {
24
+ return (0, vue_1.h)('p', ele);
25
+ }))
26
+ : (0, vue_1.createVNode)('div', { style: 'color:#555;' }, content) }, config), { onOk() {
27
+ resolve(true);
28
+ },
29
+ onCancel() {
30
+ resolve(false);
31
+ } }));
32
+ });
33
+ },
34
+ toThousands(num) {
35
+ num = String(num);
36
+ if (!/^(\+|-)?(\d+)(\.\d+)?$/.test(num)) {
37
+ return num;
38
+ }
39
+ let a = RegExp.$1;
40
+ let b = RegExp.$2;
41
+ let c = RegExp.$3;
42
+ let re = /(\\d)(\\d{3})(,|$)/;
43
+ re.compile('(\\d)(\\d{3})(,|$)');
44
+ while (re.test(b)) {
45
+ b = b.replace(re, '$1,$2$3');
46
+ }
47
+ return a + '' + b + '' + c;
48
+ },
49
+ toFixNumHasDefault(value, num = 0, isMoney = false, defaultValue = '-') {
50
+ if (value === 0 || value === '0' || value) {
51
+ return ((isMoney ? '¥' : '') +
52
+ (value === 0 || value === '0'
53
+ ? 0
54
+ : this.toThousands(Number(value).toFixed(num))));
55
+ }
56
+ else {
57
+ return defaultValue;
58
+ }
59
+ },
60
+ wait(ms = 0) {
61
+ return new Promise((resolve) => setTimeout(resolve, ms));
62
+ },
63
+ };
64
+ exports.default = utils;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isNull = void 0;
4
4
  function isNull(value) {
5
- return (!value ||
5
+ return ([null, undefined, ''].includes(value) ||
6
6
  (Array.isArray(value) && !value.length) ||
7
7
  (value.constructor === Object && !Object.keys(value).length));
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bm-admin-ui",
3
- "version": "1.2.29-alpha",
3
+ "version": "1.2.31-alpha",
4
4
  "private": false,
5
5
  "description": "An Admin Component Library for Bm",
6
6
  "license": "UNLICENSED",