@caido-utils/components 0.5.0 → 0.5.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.
@@ -4,7 +4,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_With
4
4
  field: string;
5
5
  header: string;
6
6
  sortable?: boolean;
7
- style?: Record<string, string>;
7
+ width?: string;
8
8
  }[];
9
9
  rowHeight?: number;
10
10
  selectable?: boolean | "single" | "multiple";
@@ -27,7 +27,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_With
27
27
  field: string;
28
28
  header: string;
29
29
  sortable?: boolean;
30
- style?: Record<string, string>;
30
+ width?: string;
31
31
  }[];
32
32
  rowHeight?: number;
33
33
  selectable?: boolean | "single" | "multiple";
@@ -45,11 +45,11 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_With
45
45
  loading: boolean;
46
46
  loadingRows: number;
47
47
  }>>>, {
48
- loading: boolean;
49
48
  rowHeight: number;
50
49
  selectable: boolean | "single" | "multiple";
51
50
  selection: Record<string, unknown>[] | null;
52
51
  activeRow: Record<string, unknown> | null;
52
+ loading: boolean;
53
53
  loadingRows: number;
54
54
  }, {}>, {
55
55
  [x: string]: ((props: {
@@ -22,7 +22,7 @@ type ColumnDef = {
22
22
  field: string;
23
23
  header: string;
24
24
  sortable?: boolean;
25
- style?: Record<string, string>;
25
+ width?: string;
26
26
  };
27
27
 
28
28
  const props = withDefaults(
@@ -265,7 +265,7 @@ const columnPt = {
265
265
  stripedRows
266
266
  :virtualScrollerOptions="{ itemSize: props.rowHeight }"
267
267
  resizableColumns
268
- columnResizeMode="fit"
268
+ columnResizeMode="expand"
269
269
  rowHover
270
270
  :rowClass="activeRowClass"
271
271
  :pt="tablePt"
@@ -291,7 +291,7 @@ const columnPt = {
291
291
  :field="col.field"
292
292
  :header="col.header"
293
293
  :sortable="col.sortable"
294
- :style="{ height: `${props.rowHeight}px`, ...col.style }"
294
+ :style="col.width ? { height: `${props.rowHeight}px`, width: col.width, minWidth: col.width, maxWidth: col.width } : { height: `${props.rowHeight}px` }"
295
295
  :pt="columnPt"
296
296
  >
297
297
  <template v-if="col.sortable" #sorticon="{ sorted, sortOrder }">
@@ -303,10 +303,10 @@ const columnPt = {
303
303
  ]"
304
304
  />
305
305
  </template>
306
- <template #body="{ data }">
306
+ <template v-if="loading || $slots[`cell-${col.field}`]" #body="{ data }">
307
307
  <Skeleton v-if="loading" />
308
308
  <slot
309
- v-else-if="$slots[`cell-${col.field}`]"
309
+ v-else
310
310
  :name="`cell-${col.field}`"
311
311
  :item="data"
312
312
  :value="data[col.field]"
@@ -4,7 +4,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_With
4
4
  field: string;
5
5
  header: string;
6
6
  sortable?: boolean;
7
- style?: Record<string, string>;
7
+ width?: string;
8
8
  }[];
9
9
  rowHeight?: number;
10
10
  selectable?: boolean | "single" | "multiple";
@@ -27,7 +27,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_With
27
27
  field: string;
28
28
  header: string;
29
29
  sortable?: boolean;
30
- style?: Record<string, string>;
30
+ width?: string;
31
31
  }[];
32
32
  rowHeight?: number;
33
33
  selectable?: boolean | "single" | "multiple";
@@ -45,11 +45,11 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<__VLS_With
45
45
  loading: boolean;
46
46
  loadingRows: number;
47
47
  }>>>, {
48
- loading: boolean;
49
48
  rowHeight: number;
50
49
  selectable: boolean | "single" | "multiple";
51
50
  selection: Record<string, unknown>[] | null;
52
51
  activeRow: Record<string, unknown> | null;
52
+ loading: boolean;
53
53
  loadingRows: number;
54
54
  }, {}>, {
55
55
  [x: string]: ((props: {
@@ -10,8 +10,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
10
10
  placeholder: string;
11
11
  loading: boolean;
12
12
  }>>>, {
13
- placeholder: string;
14
13
  loading: boolean;
14
+ placeholder: string;
15
15
  }, {}>;
16
16
  export default _default;
17
17
  type __VLS_WithDefaults<P, D> = {
@@ -10,8 +10,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
10
10
  placeholder: string;
11
11
  loading: boolean;
12
12
  }>>>, {
13
- placeholder: string;
14
13
  loading: boolean;
14
+ placeholder: string;
15
15
  }, {}>;
16
16
  export default _default;
17
17
  type __VLS_WithDefaults<P, D> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caido-utils/components",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"