diff --git a/docs/api/config/js_kanban_cardheight_config.md b/docs/api/config/js_kanban_cardheight_config.md index 8a36d1be..195da4a6 100644 --- a/docs/api/config/js_kanban_cardheight_config.md +++ b/docs/api/config/js_kanban_cardheight_config.md @@ -19,6 +19,8 @@ cardHeight?: number; // px :::important If you combine the [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) and [`scrollType: "default"`](api/config/js_kanban_scrolltype_config.md) settings, don't forget to specify a static height for cards via the `cardHeight` property. Unless you specify it, the cards will not be displayed. When you use [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) with [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md), you should also fix the height of cards via the `cardHeight` property. Although a variable height of cards is supported for this type of layout, it may not work in a stable manner with custom card content. + +If `cardHeight` is not specified, the widget falls back to an experimental approximation of card heights based on the visible fields declared in [`cardShape`](api/config/js_kanban_cardshape_config.md). With a custom [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md), this approximation does not apply — in that case, either set `cardHeight` explicitly or supply a custom [`getCardHeight`](api/config/js_kanban_getcardheight_config.md) function. ::: ### Example diff --git a/docs/api/config/js_kanban_columnshape_config.md b/docs/api/config/js_kanban_columnshape_config.md index 32690d86..ba347fa3 100644 --- a/docs/api/config/js_kanban_columnshape_config.md +++ b/docs/api/config/js_kanban_columnshape_config.md @@ -30,10 +30,10 @@ columnShape?: { }, fixedHeaders?: boolean, css?: (column, cards) => string, - headerTemplate?: template(column => { + headerTemplate?: template(props => { return "The HTML template of the column header in the expanded state"; }), - collapsedTemplate?: template(column => { + collapsedTemplate?: template(props => { return "The HTML template of the column header in the collapsed state"; }), confirmDeletion?: boolean @@ -94,8 +94,28 @@ To configure the columns appearance, in the **columnShape** object you can speci - `fixedHeaders` - (optional) freezes column headers during vertical scroll (*true* by default). Scroll must be enabled in Kanban itself (height must be limited) - `css` - (optional) a function that returns a css class that applies to columns conditionally -- `headerTemplate` - (optional) the HTML template of the column header in the expanded state -- `collapsedTemplate` - (optional) the HTML template of the column header in the collapsed state +- `headerTemplate` - (optional) the HTML template of the column header in the expanded state. The function receives a `props` object with the following properties: + - `column` - (object) the column data (see [`columns`](api/config/js_kanban_columns_config.md) for the structure) + - `columnState` - (object) the current state of the column. It always includes: + - ***columnId*** - (string | number) the ID of the column + - ***column*** - (object) the column data (same as `props.column`) + - ***cardsCount*** - (number) the number of cards in the column + - ***noFreeSpace*** - (boolean) ***true*** when the column cannot accept more cards + + When the [`columns[i].limit`](api/config/js_kanban_columns_config.md) parameter is enabled, it also includes: + - ***totalLimit*** - (number) the configured cards limit + - ***isOverLimit*** - (boolean) ***true*** when the number of cards exceeds the limit + + When the column belongs to a swimlane (row), it also includes: + - ***rowId*** - (string | number) the ID of the row + - ***row*** - (object) the row data (see [`rows`](api/config/js_kanban_rows_config.md) for the structure) + - ***height*** - (number) the height of the area + - `isMenuVisible` - (boolean) ***true*** when the menu should be shown for this column header + - `renaming` - (boolean) ***true*** when the input for editing the column name is active + - `readonly` - (boolean) ***true*** when column editing is disabled (equivalent of `!readonly.edit`, see the [`readonly`](api/config/js_kanban_readonly_config.md) property) +- `collapsedTemplate` - (optional) the HTML template of the column header in the collapsed state. The function receives a `props` object with the following properties: + - `column` - (object) the column data (see [`columns`](api/config/js_kanban_columns_config.md)) + - `columnState` - (object) the current state of the column. The shape is the same as `columnState` in the [`headerTemplate`](#parameters) parameter above - `confirmDeletion` - (optional) shows/hides the **confirmation dialog** that allows users to confirm or decline the column deletion ### Default config @@ -160,30 +180,30 @@ const columnShape = { }, fixedHeaders: false, css: (column, cards) => column.id == "inprogress" && cards.length < 5 ? "green" : "red", - headerTemplate: template(column => { + headerTemplate: template(props => { return `
- +
${ - !column.column.collapsed + !props.column.collapsed ? `
- ${escapeHTML(column.column.label)} - (${column.columnState.cardsCount}) + ${escapeHTML(props.column.label)} + (${props.columnState.cardsCount})
` : "" } ${ - !column.column.collapsed - ? `
+ !props.column.collapsed + ? `
` : "" }`; }), - collapsedTemplate: template(column => { + collapsedTemplate: template(props => { return `
-
${escapeHTML(column.column.label)} (${ - column.columnState?.cardsCount +
${escapeHTML(props.column.label)} (${ + props.columnState?.cardsCount })
`; }), diff --git a/docs/api/config/js_kanban_editorshape_config.md b/docs/api/config/js_kanban_editorshape_config.md index 5bb34377..e354bf59 100644 --- a/docs/api/config/js_kanban_editorshape_config.md +++ b/docs/api/config/js_kanban_editorshape_config.md @@ -19,6 +19,7 @@ editorShape?: [ type: string, key: string, label?: string, + modalSection?: "left" | "right", // for the "dateRange" type only key: { @@ -182,6 +183,9 @@ In the Kanban editor you can use the following types of fields: **dateRange**, * ~~~ - `label` - (optional) an editor field label +- `modalSection` - (optional) defines in which column of the modal editor the field is placed. Applied only when the editor is shown as a modal window via the [`editor.placement: "modal"`](api/config/js_kanban_editor_config.md) property. The possible values are: + - `"left"` - the field is placed in the left column + - `"right"` - the field is placed in the right column (default) #### - Parameters for a "dateRange" type @@ -466,6 +470,7 @@ 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 ***modalSection*** parameter was added in v1.6 - The ***clearButton*** parameter was replaced with the ***clear*** parameter **Related articles:** [Configuration](guides/configuration.md/#editor) diff --git a/docs/api/config/js_kanban_getcardheight_config.md b/docs/api/config/js_kanban_getcardheight_config.md new file mode 100644 index 00000000..67706f99 --- /dev/null +++ b/docs/api/config/js_kanban_getcardheight_config.md @@ -0,0 +1,74 @@ +--- +sidebar_label: getCardHeight +title: getCardHeight Config +description: You can learn about the getCardHeight config in the documentation of the DHTMLX JavaScript Kanban library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Kanban. +--- + +# getCardHeight + +### Description + +@short: Optional. A function that returns an estimated height of a card + +The `getCardHeight` function is used by the widget to estimate card heights when the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property is not set and the board is configured with [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) and [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md). The estimated heights let the widget render the scrollbar correctly before the actual cards are measured in the DOM. + +:::info +If you set the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property, the widget uses the fixed height and `getCardHeight` is not called. Setting `cardHeight` is the recommended way to combine `renderType: "lazy"` with `scrollType: "column"`. +::: + +### Usage + +~~~jsx {} +getCardHeight?: (cardShape: object, card: object, cardWidth: number) => number; +~~~ + +### Parameters + +The callback function takes the following arguments: + +- `cardShape` - the configuration object of the card (the [`cardShape`](api/config/js_kanban_cardshape_config.md) property) +- `card` - the data object of the card +- `cardWidth` - the current width of the card in pixels + +The function must return a number — the estimated height of the card in pixels. + +### Default config + +By default, the widget uses a built-in function that approximates card height based on the visible fields declared in [`cardShape`](api/config/js_kanban_cardshape_config.md) and the data stored in the card. This default works for boards that rely on the built-in card layout. + +If you provide a custom [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md), the built-in approximation can no longer predict the actual height of the rendered markup. In this case, specify a custom `getCardHeight` function that returns the height of the rendered template, or set a static [`cardHeight`](api/config/js_kanban_cardheight_config.md) instead. + +### Example + +The example below provides a custom `getCardHeight` function for a board with a custom card template: + +~~~jsx {15-22,27} +const cardTemplate = ({ cardFields }) => { + const { label, description } = cardFields; + return ` +
+
${label}
+
${description || ""}
+
+ `; +}; + +new kanban.Kanban("#root", { + cards, + columns, + renderType: "lazy", + scrollType: "column", + cardTemplate: kanban.template(card => cardTemplate(card)), + getCardHeight: (cardShape, card, cardWidth) => { + // estimate the height of the custom template + let height = 60; // base padding + label line + if (card.description) { + height += Math.ceil(card.description.length / 40) * 18; + } + return height; + }, + // other parameters +}); +~~~ + +**Related articles:** [Configuration](guides/configuration.md#rendering-and-scrolling) diff --git a/docs/api/config/js_kanban_rendertype_config.md b/docs/api/config/js_kanban_rendertype_config.md index a11280bd..9e18e756 100644 --- a/docs/api/config/js_kanban_rendertype_config.md +++ b/docs/api/config/js_kanban_rendertype_config.md @@ -23,6 +23,8 @@ renderType?: "default" | "lazy"; :::important If you combine the `renderType: "lazy"` and [`scrollType: "default"`](api/config/js_kanban_scrolltype_config.md) settings, don't forget to specify a static height for cards via the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property. Unless you specify it, the cards will not be displayed correctly. When you use `renderType: "lazy"` with [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md), you should also fix the height of cards via the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property. Although a variable height of cards is supported for this type of layout, it may not work in a stable manner with custom card content. + +If `cardHeight` is not set, the widget falls back to an experimental approximation of card heights based on [`cardShape`](api/config/js_kanban_cardshape_config.md). For boards with a custom [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md), supply a custom [`getCardHeight`](api/config/js_kanban_getcardheight_config.md) function instead. ::: ### Default config diff --git a/docs/api/config/js_kanban_scrolltype_config.md b/docs/api/config/js_kanban_scrolltype_config.md index 70eb10d8..36831280 100644 --- a/docs/api/config/js_kanban_scrolltype_config.md +++ b/docs/api/config/js_kanban_scrolltype_config.md @@ -29,6 +29,8 @@ scrollType: "default" :::important If you combine the [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) and `scrollType: "default"` settings, don't forget to specify a static height for cards via the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property. Unless you specify it, the cards will not be displayed. When you use [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) with `scrollType: "column"`, you should also fix the height of cards via the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property. Although a variable height of cards is supported for this type of layout, it may not work in a stable manner with custom card content. + +If `cardHeight` is not set, the widget falls back to an experimental approximation of card heights based on [`cardShape`](api/config/js_kanban_cardshape_config.md). For boards with a custom [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md), supply a custom [`getCardHeight`](api/config/js_kanban_getcardheight_config.md) function instead. ::: ### Example diff --git a/docs/api/config/toolbar_items_config.md b/docs/api/config/toolbar_items_config.md index 300b7a34..e4b0759f 100644 --- a/docs/api/config/toolbar_items_config.md +++ b/docs/api/config/toolbar_items_config.md @@ -26,8 +26,8 @@ items?: [ } }, {...} ], - resultTemplate?: template(searchResult => { - return "The HTML template of the search result"; + resultTemplate?: template(({ result }) => { + return `HTML template using ${result.label}`; }) }, "sort" | { @@ -66,7 +66,7 @@ In the **items** array you can specify the following parameters: - ***card*** - an object of the card data - ***value*** - a searched value, specified in the search bar - ***by*** - a key of card field, by which the cards will be searched -- `searchResult` - (optional) a template for displaying the custom search result +- `resultTemplate` - (optional) a template for displaying the custom search result ~~~jsx items: [ @@ -93,10 +93,10 @@ items: [ } } ], - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, @@ -161,10 +161,10 @@ new kanban.Toolbar("#toolbar", { items: [ { type: "search", - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, @@ -182,7 +182,7 @@ new kanban.Toolbar("#toolbar", { - The *"Undo"* and *"Redo"* controls were added in v1.3 - The ***items.options[0].label*** parameter of the **sort** control was replaced by the ***items.options[0].text*** parameter in v1.4 -- The ***items.searchResult*** parameter of the **"search"** control was added in v1.6 +- The ***items.resultTemplate*** parameter of the **"search"** control was added in v1.6 **Related articles:** [Configuration](guides/configuration.md#toolbar) and [Customization](guides/customization.md#custom-toolbar) diff --git a/docs/api/overview/internal_rest_overview.md b/docs/api/overview/internal_rest_overview.md index 1e0e6dd7..08ce3e71 100644 --- a/docs/api/overview/internal_rest_overview.md +++ b/docs/api/overview/internal_rest_overview.md @@ -6,11 +6,15 @@ description: You can have an Internal RestDataProvider methods overview of JavaS # RestDataProvider methods -| Name | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------------ | -| [](api/provider/rest_methods/js_kanban_getcards_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcards_method.md) | -| [](api/provider/rest_methods/js_kanban_getcolumns_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcolumns_method.md) | -| [](api/provider/rest_methods/js_kanban_getlinks_method.md) | @getshort(api/provider/rest_methods/js_kanban_getlinks_method.md) | -| [](api/provider/rest_methods/js_kanban_getrows_method.md) | @getshort(api/provider/rest_methods/js_kanban_getrows_method.md) | -| [](api/provider/rest_methods/js_kanban_getusers_method.md) | @getshort(api/provider/rest_methods/js_kanban_getusers_method.md) | -| [](api/provider/rest_methods/js_kanban_send_method.md) | @getshort(api/provider/rest_methods/js_kanban_send_method.md) | +| Name | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------------- | +| [](api/provider/rest_methods/js_kanban_getcards_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcards_method.md) | +| [](api/provider/rest_methods/js_kanban_getcolumns_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcolumns_method.md) | +| [](api/provider/rest_methods/js_kanban_gethandlers_method.md) | @getshort(api/provider/rest_methods/js_kanban_gethandlers_method.md) | +| [](api/provider/rest_methods/js_kanban_getidresolver_method.md) | @getshort(api/provider/rest_methods/js_kanban_getidresolver_method.md)| +| [](api/provider/rest_methods/js_kanban_getlinks_method.md) | @getshort(api/provider/rest_methods/js_kanban_getlinks_method.md) | +| [](api/provider/rest_methods/js_kanban_getqueue_method.md) | @getshort(api/provider/rest_methods/js_kanban_getqueue_method.md) | +| [](api/provider/rest_methods/js_kanban_getrows_method.md) | @getshort(api/provider/rest_methods/js_kanban_getrows_method.md) | +| [](api/provider/rest_methods/js_kanban_getusers_method.md) | @getshort(api/provider/rest_methods/js_kanban_getusers_method.md) | +| [](api/provider/rest_methods/js_kanban_send_method.md) | @getshort(api/provider/rest_methods/js_kanban_send_method.md) | +| [](api/provider/rest_methods/js_kanban_setheaders_method.md) | @getshort(api/provider/rest_methods/js_kanban_setheaders_method.md) | diff --git a/docs/api/overview/properties_overview.md b/docs/api/overview/properties_overview.md index 8aeddf7a..6add4207 100644 --- a/docs/api/overview/properties_overview.md +++ b/docs/api/overview/properties_overview.md @@ -20,6 +20,7 @@ To configure the **Kanban**, refer to the [Configuration](guides/configuration.m | [](api/config/js_kanban_currentuser_config.md) | @getshort(api/config/js_kanban_currentuser_config.md) | | [](api/config/js_kanban_editor_config.md) | @getshort(api/config/js_kanban_editor_config.md) | | [](api/config/js_kanban_editorshape_config.md) | @getshort(api/config/js_kanban_editorshape_config.md) | +| [](api/config/js_kanban_getcardheight_config.md) | @getshort(api/config/js_kanban_getcardheight_config.md) | | [](api/config/js_kanban_history_config.md) | @getshort(api/config/js_kanban_history_config.md) | | [](api/config/js_kanban_links_config.md) | @getshort(api/config/js_kanban_links_config.md) | | [](api/config/js_kanban_locale_config.md) | @getshort(api/config/js_kanban_locale_config.md) | diff --git a/docs/api/provider/rest_methods/js_kanban_gethandlers_method.md b/docs/api/provider/rest_methods/js_kanban_gethandlers_method.md new file mode 100644 index 00000000..21b78b16 --- /dev/null +++ b/docs/api/provider/rest_methods/js_kanban_gethandlers_method.md @@ -0,0 +1,54 @@ +--- +sidebar_label: getHandlers() +title: getHandlers REST Method +description: You can learn about the getHandlers REST method in the documentation of the DHTMLX JavaScript Kanban library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Kanban. +--- + +# getHandlers() + +### Description + +@short: Returns the default action handlers used by RestDataProvider to send data operations to the server + +:::info +The **getHandlers()** method is a part of the **RestDataProvider** service intended for working with server. +::: + +### Usage + +~~~jsx {} +getHandlers(): object; +~~~ + +### Returns + +The `getHandlers()` method returns an object that maps the [data operations supported by `RestDataProvider`](guides/working_with_server.md/#restdataprovider) to the requests that the provider sends to the server. + +The returned object is the default actions map used internally by `RestDataProvider`. Override this method to add custom handlers or replace the default ones with custom logic. + +### Example + +To extend the default handlers with custom ones, create a class that extends `RestDataProvider` and override `getHandlers()`. Always call `super.getHandlers()` from the override to keep the default handlers in place: + +~~~jsx {3-11} +const url = "https://some_backend_url"; + +class MyDataProvider extends kanban.RestDataProvider { + getHandlers() { + const handlers = super.getHandlers(); + return { + ...handlers, + // custom or overridden handlers go here + }; + } +} + +const restProvider = new MyDataProvider(url); +board.api.setNext(restProvider); +~~~ + +:::warning +Do not copy the default handlers into the override manually. The contents of the default actions map may change between versions; calling `super.getHandlers()` guarantees that your custom handlers stay merged on top of the current defaults. +::: + +**Related articles:** [Working with server](guides/working_with_server.md) diff --git a/docs/api/provider/rest_methods/js_kanban_getidresolver_method.md b/docs/api/provider/rest_methods/js_kanban_getidresolver_method.md new file mode 100644 index 00000000..8f00499b --- /dev/null +++ b/docs/api/provider/rest_methods/js_kanban_getidresolver_method.md @@ -0,0 +1,58 @@ +--- +sidebar_label: getIDResolver() +title: getIDResolver REST Method +description: You can learn about the getIDResolver REST method in the documentation of the DHTMLX JavaScript Kanban library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Kanban. +--- + +# getIDResolver() + +### Description + +@short: Returns a function that resolves temporary client-side IDs to backend IDs + +:::info +The `getIDResolver()` method is a part of the **RestDataProvider** service intended for working with server. +::: + +### Usage + +~~~jsx {} +getIDResolver(): (id: string | number, type: number) => string | number; +~~~ + +### Returns + +The method returns an `idResolver(id, type)` function: + +- `id` — the entity ID to resolve (a temporary client-side ID or a regular ID) +- `type` — the model type the ID belongs to: + - `1` — card (`CardID`) + - `2` — row (`RowID`) + - `3` — column (`ColumnID`) + - `4` — link (`LinkID`) + - `5` — comment (`CommentID`) + +When the client creates a new entity (card, column, row, link, comment), `RestDataProvider` assigns it a temporary client-side ID and remembers the backend ID returned by the server. The `idResolver(id, type)` function returns the backend ID for any temporary ID it still holds. For IDs that already match the backend, the function returns them unchanged. + +### Example + +The most common use case is wiring `RestDataProvider` to `kanbanUpdates` in a multiuser setup so that server events targeted at backend IDs apply correctly to entities that still live on the client under temporary IDs: + +~~~jsx {6-9} +const url = "https://some_backend_url"; +const restProvider = new kanban.RestDataProvider(url); + +// other initialization... + +const handlers = kanbanUpdates( + board.api, + restProvider.getIDResolver() +); + +const events = new kanban.RemoteEvents(url + "/api/v1", token); +events.on(handlers); +~~~ + +The same resolver function can be used inside custom handlers passed to `RemoteEvents.on()`. See [Customize server events](guides/working_with_server.md#customize-server-events) for a complete example. + +**Related articles:** [Working with server: Multiuser backend](guides/working_with_server.md#multiuser-backend) diff --git a/docs/api/provider/rest_methods/js_kanban_getqueue_method.md b/docs/api/provider/rest_methods/js_kanban_getqueue_method.md new file mode 100644 index 00000000..78dc9dbf --- /dev/null +++ b/docs/api/provider/rest_methods/js_kanban_getqueue_method.md @@ -0,0 +1,34 @@ +--- +sidebar_label: getQueue() +title: getQueue REST Method +description: You can learn about the getQueue REST method in the documentation of the DHTMLX JavaScript Kanban library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Kanban. +--- + +# getQueue() + +### Description + +@short: Returns the internal queue of actions that RestDataProvider processes + +:::info +The `getQueue()` method is a part of the **RestDataProvider** service intended for working with server. +::: + +### Usage + +~~~jsx {} +getQueue(): object; +~~~ + +### Returns + +The method returns the internal `ActionQueue` instance used by `RestDataProvider` to process data operations sent to the server. The queue is responsible for: + +- buffering actions until pending requests resolve +- assigning temporary client-side IDs to newly created entities and replacing them with backend IDs once the server responds + +The queue is used internally by other methods of `RestDataProvider`. The most common indirect use is via [`getIDResolver()`](api/provider/rest_methods/js_kanban_getidresolver_method.md), which is built on top of the queue's ID-resolution logic. + +You normally do not need to call `getQueue()` directly. Use this method only when you need fine-grained access to the queue (for example, when implementing advanced custom synchronization between the client and the server). + +**Related articles:** [Working with server](guides/working_with_server.md) diff --git a/docs/api/provider/rest_methods/js_kanban_setheaders_method.md b/docs/api/provider/rest_methods/js_kanban_setheaders_method.md new file mode 100644 index 00000000..9d89db58 --- /dev/null +++ b/docs/api/provider/rest_methods/js_kanban_setheaders_method.md @@ -0,0 +1,42 @@ +--- +sidebar_label: setHeaders() +title: setHeaders REST Method +description: You can learn about the setHeaders REST method in the documentation of the DHTMLX JavaScript Kanban library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Kanban. +--- + +# setHeaders() + +### Description + +@short: Sets custom HTTP headers that RestDataProvider attaches to every request sent to the server + +:::info +The `setHeaders()` method is a part of the **RestDataProvider** service intended for working with server. +::: + +### Usage + +~~~jsx {} +setHeaders(headers: object): void; +~~~ + +### Parameters + +- `headers` - (required) an object whose keys are header names and values are header values. The headers are appended to the default `Content-Type: application/json` header on every request sent via [`send()`](api/provider/rest_methods/js_kanban_send_method.md). + +### Example + +The most common use case is attaching an authorization token to every request: + +~~~jsx {4-6} +const url = "https://some_backend_url"; +const restProvider = new kanban.RestDataProvider(url); + +restProvider.setHeaders({ + "Remote-Token": "eyJpZCI6IjEzMzciLCJ1c2VybmFtZSI6ImJpem9uZSIsImlhdC...", +}); +~~~ + +To set headers only for a particular request rather than for every request, pass them as the fourth argument to [`send()`](api/provider/rest_methods/js_kanban_send_method.md) instead. + +**Related articles:** [Working with server: Multiuser backend](guides/working_with_server.md#multiuser-backend) diff --git a/docs/guides/configuration.md b/docs/guides/configuration.md index 273906b3..63df5a56 100644 --- a/docs/guides/configuration.md +++ b/docs/guides/configuration.md @@ -487,6 +487,8 @@ new kanban.Kanban("#root", { :::important When you combine `renderType: "lazy"` with any `scrollType`, set a static height for cards through the [`cardHeight`](api/config/js_kanban_cardheight_config.md) property. Without `cardHeight`, lazy rendering does not display cards correctly. + +If `cardHeight` is omitted with `renderType: "lazy"` and `scrollType: "column"`, the widget falls back to an experimental approximation of card heights based on the visible fields in [`cardShape`](api/config/js_kanban_cardshape_config.md). For boards that use a custom [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md), the widget cannot predict the rendered height — supply a custom [`getCardHeight(cardShape, card, cardWidth)`](api/config/js_kanban_getcardheight_config.md) function that returns the estimated card height. ::: ## History of changes @@ -554,10 +556,10 @@ new kanban.Toolbar("#toolbar", { } } ], - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, diff --git a/docs/guides/working_with_server.md b/docs/guides/working_with_server.md index ca9ade72..14478e3f 100644 --- a/docs/guides/working_with_server.md +++ b/docs/guides/working_with_server.md @@ -38,14 +38,47 @@ JavaScript Kanban includes the `RestDataProvider` service, which fully supports ## REST methods -The `RestDataProvider` service exposes the following REST methods for dynamic data loading: +The `RestDataProvider` service exposes the following REST methods: - [`getCards()`](api/provider/rest_methods/js_kanban_getcards_method.md) — gets a promise with cards data - [`getColumns()`](api/provider/rest_methods/js_kanban_getcolumns_method.md) — gets a promise with columns data +- [`getHandlers()`](api/provider/rest_methods/js_kanban_gethandlers_method.md) — returns the default action handlers used by the provider +- [`getIDResolver()`](api/provider/rest_methods/js_kanban_getidresolver_method.md) — returns a function that resolves temporary client IDs to backend IDs - [`getLinks()`](api/provider/rest_methods/js_kanban_getlinks_method.md) — gets a promise with links data +- [`getQueue()`](api/provider/rest_methods/js_kanban_getqueue_method.md) — returns the internal queue of actions processed by the provider - [`getRows()`](api/provider/rest_methods/js_kanban_getrows_method.md) — gets a promise with rows data - [`getUsers()`](api/provider/rest_methods/js_kanban_getusers_method.md) — gets a promise with users data - [`send()`](api/provider/rest_methods/js_kanban_send_method.md) — sends a custom HTTP request and returns a promise +- [`setHeaders()`](api/provider/rest_methods/js_kanban_setheaders_method.md) — sets custom HTTP headers attached to every request + +## Customize RestDataProvider + +To customize how `RestDataProvider` sends data operations to the server, extend the class and override one of its methods. Most often, customization targets the default action handlers — for example, to add a handler for a custom event or to extend the payload of an existing operation. + +To add custom handlers without losing the default ones, override [`getHandlers()`](api/provider/rest_methods/js_kanban_gethandlers_method.md) and merge custom entries on top of `super.getHandlers()`: + +~~~js {3-11} +const url = "https://some_backend_url"; + +class MyDataProvider extends kanban.RestDataProvider { + getHandlers() { + const handlers = super.getHandlers(); + return { + ...handlers, + // custom or overridden handlers go here + }; + } +} + +const restProvider = new MyDataProvider(url); +board.api.setNext(restProvider); +~~~ + +:::warning +Always call `super.getHandlers()` from the override and spread its result. Do not copy the default handlers into the override manually — the actions map may change between versions, so a hard-coded copy can silently get out of sync with the current defaults. +::: + +Another common customization target is the [`send()`](api/provider/rest_methods/js_kanban_send_method.md) method, which is called by every default handler. Override `send()` to inject extra headers, rewrite URLs, or wrap every server request with custom logic. ## Interact with the backend diff --git a/docs/news/whats_new.md b/docs/news/whats_new.md index 57adffd6..fcd6ec70 100644 --- a/docs/news/whats_new.md +++ b/docs/news/whats_new.md @@ -158,7 +158,7 @@ Released on November 13, 2024 - The ability to change how many assigned users are displayed on a card via the [`cardShape.users.maxCount`](api/config/js_kanban_cardshape_config.md) property (see the [**example**](https://snippet.dhtmlx.com/w205dvzg?tag=kanban)) - The ability to change the content of column headers via the [`columnShape`](api/config/js_kanban_columnshape_config.md) property (see the [**example**](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban)) -- The ability to change the view and content of search results via the [`items.searchResult`](api/config/toolbar_items_config.md) property of the Toolbar **search** control (see the [**example**](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban)) +- The ability to change the view and content of search results via the [`items.resultTemplate`](api/config/toolbar_items_config.md) property of the Toolbar **search** control (see the [**example**](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban)) - The ability to display the editor as a modal window via the [`editor.placement`](api/config/js_kanban_editor_config.md) property (see the [**example**](https://snippet.dhtmlx.com/vt6pe7qz?tag=kanban)) - The ability to enable voting for a card (using the vote icon on the card) via the [`cardShape.votes.clickable`](api/config/js_kanban_cardshape_config.md) property (see the [**example**](https://snippet.dhtmlx.com/en76xvi4?tag=kanban)) @@ -169,7 +169,8 @@ Released on November 13, 2024 - The [`cardShape`](api/config/js_kanban_cardshape_config.md) property is extended by the ***users.maxCount*** and ***votes.clickable*** parameters - The [`columnShape`](api/config/js_kanban_columnshape_config.md) property is extended by the ***headerTemplate*** and ***collapsedTemplate*** parameters - The [`editor`](api/config/js_kanban_editor_config.md) property is extended by the ***placement*** parameter - - The [`items`](api/config/toolbar_items_config.md) property of the Toolbar **search** control is extended by the ***searchResult*** parameter + - The [`editorShape`](api/config/js_kanban_editorshape_config.md) property is extended by the ***modalSection*** parameter + - The [`items`](api/config/toolbar_items_config.md) property of the Toolbar **search** control is extended by the ***resultTemplate*** parameter - #### Events diff --git a/i18n/de/docusaurus-plugin-content-docs/current/.sync b/i18n/de/docusaurus-plugin-content-docs/current/.sync index 0337ab75..a10bd810 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/.sync +++ b/i18n/de/docusaurus-plugin-content-docs/current/.sync @@ -1 +1 @@ -f55b2fb6832c9d6955cfb66b8e5734aa93ffa3d3 +943f1d77abd087cfa70fc9f4a148239ebcae9d9a diff --git a/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md b/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md index f6911eac..c916f152 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md @@ -19,6 +19,8 @@ cardHeight?: number; // px :::important Wenn Sie die Einstellungen [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) und [`scrollType: "default"`](api/config/js_kanban_scrolltype_config.md) kombinieren, vergessen Sie nicht, eine statische Höhe für die Karten über die Eigenschaft `cardHeight` anzugeben. Wenn Sie dies nicht tun, werden die Karten nicht angezeigt. Wenn Sie [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) gemeinsam mit [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md) verwenden, sollten Sie ebenfalls die Höhe der Karten über die Eigenschaft `cardHeight` festlegen. Obwohl für diesen Layouttyp eine variable Kartenhöhe unterstützt wird, kann dies mit individuellem Karteninhalt unter Umständen nicht stabil funktionieren. + +Wenn `cardHeight` nicht angegeben ist, greift das Widget auf eine experimentelle Schätzung der Kartenhöhen zurück, die auf den in [`cardShape`](api/config/js_kanban_cardshape_config.md) deklarierten sichtbaren Feldern basiert. Bei einem benutzerdefinierten [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md) gilt diese Schätzung nicht — in diesem Fall entweder `cardHeight` explizit setzen oder eine benutzerdefinierte [`getCardHeight`](api/config/js_kanban_getcardheight_config.md)-Funktion bereitstellen. ::: ### Beispiel diff --git a/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md b/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md index 0f23c51b..3a499e0c 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md @@ -30,10 +30,10 @@ columnShape?: { }, fixedHeaders?: boolean, css?: (column, cards) => string, - headerTemplate?: template(column => { + headerTemplate?: template(props => { return "Die HTML-Vorlage des Spaltenkopfs im erweiterten Zustand"; }), - collapsedTemplate?: template(column => { + collapsedTemplate?: template(props => { return "Die HTML-Vorlage des Spaltenkopfs im eingeklappten Zustand"; }), confirmDeletion?: boolean @@ -94,8 +94,28 @@ Um das Erscheinungsbild der Spalten zu konfigurieren, können Sie im **columnSha - `fixedHeaders` - (optional) friert die Spaltenüberschriften beim vertikalen Scrollen ein (*true* standardmäßig). Scrollen muss im Kanban selbst aktiviert sein (Höhe muss begrenzt sein) - `css` - (optional) eine Funktion, die eine CSS-Klasse zurückgibt, die bedingt auf Spalten angewendet wird -- `headerTemplate` - (optional) die HTML-Vorlage des Spaltenkopfs im erweiterten Zustand -- `collapsedTemplate` - (optional) die HTML-Vorlage des Spaltenkopfs im eingeklappten Zustand +- `headerTemplate` - (optional) die HTML-Vorlage des Spaltenkopfs im erweiterten Zustand. Die Funktion erhält ein `props`-Objekt mit den folgenden Eigenschaften: + - `column` - (object) die Spaltendaten (siehe [`columns`](api/config/js_kanban_columns_config.md) für die Struktur) + - `columnState` - (object) der aktuelle Zustand der Spalte. Er enthält immer: + - ***columnId*** - (string | number) die ID der Spalte + - ***column*** - (object) die Spaltendaten (entspricht `props.column`) + - ***cardsCount*** - (number) die Anzahl der Karten in der Spalte + - ***noFreeSpace*** - (boolean) ***true***, wenn die Spalte keine weiteren Karten annehmen kann + + Wenn der Parameter [`columns[i].limit`](api/config/js_kanban_columns_config.md) aktiviert ist, enthält er zusätzlich: + - ***totalLimit*** - (number) das konfigurierte Kartenlimit + - ***isOverLimit*** - (boolean) ***true***, wenn die Anzahl der Karten das Limit überschreitet + + Wenn die Spalte zu einer Swimlane (Zeile) gehört, enthält er zusätzlich: + - ***rowId*** - (string | number) die ID der Zeile + - ***row*** - (object) die Zeilendaten (siehe [`rows`](api/config/js_kanban_rows_config.md) für die Struktur) + - ***height*** - (number) die Höhe des Bereichs + - `isMenuVisible` - (boolean) ***true***, wenn das Menü für diesen Spaltenkopf angezeigt werden soll + - `renaming` - (boolean) ***true***, wenn das Eingabefeld zur Bearbeitung des Spaltennamens aktiv ist + - `readonly` - (boolean) ***true***, wenn die Bearbeitung der Spalte deaktiviert ist (entspricht `!readonly.edit`, siehe die Eigenschaft [`readonly`](api/config/js_kanban_readonly_config.md)) +- `collapsedTemplate` - (optional) die HTML-Vorlage des Spaltenkopfs im eingeklappten Zustand. Die Funktion erhält ein `props`-Objekt mit den folgenden Eigenschaften: + - `column` - (object) die Spaltendaten (siehe [`columns`](api/config/js_kanban_columns_config.md)) + - `columnState` - (object) der aktuelle Zustand der Spalte. Die Struktur ist identisch mit `columnState` im Parameter [`headerTemplate`](#parameter) oben - `confirmDeletion` - (optional) zeigt/versteckt den **Bestätigungsdialog**, der es Benutzern erlaubt, das Löschen der Spalte zu bestätigen oder abzulehnen ### Standardkonfiguration @@ -160,30 +180,30 @@ const columnShape = { }, fixedHeaders: false, css: (column, cards) => column.id == "inprogress" && cards.length < 5 ? "green" : "red", - headerTemplate: template(column => { + headerTemplate: template(props => { return `
- +
${ - !column.column.collapsed + !props.column.collapsed ? `
- ${escapeHTML(column.column.label)} - (${column.columnState.cardsCount}) + ${escapeHTML(props.column.label)} + (${props.columnState.cardsCount})
` : "" } ${ - !column.column.collapsed - ? `
+ !props.column.collapsed + ? `
` : "" }`; }), - collapsedTemplate: template(column => { + collapsedTemplate: template(props => { return `
-
${escapeHTML(column.column.label)} (${ - column.columnState?.cardsCount +
${escapeHTML(props.column.label)} (${ + props.columnState?.cardsCount })
`; }), @@ -213,4 +233,4 @@ new kanban.Kanban("#root", { **Verwandte Beispiele:** - [Kanban. Ändern der Spaltenfarbe über benutzerdefiniertes Menü](https://snippet.dhtmlx.com/fnlvd2g5?tag=kanban) - [Kanban. Fixierte Überschriften, Lazy Rendering und Spaltenscroll](https://snippet.dhtmlx.com/xez9ghqq?tag=kanban) -- [Kanban. Vorlage für Spaltenüberschriften](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban) \ No newline at end of file +- [Kanban. Vorlage für Spaltenüberschriften](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban) diff --git a/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md b/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md index 15605670..3560c483 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md @@ -19,6 +19,7 @@ editorShape?: [ type: string, key: string, label?: string, + modalSection?: "left" | "right", // nur für den Typ "dateRange" key: { @@ -182,6 +183,9 @@ Im Kanban-Editor können Sie die folgenden Feldtypen verwenden: **dateRange**, * ~~~ - `label` - (optional) eine Beschriftung für das Editor-Feld +- `modalSection` - (optional) definiert, in welcher Spalte des modalen Editors das Feld platziert wird. Wird nur angewendet, wenn der Editor als modales Fenster über die Eigenschaft [`editor.placement: "modal"`](api/config/js_kanban_editor_config.md) angezeigt wird. Mögliche Werte: + - `"left"` - das Feld wird in der linken Spalte platziert + - `"right"` - das Feld wird in der rechten Spalte platziert (Standard) #### - Parameter für den Typ "dateRange" @@ -466,6 +470,7 @@ new kanban.Kanban("#root", { - Der Typ ***dateRange*** wurde in Version 1.3 hinzugefügt - Die Typen ***comments*** und ***links*** für den Editor sowie der Parameter ***format*** wurden in Version 1.4 hinzugefügt +- Der Parameter ***modalSection*** wurde in Version 1.6 hinzugefügt - Der Parameter ***clearButton*** wurde durch den Parameter ***clear*** ersetzt **Verwandte Artikel:** [Konfiguration](guides/configuration.md/#editor) diff --git a/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md b/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md index fe1c4b9e..1771c93c 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md @@ -23,6 +23,8 @@ renderType?: "default" | "lazy"; :::important Wenn Sie die Einstellungen `renderType: "lazy"` und [`scrollType: "default"`](api/config/js_kanban_scrolltype_config.md) kombinieren, vergessen Sie nicht, eine statische Höhe für die Karten über die Eigenschaft [`cardHeight`](api/config/js_kanban_cardheight_config.md) anzugeben. Andernfalls werden die Karten nicht korrekt angezeigt. Wenn Sie `renderType: "lazy"` mit [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md) verwenden, sollten Sie ebenfalls die Höhe der Karten über die [`cardHeight`](api/config/js_kanban_cardheight_config.md) Eigenschaft festlegen. Obwohl eine variable Kartenhöhe für diesen Layouttyp unterstützt wird, kann dies bei benutzerdefiniertem Karteninhalt zu Instabilitäten führen. + +Wenn `cardHeight` nicht gesetzt ist, greift das Widget auf eine experimentelle Näherung der Kartenhöhen zurück, die auf [`cardShape`](api/config/js_kanban_cardshape_config.md) basiert. Für Boards mit einem benutzerdefinierten [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md) sollte stattdessen eine benutzerdefinierte [`getCardHeight`](api/config/js_kanban_getcardheight_config.md)-Funktion angegeben werden. ::: ### Standardkonfiguration diff --git a/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md b/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md index 3ef15223..60a5bd2f 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md @@ -29,6 +29,8 @@ scrollType: "default" :::important Wenn Sie die Einstellungen [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) und `scrollType: "default"` kombinieren, vergessen Sie nicht, eine statische Höhe für die Karten über die Eigenschaft [`cardHeight`](api/config/js_kanban_cardheight_config.md) anzugeben. Andernfalls werden die Karten nicht angezeigt. Wenn Sie [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) mit `scrollType: "column"` verwenden, sollten Sie ebenfalls die Höhe der Karten über die Eigenschaft [`cardHeight`](api/config/js_kanban_cardheight_config.md) festlegen. Obwohl eine variable Höhe für Karten bei diesem Layouttyp unterstützt wird, kann dies bei individuellem Karteninhalt zu einer instabilen Darstellung führen. + +Wenn `cardHeight` nicht festgelegt ist, greift das Widget auf eine experimentelle Näherung der Kartenhöhen basierend auf [`cardShape`](api/config/js_kanban_cardshape_config.md) zurück. Für Boards mit einem benutzerdefinierten [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md) sollte stattdessen eine benutzerdefinierte [`getCardHeight`](api/config/js_kanban_getcardheight_config.md)-Funktion angegeben werden. ::: ### Beispiel diff --git a/i18n/de/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md b/i18n/de/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md index 1f49a1c0..3aa32f9c 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md @@ -26,8 +26,8 @@ items?: [ } }, {...} ], - resultTemplate?: template(searchResult => { - return "Die HTML-Vorlage des Suchergebnisses"; + resultTemplate?: template(({ result }) => { + return `HTML template using ${result.label}`; }) }, "sort" | { @@ -93,10 +93,10 @@ items: [ } } ], - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, @@ -161,10 +161,10 @@ new kanban.Toolbar("#toolbar", { items: [ { type: "search", - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, @@ -182,7 +182,7 @@ new kanban.Toolbar("#toolbar", { - Die Steuerelemente *"Undo"* und *"Redo"* wurden in v1.3 hinzugefügt - Der Parameter ***items.options[0].label*** der **sort** Steuerung wurde in v1.4 durch den Parameter ***items.options[0].text*** ersetzt -- Der Parameter ***items.searchResult*** der **"search"** Steuerung wurde in v1.6 hinzugefügt +- Der Parameter ***items.resultTemplate*** der **"search"** Steuerung wurde in v1.6 hinzugefügt **Verwandte Artikel:** [Konfiguration](guides/configuration.md#toolbar) und [Anpassung](guides/customization.md#custom-toolbar) diff --git a/i18n/de/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md b/i18n/de/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md index 30788d76..2b691985 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md @@ -6,11 +6,15 @@ description: In der Dokumentation der DHTMLX JavaScript Kanban-Bibliothek finden # RestDataProvider-Methoden -| Name | Beschreibung | -| ------------------------------------------------------------ | ----------------------------------------------------------------- | -| [](api/provider/rest_methods/js_kanban_getcards_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcards_method.md) | -| [](api/provider/rest_methods/js_kanban_getcolumns_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcolumns_method.md)| -| [](api/provider/rest_methods/js_kanban_getlinks_method.md) | @getshort(api/provider/rest_methods/js_kanban_getlinks_method.md) | -| [](api/provider/rest_methods/js_kanban_getrows_method.md) | @getshort(api/provider/rest_methods/js_kanban_getrows_method.md) | -| [](api/provider/rest_methods/js_kanban_getusers_method.md) | @getshort(api/provider/rest_methods/js_kanban_getusers_method.md) | -| [](api/provider/rest_methods/js_kanban_send_method.md) | @getshort(api/provider/rest_methods/js_kanban_send_method.md) | \ No newline at end of file +| Name | Beschreibung | +| --------------------------------------------------------------- | --------------------------------------------------------------------- | +| [](api/provider/rest_methods/js_kanban_getcards_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcards_method.md) | +| [](api/provider/rest_methods/js_kanban_getcolumns_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcolumns_method.md) | +| [](api/provider/rest_methods/js_kanban_gethandlers_method.md) | @getshort(api/provider/rest_methods/js_kanban_gethandlers_method.md) | +| [](api/provider/rest_methods/js_kanban_getidresolver_method.md) | @getshort(api/provider/rest_methods/js_kanban_getidresolver_method.md)| +| [](api/provider/rest_methods/js_kanban_getlinks_method.md) | @getshort(api/provider/rest_methods/js_kanban_getlinks_method.md) | +| [](api/provider/rest_methods/js_kanban_getqueue_method.md) | @getshort(api/provider/rest_methods/js_kanban_getqueue_method.md) | +| [](api/provider/rest_methods/js_kanban_getrows_method.md) | @getshort(api/provider/rest_methods/js_kanban_getrows_method.md) | +| [](api/provider/rest_methods/js_kanban_getusers_method.md) | @getshort(api/provider/rest_methods/js_kanban_getusers_method.md) | +| [](api/provider/rest_methods/js_kanban_send_method.md) | @getshort(api/provider/rest_methods/js_kanban_send_method.md) | +| [](api/provider/rest_methods/js_kanban_setheaders_method.md) | @getshort(api/provider/rest_methods/js_kanban_setheaders_method.md) | diff --git a/i18n/de/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md b/i18n/de/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md index 05af2014..01c8b262 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md @@ -20,6 +20,7 @@ Zur Konfiguration des **Kanban** siehe den Abschnitt [Configuration](guides/conf | [](api/config/js_kanban_currentuser_config.md) | @getshort(api/config/js_kanban_currentuser_config.md) | | [](api/config/js_kanban_editor_config.md) | @getshort(api/config/js_kanban_editor_config.md) | | [](api/config/js_kanban_editorshape_config.md) | @getshort(api/config/js_kanban_editorshape_config.md) | +| [](api/config/js_kanban_getcardheight_config.md) | @getshort(api/config/js_kanban_getcardheight_config.md) | | [](api/config/js_kanban_history_config.md) | @getshort(api/config/js_kanban_history_config.md) | | [](api/config/js_kanban_links_config.md) | @getshort(api/config/js_kanban_links_config.md) | | [](api/config/js_kanban_locale_config.md) | @getshort(api/config/js_kanban_locale_config.md) | diff --git a/i18n/de/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_gethandlers_method.md b/i18n/de/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_gethandlers_method.md new file mode 100644 index 00000000..02ca22a5 --- /dev/null +++ b/i18n/de/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_gethandlers_method.md @@ -0,0 +1,54 @@ +--- +sidebar_label: getHandlers() +title: getHandlers REST-Methode +description: In der Dokumentation der DHTMLX JavaScript Kanban-Bibliothek erfahren Sie mehr über die getHandlers REST-Methode. Lesen Sie Entwicklerhandbücher und API-Referenzen, testen Sie Codebeispiele und Live-Demos, und laden Sie eine kostenlose 30-Tage-Evaluierungsversion von DHTMLX Kanban herunter. +--- + +# getHandlers() + +### Beschreibung + +@short: Gibt die Standard-Action-Handler zurück, die von RestDataProvider verwendet werden, um Datenoperationen an den Server zu senden + +:::info +Die Methode **getHandlers()** ist Teil des **RestDataProvider**-Dienstes für die Arbeit mit dem Server. +::: + +### Verwendung + +~~~jsx {} +getHandlers(): object; +~~~ + +### Rückgabewert + +Die Methode `getHandlers()` gibt ein Objekt zurück, das die [von `RestDataProvider` unterstützten Datenoperationen](guides/working_with_server.md/#restdataprovider) den Anfragen zuordnet, die der Provider an den Server sendet. + +Das zurückgegebene Objekt ist die Standard-Actions-Map, die intern von `RestDataProvider` verwendet wird. Überschreiben Sie diese Methode, um benutzerdefinierte Handler hinzuzufügen oder die Standardhandler durch eigene Logik zu ersetzen. + +### Beispiel + +Um die Standard-Handler um benutzerdefinierte zu erweitern, erstellen Sie eine Klasse, die `RestDataProvider` erweitert, und überschreiben Sie `getHandlers()`. Rufen Sie dabei immer `super.getHandlers()` aus der überschriebenen Methode auf, um die Standard-Handler beizubehalten: + +~~~jsx {3-11} +const url = "https://some_backend_url"; + +class MyDataProvider extends kanban.RestDataProvider { + getHandlers() { + const handlers = super.getHandlers(); + return { + ...handlers, + // custom or overridden handlers go here + }; + } +} + +const restProvider = new MyDataProvider(url); +board.api.setNext(restProvider); +~~~ + +:::warning +Kopieren Sie die Standard-Handler nicht manuell in die überschriebene Methode. Der Inhalt der Standard-Actions-Map kann sich zwischen Versionen ändern; der Aufruf von `super.getHandlers()` stellt sicher, dass Ihre benutzerdefinierten Handler stets auf den aktuellen Standardwerten aufbauen. +::: + +**Verwandte Artikel:** [Arbeiten mit dem Server](guides/working_with_server.md) diff --git a/i18n/de/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getidresolver_method.md b/i18n/de/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getidresolver_method.md new file mode 100644 index 00000000..c7d9e8f5 --- /dev/null +++ b/i18n/de/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getidresolver_method.md @@ -0,0 +1,58 @@ +--- +sidebar_label: getIDResolver() +title: getIDResolver REST-Methode +description: In der Dokumentation der DHTMLX JavaScript Kanban-Bibliothek erfahren Sie mehr über die REST-Methode getIDResolver. Lesen Sie Entwicklerhandbücher und API-Referenzen, probieren Sie Codebeispiele und Live-Demos aus und laden Sie eine kostenlose 30-Tage-Evaluierungsversion von DHTMLX Kanban herunter. +--- + +# getIDResolver() + +### Beschreibung + +@short: Gibt eine Funktion zurück, die temporäre clientseitige IDs in Backend-IDs auflöst + +:::info +Die Methode `getIDResolver()` ist Teil des **RestDataProvider**-Diensts für die Arbeit mit dem Server. +::: + +### Verwendung + +~~~jsx {} +getIDResolver(): (id: string | number, type: number) => string | number; +~~~ + +### Rückgabewert + +Die Methode gibt eine `idResolver(id, type)`-Funktion zurück: + +- `id` — die aufzulösende Entitäts-ID (eine temporäre clientseitige ID oder eine reguläre ID) +- `type` — der Modelltyp, zu dem die ID gehört: + - `1` — Karte (`CardID`) + - `2` — Zeile (`RowID`) + - `3` — Spalte (`ColumnID`) + - `4` — Verknüpfung (`LinkID`) + - `5` — Kommentar (`CommentID`) + +Wenn der Client eine neue Entität (Karte, Spalte, Zeile, Verknüpfung, Kommentar) erstellt, weist `RestDataProvider` ihr eine temporäre clientseitige ID zu und speichert die vom Server zurückgegebene Backend-ID. Die Funktion `idResolver(id, type)` gibt die Backend-ID für jede temporäre ID zurück, die sie noch enthält. Für IDs, die bereits mit der Backend-ID übereinstimmen, gibt die Funktion sie unverändert zurück. + +### Beispiel + +Der häufigste Anwendungsfall ist die Verbindung von `RestDataProvider` mit `kanbanUpdates` in einer Mehrbenutzerumgebung, damit serverseitige Ereignisse, die auf Backend-IDs abzielen, korrekt auf Entitäten angewendet werden, die auf dem Client noch unter temporären IDs gespeichert sind: + +~~~jsx {6-9} +const url = "https://some_backend_url"; +const restProvider = new kanban.RestDataProvider(url); + +// other initialization... + +const handlers = kanbanUpdates( + board.api, + restProvider.getIDResolver() +); + +const events = new kanban.RemoteEvents(url + "/api/v1", token); +events.on(handlers); +~~~ + +Dieselbe Resolver-Funktion kann in benutzerdefinierten Handlern verwendet werden, die an `RemoteEvents.on()` übergeben werden. Ein vollständiges Beispiel finden Sie unter [Serverevents anpassen](guides/working_with_server.md/#customize-server-events). + +**Verwandte Artikel:** [Mit dem Server arbeiten: Mehrbenutzer-Backend](guides/working_with_server.md/#multiuser-backend) diff --git a/i18n/de/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getqueue_method.md b/i18n/de/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getqueue_method.md new file mode 100644 index 00000000..749735bb --- /dev/null +++ b/i18n/de/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getqueue_method.md @@ -0,0 +1,34 @@ +--- +sidebar_label: getQueue() +title: getQueue REST-Methode +description: In der Dokumentation der DHTMLX JavaScript Kanban-Bibliothek erfahren Sie mehr über die getQueue REST-Methode. Entwicklerhandbücher und API-Referenz, Code-Beispiele und Live-Demos sowie eine kostenlose 30-Tage-Testversion von DHTMLX Kanban stehen zur Verfügung. +--- + +# getQueue() + +### Beschreibung + +@short: Gibt die interne Warteschlange der Aktionen zurück, die RestDataProvider verarbeitet + +:::info +Die Methode `getQueue()` ist Teil des **RestDataProvider**-Dienstes für die Arbeit mit dem Server. +::: + +### Verwendung + +~~~jsx {} +getQueue(): object; +~~~ + +### Rückgabewert + +Die Methode gibt die interne `ActionQueue`-Instanz zurück, die von `RestDataProvider` zur Verarbeitung der an den Server gesendeten Datenoperationen verwendet wird. Die Warteschlange ist verantwortlich für: + +- das Puffern von Aktionen, bis ausstehende Anfragen abgeschlossen sind +- das Zuweisen temporärer clientseitiger IDs an neu erstellte Entitäten und deren Ersetzung durch Backend-IDs, sobald der Server antwortet + +Die Warteschlange wird intern von anderen Methoden von `RestDataProvider` verwendet. Die häufigste indirekte Verwendung erfolgt über [`getIDResolver()`](api/provider/rest_methods/js_kanban_getidresolver_method.md), das auf der ID-Auflösungslogik der Warteschlange aufbaut. + +In der Regel ist es nicht notwendig, `getQueue()` direkt aufzurufen. Verwenden Sie diese Methode nur, wenn Sie detaillierten Zugriff auf die Warteschlange benötigen (z. B. bei der Implementierung einer erweiterten benutzerdefinierten Synchronisierung zwischen Client und Server). + +**Verwandte Artikel:** [Arbeiten mit dem Server](guides/working_with_server.md) diff --git a/i18n/de/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_setheaders_method.md b/i18n/de/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_setheaders_method.md new file mode 100644 index 00000000..b62f4e43 --- /dev/null +++ b/i18n/de/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_setheaders_method.md @@ -0,0 +1,42 @@ +--- +sidebar_label: setHeaders() +title: setHeaders REST-Methode +description: In der Dokumentation der DHTMLX JavaScript Kanban-Bibliothek erfahren Sie mehr über die setHeaders-REST-Methode. Entdecken Sie Entwicklerhandbücher und API-Referenzen, probieren Sie Codebeispiele und Live-Demos aus und laden Sie eine kostenlose 30-Tage-Evaluierungsversion von DHTMLX Kanban herunter. +--- + +# setHeaders() + +### Beschreibung + +@short: Legt benutzerdefinierte HTTP-Header fest, die RestDataProvider bei jeder an den Server gesendeten Anfrage anhängt + +:::info +Die Methode `setHeaders()` ist Teil des **RestDataProvider**-Dienstes für die Arbeit mit dem Server. +::: + +### Verwendung + +~~~jsx {} +setHeaders(headers: object): void; +~~~ + +### Parameter + +- `headers` - (erforderlich) ein Objekt, dessen Schlüssel Header-Namen und dessen Werte Header-Werte sind. Die Header werden bei jeder über [`send()`](api/provider/rest_methods/js_kanban_send_method.md) gesendeten Anfrage zum Standard-Header `Content-Type: application/json` hinzugefügt. + +### Beispiel + +Der häufigste Anwendungsfall ist das Anhängen eines Autorisierungs-Tokens an jede Anfrage: + +~~~jsx {4-6} +const url = "https://some_backend_url"; +const restProvider = new kanban.RestDataProvider(url); + +restProvider.setHeaders({ + "Remote-Token": "eyJpZCI6IjEzMzciLCJ1c2VybmFtZSI6ImJpem9uZSIsImlhdC...", +}); +~~~ + +Um Header nur für eine bestimmte Anfrage und nicht für jede Anfrage festzulegen, übergeben Sie diese stattdessen als viertes Argument an [`send()`](api/provider/rest_methods/js_kanban_send_method.md). + +**Verwandte Artikel:** [Arbeiten mit dem Server: Multiuser-Backend](guides/working_with_server.md/#multiuser-backend) diff --git a/i18n/de/docusaurus-plugin-content-docs/current/guides/configuration.md b/i18n/de/docusaurus-plugin-content-docs/current/guides/configuration.md index fc81d9fa..4ae18216 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/guides/configuration.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/guides/configuration.md @@ -465,7 +465,7 @@ new kanban.Kanban("#root", { }); ~~~ -## Rendering und Scrollen +## Rendering und Scrollen {#rendering-and-scrolling} Standardmäßig rendert das Kanban-Widget alle Karten und scrollt das gesamte Board. Bei Boards mit vielen Karten können Sie auf Lazy Rendering oder spaltenweises Scrollen umschalten: @@ -487,6 +487,8 @@ new kanban.Kanban("#root", { :::important Wenn Sie `renderType: "lazy"` mit einem beliebigen `scrollType` kombinieren, legen Sie über die [`cardHeight`](api/config/js_kanban_cardheight_config.md) Eigenschaft eine statische Höhe für Karten fest. Ohne `cardHeight` werden Karten beim Lazy Rendering nicht korrekt angezeigt. + +Wenn `cardHeight` bei `renderType: "lazy"` und `scrollType: "column"` weggelassen wird, greift das Widget auf eine experimentelle Näherung der Kartenhöhen auf Basis der sichtbaren Felder in [`cardShape`](api/config/js_kanban_cardshape_config.md) zurück. Bei Boards mit einem benutzerdefinierten [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md) kann das Widget die gerenderte Höhe nicht vorhersagen — stellen Sie eine benutzerdefinierte Funktion [`getCardHeight(cardShape, card, cardWidth)`](api/config/js_kanban_getcardheight_config.md) bereit, die die geschätzte Kartenhöhe zurückgibt. ::: ## Änderungsverlauf @@ -554,10 +556,10 @@ new kanban.Toolbar("#toolbar", { } } ], - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, diff --git a/i18n/de/docusaurus-plugin-content-docs/current/guides/working_with_server.md b/i18n/de/docusaurus-plugin-content-docs/current/guides/working_with_server.md index a4975e49..17a74b48 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/guides/working_with_server.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/guides/working_with_server.md @@ -38,14 +38,47 @@ JavaScript Kanban enthält den `RestDataProvider`-Service, der die REST API voll ## REST-Methoden -Der `RestDataProvider`-Service stellt folgende REST-Methoden für das dynamische Laden von Daten bereit: +Der `RestDataProvider`-Service stellt folgende REST-Methoden bereit: - [`getCards()`](api/provider/rest_methods/js_kanban_getcards_method.md) — gibt ein Promise mit den Kartendaten zurück - [`getColumns()`](api/provider/rest_methods/js_kanban_getcolumns_method.md) — gibt ein Promise mit den Spaltendaten zurück +- [`getHandlers()`](api/provider/rest_methods/js_kanban_gethandlers_method.md) — gibt die Standard-Aktions-Handler zurück, die vom Provider verwendet werden +- [`getIDResolver()`](api/provider/rest_methods/js_kanban_getidresolver_method.md) — gibt eine Funktion zurück, die temporäre Client-IDs in Backend-IDs auflöst - [`getLinks()`](api/provider/rest_methods/js_kanban_getlinks_method.md) — gibt ein Promise mit den Verbindungsdaten zurück +- [`getQueue()`](api/provider/rest_methods/js_kanban_getqueue_method.md) — gibt die interne Warteschlange der vom Provider verarbeiteten Aktionen zurück - [`getRows()`](api/provider/rest_methods/js_kanban_getrows_method.md) — gibt ein Promise mit den Zeilendaten zurück - [`getUsers()`](api/provider/rest_methods/js_kanban_getusers_method.md) — gibt ein Promise mit den Benutzerdaten zurück - [`send()`](api/provider/rest_methods/js_kanban_send_method.md) — sendet eine benutzerdefinierte HTTP-Anfrage und gibt ein Promise zurück +- [`setHeaders()`](api/provider/rest_methods/js_kanban_setheaders_method.md) — setzt benutzerdefinierte HTTP-Header, die an jede Anfrage angehängt werden + +## RestDataProvider anpassen + +Um anzupassen, wie `RestDataProvider` Datenoperationen an den Server sendet, erweitern Sie die Klasse und überschreiben Sie eine ihrer Methoden. Meist zielt die Anpassung auf die Standard-Aktions-Handler — zum Beispiel um einen Handler für ein benutzerdefiniertes Ereignis hinzuzufügen oder den Payload einer vorhandenen Operation zu erweitern. + +Um eigene Handler hinzuzufügen, ohne die Standardhandler zu verlieren, überschreiben Sie [`getHandlers()`](api/provider/rest_methods/js_kanban_gethandlers_method.md) und führen Sie benutzerdefinierte Einträge mit `super.getHandlers()` zusammen: + +~~~js {3-11} +const url = "https://some_backend_url"; + +class MyDataProvider extends kanban.RestDataProvider { + getHandlers() { + const handlers = super.getHandlers(); + return { + ...handlers, + // custom or overridden handlers go here + }; + } +} + +const restProvider = new MyDataProvider(url); +board.api.setNext(restProvider); +~~~ + +:::warning +Rufen Sie in der Überschreibung immer `super.getHandlers()` auf und spreaden Sie das Ergebnis. Kopieren Sie die Standard-Handler nicht manuell in die Überschreibung — die Aktionszuordnung kann sich zwischen Versionen ändern, sodass eine fest kodierte Kopie stillschweigend nicht mehr mit den aktuellen Standards übereinstimmt. +::: + +Ein weiteres häufiges Anpassungsziel ist die Methode [`send()`](api/provider/rest_methods/js_kanban_send_method.md), die von jedem Standard-Handler aufgerufen wird. Überschreiben Sie `send()`, um zusätzliche Header einzufügen, URLs umzuschreiben oder jede Serveranfrage mit eigener Logik zu umhüllen. ## Interaktion mit dem Backend @@ -101,7 +134,7 @@ Das folgende Demo verbindet `RestDataProvider` mit einem Go-Backend und lädt Se -## Multiuser-Backend +## Multiuser-Backend {#multiuser-backend} Ein Multiuser-Backend ermöglicht es mehreren Nutzern, dasselbe Kanban-Board in Echtzeit zu bearbeiten, ohne die Seite neu zu laden. Das Widget verbindet sich über einen WebSocket mit dem Server, und benutzerdefinierte Handler wenden eingehende Änderungen auf das Kanban-Board an. @@ -196,7 +229,7 @@ Das folgende Demo konfiguriert das Multiuser-Backend, um Änderungen anderer Nut -## Server-Ereignisse anpassen +## Server-Ereignisse anpassen {#customize-server-events} Um benutzerdefinierte Logik für Server-Ereignisse zu definieren, übergeben Sie ein `handlers`-Objekt an `RemoteEvents.on(handlers)`. Das Objekt hat folgende Struktur: diff --git a/i18n/de/docusaurus-plugin-content-docs/current/news/whats_new.md b/i18n/de/docusaurus-plugin-content-docs/current/news/whats_new.md index 1c915fb2..a88cc675 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/news/whats_new.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/news/whats_new.md @@ -158,7 +158,7 @@ Veröffentlicht am 13. November 2024 - Möglichkeit, wie viele zugewiesene Benutzer auf einer Karte angezeigt werden, über die Eigenschaft [`cardShape.users.maxCount`](api/config/js_kanban_cardshape_config.md) zu ändern (siehe [**Beispiel**](https://snippet.dhtmlx.com/w205dvzg?tag=kanban)) - Möglichkeit, den Inhalt von Spaltenköpfen über die Eigenschaft [`columnShape`](api/config/js_kanban_columnshape_config.md) zu ändern (siehe [**Beispiel**](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban)) -- Möglichkeit, Ansicht und Inhalt der Suchergebnisse über die Eigenschaft [`items.searchResult`](api/config/toolbar_items_config.md) der Toolbar-**Suche**-Steuerung zu ändern (siehe [**Beispiel**](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban)) +- Möglichkeit, Ansicht und Inhalt der Suchergebnisse über die Eigenschaft [`items.resultTemplate`](api/config/toolbar_items_config.md) der Toolbar-**Suche**-Steuerung zu ändern (siehe [**Beispiel**](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban)) - Möglichkeit, den Editor als modales Fenster über die Eigenschaft [`editor.placement`](api/config/js_kanban_editor_config.md) anzuzeigen (siehe [**Beispiel**](https://snippet.dhtmlx.com/vt6pe7qz?tag=kanban)) - Möglichkeit, das Voting für eine Karte (mit dem Abstimmungs-Icon auf der Karte) über die Eigenschaft [`cardShape.votes.clickable`](api/config/js_kanban_cardshape_config.md) zu aktivieren (siehe [**Beispiel**](https://snippet.dhtmlx.com/en76xvi4?tag=kanban)) @@ -169,7 +169,8 @@ Veröffentlicht am 13. November 2024 - Die Eigenschaft [`cardShape`](api/config/js_kanban_cardshape_config.md) wurde um die Parameter ***users.maxCount*** und ***votes.clickable*** erweitert. - Die Eigenschaft [`columnShape`](api/config/js_kanban_columnshape_config.md) wurde um die Parameter ***headerTemplate*** und ***collapsedTemplate*** erweitert. - Die Eigenschaft [`editor`](api/config/js_kanban_editor_config.md) wurde um den Parameter ***placement*** erweitert. - - Die Eigenschaft [`items`](api/config/toolbar_items_config.md) der Toolbar-**Suche**-Steuerung wurde um den Parameter ***searchResult*** erweitert. + - Die Eigenschaft [`editorShape`](api/config/js_kanban_editorshape_config.md) wurde um den Parameter ***modalSection*** erweitert. + - Die Eigenschaft [`items`](api/config/toolbar_items_config.md) der Toolbar-**Suche**-Steuerung wurde um den Parameter ***resultTemplate*** erweitert. - #### Events diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/.sync b/i18n/ko/docusaurus-plugin-content-docs/current/.sync index 0337ab75..a10bd810 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/.sync +++ b/i18n/ko/docusaurus-plugin-content-docs/current/.sync @@ -1 +1 @@ -f55b2fb6832c9d6955cfb66b8e5734aa93ffa3d3 +943f1d77abd087cfa70fc9f4a148239ebcae9d9a diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md b/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md index ecdbe7ae..94efa619 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md +++ b/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md @@ -19,6 +19,8 @@ cardHeight?: number; // px :::important [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md)와 [`scrollType: "default"`](api/config/js_kanban_scrolltype_config.md) 설정을 함께 사용하는 경우, `cardHeight` 속성을 통해 카드의 고정 높이를 반드시 지정해야 합니다. 지정하지 않으면 카드가 표시되지 않습니다. 또한 [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md)와 [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md)을 함께 사용할 때도 `cardHeight` 속성을 통해 카드의 높이를 고정해야 합니다. 이 레이아웃에서는 카드의 가변 높이가 지원되지만, 커스텀 카드 콘텐츠와 함께 사용할 경우 안정적으로 동작하지 않을 수 있습니다. + +`cardHeight`를 지정하지 않은 경우, 위젯은 [`cardShape`](api/config/js_kanban_cardshape_config.md)에 선언된 표시 필드를 기반으로 카드 높이를 실험적으로 추정합니다. 커스텀 [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md)을 사용하는 경우에는 이 추정이 적용되지 않으므로, `cardHeight`를 명시적으로 설정하거나 커스텀 [`getCardHeight`](api/config/js_kanban_getcardheight_config.md) 함수를 제공해야 합니다. ::: ### 예제 diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md b/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md index 1bb75f4e..e0b984c8 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md +++ b/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md @@ -30,17 +30,17 @@ columnShape?: { }, fixedHeaders?: boolean, css?: (column, cards) => string, - headerTemplate?: template(column => { + headerTemplate?: template(props => { return "확장된 상태의 컬럼 헤더 HTML 템플릿"; }), - collapsedTemplate?: template(column => { + collapsedTemplate?: template(props => { return "축소된 상태의 컬럼 헤더 HTML 템플릿"; }), confirmDeletion?: boolean }; ~~~ -### 매개변수 +### 매개변수 {#parameters} 컬럼 모양을 구성하려면 **columnShape** 객체에서 다음 매개변수를 지정할 수 있습니다: @@ -94,8 +94,28 @@ columnShape?: { - `fixedHeaders` - (선택 사항) 수직 스크롤 시 컬럼 헤더 고정 (기본값 *true*). Kanban 자체에서 스크롤이 활성화되어야 하며 (높이 제한 필요) - `css` - (선택 사항) 조건에 따라 컬럼에 적용할 CSS 클래스를 반환하는 함수 -- `headerTemplate` - (선택 사항) 확장된 상태의 컬럼 헤더 HTML 템플릿 -- `collapsedTemplate` - (선택 사항) 축소된 상태의 컬럼 헤더 HTML 템플릿 +- `headerTemplate` - (선택 사항) 확장된 상태의 컬럼 헤더 HTML 템플릿입니다. 이 함수는 다음 속성을 가진 `props` 객체를 받습니다: + - `column` - (object) 컬럼 데이터 (구조는 [`columns`](api/config/js_kanban_columns_config.md) 참조) + - `columnState` - (object) 컬럼의 현재 상태. 항상 다음을 포함합니다: + - ***columnId*** - (string | number) 컬럼 ID + - ***column*** - (object) 컬럼 데이터 (`props.column`과 동일) + - ***cardsCount*** - (number) 컬럼 내 카드 수 + - ***noFreeSpace*** - (boolean) 컬럼이 더 이상 카드를 받을 수 없을 때 ***true*** + + [`columns[i].limit`](api/config/js_kanban_columns_config.md) 매개변수가 활성화된 경우 추가로 포함됩니다: + - ***totalLimit*** - (number) 설정된 카드 한도 + - ***isOverLimit*** - (boolean) 카드 수가 한도를 초과할 때 ***true*** + + 컬럼이 스윔레인(row)에 속하는 경우 추가로 포함됩니다: + - ***rowId*** - (string | number) row ID + - ***row*** - (object) row 데이터 (구조는 [`rows`](api/config/js_kanban_rows_config.md) 참조) + - ***height*** - (number) 영역 높이 + - `isMenuVisible` - (boolean) 해당 컬럼 헤더에 메뉴를 표시해야 할 때 ***true*** + - `renaming` - (boolean) 컬럼 이름 편집 입력이 활성화될 때 ***true*** + - `readonly` - (boolean) 컬럼 편집이 비활성화될 때 ***true*** (`!readonly.edit`과 동일, [`readonly`](api/config/js_kanban_readonly_config.md) 속성 참조) +- `collapsedTemplate` - (선택 사항) 축소된 상태의 컬럼 헤더 HTML 템플릿입니다. 이 함수는 다음 속성을 가진 `props` 객체를 받습니다: + - `column` - (object) 컬럼 데이터 ([`columns`](api/config/js_kanban_columns_config.md) 참조) + - `columnState` - (object) 컬럼의 현재 상태. 형태는 위의 [`headerTemplate`](#parameters) 매개변수의 `columnState`와 동일합니다 - `confirmDeletion` - (선택 사항) 컬럼 삭제 확인 대화상자 표시 여부 ### 기본 구성 @@ -160,30 +180,30 @@ const columnShape = { }, fixedHeaders: false, css: (column, cards) => column.id == "inprogress" && cards.length < 5 ? "green" : "red", - headerTemplate: template(column => { + headerTemplate: template(props => { return `
- +
${ - !column.column.collapsed + !props.column.collapsed ? `
- ${escapeHTML(column.column.label)} - (${column.columnState.cardsCount}) + ${escapeHTML(props.column.label)} + (${props.columnState.cardsCount})
` : "" } ${ - !column.column.collapsed - ? `
+ !props.column.collapsed + ? `
` : "" }`; }), - collapsedTemplate: template(column => { + collapsedTemplate: template(props => { return `
-
${escapeHTML(column.column.label)} (${ - column.columnState?.cardsCount +
${escapeHTML(props.column.label)} (${ + props.columnState?.cardsCount })
`; }), @@ -213,4 +233,4 @@ new kanban.Kanban("#root", { **관련 샘플:** - [Kanban. 사용자 정의 메뉴를 통한 컬럼 색상 변경](https://snippet.dhtmlx.com/fnlvd2g5?tag=kanban) - [Kanban. 고정 헤더, 지연 렌더링 및 컬럼 스크롤](https://snippet.dhtmlx.com/xez9ghqq?tag=kanban) -- [Kanban. 컬럼 헤더 템플릿](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban) \ No newline at end of file +- [Kanban. 컬럼 헤더 템플릿](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban) diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md b/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md index dac44fce..5eea2f4d 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md +++ b/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md @@ -19,6 +19,7 @@ editorShape?: [ type: string, key: string, label?: string, + modalSection?: "left" | "right", // "dateRange" 유형에만 해당 key: { @@ -182,6 +183,9 @@ Kanban 편집기에서는 다음 필드 유형을 사용할 수 있습니다: ** ~~~ - `label` - (선택 사항) 편집기 필드 레이블 +- `modalSection` - (선택 사항) 모달 편집기에서 필드가 배치될 열을 정의합니다. [`editor.placement: "modal"`](api/config/js_kanban_editor_config.md) 속성을 통해 편집기가 모달 창으로 표시될 때만 적용됩니다. 가능한 값은 다음과 같습니다: + - `"left"` - 필드가 왼쪽 열에 배치됩니다 + - `"right"` - 필드가 오른쪽 열에 배치됩니다 (기본값) #### - "dateRange" 유형 매개변수 @@ -466,6 +470,7 @@ new kanban.Kanban("#root", { - v1.3에서 ***dateRange*** 유형 추가 - v1.4에서 ***comments*** 및 ***links*** 편집기 유형과 ***format*** 매개변수 추가 +- v1.6에서 ***modalSection*** 매개변수 추가 - ***clearButton*** 매개변수가 ***clear*** 매개변수로 대체됨 **관련 문서:** [구성](guides/configuration.md/#editor) diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md b/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md index bbed9213..a745cc44 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md +++ b/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md @@ -23,6 +23,8 @@ renderType?: "default" | "lazy"; :::important `renderType: "lazy"`와 [`scrollType: "default"`](api/config/js_kanban_scrolltype_config.md) 설정을 함께 사용할 경우, 반드시 [`cardHeight`](api/config/js_kanban_cardheight_config.md) 속성을 통해 카드의 고정 높이를 지정해야 합니다. 지정하지 않으면 카드가 올바르게 표시되지 않습니다. `renderType: "lazy"`를 [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md)과 함께 사용할 때도 카드의 높이를 [`cardHeight`](api/config/js_kanban_cardheight_config.md) 속성을 통해 고정해야 합니다. 이 레이아웃에서는 카드의 가변 높이도 지원하지만, 커스텀 카드 콘텐츠와 함께 사용할 경우 안정적으로 동작하지 않을 수 있습니다. + +`cardHeight`가 설정되지 않은 경우, 위젯은 [`cardShape`](api/config/js_kanban_cardshape_config.md)를 기반으로 카드 높이를 실험적으로 추정합니다. 커스텀 [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md)을 사용하는 보드의 경우, 대신 커스텀 [`getCardHeight`](api/config/js_kanban_getcardheight_config.md) 함수를 제공하세요. ::: ### 기본 구성 diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md b/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md index 09c0ae06..95d00b6c 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md +++ b/i18n/ko/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md @@ -29,6 +29,8 @@ scrollType: "default" :::important [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md)와 `scrollType: "default"` 설정을 함께 사용할 경우, [`cardHeight`](api/config/js_kanban_cardheight_config.md) 속성을 통해 카드의 고정 높이를 반드시 지정해야 합니다. 지정하지 않으면 카드가 표시되지 않습니다. [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md)와 `scrollType: "column"`을 함께 사용할 때에도 [`cardHeight`](api/config/js_kanban_cardheight_config.md) 속성을 통해 카드의 높이를 고정해야 합니다. 이 레이아웃 유형에서는 카드의 가변 높이가 지원되지만, 커스텀 카드 콘텐츠와 함께 사용할 경우 안정적으로 동작하지 않을 수 있습니다. + +`cardHeight`가 설정되지 않은 경우, widget은 [`cardShape`](api/config/js_kanban_cardshape_config.md)를 기반으로 카드 높이를 실험적으로 근사하는 방식으로 대체됩니다. 커스텀 [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md)을 사용하는 보드의 경우, 대신 커스텀 [`getCardHeight`](api/config/js_kanban_getcardheight_config.md) 함수를 제공하세요. ::: ### 예제 diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md b/i18n/ko/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md index 0b040013..e026bbe8 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md +++ b/i18n/ko/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md @@ -26,8 +26,8 @@ items?: [ } }, {...} ], - resultTemplate?: template(searchResult => { - return "검색 결과의 HTML 템플릿"; + resultTemplate?: template(({ result }) => { + return `HTML template using ${result.label}`; }) }, "sort" | { @@ -66,7 +66,7 @@ items?: [ - ***card*** - 카드 데이터 객체 - ***value*** - 검색바에 입력된 검색 값 - ***by*** - 카드가 검색될 카드 필드 키 -- `searchResult` - (선택) 사용자 정의 검색 결과를 표시하기 위한 템플릿 +- `resultTemplate` - (선택) 사용자 정의 검색 결과를 표시하기 위한 템플릿 ~~~jsx items: [ @@ -93,10 +93,10 @@ items: [ } } ], - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, @@ -161,10 +161,10 @@ new kanban.Toolbar("#toolbar", { items: [ { type: "search", - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, @@ -182,7 +182,7 @@ new kanban.Toolbar("#toolbar", { - *"Undo"* 및 *"Redo"* 컨트롤이 v1.3에 추가되었습니다. - **sort** 컨트롤의 ***items.options[0].label*** 매개변수가 v1.4에서 ***items.options[0].text*** 매개변수로 변경되었습니다. -- **"search"** 컨트롤의 ***items.searchResult*** 매개변수가 v1.6에 추가되었습니다. +- **"search"** 컨트롤의 ***items.resultTemplate*** 매개변수가 v1.6에 추가되었습니다. **관련 문서:** [구성](guides/configuration.md#toolbar) 및 [커스터마이징](guides/customization.md#custom-toolbar) diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md b/i18n/ko/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md index b9256ab6..e4322c11 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md +++ b/i18n/ko/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md @@ -6,11 +6,15 @@ description: DHTMLX JavaScript Kanban 라이브러리 문서에서 JavaScript Ka # RestDataProvider 메서드 -| 이름 | 설명 | -| ------------------------------------------------------------ | ----------------------------------------------------------------- | -| [](api/provider/rest_methods/js_kanban_getcards_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcards_method.md) | -| [](api/provider/rest_methods/js_kanban_getcolumns_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcolumns_method.md)| -| [](api/provider/rest_methods/js_kanban_getlinks_method.md) | @getshort(api/provider/rest_methods/js_kanban_getlinks_method.md) | -| [](api/provider/rest_methods/js_kanban_getrows_method.md) | @getshort(api/provider/rest_methods/js_kanban_getrows_method.md) | -| [](api/provider/rest_methods/js_kanban_getusers_method.md) | @getshort(api/provider/rest_methods/js_kanban_getusers_method.md) | -| [](api/provider/rest_methods/js_kanban_send_method.md) | @getshort(api/provider/rest_methods/js_kanban_send_method.md) | \ No newline at end of file +| 이름 | 설명 | +| --------------------------------------------------------------- | --------------------------------------------------------------------- | +| [](api/provider/rest_methods/js_kanban_getcards_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcards_method.md) | +| [](api/provider/rest_methods/js_kanban_getcolumns_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcolumns_method.md) | +| [](api/provider/rest_methods/js_kanban_gethandlers_method.md) | @getshort(api/provider/rest_methods/js_kanban_gethandlers_method.md) | +| [](api/provider/rest_methods/js_kanban_getidresolver_method.md) | @getshort(api/provider/rest_methods/js_kanban_getidresolver_method.md)| +| [](api/provider/rest_methods/js_kanban_getlinks_method.md) | @getshort(api/provider/rest_methods/js_kanban_getlinks_method.md) | +| [](api/provider/rest_methods/js_kanban_getqueue_method.md) | @getshort(api/provider/rest_methods/js_kanban_getqueue_method.md) | +| [](api/provider/rest_methods/js_kanban_getrows_method.md) | @getshort(api/provider/rest_methods/js_kanban_getrows_method.md) | +| [](api/provider/rest_methods/js_kanban_getusers_method.md) | @getshort(api/provider/rest_methods/js_kanban_getusers_method.md) | +| [](api/provider/rest_methods/js_kanban_send_method.md) | @getshort(api/provider/rest_methods/js_kanban_send_method.md) | +| [](api/provider/rest_methods/js_kanban_setheaders_method.md) | @getshort(api/provider/rest_methods/js_kanban_setheaders_method.md) | diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md b/i18n/ko/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md index dcc28bb7..304a18a0 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md +++ b/i18n/ko/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md @@ -20,6 +20,7 @@ description: DHTMLX JavaScript Kanban 라이브러리 문서에서 JavaScript Ka | [](api/config/js_kanban_currentuser_config.md) | @getshort(api/config/js_kanban_currentuser_config.md) | | [](api/config/js_kanban_editor_config.md) | @getshort(api/config/js_kanban_editor_config.md) | | [](api/config/js_kanban_editorshape_config.md) | @getshort(api/config/js_kanban_editorshape_config.md) | +| [](api/config/js_kanban_getcardheight_config.md) | @getshort(api/config/js_kanban_getcardheight_config.md) | | [](api/config/js_kanban_history_config.md) | @getshort(api/config/js_kanban_history_config.md) | | [](api/config/js_kanban_links_config.md) | @getshort(api/config/js_kanban_links_config.md) | | [](api/config/js_kanban_locale_config.md) | @getshort(api/config/js_kanban_locale_config.md) | @@ -28,4 +29,4 @@ description: DHTMLX JavaScript Kanban 라이브러리 문서에서 JavaScript Ka | [](api/config/js_kanban_rowkey_config.md) | @getshort(api/config/js_kanban_rowkey_config.md) | | [](api/config/js_kanban_rows_config.md) | @getshort(api/config/js_kanban_rows_config.md) | | [](api/config/js_kanban_rowshape_config.md) | @getshort(api/config/js_kanban_rowshape_config.md) | -| [](api/config/js_kanban_scrolltype_config.md) | @getshort(api/config/js_kanban_scrolltype_config.md) | \ No newline at end of file +| [](api/config/js_kanban_scrolltype_config.md) | @getshort(api/config/js_kanban_scrolltype_config.md) | diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_gethandlers_method.md b/i18n/ko/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_gethandlers_method.md new file mode 100644 index 00000000..fe3b49e1 --- /dev/null +++ b/i18n/ko/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_gethandlers_method.md @@ -0,0 +1,54 @@ +--- +sidebar_label: getHandlers() +title: getHandlers REST 메서드 +description: DHTMLX JavaScript Kanban 라이브러리 문서에서 getHandlers REST 메서드에 대해 알아볼 수 있습니다. 개발자 가이드와 API 레퍼런스를 살펴보고, 코드 예제와 라이브 데모를 체험해 보세요. DHTMLX Kanban의 30일 무료 평가판을 다운로드하실 수도 있습니다. +--- + +# getHandlers() + +### 설명 + +@short: RestDataProvider가 서버에 데이터 작업을 전송할 때 사용하는 기본 액션 핸들러를 반환합니다 + +:::info +**getHandlers()** 메서드는 서버 연동을 위한 **RestDataProvider** 서비스의 일부입니다. +::: + +### 사용법 + +~~~jsx {} +getHandlers(): object; +~~~ + +### 반환값 + +`getHandlers()` 메서드는 [`RestDataProvider`가 지원하는 데이터 작업](guides/working_with_server.md/#restdataprovider)을 서버로 전송하는 요청에 매핑한 객체를 반환합니다. + +반환된 객체는 `RestDataProvider` 내부에서 사용하는 기본 액션 맵입니다. 이 메서드를 오버라이드하여 커스텀 핸들러를 추가하거나 기본 핸들러를 커스텀 로직으로 교체할 수 있습니다. + +### 예제 + +기본 핸들러에 커스텀 핸들러를 추가하려면 `RestDataProvider`를 상속하는 클래스를 만들고 `getHandlers()`를 오버라이드합니다. 기본 핸들러를 유지하려면 오버라이드 내에서 반드시 `super.getHandlers()`를 호출하세요. + +~~~jsx {3-11} +const url = "https://some_backend_url"; + +class MyDataProvider extends kanban.RestDataProvider { + getHandlers() { + const handlers = super.getHandlers(); + return { + ...handlers, + // custom or overridden handlers go here + }; + } +} + +const restProvider = new MyDataProvider(url); +board.api.setNext(restProvider); +~~~ + +:::warning +기본 핸들러를 오버라이드에 수동으로 복사하지 마세요. 기본 액션 맵의 내용은 버전마다 변경될 수 있습니다. `super.getHandlers()`를 호출하면 커스텀 핸들러가 항상 현재 기본값 위에 병합되는 것이 보장됩니다. +::: + +**관련 문서:** [서버와 함께 작업하기](guides/working_with_server.md) diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getidresolver_method.md b/i18n/ko/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getidresolver_method.md new file mode 100644 index 00000000..811cc9ca --- /dev/null +++ b/i18n/ko/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getidresolver_method.md @@ -0,0 +1,58 @@ +--- +sidebar_label: getIDResolver() +title: getIDResolver REST 메서드 +description: DHTMLX JavaScript Kanban 라이브러리 문서에서 getIDResolver REST 메서드에 대해 알아볼 수 있습니다. 개발자 가이드와 API 레퍼런스를 살펴보고, 코드 예제와 라이브 데모를 체험해 보세요. DHTMLX Kanban 무료 30일 평가판도 다운로드할 수 있습니다. +--- + +# getIDResolver() + +### 설명 + +@short: 임시 클라이언트 측 ID를 백엔드 ID로 변환하는 함수를 반환합니다 + +:::info +`getIDResolver()` 메서드는 서버와 연동하기 위한 **RestDataProvider** 서비스의 일부입니다. +::: + +### 사용법 + +~~~jsx {} +getIDResolver(): (id: string | number, type: number) => string | number; +~~~ + +### 반환값 + +이 메서드는 `idResolver(id, type)` 함수를 반환합니다: + +- `id` — 변환할 엔티티 ID (임시 클라이언트 측 ID 또는 일반 ID) +- `type` — ID가 속한 모델 타입: + - `1` — 카드 (`CardID`) + - `2` — 행 (`RowID`) + - `3` — 열 (`ColumnID`) + - `4` — 링크 (`LinkID`) + - `5` — 댓글 (`CommentID`) + +클라이언트에서 새 엔티티(카드, 열, 행, 링크, 댓글)를 생성할 때, `RestDataProvider`는 임시 클라이언트 측 ID를 할당하고 서버에서 반환한 백엔드 ID를 기억합니다. `idResolver(id, type)` 함수는 보유 중인 임시 ID에 대해 백엔드 ID를 반환합니다. 이미 백엔드 ID와 일치하는 ID의 경우 변환 없이 그대로 반환합니다. + +### 예제 + +가장 일반적인 사용 사례는 멀티유저 환경에서 `RestDataProvider`를 `kanbanUpdates`에 연결하는 것입니다. 이를 통해 백엔드 ID를 대상으로 하는 서버 이벤트가 임시 ID로 클라이언트에 존재하는 엔티티에 올바르게 적용됩니다: + +~~~jsx {6-9} +const url = "https://some_backend_url"; +const restProvider = new kanban.RestDataProvider(url); + +// other initialization... + +const handlers = kanbanUpdates( + board.api, + restProvider.getIDResolver() +); + +const events = new kanban.RemoteEvents(url + "/api/v1", token); +events.on(handlers); +~~~ + +동일한 resolver 함수를 `RemoteEvents.on()`에 전달하는 커스텀 핸들러 내부에서도 사용할 수 있습니다. 전체 예제는 [서버 이벤트 커스터마이즈](guides/working_with_server.md/#customize-server-events)를 참조하세요. + +**관련 문서:** [서버와 연동하기: 멀티유저 백엔드](guides/working_with_server.md/#multiuser-backend) diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getqueue_method.md b/i18n/ko/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getqueue_method.md new file mode 100644 index 00000000..aae75971 --- /dev/null +++ b/i18n/ko/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getqueue_method.md @@ -0,0 +1,34 @@ +--- +sidebar_label: getQueue() +title: getQueue REST 메서드 +description: DHTMLX JavaScript Kanban 라이브러리 문서에서 getQueue REST 메서드에 대해 알아볼 수 있습니다. 개발자 가이드 및 API 레퍼런스를 살펴보고, 코드 예제와 라이브 데모를 확인하며, DHTMLX Kanban 30일 무료 평가판을 다운로드하세요. +--- + +# getQueue() + +### 설명 + +@short: RestDataProvider가 처리하는 작업의 내부 큐를 반환합니다 + +:::info +`getQueue()` 메서드는 서버 작업을 위한 **RestDataProvider** 서비스의 일부입니다. +::: + +### 사용법 + +~~~jsx {} +getQueue(): object; +~~~ + +### 반환값 + +이 메서드는 `RestDataProvider`가 서버로 전송되는 데이터 작업을 처리하는 데 사용하는 내부 `ActionQueue` 인스턴스를 반환합니다. 큐는 다음을 담당합니다: + +- 보류 중인 요청이 완료될 때까지 작업을 버퍼링 +- 새로 생성된 엔티티에 임시 클라이언트 측 ID를 할당하고, 서버가 응답하면 백엔드 ID로 교체 + +큐는 `RestDataProvider`의 다른 메서드에서 내부적으로 사용됩니다. 가장 일반적인 간접 사용은 큐의 ID 해석 로직을 기반으로 구축된 [`getIDResolver()`](api/provider/rest_methods/js_kanban_getidresolver_method.md)를 통해 이루어집니다. + +일반적으로 `getQueue()`를 직접 호출할 필요는 없습니다. 클라이언트와 서버 간의 고급 사용자 정의 동기화를 구현하는 경우와 같이 큐에 세밀한 접근이 필요할 때만 이 메서드를 사용하세요. + +**관련 문서:** [서버와 함께 작업하기](guides/working_with_server.md) diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_setheaders_method.md b/i18n/ko/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_setheaders_method.md new file mode 100644 index 00000000..87da081a --- /dev/null +++ b/i18n/ko/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_setheaders_method.md @@ -0,0 +1,42 @@ +--- +sidebar_label: setHeaders() +title: setHeaders REST 메서드 +description: DHTMLX JavaScript Kanban 라이브러리 문서에서 setHeaders REST 메서드에 대해 알아볼 수 있습니다. 개발자 가이드와 API 레퍼런스를 살펴보고, 코드 예제와 라이브 데모를 직접 확인하며, DHTMLX Kanban의 무료 30일 평가판을 다운로드하세요. +--- + +# setHeaders() + +### 설명 + +@short: RestDataProvider가 서버로 보내는 모든 요청에 첨부할 사용자 정의 HTTP 헤더를 설정합니다 + +:::info +`setHeaders()` 메서드는 서버와의 통신을 위한 **RestDataProvider** 서비스의 일부입니다. +::: + +### 사용법 + +~~~jsx {} +setHeaders(headers: object): void; +~~~ + +### 매개변수 + +- `headers` - (필수) 키가 헤더 이름이고 값이 헤더 값인 객체입니다. 이 헤더들은 [`send()`](api/provider/rest_methods/js_kanban_send_method.md)를 통해 전송되는 모든 요청에서 기본 `Content-Type: application/json` 헤더에 추가됩니다. + +### 예제 + +가장 일반적인 사용 사례는 모든 요청에 인증 토큰을 첨부하는 것입니다: + +~~~jsx {4-6} +const url = "https://some_backend_url"; +const restProvider = new kanban.RestDataProvider(url); + +restProvider.setHeaders({ + "Remote-Token": "eyJpZCI6IjEzMzciLCJ1c2VybmFtZSI6ImJpem9uZSIsImlhdC...", +}); +~~~ + +모든 요청이 아닌 특정 요청에만 헤더를 설정하려면, 대신 [`send()`](api/provider/rest_methods/js_kanban_send_method.md)의 네 번째 인수로 헤더를 전달하세요. + +**관련 문서:** [서버와 함께 작업하기: 멀티유저 백엔드](guides/working_with_server.md/#multiuser-backend) diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/guides/configuration.md b/i18n/ko/docusaurus-plugin-content-docs/current/guides/configuration.md index f03640ea..df570600 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/guides/configuration.md +++ b/i18n/ko/docusaurus-plugin-content-docs/current/guides/configuration.md @@ -465,7 +465,7 @@ new kanban.Kanban("#root", { }); ~~~ -## 렌더링 및 스크롤 +## 렌더링 및 스크롤 {#rendering-and-scrolling} Kanban 위젯은 기본적으로 모든 카드를 렌더링하고 전체 보드를 스크롤합니다. 카드가 많은 보드의 경우 지연 렌더링 또는 컬럼별 스크롤로 전환할 수 있습니다: @@ -487,6 +487,8 @@ new kanban.Kanban("#root", { :::important `renderType: "lazy"`와 `scrollType`을 함께 사용하는 경우, [`cardHeight`](api/config/js_kanban_cardheight_config.md) 속성으로 카드의 고정 높이를 설정하세요. `cardHeight` 없이는 지연 렌더링이 카드를 올바르게 표시하지 않습니다. + +`renderType: "lazy"`와 `scrollType: "column"`을 함께 사용하면서 `cardHeight`를 생략하면, 위젯은 [`cardShape`](api/config/js_kanban_cardshape_config.md)의 표시 필드를 기반으로 카드 높이를 실험적으로 근사합니다. 커스텀 [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md)을 사용하는 보드에서는 위젯이 렌더링 높이를 예측할 수 없으므로, 예상 카드 높이를 반환하는 커스텀 [`getCardHeight(cardShape, card, cardWidth)`](api/config/js_kanban_getcardheight_config.md) 함수를 제공하세요. ::: ## 변경 기록 @@ -554,10 +556,10 @@ new kanban.Toolbar("#toolbar", { } } ], - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/guides/working_with_server.md b/i18n/ko/docusaurus-plugin-content-docs/current/guides/working_with_server.md index d561edf5..e2975e1d 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/guides/working_with_server.md +++ b/i18n/ko/docusaurus-plugin-content-docs/current/guides/working_with_server.md @@ -38,14 +38,47 @@ JavaScript Kanban에는 백엔드와의 통신을 위한 REST API를 완벽하 ## REST 메서드 -`RestDataProvider` 서비스는 동적 데이터 로딩을 위한 다음과 같은 REST 메서드를 제공합니다: +`RestDataProvider` 서비스는 다음과 같은 REST 메서드를 제공합니다: - [`getCards()`](api/provider/rest_methods/js_kanban_getcards_method.md) — ***카드 데이터***에 대한 promise를 반환합니다 - [`getColumns()`](api/provider/rest_methods/js_kanban_getcolumns_method.md) — ***컬럼 데이터***에 대한 promise를 반환합니다 +- [`getHandlers()`](api/provider/rest_methods/js_kanban_gethandlers_method.md) — provider가 사용하는 기본 액션 핸들러를 반환합니다 +- [`getIDResolver()`](api/provider/rest_methods/js_kanban_getidresolver_method.md) — 임시 클라이언트 ID를 백엔드 ID로 변환하는 함수를 반환합니다 - [`getLinks()`](api/provider/rest_methods/js_kanban_getlinks_method.md) — ***링크 데이터***에 대한 promise를 반환합니다 +- [`getQueue()`](api/provider/rest_methods/js_kanban_getqueue_method.md) — provider가 처리하는 액션의 내부 큐를 반환합니다 - [`getRows()`](api/provider/rest_methods/js_kanban_getrows_method.md) — ***행 데이터***에 대한 promise를 반환합니다 - [`getUsers()`](api/provider/rest_methods/js_kanban_getusers_method.md) — ***사용자 데이터***에 대한 promise를 반환합니다 - [`send()`](api/provider/rest_methods/js_kanban_send_method.md) — 커스텀 HTTP 요청을 전송하고 promise를 반환합니다 +- [`setHeaders()`](api/provider/rest_methods/js_kanban_setheaders_method.md) — 모든 요청에 첨부할 커스텀 HTTP 헤더를 설정합니다 + +## RestDataProvider 커스터마이징 + +`RestDataProvider`가 서버에 데이터 작업을 전송하는 방식을 커스터마이징하려면, 클래스를 확장하고 메서드를 오버라이드하세요. 대부분의 경우, 커스터마이징은 기본 액션 핸들러를 대상으로 합니다 — 예를 들어, 커스텀 이벤트에 대한 핸들러를 추가하거나 기존 작업의 payload를 확장하는 경우입니다. + +기본 핸들러를 유지하면서 커스텀 핸들러를 추가하려면, [`getHandlers()`](api/provider/rest_methods/js_kanban_gethandlers_method.md)를 오버라이드하고 `super.getHandlers()`의 결과 위에 커스텀 항목을 병합하세요: + +~~~js {3-11} +const url = "https://some_backend_url"; + +class MyDataProvider extends kanban.RestDataProvider { + getHandlers() { + const handlers = super.getHandlers(); + return { + ...handlers, + // custom or overridden handlers go here + }; + } +} + +const restProvider = new MyDataProvider(url); +board.api.setNext(restProvider); +~~~ + +:::warning +오버라이드에서는 항상 `super.getHandlers()`를 호출하고 그 결과를 spread하세요. 기본 핸들러를 오버라이드에 직접 복사하지 마세요 — 액션 맵은 버전마다 변경될 수 있으므로, 하드코딩된 복사본은 현재 기본값과 조용히 동기화가 깨질 수 있습니다. +::: + +또 다른 일반적인 커스터마이징 대상은 [`send()`](api/provider/rest_methods/js_kanban_send_method.md) 메서드입니다. 이 메서드는 모든 기본 핸들러에서 호출됩니다. `send()`를 오버라이드하면 추가 헤더를 주입하거나, URL을 재작성하거나, 모든 서버 요청에 커스텀 로직을 적용할 수 있습니다. ## 백엔드와의 상호작용 @@ -101,7 +134,7 @@ Promise.all([ -## 다중 사용자 백엔드 +## 다중 사용자 백엔드 {#multiuser-backend} 다중 사용자 백엔드를 사용하면 여러 사용자가 페이지를 새로 고침하지 않고도 동일한 Kanban 보드를 실시간으로 편집할 수 있습니다. 위젯은 WebSocket을 통해 서버에 연결하며, 커스텀 핸들러가 수신된 변경 사항을 Kanban 보드에 적용합니다. @@ -196,7 +229,7 @@ events.on(handlers); -## 서버 이벤트 커스터마이징 +## 서버 이벤트 커스터마이징 {#customize-server-events} 서버 이벤트에 대한 커스텀 로직을 정의하려면, `handlers` 객체를 `RemoteEvents.on(handlers)`에 전달하세요. 객체의 구조는 다음과 같습니다: @@ -289,7 +322,7 @@ remoteEvents.on(handlers); ### 서버에서 그룹화 {#group-on-the-server} -서버 사이드 그룹화를 구현하려면, 서버가 [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)를 통해 클라이언트에 데이터를 전송할 수 있어야 합니다([다중 사용자 백엔드](#다중-사용자-백엔드) 참고). +서버 사이드 그룹화를 구현하려면, 서버가 [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)를 통해 클라이언트에 데이터를 전송할 수 있어야 합니다([다중 사용자 백엔드](#multiuser-backend) 참고). 서버에서 카드 업데이트 쿼리를 처리할 때 `status` 필드를 확인하세요. 아래 예제는 [Go](https://go.dev/)를 사용하지만, 다른 백엔드 기술도 사용할 수 있습니다. diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/news/whats_new.md b/i18n/ko/docusaurus-plugin-content-docs/current/news/whats_new.md index a61954a3..c64576fb 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/news/whats_new.md +++ b/i18n/ko/docusaurus-plugin-content-docs/current/news/whats_new.md @@ -158,7 +158,7 @@ v1.7부터 JavaScript Kanban을 Salesforce 환경에서 사용할 수 있습니 - [`cardShape.users.maxCount`](api/config/js_kanban_cardshape_config.md) 속성을 통해 카드에 표시되는 할당 사용자 수를 변경할 수 있음 ([**예제**](https://snippet.dhtmlx.com/w205dvzg?tag=kanban) 참고) - [`columnShape`](api/config/js_kanban_columnshape_config.md) 속성을 통해 컬럼 헤더의 내용을 변경할 수 있음 ([**예제**](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban) 참고) -- 툴바 **search** 컨트롤의 [`items.searchResult`](api/config/toolbar_items_config.md) 속성을 통해 검색 결과의 보기 및 내용을 변경할 수 있음 ([**예제**](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban) 참고) +- 툴바 **search** 컨트롤의 [`items.resultTemplate`](api/config/toolbar_items_config.md) 속성을 통해 검색 결과의 보기 및 내용을 변경할 수 있음 ([**예제**](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban) 참고) - [`editor.placement`](api/config/js_kanban_editor_config.md) 속성을 통해 에디터를 모달 창으로 표시할 수 있음 ([**예제**](https://snippet.dhtmlx.com/vt6pe7qz?tag=kanban) 참고) - [`cardShape.votes.clickable`](api/config/js_kanban_cardshape_config.md) 속성을 통해 카드에 투표 기능을 활성화할 수 있음 ([**예제**](https://snippet.dhtmlx.com/en76xvi4?tag=kanban) 참고) @@ -169,7 +169,8 @@ v1.7부터 JavaScript Kanban을 Salesforce 환경에서 사용할 수 있습니 - [`cardShape`](api/config/js_kanban_cardshape_config.md) 속성에 ***users.maxCount*** 및 ***votes.clickable*** 파라미터가 추가됨 - [`columnShape`](api/config/js_kanban_columnshape_config.md) 속성에 ***headerTemplate*** 및 ***collapsedTemplate*** 파라미터가 추가됨 - [`editor`](api/config/js_kanban_editor_config.md) 속성에 ***placement*** 파라미터가 추가됨 - - 툴바 **search** 컨트롤의 [`items`](api/config/toolbar_items_config.md) 속성에 ***searchResult*** 파라미터가 추가됨 + - [`editorShape`](api/config/js_kanban_editorshape_config.md) 속성에 ***modalSection*** 파라미터가 추가됨 + - 툴바 **search** 컨트롤의 [`items`](api/config/toolbar_items_config.md) 속성에 ***resultTemplate*** 파라미터가 추가됨 - #### 이벤트 diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/.sync b/i18n/ru/docusaurus-plugin-content-docs/current/.sync index 0337ab75..a10bd810 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/.sync +++ b/i18n/ru/docusaurus-plugin-content-docs/current/.sync @@ -1 +1 @@ -f55b2fb6832c9d6955cfb66b8e5734aa93ffa3d3 +943f1d77abd087cfa70fc9f4a148239ebcae9d9a diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md b/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md index e4814cc2..60e38e66 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md +++ b/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md @@ -19,6 +19,8 @@ cardHeight?: number; // px :::important Если вы используете настройки [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) и [`scrollType: "default"`](api/config/js_kanban_scrolltype_config.md) одновременно, не забудьте указать статическую высоту карточек через свойство `cardHeight`. Если не указать, карточки не будут отображаться. Если вы используете [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) с [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md), также рекомендуется зафиксировать высоту карточек через свойство `cardHeight`. Хотя для такого типа лейаута поддерживается переменная высота карточек, скролл может некорректно работать с кастомизациями карточек. + +Если `cardHeight` не задан, виджет использует экспериментальное приближение высоты карточек на основе видимых полей, объявленных в [`cardShape`](api/config/js_kanban_cardshape_config.md). При использовании кастомного [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md) это приближение не применяется — в таком случае либо задайте `cardHeight` явно, либо передайте кастомную функцию [`getCardHeight`](api/config/js_kanban_getcardheight_config.md). ::: ### Пример diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md b/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md index e6682c3d..1e9d9dcf 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md +++ b/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md @@ -30,17 +30,17 @@ columnShape?: { }, fixedHeaders?: boolean, css?: (column, cards) => string, - headerTemplate?: template(column => { + headerTemplate?: template(props => { return "HTML-шаблон заголовка колонки в развернутом состоянии"; }), - collapsedTemplate?: template(column => { + collapsedTemplate?: template(props => { return "HTML-шаблон заголовка колонки в свернутом состоянии"; }), confirmDeletion?: boolean }; ~~~ -### Параметры +### Параметры {#parameters} Для настройки внешнего вида колонок в объекте **columnShape** можно указать следующие параметры: @@ -94,8 +94,28 @@ columnShape?: { - `fixedHeaders` - (необязательно) фиксирует заголовки колонок при вертикальной прокрутке (*true* по умолчанию). Прокрутка должна быть включена в самом Kanban (высота должна быть ограничена) - `css` - (необязательно) функция, возвращающая CSS-класс, который применяется к колонкам условно -- `headerTemplate` - (необязательно) HTML-шаблон заголовка колонки в развернутом состоянии -- `collapsedTemplate` - (необязательно) HTML-шаблон заголовка колонки в свернутом состоянии +- `headerTemplate` - (необязательно) HTML-шаблон заголовка колонки в развернутом состоянии. Функция получает объект `props` со следующими свойствами: + - `column` - (object) данные колонки (структуру см. в [`columns`](api/config/js_kanban_columns_config.md)) + - `columnState` - (object) текущее состояние колонки. Всегда включает: + - ***columnId*** - (string | number) ID колонки + - ***column*** - (object) данные колонки (то же, что `props.column`) + - ***cardsCount*** - (number) количество карточек в колонке + - ***noFreeSpace*** - (boolean) ***true***, если колонка не может принять больше карточек + + Если задан параметр [`columns[i].limit`](api/config/js_kanban_columns_config.md), также включает: + - ***totalLimit*** - (number) настроенный лимит карточек + - ***isOverLimit*** - (boolean) ***true***, если количество карточек превышает лимит + + Если колонка принадлежит строке (swimlane), также включает: + - ***rowId*** - (string | number) ID строки + - ***row*** - (object) данные строки (структуру см. в [`rows`](api/config/js_kanban_rows_config.md)) + - ***height*** - (number) высота области + - `isMenuVisible` - (boolean) ***true***, если меню должно отображаться для данного заголовка колонки + - `renaming` - (boolean) ***true***, если активен режим редактирования названия колонки + - `readonly` - (boolean) ***true***, если редактирование колонки отключено (эквивалент `!readonly.edit`, см. свойство [`readonly`](api/config/js_kanban_readonly_config.md)) +- `collapsedTemplate` - (необязательно) HTML-шаблон заголовка колонки в свернутом состоянии. Функция получает объект `props` со следующими свойствами: + - `column` - (object) данные колонки (структуру см. в [`columns`](api/config/js_kanban_columns_config.md)) + - `columnState` - (object) текущее состояние колонки. Структура аналогична `columnState` в параметре [`headerTemplate`](#parameters) выше - `confirmDeletion` - (необязательно) отображает/скрывает **диалог подтверждения**, который позволяет пользователям подтвердить или отклонить удаление колонки ### Конфигурация по умолчанию @@ -160,30 +180,30 @@ const columnShape = { }, fixedHeaders: false, css: (column, cards) => column.id == "inprogress" && cards.length < 5 ? "green" : "red", - headerTemplate: template(column => { + headerTemplate: template(props => { return `
- +
${ - !column.column.collapsed + !props.column.collapsed ? `
- ${escapeHTML(column.column.label)} - (${column.columnState.cardsCount}) + ${escapeHTML(props.column.label)} + (${props.columnState.cardsCount})
` : "" } ${ - !column.column.collapsed - ? `
+ !props.column.collapsed + ? `
` : "" }`; }), - collapsedTemplate: template(column => { + collapsedTemplate: template(props => { return `
-
${escapeHTML(column.column.label)} (${ - column.columnState?.cardsCount +
${escapeHTML(props.column.label)} (${ + props.columnState?.cardsCount })
`; }), @@ -213,4 +233,4 @@ new kanban.Kanban("#root", { **Связанные примеры:** - [Kanban. Изменение цвета колонки через кастомное меню](https://snippet.dhtmlx.com/fnlvd2g5?tag=kanban) - [Kanban. Фиксированные заголовки, ленивый рендеринг и прокрутка колонок](https://snippet.dhtmlx.com/xez9ghqq?tag=kanban) -- [Kanban. Шаблон для заголовков колонок](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban) \ No newline at end of file +- [Kanban. Шаблон для заголовков колонок](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban) diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md b/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md index e0d12f7e..e79a4a56 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md +++ b/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md @@ -19,6 +19,7 @@ editorShape?: [ type: string, key: string, label?: string, + modalSection?: "left" | "right", // только для типа "dateRange" key: { @@ -182,6 +183,9 @@ editorShape?: [ ~~~ - `label` - (необязательно) метка поля редактора +- `modalSection` - (необязательно) определяет, в какой колонке модального редактора размещается поле. Применяется только когда редактор отображается как модальное окно через свойство [`editor.placement: "modal"`](api/config/js_kanban_editor_config.md). Возможные значения: + - `"left"` - поле размещается в левой колонке + - `"right"` - поле размещается в правой колонке (по умолчанию) #### - Параметры для типа "dateRange" @@ -466,6 +470,7 @@ new kanban.Kanban("#root", { - Тип ***dateRange*** добавлен в версии v1.3 - Типы редактора ***comments*** и ***links***, а также параметр ***format*** добавлены в версии v1.4 +- Параметр ***modalSection*** добавлен в версии v1.6 - Параметр ***clearButton*** заменён на ***clear*** **Связанные статьи:** [Конфигурация](guides/configuration.md/#editor) diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md b/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md index dd4abd6b..ccdcc3f3 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md +++ b/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md @@ -23,6 +23,8 @@ renderType?: "default" | "lazy"; :::important Если вы используете настройки `renderType: "lazy"` и [`scrollType: "default"`](api/config/js_kanban_scrolltype_config.md) вместе, не забудьте указать статическую высоту карточек через свойство [`cardHeight`](api/config/js_kanban_cardheight_config.md). Если этого не сделать, карточки будут отображаться некорректно. Если вы используете `renderType: "lazy"` с [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md), мы советуем также фиксировать высоту карточек через свойство [`cardHeight`](api/config/js_kanban_cardheight_config.md). Хотя переменная высота карточек поддерживается для такого типа лейаута, скролл может работать нестабильно с кастомным содержимым карточек. + +Если `cardHeight` не задан, виджет использует экспериментальный механизм приближённого расчёта высоты карточек на основе [`cardShape`](api/config/js_kanban_cardshape_config.md). Для досок с кастомным [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md) следует передать собственную функцию [`getCardHeight`](api/config/js_kanban_getcardheight_config.md). ::: ### Конфигурация по умолчанию diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md b/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md index a540878b..c0f86809 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md +++ b/i18n/ru/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md @@ -29,6 +29,8 @@ scrollType: "default" :::important Если вы комбинируете настройки [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) и `scrollType: "default"`, не забудьте указать статическую высоту для карточек через свойство [`cardHeight`](api/config/js_kanban_cardheight_config.md). Если не указать высоту, карточки не будут отображаться. Если вы используете [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) и `scrollType: "column"`, мы советуем также фиксировать высоту карточек через свойство [`cardHeight`](api/config/js_kanban_cardheight_config.md). Хотя для этого типа лейаута поддерживается переменная высота карточек, скролл может работать нестабильно с кастомным содержимым карточек. + +Если `cardHeight` не задан, виджет использует экспериментальное приближение высоты карточек на основе [`cardShape`](api/config/js_kanban_cardshape_config.md). Для досок с кастомным [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md) вместо этого передайте кастомную функцию [`getCardHeight`](api/config/js_kanban_getcardheight_config.md). ::: ### Пример diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md b/i18n/ru/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md index d49a6a28..6e7abcaf 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md +++ b/i18n/ru/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md @@ -26,8 +26,8 @@ items?: [ } }, {...} ], - resultTemplate?: template(searchResult => { - return "HTML-шаблон результата поиска"; + resultTemplate?: template(({ result }) => { + return `HTML template using ${result.label}`; }) }, "sort" | { @@ -93,10 +93,10 @@ items: [ } } ], - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, @@ -161,10 +161,10 @@ new kanban.Toolbar("#toolbar", { items: [ { type: "search", - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, @@ -182,10 +182,10 @@ new kanban.Toolbar("#toolbar", { - Элементы *"Undo"* и *"Redo"* были добавлены в версии v1.3 - Параметр ***items.options[0].label*** элемента **sort** был заменён на ***items.options[0].text*** в версии v1.4 -- Параметр ***items.searchResult*** элемента **"search"** был добавлен в версии v1.6 +- Параметр ***items.resultTemplate*** элемента **"search"** был добавлен в версии v1.6 **Связанные статьи:** [Конфигурация](guides/configuration.md#toolbar) и [Настройка](guides/customization.md#custom-toolbar) **Связанные примеры:** - [Kanban. Пользовательский Toolbar](https://snippet.dhtmlx.com/s5r5h4ju?tag=kanban) -- [Kanban. Настройка подсказок в результатах поиска](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban) \ No newline at end of file +- [Kanban. Настройка подсказок в результатах поиска](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban) diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md b/i18n/ru/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md index 7a859931..3c7f0489 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md +++ b/i18n/ru/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md @@ -6,11 +6,15 @@ description: В документации библиотеки DHTMLX JavaScript # Методы RestDataProvider -| Название | Описание | -| ----------------------------------------------------------- | ----------------------------------------------------------------- | -| [](api/provider/rest_methods/js_kanban_getcards_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcards_method.md) | -| [](api/provider/rest_methods/js_kanban_getcolumns_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcolumns_method.md)| -| [](api/provider/rest_methods/js_kanban_getlinks_method.md) | @getshort(api/provider/rest_methods/js_kanban_getlinks_method.md) | -| [](api/provider/rest_methods/js_kanban_getrows_method.md) | @getshort(api/provider/rest_methods/js_kanban_getrows_method.md) | -| [](api/provider/rest_methods/js_kanban_getusers_method.md) | @getshort(api/provider/rest_methods/js_kanban_getusers_method.md) | -| [](api/provider/rest_methods/js_kanban_send_method.md) | @getshort(api/provider/rest_methods/js_kanban_send_method.md) | \ No newline at end of file +| Название | Описание | +| ------------------------------------------------------------------ | --------------------------------------------------------------------- | +| [](api/provider/rest_methods/js_kanban_getcards_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcards_method.md) | +| [](api/provider/rest_methods/js_kanban_getcolumns_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcolumns_method.md) | +| [](api/provider/rest_methods/js_kanban_gethandlers_method.md) | @getshort(api/provider/rest_methods/js_kanban_gethandlers_method.md) | +| [](api/provider/rest_methods/js_kanban_getidresolver_method.md) | @getshort(api/provider/rest_methods/js_kanban_getidresolver_method.md)| +| [](api/provider/rest_methods/js_kanban_getlinks_method.md) | @getshort(api/provider/rest_methods/js_kanban_getlinks_method.md) | +| [](api/provider/rest_methods/js_kanban_getqueue_method.md) | @getshort(api/provider/rest_methods/js_kanban_getqueue_method.md) | +| [](api/provider/rest_methods/js_kanban_getrows_method.md) | @getshort(api/provider/rest_methods/js_kanban_getrows_method.md) | +| [](api/provider/rest_methods/js_kanban_getusers_method.md) | @getshort(api/provider/rest_methods/js_kanban_getusers_method.md) | +| [](api/provider/rest_methods/js_kanban_send_method.md) | @getshort(api/provider/rest_methods/js_kanban_send_method.md) | +| [](api/provider/rest_methods/js_kanban_setheaders_method.md) | @getshort(api/provider/rest_methods/js_kanban_setheaders_method.md) | diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md b/i18n/ru/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md index 6b0927dd..ac7885e9 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md +++ b/i18n/ru/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md @@ -20,6 +20,7 @@ description: В документации по библиотеке DHTMLX JavaSc | [](api/config/js_kanban_currentuser_config.md) | @getshort(api/config/js_kanban_currentuser_config.md) | | [](api/config/js_kanban_editor_config.md) | @getshort(api/config/js_kanban_editor_config.md) | | [](api/config/js_kanban_editorshape_config.md) | @getshort(api/config/js_kanban_editorshape_config.md) | +| [](api/config/js_kanban_getcardheight_config.md) | @getshort(api/config/js_kanban_getcardheight_config.md) | | [](api/config/js_kanban_history_config.md) | @getshort(api/config/js_kanban_history_config.md) | | [](api/config/js_kanban_links_config.md) | @getshort(api/config/js_kanban_links_config.md) | | [](api/config/js_kanban_locale_config.md) | @getshort(api/config/js_kanban_locale_config.md) | diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_gethandlers_method.md b/i18n/ru/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_gethandlers_method.md new file mode 100644 index 00000000..56d18375 --- /dev/null +++ b/i18n/ru/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_gethandlers_method.md @@ -0,0 +1,54 @@ +--- +sidebar_label: getHandlers() +title: getHandlers REST Method +description: В документации по JavaScript-библиотеке DHTMLX Kanban можно узнать о REST-методе getHandlers. Изучайте руководства разработчика и справочник АПИ, запускайте примеры кода и живые демо, скачайте бесплатную 30-дневную ознакомительную версию DHTMLX Kanban. +--- + +# getHandlers() + +### Описание + +@short: Возвращает обработчики действий по умолчанию, используемые RestDataProvider для отправки операций с данными на сервер + +:::info +Метод **getHandlers()** является частью сервиса **RestDataProvider**, предназначенного для работы с сервером. +::: + +### Применение + +~~~jsx {} +getHandlers(): object; +~~~ + +### Возвращаемое значение + +Метод `getHandlers()` возвращает объект, который сопоставляет [операции с данными, поддерживаемые `RestDataProvider`](guides/working_with_server.md/#restdataprovider), с запросами, которые провайдер отправляет на сервер. + +Возвращаемый объект — это карта действий по умолчанию, используемая внутри `RestDataProvider`. Переопределите этот метод, чтобы добавить собственные обработчики или заменить стандартные на пользовательскую логику. + +### Пример + +Чтобы расширить обработчики по умолчанию собственными, создайте класс, наследующий `RestDataProvider`, и переопределите `getHandlers()`. Всегда вызывайте `super.getHandlers()` из переопределённого метода, чтобы сохранить обработчики по умолчанию: + +~~~jsx {3-11} +const url = "https://some_backend_url"; + +class MyDataProvider extends kanban.RestDataProvider { + getHandlers() { + const handlers = super.getHandlers(); + return { + ...handlers, + // custom or overridden handlers go here + }; + } +} + +const restProvider = new MyDataProvider(url); +board.api.setNext(restProvider); +~~~ + +:::warning +Не копируйте обработчики по умолчанию в переопределение вручную. Содержимое карты действий по умолчанию может меняться между версиями; вызов `super.getHandlers()` гарантирует, что ваши пользовательские обработчики будут объединены поверх актуальных значений по умолчанию. +::: + +**Связанные статьи:** [Работа с сервером](guides/working_with_server.md) diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getidresolver_method.md b/i18n/ru/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getidresolver_method.md new file mode 100644 index 00000000..74b5629f --- /dev/null +++ b/i18n/ru/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getidresolver_method.md @@ -0,0 +1,58 @@ +--- +sidebar_label: getIDResolver() +title: getIDResolver REST Method +description: В документации по JavaScript-библиотеке DHTMLX Kanban вы можете узнать о REST-методе getIDResolver. Изучайте руководства для разработчиков и справочник АПИ, просматривайте примеры кода и живые демо, а также загружайте бесплатную 30-дневную ознакомительную версию DHTMLX Kanban. +--- + +# getIDResolver() + +### Описание + +@short: Возвращает функцию, которая преобразует временные клиентские ID в серверные ID + +:::info +Метод `getIDResolver()` является частью сервиса **RestDataProvider**, предназначенного для работы с сервером. +::: + +### Использование + +~~~jsx {} +getIDResolver(): (id: string | number, type: number) => string | number; +~~~ + +### Возвращаемое значение + +Метод возвращает функцию `idResolver(id, type)`: + +- `id` — ID сущности для преобразования (временный клиентский ID или обычный ID) +- `type` — тип модели, которому принадлежит ID: + - `1` — карточка (`CardID`) + - `2` — строка (`RowID`) + - `3` — колонка (`ColumnID`) + - `4` — связь (`LinkID`) + - `5` — комментарий (`CommentID`) + +Когда клиент создаёт новую сущность (карточку, колонку, строку, связь, комментарий), `RestDataProvider` присваивает ей временный клиентский ID и запоминает серверный ID, возвращённый сервером. Функция `idResolver(id, type)` возвращает серверный ID для любого временного ID, который она хранит. Для ID, уже совпадающих с серверными, функция возвращает их без изменений. + +### Пример + +Наиболее распространённый сценарий использования — подключение `RestDataProvider` к `kanbanUpdates` в многопользовательской конфигурации, чтобы серверные события, адресованные серверным ID, корректно применялись к сущностям, которые ещё существуют на клиенте под временными ID: + +~~~jsx {6-9} +const url = "https://some_backend_url"; +const restProvider = new kanban.RestDataProvider(url); + +// other initialization... + +const handlers = kanbanUpdates( + board.api, + restProvider.getIDResolver() +); + +const events = new kanban.RemoteEvents(url + "/api/v1", token); +events.on(handlers); +~~~ + +Та же функция-резолвер может использоваться внутри пользовательских обработчиков, передаваемых в `RemoteEvents.on()`. См. [Настройка серверных событий](guides/working_with_server.md/#customize-server-events) для полного примера. + +**Связанные статьи:** [Работа с сервером: многопользовательский бэкенд](guides/working_with_server.md/#multiuser-backend) diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getqueue_method.md b/i18n/ru/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getqueue_method.md new file mode 100644 index 00000000..ba1d2547 --- /dev/null +++ b/i18n/ru/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getqueue_method.md @@ -0,0 +1,34 @@ +--- +sidebar_label: getQueue() +title: REST-метод getQueue +description: В документации библиотеки JavaScript Kanban от DHTMLX вы можете узнать о REST-методе getQueue. Изучайте руководства разработчика и справочник АПИ, просматривайте примеры кода и живые демо, а также загрузите бесплатную 30-дневную ознакомительную версию DHTMLX Kanban. +--- + +# getQueue() + +### Описание + +@short: Возвращает внутреннюю очередь действий, которую обрабатывает RestDataProvider + +:::info +Метод `getQueue()` является частью сервиса **RestDataProvider**, предназначенного для работы с сервером. +::: + +### Использование + +~~~jsx {} +getQueue(): object; +~~~ + +### Возвращаемое значение + +Метод возвращает внутренний экземпляр `ActionQueue`, используемый `RestDataProvider` для обработки операций с данными, отправляемых на сервер. Очередь отвечает за: + +- буферизацию действий до завершения текущих запросов +- назначение временных клиентских идентификаторов вновь созданным сущностям и их замену идентификаторами с сервера после получения ответа + +Очередь используется внутри другими методами `RestDataProvider`. Наиболее распространённое косвенное использование — через [`getIDResolver()`](api/provider/rest_methods/js_kanban_getidresolver_method.md), который построен на логике разрешения идентификаторов из очереди. + +Как правило, вызывать `getQueue()` напрямую не нужно. Используйте этот метод только в тех случаях, когда требуется детальный доступ к очереди (например, при реализации расширенной пользовательской синхронизации между клиентом и сервером). + +**Связанные статьи:** [Работа с сервером](guides/working_with_server.md) diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_setheaders_method.md b/i18n/ru/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_setheaders_method.md new file mode 100644 index 00000000..e63e3bd4 --- /dev/null +++ b/i18n/ru/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_setheaders_method.md @@ -0,0 +1,42 @@ +--- +sidebar_label: setHeaders() +title: setHeaders REST Method +description: Вы можете узнать о методе setHeaders REST в документации библиотеки DHTMLX JavaScript Kanban. Просматривайте руководства разработчика и справочник АПИ, изучайте примеры кода и живые демо, а также загрузите бесплатную 30-дневную ознакомительную версию DHTMLX Kanban. +--- + +# setHeaders() + +### Описание + +@short: Устанавливает пользовательские HTTP-заголовки, которые RestDataProvider добавляет к каждому запросу, отправляемому на сервер + +:::info +Метод `setHeaders()` является частью сервиса **RestDataProvider**, предназначенного для работы с сервером. +::: + +### Использование + +~~~jsx {} +setHeaders(headers: object): void; +~~~ + +### Параметры + +- `headers` - (обязательный) объект, ключи которого являются именами заголовков, а значения — значениями заголовков. Заголовки добавляются к стандартному заголовку `Content-Type: application/json` при каждом запросе, отправляемом через [`send()`](api/provider/rest_methods/js_kanban_send_method.md). + +### Пример + +Наиболее распространённый сценарий использования — добавление токена авторизации к каждому запросу: + +~~~jsx {4-6} +const url = "https://some_backend_url"; +const restProvider = new kanban.RestDataProvider(url); + +restProvider.setHeaders({ + "Remote-Token": "eyJpZCI6IjEzMzciLCJ1c2VybmFtZSI6ImJpem9uZSIsImlhdC...", +}); +~~~ + +Чтобы задать заголовки только для конкретного запроса, а не для каждого, передайте их в качестве четвёртого аргумента в [`send()`](api/provider/rest_methods/js_kanban_send_method.md). + +**Связанные статьи:** [Работа с сервером: Многопользовательский бэкенд](guides/working_with_server.md/#multiuser-backend) diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/guides/configuration.md b/i18n/ru/docusaurus-plugin-content-docs/current/guides/configuration.md index e954c701..f5cc9970 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/guides/configuration.md +++ b/i18n/ru/docusaurus-plugin-content-docs/current/guides/configuration.md @@ -104,8 +104,8 @@ new kanban.Kanban("#root", { - [`progress`](#тип-progress) — слайдер прогресса - [`files`](#тип-files) — загрузчик файлов - [`date`, `dateRange`](#типы-date-и-daterange) — одиночная дата или диапазон дат -- [`comments`](#тип-comments) — комментарии к карточке -- [`links`](#тип-links) — связи карточки +- [`comments`](#comments-type) — комментарии к карточке +- [`links`](#links-type) — связи карточки :::info Отображайте редактор как боковую панель или модальное окно с помощью свойства [`editor.placement`](api/config/js_kanban_editor_config.md). @@ -334,7 +334,7 @@ new kanban.Kanban("#root", { }); ~~~ -### Тип Comments +### Тип Comments {#comments-type} Следующий пример настраивает поле комментариев редактора: @@ -357,7 +357,7 @@ new kanban.Kanban("#root", { }); ~~~ -### Тип Links +### Тип Links {#links-type} Следующий пример настраивает поле связей редактора: @@ -465,7 +465,7 @@ new kanban.Kanban("#root", { }); ~~~ -## Рендеринг и прокрутка +## Рендеринг и прокрутка {#rendering-and-scrolling} По умолчанию виджет Kanban рендерит все карточки и прокручивает всю доску целиком. Для досок с большим количеством карточек переключитесь на ленивый рендеринг или прокрутку по колонкам: @@ -487,6 +487,8 @@ new kanban.Kanban("#root", { :::important При совместном использовании `renderType: "lazy"` с любым `scrollType` задайте статическую высоту карточек через свойство [`cardHeight`](api/config/js_kanban_cardheight_config.md). Без `cardHeight` ленивый рендеринг не отображает карточки корректно. + +Если `cardHeight` не указан при использовании `renderType: "lazy"` и `scrollType: "column"`, виджет применяет экспериментальное приближение высоты карточек на основе видимых полей в [`cardShape`](api/config/js_kanban_cardshape_config.md). Для досок с кастомным [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md) виджет не может предсказать итоговую высоту — передайте кастомную функцию [`getCardHeight(cardShape, card, cardWidth)`](api/config/js_kanban_getcardheight_config.md), возвращающую ожидаемую высоту карточки. ::: ## История изменений @@ -554,10 +556,10 @@ new kanban.Toolbar("#toolbar", { } } ], - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/guides/working_with_server.md b/i18n/ru/docusaurus-plugin-content-docs/current/guides/working_with_server.md index 280cd561..3d83f62b 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/guides/working_with_server.md +++ b/i18n/ru/docusaurus-plugin-content-docs/current/guides/working_with_server.md @@ -38,14 +38,47 @@ JavaScript Kanban поддерживает как клиентские, так ## REST-методы -Сервис `RestDataProvider` предоставляет следующие REST-методы для динамической загрузки данных: +Сервис `RestDataProvider` предоставляет следующие REST-методы: - [`getCards()`](api/provider/rest_methods/js_kanban_getcards_method.md) — возвращает promise с данными карточек - [`getColumns()`](api/provider/rest_methods/js_kanban_getcolumns_method.md) — возвращает promise с данными колонок +- [`getHandlers()`](api/provider/rest_methods/js_kanban_gethandlers_method.md) — возвращает стандартные обработчики действий, используемые провайдером +- [`getIDResolver()`](api/provider/rest_methods/js_kanban_getidresolver_method.md) — возвращает функцию, которая разрешает временные client ID в server ID - [`getLinks()`](api/provider/rest_methods/js_kanban_getlinks_method.md) — возвращает promise с данными связей +- [`getQueue()`](api/provider/rest_methods/js_kanban_getqueue_method.md) — возвращает внутреннюю очередь действий, обрабатываемых провайдером - [`getRows()`](api/provider/rest_methods/js_kanban_getrows_method.md) — возвращает promise с данными строк - [`getUsers()`](api/provider/rest_methods/js_kanban_getusers_method.md) — возвращает promise с данными пользователей - [`send()`](api/provider/rest_methods/js_kanban_send_method.md) — отправляет произвольный HTTP-запрос и возвращает promise +- [`setHeaders()`](api/provider/rest_methods/js_kanban_setheaders_method.md) — устанавливает пользовательские HTTP-заголовки, прикрепляемые к каждому запросу + +## Кастомизация RestDataProvider + +Чтобы изменить порядок отправки операций с данными на сервер, расширьте класс `RestDataProvider` и переопределите один из его методов. Чаще всего кастомизация направлена на стандартные обработчики действий — например, чтобы добавить обработчик для пользовательского события или расширить payload существующей операции. + +Чтобы добавить пользовательские обработчики без потери стандартных, переопределите [`getHandlers()`](api/provider/rest_methods/js_kanban_gethandlers_method.md) и объедините пользовательские записи поверх `super.getHandlers()`: + +~~~js {3-11} +const url = "https://some_backend_url"; + +class MyDataProvider extends kanban.RestDataProvider { + getHandlers() { + const handlers = super.getHandlers(); + return { + ...handlers, + // custom or overridden handlers go here + }; + } +} + +const restProvider = new MyDataProvider(url); +board.api.setNext(restProvider); +~~~ + +:::warning +Всегда вызывайте `super.getHandlers()` в переопределении и разворачивайте его результат. Не копируйте стандартные обработчики вручную — карта действий может меняться между версиями, и жёстко заданная копия может незаметно рассинхронизироваться с актуальными значениями по умолчанию. +::: + +Ещё одна распространённая цель кастомизации — метод [`send()`](api/provider/rest_methods/js_kanban_send_method.md), который вызывается каждым стандартным обработчиком. Переопределите `send()`, чтобы добавить дополнительные заголовки, изменить URL или обернуть каждый запрос к серверу пользовательской логикой. ## Взаимодействие с backend @@ -101,7 +134,7 @@ Promise.all([ -## Мультипользовательский backend +## Мультипользовательский backend {#multiuser-backend} Мультипользовательский backend позволяет нескольким пользователям редактировать одну и ту же доску Kanban в реальном времени без перезагрузки страницы. Виджет подключается к серверу через WebSocket, а пользовательские обработчики применяют входящие изменения к доске Kanban. @@ -196,7 +229,7 @@ events.on(handlers); -## Кастомизация серверных событий +## Кастомизация серверных событий {#customize-server-events} Чтобы определить пользовательскую логику обработки серверных событий, передайте объект `handlers` в метод `RemoteEvents.on(handlers)`. Объект имеет следующую структуру: @@ -289,7 +322,7 @@ remoteEvents.on(handlers); ### Группировка на сервере {#group-on-the-server} -Группировка на стороне сервера требует, чтобы сервер мог передавать данные на клиент через [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) (см. раздел [Мультипользовательский backend](#мультипользовательский-backend)). +Группировка на стороне сервера требует, чтобы сервер мог передавать данные на клиент через [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) (см. раздел [Мультипользовательский backend](#multiuser-backend)). При обработке запроса на обновление карточки проверьте поле `status`. Пример ниже использует [Go](https://go.dev/), но подходит любой backend. diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/news/whats_new.md b/i18n/ru/docusaurus-plugin-content-docs/current/news/whats_new.md index 2fb9d42a..8e528753 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/news/whats_new.md +++ b/i18n/ru/docusaurus-plugin-content-docs/current/news/whats_new.md @@ -31,8 +31,646 @@ description: Ознакомьтесь с новыми возможностями ### Исправления -- Ошибка скрипта при использовании `dateRange` в редакторе -- `parse()` не работает после вызова `setConfig()` -- Ошибка скрипта после закрытия редактора с несохранёнными данными новых ссылок +- Ошибка скрипта при использовании `dateRange` в редакторе +- `parse()` не работает после вызова `setConfig()` +- Ошибка скрипта после закрытия редактора с несохранёнными данными новых ссылок -... (остальной текст документа без изменений, согласно предыдущему переводу) +## Версия 1.7.0 + +Выпущена 14 октября 2025 + +[Обзор релиза в блоге](https://dhtmlx.com/blog/meet-dhtmlx-kanban-1-7/) + +### Интеграция с Salesforce + +Начиная с v1.7 вы можете использовать JavaScript Kanban в среде Salesforce. Подробнее см. в руководстве: [**Интеграция с Salesforce**](guides/integration_with_salesforce.md). + +Также доступны [**пример на GitHub**](https://github.com/DHTMLX/salesforce-lwc-demo) и [**онлайн-демо**](https://dhtmlx-dev-ed.develop.lightning.force.com/) (*Логин*: ***user***, *Пароль*: ***demo***). + +### Новый АПИ + +- #### События + + - [`undo`](api/events/js_kanban_undo_event.md) + - [`redo`](api/events/js_kanban_redo_event.md) + +- #### Методы + + - [`getColumnCards()`](api/methods/js_kanban_getcolumncards_method.md) + - [`detach()`](api/internal/js_kanban_detach_method.md) + +### Обновления + +- #### Методы + + - Внутренний метод [`on`](api/internal/js_kanban_on_method.md) расширен параметрами `config.tag` и `config.intercept` + - Внутренний метод [`intercept`](api/internal/js_kanban_intercept_method.md) расширен параметрами `config.tag` и `config.intercept` + +- #### Свойства + + - Свойство [`links`](api/config/js_kanban_links_config.md) обновлено следующим образом: + - Параметр `masterId` заменён параметром `source` + - Параметр `slaveId` заменён параметром `target` + + - Свойство [`editorShape`](api/config/js_kanban_editorshape_config.md) обновлено: параметр `clearButton` заменён параметром `clear` + + - Функция [`cardShape.menu.items`](api/config/js_kanban_cardshape_config.md) обновлена: параметр `store` заменён параметром `readonly` + + - Свойство [`cards[i].attached[i]`](api/config/js_kanban_cards_config.md) расширено параметром `size` + +### Удалённый АПИ + +- Свойство `editorAutoSave` удалено. Используйте свойство [`editor.autoSave`](api/config/js_kanban_editor_config.md) + +- Параметры `dragItemsCoords` и `dropAreasCoords` удалены из события [`start-drag-card`](api/events/js_kanban_startdragcard_event.md) + +### Исправления + +- При загрузке большого количества файлов или нескольких крупных файлов форма обновляется до завершения загрузки всех файлов на сервер, что приводит к некорректным данным карточек, отправляемых на сервер +- Размер файла отображается только для вновь загруженных файлов +- Значения года и месяца не обновляются после нажатия кнопки **Done** в редакторе +- Расширяемое текстовое поле комментариев смещает кнопку за пределы кликабельной зоны +- Ошибка скрипта при открытии карточки, связанной с удалённой карточкой + +## Версия 1.6.5 + +Выпущена 14 июля 2025 + +### Исправления + +- Конфигурация `disabled: true` не работает для элементов меню +- При добавлении строки в Kanban без предопределённой структуры строк заголовки строк не отображаются + +## Версия 1.6.4 + +Выпущена 12 июня 2025 + +### Исправления + +- Карточки теряются при добавлении в колонки/строки, которые были удалены и затем восстановлены +- Отсутствуют локализованные строки для кнопок списка загрузчика файлов +- Отсутствуют файлы readme в пакетах коммерческой версии + +## Версия 1.6.3 + +Выпущена 8 апреля 2025 + +### Исправления + +- Лимит применяется ко всей колонке некорректно +- Ошибка при перемещении карточки после закрытия модального редактора +- Подтверждение удаления отображается под модальным редактором +- Иконка "ещё" на тулбаре неожиданно появляется и исчезает при медленном изменении размера окна +- Событие `delete-card` всегда закрывает редактор +- Редактор не открывается, если приоритет задан ID, выходящим за пределы допустимых вариантов + +## Версия 1.6.2 + +Выпущена 14 февраля 2025 + +### Исправления + +- Неверная дата истечения срока в пробном пакете +- Предупреждение при drag and drop на touch-устройствах +- Конфигурация `add: false` в режиме только для чтения не убирает пункт **Add** из меню колонки +- Редактор не отображается для карточек с числовыми ID в виде строк +- Устаревшая ссылка на примеры в пакете +- Прокрутка колонки с динамической отрисовкой имеет проблемы с drag and drop +- Метод `setConfig()` не обновляет фиксированное состояние заголовков колонок + +## Версия 1.6.1 + +Выпущена 29 ноября 2024 + +### Исправления + +- Иконка "ещё" на тулбаре выровнена неправильно на узких экранах +- `RestDataProvider` игнорирует заголовки, заданные через `setHeaders()` +- Ошибка: `RestDataProvider.getIDResolver` не является функцией + +## Версия 1.6 + +Выпущена 13 ноября 2024 + +[Обзор релиза в блоге](https://dhtmlx.com/blog/dhtmlx-kanban-1-6/) + +### Новая функциональность + +- Возможность изменять количество отображаемых на карточке назначенных пользователей через свойство [`cardShape.users.maxCount`](api/config/js_kanban_cardshape_config.md) (см. [**пример**](https://snippet.dhtmlx.com/w205dvzg?tag=kanban)) +- Возможность изменять содержимое заголовков колонок через свойство [`columnShape`](api/config/js_kanban_columnshape_config.md) (см. [**пример**](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban)) +- Возможность изменять вид и содержимое результатов поиска через свойство [`items.resultTemplate`](api/config/toolbar_items_config.md) элемента управления **search** тулбара (см. [**пример**](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban)) +- Возможность отображать редактор в виде модального окна через свойство [`editor.placement`](api/config/js_kanban_editor_config.md) (см. [**пример**](https://snippet.dhtmlx.com/vt6pe7qz?tag=kanban)) +- Возможность включить голосование за карточку (с помощью иконки голосования на карточке) через свойство [`cardShape.votes.clickable`](api/config/js_kanban_cardshape_config.md) (см. [**пример**](https://snippet.dhtmlx.com/en76xvi4?tag=kanban)) + +### Обновления + +- #### Свойства + + - Свойство [`cardShape`](api/config/js_kanban_cardshape_config.md) расширено параметрами ***users.maxCount*** и ***votes.clickable*** + - Свойство [`columnShape`](api/config/js_kanban_columnshape_config.md) расширено параметрами ***headerTemplate*** и ***collapsedTemplate*** + - Свойство [`editor`](api/config/js_kanban_editor_config.md) расширено параметром ***placement*** + - Свойство [`editorShape`](api/config/js_kanban_editorshape_config.md) расширено параметром ***modalSection*** + - Свойство [`items`](api/config/toolbar_items_config.md) элемента управления **search** тулбара расширено параметром ***resultTemplate*** + +- #### События + + - Событие [`set-edit`](api/events/js_kanban_setedit_event.md) расширено параметром ***eventSource*** (см. [**пример**](https://snippet.dhtmlx.com/zh4d9pdb?tag=kanban)) + +- #### Методы + + - Функциональность метода [`setConfig()`](api/methods/js_kanban_setconfig_method.md) обновлена следующим образом: + + - Метод не изменяет историю (изменение истории недоступно) + - Метод не уничтожает хранилище данных Kanban. Нет необходимости пересоздавать обработчики событий и повторно подключать тулбар к Kanban + + - Метод [`setLocale()`](api/methods/js_kanban_setlocale_method.md) не уничтожает хранилище данных Kanban. Нет необходимости пересоздавать обработчики событий и повторно подключать тулбар к Kanban + - Параметр `api` метода [`setLocale()`](api/methods/toolbar_setlocale_method.md) тулбара объявлен устаревшим + +### Исправления + +- Комментарий в процессе редактирования может быть удалён, а поле ввода для новых комментариев исчезает +- Добавлены недостающие строки локализации +- Drag-n-drop не работает при совместном использовании настроек [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md) и [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) +- Редактор невозможно закрыть с помощью иконки закрытия +- Правая часть редактора имеет тот же цвет, что и фон прогресс-бара (только в теме Willow) + +## Версия 1.5.13 + +Выпущена 12 сентября 2024 + +### Исправления + +- Кнопка "Make cover" не появляется, если расширение файла написано в верхнем регистре +- Клик по отключённому элементу управления Multiselect вызывает ошибку +- Прокрутка после вызова метода [`addCard()`](api/methods/js_kanban_addcard_method.md) выбрасывает ошибку при использовании [прокрутки колонок](api/config/js_kanban_scrolltype_config.md) и [динамической отрисовки](api/config/js_kanban_rendertype_config.md) +- Пустые комментарии сохраняются как "" вместо [] +- Стили редактора перекрываются глобальными стилями с одноимённым неуникальным селектором класса. [См. раздел миграции](news/migration.md/#1512---1513) + +## Версия 1.5.12 + +Выпущена 2 мая 2024 + +### Исправления + +- Регрессия в intercept: возврат `false` не предотвращает внутренние события +- Отключённый загрузчик файлов всё равно принимает файлы + +## Версия 1.5.11 + +Выпущена 25 марта 2024 + +### Исправления + +- CSS-переменные Kanban темы *Dark willow* теряются для тулбара и порталов +- Изменения комментариев и голосов не применяются к значениям формы при отключённом автосохранении +- Пользовательское подменю колонки получает `null` в аргументе функции **onClick** +- Невозможно установить режим редактирования для элементов Datepicker в редакторе +- Предупреждения в консоли в примерах Kanban + +## Версия 1.5.10 + +Выпущена 29 февраля 2024 + +### Исправления + +- Сломанная сборка на npm-сервере +- Добавлен параметр `select` в событие [`duplicate-card`](api/events/js_kanban_duplicatecard_event.md) и метод [`duplicateCard()`](api/methods/js_kanban_duplicatecard_method.md) +- Некорректные стили поля комментариев в редакторе Kanban + +## Версия 1.5.9 + +Выпущена 20 февраля 2024 + +### Исправления + +- Kanban влияет на стили других виджетов +- Пользовательские элементы подменю колонки с `disabled: true` остаются активными +- Невозможно задать пользовательскую функцию загрузки для элемента управления **Uploader** + +## Версия 1.5.8 + +Выпущена 28 ноября 2023 + +### Исправления + +- Отсутствует определение TypeScript для **currentUser** в типе **IKanbanConfig** + +## Версия 1.5.7 + +Выпущена 14 ноября 2023 + +### Обновления + +- Метод [`setLocale()`](api/methods/toolbar_setlocale_method.md) тулбара расширен параметром ***api*** + +### Исправления + +- Конфигурация `disabled: true` не работает для элементов меню карточки +- Нежелательные предупреждения в консоли в примерах Kanban +- Невозможно сбросить приоритет задачи +- Выпадающие элементы управления в редакторе Kanban не закрываются при клике за их пределами + +## Версия 1.5.6 + +Выпущена 13 сентября 2023 + +### Обновления + +- Возможность импортировать компонент как ES-модуль + +### Исправления + +- Регрессия в npm-пакетах + +## Версия 1.5.4 + +Выпущена 9 августа 2023 + +### Исправления + +- Ранее загруженные файлы остаются в форме при переключении на другую карточку +- Загрузка файлов через drag-and-drop не работает +- Непредвиденное удаление карточек при нажатии клавиши Delete, когда форма открыта +- Поле выпадающего списка "Search in" становится пустым после выбора карточки через поиск +- Добавленные ссылки не удаляются на бэкенде при отмене операции add-link + +## Версия 1.5.1 + +### Исправления + +- Корректная генерация определений TypeScript + +## Версия 1.5 + +Выпущена 15 июня 2023 + +[Обзор релиза в блоге](https://dhtmlx.com/blog/dhtmlx-kanban-1-5/) + +### Новая функциональность + +- Возможность устанавливать и удалять связи между карточками в режиме реального времени +- Возможность управлять связями между карточками на стороне сервера +- Возможность фиксировать заголовки колонок (см. [**пример**](https://snippet.dhtmlx.com/xez9ghqq?tag=kanban)) + +### Новый АПИ + +- #### Методы + + - [`addLink()`](api/methods/js_kanban_addlink_method.md) + - [`deleteLink()`](api/methods/js_kanban_deletelink_method.md) + - [`getLinks()`](api/provider/rest_methods/js_kanban_getlinks_method.md) + +- #### Маршруты + + - [`DELETE /links`](api/provider/rest_routes/delete_routes/js_kanban_delete_links_route.md) + - [`GET /links`](api/provider/rest_routes/get_routes/js_kanban_get_links_route.md) + - [`POST /links`](api/provider/rest_routes/post_routes/js_kanban_post_links_route.md) + +### Обновления + +- #### Свойства + + - Свойство [`columnShape`](api/config/js_kanban_columnshape_config.md) расширено параметром ***fixedHeaders***. + +### Исправления + +- Ссылки невозможно распарсить в режиме реального времени, экспортировать или сериализовать +- Создание раздела комментариев завершается ошибкой, если раздел пользователей не был активирован +- Ссылки в хранилище мутируют исходные данные и не сохраняются должным образом +- Динамическая отрисовка нарушает стили области наведения свёрнутых колонок +- Карточки, перемещённые во вновь созданные колонки, исчезают +- Поле ввода нового комментария не закрывается при начале редактирования + +## Версия 1.4.2 + +Выпущена 13 апреля 2023 + +### Исправления + +- ID бэкенда не сохраняется в локальные данные карточки/колонки/строки после операций добавления +- Добавлены недостающие определения TypeScript +- Стили тёмной темы оказывают влияние на другие элементы + +## Версия 1.4.1 + +Выпущена 29 марта 2023 + +### Исправления + +- Некорректное поведение сохранения сортировки +- Некорректное поведение при отключении контекстного меню через свойства **cardShape**, **columnShape** или **rowShape** +- Некорректное поведение при добавлении ссылок в редакторе без предоставления ссылок в данных +- Меню колонки может совпадать с меню карточки или не отображаться +- Перетаскиваются две задачи вместо одной + +## Версия 1.4 + +Выпущена 21 марта 2023 + +[Обзор релиза в блоге](https://dhtmlx.com/blog/dhtmlx-kanban-1-4/) + +### Новая функциональность + +- Возможность добавлять комментарии (см. [**пример**](https://snippet.dhtmlx.com/5hcx01h4?tag=kanban)) +- Возможность ограничивать количество пользователей (см. [**пример**](https://snippet.dhtmlx.com/2rlg4qvk?tag=kanban)) +- Возможность устанавливать связи между карточками (см. [**пример**](https://snippet.dhtmlx.com/81qu7qh0?tag=kanban)) +- Возможность голосовать за карточку (см. [**пример**](https://snippet.dhtmlx.com/5hcx01h4?tag=kanban)) + +### Новый АПИ + +- #### События + + - [`add-comment`](api/events/js_kanban_addcomment_event.md) + - [`add-link`](api/events/js_kanban_addlink_event.md) + - [`delete-comment`](api/events/js_kanban_deletecomment_event.md) + - [`delete-link`](api/events/js_kanban_deletelink_event.md) + - [`drag-card`](api/events/js_kanban_dragcard_event.md) + - [`end-drag-card`](api/events/js_kanban_enddragcard_event.md) + - [`start-drag-card`](api/events/js_kanban_startdragcard_event.md) + - [`update-comment`](api/events/js_kanban_updatecomment_event.md) + +- #### Методы + + - [`addComment()`](api/methods/js_kanban_addcomment_method.md) + - [`deleteComment()`](api/methods/js_kanban_deletecomment_method.md) + - [`updateComment()`](api/methods/js_kanban_updatecomment_method.md) + +- #### Свойства + + - [`currentUser`](api/config/js_kanban_currentuser_config.md) + - [`links`](api/config/js_kanban_links_config.md) + +### Обновления + +- #### Методы + + - Метод [`api.getState()`](api/internal/js_kanban_getstate_method.md) обновлён + +- #### Свойства + + - Свойство [`cards`](api/config/js_kanban_cards_config.md) расширено параметрами ***css***, ***comments*** и ***votes*** + - Свойство [`cardShape`](api/config/js_kanban_cardshape_config.md) расширено параметрами ***comments***, ***votes*** (см. [**пример**](https://snippet.dhtmlx.com/5hcx01h4?tag=kanban)) и ***css*** (см. [**пример**](https://snippet.dhtmlx.com/7fvc3rr1?tag=kanban)). + - Свойство [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md) поддерживает отображение контекстного меню + - Свойство [`columns`](api/config/js_kanban_columns_config.md) расширено параметрами ***css*** (см. [**пример**](https://snippet.dhtmlx.com/fnlvd2g5?tag=kanban)) и ***overlay*** (см. [**пример**](https://snippet.dhtmlx.com/nfv59yif?tag=kanban)) + - Свойство [`columnShape`](api/config/js_kanban_columnshape_config.md) расширено параметром ***css*** (см. [**пример**](https://snippet.dhtmlx.com/fnlvd2g5?tag=kanban)) + - Свойство [`editorShape`](api/config/js_kanban_editorshape_config.md) расширено типами [***comments***](guides/configuration.md#comments-type) и [***links***](guides/configuration.md#links-type), а также параметром ***format*** для типов *date/dateRange* + - Свойство [`rows`](api/config/js_kanban_rows_config.md) расширено параметром ***css*** (см. [**пример**](https://snippet.dhtmlx.com/tev4ej9c?tag=kanban)) + - Свойство [`rowShape`](api/config/js_kanban_rowshape_config.md) расширено параметром ***css*** (см. [**пример**](https://snippet.dhtmlx.com/tev4ej9c?tag=kanban)) + +### Устаревший АПИ + +- #### Свойства + + - Параметр label в объектах элементов меню `cardShape.menu.items`, `columnShape.menu.items` и `rowShape.menu.items` + +### Исправления + +- Позиция меню неверна, когда Kanban находится внутри контейнера с отступами +- Неверная позиция свёрнутых колонок при пользовательской ширине колонки +- Перетаскивание карточки в свёрнутую колонку приводит к её исчезновению +- Неверная позиция свёрнутых колонок при пользовательской ширине колонки +- Swimlanes. Контекстное меню карточки перекрывается панелью редактирования, и поэтому карточку невозможно удалить + +## Версия 1.3 + +Выпущена 29 сентября 2022 + +[Обзор релиза в блоге](https://dhtmlx.com/blog/dhtmlx-kanban-1-3/) + +### Новая функциональность + +- Дублирование карточек через АПИ, контекстное меню (иконка с тремя точками) или сочетание клавиш `Ctrl (Command)` + `D` (позволяет дублировать несколько карточек) +- Экспорт данных Kanban в файл JSON +- Управление историей Kanban: + - через элементы управления *Undo* и *Redo* на тулбаре + - через сочетания клавиш: + - `Ctrl (Command)`+`Z` — отменить действие + - `Ctrl (Command)`+`Y` или `Ctrl (Command)`+`Shift`+`Z` — повторить действие + - через АПИ + +### Новый АПИ + +- **События:** + [`duplicate-card`](api/events/js_kanban_duplicatecard_event.md) + +- **Методы:** + [`duplicateCard()`](api/methods/js_kanban_duplicatecard_method.md), + [`export.json()`](api/internal/js_kanban_json_method.md), + [`getUsers()`](api/provider/rest_methods/js_kanban_getusers_method.md), + [`redo()`](api/methods/js_kanban_redo_method.md) и + [`undo()`](api/methods/js_kanban_undo_method.md) + +- **Свойства:** + [`editor`](api/config/js_kanban_editor_config.md) и + [`history`](api/config/js_kanban_history_config.md) + +- **Общие настройки:** + [`$meta`](api/common/js_kanban_meta_parameter.md) + +### Устаревший АПИ + +- **Свойства:** + [`editorAutoSave`](api/config/js_kanban_editorautosave_config.md) + +### Обновления + +- #### События + + - Событие [`update-card`](api/events/js_kanban_updatecard_event.md) Kanban обновлено + - Событие [`update-column`](api/events/js_kanban_updatecolumn_event.md) Kanban обновлено + - Событие [`update-row`](api/events/js_kanban_updaterow_event.md) Kanban обновлено + +- #### Методы + + - Метод [`updateCard()`](api/methods/js_kanban_updatecard_method.md) Kanban обновлён + - Метод [`updateColumn()`](api/methods/js_kanban_updatecolumn_method.md) Kanban обновлён + - Метод [`updateRow()`](api/methods/js_kanban_updaterow_method.md) Kanban обновлён + +- #### Свойства + + - Свойство [`items`](api/config/toolbar_items_config.md) тулбара расширено параметрами (элементами управления) ***"undo"*** и ***"redo"*** + - Свойство [`editorShape`](api/config/js_kanban_editorshape_config.md) расширено типом ***dateRange*** + +## Версия 1.2.2 + +Выпущена 30 августа 2022 + +### Исправления + +- Дублирование некоторых иконок в меню и тулбаре + +## Версия 1.2.1 + +Выпущена 28 июля 2022 + +### Исправления + +- Свойство `cardHeight` не работает при включённой конфигурации `scrollType:"column"` +- Загрузчик файлов не отображает загруженные файлы в редакторе карточки +- Локализация не работает для полей "combo" и "progress" в редакторе карточки + +## Версия 1.2 + +Выпущена 29 июня 2022 + +[Обзор релиза в блоге](https://dhtmlx.com/blog/dhtmlx-kanban-1-2/) + +### Новая функциональность + +- Добавление новых карточек через меню колонки (см. [**пример**](https://snippet.dhtmlx.com/8eo65gr5?tag=kanban)) +- Динамическая отрисовка (см. [**пример**](https://snippet.dhtmlx.com/xez9ghqq?tag=kanban)) +- Прокрутка отдельных колонок (см. [**пример**](https://snippet.dhtmlx.com/xez9ghqq?tag=kanban)) +- Прокрутка Kanban до вновь созданных карточек, колонок и строк (АПИ и интерфейс) (см. [**пример**](https://snippet.dhtmlx.com/5hcx01h4?tag=kanban)) +- Сортировка карточек (АПИ и интерфейс) (см. [**пример**](https://snippet.dhtmlx.com/74nyuv14?tag=kanban)) + +### Новый АПИ + +- **События:** + [`scroll`](api/events/js_kanban_scroll_event.md), + [`set-edit`](api/events/js_kanban_setedit_event.md) и + [`set-sort`](api/events/js_kanban_setsort_event.md) + +- **Методы:** + [`scroll()`](api/methods/js_kanban_scroll_method.md), + [`setEdit()`](api/methods/js_kanban_setedit_method.md) и + [`setSort()`](api/methods/js_kanban_setsort_method.md) + +- **Свойства:** + [`cardHeight`](api/config/js_kanban_cardheight_config.md), + [`columnShape`](api/config/js_kanban_columnshape_config.md), + [`rowShape`](api/config/js_kanban_rowshape_config.md), + [`renderType`](api/config/js_kanban_rendertype_config.md) и + [`scrollType`](api/config/js_kanban_scrolltype_config.md) + +### Обновления + +- #### Методы + + - Метод [`api.getReactiveState()`](api/internal/js_kanban_getreactivestate_method.md) обновлён + - Метод [`api.getState()`](api/internal/js_kanban_getstate_method.md) обновлён + - Метод [`api.getStores()`](api/internal/js_kanban_getstores_method.md) обновлён + - Метод [`setLocale()`](api/methods/js_kanban_setlocale_method.md) Kanban обновлён + - Метод [`setLocale()`](api/methods/toolbar_setlocale_method.md) тулбара обновлён + +- #### Свойства + + - Свойство [`items`](api/config/toolbar_items_config.md) тулбара обновлено + - Параметры (поля) ***start_date***, ***end_date***, ***menu*** и ***users*** свойства [`cardShape`](api/config/js_kanban_cardshape_config.md) обновлены + - Тип ***multiselect*** свойства [`editorShape`](api/config/js_kanban_editorshape_config.md) обновлён + +#### Общее + +- Префиксы CSS-классов (*см. раздел [Стилизация](guides/stylization.md)*) +- Структура локализации (*см. раздел [Локализация](guides/localization.md)*) + +### Исправления + +- Привязка карточек к swimlane через конфигурацию `rowKey` работает некорректно +- Клик по меню карточки открывает редактор +- Перетаскивание нескольких карточек работает некорректно +- Редактирование карточек при `select: false` (конфигурация **readonly**) работает некорректно +- Выбор вновь добавленных карточек через метод `addCard()` работает некорректно +- Параметры `label: false` и `menu: false` свойства `cardShape` работают некорректно + +## Версия 1.1.1 + +Выпущена 28 февраля 2022 + +[Обзор релиза в блоге](https://dhtmlx.com/blog/maintenance-release-kanban-1-1-1/) + +### Исправления + +- Пользовательское поле редактора не работает без его определения в конфигурации cardShape +- Выбор нужной карточки из выпадающего меню строки поиска + +## Версия 1.1 + +Выпущена 15 февраля 2022 + +[Обзор релиза в блоге](https://dhtmlx.com/blog/dhtmlx-kanban-1-1-wip-validation-new-operations-columns-rows-typescript-support/) + +### Новая функциональность + +- Возможность *сворачивать/разворачивать* колонки с помощью стрелки слева от метки колонки +- Возможность *ограничивать* количество карточек для колонок и swimlane +- Возможность *перемещать* колонки через контекстное меню (иконка с тремя точками) +- Возможность *перемещать* строки через контекстное меню (иконка с тремя точками) +- Возможность *выбирать несколько карточек* в одной колонке с помощью привычного сочетания **Shift** + **клик** +- Возможность использовать [определения TypeScript](guides/typescript_support.md) Kanban + +### Новый АПИ + +- Новые **события** для перемещения колонок и строк: + [`move-column`](api/events/js_kanban_movecolumn_event.md) + и + [`move-row`](api/events/js_kanban_moverow_event.md) +- Новые **методы** для перемещения колонок и строк: + [`moveColumn()`](api/methods/js_kanban_movecolumn_method.md) + и + [`moveRow()`](api/methods/js_kanban_moverow_method.md) + +### Обновления + +#### Свойства + +- Свойство [`cards`](api/config/js_kanban_cards_config.md) стало необязательным + +- Свойство [`columns`](api/config/js_kanban_columns_config.md) стало необязательным и расширено следующими параметрами: + - ***collapsed*** + - ***limit*** + - ***strictLimit*** + +- Параметр ***color*** свойства [`cardShape`](api/config/js_kanban_cardshape_config.md) обновлён + +#### Методы + +- Метод [`addColumn`](api/methods/js_kanban_addcolumn_method.md) обновлён +- Метод [`addRow`](api/methods/js_kanban_addrow_method.md) обновлён +- Метод [`updateCard`](api/methods/js_kanban_updatecard_method.md) обновлён +- Метод [`updateColumn`](api/methods/js_kanban_updatecolumn_method.md) обновлён +- Метод [`updateRow`](api/methods/js_kanban_updaterow_method.md) обновлён +- Метод [`parse`](api/methods/js_kanban_parse_method.md) обновлён + +#### События + +- Событие [`add-column`](api/events/js_kanban_addcolumn_event.md) обновлено +- Событие [`add-row`](api/events/js_kanban_addrow_event.md) обновлено +- Событие [`update-card`](api/events/js_kanban_updatecard_event.md) обновлено +- Событие [`update-column`](api/events/js_kanban_updatecolumn_event.md) обновлено +- Событие [`update-row`](api/events/js_kanban_updaterow_event.md) обновлено + +## Версия 1.0 + +Выпущена 23 ноября 2021 + +[Обзор релиза в блоге](https://dhtmlx.com/blog/releasing-dhtmlx-kanban-board-v-1-0/) + +### Начальная функциональность + +- Возможность работать с **карточками** следующим образом: + - добавлять новые карточки + - выбирать карточки (мультивыбор) + - удалять карточки + - искать карточки + - изменять порядок карточек путём перетаскивания в нужную колонку (и строку) + - управлять данными карточки через редактор: + - метка + - описание + - прогресс + - дата начала + - дата окончания + - цвет + - приоритет + - вложение (*файлы* и *изображения*) + - *пользовательские поля* + +- Возможность работать с **колонками** и **строками** следующим образом: + - добавлять новые колонки и строки + - удалять колонки и строки + - переименовывать колонки и строки + - сворачивать/разворачивать строки + +- [Локализация](guides/localization.md) +- [Интеграция с бэкендом](guides/working_with_server.md) (Go и Node) +- Кросс-браузерная совместимость +- Поддержка touch-устройств diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/.sync b/i18n/zh/docusaurus-plugin-content-docs/current/.sync index 0337ab75..a10bd810 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/.sync +++ b/i18n/zh/docusaurus-plugin-content-docs/current/.sync @@ -1 +1 @@ -f55b2fb6832c9d6955cfb66b8e5734aa93ffa3d3 +943f1d77abd087cfa70fc9f4a148239ebcae9d9a diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md b/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md index 2f324ad7..d427e4d9 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_cardheight_config.md @@ -19,6 +19,8 @@ cardHeight?: number; // px :::important 如果您同时使用 [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) 和 [`scrollType: "default"`](api/config/js_kanban_scrolltype_config.md) 设置,请务必通过 `cardHeight` 属性指定卡片的固定高度。如果未指定,卡片将不会显示。 当您将 [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) 与 [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md) 配合使用时,也应通过 `cardHeight` 属性固定卡片高度。尽管该布局类型支持卡片高度可变,但在自定义卡片内容时,可能无法稳定工作。 + +如果未指定 `cardHeight`,组件将根据 [`cardShape`](api/config/js_kanban_cardshape_config.md) 中声明的可见字段,对卡片高度进行实验性估算作为回退方案。若使用了自定义 [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md),此估算将不适用——在这种情况下,请显式设置 `cardHeight`,或提供自定义的 [`getCardHeight`](api/config/js_kanban_getcardheight_config.md) 函数。 ::: ### 示例 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md b/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md index fd415d64..32879f35 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_columnshape_config.md @@ -30,17 +30,17 @@ columnShape?: { }, fixedHeaders?: boolean, css?: (column, cards) => string, - headerTemplate?: template(column => { + headerTemplate?: template(props => { return "展开状态下列头的 HTML 模板"; }), - collapsedTemplate?: template(column => { + collapsedTemplate?: template(props => { return "折叠状态下列头的 HTML 模板"; }), confirmDeletion?: boolean }; ~~~ -### 参数 +### 参数 {#parameters} 要配置列的外观,可以在 **columnShape** 对象中指定以下参数: @@ -94,8 +94,28 @@ columnShape?: { - `fixedHeaders` - (可选)在垂直滚动时固定列头(默认 *true*)。必须在看板本身启用滚动(限制高度) - `css` - (可选)一个函数,根据条件返回应用于列的 CSS 类名 -- `headerTemplate` - (可选)展开状态下列头的 HTML 模板 -- `collapsedTemplate` - (可选)折叠状态下列头的 HTML 模板 +- `headerTemplate` - (可选)展开状态下列头的 HTML 模板。该函数接收一个 `props` 对象,包含以下属性: + - `column` - (对象)列数据(结构参见 [`columns`](api/config/js_kanban_columns_config.md)) + - `columnState` - (对象)列的当前状态,始终包含以下属性: + - ***columnId*** - (string | number)列的 ID + - ***column*** - (对象)列数据(与 `props.column` 相同) + - ***cardsCount*** - (number)列中卡片数量 + - ***noFreeSpace*** - (boolean)当列无法接受更多卡片时为 ***true*** + + 当启用 [`columns[i].limit`](api/config/js_kanban_columns_config.md) 参数时,还包含: + - ***totalLimit*** - (number)配置的卡片数量限制 + - ***isOverLimit*** - (boolean)当卡片数量超过限制时为 ***true*** + + 当列属于泳道(行)时,还包含: + - ***rowId*** - (string | number)行的 ID + - ***row*** - (对象)行数据(结构参见 [`rows`](api/config/js_kanban_rows_config.md)) + - ***height*** - (number)区域高度 + - `isMenuVisible` - (boolean)当该列头应显示菜单时为 ***true*** + - `renaming` - (boolean)当列名编辑输入框处于激活状态时为 ***true*** + - `readonly` - (boolean)当列编辑被禁用时为 ***true***(等同于 `!readonly.edit`,参见 [`readonly`](api/config/js_kanban_readonly_config.md) 属性) +- `collapsedTemplate` - (可选)折叠状态下列头的 HTML 模板。该函数接收一个 `props` 对象,包含以下属性: + - `column` - (对象)列数据(参见 [`columns`](api/config/js_kanban_columns_config.md)) + - `columnState` - (对象)列的当前状态,结构与上方 [`headerTemplate`](#parameters) 参数中的 `columnState` 相同 - `confirmDeletion` - (可选)显示/隐藏 **确认对话框**,允许用户确认或取消列的删除操作 ### 默认配置 @@ -160,30 +180,30 @@ const columnShape = { }, fixedHeaders: false, css: (column, cards) => column.id == "inprogress" && cards.length < 5 ? "green" : "red", - headerTemplate: template(column => { + headerTemplate: template(props => { return `
- +
${ - !column.column.collapsed + !props.column.collapsed ? `
- ${escapeHTML(column.column.label)} - (${column.columnState.cardsCount}) + ${escapeHTML(props.column.label)} + (${props.columnState.cardsCount})
` : "" } ${ - !column.column.collapsed - ? `
+ !props.column.collapsed + ? `
` : "" }`; }), - collapsedTemplate: template(column => { + collapsedTemplate: template(props => { return `
-
${escapeHTML(column.column.label)} (${ - column.columnState?.cardsCount +
${escapeHTML(props.column.label)} (${ + props.columnState?.cardsCount })
`; }), @@ -213,4 +233,4 @@ new kanban.Kanban("#root", { **相关示例:** - [Kanban. 通过自定义菜单更改列颜色](https://snippet.dhtmlx.com/fnlvd2g5?tag=kanban) - [Kanban. 固定表头、懒加载和列滚动](https://snippet.dhtmlx.com/xez9ghqq?tag=kanban) -- [Kanban. 列头模板](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban) \ No newline at end of file +- [Kanban. 列头模板](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md b/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md index 0ba53ff3..e68e1bc1 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_editorshape_config.md @@ -19,6 +19,7 @@ editorShape?: [ type: string, key: string, label?: string, + modalSection?: "left" | "right", // 仅针对 "dateRange" 类型 key: { @@ -182,6 +183,9 @@ editorShape?: [ ~~~ - `label` - (可选)编辑器字段标签 +- `modalSection` - (可选)定义字段在模态编辑器中的列位置。仅当编辑器通过 [`editor.placement: "modal"`](api/config/js_kanban_editor_config.md) 属性以模态窗口形式显示时生效。可设置为: + - `"left"` - 字段放置在左列 + - `"right"` - 字段放置在右列(默认值) #### - "dateRange" 类型的参数 @@ -466,6 +470,7 @@ new kanban.Kanban("#root", { - v1.3 版本新增了 ***dateRange*** 类型 - v1.4 版本新增了 ***comments*** 和 ***links*** 编辑器类型,以及 ***format*** 参数 +- v1.6 版本新增了 ***modalSection*** 参数 - ***clearButton*** 参数被替换为 ***clear*** 参数 **相关文档:** [配置](guides/configuration.md/#editor) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md b/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md index b7cc6ccd..fe7ae80d 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_rendertype_config.md @@ -23,6 +23,8 @@ renderType?: "default" | "lazy"; :::important 如果您将 `renderType: "lazy"` 与 [`scrollType: "default"`](api/config/js_kanban_scrolltype_config.md) 设置结合使用,请务必通过 [`cardHeight`](api/config/js_kanban_cardheight_config.md) 属性指定卡片的固定高度。否则卡片将无法正确显示。 当您将 `renderType: "lazy"` 与 [`scrollType: "column"`](api/config/js_kanban_scrolltype_config.md) 搭配使用时,也应通过 [`cardHeight`](api/config/js_kanban_cardheight_config.md) 属性固定卡片的高度。虽然此布局类型支持卡片高度可变,但如果使用自定义卡片内容,可能无法稳定工作。 + +如果未设置 `cardHeight`,组件将根据 [`cardShape`](api/config/js_kanban_cardshape_config.md) 对卡片高度进行实验性近似估算。对于使用自定义 [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md) 的看板,请改为提供自定义的 [`getCardHeight`](api/config/js_kanban_getcardheight_config.md) 函数。 ::: ### 默认配置 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md b/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md index 2a3ccc5d..51fc55f9 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/api/config/js_kanban_scrolltype_config.md @@ -29,6 +29,8 @@ scrollType: "default" :::important 如果您将 [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) 和 `scrollType: "default"` 设置结合使用,请务必通过 [`cardHeight`](api/config/js_kanban_cardheight_config.md) 属性指定卡片的固定高度。否则卡片将无法显示。 当您将 [`renderType: "lazy"`](api/config/js_kanban_rendertype_config.md) 与 `scrollType: "column"` 一起使用时,也应该通过 [`cardHeight`](api/config/js_kanban_cardheight_config.md) 属性固定卡片的高度。尽管该布局类型支持可变高度的卡片,但如果卡片内容为自定义内容,显示效果可能不稳定。 + +如果未设置 `cardHeight`,组件将根据 [`cardShape`](api/config/js_kanban_cardshape_config.md) 对卡片高度进行实验性估算作为回退。对于使用自定义 [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md) 的看板,请改为提供自定义的 [`getCardHeight`](api/config/js_kanban_getcardheight_config.md) 函数。 ::: ### 示例 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md b/i18n/zh/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md index ec27ebf4..42e6090b 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/api/config/toolbar_items_config.md @@ -26,8 +26,8 @@ items?: [ } }, {...} ], - resultTemplate?: template(searchResult => { - return "搜索结果的 HTML 模板"; + resultTemplate?: template(({ result }) => { + return `HTML template using ${result.label}`; }) }, "sort" | { @@ -66,7 +66,7 @@ items?: [ - ***card*** - 卡片数据对象 - ***value*** - 搜索栏中指定的搜索值 - ***by*** - 用于搜索卡片的字段键 -- `searchResult` - (可选)用于显示自定义搜索结果的模板 +- `resultTemplate` - (可选)用于显示自定义搜索结果的模板 ~~~jsx items: [ @@ -93,10 +93,10 @@ items: [ } } ], - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, @@ -161,10 +161,10 @@ new kanban.Toolbar("#toolbar", { items: [ { type: "search", - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, @@ -182,10 +182,10 @@ new kanban.Toolbar("#toolbar", { - 在 v1.3 版本中新增了 *"Undo"* 和 *"Redo"* 控件 - 在 v1.4 版本中,**sort** 控件的 ***items.options[0].label*** 参数被替换为 ***items.options[0].text*** -- 在 v1.6 版本中,**"search"** 控件新增了 ***items.searchResult*** 参数 +- 在 v1.6 版本中,**"search"** 控件新增了 ***items.resultTemplate*** 参数 **相关文档:** [配置](guides/configuration.md#toolbar) 和 [自定义](guides/customization.md#custom-toolbar) **相关示例:** - [看板. 自定义工具栏](https://snippet.dhtmlx.com/s5r5h4ju?tag=kanban) -- [看板. 搜索结果中建议项的自定义](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban) \ No newline at end of file +- [看板. 搜索结果中建议项的自定义](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md b/i18n/zh/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md index 85168da7..ae871558 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/api/overview/internal_rest_overview.md @@ -6,11 +6,15 @@ description: 您可以在 DHTMLX JavaScript 看板库的文档中查看 JavaScri # RestDataProvider 方法 -| 名称 | 描述 | -| ------------------------------------------------------------ | ----------------------------------------------------------------- | -| [](api/provider/rest_methods/js_kanban_getcards_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcards_method.md) | -| [](api/provider/rest_methods/js_kanban_getcolumns_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcolumns_method.md) | -| [](api/provider/rest_methods/js_kanban_getlinks_method.md) | @getshort(api/provider/rest_methods/js_kanban_getlinks_method.md) | -| [](api/provider/rest_methods/js_kanban_getrows_method.md) | @getshort(api/provider/rest_methods/js_kanban_getrows_method.md) | -| [](api/provider/rest_methods/js_kanban_getusers_method.md) | @getshort(api/provider/rest_methods/js_kanban_getusers_method.md) | -| [](api/provider/rest_methods/js_kanban_send_method.md) | @getshort(api/provider/rest_methods/js_kanban_send_method.md) | \ No newline at end of file +| 名称 | 描述 | +| --------------------------------------------------------------- | --------------------------------------------------------------------- | +| [](api/provider/rest_methods/js_kanban_getcards_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcards_method.md) | +| [](api/provider/rest_methods/js_kanban_getcolumns_method.md) | @getshort(api/provider/rest_methods/js_kanban_getcolumns_method.md) | +| [](api/provider/rest_methods/js_kanban_gethandlers_method.md) | @getshort(api/provider/rest_methods/js_kanban_gethandlers_method.md) | +| [](api/provider/rest_methods/js_kanban_getidresolver_method.md) | @getshort(api/provider/rest_methods/js_kanban_getidresolver_method.md)| +| [](api/provider/rest_methods/js_kanban_getlinks_method.md) | @getshort(api/provider/rest_methods/js_kanban_getlinks_method.md) | +| [](api/provider/rest_methods/js_kanban_getqueue_method.md) | @getshort(api/provider/rest_methods/js_kanban_getqueue_method.md) | +| [](api/provider/rest_methods/js_kanban_getrows_method.md) | @getshort(api/provider/rest_methods/js_kanban_getrows_method.md) | +| [](api/provider/rest_methods/js_kanban_getusers_method.md) | @getshort(api/provider/rest_methods/js_kanban_getusers_method.md) | +| [](api/provider/rest_methods/js_kanban_send_method.md) | @getshort(api/provider/rest_methods/js_kanban_send_method.md) | +| [](api/provider/rest_methods/js_kanban_setheaders_method.md) | @getshort(api/provider/rest_methods/js_kanban_setheaders_method.md) | diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md b/i18n/zh/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md index 4f643e4c..2664a6fb 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/api/overview/properties_overview.md @@ -20,6 +20,7 @@ description: 您可以在 DHTMLX JavaScript Kanban 库的文档中查看 JavaScr | [](api/config/js_kanban_currentuser_config.md) | @getshort(api/config/js_kanban_currentuser_config.md) | | [](api/config/js_kanban_editor_config.md) | @getshort(api/config/js_kanban_editor_config.md) | | [](api/config/js_kanban_editorshape_config.md) | @getshort(api/config/js_kanban_editorshape_config.md) | +| [](api/config/js_kanban_getcardheight_config.md) | @getshort(api/config/js_kanban_getcardheight_config.md) | | [](api/config/js_kanban_history_config.md) | @getshort(api/config/js_kanban_history_config.md) | | [](api/config/js_kanban_links_config.md) | @getshort(api/config/js_kanban_links_config.md) | | [](api/config/js_kanban_locale_config.md) | @getshort(api/config/js_kanban_locale_config.md) | diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_gethandlers_method.md b/i18n/zh/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_gethandlers_method.md new file mode 100644 index 00000000..631822bf --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_gethandlers_method.md @@ -0,0 +1,54 @@ +--- +sidebar_label: getHandlers() +title: getHandlers REST 方法 +description: 您可以在 DHTMLX JavaScript Kanban 库的文档中了解 getHandlers REST 方法。浏览开发者指南和 API 参考,试用代码示例和在线演示,并下载免费 30 天评估版本的 DHTMLX Kanban。 +--- + +# getHandlers() + +### 描述 + +@short: 返回 RestDataProvider 用于向服务器发送数据操作的默认操作处理程序 + +:::info +**getHandlers()** 方法是用于与服务器交互的 **RestDataProvider** 服务的一部分。 +::: + +### 用法 + +~~~jsx {} +getHandlers(): object; +~~~ + +### 返回值 + +`getHandlers()` 方法返回一个对象,该对象将 [`RestDataProvider` 支持的数据操作](guides/working_with_server.md/#restdataprovider)映射到提供程序发送到服务器的请求。 + +返回的对象是 `RestDataProvider` 内部使用的默认操作映射。可以通过覆盖此方法来添加自定义处理程序,或使用自定义逻辑替换默认处理程序。 + +### 示例 + +要使用自定义处理程序扩展默认处理程序,请创建一个继承 `RestDataProvider` 的类并覆盖 `getHandlers()`。始终在覆盖中调用 `super.getHandlers()` 以保留默认处理程序: + +~~~jsx {3-11} +const url = "https://some_backend_url"; + +class MyDataProvider extends kanban.RestDataProvider { + getHandlers() { + const handlers = super.getHandlers(); + return { + ...handlers, + // custom or overridden handlers go here + }; + } +} + +const restProvider = new MyDataProvider(url); +board.api.setNext(restProvider); +~~~ + +:::warning +请勿手动将默认处理程序复制到覆盖中。默认操作映射的内容可能在版本之间发生变化;调用 `super.getHandlers()` 可确保您的自定义处理程序始终合并在当前默认值之上。 +::: + +**相关文章:** [与服务器配合使用](guides/working_with_server.md) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getidresolver_method.md b/i18n/zh/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getidresolver_method.md new file mode 100644 index 00000000..a549dac4 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getidresolver_method.md @@ -0,0 +1,58 @@ +--- +sidebar_label: getIDResolver() +title: getIDResolver REST 方法 +description: 您可以在 DHTMLX JavaScript Kanban 库的文档中了解 getIDResolver REST 方法。浏览开发者指南和 API 参考,查看代码示例和在线演示,并下载 DHTMLX Kanban 的 30 天免费评估版本。 +--- + +# getIDResolver() + +### 描述 + +@short: 返回一个将临时客户端 ID 解析为后端 ID 的函数 + +:::info +`getIDResolver()` 方法是 **RestDataProvider** 服务的一部分,用于与服务器进行交互。 +::: + +### 用法 + +~~~jsx {} +getIDResolver(): (id: string | number, type: number) => string | number; +~~~ + +### 返回值 + +该方法返回一个 `idResolver(id, type)` 函数: + +- `id` — 需要解析的实体 ID(临时客户端 ID 或常规 ID) +- `type` — 该 ID 所属的模型类型: + - `1` — 卡片(`CardID`) + - `2` — 行(`RowID`) + - `3` — 列(`ColumnID`) + - `4` — 链接(`LinkID`) + - `5` — 评论(`CommentID`) + +当客户端创建新实体(卡片、列、行、链接、评论)时,`RestDataProvider` 会为其分配一个临时客户端 ID,并记录服务器返回的后端 ID。`idResolver(id, type)` 函数会为其持有的任何临时 ID 返回对应的后端 ID。对于已与后端匹配的 ID,该函数将原样返回。 + +### 示例 + +最常见的使用场景是在多用户环境中将 `RestDataProvider` 与 `kanbanUpdates` 连接,使针对后端 ID 的服务器事件能正确应用于客户端仍以临时 ID 存在的实体: + +~~~jsx {6-9} +const url = "https://some_backend_url"; +const restProvider = new kanban.RestDataProvider(url); + +// other initialization... + +const handlers = kanbanUpdates( + board.api, + restProvider.getIDResolver() +); + +const events = new kanban.RemoteEvents(url + "/api/v1", token); +events.on(handlers); +~~~ + +同样的解析函数也可以在传递给 `RemoteEvents.on()` 的自定义处理程序中使用。完整示例请参阅[自定义服务器事件](guides/working_with_server.md/#customize-server-events)。 + +**相关文章:** [与服务器协作:多用户后端](guides/working_with_server.md/#multiuser-backend) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getqueue_method.md b/i18n/zh/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getqueue_method.md new file mode 100644 index 00000000..d11e056a --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_getqueue_method.md @@ -0,0 +1,34 @@ +--- +sidebar_label: getQueue() +title: getQueue REST Method +description: 您可以在 DHTMLX JavaScript Kanban 库的文档中了解 getQueue REST 方法。浏览开发者指南和 API 参考,查看代码示例和在线演示,并下载 DHTMLX Kanban 的免费 30 天评估版本。 +--- + +# getQueue() + +### 描述 + +@short: 返回 RestDataProvider 处理的内部操作队列 + +:::info +`getQueue()` 方法是 **RestDataProvider** 服务的一部分,用于与服务器进行交互。 +::: + +### 用法 + +~~~jsx {} +getQueue(): object; +~~~ + +### 返回值 + +该方法返回 `RestDataProvider` 用于处理发送到服务器的数据操作的内部 `ActionQueue` 实例。该队列负责: + +- 在待处理请求完成之前缓冲操作 +- 为新创建的实体分配临时客户端 ID,并在服务器响应后将其替换为后端 ID + +该队列由 `RestDataProvider` 的其他方法在内部使用。最常见的间接使用方式是通过 [`getIDResolver()`](api/provider/rest_methods/js_kanban_getidresolver_method.md),该方法基于队列的 ID 解析逻辑构建。 + +通常情况下,您无需直接调用 `getQueue()`。仅当需要对队列进行精细控制时(例如,在实现客户端与服务器之间的高级自定义同步时),才使用此方法。 + +**相关文章:** [与服务器配合使用](guides/working_with_server.md) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_setheaders_method.md b/i18n/zh/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_setheaders_method.md new file mode 100644 index 00000000..36a5c9fb --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/api/provider/rest_methods/js_kanban_setheaders_method.md @@ -0,0 +1,42 @@ +--- +sidebar_label: setHeaders() +title: setHeaders REST 方法 +description: 您可以在 DHTMLX JavaScript Kanban 库的文档中了解 setHeaders REST 方法。浏览开发者指南和 API 参考,查看代码示例和在线演示,并下载 DHTMLX Kanban 的免费 30 天评估版本。 +--- + +# setHeaders() + +### 描述 + +@short: 设置自定义 HTTP 请求头,RestDataProvider 会将其附加到每个发送至服务器的请求中 + +:::info +`setHeaders()` 方法是 **RestDataProvider** 服务的一部分,用于与服务器进行交互。 +::: + +### 用法 + +~~~jsx {} +setHeaders(headers: object): void; +~~~ + +### 参数 + +- `headers` - (必填)一个对象,其键为请求头名称,值为请求头的值。这些请求头会附加到默认的 `Content-Type: application/json` 请求头之后,并随每次通过 [`send()`](api/provider/rest_methods/js_kanban_send_method.md) 发送的请求一同传递。 + +### 示例 + +最常见的用例是为每个请求附加授权令牌: + +~~~jsx {4-6} +const url = "https://some_backend_url"; +const restProvider = new kanban.RestDataProvider(url); + +restProvider.setHeaders({ + "Remote-Token": "eyJpZCI6IjEzMzciLCJ1c2VybmFtZSI6ImJpem9uZSIsImlhdC...", +}); +~~~ + +如果只需为某个特定请求设置请求头而非所有请求,请将其作为第四个参数传递给 [`send()`](api/provider/rest_methods/js_kanban_send_method.md)。 + +**相关文章:** [与服务器协作:多用户后端](guides/working_with_server.md/#multiuser-backend) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/guides/configuration.md b/i18n/zh/docusaurus-plugin-content-docs/current/guides/configuration.md index aaeeec45..768963e0 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/guides/configuration.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/guides/configuration.md @@ -465,7 +465,7 @@ new kanban.Kanban("#root", { }); ~~~ -## 渲染与滚动 +## 渲染与滚动 {#rendering-and-scrolling} Kanban 控件默认渲染所有卡片并整体滚动看板。对于卡片数量较多的看板,可切换为懒加载渲染或按列独立滚动: @@ -487,6 +487,8 @@ new kanban.Kanban("#root", { :::important 当 `renderType: "lazy"` 与任意 `scrollType` 组合使用时,需通过 [`cardHeight`](api/config/js_kanban_cardheight_config.md) 属性为卡片设置固定高度。不设置 `cardHeight` 时,懒加载渲染将无法正确显示卡片。 + +如果在 `renderType: "lazy"` 和 `scrollType: "column"` 同时启用时省略了 `cardHeight`,控件将根据 [`cardShape`](api/config/js_kanban_cardshape_config.md) 中可见字段对卡片高度进行实验性的近似估算。对于使用自定义 [`cardTemplate`](api/config/js_kanban_cardtemplate_config.md) 的看板,控件无法预测渲染高度——请提供一个自定义的 [`getCardHeight(cardShape, card, cardWidth)`](api/config/js_kanban_getcardheight_config.md) 函数,返回卡片的预估高度。 ::: ## 变更历史 @@ -554,10 +556,10 @@ new kanban.Toolbar("#toolbar", { } } ], - resultTemplate: kanban.template(searchResult => { + resultTemplate: kanban.template(({ result }) => { return `
-
${searchResult.result.label}
- ${searchResult.result.description ? `
${searchResult.result.description}
` : ""} +
${result.label}
+ ${result.description ? `
${result.description}
` : ""}
` }) }, diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/guides/working_with_server.md b/i18n/zh/docusaurus-plugin-content-docs/current/guides/working_with_server.md index 17910be9..073a0b8c 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/guides/working_with_server.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/guides/working_with_server.md @@ -38,14 +38,47 @@ JavaScript Kanban 提供了 `RestDataProvider` 服务,完全支持与后端通 ## REST 方法 -`RestDataProvider` 服务提供以下用于动态数据加载的 REST 方法: +`RestDataProvider` 服务提供以下 REST 方法: - [`getCards()`](api/provider/rest_methods/js_kanban_getcards_method.md) — 获取 cards 数据的 Promise - [`getColumns()`](api/provider/rest_methods/js_kanban_getcolumns_method.md) — 获取 columns 数据的 Promise +- [`getHandlers()`](api/provider/rest_methods/js_kanban_gethandlers_method.md) — 返回 provider 使用的默认 action handler +- [`getIDResolver()`](api/provider/rest_methods/js_kanban_getidresolver_method.md) — 返回一个将临时客户端 ID 解析为后端 ID 的函数 - [`getLinks()`](api/provider/rest_methods/js_kanban_getlinks_method.md) — 获取 links 数据的 Promise +- [`getQueue()`](api/provider/rest_methods/js_kanban_getqueue_method.md) — 返回 provider 处理的内部 action 队列 - [`getRows()`](api/provider/rest_methods/js_kanban_getrows_method.md) — 获取 rows 数据的 Promise - [`getUsers()`](api/provider/rest_methods/js_kanban_getusers_method.md) — 获取 users 数据的 Promise - [`send()`](api/provider/rest_methods/js_kanban_send_method.md) — 发送自定义 HTTP 请求并返回 Promise +- [`setHeaders()`](api/provider/rest_methods/js_kanban_setheaders_method.md) — 设置附加到每个请求的自定义 HTTP 请求头 + +## 自定义 RestDataProvider + +要自定义 `RestDataProvider` 向服务器发送数据操作的方式,可以继承该类并覆盖其中的某个方法。最常见的自定义目标是默认 action handler——例如,为自定义事件添加 handler,或扩展现有操作的 payload。 + +若要在不丢失默认 handler 的情况下添加自定义 handler,请覆盖 [`getHandlers()`](api/provider/rest_methods/js_kanban_gethandlers_method.md) 方法,并将自定义条目合并到 `super.getHandlers()` 的结果之上: + +~~~js {3-11} +const url = "https://some_backend_url"; + +class MyDataProvider extends kanban.RestDataProvider { + getHandlers() { + const handlers = super.getHandlers(); + return { + ...handlers, + // custom or overridden handlers go here + }; + } +} + +const restProvider = new MyDataProvider(url); +board.api.setNext(restProvider); +~~~ + +:::warning +覆盖时务必调用 `super.getHandlers()` 并展开其结果。不要手动将默认 handler 复制到覆盖方法中——action 映射可能在不同版本间发生变化,硬编码的副本可能在不知不觉中与当前默认值脱节。 +::: + +另一个常见的自定义目标是 [`send()`](api/provider/rest_methods/js_kanban_send_method.md) 方法,每个默认 handler 都会调用该方法。覆盖 `send()` 可注入额外请求头、重写 URL,或为每个服务器请求添加自定义逻辑。 ## 与后端交互 @@ -196,7 +229,7 @@ events.on(handlers); -## 自定义服务器事件 +## 自定义服务器事件 {#customize-server-events} 要为服务器事件定义自定义逻辑,需将 `handlers` 对象传递给 `RemoteEvents.on(handlers)`。该对象的结构如下: diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/news/whats_new.md b/i18n/zh/docusaurus-plugin-content-docs/current/news/whats_new.md index cb873c5a..5222b096 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/news/whats_new.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/news/whats_new.md @@ -158,7 +158,7 @@ description: 您可以在 DHTMLX JavaScript UI 库的文档中了解 DHTMLX Kanb - 可通过 [`cardShape.users.maxCount`](api/config/js_kanban_cardshape_config.md) 属性设置卡片上显示的指派用户数量(参见 [**示例**](https://snippet.dhtmlx.com/w205dvzg?tag=kanban)) - 可通过 [`columnShape`](api/config/js_kanban_columnshape_config.md) 属性自定义列标题内容(参见 [**示例**](https://snippet.dhtmlx.com/gq2saz9c?tag=kanban)) -- 可通过工具栏 **搜索** 控件的 [`items.searchResult`](api/config/toolbar_items_config.md) 属性自定义搜索结果的视图和内容(参见 [**示例**](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban)) +- 可通过工具栏 **搜索** 控件的 [`items.resultTemplate`](api/config/toolbar_items_config.md) 属性自定义搜索结果的视图和内容(参见 [**示例**](https://snippet.dhtmlx.com/2uo2f5mf?tag=kanban)) - 可通过 [`editor.placement`](api/config/js_kanban_editor_config.md) 属性将编辑器显示为模态窗口(参见 [**示例**](https://snippet.dhtmlx.com/vt6pe7qz?tag=kanban)) - 可通过 [`cardShape.votes.clickable`](api/config/js_kanban_cardshape_config.md) 属性为卡片启用投票(在卡片上使用投票图标,参见 [**示例**](https://snippet.dhtmlx.com/en76xvi4?tag=kanban)) @@ -169,7 +169,8 @@ description: 您可以在 DHTMLX JavaScript UI 库的文档中了解 DHTMLX Kanb - [`cardShape`](api/config/js_kanban_cardshape_config.md) 属性新增 ***users.maxCount*** 和 ***votes.clickable*** 参数 - [`columnShape`](api/config/js_kanban_columnshape_config.md) 属性新增 ***headerTemplate*** 和 ***collapsedTemplate*** 参数 - [`editor`](api/config/js_kanban_editor_config.md) 属性新增 ***placement*** 参数 - - 工具栏 **搜索** 控件的 [`items`](api/config/toolbar_items_config.md) 属性新增 ***searchResult*** 参数 + - [`editorShape`](api/config/js_kanban_editorshape_config.md) 属性新增 ***modalSection*** 参数 + - 工具栏 **搜索** 控件的 [`items`](api/config/toolbar_items_config.md) 属性新增 ***resultTemplate*** 参数 - #### 事件 diff --git a/sidebars.js b/sidebars.js index 22f75196..467c0491 100644 --- a/sidebars.js +++ b/sidebars.js @@ -224,6 +224,8 @@ module.exports = { "api/config/js_kanban_editor_config", //"api/config/js_kanban_editorautosave_config", REMOVED "api/config/js_kanban_editorshape_config", + // G + "api/config/js_kanban_getcardheight_config", // H "api/config/js_kanban_history_config", // L @@ -322,10 +324,14 @@ module.exports = { items: [ "api/provider/rest_methods/js_kanban_getcards_method", "api/provider/rest_methods/js_kanban_getcolumns_method", + "api/provider/rest_methods/js_kanban_gethandlers_method", + "api/provider/rest_methods/js_kanban_getidresolver_method", "api/provider/rest_methods/js_kanban_getlinks_method", + "api/provider/rest_methods/js_kanban_getqueue_method", "api/provider/rest_methods/js_kanban_getrows_method", "api/provider/rest_methods/js_kanban_getusers_method", - "api/provider/rest_methods/js_kanban_send_method" + "api/provider/rest_methods/js_kanban_send_method", + "api/provider/rest_methods/js_kanban_setheaders_method" ] } ]