@indielayer/ui 1.14.0 → 1.14.1
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/docs/pages/component/table/selectable.vue +2 -1
- package/lib/components/menu/MenuItem.vue.js +1 -1
- package/lib/components/menu/MenuItem.vue2.js +82 -84
- package/lib/components/table/Table.vue.js +256 -255
- package/lib/components/table/TableHeader.vue.d.ts +5 -5
- package/lib/components/table/TableHeader.vue.js +35 -32
- package/lib/components/table/theme/TableHeader.base.theme.js +9 -9
- package/lib/components/table/theme/TableHeader.carbon.theme.js +1 -1
- package/lib/index.js +1 -1
- package/lib/index.umd.js +4 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/components/menu/MenuItem.vue +1 -0
- package/src/components/table/Table.vue +5 -4
- package/src/components/table/TableHeader.vue +6 -4
- package/src/components/table/theme/TableHeader.base.theme.ts +4 -3
- package/src/components/table/theme/TableHeader.carbon.theme.ts +0 -1
- package/src/version.ts +1 -1
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.14.
|
|
1
|
+
declare const _default: "1.14.1";
|
|
2
2
|
export default _default;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -60,6 +60,7 @@ import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
|
60
60
|
|
|
61
61
|
import XIcon from '../../components/icon/Icon.vue'
|
|
62
62
|
import XSpinner from '../../components/spinner/Spinner.vue'
|
|
63
|
+
import XCheckbox from '../../components/checkbox/Checkbox.vue'
|
|
63
64
|
|
|
64
65
|
import type { MenuArrayItem } from './Menu.vue'
|
|
65
66
|
|
|
@@ -87,6 +87,7 @@ import XSkeleton from '../skeleton/Skeleton.vue'
|
|
|
87
87
|
import type { SkeletonShape } from '../skeleton/Skeleton.vue'
|
|
88
88
|
|
|
89
89
|
import XIcon from '../icon/Icon.vue'
|
|
90
|
+
import XCheckbox from '../checkbox/Checkbox.vue'
|
|
90
91
|
|
|
91
92
|
import { chevronDownIcon } from '../../common/icons'
|
|
92
93
|
|
|
@@ -278,14 +279,14 @@ const { styles, classes, className } = useTheme('Table', {}, props)
|
|
|
278
279
|
:class="classes.table"
|
|
279
280
|
>
|
|
280
281
|
<x-table-head :sticky-header="stickyHeader">
|
|
281
|
-
<x-table-header v-if="props.selectable && !props.singleSelect" width="
|
|
282
|
+
<x-table-header v-if="props.selectable && !props.singleSelect" width="40" class="!pl-3.5 !pr-0.5 !py-2.5 cursor-pointer" @click="toggleSelectAll">
|
|
282
283
|
<x-checkbox
|
|
283
284
|
:model-value="allRowsSelected || someRowsSelected"
|
|
284
285
|
:indeterminate="someRowsSelected"
|
|
285
286
|
hide-footer
|
|
286
287
|
aria-label="Select all rows"
|
|
287
288
|
skip-form-registry
|
|
288
|
-
@click.prevent="toggleSelectAll"
|
|
289
|
+
@click.prevent.stop="toggleSelectAll"
|
|
289
290
|
/>
|
|
290
291
|
</x-table-header>
|
|
291
292
|
<x-table-header v-if="expandable" width="48" class="!p-0"/>
|
|
@@ -354,13 +355,13 @@ const { styles, classes, className } = useTheme('Table', {}, props)
|
|
|
354
355
|
:single-select="singleSelect"
|
|
355
356
|
@click="onTableRowClick(item.data, item.index)"
|
|
356
357
|
>
|
|
357
|
-
<x-table-cell v-if="props.selectable && !singleSelect" width="
|
|
358
|
+
<x-table-cell v-if="props.selectable && !singleSelect" width="40" class="!pl-3.5 !pr-0.5 cursor-pointer" @click.stop="toggleRowSelection(keyProp ? (item.data as Record<string, unknown>)[keyProp] : item.index)">
|
|
358
359
|
<x-checkbox
|
|
359
360
|
:model-value="isRowSelected(keyProp ? (item.data as Record<string, unknown>)[keyProp] : item.index)"
|
|
360
361
|
hide-footer
|
|
361
362
|
:aria-label="`Select row ${index + 1}`"
|
|
362
363
|
skip-form-registry
|
|
363
|
-
@click.prevent="toggleRowSelection(keyProp ? (item.data as Record<string, unknown>)[keyProp] : item.index)"
|
|
364
|
+
@click.prevent.stop="toggleRowSelection(keyProp ? (item.data as Record<string, unknown>)[keyProp] : item.index)"
|
|
364
365
|
/>
|
|
365
366
|
</x-table-cell>
|
|
366
367
|
<x-table-cell v-if="expandable" width="48" class="!p-1">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
const validators = {
|
|
3
3
|
sort: [1, -1, undefined] as const,
|
|
4
|
-
textAlign: ['left', 'center', 'right'
|
|
4
|
+
textAlign: ['left', 'center', 'right'] as const,
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
const tableHeaderProps = {
|
|
@@ -41,15 +41,17 @@ const { styles, classes, className } = useTheme('TableHeader', {}, props)
|
|
|
41
41
|
<template>
|
|
42
42
|
<th :style="styles" :class="[className, classes.th, 'group/th']">
|
|
43
43
|
<div :class="classes.header">
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
<div class="flex items-center gap-1">
|
|
45
|
+
<slot></slot>
|
|
46
|
+
<x-toggle-tip v-if="tooltip" :content="tooltip"/>
|
|
47
|
+
</div>
|
|
47
48
|
|
|
48
49
|
<svg
|
|
49
50
|
v-if="sortable"
|
|
50
51
|
class="shrink-0"
|
|
51
52
|
:class="[
|
|
52
53
|
classes.sortIcon,
|
|
54
|
+
textAlign === 'right' ? '-mr-4 -translate-x-4' : '-ml-4 translate-x-4',
|
|
53
55
|
[sort && [1, -1].includes(sort) ? '' : 'invisible group-hover/th:visible'],
|
|
54
56
|
[sort !== -1 && sort !== 1 ? 'text-secondary-400 dark:text-secondary-500' : 'text-primary-700 dark:text-primary-400']
|
|
55
57
|
]"
|
|
@@ -14,9 +14,10 @@ const theme: TableHeaderTheme = {
|
|
|
14
14
|
const classes = ['flex items-center gap-1 select-none']
|
|
15
15
|
|
|
16
16
|
if (props.textAlign === 'left') classes.push('justify-start')
|
|
17
|
-
if (props.textAlign === 'right')
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
else if (props.textAlign === 'right') {
|
|
18
|
+
if (props.sortable) classes.push('flex-row-reverse')
|
|
19
|
+
else classes.push('justify-end')
|
|
20
|
+
} else if (props.textAlign === 'center') classes.push('justify-center')
|
|
20
21
|
|
|
21
22
|
return classes
|
|
22
23
|
},
|
|
@@ -10,7 +10,6 @@ const theme: TableHeaderTheme = {
|
|
|
10
10
|
if (props.textAlign === 'left') classes.push('text-left')
|
|
11
11
|
if (props.textAlign === 'right') classes.push('text-right')
|
|
12
12
|
if (props.textAlign === 'center') classes.push('text-center')
|
|
13
|
-
if (props.textAlign === 'justify') classes.push('text-justify')
|
|
14
13
|
|
|
15
14
|
return classes
|
|
16
15
|
},
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.14.
|
|
1
|
+
export default '1.14.1'
|