@davincihealthcare/elty-design-system-vue 1.62.0 → 1.63.0

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.
@@ -71,6 +71,7 @@ export type MobileTableFilter = {
71
71
  enabled: boolean;
72
72
  label: string;
73
73
  initialValue?: number;
74
+ placeholder?: string;
74
75
  };
75
76
  resetButton?: boolean;
76
77
  managed?: boolean;
@@ -1,25 +1,12 @@
1
- import { ElInputSelect } from '..';
2
- import { DefaultCell } from './ElTableCell.vue';
3
- import { default as ElDropdown } from '../ElDropdown.vue';
4
- import { default as ElIconButton } from '../ElIconButton.vue';
1
+ import { ElTagColor, TableColumnFilterDateRange, TableColumnFilterFreeSearch, TableColumnFilterMultiValue, TableColumnFilterResetButton } from '..';
2
+ import { ActionCell, DefaultCell, TagCell } from './ElTableCell.vue';
5
3
  import { default as ElButton } from '../ElButton.vue';
6
- import { default as ElAvatar } from '../ElAvatar.vue';
7
4
  import { ElIconProps } from '../ElIcon.vue';
8
- import { ElTextCellColor, ElTextCellStyle } from '../ElTextCell.vue';
9
- import { ElTagColor } from '../ElTag.vue';
10
5
  import { ElMobileTableProps, MobileTableRow } from './ElMobileTable.vue';
11
- import { DataRow, FilterType } from './commonTypes';
6
+ import { DataRow } from './commonTypes';
12
7
 
13
8
  export type ResponsiveDataCell = ResponsiveDefaultDataCell | ResponsiveTagDataCell | ResponsiveActionDataCell;
