From 34b6de2ed8e495c71185753cadb7fdf8f4d2fa6e Mon Sep 17 00:00:00 2001 From: sunhao Date: Tue, 2 Jan 2024 17:31:24 +0800 Subject: [PATCH] * kanban: support to set col title alignment. --- lib/kanban/dev.ts | 1 + lib/kanban/src/component/kanban-header-col.tsx | 3 ++- lib/kanban/src/style/kanban.css | 6 ++++++ lib/kanban/src/types/kanban-col-options.ts | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/kanban/dev.ts b/lib/kanban/dev.ts index 13ca1bd3dd..e136176c6f 100644 --- a/lib/kanban/dev.ts +++ b/lib/kanban/dev.ts @@ -27,6 +27,7 @@ onPageLoad(() => { }, editLinks: true, colProps: { + titleAlign: 'left', /* 通过 actions 自定义列操作按钮(actions 还可以为一个回调函数动态返回操作按钮设置)。 */ actions: () => { return [{ diff --git a/lib/kanban/src/component/kanban-header-col.tsx b/lib/kanban/src/component/kanban-header-col.tsx index c8d30dafff..046b669b98 100644 --- a/lib/kanban/src/component/kanban-header-col.tsx +++ b/lib/kanban/src/component/kanban-header-col.tsx @@ -35,6 +35,7 @@ export class KanbanHeaderCol extends HElement { prefixClass, title, titleClass, + titleAlign = 'center', subtitle, subtitleClass, icon, @@ -44,7 +45,7 @@ export class KanbanHeaderCol extends HElement { } = props; return [ -
+
{icon ? : null} {prefix ? : null} diff --git a/lib/kanban/src/style/kanban.css b/lib/kanban/src/style/kanban.css index f77e2e23e9..c2f03e3fa7 100644 --- a/lib/kanban/src/style/kanban.css +++ b/lib/kanban/src/style/kanban.css @@ -28,6 +28,12 @@ .kanban-header-col-wrapper { @apply -bg-surface -relative -px-14 -w-full -flex-1 -flex -flex-row -items-center; } +.kanban-header-col-wrapper.is-align-left { + @apply -justify-start -pl-2; +} +.kanban-header-col-wrapper.is-align-left > .kanban-header-title { + @apply -justify-start; +} .kanban-header-title { @apply -flex -flex-row -items-center -flex-auto -justify-center -overflow-hidden; } diff --git a/lib/kanban/src/types/kanban-col-options.ts b/lib/kanban/src/types/kanban-col-options.ts index 87e7b4921d..bd848b7622 100644 --- a/lib/kanban/src/types/kanban-col-options.ts +++ b/lib/kanban/src/types/kanban-col-options.ts @@ -20,6 +20,7 @@ export interface KanbanColOptions extends HElementProps { prefixClass?: ClassNameLike; title?: CustomContentType; titleClass?: ClassNameLike; + titleAlign?: 'left' | 'center', subtitle?: CustomContentType; subtitleClass?: ClassNameLike; icon?: IconType;