UNPKG

@lanaco/lnc-react-ui

Version:

React component library

256 lines (255 loc) 6.18 kB
import { jsxs as m, jsx as i } from "react/jsx-runtime"; import { forwardRef as $ } from "react"; import { P as e } from "./index-S5Cd7WrG.js"; import { n as k } from "./emotion-styled.browser.esm-CjCaF13H.js"; import P from "./KanbanActionsToolbar.js"; import { r as s, i as d } from "./utils-DtRLzzTZ.js"; import ee from "./Kanban.js"; import { K as oe } from "./KanbanCard-BDRSqfVD.js"; import ne from "./KanbanHeader.js"; import ae from "./KanbanFooter.js"; const te = k.div` & .kanban-view-footer-lnc { padding: 0 0.625rem; } & .kanban-view-toolbar-lnc { margin: 0 0.625rem; } `, C = $((u, b) => { const { __TYPE__: le = "KANBAN_VIEW", goToPreviousView: re, toolbarActions: w = [], kanbanProps: n = {}, actionsToolbarProps: f = {}, footerProps: a = {}, showCreate: A = !0, enableCreate: h = !0, loading: ie = !1, customCardActions: N = [], customColumnActions: E = [], editCardText: D = "Edit", enableEditCard: T = !0, showEditCard: z = !0, deleteCardText: g = "Delete", enableDeleteCard: y = !0, showDeleteCard: _ = !0, editColumnText: K = "Edit", enableEditColumn: x = !0, showEditColumn: v = !0, deleteColumnText: O = "Delete", enableDeleteColumn: V = !0, showDeleteColumn: j = !0, showAddNewCard: M = !1, showLoadMoreCards: B = !1, //---------------- onCreate: c = () => { }, onEditCard: L = () => { }, onDeleteCard: I = () => { }, onEditColumn: R = () => { }, onDeleteColumn: F = () => { }, onCardDetails: S = () => { }, onColumnDetails: W = () => { }, onAddNewCard: Y = () => { }, onLoadMoreCards: p = () => { }, //------------------ className: H = "", style: q = {}, size: l = "small", color: r = "primary", children: t, ...G } = u, o = { ...f, showCreate: A, enableCreate: h, onCreate: c, actions: w }, J = (Z) => { c(Z); }, Q = () => s( d("KANBAN_VIEW_ACTIONS_TOOLBAR", t), { ...o, size: o != null && o.size ? o.size : l, color: o != null && o.color ? o.color : r, className: "kanban-view-toolbar-lnc " + (o == null ? void 0 : o.className) }, t ) || /* @__PURE__ */ i( P, { ...o, className: "kanban-view-toolbar-lnc " + (o == null ? void 0 : o.className), size: o != null && o.size ? o.size : l, color: o != null && o.color ? o.color : r, onCreate: J } ), U = () => s( d("KANBAN", t), { ...n, size: n != null && n.size ? n.size : l, color: n != null && n.color ? n.color : r, className: n == null ? void 0 : n.className }, t ) || /* @__PURE__ */ m( ee, { size: n != null && n.size ? n.size : l, color: n != null && n.color ? n.color : r, ...n, children: [ /* @__PURE__ */ i( ne, { onDetails: W, actionsMenu: !0, actions: [ { name: K, enable: x, show: v, onAction: R, icon: "pen" }, { name: O, enable: V, show: j, onAction: F, icon: "trash" }, ...E ] } ), /* @__PURE__ */ i( oe, { onDetails: S, actionsMenu: !0, actions: [ { name: D, enable: T, show: z, onAction: L, icon: "pen" }, { name: g, enable: y, show: _, onAction: I, icon: "trash" }, ...N ] } ), t, /* @__PURE__ */ i( ae, { showAddNewCard: M, showLoadMoreCards: B, onAddNewCard: Y, onLoadMoreCards: p } ) ] } ), X = () => s( d("KANBAN_VIEW_FOOTER", t), { ...a, size: a != null && a.size ? a.size : l, color: a != null && a.color ? a.color : r, className: "kanban-view-footer-lnc " + (a == null ? void 0 : a.className) }, t ) || null; return /* @__PURE__ */ m(te, { ref: b, className: H, style: q, ...G, children: [ Q(), U(), X() ] }); }); C.propTypes = { __TYPE__: e.string, kanbanProps: e.object, actionsToolbarProps: e.object, footerProps: e.object, loading: e.bool, showCreate: e.bool, /** * Enable create */ enableCreate: e.bool, /** * Actions that will be shown in toolbar with existing actions * toolbarActions=[{name: `<string>`, show: `<bool>`, enable: `<bool>`, onAction: `<func>`, customAction: `<element>`}, ...] */ toolbarActions: e.array, customCardActions: e.array, customColumnActions: e.array, editCardText: e.string, enableEditCard: e.bool, showEditCard: e.bool, deleteCardText: e.string, enableDeleteCard: e.bool, showDeleteCard: e.bool, editColumnText: e.string, enableEditColumn: e.bool, showEditColumn: e.bool, deleteColumnText: e.string, enableDeleteColumn: e.bool, showDeleteColumn: e.bool, /** * Show Add New Card in all Columns */ showAddNewCard: e.bool, /** * Show Load More Cards in all Columns */ showLoadMoreCards: e.bool, //------------------------------------------------------------- onCreate: e.func, onEditCard: e.func, onDeleteCard: e.func, onEditColumn: e.func, onDeleteColumn: e.func, onCardDetails: e.func, onColumnDetails: e.func, onLoadMoreCards: e.func, onAddNewCard: e.func, //------------------------------------------------------------ className: e.string, style: e.object, size: e.oneOf(["small", "medium", "large"]), color: e.oneOf([ "primary", "secondary", "success", "danger", "warning", "information", "neutral", "gray" ]) }; C.displayName = "KanbanView"; export { C as default };