terrier-engine 4.32.3 → 4.33.0
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/data-dive/gen/models.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// This file was automatically generated on 2024-
|
|
1
|
+
// This file was automatically generated on 2024-08-14 09:08:29 -0500, DO NOT EDIT IT MANUALLY!
|
|
2
2
|
|
|
3
3
|
import { Query } from "../queries/queries"
|
|
4
4
|
|
|
@@ -10,7 +10,9 @@ import { Attachment } from "../../terrier/attachments"
|
|
|
10
10
|
|
|
11
11
|
import { RegularSchedule } from "../../terrier/schedules"
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { DivePlotLayout } from "../plots/dive-plots"
|
|
14
|
+
|
|
15
|
+
import { DivePlotTrace } from "../plots/dive-plot-traces"
|
|
14
16
|
|
|
15
17
|
import { OptionalProps } from "tuff-core/types"
|
|
16
18
|
|
|
@@ -33,7 +35,6 @@ export type DdDive = {
|
|
|
33
35
|
sort_order?: number
|
|
34
36
|
query_data?: { queries: Query[] }
|
|
35
37
|
dive_types: string[]
|
|
36
|
-
delivery_mode?: string
|
|
37
38
|
delivery_recipients?: string[]
|
|
38
39
|
delivery_schedule?: RegularSchedule
|
|
39
40
|
created_by?: DdUser
|
|
@@ -62,7 +63,6 @@ export type UnpersistedDdDive = {
|
|
|
62
63
|
sort_order?: number
|
|
63
64
|
query_data?: { queries: Query[] }
|
|
64
65
|
dive_types: string[]
|
|
65
|
-
delivery_mode?: string
|
|
66
66
|
delivery_recipients?: string[]
|
|
67
67
|
delivery_schedule?: RegularSchedule
|
|
68
68
|
created_by?: DdUser
|
|
@@ -171,7 +171,6 @@ export type DdDiveRun = {
|
|
|
171
171
|
output_data?: object
|
|
172
172
|
output_file_data?: Attachment | { path: string }
|
|
173
173
|
status: "initial" | "running" | "success" | "error"
|
|
174
|
-
delivery_mode?: string
|
|
175
174
|
delivery_recipients?: string[]
|
|
176
175
|
delivery_data?: object
|
|
177
176
|
created_by?: DdUser
|
|
@@ -195,7 +194,6 @@ export type UnpersistedDdDiveRun = {
|
|
|
195
194
|
output_data?: object
|
|
196
195
|
output_file_data?: Attachment | { path: string }
|
|
197
196
|
status: "initial" | "running" | "success" | "error"
|
|
198
|
-
delivery_mode?: string
|
|
199
197
|
delivery_recipients?: string[]
|
|
200
198
|
delivery_data?: object
|
|
201
199
|
created_by?: DdUser
|
|
@@ -131,10 +131,9 @@ export default class DivePlotEditor extends ModalPart<DivePlotEditorState> {
|
|
|
131
131
|
parent.div(".tt-flex.column.padded.large-gap", mainColumn => {
|
|
132
132
|
|
|
133
133
|
mainColumn.div(".dd-plot-axes-and-preview.tt-flex.column.gap", axesAndPreview => {
|
|
134
|
-
this.fields.compoundField(axesAndPreview, field
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}).class('plot-title-field')
|
|
134
|
+
this.fields.compoundField(axesAndPreview, 'title', 'plot-title-field')
|
|
135
|
+
.label("Title", '.required')
|
|
136
|
+
.textInput({class: 'shrink plot-title'})
|
|
138
137
|
axesAndPreview.div('.tt-flex.gap', row => {
|
|
139
138
|
this.leftAxisFields.render(row)
|
|
140
139
|
row.part(this.renderPart)
|
|
@@ -55,18 +55,17 @@ class TraceStyleFields extends TerrierFormFields<TraceStyle> {
|
|
|
55
55
|
|
|
56
56
|
render(parent: PartTag) {
|
|
57
57
|
parent.div('.tt-form.tt-flex.gap.wrap', container => {
|
|
58
|
-
this.compoundField(container,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
this.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
this.compoundField(container,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
})
|
|
58
|
+
this.compoundField(container, 'stroke')
|
|
59
|
+
.label("Color")
|
|
60
|
+
.textInput({placeholder: 'Color'})
|
|
61
|
+
|
|
62
|
+
this.numericCompoundField(container, 'strokeWidth')
|
|
63
|
+
.label("Width")
|
|
64
|
+
.numberInput({placeholder: 'Width'})
|
|
65
|
+
|
|
66
|
+
this.compoundField(container, 'strokeDasharray')
|
|
67
|
+
.label("Dashes")
|
|
68
|
+
.textInput({placeholder: 'Dashes'})
|
|
70
69
|
})
|
|
71
70
|
}
|
|
72
71
|
|
|
@@ -165,10 +164,10 @@ export class DivePlotTraceEditor extends ModalPart<DivePlotTraceState> {
|
|
|
165
164
|
renderContent(parent: PartTag): void {
|
|
166
165
|
parent.div(".tt-form.tt-flex.large-gap.column.padded", mainColumn => {
|
|
167
166
|
// query
|
|
168
|
-
this.fields
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
167
|
+
this.fields
|
|
168
|
+
.compoundField(mainColumn, 'query_id')
|
|
169
|
+
.label("Query")
|
|
170
|
+
.select(this.queryOptions)
|
|
172
171
|
|
|
173
172
|
// axes
|
|
174
173
|
mainColumn.div('.tt-flex.gap', row => {
|
package/package.json
CHANGED
package/terrier/forms.ts
CHANGED
|
@@ -8,6 +8,10 @@ import Glyps from "./glyps"
|
|
|
8
8
|
import Messages from "tuff-core/messages"
|
|
9
9
|
import {Logger} from "tuff-core/logging"
|
|
10
10
|
import Strings from "tuff-core/strings"
|
|
11
|
+
import Theme, {Action, ColorName, IconName} from "./theme"
|
|
12
|
+
import Objects from "tuff-core/objects"
|
|
13
|
+
import {InlineStyle} from "tuff-core/tags"
|
|
14
|
+
import Hints, {Hint, HintRenderOptions} from "./hints"
|
|
11
15
|
|
|
12
16
|
const log = new Logger("TerrierForms")
|
|
13
17
|
|
|
@@ -142,17 +146,20 @@ export class TerrierFormFields<T extends FormPartData> extends FormFields<T> {
|
|
|
142
146
|
}).emitClick(this.pickGlypKey, {key})
|
|
143
147
|
}
|
|
144
148
|
|
|
149
|
+
compoundField<Key extends KeyOfType<T, string> & string>(parent: PartTag, key: Key, ...classes: string[]): StringCompoundFieldBuilder<T, Key> {
|
|
150
|
+
return new StringCompoundFieldBuilder(this, parent, key, (this.part as TerrierPart<any>).theme, ...classes)
|
|
151
|
+
}
|
|
145
152
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
numericCompoundField<Key extends KeyOfType<T, number> & string>(parent: PartTag, key: Key, ...classes: string[]): NumericCompoundFieldBuilder<T, Key> {
|
|
154
|
+
return new NumericCompoundFieldBuilder(this, parent, key, (this.part as TerrierPart<any>).theme, ...classes)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
fileCompoundField<Key extends KeyOfType<T, File> & string>(parent: PartTag, key: Key, ...classes: string[]): FileCompoundFieldBuilder<T, Key> {
|
|
158
|
+
return new FileCompoundFieldBuilder(this, parent, key, (this.part as TerrierPart<any>).theme, ...classes)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
booleanCompoundField<Key extends KeyOfType<T, boolean> & string>(parent: PartTag, key: Key, ...classes: string[]): BooleanCompoundFieldBuilder<T, Key> {
|
|
162
|
+
return new BooleanCompoundFieldBuilder(this, parent, key, (this.part as TerrierPart<any>).theme, ...classes)
|
|
156
163
|
}
|
|
157
164
|
|
|
158
165
|
/**
|
|
@@ -172,6 +179,153 @@ export class TerrierFormFields<T extends FormPartData> extends FormFields<T> {
|
|
|
172
179
|
|
|
173
180
|
}
|
|
174
181
|
|
|
182
|
+
abstract class CompoundFieldBuilder<T extends Record<string, unknown>, K extends KeyOfType<T, unknown> & string> {
|
|
183
|
+
|
|
184
|
+
field!: DivTag
|
|
185
|
+
|
|
186
|
+
constructor(readonly formFields: TerrierFormFields<T>, readonly parent: PartTag, readonly key: K, readonly theme: Theme, ...classes: string[]) {
|
|
187
|
+
this.field = parent.div('.tt-compound-field')
|
|
188
|
+
// add the error class if this key (or key_id) is in the errors object
|
|
189
|
+
if (formFields.errors && (formFields.errors[key] || formFields.errors[`${key}_id`] || formFields.errors[key.replace(/_id$/,'')])) {
|
|
190
|
+
this.field.class('error')
|
|
191
|
+
}
|
|
192
|
+
if (classes.length) {
|
|
193
|
+
this.field.class(...classes)
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
readonly(text?: string): this {
|
|
198
|
+
this.field.div('.readonly', {text: text ?? Objects.safeToString(this.formFields.data[this.key]) })
|
|
199
|
+
return this
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
label(text: string, ...classes: string[]): this {
|
|
203
|
+
this.field.label({ text, htmlFor: `${this.formFields.part.id}-${this.key}`, classes })
|
|
204
|
+
return this
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
tooltip(text: string): this {
|
|
208
|
+
this.field.dataAttr('tooltip', text)
|
|
209
|
+
return this
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
hint(hint: Hint, options?: HintRenderOptions): this {
|
|
213
|
+
Hints.renderHint(this.theme, this.field, hint, options)
|
|
214
|
+
return this
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
icon(icon: IconName, color: ColorName = 'secondary'): this {
|
|
218
|
+
this.theme.renderIcon(this.field, icon, color)
|
|
219
|
+
return this
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
css(styles: InlineStyle): this {
|
|
223
|
+
this.field.css(styles)
|
|
224
|
+
return this
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
action(action: Action, color: ColorName = 'link'): this {
|
|
228
|
+
action.classes ||= []
|
|
229
|
+
action.classes.push(color)
|
|
230
|
+
this.theme.renderActions(this.field, action, {iconColor: color})
|
|
231
|
+
return this
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
class(...s: string[]): this {
|
|
235
|
+
this.field.class(...s)
|
|
236
|
+
return this
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
class StringCompoundFieldBuilder<T extends Record<string, unknown>, K extends KeyOfType<T, string> & string> extends CompoundFieldBuilder<T, K> {
|
|
241
|
+
hiddenInput(attrs?: InputTagAttrs): this {
|
|
242
|
+
this.formFields.hiddenInput(this.field, this.key, attrs ?? {})
|
|
243
|
+
return this
|
|
244
|
+
}
|
|
245
|
+
textInput(attrs?: InputTagAttrs): this {
|
|
246
|
+
this.formFields.textInput(this.field, this.key, attrs ?? {})
|
|
247
|
+
return this
|
|
248
|
+
}
|
|
249
|
+
emailInput(attrs?: InputTagAttrs): this {
|
|
250
|
+
this.formFields.emailInput(this.field, this.key, attrs ?? {})
|
|
251
|
+
return this
|
|
252
|
+
}
|
|
253
|
+
phoneInput(attrs?: InputTagAttrs): this {
|
|
254
|
+
this.formFields.phoneInput(this.field, this.key, attrs ?? {})
|
|
255
|
+
return this
|
|
256
|
+
}
|
|
257
|
+
passwordInput(attrs?: InputTagAttrs): this {
|
|
258
|
+
this.formFields.passwordInput(this.field, this.key, attrs ?? {})
|
|
259
|
+
return this
|
|
260
|
+
}
|
|
261
|
+
searchInput(attrs?: InputTagAttrs): this {
|
|
262
|
+
this.formFields.searchInput(this.field, this.key, attrs ?? {})
|
|
263
|
+
return this
|
|
264
|
+
}
|
|
265
|
+
urlInput(attrs?: InputTagAttrs): this {
|
|
266
|
+
this.formFields.urlInput(this.field, this.key, attrs ?? {})
|
|
267
|
+
return this
|
|
268
|
+
}
|
|
269
|
+
textArea(attrs?: TextAreaTagAttrs): this {
|
|
270
|
+
this.formFields.textArea(this.field, this.key, attrs ?? {})
|
|
271
|
+
return this
|
|
272
|
+
}
|
|
273
|
+
dateInput(attrs?: InputTagAttrs): this {
|
|
274
|
+
this.formFields.dateInput(this.field, this.key, attrs ?? {})
|
|
275
|
+
return this
|
|
276
|
+
}
|
|
277
|
+
timeInput(attrs?: InputTagAttrs): this {
|
|
278
|
+
this.formFields.timeInput(this.field, this.key, attrs ?? {})
|
|
279
|
+
return this
|
|
280
|
+
}
|
|
281
|
+
dateTimeInput(attrs?: InputTagAttrs): this {
|
|
282
|
+
this.formFields.dateTimeInput(this.field, this.key, attrs ?? {})
|
|
283
|
+
return this
|
|
284
|
+
}
|
|
285
|
+
monthInput(attrs?: InputTagAttrs): this {
|
|
286
|
+
this.formFields.monthInput(this.field, this.key, attrs ?? {})
|
|
287
|
+
return this
|
|
288
|
+
}
|
|
289
|
+
weekInput(attrs?: InputTagAttrs): this {
|
|
290
|
+
this.formFields.weekInput(this.field, this.key, attrs ?? {})
|
|
291
|
+
return this
|
|
292
|
+
}
|
|
293
|
+
radio(value: string, attrs?: InputTagAttrs): this {
|
|
294
|
+
this.formFields.radio(this.field, this.key, value, attrs ?? {})
|
|
295
|
+
return this
|
|
296
|
+
}
|
|
297
|
+
select(selectOptions?: SelectOptions, attrs?: InputTagAttrs): this {
|
|
298
|
+
this.formFields.select(this.field, this.key, selectOptions, attrs ?? {})
|
|
299
|
+
return this
|
|
300
|
+
}
|
|
301
|
+
colorInput(attrs?: InputTagAttrs): this {
|
|
302
|
+
this.formFields.colorInput(this.field, this.key, attrs ?? {})
|
|
303
|
+
return this
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
class NumericCompoundFieldBuilder<T extends Record<string, unknown>, K extends KeyOfType<T, number> & string> extends CompoundFieldBuilder<T, K> {
|
|
308
|
+
numberInput(attrs?: InputTagAttrs): this {
|
|
309
|
+
this.formFields.numberInput(this.field, this.key, attrs ?? {})
|
|
310
|
+
return this
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
class FileCompoundFieldBuilder<T extends Record<string, unknown>, K extends KeyOfType<T, File> & string> extends CompoundFieldBuilder<T, K> {
|
|
315
|
+
fileInput(attrs?: InputTagAttrs): this {
|
|
316
|
+
this.formFields.fileInput(this.field, this.key, attrs ?? {})
|
|
317
|
+
return this
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
class BooleanCompoundFieldBuilder<T extends Record<string, unknown>, K extends KeyOfType<T, boolean> & string> extends CompoundFieldBuilder<T, K> {
|
|
322
|
+
|
|
323
|
+
checkbox(attrs?: InputTagAttrs): this {
|
|
324
|
+
this.formFields.checkbox(this.field, this.key, attrs ?? {})
|
|
325
|
+
return this
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
175
329
|
|
|
176
330
|
|
|
177
331
|
////////////////////////////////////////////////////////////////////////////////
|