terrier-engine 4.40.0 → 4.41.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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "files": [
5
5
  "*"
6
6
  ],
7
- "version": "4.40.0",
7
+ "version": "4.41.2",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Terrier-Tech/terrier-engine"
@@ -1,5 +1,5 @@
1
1
  import TerrierPart from "./parts/terrier-part"
2
- import {Part, PartConstructor, PartTag, StatelessPart} from "tuff-core/parts"
2
+ import { Part, PartConstructor, PartTag, StatelessPart } from "tuff-core/parts"
3
3
  import Messages from "tuff-core/messages"
4
4
  import {Logger} from "tuff-core/logging"
5
5
  import {PageBreakpoints} from "./parts/page-part"
@@ -269,9 +269,11 @@ export abstract class ListViewerPart<T extends ListItem> extends TerrierPart<any
269
269
  render(parent: PartTag): any {
270
270
  log.debug(`Rendering the viewer`)
271
271
  parent.div('.tt-list-viewer-list', list => {
272
- list.div('.tt-list-viewer-header', header => {
273
- this.renderListHeader(header)
274
- })
272
+ if (this.listHeaderPart) {
273
+ list.div('.tt-list-viewer-header', header => {
274
+ header.part(this.listHeaderPart!)
275
+ })
276
+ }
275
277
  this.renderCollection(list, 'items')
276
278
  })
277
279
  if (this.layout == 'side') {
@@ -293,14 +295,6 @@ export abstract class ListViewerPart<T extends ListItem> extends TerrierPart<any
293
295
  */
294
296
  abstract renderDetails(context: ListViewerDetailsContext<T>): any
295
297
 
296
- /**
297
- * Subclasses can override this to render something at the top of the list.
298
- * @param parent
299
- */
300
- renderListHeader(_parent: PartTag) {
301
-
302
- }
303
-
304
298
  /**
305
299
  * Subclasses should override this to render custom content when there's no item selected (and layout=side).
306
300
  * @param parent
@@ -310,6 +304,14 @@ export abstract class ListViewerPart<T extends ListItem> extends TerrierPart<any
310
304
  }
311
305
 
312
306
 
307
+ // Header
308
+
309
+ /**
310
+ * Subclasses can provide a part to render at the top of the list.
311
+ */
312
+ listHeaderPart?: Part<any>
313
+
314
+
313
315
  // Details
314
316
 
315
317
  /**
package/terrier/modals.ts CHANGED
@@ -50,10 +50,10 @@ export abstract class ModalPart<TState> extends ContentPart<TState> {
50
50
  }
51
51
  parent.div(...actionsClasses, actions => {
52
52
  actions.div('.secondary-actions', container => {
53
- this.theme.renderActions(container, secondaryActions, {iconColor: 'white', defaultClass: 'secondary'})
53
+ this.theme.renderActions(container, secondaryActions, { defaultClass: 'secondary' })
54
54
  })
55
55
  actions.div('.primary-actions', container => {
56
- this.theme.renderActions(container, primaryActions, {iconColor: 'white', defaultClass: 'primary'})
56
+ this.theme.renderActions(container, primaryActions, { defaultClass: 'primary' })
57
57
  })
58
58
  })
59
59
  }
@@ -135,8 +135,8 @@ export default abstract class PagePart<TState> extends ContentPart<TState> {
135
135
  conatiner.div('.page-content', main => {
136
136
  this.renderContent(main)
137
137
  main.div('.page-actions', actions => {
138
- this.renderActions(actions, 'secondary', {iconColor: null, defaultClass: 'secondary'})
139
- this.renderActions(actions, 'primary', {iconColor: null, defaultClass: 'primary'})
138
+ this.renderActions(actions, 'secondary', { defaultClass: 'secondary' })
139
+ this.renderActions(actions, 'primary', { defaultClass: 'primary' })
140
140
  })
141
141
  })
142
142
  })