@pisell/private-materials 3.4.156 → 3.4.158

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.
Files changed (70) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +14 -14
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +14 -14
  9. package/es/index.d.ts +7 -1
  10. package/es/index.js +5 -1
  11. package/es/plus/inventory/BindingModal.js +94 -0
  12. package/es/plus/inventory/InventoryItemManagement.d.ts +7 -0
  13. package/es/plus/inventory/InventoryItemManagement.js +204 -0
  14. package/es/plus/inventory/InventoryLocationManagement.d.ts +7 -0
  15. package/es/plus/inventory/InventoryLocationManagement.js +296 -0
  16. package/es/plus/inventory/InventoryUnitManagement.d.ts +7 -0
  17. package/es/plus/inventory/InventoryUnitManagement.js +144 -0
  18. package/es/plus/inventory/ItemDrawer.js +266 -0
  19. package/es/plus/inventory/RecordDialog.js +141 -0
  20. package/es/plus/inventory/StockList.js +132 -0
  21. package/es/plus/inventory/api.js +66 -0
  22. package/es/plus/inventory/components.js +172 -0
  23. package/es/plus/inventory/context.js +118 -0
  24. package/es/plus/inventory/forms.js +46 -0
  25. package/es/plus/inventory/hooks.js +235 -0
  26. package/es/plus/inventory/index.less +559 -0
  27. package/es/plus/inventory/locales.js +277 -0
  28. package/es/plus/inventory/types.d.ts +10 -0
  29. package/es/plus/inventory/utils.js +24 -0
  30. package/es/plus/pisellSupersetDashboard/README.md +291 -0
  31. package/es/plus/pisellSupersetDashboard/index.d.ts +15 -0
  32. package/es/plus/pisellSupersetDashboard/index.js +187 -0
  33. package/es/plus/pisellSupersetDashboard/index.less +83 -0
  34. package/es/plus/pisellSupersetDashboard/locales.js +36 -0
  35. package/es/plus/pisellSupersetDashboard/serve.js +51 -0
  36. package/es/plus/pisellSupersetDashboard/types.d.ts +17 -0
  37. package/es/plus/skuOptionsSelection/store/createStore.js +2 -2
  38. package/lib/index.d.ts +7 -1
  39. package/lib/index.js +134 -126
  40. package/lib/plus/inventory/BindingModal.js +96 -0
  41. package/lib/plus/inventory/InventoryItemManagement.d.ts +7 -0
  42. package/lib/plus/inventory/InventoryItemManagement.js +206 -0
  43. package/lib/plus/inventory/InventoryLocationManagement.d.ts +7 -0
  44. package/lib/plus/inventory/InventoryLocationManagement.js +298 -0
  45. package/lib/plus/inventory/InventoryUnitManagement.d.ts +7 -0
  46. package/lib/plus/inventory/InventoryUnitManagement.js +146 -0
  47. package/lib/plus/inventory/ItemDrawer.js +268 -0
  48. package/lib/plus/inventory/RecordDialog.js +143 -0
  49. package/lib/plus/inventory/StockList.js +134 -0
  50. package/lib/plus/inventory/api.js +66 -0
  51. package/lib/plus/inventory/components.js +181 -0
  52. package/lib/plus/inventory/context.js +121 -0
  53. package/lib/plus/inventory/forms.js +50 -0
  54. package/lib/plus/inventory/hooks.js +240 -0
  55. package/lib/plus/inventory/index.less +559 -0
  56. package/lib/plus/inventory/locales.js +277 -0
  57. package/lib/plus/inventory/types.d.ts +10 -0
  58. package/lib/plus/inventory/utils.js +30 -0
  59. package/lib/plus/pisellSupersetDashboard/README.md +291 -0
  60. package/lib/plus/pisellSupersetDashboard/index.d.ts +15 -0
  61. package/lib/plus/pisellSupersetDashboard/index.js +189 -0
  62. package/lib/plus/pisellSupersetDashboard/index.less +83 -0
  63. package/lib/plus/pisellSupersetDashboard/locales.js +36 -0
  64. package/lib/plus/pisellSupersetDashboard/serve.js +52 -0
  65. package/lib/plus/pisellSupersetDashboard/types.d.ts +17 -0
  66. package/lowcode/inventory-item-management/meta.ts +20 -0
  67. package/lowcode/inventory-location-management/meta.ts +20 -0
  68. package/lowcode/inventory-unit-management/meta.ts +20 -0
  69. package/lowcode/pisell-superset-dashboard/meta.ts +75 -0
  70. package/package.json +5 -3
package/es/index.d.ts CHANGED
@@ -23,6 +23,8 @@ import { _default as _default$9 } from "./components/pay/toC/index.js";
23
23
  import { _default as _default$1 } from "./components/eftpos/index.js";
