terrier-engine 4.65.2 → 4.65.3
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
|
@@ -64,6 +64,10 @@ export default abstract class ContentPart<TState> extends TerrierPart<TState> {
|
|
|
64
64
|
|
|
65
65
|
private _namedActions: Record<string, { action: Action, level: ActionLevel }> = {}
|
|
66
66
|
|
|
67
|
+
protected get primarySecondaryActionsClasses(): string[] {
|
|
68
|
+
return []
|
|
69
|
+
}
|
|
70
|
+
|
|
67
71
|
/**
|
|
68
72
|
* Add an action to the part, or replace a named action if it already exists.
|
|
69
73
|
* @param action the action to add
|
|
@@ -138,6 +138,7 @@ export default abstract class PagePart<TState> extends ContentPart<TState> {
|
|
|
138
138
|
main.class(...this.contentClasses)
|
|
139
139
|
this.renderContent(main)
|
|
140
140
|
main.div('.page-actions', actions => {
|
|
141
|
+
actions.class(...this.primarySecondaryActionsClasses)
|
|
141
142
|
this.renderActions(actions, 'secondary', { defaultClass: 'secondary' })
|
|
142
143
|
this.renderActions(actions, 'primary', { defaultClass: 'primary' })
|
|
143
144
|
})
|
package/terrier/theme.ts
CHANGED
|
@@ -40,6 +40,7 @@ export type Action = {
|
|
|
40
40
|
color?: ColorName
|
|
41
41
|
img?: string
|
|
42
42
|
href?: string
|
|
43
|
+
target?: string
|
|
43
44
|
classes?: string[]
|
|
44
45
|
click?: Packet
|
|
45
46
|
data?: Record<string, unknown> | undefined
|
|
@@ -126,6 +127,9 @@ export default class Theme {
|
|
|
126
127
|
if (action.href?.length) {
|
|
127
128
|
a.attrs({href: action.href})
|
|
128
129
|
}
|
|
130
|
+
if (action.target?.length) {
|
|
131
|
+
a.attrs({target: action.target})
|
|
132
|
+
}
|
|
129
133
|
if (action.click) {
|
|
130
134
|
a.emitClick(action.click.key, action.click.data || {})
|
|
131
135
|
} else {
|