terrier-engine 4.53.2 → 4.54.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/package.json
CHANGED
package/terrier/forms.ts
CHANGED
|
@@ -133,7 +133,7 @@ export class TerrierFormFields<T extends FormPartData> extends FormFields<T> {
|
|
|
133
133
|
return new CompoundFieldBuilder(this, parent, key, (this.part as TerrierPart<any>).theme, ...classes)
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
fileCompoundField<Key extends KeyOfType<T, File> & string>(parent: PartTag, key: Key, ...classes: string[]): FileCompoundFieldBuilder<T, Key> {
|
|
136
|
+
fileCompoundField<Key extends KeyOfType<T, File | FileList> & string>(parent: PartTag, key: Key, ...classes: string[]): FileCompoundFieldBuilder<T, Key> {
|
|
137
137
|
return new FileCompoundFieldBuilder(this, parent, key, (this.part as TerrierPart<any>).theme, ...classes)
|
|
138
138
|
}
|
|
139
139
|
|
|
@@ -287,9 +287,9 @@ class CompoundFieldBuilder<T extends Record<string, unknown>, K extends keyof T
|
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
class FileCompoundFieldBuilder<T extends Record<string, unknown>, K extends KeyOfType<T, File> & string> extends CompoundFieldBuilder<T, K> {
|
|
291
|
-
fileInput(attrs?: InputTagAttrs): this {
|
|
292
|
-
this.formFields.fileInput(this.field, this.key, attrs ?? {})
|
|
290
|
+
class FileCompoundFieldBuilder<T extends Record<string, unknown>, K extends KeyOfType<T, File | FileList> & string> extends CompoundFieldBuilder<T, K> {
|
|
291
|
+
fileInput(attrs?: InputTagAttrs, serializerType?: FieldConstructor<T[K], HTMLInputElement>): this {
|
|
292
|
+
this.formFields.fileInput(this.field, this.key, attrs ?? {}, serializerType)
|
|
293
293
|
return this
|
|
294
294
|
}
|
|
295
295
|
}
|
package/terrier/modals.ts
CHANGED
|
@@ -39,6 +39,7 @@ export abstract class ModalPart<TState> extends ContentPart<TState> {
|
|
|
39
39
|
}).emitClick(modalPopKey)
|
|
40
40
|
})
|
|
41
41
|
parent.div('.modal-content', content => {
|
|
42
|
+
content.class(...this.contentClasses)
|
|
42
43
|
this.renderContent(content)
|
|
43
44
|
})
|
|
44
45
|
const secondaryActions = this.getActions('secondary')
|
|
@@ -14,6 +14,10 @@ export type ActionLevel = keyof PanelActions
|
|
|
14
14
|
*/
|
|
15
15
|
export default abstract class ContentPart<TState> extends TerrierPart<TState> {
|
|
16
16
|
|
|
17
|
+
protected get contentClasses(): string[] {
|
|
18
|
+
return []
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
/**
|
|
18
22
|
* All ContentParts must implement this to render their actual content.
|
|
19
23
|
* @param parent
|
|
@@ -135,6 +135,7 @@ export default abstract class PagePart<TState> extends ContentPart<TState> {
|
|
|
135
135
|
page.div('.lighting')
|
|
136
136
|
page.div('.full-width-page', conatiner => {
|
|
137
137
|
conatiner.div('.page-content', main => {
|
|
138
|
+
main.class(...this.contentClasses)
|
|
138
139
|
this.renderContent(main)
|
|
139
140
|
main.div('.page-actions', actions => {
|
|
140
141
|
this.renderActions(actions, 'secondary', { defaultClass: 'secondary' })
|
|
@@ -52,10 +52,6 @@ export default abstract class PanelPart<TState> extends ContentPart<TState & { c
|
|
|
52
52
|
return []
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
protected get contentClasses(): string[] {
|
|
56
|
-
return []
|
|
57
|
-
}
|
|
58
|
-
|
|
59
55
|
render(parent: PartTag) {
|
|
60
56
|
const collapsibleConfig = this.state.collapsible
|
|
61
57
|
parent.div('.tt-panel', panel => {
|