24
24
  import { WalletList } from "./components/walletList/index.js";
25
25
  import { BookingDashboard } from "./components/booking/dashboard/index.js";
26
+ import { PisellSupersetDashboardProps } from "./plus/pisellSupersetDashboard/types.js";
27
+ import { PisellSupersetDashboard } from "./plus/pisellSupersetDashboard/index.js";
26
28
  import { PisellSelectCustomerModal } from "./components/pisellSelectCustomerModal/index.js";
27
29
  import { EventBooking } from "./components/eventBooking/index.js";
28
30
  import { EventCard } from "./components/eventBooking/components/eventCard/index.js";
@@ -84,6 +86,10 @@ import { Registry } from "./components/systemSettings/registry/index.js";
84
86
  import { SaasRole } from "./plus/saasRole/index.js";
85
87
  import { SaasTeamMembersProps } from "./plus/saasTeamMembers/type.js";
86
88
  import { SaasTeamMembers } from "./plus/saasTeamMembers/index.js";
89
+ import { InventoryPageProps } from "./plus/inventory/types.js";
90
+ import { InventoryItemManagement } from "./plus/inventory/InventoryItemManagement.js";
91
+ import { InventoryUnitManagement } from "./plus/inventory/InventoryUnitManagement.js";
92
+ import { InventoryLocationManagement } from "./plus/inventory/InventoryLocationManagement.js";
87
93
  import { SaasDeviceProfileProps } from "./plus/saasDevice/deviceProfile/types.js";
88
94
  import { SaasDeviceProfile } from "./plus/saasDevice/deviceProfile/index.js";
89
95
  import { SaasDevicePlanningProps } from "./plus/saasDevice/devicePlanning/model/types.js";
@@ -122,4 +128,4 @@ import { PisellProResourcePickerModal } from "./plus/pisellProResourcePickerModa
122
128
  import { PisellFloorMapPaletteViewAllModal } from "./plus/pisellProResourcePickerModal/PisellFloorMapPaletteViewAllModal.js";
123
129
  import { PisellCashCounting } from "./components/pisellCashCounting/PisellCashCounting.js";
124
130
  import { _default as _default$5 } from "./plus/pisellAdyenDashboard/index.js";
