@abpjs/ui 0.2.0-next.28 → 0.2.0-next.29

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,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0-next.29
4
+
5
+ A prerelease under npm's `next` tag.
6
+
7
+ - `RowMenu`: a row's ⋯ menu. It takes items (with an icon, `danger` for red, `disabled`), separators, and a quiet note
8
+ saying who can use the items that are off.
9
+ - `Button variant="cancel"`: the one Cancel look, a gray fill a step above the surface in either mode with no border.
10
+ `ConfirmDialog`'s Cancel uses it.
11
+ - `ConfirmDialog typeToConfirm`: the confirm turns on only once the person types the given word (a project's key, to
12
+ delete it). Its prompt is `typeToConfirm`, an optional label ("Type {value} to confirm").
13
+ - `QueryableList`: `trailingColumn` adds a column after the fields (a row's menu). `cards` with `layout="cards"` draws
14
+ the rows as cards in a grid, with placeholders while loading; filters, sort, saved views and pages work the same.
15
+
3
16
  ## 0.2.0-next.28
4
17
 
5
18
  A prerelease under npm's `next` tag.
package/dist/index.d.ts CHANGED
@@ -68,6 +68,8 @@ interface AbpLabels {
68
68
  close: string;
69
69
  cancel: string;
70
70
  confirm: string;
71
+ /** A confirm that needs a word typed first (deleting a project), `{value}` being the word. Optional: English by default. */
72
+ typeToConfirm?: string;
71
73
  retry: string;
72
74
  loading: string;
73
75
  noData: string;
@@ -1310,9 +1312,10 @@ declare function AvatarStack({ 'aria-label': ariaLabel, people, max, moreLabel,
1310
1312
  * secondary every other action (outlined neutral); the default
1311
1313
  * ghost low-emphasis actions in toolbars and table rows
1312
1314
  * link inline text action
1315
+ * cancel every Cancel (a dialog's, a form's, a composer's): one quiet gray fill, no border
1313
1316
  * `danger` turns any of them red for destructive actions.
1314
1317
  */
1315
- type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'link';
1318
+ type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'link' | 'cancel';
1316
1319
  type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
1317
1320
  interface AbpButtonProps {
1318
1321
  variant?: ButtonVariant;
@@ -1347,6 +1350,35 @@ declare const IconButton: react.ForwardRefExoticComponent<Omit<IconButtonProps$1
1347
1350
  remove?: boolean;
1348
1351
  } & react.RefAttributes<HTMLButtonElement>>;
1349
1352
 
1353
+ /** One thing a row's ⋯ menu can do. */
1354
+ interface RowMenuItem {
1355
+ id: string;
1356
+ label: ReactNode;
1357
+ icon?: ReactNode;
1358
+ onSelect?: () => void;
1359
+ /** Red text and icon: delete, and other acts that can't be taken back. */
1360
+ danger?: boolean;
1361
+ /** Shown but not chosen: the person may not do it here (say why in a `note`). */
1362
+ disabled?: boolean;
1363
+ }
1364
+ /** An entry of a row's menu: an item, a line between groups, or a quiet note (why some items are off). */
1365
+ type RowMenuEntry = RowMenuItem | {
1366
+ separator: true;
1367
+ } | {
1368
+ note: ReactNode;
1369
+ };
1370
+ interface RowMenuProps {
1371
+ /** The trigger's name, with the row in it ("More for Finance"). */
1372
+ label: string;
1373
+ items: RowMenuEntry[];
1374
+ size?: 'xs' | 'sm';
1375
+ }
1376
+ /**
1377
+ * A row's ⋯ menu (the design canvas's row menu): Open, Star, Edit, then Archive and a red Delete apart. Items the
1378
+ * person may not use stay listed, turned off, with a note saying who can.
1379
+ */
1380
+ declare function RowMenu({ label, items, size }: RowMenuProps): react.JSX.Element;
1381
+
1350
1382
  interface ConfirmOptions {
1351
1383
  title: ReactNode;
1352
1384
  description?: ReactNode;
@@ -1354,6 +1386,11 @@ interface ConfirmOptions {
1354
1386
  cancelLabel?: ReactNode;
1355
1387
  /** Red confirm button for destructive actions. */
1356
1388
  danger?: boolean;
1389
+ /**
1390
+ * A word the person types before the confirm turns on (a project's key, to delete it): for acts that can't be taken
1391
+ * back and reach a lot. Matched exactly, ignoring spaces around it.
1392
+ */
1393
+ typeToConfirm?: string;
1357
1394
  }
1358
1395
  interface ConfirmDialogProps extends ConfirmOptions {
1359
1396
  open: boolean;
@@ -1363,7 +1400,7 @@ interface ConfirmDialogProps extends ConfirmOptions {
1363
1400
  busy?: boolean;
1364
1401
  }
1365
1402
  /** An alert dialog asking the user to confirm an action. Focus starts on Cancel. */
1366
- declare function ConfirmDialog({ open, onOpenChange, onConfirm, busy, title, description, confirmLabel, cancelLabel, danger, }: ConfirmDialogProps): react.JSX.Element;
1403
+ declare function ConfirmDialog({ open, onOpenChange, onConfirm, busy, title, description, confirmLabel, cancelLabel, danger, typeToConfirm, }: ConfirmDialogProps): react.JSX.Element;
1367
1404
  type ConfirmFn = (options: ConfirmOptions) => Promise<boolean>;
1368
1405
  /** Provides `useConfirm()`. AbpProvider renders it; you rarely need it directly. */
1369
1406
  declare function ConfirmProvider({ children }: {
@@ -2569,6 +2606,17 @@ interface QueryableListProps {
2569
2606
  countMatches?: (conditions: QueryConditionJson[]) => Promise<number>;
2570
2607
  /** A column before the fields' (the checkboxes of rows picked for a change, UI round 9 step 56). */
2571
2608
  leadingColumn?: DataTableColumn<QueryRow>;
2609
+ /** A column after the fields' (a row's ⋯ menu). */
2610
+ trailingColumn?: DataTableColumn<QueryRow>;
2611
+ /**
2612
+ * The rows as cards in a grid instead of a table (a projects directory's Cards view): `layout="cards"` draws each row
2613
+ * with `cards.render`. Filters, sort, saved views and pages work the same; grouping and the tree apply to the table.
2614
+ */
2615
+ cards?: {
2616
+ render: (row: QueryRow) => ReactNode;
2617
+ minWidth?: string;
2618
+ };
2619
+ layout?: 'list' | 'cards';
2572
2620
  /** A row under the toolbar, across it (picking rows, changing them). */
2573
2621
  toolbarFooter?: ReactNode;
2574
2622
  /** RQL autocomplete at the caret; without it the RQL box is a plain input. */
@@ -2667,7 +2715,7 @@ declare function basicConditions(where: QueryNodeJson | null | undefined): Query
2667
2715
  * counts, saved views and paging, over any entity the query engine serves. Controlled: the host runs the query and
2668
2716
  * keeps the state in the URL.
2669
2717
  */
2670
- declare function QueryableList({ 'aria-label': ariaLabel, fields, state, onStateChange, result, loading: own, error, renderCell, renderRow, selection, leadingColumn, toolbarFooter, countMatches, suggest, renderValueEditor, skip, take, onSkipChange, pagination, views, activeViewId, onSelectView, onSaveView, onDeleteView, onExport, actions, empty, loadFailed, leading, attention, search, renderGroupFooter, renderGroupAside, moveToGroup, tree, columnLabels, exportTarget, }: QueryableListProps): react.JSX.Element;
2718
+ declare function QueryableList({ 'aria-label': ariaLabel, fields, state, onStateChange, result, loading: own, error, renderCell, renderRow, selection, leadingColumn, trailingColumn, cards, layout, toolbarFooter, countMatches, suggest, renderValueEditor, skip, take, onSkipChange, pagination, views, activeViewId, onSelectView, onSaveView, onDeleteView, onExport, actions, empty, loadFailed, leading, attention, search, renderGroupFooter, renderGroupAside, moveToGroup, tree, columnLabels, exportTarget, }: QueryableListProps): react.JSX.Element;
2671
2719
 
2672
2720
  interface RecordKeyProps extends Omit<HTMLChakraProps<'span'>, 'children'> {
2673
2721
  /** The key, e.g. "PAY-41". Children win when both are given. */
@@ -3163,4 +3211,4 @@ interface TooltipProps extends Omit<Tooltip$1.RootProps, 'children'> {
3163
3211
  */
3164
3212
  declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLDivElement>>;
3165
3213
 
3166
- export { ABP_UI_VERSION, AbpApiError, type AbpBrand, type AbpHost, type AbpLabels, type AbpLabelsInput, type AbpListOptions, AbpProvider, type AbpProviderProps, type AbpSystemOptions, AddButton, type AddButtonProps, type ApiQuery, AppLink, type AppLinkProps, AppShell, type AppShellBrand, type AppShellNavItem, type AppShellNavSection, type AppShellPlace, type AppShellProps, type AppShellSidebar, type AreaTexts, type Arrival, ArriveOnChange, type ArriveOnChangeProps, AttentionChip, type AttentionChipProps, type AvatarPerson, AvatarStack, type AvatarStackProps, Bone, type BoneProps, type BreadcrumbItem, Breadcrumbs, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarGrid, type CalendarGridProps, type CalendarItem, type CardDates, CategoryProgress, type CategoryProgressProps, type CelebrateTarget, Chart, type ChartProps, type ChartSeries, CheckboxField, type CheckboxFieldProps, Collapse, type CollapseProps, type ColorMode, ColorModeProvider, ColorModeToggle, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, ConfirmProvider, CountBadge, type CountBadgeProps, Counter, type CounterProps, DEFAULT_PAGE_SIZE, DashboardGrid, type DashboardGridProps, DataTable, type DataTableColumn, type DataTableProps, type DataTableSelection, type DataTableSort, type Direction, DirectionalIcon, DropHint, type DropHintProps, type DropZoneOptions, type DropZoneState, type DroppedFile, EMPTY_VALUE, EmotionRegistry, type EmptyArt, EmptyArtDrawing, type EmptyIllustration, EmptyState, type EmptyStateProps, FadeIn, type FadeInProps, Field, type FieldProps, FileDropArea, type FileDropAreaProps, FormDialog, type FormDialogProps, FormField, type GridItem, GroupPicker, Highlight, HighlightText, type HostEventHandler, type HostEvents, type HostFile, type HostLanguage, HostProvider, type HostRequest, type HostRequestInit, type HostRequestOptions, type HostScope, HostSlot, IconButton, type IconButtonProps, IconTile, type IconTileProps, Indicator, type IndicatorProps, InlineAlert, type InlineAlertProps, KanbanBoard, type KanbanBoardProps, type KanbanColumn, type KanbanItem, type KanbanLane, type KanbanMove, type LinkComponent, ListFooter, type ListPage, type ListQuery, type ListSource, type ListState, Loading, type LoadingProps, LoadingState, MotionProvider, type MotionSetting, type MotionState, type NameSuggestion, type NamesValue, Nudge, type NudgeProps, PageHeader, type PageHeaderProps, PageIllustration, PageTitleProvider, Pagination, type PaginationForm, type PaginationProps, Panel, type PanelProps, PanelTone, type Particle, PathChips, type PathChipsProps, PersonChip, type PersonChipProps, PersonPicker, type PickerGroup, type PickerLabels, type PickerPerson, type PlacedCard, PluginTextsProvider, type Pose, Presence, PresenceItem, type PresenceItemProps, PresenceList, type PresenceListProps, type PresenceProps, Pressable, type PressableProps, PriorityMark, type PriorityMarkProps, type PropertyItem, PropertyList, type PropertyListProps, type QueryConditionJson, type QueryExportFormat, type QueryField, type QueryGroup, type QueryJson, type QueryListLabels, type QueryNodeJson, type QueryRow, type QuerySuggestion, type QuerySuggestions, type QueryValueEditor, QueryableList, type QueryableListError, type QueryableListExport, type QueryableListProps, type QueryableListState, type QueryableListView, type QueueProgress, RecordKey, type RecordKeyProps, type RegisterSlotSave, Reveal, RevealItem, type RevealItemProps, type RevealProps, SHOWN, STEP_UP_REQUIRED, STRONG_FACTOR_REQUIRED, type Scale, SearchInput, type SearchInputProps, SearchPicker, type SearchPickerMessages, type SearchPickerProps, type SectionMove, SegmentedControl, type SegmentedControlProps, type SegmentedItem, SelectField, type SelectFieldProps, type SelectOption, type ServerInsertedHTML, type SettingsArea, SettingsLayout, type SettingsLayoutProps, type SettingsPage, type SettingsSection, SlideItem, type SlideItemProps, SlideList, type SlideListProps, type SlotSave, type SortDirection, type SortableSection, SortableSections, type SortableSectionsProps, type StatusCategory, StatusPill, type StatusPillProps, type StatusTone, StepUpDialog, type StepUpHandler, type StepUpNeed, Swap, type SwapProps, SwitchField, type SwitchFieldProps, TITLE_SEPARATOR, TextBone, type TextBoneProps, TextSlot, type TextSlotProps, type TimelineCardItem, TimelineCards, type TimelineCardsProps, TimelineChart, type TimelineChartProps, type TimelineItem, type TimelineRow, type TimelineScale, type TitleParts, Toaster, Tooltip, type TooltipProps, TranslatedInput, type TranslatedInputProps, type TranslationsLabels, UPLOADS_AT_ONCE, type UploadJob, UploadList, type UploadListProps, type UploadRow, type UploadState, abpConfig, abpListParams, abpListSource, arriveCss, asMotionSetting, avatarPalette, basicConditions, boneWidth, burst, compactLayout, compareOrdinal, composeTitle, covers, createAbpSystem, createAreaTexts, createHostEvents, createHostRequest, createPasskey, curves, defaultBrand, defaultLabels, defaultPickerLabels, defaultQueryListLabels, defaultTranslationsLabels, directionOf, droppedFiles, emptyQuery, errorText, fileNameOf, findSettingsPage, folderOf, foldersFor, formatDateTime, formatMessage, formatNumber, getPasskey, ghostCss, groupKey, heavierFirst, hiddenPose, inSections, isStepUp, looksLikeCode, durations as motionDurations, needsStepUp, notify, pageCount, pageList, pagesShown, partsOf, passkeysSupported, pastedName, personLabel, placeCards, placeItem, priorityLevel, progressOf, readAbpError, readEvents, refusal, requestStepUp, setStepUpHandler, settingsArea, shineCss, springs, staggerDelay, stepUpNeedOf, targetOf, toStart, toaster, useAbpLabels, useAbpLocale, useAbpTimeZone, useApiAction, useApiDownload, useApiQuery, useAreaEvents, useAreaListSource, useAreaRequest, useArriving, useCan, useCelebrate, useColorMode, useConfirm, useDropZone, useFilesOverPage, useFormatters, useHost, useHostLanguages, useLinkComponent, useListState, useLoading, useMe, useMotionSetting, useNames, useNavigate, useOptionalHost, usePageDrop, usePageTitle, usePageTitleParts, usePageTitleSite, usePastedFiles, usePluginTexts, useProductName, useSettledValue, useSlotSaves, useTokenVar };
3214
+ export { ABP_UI_VERSION, AbpApiError, type AbpBrand, type AbpHost, type AbpLabels, type AbpLabelsInput, type AbpListOptions, AbpProvider, type AbpProviderProps, type AbpSystemOptions, AddButton, type AddButtonProps, type ApiQuery, AppLink, type AppLinkProps, AppShell, type AppShellBrand, type AppShellNavItem, type AppShellNavSection, type AppShellPlace, type AppShellProps, type AppShellSidebar, type AreaTexts, type Arrival, ArriveOnChange, type ArriveOnChangeProps, AttentionChip, type AttentionChipProps, type AvatarPerson, AvatarStack, type AvatarStackProps, Bone, type BoneProps, type BreadcrumbItem, Breadcrumbs, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarGrid, type CalendarGridProps, type CalendarItem, type CardDates, CategoryProgress, type CategoryProgressProps, type CelebrateTarget, Chart, type ChartProps, type ChartSeries, CheckboxField, type CheckboxFieldProps, Collapse, type CollapseProps, type ColorMode, ColorModeProvider, ColorModeToggle, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmOptions, ConfirmProvider, CountBadge, type CountBadgeProps, Counter, type CounterProps, DEFAULT_PAGE_SIZE, DashboardGrid, type DashboardGridProps, DataTable, type DataTableColumn, type DataTableProps, type DataTableSelection, type DataTableSort, type Direction, DirectionalIcon, DropHint, type DropHintProps, type DropZoneOptions, type DropZoneState, type DroppedFile, EMPTY_VALUE, EmotionRegistry, type EmptyArt, EmptyArtDrawing, type EmptyIllustration, EmptyState, type EmptyStateProps, FadeIn, type FadeInProps, Field, type FieldProps, FileDropArea, type FileDropAreaProps, FormDialog, type FormDialogProps, FormField, type GridItem, GroupPicker, Highlight, HighlightText, type HostEventHandler, type HostEvents, type HostFile, type HostLanguage, HostProvider, type HostRequest, type HostRequestInit, type HostRequestOptions, type HostScope, HostSlot, IconButton, type IconButtonProps, IconTile, type IconTileProps, Indicator, type IndicatorProps, InlineAlert, type InlineAlertProps, KanbanBoard, type KanbanBoardProps, type KanbanColumn, type KanbanItem, type KanbanLane, type KanbanMove, type LinkComponent, ListFooter, type ListPage, type ListQuery, type ListSource, type ListState, Loading, type LoadingProps, LoadingState, MotionProvider, type MotionSetting, type MotionState, type NameSuggestion, type NamesValue, Nudge, type NudgeProps, PageHeader, type PageHeaderProps, PageIllustration, PageTitleProvider, Pagination, type PaginationForm, type PaginationProps, Panel, type PanelProps, PanelTone, type Particle, PathChips, type PathChipsProps, PersonChip, type PersonChipProps, PersonPicker, type PickerGroup, type PickerLabels, type PickerPerson, type PlacedCard, PluginTextsProvider, type Pose, Presence, PresenceItem, type PresenceItemProps, PresenceList, type PresenceListProps, type PresenceProps, Pressable, type PressableProps, PriorityMark, type PriorityMarkProps, type PropertyItem, PropertyList, type PropertyListProps, type QueryConditionJson, type QueryExportFormat, type QueryField, type QueryGroup, type QueryJson, type QueryListLabels, type QueryNodeJson, type QueryRow, type QuerySuggestion, type QuerySuggestions, type QueryValueEditor, QueryableList, type QueryableListError, type QueryableListExport, type QueryableListProps, type QueryableListState, type QueryableListView, type QueueProgress, RecordKey, type RecordKeyProps, type RegisterSlotSave, Reveal, RevealItem, type RevealItemProps, type RevealProps, RowMenu, type RowMenuEntry, type RowMenuItem, type RowMenuProps, SHOWN, STEP_UP_REQUIRED, STRONG_FACTOR_REQUIRED, type Scale, SearchInput, type SearchInputProps, SearchPicker, type SearchPickerMessages, type SearchPickerProps, type SectionMove, SegmentedControl, type SegmentedControlProps, type SegmentedItem, SelectField, type SelectFieldProps, type SelectOption, type ServerInsertedHTML, type SettingsArea, SettingsLayout, type SettingsLayoutProps, type SettingsPage, type SettingsSection, SlideItem, type SlideItemProps, SlideList, type SlideListProps, type SlotSave, type SortDirection, type SortableSection, SortableSections, type SortableSectionsProps, type StatusCategory, StatusPill, type StatusPillProps, type StatusTone, StepUpDialog, type StepUpHandler, type StepUpNeed, Swap, type SwapProps, SwitchField, type SwitchFieldProps, TITLE_SEPARATOR, TextBone, type TextBoneProps, TextSlot, type TextSlotProps, type TimelineCardItem, TimelineCards, type TimelineCardsProps, TimelineChart, type TimelineChartProps, type TimelineItem, type TimelineRow, type TimelineScale, type TitleParts, Toaster, Tooltip, type TooltipProps, TranslatedInput, type TranslatedInputProps, type TranslationsLabels, UPLOADS_AT_ONCE, type UploadJob, UploadList, type UploadListProps, type UploadRow, type UploadState, abpConfig, abpListParams, abpListSource, arriveCss, asMotionSetting, avatarPalette, basicConditions, boneWidth, burst, compactLayout, compareOrdinal, composeTitle, covers, createAbpSystem, createAreaTexts, createHostEvents, createHostRequest, createPasskey, curves, defaultBrand, defaultLabels, defaultPickerLabels, defaultQueryListLabels, defaultTranslationsLabels, directionOf, droppedFiles, emptyQuery, errorText, fileNameOf, findSettingsPage, folderOf, foldersFor, formatDateTime, formatMessage, formatNumber, getPasskey, ghostCss, groupKey, heavierFirst, hiddenPose, inSections, isStepUp, looksLikeCode, durations as motionDurations, needsStepUp, notify, pageCount, pageList, pagesShown, partsOf, passkeysSupported, pastedName, personLabel, placeCards, placeItem, priorityLevel, progressOf, readAbpError, readEvents, refusal, requestStepUp, setStepUpHandler, settingsArea, shineCss, springs, staggerDelay, stepUpNeedOf, targetOf, toStart, toaster, useAbpLabels, useAbpLocale, useAbpTimeZone, useApiAction, useApiDownload, useApiQuery, useAreaEvents, useAreaListSource, useAreaRequest, useArriving, useCan, useCelebrate, useColorMode, useConfirm, useDropZone, useFilesOverPage, useFormatters, useHost, useHostLanguages, useLinkComponent, useListState, useLoading, useMe, useMotionSetting, useNames, useNavigate, useOptionalHost, usePageDrop, usePageTitle, usePageTitleParts, usePageTitleSite, usePastedFiles, usePluginTexts, useProductName, useSettledValue, useSlotSaves, useTokenVar };