terrier-engine 4.39.0 → 4.39.2
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 +1 -1
- package/terrier/fragments.ts +1 -1
- package/terrier/theme.ts +5 -1
package/package.json
CHANGED
package/terrier/fragments.ts
CHANGED
|
@@ -123,7 +123,7 @@ function panelActions(panel: PartTag, actions: PanelActions, theme: Theme) {
|
|
|
123
123
|
const levelActions = actions[level]
|
|
124
124
|
if (!levelActions?.length) continue;
|
|
125
125
|
actionsContainer.div(`.${level}-actions`, container => {
|
|
126
|
-
theme.renderActions(container, levelActions, {
|
|
126
|
+
theme.renderActions(container, levelActions, { defaultClass: level })
|
|
127
127
|
})
|
|
128
128
|
}
|
|
129
129
|
})
|
package/terrier/theme.ts
CHANGED
|
@@ -35,6 +35,7 @@ export type Action = {
|
|
|
35
35
|
subtitle?: string
|
|
36
36
|
tooltip?: string
|
|
37
37
|
icon?: IconName
|
|
38
|
+
color?: ColorName
|
|
38
39
|
img?: string
|
|
39
40
|
href?: string
|
|
40
41
|
classes?: string[]
|
|
@@ -90,7 +91,7 @@ export default class Theme {
|
|
|
90
91
|
actions = [actions]
|
|
91
92
|
}
|
|
92
93
|
for (const action of actions) {
|
|
93
|
-
let iconColor = options?.iconColor
|
|
94
|
+
let iconColor = action.color || options?.iconColor
|
|
94
95
|
const attrs = action.tooltip?.length ? {data: {tooltip: action.tooltip}} : {}
|
|
95
96
|
parent.a(attrs, a => {
|
|
96
97
|
const classes = action.classes || []
|
|
@@ -111,6 +112,9 @@ export default class Theme {
|
|
|
111
112
|
if (action.subtitle?.length) {
|
|
112
113
|
a.div('.subtitle', {text: action.subtitle})
|
|
113
114
|
}
|
|
115
|
+
if (iconColor?.length) {
|
|
116
|
+
a.class(iconColor)
|
|
117
|
+
}
|
|
114
118
|
if (!(action.title?.length || action.subtitle?.length)) {
|
|
115
119
|
a.class('icon-only')
|
|
116
120
|
}
|