@dcs-tech/ui-native 0.15.0 → 0.17.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/CHANGELOG.md CHANGED
@@ -1,5 +1,90 @@
1
1
  # @dcs-tech/ui-native
2
2
 
3
+ ## 0.17.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c04b2a4]
8
+ - Updated dependencies [c04b2a4]
9
+ - Updated dependencies [c04b2a4]
10
+ - Updated dependencies [c04b2a4]
11
+ - Updated dependencies [c04b2a4]
12
+ - Updated dependencies [c04b2a4]
13
+ - Updated dependencies [c04b2a4]
14
+ - Updated dependencies [c04b2a4]
15
+ - Updated dependencies [c04b2a4]
16
+ - Updated dependencies [c04b2a4]
17
+ - Updated dependencies [c04b2a4]
18
+ - Updated dependencies [c04b2a4]
19
+ - Updated dependencies [c04b2a4]
20
+ - Updated dependencies [c04b2a4]
21
+ - Updated dependencies [c04b2a4]
22
+ - Updated dependencies [c04b2a4]
23
+ - Updated dependencies [c04b2a4]
24
+ - @dcs-tech/core@0.17.0
25
+ - @dcs-tech/tokens@0.17.0
26
+
27
+ ## 0.16.0
28
+
29
+ ### Minor Changes
30
+
31
+ - 2b41f48: DatePicker's first day of the week follows the app's locale, on the web and native: with no `weekStart` set, the calendar grid's first column — and where the "This Week" preset starts — is the first day of the week in UIProvider `locale` (`localeWeekStart`, as the EventCalendar already did; without a provider, the browser's or device's locale). Monday-first locales (en-GB, de, …) now start on Monday, and "This Week" runs Monday to Sunday there; en-IN and en-US stay on Sunday. A picker's own `weekStart` still wins. In `@dcs-tech/core`, `localeWeekStart` now lives with the date logic (`datePicker.logic`); it is exported as before.
32
+ - 2b41f48: DatePicker follows the app, as on the web: the month and weekday names come from Intl in UIProvider's `locale`, the words from its language pack, and the shown format from the new UIProvider `dateFormat` (a picker's own `displayFormat` still wins; default dd-mm-yyyy). A month picker names its month in the locale too. New: UIProvider `dateFormat`, `useUIDateFormat()`.
33
+ - 2b41f48: Rich text. New `RichTextEditor` in its own entry, `@dcs-tech/ui/rich-text` (Tiptap underneath, so only an app that imports it bundles the editor engine): headings, lists and checklists, quotes, code, rules, tables (rows, columns, header row, merge / split, column resize), images (`onImageUpload`, or kept in the document; pick, drop or paste; alt text), links (a link box that reads `example.com` / an email / a phone number as an address and refuses unsafe ones), theme text colours and highlights, alignment and text direction, @mentions (`mentions.items(query)`, async), `{{variables}}` (`variables`, from the toolbar or typed "{{"), a "/" menu of blocks, a menu over selected text, Markdown paste and import, HTML import read through the schema, `maxLength` (graphemes, any script) and a word / character count, min / max height (scrolls inside), read-only and disabled. A field like the others: label, hint, error, required (an empty document is missing), Form / Fields `field: 'richText'` with the editor handed over in `componentRegistry`, Tab leaves, Ctrl+Enter submits, Escape closes a menu first; its shortcuts follow the app's command key (Ctrl by default on every platform). The toolbar takes a preset (`full`, `basic`, `message`, `minimal`) or groups, and folds what does not fit into ⋯.
34
+
35
+ New in `@dcs-tech/ui`: `RichTextView` (a document drawn read-only, no editor loaded; variables filled or as chips; `onMentionClick`, `onLinkClick`) and `richTextClassName()` (the content look, for HTML from `richTextToHtml`); icons `IconListBulleted`, `IconQuote`, `IconHeading`, `IconAlignJustify`, `IconIndent`, `IconOutdent`, `IconCodeBlock`, `IconTextDirection`, `IconHighlighter`, `IconTextColor` (also in `@dcs-tech/ui-native`); words in `labels.richText`.
36
+
37
+ New in `@dcs-tech/core`: the document model `RichTextDoc` (ProseMirror / Tiptap JSON) with `normalizeRichText`, `richTextToPlain`, `richTextToMarkdown`, `richTextToHtml` (escaped, known tags only), `fillRichTextVariables`, `liftRichTextVariables`, `collectRichTextVariables`, `collectRichTextMentions`, `isEmptyRichText`, `richTextCharCount` / `richTextWordCount` / `graphemeCount` / `textWordCount` (`Intl.Segmenter`), `safeRichTextUrl`, `normalizeLinkInput`, `firstStrongDirection`, the editor's keys, toolbar presets and menu search (`richTextKeyCommand`, `richTextToolbarGroups`, `filterRichTextItems`); `isMissingRequired('richText', …)`; `FieldDefinition` `field: 'richText'` and `FieldComponentRegistry.RichTextEditor`.
38
+
39
+ ### Patch Changes
40
+
41
+ - 2b41f48: DataTable filter sheet: a condition's value list (a column with no `filterOptions`) comes from the rows the search and the sheet's other conditions keep, as in the web's Filters dialog: every condition on the column itself counts as passed (an OR group that holds one included), so choosing a value never narrows its own list. Core's `valueListRows`.
42
+ - Updated dependencies [2b41f48]
43
+ - Updated dependencies [2b41f48]
44
+ - Updated dependencies [2b41f48]
45
+ - Updated dependencies [2b41f48]
46
+ - Updated dependencies [2b41f48]
47
+ - Updated dependencies [2b41f48]
48
+ - Updated dependencies [2b41f48]
49
+ - Updated dependencies [2b41f48]
50
+ - Updated dependencies [2b41f48]
51
+ - Updated dependencies [2b41f48]
52
+ - Updated dependencies [2b41f48]
53
+ - Updated dependencies [2b41f48]
54
+ - Updated dependencies [2b41f48]
55
+ - Updated dependencies [2b41f48]
56
+ - Updated dependencies [2b41f48]
57
+ - Updated dependencies [2b41f48]
58
+ - Updated dependencies [2b41f48]
59
+ - Updated dependencies [2b41f48]
60
+ - Updated dependencies [2b41f48]
61
+ - Updated dependencies [2b41f48]
62
+ - Updated dependencies [2b41f48]
63
+ - Updated dependencies [2b41f48]
64
+ - Updated dependencies [2b41f48]
65
+ - Updated dependencies [2b41f48]
66
+ - Updated dependencies [2b41f48]
67
+ - Updated dependencies [2b41f48]
68
+ - Updated dependencies [2b41f48]
69
+ - Updated dependencies [2b41f48]
70
+ - Updated dependencies [2b41f48]
71
+ - Updated dependencies [2b41f48]
72
+ - Updated dependencies [2b41f48]
73
+ - Updated dependencies [2b41f48]
74
+ - Updated dependencies [2b41f48]
75
+ - Updated dependencies [2b41f48]
76
+ - Updated dependencies [2b41f48]
77
+ - Updated dependencies [2b41f48]
78
+ - Updated dependencies [2b41f48]
79
+ - Updated dependencies [2b41f48]
80
+ - Updated dependencies [2b41f48]
81
+ - Updated dependencies [2b41f48]
82
+ - Updated dependencies [2b41f48]
83
+ - Updated dependencies [2b41f48]
84
+ - Updated dependencies [2b41f48]
85
+ - @dcs-tech/core@0.16.0
86
+ - @dcs-tech/tokens@0.16.0
87
+
3
88
  ## 0.15.0
4
89
 
5
90
  ### Minor Changes
package/README.md CHANGED
@@ -33,13 +33,14 @@ import { Button, IconAdd, UIProvider } from '@dcs-tech/ui-native';
33
33
 
34
34
  | Export | What it is |
35
35
  |---|---|
36
- | `UIProvider` | Optional. `theme` (`'light'`, `'dark'` or `'system'`, the default), `icons` (icon defaults), `labels` (the library's words, the same dictionary as the web's, `table` included), and `messages` + `locale` (language packs, the web's: `import ta from '@dcs-tech/ui-native/locales/ta'`, `<UIProvider locale="ta-IN" messages={[ta]}>`; per word the exact locale's pack, then its language's, then English; `locale` is also the DataTable's default locale) for the tree below, and `toast` (toast defaults); it also hosts `useDialog()` and `useToast()`. Put it at the app's root: the toasts are drawn over the view it sits in. |
36
+ | `UIProvider` | Optional. `theme` (`'light'`, `'dark'` or `'system'`, the default), `icons` (icon defaults), `labels` (the library's words, the same dictionary as the web's, `table` included), and `messages` + `locale` (language packs, the web's: `import ta from '@dcs-tech/ui-native/locales/ta'`, `<UIProvider locale="ta-IN" messages={[ta]}>`; per word the exact locale's pack, then its language's, then English; `locale` is also the DataTable's default locale and the DatePicker's month and weekday names), `dateFormat` (how every DatePicker shows a day unless it sets `displayFormat`, the web's) for the tree below, and `toast` (toast defaults); it also hosts `useDialog()` and `useToast()`. Put it at the app's root: the toasts are drawn over the view it sits in. |
37
37
  | `useTokens()` | The design tokens in force: the light or dark set, with the motion tokens zeroed when the device asks for reduced motion. For an app's own styles too. |
