@nxgt/material 3.33.0 → 3.35.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 +34 -0
- package/README.md +5 -5
- package/dist/{async-slice-Cll-4Mvg.js → async-slice-BNI_F0jz.js} +2 -2
- package/dist/{button-B47lM8a5.js → button-EMWOFSDB.js} +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-Bf80b1XT.js → chip-B6m3yagf.js} +1 -1
- package/dist/{code-editor-BLLpzmCc.js → code-editor-BdiufnpC.js} +4 -4
- package/dist/code-editor.js +4 -4
- package/dist/{code-language-items-COd99vab.js → code-language-items-v5Rnq425.js} +2 -2
- package/dist/{components-1vjs-YVY.js → components-C9Zz2dir.js} +16629 -13869
- package/dist/components.js +26 -26
- package/dist/{dialog-Cp7bS5LI.js → dialog-Cdv9IXVo.js} +1 -1
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-DJNMcPZa.js → dropdown-menu-CpSnRXd-.js} +1 -1
- package/dist/editor.js +7 -7
- package/dist/{empty-state-Dv9AtrMw.js → empty-state-DMr94lsF.js} +1 -1
- package/dist/hooks.js +2 -2
- package/dist/{i18n-provider-BBhhsa4I.js → i18n-provider-A4mI4vc1.js} +1 -1
- package/dist/i18n.js +5 -5
- package/dist/{icon-badge-DEk244kn.js → icon-badge-BFScQnp9.js} +1 -1
- package/dist/lib/components/ui/collections/server-table/bulk-action-targets.d.ts +11 -0
- package/dist/lib/components/ui/collections/server-table/bulk-action.d.ts +32 -0
- package/dist/lib/components/ui/collections/server-table/partials/server-table-bulk-buttons.d.ts +21 -0
- package/dist/lib/components/ui/collections/server-table/server-table.d.ts +1 -0
- package/dist/lib/components/ui/collections/server-table/types.d.ts +2 -1
- package/dist/lib/components/ui/dates/picker-trigger/typed-box-compact.d.ts +12 -0
- package/dist/lib/components/ui/dates/picker-trigger/typed-box.d.ts +6 -2
- package/dist/lib/components/ui/dates/picker-trigger/typed-trigger.d.ts +3 -2
- package/dist/lib/components/ui/dates/time-field/index.d.ts +1 -0
- package/dist/lib/components/ui/dates/time-field/partials/time-field-body.d.ts +2 -1
- package/dist/lib/components/ui/dates/time-field/partials/time-field-entry.d.ts +1 -0
- package/dist/lib/components/ui/dates/time-field/partials/time-field-typed.d.ts +2 -2
- package/dist/lib/components/ui/dates/time-field/time-field.d.ts +6 -1
- package/dist/lib/components/ui/dates/time-field/time-string-field.d.ts +14 -0
- package/dist/lib/components/ui/fields/attributes/attribute-dialog.d.ts +3 -1
- package/dist/lib/components/ui/fields/attributes/attribute-form/attribute-form.d.ts +3 -1
- package/dist/lib/components/ui/fields/attributes/attribute-form/attribute-text-form-fields.d.ts +6 -0
- package/dist/lib/components/ui/fields/attributes/attribute-form/consts.d.ts +7 -6
- package/dist/lib/components/ui/fields/attributes/attribute-form/use-attribute-form.d.ts +44 -0
- package/dist/lib/components/ui/fields/attributes/attributes-editor.d.ts +22 -0
- package/dist/lib/components/ui/fields/attributes/attributes-field/attributes-dialog-field.d.ts +14 -0
- package/dist/lib/components/ui/fields/attributes/attributes-field/attributes-field.d.ts +14 -12
- package/dist/lib/components/ui/fields/attributes/attributes-field/attributes-inline-field.d.ts +8 -0
- package/dist/lib/components/ui/fields/attributes/attributes-field/use-dialog-field.d.ts +15 -0
- package/dist/lib/components/ui/fields/attributes/attributes-form-field/attributes-form-field.d.ts +7 -1
- package/dist/lib/components/ui/fields/attributes/attributes-summary.d.ts +22 -0
- package/dist/lib/components/ui/fields/attributes/index.d.ts +3 -0
- package/dist/lib/components/ui/fields/attributes/logic/names.d.ts +13 -0
- package/dist/lib/components/ui/fields/attributes/logic/order.d.ts +15 -0
- package/dist/lib/components/ui/fields/attributes/logic/reorder-keys.d.ts +9 -0
- package/dist/lib/components/ui/fields/attributes/logic/value.d.ts +42 -0
- package/dist/lib/components/ui/fields/attributes/models/attribute.d.ts +5 -1
- package/dist/lib/components/ui/fields/attributes/partials/attribute-row.d.ts +18 -0
- package/dist/lib/components/ui/fields/attributes/partials/default-choices.d.ts +5 -0
- package/dist/lib/components/ui/fields/attributes/partials/default-field.d.ts +12 -0
- package/dist/lib/components/ui/fields/attributes/partials/default-inputs.d.ts +16 -0
- package/dist/lib/components/ui/fields/attributes/partials/editor-notes.d.ts +11 -0
- package/dist/lib/components/ui/fields/attributes/partials/labeled.d.ts +10 -0
- package/dist/lib/components/ui/fields/attributes/partials/name-field.d.ts +15 -0
- package/dist/lib/components/ui/fields/attributes/partials/options-field.d.ts +11 -0
- package/dist/lib/components/ui/fields/attributes/partials/phone-sheet.d.ts +12 -0
- package/dist/lib/components/ui/fields/attributes/partials/reorder-handle.d.ts +19 -0
- package/dist/lib/components/ui/fields/attributes/partials/row-fields.d.ts +16 -0
- package/dist/lib/components/ui/fields/attributes/partials/row-footer.d.ts +12 -0
- package/dist/lib/components/ui/fields/attributes/partials/row-head.d.ts +12 -0
- package/dist/lib/components/ui/fields/attributes/partials/row-panel.d.ts +15 -0
- package/dist/lib/components/ui/fields/attributes/partials/rows-dnd.d.ts +11 -0
- package/dist/lib/components/ui/fields/attributes/partials/simple-fields.d.ts +20 -0
- package/dist/lib/components/ui/fields/attributes/partials/summary-item.d.ts +9 -0
- package/dist/lib/components/ui/fields/attributes/partials/type-icon.d.ts +13 -0
- package/dist/lib/components/ui/fields/attributes/partials/value-text.d.ts +12 -0
- package/dist/lib/components/ui/fields/attributes/schema.d.ts +32 -0
- package/dist/lib/components/ui/fields/attributes/use-announce.d.ts +14 -0
- package/dist/lib/components/ui/fields/attributes/use-attribute-text.d.ts +13 -0
- package/dist/lib/components/ui/fields/attributes/use-attributes-editor.d.ts +34 -0
- package/dist/lib/components/ui/fields/attributes/use-reorder.d.ts +26 -0
- package/dist/lib/components/ui/fields/contacts/contacts-dialog-form-field.d.ts +9 -0
- package/dist/lib/components/ui/fields/contacts/contacts-editor.d.ts +29 -0
- package/dist/lib/components/ui/fields/contacts/contacts-form-field.d.ts +14 -1
- package/dist/lib/components/ui/fields/contacts/contacts-summary.d.ts +23 -0
- package/dist/lib/components/ui/fields/contacts/index.d.ts +3 -0
- package/dist/lib/components/ui/fields/contacts/logic/check-contact.d.ts +11 -0
- package/dist/lib/components/ui/fields/contacts/logic/contact-action.d.ts +11 -0
- package/dist/lib/components/ui/fields/contacts/logic/duplicates.d.ts +17 -0
- package/dist/lib/components/ui/fields/contacts/logic/issues.d.ts +7 -0
- package/dist/lib/components/ui/fields/contacts/logic/primary.d.ts +33 -0
- package/dist/lib/components/ui/fields/contacts/models.d.ts +7 -0
- package/dist/lib/components/ui/fields/contacts/partials/contact-fields.d.ts +29 -0
- package/dist/lib/components/ui/fields/contacts/partials/contact-links.d.ts +15 -0
- package/dist/lib/components/ui/fields/contacts/partials/contact-row.d.ts +14 -0
- package/dist/lib/components/ui/fields/contacts/partials/phone-sheet.d.ts +14 -0
- package/dist/lib/components/ui/fields/contacts/partials/quick-add.d.ts +12 -0
- package/dist/lib/components/ui/fields/contacts/partials/row-actions.d.ts +16 -0
- package/dist/lib/components/ui/fields/contacts/partials/summary-item.d.ts +11 -0
- package/dist/lib/components/ui/fields/contacts/partials/summary-row.d.ts +14 -0
- package/dist/lib/components/ui/fields/contacts/partials/type-group.d.ts +15 -0
- package/dist/lib/components/ui/fields/contacts/partials/type-icon.d.ts +12 -0
- package/dist/lib/components/ui/fields/contacts/partials/value-field.d.ts +25 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +2 -0
- package/dist/lib/components/ui/fields/contacts/schema.d.ts +18 -0
- package/dist/lib/components/ui/fields/contacts/use-contact-text.d.ts +9 -0
- package/dist/lib/components/ui/fields/contacts/use-contacts-editor.d.ts +33 -0
- package/dist/lib/components/ui/fields/inline-editor/action-tone.d.ts +2 -0
- package/dist/lib/components/ui/fields/inline-editor/editor-header.d.ts +19 -0
- package/dist/lib/components/ui/fields/inline-editor/editor-sheet.d.ts +20 -0
- package/dist/lib/components/ui/fields/inline-editor/empty-summary.d.ts +19 -0
- package/dist/lib/components/ui/fields/inline-editor/use-focus-request.d.ts +13 -0
- package/dist/lib/components/ui/fields/inline-editor/use-row-ids.d.ts +13 -0
- package/dist/lib/components/ui/fields/opening-hours/consts.d.ts +17 -3
- package/dist/lib/components/ui/fields/opening-hours/index.d.ts +2 -0
- package/dist/lib/components/ui/fields/opening-hours/logic/edit-days.d.ts +9 -0
- package/dist/lib/components/ui/fields/opening-hours/logic/first-day.d.ts +14 -0
- package/dist/lib/components/ui/fields/opening-hours/logic/format.d.ts +6 -0
- package/dist/lib/components/ui/fields/opening-hours/logic/group.d.ts +13 -0
- package/dist/lib/components/ui/fields/opening-hours/logic/range-errors.d.ts +20 -0
- package/dist/lib/components/ui/fields/opening-hours/logic/status.d.ts +19 -0
- package/dist/lib/components/ui/fields/opening-hours/logic/week.d.ts +32 -0
- package/dist/lib/components/ui/fields/opening-hours/logic/zoned.d.ts +10 -0
- package/dist/lib/components/ui/fields/opening-hours/opening-hours-dialog-form-field.d.ts +10 -0
- package/dist/lib/components/ui/fields/opening-hours/opening-hours-editor.d.ts +26 -0
- package/dist/lib/components/ui/fields/opening-hours/opening-hours-form-field.d.ts +17 -1
- package/dist/lib/components/ui/fields/opening-hours/opening-hours-summary.d.ts +32 -0
- package/dist/lib/components/ui/fields/opening-hours/partials/copy-chips.d.ts +12 -0
- package/dist/lib/components/ui/fields/opening-hours/partials/copy-menu.d.ts +10 -0
- package/dist/lib/components/ui/fields/opening-hours/partials/day-controls.d.ts +14 -0
- package/dist/lib/components/ui/fields/opening-hours/partials/day-row.d.ts +15 -0
- package/dist/lib/components/ui/fields/opening-hours/partials/day-summary-row.d.ts +15 -0
- package/dist/lib/components/ui/fields/opening-hours/partials/group-row.d.ts +13 -0
- package/dist/lib/components/ui/fields/opening-hours/partials/phone-sheet.d.ts +18 -0
- package/dist/lib/components/ui/fields/opening-hours/partials/range-field-props.d.ts +28 -0
- package/dist/lib/components/ui/fields/opening-hours/partials/range-row.d.ts +24 -0
- package/dist/lib/components/ui/fields/opening-hours/partials/status-pill.d.ts +13 -0
- package/dist/lib/components/ui/fields/opening-hours/use-first-day.d.ts +8 -0
- package/dist/lib/components/ui/fields/opening-hours/use-hours-editor.d.ts +26 -0
- package/dist/lib/components/ui/fields/opening-hours/use-hours-text.d.ts +8 -0
- package/dist/lib/components/ui/fields/opening-hours/use-now.d.ts +6 -0
- package/dist/lib/i18n/resources/en/en.d.ts +77 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +89 -12
- package/dist/lib/i18n/resources/fr/fr.d.ts +77 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +89 -12
- package/dist/lib/i18n/resources/resources.d.ts +154 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +43 -43
- package/dist/map.js +4 -4
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +2 -2
- package/dist/{public-Cvwb2tds.js → public-CYdnlHqA.js} +6 -6
- package/dist/{rich-code-block-MItKFVB-.js → rich-code-block-Bwhfhu7J.js} +4 -4
- package/dist/{sortable-provider-CIlK0Vuk.js → sortable-provider-CY_YD3Ee.js} +1 -1
- package/dist/{spinner-DRGPXRNW.js → spinner-CKlDba5I.js} +1 -1
- package/dist/{stored-language-CkPRWAaM.js → stored-language-CfQGHLq9.js} +182 -24
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-CPzxOW_X.js → theme-toggle--Zcf5AM8.js} +1 -1
- package/dist/{toolbar-items-GIaifZbx.js → toolbar-items-B1W-uVHS.js} +2 -2
- package/dist/{translate-material-BEQGLLY7.js → translate-material-xDh10aWZ.js} +2 -2
- package/dist/{translator-Ec9Uj32C.js → translator-BbOZntEF.js} +1 -1
- package/dist/{use-chat-composer-BEs82Xar.js → use-chat-composer-CoyqPKbt.js} +12 -12
- package/dist/{use-heading-spy-BRAPVvfh.js → use-heading-spy-DXYCeegh.js} +1 -1
- package/dist/{use-material-translation-B0RHv3l7.js → use-material-translation-BK2YYCY3.js} +2 -2
- package/docs/components/data-table-filter-and-lists.md +29 -1
- package/docs/components/date-and-time.md +9 -1
- package/docs/components/form-fields.md +298 -67
- package/docs/guides/forms.md +18 -12
- package/docs/guides/i18n.md +2 -1
- package/docs/guides/ssr.md +1 -0
- package/docs/previews/form-fields-contacts.webp +0 -0
- package/docs/previews/form-fields-openinghours.webp +0 -0
- package/package.json +1 -1
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { UseControllerProps } from 'react-hook-form';
|
|
3
|
+
import { WeekStart } from './logic/week.js';
|
|
3
4
|
export type OpeningHoursFormFieldProps<T extends Record<string, any>> = Pick<UseControllerProps<T>, 'control' | 'name'> & {
|
|
4
5
|
className?: string;
|
|
5
6
|
disabled?: boolean;
|
|
6
7
|
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* `'inline'` (the default) edits the week in place
|
|
10
|
+
* (`OpeningHoursEditor`); `'dialog'` keeps the list and the dialog that
|
|
11
|
+
* edits one range at a time.
|
|
12
|
+
*/
|
|
13
|
+
editing?: 'inline' | 'dialog';
|
|
14
|
+
/** `editing="dialog"` only: the "Add All Days" button. */
|
|
7
15
|
showAddAllDays?: boolean;
|
|
16
|
+
/** `editing="inline"` only: the first day of the week, `0` Sunday. */
|
|
17
|
+
weekStartsOn?: WeekStart;
|
|
18
|
+
/** `editing="inline"` only: the locale of day and time names. */
|
|
19
|
+
locale?: string;
|
|
8
20
|
} & Omit<ComponentProps<'div'>, 'name'>;
|
|
9
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Opening hours in a React Hook Form field (an array of one entry per
|
|
23
|
+
* range). Inline by default; `editing="dialog"` is today's list and dialog.
|
|
24
|
+
*/
|
|
25
|
+
export declare function OpeningHoursFormField<T extends Record<string, any>>({ editing, showAddAllDays, weekStartsOn, locale, ...props }: OpeningHoursFormFieldProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { WeekStart } from './logic/week.js';
|
|
3
|
+
import { OpeningHoursFieldValue } from './models.js';
|
|
4
|
+
export type OpeningHoursSummaryProps = {
|
|
5
|
+
/** The hours, in the value model of `OpeningHours`. */
|
|
6
|
+
data?: OpeningHoursFieldValue[] | null;
|
|
7
|
+
/** Names the region; "Opening Hours" by default. */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** The moment to read as now (tests, stories); the clock by default. */
|
|
10
|
+
now?: Date;
|
|
11
|
+
/** The IANA zone of the place ("America/Toronto"); the viewer's by default. */
|
|
12
|
+
timeZone?: string;
|
|
13
|
+
/** The locale of day and time names; the `I18nProvider` language by default. */
|
|
14
|
+
locale?: string;
|
|
15
|
+
/** The first day of the week, `0` Sunday; the locale's by default. */
|
|
16
|
+
weekStartsOn?: WeekStart;
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* What shows when there is nothing to list. A quiet "Hours not set" by default; your
|
|
20
|
+
* node replaces it, and `null` renders nothing.
|
|
21
|
+
*/
|
|
22
|
+
empty?: ReactNode;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The read-only counterpart of `OpeningHoursEditor`: whether the place is
|
|
26
|
+
* open now ("Open · closes at 6:00 PM", "Closed · opens Monday at 9:00 AM"),
|
|
27
|
+
* then the week with identical consecutive days grouped ("Mon–Fri
|
|
28
|
+
* 9:00 AM – 6:00 PM") and today's group marked. Times are the locale's; the
|
|
29
|
+
* status reads the clock in `timeZone`. Without `now` the status appears
|
|
30
|
+
* once the page has mounted, so a server render and its hydration match.
|
|
31
|
+
*/
|
|
32
|
+
export declare function OpeningHoursSummary({ data, label, now, timeZone, locale, weekStartsOn, className, empty, }: OpeningHoursSummaryProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HoursText } from '../use-hours-text.js';
|
|
2
|
+
type CopyChipsProps = {
|
|
3
|
+
text: HoursText;
|
|
4
|
+
/** The day copied from, left out of the chips. */
|
|
5
|
+
index: number;
|
|
6
|
+
order: readonly number[];
|
|
7
|
+
targets: readonly number[];
|
|
8
|
+
onToggle: (day: number) => void;
|
|
9
|
+
};
|
|
10
|
+
/** "Copy to…": one toggle chip for each other day of the week. */
|
|
11
|
+
export declare function CopyChips({ text, index, order, targets, onToggle, }: CopyChipsProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HoursText } from '../use-hours-text.js';
|
|
2
|
+
type CopyMenuProps = {
|
|
3
|
+
text: HoursText;
|
|
4
|
+
from: number;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onCopy: (to: number[]) => void;
|
|
7
|
+
};
|
|
8
|
+
/** "Copy to": Monday to Friday, the weekend, or all days. */
|
|
9
|
+
export declare function CopyMenu({ text, from, disabled, onCopy }: CopyMenuProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FocusRequest } from '../../inline-editor/use-focus-request.js';
|
|
2
|
+
import { Day } from '../logic/week.js';
|
|
3
|
+
import { HoursText } from '../use-hours-text.js';
|
|
4
|
+
type DayControlsProps = {
|
|
5
|
+
text: HoursText;
|
|
6
|
+
index: number;
|
|
7
|
+
day: Day;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
focus: Pick<FocusRequest, 'key' | 'request'>;
|
|
10
|
+
onChange: (day: Day) => void;
|
|
11
|
+
};
|
|
12
|
+
/** A day's switch, its ranges and the button that adds one. */
|
|
13
|
+
export declare function DayControls({ text, index, day, disabled, focus, onChange, }: DayControlsProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FocusRequest } from '../../inline-editor/use-focus-request.js';
|
|
2
|
+
import { Day } from '../logic/week.js';
|
|
3
|
+
import { HoursText } from '../use-hours-text.js';
|
|
4
|
+
type DayRowProps = {
|
|
5
|
+
text: HoursText;
|
|
6
|
+
index: number;
|
|
7
|
+
day: Day;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
focus: Pick<FocusRequest, 'key' | 'request'>;
|
|
10
|
+
onChange: (day: Day) => void;
|
|
11
|
+
onCopy: (to: number[]) => void;
|
|
12
|
+
};
|
|
13
|
+
/** A day on a wide screen: its name, its controls and the "Copy to" menu. */
|
|
14
|
+
export declare function DayRow({ text, index, day, disabled, focus, onChange, onCopy, }: DayRowProps): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Day } from '../logic/week.js';
|
|
2
|
+
import { HoursText } from '../use-hours-text.js';
|
|
3
|
+
/** The text under a day's name: its ranges, or that it is closed. */
|
|
4
|
+
export declare function daySummary(text: HoursText, day: Day): string;
|
|
5
|
+
type DaySummaryRowProps = {
|
|
6
|
+
text: HoursText;
|
|
7
|
+
index: number;
|
|
8
|
+
day: Day;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onOpen: () => void;
|
|
11
|
+
onChange: (day: Day) => void;
|
|
12
|
+
};
|
|
13
|
+
/** A phone's row for a day: a summary and a chevron that opens its sheet. */
|
|
14
|
+
export declare function DaySummaryRow({ text, index, day, disabled, onOpen, onChange, }: DaySummaryRowProps): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Group } from '../logic/group.js';
|
|
2
|
+
import { HoursText } from '../use-hours-text.js';
|
|
3
|
+
type GroupRowProps = {
|
|
4
|
+
text: HoursText;
|
|
5
|
+
group: Group;
|
|
6
|
+
today: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A run of identical days and its hours. Today's group has the selected-row
|
|
10
|
+
* look (a tint and a 3px start bar) and a "Today" tag.
|
|
11
|
+
*/
|
|
12
|
+
export declare function GroupRow({ text, group, today }: GroupRowProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FocusRequest } from '../../inline-editor/use-focus-request.js';
|
|
2
|
+
import { Day } from '../logic/week.js';
|
|
3
|
+
import { HoursText } from '../use-hours-text.js';
|
|
4
|
+
type PhoneSheetProps = {
|
|
5
|
+
text: HoursText;
|
|
6
|
+
/** The day being edited; `null` keeps the sheet closed. */
|
|
7
|
+
index: number | null;
|
|
8
|
+
day?: Day;
|
|
9
|
+
order: readonly number[];
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
focus: Pick<FocusRequest, 'key' | 'request'>;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
onChange: (day: Day) => void;
|
|
14
|
+
onCopy: (from: number, to: number[]) => void;
|
|
15
|
+
};
|
|
16
|
+
/** A phone's editor for one day: its controls and copy-to day chips. */
|
|
17
|
+
export declare function PhoneSheet({ text, index, day, order, disabled, focus, onClose, onChange, onCopy, }: PhoneSheetProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HoursRangeError } from '../logic/range-errors.js';
|
|
2
|
+
import { HoursRange } from '../logic/week.js';
|
|
3
|
+
import { HoursText } from '../use-hours-text.js';
|
|
4
|
+
type Options = {
|
|
5
|
+
text: HoursText;
|
|
6
|
+
key: 'o' | 'c';
|
|
7
|
+
day: number;
|
|
8
|
+
/** Position of the range in its day, from 1. */
|
|
9
|
+
n: number;
|
|
10
|
+
range: HoursRange;
|
|
11
|
+
error?: HoursRangeError;
|
|
12
|
+
errorId: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onChange: (range: HoursRange) => void;
|
|
15
|
+
};
|
|
16
|
+
/** The props of one compact time field of a range (`o` opens, `c` closes). */
|
|
17
|
+
export declare function rangeFieldProps({ text, key, day, n, range, error, errorId, disabled, onChange, }: Options): {
|
|
18
|
+
size: "sm";
|
|
19
|
+
clearable: boolean;
|
|
20
|
+
disabled: boolean | undefined;
|
|
21
|
+
value: string;
|
|
22
|
+
error: boolean;
|
|
23
|
+
'aria-describedby': string | undefined;
|
|
24
|
+
className: string;
|
|
25
|
+
'aria-label': string;
|
|
26
|
+
onValueChange: (value?: string) => void;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HoursRangeError } from '../logic/range-errors.js';
|
|
2
|
+
import { HoursRange } from '../logic/week.js';
|
|
3
|
+
import { HoursText } from '../use-hours-text.js';
|
|
4
|
+
type RangeRowProps = {
|
|
5
|
+
text: HoursText;
|
|
6
|
+
day: number;
|
|
7
|
+
/** Position of the range in its day, from 0. */
|
|
8
|
+
index: number;
|
|
9
|
+
range: HoursRange;
|
|
10
|
+
error?: HoursRangeError;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** The scoped focus keys of the two time fields. */
|
|
13
|
+
focusKeys: {
|
|
14
|
+
open: string;
|
|
15
|
+
close: string;
|
|
16
|
+
};
|
|
17
|
+
onChange: (range: HoursRange) => void;
|
|
18
|
+
onRemove: () => void;
|
|
19
|
+
};
|
|
20
|
+
/** One range of a day: opening and closing time, remove, and its error. */
|
|
21
|
+
export declare function RangeRow({ text, day, index, range, error, disabled, focusKeys, onChange, onRemove, }: RangeRowProps): import("react").JSX.Element;
|
|
22
|
+
/** The sentence for a range error. */
|
|
23
|
+
export declare function errorText({ t }: HoursText, error: HoursRangeError): string;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Status } from '../logic/status.js';
|
|
2
|
+
import { HoursText } from '../use-hours-text.js';
|
|
3
|
+
/** "Open · closes at 6:00 PM" or "Closed · opens Monday at 9:00 AM". */
|
|
4
|
+
export declare function statusDetail(text: HoursText, status: Status, today: number): string | null;
|
|
5
|
+
type StatusPillProps = {
|
|
6
|
+
text: HoursText;
|
|
7
|
+
status: Status;
|
|
8
|
+
today: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
/** The tonal pill that says whether the place is open now, and what is next. */
|
|
12
|
+
export declare function StatusPill({ text, status, today, className, }: StatusPillProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WeekStart } from './logic/week.js';
|
|
2
|
+
/**
|
|
3
|
+
* The first day of the week: `weekStartsOn` when given, else the locale's.
|
|
4
|
+
* Until the page has mounted the answer comes from the language alone, the
|
|
5
|
+
* same on a server and in a browser, so hydration matches; then the locale's
|
|
6
|
+
* own week info replaces it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useFirstDay(locale: string, weekStartsOn?: WeekStart): WeekStart;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Day } from './logic/week.js';
|
|
2
|
+
import { OpeningHoursFieldValue } from './models.js';
|
|
3
|
+
import { HoursText } from './use-hours-text.js';
|
|
4
|
+
type Options = {
|
|
5
|
+
value: OpeningHoursFieldValue[] | undefined;
|
|
6
|
+
onValueChange?: (value: OpeningHoursFieldValue[]) => void;
|
|
7
|
+
text: HoursText;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The week an editor shows, how it changes the value, its copy note, and the
|
|
11
|
+
* focus hand-off a day's controls use after a range is added or removed.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useHoursEditor({ value, onValueChange, text }: Options): {
|
|
14
|
+
focus: {
|
|
15
|
+
key: (name: string) => string;
|
|
16
|
+
request: (name: string) => void;
|
|
17
|
+
};
|
|
18
|
+
week: import('./logic/week.js').Week;
|
|
19
|
+
note: string;
|
|
20
|
+
sheet: number | null;
|
|
21
|
+
setSheet: import('react').Dispatch<import('react').SetStateAction<number | null>>;
|
|
22
|
+
issues: number;
|
|
23
|
+
setDay: (index: number, day: Day) => void;
|
|
24
|
+
copy: (from: number, to: number[]) => void;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The translator and the locale the hours components print with. */
|
|
2
|
+
export declare function useHoursText(locale?: string): {
|
|
3
|
+
t: (key: import('../../../../i18n/index.js').MaterialLocaleKey, fallback: string, options?: import('../../../../i18n/index.js').TranslationContext) => string;
|
|
4
|
+
locale: string;
|
|
5
|
+
time: (value: string) => string;
|
|
6
|
+
day: (day: number, width?: "long" | "short") => string;
|
|
7
|
+
};
|
|
8
|
+
export type HoursText = ReturnType<typeof useHoursText>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The moment the summary reads: `now` when given, else the clock, once the
|
|
3
|
+
* page has mounted and every minute after. `null` before that, so a server
|
|
4
|
+
* and a hydrating client render the same (no status, no "today").
|
|
5
|
+
*/
|
|
6
|
+
export declare function useNow(now?: Date): Date | null;
|
|
@@ -416,10 +416,20 @@ export declare const en: {
|
|
|
416
416
|
cancel: string;
|
|
417
417
|
remove: string;
|
|
418
418
|
"add-option": string;
|
|
419
|
+
done: string;
|
|
420
|
+
"remove-row": string;
|
|
421
|
+
"edit-row": string;
|
|
422
|
+
reorder: string;
|
|
419
423
|
};
|
|
420
424
|
labels: {
|
|
425
|
+
none: string;
|
|
421
426
|
"new-attribute": string;
|
|
422
427
|
attributes: string;
|
|
428
|
+
default: string;
|
|
429
|
+
yes: string;
|
|
430
|
+
no: string;
|
|
431
|
+
hint: string;
|
|
432
|
+
untitled: string;
|
|
423
433
|
};
|
|
424
434
|
messages: {
|
|
425
435
|
"create-succeeded": string;
|
|
@@ -428,6 +438,7 @@ export declare const en: {
|
|
|
428
438
|
empty: string;
|
|
429
439
|
"add-first": string;
|
|
430
440
|
dialog: string;
|
|
441
|
+
sheet: string;
|
|
431
442
|
};
|
|
432
443
|
types: {
|
|
433
444
|
color: string;
|
|
@@ -486,6 +497,17 @@ export declare const en: {
|
|
|
486
497
|
placeholder: string;
|
|
487
498
|
};
|
|
488
499
|
};
|
|
500
|
+
errors: {
|
|
501
|
+
duplicate: string;
|
|
502
|
+
empty: string;
|
|
503
|
+
issues: string;
|
|
504
|
+
};
|
|
505
|
+
announce: {
|
|
506
|
+
lift: string;
|
|
507
|
+
move: string;
|
|
508
|
+
drop: string;
|
|
509
|
+
cancel: string;
|
|
510
|
+
};
|
|
489
511
|
};
|
|
490
512
|
table: {
|
|
491
513
|
loading: string;
|
|
@@ -545,6 +567,9 @@ export declare const en: {
|
|
|
545
567
|
type: string;
|
|
546
568
|
value: string;
|
|
547
569
|
label: string;
|
|
570
|
+
"row-type": string;
|
|
571
|
+
"row-value": string;
|
|
572
|
+
"row-label": string;
|
|
548
573
|
};
|
|
549
574
|
types: {
|
|
550
575
|
phone: string;
|
|
@@ -569,14 +594,35 @@ export declare const en: {
|
|
|
569
594
|
edit: string;
|
|
570
595
|
save: string;
|
|
571
596
|
cancel: string;
|
|
597
|
+
"make-primary": string;
|
|
598
|
+
"is-primary": string;
|
|
599
|
+
call: string;
|
|
600
|
+
"send-email": string;
|
|
601
|
+
"open-site": string;
|
|
602
|
+
"copy-value": string;
|
|
603
|
+
done: string;
|
|
604
|
+
"remove-row": string;
|
|
605
|
+
"add-type": string;
|
|
572
606
|
};
|
|
573
607
|
messages: {
|
|
574
608
|
"no-contacts": string;
|
|
575
609
|
"add-first": string;
|
|
576
610
|
dialog: string;
|
|
611
|
+
sheet: string;
|
|
577
612
|
};
|
|
578
613
|
labels: {
|
|
614
|
+
none: string;
|
|
579
615
|
contacts: string;
|
|
616
|
+
primary: string;
|
|
617
|
+
group: string;
|
|
618
|
+
};
|
|
619
|
+
errors: {
|
|
620
|
+
email: string;
|
|
621
|
+
phone: string;
|
|
622
|
+
website: string;
|
|
623
|
+
duplicate: string;
|
|
624
|
+
empty: string;
|
|
625
|
+
issues: string;
|
|
580
626
|
};
|
|
581
627
|
};
|
|
582
628
|
"opening-hours": {
|
|
@@ -585,6 +631,9 @@ export declare const en: {
|
|
|
585
631
|
openTime: string;
|
|
586
632
|
closeTime: string;
|
|
587
633
|
isClosed: string;
|
|
634
|
+
"range-open": string;
|
|
635
|
+
"range-close": string;
|
|
636
|
+
"day-open": string;
|
|
588
637
|
};
|
|
589
638
|
days: {
|
|
590
639
|
"0": string;
|
|
@@ -616,16 +665,42 @@ export declare const en: {
|
|
|
616
665
|
edit: string;
|
|
617
666
|
save: string;
|
|
618
667
|
cancel: string;
|
|
668
|
+
"add-range": string;
|
|
669
|
+
"remove-range": string;
|
|
670
|
+
"copy-to": string;
|
|
671
|
+
copy: string;
|
|
672
|
+
done: string;
|
|
619
673
|
};
|
|
620
674
|
labels: {
|
|
621
675
|
"closed-all-day": string;
|
|
622
676
|
"open-hours": string;
|
|
677
|
+
today: string;
|
|
678
|
+
open: string;
|
|
679
|
+
closed: string;
|
|
680
|
+
"copy-weekdays": string;
|
|
681
|
+
"copy-weekend": string;
|
|
682
|
+
"copy-all": string;
|
|
683
|
+
copied: string;
|
|
684
|
+
"copy-days": string;
|
|
623
685
|
};
|
|
624
686
|
messages: {
|
|
625
687
|
"no-hours": string;
|
|
626
688
|
"add-first": string;
|
|
627
689
|
dialog: string;
|
|
628
690
|
};
|
|
691
|
+
status: {
|
|
692
|
+
"closes-at": string;
|
|
693
|
+
"opens-at": string;
|
|
694
|
+
"opens-tomorrow": string;
|
|
695
|
+
"opens-day": string;
|
|
696
|
+
unset: string;
|
|
697
|
+
};
|
|
698
|
+
errors: {
|
|
699
|
+
close: string;
|
|
700
|
+
overlap: string;
|
|
701
|
+
missing: string;
|
|
702
|
+
issues: string;
|
|
703
|
+
};
|
|
629
704
|
};
|
|
630
705
|
"postal-address": {
|
|
631
706
|
fields: {
|
|
@@ -1999,6 +2074,8 @@ export declare const en: {
|
|
|
1999
2074
|
"past-end-status": string;
|
|
2000
2075
|
error: string;
|
|
2001
2076
|
"error-hint": string;
|
|
2077
|
+
"bulk-action": string;
|
|
2078
|
+
"bulk-action-name": string;
|
|
2002
2079
|
};
|
|
2003
2080
|
"list-empty": {
|
|
2004
2081
|
clear: string;
|
|
@@ -405,11 +405,21 @@ declare const _default: {
|
|
|
405
405
|
"save": "Save",
|
|
406
406
|
"cancel": "Cancel",
|
|
407
407
|
"remove": "Delete",
|
|
408
|
-
"add-option": "Add option"
|
|
408
|
+
"add-option": "Add option",
|
|
409
|
+
"done": "Done",
|
|
410
|
+
"remove-row": "Remove {name}",
|
|
411
|
+
"edit-row": "Edit {name}",
|
|
412
|
+
"reorder": "Reorder {name}"
|
|
409
413
|
},
|
|
410
414
|
"labels": {
|
|
415
|
+
"none": "No attributes",
|
|
411
416
|
"new-attribute": "New attribute",
|
|
412
|
-
"attributes": "Attributes"
|
|
417
|
+
"attributes": "Attributes",
|
|
418
|
+
"default": "Default",
|
|
419
|
+
"yes": "Yes",
|
|
420
|
+
"no": "No",
|
|
421
|
+
"hint": "Drag the handle, or press Space, then ↑ ↓, Space to drop, Esc to cancel",
|
|
422
|
+
"untitled": "Untitled attribute"
|
|
413
423
|
},
|
|
414
424
|
"messages": {
|
|
415
425
|
"create-succeeded": "Attribute successfully created",
|
|
@@ -417,7 +427,8 @@ declare const _default: {
|
|
|
417
427
|
"delete-succeeded": "{count, plural, one {Attribute successfully deleted} other {# attributes successfully deleted}}",
|
|
418
428
|
"empty": "No attributes yet",
|
|
419
429
|
"add-first": "Add an attribute to get started.",
|
|
420
|
-
"dialog": "Name, type, and optional defaults."
|
|
430
|
+
"dialog": "Name, type, and optional defaults.",
|
|
431
|
+
"sheet": "Edit this attribute."
|
|
421
432
|
},
|
|
422
433
|
"types": {
|
|
423
434
|
"color": "Color",
|
|
@@ -475,6 +486,17 @@ declare const _default: {
|
|
|
475
486
|
"label": "Unit",
|
|
476
487
|
"placeholder": "Enter unit (e.g., kg, cm)"
|
|
477
488
|
}
|
|
489
|
+
},
|
|
490
|
+
"errors": {
|
|
491
|
+
"duplicate": "Another attribute already has this name.",
|
|
492
|
+
"empty": "Enter a name.",
|
|
493
|
+
"issues": "{count, plural, one {# issue to fix} other {# issues to fix}}"
|
|
494
|
+
},
|
|
495
|
+
"announce": {
|
|
496
|
+
"lift": "Picked up {name}, position {position} of {count}. Use the arrow keys to move it, Space to drop it, Escape to cancel.",
|
|
497
|
+
"move": "{name} moved to position {position} of {count}.",
|
|
498
|
+
"drop": "{name} dropped at position {position} of {count}.",
|
|
499
|
+
"cancel": "Reorder cancelled. {name} is back at position {position} of {count}."
|
|
478
500
|
}
|
|
479
501
|
},
|
|
480
502
|
"table": {
|
|
@@ -534,7 +556,10 @@ declare const _default: {
|
|
|
534
556
|
"fields": {
|
|
535
557
|
"type": "Type",
|
|
536
558
|
"value": "Value",
|
|
537
|
-
"label": "Label"
|
|
559
|
+
"label": "Label",
|
|
560
|
+
"row-type": "{type} {n}: type",
|
|
561
|
+
"row-value": "{type} {n}: value",
|
|
562
|
+
"row-label": "{type} {n}: label"
|
|
538
563
|
},
|
|
539
564
|
"types": {
|
|
540
565
|
"phone": "Phone",
|
|
@@ -558,15 +583,36 @@ declare const _default: {
|
|
|
558
583
|
"remove": "Remove Contact",
|
|
559
584
|
"edit": "Edit contact",
|
|
560
585
|
"save": "Save",
|
|
561
|
-
"cancel": "Cancel"
|
|
586
|
+
"cancel": "Cancel",
|
|
587
|
+
"make-primary": "Make primary",
|
|
588
|
+
"is-primary": "Primary for this type",
|
|
589
|
+
"call": "Call",
|
|
590
|
+
"send-email": "Send an email",
|
|
591
|
+
"open-site": "Open site",
|
|
592
|
+
"copy-value": "Copy {value}",
|
|
593
|
+
"done": "Done",
|
|
594
|
+
"remove-row": "Remove {type} {n}",
|
|
595
|
+
"add-type": "Add {type}"
|
|
562
596
|
},
|
|
563
597
|
"messages": {
|
|
564
598
|
"no-contacts": "No contacts added yet",
|
|
565
599
|
"add-first": "Click the button below to add a contact",
|
|
566
|
-
"dialog": "Type, value, and an optional label."
|
|
600
|
+
"dialog": "Type, value, and an optional label.",
|
|
601
|
+
"sheet": "Edit this contact."
|
|
567
602
|
},
|
|
568
603
|
"labels": {
|
|
569
|
-
"
|
|
604
|
+
"none": "No contacts",
|
|
605
|
+
"contacts": "Contacts",
|
|
606
|
+
"primary": "Primary",
|
|
607
|
+
"group": "{type}, {count, plural, one {# contact} other {# contacts}}"
|
|
608
|
+
},
|
|
609
|
+
"errors": {
|
|
610
|
+
"email": "Enter a valid email address.",
|
|
611
|
+
"phone": "Enter 7 to 15 digits.",
|
|
612
|
+
"website": "Start with https:// or http://.",
|
|
613
|
+
"duplicate": "Already listed ({name}).",
|
|
614
|
+
"empty": "Enter a value.",
|
|
615
|
+
"issues": "{count, plural, one {# issue to fix} other {# issues to fix}}"
|
|
570
616
|
}
|
|
571
617
|
},
|
|
572
618
|
"opening-hours": {
|
|
@@ -574,7 +620,10 @@ declare const _default: {
|
|
|
574
620
|
"dayOfWeek": "Day of Week",
|
|
575
621
|
"openTime": "Opening Time",
|
|
576
622
|
"closeTime": "Closing Time",
|
|
577
|
-
"isClosed": "Closed"
|
|
623
|
+
"isClosed": "Closed",
|
|
624
|
+
"range-open": "{day}, range {n}: opening time",
|
|
625
|
+
"range-close": "{day}, range {n}: closing time",
|
|
626
|
+
"day-open": "{day}: open"
|
|
578
627
|
},
|
|
579
628
|
"days": {
|
|
580
629
|
"0": "Sunday",
|
|
@@ -605,16 +654,42 @@ declare const _default: {
|
|
|
605
654
|
"add-all": "Add All Days",
|
|
606
655
|
"edit": "Edit hours",
|
|
607
656
|
"save": "Save",
|
|
608
|
-
"cancel": "Cancel"
|
|
657
|
+
"cancel": "Cancel",
|
|
658
|
+
"add-range": "Add hours",
|
|
659
|
+
"remove-range": "Remove range {n} of {day}",
|
|
660
|
+
"copy-to": "Copy to…",
|
|
661
|
+
"copy": "Copy",
|
|
662
|
+
"done": "Done"
|
|
609
663
|
},
|
|
610
664
|
"labels": {
|
|
611
665
|
"closed-all-day": "Closed all day",
|
|
612
|
-
"open-hours": "Opening Hours"
|
|
666
|
+
"open-hours": "Opening Hours",
|
|
667
|
+
"today": "Today",
|
|
668
|
+
"open": "Open",
|
|
669
|
+
"closed": "Closed",
|
|
670
|
+
"copy-weekdays": "Monday to Friday",
|
|
671
|
+
"copy-weekend": "Weekend",
|
|
672
|
+
"copy-all": "All days",
|
|
673
|
+
"copied": "Copied to {days}",
|
|
674
|
+
"copy-days": "Copy {day} to"
|
|
613
675
|
},
|
|
614
676
|
"messages": {
|
|
615
677
|
"no-hours": "No opening hours configured",
|
|
616
|
-
"add-first": "
|
|
678
|
+
"add-first": "Use the button above to add opening hours",
|
|
617
679
|
"dialog": "Day, opening time, and closing time."
|
|
680
|
+
},
|
|
681
|
+
"status": {
|
|
682
|
+
"closes-at": "closes at {time}",
|
|
683
|
+
"opens-at": "opens at {time}",
|
|
684
|
+
"opens-tomorrow": "opens tomorrow at {time}",
|
|
685
|
+
"opens-day": "opens {day} at {time}",
|
|
686
|
+
"unset": "Hours not set"
|
|
687
|
+
},
|
|
688
|
+
"errors": {
|
|
689
|
+
"close": "Closing time must be after opening time.",
|
|
690
|
+
"overlap": "This range overlaps another one.",
|
|
691
|
+
"missing": "Enter both times.",
|
|
692
|
+
"issues": "{count, plural, one {# issue to fix} other {# issues to fix}}"
|
|
618
693
|
}
|
|
619
694
|
},
|
|
620
695
|
"postal-address": {
|
|
@@ -1988,7 +2063,9 @@ declare const _default: {
|
|
|
1988
2063
|
"first-page": "Back to the first page",
|
|
1989
2064
|
"past-end-status": "{count, plural, =0 {No results} one {# result} other {# results}} in all, none on this page",
|
|
1990
2065
|
"error": "Could not load the list",
|
|
1991
|
-
"error-hint": "Check your connection, then try again."
|
|
2066
|
+
"error-hint": "Check your connection, then try again.",
|
|
2067
|
+
"bulk-action": "{label} ({count})",
|
|
2068
|
+
"bulk-action-name": "{label} {count, plural, one {# row} other {# rows}}"
|
|
1992
2069
|
},
|
|
1993
2070
|
"list-empty": {
|
|
1994
2071
|
"clear": "Clear search and filters"
|