@fastkit/vui 0.12.4 → 0.12.6

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.
package/dist/vui.d.ts CHANGED
@@ -1124,13 +1124,13 @@ export declare interface DataTableCellSlotPayload<T extends DataTableItem = Data
1124
1124
 
1125
1125
  export declare type DataTableDefaults = typeof DATA_TABLE_DEFAULTS;
1126
1126
 
1127
- export declare interface DataTableHeader {
1127
+ export declare interface DataTableHeader<T extends DataTableItem = DataTableItem> {
1128
1128
  key: number | string;
1129
1129
  label?: VNodeChild | ((vui: VuiService) => VNodeChild);
1130
1130
  sortQuery?: string;
1131
- hidden?: boolean;
1131
+ hidden?: boolean | (() => boolean);
1132
1132
  align?: DataTableHeaderAlign;
1133
- cell?: (payload: DataTableCellSlotPayload) => VNodeChild;
1133
+ cell?: (payload: DataTableCellSlotPayload<T>) => VNodeChild;
1134
1134
  }
1135
1135
 
1136
1136
  export declare type DataTableHeaderAlign = 'left' | 'center' | 'right';
@@ -3360,7 +3360,7 @@ export declare const VButton: DefineComponent<{
3360
3360
  ariaCurrentValue: "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined;
3361
3361
  }>;
3362
3362
 
3363
- export declare type VButtonAlign = typeof BUTTON_ALIGNS[number];
3363
+ export declare type VButtonAlign = (typeof BUTTON_ALIGNS)[number];
3364
3364
 
3365
3365
  export declare const VButtonGroup: DefineComponent<{
3366
3366
  disabled: BooleanConstructor;
@@ -4368,7 +4368,7 @@ export declare const VDataTable: DefineComponent<{
4368
4368
  default: () => number;
4369
4369
  };
4370
4370
  headers: {
4371
- type: PropType<DataTableHeader[]>;
4371
+ type: PropType<DataTableHeader<DataTableItem>[]>;
4372
4372
  required: true;
4373
4373
  };
4374
4374
  items: {
@@ -4456,7 +4456,7 @@ export declare const VDataTable: DefineComponent<{
4456
4456
  default: () => number;
4457
4457
  };
4458
4458
  headers: {
4459
- type: PropType<DataTableHeader[]>;
4459
+ type: PropType<DataTableHeader<DataTableItem>[]>;
4460
4460
  required: true;
4461
4461
  };
4462
4462
  items: {
package/dist/vui.mjs CHANGED
@@ -4567,7 +4567,9 @@ const VDataTable = /* @__PURE__ */ defineComponent({
4567
4567
  key: SELECTABLE_HEADER_SYMBOL
4568
4568
  });
4569
4569
  }
4570
- ret.push(...headers.filter(h => !h.hidden));
4570
+ ret.push(...headers.filter(({
4571
+ hidden
4572
+ }) => !(typeof hidden === 'function' ? hidden() : hidden)));
4571
4573
  return ret;
4572
4574
  });
4573
4575
  const searchQueryValues = computed(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastkit/vui",
3
- "version": "0.12.4",
3
+ "version": "0.12.6",
4
4
  "description": "A simple, extensible UI kit for Vue applications.",
5
5
  "buildOptions": {
6
6
  "name": "Vui",
@@ -59,11 +59,11 @@
59
59
  "vue": "^3.2.45"
60
60
  },
61
61
  "dependencies": {
62
- "@fastkit/color-scheme": "0.12.4",
63
- "@fastkit/icon-font": "0.12.4",
64
- "@fastkit/tiny-logger": "0.12.4",
65
- "@fastkit/vite-kit": "0.12.4",
66
- "@fastkit/vue-kit": "0.12.4",
62
+ "@fastkit/color-scheme": "0.12.6",
63
+ "@fastkit/icon-font": "0.12.6",
64
+ "@fastkit/tiny-logger": "0.12.6",
65
+ "@fastkit/vite-kit": "0.12.6",
66
+ "@fastkit/vue-kit": "0.12.6",
67
67
  "@tiptap/extension-link": "^2.0.0-beta.209",
68
68
  "@tiptap/extension-text-style": "^2.0.0-beta.209",
69
69
  "@tiptap/extension-underline": "^2.0.0-beta.209",
@@ -32,7 +32,7 @@ export type RawVButtonIcon = IconName | VButtonIcon;
32
32
 
33
33
  export const BUTTON_ALIGNS = ['left', 'center', 'right'] as const;
34
34
 
35
- export type VButtonAlign = typeof BUTTON_ALIGNS[number];
35
+ export type VButtonAlign = (typeof BUTTON_ALIGNS)[number];
36
36
 
37
37
  function resolveRawVButtonIcon(
38
38
  raw?: RawVButtonIcon,
@@ -79,13 +79,13 @@ export interface DataTableCellSlotPayload<
79
79
  selected: boolean;
80
80
  }
81
81
 
82
- export interface DataTableHeader {
82
+ export interface DataTableHeader<T extends DataTableItem = DataTableItem> {
83
83
  key: number | string;
84
84
  label?: VNodeChild | ((vui: VuiService) => VNodeChild);
85
85
  sortQuery?: string;
86
- hidden?: boolean;
86
+ hidden?: boolean | (() => boolean);
87
87
  align?: DataTableHeaderAlign;
88
- cell?: (payload: DataTableCellSlotPayload) => VNodeChild;
88
+ cell?: (payload: DataTableCellSlotPayload<T>) => VNodeChild;
89
89
  }
90
90
 
91
91
  const SELECTABLE_HEADER_SYMBOL = '__selectable_header__';
@@ -207,7 +207,11 @@ export const VDataTable = defineComponent({
207
207
  key: SELECTABLE_HEADER_SYMBOL,
208
208
  });
209
209
  }
210
- ret.push(...headers.filter((h) => !h.hidden));
210
+ ret.push(
211
+ ...headers.filter(
212
+ ({ hidden }) => !(typeof hidden === 'function' ? hidden() : hidden),
213
+ ),
214
+ );
211
215
  return ret;
212
216
  });
213
217