@nice2dev/ui-erp 1.3.18 → 1.4.0
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 je$1 = require("react");
|
|
5
|
+
const a = (e, t) => t, c = /* @__PURE__ */ je$1.createContext(a), i = /* @__PURE__ */ je$1.createContext("en");
|
|
6
6
|
function v() {
|
|
7
|
-
const e =
|
|
7
|
+
const e = je$1.useContext(c), t = je$1.useContext(i);
|
|
8
8
|
return { t: e, lang: t };
|
|
9
9
|
}
|
|
10
10
|
const Mt = /* @__PURE__ */ new Set([
|
|
@@ -423,7 +423,7 @@ const kt = {
|
|
|
423
423
|
md: 20,
|
|
424
424
|
lg: 24,
|
|
425
425
|
xl: 32
|
|
426
|
-
}, Ie = /* @__PURE__ */
|
|
426
|
+
}, Ie = /* @__PURE__ */ je$1.createContext({});
|
|
427
427
|
function Jt({
|
|
428
428
|
path: n,
|
|
429
429
|
size: e,
|
|
@@ -469,7 +469,7 @@ const ee = ({
|
|
|
469
469
|
title: s,
|
|
470
470
|
onClick: o
|
|
471
471
|
}) => {
|
|
472
|
-
const { resolver: i2 } =
|
|
472
|
+
const { resolver: i2 } = je$1.useContext(Ie), c2 = typeof e == "number" ? e : Xt[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)) || te(a2) && t.push(a2);
|
|
575
575
|
return t;
|
|
576
576
|
}
|
|
577
|
-
const _e = typeof window > "u" ?
|
|
577
|
+
const _e = typeof window > "u" ? je$1.useEffect : je$1.useLayoutEffect;
|
|
578
578
|
function B(n, e, t) {
|
|
579
|
-
const a2 =
|
|
579
|
+
const a2 = je$1.useRef({ el: null, deps: [] }), r = je$1.useRef(e);
|
|
580
580
|
r.current = e, _e(() => {
|
|
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 Kn(n = window, e = true) {
|
|
|
1470
1470
|
return t || (t = new Bn(n), st.set(n, t)), e && t.start(), t;
|
|
1471
1471
|
}
|
|
1472
1472
|
function K() {
|
|
1473
|
-
const [n] =
|
|
1473
|
+
const [n] = je$1.useState(
|
|
1474
1474
|
() => typeof window > "u" ? null : Kn(window, false)
|
|
1475
1475
|
);
|
|
1476
|
-
return
|
|
1476
|
+
return je$1.useEffect(() => {
|
|
1477
1477
|
n == null || n.start();
|
|
1478
1478
|
}, [n]), n;
|
|
1479
1479
|
}
|
|
1480
1480
|
const ua = '[role="row"],tr', da = '[role="gridcell"],[role="columnheader"],[role="rowheader"],td,th', ha = 'button:not([disabled]),a[href],input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled])', fa = 'textarea,select,input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"])';
|
|
1481
1481
|
function Wa(n, e = {}) {
|
|
1482
|
-
const { rowSelector: t = ua, cellSelector: a2 = da, pageSize: r = 10, enabled: s = true } = e, o =
|
|
1482
|
+
const { rowSelector: t = ua, cellSelector: a2 = da, pageSize: r = 10, enabled: s = true } = e, o = je$1.useRef(e);
|
|
1483
1483
|
o.current = e;
|
|
1484
1484
|
const i2 = K();
|
|
1485
1485
|
B(
|
|
@@ -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] = je$1.useState(null);
|
|
1619
|
+
const [hoveredCell, setHoveredCell] = je$1.useState(null);
|
|
1620
|
+
const [timeUnit, setTimeUnit] = je$1.useState(config.timeUnit);
|
|
1621
|
+
const [expandedResources, setExpandedResources] = je$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] = je$1.useState(false);
|
|
1625
|
+
const [newAllocation, setNewAllocation] = je$1.useState({});
|
|
1626
|
+
const timePeriods = je$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 = je$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 = je$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 = je$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] = je$1.useState({});
|
|
2141
|
+
const [view, setView] = je$1.useState(config.view);
|
|
2142
|
+
const [sortBy, setSortBy] = je$1.useState(config.sortBy);
|
|
2143
|
+
const [sortOrder, setSortOrder] = je$1.useState(config.sortOrder);
|
|
2144
|
+
const [page, setPage] = je$1.useState(1);
|
|
2145
|
+
const [selectedItems, setSelectedItems] = je$1.useState(/* @__PURE__ */ new Set());
|
|
2146
|
+
const [showItemModal, setShowItemModal] = je$1.useState(false);
|
|
2147
|
+
const [showTransactionModal, setShowTransactionModal] = je$1.useState(false);
|
|
2148
|
+
const [editingItem, setEditingItem] = je$1.useState(null);
|
|
2149
|
+
const [newTransaction, setNewTransaction] = je$1.useState({});
|
|
2150
|
+
const [activeTab, setActiveTab] = je$1.useState("inventory");
|
|
2151
|
+
const categories = je$1.useMemo(() => {
|
|
2152
2152
|
return Array.from(new Set(items.map((item) => item.category))).sort();
|
|
2153
2153
|
}, [items]);
|
|
2154
|
-
const filteredItems =
|
|
2154
|
+
const filteredItems = je$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 = je$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 = je$1.useMemo(() => {
|
|
2205
2205
|
return items.filter((item) => item.quantity <= item.reorderLevel);
|
|
2206
2206
|
}, [items]);
|
|
2207
|
-
const recentTransactions =
|
|
2207
|
+
const recentTransactions = je$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 = je$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__ */ je$1.forwardRef(
|
|
3055
3055
|
function NiceInvoiceView2({
|
|
3056
3056
|
invoice,
|
|
3057
3057
|
locale,
|
|
@@ -3091,7 +3091,7 @@ const NiceInvoiceView = /* @__PURE__ */ De$1.forwardRef(
|
|
|
3091
3091
|
vatId: "VAT ID",
|
|
3092
3092
|
...labels
|
|
3093
3093
|
};
|
|
3094
|
-
const totals =
|
|
3094
|
+
const totals = je$1.useMemo(() => {
|
|
3095
3095
|
let net = 0;
|
|
3096
3096
|
let vat = 0;
|
|
3097
3097
|
const byRate = /* @__PURE__ */ new Map();
|
|
@@ -3304,7 +3304,7 @@ function colorFor(occ, colors) {
|
|
|
3304
3304
|
}
|
|
3305
3305
|
return colors.high;
|
|
3306
3306
|
}
|
|
3307
|
-
const NiceWarehouseView = /* @__PURE__ */
|
|
3307
|
+
const NiceWarehouseView = /* @__PURE__ */ je$1.forwardRef(
|
|
3308
3308
|
function NiceWarehouseView2({
|
|
3309
3309
|
warehouseName,
|
|
3310
3310
|
cells = EMPTY_CELLS,
|
|
@@ -3324,8 +3324,8 @@ const NiceWarehouseView = /* @__PURE__ */ De$1.forwardRef(
|
|
|
3324
3324
|
"data-testid": dataTestId
|
|
3325
3325
|
}, ref) {
|
|
3326
3326
|
const { t } = v();
|
|
3327
|
-
const [hovered, setHovered] =
|
|
3328
|
-
const grid =
|
|
3327
|
+
const [hovered, setHovered] = je$1.useState(null);
|
|
3328
|
+
const grid = je$1.useMemo(() => {
|
|
3329
3329
|
const rows = /* @__PURE__ */ new Map();
|
|
3330
3330
|
for (const c2 of cells) {
|
|
3331
3331
|
const rowKey = c2.row !== void 0 ? `r${c2.row}` : c2.location.rack ?? c2.location.aisle ?? "0";
|
|
@@ -3338,7 +3338,7 @@ const NiceWarehouseView = /* @__PURE__ */ De$1.forwardRef(
|
|
|
3338
3338
|
}
|
|
3339
3339
|
return [...rows.entries()].map(([rowKey, arr]) => ({ rowKey, cells: arr }));
|
|
3340
3340
|
}, [cells]);
|
|
3341
|
-
const gridRef =
|
|
3341
|
+
const gridRef = je$1.useRef(null);
|
|
3342
3342
|
Wa(gridRef);
|
|
3343
3343
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3344
3344
|
"div",
|
|
@@ -3380,7 +3380,7 @@ const NiceWarehouseView = /* @__PURE__ */ De$1.forwardRef(
|
|
|
3380
3380
|
children: grid.map(({ rowKey, cells: row }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-warehouse-view__row", role: "row", children: row.map((c2, idx) => {
|
|
3381
3381
|
const key = [c2.location.rack, c2.location.aisle, c2.location.shelf, c2.location.bin].filter(Boolean).join("-") || String(idx);
|
|
3382
3382
|
const aisleBreak = aisleEvery > 0 && idx > 0 && idx % aisleEvery === 0;
|
|
3383
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3383
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(je$1.Fragment, { children: [
|
|
3384
3384
|
aisleBreak && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-warehouse-view__aisle", "aria-hidden": true }),
|
|
3385
3385
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3386
3386
|
"button",
|
|
@@ -3456,7 +3456,7 @@ function fmtDate(d, locale) {
|
|
|
3456
3456
|
const dt = d instanceof Date ? d : new Date(d);
|
|
3457
3457
|
return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
|
|
3458
3458
|
}
|
|
3459
|
-
const NicePurchaseOrder = /* @__PURE__ */
|
|
3459
|
+
const NicePurchaseOrder = /* @__PURE__ */ je$1.forwardRef(function NicePurchaseOrder2({
|
|
3460
3460
|
orders = EMPTY_ORDERS,
|
|
3461
3461
|
selectable = true,
|
|
3462
3462
|
initialSelectedId,
|
|
@@ -3472,7 +3472,7 @@ const NicePurchaseOrder = /* @__PURE__ */ De$1.forwardRef(function NicePurchaseO
|
|
|
3472
3472
|
}, ref) {
|
|
3473
3473
|
var _a;
|
|
3474
3474
|
const { t } = v();
|
|
3475
|
-
const [selectedId, setSelectedId] =
|
|
3475
|
+
const [selectedId, setSelectedId] = je$1.useState(
|
|
3476
3476
|
initialSelectedId ?? ((_a = orders[0]) == null ? void 0 : _a.id)
|
|
3477
3477
|
);
|
|
3478
3478
|
const L = {
|
|
@@ -3493,7 +3493,7 @@ const NicePurchaseOrder = /* @__PURE__ */ De$1.forwardRef(function NicePurchaseO
|
|
|
3493
3493
|
receive: "Receive all",
|
|
3494
3494
|
...labels
|
|
3495
3495
|
};
|
|
3496
|
-
const selected =
|
|
3496
|
+
const selected = je$1.useMemo(
|
|
3497
3497
|
() => orders.find((o) => o.id === selectedId),
|
|
3498
3498
|
[orders, selectedId]
|
|
3499
3499
|
);
|
|
@@ -3603,7 +3603,7 @@ const NicePurchaseOrder = /* @__PURE__ */ De$1.forwardRef(function NicePurchaseO
|
|
|
3603
3603
|
] });
|
|
3604
3604
|
});
|
|
3605
3605
|
const EMPTY_EMPLOYEES = [];
|
|
3606
|
-
const NiceHRDashboard = /* @__PURE__ */
|
|
3606
|
+
const NiceHRDashboard = /* @__PURE__ */ je$1.forwardRef(
|
|
3607
3607
|
function NiceHRDashboard2({
|
|
3608
3608
|
employees = EMPTY_EMPLOYEES,
|
|
3609
3609
|
labels,
|
|
@@ -3627,7 +3627,7 @@ const NiceHRDashboard = /* @__PURE__ */ De$1.forwardRef(
|
|
|
3627
3627
|
activeEmployees: "Active",
|
|
3628
3628
|
...labels
|
|
3629
3629
|
};
|
|
3630
|
-
const stats =
|
|
3630
|
+
const stats = je$1.useMemo(() => {
|
|
3631
3631
|
const active = employees.filter((e) => e.active !== false);
|
|
3632
3632
|
const fte = active.reduce((s, e) => s + (e.fte ?? 1), 0);
|
|
3633
3633
|
const vacationAvg = active.length === 0 ? 0 : active.reduce((s, e) => s + (e.vacationBalanceDays ?? 0), 0) / active.length;
|
|
@@ -3741,11 +3741,11 @@ const DEFAULT_SEED = {
|
|
|
3741
3741
|
};
|
|
3742
3742
|
function useMockErpApi(options = {}) {
|
|
3743
3743
|
const { latencyMs = 300, errorRate = 0, seed } = options;
|
|
3744
|
-
const [loading, setLoading] =
|
|
3745
|
-
const [error, setError] =
|
|
3746
|
-
const [data, setData] =
|
|
3747
|
-
const settledRef =
|
|
3748
|
-
const refresh =
|
|
3744
|
+
const [loading, setLoading] = je$1.useState(true);
|
|
3745
|
+
const [error, setError] = je$1.useState(null);
|
|
3746
|
+
const [data, setData] = je$1.useState(() => ({ ...DEFAULT_SEED, ...seed }));
|
|
3747
|
+
const settledRef = je$1.useRef(false);
|
|
3748
|
+
const refresh = je$1.useCallback(async () => {
|
|
3749
3749
|
setLoading(true);
|
|
3750
3750
|
setError(null);
|
|
3751
3751
|
await wait(latencyMs);
|
|
@@ -3756,14 +3756,14 @@ function useMockErpApi(options = {}) {
|
|
|
3756
3756
|
}
|
|
3757
3757
|
setLoading(false);
|
|
3758
3758
|
}, [latencyMs, errorRate]);
|
|
3759
|
-
|
|
3759
|
+
je$1.useEffect(() => {
|
|
3760
3760
|
if (settledRef.current) {
|
|
3761
3761
|
return;
|
|
3762
3762
|
}
|
|
3763
3763
|
settledRef.current = true;
|
|
3764
3764
|
void refresh();
|
|
3765
3765
|
}, [refresh]);
|
|
3766
|
-
const writeWith =
|
|
3766
|
+
const writeWith = je$1.useCallback(
|
|
3767
3767
|
async (key, item) => {
|
|
3768
3768
|
await wait(latencyMs);
|
|
3769
3769
|
if (Math.random() < errorRate) {
|
|
@@ -3782,7 +3782,7 @@ function useMockErpApi(options = {}) {
|
|
|
3782
3782
|
},
|
|
3783
3783
|
[latencyMs, errorRate]
|
|
3784
3784
|
);
|
|
3785
|
-
return
|
|
3785
|
+
return je$1.useMemo(
|
|
3786
3786
|
() => ({
|
|
3787
3787
|
loading,
|
|
3788
3788
|
error,
|
|
@@ -3801,7 +3801,7 @@ function useMockErpApi(options = {}) {
|
|
|
3801
3801
|
[loading, error, data, refresh, writeWith]
|
|
3802
3802
|
);
|
|
3803
3803
|
}
|
|
3804
|
-
const NiceVatTable = /* @__PURE__ */
|
|
3804
|
+
const NiceVatTable = /* @__PURE__ */ je$1.forwardRef(
|
|
3805
3805
|
function NiceVatTable2({
|
|
3806
3806
|
country = "PL",
|
|
3807
3807
|
rates,
|
|
@@ -3818,7 +3818,7 @@ const NiceVatTable = /* @__PURE__ */ De$1.forwardRef(
|
|
|
3818
3818
|
"data-testid": dataTestId
|
|
3819
3819
|
}, ref) {
|
|
3820
3820
|
const { t } = v();
|
|
3821
|
-
const [internal, setInternal] =
|
|
3821
|
+
const [internal, setInternal] = je$1.useState(rates ?? NICE_VAT_PRESETS[country]);
|
|
3822
3822
|
const L = {
|
|
3823
3823
|
code: "Code",
|
|
3824
3824
|
rate: "Rate",
|
|
@@ -3828,7 +3828,7 @@ const NiceVatTable = /* @__PURE__ */ De$1.forwardRef(
|
|
|
3828
3828
|
remove: "Remove",
|
|
3829
3829
|
...labels
|
|
3830
3830
|
};
|
|
3831
|
-
const update =
|
|
3831
|
+
const update = je$1.useCallback(
|
|
3832
3832
|
(next) => {
|
|
3833
3833
|
setInternal(next);
|
|
3834
3834
|
onChange == null ? void 0 : onChange(next);
|
|
@@ -3971,7 +3971,7 @@ function defaultBuildXml(opts) {
|
|
|
3971
3971
|
lines.push("</JPK>");
|
|
3972
3972
|
return lines.join("\n");
|
|
3973
3973
|
}
|
|
3974
|
-
const NiceJpkExporter = /* @__PURE__ */
|
|
3974
|
+
const NiceJpkExporter = /* @__PURE__ */ je$1.forwardRef(
|
|
3975
3975
|
function NiceJpkExporter2({
|
|
3976
3976
|
invoices = EMPTY_INVOICES,
|
|
3977
3977
|
taxpayer,
|
|
@@ -3989,11 +3989,11 @@ const NiceJpkExporter = /* @__PURE__ */ De$1.forwardRef(
|
|
|
3989
3989
|
}, ref) {
|
|
3990
3990
|
const { t } = v();
|
|
3991
3991
|
const today = /* @__PURE__ */ new Date();
|
|
3992
|
-
const [format, setFormat] =
|
|
3993
|
-
const [from, setFrom] =
|
|
3992
|
+
const [format, setFormat] = je$1.useState(defaultFormat);
|
|
3993
|
+
const [from, setFrom] = je$1.useState(
|
|
3994
3994
|
isoDate((defaultPeriod == null ? void 0 : defaultPeriod.from) ?? new Date(today.getFullYear(), today.getMonth(), 1))
|
|
3995
3995
|
);
|
|
3996
|
-
const [to, setTo] =
|
|
3996
|
+
const [to, setTo] = je$1.useState(
|
|
3997
3997
|
isoDate((defaultPeriod == null ? void 0 : defaultPeriod.to) ?? new Date(today.getFullYear(), today.getMonth() + 1, 0))
|
|
3998
3998
|
);
|
|
3999
3999
|
const L = {
|
|
@@ -4003,7 +4003,7 @@ const NiceJpkExporter = /* @__PURE__ */ De$1.forwardRef(
|
|
|
4003
4003
|
export: "Export",
|
|
4004
4004
|
...labels
|
|
4005
4005
|
};
|
|
4006
|
-
const exportNow =
|
|
4006
|
+
const exportNow = je$1.useCallback(() => {
|
|
4007
4007
|
const opts = {
|
|
4008
4008
|
format,
|
|
4009
4009
|
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 je$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);
|
|
@@ -3378,7 +3378,7 @@ const NiceWarehouseView = /* @__PURE__ */ forwardRef(
|
|
|
3378
3378
|
children: grid.map(({ rowKey, cells: row }) => /* @__PURE__ */ jsx("div", { className: "nice-warehouse-view__row", role: "row", children: row.map((c2, idx) => {
|
|
3379
3379
|
const key = [c2.location.rack, c2.location.aisle, c2.location.shelf, c2.location.bin].filter(Boolean).join("-") || String(idx);
|
|
3380
3380
|
const aisleBreak = aisleEvery > 0 && idx > 0 && idx % aisleEvery === 0;
|
|
3381
|
-
return /* @__PURE__ */ jsxs(
|
|
3381
|
+
return /* @__PURE__ */ jsxs(je$1.Fragment, { children: [
|
|
3382
3382
|
aisleBreak && /* @__PURE__ */ jsx("div", { className: "nice-warehouse-view__aisle", "aria-hidden": true }),
|
|
3383
3383
|
/* @__PURE__ */ jsx(
|
|
3384
3384
|
"button",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice2dev/ui-erp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
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.
|
|
53
|
+
"@nice2dev/ui-core": "^1.4.0",
|
|
54
54
|
"@testing-library/react": "^16.3.3",
|
|
55
55
|
"@types/react": "^19.2.18",
|
|
56
56
|
"@types/react-dom": "^19.2.7",
|