@commercelayer/app-elements 0.0.76 → 0.0.78
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/{Async-7776e533.js → Async-163e6f77.js} +3 -3
- package/dist/{InputDateComponent-2e1d89ea.js → InputDateComponent-6853e317.js} +2 -2
- package/dist/{Select-fd7da201.js → Select-a7b98c9a.js} +3 -3
- package/dist/{main-020a0e90.js → main-740e7f02.js} +4058 -4020
- package/dist/main.js +1 -1
- package/dist/{overrides-71912a6c.js → overrides-f9354b78.js} +2 -2
- package/dist/ui/atoms/Legend.d.ts +9 -5
- package/dist/ui/atoms/SkeletonTemplate.d.ts +1 -1
- package/dist/ui/composite/SearchBar.d.ts +11 -5
- package/dist/ui/resources/ResourceList/index.d.ts +29 -5
- package/dist/ui/resources/ResourceList/reducer.d.ts +5 -0
- package/dist/ui/resources/ShipmentParcels.mocks.d.ts +1 -0
- package/dist/{unsupportedIterableToArray-92b7b607.js → unsupportedIterableToArray-1a2db0a9.js} +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ah as o, aW as n, ai as i, aj as u, ak as l, am as b, an as g, ao as d, ap as p, aX as m, aq as c, aY as S, ar as T, aa as I, aQ as D, aR as k, aS as y, as as C, ad as P, at as h, au as B, av as A, aw as R, b3 as L, b4 as v, b5 as O, b6 as f, b8 as N, b9 as F, ba as x, bb as M, bc as w, bd as V, be as G, bf as E, bg as H, bm as J, bn as j, bo as q, bp as z, bq as K, ay as Q, bx as U, bt as W, bu as X, bv as Y, bw as Z, by as $, bz as _, ae as aa, bA as ea, bB as sa, az as ta, aZ as ra, aA as oa, a_ as na, a$ as ia, aB as ua, aC as la, aD as ba, br as ga, bC as da, b0 as pa, bD as ma, bE as ca, b1 as Sa, bF as Ta, aE as Ia, aF as Da, aG as ka, aI as ya, aJ as Ca, aK as Pa, aL as ha, aM as Ba, bG as Aa, bH as Ra, aN as La, aO as va, aT as Oa, aP as fa, aU as Na, b2 as Fa, bs as xa, af as Ma, aV as wa, al as Va, X as Ga, W as Ea, bh as Ha, b7 as Ja, R as ja, Y as qa, Z as za, $ as Ka, bi as Qa, S as Ua, T as Wa, bI as Xa, bJ as Ya, bK as Za, bL as $a, bM as _a, bN as ae, a0 as ee, a1 as se, a2 as te, a3 as re, M as oe, a4 as ne, a5 as ie, ax as ue, O as le, bj as be, bk as ge, bl as de, N as pe, Q as me, U as ce, V as Se, a6 as Te, ab as Ie, ac as De, a7 as ke, a8 as ye, a9 as Ce, ag as Pe, aH as he } from "./main-
|
|
1
|
+
import { ah as o, aW as n, ai as i, aj as u, ak as l, am as b, an as g, ao as d, ap as p, aX as m, aq as c, aY as S, ar as T, aa as I, aQ as D, aR as k, aS as y, as as C, ad as P, at as h, au as B, av as A, aw as R, b3 as L, b4 as v, b5 as O, b6 as f, b8 as N, b9 as F, ba as x, bb as M, bc as w, bd as V, be as G, bf as E, bg as H, bm as J, bn as j, bo as q, bp as z, bq as K, ay as Q, bx as U, bt as W, bu as X, bv as Y, bw as Z, by as $, bz as _, ae as aa, bA as ea, bB as sa, az as ta, aZ as ra, aA as oa, a_ as na, a$ as ia, aB as ua, aC as la, aD as ba, br as ga, bC as da, b0 as pa, bD as ma, bE as ca, b1 as Sa, bF as Ta, aE as Ia, aF as Da, aG as ka, aI as ya, aJ as Ca, aK as Pa, aL as ha, aM as Ba, bG as Aa, bH as Ra, aN as La, aO as va, aT as Oa, aP as fa, aU as Na, b2 as Fa, bs as xa, af as Ma, aV as wa, al as Va, X as Ga, W as Ea, bh as Ha, b7 as Ja, R as ja, Y as qa, Z as za, $ as Ka, bi as Qa, S as Ua, T as Wa, bI as Xa, bJ as Ya, bK as Za, bL as $a, bM as _a, bN as ae, a0 as ee, a1 as se, a2 as te, a3 as re, M as oe, a4 as ne, a5 as ie, ax as ue, O as le, bj as be, bk as ge, bl as de, N as pe, Q as me, U as ce, V as Se, a6 as Te, ab as Ie, ac as De, a7 as ke, a8 as ye, a9 as Ce, ag as Pe, aH as he } from "./main-740e7f02.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
import "@commercelayer/sdk";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as Se, g as gr, _ as In, a as br, b as pr, c as fr, f as mr } from "./unsupportedIterableToArray-
|
|
1
|
+
import { d as Se, g as gr, _ as In, a as br, b as pr, c as fr, f as mr } from "./unsupportedIterableToArray-1a2db0a9.js";
|
|
2
2
|
import * as B from "react";
|
|
3
3
|
import { useLayoutEffect as vn, forwardRef as Ir, useContext as Te, createElement as me, Fragment as Be, createContext as Ct, useRef as oe, useState as Ie, useMemo as Ce, useCallback as Y, Component as vr, useEffect as hn } from "react";
|
|
4
|
-
import { _ as hr, H as se, K as Cn } from "./main-
|
|
4
|
+
import { _ as hr, H as se, K as Cn } from "./main-740e7f02.js";
|
|
5
5
|
import { createPortal as Cr } from "react-dom";
|
|
6
6
|
function V() {
|
|
7
7
|
return V = Object.assign ? Object.assign.bind() : function(t) {
|
|
@@ -21,8 +21,12 @@ export interface LegendProps {
|
|
|
21
21
|
*/
|
|
22
22
|
className?: string;
|
|
23
23
|
}
|
|
24
|
-
declare
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
export declare const Legend: import('../atoms/SkeletonTemplate').SkeletonTemplateComponent<{
|
|
25
|
+
title?: ReactNode;
|
|
26
|
+
titleSize?: "small" | "normal" | undefined;
|
|
27
|
+
border?: "none" | undefined;
|
|
28
|
+
actionButton?: ReactNode;
|
|
29
|
+
className?: string | undefined;
|
|
30
|
+
delayMs?: number | undefined;
|
|
31
|
+
isLoading?: boolean | undefined;
|
|
32
|
+
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type FC, type FunctionComponent, type ReactNode, type ReactPortal } from 'react';
|
|
2
2
|
import { type Simplify } from 'type-fest';
|
|
3
3
|
type ReactNodeNoPortal = Exclude<ReactNode, ReactPortal>;
|
|
4
|
-
type SkeletonTemplateProps<P = Record<string, unknown>> = Simplify<P & {
|
|
4
|
+
export type SkeletonTemplateProps<P = Record<string, unknown>> = Simplify<P & {
|
|
5
5
|
/**
|
|
6
6
|
* This prevents `SkeletonTemplate` to appear immediately.
|
|
7
7
|
* It can be used when loading times are too short and you don't want flashing of content
|
|
@@ -25,9 +25,15 @@ interface SearchBarProps {
|
|
|
25
25
|
* Placeholder text for the input element
|
|
26
26
|
*/
|
|
27
27
|
placeholder?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Enable auto focus on the input element
|
|
30
|
+
*/
|
|
31
|
+
autoFocus?: boolean;
|
|
28
32
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
* This component renders a search bar with a clear button with debounced `onSearch` callback.
|
|
35
|
+
* <blockquote type='info'>In this way the `onSearch` callback will be triggered only when the user stops typing
|
|
36
|
+
* for the specified value of `debounceMs` (default 500ms).</blockquote>
|
|
37
|
+
*/
|
|
38
|
+
export declare const SearchBar: import("react").ForwardRefExoticComponent<SearchBarProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
39
|
+
export {};
|
|
@@ -1,17 +1,41 @@
|
|
|
1
1
|
import { type LegendProps } from '../../atoms/Legend';
|
|
2
|
+
import { type SkeletonTemplateProps } from '../../atoms/SkeletonTemplate';
|
|
2
3
|
import { type CommerceLayerClient, type QueryParamsList } from '@commercelayer/sdk';
|
|
3
4
|
import { type ListableResourceType } from '@commercelayer/sdk/lib/cjs/api';
|
|
4
5
|
import { type FC } from 'react';
|
|
5
6
|
import { type Resource } from './infiniteFetcher';
|
|
7
|
+
export interface ResourceListItemProps<TResource extends ListableResourceType> extends SkeletonTemplateProps<{
|
|
8
|
+
/**
|
|
9
|
+
* The fetched resource
|
|
10
|
+
*/
|
|
11
|
+
resource?: Resource<TResource>;
|
|
12
|
+
/**
|
|
13
|
+
* callback to be used to remove the item from the list as UI element.
|
|
14
|
+
* This needs to be used after a successful API call to delete the resource, since it just affects the current UI rendering and not the server data.
|
|
15
|
+
*/
|
|
16
|
+
remove?: () => void;
|
|
17
|
+
}> {
|
|
18
|
+
}
|
|
6
19
|
export interface ResourceListProps<TResource extends ListableResourceType> extends Pick<LegendProps, 'title' | 'actionButton'> {
|
|
20
|
+
/**
|
|
21
|
+
* The resource type to be fetched in the list
|
|
22
|
+
*/
|
|
7
23
|
type: TResource;
|
|
24
|
+
/**
|
|
25
|
+
* SDK query object to be used to fetch the list, excluding the pageNumber that is handled internally for infinite scrolling.
|
|
26
|
+
*/
|
|
8
27
|
query?: Omit<QueryParamsList, 'pageNumber'>;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
28
|
+
/**
|
|
29
|
+
* A react component to be used to render each item in the list.
|
|
30
|
+
*/
|
|
31
|
+
Item: FC<ResourceListItemProps<TResource>>;
|
|
32
|
+
/**
|
|
33
|
+
* An element to be rendered when the list is empty.
|
|
34
|
+
*/
|
|
14
35
|
emptyState: JSX.Element;
|
|
36
|
+
/**
|
|
37
|
+
* A valid CommerceLayer SDK client instance.
|
|
38
|
+
*/
|
|
15
39
|
sdkClient?: CommerceLayerClient;
|
|
16
40
|
}
|
|
17
41
|
declare function ResourceList<TResource extends ListableResourceType>({ type, query, title, Item, actionButton, sdkClient, emptyState }: ResourceListProps<TResource>): JSX.Element;
|
|
@@ -18,6 +18,11 @@ type Action<TResource extends ListableResourceType> = {
|
|
|
18
18
|
} | {
|
|
19
19
|
type: 'error';
|
|
20
20
|
payload: string;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'removeItem';
|
|
23
|
+
payload: {
|
|
24
|
+
resourceId: string;
|
|
25
|
+
};
|
|
21
26
|
};
|
|
22
27
|
export declare const reducer: <TResource extends ListableResourceType>(state: ResourceListInternalState<TResource>, action: Action<TResource>) => ResourceListInternalState<TResource>;
|
|
23
28
|
export {};
|
|
@@ -8,6 +8,7 @@ export declare const shipmentWithoutTracking: import("@commercelayer/sdk/lib/cjs
|
|
|
8
8
|
export declare const shipmentWithStatusDifferentFromPacking: import("@commercelayer/sdk/lib/cjs/resources/shipments").Shipment;
|
|
9
9
|
export declare const shipmentHasBeenPurchased: import("@commercelayer/sdk/lib/cjs/resources/shipments").Shipment;
|
|
10
10
|
export declare const shipmentWithSingleParcelSingleTracking: import("@commercelayer/sdk/lib/cjs/resources/shipments").Shipment;
|
|
11
|
+
export declare const shipmentWithSingleParcelSingleTrackingNoCarrier: import("@commercelayer/sdk/lib/cjs/resources/shipments").Shipment;
|
|
11
12
|
export declare const shipmentWithMultipleParcelsSingleTracking: import("@commercelayer/sdk/lib/cjs/resources/shipments").Shipment;
|
|
12
13
|
export declare const shipmentWithMultipleParcelsMultipleTrackings: import("@commercelayer/sdk/lib/cjs/resources/shipments").Shipment;
|
|
13
14
|
export declare const shipmentWithoutTrackingDetails: import("@commercelayer/sdk/lib/cjs/resources/shipments").Shipment;
|