@v-c/table 0.0.1 → 0.0.2

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.
@@ -11,8 +11,8 @@ let _v_c_util_dist_props_util = require("@v-c/util/dist/props-util");
11
11
  function useColumnWidth(colWidths, columnCount) {
12
12
  return (0, vue.computed)(() => {
13
13
  const cloneColumns = [];
14
- for (let i = 0; i < columnCount; i += 1) {
15
- const val = colWidths[i];
14
+ for (let i = 0; i < columnCount.value; i += 1) {
15
+ const val = colWidths.value[i];
16
16
  if (val !== void 0) cloneColumns[i] = val;
17
17
  else return null;
18
18
  }
@@ -44,12 +44,13 @@ var FixedHolder = /* @__PURE__ */ (0, vue.defineComponent)({
44
44
  setup(props, { slots, expose }) {
45
45
  const context = require_TableContext.useInjectTableContext();
46
46
  const scrollRef = (0, vue.ref)(null);
47
+ const { colWidths, columCount } = (0, _v_c_util_dist_props_util.toPropsRefs)(props, "colWidths", "columCount");
47
48
  expose({ nativeElement: scrollRef });
48
49
  const TableComponent = (0, vue.computed)(() => context.getComponent(["header", "table"], "table"));
49
50
  const combinationScrollBarSize = (0, vue.computed)(() => {
50
51
  return context.isSticky && !props.fixHeader ? 0 : context.scrollbarSize;
51
52
  });
52
- const mergedColumnWidth = useColumnWidth(props.colWidths, props.columCount);
53
+ const mergedColumnWidth = useColumnWidth(colWidths, columCount);
53
54
  const isColGroupEmpty = (0, vue.computed)(() => {
54
55
  const widths = mergedColumnWidth.value;
55
56
  const noWidth = !widths || !widths.length || widths.every((w) => !w);
@@ -2,12 +2,12 @@ import { useInjectTableContext } from "../context/TableContext.js";
2
2
  import ColGroup_default from "../ColGroup.js";
3
3
  import { computed, createVNode, defineComponent, onBeforeUnmount, onMounted, ref } from "vue";
4
4
  import { clsx } from "@v-c/util";
5
- import { getStylePxValue } from "@v-c/util/dist/props-util";
5
+ import { getStylePxValue, toPropsRefs } from "@v-c/util/dist/props-util";
6
6
  function useColumnWidth(colWidths, columnCount) {
7
7
  return computed(() => {
8
8
  const cloneColumns = [];
9
- for (let i = 0; i < columnCount; i += 1) {
10
- const val = colWidths[i];
9
+ for (let i = 0; i < columnCount.value; i += 1) {
10
+ const val = colWidths.value[i];
11
11
  if (val !== void 0) cloneColumns[i] = val;
12
12
  else return null;
13
13
  }
@@ -39,12 +39,13 @@ var FixedHolder_default = /* @__PURE__ */ defineComponent({
39
39
  setup(props, { slots, expose }) {
40
40
  const context = useInjectTableContext();
41
41
  const scrollRef = ref(null);
42
+ const { colWidths, columCount } = toPropsRefs(props, "colWidths", "columCount");
42
43
  expose({ nativeElement: scrollRef });
43
44
  const TableComponent = computed(() => context.getComponent(["header", "table"], "table"));
44
45
  const combinationScrollBarSize = computed(() => {
45
46
  return context.isSticky && !props.fixHeader ? 0 : context.scrollbarSize;
46
47
  });
47
- const mergedColumnWidth = useColumnWidth(props.colWidths, props.columCount);
48
+ const mergedColumnWidth = useColumnWidth(colWidths, columCount);
48
49
  const isColGroupEmpty = computed(() => {
49
50
  const widths = mergedColumnWidth.value;
50
51
  const noWidth = !widths || !widths.length || widths.every((w) => !w);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/table",
3
3
  "type": "module",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",