Skip to content

Commit 7c3da7e

Browse files
committed
fix: table scoped slots
1 parent 37688ed commit 7c3da7e

File tree

9 files changed

+39
-27
lines changed

9 files changed

+39
-27
lines changed

packages/common-helpers/src/locale/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export const localeForm: tLocaleForm = {
141141
export const localeTable: tLocaleTable = {
142142
table_see_values: "See {name}",
143143
table_see_name: 'See: "{name}"',
144+
table_hide_name: 'Hide: "{name}"',
144145
table_create_new: "Create new",
145146
table_create_new_name: 'Create new "{name}"',
146147
table_quantity: "Quantity: {count}",

packages/common-helpers/src/locale/es.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export const localeForm: tLocaleForm = {
142142
export const localeTable: tLocaleTable = {
143143
table_see_values: "Ver {name}",
144144
table_see_name: 'Ver: "{name}"',
145+
table_hide_name: 'Ocultar: "{name}"',
145146
table_create_new: "Crear nuevo",
146147
table_create_new_name: 'Crear nuevo "{name}"',
147148
table_quantity: "Cantidad: {count}",

packages/common-types/src/locale.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ export type tLocaleTable = {
209209
table_see_values: string;
210210
/** @example "See: \"{name}\"" */
211211
table_see_name: string;
212+
/** @example "Hide: \"{name}\"" */
213+
table_hide_name: string;
212214
/** @example "Create new" */
213215
table_create_new: string;
214216
/** @example "Crear nuevo" */

packages/components-vue/src/components/table/Body.vue

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,17 @@
197197
:size="size"
198198
:active="showChildren(nodeIndex, node)"
199199
:tooltip="
200-
t('table_see_name', {
201-
name:
202-
childrenName ||
203-
childrenCountKey ||
204-
String(node.id ?? nodeIndex).split('/')[0],
205-
})
200+
t(
201+
showChildren(nodeIndex, node)
202+
? 'table_hide_name'
203+
: 'table_see_name',
204+
{
205+
name:
206+
childrenName ||
207+
childrenCountKey ||
208+
String(node.id ?? nodeIndex).split('/')[0],
209+
}
210+
)
206211
"
207212
tooltip-position="right"
208213
:disabled="!childrenCount(node) || showNodeChildren?.(node)"

packages/components-vue/src/components/table/Simple.vue

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,22 @@
99
:class="[{ '--nested': nested }, themeClasses]"
1010
>
1111
<TableHead v-bind="childrenProps" :with-default-slot="!!$slots.default">
12-
<slot v-if="$slots.headActions" name="headActions"></slot>
12+
<template v-if="$slots.headActions" #headActions="headScope">
13+
<slot name="headActions" v-bind="headScope"></slot>
14+
</template>
1315
</TableHead>
1416
<TableBody v-bind="childrenProps">
15-
<template v-if="$slots.default" #default>
16-
<slot name="default"></slot>
17+
<template v-if="$slots.default" #default="defaultScope">
18+
<slot name="default" v-bind="defaultScope"></slot>
1719
</template>
18-
<template v-if="$slots.modifyActions" #modifyActions>
19-
<slot name="modifyActions"></slot>
20+
<template v-if="$slots.modifyActions" #modifyActions="modifyScope">
21+
<slot name="modifyActions" v-bind="modifyScope"></slot>
2022
</template>
21-
<template v-if="$slots.modifyDropdownActions" #modifyDropdownActions>
22-
<slot name="modifyDropdownActions"></slot>
23+
<template
24+
v-if="$slots.modifyDropdownActions"
25+
#modifyDropdownActions="modifyDropdownScope"
26+
>
27+
<slot name="modifyDropdownActions" v-bind="modifyDropdownScope"></slot>
2328
</template>
2429
</TableBody>
2530
</table>

packages/components-vue/src/composables/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default function useTheme(props: iAllUseThemeProps, themeAsUnion?: boolea
8585

8686
return tooltipText
8787
? {
88-
"arial-label": tooltipText,
88+
"aria-label": tooltipText,
8989
"data-tooltip": tooltipText,
9090
"data-tooltip-position": props.tooltipPosition,
9191
"data-tooltip-text": props.tooltipAsText ?? true,

packages/styles/src/base/_initialize.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@
4949
text-shadow: inherit;
5050
}
5151

52+
p {
53+
a {
54+
@layer defaults {
55+
&:hover {
56+
opacity: 0.7;
57+
}
58+
}
59+
}
60+
}
61+
5262
// broken asset fallback styles
5363
img,
5464
iframe {

packages/styles/src/base/_reset.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,6 @@
137137
pointer-events: none;
138138
}
139139
}
140-
h1,
141-
h2,
142-
h3,
143-
h4,
144-
h5,
145-
h6 {
146-
@layer defaults {
147-
&,
148-
* {
149-
// @defaults txtWrap
150-
}
151-
}
152-
}
153140

154141
// basic transition
155142
//

packages/styles/src/components/action/_module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
border-style: solid;
1414
text-shadow: none;
1515
font-size: 1em;
16+
opacity: 1;
1617
}
1718
}
1819

0 commit comments

Comments
 (0)