@mercurjs/dashboard-shared 2.3.4-canary.7 → 2.3.4-canary.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +10 -2
- package/dist/index.js +6 -0
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QueryKey, UseQueryOptions, QueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { ProductChangeActionDTO, HttpTypes as HttpTypes$1, AttributeType, ProductAttributeBatchInput, ProductAttributeDTO, OfferDTO } from '@mercurjs/types';
|
|
3
|
-
import { HttpTypes } from '@medusajs/types';
|
|
3
|
+
import { HttpTypes, AdminOrder } from '@medusajs/types';
|
|
4
4
|
import { z, ZodObject } from 'zod';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import * as React$1 from 'react';
|
|
@@ -115,6 +115,14 @@ declare const getFormattedAddress: ({ address, }: {
|
|
|
115
115
|
}) => string[];
|
|
116
116
|
declare const getFormattedCountry: (countryCode: string | null | undefined) => string;
|
|
117
117
|
|
|
118
|
+
/**
|
|
119
|
+
* An order in `requires_action` is awaiting a decision (e.g. a seller accepting it), so
|
|
120
|
+
* fulfilment, edits, returns, claims, exchanges and payment actions stay unavailable until it
|
|
121
|
+
* leaves that status, the same way they are on a canceled order.
|
|
122
|
+
*/
|
|
123
|
+
declare const isOrderActionable: (order: Pick<AdminOrder, "status">) => boolean;
|
|
124
|
+
declare const isOrderAwaitingAction: (order: Pick<AdminOrder, "status">) => boolean;
|
|
125
|
+
|
|
118
126
|
interface StaticCountry extends Required<Omit<HttpTypes.AdminRegionCountry, "id">> {
|
|
119
127
|
}
|
|
120
128
|
declare function getCountryByIso2(iso2: string | null): StaticCountry | undefined;
|
|
@@ -2046,4 +2054,4 @@ declare const extractPricesFromOffers: (offers: ExtractableOffers, regions: Http
|
|
|
2046
2054
|
variant_id: string;
|
|
2047
2055
|
}[];
|
|
2048
2056
|
|
|
2049
|
-
export { type Action, type ActionGroup, ActionMenu, AddressForm, AddressSchema, type AttributeChange, type AttributeChangeKind, AttributeValueInput, BadgeListSummary, ChipGroup, ChipInput, CodeCell, CodeHeader, Combobox, type Command, ConditionalTooltip, ConfirmPrompt, type ConfirmPromptProps, type CoreNavItem, CountrySelect, CreatedAtCell, CreatedAtHeader, type CurrencyInfo, type CustomFieldsModule, CustomerInfo, DataGrid, DataTable, DateCell, DateHeader, DateRangeDisplay, DeprecatedPercentageInput, DisplayExtensionZone, type DisplayExtensionZoneProps, DisplayField, type DisplayFieldProps, DisplaySection, type DisplaySectionField, type DisplaySectionProps, type EditAttributeAttribute, EditAttributeForm, type EditAttributeFormProps, EmailCell, EmailForm, EmailHeader, EmailSchema, ErrorBoundary, type ExtendableTable, ExtensionProvider, type ExtensionProviderProps, ExtensionRegistry, type ExtractableOffer, type ExtractableOffers, type FieldDiff, FilePreview, type FileType, FileUpload, type FileUploadProps, type Filter, FilterGroup, Form, FormExtensionZone, type FormExtensionZoneProps, GeneralSectionSkeleton, HandleInput, HeadingSkeleton, IconAvatar, IconButtonSkeleton, ImageAvatar, type ImageRef, IncludesTaxTooltip, InfiniteList, JsonViewSection, JsonViewSectionSkeleton, KeyboundForm, LinkButton, ListBadge, ListSummary, Listicle, type ListicleProps, LocalizedTablePagination, type MediaDiff, MetadataForm, MetadataSection, MoneyAmountCell, NameCell, NameHeader, type NavigationModule, NoRecords, type NoRecordsProps, NoResults, type NoResultsProps, OrderBy, PercentageInput, PermissionGuard, type PermissionGuardProps, type PermissionProps, PermissionsContext, PermissionsProvider, type PermissionsProviderProps, PermissionsRequirement, type PermissionsRequirementProps, PermissionsRequirementsContext, PermissionsRequirementsProvider, PlaceholderCell, PriceListDateStatus, type PriceListGridGroupRow, type PriceListGridOfferRow, type PriceListGridRow, PriceListStatus, PriceListType, type ProductAttributeBatchPayload, ProductAttributeSection, type ProductAttributeSectionProps, type ProductChangeAttribute, ProductChangePanel, type ProductChangePanelProps, type ProductChangeProduct, type ProductChangeResolvers, type ProductChangeVariant, type ProductChangeView, ProgressBar, ProvinceSelect, Query, REFERENCE_FIELDS, type ReferenceField, RequiredPermissionsSection, type ResolvedAttribute, type ResolvedDisplays, type ResolvedFormField, RouteDrawer, RouteFocusModal, RoutePermissionGuard, SectionRow, type SectionRowProps, SegmentedControl, type SegmentedControlOption, SidebarLink, type SidebarLinkProps, SingleColumnPage, SingleColumnPageSkeleton, Skeleton, SortableList, SortableTree, StackedDrawer, StackedFocusModal, type StaticCountry, StatusCell, SwitchBox, type TQueryKey, type TabDefinition, TabbedForm, TableFooterSkeleton, TableSectionSkeleton, TableSkeleton, TextCell, TextHeader, TextSkeleton, Thumbnail, TransferOwnershipSchema, TwoColumnPage, TwoColumnPageSkeleton, type UseExtendableFormProps, type UseExtendableTableProps, type UseQueryOptionsWrapper, type UseRegisterPermissionsOptions, type VariantGroup, VisuallyHidden, type Widget, type WidgetModule, type WidgetPlacement, WidgetZone, type WidgetZoneProps, type ZoneWidgets, _DataTable, applyNavOverrides, buildAdditionalDataDefaults, buildAdditionalDataSchema, buildOfferGridData, buildProductChangeView, countries, createDataGridHelper, createDataGridPriceColumns, createFormHelper, currencies, extractPricesFromOffers, extractReferenceIds, formatFieldValue, genericForwardRef, getCountryByIso2, getCurrencySymbol, getDecimalDigits, getExtensionRegistry, getFormattedAddress, getFormattedCountry, getLinkQuery, getLocaleAmount, getNativeSymbol, getPriceListStatus, getStylizedAmount, humanizeFieldName, isAmountLessThenRoundingError, isImageList, isPriceListGroupRow, isProductRow, isReferenceField, isSameAddress, linkFields, productChangeViewHasContent, queryClient, queryKeysFactory, resolvePermissionProps, useCombinedRefs, useCommandHistory, useDataTable, useDate, useDisplayFieldOverride, useDocumentDirection, useExtendableForm, useExtendableTable, useExtension, useLinkQuery, usePermissions, useQueryParams, useRegisterPermissions, useRequiredPermissions, useResourcePermissions, useRouteModal, useStackedModal, useTabManagement, useTabbedForm, withLinkFields };
|
|
2057
|
+
export { type Action, type ActionGroup, ActionMenu, AddressForm, AddressSchema, type AttributeChange, type AttributeChangeKind, AttributeValueInput, BadgeListSummary, ChipGroup, ChipInput, CodeCell, CodeHeader, Combobox, type Command, ConditionalTooltip, ConfirmPrompt, type ConfirmPromptProps, type CoreNavItem, CountrySelect, CreatedAtCell, CreatedAtHeader, type CurrencyInfo, type CustomFieldsModule, CustomerInfo, DataGrid, DataTable, DateCell, DateHeader, DateRangeDisplay, DeprecatedPercentageInput, DisplayExtensionZone, type DisplayExtensionZoneProps, DisplayField, type DisplayFieldProps, DisplaySection, type DisplaySectionField, type DisplaySectionProps, type EditAttributeAttribute, EditAttributeForm, type EditAttributeFormProps, EmailCell, EmailForm, EmailHeader, EmailSchema, ErrorBoundary, type ExtendableTable, ExtensionProvider, type ExtensionProviderProps, ExtensionRegistry, type ExtractableOffer, type ExtractableOffers, type FieldDiff, FilePreview, type FileType, FileUpload, type FileUploadProps, type Filter, FilterGroup, Form, FormExtensionZone, type FormExtensionZoneProps, GeneralSectionSkeleton, HandleInput, HeadingSkeleton, IconAvatar, IconButtonSkeleton, ImageAvatar, type ImageRef, IncludesTaxTooltip, InfiniteList, JsonViewSection, JsonViewSectionSkeleton, KeyboundForm, LinkButton, ListBadge, ListSummary, Listicle, type ListicleProps, LocalizedTablePagination, type MediaDiff, MetadataForm, MetadataSection, MoneyAmountCell, NameCell, NameHeader, type NavigationModule, NoRecords, type NoRecordsProps, NoResults, type NoResultsProps, OrderBy, PercentageInput, PermissionGuard, type PermissionGuardProps, type PermissionProps, PermissionsContext, PermissionsProvider, type PermissionsProviderProps, PermissionsRequirement, type PermissionsRequirementProps, PermissionsRequirementsContext, PermissionsRequirementsProvider, PlaceholderCell, PriceListDateStatus, type PriceListGridGroupRow, type PriceListGridOfferRow, type PriceListGridRow, PriceListStatus, PriceListType, type ProductAttributeBatchPayload, ProductAttributeSection, type ProductAttributeSectionProps, type ProductChangeAttribute, ProductChangePanel, type ProductChangePanelProps, type ProductChangeProduct, type ProductChangeResolvers, type ProductChangeVariant, type ProductChangeView, ProgressBar, ProvinceSelect, Query, REFERENCE_FIELDS, type ReferenceField, RequiredPermissionsSection, type ResolvedAttribute, type ResolvedDisplays, type ResolvedFormField, RouteDrawer, RouteFocusModal, RoutePermissionGuard, SectionRow, type SectionRowProps, SegmentedControl, type SegmentedControlOption, SidebarLink, type SidebarLinkProps, SingleColumnPage, SingleColumnPageSkeleton, Skeleton, SortableList, SortableTree, StackedDrawer, StackedFocusModal, type StaticCountry, StatusCell, SwitchBox, type TQueryKey, type TabDefinition, TabbedForm, TableFooterSkeleton, TableSectionSkeleton, TableSkeleton, TextCell, TextHeader, TextSkeleton, Thumbnail, TransferOwnershipSchema, TwoColumnPage, TwoColumnPageSkeleton, type UseExtendableFormProps, type UseExtendableTableProps, type UseQueryOptionsWrapper, type UseRegisterPermissionsOptions, type VariantGroup, VisuallyHidden, type Widget, type WidgetModule, type WidgetPlacement, WidgetZone, type WidgetZoneProps, type ZoneWidgets, _DataTable, applyNavOverrides, buildAdditionalDataDefaults, buildAdditionalDataSchema, buildOfferGridData, buildProductChangeView, countries, createDataGridHelper, createDataGridPriceColumns, createFormHelper, currencies, extractPricesFromOffers, extractReferenceIds, formatFieldValue, genericForwardRef, getCountryByIso2, getCurrencySymbol, getDecimalDigits, getExtensionRegistry, getFormattedAddress, getFormattedCountry, getLinkQuery, getLocaleAmount, getNativeSymbol, getPriceListStatus, getStylizedAmount, humanizeFieldName, isAmountLessThenRoundingError, isImageList, isOrderActionable, isOrderAwaitingAction, isPriceListGroupRow, isProductRow, isReferenceField, isSameAddress, linkFields, productChangeViewHasContent, queryClient, queryKeysFactory, resolvePermissionProps, useCombinedRefs, useCommandHistory, useDataTable, useDate, useDisplayFieldOverride, useDocumentDirection, useExtendableForm, useExtendableTable, useExtension, useLinkQuery, usePermissions, useQueryParams, useRegisterPermissions, useRequiredPermissions, useResourcePermissions, useRouteModal, useStackedModal, useTabManagement, useTabbedForm, withLinkFields };
|
package/dist/index.js
CHANGED
|
@@ -12439,6 +12439,10 @@ var getFormattedCountry = (countryCode) => {
|
|
|
12439
12439
|
return country ? country.display_name : countryCode;
|
|
12440
12440
|
};
|
|
12441
12441
|
|
|
12442
|
+
// src/lib/order-status.ts
|
|
12443
|
+
var isOrderActionable = (order) => order.status !== "canceled" && order.status !== "requires_action";
|
|
12444
|
+
var isOrderAwaitingAction = (order) => order.status === "requires_action";
|
|
12445
|
+
|
|
12442
12446
|
// src/lib/data/currencies.ts
|
|
12443
12447
|
var currencies = {
|
|
12444
12448
|
USD: {
|
|
@@ -28783,6 +28787,8 @@ export {
|
|
|
28783
28787
|
humanizeFieldName,
|
|
28784
28788
|
isAmountLessThenRoundingError,
|
|
28785
28789
|
isImageList,
|
|
28790
|
+
isOrderActionable,
|
|
28791
|
+
isOrderAwaitingAction,
|
|
28786
28792
|
isPriceListGroupRow,
|
|
28787
28793
|
isProductRow,
|
|
28788
28794
|
isReferenceField,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercurjs/dashboard-shared",
|
|
3
|
-
"version": "2.3.4-canary.
|
|
3
|
+
"version": "2.3.4-canary.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/mercurjs/mercur",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"build": "tsup"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@mercurjs/client": "2.3.4-canary.
|
|
26
|
+
"@mercurjs/client": "2.3.4-canary.9",
|
|
27
27
|
"@ariakit/react": "^0.4.15",
|
|
28
28
|
"@babel/runtime": "^8.0.0",
|
|
29
29
|
"@dnd-kit/core": "^6.1.0",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@medusajs/types": "2.20.1",
|
|
66
|
-
"@mercurjs/core": "2.3.4-canary.
|
|
67
|
-
"@mercurjs/dashboard-sdk": "2.3.4-canary.
|
|
68
|
-
"@mercurjs/types": "2.3.4-canary.
|
|
66
|
+
"@mercurjs/core": "2.3.4-canary.9",
|
|
67
|
+
"@mercurjs/dashboard-sdk": "2.3.4-canary.9",
|
|
68
|
+
"@mercurjs/types": "2.3.4-canary.9",
|
|
69
69
|
"@types/lodash.debounce": "^4.0.8",
|
|
70
70
|
"@types/react": "^18.3.2",
|
|
71
71
|
"@types/react-dom": "^18.2.22",
|