@blueking/ediatable 0.0.1-beta.28 → 0.0.1-beta.29

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.
@@ -539,6 +539,26 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
539
539
  align-items: center;
540
540
  cursor: pointer;
541
541
  }
542
+ .bk-ediatable-checkbox {
543
+ position: relative;
544
+ min-height: 42px;
545
+ cursor: pointer;
546
+ background: #fff;
547
+ padding-left: 16px;
548
+ display: flex;
549
+ align-items: center;
550
+ }
551
+ .bk-ediatable-checkbox.is-error {
552
+ background-color: #fff0f1;
553
+ }
554
+ .bk-ediatable-checkbox .error-icon {
555
+ position: absolute;
556
+ top: 14px;
557
+ right: 10px;
558
+ display: flex;
559
+ font-size: 14px;
560
+ color: #ea3636;
561
+ }
542
562
  `;
543
563
  document.head.appendChild(__vite_style__);
544
564
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -8894,7 +8914,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
8894
8914
  const _hoisted_1$6 = ["data-fixed", "data-maxWidth", "data-minWidth", "data-width"];
8895
8915
  const _hoisted_2$2 = { class: "th-cell" };
8896
8916
  const _hoisted_3$1 = { style: { "display": "inline-block", "line-height": "40px", "vertical-align": "top" } };
8897
- const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
8917
+ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
8898
8918
  __name: "head-column",
8899
8919
  props: {
8900
8920
  fixed: { default: void 0 },
@@ -9030,7 +9050,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
9030
9050
  ]),
9031
9051
  vue.createElementVNode("div", _hoisted_3$1, [
9032
9052
  slots.append && !_ctx.renderAppend ? vue.renderSlot(_ctx.$slots, "append", { key: 0 }) : vue.createCommentVNode("v-if", true),
9033
- _ctx.renderAppend ? (vue.openBlock(), vue.createBlock(vue.unref(RenderAppendElement), { key: 1 })) : vue.createCommentVNode("v-if", true)
9053
+ _ctx.renderAppend !== void 0 ? (vue.openBlock(), vue.createBlock(vue.unref(RenderAppendElement), { key: 1 })) : vue.createCommentVNode("v-if", true)
9034
9054
  ])
9035
9055
  ],
9036
9056
  2
@@ -9041,7 +9061,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
9041
9061
  }
9042
9062
  });
9043
9063
  const renderTablekey = Symbol("renderTable");
9044
- const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
9064
+ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
9045
9065
  __name: "ediatable",
9046
9066
  props: {
9047
9067
  theadList: { default: () => [] }
@@ -9104,7 +9124,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
9104
9124
  vue.Fragment,
9105
9125
  { key: 1 },
9106
9126
  vue.renderList(_ctx.theadList, (head, index) => {
9107
- return vue.openBlock(), vue.createBlock(_sfc_main$8, {
9127
+ return vue.openBlock(), vue.createBlock(_sfc_main$9, {
9108
9128
  key: index,
9109
9129
  width: head.width,
9110
9130
  "min-width": head.minWidth,
@@ -9250,7 +9270,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
9250
9270
  key: 0,
9251
9271
  class: "input-error"
9252
9272
  };
9253
- const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
9273
+ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
9254
9274
  __name: "date-time-picker-column",
9255
9275
  props: /* @__PURE__ */ vue.mergeModels({
9256
9276
  placeholder: { default: "" },
@@ -9344,7 +9364,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
9344
9364
  key: 2,
9345
9365
  class: "blur-dispaly-main"
9346
9366
  };
9347
- const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
9367
+ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
9348
9368
  __name: "input-column",
9349
9369
  props: /* @__PURE__ */ vue.mergeModels({
9350
9370
  placeholder: { default: "请输入" },
@@ -9510,7 +9530,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
9510
9530
  };
9511
9531
  }
9512
9532
  });
9513
- const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
9533
+ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
9514
9534
  __name: "fixed-column",
9515
9535
  props: {
9516
9536
  fixed: { default: "right" }
@@ -9539,7 +9559,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
9539
9559
  }
9540
9560
  });
9541
9561
  const _hoisted_1$3 = { class: "bk-ediatable-operation" };
9542
- const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
9562
+ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
9543
9563
  __name: "operation-column",
9544
9564
  props: {
9545
9565
  removeable: { type: Boolean, default: true },
@@ -9564,7 +9584,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
9564
9584
  emits("remove");
9565
9585
  };
9566
9586
  return (_ctx, _cache) => {
9567
- return vue.openBlock(), vue.createBlock(_sfc_main$4, null, {
9587
+ return vue.openBlock(), vue.createBlock(_sfc_main$5, null, {
9568
9588
  default: vue.withCtx(() => [
9569
9589
  vue.createElementVNode("div", _hoisted_1$3, [
9570
9590
  _ctx.showCopy ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -9608,7 +9628,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
9608
9628
  key: 0,
9609
9629
  class: "select-error"
9610
9630
  };
9611
- const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
9631
+ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
9612
9632
  __name: "select-column",
9613
9633
  props: /* @__PURE__ */ vue.mergeModels({
9614
9634
  list: { default: () => [] },
@@ -9622,7 +9642,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
9622
9642
  displayKey: { default: "label" },
9623
9643
  idKey: { default: "value" }
9624
9644
  }, {
9625
- "modelValue": { type: [Number, String, Array, Boolean] },
9645
+ "modelValue": { type: [Boolean, Number, String, Array] },
9626
9646
  "modelModifiers": {}
9627
9647
  }),
9628
9648
  emits: /* @__PURE__ */ vue.mergeModels(["change", "error"], ["update:modelValue"]),
@@ -9770,7 +9790,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
9770
9790
  class: "input-error"
9771
9791
  };
9772
9792
  const _hoisted_2$1 = { style: { "display": "none" } };
9773
- const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
9793
+ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
9774
9794
  __name: "tag-input-column",
9775
9795
  props: /* @__PURE__ */ vue.mergeModels({
9776
9796
  placeholder: { default: "" },
@@ -9938,7 +9958,7 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
9938
9958
  key: 2,
9939
9959
  class: "input-error"
9940
9960
  };
9941
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
9961
+ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
9942
9962
  __name: "text-plain-column",
9943
9963
  props: {
9944
9964
  data: {},
@@ -10013,15 +10033,79 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
10013
10033
  };
10014
10034
  }
10015
10035
  });
10016
- exports2.DateTimePickerColumn = _sfc_main$6;
10017
- exports2.Ediatable = _sfc_main$7;
10018
- exports2.FixedColumn = _sfc_main$4;
10019
- exports2.HeadColumn = _sfc_main$8;
10020
- exports2.InputColumn = _sfc_main$5;
10021
- exports2.OperationColumn = _sfc_main$3;
10022
- exports2.SelectColumn = _sfc_main$2;
10023
- exports2.TagInputColumn = _sfc_main$1;
10024
- exports2.TextPlainColumn = _sfc_main;
10025
- exports2.default = _sfc_main$7;
10036
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
10037
+ __name: "checkbox-column",
10038
+ props: /* @__PURE__ */ vue.mergeModels({
10039
+ rules: { default: void 0 },
10040
+ disabled: { type: Boolean, default: false }
10041
+ }, {
10042
+ "modelValue": { type: Boolean, ...{
10043
+ default: false
10044
+ } },
10045
+ "modelModifiers": {}
10046
+ }),
10047
+ emits: /* @__PURE__ */ vue.mergeModels(["submit", "error"], ["update:modelValue"]),
10048
+ setup(__props, { expose: __expose, emit: __emit }) {
10049
+ const props = __props;
10050
+ const emits = __emit;
10051
+ const modelValue = vue.useModel(__props, "modelValue");
10052
+ const vBkTooltips = bkuiVue.bkTooltips;
10053
+ const { message: errorMessage, validator } = useValidtor(props.rules);
10054
+ const handleChange = (value) => {
10055
+ modelValue.value = value;
10056
+ validator(modelValue.value).then(() => {
10057
+ emits("error", false);
10058
+ emits("submit", value);
10059
+ }).catch(() => emits("error", true));
10060
+ };
10061
+ __expose({
10062
+ getValue() {
10063
+ return validator(modelValue.value).then(() => modelValue.value);
10064
+ }
10065
+ });
10066
+ return (_ctx, _cache) => {
10067
+ return vue.openBlock(), vue.createElementBlock(
10068
+ "div",
10069
+ {
10070
+ class: vue.normalizeClass(["bk-ediatable-checkbox", {
10071
+ "is-error": Boolean(vue.unref(errorMessage))
10072
+ }])
10073
+ },
10074
+ [
10075
+ vue.createVNode(vue.unref(bkuiVue.Checkbox), vue.mergeProps({
10076
+ "model-value": modelValue.value,
10077
+ disabled: _ctx.disabled
10078
+ }, _ctx.$attrs, { onChange: handleChange }), null, 16, ["model-value", "disabled"]),
10079
+ vue.unref(errorMessage) ? vue.withDirectives((vue.openBlock(), vue.createBlock(
10080
+ vue.unref(DbIcon),
10081
+ {
10082
+ key: 0,
10083
+ class: "error-icon",
10084
+ type: "exclamation-fill"
10085
+ },
10086
+ null,
10087
+ 512
10088
+ /* NEED_PATCH */
10089
+ )), [
10090
+ [vue.unref(vBkTooltips), vue.unref(errorMessage)]
10091
+ ]) : vue.createCommentVNode("v-if", true)
10092
+ ],
10093
+ 2
10094
+ /* CLASS */
10095
+ );
10096
+ };
10097
+ }
10098
+ });
10099
+ exports2.CheckboxColumn = _sfc_main;
10100
+ exports2.DateTimePickerColumn = _sfc_main$7;
10101
+ exports2.Ediatable = _sfc_main$8;
10102
+ exports2.FixedColumn = _sfc_main$5;
10103
+ exports2.HeadColumn = _sfc_main$9;
10104
+ exports2.InputColumn = _sfc_main$6;
10105
+ exports2.OperationColumn = _sfc_main$4;
10106
+ exports2.SelectColumn = _sfc_main$3;
10107
+ exports2.TagInputColumn = _sfc_main$2;
10108
+ exports2.TextPlainColumn = _sfc_main$1;
10109
+ exports2.default = _sfc_main$8;
10026
10110
  Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
10027
10111
  });
package/vue3/vue3.css CHANGED
@@ -534,3 +534,23 @@ url("data:application/vnd.ms-fontobject;base64,cAkAAMgIAAABAAIAAAAAAAIABQMAAAAAA
534
534
  align-items: center;
535
535
  cursor: pointer;
536
536
  }
537
+ .bk-ediatable-checkbox {
538
+ position: relative;
539
+ min-height: 42px;
540
+ cursor: pointer;
541
+ background: #fff;
542
+ padding-left: 16px;
543
+ display: flex;
544
+ align-items: center;
545
+ }
546
+ .bk-ediatable-checkbox.is-error {
547
+ background-color: #fff0f1;
548
+ }
549
+ .bk-ediatable-checkbox .error-icon {
550
+ position: absolute;
551
+ top: 14px;
552
+ right: 10px;
553
+ display: flex;
554
+ font-size: 14px;
555
+ color: #ea3636;
556
+ }