@dao-style/core 0.2.1 → 0.2.4

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.
@@ -1,8 +1,8 @@
1
1
  import type { PropType, defineComponent } from 'vue';
2
2
  export declare type TagType = string | Element['tagName'] | ReturnType<typeof defineComponent>;
3
- export declare const TextButtonType: readonly ["default", "action", "link"];
3
+ export declare const textButtonType: readonly ["default", "action", "link", "custom"];
4
4
  declare type ThePropType = {
5
- type: typeof TextButtonType[number];
5
+ type: typeof textButtonType[number];
6
6
  icon?: string;
7
7
  };
8
8
  declare const _default: {
@@ -5,7 +5,7 @@ declare const _default: import("vue").DefineComponent<{
5
5
  };
6
6
  prop: {
7
7
  type: import("vue").PropType<{
8
- type: "link" | "default" | "action";
8
+ type: "link" | "default" | "custom" | "action";
9
9
  icon?: string | undefined;
10
10
  }>;
11
11
  default: () => {
@@ -20,13 +20,13 @@ declare const _default: import("vue").DefineComponent<{
20
20
  } & {
21
21
  tag: string;
22
22
  prop: {
23
- type: "link" | "default" | "action";
23
+ type: "link" | "default" | "custom" | "action";
24
24
  icon?: string | undefined;
25
25
  };
26
26
  } & {}>, {
27
27
  tag: string;
28
28
  prop: {
29
- type: "link" | "default" | "action";
29
+ type: "link" | "default" | "custom" | "action";
30
30
  icon?: string | undefined;
31
31
  };
32
32
  }>;
@@ -3764,7 +3764,7 @@ function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
3764
3764
  return openBlock(), createElementBlock("div", {
3765
3765
  class: normalizeClass([
3766
3766
  "dao-form",
3767
- { "dao-form__vertical": _ctx.type === "vertical" }
3767
+ "dao-form__" + _ctx.type
3768
3768
  ])
3769
3769
  }, [
3770
3770
  renderSlot(_ctx.$slots, "default", { classNames: {
@@ -5520,7 +5520,7 @@ const _sfc_main$j = defineComponent({
5520
5520
  provide("onSelect", onSelect);
5521
5521
  provide("remove", remove);
5522
5522
  provide("selectState", state);
5523
- watch(modelValue, () => checkUpdatedOption());
5523
+ watch(modelValue, () => checkUpdatedOption(), { deep: true });
5524
5524
  const bindTriggerEleOutsideClick = {
5525
5525
  cleanup: void 0,
5526
5526
  visible() {
@@ -5620,6 +5620,9 @@ const _sfc_main$j = defineComponent({
5620
5620
  }
5621
5621
  }
5622
5622
  };
5623
+ onBeforeUnmount(() => {
5624
+ provide("remove", null);
5625
+ });
5623
5626
  return {
5624
5627
  popper: popper2,
5625
5628
  searchInput,
@@ -5779,7 +5782,6 @@ const _sfc_main$i = defineComponent({
5779
5782
  const optionRef = ref(null);
5780
5783
  const addFn = inject("add");
5781
5784
  const onSelectFn = inject("onSelect");
5782
- const removeFn = inject("remove");
5783
5785
  const selectState = inject("selectState");
5784
5786
  const { label, disabled, value } = toRefs(props);
5785
5787
  const labelValue = computed(() => {
@@ -5826,6 +5828,7 @@ const _sfc_main$i = defineComponent({
5826
5828
  }
5827
5829
  onBeforeUnmount(() => {
5828
5830
  var _a2;
5831
+ const removeFn = inject("remove");
5829
5832
  if (typeof removeFn === "function") {
5830
5833
  const index2 = (_a2 = selectState == null ? void 0 : selectState.options.indexOf(instance)) != null ? _a2 : -1;
5831
5834
  removeFn(index2);
@@ -6923,10 +6926,11 @@ const _sfc_main$a = defineComponent({
6923
6926
  }
6924
6927
  }
6925
6928
  };
6926
- watch([() => props.data, () => selectedRowsModel], handleSelectedRows, {
6927
- immediate: true
6929
+ watch([() => props.data, selectedRowsModel], handleSelectedRows, {
6930
+ immediate: true,
6931
+ deep: true
6928
6932
  });
6929
- watch([() => selectedRowsSet, () => selectableRows], () => {
6933
+ watch([selectedRowsSet, selectableRows], () => {
6930
6934
  let have = 0;
6931
6935
  let notHave = 0;
6932
6936
  for (let i = 0; i < props.data.length; i += 1) {
@@ -6953,7 +6957,8 @@ const _sfc_main$a = defineComponent({
6953
6957
  selectedRowsModel.value.splice(0, selectedRowsModel.value.length, ...Array.from(selectedRowsSet));
6954
6958
  }, {
6955
6959
  deep: true,
6956
- immediate: true
6960
+ immediate: true,
6961
+ flush: "post"
6957
6962
  });
6958
6963
  const expandedRows = reactive(new WeakSet());
6959
6964
  const columnRefs = reactive({});
@@ -8138,7 +8143,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
8138
8143
  ]);
8139
8144
  }
8140
8145
  var toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3]]);
8141
- const TextButtonType = ["default", "action", "link"];
8146
+ const textButtonType = ["default", "action", "link", "custom"];
8142
8147
  var TextButtonProps = {
8143
8148
  tag: {
8144
8149
  type: [Object, String],
@@ -8162,7 +8167,7 @@ const _sfc_main$3 = defineComponent({
8162
8167
  const prop = toRef(props, "prop");
8163
8168
  const computedType = computed(() => {
8164
8169
  var _a2;
8165
- return ((_a2 = prop.value) == null ? void 0 : _a2.type) && TextButtonType.includes(prop.value.type) ? prop.value.type : "custom";
8170
+ return ((_a2 = prop.value) == null ? void 0 : _a2.type) && textButtonType.includes(prop.value.type) ? prop.value.type : "custom";
8166
8171
  });
8167
8172
  const componentComputed = computed(() => ({
8168
8173
  class: [