@llmnative/react 1.7.0 → 1.8.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/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +793 -573
- package/dist/index.mjs.map +1 -1
- package/dist/types/src/I18n.d.ts +9 -0
- package/dist/types/src/components/widgets/grid-core/types.d.ts +60 -10
- package/dist/types/src/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/types/src/I18n.d.ts
CHANGED
|
@@ -47,6 +47,15 @@ export interface I18nDict {
|
|
|
47
47
|
buttonAdd: string;
|
|
48
48
|
deleteConfirm: string;
|
|
49
49
|
emptyState: string;
|
|
50
|
+
filtersButton: string;
|
|
51
|
+
filtersPanelTitle: string;
|
|
52
|
+
filtersClearAll: string;
|
|
53
|
+
filtersSelectPlaceholder: string;
|
|
54
|
+
filtersRangeFrom: string;
|
|
55
|
+
filtersRangeTo: string;
|
|
56
|
+
filtersRangeMin: string;
|
|
57
|
+
filtersRangeMax: string;
|
|
58
|
+
filtersSelectedCountTemplate: string;
|
|
50
59
|
};
|
|
51
60
|
select: {
|
|
52
61
|
placeholder: string;
|
|
@@ -274,20 +274,68 @@ export type GridSearchConfig<TRecord> = {
|
|
|
274
274
|
/** Field keys to match against — omit to search every string-valued field on each record. */
|
|
275
275
|
fields?: Array<keyof TRecord | string>;
|
|
276
276
|
};
|
|
277
|
-
/**
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
/** One `{ label, value }` choice for a `'select'`/`'multiselect'` filter. */
|
|
278
|
+
export type GridFilterOption = {
|
|
279
|
+
label: string;
|
|
280
|
+
value: string;
|
|
281
|
+
};
|
|
282
|
+
interface GridFilterBase {
|
|
283
|
+
/** Unique key identifying this filter — used as the React key and to track its state, so
|
|
284
|
+
* it must be stable and unique within the `filters` array. */
|
|
282
285
|
key: string;
|
|
283
|
-
/** Label
|
|
286
|
+
/** Label shown in the filters panel, and as the prefix of the filter's chip once active. */
|
|
284
287
|
label: string;
|
|
288
|
+
}
|
|
289
|
+
/** A checkbox filter. `kind` may be omitted — it defaults to `'toggle'` (the original,
|
|
290
|
+
* pre-1.8 shape of `GridFilterConfig`). */
|
|
291
|
+
export type GridFilterToggleConfig<TRecord> = GridFilterBase & {
|
|
292
|
+
kind?: 'toggle';
|
|
285
293
|
/** Initial checkbox state. Defaults to `false`. */
|
|
286
294
|
defaultValue?: boolean;
|
|
287
295
|
/** Return `true` to keep `record` given the filter's current checkbox `value`. Called for
|
|
288
296
|
* every record on every render of the filtered set — keep it cheap and pure. */
|
|
289
297
|
predicate: (record: TRecord, value: boolean) => boolean;
|
|
290
298
|
};
|
|
299
|
+
/** A single-choice dropdown filter. */
|
|
300
|
+
export type GridFilterSelectConfig<TRecord> = GridFilterBase & {
|
|
301
|
+
kind: 'select';
|
|
302
|
+
options: GridFilterOption[];
|
|
303
|
+
/** Return `true` to keep `record`. `value` is `''` when nothing is selected — treat that as
|
|
304
|
+
* "no constraint" (match every record). */
|
|
305
|
+
predicate: (record: TRecord, value: string) => boolean;
|
|
306
|
+
};
|
|
307
|
+
/** A multi-choice filter, rendered as a checkbox list in the filters panel. */
|
|
308
|
+
export type GridFilterMultiSelectConfig<TRecord> = GridFilterBase & {
|
|
309
|
+
kind: 'multiselect';
|
|
310
|
+
options: GridFilterOption[];
|
|
311
|
+
/** Return `true` to keep `record`. `values` is `[]` when nothing is selected — treat that
|
|
312
|
+
* as "no constraint" (match every record). */
|
|
313
|
+
predicate: (record: TRecord, values: string[]) => boolean;
|
|
314
|
+
};
|
|
315
|
+
/** A `from`/`to` date-range filter, rendered as two native date inputs. */
|
|
316
|
+
export type GridFilterDateRangeConfig<TRecord> = GridFilterBase & {
|
|
317
|
+
kind: 'dateRange';
|
|
318
|
+
/** Return `true` to keep `record`. `from`/`to` are `''` when that bound isn't set —
|
|
319
|
+
* treat an empty bound as unconstrained on that side. */
|
|
320
|
+
predicate: (record: TRecord, range: {
|
|
321
|
+
from: string;
|
|
322
|
+
to: string;
|
|
323
|
+
}) => boolean;
|
|
324
|
+
};
|
|
325
|
+
/** A `min`/`max` numeric-range filter, rendered as two native number inputs. */
|
|
326
|
+
export type GridFilterNumberRangeConfig<TRecord> = GridFilterBase & {
|
|
327
|
+
kind: 'numberRange';
|
|
328
|
+
/** Return `true` to keep `record`. `min`/`max` are `undefined` when that bound isn't set —
|
|
329
|
+
* treat an unset bound as unconstrained on that side. */
|
|
330
|
+
predicate: (record: TRecord, range: {
|
|
331
|
+
min: number | undefined;
|
|
332
|
+
max: number | undefined;
|
|
333
|
+
}) => boolean;
|
|
334
|
+
};
|
|
335
|
+
/** One entry of `GridBehavior.filters` — a checkbox, dropdown, multi-choice list, date range,
|
|
336
|
+
* or numeric range, all rendered together in the filters panel opened from Grid's own default
|
|
337
|
+
* header (see `GridBehavior.filters`). */
|
|
338
|
+
export type GridFilterConfig<TRecord> = GridFilterToggleConfig<TRecord> | GridFilterSelectConfig<TRecord> | GridFilterMultiSelectConfig<TRecord> | GridFilterDateRangeConfig<TRecord> | GridFilterNumberRangeConfig<TRecord>;
|
|
291
339
|
/** Interaction / behaviour props for `<Grid>`. */
|
|
292
340
|
export type GridBehavior<TRecord> = {
|
|
293
341
|
/** Enable global sorting. Pass an `OrderConfig` to set a default sort. */
|
|
@@ -312,10 +360,12 @@ export type GridBehavior<TRecord> = {
|
|
|
312
360
|
* header — same as `views.table.columnPicker`/`views.toggle`, a fully custom `header` prop
|
|
313
361
|
* bypasses it entirely (render your own search input there instead). */
|
|
314
362
|
searchable?: boolean | GridSearchConfig<TRecord>;
|
|
315
|
-
/**
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
363
|
+
/** Filters (checkbox / select / multiselect / date range / number range) opened from a
|
|
364
|
+
* "Filters" button in Grid's OWN default header, next to the search box — applied BEFORE
|
|
365
|
+
* `searchable` (filters → search → sort → pagination/selection all see the FILTERED set).
|
|
366
|
+
* Each active filter shows as a removable chip on the header row. Same extension point as
|
|
367
|
+
* `searchable`: a fully custom `header` prop bypasses it entirely (render your own filter
|
|
368
|
+
* controls there instead). */
|
|
319
369
|
filters?: GridFilterConfig<TRecord>[];
|
|
320
370
|
};
|
|
321
371
|
/** Data-mutation hooks for `<Grid>`. */
|
|
@@ -21,7 +21,7 @@ export { PromptUtils } from './libs/promptUtils';
|
|
|
21
21
|
export type { PromptAction, PromptStatusItem, PromptRunStats } from './components/widgets/Prompt';
|
|
22
22
|
export type { TableHeaderProp, TableReorderHandler, TableReorderMeta, TableSelectionChangeHandler, TableSelectionState } from './components/ui/Table';
|
|
23
23
|
export type { GalleryRecord, GallerySelectionChangeHandler, GallerySelectionState } from './components/ui/Gallery';
|
|
24
|
-
export type { GridAction, GridActions, GridAfterActionArgs, GridAfterActionHandler, GridArrayProps, GridColumn, GridCoreProps, GridDBPath, GridDBQuery, GridDBProps, GridFooterContext, GridFormContext, GridGalleryField, GridGalleryViewProps, GridGalleryViewConfig, GridFilterConfig, GridHeaderContext, GridLayout, GridMutationDeleteArgs, GridMutationDeleteHandler, GridMutationSaveArgs, GridMutationSaveHandler, GridReorderHandler, GridReorderMeta, GridRecordKey, GridProps, GridSearchConfig, GridSelectionChangeHandler, GridSelectionMode, GridSelectionState, GridSticky, GridTableViewProps, GridTableViewConfig, GridViewsConfig, GridCellContext, } from './components/widgets/Grid';
|
|
24
|
+
export type { GridAction, GridActions, GridAfterActionArgs, GridAfterActionHandler, GridArrayProps, GridColumn, GridCoreProps, GridDBPath, GridDBQuery, GridDBProps, GridFooterContext, GridFormContext, GridGalleryField, GridGalleryViewProps, GridGalleryViewConfig, GridFilterConfig, GridFilterOption, GridFilterToggleConfig, GridFilterSelectConfig, GridFilterMultiSelectConfig, GridFilterDateRangeConfig, GridFilterNumberRangeConfig, GridHeaderContext, GridLayout, GridMutationDeleteArgs, GridMutationDeleteHandler, GridMutationSaveArgs, GridMutationSaveHandler, GridReorderHandler, GridReorderMeta, GridRecordKey, GridProps, GridSearchConfig, GridSelectionChangeHandler, GridSelectionMode, GridSelectionState, GridSticky, GridTableViewProps, GridTableViewConfig, GridViewsConfig, GridCellContext, } from './components/widgets/Grid';
|
|
25
25
|
export type { ProviderConfigurable, ProviderConfigurationState } from './providers/ProviderConfiguration';
|
|
26
26
|
export { getProviderConfigurationState } from './providers/ProviderConfiguration';
|
|
27
27
|
export type { ProviderAdapterMap, ProviderService, SetProviderFn, ProviderRegistrySnapshot } from './providers/ProviderRegistryContext';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmnative/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "LLM-native React framework for deterministic UI generation. Data-driven by default, schema-driven optional. Ultra-low token consumption — built for AI agents, not just humans.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|