@voyantjs/resources-ui 0.28.1 → 0.28.3
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BookingOption, ResourceCloseoutRow, ResourceRow, ResourceSlotAssignmentRow, SlotOption } from "@voyantjs/resources-react";
|
|
2
|
-
export declare function ResourcesOverview({ bookings, slots, closeouts, filteredResources, filteredPools, liveAssignments, resourcesWithoutSupplier, unassignedReservations, search, setSearch, kindFilter, setKindFilter, hasFilters, onClearFilters, onOpenAssignment, onOpenResource, }: {
|
|
2
|
+
export declare function ResourcesOverview({ bookings, slots, closeouts, filteredResources, filteredPools, liveAssignments, resourcesWithoutSupplier, unassignedReservations, search, setSearch, kindFilter, setKindFilter, hasFilters, onClearFilters, onOpenAssignment, onOpenResource, showFilters, }: {
|
|
3
3
|
bookings: BookingOption[];
|
|
4
4
|
slots: SlotOption[];
|
|
5
5
|
closeouts: ResourceCloseoutRow[];
|
|
@@ -18,5 +18,11 @@ export declare function ResourcesOverview({ bookings, slots, closeouts, filtered
|
|
|
18
18
|
onClearFilters: () => void;
|
|
19
19
|
onOpenAssignment: (assignmentId: string) => void;
|
|
20
20
|
onOpenResource: (resourceId: string) => void;
|
|
21
|
+
/**
|
|
22
|
+
* When false, hides the inline search + kind filter row. Templates that
|
|
23
|
+
* surface those controls in the page header (mirroring availability) pass
|
|
24
|
+
* `false` so the affordance isn't duplicated.
|
|
25
|
+
*/
|
|
26
|
+
showFilters?: boolean;
|
|
21
27
|
}): import("react/jsx-runtime").JSX.Element;
|
|
22
28
|
//# sourceMappingURL=resources-overview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources-overview.d.ts","sourceRoot":"","sources":["../../src/components/resources-overview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,yBAAyB,EACzB,UAAU,EACX,MAAM,2BAA2B,CAAA;AAqBlC,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,KAAK,EACL,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,MAAM,EACN,SAAS,EACT,UAAU,EACV,aAAa,EACb,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,
|
|
1
|
+
{"version":3,"file":"resources-overview.d.ts","sourceRoot":"","sources":["../../src/components/resources-overview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,yBAAyB,EACzB,UAAU,EACX,MAAM,2BAA2B,CAAA;AAqBlC,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,KAAK,EACL,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,MAAM,EACN,SAAS,EACT,UAAU,EACV,aAAa,EACb,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,WAAkB,GACnB,EAAE;IACD,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,SAAS,EAAE,mBAAmB,EAAE,CAAA;IAChC,iBAAiB,EAAE,WAAW,EAAE,CAAA;IAChC,aAAa,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IACzC,eAAe,EAAE,yBAAyB,EAAE,CAAA;IAC5C,wBAAwB,EAAE,WAAW,EAAE,CAAA;IACvC,sBAAsB,EAAE,yBAAyB,EAAE,CAAA;IACnD,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,UAAU,EAAE,OAAO,CAAA;IACnB,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,gBAAgB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IAChD,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,2CAkJA"}
|
|
@@ -5,7 +5,7 @@ import { Button, Card, CardContent, CardHeader, CardTitle, Input, OverviewMetric
|
|
|
5
5
|
import { CalendarDays, ExternalLink, Search, Users, Wrench } from "lucide-react";
|
|
6
6
|
import { useResourcesUiI18nOrDefault } from "../i18n/index.js";
|
|
7
7
|
import { formatResourceSlotLabel, RESOURCE_KIND_VALUES } from "../i18n/utils.js";
|
|
8
|
-
export function ResourcesOverview({ bookings, slots, closeouts, filteredResources, filteredPools, liveAssignments, resourcesWithoutSupplier, unassignedReservations, search, setSearch, kindFilter, setKindFilter, hasFilters, onClearFilters, onOpenAssignment, onOpenResource, }) {
|
|
8
|
+
export function ResourcesOverview({ bookings, slots, closeouts, filteredResources, filteredPools, liveAssignments, resourcesWithoutSupplier, unassignedReservations, search, setSearch, kindFilter, setKindFilter, hasFilters, onClearFilters, onOpenAssignment, onOpenResource, showFilters = true, }) {
|
|
9
9
|
const i18n = useResourcesUiI18nOrDefault();
|
|
10
10
|
const m = i18n.messages;
|
|
11
11
|
const activeResourcesCount = filteredResources.filter((resource) => resource.active).length;
|
|
@@ -28,5 +28,5 @@ export function ResourcesOverview({ bookings, slots, closeouts, filteredResource
|
|
|
28
28
|
}) })] }, assignment.id)))) })] }), _jsxs(Card, { size: "sm", children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: m.overview.ownershipGaps.title }) }), _jsx(CardContent, { className: "space-y-3 text-sm", children: resourcesWithoutSupplier.length === 0 ? (_jsx("p", { className: "text-muted-foreground", children: m.overview.ownershipGaps.empty })) : (resourcesWithoutSupplier.slice(0, 4).map((resource) => (_jsxs("button", { type: "button", className: "block w-full rounded-md border p-3 text-left hover:bg-muted/40", onClick: () => onOpenResource(resource.id), children: [_jsx("div", { className: "font-medium", children: resource.name }), _jsx("div", { className: "text-muted-foreground", children: formatMessage(m.overview.ownershipGaps.detail, {
|
|
29
29
|
kind: m.common.resourceKindLabels[resource.kind],
|
|
30
30
|
capacity: resource.capacity === null ? "-" : i18n.formatNumber(resource.capacity),
|
|
31
|
-
}) })] }, resource.id)))) })] })] }), _jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [_jsxs("div", { className: "flex flex-1 flex-col gap-3 md:flex-row md:items-center", children: [_jsxs("div", { className: "relative w-full max-w-sm", children: [_jsx(Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }), _jsx(Input, { placeholder: m.overview.filters.searchPlaceholder, value: search, onChange: (event) => setSearch(event.target.value), className: "pl-9" })] }), _jsxs(Select, { value: kindFilter, onValueChange: (value) => setKindFilter(value ?? "all"), children: [_jsx(SelectTrigger, { className: "w-full md:w-56", children: _jsx(SelectValue, { placeholder: m.overview.filters.allKindsPlaceholder }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "all", children: m.common.allKinds }), kindOptions.map((option) => (_jsx(SelectItem, { value: option.value, children: option.label }, option.value)))] })] })] }), hasFilters ? (_jsx(Button, { variant: "outline", onClick: onClearFilters, children: m.common.clearFilters })) : null] })] }));
|
|
31
|
+
}) })] }, resource.id)))) })] })] }), showFilters ? (_jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [_jsxs("div", { className: "flex flex-1 flex-col gap-3 md:flex-row md:items-center", children: [_jsxs("div", { className: "relative w-full max-w-sm", children: [_jsx(Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }), _jsx(Input, { placeholder: m.overview.filters.searchPlaceholder, value: search, onChange: (event) => setSearch(event.target.value), className: "pl-9" })] }), _jsxs(Select, { value: kindFilter, onValueChange: (value) => setKindFilter(value ?? "all"), children: [_jsx(SelectTrigger, { className: "w-full md:w-56", children: _jsx(SelectValue, { placeholder: m.overview.filters.allKindsPlaceholder }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "all", children: m.common.allKinds }), kindOptions.map((option) => (_jsx(SelectItem, { value: option.value, children: option.label }, option.value)))] })] })] }), hasFilters ? (_jsx(Button, { variant: "outline", onClick: onClearFilters, children: m.common.clearFilters })) : null] })) : null] }));
|
|
32
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/resources-ui",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@tanstack/react-table": "^8.0.0",
|
|
45
45
|
"react": "^19.0.0",
|
|
46
46
|
"react-dom": "^19.0.0",
|
|
47
|
-
"@voyantjs/resources-react": "0.28.
|
|
48
|
-
"@voyantjs/ui": "0.28.
|
|
47
|
+
"@voyantjs/resources-react": "0.28.3",
|
|
48
|
+
"@voyantjs/ui": "0.28.3"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@voyantjs/i18n": "0.28.
|
|
51
|
+
"@voyantjs/i18n": "0.28.3"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@tanstack/react-query": "^5.96.2",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"react-dom": "^19.2.4",
|
|
61
61
|
"typescript": "^6.0.2",
|
|
62
62
|
"vitest": "^4.1.2",
|
|
63
|
-
"@voyantjs/i18n": "0.28.
|
|
64
|
-
"@voyantjs/resources-react": "0.28.
|
|
63
|
+
"@voyantjs/i18n": "0.28.3",
|
|
64
|
+
"@voyantjs/resources-react": "0.28.3",
|
|
65
65
|
"@voyantjs/voyant-typescript-config": "0.1.0",
|
|
66
|
-
"@voyantjs/ui": "0.28.
|
|
66
|
+
"@voyantjs/ui": "0.28.3"
|
|
67
67
|
},
|
|
68
68
|
"files": [
|
|
69
69
|
"dist",
|