terrier-engine 4.19.0 → 4.20.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.
@@ -12,7 +12,7 @@ import Dives from "./dives"
12
12
  import {Logger} from "tuff-core/logging";
13
13
  import Schema, {SchemaDef} from "../../terrier/schema"
14
14
  import {TerrierFormFields} from "../../terrier/forms"
15
- import inflection from "inflection"
15
+ import * as inflection from "inflection"
16
16
  import Dates, {DateLiteral, DatePeriodPickerPart, DatePeriodPickerState, LiteralDateRange} from "../queries/dates"
17
17
  import dayjs from "dayjs"
18
18
  import {ProgressBarPart} from "../../terrier/progress";
@@ -2,7 +2,7 @@ import TerrierPart from "../../terrier/parts/terrier-part"
2
2
  import {Logger} from "tuff-core/logging"
3
3
  import {PartTag} from "tuff-core/parts"
4
4
  import {DdDive, DdDiveEnumFields, UnpersistedDdDive} from "../gen/models"
5
- import inflection from "inflection"
5
+ import * as inflection from "inflection"
6
6
  import {SchemaDef} from "../../terrier/schema"
7
7
  import {ModalPart} from "../../terrier/modals"
8
8
  import {Query, QueryModelPicker} from "../queries/queries"
@@ -1,4 +1,4 @@
1
- import inflection from "inflection"
1
+ import * as inflection from "inflection"
2
2
  import dayjs from "dayjs"
3
3
  import {Dropdown} from "../../terrier/dropdowns"
4
4
  import {PartTag} from "tuff-core/parts"
@@ -4,7 +4,7 @@ import {ColumnDef, ModelDef, SchemaDef} from "../../terrier/schema"
4
4
  import {TableRef, TableView} from "./tables"
5
5
  import {Logger} from "tuff-core/logging"
6
6
  import Objects from "tuff-core/objects"
7
- import inflection from "inflection"
7
+ import * as inflection from "inflection"
8
8
  import {ModalPart} from "../../terrier/modals"
9
9
  import TerrierFormPart from "../../terrier/parts/terrier-form-part"
10
10
  import {Dropdown} from "../../terrier/dropdowns"
@@ -7,7 +7,7 @@ import QueryEditor from "./query-editor"
7
7
  import TerrierPart from "../../terrier/parts/terrier-part"
8
8
  import Schema, {ModelDef, SchemaDef} from "../../terrier/schema"
9
9
  import {Logger} from "tuff-core/logging"
10
- import inflection from "inflection"
10
+ import * as inflection from "inflection"
11
11
  import Messages from "tuff-core/messages"
12
12
  import Strings from "tuff-core/strings"
13
13
  import Arrays from "tuff-core/arrays"
@@ -1,6 +1,6 @@
1
1
  import {PartTag} from "tuff-core/parts"
2
2
  import Schema, {BelongsToDef, ModelDef, SchemaDef} from "../../terrier/schema"
3
- import inflection from "inflection"
3
+ import * as inflection from "inflection"
4
4
  import Filters, {Filter, FilterInput, FiltersEditorModal} from "./filters"
5
5
  import Columns, {ColumnRef, ColumnsEditorModal} from "./columns"
6
6
  import {Logger} from "tuff-core/logging"
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "files": [
5
5
  "*"
6
6
  ],
7
- "version": "4.19.0",
7
+ "version": "4.20.0",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Terrier-Tech/terrier-engine"
package/terrier/forms.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import {Field, FormFields, FormPartData, InputType, KeyOfType, SelectOptions} from "tuff-core/forms"
2
2
  import {DbErrors} from "./db-client"
3
3
  import {PartTag} from "tuff-core/parts"
4
- import {InputTag, InputTagAttrs} from "tuff-core/html"
4
+ import {InputTag, InputTagAttrs, SelectTag, SelectTagAttrs, TextAreaTag, TextAreaTagAttrs} from "tuff-core/html"
5
5
  import TerrierPart from "./parts/terrier-part"
6
6
  import GlypPicker from "./parts/glyp-picker"
7
7
  import Glyps from "./glyps"
@@ -97,6 +97,24 @@ export class TerrierFormFields<T extends FormPartData> extends FormFields<T> {
97
97
  return super.input(parent, type, name, serializerType, attrs);
98
98
  }
99
99
 
100
+ select<Key extends KeyOfType<T, string> & string>(parent: PartTag, name: Key, options?: SelectOptions, attrs: SelectTagAttrs = {}): SelectTag {
101
+ if (this.errors && this.errors[name]) {
102
+ attrs ||= {}
103
+ attrs.classes ||= []
104
+ attrs.classes.push('error')
105
+ }
106
+ return super.select(parent, name, options, attrs);
107
+ }
108
+
109
+ textArea<Key extends KeyOfType<T, string> & string>(parent: PartTag, name: Key, attrs: TextAreaTagAttrs={}): TextAreaTag {
110
+ if (this.errors && this.errors[name]) {
111
+ attrs ||= {}
112
+ attrs.classes ||= []
113
+ attrs.classes.push('error')
114
+ }
115
+ return super.textArea(parent, name, attrs);
116
+ }
117
+
100
118
  /**
101
119
  * Only renders the error bubble if the errors are set.
102
120
  * @param parent
@@ -1,6 +1,6 @@
1
1
  // This file was automatically generated, DO NOT EDIT IT MANUALLY!
2
2
 
3
- import inflection from "inflection"
3
+ import * as inflection from "inflection"
4
4
 
5
5
  const allBadges = [
6
6
 
@@ -4,7 +4,7 @@ import Loading from "../loading"
4
4
  import Theme, {IconName} from "../theme"
5
5
  import Toasts, {ToastOptions} from "../toasts"
6
6
  import {DbErrors} from "../db-client"
7
- import inflection from "inflection";
7
+ import * as inflection from "inflection"
8
8
 
9
9
  /**
10
10
  * Base class for ALL parts in a Terrier application.
package/terrier/schema.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Api from "./api"
2
- import inflection from "inflection"
2
+ import * as inflection from "inflection"
3
3
 
4
4
  ////////////////////////////////////////////////////////////////////////////////
5
5
  // Schema Definitions