@unsource/ui 2.7.8 → 2.7.9

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unsource-ui",
3
3
  "configKey": "unsourceUi",
4
- "version": "2.7.8",
4
+ "version": "2.7.9",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -6,6 +6,7 @@ export type TableCol = {
6
6
  key?: string | string[];
7
7
  subKey?: string | string[];
8
8
  class?: string;
9
+ classHandler?: () => string;
9
10
  dir?: string;
10
11
  isDesktop?: boolean;
11
12
  isMobile?: boolean;
@@ -14,6 +15,7 @@ type __VLS_Props = {
14
15
  cols?: TableCol[];
15
16
  items?: Record<string, unknown>[];
16
17
  thClass?: string;
18
+ trClass?: () => string;
17
19
  tdClass?: string;
18
20
  textClass?: string;
19
21
  boxMode?: boolean;
@@ -73,6 +73,7 @@
73
73
  :level="0"
74
74
  :item="item"
75
75
  :items
76
+ :tr-class
76
77
  :cols="cols"
77
78
  :td-class
78
79
  :text-class
@@ -99,6 +100,7 @@ const { parentKey, idKey, cols = [], items = [], thClass = "bg-gray-100 border-g
99
100
  cols: { type: Array, required: false },
100
101
  items: { type: Array, required: false },
101
102
  thClass: { type: String, required: false },
103
+ trClass: { type: Function, required: false },
102
104
  tdClass: { type: String, required: false },
103
105
  textClass: { type: String, required: false },
104
106
  boxMode: { type: Boolean, required: false },
@@ -6,6 +6,7 @@ export type TableCol = {
6
6
  key?: string | string[];
7
7
  subKey?: string | string[];
8
8
  class?: string;
9
+ classHandler?: () => string;
9
10
  dir?: string;
10
11
  isDesktop?: boolean;
11
12
  isMobile?: boolean;
@@ -14,6 +15,7 @@ type __VLS_Props = {
14
15
  cols?: TableCol[];
15
16
  items?: Record<string, unknown>[];
16
17
  thClass?: string;
18
+ trClass?: () => string;
17
19
  tdClass?: string;
18
20
  textClass?: string;
19
21
  boxMode?: boolean;
@@ -7,6 +7,7 @@ type __VLS_Props = {
7
7
  parentKey?: string;
8
8
  idKey?: string;
9
9
  tdClass?: string;
10
+ trClass?: () => string;
10
11
  level?: number;
11
12
  };
12
13
  type __VLS_ModelProps = {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <tr
3
3
  class="children:p-3 <md:children:p-1 text-center border-b-(2 solid border) hover:bg-primary/10"
4
- :class="{ '!bg-primary/20': selected?.[idKey] === item[idKey] }"
4
+ :class="[trClass?.(item, items), { '!bg-primary/20': selected?.[idKey] === item[idKey] }]"
5
5
  @click="$emit('click:row', item);
6
6
  selected = item"
7
7
  @dbclick="$emit('dbclick:row', item)"
@@ -23,7 +23,7 @@
23
23
  :key="col.name + '-td'"
24
24
  class="text-gray-400 text-sm text-center first:rounded-l-lg last:rounded-r-lg"
25
25
  :style="{ paddingInlineStart: parentKey ? level * 10 + 5 + 'px' : 'unset' }"
26
- :class="[col.class, { '<md:hidden': col.isDesktop, 'hidden <md:table-cell': col.isMobile }, tdClass]"
26
+ :class="[col.classHandler?.(item, col, items, cols), col.class, { '<md:hidden': col.isDesktop, 'hidden <md:table-cell': col.isMobile }, tdClass]"
27
27
  :dir="col.dir"
28
28
  >
29
29
  <slot
@@ -68,6 +68,7 @@
68
68
  :id-key
69
69
  :text-class
70
70
  :td-class
71
+ :tr-class
71
72
  @click:row="$emit('click:row', i)"
72
73
  @dbclick:row="$emit('dbclick:row', i)"
73
74
  @add:row="$emit('add:row', i)"
@@ -86,6 +87,7 @@ const { level = 0, parentKey, idKey = "id", item = {}, items = [] } = defineProp
86
87
  parentKey: { type: String, required: false },
87
88
  idKey: { type: String, required: false },
88
89
  tdClass: { type: String, required: false },
90
+ trClass: { type: Function, required: false },
89
91
  level: { type: Number, required: false }
90
92
  });
91
93
  const open = ref(false);
@@ -7,6 +7,7 @@ type __VLS_Props = {
7
7
  parentKey?: string;
8
8
  idKey?: string;
9
9
  tdClass?: string;
10
+ trClass?: () => string;
10
11
  level?: number;
11
12
  };
12
13
  type __VLS_ModelProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsource/ui",
3
- "version": "2.7.8",
3
+ "version": "2.7.9",
4
4
  "private": false,
5
5
  "description": "nuxt ui kit for unsource env",
6
6
  "repository": "https://github.com/alisa2142/unsource-ui",