@lanaco/lnc-react-ui
Version:
React component library
189 lines (188 loc) • 4.47 kB
JavaScript
import { jsxs as m, jsx as i } from "react/jsx-runtime";
import { forwardRef as Z } from "react";
import { s as $ } from "./emotion-styled.browser.esm-DfbrHHed.js";
import k from "./KanbanActionsToolbar.js";
import { r, j as s } from "./utils-BUdHa0nB.js";
import p from "./Kanban.js";
import { K as P } from "./KanbanCard-ffmclwO4.js";
import ee from "./KanbanHeader.js";
import ne from "./KanbanFooter.js";
const oe = $.div`
& .kanban-view-footer-lnc {
padding: 0 0.625rem;
}
& .kanban-view-toolbar-lnc {
margin: 0 0.625rem;
}
`, ae = Z((d, u) => {
const {
toolbarActions: C = [],
kanbanProps: n = {},
actionsToolbarProps: w = {},
footerProps: o = {},
showCreate: N = !0,
enableCreate: A = !0,
customCardActions: h = [],
customColumnActions: z = [],
editCardText: D = "Edit",
enableEditCard: E = !0,
showEditCard: K = !0,
deleteCardText: f = "Delete",
enableDeleteCard: T = !0,
showDeleteCard: b = !0,
editColumnText: x = "Edit",
enableEditColumn: v = !0,
showEditColumn: y = !0,
deleteColumnText: O = "Delete",
enableDeleteColumn: V = !0,
showDeleteColumn: _ = !0,
showAddNewCard: B = !1,
showLoadMoreCards: M = !1,
//----------------
onCreate: c = () => {
},
onEditCard: R = () => {
},
onDeleteCard: g = () => {
},
onEditColumn: j = () => {
},
onDeleteColumn: F = () => {
},
onCardDetails: I = () => {
},
onColumnDetails: L = () => {
},
onAddNewCard: S = () => {
},
onLoadMoreCards: W = () => {
},
//------------------
className: H = "",
style: q = {},
size: t = "small",
color: l = "primary",
children: a,
...G
} = d, e = {
...w,
showCreate: N,
enableCreate: A,
onCreate: c,
actions: C
}, J = (Y) => {
c(Y);
}, Q = () => r(
s("KANBAN_VIEW_ACTIONS_TOOLBAR", a),
{
...e,
size: e != null && e.size ? e.size : t,
color: e != null && e.color ? e.color : l,
className: "kanban-view-toolbar-lnc " + (e == null ? void 0 : e.className)
},
a
) || /* @__PURE__ */ i(
k,
{
...e,
className: "kanban-view-toolbar-lnc " + (e == null ? void 0 : e.className),
size: e != null && e.size ? e.size : t,
color: e != null && e.color ? e.color : l,
onCreate: J
}
), U = () => r(
s("KANBAN", a),
{
...n,
size: n != null && n.size ? n.size : t,
color: n != null && n.color ? n.color : l,
className: n == null ? void 0 : n.className
},
a
) || /* @__PURE__ */ m(
p,
{
size: n != null && n.size ? n.size : t,
color: n != null && n.color ? n.color : l,
...n,
children: [
/* @__PURE__ */ i(
ee,
{
onDetails: L,
actionsMenu: !0,
actions: [
{
name: x,
enable: v,
show: y,
onAction: j,
icon: "pen"
},
{
name: O,
enable: V,
show: _,
onAction: F,
icon: "trash"
},
...z
]
}
),
/* @__PURE__ */ i(
P,
{
onDetails: I,
actionsMenu: !0,
actions: [
{
name: D,
enable: E,
show: K,
onAction: R,
icon: "pen"
},
{
name: f,
enable: T,
show: b,
onAction: g,
icon: "trash"
},
...h
]
}
),
a,
/* @__PURE__ */ i(
ne,
{
showAddNewCard: B,
showLoadMoreCards: M,
onAddNewCard: S,
onLoadMoreCards: W
}
)
]
}
), X = () => r(
s("KANBAN_VIEW_FOOTER", a),
{
...o,
size: o != null && o.size ? o.size : t,
color: o != null && o.color ? o.color : l,
className: "kanban-view-footer-lnc " + (o == null ? void 0 : o.className)
},
a
) || null;
return /* @__PURE__ */ m(oe, { ref: u, className: H, style: q, ...G, children: [
Q(),
U(),
X()
] });
});
ae.displayName = "KanbanView";
export {
ae as default
};