14
- export type ResponsiveDefaultDataCell = {
15
- type?: 'default';
16
- sortableAndFilterableValue?: string;
17
- mainText: string;
18
- mainTextStyle?: ElTextCellStyle;
19
- mainTextColor?: ElTextCellColor;
20
- subText?: string;
21
- avatar?: Pick<InstanceType<typeof ElAvatar>['$props'], 'picture' | 'label'>;
22
- clickAction?: (payload?: PointerEvent) => void;
9
+ export type ResponsiveDefaultDataCell = Omit<DefaultCell, 'mainIcon' | 'subIcon' | 'longText' | 'truncateSubText'> & {
23
10
  desktopBehaviour?: Pick<DefaultCell, 'mainIcon' | 'subIcon' | 'longText' | 'truncateSubText'>;
24
11
  mobileBehaviour?: {
25
12
  tertiaryText?: string;
@@ -27,21 +14,14 @@ export type ResponsiveDefaultDataCell = {
27
14
  timeText?: string;
28
15
  };
29
16
  };
30
- export type ResponsiveTagDataCell = {
17
+ export type ResponsiveTagDataCell = Omit<TagCell, 'subText' | 'truncateSubText' | 'tag'> & {
31
18
  type: 'tag';
32
- text: string;
19
+ text?: string;
33
20
  color?: ElTagColor;
34
- desktopBehaviour?: {
35
- subText?: string;
36
- truncateSubText?: boolean;
37
- };
38
- sortableAndFilterableValue?: string;
21
+ desktopBehaviour?: Pick<TagCell, 'subText' | 'truncateSubText' | 'tag'>;
39
22
  };
40
- export type ResponsiveActionDataCell = {
23
+ export type ResponsiveActionDataCell = ActionCell & {
41
24
  type: 'action';
42
- buttons?: InstanceType<typeof ElButton>['$props'][];
43
- iconButtons?: InstanceType<typeof ElIconButton>['$props'][];
44
- dropdown?: InstanceType<typeof ElDropdown>['$props'];
45
25
  mobileBehaviour?: {
46
26
  primary: InstanceType<typeof ElButton>['$props'];
47
27
  secondary?: InstanceType<typeof ElButton>['$props'];
@@ -58,25 +38,7 @@ export type ResponsiveDataRow<T = any> = {
58
38
  };
59
39
  export type ResponsiveTableColumn = {
60
40
  title: string;
61
- filter?: {
62
- type: Extract<FilterType, 'FREE_SEARCH'>;
63
- initialValue?: string;
64
- } | {
65
- type: Extract<FilterType, 'DATE_RANGE'>;
66
- initialValue?: number;
67
- } | {
68
- type: Extract<FilterType, 'MULTI_VALUE'>;
69
- selectOptions: InstanceType<typeof ElInputSelect>['$props']['options'];
70
- initialValue?: string;
71
- mobileBehaviour?: {
72
- /**
73
- * Used only if filter type === 'MULTI_VALUE' and column.mobileBehaviour.position is an array
74
- */
75
- position?: 'mainText' | 'secondaryRow' | 'tertiaryRow' | 'amount' | 'time' | 'tags' | 'avatar';
76
- };
77
- } | {
78
- type: 'RESET_FILTERS_BUTTON';
79
- };
41
+ filter?: ResponiveTableColumnFilter;
80
42
  desktopBehaviour?: {
81
43
  alignRight?: boolean;
82
44
  noSort?: boolean;
@@ -92,6 +54,14 @@ export type ResponsiveTableColumn = {
92
54
  })[];
93
55
  };
94
56
  };
57
+ export type ResponiveTableColumnFilter = TableColumnFilterFreeSearch | TableColumnFilterDateRange | (TableColumnFilterMultiValue & {
58
+ mobileBehaviour?: {
59
+ /**
60
+ * Used only if filter type === 'MULTI_VALUE' and column.mobileBehaviour.position is an array
61
+ */
62
+ position?: 'mainText' | 'secondaryRow' | 'tertiaryRow' | 'amount' | 'time' | 'tags' | 'avatar';
63
+ };
64
+ }) | TableColumnFilterResetButton;
95
65
  export interface ElResponsiveTableProps {
96
66
  columns: ResponsiveTableColumn[];
97
67
  data: ResponsiveDataRow[];
@@ -36,16 +36,16 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToRu
36
36
  relatedObject?: any;
37
37
  cells: ({
38
38
  type?: "default" | undefined;
39
- sortableAndFilterableValue?: string | undefined;
40
- mainText: string;
41
- mainTextStyle?: ElTextCellStyle | undefined;
42
- mainTextColor?: ElTextCellColor | undefined;
43
- subText?: string | undefined;
44
39
  avatar?: {
45
40
  label?: string | undefined;
46
41
  picture?: string | undefined;
47
42
  } | undefined;
43
+ mainTextColor?: ElTextCellColor | undefined;
44
+ mainTextStyle?: ElTextCellStyle | undefined;
48
45
  clickAction?: ((payload?: PointerEvent) => void) | undefined;
46
+ subText?: string | undefined;
47
+ sortableAndFilterableValue?: string | undefined;
48
+ mainText: string;
49
49
  desktopBehaviour?: {
50
50
  mainIcon?: {
51
51
  name: import('..').IconNames;
@@ -69,13 +69,43 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToRu
69
69
  } | undefined;
70
70
  } | {
71
71
  type: "tag";
72
- text: string;
72
+ sortableAndFilterableValue?: string | undefined;
73
+ text?: string | undefined;
73
74
  color?: import('..').ElTagColor | undefined;
74
75
  desktopBehaviour?: {
76
+ tag: {
77
+ color?: import('..').ElTagColor | undefined;
78
+ size?: import('..').ElTagSize | undefined;
79
+ leadingIcon?: {
80
+ name: import('..').IconNames;
81
+ solid?: boolean | undefined;
82
+ cursorPointer?: boolean | undefined;
83
+ disabled?: boolean | undefined;
84
+ } | undefined;
85
+ trailingIcon?: {
86
+ name: import('..').IconNames;
87
+ solid?: boolean | undefined;
88
+ cursorPointer?: boolean | undefined;
89
+ disabled?: boolean | undefined;
90
+ } | undefined;
91
+ outlined?: boolean | undefined;
92
+ style?: unknown;
93
+ readonly text: string;
94
+ class?: unknown;
95
+ key?: (string | number | symbol) | undefined;
96
+ ref?: any;
97
+ ref_for?: boolean | undefined;
98
+ ref_key?: string | undefined;
99
+ onVnodeBeforeMount?: (((vnode: import('vue').VNode) => void) | ((vnode: import('vue').VNode) => void)[]) | undefined;
100
+ onVnodeMounted?: (((vnode: import('vue').VNode) => void) | ((vnode: import('vue').VNode) => void)[]) | undefined;
101
+ onVnodeBeforeUpdate?: (((vnode: import('vue').VNode, oldVNode: import('vue').VNode) => void) | ((vnode: import('vue').VNode, oldVNode: import('vue').VNode) => void)[]) | undefined;
102
+ onVnodeUpdated?: (((vnode: import('vue').VNode, oldVNode: import('vue').VNode) => void) | ((vnode: import('vue').VNode, oldVNode: import('vue').VNode) => void)[]) | undefined;
103
+ onVnodeBeforeUnmount?: (((vnode: import('vue').VNode) => void) | ((vnode: import('vue').VNode) => void)[]) | undefined;
104
+ onVnodeUnmounted?: (((vnode: import('vue').VNode) => void) | ((vnode: import('vue').VNode) => void)[]) | undefined;
105
+ };
75
106
  subText?: string | undefined;
76
107
  truncateSubText?: boolean | undefined;
77
108
  } | undefined;
78
- sortableAndFilterableValue?: string | undefined;
79
109
  } | {
80
110
  type: "action";
81
111
  buttons?: {
@@ -108,6 +138,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToRu
108
138
  onVnodeBeforeUnmount?: (((vnode: import('vue').VNode) => void) | ((vnode: import('vue').VNode) => void)[]) | undefined;
109
139
  onVnodeUnmounted?: (((vnode: import('vue').VNode) => void) | ((vnode: import('vue').VNode) => void)[]) | undefined;
110
140
  readonly iconRight?: boolean | undefined;
141
+ id?: string | undefined;
111
142
  }[] | undefined;
112
143
  iconButtons?: {
113
144
  disabled?: boolean | undefined;
@@ -136,6 +167,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToRu
136
167
  cursorPointer?: boolean | undefined;
137
168
  disabled?: boolean | undefined;
138
169
  };
170
+ id?: string | undefined;
139
171
  }[] | undefined;
140
172
  dropdown?: {
141
173
  title?: string | undefined;
@@ -247,7 +279,9 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToRu
247
279
  }[];
248
280
  "onClick:action"?: (() => any) | undefined;
249
281
  "onUpdate:is-open"?: ((isOpen: boolean) => any) | undefined;
282
+ disabled?: boolean | undefined;
250
283
  } | undefined;
284
+ sortableAndFilterableValue?: string | undefined;
251
285
  mobileBehaviour?: {
252
286
  primary: {
253
287
  disabled?: boolean | undefined;
@@ -3,24 +3,32 @@ import { default as ElInputSelect } from '../forms/ElInputSelect.vue';
3
3
 
4
4
  export interface TableColumn {
5
5
  title: string;
6
- filter?: {
7
- type: Extract<FilterType, 'FREE_SEARCH'>;
8
- placeholder?: string;
9
- initialValue?: string;
10
- } | {
11
- type: Extract<FilterType, 'DATE_RANGE'>;
12
- placeholder?: string;
13
- initialValue?: number;
14
- } | {
15
- type: Extract<FilterType, 'MULTI_VALUE'>;
16
- selectOptions: InstanceType<typeof ElInputSelect>['$props']['options'];
17
- initialValue?: string;
18
- } | {
19
- type: 'RESET_FILTERS_BUTTON';
20
- };
6
+ filter?: TableColumnFilter;
21
7
  alignRight?: boolean;
22
8
  noSort?: boolean;
23
9
  }
10
+ export type TableColumnFilter = TableColumnFilterFreeSearch | TableColumnFilterDateRange | TableColumnFilterMultiValue | TableColumnFilterResetButton;
11
+ export type TableColumnFilterFreeSearch = {
12
+ id?: string;
13
+ type: Extract<FilterType, 'FREE_SEARCH'>;
14
+ placeholder?: string;
15
+ initialValue?: string;
16
+ };
17
+ export type TableColumnFilterDateRange = {
18
+ id?: string;
19
+ type: Extract<FilterType, 'DATE_RANGE'>;
20
+ placeholder?: string;
21
+ initialValue?: number;
22
+ };
23
+ export type TableColumnFilterMultiValue = {
24
+ id?: string;
25
+ type: Extract<FilterType, 'MULTI_VALUE'>;
26
+ selectOptions: InstanceType<typeof ElInputSelect>['$props']['options'];
27
+ initialValue?: string;
28
+ };
29
+ export type TableColumnFilterResetButton = {
30
+ type: 'RESET_FILTERS_BUTTON';
31
+ };
24
32
  export interface DataControls {
25
33
  sortStatus: SortStatus;
26
34
  paginationStatus: {
@@ -49,11 +57,13 @@ export interface ServerSideTableProps {
49
57
  }
50
58
  export type FilterStatus = TextFilterStatus | DateFilterStatus;
51
59
  export type TextFilterStatus = {
60
+ id?: string;
52
61
  textSearch: string;
53
62
  columnTitle: string;
54
63
  type: Extract<FilterType, 'FREE_SEARCH' | 'MULTI_VALUE'>;
55
64
  };
56
65
  export type DateFilterStatus = {
66
+ id?: string;
57
67
  dateFrom: number;
58
68
  columnTitle: string;
59
69
  type: Extract<FilterType, 'DATE_RANGE'>;
@@ -33,11 +33,17 @@ export interface TagCell extends BasicDataCell {
33
33
  subText?: string;
34
34
  truncateSubText?: boolean;
35
35
  }
36
- export interface ActionCell extends BasicDataCell {
36
+ export interface ActionCell<ID extends string = string> extends BasicDataCell {
37
37
  type?: 'action';
38
- buttons?: InstanceType<typeof ElButton>['$props'][];
39
- iconButtons?: InstanceType<typeof ElIconButton>['$props'][];
40
- dropdown?: InstanceType<typeof ElDropdown>['$props'];
38
+ buttons?: (InstanceType<typeof ElButton>['$props'] & {
39
+ id?: ID;
40
+ })[];
41
+ iconButtons?: (InstanceType<typeof ElIconButton>['$props'] & {
42
+ id?: ID;
43
+ })[];
44
+ dropdown?: InstanceType<typeof ElDropdown>['$props'] & {
45
+ disabled?: boolean;
46
+ };
41
47
  }
42
48
  export interface InputCell extends BasicDataCell {
43
49
  type?: 'input';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@davincihealthcare/elty-design-system-vue",
3
- "version": "1.62.0",
3
+ "version": "1.63.0",
4
4
  "license": "UNLICENSED",
5
5
  "main": "dist/index.umd.cjs",
6
6
  "types": "dist/index.d.ts",