125
- export { AppointmentBooking, Deposit as AppointmentDeposit, AuthModal, Booking, Addons as BookingAddons, Contacts as BookingContacts, BookingDashboard, Deposit$1 as BookingDeposit, Duration as BookingDuration, Forms as BookingForms, APP as BookingInfo, Notes as BookingNotes, Payments as BookingPayment, Resources as BookingResources, StartTime as BookingStartTime, ChannelAuthSetting, ClientCard, ClientSearch, ComprehensiveSearch, ContactInfo, ContactInfoModal, CustomerAuth, CustomerOAuthConfig, type CustomerOAuthConfigProps, DeviceAuth, type DeviceAuthProps, CupList as EcoCupList, EcoCupProject, CustomerList as EcoCustomerList, _default as EditBookingModal, _default$1 as Eftpos, _default$2 as EftposPay, EventBooking, BookingAvailabilityCalendar as EventBookingAvailabilityCalendar, BookingDetailModal as EventBookingDetailModal, BookingServiceList as EventBookingServiceList, EventCard, PisellProductCard as EventProductCard, ProgressBar as EventProgressBar, PisellResourceCard as EventResourceDisplay, EventResourceUsability, EventScheduleCalendar, PisellSelectHolder as EventSelectHolder, TimeResourceSelector as EventTimeResourceSelector, type FloorMapBookingClickArgs, type FloorMapBookingClickMode, HolderList, KioskSkuDetail, Login, Login2, type LoginProps, OAuthConfig, Onlineshopauth as OnlineShopAuth, OrderList, OrgAdminAuth, type OrgAdminAuthProps, PISELL_RESERVATION_TABLE_PAGE_STORAGE_KEY, PISELL_RESERVATION_VENUE_WALL_PAGE_STORAGE_KEY, POSOperatorAuth, type POSOperatorAuthProps, PanpacificTask, type PanpacificTaskProps, PiPaymentResult, _default$3 as PinModal, _default$4 as PinVerifyModal, _default$5 as PisellAdyenDashboard, PisellCashCounting, PisellFloorMapPaletteViewAllModal, PisellProResourcePickerModal, type PisellProResourcePickerModalProps, type PisellProResourcePickerMode, PisellReservation, PisellReservationBookingPage, PisellReservationCore, type PisellReservationProps, PisellReservationTablePage, type PisellReservationTableRow, PisellSalesGrid, PisellSelectCustomerModal, PisellTopology, PisellTopologyCore, type PisellTopologyProps, PisellVenueControlPage, PisellVenueWallPage, PisellNumberSelector as ProNumberSelector, ProductExtension, _default$6 as ProductStockCheckModal, Register2, type ResourceSelectModeConfig, RuleSetting, SKUOptionsSelection, SaaSAdminAuth, type SaaSAdminAuthProps, SaaSManagermentAuth, SaasAttendance, SaasCreateOrganization, SaasDevicePasscodes, type SaasDevicePasscodesProps, SaasDevicePlanning, type SaasDevicePlanningProps, SaasDeviceProfile, type SaasDeviceProfileProps, SaasLogin, _default$7 as SaasRegister, SaasRole, SaasTeamMembers, type SaasTeamMembersProps, SaleDetail, ScanOrder, type ScanOrderProps, Schedules, SelectFloorMapResourceDialog, type SelectFloorMapResourcePayload, PisellSelectHolder$1 as SelectHolder, Selector, Registry as SettingsRegistry, shoppingCart as ShoppingCart, StepController, SubTotal, TaxSelect, _default$8 as TicketBooking, _default$9 as ToCPay, type TopologyDeviceRow, VenueBooking, AddServiceVariant as VerticalAddService, VerticalClient, WalletEditor, WalletList, PassDetail as WalletPassDetail, WalletPassGallery, WorkspacesList as WorkspaceList, WorkSpaceListDetail as WorkspaceListDetail, PisellReservationBookingPage as default, defaultReservationTableRows, getDefaultReservationFloorMapConfig, PisellSalesManagement as pisellSalesManagement };
131
+ export { AppointmentBooking, Deposit as AppointmentDeposit, AuthModal, Booking, Addons as BookingAddons, Contacts as BookingContacts, BookingDashboard, Deposit$1 as BookingDeposit, Duration as BookingDuration, Forms as BookingForms, APP as BookingInfo, Notes as BookingNotes, Payments as BookingPayment, Resources as BookingResources, StartTime as BookingStartTime, ChannelAuthSetting, ClientCard, ClientSearch, ComprehensiveSearch, ContactInfo, ContactInfoModal, CustomerAuth, CustomerOAuthConfig, type CustomerOAuthConfigProps, DeviceAuth, type DeviceAuthProps, CupList as EcoCupList, EcoCupProject, CustomerList as EcoCustomerList, _default as EditBookingModal, _default$1 as Eftpos, _default$2 as EftposPay, EventBooking, BookingAvailabilityCalendar as EventBookingAvailabilityCalendar, BookingDetailModal as EventBookingDetailModal, BookingServiceList as EventBookingServiceList, EventCard, PisellProductCard as EventProductCard, ProgressBar as EventProgressBar, PisellResourceCard as EventResourceDisplay, EventResourceUsability, EventScheduleCalendar, PisellSelectHolder as EventSelectHolder, TimeResourceSelector as EventTimeResourceSelector, type FloorMapBookingClickArgs, type FloorMapBookingClickMode, HolderList, InventoryItemManagement, type InventoryPageProps as InventoryItemManagementProps, InventoryLocationManagement, type InventoryPageProps as InventoryLocationManagementProps, type InventoryPageProps, InventoryUnitManagement, type InventoryPageProps as InventoryUnitManagementProps, KioskSkuDetail, Login, Login2, type LoginProps, OAuthConfig, Onlineshopauth as OnlineShopAuth, OrderList, OrgAdminAuth, type OrgAdminAuthProps, PISELL_RESERVATION_TABLE_PAGE_STORAGE_KEY, PISELL_RESERVATION_VENUE_WALL_PAGE_STORAGE_KEY, POSOperatorAuth, type POSOperatorAuthProps, PanpacificTask, type PanpacificTaskProps, PiPaymentResult, _default$3 as PinModal, _default$4 as PinVerifyModal, _default$5 as PisellAdyenDashboard, PisellCashCounting, PisellFloorMapPaletteViewAllModal, PisellProResourcePickerModal, type PisellProResourcePickerModalProps, type PisellProResourcePickerMode, PisellReservation, PisellReservationBookingPage, PisellReservationCore, type PisellReservationProps, PisellReservationTablePage, type PisellReservationTableRow, PisellSalesGrid, PisellSelectCustomerModal, PisellSupersetDashboard, type PisellSupersetDashboardProps, PisellTopology, PisellTopologyCore, type PisellTopologyProps, PisellVenueControlPage, PisellVenueWallPage, PisellNumberSelector as ProNumberSelector, ProductExtension, _default$6 as ProductStockCheckModal, Register2, type ResourceSelectModeConfig, RuleSetting, SKUOptionsSelection, SaaSAdminAuth, type SaaSAdminAuthProps, SaaSManagermentAuth, SaasAttendance, SaasCreateOrganization, SaasDevicePasscodes, type SaasDevicePasscodesProps, SaasDevicePlanning, type SaasDevicePlanningProps, SaasDeviceProfile, type SaasDeviceProfileProps, SaasLogin, _default$7 as SaasRegister, SaasRole, SaasTeamMembers, type SaasTeamMembersProps, SaleDetail, ScanOrder, type ScanOrderProps, Schedules, SelectFloorMapResourceDialog, type SelectFloorMapResourcePayload, PisellSelectHolder$1 as SelectHolder, Selector, Registry as SettingsRegistry, shoppingCart as ShoppingCart, StepController, SubTotal, TaxSelect, _default$8 as TicketBooking, _default$9 as ToCPay, type TopologyDeviceRow, VenueBooking, AddServiceVariant as VerticalAddService, VerticalClient, WalletEditor, WalletList, PassDetail as WalletPassDetail, WalletPassGallery, WorkspacesList as WorkspaceList, WorkSpaceListDetail as WorkspaceListDetail, PisellReservationBookingPage as default, defaultReservationTableRows, getDefaultReservationFloorMapConfig, PisellSalesManagement as pisellSalesManagement };
package/es/index.js CHANGED
@@ -28,6 +28,7 @@ import eftpos_default from "./components/eftpos/index.js";
28
28
  import pinModal_default from "./components/pinModal/index.js";