38
38
  | `Icon`, `IconSwap`, `createIcon`, `IconProvider`, `useIconDone` | Icons, as on the web. |
39
39
  | `IconAdd`, `IconFilter`, … | One component per icon in `@dcs-tech/core`, the same names as the web's. |
40
40
  | `Button` | The web Button's variants, sizes, colours and shapes, pressed with a finger. |
41
41
  | `useUILabels()` | The library's words as the nearest `UIProvider` set them. |
42
42
  | `useUILocale()` | The nearest `UIProvider`'s `locale`, or undefined (the device's). |
43
+ | `useUIDateFormat()` | The nearest `UIProvider`'s `dateFormat`, or undefined (dd-mm-yyyy). |
43
44
  | `FieldProvider`, `useFieldSurface()` | Size, variant, layout, disabled and read-only for every field below; a field's own prop wins. |
44
45
  | `FieldWrapper` | The label, help and error around a control: the same look for a control of your own. |
45
46
  | `Input` | A text field: sizes, variants, layouts, prefix and suffix, icons, clear button, password eye, character count. |
@@ -124,7 +125,7 @@ A prop marked **same** takes the same values and does the same thing as on `@dcs
124
125
  | | Props |
125
126
  |---|---|
126
127
  | Same | `name`, `value` (`yyyy-mm-dd`, or `{ from, to }` with `range`), `onChange` (`{ target: { name, value, type: 'date' } }`), `onApply`, `range`, `label`, `hint`, `error`, `required`, `placeholder`, `disabled`, `readOnly`, `size`, `variant`, `layout`, `width`, `min`, `max`, `yearRange`, `displayFormat`, `textOrder`, `weekStart`, `presets`, `fyStartMonth`, `monthNames`, `weekdayNames`, `clearLabel`, `applyLabel`, `showCalendarIcon`, `clearable`, `autoComplete`, `withTime` (a range's ends 00:00 and 23:59, a single date now), `timeToggle`, `picker` (`'month'` → `yyyy-mm`, `'year'` → `yyyy`: twelve cells three to a row; one press chooses and closes, a range closes on its second end; Apply on a range only with `applyLabel`), `open` / `defaultOpen` / `onOpenChange`, `aria-label` |
127
- | Adapted | The panel is a sheet from the bottom, the web's phone panel: one month, the presets below the calendar two to a row, the month and year as two Selects. The return key does what Enter does (From → To → close). The time boxes go two to a row under the dates (Start time, End time), and the hour / minute / AM-PM columns open under the box in the flow while it has the focus, as on the web's phone panel; the keypad has digits only, so AM / PM is pointed at in its column (the web also reads a typed `9pm`). The format and month names do not come from the app yet (ui-native's UIProvider has no `dateFormat` / `locale`): `displayFormat` defaults to dd-mm-yyyy and the names to the device's language. |
128
+ | Adapted | The panel is a sheet from the bottom, the web's phone panel: one month, the presets below the calendar two to a row, the month and year as two Selects. The return key does what Enter does (From → To → close). The time boxes go two to a row under the dates (Start time, End time), and the hour / minute / AM-PM columns open under the box in the flow while it has the focus, as on the web's phone panel; the keypad has digits only, so AM / PM is pointed at in its column (the web also reads a typed `9pm`). As on the web, `displayFormat` defaults to UIProvider's `dateFormat` (else dd-mm-yyyy), the month and weekday names come from Intl in UIProvider's `locale` (else the device's language), the words from its language pack, and `weekStart` (the grid's first column and the "This Week" preset) from `localeWeekStart` of that locale, as on the web: Monday for en-GB, Sunday for en-IN / en-US — where the device's Intl has no week info (older Hermes), Sunday. |
128
129
  | Web only | `months`, `currentMonthSide`, `showOutsideDays` (a phone shows one month, its neighbours' days with it), `placement`, the keyboard's arrows, `keyboard`, the class names, the grid-cell props |
129
130
 
130
131
  **Suggest**
@@ -163,7 +164,7 @@ apps. The rows are found, sorted and paged by the web table's rules (`@dcs-tech/
163
164
  | | Props |
164
165
  |---|---|
