Skip to content

Commit 2daad5e

Browse files
Merge pull request #67 from DHTMLX/sp-release-1-7
Whats new before v1.7.0
2 parents 30ced50 + ad351c9 commit 2daad5e

File tree

101 files changed

+15345
-10648
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+15345
-10648
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Deploy To Site
66
on:
77
# Triggers the workflow on push or pull request events but only for the master branch
88
push:
9-
branches: [ master, next, test ]
9+
branches: [master, next, test]
1010

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

2525
- uses: actions/setup-node@v4
2626
with:
27-
node-version: '18.19.0'
27+
node-version: "20.0"
2828

2929
- run: yarn install
3030
- run: yarn build

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@
1818
npm-debug.log*
1919
yarn-debug.log*
2020
yarn-error.log*
21+
*.cjs
22+
.pnp.loader.mjs
23+
.yarn

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

docs/api/config/js_kanban_cardheight_config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ new kanban.Kanban("#root", {
3333

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

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

3838
**Related sample:** [Kanban. Lazy rendering and column scroll](https://snippet.dhtmlx.com/xez9ghqq?tag=kanban)

docs/api/config/js_kanban_cards_config.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ cards?: [
2929
coverURL?: string,
3030
name?: string,
3131
isCover?: boolean
32+
size?: number
3233
}, {...}
3334
],
3435
color?: string,
@@ -69,16 +70,17 @@ For each card you can specify the following parameters (data):
6970
- `coverURL` - (optional) a path to the image to be set as a cover
7071
- `name` - (optional) a file name
7172
- `isCover` - (optional) enables a cover image. If **true**, the cover image will be downloaded via the "coverURL" url
73+
- `size` - (optional) a size of the attached file (in bytes)
7274
- `color` - (optional) a valid HEX color code. It is the color of the card top line
73-
- `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
75+
- `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
7476

7577
:::info
76-
`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
78+
`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
7779

78-
`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
80+
`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
7981
:::
8082

81-
- `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
83+
- `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
8284
- `css` - (optional) defines css styles for a separate card
8385
- `votes` - (optional) an array of user IDs
8486
- `comments` - (optional) an array of objects with data of comments. For each comment's object you can specify the following parameters:
@@ -87,15 +89,15 @@ For each card you can specify the following parameters (data):
8789
- `cardId` - (required) an **ID** of the card that the comment belongs to
8890
- `text` - (optional) a text of the comment. It also can contain html markup
8991
- `date` - (optional) a Date object (do not specify a string date). The date when the comment was posted. It is not updated after editing
90-
- `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
92+
- `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
9193

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

9698
### Example
9799

98-
~~~jsx {1-40,44}
100+
~~~jsx {1-41,45}
99101
const cards = [
100102
{
101103
id: 1,
@@ -111,7 +113,8 @@ const cards = [
111113
previewURL: "../assets/img-1.jpg",
112114
coverURL: "../assets/img-1.jpg",
113115
name: "img-1.jpg",
114-
isCover: true
116+
isCover: true,
117+
size: 11979
115118
}, {...} // other attached files data
116119
],
117120
color: "#65D3B3",
@@ -147,7 +150,7 @@ new kanban.Kanban("#root", {
147150
**Change log:** The ***css***, ***comments*** and ***votes*** parameters were added in v1.4
148151

149152
**Related articles:**
150-
- [Working with data](../../../guides/working_with_data)
153+
- [Working with data](guides/working_with_data.md)
151154
- [updateCard()](api/methods/js_kanban_updatecard_method.md)
152155

153156
**Related sample:** [Kanban. Styling cards](https://snippet.dhtmlx.com/qu6rpktk?tag=kanban)

docs/api/config/js_kanban_cardshape_config.md

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ cardShape?: {
4141
icon?: string,
4242
text?: string,
4343
disabled? boolean,
44-
onClick?: ({ id, item, card }) => void
44+
onClick?: ({ id, item, card }) => void,
45+
data?: array // an array of menu subitems
4546
},
4647
{...}
47-
] | ({ card, store }) => array | boolean
48+
] | ({ card, readonly }) => array | null
4849
},
4950
users?: boolean | {
5051
show?: boolean,
@@ -131,22 +132,35 @@ To configure the card appearance, in the **cardShape** object you can specify th
131132
- ***id*** - an ID of the current menu item
132133
- ***item*** - a data object of the current menu item
133134
- ***card*** - a data object of the target card
135+
- `data` - (optional) an array of objects that represent menu subitems
134136

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

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

142144
~~~jsx {}
143-
items: ({ card, store }) => {
144-
if(card.id === 1)
145-
return false
146-
return [
147-
{ id: "set-edit", icon: "wxi-edit", label: "Edit" },
148-
{ id: "delete-card", icon: "wxi-delete", label: "Delete" }
149-
]
145+
items: ({ card, readonly }) => {
146+
if (card.id === 1){
147+
return false;
148+
}
149+
150+
const menu = [];
151+
152+
if (!readonly.delete){
153+
menu.push({
154+
id: "delete-card", icon: "wxi-delete", label: "Delete"
155+
});
156+
}
157+
158+
if (!readonly.edit){
159+
menu.push({
160+
id: "set-edit", icon: "wxi-edit", label: "Edit"
161+
});
162+
}
163+
return menu.length ? menu : null;
150164
}
151165
~~~
152166
:::
@@ -190,7 +204,7 @@ To configure the card appearance, in the **cardShape** object you can specify th
190204
- `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
191205
- `css` - a function returns a css class that applies to cards conditionally
192206
- `headerFields` - (optional) an array of objects with the **custom fields** data. Here you can specify the following parameters:
193-
- `key` - (required) a key of the custom field. It is used when configuring the Editor via the [editorShape](../js_kanban_editorshape_config) property
207+
- `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
194208
- `label` - (optional) a label of the custom field
195209
- `css` - (optional) a css class of the custom field
196210

@@ -209,8 +223,8 @@ const defaultPriorities = [
209223

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

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

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

317-
**Related articles:** [Configuration](../../../guides/configuration#cards)
334+
**Related articles:** [Configuration](guides/configuration.md#cards)
318335

319336
**Related samples:**
320337
- [Kanban. Swimlanes, comments, votes](https://snippet.dhtmlx.com/5hcx01h4?tag=kanban)

docs/api/config/js_kanban_cardtemplate_config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ new kanban.Kanban("#root", {
6868

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

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

7373
**Related sample:** [Kanban. Custom card](https://snippet.dhtmlx.com/8rhdq81d?tag=kanban)

docs/api/config/js_kanban_columns_config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ If styles are not applied, ensure that:
116116
**Change log:** The **css** and **overlay** parameters were added in v1.4
117117

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

122122
**Related samples:**

docs/api/config/js_kanban_columnshape_config.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ columnShape?: {
2222
icon?: string,
2323
text?: string,
2424
disabled?: boolean,
25-
onClick?: ({ id, item, column }) => void
25+
onClick?: ({ id, item, column }) => void,
26+
data?: array // an array of menu subitems
2627
},
2728
{...}
28-
] | ({ column, columnIndex, columns, store }) => array | boolean
29+
] | ({ column, columnIndex, columns, readonly }) => array | null
2930
},
3031
fixedHeaders?: boolean,
3132
css?: (column, cards) => string,
@@ -52,6 +53,7 @@ To configure the columns appearance, in the **columnShape** object you can speci
5253
- ***"move-column:left"*** - defines the action to move a column left
5354
- ***"move-column:right"*** - defines the action to move a column right
5455
- ***"delete-column"*** - defines the action to delete a column
56+
5557
- `icon` - (optional) a class name of icon of the menu item. Here you can specify any icon related to the icon fonts (*mdi-delete*)
5658
- `text` - (optional) a name of the menu item
5759
- `disabled` - (optional) a state of the menu item (*active* or *disabled* depending on the *boolean* value)
@@ -60,29 +62,32 @@ To configure the columns appearance, in the **columnShape** object you can speci
6062
- ***item*** - a data object of the current menu item
6163
- ***column*** - a data object of the target column
6264

65+
- `data` - (optional) an array of objects that represent menu subitems
66+
6367
:::info
64-
You can also set the `items` parameter to a custom function, that takes the following arguments:
68+
You can also set the `menu.items` parameter to a custom function, that takes the following arguments:
6569
- ***column*** - a data object of a current column
6670
- ***columnIndex*** - an index of a current column
6771
- ***columns*** - an array of objects containing all columns data
68-
- ***store*** - an object of *dataStore*
72+
- ***readonly*** - an object of readonly [state properties](api/internal/js_kanban_getstate_method.md)
6973

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

7276
~~~jsx {}
73-
items: ({ column, columnIndex, columns, store }) => {
74-
if(column.id === "inprogress")
75-
return null
76-
77-
if (column.id === "backlog")
77+
items: ({ column }) => {
78+
if(column.id === "inprogress"){
79+
return null;
80+
}
81+
if (column.id === "backlog"){
7882
return [
7983
{ id: "set-edit", icon: "wxi-edit", text: "Rename" },
8084
{
8185
id: "delete-card",
8286
icon: "wxi-delete",
8387
text: "Remove card"
8488
}
85-
]
89+
];
90+
}
8691
}
8792
~~~
8893
:::
@@ -96,7 +101,7 @@ To configure the columns appearance, in the **columnShape** object you can speci
96101
### Default config
97102

98103
~~~jsx {}
99-
const getDefaultColumnMenuItems = ({ column, columnIndex, columns, store }) => [
104+
const getDefaultColumnMenuItems = ({ column, columnIndex, columns, readonly }) => [
100105
{ id: "add-card", icon: "wxi-plus", text: "Add new card" },
101106
{ id: "set-edit", icon: "wxi-edit", text: "Rename" },
102107
{
@@ -133,7 +138,7 @@ const columnShape = {
133138
{
134139
id: "color",
135140
text: "Color",
136-
items: [
141+
data: [
137142
{
138143
id:"yellow",
139144
text: "Yellow",
@@ -196,11 +201,14 @@ new kanban.Kanban("#root", {
196201
197202
**Change log:**
198203
- The ***css*** parameter was added in v1.4
199-
- The ***menu.items[0].label*** parameter was replaced by the ***menu.items[0].text*** parameter in v1.4
204+
- The ***menu.items[0].label*** parameter was deprecated and replaced by the ***menu.items[0].text*** parameter in v1.4
205+
- The ***menu.items[0].items*** parameter was deprecated and replaced by the ***menu.items[0].data*** parameter in v1.4
200206
- The ***fixedHeaders*** parameter was added in v1.5
201207
- The ***headerTemplate*** and ***collapsedTemplate*** parameters were added in v1.6
208+
- The ***menu.items[0].label*** and ***menu.items[0].items*** parameters were removed in v1.7
209+
- The ***menu.items*** function was updated. The **store** parameter was replaced with the **readonly** one in v1.7
202210
203-
**Related articles:** [Configuration](../../../guides/configuration)
211+
**Related articles:** [Configuration](guides/configuration.md)
204212
205213
**Related samples:**
206214
- [Kanban. Changing color of column via custom menu](https://snippet.dhtmlx.com/fnlvd2g5?tag=kanban)

docs/api/config/js_kanban_editor_config.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ description: You can learn about the editor config in the documentation of the D
1414

1515
~~~jsx {}
1616
editor?: {
17+
show?: boolean,
1718
autoSave?: boolean,
1819
debounce?: number,
1920
placement?: "sidebar" | "modal"
@@ -22,6 +23,7 @@ editor?: {
2223

2324
### Parameters
2425

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

3335
~~~jsx {}
3436
editor: {
37+
show: true,
3538
debounce: 100,
3639
autoSave: true,
3740
placement: "sidebar"
@@ -45,6 +48,7 @@ new kanban.Kanban("#root", {
4548
columns,
4649
cards,
4750
editor: {
51+
show: true
4852
autoSave: true,
4953
debounce: 2000,
5054
placement: "modal"

0 commit comments

Comments
 (0)