29
29
  import WalletList from "./components/walletList/index.js";
30
30
  import BookingDashboard from "./components/booking/dashboard/index.js";
31
+ import PisellSupersetDashboard from "./plus/pisellSupersetDashboard/index.js";
31
32
  import PisellSelectCustomerModal from "./components/pisellSelectCustomerModal/index.js";
32
33
  import ProgressBar from "./components/eventBooking/components/progressBar/index.js";
33
34
  import PisellSelectHolder from "./components/eventBooking/components/selectHolder/index.js";
@@ -78,6 +79,9 @@ import HolderList from "./plus/selectHolder/components/HolderList/index.js";
78
79
  import PisellSelectHolder$1 from "./plus/selectHolder/index.js";
79
80
  import SaasRole from "./plus/saasRole/index.js";
80
81
  import SaasTeamMembers from "./plus/saasTeamMembers/index.js";
82
+ import InventoryItemManagement from "./plus/inventory/InventoryItemManagement.js";
83
+ import InventoryUnitManagement from "./plus/inventory/InventoryUnitManagement.js";
84
+ import InventoryLocationManagement from "./plus/inventory/InventoryLocationManagement.js";
81
85
  import SaasDeviceProfile from "./plus/saasDevice/deviceProfile/index.js";
82
86
  import SaasDevicePlanning from "./plus/saasDevice/devicePlanning/index.js";
83
87
  import SaasDevicePasscodes from "./plus/saasDevice/devicePasscodes/index.js";
@@ -115,4 +119,4 @@ import localeData from "dayjs/plugin/localeData";
115
119
  dayjs.extend(weekday);
116
120
  dayjs.extend(localeData);
117
121
  //#endregion
