@lavalogic/scoria 0.37.1 → 0.37.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.
@@ -215,6 +215,11 @@ export function createColumnFactory() {
215
215
  ...commonProps(opts),
216
216
  accessorFn: opts.value,
217
217
  modal: opts.modal,
218
+ // Display columns have no implicit filter type (unlike the
219
+ // typed kinds where the factory pins one based on the
220
+ // column kind). Consumers opt in by passing the type they
221
+ // want the filter input rendered as.
222
+ filterValueType: opts.filterValueType,
218
223
  });
219
224
  return makeSpec('display', def);
220
225
  },
@@ -225,6 +230,7 @@ export function createColumnFactory() {
225
230
  ...commonProps(opts),
226
231
  accessorFn: opts.value,
227
232
  getColour: opts.colour,
233
+ filterValueType: opts.filterValueType,
228
234
  });
229
235
  return makeSpec('bubble', def);
230
236
  },
@@ -250,6 +256,7 @@ export function createColumnFactory() {
250
256
  ...commonProps(opts),
251
257
  accessorFn: tupleAccessor,
252
258
  getColour,
259
+ filterValueType: opts.filterValueType,
253
260
  });
254
261
  return makeSpec('progress', def);
255
262
  },
@@ -132,6 +132,21 @@ export interface DisplayColumnOptions<TRow extends object, TValue = unknown> ext
132
132
  /** Override the auto-generated id. Rare; only useful when the consumer
133
133
  * needs a stable id for preset persistence or test selectors. */
134
134
  idHint?: string;
135
+ /**
136
+ * Filter-input shape for this column. Display columns have no
137
+ * implicit filter type (unlike `col.number` / `col.date` etc.
138
+ * which derive theirs from the column kind). Set this when the
139
+ * displayed `value` is a computed string but the underlying field
140
+ * the server filters on is a number / date / select - this keeps
141
+ * the typed filter UI (e.g. number ranges, date pickers) for
142
+ * foreign-key columns that show a human-readable name.
143
+ *
144
+ * When omitted, the filter row renders a generic string input.
145
+ *
146
+ * The filter targets the column id (use `idHint` to set a stable
147
+ * id matching the server field name).
148
+ */
149
+ filterValueType?: FilterValueType;
135
150
  }
136
151
  /** Options for `col.bubble({ header, value, colour, ... })`. Renders one or
137
152
  * more coloured pill bubbles per row. */
@@ -143,6 +158,12 @@ export interface BubbleColumnOptions<TRow extends object, TValue = unknown> exte
143
158
  * so multi-bubble cells can colour each independently. */
144
159
  colour: (row: TRow, index: number, value: TValue) => BubbleColour | Promise<BubbleColour>;
145
160
  idHint?: string;
161
+ /**
162
+ * Filter-input shape for this column. See `DisplayColumnOptions.filterValueType`
163
+ * - same semantics, applied to bubble cells. Common case: a tag-bubble column
164
+ * where the displayed values are strings but the server filter is a select.
165
+ */
166
+ filterValueType?: FilterValueType;
146
167
  }
147
168
  /** Options for `col.progress({ header, value, ... })`. Renders a horizontal
148
169
  * progress bar from a numeric ratio. */
@@ -152,6 +173,12 @@ export interface ProgressColumnOptions<TRow extends object> extends BaseColumnOp
152
173
  /** Optional colour override. Defaults to scoria's progress colour ramp. */
153
174
  colour?: (row: TRow, index: number, fraction: number) => ColourSet | Promise<ColourSet>;
154
175
  idHint?: string;
176
+ /**
177
+ * Filter-input shape for this column. See `DisplayColumnOptions.filterValueType`
178
+ * - same semantics. Progress columns most commonly filter on a numeric
179
+ * "percent complete" field, in which case set this to `'Number'`.
180
+ */
181
+ filterValueType?: FilterValueType;
155
182
  }
156
183
  /** Options for `col.validity({ header, ... })`. Renders the row's overall
157
184
  * validity indicator and (optionally) opens a modal with the validity
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lavalogic/scoria",
3
3
  "description": "Svelte components used for the FloWMS Web Frontend",
4
- "version": "0.37.1",
4
+ "version": "0.37.2",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },