@webority/ui-react 0.35.1 → 0.36.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.
|
@@ -8,15 +8,15 @@ import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
|
8
8
|
import { KANBAN_SUMMARY_FORMATS as f, KANBAN_TEXT as p, KANBAN_TONES as m, kanbanOverflow as ee, kanbanSummaryFormat as h, kanbanVisibleLimit as g, sumKanbanValues as _ } from "@webority/ui-elements/elements/kanban";
|
|
9
9
|
//#region src/components/AppKanban.jsx
|
|
10
10
|
var v = (e) => e.key ?? e.id, y = (e) => e.column, b = ["rupees", "paise"];
|
|
11
|
-
function x({ columns: x = [], cards: S = [], renderCard: C, renderColumnActions: w, getCardKey: T = v, getCardColumn: E = y, getCardValue: D, cardLabel: O, isCardLocked: k, onLocked: A, onMove: j, accept: M, filter: N, boardId: P, ariaLabel:
|
|
11
|
+
function x({ columns: x = [], cards: S = [], renderCard: C, renderColumnActions: w, getCardKey: T = v, getCardColumn: E = y, getCardValue: D, cardLabel: O, isCardLocked: k, onLocked: A, onMove: j, accept: M, filter: N, boardId: P, ariaLabel: te = "Board", emptyText: ne = p.empty, readOnly: re = !1, swipeHint: ie = !1, fill: F = !1, summaryFormat: I, summaryUnit: L, className: R = "", id: z, ...B }) {
|
|
12
12
|
t("AppKanban", B), e("AppKanban", "summaryFormat", I, f), e("AppKanban", "summaryUnit", L, b);
|
|
13
13
|
for (let t of x) e("AppKanban", "columns[].tone", t.tone, m);
|
|
14
|
-
let V = o(), H = z || `kanban-${V.replace(/[^a-zA-Z0-9_-]/g, "")}`, U = c(null), [W, G] = l(() => /* @__PURE__ */ new Map()), [K, q] = l(() => /* @__PURE__ */ new Set()), [J, Y] = l(() => /* @__PURE__ */ new Set()),
|
|
14
|
+
let V = o(), H = z || `kanban-${V.replace(/[^a-zA-Z0-9_-]/g, "")}`, U = c(null), [W, G] = l(() => /* @__PURE__ */ new Map()), [K, q] = l(() => /* @__PURE__ */ new Set()), [J, Y] = l(() => /* @__PURE__ */ new Set()), ae = s(() => new Map(S.map((e) => [String(T(e)), e])), [S, T]), X = c(null);
|
|
15
15
|
X.current = {
|
|
16
16
|
accept: M,
|
|
17
17
|
onMove: j,
|
|
18
18
|
onLocked: A,
|
|
19
|
-
byKey:
|
|
19
|
+
byKey: ae,
|
|
20
20
|
columns: x
|
|
21
21
|
};
|
|
22
22
|
let Z = I && f.includes(I) && (L == null || b.includes(L)) ? h(I, L) : null, Q = s(() => {
|
|
@@ -85,7 +85,7 @@ function x({ columns: x = [], cards: S = [], renderCard: C, renderColumnActions:
|
|
|
85
85
|
e.removeEventListener("wui:kanban:move", t), e.removeEventListener("wui:kanban:locked", n), e.accept = void 0;
|
|
86
86
|
};
|
|
87
87
|
}, []);
|
|
88
|
-
let $ = (e) => !N || N(e) !== !1,
|
|
88
|
+
let $ = (e) => !N || N(e) !== !1, oe = (e, t) => {
|
|
89
89
|
K.has(e) && Y((e) => {
|
|
90
90
|
let n = new Set(e);
|
|
91
91
|
for (let e of t) n.delete(String(T(e)));
|
|
@@ -100,11 +100,12 @@ function x({ columns: x = [], cards: S = [], renderCard: C, renderColumnActions:
|
|
|
100
100
|
id: H,
|
|
101
101
|
class: R ? `wui-kanban ${R}` : "wui-kanban",
|
|
102
102
|
role: "region",
|
|
103
|
-
"aria-label":
|
|
103
|
+
"aria-label": te,
|
|
104
104
|
"board-id": P || void 0,
|
|
105
105
|
"summary-format": Z ? I : void 0,
|
|
106
106
|
"summary-unit": Z && L ? L : void 0,
|
|
107
|
-
readonly:
|
|
107
|
+
readonly: re ? "" : void 0,
|
|
108
|
+
fill: F ? "" : void 0,
|
|
108
109
|
controlled: "",
|
|
109
110
|
...B,
|
|
110
111
|
children: [
|
|
@@ -127,7 +128,7 @@ function x({ columns: x = [], cards: S = [], renderCard: C, renderColumnActions:
|
|
|
127
128
|
})]
|
|
128
129
|
}, e.key))
|
|
129
130
|
}),
|
|
130
|
-
|
|
131
|
+
ie && /* @__PURE__ */ d("p", {
|
|
131
132
|
className: "wui-kanban-hint",
|
|
132
133
|
"aria-hidden": "true",
|
|
133
134
|
children: [/* @__PURE__ */ u(n, {
|
|
@@ -237,14 +238,14 @@ function x({ columns: x = [], cards: S = [], renderCard: C, renderColumnActions:
|
|
|
237
238
|
"aria-controls": `${t}-body`,
|
|
238
239
|
"aria-expanded": c ? "true" : "false",
|
|
239
240
|
hidden: c ? a.length <= s : l.size === 0,
|
|
240
|
-
onClick: () =>
|
|
241
|
+
onClick: () => oe(e.key, r),
|
|
241
242
|
children: c ? p.fewer : p.more(l.size)
|
|
242
243
|
}),
|
|
243
244
|
/* @__PURE__ */ u("p", {
|
|
244
245
|
className: "wui-kanban-empty",
|
|
245
246
|
"data-wui-empty": "",
|
|
246
247
|
hidden: a.length > 0,
|
|
247
|
-
children: e.emptyText ??
|
|
248
|
+
children: e.emptyText ?? ne
|
|
248
249
|
})
|
|
249
250
|
]
|
|
250
251
|
}, e.key);
|
|
@@ -49,13 +49,18 @@
|
|
|
49
49
|
* @param {string} [props.emptyText='Nothing here'] Text of an empty column.
|
|
50
50
|
* @param {boolean} [props.readOnly=false] No card can move.
|
|
51
51
|
* @param {boolean} [props.swipeHint=false] On phones, a "Swipe sideways or tap a column" line under the switcher.
|
|
52
|
+
* @param {boolean} [props.fill=false] From md up, the board fits the screen: it is the viewport's height
|
|
53
|
+
* less `--wui-kanban-fill-offset` (240px by default; set it on the board for the page around it), and
|
|
54
|
+
* each column's cards scroll inside the column under its fixed head, so a long column never scrolls
|
|
55
|
+
* the page. While a card is carried, a column's list scrolls when the pointer nears its top or
|
|
56
|
+
* bottom. Phones keep the one-column layout, scrolling the page.
|
|
52
57
|
* @param {'number'|'currency'|'compact'} [props.summaryFormat] Each column's summary becomes the sum
|
|
53
58
|
* of its visible cards' `getCardValue`, in this format.
|
|
54
59
|
* @param {'rupees'|'paise'} [props.summaryUnit='rupees'] The unit of the card values.
|
|
55
60
|
* @param {string} [props.className]
|
|
56
61
|
* @param {string} [props.id] The board's id; the column, body and help ids derive from it. Generated when omitted.
|
|
57
62
|
*/
|
|
58
|
-
export default function AppKanban({ columns, cards, renderCard, renderColumnActions, getCardKey, getCardColumn, getCardValue, cardLabel, isCardLocked, onLocked, onMove, accept, filter, boardId, ariaLabel, emptyText, readOnly, swipeHint, summaryFormat, summaryUnit, className, id, ...rest }: {
|
|
63
|
+
export default function AppKanban({ columns, cards, renderCard, renderColumnActions, getCardKey, getCardColumn, getCardValue, cardLabel, isCardLocked, onLocked, onMove, accept, filter, boardId, ariaLabel, emptyText, readOnly, swipeHint, fill, summaryFormat, summaryUnit, className, id, ...rest }: {
|
|
59
64
|
columns: {
|
|
60
65
|
key: string;
|
|
61
66
|
title: string;
|
|
@@ -95,6 +100,7 @@ export default function AppKanban({ columns, cards, renderCard, renderColumnActi
|
|
|
95
100
|
emptyText?: string;
|
|
96
101
|
readOnly?: boolean;
|
|
97
102
|
swipeHint?: boolean;
|
|
103
|
+
fill?: boolean;
|
|
98
104
|
summaryFormat?: 'number' | 'currency' | 'compact';
|
|
99
105
|
summaryUnit?: 'rupees' | 'paise';
|
|
100
106
|
className?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@webority/
|
|
33
|
-
"@webority/
|
|
32
|
+
"@webority/ui-elements": "0.36.0",
|
|
33
|
+
"@webority/theme": "0.36.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@webority/analytics": "^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0",
|
|
36
|
+
"@webority/analytics": "^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0",
|
|
37
37
|
"bootstrap": "5.3.3",
|
|
38
38
|
"react": "^19.0.0",
|
|
39
39
|
"react-bootstrap": "^2.10.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@types/react": "^19.2.17",
|
|
48
48
|
"@vitejs/plugin-react": "^6.0.1",
|
|
49
49
|
"@vitest/coverage-v8": "5.0.1",
|
|
50
|
-
"@webority/analytics": "0.
|
|
50
|
+
"@webority/analytics": "0.11.0",
|
|
51
51
|
"bootstrap": "5.3.3",
|
|
52
52
|
"jsdom": "30.1.1",
|
|
53
53
|
"react": "^19.2.6",
|