@jirawatpyk/aura-react 4.18.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.
- package/README.md +47 -3
- package/dist/aura.bundle.js +698 -298
- package/dist/cjs/index.cjs +697 -297
- package/dist/esm/ActionBar.js +47 -0
- package/dist/esm/AppShell.js +2 -2
- package/dist/esm/BottomNav.js +45 -0
- package/dist/esm/DataTable.js +187 -114
- package/dist/esm/DatePicker.js +33 -11
- package/dist/esm/DropdownMenu.js +1 -0
- package/dist/esm/Menu.js +64 -22
- package/dist/esm/Separator.js +20 -0
- package/dist/esm/Table.js +79 -0
- package/dist/esm/Tabs.js +35 -0
- package/dist/esm/Toaster.js +23 -6
- package/dist/esm/Tooltip.js +21 -3
- package/dist/esm/dates.js +12 -1
- package/dist/esm/index.js +16 -0
- package/dist/esm/locale.js +4 -2
- package/dist/esm/strings.js +3 -0
- package/dist/index.d.ts +163 -10
- package/dist/server/index.cjs +15 -1
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +15 -1
- package/dist/styles.css +184 -55
- package/dist/styles.layer.css +184 -55
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export interface DataTableColumn {
|
|
|
74
74
|
pinned?: boolean | undefined;
|
|
75
75
|
/** Start hidden (show it from the columns button). */
|
|
76
76
|
hidden?: boolean | undefined;
|
|
77
|
-
/** Hide this column when the table is narrower than this (px, or a breakpoint name). For tablets: keep ID, name, date and status; drop the rest below `lg`. Not applied to stacked cards. */
|
|
77
|
+
/** Hide this column when the table is narrower than this (px, or a breakpoint name). For tablets: keep ID, name, date and status; drop the rest below `lg`. Not applied to stacked cards. Decided in CSS from the first paint (4.20) for up to three distinct widths per table; more than that apply once JavaScript runs. */
|
|
78
78
|
hideBelow?: number | "sm" | "md" | "lg" | "xl" | undefined;
|
|
79
79
|
/** Row actions (a DropdownMenu or IconButton). In stacked cards it sits top-right instead of in the field list. Give it an empty label. */
|
|
80
80
|
actions?: boolean | undefined;
|
|
@@ -117,6 +117,11 @@ export interface DataTableProps {
|
|
|
117
117
|
onSelectionChange?: ((keys: Array<string | number>) => void) | undefined;
|
|
118
118
|
/** Shown when rows is empty. */
|
|
119
119
|
empty?: DataTableEmpty | undefined;
|
|
120
|
+
/** A totals row under the body (4.19): content per column key, e.g. `{ id: 'Total', vat: '7,000.00', total: '107,000.00' }`.
|
|
121
|
+
* Cells share the body's widths and alignment, so right-aligned money lines up. Stacked cards get a Totals card. */
|
|
122
|
+
footer?: Record<string, React$1.ReactNode> | undefined;
|
|
123
|
+
/** Keep the totals row visible while a `height` table scrolls. (4.19) */
|
|
124
|
+
stickyFooter?: boolean | undefined;
|
|
120
125
|
/** Rows per page; omit for no pagination. */
|
|
121
126
|
pageSize?: number | undefined;
|
|
122
127
|
/** Controlled page (1-based); pair with onPageChange. */
|
|
@@ -166,7 +171,7 @@ export interface DataTableProps {
|
|
|
166
171
|
onPinnedColumnsChange?: ((keys: string[]) => void) | undefined;
|
|
167
172
|
/** `compact` = 40px rows (48px on touch screens). Default: the surrounding density. */
|
|
168
173
|
density?: "comfortable" | "compact" | undefined;
|
|
169
|
-
/**
|
|
174
|
+
/** Table width in px below which rows render as stacked cards (phones). Try 640. It follows the table's own width, not the window. Since 4.20 the cards are the same markup as the grid, laid out by a container query, so any width is right before hydration and each row is in the HTML once. */
|
|
170
175
|
stackBelow?: number | undefined;
|
|
171
176
|
className?: string | undefined;
|
|
172
177
|
}
|
|
@@ -201,6 +206,8 @@ export interface AuraProviderProps {
|
|
|
201
206
|
calendar?: "buddhist" | "gregory" | undefined;
|
|
202
207
|
/** Override individual strings. */
|
|
203
208
|
strings?: Partial<Record<string, string | ((...args: any[]) => string)>> | undefined;
|
|
209
|
+
/** IANA time zone for "today" in DatePicker, DateRangePicker and Calendar, e.g. `Asia/Bangkok` (4.19). Default: the browser's. */
|
|
210
|
+
timeZone?: string | undefined;
|
|
204
211
|
/** `compact`: 36px fields and buttons, 40px table rows — dense admin screens. Touch screens keep 44px. Default: comfortable (or an ancestor's `data-density`). */
|
|
205
212
|
density?: "comfortable" | "compact" | undefined;
|
|
206
213
|
/** Your router's link (e.g. `Link` from `next/link`), used by every AURA component that renders a link: Button with `href`, SideNav, Breadcrumb, Stat, Pagination, DataTable row links. It gets `href`, `className`, `aria-current`, the children and the ref. A component's own `linkComponent` wins. */
|
|
@@ -256,6 +263,16 @@ export interface MenuItem {
|
|
|
256
263
|
/** A divider instead of an item. */
|
|
257
264
|
separator?: boolean | undefined;
|
|
258
265
|
onSelect?: (() => void) | undefined;
|
|
266
|
+
/** A link item (4.19): rendered through your router's link (`linkComponent`), e.g. a download or "Open in new tab". */
|
|
267
|
+
href?: string | undefined;
|
|
268
|
+
/** Link target, e.g. `_blank`, with `href`. */
|
|
269
|
+
target?: string | undefined;
|
|
270
|
+
/** `danger` for destructive items (Void, Delete): danger colour, put them last after a separator. (4.19) */
|
|
271
|
+
tone?: "danger" | undefined;
|
|
272
|
+
/** `radio` makes a single-choice item (menuitemradio); `checked` marks the chosen one. (4.19) */
|
|
273
|
+
type?: "radio" | undefined;
|
|
274
|
+
/** Radio items with the same `group` form one labelled group (the name is read out). (4.19) */
|
|
275
|
+
group?: string | undefined;
|
|
259
276
|
}
|
|
260
277
|
/** Popover list anchored to an element, rendered in a portal. */
|
|
261
278
|
export interface MenuProps {
|
|
@@ -268,6 +285,8 @@ export interface MenuProps {
|
|
|
268
285
|
onClose: (restoreFocus: boolean) => void;
|
|
269
286
|
/** Focus the first item on open. Default true; turn off only for static demos. */
|
|
270
287
|
autoFocus?: boolean | undefined;
|
|
288
|
+
/** Router link for items with `href`; defaults to AuraProvider's `linkComponent`, then `<a>`. (4.19) */
|
|
289
|
+
linkComponent?: React$1.ElementType | undefined;
|
|
271
290
|
}
|
|
272
291
|
export interface FieldProps {
|
|
273
292
|
/** Visible label; also the accessible name. */
|
|
@@ -460,7 +479,9 @@ export interface TooltipProps {
|
|
|
460
479
|
content: React$1.ReactNode;
|
|
461
480
|
/** One focusable element. */
|
|
462
481
|
children: React$1.ReactElement;
|
|
463
|
-
side
|
|
482
|
+
/** Preferred side. Default `top`. `left` / `right` (4.20) for icon buttons at the right edge of a table or in a
|
|
483
|
+
* collapsed rail. Flips to the opposite side when clipped, and always stays inside the viewport. */
|
|
484
|
+
side?: "top" | "bottom" | "left" | "right" | undefined;
|
|
464
485
|
/** Hover delay in ms. Default 400. */
|
|
465
486
|
delay?: number | undefined;
|
|
466
487
|
/** Force open (demos, tests). */
|
|
@@ -516,14 +537,20 @@ export interface TabItem {
|
|
|
516
537
|
count?: number | undefined;
|
|
517
538
|
disabled?: boolean | undefined;
|
|
518
539
|
content?: React$1.ReactNode | undefined;
|
|
540
|
+
/** A route (4.19). When every tab has one, Tabs renders a `nav` of links (section tabs that are pages), with
|
|
541
|
+
* `aria-current="page"` on the current one and no panels. */
|
|
542
|
+
href?: string | undefined;
|
|
519
543
|
}
|
|
520
544
|
export interface TabsProps {
|
|
521
545
|
tabs: TabItem[];
|
|
522
|
-
/** Accessible name for the tab list. */
|
|
546
|
+
/** Accessible name for the tab list (or the nav, for link tabs). */
|
|
523
547
|
label: string;
|
|
548
|
+
/** The current tab's id. For link tabs, the current route's tab. */
|
|
524
549
|
value?: string | undefined;
|
|
525
550
|
defaultValue?: string | undefined;
|
|
526
551
|
onChange?: ((id: string) => void) | undefined;
|
|
552
|
+
/** Router link for tabs with `href`; defaults to AuraProvider's `linkComponent`, then `<a>`. (4.19) */
|
|
553
|
+
linkComponent?: React$1.ElementType | undefined;
|
|
527
554
|
className?: string | undefined;
|
|
528
555
|
}
|
|
529
556
|
export interface NavItem {
|
|
@@ -592,6 +619,8 @@ export interface DropdownMenuProps {
|
|
|
592
619
|
items: MenuItem[];
|
|
593
620
|
/** Accessible name for the menu. */
|
|
594
621
|
label?: string | undefined;
|
|
622
|
+
/** Router link for items with `href`. (4.19) */
|
|
623
|
+
linkComponent?: React$1.ElementType | undefined;
|
|
595
624
|
}
|
|
596
625
|
export interface ComboboxOption {
|
|
597
626
|
value: string;
|
|
@@ -726,11 +755,17 @@ export interface CalendarProps extends DateDisplayOptions {
|
|
|
726
755
|
end?: ISODate | null | undefined;
|
|
727
756
|
focus?: ISODate | null | undefined;
|
|
728
757
|
range?: boolean | undefined;
|
|
729
|
-
|
|
730
|
-
|
|
758
|
+
/** Earliest / latest day; `'today'` means today in `timeZone` (4.19). */
|
|
759
|
+
min?: ISODate | "today" | undefined;
|
|
760
|
+
max?: ISODate | "today" | undefined;
|
|
731
761
|
isDateDisabled?: ((iso: ISODate) => boolean) | undefined;
|
|
732
762
|
/** 0 = Sunday (Thai default), 1 = Monday. */
|
|
733
763
|
weekStartsOn?: 0 | 1 | undefined;
|
|
764
|
+
/** IANA time zone that decides which day is "today" (the marker, `min`/`max="today"`, the Today button), e.g.
|
|
765
|
+
* `Asia/Bangkok`. Default: the provider's `timeZone`, else the browser's. (4.19) */
|
|
766
|
+
timeZone?: string | undefined;
|
|
767
|
+
/** Today, given outright (ISO). Wins over `timeZone`; handy in tests and server-rendered pages. (4.19) */
|
|
768
|
+
today?: ISODate | undefined;
|
|
734
769
|
onSelect?: ((iso: ISODate | null) => void) | undefined;
|
|
735
770
|
/** Adds a Clear link to the footer. */
|
|
736
771
|
onClear?: (() => void) | undefined;
|
|
@@ -746,10 +781,16 @@ export interface DateFieldProps extends FieldProps, DateDisplayOptions {
|
|
|
746
781
|
disabled?: boolean | undefined;
|
|
747
782
|
/** Clear button while there is a value. Default true. */
|
|
748
783
|
clearable?: boolean | undefined;
|
|
749
|
-
|
|
750
|
-
|
|
784
|
+
/** Earliest / latest day; `'today'` means today in `timeZone` (4.19). */
|
|
785
|
+
min?: ISODate | "today" | undefined;
|
|
786
|
+
max?: ISODate | "today" | undefined;
|
|
751
787
|
isDateDisabled?: ((iso: ISODate) => boolean) | undefined;
|
|
752
788
|
weekStartsOn?: 0 | 1 | undefined;
|
|
789
|
+
/** IANA time zone that decides which day is "today" (the marker, `min`/`max="today"`, the Today button), e.g.
|
|
790
|
+
* `Asia/Bangkok`. Default: the provider's `timeZone`, else the browser's. (4.19) */
|
|
791
|
+
timeZone?: string | undefined;
|
|
792
|
+
/** Today, given outright (ISO). Wins over `timeZone`; handy in tests and server-rendered pages. (4.19) */
|
|
793
|
+
today?: ISODate | undefined;
|
|
753
794
|
className?: string | undefined;
|
|
754
795
|
}
|
|
755
796
|
export interface DatePickerProps extends DateFieldProps {
|
|
@@ -822,6 +863,91 @@ export interface AppShellProps {
|
|
|
822
863
|
menuLabel?: string | undefined;
|
|
823
864
|
/** id of `<main>`, for a skip link. Default `main`. */
|
|
824
865
|
mainId?: string | undefined;
|
|
866
|
+
/** A BottomNav for phones (4.19). Shown below its `hideFrom` breakpoint; the content keeps room for it, and a
|
|
867
|
+
* viewport ActionBar sits on top of it. With a `bottomNav` and no `nav`, there is no menu button. */
|
|
868
|
+
bottomNav?: React$1.ReactElement | undefined;
|
|
869
|
+
className?: string | undefined;
|
|
870
|
+
}
|
|
871
|
+
export interface SeparatorProps {
|
|
872
|
+
/** Default `horizontal` (full width). `vertical` fills the height of a flex row, e.g. between toolbar groups. */
|
|
873
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
874
|
+
/** Default true: hidden from screen readers. `false` renders `role="separator"`, announced as a boundary. */
|
|
875
|
+
decorative?: boolean | undefined;
|
|
876
|
+
/** Space on both sides, as an `aura-space-*` step (e.g. 4 = 16px). Default 0. */
|
|
877
|
+
spacing?: 1 | 2 | 3 | 4 | 5 | 6 | 8 | undefined;
|
|
878
|
+
className?: string | undefined;
|
|
879
|
+
}
|
|
880
|
+
export interface TableProps extends Omit<React$1.TableHTMLAttributes<HTMLTableElement>, "className"> {
|
|
881
|
+
/** The table's name (a `<caption>`). Give every table one; `captionHidden` keeps it for screen readers only. */
|
|
882
|
+
caption?: React$1.ReactNode | undefined;
|
|
883
|
+
captionHidden?: boolean | undefined;
|
|
884
|
+
/** `compact` tightens the cell padding. Default follows the page. */
|
|
885
|
+
density?: "comfortable" | "compact" | undefined;
|
|
886
|
+
className?: string | undefined;
|
|
887
|
+
children?: React$1.ReactNode | undefined;
|
|
888
|
+
}
|
|
889
|
+
export interface TableSectionProps extends React$1.HTMLAttributes<HTMLTableSectionElement> {
|
|
890
|
+
className?: string | undefined;
|
|
891
|
+
}
|
|
892
|
+
export interface TableRowProps extends React$1.HTMLAttributes<HTMLTableRowElement> {
|
|
893
|
+
className?: string | undefined;
|
|
894
|
+
}
|
|
895
|
+
export interface TableCellProps extends Omit<React$1.TdHTMLAttributes<HTMLTableCellElement>, "align" | "scope"> {
|
|
896
|
+
/** Text alignment. `numeric` implies `end`. */
|
|
897
|
+
align?: "start" | "center" | "end" | undefined;
|
|
898
|
+
/** Money and counts: right-aligned, tabular figures. */
|
|
899
|
+
numeric?: boolean | undefined;
|
|
900
|
+
/** IDs and codes in the mono face. */
|
|
901
|
+
mono?: boolean | undefined;
|
|
902
|
+
/** Th only. Default `col`. */
|
|
903
|
+
scope?: "col" | "row" | "colgroup" | "rowgroup" | undefined;
|
|
904
|
+
className?: string | undefined;
|
|
905
|
+
}
|
|
906
|
+
export interface ActionBarProps {
|
|
907
|
+
/** Buttons, right-aligned (the primary one last). */
|
|
908
|
+
children?: React$1.ReactNode | undefined;
|
|
909
|
+
/** A short line such as "Total 107,000.00 THB · due Oct 22, 2026" or "Unsaved changes". It sits in a polite live
|
|
910
|
+
* region that is always in the page, so a change is announced. */
|
|
911
|
+
status?: React$1.ReactNode | undefined;
|
|
912
|
+
/** `viewport` (default): sticks to the bottom of the screen, padded for the home indicator, above a BottomNav.
|
|
913
|
+
* `container`: sticks to the bottom of the scrolling card or panel it's in. Both stay in the flow at the end of their
|
|
914
|
+
* parent, so they never cover the last field. Make it the last child of the form or card it belongs to: like any
|
|
915
|
+
* `position: sticky` element it sticks only while that parent is on screen. */
|
|
916
|
+
position?: "viewport" | "container" | undefined;
|
|
917
|
+
/** Bulk actions: the number of selected rows. Shows "N selected" in the status; at 0 the bar hides (its live region
|
|
918
|
+
* stays, so the next selection is announced) and its actions leave the tab order. */
|
|
919
|
+
selected?: number | undefined;
|
|
920
|
+
/** Adds a "Clear" button next to the count. */
|
|
921
|
+
onClearSelection?: (() => void) | undefined;
|
|
922
|
+
/** Name of the region. Default "Actions". */
|
|
923
|
+
label?: string | undefined;
|
|
924
|
+
className?: string | undefined;
|
|
925
|
+
}
|
|
926
|
+
export interface BottomNavItem {
|
|
927
|
+
id: string;
|
|
928
|
+
/** Short: five items share 320px. */
|
|
929
|
+
label: string;
|
|
930
|
+
icon: IconInput;
|
|
931
|
+
href?: string | undefined;
|
|
932
|
+
/** A number on the icon (99+ above 99); 0 hides it. Part of the item's accessible name. */
|
|
933
|
+
count?: number | undefined;
|
|
934
|
+
/** A dot on the icon, e.g. "new". Give it words with `badgeLabel`. */
|
|
935
|
+
badge?: boolean | undefined;
|
|
936
|
+
/** Read after the label when `badge` is set, e.g. "new". */
|
|
937
|
+
badgeLabel?: string | undefined;
|
|
938
|
+
}
|
|
939
|
+
export interface BottomNavProps {
|
|
940
|
+
/** 2–5 items. */
|
|
941
|
+
items: BottomNavItem[];
|
|
942
|
+
value?: string | undefined;
|
|
943
|
+
defaultValue?: string | undefined;
|
|
944
|
+
onChange?: ((id: string) => void) | undefined;
|
|
945
|
+
/** Default "Main". */
|
|
946
|
+
label?: string | undefined;
|
|
947
|
+
/** Router link for items with `href`; defaults to the AuraProvider's `linkComponent`, then `<a>`. */
|
|
948
|
+
linkComponent?: React$1.ElementType | undefined;
|
|
949
|
+
/** Hidden from this breakpoint up, in CSS (so the server's HTML is right). Default `lg` (1024px); `false` never hides. */
|
|
950
|
+
hideFrom?: "md" | "lg" | "xl" | false | undefined;
|
|
825
951
|
className?: string | undefined;
|
|
826
952
|
}
|
|
827
953
|
export interface StatChange {
|
|
@@ -1101,10 +1227,14 @@ export declare const Combobox: ComboboxComponent;
|
|
|
1101
1227
|
export type FormatDateOptions = DateDisplayOptions & {
|
|
1102
1228
|
format?: "short" | "long" | "numeric" | Intl.DateTimeFormatOptions | undefined;
|
|
1103
1229
|
};
|
|
1104
|
-
/** Format an ISO date for display, e.g. "18 ก.ย. 2569" (th, Buddhist) or "18 Sept 2026" (en, Gregorian). */
|
|
1105
|
-
export declare function formatDate(iso: ISODate | null | undefined, opts?: FormatDateOptions): string;
|
|
1106
1230
|
/** Parse typed text: dd/mm/yyyy (Buddhist years ≥ 2400 are converted), d-m-yyyy, d.m.yyyy, yyyy-mm-dd or '18 ก.ย. 2569' / '18 Sep 2026'. */
|
|
1107
1231
|
export declare function parseDate(text: string | null | undefined): ISODate | null;
|
|
1232
|
+
/** Today as an ISO date in an IANA time zone (e.g. `Asia/Bangkok`), or in the runtime's own zone without one. (4.19) */
|
|
1233
|
+
export declare function todayIn(timeZone?: string | null): ISODate;
|
|
1234
|
+
/** Format an ISO date for display. Without a `locale` it is Thai with Buddhist-era years **until 5.0, which makes it
|
|
1235
|
+
* English and Gregorian** like `@jirawatpyk/aura-react/server` and `useFormatDate()`. Pass `{ locale }` (or use
|
|
1236
|
+
* `useFormatDate()` in components) so the switch changes nothing for you; a call without one warns once in development. */
|
|
1237
|
+
export declare function formatDate(iso: ISODate | null | undefined, opts?: FormatDateOptions): string;
|
|
1108
1238
|
/** formatDate bound to the nearest AuraProvider: its locale and calendar (English, Gregorian without one).
|
|
1109
1239
|
* Options you pass still win. Use it in components; plain formatDate() stays for code outside React. */
|
|
1110
1240
|
export declare function useFormatDate(): (iso: ISODate | null | undefined, opts?: FormatDateOptions) => string;
|
|
@@ -1163,6 +1293,26 @@ export declare const Container: React$1.ForwardRefExoticComponent<ContainerProps
|
|
|
1163
1293
|
* Which one shows is decided in CSS (4.16), so the server's HTML is already right on a phone and nothing shifts on
|
|
1164
1294
|
* hydration; JavaScript only opens and closes the drawer. */
|
|
1165
1295
|
export declare const AppShell: React$1.ForwardRefExoticComponent<AppShellProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1296
|
+
/** ActionBar — a bar stuck to the bottom of the screen or of a card: a status line and the form's or selection's
|
|
1297
|
+
* actions. It is `position: sticky`, so it stays in the flow at the end of its parent and never covers the last field. */
|
|
1298
|
+
export declare const ActionBar: React$1.ForwardRefExoticComponent<ActionBarProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1299
|
+
/** Separator — a 1px `aura-border-default` rule between groups of content (4.20). Decorative by default (hidden from
|
|
1300
|
+
* screen readers); `decorative={false}` makes it a `role="separator"` that is announced. */
|
|
1301
|
+
export declare const Separator: React$1.ForwardRefExoticComponent<SeparatorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1302
|
+
/** A static table. Scrolls sideways inside its own box when it is wider than its container. */
|
|
1303
|
+
export declare const Table: React$1.ForwardRefExoticComponent<TableProps & React$1.RefAttributes<HTMLTableElement>>;
|
|
1304
|
+
export declare const THead: React$1.ForwardRefExoticComponent<TableSectionProps & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
1305
|
+
export declare const TBody: React$1.ForwardRefExoticComponent<TableSectionProps & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
1306
|
+
export declare const TFoot: React$1.ForwardRefExoticComponent<TableSectionProps & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
1307
|
+
export declare const Tr: React$1.ForwardRefExoticComponent<TableRowProps & React$1.RefAttributes<HTMLTableRowElement>>;
|
|
1308
|
+
/** Header cell. `scope` defaults to `col`; pass `scope="row"` for a row header in the body. */
|
|
1309
|
+
export declare const Th: React$1.ForwardRefExoticComponent<TableCellProps & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
1310
|
+
/** Data cell. `numeric` right-aligns with tabular figures (money, counts). */
|
|
1311
|
+
export declare const Td: React$1.ForwardRefExoticComponent<TableCellProps & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
1312
|
+
/** BottomNav — a phone tab bar: icon over a short label, a count or dot, the current page marked. Fixed to the bottom,
|
|
1313
|
+
* padded for the home indicator, with a spacer of the same height in the flow so nothing sits under it. Which
|
|
1314
|
+
* breakpoints show it is decided in CSS, so the server's HTML is already right and nothing shifts on hydration. */
|
|
1315
|
+
export declare const BottomNav: React$1.ForwardRefExoticComponent<BottomNavProps & React$1.RefAttributes<HTMLElement>>;
|
|
1166
1316
|
/** Min-width breakpoints in px, mirroring the aura-bp-* tokens. */
|
|
1167
1317
|
export declare const breakpoints: {
|
|
1168
1318
|
sm: 640;
|
|
@@ -1227,6 +1377,7 @@ export interface AuraStrings {
|
|
|
1227
1377
|
prevPage: string;
|
|
1228
1378
|
nextPage: string;
|
|
1229
1379
|
rowCount: (c: number) => string;
|
|
1380
|
+
totals: string;
|
|
1230
1381
|
actions: string;
|
|
1231
1382
|
optional: string;
|
|
1232
1383
|
timePlaceholder: string;
|
|
@@ -1267,6 +1418,8 @@ export interface AuraLocaleValue {
|
|
|
1267
1418
|
linkComponent?: React$1.ElementType | null | undefined;
|
|
1268
1419
|
/** The density set on the nearest AuraProvider that sets one (null: none, i.e. comfortable unless an ancestor's data-density says otherwise). */
|
|
1269
1420
|
density?: "comfortable" | "compact" | null | undefined;
|
|
1421
|
+
/** The time zone set on the nearest AuraProvider that sets one (4.19). */
|
|
1422
|
+
timeZone?: string | null | undefined;
|
|
1270
1423
|
}
|
|
1271
1424
|
/** Sets the language of built-in labels (and the default date locale) for everything inside. */
|
|
1272
1425
|
export declare function AuraProvider(props: AuraProviderProps): React$1.ReactElement;
|
package/dist/server/index.cjs
CHANGED
|
@@ -32,7 +32,8 @@ __export(server_exports, {
|
|
|
32
32
|
parseDate: () => parseDate,
|
|
33
33
|
parseTime: () => parseTime,
|
|
34
34
|
statusTone: () => toneFor,
|
|
35
|
-
toISO: () => toISO
|
|
35
|
+
toISO: () => toISO,
|
|
36
|
+
todayIn: () => todayIn
|
|
36
37
|
});
|
|
37
38
|
module.exports = __toCommonJS(server_exports);
|
|
38
39
|
|
|
@@ -112,6 +113,16 @@ function parseDate(text) {
|
|
|
112
113
|
const dt = new Date(y, mo - 1, d);
|
|
113
114
|
return dt.getMonth() === mo - 1 && dt.getDate() === d ? toISO(dt) : null;
|
|
114
115
|
}
|
|
116
|
+
function todayIn(timeZone) {
|
|
117
|
+
const now = /* @__PURE__ */ new Date();
|
|
118
|
+
if (!timeZone) return toISO(now);
|
|
119
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
120
|
+
timeZone,
|
|
121
|
+
year: "numeric",
|
|
122
|
+
month: "2-digit",
|
|
123
|
+
day: "2-digit"
|
|
124
|
+
}).format(now);
|
|
125
|
+
}
|
|
115
126
|
|
|
116
127
|
// src/text.ts
|
|
117
128
|
function formatBytes(n2) {
|
|
@@ -230,6 +241,7 @@ var STRINGS = {
|
|
|
230
241
|
},
|
|
231
242
|
prevPage: "Previous page",
|
|
232
243
|
nextPage: "Next page",
|
|
244
|
+
totals: "Totals",
|
|
233
245
|
rowCount: function(c) {
|
|
234
246
|
return n(c) + " rows";
|
|
235
247
|
},
|
|
@@ -343,6 +355,7 @@ var STRINGS = {
|
|
|
343
355
|
},
|
|
344
356
|
prevPage: "\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
|
|
345
357
|
nextPage: "\u0E2B\u0E19\u0E49\u0E32\u0E16\u0E31\u0E14\u0E44\u0E1B",
|
|
358
|
+
totals: "\u0E23\u0E27\u0E21",
|
|
346
359
|
rowCount: function(c) {
|
|
347
360
|
return n(c) + " \u0E41\u0E16\u0E27";
|
|
348
361
|
},
|
|
@@ -456,6 +469,7 @@ var STRINGS = {
|
|
|
456
469
|
},
|
|
457
470
|
prevPage: "F\xF6reg\xE5ende sida",
|
|
458
471
|
nextPage: "N\xE4sta sida",
|
|
472
|
+
totals: "Summa",
|
|
459
473
|
rowCount: function(c) {
|
|
460
474
|
return nsv(c) + " rader";
|
|
461
475
|
},
|
package/dist/server/index.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ export declare function toISO(d: Date | null | undefined): ISODate | null;
|
|
|
44
44
|
export declare function fromISO(s: ISODate | null | undefined): Date | null;
|
|
45
45
|
/** Parse typed text: dd/mm/yyyy (Buddhist years ≥ 2400 are converted), d-m-yyyy, d.m.yyyy, yyyy-mm-dd or '18 ก.ย. 2569' / '18 Sep 2026'. */
|
|
46
46
|
export declare function parseDate(text: string | null | undefined): ISODate | null;
|
|
47
|
+
/** Today as an ISO date in an IANA time zone (e.g. `Asia/Bangkok`), or in the runtime's own zone without one. (4.19) */
|
|
48
|
+
export declare function todayIn(timeZone?: string | null): ISODate;
|
|
47
49
|
/** 1536 → "1.5 KB". */
|
|
48
50
|
export declare function formatBytes(n: number | null | undefined): string;
|
|
49
51
|
/** Parse typed time: 9 · 09 · 930 · 0930 · 9:30 · 9.30 · 09.30 น. · 9:30 pm → "HH:mm" (24-hour) or null. */
|
|
@@ -102,6 +104,7 @@ export interface AuraStrings {
|
|
|
102
104
|
prevPage: string;
|
|
103
105
|
nextPage: string;
|
|
104
106
|
rowCount: (c: number) => string;
|
|
107
|
+
totals: string;
|
|
105
108
|
actions: string;
|
|
106
109
|
optional: string;
|
|
107
110
|
timePlaceholder: string;
|
package/dist/server/index.js
CHANGED
|
@@ -74,6 +74,16 @@ function parseDate(text) {
|
|
|
74
74
|
const dt = new Date(y, mo - 1, d);
|
|
75
75
|
return dt.getMonth() === mo - 1 && dt.getDate() === d ? toISO(dt) : null;
|
|
76
76
|
}
|
|
77
|
+
function todayIn(timeZone) {
|
|
78
|
+
const now = /* @__PURE__ */ new Date();
|
|
79
|
+
if (!timeZone) return toISO(now);
|
|
80
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
81
|
+
timeZone,
|
|
82
|
+
year: "numeric",
|
|
83
|
+
month: "2-digit",
|
|
84
|
+
day: "2-digit"
|
|
85
|
+
}).format(now);
|
|
86
|
+
}
|
|
77
87
|
|
|
78
88
|
// src/text.ts
|
|
79
89
|
function formatBytes(n2) {
|
|
@@ -192,6 +202,7 @@ var STRINGS = {
|
|
|
192
202
|
},
|
|
193
203
|
prevPage: "Previous page",
|
|
194
204
|
nextPage: "Next page",
|
|
205
|
+
totals: "Totals",
|
|
195
206
|
rowCount: function(c) {
|
|
196
207
|
return n(c) + " rows";
|
|
197
208
|
},
|
|
@@ -305,6 +316,7 @@ var STRINGS = {
|
|
|
305
316
|
},
|
|
306
317
|
prevPage: "\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
|
|
307
318
|
nextPage: "\u0E2B\u0E19\u0E49\u0E32\u0E16\u0E31\u0E14\u0E44\u0E1B",
|
|
319
|
+
totals: "\u0E23\u0E27\u0E21",
|
|
308
320
|
rowCount: function(c) {
|
|
309
321
|
return n(c) + " \u0E41\u0E16\u0E27";
|
|
310
322
|
},
|
|
@@ -418,6 +430,7 @@ var STRINGS = {
|
|
|
418
430
|
},
|
|
419
431
|
prevPage: "F\xF6reg\xE5ende sida",
|
|
420
432
|
nextPage: "N\xE4sta sida",
|
|
433
|
+
totals: "Summa",
|
|
421
434
|
rowCount: function(c) {
|
|
422
435
|
return nsv(c) + " rader";
|
|
423
436
|
},
|
|
@@ -764,5 +777,6 @@ export {
|
|
|
764
777
|
parseDate,
|
|
765
778
|
parseTime,
|
|
766
779
|
toneFor as statusTone,
|
|
767
|
-
toISO
|
|
780
|
+
toISO,
|
|
781
|
+
todayIn
|
|
768
782
|
};
|