165
166
  | Same | `data`, `dataSource` (`fetchRows`, `subscribe`, `searchDebounceMs`), `views` (tabs; `authorized`, `defaultVisible`), `labels` (over UIProvider's `labels.table` and its language pack's), `locale` (else UIProvider's), `initialState` (view, search, sort, page, page size), `onStateChange` (the web's query), `renderDetail` (and a view's own), `detailBar`, `openRowId`, `onOpenRowChange`. A view's `columns`, `resolveColumns`, `rowKey`, `params`, `transform`, `search`, `sorting` (`defaultSort`), `pagination` (`pageSize`, `pageSizeOptions`), `layouts` / `defaultLayout` (`cards`, `split`), `cardFields`, `listFields`, `cardMinWidth`, `cardsExpanded`, `avatar`, `actions` (`label`, `icon`, `onClick`, `variant`, `primary`, `showWhen`, `disabledWhen`, `disableTextTransform`), `rowMenu` (`enabled`, `onOpen`, `openView`, `openHeader`, `openSubheader`, `openFooter`, `items`, `iconActions`, `longPress`, `builtIns`), `emptyMessage`, `noResultsMessage`, `loading`, `loadingMessage`, `swipeActions` (`right`, `left`, `fullSwipe`), `filtering` (`quickFilters`, `quickFilterMode`, `quickFilterLabel`, `defaultFilter`; `false` for none), `selection` (`true` / `onDemand`, `always`, `false`, or `mode`, `isSelectable`, `onSelectionChange`, `show`), `bulkActions` and `hideBulkActions`. Which actions are buttons and what the menu lists are core's rules (`inlineActionsOf`, `rowMenuEntries`). The table's `bulkActions` (`label`, `icon`, `variant`, `display`, `views`, `authorize`, `eligible`, `minSelected`, `maxSelected`, `allowAllMatching`, `confirm` with its `message`, `confirmLabel`, `danger` and `input`, `undoTimeoutMs`, `onRun` and what it returns), run by core's rules (`planBulkAction`, `summarizeBulkResult`): the eligible and skipped rows, the limits, the confirm, the result line, Undo, keeping or letting go of the selection, server mode fetching again. `authorize` for its `selection` and `bulkAction` gates. The filter is the web's one filter, by core's rules (`evaluateGroup`, `quickFilterGroup`, `valueFilterEntries`): a quick filter replaces it, a chip's ✕ or the row menu's Filter by (Only / Add / Hide) change it by hand and the quick filter it came from goes off; it goes in the query in server mode (`filterGroup`, `quickFilterIds`). The status row under the toolbar: the bulk buttons, "3 selected", Select all (N matching), Clear, the sort's chips, the filter's chips, the default order, the summary ("Showing all 48 rows"); the row menu's Select / Unselect (`builtIns`). A column's `header`, `type`, `value`, `field`, `format`, `numberFormat`, `dateFormat`, `options`, `searchText`, `sortValue`, `compare`, `sortable`, `authorized`, `dataOnly`, `exportValue`. |
166
- | Adapted | The row menu is a bottom sheet (the web's on a phone), opened by ⋮ or a long-press; its icons show their short labels. Where the view has bulk actions, a long-press ticks the row instead (starting to select, as a phone's lists do; the web's opens the menu, and the menu stays on ⋮); while selecting, a tap ticks / unticks a row. Swipe actions, a phone's own (the web has none): a card or list item swiped sideways shows the actions the view names in `swipeActions` behind it, in their colours; let go past half of them it stays open, a tap runs one, a tap on the row closes it; a long swipe runs the outermost one, which stretches across first (never a dangerous one, nor with `fullSwipe: false`); one row open at a time, none while selecting. Drag to select, a phone's own (the web has none): after that long-press, moving the finger without lifting it ticks every row from there to the one under it, and moving back unticks them; put the table in a `DataTableScrollView` (a ScrollView of the library's, the same props) and the drag holds it still and scrolls it near its top and bottom edges (beside a pane, the split list scrolls on its own). A bulk action's reason for being disabled and its `tooltip` are read out by a screen reader (no hover). Its result shows at the bottom in the app's toast (`useToast`, UIProvider's), else in one of the table's own. A view change lets go of the selection. The checkbox is the library Checkbox (16; the web's card one is 18). A card shows its first `primary` action with its icon and label, a list item that action's icon, as the web's defaults (Display's choices are not drawn yet). An action's `icon`, a menu item's and an icon action's `icon`, a column's `cell`, a view's `avatar`, `renderDetail` and `rowMenu.openView` / `openHeader` / `openFooter` return what the platform draws: give native nodes on a phone (text alone works on both). The table layout is not drawn: a view that offers only `table` shows cards, and dynamic columns (`resolveColumns`) show cards. A row opens in a sheet from the bottom on a phone (the web goes full screen) and from the right wider (the web's drawer, as wide); in a split view 768 or wider, in the pane beside the list. The sort is chosen in a sheet, one column at a time (a view's `defaultSort` of several still sorts by all of them). The layout is one button, as the web's (its icon and a ▾; its name too wider than a phone, where the web's is the icon and ▾ on every size), opening the view's layouts in a menu under it; the web's Columns / Card fields / List fields button after it is not drawn yet. The filter builder (the toolbar's Filters, with its count, or a filter chip) is the web's Filters dialog as a sheet from the bottom, in its phone layout: AND / OR, nested groups with NOT, each condition's column, operator and value one under another (a date's value is the DatePicker, one date or a range), the JSON folded away, Clear all / Cancel / Apply; a value's options are the column's `filterOptions`, else the distinct values of the rows (client mode). Saved filters, as the web's: the builder's list to load one from (★ the view's quick filters, 🔖 the user's, with their count of conditions and 🗑), Update and Save as new beside it, the name box under it; the user's are offered with the quick filters (⚡) too, and are kept with the view's preferences; `authorize('savedFilters')` false: they may be loaded, not saved or deleted. The user's choices (the layout, saved filters) are kept as the web's: with a `tableId`, in the same document (`<tableId>.<viewId>`) through the same `persistence` adapter, so an app's adapter (its server) gives the same choices on the web and the phone; the parts the phone does not draw (columns, export, summary, …) are kept as they are. Without `persistence` the phone's default is the device (`asyncStorageAdapter` over AsyncStorage, the web's localStorage) when the app has AsyncStorage installed, else memory until the app reloads; `null` keeps nothing. `prefsVersion` / `migratePrefs`, `renamedViews` and the one-time notice of a repair as the web's. The page size is the view's (no size picker yet). A row is pressed where the web clicks; there is no hover. Choices (layout, sort, page) last while the table is mounted (`persistence` is not read yet). |
167
+ | Adapted | The row menu is a bottom sheet (the web's on a phone), opened by ⋮ or a long-press; its icons show their short labels. Where the view has bulk actions, a long-press ticks the row instead (starting to select, as a phone's lists do; the web's opens the menu, and the menu stays on ⋮); while selecting, a tap ticks / unticks a row. Swipe actions, a phone's own (the web has none): a card or list item swiped sideways shows the actions the view names in `swipeActions` behind it, in their colours; let go past half of them it stays open, a tap runs one, a tap on the row closes it; a long swipe runs the outermost one, which stretches across first (never a dangerous one, nor with `fullSwipe: false`); one row open at a time, none while selecting. Drag to select, a phone's own (the web has none): after that long-press, moving the finger without lifting it ticks every row from there to the one under it, and moving back unticks them; put the table in a `DataTableScrollView` (a ScrollView of the library's, the same props) and the drag holds it still and scrolls it near its top and bottom edges (beside a pane, the split list scrolls on its own). A bulk action's reason for being disabled and its `tooltip` are read out by a screen reader (no hover). Its result shows at the bottom in the app's toast (`useToast`, UIProvider's), else in one of the table's own. A view change lets go of the selection. The checkbox is the library Checkbox (16; the web's card one is 18). A card shows its first `primary` action with its icon and label, a list item that action's icon, as the web's defaults (Display's choices are not drawn yet). An action's `icon`, a menu item's and an icon action's `icon`, a column's `cell`, a view's `avatar`, `renderDetail` and `rowMenu.openView` / `openHeader` / `openFooter` return what the platform draws: give native nodes on a phone (text alone works on both). The table layout is not drawn: a view that offers only `table` shows cards, and dynamic columns (`resolveColumns`) show cards. A row opens in a sheet from the bottom on a phone (the web goes full screen) and from the right wider (the web's drawer, as wide); in a split view 768 or wider, in the pane beside the list. The sort is chosen in a sheet, one column at a time (a view's `defaultSort` of several still sorts by all of them). The layout is one button, as the web's (its icon and a ▾; its name too wider than a phone, where the web's is the icon and ▾ on every size), opening the view's layouts in a menu under it; the web's Columns / Card fields / List fields button after it is not drawn yet. The filter builder (the toolbar's Filters, with its count, or a filter chip) is the web's Filters dialog as a sheet from the bottom, in its phone layout: AND / OR, nested groups with NOT, each condition's column, operator and value one under another (a date's value is the DatePicker, one date or a range), the JSON folded away, Clear all / Cancel / Apply; a value's options are the column's `filterOptions`, else the distinct values of the rows (client mode) the search and the sheet's other conditions keep, as the web's: every condition on the column itself counts as passed, an OR group holding one included (core `valueListRows`). Saved filters, as the web's: the builder's list to load one from (★ the view's quick filters, 🔖 the user's, with their count of conditions and 🗑), Update and Save as new beside it, the name box under it; the user's are offered with the quick filters (⚡) too, and are kept with the view's preferences; `authorize('savedFilters')` false: they may be loaded, not saved or deleted. The user's choices (the layout, saved filters) are kept as the web's: with a `tableId`, in the same document (`<tableId>.<viewId>`) through the same `persistence` adapter, so an app's adapter (its server) gives the same choices on the web and the phone; the parts the phone does not draw (columns, export, summary, …) are kept as they are. Without `persistence` the phone's default is the device (`asyncStorageAdapter` over AsyncStorage, the web's localStorage) when the app has AsyncStorage installed, else memory until the app reloads; `null` keeps nothing. `prefsVersion` / `migratePrefs`, `renamedViews` and the one-time notice of a repair as the web's. The page size is the view's (no size picker yet). A row is pressed where the web clicks; there is no hover. Choices (layout, sort, page) last while the table is mounted (`persistence` is not read yet). |
167
168
  | Not yet | export, a whole group selected (grouping is not drawn), `DataTableApi.clearSelection`, the row menu's built-in Copy, Select, Only / Hide and Open in new tab (they come with a clipboard module, selection and filters), the summary (a breakdown card's `order` / `showEmpty` are core's rules, `orderBreakdown` and `emptyListedBuckets`, ready for it), grouping, tree data, pivot, row styles (`rowStyles` / `rowStyle`), cell charts, rows animating in and out and cell flashes, `pinnedRows`, transactions (`apiRef`), counts on the view tabs, Manage views & templates, Display settings, the card / list fields editors, `HeaderComponent` / `FooterComponent`, `expandRow`, `sharing`, `authorize`, `virtualize` |
168
169
  | Web only | the table layout's grid (columns, widths, pinning, resizing, keyboard navigation, cell selection, `inlineActions`, the header checkbox and so `selection.headerSelects`: on a phone "Select all" is the status row's, which ticks every row found as the web's offer does), an action's `shortcut` and `tooltip`, `className`, the keyboard shortcuts, `getRowHref` / opening in a new tab |
169
170
 
@@ -11,13 +11,14 @@ import { DatePicker } from '../../DatePicker/DatePicker';
11
11
  import { IconDelete } from '../../Icon';
12
12
  import { filterLook } from './filterStyle';
13
13
  const NO_MARGIN = { marginBottom: 0 };
14
- export function FilterConditionRow({ condition, columns, onChange, onRemove, L, operators, rows }) {
14
+ export function FilterConditionRow({ condition, columns, onChange, onRemove, L, operators, rowsFor }) {
15
15
  const t = useTokens();
16
16
  const look = filterLook(t);
17
17
  const columnOptions = useMemo(() => filterColumnOptions(columns), [columns]);
18
18
  const column = useMemo(() => columns.find(c => c.key === condition.column), [columns, condition.column]);
19
19
  const type = column?.type || 'string';
20
20
  const operatorOptions = useMemo(() => filterOperatorsFor(type, operators).map(op => ({ name: operatorLabel(op, L), value: op })), [type, operators, L]);
21
+ const rows = useMemo(() => (column ? rowsFor?.(column.key) : undefined), [rowsFor, column]);
21
22
  const valueOptions = useMemo(() => filterValueOptions(column, rows), [column, rows]);
22
23
  const set = (value) => onChange({ ...condition, value });
23
24
  const valueInput = () => {
@@ -7,7 +7,7 @@ import { Button } from '../../Button/Button';
7
7
  import { IconAdd, IconDelete, IconFolder } from '../../Icon';
8
8
  import { FilterConditionRow } from './FilterConditionRow';
9
9
  import { filterLook } from './filterStyle';
10
- export function FilterGroupEditor({ group, columns, onChange, onRemove, L, operators, rows, depth = 0 }) {
10
+ export function FilterGroupEditor({ group, columns, onChange, onRemove, L, operators, rowsFor, depth = 0 }) {
11
11
  const t = useTokens();
12
12
  const look = filterLook(t);
13
13
  const or = group.logic === 'OR';
@@ -17,5 +17,5 @@ export function FilterGroupEditor({ group, columns, onChange, onRemove, L, opera
17
17
  const on = group.logic === logic;
18
18
  return (_jsx(Pressable, { role: "tab", "aria-selected": on, accessibilityState: { selected: on }, onPress: () => onChange({ ...group, logic }), style: look.tab(on), children: _jsx(Text, { style: look.tabText(on, logic === 'OR'), children: label }) }));
19
19
  };
20
- return (_jsxs(View, { style: look.group(or, depth), children: [_jsxs(View, { style: look.groupHead, children: [_jsxs(View, { style: look.tabs, role: "tablist", children: [tab('AND', L.filterAnd), tab('OR', L.filterOr)] }), depth > 0 && (_jsxs(View, { style: look.groupHeadRight, children: [_jsx(Switch, { size: "small", label: L.filterNot, labelPosition: "start", checked: !!group.negated, onCheckedChange: on => onChange({ ...group, negated: on }) }), onRemove && _jsx(Button, { icon: _jsx(IconDelete, {}), variant: "text", color: "error", size: "small", onPress: onRemove, "aria-label": L.filterRemoveGroup })] }))] }), group.conditions.map((item, index) => (isFilterGroup(item) ? (_jsx(FilterGroupEditor, { group: item, columns: columns, onChange: next => replace(index, next), onRemove: () => remove(index), L: L, operators: operators, rows: rows, depth: depth + 1 }, item.id)) : (_jsx(FilterConditionRow, { condition: item, columns: columns, onChange: next => replace(index, next), onRemove: () => remove(index), L: L, operators: operators, rows: rows }, item.id)))), _jsxs(View, { style: look.groupActions, children: [_jsx(Button, { startIcon: _jsx(IconAdd, {}), label: L.filterAddCondition, variant: "text", size: "small", onPress: () => onChange({ ...group, conditions: [...group.conditions, emptyFilterCondition()] }) }), _jsx(Button, { startIcon: _jsx(IconFolder, {}), label: L.filterAddGroup, variant: "text", size: "small", onPress: () => onChange({ ...group, conditions: [...group.conditions, emptyFilterSubgroup()] }) })] })] }));
20
+ return (_jsxs(View, { style: look.group(or, depth), children: [_jsxs(View, { style: look.groupHead, children: [_jsxs(View, { style: look.tabs, role: "tablist", children: [tab('AND', L.filterAnd), tab('OR', L.filterOr)] }), depth > 0 && (_jsxs(View, { style: look.groupHeadRight, children: [_jsx(Switch, { size: "small", label: L.filterNot, labelPosition: "start", checked: !!group.negated, onCheckedChange: on => onChange({ ...group, negated: on }) }), onRemove && _jsx(Button, { icon: _jsx(IconDelete, {}), variant: "text", color: "error", size: "small", onPress: onRemove, "aria-label": L.filterRemoveGroup })] }))] }), group.conditions.map((item, index) => (isFilterGroup(item) ? (_jsx(FilterGroupEditor, { group: item, columns: columns, onChange: next => replace(index, next), onRemove: () => remove(index), L: L, operators: operators, rowsFor: rowsFor, depth: depth + 1 }, item.id)) : (_jsx(FilterConditionRow, { condition: item, columns: columns, onChange: next => replace(index, next), onRemove: () => remove(index), L: L, operators: operators, rowsFor: rowsFor }, item.id)))), _jsxs(View, { style: look.groupActions, children: [_jsx(Button, { startIcon: _jsx(IconAdd, {}), label: L.filterAddCondition, variant: "text", size: "small", onPress: () => onChange({ ...group, conditions: [...group.conditions, emptyFilterCondition()] }) }), _jsx(Button, { startIcon: _jsx(IconFolder, {}), label: L.filterAddGroup, variant: "text", size: "small", onPress: () => onChange({ ...group, conditions: [...group.conditions, emptyFilterSubgroup()] }) })] })] }));
21
21
  }
@@ -27,6 +27,8 @@ export function FilterSheet({ state }) {
27
27
  }
28
28
  }, [state.filtersOpen]);
29
29
  const shown = useMemo(() => withBlankCondition(local), [local]);
30
+ const valueRowsFor = state.valueRowsFor;
31
+ const rowsFor = useMemo(() => (valueRowsFor ? (column) => valueRowsFor(column, local) : undefined), [valueRowsFor, local]);
30
32
  const count = countActiveConditions(local);
31
33
  const close = () => state.setFiltersOpen(false);
32
34
  const apply = () => { state.setFilterGroup(local); close(); };
@@ -63,5 +65,5 @@ export function FilterSheet({ state }) {
63
65
  };
64
66
  const title = (_jsxs(View, { style: look.headRow, children: [_jsx(View, { style: look.tile, children: _jsx(IconFilter, { size: "action", color: t.onPrimary }) }), _jsxs(View, { style: { flex: 1 }, children: [_jsxs(View, { style: look.titleRow, children: [_jsx(Text, { role: "heading", style: look.title, children: L.filterTitle }), count > 0 && _jsx(View, { style: look.badge, children: _jsx(Text, { style: look.badgeText, children: state.format.number(count) }) })] }), _jsx(Text, { style: look.subtitle, children: L.filterHint })] })] }));
65
67
  const footer = (_jsxs(View, { style: look.foot, children: [_jsx(Button, { label: L.clearAll, variant: "text", color: "error", size: "small", onPress: () => { setLocal(createEmptyFilterGroup()); setActiveId(null); } }), _jsxs(View, { style: look.footRight, children: [_jsx(Button, { label: L.cancel, variant: "outlined", size: "small", onPress: close }), _jsx(Button, { label: L.apply, variant: "filled", size: "small", onPress: apply })] })] }));
66
- return (_jsxs(Dialog, { open: state.filtersOpen, onClose: close, placement: "bottom", title: title, footer: footer, "aria-label": L.filterTitle, children: [(saved.length > 0 || state.canSaveFilters) && (_jsx(SavedFilterBar, { saved: saved, columns: state.columns, activeId: activeId, onPick: pick, onDelete: state.canSaveFilters ? remove : undefined, offer: offer, onUpdate: update, name: name, onName: setName, onSaveAsNew: saveAsNew, L: L, format: state.format })), _jsx(FilterGroupEditor, { group: shown, columns: state.columns, onChange: setLocal, L: L, operators: state.operators, rows: state.filterOptionRows }), _jsxs(View, { style: look.json, children: [_jsxs(Pressable, { role: "button", "aria-expanded": jsonOpen, onPress: () => setJsonOpen(v => !v), style: ({ pressed }) => look.jsonToggle(pressed), children: [_jsx(IconBraces, { size: "sm", color: t.textSecondary }), _jsx(Text, { style: look.jsonToggleText, children: L.filterJson }), _jsx(View, { style: { transform: [{ rotate: jsonOpen ? '180deg' : '0deg' }] }, children: _jsx(IconChevronDown, { size: "sm", color: t.textSecondary }) })] }), jsonOpen && (_jsx(ScrollView, { style: look.jsonBody, nestedScrollEnabled: true, children: _jsx(Text, { selectable: true, style: look.jsonText, children: JSON.stringify(shown, null, 2) }) }))] })] }));
68
+ return (_jsxs(Dialog, { open: state.filtersOpen, onClose: close, placement: "bottom", title: title, footer: footer, "aria-label": L.filterTitle, children: [(saved.length > 0 || state.canSaveFilters) && (_jsx(SavedFilterBar, { saved: saved, columns: state.columns, activeId: activeId, onPick: pick, onDelete: state.canSaveFilters ? remove : undefined, offer: offer, onUpdate: update, name: name, onName: setName, onSaveAsNew: saveAsNew, L: L, format: state.format })), _jsx(FilterGroupEditor, { group: shown, columns: state.columns, onChange: setLocal, L: L, operators: state.operators, rowsFor: rowsFor }), _jsxs(View, { style: look.json, children: [_jsxs(Pressable, { role: "button", "aria-expanded": jsonOpen, onPress: () => setJsonOpen(v => !v), style: ({ pressed }) => look.jsonToggle(pressed), children: [_jsx(IconBraces, { size: "sm", color: t.textSecondary }), _jsx(Text, { style: look.jsonToggleText, children: L.filterJson }), _jsx(View, { style: { transform: [{ rotate: jsonOpen ? '180deg' : '0deg' }] }, children: _jsx(IconChevronDown, { size: "sm", color: t.textSecondary }) })] }), jsonOpen && (_jsx(ScrollView, { style: look.jsonBody, nestedScrollEnabled: true, children: _jsx(Text, { selectable: true, style: look.jsonText, children: JSON.stringify(shown, null, 2) }) }))] })] }));
67
69
  }
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useDeferredValue, useEffect, useMemo, useRef, useState } from 'react';
2
- import { applyValueFilter, clientRows, createEmptyFilterGroup, flattenActiveFilters, quickFilterGroup, quickFiltersStillOn, mergedSavedFilters, pickQuickFilters, withSavedFilter, withoutSavedFilter, SAVED_FILTER_PREFIX, savedFilterQuickId, isUsableSavedFilter, prefsNotice, reportsUserChange, PREFS_NOTICE_MS, removeConditionById, resolveFiltering, createFormat, createUIFormat, defaultCardFields, defaultListFields, detailModeFor, getNestedValue, initialSorting, pageCountOf, pageOf, pickLayout, resolveBulkActions, resolveLabels, resolveSelection, resolveSorting, sameSortEntries, selectAllOffer, toggleSelected, shownViews, sizeOf, viewColumns, viewLayouts, viewPageSize, } from '@dcs-tech/core';
2
+ import { applyValueFilter, clientRows, createEmptyFilterGroup, flattenActiveFilters, quickFilterGroup, quickFiltersStillOn, mergedSavedFilters, pickQuickFilters, withSavedFilter, withoutSavedFilter, SAVED_FILTER_PREFIX, savedFilterQuickId, isUsableSavedFilter, prefsNotice, reportsUserChange, PREFS_NOTICE_MS, removeConditionById, resolveFiltering, createFormat, createUIFormat, valueListRows, withoutColumnConditions, defaultCardFields, defaultListFields, detailModeFor, getNestedValue, initialSorting, pageCountOf, pageOf, pickLayout, resolveBulkActions, resolveLabels, resolveSelection, resolveSorting, sameSortEntries, selectAllOffer, toggleSelected, shownViews, sizeOf, viewColumns, viewLayouts, viewPageSize, } from '@dcs-tech/core';
3
3
  import { useDebounced, useServerData } from '@dcs-tech/core/hooks';
4
4
  import { useOptionalToast } from '../Toast/ToastHost';
5
5
  import { useUILabels, useUILocale } from '../UIProvider/context';
@@ -119,6 +119,23 @@ export function useTableState(props, width) {
119
119
  }), [view.id, view.params, searchApplied, sorting, byKey, pageIndex, pageSize, filterGroup, quickFilterIds]);
120
120
  const server = useServerData(dataSource, serverMode ? query : null);
121
121
  const found = useMemo(() => (serverMode ? null : clientRows(data, view, columns, { search: searchApplied, sorting, filterGroup }, ctx)), [serverMode, data, view, columns, searchApplied, sorting, filterGroup, ctx]);
122
+ const searched = useMemo(() => (serverMode ? null : clientRows(data, view, columns, { search: searchApplied, sorting: [] }, ctx)), [serverMode, data, view, columns, searchApplied, ctx]);
123
+ const valueRowsFor = useMemo(() => {
124
+ if (!searched)
125
+ return undefined;
126
+ const cache = new Map();
127
+ return (column, group) => {
128
+ const key = JSON.stringify(withoutColumnConditions(group, column));
129
+ let rows = cache.get(key);
130
+ if (!rows) {
131
+ rows = valueListRows(searched, group, columns, column);
132
+ if (cache.size >= 20)
133
+ cache.clear();
134
+ cache.set(key, rows);
135
+ }
136
+ return rows;
137
+ };
138
+ }, [searched, columns]);
122
139
  const total = found ? found.length : server.total;
123
140
  const pageCount = pageCountOf(total, pageSize);
124
141
  const page = found ? pageOf(found, pageIndex, pageSize) : { rows: server.rows, pageIndex };
@@ -312,7 +329,7 @@ export function useTableState(props, width) {
312
329
  filterOn, filterGroup, setFilterGroup, activeFilters, removeFilter, quickFilters, quickFilterMode,
313
330
  quickFilterLabel: (filtering && filtering.quickFilterLabel) || undefined, quickFilterIds, setQuickFilters, filterByValue, operators, clearAll,
314
331
  savedFilters, allSavedFilters, canSaveFilters: authorize ? authorize('savedFilters') !== false : true, saveFilter, deleteFilter,
315
- filtersOpen, setFiltersOpen, filterOptionRows: serverMode ? undefined : data,
332
+ filtersOpen, setFiltersOpen, valueRowsFor,
316
333
  rows, total, serverMode, pageOn: pageSize > 0, pageIndex: page.pageIndex, pageCount, setPageIndex: setPageIndexState,
317
334
  loading: server.loading, fetching: serverMode ? server.fetching : search !== deferred, error: server.error, retry: server.refetch,
318
335
  layouts, layout, setLayout, detailMode,
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { Pressable, Text, View } from 'react-native';
4
- import { buildCalendar, buildDatePresets, calendarIcon, calendarNames, chevronLeftIcon, chevronRightIcon, clockIcon, closeIcon, compareDays, datePlaceholder, extendDateRange, formatDateValueText, formatDayText, isDayInRange, joinDateValue, matchDatePresets, openingHighlight, parseDateRangeText, parseDateValueText, parseIsoDay, shiftMonths, smallerSize, splitDateValue, startOfMonth, todayIso, viewForRange, yearOptions, } from '@dcs-tech/core';
4
+ import { buildCalendar, buildDatePresets, calendarIcon, calendarNames, localeWeekStart, chevronLeftIcon, chevronRightIcon, clockIcon, closeIcon, compareDays, datePlaceholder, extendDateRange, formatDateValueText, formatDayText, isDayInRange, joinDateValue, matchDatePresets, openingHighlight, parseDateRangeText, parseDateValueText, parseIsoDay, shiftMonths, smallerSize, splitDateValue, startOfMonth, todayIso, viewForRange, yearOptions, } from '@dcs-tech/core';
5
5
  import { useDebouncedCallback } from '@dcs-tech/core/hooks';
6
- import { useTokens, useUILabels } from '../UIProvider/context';
6
+ import { useTokens, useUIDateFormat, useUILabels, useUILocale } from '../UIProvider/context';
7
7
  import { useFieldSurface } from '../FieldContext/FieldContext';
8
8
  import { FieldWrapper } from '../FieldWrapper/FieldWrapper';
9
9
  import { Icon } from '../Icon/Icon';
@@ -25,12 +25,16 @@ const timeNow = () => {
25
25
  return `${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`;
26
26
  };
27
27
  function DayPicker(props) {
28
- const { name, value, label, placeholder, hint, error, required = false, disabled: disabledProp, readOnly: readOnlyProp, size: sizeProp, variant: variantProp, layout: layoutProp, width, style, range = false, min, max, yearRange, displayFormat = 'dd-mm-yyyy', textOrder, weekStart = 0, presets = true, fyStartMonth = 4, monthNames: monthNamesProp, weekdayNames: weekdayNamesProp, clearLabel: clearLabelProp, applyLabel: applyLabelProp, showCalendarIcon = true, clearable = false, autoComplete = 'off', withTime = false, timeToggle = false, open: openProp, defaultOpen = false, onOpenChange, testID, 'aria-label': ariaLabel, } = props;
28
+ const { name, value, label, placeholder, hint, error, required = false, disabled: disabledProp, readOnly: readOnlyProp, size: sizeProp, variant: variantProp, layout: layoutProp, width, style, range = false, min, max, yearRange, displayFormat: displayFormatProp, textOrder, weekStart: weekStartProp, presets = true, fyStartMonth = 4, monthNames: monthNamesProp, weekdayNames: weekdayNamesProp, clearLabel: clearLabelProp, applyLabel: applyLabelProp, showCalendarIcon = true, clearable = false, autoComplete = 'off', withTime = false, timeToggle = false, open: openProp, defaultOpen = false, onOpenChange, testID, 'aria-label': ariaLabel, } = props;
29
29
  const onChange = props.onChange;
30
30
  const onApply = props.onApply;
31
31
  const t = useTokens();
32
32
  const UL = useUILabels();
33
- const names = useMemo(() => calendarNames(), []);
33
+ const locale = useUILocale();
34
+ const appDateFormat = useUIDateFormat();
35
+ const displayFormat = displayFormatProp ?? appDateFormat ?? 'dd-mm-yyyy';
36
+ const names = useMemo(() => calendarNames(locale), [locale]);
37
+ const weekStart = useMemo(() => weekStartProp ?? localeWeekStart(locale), [weekStartProp, locale]);
34
38
  const monthNames = monthNamesProp ?? names.months;
35
39
  const weekdayNames = weekdayNamesProp ?? names.weekdays;
36
40
  const clearLabel = clearLabelProp ?? UL.datePicker.clear;
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { Pressable, Text, View } from 'react-native';
4
4
  import { buildPeriodGrid, calendarIcon, calendarNames, chevronLeftIcon, chevronRightIcon, clampPeriod, closeIcon, extendPeriodRange, formatPeriodText, isPeriodInBounds, openingPeriod, parsePeriodRangeText, parsePeriodText, periodPlaceholder, resolvePeriodBounds, shiftPeriod, smallerSize, toPeriod, todayIso, yearOptions, PERIOD_PAGE_SIZE, } from '@dcs-tech/core';
5
5
  import { useDebouncedCallback } from '@dcs-tech/core/hooks';
6
- import { useTokens, useUILabels } from '../UIProvider/context';
6
+ import { useTokens, useUIDateFormat, useUILabels, useUILocale } from '../UIProvider/context';
7
7
  import { useFieldSurface } from '../FieldContext/FieldContext';
8
8
  import { FieldWrapper } from '../FieldWrapper/FieldWrapper';
9
9
  import { Icon } from '../Icon/Icon';
@@ -19,12 +19,15 @@ const asRange = (value) => value && typeof value === 'object'
19
19
  ? { from: String(value.from ?? ''), to: String(value.to ?? '') }
20
20
  : { from: typeof value === 'string' ? value : '', to: '' };
21
21
  export function PeriodPicker(props) {
22
- const { mode, name, value, label, placeholder, hint, error, required = false, disabled: disabledProp, readOnly: readOnlyProp, size: sizeProp, variant: variantProp, layout: layoutProp, width, style, range = false, min, max, yearRange, displayFormat = 'dd-mm-yyyy', textOrder, monthNames: monthNamesProp, clearLabel: clearLabelProp, applyLabel, showCalendarIcon = true, clearable = false, autoComplete = 'off', open: openProp, defaultOpen = false, onOpenChange, testID, 'aria-label': ariaLabel, } = props;
22
+ const { mode, name, value, label, placeholder, hint, error, required = false, disabled: disabledProp, readOnly: readOnlyProp, size: sizeProp, variant: variantProp, layout: layoutProp, width, style, range = false, min, max, yearRange, displayFormat: displayFormatProp, textOrder, monthNames: monthNamesProp, clearLabel: clearLabelProp, applyLabel, showCalendarIcon = true, clearable = false, autoComplete = 'off', open: openProp, defaultOpen = false, onOpenChange, testID, 'aria-label': ariaLabel, } = props;
23
23
  const onChange = props.onChange;
24
24
  const onApply = props.onApply;
25
25
  const t = useTokens();
26
26
  const L = useUILabels().datePicker;
27
- const names = useMemo(() => calendarNames(), []);
27
+ const locale = useUILocale();
28
+ const appDateFormat = useUIDateFormat();
29
+ const displayFormat = displayFormatProp ?? appDateFormat ?? 'dd-mm-yyyy';
30
+ const names = useMemo(() => calendarNames(locale), [locale]);
28
31
  const monthNames = monthNamesProp ?? names.months;
29
32
  const clearLabel = clearLabelProp ?? L.clear;
30
33
  const order = textOrder ?? (displayFormat === 'yyyy-mm-dd' ? 'ymd' : 'dmy');
@@ -32,7 +35,7 @@ export function PeriodPicker(props) {
32
35
  const surface = useFieldSurface({ size: sizeProp, variant: variantProp, layout: layoutProp, disabled: disabledProp, readOnly: readOnlyProp });
33
36
  const { size, variant, shownLayout: layout, disabled, readOnly } = surface;
34
37
  const canType = !disabled && !readOnly;
35
- const textOf = useCallback((period) => formatPeriodText(period, mode, { monthNames: monthNamesProp }), [mode, monthNamesProp]);
38
+ const textOf = useCallback((period) => formatPeriodText(period, mode, { locale, monthNames: monthNamesProp }), [mode, locale, monthNamesProp]);
36
39
  const bounds = useMemo(() => resolvePeriodBounds({ mode, min, max, yearRange, today }), [mode, min, max, yearRange, today]);
37
40
  const pair = asRange(value);
38
41
  const from = toPeriod(pair.from, mode);
@@ -1,4 +1,4 @@
1
- import { chevronLeftIcon, chevronRightIcon, chevronUpIcon, chevronDownIcon, firstPageIcon, lastPageIcon, arrowLeftIcon, arrowUpIcon, arrowDownIcon, arrowToTopIcon, arrowToBottomIcon, openExternalIcon, expandAllIcon, collapseAllIcon, dragHandleIcon, moreVerticalIcon, moreHorizontalIcon, closeIcon, addIcon, deleteIcon, editIcon, copyIcon, copyRowIcon, saveIcon, shareIcon, printIcon, downloadIcon, exportIcon, resetIcon, searchIcon, checkIcon, playIcon, pauseIcon, bugIcon, settingsIcon, slidersIcon, filterIcon, filterOnlyIcon, filterAddIcon, filterExcludeIcon, filterRowIcon, sortIcon, columnsIcon, pivotIcon, openDetailIcon, groupByIcon, autoFitIcon, selectRowsIcon, viewsIcon, customizeIcon, layoutTableIcon, layoutCardsIcon, layoutSplitIcon, layoutListIcon, insightsIcon, boltIcon, clickIcon, pinIcon, pinOffIcon, starIcon, bookmarkIcon, bookmarkAddIcon, checkboxIcon, eyeIcon, eyeOffIcon, successIcon, warningIcon, errorIcon, spinnerIcon, fileIcon, fileTextIcon, fileSheetIcon, bracesIcon, codeIcon, globeIcon, databaseIcon, folderIcon, homeIcon, menuIcon, swapHorizontalIcon, uploadIcon, refreshIcon, alignLeftIcon, alignCenterIcon, alignRightIcon, lockIcon, unlockIcon, infoIcon, helpIcon, imageAddIcon, zoomInIcon, zoomOutIcon, rotateLeftIcon, rotateRightIcon, flipIcon, rulerIcon, handIcon, userIcon, usersIcon, calendarIcon, clockIcon, storeIcon, cardIcon, arrowRightIcon, arrowUpRightIcon, panelLeftIcon, panelRightIcon, undoIcon, redoIcon, repeatIcon, linkIcon, unlinkIcon, scissorsIcon, minusIcon, plusCircleIcon, minusCircleIcon, maximizeIcon, minimizeIcon, wrenchIcon, heartIcon, bookmarkCheckIcon, circleIcon, banIcon, cancelIcon, checkDoubleIcon, filePlusIcon, fileCheckIcon, fileUploadIcon, fileDownloadIcon, imageIcon, cropIcon, boldIcon, italicIcon, underlineIcon, strikethroughIcon, fontSizeIcon, textIcon, eraserIcon, hashIcon, listNumberedIcon, listCheckIcon, listPlusIcon, listMinusIcon, userAddIcon, userCheckIcon, userSearchIcon, userSettingsIcon, userShieldIcon, accountCircleIcon, idCardIcon, logoutIcon, keyIcon, shieldIcon, shieldCheckIcon, badgeCheckIcon, mailIcon, phoneIcon, phoneCallIcon, messageIcon, commentIcon, sendIcon, atSignIcon, bellIcon, inboxIcon, cartIcon, shoppingBagIcon, walletIcon, coinsIcon, banknoteIcon, receiptIcon, invoiceIcon, calculatorIcon, percentIcon, tagIcon, giftIcon, pointOfSaleIcon, bankIcon, rupeeIcon, upiIcon, upiTaglineIcon, upiMonoIcon, dollarIcon, truckIcon, packageIcon, boxesIcon, archiveIcon, warehouseIcon, buildingIcon, locationPinIcon, mapIcon, routeIcon, barcodeIcon, qrCodeIcon, scanIcon, monitorIcon, smartphoneIcon, tabletIcon, cloudIcon, cloudOffIcon, cloudUploadIcon, cloudDownloadIcon, wifiOffIcon, powerIcon, moonIcon, sunIcon, paletteIcon, pipetteIcon, aspectRatioIcon, gridSnapIcon, fileSettingsIcon, fileReturnIcon, listClockIcon, priceChangeIcon, quickReplyIcon, magicWandIcon, brushIcon, roadIcon, dashboardIcon, layersIcon, gridIcon, historyIcon, clockPlusIcon, briefcaseIcon, bookIcon, clipboardIcon, clipboardListIcon, clipboardCheckIcon, hierarchyIcon, branchIcon, shapesIcon, scaleIcon, lifeBuoyIcon, awardIcon, targetIcon, barChartIcon, sparklesIcon, handshakeIcon, } from '@dcs-tech/core';
1
+ import { chevronLeftIcon, chevronRightIcon, chevronUpIcon, chevronDownIcon, firstPageIcon, lastPageIcon, arrowLeftIcon, arrowUpIcon, arrowDownIcon, arrowToTopIcon, arrowToBottomIcon, openExternalIcon, expandAllIcon, collapseAllIcon, dragHandleIcon, moreVerticalIcon, moreHorizontalIcon, closeIcon, addIcon, deleteIcon, editIcon, copyIcon, copyRowIcon, saveIcon, shareIcon, printIcon, downloadIcon, exportIcon, resetIcon, searchIcon, checkIcon, playIcon, pauseIcon, bugIcon, settingsIcon, slidersIcon, filterIcon, filterOnlyIcon, filterAddIcon, filterExcludeIcon, filterRowIcon, sortIcon, columnsIcon, pivotIcon, openDetailIcon, groupByIcon, autoFitIcon, selectRowsIcon, viewsIcon, customizeIcon, layoutTableIcon, layoutCardsIcon, layoutSplitIcon, layoutListIcon, insightsIcon, boltIcon, clickIcon, pinIcon, pinOffIcon, starIcon, bookmarkIcon, bookmarkAddIcon, checkboxIcon, eyeIcon, eyeOffIcon, successIcon, warningIcon, errorIcon, spinnerIcon, fileIcon, fileTextIcon, fileSheetIcon, bracesIcon, codeIcon, globeIcon, databaseIcon, folderIcon, homeIcon, menuIcon, swapHorizontalIcon, uploadIcon, refreshIcon, alignLeftIcon, alignCenterIcon, alignRightIcon, lockIcon, unlockIcon, infoIcon, helpIcon, imageAddIcon, zoomInIcon, zoomOutIcon, rotateLeftIcon, rotateRightIcon, flipIcon, rulerIcon, handIcon, userIcon, usersIcon, calendarIcon, clockIcon, storeIcon, cardIcon, arrowRightIcon, arrowUpRightIcon, panelLeftIcon, panelRightIcon, undoIcon, redoIcon, repeatIcon, linkIcon, unlinkIcon, scissorsIcon, minusIcon, plusCircleIcon, minusCircleIcon, maximizeIcon, minimizeIcon, wrenchIcon, heartIcon, bookmarkCheckIcon, circleIcon, banIcon, cancelIcon, checkDoubleIcon, filePlusIcon, fileCheckIcon, fileUploadIcon, fileDownloadIcon, imageIcon, cropIcon, boldIcon, italicIcon, underlineIcon, strikethroughIcon, fontSizeIcon, textIcon, eraserIcon, hashIcon, listNumberedIcon, listCheckIcon, listBulletedIcon, quoteIcon, headingIcon, alignJustifyIcon, indentIcon, outdentIcon, codeBlockIcon, textDirectionIcon, highlighterIcon, textColorIcon, listPlusIcon, listMinusIcon, userAddIcon, userCheckIcon, userSearchIcon, userSettingsIcon, userShieldIcon, accountCircleIcon, idCardIcon, logoutIcon, keyIcon, shieldIcon, shieldCheckIcon, badgeCheckIcon, mailIcon, thumbUpIcon, thumbDownIcon, flagIcon, phoneIcon, phoneCallIcon, messageIcon, commentIcon, sendIcon, atSignIcon, bellIcon, inboxIcon, cartIcon, shoppingBagIcon, walletIcon, coinsIcon, banknoteIcon, receiptIcon, invoiceIcon, calculatorIcon, percentIcon, tagIcon, giftIcon, pointOfSaleIcon, bankIcon, rupeeIcon, upiIcon, upiTaglineIcon, upiMonoIcon, dollarIcon, truckIcon, packageIcon, boxesIcon, archiveIcon, warehouseIcon, buildingIcon, locationPinIcon, mapIcon, routeIcon, barcodeIcon, qrCodeIcon, scanIcon, monitorIcon, smartphoneIcon, tabletIcon, cloudIcon, cloudOffIcon, cloudUploadIcon, cloudDownloadIcon, wifiOffIcon, powerIcon, moonIcon, sunIcon, paletteIcon, pipetteIcon, aspectRatioIcon, gridSnapIcon, fileSettingsIcon, fileReturnIcon, listClockIcon, priceChangeIcon, quickReplyIcon, magicWandIcon, brushIcon, roadIcon, dashboardIcon, layersIcon, gridIcon, historyIcon, clockPlusIcon, briefcaseIcon, bookIcon, clipboardIcon, clipboardListIcon, clipboardCheckIcon, hierarchyIcon, branchIcon, shapesIcon, scaleIcon, lifeBuoyIcon, awardIcon, targetIcon, barChartIcon, sparklesIcon, handshakeIcon, } from '@dcs-tech/core';
2
2
  import { createIcon } from './Icon';
3
3
  export const IconChevronLeft = createIcon(chevronLeftIcon, 'IconChevronLeft');
4
4
  export const IconChevronRight = createIcon(chevronRightIcon, 'IconChevronRight');
@@ -158,6 +158,16 @@ export const IconEraser = createIcon(eraserIcon, 'IconEraser');
158
158
  export const IconHash = createIcon(hashIcon, 'IconHash');
159
159
  export const IconListNumbered = createIcon(listNumberedIcon, 'IconListNumbered');
160
160
  export const IconListCheck = createIcon(listCheckIcon, 'IconListCheck');
161
+ export const IconListBulleted = createIcon(listBulletedIcon, 'IconListBulleted');
162
+ export const IconQuote = createIcon(quoteIcon, 'IconQuote');
163
+ export const IconHeading = createIcon(headingIcon, 'IconHeading');
164
+ export const IconAlignJustify = createIcon(alignJustifyIcon, 'IconAlignJustify');
165
+ export const IconIndent = createIcon(indentIcon, 'IconIndent');
166
+ export const IconOutdent = createIcon(outdentIcon, 'IconOutdent');
167
+ export const IconCodeBlock = createIcon(codeBlockIcon, 'IconCodeBlock');
168
+ export const IconTextDirection = createIcon(textDirectionIcon, 'IconTextDirection');
169
+ export const IconHighlighter = createIcon(highlighterIcon, 'IconHighlighter');
170
+ export const IconTextColor = createIcon(textColorIcon, 'IconTextColor');
161
171
  export const IconListPlus = createIcon(listPlusIcon, 'IconListPlus');
162
172
  export const IconListMinus = createIcon(listMinusIcon, 'IconListMinus');
163
173
  export const IconUserAdd = createIcon(userAddIcon, 'IconUserAdd');
@@ -171,6 +181,9 @@ export const IconLogout = createIcon(logoutIcon, 'IconLogout');
171
181
  export const IconKey = createIcon(keyIcon, 'IconKey');
172
182
  export const IconShield = createIcon(shieldIcon, 'IconShield');
173
183
  export const IconShieldCheck = createIcon(shieldCheckIcon, 'IconShieldCheck');
184
+ export const IconThumbUp = createIcon(thumbUpIcon, 'IconThumbUp');
185
+ export const IconThumbDown = createIcon(thumbDownIcon, 'IconThumbDown');
186
+ export const IconFlag = createIcon(flagIcon, 'IconFlag');
174
187
  export const IconBadgeCheck = createIcon(badgeCheckIcon, 'IconBadgeCheck');
175
188
  export const IconMail = createIcon(mailIcon, 'IconMail');
176
189
  export const IconPhone = createIcon(phoneIcon, 'IconPhone');
@@ -5,10 +5,10 @@ import { DialogOpenProvider } from '../Dialog/Dialog';
5
5
  import { DialogHost } from '../Dialog/DialogHost';
6
6
  import { ToastHost } from '../Toast/ToastHost';
7
7
  import { LabelsContext, ThemeContext, resolveLabelsState } from './context';
8
- export { useTokens, useUILabels, useUILocale } from './context';
9
- export const UIProvider = ({ children, theme = 'system', icons, labels, messages, locale, toast }) => {
8
+ export { useTokens, useUIDateFormat, useUILabels, useUILocale } from './context';
9
+ export const UIProvider = ({ children, theme = 'system', icons, labels, messages, locale, dateFormat, toast }) => {
10
10
  const parent = useContext(LabelsContext);
11
- const words = useMemo(() => resolveLabelsState(parent, labels, messages, locale), [parent, labels, messages, locale]);
11
+ const words = useMemo(() => resolveLabelsState(parent, labels, messages, locale, dateFormat), [parent, labels, messages, locale, dateFormat]);
12
12
  return (_jsx(ThemeContext.Provider, { value: theme, children: _jsx(LabelsContext.Provider, { value: words, children: _jsx(IconProvider, { ...icons, children: _jsx(DialogOpenProvider, { children: _jsx(ToastHost, { defaults: toast, children: _jsx(DialogHost, { children: children }) }) }) }) }) }));
13
13
  };
14
14
  UIProvider.displayName = 'UIProvider';
@@ -4,16 +4,17 @@ import { dark, light, reducedMotion } from '@dcs-tech/tokens';
4
4
  import { DEFAULT_UI_LABELS, localeMessages, mergeLabels } from '@dcs-tech/core';
5
5
  export const ThemeContext = createContext('system');
6
6
  export const LabelsContext = createContext({ value: DEFAULT_UI_LABELS, labels: undefined, packs: [], locale: undefined });
7
- export function resolveLabelsState(parent, labels, messages, locale) {
7
+ export function resolveLabelsState(parent, labels, messages, locale, dateFormat) {
8
8
  const allLabels = labels ? (parent.labels ? mergeLabels(parent.labels, labels) : labels) : parent.labels;
9
9
  const packs = messages?.length ? [...parent.packs, ...messages] : parent.packs;
10
10
  const wordsLocale = locale ?? parent.locale;
11
11
  const pack = localeMessages(packs, wordsLocale);
12
12
  const value = mergeLabels(mergeLabels(DEFAULT_UI_LABELS, pack), allLabels);
13
- return { value, labels: allLabels, packs, locale: wordsLocale };
13
+ return { value, labels: allLabels, packs, locale: wordsLocale, dateFormat: dateFormat ?? parent.dateFormat };
14
14
  }
15
15
  export const useUILabels = () => useContext(LabelsContext).value;
16
16
  export const useUILocale = () => useContext(LabelsContext).locale;
17
+ export const useUIDateFormat = () => useContext(LabelsContext).dateFormat;
17
18
  const reduceMotion = (() => {
18
19
  let value = false;
19
20
  const listeners = new Set();
@@ -1 +1 @@
1
- export { UIProvider, useTokens, useUILabels, useUILocale } from './UIProvider';
1
+ export { UIProvider, useTokens, useUIDateFormat, useUILabels, useUILocale } from './UIProvider';
@@ -7,6 +7,6 @@ export interface FilterConditionRowProps<T> {
7
7
  onRemove: () => void;
8
8
  L: DataTableLabels;
9
9
  operators?: readonly string[];
10
- rows?: readonly T[];
10
+ rowsFor?: (column: string) => readonly T[] | undefined;
11
11
  }
12
- export declare function FilterConditionRow<T>({ condition, columns, onChange, onRemove, L, operators, rows }: FilterConditionRowProps<T>): React.JSX.Element;
12
+ export declare function FilterConditionRow<T>({ condition, columns, onChange, onRemove, L, operators, rowsFor }: FilterConditionRowProps<T>): React.JSX.Element;
@@ -7,7 +7,7 @@ export interface FilterGroupEditorProps<T> {
7
7
  onRemove?: () => void;
8
8
  L: DataTableLabels;
9
9
  operators?: readonly string[];
10
- rows?: readonly T[];
10
+ rowsFor?: (column: string) => readonly T[] | undefined;
11
11
  depth?: number;
12
12
  }
13
- export declare function FilterGroupEditor<T>({ group, columns, onChange, onRemove, L, operators, rows, depth }: FilterGroupEditorProps<T>): React.JSX.Element;
13
+ export declare function FilterGroupEditor<T>({ group, columns, onChange, onRemove, L, operators, rowsFor, depth }: FilterGroupEditorProps<T>): React.JSX.Element;
@@ -45,7 +45,7 @@ export interface TableState<T> {
45
45
  clearAll: () => void;
46
46
  filtersOpen: boolean;
47
47
  setFiltersOpen: (open: boolean) => void;
48
- filterOptionRows?: readonly T[];
48
+ valueRowsFor?: (column: string, group: DataTableFilterGroup) => readonly T[];
49
49
  rows: PageRow<T>[];
50
50
  total: number;
51
51
  serverMode: boolean;
@@ -156,6 +156,16 @@ export declare const IconEraser: import("./Icon").IconComponent;
156
156
  export declare const IconHash: import("./Icon").IconComponent;
157
157
  export declare const IconListNumbered: import("./Icon").IconComponent;
158
158
  export declare const IconListCheck: import("./Icon").IconComponent;
159
+ export declare const IconListBulleted: import("./Icon").IconComponent;
160
+ export declare const IconQuote: import("./Icon").IconComponent;
161
+ export declare const IconHeading: import("./Icon").IconComponent;
162
+ export declare const IconAlignJustify: import("./Icon").IconComponent;
163
+ export declare const IconIndent: import("./Icon").IconComponent;
164
+ export declare const IconOutdent: import("./Icon").IconComponent;
165
+ export declare const IconCodeBlock: import("./Icon").IconComponent;
166
+ export declare const IconTextDirection: import("./Icon").IconComponent;
167
+ export declare const IconHighlighter: import("./Icon").IconComponent;
168
+ export declare const IconTextColor: import("./Icon").IconComponent;
159
169
  export declare const IconListPlus: import("./Icon").IconComponent;
160
170
  export declare const IconListMinus: import("./Icon").IconComponent;
161
171
  export declare const IconUserAdd: import("./Icon").IconComponent;
@@ -169,6 +179,9 @@ export declare const IconLogout: import("./Icon").IconComponent;
169
179
  export declare const IconKey: import("./Icon").IconComponent;
170
180
  export declare const IconShield: import("./Icon").IconComponent;
171
181
  export declare const IconShieldCheck: import("./Icon").IconComponent;
182
+ export declare const IconThumbUp: import("./Icon").IconComponent;
183
+ export declare const IconThumbDown: import("./Icon").IconComponent;
184
+ export declare const IconFlag: import("./Icon").IconComponent;
172
185
  export declare const IconBadgeCheck: import("./Icon").IconComponent;
173
186
  export declare const IconMail: import("./Icon").IconComponent;
174
187
  export declare const IconPhone: import("./Icon").IconComponent;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import type { IconDefaults, UILocalePack } from '@dcs-tech/core';
2
+ import type { DateDisplayFormat, IconDefaults, UILocalePack } from '@dcs-tech/core';
3
3
  import type { ToastDefaults } from '../Toast/toast.types';
4
4
  import { type UILabelsInput, type UITheme } from './context';
5
- export { useTokens, useUILabels, useUILocale } from './context';
5
+ export { useTokens, useUIDateFormat, useUILabels, useUILocale } from './context';
6
6
  export type { UITheme, UILabels, UILabelsInput } from './context';
7
7
  export interface UIProviderProps {
8
8
  children?: React.ReactNode;
@@ -11,6 +11,7 @@ export interface UIProviderProps {
11
11
  labels?: UILabelsInput;
12
12
  messages?: readonly UILocalePack[];
13
13
  locale?: string;
14
+ dateFormat?: DateDisplayFormat;
14
15
  toast?: ToastDefaults;
15
16
  }
16
17
  export declare const UIProvider: React.FC<UIProviderProps>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { type Tokens } from '@dcs-tech/tokens';
3
- import type { DataTableLabels, PartialLabels, UILabelDictionary, UILocalePack } from '@dcs-tech/core';
3
+ import type { DataTableLabels, DateDisplayFormat, PartialLabels, UILabelDictionary, UILocalePack } from '@dcs-tech/core';
4
4
  export type UITheme = 'light' | 'dark' | 'system';
5
5
  export type UILabels = UILabelDictionary & {
6
6
  table?: Partial<DataTableLabels>;
@@ -11,10 +11,12 @@ export interface LabelsState {
11
11
  labels: UILabelsInput | undefined;
12
12
  packs: readonly UILocalePack[];
13
13
  locale: string | undefined;
14
+ dateFormat?: DateDisplayFormat;
14
15
  }
15
16
  export declare const ThemeContext: React.Context<UITheme>;
16
17
  export declare const LabelsContext: React.Context<LabelsState>;
17
- export declare function resolveLabelsState(parent: LabelsState, labels: UILabelsInput | undefined, messages: readonly UILocalePack[] | undefined, locale: string | undefined): LabelsState;
18
+ export declare function resolveLabelsState(parent: LabelsState, labels: UILabelsInput | undefined, messages: readonly UILocalePack[] | undefined, locale: string | undefined, dateFormat?: DateDisplayFormat): LabelsState;
18
19
  export declare const useUILabels: () => UILabels;
19
20
  export declare const useUILocale: () => string | undefined;
21
+ export declare const useUIDateFormat: () => DateDisplayFormat | undefined;
20
22
  export declare function useTokens(): Tokens;
@@ -1,2 +1,2 @@
1
- export { UIProvider, useTokens, useUILabels, useUILocale } from './UIProvider';
1
+ export { UIProvider, useTokens, useUIDateFormat, useUILabels, useUILocale } from './UIProvider';
2
2
  export type { UIProviderProps, UITheme, UILabels, UILabelsInput } from './UIProvider';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcs-tech/ui-native",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "description": "React Native components of the DCS Tech UI library, on the same logic, icons and design tokens as @dcs-tech/ui.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -38,8 +38,8 @@
38
38
  "clean": "rm -rf dist"
39
39
  },
40
40
  "dependencies": {
41
- "@dcs-tech/core": "0.15.0",
42
- "@dcs-tech/tokens": "0.15.0"
41
+ "@dcs-tech/core": "0.17.0",
42
+ "@dcs-tech/tokens": "0.17.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": ">=19.3",
@@ -67,6 +67,7 @@
67
67
  },
68
68
  "jest": {
69
69
  "preset": "@react-native/jest-preset",
70
+ "testTimeout": 20000,
70
71
  "roots": [
71
72
  "<rootDir>/src"
72
73
  ],