tsv2-library 0.2.4 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsv2-library",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "author": "fixedassetv2-fe",
5
5
  "license": "ISC",
6
6
  "homepage": "https://github.com/fixedassetv2-fe/tsv2-library#readme",
@@ -51,6 +51,11 @@ export interface TSCalendarProps {
51
51
  * Defines the calendar to use hour picker.
52
52
  */
53
53
  showTime?: boolean;
54
+ /**
55
+ * Formats the hour picker to 12 hour format.
56
+ * @default true
57
+ */
58
+ useTimeFormat?: boolean;
54
59
  }
55
60
 
56
61
  /**
@@ -179,6 +179,24 @@ export interface TSDataTableProps {
179
179
  * An array of table columns for children table.
180
180
  */
181
181
  childrenColumns?: TableColumn[];
182
+ /**
183
+ * Whether show single action option in children table.
184
+ * @default true;
185
+ */
186
+ childrenUseOption?: boolean;
187
+ /**
188
+ * The options that will be visible for each row data in children table.
189
+ *
190
+ * __Provide at least one option to display an Options Menu for each row.__
191
+ *
192
+ * The options menu will be displayed on the right side of the children table row.
193
+ */
194
+ childrenOptions?: MenuOption[];
195
+ /**
196
+ * The key of the data object to use as a unique identifier for chlidren table.
197
+ * @default '_id'
198
+ */
199
+ childrenDataKey?: string;
182
200
  /**
183
201
  * An array of objects to display in the table.
184
202
  */
@@ -280,12 +298,6 @@ export interface TSDataTableProps {
280
298
  * Set the scrollHeight in px
281
299
  */
282
300
  scrollHeight?: string;
283
- /**
284
- * Define the shape of header table is rounded
285
- *
286
- * @default true
287
- */
288
- roundedHeader?: boolean;
289
301
  }
290
302
 
291
303
  export type TSDataTableEmits = {
@@ -293,6 +305,10 @@ export type TSDataTableEmits = {
293
305
  * Emits when option menu button clicked.
294
306
  */
295
307
  'toggleOption': [data: Data];
308
+ /**
309
+ * Emits when option menu button in children table was clicked.
310
+ */
311
+ 'toggleChildrenOption': [data: Data];
296
312
  /**
297
313
  * @deprecated use 'v-model:selected-data' instead.
298
314
  */
@@ -49,7 +49,7 @@ export default {
49
49
  { 'h-full': props.scrollable && props.scrollHeight === 'flex' },
50
50
 
51
51
  // Shape
52
- // 'rounded-lg',
52
+ 'rounded-lg',
53
53
  'rounded-br-none rounded-bl-none',
54
54
  ],
55
55
  }),
@@ -1090,7 +1090,7 @@ export default {
1090
1090
  rowexpansioncell: {
1091
1091
  class: [
1092
1092
  // Spacing
1093
- 'pl-[65px] pt-3',
1093
+ 'px-[64px] pt-3',
1094
1094
 
1095
1095
  // Shape
1096
1096
  'border-b border-solid border-general-100',
@@ -152,6 +152,8 @@ export default {
152
152
  // Font
153
153
  '!text-header-weak text-xs font-medium tracking-[0.02em]',
154
154
 
155
+ 'pr-1.5 -mr-1.5 pb-2 pl-1.5 -ml-1.5 pt-1.5 -mt-1.5',
156
+
155
157
  // Layout
156
158
  'flex flex-col gap-3',
157
159
 
@@ -1,9 +1,9 @@
1
1
  const ringClass = [
2
2
  {
3
- 'ring-1': navigator.userAgent.includes('Firefox'),
4
- 'ring-[0.5px]': !navigator.userAgent.includes('Firefox'),
3
+ 'ring-1 p-[1px]': navigator.userAgent.includes('Firefox'),
4
+ 'ring-[0.5px] p-[0.5px]': !navigator.userAgent.includes('Firefox'),
5
5
  },
6
- 'ring-offset-0',
6
+ 'ring-inset',
7
7
  'ring-general-200 dark:ring-general-200',
8
8
  ]
9
9
 
@@ -14,12 +14,12 @@ export default {
14
14
  'shrink-0',
15
15
  { 'rounded-full': props.rounded},
16
16
  { 'rounded-lg': !props.rounded },
17
+ ...ringClass,
17
18
  ],
18
19
  }),
19
20
  image: ({ props}) => ({
20
21
  class: [
21
22
  'w-full h-full object-cover',
22
- ...ringClass,
23
23
  { 'rounded-full': props.rounded },
24
24
  { 'rounded-lg': !props.rounded },
25
25
  ],
@@ -32,7 +32,6 @@ export default {
32
32
  'inset-0 opacity-0 transition-opacity duration-300',
33
33
  'bg-transparent text-surface-0',
34
34
  'hover:cursor-pointer hover:bg-header-weak hover:opacity-50',
35
- ...ringClass,
36
35
  ],
37
36
  style: 'border-radius: inherit'
38
37
  },
@@ -59,8 +59,12 @@ export default {
59
59
  },
60
60
 
61
61
  // States
62
- 'focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:ring-2 focus-visible:ring-inset',
63
- 'focus-visible:ring-primary-500 dark:focus-visible:ring-primary-500',
62
+ 'focus-visible:outline-none focus-visible:outline-offset-0',
63
+ 'focus-visible:bg-primary-50 dark:focus-visible:bg-primary-50',
64
+ {
65
+ 'focus-visible:border-primary-200 dark:focus-visible:border-primary-200 focus-visible:text-primary-400 dark:focus-visible:text-primary-400 ':
66
+ state.d_activeIndex !== context.index,
67
+ },
64
68
  {
65
69
  // 'hover:bg-surface-0 dark:hover:bg-surface-800/80':
66
70
  // state.d_activeIndex !== context.index,