118
- export { AppointmentBooking, Deposit as AppointmentDeposit, AuthModal, Booking, Addons as BookingAddons, Contacts as BookingContacts, BookingDashboard, Deposit$1 as BookingDeposit, Duration as BookingDuration, Forms as BookingForms, APP as BookingInfo, Notes as BookingNotes, Payments as BookingPayment, Resources as BookingResources, StartTime as BookingStartTime, ChannelAuthSetting, ClientCard, ClientSearch, ComprehensiveSearch, ContactInfo, ContactInfoModal, CustomerAuth, CustomerOAuthConfig, DeviceAuth, CupList as EcoCupList, EcoCupProject, CustomerList as EcoCustomerList, editBookingModal_default as EditBookingModal, eftpos_default as Eftpos, eftposPay_default as EftposPay, EventBooking, BookingAvailabilityCalendar as EventBookingAvailabilityCalendar, BookingDetailModal as EventBookingDetailModal, BookingServiceList as EventBookingServiceList, EventCard, PisellProductCard as EventProductCard, ProgressBar as EventProgressBar, PisellResourceCard as EventResourceDisplay, EventResourceUsability, EventScheduleCalendar, PisellSelectHolder as EventSelectHolder, TimeResourceSelector as EventTimeResourceSelector, HolderList, KioskSkuDetail, Login, Login2, OAuthConfig, Onlineshopauth as OnlineShopAuth, OrderList, OrgAdminAuth, PISELL_RESERVATION_TABLE_PAGE_STORAGE_KEY, PISELL_RESERVATION_VENUE_WALL_PAGE_STORAGE_KEY, POSOperatorAuth, PanpacificTask, PiPaymentResult, pinModal_default as PinModal, pinVerifyModal_default as PinVerifyModal, pisellAdyenDashboard_default as PisellAdyenDashboard, PisellCashCounting, PisellFloorMapPaletteViewAllModal, PisellProResourcePickerModal, PisellReservation, PisellReservationBookingPage, PisellReservationCore, PisellReservationTablePage, pisellSalesGrid_default as PisellSalesGrid, PisellSelectCustomerModal, PisellTopology, PisellTopologyCore, PisellVenueControlPage, PisellVenueWallPage, PisellNumberSelector as ProNumberSelector, ProductExtension, productStockCheckModal_default as ProductStockCheckModal, Register2, RuleSetting, SKUOptionsSelection, SaaSAdminAuth, SaaSManagermentAuth, SaasAttendance, SaasCreateOrganization, SaasDevicePasscodes, SaasDevicePlanning, SaasDeviceProfile, SaasLogin, saasRegister_default as SaasRegister, SaasRole, SaasTeamMembers, SaleDetail, ScanOrder, Schedules, SelectFloorMapResourceDialog, PisellSelectHolder$1 as SelectHolder, Selector, Registry as SettingsRegistry, shoppingCart as ShoppingCart, StepController, SubTotal, TaxSelect, ticketBooking_default as TicketBooking, toC_default as ToCPay, VenueBooking, AddServiceVariant as VerticalAddService, VerticalClient, walletEditor_default as WalletEditor, WalletList, PassDetail as WalletPassDetail, WalletPassGallery, WorkspacesList as WorkspaceList, WorkSpaceListDetail as WorkspaceListDetail, PisellReservationBookingPage as default, defaultReservationTableRows, getDefaultReservationFloorMapConfig, PisellSalesManagement as pisellSalesManagement };
122
+ export { AppointmentBooking, Deposit as AppointmentDeposit, AuthModal, Booking, Addons as BookingAddons, Contacts as BookingContacts, BookingDashboard, Deposit$1 as BookingDeposit, Duration as BookingDuration, Forms as BookingForms, APP as BookingInfo, Notes as BookingNotes, Payments as BookingPayment, Resources as BookingResources, StartTime as BookingStartTime, ChannelAuthSetting, ClientCard, ClientSearch, ComprehensiveSearch, ContactInfo, ContactInfoModal, CustomerAuth, CustomerOAuthConfig, DeviceAuth, CupList as EcoCupList, EcoCupProject, CustomerList as EcoCustomerList, editBookingModal_default as EditBookingModal, eftpos_default as Eftpos, eftposPay_default as EftposPay, EventBooking, BookingAvailabilityCalendar as EventBookingAvailabilityCalendar, BookingDetailModal as EventBookingDetailModal, BookingServiceList as EventBookingServiceList, EventCard, PisellProductCard as EventProductCard, ProgressBar as EventProgressBar, PisellResourceCard as EventResourceDisplay, EventResourceUsability, EventScheduleCalendar, PisellSelectHolder as EventSelectHolder, TimeResourceSelector as EventTimeResourceSelector, HolderList, InventoryItemManagement, InventoryLocationManagement, InventoryUnitManagement, KioskSkuDetail, Login, Login2, OAuthConfig, Onlineshopauth as OnlineShopAuth, OrderList, OrgAdminAuth, PISELL_RESERVATION_TABLE_PAGE_STORAGE_KEY, PISELL_RESERVATION_VENUE_WALL_PAGE_STORAGE_KEY, POSOperatorAuth, PanpacificTask, PiPaymentResult, pinModal_default as PinModal, pinVerifyModal_default as PinVerifyModal, pisellAdyenDashboard_default as PisellAdyenDashboard, PisellCashCounting, PisellFloorMapPaletteViewAllModal, PisellProResourcePickerModal, PisellReservation, PisellReservationBookingPage, PisellReservationCore, PisellReservationTablePage, pisellSalesGrid_default as PisellSalesGrid, PisellSelectCustomerModal, PisellSupersetDashboard, PisellTopology, PisellTopologyCore, PisellVenueControlPage, PisellVenueWallPage, PisellNumberSelector as ProNumberSelector, ProductExtension, productStockCheckModal_default as ProductStockCheckModal, Register2, RuleSetting, SKUOptionsSelection, SaaSAdminAuth, SaaSManagermentAuth, SaasAttendance, SaasCreateOrganization, SaasDevicePasscodes, SaasDevicePlanning, SaasDeviceProfile, SaasLogin, saasRegister_default as SaasRegister, SaasRole, SaasTeamMembers, SaleDetail, ScanOrder, Schedules, SelectFloorMapResourceDialog, PisellSelectHolder$1 as SelectHolder, Selector, Registry as SettingsRegistry, shoppingCart as ShoppingCart, StepController, SubTotal, TaxSelect, ticketBooking_default as TicketBooking, toC_default as ToCPay, VenueBooking, AddServiceVariant as VerticalAddService, VerticalClient, walletEditor_default as WalletEditor, WalletList, PassDetail as WalletPassDetail, WalletPassGallery, WorkspacesList as WorkspaceList, WorkSpaceListDetail as WorkspaceListDetail, PisellReservationBookingPage as default, defaultReservationTableRows, getDefaultReservationFloorMapConfig, PisellSalesManagement as pisellSalesManagement };
@@ -0,0 +1,94 @@
1
+ import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
+ import { useInventory } from "./context.js";
3
+ import { useInventoryMutation } from "./hooks.js";
4
+ import { PagedInventorySelect } from "./components.js";
5
+ import React from "react";
6
+ import { Alert, Form } from "antd";
7
+ import { PisellModal } from "@pisell/materials";
8
+ //#region src/plus/inventory/BindingModal.tsx
9
+ function BindingModal({ itemId, onClose, onBound }) {
10
+ const { api, t, success } = useInventory();
11
+ const [form] = Form.useForm();
12
+ const locationId = Form.useWatch("location_id", form);
13
+ const shelfId = Form.useWatch("shelf_id", form);
14
+ const mutation = useInventoryMutation();
15
+ const submit = () => mutation.run(_asyncToGenerator(function* () {
16
+ let values;
17
+ try {
18
+ values = yield form.validateFields();
19
+ } catch (_unused) {
20
+ return;
21
+ }
22
+ yield api.bind(itemId, values.space_id);
23
+ success("bound");
24
+ onBound();
25
+ }));
26
+ return /* @__PURE__ */ React.createElement(PisellModal, {
27
+ open: true,
28
+ title: t("bind"),
29
+ size: "middle",
30
+ okText: t("bind"),
31
+ cancelText: t("cancel"),
32
+ confirmLoading: mutation.busy,
33
+ closable: !mutation.busy,
34
+ maskClosable: !mutation.busy,
35
+ cancelButtonProps: { disabled: mutation.busy },
36
+ onCancel: () => {
37
+ if (!mutation.busy) onClose();
38
+ },
39
+ onOk: () => void submit()
40
+ }, /* @__PURE__ */ React.createElement("div", { className: "inventory-modal-body" }, /* @__PURE__ */ React.createElement(Alert, {
41
+ className: "inventory-notice",
42
+ type: "info",
43
+ showIcon: true,
44
+ message: t("bindHint")
45
+ }), /* @__PURE__ */ React.createElement(Form, {
46
+ form,
47
+ layout: "vertical",
48
+ disabled: mutation.busy
49
+ }, /* @__PURE__ */ React.createElement(Form.Item, {
50
+ name: "location_id",
51
+ label: t("location"),
52
+ rules: [{
53
+ required: true,
54
+ message: t("required")
55
+ }]
56
+ }, /* @__PURE__ */ React.createElement(PagedInventorySelect, {
57
+ resource: "location",
58
+ placeholder: t("chooseLocation"),
59
+ disabled: mutation.busy,
60
+ onChange: () => form.setFieldsValue({
61
+ shelf_id: void 0,
62
+ space_id: void 0
63
+ })
64
+ })), /* @__PURE__ */ React.createElement(Form.Item, {
65
+ name: "shelf_id",
66
+ label: t("shelf"),
67
+ rules: [{
68
+ required: true,
69
+ message: t("required")
70
+ }]
71
+ }, /* @__PURE__ */ React.createElement(PagedInventorySelect, {
72
+ key: `shelf-${locationId}`,
73
+ resource: "shelf",
74
+ placeholder: t("chooseShelf"),
75
+ disabled: !locationId || mutation.busy,
76
+ filters: { location_id: locationId },
77
+ onChange: () => form.setFieldValue("space_id", void 0)
78
+ })), /* @__PURE__ */ React.createElement(Form.Item, {
79
+ name: "space_id",
80
+ label: t("space"),
81
+ rules: [{
82
+ required: true,
83
+ message: t("required")
84
+ }]
85
+ }, /* @__PURE__ */ React.createElement(PagedInventorySelect, {
86
+ key: `space-${shelfId}`,
87
+ resource: "space",
88
+ placeholder: t("chooseSpace"),
89
+ disabled: !shelfId || mutation.busy,
90
+ filters: { shelf_id: shelfId }
91
+ })))));
92
+ }
93
+ //#endregion
94
+ export { BindingModal as default };
@@ -0,0 +1,7 @@
1
+ import { InventoryPageProps } from "./types.js";
2
+ import React from "react";
3
+
4
+ //#region src/plus/inventory/InventoryItemManagement.d.ts
5
+ declare function InventoryItemManagement(props: InventoryPageProps): React.JSX.Element;
6
+ //#endregion
7
+ export { InventoryItemManagement };
@@ -0,0 +1,204 @@
1
+ import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
+ import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
3
+ import { inventoryQuantity } from "./utils.js";
4
+ import { InventoryProvider, useInventory } from "./context.js";
5
+ import { useInventoryList, useInventoryMutation, useInventoryQuery } from "./hooks.js";
6
+ import { InventoryHeader, InventoryTable, RequestError, SearchInput, StatusSelect, StatusTag } from "./components.js";
7
+ import ItemDrawer from "./ItemDrawer.js";
8
+ import React, { useMemo, useState } from "react";
9
+ import { Button, Select, Space, Tooltip } from "antd";
10
+ import { useDebounce } from "ahooks";
11
+ import { PlusOutlined, ReloadOutlined } from "@ant-design/icons";
12
+ //#region src/plus/inventory/InventoryItemManagement.tsx
13
+ function ItemPage({ className, style }) {
14
+ const { api, t, name, confirm, success } = useInventory();
15
+ const [search, setSearch] = useState("");
16
+ const keyword = useDebounce(search, { wait: 300 });
17
+ const [status, setStatus] = useState();
18
+ const [unit, setUnit] = useState();
19
+ const [stockMode, setStockMode] = useState();
20
+ const [target, setTarget] = useState();
21
+ const mutation = useInventoryMutation();
22
+ const units = useInventoryQuery(() => api.units(), "item-filter-units");
23
+ const list = useInventoryList("item", {
24
+ search: keyword || void 0,
25
+ status,
26
+ unit_id: unit,
27
+ stock_mode: stockMode,
28
+ with: ["unit"]
29
+ });
30
+ const remove = (record) => void mutation.run(_asyncToGenerator(function* () {
31
+ if (!(yield confirm("deleteTitle", /* @__PURE__ */ React.createElement(React.Fragment, null, name(record), /* @__PURE__ */ React.createElement("p", null, t("deleteHint")))))) return;
32
+ try {
33
+ yield api.remove("item", record.id);
34
+ success("deleted");
35
+ } finally {
36
+ list.reload();
37
+ }
38
+ }));
39
+ const columns = useMemo(() => [
40
+ {
41
+ title: t("item"),
42
+ key: "name",
43
+ dataIndex: "name",
44
+ width: 250,
45
+ render: (_, record) => /* @__PURE__ */ React.createElement("button", {
46
+ type: "button",
47
+ className: "inventory-item-link",
48
+ onClick: () => setTarget({
49
+ id: record.id,
50
+ mode: "view"
51
+ })
52
+ }, record.cover && /* @__PURE__ */ React.createElement("img", {
53
+ className: "inventory-cover inventory-cover-small",
54
+ src: record.cover,
55
+ alt: ""
56
+ }), /* @__PURE__ */ React.createElement("span", null, name(record)))
57
+ },
58
+ {
59
+ title: t("sku"),
60
+ key: "sku",
61
+ dataIndex: "sku",
62
+ render: (value) => value || "—"
63
+ },
64
+ {
65
+ title: t("barcode"),
66
+ key: "barcode",
67
+ dataIndex: "barcode",
68
+ render: (value) => value || "—"
69
+ },
70
+ {
71
+ title: t("unit"),
72
+ key: "unit",
73
+ dataIndex: "unit",
74
+ render: (_, record) => record.unit ? name(record.unit) : "—"
75
+ },
76
+ {
77
+ title: t("stockMode"),
78
+ key: "stock_mode",
79
+ dataIndex: "stock_mode",
80
+ render: (value) => t(value)
81
+ },
82
+ {
83
+ title: t("quantity"),
84
+ key: "stock_quantity",
85
+ dataIndex: "stock_quantity",
86
+ align: "right",
87
+ render: inventoryQuantity
88
+ },
89
+ {
90
+ title: t("available"),
91
+ key: "stock_available_quantity",
92
+ dataIndex: "stock_available_quantity",
93
+ align: "right",
94
+ render: inventoryQuantity
95
+ },
96
+ {
97
+ title: t("status"),
98
+ key: "status",
99
+ dataIndex: "status",
100
+ render: (value) => /* @__PURE__ */ React.createElement(StatusTag, { status: value })
101
+ },
102
+ {
103
+ title: t("actions"),
104
+ key: "actions",
105
+ dataIndex: "actions",
106
+ fixed: "right",
107
+ width: 210,
108
+ render: (_, record) => /* @__PURE__ */ React.createElement(Space, { size: 0 }, /* @__PURE__ */ React.createElement(Button, {
109
+ type: "link",
110
+ disabled: mutation.busy,
111
+ onClick: () => setTarget({
112
+ id: record.id,
113
+ mode: "view"
114
+ })
115
+ }, t("view")), /* @__PURE__ */ React.createElement(Button, {
116
+ type: "link",
117
+ disabled: mutation.busy,
118
+ onClick: () => setTarget({
119
+ id: record.id,
120
+ mode: "edit"
121
+ })
122
+ }, t("edit")), /* @__PURE__ */ React.createElement(Button, {
123
+ type: "link",
124
+ danger: true,
125
+ disabled: mutation.busy,
126
+ onClick: () => remove(record)
127
+ }, t("remove")))
128
+ }
129
+ ], [
130
+ t,
131
+ name,
132
+ mutation.busy,
133
+ confirm,
134
+ api
135
+ ]);
136
+ return /* @__PURE__ */ React.createElement("div", {
137
+ className: `inventory-page ${className || ""}`,
138
+ style
139
+ }, /* @__PURE__ */ React.createElement(InventoryHeader, {
140
+ title: t("items"),
141
+ description: t("itemHint")
142
+ }, /* @__PURE__ */ React.createElement(Button, {
143
+ type: "primary",
144
+ icon: /* @__PURE__ */ React.createElement(PlusOutlined, null),
145
+ disabled: mutation.busy,
146
+ onClick: () => setTarget({ mode: "create" })
147
+ }, t("add"), " ", t("item"))), /* @__PURE__ */ React.createElement("div", { className: "inventory-toolbar" }, /* @__PURE__ */ React.createElement(Tooltip, { title: t("searchHint") }, /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(SearchInput, {
148
+ items: true,
149
+ value: search,
150
+ onChange: setSearch
151
+ }))), /* @__PURE__ */ React.createElement(Select, {
152
+ className: "inventory-filter",
153
+ showSearch: true,
154
+ allowClear: true,
155
+ optionFilterProp: "label",
156
+ placeholder: t("allUnits"),
157
+ loading: units.loading,
158
+ value: unit,
159
+ onChange: setUnit,
160
+ options: (units.data || []).map((record) => ({
161
+ value: record.id,
162
+ label: `${name(record)}${record.status === "inactive" ? ` (${t("inactive")})` : ""}`
163
+ }))
164
+ }), /* @__PURE__ */ React.createElement(Select, {
165
+ className: "inventory-filter",
166
+ allowClear: true,
167
+ placeholder: t("allStockModes"),
168
+ value: stockMode,
169
+ onChange: setStockMode,
170
+ options: ["tracked", "unlimited"].map((value) => ({
171
+ value,
172
+ label: t(value)
173
+ }))
174
+ }), /* @__PURE__ */ React.createElement(StatusSelect, {
175
+ value: status,
176
+ onChange: setStatus
177
+ }), /* @__PURE__ */ React.createElement(Button, {
178
+ icon: /* @__PURE__ */ React.createElement(ReloadOutlined, null),
179
+ disabled: mutation.busy,
180
+ onClick: () => {
181
+ list.reload();
182
+ units.reload();
183
+ }
184
+ }, t("refresh"))), /* @__PURE__ */ React.createElement(RequestError, {
185
+ error: list.error || units.error,
186
+ retry: () => {
187
+ list.reload();
188
+ units.reload();
189
+ }
190
+ }), /* @__PURE__ */ React.createElement(InventoryTable, _objectSpread2(_objectSpread2({}, list), {}, {
191
+ loading: list.loading || mutation.busy,
192
+ columns,
193
+ tableKey: "items"
194
+ })), target && /* @__PURE__ */ React.createElement(ItemDrawer, {
195
+ target,
196
+ onClose: () => setTarget(void 0),
197
+ onChanged: list.reload
198
+ }));
199
+ }
200
+ function InventoryItemManagement(props) {
201
+ return /* @__PURE__ */ React.createElement(InventoryProvider, { id: props.__id }, /* @__PURE__ */ React.createElement(ItemPage, props));
202
+ }
203
+ //#endregion
204
+ export { InventoryItemManagement as default };
@@ -0,0 +1,7 @@
1
+ import { InventoryPageProps } from "./types.js";
2
+ import React from "react";
3
+
4
+ //#region src/plus/inventory/InventoryLocationManagement.d.ts
5
+ declare function InventoryLocationManagement(props: InventoryPageProps): React.JSX.Element;
6
+ //#endregion
7
+ export { InventoryLocationManagement };