@nice2dev/ui-erp 1.3.1 → 1.3.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.
- package/dist/index.cjs +65 -65
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const $
|
|
5
|
-
const a = (e, t) => t, c = /* @__PURE__ */ $
|
|
4
|
+
const De$1 = require("react");
|
|
5
|
+
const a = (e, t) => t, c = /* @__PURE__ */ De$1.createContext(a), i = /* @__PURE__ */ De$1.createContext("en");
|
|
6
6
|
function v() {
|
|
7
|
-
const e = $
|
|
7
|
+
const e = De$1.useContext(c), t = De$1.useContext(i);
|
|
8
8
|
return { t: e, lang: t };
|
|
9
9
|
}
|
|
10
10
|
const gt = /* @__PURE__ */ new Set([
|
|
@@ -423,7 +423,7 @@ const xt = {
|
|
|
423
423
|
md: 20,
|
|
424
424
|
lg: 24,
|
|
425
425
|
xl: 32
|
|
426
|
-
}, Oe = /* @__PURE__ */ $
|
|
426
|
+
}, Oe = /* @__PURE__ */ De$1.createContext({});
|
|
427
427
|
function Zt({
|
|
428
428
|
path: n,
|
|
429
429
|
size: e,
|
|
@@ -469,7 +469,7 @@ const te = ({
|
|
|
469
469
|
title: s,
|
|
470
470
|
onClick: o
|
|
471
471
|
}) => {
|
|
472
|
-
const { resolver: i2 } = $
|
|
472
|
+
const { resolver: i2 } = De$1.useContext(Oe), c2 = typeof e == "number" ? e : Jt[e];
|
|
473
473
|
if (i2) {
|
|
474
474
|
const u = i2(n, c2);
|
|
475
475
|
if (u)
|
|
@@ -574,9 +574,9 @@ function U(n, e = []) {
|
|
|
574
574
|
e.some((r) => r && r.contains(a2)) || ne(a2) && t.push(a2);
|
|
575
575
|
return t;
|
|
576
576
|
}
|
|
577
|
-
const Be = typeof window > "u" ? $
|
|
577
|
+
const Be = typeof window > "u" ? De$1.useEffect : De$1.useLayoutEffect;
|
|
578
578
|
function _(n, e, t) {
|
|
579
|
-
const a2 = $
|
|
579
|
+
const a2 = De$1.useRef({ el: null, deps: [] }), r = De$1.useRef(e);
|
|
580
580
|
r.current = e, Be(() => {
|
|
581
581
|
const s = (n == null ? void 0 : n.current) ?? null, o = a2.current;
|
|
582
582
|
s === o.el && t.length === o.deps.length && t.every((c2, d) => Object.is(c2, o.deps[d])) || (typeof o.cleanup == "function" && o.cleanup(), o.el = s, o.deps = [...t], o.cleanup = s ? r.current(s) : void 0);
|
|
@@ -1470,16 +1470,16 @@ function jn(n = window, e = true) {
|
|
|
1470
1470
|
return t || (t = new Kn(n), ot.set(n, t)), e && t.start(), t;
|
|
1471
1471
|
}
|
|
1472
1472
|
function B() {
|
|
1473
|
-
const [n] = $
|
|
1473
|
+
const [n] = De$1.useState(
|
|
1474
1474
|
() => typeof window > "u" ? null : jn(window, false)
|
|
1475
1475
|
);
|
|
1476
|
-
return $
|
|
1476
|
+
return De$1.useEffect(() => {
|
|
1477
1477
|
n == null || n.start();
|
|
1478
1478
|
}, [n]), n;
|
|
1479
1479
|
}
|
|
1480
1480
|
const da = '[role="row"],tr', ha = '[role="gridcell"],[role="columnheader"],[role="rowheader"],td,th', fa = 'button:not([disabled]),a[href],input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled])', pa = 'textarea,select,input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"])';
|
|
1481
1481
|
function Xa(n, e = {}) {
|
|
1482
|
-
const { rowSelector: t = da, cellSelector: a2 = ha, pageSize: r = 10, enabled: s = true } = e, o = $
|
|
1482
|
+
const { rowSelector: t = da, cellSelector: a2 = ha, pageSize: r = 10, enabled: s = true } = e, o = De$1.useRef(e);
|
|
1483
1483
|
o.current = e;
|
|
1484
1484
|
const i2 = B();
|
|
1485
1485
|
_(
|
|
@@ -1615,15 +1615,15 @@ const NiceCapacityPlanner = ({
|
|
|
1615
1615
|
var _a, _b;
|
|
1616
1616
|
const { t } = v();
|
|
1617
1617
|
const config = { ...DEFAULT_VIEW_CONFIG$1, ...externalConfig };
|
|
1618
|
-
const [selectedAllocation, setSelectedAllocation] = $
|
|
1619
|
-
const [hoveredCell, setHoveredCell] = $
|
|
1620
|
-
const [timeUnit, setTimeUnit] = $
|
|
1621
|
-
const [expandedResources, setExpandedResources] = $
|
|
1618
|
+
const [selectedAllocation, setSelectedAllocation] = De$1.useState(null);
|
|
1619
|
+
const [hoveredCell, setHoveredCell] = De$1.useState(null);
|
|
1620
|
+
const [timeUnit, setTimeUnit] = De$1.useState(config.timeUnit);
|
|
1621
|
+
const [expandedResources, setExpandedResources] = De$1.useState(
|
|
1622
1622
|
new Set(resources.map((r) => r.id))
|
|
1623
1623
|
);
|
|
1624
|
-
const [showAllocationModal, setShowAllocationModal] = $
|
|
1625
|
-
const [newAllocation, setNewAllocation] = $
|
|
1626
|
-
const timePeriods = $
|
|
1624
|
+
const [showAllocationModal, setShowAllocationModal] = De$1.useState(false);
|
|
1625
|
+
const [newAllocation, setNewAllocation] = De$1.useState({});
|
|
1626
|
+
const timePeriods = De$1.useMemo(() => {
|
|
1627
1627
|
const periods = [];
|
|
1628
1628
|
const increment = TIME_INCREMENTS[timeUnit];
|
|
1629
1629
|
let current = new Date(dateRange.start);
|
|
@@ -1633,7 +1633,7 @@ const NiceCapacityPlanner = ({
|
|
|
1633
1633
|
}
|
|
1634
1634
|
return periods;
|
|
1635
1635
|
}, [dateRange.start, dateRange.end, timeUnit]);
|
|
1636
|
-
const utilizationMap = $
|
|
1636
|
+
const utilizationMap = De$1.useMemo(() => {
|
|
1637
1637
|
const map = /* @__PURE__ */ new Map();
|
|
1638
1638
|
resources.forEach((resource) => {
|
|
1639
1639
|
const resourceMap = /* @__PURE__ */ new Map();
|
|
@@ -1664,7 +1664,7 @@ const NiceCapacityPlanner = ({
|
|
|
1664
1664
|
});
|
|
1665
1665
|
return map;
|
|
1666
1666
|
}, [resources, allocations, timePeriods, timeUnit]);
|
|
1667
|
-
const conflicts = $
|
|
1667
|
+
const conflicts = De$1.useMemo(() => {
|
|
1668
1668
|
const conflictList = [];
|
|
1669
1669
|
utilizationMap.forEach((resourceMap, resourceId) => {
|
|
1670
1670
|
const resource = resources.find((r) => r.id === resourceId);
|
|
@@ -1692,7 +1692,7 @@ const NiceCapacityPlanner = ({
|
|
|
1692
1692
|
});
|
|
1693
1693
|
return conflictList;
|
|
1694
1694
|
}, [utilizationMap, allocations, resources, timeUnit]);
|
|
1695
|
-
const getCellAllocations = $
|
|
1695
|
+
const getCellAllocations = De$1.useCallback(
|
|
1696
1696
|
(resourceId, date) => {
|
|
1697
1697
|
const periodStart = date.getTime();
|
|
1698
1698
|
const periodEnd = periodStart + TIME_INCREMENTS[timeUnit];
|
|
@@ -2137,21 +2137,21 @@ const NiceInventoryManager = ({
|
|
|
2137
2137
|
var _a, _b;
|
|
2138
2138
|
const { t } = v();
|
|
2139
2139
|
const config = { ...DEFAULT_VIEW_CONFIG, ...externalConfig };
|
|
2140
|
-
const [filters, setFilters] = $
|
|
2141
|
-
const [view, setView] = $
|
|
2142
|
-
const [sortBy, setSortBy] = $
|
|
2143
|
-
const [sortOrder, setSortOrder] = $
|
|
2144
|
-
const [page, setPage] = $
|
|
2145
|
-
const [selectedItems, setSelectedItems] = $
|
|
2146
|
-
const [showItemModal, setShowItemModal] = $
|
|
2147
|
-
const [showTransactionModal, setShowTransactionModal] = $
|
|
2148
|
-
const [editingItem, setEditingItem] = $
|
|
2149
|
-
const [newTransaction, setNewTransaction] = $
|
|
2150
|
-
const [activeTab, setActiveTab] = $
|
|
2151
|
-
const categories = $
|
|
2140
|
+
const [filters, setFilters] = De$1.useState({});
|
|
2141
|
+
const [view, setView] = De$1.useState(config.view);
|
|
2142
|
+
const [sortBy, setSortBy] = De$1.useState(config.sortBy);
|
|
2143
|
+
const [sortOrder, setSortOrder] = De$1.useState(config.sortOrder);
|
|
2144
|
+
const [page, setPage] = De$1.useState(1);
|
|
2145
|
+
const [selectedItems, setSelectedItems] = De$1.useState(/* @__PURE__ */ new Set());
|
|
2146
|
+
const [showItemModal, setShowItemModal] = De$1.useState(false);
|
|
2147
|
+
const [showTransactionModal, setShowTransactionModal] = De$1.useState(false);
|
|
2148
|
+
const [editingItem, setEditingItem] = De$1.useState(null);
|
|
2149
|
+
const [newTransaction, setNewTransaction] = De$1.useState({});
|
|
2150
|
+
const [activeTab, setActiveTab] = De$1.useState("inventory");
|
|
2151
|
+
const categories = De$1.useMemo(() => {
|
|
2152
2152
|
return Array.from(new Set(items.map((item) => item.category))).sort();
|
|
2153
2153
|
}, [items]);
|
|
2154
|
-
const filteredItems = $
|
|
2154
|
+
const filteredItems = De$1.useMemo(() => {
|
|
2155
2155
|
var _a2, _b2;
|
|
2156
2156
|
let result = [...items];
|
|
2157
2157
|
if (filters.searchQuery) {
|
|
@@ -2196,18 +2196,18 @@ const NiceInventoryManager = ({
|
|
|
2196
2196
|
});
|
|
2197
2197
|
return result;
|
|
2198
2198
|
}, [items, filters, sortBy, sortOrder]);
|
|
2199
|
-
const paginatedItems = $
|
|
2199
|
+
const paginatedItems = De$1.useMemo(() => {
|
|
2200
2200
|
const start = (page - 1) * config.pageSize;
|
|
2201
2201
|
return filteredItems.slice(start, start + config.pageSize);
|
|
2202
2202
|
}, [filteredItems, page, config.pageSize]);
|
|
2203
2203
|
const totalPages = Math.ceil(filteredItems.length / config.pageSize);
|
|
2204
|
-
const reorderItems = $
|
|
2204
|
+
const reorderItems = De$1.useMemo(() => {
|
|
2205
2205
|
return items.filter((item) => item.quantity <= item.reorderLevel);
|
|
2206
2206
|
}, [items]);
|
|
2207
|
-
const recentTransactions = $
|
|
2207
|
+
const recentTransactions = De$1.useMemo(() => {
|
|
2208
2208
|
return [...transactions].sort((a2, b) => b.date.getTime() - a2.date.getTime()).slice(0, 50);
|
|
2209
2209
|
}, [transactions]);
|
|
2210
|
-
const kanbanGroups = $
|
|
2210
|
+
const kanbanGroups = De$1.useMemo(() => {
|
|
2211
2211
|
if (view !== "kanban") {
|
|
2212
2212
|
return null;
|
|
2213
2213
|
}
|
|
@@ -3051,7 +3051,7 @@ function fmtDate$1(d, locale) {
|
|
|
3051
3051
|
const dt = d instanceof Date ? d : new Date(d);
|
|
3052
3052
|
return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
|
|
3053
3053
|
}
|
|
3054
|
-
const NiceInvoiceView = /* @__PURE__ */ $
|
|
3054
|
+
const NiceInvoiceView = /* @__PURE__ */ De$1.forwardRef(
|
|
3055
3055
|
function NiceInvoiceView2({
|
|
3056
3056
|
invoice,
|
|
3057
3057
|
locale,
|
|
@@ -3089,7 +3089,7 @@ const NiceInvoiceView = /* @__PURE__ */ $e$1.forwardRef(
|
|
|
3089
3089
|
vatId: "VAT ID",
|
|
3090
3090
|
...labels
|
|
3091
3091
|
};
|
|
3092
|
-
const totals = $
|
|
3092
|
+
const totals = De$1.useMemo(() => {
|
|
3093
3093
|
let net = 0;
|
|
3094
3094
|
let vat = 0;
|
|
3095
3095
|
const byRate = /* @__PURE__ */ new Map();
|
|
@@ -3301,7 +3301,7 @@ function colorFor(occ, colors) {
|
|
|
3301
3301
|
}
|
|
3302
3302
|
return colors.high;
|
|
3303
3303
|
}
|
|
3304
|
-
const NiceWarehouseView = /* @__PURE__ */ $
|
|
3304
|
+
const NiceWarehouseView = /* @__PURE__ */ De$1.forwardRef(
|
|
3305
3305
|
function NiceWarehouseView2({
|
|
3306
3306
|
warehouseName,
|
|
3307
3307
|
cells = EMPTY_CELLS,
|
|
@@ -3319,8 +3319,8 @@ const NiceWarehouseView = /* @__PURE__ */ $e$1.forwardRef(
|
|
|
3319
3319
|
id
|
|
3320
3320
|
}, ref) {
|
|
3321
3321
|
const { t } = v();
|
|
3322
|
-
const [hovered, setHovered] = $
|
|
3323
|
-
const grid = $
|
|
3322
|
+
const [hovered, setHovered] = De$1.useState(null);
|
|
3323
|
+
const grid = De$1.useMemo(() => {
|
|
3324
3324
|
const rows = /* @__PURE__ */ new Map();
|
|
3325
3325
|
for (const c2 of cells) {
|
|
3326
3326
|
const rowKey = c2.row !== void 0 ? `r${c2.row}` : c2.location.rack ?? c2.location.aisle ?? "0";
|
|
@@ -3333,7 +3333,7 @@ const NiceWarehouseView = /* @__PURE__ */ $e$1.forwardRef(
|
|
|
3333
3333
|
}
|
|
3334
3334
|
return [...rows.entries()].map(([rowKey, arr]) => ({ rowKey, cells: arr }));
|
|
3335
3335
|
}, [cells]);
|
|
3336
|
-
const gridRef = $
|
|
3336
|
+
const gridRef = De$1.useRef(null);
|
|
3337
3337
|
Xa(gridRef);
|
|
3338
3338
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, id, className: `nice-warehouse-view ${className ?? ""}`, style, children: [
|
|
3339
3339
|
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "nice-warehouse-view__header", children: [
|
|
@@ -3367,7 +3367,7 @@ const NiceWarehouseView = /* @__PURE__ */ $e$1.forwardRef(
|
|
|
3367
3367
|
children: grid.map(({ rowKey, cells: row }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-warehouse-view__row", role: "row", children: row.map((c2, idx) => {
|
|
3368
3368
|
const key = [c2.location.rack, c2.location.aisle, c2.location.shelf, c2.location.bin].filter(Boolean).join("-") || String(idx);
|
|
3369
3369
|
const aisleBreak = aisleEvery > 0 && idx > 0 && idx % aisleEvery === 0;
|
|
3370
|
-
return /* @__PURE__ */ jsxRuntime.jsxs($
|
|
3370
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(De$1.Fragment, { children: [
|
|
3371
3371
|
aisleBreak && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-warehouse-view__aisle", "aria-hidden": true }),
|
|
3372
3372
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3373
3373
|
"button",
|
|
@@ -3441,7 +3441,7 @@ function fmtDate(d, locale) {
|
|
|
3441
3441
|
const dt = d instanceof Date ? d : new Date(d);
|
|
3442
3442
|
return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
|
|
3443
3443
|
}
|
|
3444
|
-
const NicePurchaseOrder = /* @__PURE__ */ $
|
|
3444
|
+
const NicePurchaseOrder = /* @__PURE__ */ De$1.forwardRef(function NicePurchaseOrder2({
|
|
3445
3445
|
orders = EMPTY_ORDERS,
|
|
3446
3446
|
selectable = true,
|
|
3447
3447
|
initialSelectedId,
|
|
@@ -3457,7 +3457,7 @@ const NicePurchaseOrder = /* @__PURE__ */ $e$1.forwardRef(function NicePurchaseO
|
|
|
3457
3457
|
}, ref) {
|
|
3458
3458
|
var _a;
|
|
3459
3459
|
const { t } = v();
|
|
3460
|
-
const [selectedId, setSelectedId] = $
|
|
3460
|
+
const [selectedId, setSelectedId] = De$1.useState(
|
|
3461
3461
|
initialSelectedId ?? ((_a = orders[0]) == null ? void 0 : _a.id)
|
|
3462
3462
|
);
|
|
3463
3463
|
const L = {
|
|
@@ -3478,7 +3478,7 @@ const NicePurchaseOrder = /* @__PURE__ */ $e$1.forwardRef(function NicePurchaseO
|
|
|
3478
3478
|
receive: "Receive all",
|
|
3479
3479
|
...labels
|
|
3480
3480
|
};
|
|
3481
|
-
const selected = $
|
|
3481
|
+
const selected = De$1.useMemo(
|
|
3482
3482
|
() => orders.find((o) => o.id === selectedId),
|
|
3483
3483
|
[orders, selectedId]
|
|
3484
3484
|
);
|
|
@@ -3588,7 +3588,7 @@ const NicePurchaseOrder = /* @__PURE__ */ $e$1.forwardRef(function NicePurchaseO
|
|
|
3588
3588
|
] });
|
|
3589
3589
|
});
|
|
3590
3590
|
const EMPTY_EMPLOYEES = [];
|
|
3591
|
-
const NiceHRDashboard = /* @__PURE__ */ $
|
|
3591
|
+
const NiceHRDashboard = /* @__PURE__ */ De$1.forwardRef(
|
|
3592
3592
|
function NiceHRDashboard2({
|
|
3593
3593
|
employees = EMPTY_EMPLOYEES,
|
|
3594
3594
|
labels,
|
|
@@ -3610,7 +3610,7 @@ const NiceHRDashboard = /* @__PURE__ */ $e$1.forwardRef(
|
|
|
3610
3610
|
activeEmployees: "Active",
|
|
3611
3611
|
...labels
|
|
3612
3612
|
};
|
|
3613
|
-
const stats = $
|
|
3613
|
+
const stats = De$1.useMemo(() => {
|
|
3614
3614
|
const active = employees.filter((e) => e.active !== false);
|
|
3615
3615
|
const fte = active.reduce((s, e) => s + (e.fte ?? 1), 0);
|
|
3616
3616
|
const vacationAvg = active.length === 0 ? 0 : active.reduce((s, e) => s + (e.vacationBalanceDays ?? 0), 0) / active.length;
|
|
@@ -3723,11 +3723,11 @@ const DEFAULT_SEED = {
|
|
|
3723
3723
|
};
|
|
3724
3724
|
function useMockErpApi(options = {}) {
|
|
3725
3725
|
const { latencyMs = 300, errorRate = 0, seed } = options;
|
|
3726
|
-
const [loading, setLoading] = $
|
|
3727
|
-
const [error, setError] = $
|
|
3728
|
-
const [data, setData] = $
|
|
3729
|
-
const settledRef = $
|
|
3730
|
-
const refresh = $
|
|
3726
|
+
const [loading, setLoading] = De$1.useState(true);
|
|
3727
|
+
const [error, setError] = De$1.useState(null);
|
|
3728
|
+
const [data, setData] = De$1.useState(() => ({ ...DEFAULT_SEED, ...seed }));
|
|
3729
|
+
const settledRef = De$1.useRef(false);
|
|
3730
|
+
const refresh = De$1.useCallback(async () => {
|
|
3731
3731
|
setLoading(true);
|
|
3732
3732
|
setError(null);
|
|
3733
3733
|
await wait(latencyMs);
|
|
@@ -3738,14 +3738,14 @@ function useMockErpApi(options = {}) {
|
|
|
3738
3738
|
}
|
|
3739
3739
|
setLoading(false);
|
|
3740
3740
|
}, [latencyMs, errorRate]);
|
|
3741
|
-
$
|
|
3741
|
+
De$1.useEffect(() => {
|
|
3742
3742
|
if (settledRef.current) {
|
|
3743
3743
|
return;
|
|
3744
3744
|
}
|
|
3745
3745
|
settledRef.current = true;
|
|
3746
3746
|
void refresh();
|
|
3747
3747
|
}, [refresh]);
|
|
3748
|
-
const writeWith = $
|
|
3748
|
+
const writeWith = De$1.useCallback(
|
|
3749
3749
|
async (key, item) => {
|
|
3750
3750
|
await wait(latencyMs);
|
|
3751
3751
|
if (Math.random() < errorRate) {
|
|
@@ -3764,7 +3764,7 @@ function useMockErpApi(options = {}) {
|
|
|
3764
3764
|
},
|
|
3765
3765
|
[latencyMs, errorRate]
|
|
3766
3766
|
);
|
|
3767
|
-
return $
|
|
3767
|
+
return De$1.useMemo(
|
|
3768
3768
|
() => ({
|
|
3769
3769
|
loading,
|
|
3770
3770
|
error,
|
|
@@ -3783,7 +3783,7 @@ function useMockErpApi(options = {}) {
|
|
|
3783
3783
|
[loading, error, data, refresh, writeWith]
|
|
3784
3784
|
);
|
|
3785
3785
|
}
|
|
3786
|
-
const NiceVatTable = /* @__PURE__ */ $
|
|
3786
|
+
const NiceVatTable = /* @__PURE__ */ De$1.forwardRef(
|
|
3787
3787
|
function NiceVatTable2({
|
|
3788
3788
|
country = "PL",
|
|
3789
3789
|
rates,
|
|
@@ -3798,7 +3798,7 @@ const NiceVatTable = /* @__PURE__ */ $e$1.forwardRef(
|
|
|
3798
3798
|
id
|
|
3799
3799
|
}, ref) {
|
|
3800
3800
|
const { t } = v();
|
|
3801
|
-
const [internal, setInternal] = $
|
|
3801
|
+
const [internal, setInternal] = De$1.useState(rates ?? NICE_VAT_PRESETS[country]);
|
|
3802
3802
|
const L = {
|
|
3803
3803
|
code: "Code",
|
|
3804
3804
|
rate: "Rate",
|
|
@@ -3808,7 +3808,7 @@ const NiceVatTable = /* @__PURE__ */ $e$1.forwardRef(
|
|
|
3808
3808
|
remove: "Remove",
|
|
3809
3809
|
...labels
|
|
3810
3810
|
};
|
|
3811
|
-
const update = $
|
|
3811
|
+
const update = De$1.useCallback(
|
|
3812
3812
|
(next) => {
|
|
3813
3813
|
setInternal(next);
|
|
3814
3814
|
onChange == null ? void 0 : onChange(next);
|
|
@@ -3950,7 +3950,7 @@ function defaultBuildXml(opts) {
|
|
|
3950
3950
|
lines.push("</JPK>");
|
|
3951
3951
|
return lines.join("\n");
|
|
3952
3952
|
}
|
|
3953
|
-
const NiceJpkExporter = /* @__PURE__ */ $
|
|
3953
|
+
const NiceJpkExporter = /* @__PURE__ */ De$1.forwardRef(
|
|
3954
3954
|
function NiceJpkExporter2({
|
|
3955
3955
|
invoices = EMPTY_INVOICES,
|
|
3956
3956
|
taxpayer,
|
|
@@ -3966,11 +3966,11 @@ const NiceJpkExporter = /* @__PURE__ */ $e$1.forwardRef(
|
|
|
3966
3966
|
}, ref) {
|
|
3967
3967
|
const { t } = v();
|
|
3968
3968
|
const today = /* @__PURE__ */ new Date();
|
|
3969
|
-
const [format, setFormat] = $
|
|
3970
|
-
const [from, setFrom] = $
|
|
3969
|
+
const [format, setFormat] = De$1.useState(defaultFormat);
|
|
3970
|
+
const [from, setFrom] = De$1.useState(
|
|
3971
3971
|
isoDate((defaultPeriod == null ? void 0 : defaultPeriod.from) ?? new Date(today.getFullYear(), today.getMonth(), 1))
|
|
3972
3972
|
);
|
|
3973
|
-
const [to, setTo] = $
|
|
3973
|
+
const [to, setTo] = De$1.useState(
|
|
3974
3974
|
isoDate((defaultPeriod == null ? void 0 : defaultPeriod.to) ?? new Date(today.getFullYear(), today.getMonth() + 1, 0))
|
|
3975
3975
|
);
|
|
3976
3976
|
const L = {
|
|
@@ -3980,7 +3980,7 @@ const NiceJpkExporter = /* @__PURE__ */ $e$1.forwardRef(
|
|
|
3980
3980
|
export: "Export",
|
|
3981
3981
|
...labels
|
|
3982
3982
|
};
|
|
3983
|
-
const exportNow = $
|
|
3983
|
+
const exportNow = De$1.useCallback(() => {
|
|
3984
3984
|
const opts = {
|
|
3985
3985
|
format,
|
|
3986
3986
|
period: { from: new Date(from), to: new Date(to) },
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import $
|
|
2
|
+
import De$1, { useContext, createContext, useRef, useState, useEffect, useLayoutEffect, useMemo, useCallback, forwardRef } from "react";
|
|
3
3
|
const a = (e, t) => t, c = /* @__PURE__ */ createContext(a), i = /* @__PURE__ */ createContext("en");
|
|
4
4
|
function v() {
|
|
5
5
|
const e = useContext(c), t = useContext(i);
|
|
@@ -3365,7 +3365,7 @@ const NiceWarehouseView = /* @__PURE__ */ forwardRef(
|
|
|
3365
3365
|
children: grid.map(({ rowKey, cells: row }) => /* @__PURE__ */ jsx("div", { className: "nice-warehouse-view__row", role: "row", children: row.map((c2, idx) => {
|
|
3366
3366
|
const key = [c2.location.rack, c2.location.aisle, c2.location.shelf, c2.location.bin].filter(Boolean).join("-") || String(idx);
|
|
3367
3367
|
const aisleBreak = aisleEvery > 0 && idx > 0 && idx % aisleEvery === 0;
|
|
3368
|
-
return /* @__PURE__ */ jsxs($
|
|
3368
|
+
return /* @__PURE__ */ jsxs(De$1.Fragment, { children: [
|
|
3369
3369
|
aisleBreak && /* @__PURE__ */ jsx("div", { className: "nice-warehouse-view__aisle", "aria-hidden": true }),
|
|
3370
3370
|
/* @__PURE__ */ jsx(
|
|
3371
3371
|
"button",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice2dev/ui-erp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Enterprise Resource Planning components for Nice2Dev",
|
|
5
5
|
"author": "Nice2Dev Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-dom": ">=17.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@nice2dev/ui-core": "^1.3.
|
|
53
|
+
"@nice2dev/ui-core": "^1.3.3",
|
|
54
54
|
"@testing-library/react": "^16.3.3",
|
|
55
55
|
"@types/react": "^19.2.18",
|
|
56
56
|
"@types/react-dom": "^19.2.7",
|