Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Deploy To Site
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, next, test ]
branches: [master, next, test]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -24,7 +24,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: '18.19.0'
node-version: "20.0"

- run: yarn install
- run: yarn build
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.cjs
.pnp.loader.mjs
.yarn
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
2 changes: 1 addition & 1 deletion docs/api/config/js_kanban_cardheight_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ new kanban.Kanban("#root", {

**Change log:** The property was added in v1.2

**Related articles:** [Configuration](../../../guides/configuration#cards)
**Related articles:** [Configuration](guides/configuration.md#cards)

**Related sample:** [Kanban. Lazy rendering and column scroll](https://snippet.dhtmlx.com/xez9ghqq?tag=kanban)
21 changes: 12 additions & 9 deletions docs/api/config/js_kanban_cards_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cards?: [
coverURL?: string,
name?: string,
isCover?: boolean
size?: number
}, {...}
],
color?: string,
Expand Down Expand Up @@ -69,16 +70,17 @@ For each card you can specify the following parameters (data):
- `coverURL` - (optional) a path to the image to be set as a cover
- `name` - (optional) a file name
- `isCover` - (optional) enables a cover image. If **true**, the cover image will be downloaded via the "coverURL" url
- `size` - (optional) a size of the attached file (in bytes)
- `color` - (optional) a valid HEX color code. It is the color of the card top line
- `users` - (optional) an **array** with **ID**s for multiple assigned users or **string | number** for a single assigned user. To specify the assigned users, you need to define an array with users data in the [cardShape.users](../js_kanban_cardshape_config) property. The users are displayed in the **Users** field
- `users` - (optional) an **array** with **ID**s for multiple assigned users or **string | number** for a single assigned user. To specify the assigned users, you need to define an array with users data in the [cardShape.users](api/config/js_kanban_cardshape_config.md) property. The users are displayed in the **Users** field

:::info
`users?: array` - specify **array** with users **ID**s, if you use the [**multiselect**](../js_kanban_editorshape_config/#--parameters-for-combo-select-and-multiselect-types) editor type to assign multiple users
`users?: array` - specify **array** with users **ID**s, if you use the [**multiselect**](api/config/js_kanban_editorshape_config.md#--parameters-for-combo-select-and-multiselect-types) editor type to assign multiple users

`users?: string | number` - specify a single **ID**, if you use the [**combo** or **select**](../js_kanban_editorshape_config/#--parameters-for-combo-select-and-multiselect-types) editor types to assign a single user
`users?: string | number` - specify a single **ID**, if you use the [**combo** or **select**](api/config/js_kanban_editorshape_config.md#--parameters-for-combo-select-and-multiselect-types) editor types to assign a single user
:::

- `priority` - (optional) a card priority **ID**. To specify the card priority, you need to define an array with priorities data in the [cardShape.priority](../js_kanban_cardshape_config) property. It is displayed in the **Priority** field
- `priority` - (optional) a card priority **ID**. To specify the card priority, you need to define an array with priorities data in the [cardShape.priority](api/config/js_kanban_cardshape_config.md) property. It is displayed in the **Priority** field
- `css` - (optional) defines css styles for a separate card
- `votes` - (optional) an array of user IDs
- `comments` - (optional) an array of objects with data of comments. For each comment's object you can specify the following parameters:
Expand All @@ -87,15 +89,15 @@ For each card you can specify the following parameters (data):
- `cardId` - (required) an **ID** of the card that the comment belongs to
- `text` - (optional) a text of the comment. It also can contain html markup
- `date` - (optional) a Date object (do not specify a string date). The date when the comment was posted. It is not updated after editing
- `custom_key` - (optional) a custom key of the card. You can specify the custom keys to place the card into column and row. See the [columnKey](../js_kanban_columnkey_config) and [rowKey](../js_kanban_rowkey_config) properties
- `custom_key` - (optional) a custom key of the card. You can specify the custom keys to place the card into column and row. See the [columnKey](../js_kanban_columnkey_config) and [rowKey](api/config/js_kanban_rowkey_config.md) properties

:::info
If you want to load new data for cards dynamically, you can use the [**parse()**](../../methods/js_kanban_parse_method) method!
If you want to load new data for cards dynamically, you can use the [**parse()**](api/methods/js_kanban_parse_method.md) method!
:::

### Example

~~~jsx {1-40,44}
~~~jsx {1-41,45}
const cards = [
{
id: 1,
Expand All @@ -111,7 +113,8 @@ const cards = [
previewURL: "../assets/img-1.jpg",
coverURL: "../assets/img-1.jpg",
name: "img-1.jpg",
isCover: true
isCover: true,
size: 11979
}, {...} // other attached files data
],
color: "#65D3B3",
Expand Down Expand Up @@ -147,7 +150,7 @@ new kanban.Kanban("#root", {
**Change log:** The ***css***, ***comments*** and ***votes*** parameters were added in v1.4

**Related articles:**
- [Working with data](../../../guides/working_with_data)
- [Working with data](guides/working_with_data.md)
- [updateCard()](api/methods/js_kanban_updatecard_method.md)

**Related sample:** [Kanban. Styling cards](https://snippet.dhtmlx.com/qu6rpktk?tag=kanban)
49 changes: 33 additions & 16 deletions docs/api/config/js_kanban_cardshape_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ cardShape?: {
icon?: string,
text?: string,
disabled? boolean,
onClick?: ({ id, item, card }) => void
onClick?: ({ id, item, card }) => void,
data?: array // an array of menu subitems
},
{...}
] | ({ card, store }) => array | boolean
] | ({ card, readonly }) => array | null
},
users?: boolean | {
show?: boolean,
Expand Down Expand Up @@ -131,22 +132,35 @@ To configure the card appearance, in the **cardShape** object you can specify th
- ***id*** - an ID of the current menu item
- ***item*** - a data object of the current menu item
- ***card*** - a data object of the target card
- `data` - (optional) an array of objects that represent menu subitems

:::info
You can also set the `items` parameter to a custom function, that takes the following arguments:
You can also set the `menu.items` parameter to a custom function, that takes the following arguments:
- ***card*** - a data object of a current card
- ***store*** - an object of *dataStore*
- ***readonly*** - an object of readonly [state properties](api/internal/js_kanban_getstate_method.md)

This function allows customizing menu for any card or hide it for a specific one (by returning *null* or *false*):

~~~jsx {}
items: ({ card, store }) => {
if(card.id === 1)
return false
return [
{ id: "set-edit", icon: "wxi-edit", label: "Edit" },
{ id: "delete-card", icon: "wxi-delete", label: "Delete" }
]
items: ({ card, readonly }) => {
if (card.id === 1){
return false;
}

const menu = [];

if (!readonly.delete){
menu.push({
id: "delete-card", icon: "wxi-delete", label: "Delete"
});
}

if (!readonly.edit){
menu.push({
id: "set-edit", icon: "wxi-edit", label: "Edit"
});
}
return menu.length ? menu : null;
}
~~~
:::
Expand Down Expand Up @@ -190,7 +204,7 @@ To configure the card appearance, in the **cardShape** object you can specify th
- `clickable` - (optional) - makes the vote icon on the card clickable. If `true`, users can vote for the card using the vote icon on this card. Otherwise, users can vote for the card using the vote icon in the editor only
- `css` - a function returns a css class that applies to cards conditionally
- `headerFields` - (optional) an array of objects with the **custom fields** data. Here you can specify the following parameters:
- `key` - (required) a key of the custom field. It is used when configuring the Editor via the [editorShape](../js_kanban_editorshape_config) property
- `key` - (required) a key of the custom field. It is used when configuring the Editor via the [editorShape](api/config/js_kanban_editorshape_config.md) property
- `label` - (optional) a label of the custom field
- `css` - (optional) a css class of the custom field

Expand All @@ -209,8 +223,8 @@ const defaultPriorities = [

const defaultColors = ["#33B0B4", "#0096FA", "#F1B941"];

export const getDefaultCardMenuItems = ({ store }: { store: DataStore }) => {
const { readonly } = store.getState();
export const getDefaultCardMenuItems = ({ readonly }: { readonly: DataStore }) => {
const { readonly } = readonly.getState();
const baseItems = [
{ id: "duplicate-card", icon: "wxi-content-copy", text: "Duplicate" },
{ id: "delete-card", icon: "wxi-delete-outline", text: "Delete" }
Expand Down Expand Up @@ -311,10 +325,13 @@ new kanban.Kanban("#root", {

**Change log:**
- The ***comments***, ***css*** and ***votes*** parameters were added in v1.4
- The ***menu.items[0].label*** parameter was replaced by the ***menu.items[0].text*** parameter in v1.4
- The ***menu.items[0].label*** parameter was deprecated and replaced by the ***menu.items[0].text*** parameter in v1.4
- The ***menu.items[0].items*** parameter was deprecated and replaced by the ***menu.items[0].data*** parameter in v1.4
- The ***users.maxCount*** and ***votes.clickable*** parameters were added in v1.6
- The ***menu.items[0].label*** and ***menu.items[0].items*** parameters were removed in v1.7
- The ***menu.items*** function was updated. The **store** parameter was replaced with the **readonly** one in v1.7

**Related articles:** [Configuration](../../../guides/configuration#cards)
**Related articles:** [Configuration](guides/configuration.md#cards)

**Related samples:**
- [Kanban. Swimlanes, comments, votes](https://snippet.dhtmlx.com/5hcx01h4?tag=kanban)
Expand Down
2 changes: 1 addition & 1 deletion docs/api/config/js_kanban_cardtemplate_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ new kanban.Kanban("#root", {

**Change log:** The ability to display context menu was added in v1.4

**Related articles:** [Customization](../../../guides/customization#custom-cards)
**Related articles:** [Customization](guides/customization.md#custom-cards)

**Related sample:** [Kanban. Custom card](https://snippet.dhtmlx.com/8rhdq81d?tag=kanban)
2 changes: 1 addition & 1 deletion docs/api/config/js_kanban_columns_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ If styles are not applied, ensure that:
**Change log:** The **css** and **overlay** parameters were added in v1.4

**Related article:**
- [Working with data](../../../guides/working_with_data)
- [Working with data](guides/working_with_data.md)
- [updateColumn()](api/methods/js_kanban_updatecolumn_method.md)

**Related samples:**
Expand Down
36 changes: 22 additions & 14 deletions docs/api/config/js_kanban_columnshape_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ columnShape?: {
icon?: string,
text?: string,
disabled?: boolean,
onClick?: ({ id, item, column }) => void
onClick?: ({ id, item, column }) => void,
data?: array // an array of menu subitems
},
{...}
] | ({ column, columnIndex, columns, store }) => array | boolean
] | ({ column, columnIndex, columns, readonly }) => array | null
},
fixedHeaders?: boolean,
css?: (column, cards) => string,
Expand All @@ -52,6 +53,7 @@ To configure the columns appearance, in the **columnShape** object you can speci
- ***"move-column:left"*** - defines the action to move a column left
- ***"move-column:right"*** - defines the action to move a column right
- ***"delete-column"*** - defines the action to delete a column

- `icon` - (optional) a class name of icon of the menu item. Here you can specify any icon related to the icon fonts (*mdi-delete*)
- `text` - (optional) a name of the menu item
- `disabled` - (optional) a state of the menu item (*active* or *disabled* depending on the *boolean* value)
Expand All @@ -60,29 +62,32 @@ To configure the columns appearance, in the **columnShape** object you can speci
- ***item*** - a data object of the current menu item
- ***column*** - a data object of the target column

- `data` - (optional) an array of objects that represent menu subitems

:::info
You can also set the `items` parameter to a custom function, that takes the following arguments:
You can also set the `menu.items` parameter to a custom function, that takes the following arguments:
- ***column*** - a data object of a current column
- ***columnIndex*** - an index of a current column
- ***columns*** - an array of objects containing all columns data
- ***store*** - an object of *dataStore*
- ***readonly*** - an object of readonly [state properties](api/internal/js_kanban_getstate_method.md)

This function allows customizing menu for any column or hide it for a specific one (by returning *null* or *false*):

~~~jsx {}
items: ({ column, columnIndex, columns, store }) => {
if(column.id === "inprogress")
return null

if (column.id === "backlog")
items: ({ column }) => {
if(column.id === "inprogress"){
return null;
}
if (column.id === "backlog"){
return [
{ id: "set-edit", icon: "wxi-edit", text: "Rename" },
{
id: "delete-card",
icon: "wxi-delete",
text: "Remove card"
}
]
];
}
}
~~~
:::
Expand All @@ -96,7 +101,7 @@ To configure the columns appearance, in the **columnShape** object you can speci
### Default config

~~~jsx {}
const getDefaultColumnMenuItems = ({ column, columnIndex, columns, store }) => [
const getDefaultColumnMenuItems = ({ column, columnIndex, columns, readonly }) => [
{ id: "add-card", icon: "wxi-plus", text: "Add new card" },
{ id: "set-edit", icon: "wxi-edit", text: "Rename" },
{
Expand Down Expand Up @@ -133,7 +138,7 @@ const columnShape = {
{
id: "color",
text: "Color",
items: [
data: [
{
id:"yellow",
text: "Yellow",
Expand Down Expand Up @@ -196,11 +201,14 @@ new kanban.Kanban("#root", {

**Change log:**
- The ***css*** parameter was added in v1.4
- The ***menu.items[0].label*** parameter was replaced by the ***menu.items[0].text*** parameter in v1.4
- The ***menu.items[0].label*** parameter was deprecated and replaced by the ***menu.items[0].text*** parameter in v1.4
- The ***menu.items[0].items*** parameter was deprecated and replaced by the ***menu.items[0].data*** parameter in v1.4
- The ***fixedHeaders*** parameter was added in v1.5
- The ***headerTemplate*** and ***collapsedTemplate*** parameters were added in v1.6
- The ***menu.items[0].label*** and ***menu.items[0].items*** parameters were removed in v1.7
- The ***menu.items*** function was updated. The **store** parameter was replaced with the **readonly** one in v1.7

**Related articles:** [Configuration](../../../guides/configuration)
**Related articles:** [Configuration](guides/configuration.md)

**Related samples:**
- [Kanban. Changing color of column via custom menu](https://snippet.dhtmlx.com/fnlvd2g5?tag=kanban)
Expand Down
4 changes: 4 additions & 0 deletions docs/api/config/js_kanban_editor_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ description: You can learn about the editor config in the documentation of the D

~~~jsx {}
editor?: {
show?: boolean,
autoSave?: boolean,
debounce?: number,
placement?: "sidebar" | "modal"
Expand All @@ -22,6 +23,7 @@ editor?: {

### Parameters

- `show` - (optional) - enables/disables an editor
- `autoSave` - (optional) enables/disables an autosave mode of editor
- `debounce` - (optional) time of delay of autosaving data (works with the ***autoSave: true*** parameter only)
- `placement` - (optional) specifies the editor placement. You can set the following values:
Expand All @@ -32,6 +34,7 @@ editor?: {

~~~jsx {}
editor: {
show: true,
debounce: 100,
autoSave: true,
placement: "sidebar"
Expand All @@ -45,6 +48,7 @@ new kanban.Kanban("#root", {
columns,
cards,
editor: {
show: true
autoSave: true,
debounce: 2000,
placement: "modal"
Expand Down
13 changes: 7 additions & 6 deletions docs/api/config/js_kanban_editorshape_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ editorShape?: [
{...} // other options
],
config?: {
clearButton?: boolean, // for a "combo" type only
clear?: boolean, // for "combo" and "color" types
label?: string, // for a "select" type only
checkboxes?: boolean, // for a "multiselect" type only
// common parameters
Expand Down Expand Up @@ -157,7 +157,7 @@ To configure the editor appearance and functionality, you can specify the follow
In the Kanban editor you can use the following types of fields: **dateRange**, **date**, **combo**, **select**, **multiselect**, **color**, **text**, **textarea**, **progress**, **files**, **comments** and **links**
:::

- `key` - (required) an editor field key. Here you need to use the value specified in the [`cardShape`](../js_kanban_cardshape_config) property. See the example below:
- `key` - (required) an editor field key. Here you need to use the value specified in the [`cardShape`](api/config/js_kanban_cardshape_config.md) property. See the example below:

~~~js {8,17}
// card appearance settings
Expand Down Expand Up @@ -190,7 +190,7 @@ In the Kanban editor you can use the following types of fields: **dateRange**, *
- `end` - (required) an end date key

:::important
The values of these keys used in the [`cardShape`](../js_kanban_cardshape_config) property!
The values of these keys used in the [`cardShape`](api/config/js_kanban_cardshape_config.md) property!
:::

- `config` - (optional) a configuration object of the **"dateRange"** field. Here you can specify the following parameters:
Expand Down Expand Up @@ -243,7 +243,7 @@ To set the control for assigning a single user, you need to use the ***"select"*
:::

- `config` - (optional) a configuration object for **"combo"**, **"select"**, and **"multiselect"** fields. Here you can specify the following parameters:
- `clearButton` - (optional) adds the Clear button into a combo input (**for a "combo" type only**)
- `clear` - (optional) adds the Clear button into a combo input (**for "combo" and "color" types only**)
- `label` - (optional) binds options to the input field by the specified key (**for a "select" type only**)
- `checkboxes` - (optional) defines whether options have checkboxes next to them (**for a "multiselect" type only**)
- `textField` - (optional) binds combo options to the input field by the specified key (**for "combo" and "multiselect" types only**)
Expand Down Expand Up @@ -387,7 +387,7 @@ const defaultEditorShape = [
label: "Priority",
key: "priority",
config: {
clearButton: true
clear: true
}
},
{
Expand Down Expand Up @@ -467,5 +467,6 @@ new kanban.Kanban("#root", {

- The ***dateRange*** type was added in v1.3
- The ***comments*** and ***links*** types of editor, and ***format*** parameters were added in v1.4
- The ***clearButton*** parameter was replaced with the ***clear*** parameter

**Related articles:** [Configuration](../../../guides/configuration#editor)
**Related articles:** [Configuration](guides/configuration.md/#editor)
Loading