terrier-engine 4.4.9 → 4.4.11
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.
|
@@ -280,13 +280,19 @@ class SelectColumnsDropdown extends Dropdown<{modelDef: ModelDef, callback: Sele
|
|
|
280
280
|
checked: Set<string> = new Set()
|
|
281
281
|
columns!: string[]
|
|
282
282
|
|
|
283
|
+
get autoClose(): boolean {
|
|
284
|
+
return true
|
|
285
|
+
}
|
|
286
|
+
|
|
283
287
|
async init() {
|
|
288
|
+
await super.init()
|
|
289
|
+
|
|
284
290
|
this.columns = Object.keys(this.state.modelDef.columns).sort()
|
|
285
291
|
|
|
286
292
|
this.onClick(checkAllKey, _ => {
|
|
287
293
|
// toggle them all being checked
|
|
288
|
-
|
|
289
|
-
if (
|
|
294
|
+
log.info(`${this.checked.size} of ${this.columns.length} checked`)
|
|
295
|
+
if (this.checked.size > this.columns.length / 2) {
|
|
290
296
|
this.checked = new Set()
|
|
291
297
|
}
|
|
292
298
|
else {
|
|
@@ -321,7 +327,7 @@ class SelectColumnsDropdown extends Dropdown<{modelDef: ModelDef, callback: Sele
|
|
|
321
327
|
}
|
|
322
328
|
|
|
323
329
|
renderContent(parent: PartTag) {
|
|
324
|
-
parent.a(a => {
|
|
330
|
+
parent.a('.header', a => {
|
|
325
331
|
a.i('.glyp-check_all')
|
|
326
332
|
a.span({text: "Toggle All"})
|
|
327
333
|
}).emitClick(checkAllKey)
|
|
@@ -6,8 +6,9 @@ import dayjs from "dayjs"
|
|
|
6
6
|
import QueryEditor from "./query-editor"
|
|
7
7
|
import TerrierPart from "../../terrier/parts/terrier-part"
|
|
8
8
|
import Schema, {ModelDef, SchemaDef} from "../../terrier/schema"
|
|
9
|
-
import {arrays, messages} from "tuff-core"
|
|
9
|
+
import {arrays, messages, strings} from "tuff-core"
|
|
10
10
|
import {Logger} from "tuff-core/logging"
|
|
11
|
+
import inflection from "inflection";
|
|
11
12
|
|
|
12
13
|
const log = new Logger("Queries")
|
|
13
14
|
|
|
@@ -205,7 +206,8 @@ export class QueryModelPicker extends TerrierPart<QueryModelPickerState> {
|
|
|
205
206
|
label.input({type: 'radio', name: `new-query-model-${this.id}`, value: model.name})
|
|
206
207
|
.emitChange(this.pickedKey, {model: model.name})
|
|
207
208
|
label.div(col => {
|
|
208
|
-
|
|
209
|
+
const name = inflection.pluralize(strings.titleize(model.name))
|
|
210
|
+
col.div('.name').text(name)
|
|
209
211
|
if (model.metadata?.description) {
|
|
210
212
|
col.div('.description').text(model.metadata.description)
|
|
211
213
|
}
|
package/package.json
CHANGED
package/terrier/overlays.ts
CHANGED
|
@@ -109,6 +109,7 @@ export class OverlayPart extends Part<NoState> {
|
|
|
109
109
|
*/
|
|
110
110
|
clearAll() {
|
|
111
111
|
this.layerStates = []
|
|
112
|
+
this.updateLayers()
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
render(parent: PartTag) {
|
|
@@ -131,6 +132,18 @@ class OverlayLayer<PartType extends Part<StateType>, StateType extends {}> exten
|
|
|
131
132
|
this.part = this.makePart(this.state.partClass, this.state.partState)
|
|
132
133
|
}
|
|
133
134
|
|
|
135
|
+
|
|
136
|
+
assignState(state: OverlayLayerState<PartType, StateType>): boolean {
|
|
137
|
+
const changed = super.assignState(state)
|
|
138
|
+
if (changed) {
|
|
139
|
+
if (this.part) {
|
|
140
|
+
this.removeChild(this.part)
|
|
141
|
+
}
|
|
142
|
+
this.part = this.makePart(this.state.partClass, this.state.partState)
|
|
143
|
+
}
|
|
144
|
+
return changed
|
|
145
|
+
}
|
|
146
|
+
|
|
134
147
|
render(parent: PartTag) {
|
|
135
148
|
parent.part(this.part)
|
|
136
149
|
}
|