terrier-engine 4.53.0 → 4.53.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.53.0",
7
+ "version": "4.53.2",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Terrier-Tech/terrier-engine"
@@ -82,7 +82,7 @@ export default abstract class PagePart<TState> extends ContentPart<TState> {
82
82
  /// Toolbar Fields
83
83
 
84
84
  protected _toolbarFieldsOrder: string[] = []
85
- protected _toolbarFields: Record<string, ToolbarFieldDef> = {}
85
+ protected _toolbarFields: Map<string, ToolbarFieldDef> = new Map<string, ToolbarFieldDef>()
86
86
 
87
87
  protected get hasToolbarFields() {
88
88
  return this._toolbarFieldsOrder.length > 0
@@ -109,8 +109,10 @@ export default abstract class PagePart<TState> extends ContentPart<TState> {
109
109
  }
110
110
 
111
111
  protected addToolbarFieldDef(def: ToolbarFieldDef) {
112
- this._toolbarFieldsOrder.push(def.name)
113
- this._toolbarFields[def.name] = def
112
+ if (!this._toolbarFields.has(def.name)) {
113
+ this._toolbarFieldsOrder.push(def.name)
114
+ }
115
+ this._toolbarFields.set(def.name, def)
114
116
  }
115
117
 
116
118
  /// Rendering
@@ -187,7 +189,7 @@ export default abstract class PagePart<TState> extends ContentPart<TState> {
187
189
  protected renderToolbarFields(parent: PartTag) {
188
190
  parent.div('.fields', fields => {
189
191
  for (const name of this._toolbarFieldsOrder) {
190
- const def = this._toolbarFields[name]
192
+ const def = this._toolbarFields.get(name)
191
193
  if (!def) {
192
194
  log.warn(`No select def with name ${name} could be found!`)
193
195
  continue;