From 1e84a46e99252b7f4a512f367df3e88d9715f6ca Mon Sep 17 00:00:00 2001 From: kendo-bot Date: Tue, 12 Nov 2024 04:19:45 +0000 Subject: [PATCH] Sync with Kendo UI Professional --- .../2024-backwards-compatibility.md | 161 +++++ .../data-management/grid/editing/popup.md | 35 ++ .../editors/dateinput/overview.md | 15 + .../editors/datepicker/overview.md | 16 +- .../editors/daterangepicker/overview.md | 18 + .../editors/timepicker/overview.md | 15 +- .../sass-themes/compatibility.md | 55 ++ .../sass-themes/customization.md | 2 +- .../styles-and-layout/sass-themes/overview.md | 14 +- .../sass-themes/sass-theme-builder.md | 10 +- docs/api/javascript/ui/switch.md | 4 +- docs/api/javascript/ui/taskboard.md | 43 +- docs/api/javascript/ui/timepicker.md | 13 +- docs/api/javascript/ui/window.md | 15 +- docs/controls/grid/binding/data-binding.md | 1 - docs/introduction.md | 2 +- ...view-selection-with-checkboxes-kendo-ui.md | 128 ++++ .../sass-themes/compatibility.md | 1 + docs/third-party/kinvey.md | 127 ---- src/colorpicker/colorgradient.js | 6 +- src/kendo.autocomplete.js | 2 +- src/kendo.core.js | 3 +- src/kendo.resizable.js | 8 +- src/kendo.splitter.js | 580 ++++++++++++++---- src/kendo.toolbar.js | 7 +- src/kendo.window.js | 2 +- tests/splitter/expandcollapse.js | 10 +- tests/splitter/initialization.js | 7 +- tests/splitter/navigation.js | 38 +- tests/splitter/paneresizing.js | 16 +- tests/splitter/panesizing.js | 6 +- 31 files changed, 994 insertions(+), 366 deletions(-) create mode 100644 docs-aspnet/styles-and-layout/sass-themes/compatibility.md create mode 100644 docs/knowledge-base/how-to-sync-listview-selection-with-checkboxes-kendo-ui.md delete mode 100644 docs/third-party/kinvey.md diff --git a/docs-aspnet/backwards-compatibility/2024-backwards-compatibility.md b/docs-aspnet/backwards-compatibility/2024-backwards-compatibility.md index bb8191f2b99..dc778ae5b33 100644 --- a/docs-aspnet/backwards-compatibility/2024-backwards-compatibility.md +++ b/docs-aspnet/backwards-compatibility/2024-backwards-compatibility.md @@ -98,6 +98,167 @@ The code is moved to the demo application, where it is used for demo purposes on | ----------- | ----------- | | `Resizable(String)` | [`Resize(TextAreaResize)`](/api/kendo.mvc.ui.fluent/textareabuilder#resizekendomvcuitextarearesize) | +### Class Changes in Components + +**AIPrompt** + +* The `k-button-flat-primary` class is now replaced with `k-button-flat-base` class. +* Added `k-prompt-view` and `k-prompt-popup`. + +**ContextMenu** + +* The `k-widget` class is now removed. +* The `k-menu-expand-arrow-icon` class has also been removed. + +**DockManager** + +* Buttons in the vertical toolbar are now size `k-button-sm`, instead of `k-button-md`. +* Unpinned pane has now class `k-pane-unpinned` instead of `k-pane-pinned`. +* Pin and close button of not active TabStrip Tabs now have `k-button-flat-primary`, instead of `k-button-flat-base`. + +**Grid** + +* Added `k-button-icon.k-icon.k-svg-i-arrow-rotate-cw.k-svg-icon` to the refresh button in the pager. +* Added `k-drag-col` to the draggable of the grid. +* Added `k-filtercell-operator` div wrapper on the filter dropdown and clear button. +* Added `k-grid-add-row`. +* Added `k-table-group` class to `k-group-cell.k-table-group-td.k-table-td`. +* Added `k-input-icon`. +* Removed `k-label` class from extra class on `k-pager-info`. +* Removed `k-reorderable` class from `tbody` of a reorderable grid. +* Removed `k-editable` class. + +**ImageEditor** + +* The `k-widget` class is now removed. +* The `k-imageeditor-pane-confirm-button` and `k-imageeditor-pane-button` classes have been removed from the resize/crop pane buttons. +* The `k-colspan-1` class is removed from the `k-col-span-1` element. +* The `k-colspan-2` class is removed from the `k-col-span-2` element. + +**Map** + +* The following classes have been substituted: + +|Versions prior to 2024 Q4| Versions 2024 Q4 and later +|:--- |:--- +|`k-navigator-up`| `k-navigator-n` | +|`k-navigator-right`| `k-navigator-e` | +|`k-navigator-down`| `k-navigator-s` | +|`k-navigator-left`| `k-navigator-w` | + +* The `k-widget` class is now removed. +* The `km-widget` class has also been removed. +* Added `k-button-group-solid` class on the Zoom button group. + +**Menu** + +* The `k-vertical` class is removed from the scroll wrapper when the Menu is scrollable. +* The `k-horizontal` class is removed from the scroll wrapper when the Menu is scrollable. +* The `k-widget` is now removed. +* The `k-menu-expand-arrow-icon` is now removed. +* The `k-group` class has also been removed. +* With the latest theme changes the following classes of the scroll buttons are removed: `k-scroll-up`, `k-scroll-down`, `k-scroll-left`, `k-scroll-right`, `k-rounded` +* Changed `k-button-solid` to `k-button-flat` on the scroll buttons +* Changed `k-button-solid-base` to `k-button-flat-base` on the scroll buttons +* Added `k-menu-scroll-wrapper-vertical` to the `div.k-menu-scroll-wrapper` only when the orientation is vertical, not applicable for the horizontal orientation + +**PDFViewer** + +* The PDFViewer starts using the [Pager](https://demos.telerik.com/{{ site.platform }}/pager/index) component internally and follows its specification. +* Added `k-icon` class to the `k-dropzone-icon` in the center of the viewer. +* Added `k-toolbar-combobox` to the combobox for zoom options. +* Removed `k-widget`. +* Removed `k-zoom-in-out-group` on the zoom tools buttongroup. +* Removed `k-toggle-selection-group` on selection buttongroup. + +**PivotGridV2** + +The following classes are now removed: + +* The `k-pivotgrid-header-total` class rendered in the total row of PivotGrid aggregates is replaced by `k-pivotgrid-total`. +* The `k-grid-header-table` class is now removed. +* The `k-table-md` class is removed from the `.k-pivotgrid-table` tables. +* The `k-table-tbody` has been removed from the `.k-pivotgrid-tbody` elements. +* The `k-table-row` class is now removed from the `.k-pivotgrid-row` elements. +* The `k-grid-table` class has been removed from the `.k-pivotgrid-table` values table. +* The `k-table-th` has been removed from the `th.k-pivotgrid-cell` elements. +* The `k-table-td` has been removed from the `td.k-pivotgrid-cell` elements. +* The `k-pos-relative` and `k-widget` classes are now removed from the Configurator. +* The `k-rounded-full` class is substituted by `k-round-md`. +* Added `k-pivotgrid-expanded` on an expanded header. +* The text of a header is now rendered in a span element with `k-pivotgrid-header-title` class. +* The content of a cell is rendered in a span element with this `k-pivotgrid-content` class. +* The form in the configurator has `k-form-md` class added to its `k-form` class. +* Added `k-chip-more-action` class on the more action span in configurator chip. + +**Scheduler** + +* The following classes are substituted as follows: + +|Versions prior to 2024 Q4| Versions 2024 Q4 and later +|:--- |:--- +|`k-nav-today`| `[data-selector='today']` +|`k-nav-prev`| `[data-selector='previous']` +|`k-nav-next`| `[data-selector='next']` +|`k-view-month`| `[data-selector='month']` +|`k-view-week`| `[data-selector='week']` +|`k-view-day`| `[data-selector='day']` +|`k-view-agenda`| `[data-selector='agenda']` +|`k-view-timeline`| `[data-selector='timeline']` +|`k-svg-i-arrow-left`| `k-i-caret-alt-left` +|`k-svg-i-arrow-right`| `k-i-caret-alt-right` + +* The `k-button-rectangle` is removed from the buttons in views ButtonGroup. +* The`k-heading-cell` is removed from the Scheduler first column. +* The `k-scheduler-table-auto` is removed from the Month view. +* The `k-scheduler-group-cell` is removed from grouped Scheduler. +* Added `k-scheduler-navigation` class to Today, Previous and Next buttongroup. +* Added `k-scheduler-views` class to views buttongroup. +* Added `k-scheduler-cell` class to Weekview, dayview, timelineview. +* Added `k-group-cell` class. +* Removed `k-event-top-actions` element from scheduler events. +* Removed `k-event-bottom-actions` element from scheduler events +* Removed `k-last` from inappropriate scenarios. +* Replaced `k-svg-i-arrow-` classes of Prev and Next buttons in RTL Scheduler with `k-svg-i-caret-alt`. + +**Splitter** + +The Splitter has received a rendering update. As a result, the below classes have been added: + +* New `k-splitter-flex` and `k-splitter-vertical/horizontal` classes have been added to the `k-splitter` root `div` element. +* New `k-pane-static` class has been added to the non-resizable panes. +* New `k-hidden` class has been added to the collapsed panes. + +Apart from that, we made changes in the positioning styles of the component. Until now, the panes had the `position:absolute` style. As of the 2024 Q4 release, the panes are positioned using flexbox. + +**TabStrip** + +* The `k-widget` class has been removed. +* The `k-tabstrip-item` class has been removed. +* The `k-tab-on-top` class has been removed. +* The `k-content` class has been removed. +* `k-link-text` is added. + +**ToolBar** + +* The following classes have been replaced or removed: + +|Versions prior to 2024 Q4| Versions 2024 Q4 and later +|:--- |:--- +|`k-toolbar-tool`| `[data-item-role='toolbar-tool']` + +* The `k-toolbar-toggle-button` class has been removed. +* The `k-dropdown-button` class has also been removed. + +This change is applied to all components that use the Toolbar internally, such as Grid, Gantt, Scheduler, etc. + +**TreeList** + +* The `k-i-none` class has been replaced with `ref-blank-icon` attribute. +* The `k-grid-display-block` class is now removed from `.k-treelist` element. +* Added `k-drag-col` to the col element for draggable column both in the header table and the body table. + + ## {{ site.product }} Q2 2024 ### Target Framework diff --git a/docs-aspnet/html-helpers/data-management/grid/editing/popup.md b/docs-aspnet/html-helpers/data-management/grid/editing/popup.md index cbef4e65343..c5ed3f7c258 100644 --- a/docs-aspnet/html-helpers/data-management/grid/editing/popup.md +++ b/docs-aspnet/html-helpers/data-management/grid/editing/popup.md @@ -264,6 +264,41 @@ When editing is performed, server validation is often needed. This section demon } ``` + +{% if site.core %} +## Using DateOnly and TimeOnly properties with .NET 6 + +`DateOnly` and `TimeOnly` types were introduced with .NET 6, however serialization and model binding support were introduced by the framework at a later stage. + +In order to edit `DateOnly` or `TimeOnly` properties when using a Grid configured for PopUp editing in a .NET 6 application you will need to provide a custom PopUp editor template where editors for these properties are defined: +```OrderViewModel.cs + public class OrderViewModel + { + public int OrderID { get; set; } + + public DateOnly ShipDate { get; set; } + } +``` +```CustomEditorTemplate.cshtml + @model OrderViewModel + +
+ @Html.LabelFor(model => model.OrderID) + @Html.EditorFor(model => model.OrderID) +
+
+ @Html.LabelFor(model => model.ShipDate) + @Html.Kendo().DatePickerFor(model => model.ShipDate) +
+``` +```HtmlHelper + @(Html.Kendo().Grid() + .Name("grid") + .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("CustomEditorTemplate")) + ) +``` +{% endif%} + ## See Also * [Editing Approaches by the Grid HtmlHelper for {{ site.framework }} (Demos)](https://demos.telerik.com/{{ site.platform }}/grid/editing) diff --git a/docs-aspnet/html-helpers/editors/dateinput/overview.md b/docs-aspnet/html-helpers/editors/dateinput/overview.md index c6d94afc515..6cef22f2723 100644 --- a/docs-aspnet/html-helpers/editors/dateinput/overview.md +++ b/docs-aspnet/html-helpers/editors/dateinput/overview.md @@ -43,6 +43,21 @@ The following example demonstrates the basic configuration for the DateInput. @[template](/_contentTemplates/core/declarative-initialization-note.md#declarative-initialization-note) {% endif %} +{% if site.core %} +## DateOnly and TimeOnly compatability + +As of the 2024 Q4 Release the {{ site.framework }} DateInput is compatible with the [`DateOnly`](https://learn.microsoft.com/en-us/dotnet/api/system.dateonly?view=net-8.0) and [`TimeOnly`](https://learn.microsoft.com/en-us/dotnet/api/system.timeonly?view=net-8.0) types. Following this release you can also set the value of the component to a `DateOnly` or a `TimeOnly` property: + +```HtmlHelper + @(Html.Kendo().DateInput().Name("dateOnly").Value(new DateOnly(2024,5,6))) + @(Html.Kendo().DateInput().Name("timeOnly").Value(new TimeOnly(10,20,30))) +``` +```TagHelper + + +``` +{% endif %} + ## Functionality and Features * [Appearance](https://docs.telerik.com/{{ site.platform }}/html-helpers/editors/dateinput/appearance)—You are able to customize the appearance of the DateInput by configuring its size, fill mode, and border radius. diff --git a/docs-aspnet/html-helpers/editors/datepicker/overview.md b/docs-aspnet/html-helpers/editors/datepicker/overview.md index a4c1e2ba8e4..581b9e66176 100644 --- a/docs-aspnet/html-helpers/editors/datepicker/overview.md +++ b/docs-aspnet/html-helpers/editors/datepicker/overview.md @@ -37,7 +37,7 @@ The following example demonstrates the basic configuration for the DatePicker. {% if site.core %} ```TagHelper @@ -68,6 +68,20 @@ The DatePicker component respects DataAnnotations when the `DatePickerFor(m=>m.P public DateTime MyDateTimeProperty{ get; set; } ``` +{% if site.core %} +## DateOnly compatability + +As of the 2024 Q4 Release the {{ site.framework }} DatePicker is compatible with the [`DateOnly`](https://learn.microsoft.com/en-us/dotnet/api/system.dateonly?view=net-8.0) type. Following this release you can also set the value of the component to a `DateOnly` property: + +```HtmlHelper + @(Html.Kendo().DatePicker().Name("datePicker").Value(new DateOnly(2024,5,6))) +``` +```TagHelper + + +``` +{% endif %} + ## Functionality and Features |Feature|Description| diff --git a/docs-aspnet/html-helpers/editors/daterangepicker/overview.md b/docs-aspnet/html-helpers/editors/daterangepicker/overview.md index 0dd2f13ff03..6f083405810 100644 --- a/docs-aspnet/html-helpers/editors/daterangepicker/overview.md +++ b/docs-aspnet/html-helpers/editors/daterangepicker/overview.md @@ -48,6 +48,24 @@ The following example demonstrates the basic configuration for the DateRangePick @[template](/_contentTemplates/core/declarative-initialization-note.md#declarative-initialization-note) {% endif %} +{% if site.core %} +## DateOnly compatability + +As of the 2024 Q4 Release the {{ site.framework }} DateRangePicker is compatible with the [`DateOnly`](https://learn.microsoft.com/en-us/dotnet/api/system.dateonly?view=net-8.0) type. Following this release you can also set the `Start` and `End` range of the component to a `DateOnly` property: + +```HtmlHelper + @(Html.Kendo().DateRangePicker() + .Name("daterangepicker") + .Range(r => r.Start(new DateOnly(2024,5,6)).End(new DateOnly(2024,5,6).AddDays(10))) // Sets the range of the DateRangePicker. + ) +``` +```TagHelper + + + +``` +{% endif %} + ## Functionality and Features | Feature | Description | diff --git a/docs-aspnet/html-helpers/editors/timepicker/overview.md b/docs-aspnet/html-helpers/editors/timepicker/overview.md index 3904c713838..f1bb98d85d4 100644 --- a/docs-aspnet/html-helpers/editors/timepicker/overview.md +++ b/docs-aspnet/html-helpers/editors/timepicker/overview.md @@ -84,7 +84,20 @@ The TimePicker component respects DataAnnotation attributes when using the `Time [Range(typeof(DateTime), minimum: "01/01/2023 03:00:00 AM", maximum: "12/31/2023 10:00:00 AM")] public DateTime MyDateTimeProperty{ get; set; } ``` - + +{% if site.core %} +## TimeOnly compatability + +As of the 2024 Q4 Release the {{ site.framework }} TimePicker is compatible with the [`TimeOnly`](https://learn.microsoft.com/en-us/dotnet/api/system.timeonly?view=net-8.0) type. Following this release you can also set the value of the component to a `TimeOnly` property: + +```HtmlHelper + @(Html.Kendo().TimePicker().Name("timeOnly").Value(new TimeOnly(10,20,30))) +``` +```TagHelper + +``` +{% endif %} + ## Functionality and Features |Feature|Description| diff --git a/docs-aspnet/styles-and-layout/sass-themes/compatibility.md b/docs-aspnet/styles-and-layout/sass-themes/compatibility.md new file mode 100644 index 00000000000..24cadb7b22a --- /dev/null +++ b/docs-aspnet/styles-and-layout/sass-themes/compatibility.md @@ -0,0 +1,55 @@ +--- +title: Compatibility +page_title: Compatibility +description: "Learn about the compatibility of the Kendo UI SASS Themes and the {{ site.product }} versions." +slug: sass_themes_compatibility_aspnetmvc6_aspnetmvc +position: 5 +--- +# Compatibility +The following table lists the Telerik UI for {{ site.framework }} versions and the Kendo UI themes versions, which are mutually compatible. + +| Telerik UI for {{ site.framework }} | Kendo UI Sass Themes | +|:--- |:--- | +| Telerik UI 2024.4.1112 (Q4 2024) | @progress/kendo-theme-bootstrap@10.0.1
@progress/kendo-theme-classic@10.0.1
@progress/kendo-theme-default@10.0.1
@progress/kendo-theme-fluent@10.0.1
@progress/kendo-theme-material@10.0.1 | +| Telerik UI 2024.3.1015 (2024.3.1015) | @progress/kendo-theme-bootstrap@9.0.0
@progress/kendo-theme-classic@9.0.0
@progress/kendo-theme-default@9.0.0
@progress/kendo-theme-fluent@9.0.0
@progress/kendo-theme-material@9.0.0 | +| Telerik UI 2024.3.806 (Q3 2024) | @progress/kendo-theme-bootstrap@8.2.1
@progress/kendo-theme-classic@8.2.1
@progress/kendo-theme-default@8.2.1
@progress/kendo-theme-fluent@8.2.1
@progress/kendo-theme-material@8.2.1 | +| Telerik UI 2024.2.514 (Q2 2024) | @progress/kendo-theme-bootstrap@8.0.1
@progress/kendo-theme-classic@8.0.1
@progress/kendo-theme-default@8.0.1
@progress/kendo-theme-fluent@8.0.1
@progress/kendo-theme-material@8.0.1 | +| Telerik UI 2024.1.319 (2024.1.319) | @progress/kendo-theme-bootstrap@7.2.1
@progress/kendo-theme-classic@7.2.1
@progress/kendo-theme-default@7.2.1
@progress/kendo-theme-fluent@7.2.1
@progress/kendo-theme-material@7.2.1 | +| Telerik UI 2024.1.130 (Q1 2024) | @progress/kendo-theme-bootstrap@7.2.0
@progress/kendo-theme-classic@7.2.0
@progress/kendo-theme-default@7.2.0
@progress/kendo-theme-fluent@7.2.0
@progress/kendo-theme-material@7.2.0 | +| Telerik UI 2023.3.1114 (R3 2023 SP1) | @progress/kendo-theme-bootstrap@7.0.2
@progress/kendo-theme-classic@7.0.2
@progress/kendo-theme-default@7.0.2
@progress/kendo-theme-fluent@7.0.2
@progress/kendo-theme-material@7.0.2 | +| Telerik UI 2023.3.1010 (R3 2023) | @progress/kendo-theme-bootstrap@7.0.1
@progress/kendo-theme-classic@7.0.1
@progress/kendo-theme-default@7.0.1
@progress/kendo-theme-fluent@7.0.1
@progress/kendo-theme-material@7.0.1 | +| Telerik UI 2023.2.829 (R2 2023 SP2) | @progress/kendo-theme-bootstrap@6.7.0
@progress/kendo-theme-classic@6.7.0
@progress/kendo-theme-default@6.7.0
@progress/kendo-theme-fluent@6.7.0
@progress/kendo-theme-material@6.7.0 | +| Telerik UI 2023.2.718 (R2 2023 SP1) | @progress/kendo-theme-bootstrap@6.6.0
@progress/kendo-theme-classic@6.6.0
@progress/kendo-theme-default@6.6.0
@progress/kendo-theme-fluent@6.6.0
@progress/kendo-theme-material@6.6.0 | +| Telerik UI 2023.2.606 (R2 2023) | @progress/kendo-theme-bootstrap@6.4.0
@progress/kendo-theme-classic@6.4.0
@progress/kendo-theme-default@6.4.0
@progress/kendo-theme-fluent@6.4.0
@progress/kendo-theme-material@6.4.0 | +| Telerik UI 2023.1.425 (R1 2023 SP2) | @progress/kendo-theme-bootstrap@6.3.0
@progress/kendo-theme-classic@6.3.0
@progress/kendo-theme-default@6.3.0
@progress/kendo-theme-fluent@6.3.0
@progress/kendo-theme-material@6.3.0 | +| Telerik UI 2023.1.314 (R1 2023 SP1) | @progress/kendo-theme-bootstrap@6.2.0
@progress/kendo-theme-classic@6.2.0
@progress/kendo-theme-default@6.2.0
@progress/kendo-theme-fluent@6.2.0
@progress/kendo-theme-material@6.2.0 | +| Telerik UI 2023.1.117 (R1 2023) | @progress/kendo-theme-bootstrap@5.10.0
@progress/kendo-theme-classic@5.10.0
@progress/kendo-theme-default@5.10.0
@progress/kendo-theme-fluent@5.10.0
@progress/kendo-theme-material@5.10.0 | +| Telerik UI 2022.3.1109 (R3 2022 SP1) | @progress/kendo-theme-bootstrap@5.10.0
@progress/kendo-theme-default@5.10.0
@progress/kendo-theme-material@5.10.0
@progress/kendo-theme-classic@5.10.0
@progress/kendo-theme-fluent@5.10.0 | +| Telerik UI 2022.3.913 (R3 2022) | @progress/kendo-theme-bootstrap@5.8.0
@progress/kendo-theme-default@5.8.0
@progress/kendo-theme-material@5.8.0
@progress/kendo-theme-classic@5.8.0
@progress/kendo-theme-fluent@5.8.0 | +| Telerik UI 2022.2.802 (R2 2022 SP2) | @progress/kendo-theme-bootstrap@5.6.0
@progress/kendo-theme-default@5.6.0
@progress/kendo-theme-material@5.6.0
@progress/kendo-theme-classic@5.6.0 | +| Telerik UI 2022.2.621 (R2 2022 SP1) | @progress/kendo-theme-bootstrap@5.5.0
@progress/kendo-theme-default@5.5.0
@progress/kendo-theme-material@5.5.0
@progress/kendo-theme-classic@5.5.0 | +| Telerik UI 2022.2.510 (R2 2022) | @progress/kendo-theme-bootstrap@5.4.0
@progress/kendo-theme-default@5.4.0
@progress/kendo-theme-material@5.4.0
@progress/kendo-theme-classic@5.4.0 | +| Telerik UI 2022.1.412 (R1 2022 SP2) | @progress/kendo-theme-bootstrap@5.3.0
@progress/kendo-theme-default@5.3.0
@progress/kendo-theme-material@5.3.0
@progress/kendo-theme-classic@5.3.0 | +| Telerik UI 2022.1.301 (R1 2022 SP1) | @progress/kendo-theme-bootstrap@5.2.0
@progress/kendo-theme-default@5.2.0
@progress/kendo-theme-material@5.2.0
@progress/kendo-theme-classic@5.2.0 | +| Telerik UI 2022.1.119 (R1 2022) | @progress/kendo-theme-bootstrap@5.0.0
@progress/kendo-theme-default@5.0.0
@progress/kendo-theme-material@5.0.0
@progress/kendo-theme-classic@5.0.0 | +| Telerik UI 2021.3.1207 (R3 2021 SP2) | @progress/kendo-theme-bootstrap@4.42.0
@progress/kendo-theme-default@4.42.0
@progress/kendo-theme-material@4.42.0
@progress/kendo-theme-classic@4.42.0 | +| Telerik UI 2021.3.1109 (R3 2021 SP1) | @progress/kendo-theme-bootstrap@4.42.0
@progress/kendo-theme-default@4.42.0
@progress/kendo-theme-material@4.42.0
@progress/kendo-theme-classic@4.42.0 | +| Telerik UI 2021.3.914 (R3 2021) | @progress/kendo-theme-bootstrap@4.41.2
@progress/kendo-theme-default@4.41.2
@progress/kendo-theme-material@4.41.2
@progress/kendo-theme-classic@4.41.2 | +| Telerik UI 2021.2.616 (R2 2021 SP1) | @progress/kendo-theme-bootstrap@4.35.1
@progress/kendo-theme-default@4.38.1
@progress/kendo-theme-material@3.33.1 | +| Telerik UI 2021.2.511 (R2 2021) | @progress/kendo-theme-bootstrap@4.35.1
@progress/kendo-theme-default@4.38.1
@progress/kendo-theme-material@3.33.1 | +| Telerik UI 2021.1.330 (R1 2021 SP2) | @progress/kendo-theme-bootstrap@4.33.0
@progress/kendo-theme-default@4.35.0
@progress/kendo-theme-material@3.31.0 | +| Telerik UI 2021.1.224 (R1 2021 SP1) | @progress/kendo-theme-bootstrap@4.31.0
@progress/kendo-theme-default@4.33.0
@progress/kendo-theme-material@3.29.0 | +| Telerik UI 2021.1.119 (R1 2021) | @progress/kendo-theme-bootstrap@4.30.0
@progress/kendo-theme-default@4.32.0
@progress/kendo-theme-material@3.28.0 | +| Telerik UI 2020.3.1118 (R3 2020 SP2) | @progress/kendo-theme-bootstrap@4.24.0
@progress/kendo-theme-default@4.26.0
@progress/kendo-theme-material@3.22.0 | +| Telerik UI 2020.3.1021 (R3 2020 SP1) | @progress/kendo-theme-bootstrap@4.23.0
@progress/kendo-theme-default@4.25.0
@progress/kendo-theme-material@3.21.0 | +| Telerik UI 2020.3.915 (R3 2020) | @progress/kendo-theme-bootstrap@4.21.0
@progress/kendo-theme-default@4.22.1
@progress/kendo-theme-material@3.19.1 | +| Telerik UI 2020.2.617 (R2 2020 SP1) | @progress/kendo-theme-bootstrap@4.17.0
@progress/kendo-theme-default@4.19.0
@progress/kendo-theme-material@3.16.0 | +| Telerik UI 2020.2.513 (R2 2020) | @progress/kendo-theme-bootstrap@4.16.1
@progress/kendo-theme-default@4.18.1
@progress/kendo-theme-material@3.15.1 | + +## Compatibility with Bootstrap Framework + +Starting with R3 of 2021 or v4.40.0, the Kendo UI Bootstrap theme is based on Bootstrap v5. + +There are many changes and tweaks between Bootstrap v4 and Bootstrap v5. To revert to the previous appearance, we provide color [swatches]({% slug sassbasedthemes_overview%}#swatch) for Bootstrap v4 and even Bootstrap v3. They are available in the [kendo-themes GitHub repository](https://github.com/telerik/kendo-themes/tree/master/packages/bootstrap/lib/swatches). Follow the steps described in the Bootstrap Theme Swatches documentation to include the desired color swatch in your application. + +> Bootstrap uses semantic versioning, which means that Kendo UI Bootstrap theme is no longer compatible with Bootstrap 4 and will throw errors when compiled against Bootstrap 4. More information about the migration process and changes could be found in [kendo-themes GitHub repository](https://github.com/telerik/kendo-themes/issues/2154). \ No newline at end of file diff --git a/docs-aspnet/styles-and-layout/sass-themes/customization.md b/docs-aspnet/styles-and-layout/sass-themes/customization.md index 978867ce544..09b7fb065b2 100644 --- a/docs-aspnet/styles-and-layout/sass-themes/customization.md +++ b/docs-aspnet/styles-and-layout/sass-themes/customization.md @@ -113,7 +113,7 @@ Upgrading may require changes to the additional custom CSS code, but only if the ## Using CSS Utilities -The CSS Utilities allows you to create the desired layout using a collection of CSS classes. Each utility class changes the appearance of the target element by applying a specific CSS rule. For more information on the Telerik UI CSS Utilities and how to install the package, [refer to the CSS Utilities documentation](https://www.telerik.com/design-system/docs/utils/get-started/introduction/). +The CSS Utilities allows you to create the desired layout using a collection of CSS classes. Each utility class changes the appearance of the target element by applying a specific CSS rule. For more information on the Telerik UI CSS Utilities and how to install the package, refer to the CSS Utilities documentation. ## Building Themes From Source Code diff --git a/docs-aspnet/styles-and-layout/sass-themes/overview.md b/docs-aspnet/styles-and-layout/sass-themes/overview.md index 0a7b64ac0a0..6b2c585bcbe 100644 --- a/docs-aspnet/styles-and-layout/sass-themes/overview.md +++ b/docs-aspnet/styles-and-layout/sass-themes/overview.md @@ -3,7 +3,7 @@ title: Overview page_title: Overview description: "The {{ site.product }} suite comes with a set of built-in themes that you can choose from. Bootstrap and Material themes are also included." slug: sassbasedthemes_overview -previous_url: /styles-and-layout/sass-themes/installation, /styles-and-layout/sass-themes/browser-support, /styles-and-layout/sass-themes/compatibility, /styles-and-layout/sass-themes/swatches, /styles-and-layout/figma-kits, /styles-and-layout/sass-themes/figma-kits +previous_url: /styles-and-layout/sass-themes/installation, /styles-and-layout/sass-themes/browser-support, /styles-and-layout/sass-themes/swatches, /styles-and-layout/figma-kits, /styles-and-layout/sass-themes/figma-kits position: 1 --- @@ -11,13 +11,9 @@ position: 1 {{ site.product }} comes with a set of built-in CSS themes that control the visual appearance of the components. Each theme determines the components' colors, borders, backgrounds, size, layout, position, font size, and more. -## Basics - -### Theme - A *theme* is a collection of styles in a CSS file, which determine the appearance of the components, including fonts, colors, sizes, and layouts. For example, *Default* and *Bootstrap* are two [built-in theme names](#built-in-themes). -### Swatch +## Swatch A *theme swatch* is a color variation of a theme. All swatches of a given theme use the same fonts, sizes, and layouts. On the other hand, the text colors, background colors and border colors are different. For example, *Default Ocean Blue* and *Bootstrap Nordic* are two built-in swatch names. @@ -25,7 +21,7 @@ When the {{ site.product }} documentation talks about a given theme name, for ex The CSS file of any swatch is self-sufficient and contains all required styles for the components, except the optional [font icon styles]({%slug webfonticons_aspnetmvc6_aspnetmvc%}). You can [switch the theme runtime]({%slug howto_changethemeontheclient%}), but the {{ site.framework }} app must always load only one theme at a time. -### Integration with the Telerik Components +## Integration with the Telerik Components The CSS themes represent an external dependency to {{ site.product }}: @@ -63,7 +59,7 @@ The Telerik themes are decoupled from the Telerik UI components, which leads to >If you have an older version of the Telerik Extensions for Visual Studio and you want to create a new {{ site.product }} project with version 2023.1.314 (R1 2023 SP1), or a newer version of the components, you must first update the Telerik Extension. To download and install the latest version of the Telerik Extensions, follow the [Installing from Visual Studio Marketplace]({% slug overview_visualstudio_aspnetcore %}#installing-from-visual-studio-marketplace) instructions. -* When loading theme swatches from a CDN, make sure that the theme version is compatible with the {{ site.product }} version. Our {% if site.core %}[release notes](https://www.telerik.com/support/whats-new/aspnet-core-ui/release-history){% else %}[release notes](https://www.telerik.com/support/whats-new/aspnet-mvc/release-history){% endif %} provide theme compatibility information for each components version. You can also use a newer minor theme version, which doesn't contain breaking changes. In other words, the latest major theme version may be still incompatible with the latest version of {{ site.product }}. +* When loading theme swatches from a CDN, make sure that the theme version is compatible with the {{ site.product }} version. Our {% if site.core %}[release notes](https://www.telerik.com/support/whats-new/aspnet-core-ui/release-history){% else %}[release notes](https://www.telerik.com/support/whats-new/aspnet-mvc/release-history){% endif %} or [compatibility table]({% slug sass_themes_compatibility_aspnetmvc6_aspnetmvc %}) provide theme compatibility information for each components version. You can also use a newer minor theme version, which doesn't contain breaking changes. In other words, the latest major theme version may be still incompatible with the latest version of {{ site.product }}. ## Next Steps @@ -74,4 +70,4 @@ The Telerik themes are decoupled from the Telerik UI components, which leads to * [Change the Theme at Runtime]({%slug howto_changethemeontheclient%}) * Default Ocean Blue Accessibility Swatch -* [Live UI for Blazor Demos](https://demos.telerik.com/{{ site.platform }}/) \ No newline at end of file +* [Live {{ site.product_short }} Demos](https://demos.telerik.com/{{ site.platform }}/) diff --git a/docs-aspnet/styles-and-layout/sass-themes/sass-theme-builder.md b/docs-aspnet/styles-and-layout/sass-themes/sass-theme-builder.md index beb71a28238..4f3b03ee618 100644 --- a/docs-aspnet/styles-and-layout/sass-themes/sass-theme-builder.md +++ b/docs-aspnet/styles-and-layout/sass-themes/sass-theme-builder.md @@ -9,13 +9,13 @@ position: 3 # ThemeBuilder -The [ThemeBuilder is an online tool](https://themebuilderapp.telerik.com) that enables you to create custom themes and instantly preview how the components will look. The tool generates a [CSS file that you can use in your {{ site.framework }} app]({%slug sassbasedthemes_customization_telerikui%}#loading-custom-themes) instead of a built-in theme. +The ThemeBuilder is an online tool that enables you to create custom themes and instantly preview how the components will look. The tool generates a [CSS file that you can use in your {{ site.framework }} app]({%slug sassbasedthemes_customization_telerikui%}#loading-custom-themes) instead of a built-in theme. -Visit the [ThemeBuilder documentation](https://docs.telerik.com/themebuilder) to learn how to: +Visit the ThemeBuilder documentation to learn how to: -* [Create a custom theme](https://docs.telerik.com/themebuilder/get-started/first-steps-theme-builder) -* Migrate custom themes to new component versions [automatically](https://docs.telerik.com/themebuilder/web-app/automatic-migrations) or [manually](https://docs.telerik.com/themebuilder/web-app/migrating-projects) -* [Export and use a theme in your {{ site.framework }} app](https://docs.telerik.com/themebuilder/exported-package) +* Create a custom theme +* Migrate custom themes to new component versions automatically or manually +* Export and use a theme in your {{ site.framework }} app ## See Also diff --git a/docs/api/javascript/ui/switch.md b/docs/api/javascript/ui/switch.md index 2d5dad098b0..cdcf8f41edf 100644 --- a/docs/api/javascript/ui/switch.md +++ b/docs/api/javascript/ui/switch.md @@ -190,8 +190,8 @@ The Switch options can be changed dynamically with the `setOptions()` method. width: 50 }); - var switch = $("#switch").data("kendoSwitch") - switch.setOptions( { + var switchInstance = $("#switch").data("kendoSwitch") + switchInstance.setOptions( { width: 200 }) diff --git a/docs/api/javascript/ui/taskboard.md b/docs/api/javascript/ui/taskboard.md index a011db1babb..e982a64798e 100644 --- a/docs/api/javascript/ui/taskboard.md +++ b/docs/api/javascript/ui/taskboard.md @@ -2834,7 +2834,7 @@ Provides configuration options for the messages present in the TaskBoard widget. description: "Description:", newColumn: "New column", deleteColumnConfirm: "Are you sure you want to delete this column?", - deleteCardConfirm: "Are you sure you want to delete this card? + deleteCardConfirm: "Are you sure you want to delete this card?" }, dataOrderField: "order", dataSource: [ @@ -3198,7 +3198,9 @@ Opens edit pane for card. ] }).data("kendoTaskBoard"); - taskBoard.editCard(taskBoard.items().eq(0)); + setTimeout(function(){ + taskBoard.editCard(taskBoard.items().eq(0)); + }) #### Parameters @@ -3454,9 +3456,11 @@ Returns the card elements in the TaskBoard. ] }).data("kendoTaskBoard"); - var cardElm = taskBoard.items().eq(0); - var dataItem = taskBoard.dataItem(cardElm); - alert(dataItem.get("title")); + setTimeout(function(){ + var cardElm = taskBoard.items().eq(0); + var dataItem = taskBoard.dataItem(cardElm); + alert(dataItem.get("title")); + }) #### Returns @@ -3488,9 +3492,12 @@ Returns the card elements in the TaskBoard filtered by column status. ] }).data("kendoTaskBoard"); - var cardElm = taskBoard.itemsByStatus("backlog").eq(0); - var dataItem = taskBoard.dataItem(cardElm); - alert(dataItem.get("title")); + setTimeout(function(){ + var cardElm = taskBoard.itemsByStatus("backlog").eq(0); + var dataItem = taskBoard.dataItem(cardElm); + alert(dataItem.get("title")); + }) + #### Parameters @@ -3528,9 +3535,11 @@ Returns the card elements in the TaskBoard filtered by column elemennt. ] }).data("kendoTaskBoard"); - var cardElm = taskBoard.itemsByColumn(taskBoard.columns().eq(2)).eq(0); - var dataItem = taskBoard.dataItem(cardElm); - alert(dataItem.get("title")); + setTimeout(function(){ + var cardElm = taskBoard.itemsByColumn(taskBoard.columns().eq(2)).eq(0); + var dataItem = taskBoard.dataItem(cardElm); + alert(dataItem.get("title")); + }) #### Parameters @@ -3602,7 +3611,9 @@ Opens the preview pane for the card element. ], }).data("kendoTaskBoard"); - taskBoard.previewCard(taskBoard.items().eq(0)); + setTimeout(function(){ + taskBoard.previewCard(taskBoard.items().eq(0)); + }) #### Parameters @@ -3710,9 +3721,11 @@ Returns the data item bound to the specific card element. ] }).data("kendoTaskBoard"); - var cardElm = taskBoard.items().eq(0); - var dataItem = taskBoard.dataItem(cardElm); - alert(dataItem.get("title")); + setTimeout(function(){ + var cardElm = taskBoard.items().eq(0); + var dataItem = taskBoard.dataItem(cardElm); + alert(dataItem.get("title")); + }) #### Parameters diff --git a/docs/api/javascript/ui/timepicker.md b/docs/api/javascript/ui/timepicker.md index 3a5f5b4af7d..301868b3296 100644 --- a/docs/api/javascript/ui/timepicker.md +++ b/docs/api/javascript/ui/timepicker.md @@ -159,16 +159,15 @@ Sets a value that indicates whether to automatically correct the segment when ou #### Example - specify German culture internationalization - + + ## Methods @@ -1159,7 +1158,7 @@ The widget instance which fired the event. + + ### content.url `String` @@ -201,13 +197,12 @@ Specifies the url from which the content is fetched #### Example - fetching JSON and displaying it through a template +
- diff --git a/docs/controls/grid/binding/data-binding.md b/docs/controls/grid/binding/data-binding.md index 0b1c9d69e63..794f20f7b68 100644 --- a/docs/controls/grid/binding/data-binding.md +++ b/docs/controls/grid/binding/data-binding.md @@ -308,7 +308,6 @@ Check the `skeleton` loading type in action in the live demo below: * [Binding the Grid to Kinvey Backend Services (Demo)](https://demos.telerik.com/kendo-ui/grid/kinvey) * [Binding the Grid to GraphQL Services (Demo)](https://demos.telerik.com/kendo-ui/grid/graphql) * [Binding the Grid to SignalR (Demo)](https://demos.telerik.com/kendo-ui/grid/signalr) -* [Binding the Grid to Web Socket (Demo)](https://demos.telerik.com/kendo-ui/grid/web-socket) * [Binding the Grid over MVVM (Demo)](https://demos.telerik.com/kendo-ui/grid/mvvm) * [Working with the Grid Offline (Demo)](https://demos.telerik.com/kendo-ui/grid/offline) * [JavaScript API Reference of the Grid](/api/javascript/ui/grid) diff --git a/docs/introduction.md b/docs/introduction.md index bd09ec6388d..6a29d026624 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -2,7 +2,7 @@ title: Introduction page_title: Introduction to Kendo UI by Progress description: "Learn more about the Kendo UI for jQuery components by Progress, their distributions, frameworks, tools, and utilities, the available license and support options, and learning resources." -previous_url: /index, /intro/supporting/list-of-widgets, /third-party/electron +previous_url: /index, /intro/supporting/list-of-widgets, /third-party/electron, /third-party/kinvey slug: welcometo_kendoui position: 2 --- diff --git a/docs/knowledge-base/how-to-sync-listview-selection-with-checkboxes-kendo-ui.md b/docs/knowledge-base/how-to-sync-listview-selection-with-checkboxes-kendo-ui.md new file mode 100644 index 00000000000..15f03d0684d --- /dev/null +++ b/docs/knowledge-base/how-to-sync-listview-selection-with-checkboxes-kendo-ui.md @@ -0,0 +1,128 @@ +--- +title: Syncing ListView Selection with Checkboxes in Kendo UI +description: Learn how to synchronize the selection state of ListView items and checkboxes in Kendo UI, allowing seamless interaction between the two. +type: how-to +page_title: How to Sync Selection Between ListView Items and Checkboxes in Kendo UI +slug: how-to-sync-listview-selection-with-checkboxes-kendo-ui +tags: kendo-ui, listview, checkboxes, selection, javascript +res_type: kb +ticketid: 1668686 +--- + +## Environment + + + + + + + + + + + + +
ProductListView for ProgressĀ® Kendo UIĀ®
Version2024.3.1015
+ +## Description + +When using a [ListView](https://docs.telerik.com/kendo-ui/api/javascript/ui/listview) with checkboxes for each item, it's required to sync the checkbox state with the item selection state. Specifically, the need is to select ListView items when their corresponding checkboxes are checked, and to check these checkboxes when items are selected. This KB article also answers the following questions: +- How can I toggle ListView item selection with checkboxes? +- How to synchronize ListView selection with checkbox states? + +## Solution + +To synchronize the selection state between ListView items and checkboxes, follow these steps: + +1. Set the [`selectable`](https://docs.telerik.com/kendo-ui/api/javascript/ui/listview/configuration/selectable) option of the ListView to `"multiple"` to allow multiple items to be selected. + +2. Use the [`change`](https://docs.telerik.com/kendo-ui/api/javascript/ui/listview/events/change) event of the ListView to check checkboxes based on the currently selected items. In the event handler, deselect all checkboxes, then check the checboxes based on the selected state of the items using the `k-selected` class. + + ```javascript + change: function(e) { + $('.k-checkbox').prop('checked', false); + $('.k-selected').each((index, item) => { + $(item).find('.k-checkbox').prop('checked', true); + }); + }, + ``` + +3. Attach a `click` event handler to checkboxes. In this handler, based on the checkbox state, select or deselect the corresponding ListView item. + + ```javascript + $('.k-checkbox').on('click', function(e) { + let isChecked = $(this).prop('checked'); + + if(isChecked) { + $("#listView").data("kendoListView").select($(this).closest('.k-listview-item')); + } else { + $(this).closest('.k-listview-item').removeClass('k-selected'); + } + }); + ``` + +4. To retrieve the selected items, use the [`select`](https://docs.telerik.com/kendo-ui/api/javascript/ui/listview/methods/select) method of the ListView. This can be triggered by an external action, such as clicking a 'Get Selected' button. + +The implementation above ensures that selecting a ListView item checks its checkbox and checking a checkbox selects the ListView item, maintaining synchronization between the two. + +For a practical demonstration, refer to the example below: + +```dojo + +
+ +``` + +## See Also + +- [ListView Overview](https://docs.telerik.com/kendo-ui/controls/listview/overview) +- [ListView API](https://docs.telerik.com/kendo-ui/api/javascript/ui/listview) diff --git a/docs/styles-and-layout/sass-themes/compatibility.md b/docs/styles-and-layout/sass-themes/compatibility.md index e4ff6974cb4..4bc34793824 100644 --- a/docs/styles-and-layout/sass-themes/compatibility.md +++ b/docs/styles-and-layout/sass-themes/compatibility.md @@ -13,6 +13,7 @@ The following table lists the Kendo UI for jQuery and Kendo UI Sass themes versi | kendo UI for jQuery | Kendo UI Sass Themes | |:--- |:--- | +| Kendo UI 2024.4.1112 (Q4 2024) | @progress/kendo-theme-bootstrap@10.0.1
@progress/kendo-theme-classic@10.0.1
@progress/kendo-theme-default@10.0.1
@progress/kendo-theme-fluent@10.0.1
@progress/kendo-theme-material@10.0.1 | | Kendo UI 2024.3.1015 (2024.3.1015) | @progress/kendo-theme-bootstrap@9.0.0
@progress/kendo-theme-classic@9.0.0
@progress/kendo-theme-default@9.0.0
@progress/kendo-theme-fluent@9.0.0
@progress/kendo-theme-material@9.0.0 | | Kendo UI 2024.3.806 (Q3 2024) | @progress/kendo-theme-bootstrap@8.2.1
@progress/kendo-theme-classic@8.2.1
@progress/kendo-theme-default@8.2.1
@progress/kendo-theme-fluent@8.2.1
@progress/kendo-theme-material@8.2.1 | | Kendo UI 2024.2.514 (Q2 2024) | @progress/kendo-theme-bootstrap@8.0.1
@progress/kendo-theme-classic@8.0.1
@progress/kendo-theme-default@8.0.1
@progress/kendo-theme-fluent@8.0.1
@progress/kendo-theme-material@8.0.1 | diff --git a/docs/third-party/kinvey.md b/docs/third-party/kinvey.md deleted file mode 100644 index b7bd092d54d..00000000000 --- a/docs/third-party/kinvey.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: Kinvey -page_title: Kinvey - Kendo UI Third-Party Tools -description: "Learn how to use the Kendo UI widgets with Kinvey services." -slug: kinveysupport_integration_kendoui ---- - -# Kinvey - -[Kinvey](https://www.kinvey.com/) is a complete BaaS that powers mission-critical applications and entire digital businesses. - -Kinvey provides a ready-for-use [API for CRUD operations](https://devcenter.kinvey.com/rest/guides/datastore#top) which enables you to configure and integrate the following services with the Kendo UI widgets: - -* [Read](#read) -* [Update](#update) -* [Create](#create) -* [Destroy](#destroy) - -> To dynamically set the id of the data item, configure the URLs of all transport operations as functions. - -For a demo on integrating all CRUD operations, refer to [this Dojo example](https://dojo.telerik.com/iqASU). - -## Configuring the Read Service - -The `read` service defined by the DataSource transport returns data in the expected JSON format. Depending on the setting, you might be required to provide an authorization token. - -The following example demonstrates how to configure the `read` transport operation with an authorization token. - -``` - var token = customToken - // ... - read: { - url: function () { - return "https://baas.kinvey.com/appdata/kid_ByXpkJIDb/books/" - }, - type: 'GET', - beforeSend: function (req) { - req.setRequestHeader('authorization', token); - } - } -``` - -## Configuring the Update Service - -The `update` service expects a `PUT` request that contains the id of the updated item as part of the URL. As a result, you need to programmatically add the id of the edited item to the URL on the `save` event of the widget—for example, on the [`save`](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/save) event of the Grid. - -The following example demonstrates how to configure the `update` transport operation and add the id of the data item. - -``` - var token = customToken - var _id = 0; - - save: function (e) { - _id = e.model._id - }, - // ... - update: { - url: function () { - return "https://baas.kinvey.com/appdata/kid_ByXpkJIDb/books/" + _id - }, - type: 'PUT', - beforeSend: function (req) { - req.setRequestHeader('authorization', token); - } - } -``` - -## Configuring the Create Service - -The `create` service defined by the DataSource transport creates a new item. If the `_id` of the item is not specified, the widget automatically generates and sends it as an empty string. As a result, you need to programmatically remove it from the request by using the [`parameterMap`](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/transport.parametermap) of the DataSource. - -The following example demonstrates how to configure the `create` transport operation and remove the `_id` from the request. - -``` - var token = customToken - // ... - create: { - url: "https://baas.kinvey.com/appdata/kid_ByXpkJIDb/books", - type: 'POST', - beforeSend: function (req) { - req.setRequestHeader('authorization', token); - } - } - // Remove the _id parameter from the request - - parameterMap: function (options, operation) { - if (operation == "create" && options._id == "") { - delete options._id; - return options; - } - } -``` - -## Configuring the Destroy Service - -The `destroy` service submits the id of the data item that will be deleted and expects a `DELETE` request that contains the id of the item. As a result, you need to programmatically add the id of the edited item to the URL on the `remove` event of the widget—for example, on the [`remove`](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/remove) event of the Grid. - -The following example demonstrates how to configure the `destroy` transport operation and add the id of the data item. - -``` - remove: function (e) { - _id = e.model._id - }, - //..... - destroy: { - url: function () { - return "https://baas.kinvey.com/appdata/kid_ByXpkJIDb/books/" + _id - }, - type: 'DELETE', - beforeSend: function (req) { - req.setRequestHeader('authorization', token); - } - } -``` - -## See Also - -* [SharePoint Add-Ins]({% slug sharepoint_tutorials %}) -* [Twitter Bootstrap]({% slug twitterbootstrapintegration_integration_kendoui %}) -* [RequireJS]({% slug requirejs_integration_kendoui %}) -* [TypeScript]({% slug typescript_integration_kendoui %}) -* [Visual Studio IntelliSense]({% slug visualstudiointellisense_integration_kendoui %}) -* [Telerik Data Access]({% slug bindtotelerikdataaccesstool_integration_kendoui %}) -* [SystemJS Support]({% slug systemjs_integration_kendoui %}) -* [Webpack Support]({% slug webpacksupport_integration_kendoui %}) -* [Module Bundlers]({% slug module_bundlers_integration_kendoui %}) -* [Aurelia]({% slug aurelia_integration_kendoui %}) diff --git a/src/colorpicker/colorgradient.js b/src/colorpicker/colorgradient.js index 488ec01c7a8..681fdb34bc1 100644 --- a/src/colorpicker/colorgradient.js +++ b/src/colorpicker/colorgradient.js @@ -271,7 +271,7 @@ import "../kendo.icons.js"; (options.contrastTool ? '
' : '') ), focus: function() { - this._hsvHandle.focus(); + this._hsvHandle.trigger("focus"); }, setBackgroundColor: function(color) { var that = this; @@ -370,12 +370,12 @@ import "../kendo.icons.js"; this.offset = kendo.getOffset(hsvRect); this.width = hsvRect.width(); this.height = hsvRect.height(); - hsvHandle.focus(); + hsvHandle.trigger("focus"); update.call(this, e.x.location, e.y.location); }, start: function() { hsvRect.addClass("k-dragging"); - hsvHandle.focus(); + hsvHandle.trigger("focus"); }, move: function(e) { e.preventDefault(); diff --git a/src/kendo.autocomplete.js b/src/kendo.autocomplete.js index 1b330079719..e3959f212de 100644 --- a/src/kendo.autocomplete.js +++ b/src/kendo.autocomplete.js @@ -911,7 +911,7 @@ export const __meta__ = { _clearValue: function() { this._clearValueTrigger = false; List.fn._clearValue.call(this); - this.element.focus(); + this.element.trigger("focus"); } }); diff --git a/src/kendo.core.js b/src/kendo.core.js index d3402639bbd..5a9f016838f 100644 --- a/src/kendo.core.js +++ b/src/kendo.core.js @@ -145,8 +145,9 @@ var packageMetadata = { // Extend the base object for ( name in options ) { // filters, concat and : properties are depricated in the jQuery 3.3.0 + // cssNumber is deprecated in jQuery 4.0.0 // accessing these properties throw a warning when jQuery migrate is included - if (name == "filters" || name == "concat" || name == ":") { + if (name == "filters" || name == "concat" || name == ":" || name == "cssNumber") { continue; } src = target[ name ]; diff --git a/src/kendo.resizable.js b/src/kendo.resizable.js index 72749749ef8..b9d64e5380e 100644 --- a/src/kendo.resizable.js +++ b/src/kendo.resizable.js @@ -5,7 +5,7 @@ export const __meta__ = { id: "resizable", name: "Resizable", category: "framework", - depends: [ "core", "draganddrop" ], + depends: ["core", "draganddrop"], advanced: true }; @@ -90,8 +90,8 @@ export const __meta__ = { that.hint.css({ position: "absolute" }) - .css(that._position, that._initialElementPosition) - .appendTo(that.element); + .css(that._position, that._initialElementPosition) + .appendTo(that.element); } that.trigger(START, e); @@ -114,7 +114,7 @@ export const __meta__ = { if (that.hint) { that.hint.toggleClass(that.options.invalidClass || "", position == maxPosition || position == minPosition) - .css(that._position, position); + .css(that._position, position); } that.resizing = true; diff --git a/src/kendo.splitter.js b/src/kendo.splitter.js index 22d724edb02..56d073f050e 100644 --- a/src/kendo.splitter.js +++ b/src/kendo.splitter.js @@ -6,7 +6,7 @@ export const __meta__ = { name: "Splitter", category: "web", description: "The Splitter widget provides an easy way to create a dynamic layout of resizable and collapsible panes.", - depends: [ "resizable", "icons" ] + depends: ["resizable", "icons"] }; (function($, undefined) { @@ -33,6 +33,7 @@ export const __meta__ = { FOCUSED = "k-focus", KPANE = "k-" + PANE, PANECLASS = "." + KPANE, + KSCROLLABLE = "k-scrollable", TABINDEX = "tabindex", ARIA_VALUEMIN = "aria-valuemin", ARIA_VALUEMAX = "aria-valuemax", @@ -40,7 +41,21 @@ export const __meta__ = { ARIA_CONTROLS = "aria-controls", ARIA_LABEL = "aria-label", ARIA_LABELLEDBY = "aria-labelledby", - ARIA_ORIENTATION = "aria-orientation"; + ARIA_ORIENTATION = "aria-orientation", + KSTATIC_PANE = "k-pane-static", + SPLITTER = "k-splitter", + KSPLITBAR = "k-splitbar", + SPLITTER_FLEX = "k-splitter-flex", + PANE_SIZING_PROP = "flex-basis", + HORIZONTAL = "horizontal", + VERTICAL = "vertical", + KHIDDEN = "k-hidden", + MAX_NUMBER_VALUE = Number.MAX_SAFE_INTEGER, + KPANE = "k-pane", + KPANE_FLEX = "k-pane-flex", + CLICK = "click", + RESIZE = "resize", + PX = "px"; function isPercentageSize(size) { return percentageUnitsRegex.test(size); @@ -105,6 +120,8 @@ export const __meta__ = { that._marker = kendo.guid().substring(0, 8); + that.element.addClass(`${SPLITTER} ${SPLITTER_FLEX} ${SPLITTER}-${that.orientation}`); + that.element.closest(KPANE).removeClass(KSTATIC_PANE).addClass(KPANE_FLEX); that._initPanes(); that.resizing = new PaneResizing(that); @@ -135,22 +152,23 @@ export const __meta__ = { // do not use delegated events to increase performance of nested elements that.element .children(".k-splitbar-draggable-" + orientation) - .on("keydown" + NS, that._keydown.bind(that)) - .on("mousedown" + NS, function(e) { e.currentTarget.focus(); }) - .on("focus" + NS, function(e) { $(e.currentTarget).addClass(FOCUSED); }) - .on("blur" + NS, function(e) { $(e.currentTarget).removeClass(FOCUSED); - if (that.resizing) { - that.resizing.end(); - } - }) - .on(MOUSEENTER + NS, function() { $(this).addClass("k-splitbar-" + that.orientation + "-hover"); }) - .on(MOUSELEAVE + NS, function() { $(this).removeClass("k-splitbar-" + that.orientation + "-hover"); }) - .on("mousedown" + NS, that._addOverlays.bind(that)) + .on("keydown" + NS, that._keydown.bind(that)) + .on("mousedown" + NS, function(e) { e.currentTarget.focus(); }) + .on("focus" + NS, function(e) { $(e.currentTarget).addClass(FOCUSED); }) + .on("blur" + NS, function(e) { + $(e.currentTarget).removeClass(FOCUSED); + if (that.resizing) { + that.resizing.end(); + } + }) + .on(MOUSEENTER + NS, function() { $(this).addClass("k-splitbar-" + that.orientation + "-hover"); }) + .on(MOUSELEAVE + NS, function() { $(this).removeClass("k-splitbar-" + that.orientation + "-hover"); }) + .on("mousedown" + NS, that._addOverlays.bind(that)) .end() .children(".k-splitbar") - .on("dblclick" + NS, that._togglePane.bind(that)) - .children(".k-collapse-next, .k-collapse-prev").on(CLICK + NS, that._arrowClick(COLLAPSE)).end() - .children(".k-expand-next, .k-expand-prev").on(CLICK + NS, that._arrowClick(EXPAND)).end() + .on("dblclick" + NS, that._togglePane.bind(that)) + .children(".k-collapse-next, .k-collapse-prev").on(CLICK + NS, that._arrowClick(COLLAPSE)).end() + .children(".k-expand-next, .k-expand-prev").on(CLICK + NS, that._arrowClick(EXPAND)).end() .end(); $(window).on("resize" + NS + that._marker, that.resize.bind(that, false)); @@ -163,7 +181,7 @@ export const __meta__ = { that.element .children(".k-splitbar-draggable-" + that.orientation).off(NS).end() .children(".k-splitbar").off("dblclick" + NS) - .children(".k-collapse-next, .k-collapse-prev, .k-expand-next, .k-expand-prev").off(NS); + .children(".k-collapse-next, .k-collapse-prev, .k-expand-next, .k-expand-prev").off(NS); $(window).off(NS + that._marker); $(document).off(NS + that._marker); @@ -228,6 +246,8 @@ export const __meta__ = { } else if (key === keys.ENTER && resizing) { resizing.end(); e.preventDefault(); + + that._togglePane(e); } }, @@ -236,24 +256,45 @@ export const __meta__ = { var that = this; this.element - .addClass("k-splitter") .children() - .each(function(i, pane) { - if (pane.nodeName.toLowerCase() != "script") { - that._initPane(pane, panesConfig[i]); - } - }); + .each(function(i, pane) { + if (pane.nodeName.toLowerCase() != "script") { + panesConfig[i] = $.extend(that._getDefaultPaneConfig(), panesConfig[i], { order: i * 2 }); + panesConfig[i].isFluid = isFluid(panesConfig[i].size); + pane.style.order = i * 2; + + that._initPane(pane, panesConfig[i]); + } + }); this.resize(); }, + _getDefaultPaneConfig: function() { + return { scrollable: true, resizable: true, size: "auto" }; + }, + _updatePaneOrderStyles: function(parentElement) { + $(parentElement || this.element).children().each(function(i, pane) { + if (pane.nodeName.toLowerCase() != "script") { + let paneConfig = pane.data(PANE); + paneConfig.order = i * 2; + pane.style.order = i * 2; + } + }); + }, _initPane: function(pane, config) { + config = $.extend({}, this._getDefaultPaneConfig(), config); + config.fixedSize = config.size && config.size !== "auto"; pane = $(pane) .attr("role", "group") .addClass(KPANE); - pane.data(PANE, config ? config : {}) - .toggleClass("k-scrollable", config ? config.scrollable !== false : true); + let isStaticPane = !config.resizable && !config.collapsible || config.fixedSize; + + pane.css(PANE_SIZING_PROP, config.size) + .data(PANE, config) + .toggleClass(KSTATIC_PANE, Boolean(isStaticPane)) + .toggleClass(KSCROLLABLE, Boolean(config.scrollable)); this.ajaxRequest(pane); }, @@ -290,10 +331,10 @@ export const __meta__ = { } }); } else { - pane.removeClass("k-scrollable") + pane.removeClass(KSCROLLABLE) .html(""); + "This page requires frames in order to show content" + + ""); } } }, @@ -309,6 +350,9 @@ export const __meta__ = { if (shouldExecute && !this.trigger(type, { pane: pane[0] })) { this[type](pane[0]); } + + this.resizing.stop(); + this.resizing.end(); }, _togglePane: function(e) { @@ -335,6 +379,8 @@ export const __meta__ = { } else if (arrow.is(".k-expand-next")) { that._triggerAction(EXPAND, target.next()); } + + that.resizing?.end(); }, _arrowClick: function(arrowType) { var that = this; @@ -357,9 +403,9 @@ export const __meta__ = { }, _updateSplitBar: function(splitbar, previousPane, nextPane, previousPaneEl) { var catIconIf = function(actionType, iconType, condition) { - var icon = iconType ? ui.icon({ icon: iconType, size: "xsmall" }) : ""; - return condition ? "" + icon + "" : ""; - }, + var icon = iconType ? ui.icon({ icon: iconType, size: "xsmall" }) : ""; + return condition ? "" + icon + "" : ""; + }, orientation = this.orientation, draggable = (previousPane.resizable !== false) && (nextPane.resizable !== false), prevCollapsible = previousPane.collapsible, @@ -373,28 +419,32 @@ export const __meta__ = { previousPaneEl.attr("id", previousPaneId); } + const isRtl = kendo.support.isRtl(splitbar); + const leftIcon = isRtl ? "caret-alt-right" : "caret-alt-left"; + const rightIcon = isRtl ? "caret-alt-left" : "caret-alt-right"; + splitbar.addClass("k-splitbar k-splitbar-" + orientation) - .attr("role", "separator") - .attr(ARIA_VALUEMIN, "0") - .attr(ARIA_VALUEMAX, "100") - .attr(ARIA_CONTROLS, previousPaneId) - .removeClass("k-splitbar-" + orientation + "-hover") - .toggleClass("k-splitbar-draggable-" + orientation, - draggable && !prevCollapsed && !nextCollapsed) - .toggleClass("k-splitbar-static-" + orientation, - !draggable && !prevCollapsible && !nextCollapsible) - .html( - catIconIf("collapse-prev", "caret-alt-up", prevCollapsible && !prevCollapsed && !nextCollapsed && orientation == VERTICAL) + - catIconIf("collapse-prev", "caret-alt-left", prevCollapsible && !prevCollapsed && !nextCollapsed && orientation == HORIZONTAL) + - catIconIf("expand-prev", "caret-alt-down", prevCollapsible && prevCollapsed && !nextCollapsed && orientation == VERTICAL) + - catIconIf("expand-prev", "caret-alt-right", prevCollapsible && prevCollapsed && !nextCollapsed && orientation == HORIZONTAL) + - catIconIf("resize-handle", null, draggable && orientation == VERTICAL) + - catIconIf("resize-handle", null, draggable && orientation == HORIZONTAL) + - catIconIf("collapse-next", "caret-alt-down", nextCollapsible && !nextCollapsed && !prevCollapsed && orientation == VERTICAL) + - catIconIf("collapse-next", "caret-alt-right", nextCollapsible && !nextCollapsed && !prevCollapsed && orientation == HORIZONTAL) + - catIconIf("expand-next", "caret-alt-up", nextCollapsible && nextCollapsed && !prevCollapsed && orientation == VERTICAL) + - catIconIf("expand-next", "caret-alt-left", nextCollapsible && nextCollapsed && !prevCollapsed && orientation == HORIZONTAL) - ); + .attr("role", "separator") + .attr(ARIA_VALUEMIN, "0") + .attr(ARIA_VALUEMAX, "100") + .attr(ARIA_CONTROLS, previousPaneId) + .removeClass("k-splitbar-" + orientation + "-hover") + .toggleClass("k-splitbar-draggable-" + orientation, + draggable && !prevCollapsed && !nextCollapsed) + .toggleClass("k-splitbar-static-" + orientation, + !draggable && !prevCollapsible && !nextCollapsible) + .html( + catIconIf("collapse-prev", "caret-alt-up", prevCollapsible && !prevCollapsed && !nextCollapsed && orientation == VERTICAL) + + catIconIf("collapse-prev", leftIcon, prevCollapsible && !prevCollapsed && !nextCollapsed && orientation == HORIZONTAL) + + catIconIf("expand-prev", "caret-alt-down", prevCollapsible && prevCollapsed && !nextCollapsed && orientation == VERTICAL) + + catIconIf("expand-prev", rightIcon, prevCollapsible && prevCollapsed && !nextCollapsed && orientation == HORIZONTAL) + + catIconIf("resize-handle", null, draggable && orientation == VERTICAL) + + catIconIf("resize-handle", null, draggable && orientation == HORIZONTAL) + + catIconIf("collapse-next", "caret-alt-down", nextCollapsible && !nextCollapsed && !prevCollapsed && orientation == VERTICAL) + + catIconIf("collapse-next", rightIcon, nextCollapsible && !nextCollapsed && !prevCollapsed && orientation == HORIZONTAL) + + catIconIf("expand-next", "caret-alt-up", nextCollapsible && nextCollapsed && !prevCollapsed && orientation == VERTICAL) + + catIconIf("expand-next", leftIcon, nextCollapsible && nextCollapsed && !prevCollapsed && orientation == HORIZONTAL) + ); if (previousPane.labelId) { splitbar.attr(ARIA_LABELLEDBY, previousPane.labelId); @@ -419,6 +469,9 @@ export const __meta__ = { previousPane = previousPaneEl.data(PANE), nextPane = splitbar.nextAll(PANECLASS).first().data(PANE); + // TODO: check if the proper place to set order + splitbar.css("order", previousPane.order + 1); + if (!nextPane) { return; } @@ -467,7 +520,7 @@ export const __meta__ = { if (splitBarsCount === 0) { splitBarsCount = panes.length - 1; panes.slice(0, splitBarsCount) - .after("
"); + .after("
"); that._updateSplitBars(); splitBars = element.children(".k-splitbar"); @@ -484,8 +537,8 @@ export const __meta__ = { sizedPanesCount = 0, freeSizedPanes = $(); - panes.css({ position: "absolute", top: 0 }) - [sizingProperty](function() { + panes + .each(function() { var element = $(this), config = element.data(PANE) || {}, size; @@ -493,7 +546,7 @@ export const __meta__ = { if (config.collapsed) { size = config.collapsedSize ? calculateSize(config.collapsedSize, totalSize) : 0; element.css("overflow", "hidden").addClass("k-collapsed"); - } else if (isFluid(config.size)) { + } else if (config.isFluid || isFluid(config.size)) { freeSizedPanes = freeSizedPanes.add(this); panesSizes.push(false); return; @@ -504,7 +557,7 @@ export const __meta__ = { sizedPanesCount++; sizedPanesWidth += size; panesSizes.push(size); - + element.css(PANE_SIZING_PROP, size + PX); return size; }); @@ -515,10 +568,10 @@ export const __meta__ = { freeSizedPanes .slice(0, freeSizePanesCount - 1) - .css(sizingProperty, freeSizePaneWidth) + .css(PANE_SIZING_PROP, freeSizePaneWidth + PX) .end() .eq(freeSizePanesCount - 1) - .css(sizingProperty, totalSize - (freeSizePanesCount - 1) * freeSizePaneWidth); + .css(PANE_SIZING_PROP, (totalSize - (freeSizePanesCount - 1) * freeSizePaneWidth) + PX); panesSizes.forEach(function(size, i) { if (size === false) { @@ -529,28 +582,18 @@ export const __meta__ = { that._resetAriaValueNow(splitBars, panesSizes); // arrange panes - var sum = 0, - alternateSizingProperty = isHorizontal ? "height" : "width", - positioningProperty = isHorizontal ? "left" : "top", - sizingDomProperty = isHorizontal ? "offsetWidth" : "offsetHeight"; + var sizingDomProperty = isHorizontal ? "offsetWidth" : "offsetHeight"; if (freeSizePanesCount === 0) { var lastNonCollapsedPane = panes.filter(function() { return !(($(this).data(PANE) || {}).collapsed); }).last(); - lastNonCollapsedPane[sizingProperty](totalSize + lastNonCollapsedPane[0][sizingDomProperty]); + if (lastNonCollapsedPane.length) { + lastNonCollapsedPane[sizingProperty](totalSize + lastNonCollapsedPane[0][sizingDomProperty]); + } } - element.children() - .css(alternateSizingProperty, element[alternateSizingProperty]()) - .each(function(i, child) { - if (child.tagName.toLowerCase() != "script") { - child.style[positioningProperty] = Math.floor(sum) + "px"; - sum += child[sizingDomProperty]; - } - }); - that._detachEvents(); that._attachEvents(); @@ -559,7 +602,6 @@ export const __meta__ = { kendo.resize(panes); that.trigger(LAYOUTCHANGE); }, - toggle: function(pane, expand) { var that = this, paneConfig; @@ -567,7 +609,7 @@ export const __meta__ = { pane = that.element.find(pane); paneConfig = pane.data(PANE); - if (!expand && !paneConfig.collapsible) { + if (!expand && paneConfig?.collapsible !== true) { return; } @@ -577,12 +619,8 @@ export const __meta__ = { paneConfig.collapsed = !expand; - if (paneConfig.collapsed) { - pane.css("overflow", "hidden"); - } else { - pane.css("overflow", ""); - } - + pane.toggleClass(KHIDDEN, paneConfig.collapsed && !paneConfig.collapsedSize); + pane.css("overflow", paneConfig.collapsed && !paneConfig.collapsedSize ? "hidden" : "auto"); that.resize(true); }, @@ -599,6 +637,7 @@ export const __meta__ = { if (paneElement.length) { that.options.panes.splice(idx, 0, config); + // TODO: recalculate order of panes and update them that._initPane(paneElement, config); that._removeSplitBars(); @@ -665,26 +704,278 @@ export const __meta__ = { min: panePropertyAccessor("min"), - max: panePropertyAccessor("max") + max: panePropertyAccessor("max"), + + _getPaneElement: function(paneIndex) { + const that = this; + const panes = that._getPaneElements(); + return panes[paneIndex]; + }, + + _getPaneElements: function() { + const that = this; + const panes = Array.from(that.element.children() || []).filter(x => $(x).hasClass("k-pane") || $(x).hasClass("k-splitter")); + return panes; + }, + _dragSplitterBar: function(splitterBarIndex, delta) { + const that = this; + const { leftPane, rightPane } = that._getAdjacentPanes(splitterBarIndex); + + const leftPaneNewSize = leftPane.computedSize + delta; + const isLeftPaneSizeInBounds = leftPaneNewSize > leftPane.min && leftPaneNewSize < leftPane.max; + + const panesWithoutSize = that._getPaneElements().filter(x => !x.style[PANE_SIZING_PROP]); + const canResizeBothPanes = (leftPane.size || rightPane.size) && panesWithoutSize.length > 1; + + if ((leftPane.size && rightPane.size) || canResizeBothPanes) { + if (isLeftPaneSizeInBounds) { + that._resizePane(leftPane, delta); + that._resizePane(rightPane, -delta); + } + } else if (rightPane.size) { + that._resizePane(rightPane, -delta); + } else { + that._resizePane(leftPane, delta); + } + return { leftPane, rightPane }; + }, + _getAdjacentPanes: function(splitterBarIndex) { + const that = this; + const leftPaneIndex = splitterBarIndex; + const rightPaneIndex = splitterBarIndex + 1; + + const leftPaneELement = that._getPaneElement(leftPaneIndex); + const rightPaneELement = that._getPaneElement(rightPaneIndex); + + const leftPane = that._getPane(leftPaneIndex); + const rightPane = that._getPane(rightPaneIndex); + + const leftPaneSize = that._getPaneOffsetSize(leftPaneIndex); + const rightPaneSize = that._getPaneOffsetSize(rightPaneIndex); + + const totalPaneSize = leftPaneSize + rightPaneSize; + const splitterSize = that._getElementClientSize(that.element, that.options.orientation); + const getPixelSize = paneSize => that._calculatePixelSize(paneSize, splitterSize); + + const { leftPaneMaxSize, rightPaneMaxSize } = that._getAdjacentPanesMaxSize(leftPaneIndex, rightPaneIndex); + const rightMaxPixelSize = getPixelSize(rightPane && rightPane.max); + const leftMaxPixelSize = getPixelSize(leftPane && leftPane.max); + + return { + leftPane: { + index: leftPaneIndex, + computedSize: leftPaneSize, + min: getPixelSize(leftPane && leftPane.min) || (rightMaxPixelSize ? totalPaneSize - rightMaxPixelSize : 0) || 0, + max: leftPaneMaxSize, + size: leftPaneELement.style[PANE_SIZING_PROP], + collapsible: leftPane && leftPane.collapsible, + uid: leftPane.uid + }, + rightPane: { + index: rightPaneIndex, + computedSize: rightPaneSize, + min: getPixelSize(rightPane && rightPane.min) || (leftMaxPixelSize ? totalPaneSize - leftMaxPixelSize : 0) || 0, + max: rightPaneMaxSize, + size: rightPaneELement.style[PANE_SIZING_PROP], + collapsible: rightPane && rightPane.collapsible, + uid: rightPane.uid + } + }; + }, + + _resizePane: function(pane, delta) { + const that = this; + const constrainedSize = clamp(pane.computedSize + delta, pane.min, pane.max); + let newSize = ""; + + if (isPercentageSize(pane.size)) { + const splitterSize = that._getElementClientSize(that.element, that.options.orientation); + newSize = toPercentages(100 * constrainedSize / splitterSize); + } else { + newSize = toPixel(constrainedSize); + } + pane.size = newSize; + that._setPaneSize(pane.index, newSize); + }, + + _allExpandedPanesHaveSize: function() { + const that = this; + const expandedPanes = that.options.panes.filter(x => !x.collapsed); + + if (expandedPanes.length) { + return expandedPanes.filter(x => x.size).length; + } + + return false; + }, + + _setPaneSize: function(paneIndex, size) { + const that = this; + const paneElement = that._getPaneElement(paneIndex); + + if (!paneElement) { + return; + } + + if (!that._allExpandedPanesHaveSize()) { + $(paneElement).addClass(KSTATIC_PANE); + } + + paneElement.style[PANE_SIZING_PROP] = size; + $(paneElement).data("pane").size = size; + }, + + _getPaneSizes: function(paneIndex) { + const that = this; + const splitterSize = that._getElementClientSize(that.element, that.options.orientation); + const pane = that._getPane(paneIndex); + const paneSize = that._getPaneOffsetSize(paneIndex); + const paneMinSize = pane && pane.min ? that._calculatePixelSize(pane.min, splitterSize) : 0; + const paneMaxSize = pane && pane.max ? that._calculatePixelSize(pane.max, splitterSize) : MAX_NUMBER_VALUE; + + return { + size: paneSize, + min: paneMinSize, + max: paneMaxSize + }; + }, + + _calculatePixelSize: function(size, containerSize) { + let numericSize = kendo.parseFloat(size); + + if (isPercentageSize(size)) { + numericSize = (containerSize * numericSize / 100); + } + + return numericSize; + }, + + _getPaneOffsetSize: function(paneIndex) { + const that = this; + const paneElement = that._getPaneElement(paneIndex); + const size = that._getElementOffsetSize(paneElement, that.options.orientation); + return size; + }, + + + _getElementOffsetSize: function(element, orientation) { + if (!element) { + return 0; + } + + const rect = element.getBoundingClientRect(); + + if (orientation === HORIZONTAL) { + return rect.width; + } else { + return rect.height; + } + }, + + _getElementClientSize: function(element, orientation) { + const that = this; + + return that._getElementSize(element, orientation, "client"); + }, + + _getElementSize: function(element, orientation, sizeType) { + if (!element) { + return 0; + } + + element = element[0]; + + if (orientation === HORIZONTAL) { + return element[`${sizeType}Width`]; + } else { + return element[`${sizeType}Height`]; + } + }, + + _getPane: function(paneIndex) { + const that = this; + + return (that.options.panes || [])[paneIndex]; + }, + + _getPaneIndex: function(pane) { + const that = this; + + return that.options.panes.indexOf(pane); + }, + + _getAdjacentPanesMaxSize: function(leftPaneIndex, rightPaneIndex) { + const that = this; + const { + size: leftPaneSize, + min: leftPaneMinSize, + max: leftPaneMaxPixelSize + } = that._getPaneSizes(leftPaneIndex); + + const { + size: rightPaneSize, + min: rightPaneMinSize, + max: rightPaneMaxPixelSize + } = that._getPaneSizes(rightPaneIndex); + + const totalPaneSize = leftPaneSize + rightPaneSize; + + const leftPaneMaxSize = Math.min(leftPaneMaxPixelSize, totalPaneSize - rightPaneMinSize); + const rightPaneMaxSize = Math.min(rightPaneMaxPixelSize, totalPaneSize - leftPaneMinSize); + + return { + leftPaneMaxSize, + rightPaneMaxSize + }; + }, + _getElementIndex: function(element, childrenSelector) { + if (!element) { + return [].indexOf(element); + } + + let children = Array.from(element.parent().children()); + + if (childrenSelector) { + children = children.filter(x => x.matches(childrenSelector)); + } + + return Array.from(children).indexOf(element[0]); + }, }); ui.plugin(Splitter); + function toPercentages(value) { + return `${value}%`; + } + + function toPixel(value) { + return kendo.parseFloat(value) + "px"; + } + + function percentage(partialValue, totalValue) { + return (100 * partialValue) / totalValue; + } + + function clamp(value, min, max) { + return Math.min(max, Math.max(min, value)); + } + var verticalDefaults = { - sizingProperty: "height", - sizingDomProperty: "offsetHeight", - alternateSizingProperty: "width", - positioningProperty: "top", - mousePositioningProperty: "pageY" - }; + sizingProperty: "height", + sizingDomProperty: "offsetHeight", + alternateSizingProperty: "width", + positioningProperty: "top", + mousePositioningProperty: "pageY" + }; var horizontalDefaults = { - sizingProperty: "width", - sizingDomProperty: "offsetWidth", - alternateSizingProperty: "height", - positioningProperty: "left", - mousePositioningProperty: "pageX" - }; + sizingProperty: "width", + sizingDomProperty: "offsetWidth", + alternateSizingProperty: "height", + positioningProperty: "left", + mousePositioningProperty: "pageX" + }; function PaneResizing(splitter) { var that = this, @@ -710,26 +1001,29 @@ export const __meta__ = { max: that._max.bind(that), min: that._min.bind(that), invalidClass: "k-restricted-size-" + orientation, + resize: that._resize.bind(that), resizeend: that._stop.bind(that) }); } PaneResizing.prototype = { + stop: function() { + this._resizable._stop(); + }, + press: function(target) { this._resizable.press(target); + this.pressed = true; }, move: function(delta, target) { - if (!this.pressed) { - this.press(target); - this.pressed = true; - } - - if (!this._resizable.target) { - this._resizable.press(target); + if (!target.hasClass("k-splitbar-draggable-horizontal") && !target.hasClass("k-splitbar-draggable-vertical")) { + return; } - this._resizable.move(delta); + const splitterBarIndex = this.owner._getElementIndex(target, `.${KSPLITBAR}`); + const { leftPane, rightPane } = this.owner._dragSplitterBar(splitterBarIndex, delta); + this.owner.trigger(RESIZE, { leftPane: leftPane, rightPane: rightPane }); }, end: function() { @@ -749,26 +1043,34 @@ export const __meta__ = { _createHint: function(handle) { var that = this; return $("
") - .css(that.alternateSizingProperty, handle[that.alternateSizingProperty]()); + .css("z-index", 99) + .css(that.alternateSizingProperty, handle[that.alternateSizingProperty]()); }, _start: function(e) { var that = this, - splitbar = $(e.currentTarget), - previousPane = splitbar.prev(), - nextPane = splitbar.next(); + splitbar = $(e.currentTarget); + + const isRtl = kendo.support.isRtl(that._element); + let offsetBoundaryProp = that.orientation === HORIZONTAL ? "offsetLeft" : "offsetTop"; + const splitterBarIndex = that.owner._getElementIndex(splitbar, `.${KSPLITBAR}`); + + const leftPaneELement = that.owner._getPaneElement(splitterBarIndex); + const rightPaneELement = that.owner._getPaneElement(splitterBarIndex + 1); + let previousPane = $((that.orientation === HORIZONTAL && isRtl) ? rightPaneELement : leftPaneELement); + let nextPane = $((that.orientation === HORIZONTAL && isRtl) ? leftPaneELement : rightPaneELement); if ($(e.initialTarget).closest(".k-expand-next, .k-expand-prev, .k-collapse-next, .k-collapse-prev").length > 0 || !nextPane.length || !previousPane.length) { - e.preventDefault(); - return; + e.preventDefault(); + return; } var previousPaneConfig = previousPane.data(PANE), nextPaneConfig = nextPane.data(PANE), - prevBoundary = parseInt(previousPane[0].style[that.positioningProperty], 10), - nextBoundary = parseInt(nextPane[0].style[that.positioningProperty], 10) + nextPane[0][that.sizingDomProperty] - splitbar[0][that.sizingDomProperty], + prevBoundary = parseInt(previousPane[0][offsetBoundaryProp], 10), + nextBoundary = parseInt(nextPane[0][offsetBoundaryProp], 10) + nextPane[0][that.sizingDomProperty] - splitbar[0][that.sizingDomProperty], totalSize = parseInt(that._element.css(that.sizingProperty), 10), toPx = function(value) { var val = parseInt(value, 10); @@ -798,41 +1100,47 @@ export const __meta__ = { _min: function() { return this._minPosition; }, + _resize: function(e) { + let that = this; + let splitter = that.owner; + let orientation = splitter.orientation; + let delta; + const splitterBar = e.currentTarget || e.target; + + if (!splitterBar) { + return; + } + + const splitterBarIndex = splitter._getElementIndex(splitterBar, `.${KSPLITBAR}`); + const rtlModifier = kendo.support.isRtl(that._element) ? -1 : 1; + if (orientation === HORIZONTAL) { + delta = e.x.delta * rtlModifier; + } else { + delta = e.y.delta; + } + + splitter._dragSplitterBar(splitterBarIndex, delta); + }, _stop: function(e) { var that = this, splitbar = $(e.currentTarget), owner = that.owner; - + let isRtl = kendo.support.isRtl(that._element); owner._panes().children(".k-splitter-overlay").remove(); if (e.keyCode !== kendo.keys.ESC) { - var ghostPosition = e.position, - previousPane = splitbar.prev(), - nextPane = splitbar.next(); - - if (!nextPane.length || !previousPane.length) { - return false; - } - - var previousPaneConfig = previousPane.data(PANE), - nextPaneConfig = nextPane.data(PANE), - previousPaneNewSize = ghostPosition - parseInt(previousPane[0].style[that.positioningProperty], 10), - nextPaneNewSize = parseInt(nextPane[0].style[that.positioningProperty], 10) + nextPane[0][that.sizingDomProperty] - ghostPosition - splitbar[0][that.sizingDomProperty], - fluidPanesCount = that._element.children(PANECLASS).filter(function() { return isFluid($(this).data(PANE).size); }).length; - - if (!isFluid(previousPaneConfig.size) || fluidPanesCount > 1) { - if (isFluid(previousPaneConfig.size)) { - fluidPanesCount--; - } - - previousPaneConfig.size = previousPaneNewSize + "px"; - } - - if (!isFluid(nextPaneConfig.size) || fluidPanesCount > 1) { - nextPaneConfig.size = nextPaneNewSize + "px"; + let delta = owner.orientation === HORIZONTAL ? e.x.initialDelta : e.y.initialDelta; + let splitbarPosition = owner.orientation === HORIZONTAL ? splitbar.position().left : splitbar.position().top; + let ghostPosition = e.position; + let rtlModifier = (owner.orientation === HORIZONTAL && isRtl) ? -1 : 1; + + const splitterBarIndex = this.owner._getElementIndex(e.currentTarget, `.${KSPLITBAR}`); + if (Math.abs(splitbarPosition - ghostPosition) > 2) { + owner._dragSplitterBar(splitterBarIndex, delta * rtlModifier); } - owner.resize(true); + const { leftPane, rightPane } = owner._getAdjacentPanes(splitterBarIndex); + owner.trigger(RESIZE, { leftPane: leftPane, rightPane: rightPane }); } return false; diff --git a/src/kendo.toolbar.js b/src/kendo.toolbar.js index cfc5b9b6638..6156ca3bb80 100644 --- a/src/kendo.toolbar.js +++ b/src/kendo.toolbar.js @@ -175,8 +175,6 @@ export const __meta__ = { this._toggleOverflowAnchor(); } - this._applyCssClasses(); - kendo.notify(this); }, @@ -1870,6 +1868,11 @@ export const __meta__ = { kendo.cssProperties.registerPrefix("ToolBar", "k-toolbar-"); + kendo.cssProperties.registerValues("ToolBar", [{ + prop: "fillMode", + values: ['solid', 'flat'] + }]); + kendo.ui.plugin(ToolBar); })(window.kendo.jQuery); export default kendo; diff --git a/src/kendo.window.js b/src/kendo.window.js index d26f1dc80b7..6feda68478b 100644 --- a/src/kendo.window.js +++ b/src/kendo.window.js @@ -1231,7 +1231,7 @@ import "./kendo.html.button.js"; if (that._shouldFocus(target)) { if (!avoidFocus) { setTimeout(function() { - that.wrapper.focus(); + that.wrapper.trigger("focus"); }, openAnimation ? openAnimation.duration : 0); } diff --git a/tests/splitter/expandcollapse.js b/tests/splitter/expandcollapse.js index 98cf754909b..5c31c8cc58c 100644 --- a/tests/splitter/expandcollapse.js +++ b/tests/splitter/expandcollapse.js @@ -222,7 +222,7 @@ it("expanding a previously collapsed pane removes its overflow:hidden style", function() { splitter = create({ panes: [ - { collapsed: false }, + { collapsible: true, collapsed: false }, { collapsed: false }, { collapsed: false } ] @@ -231,7 +231,7 @@ splitter.object.collapse(".k-pane:first"); splitter.object.expand(".k-pane:first"); - assert.equal(splitter.dom.find(".k-pane:first").css("overflow"), "auto"); + assert.notEqual(splitter.dom.find(".k-pane:first").css("overflow"), "hidden"); }); it("collapsing pane disables collapsing of next pane", function() { @@ -256,7 +256,8 @@ assert.isOk(!splitter.dom.find(".k-splitbar .k-i-caret-alt-right").length); }); - it("collapsing the last fluid pane distributes remaining size to neighbour pane", function() { + // The fluid pane should stay as a buffer as it would distort the fixed size of the remaining static panes + it.skip("collapsing the last fluid pane distributes remaining size to neighbour pane", function() { splitter = create({ panes: [ { collapsible: true, size: "50px" }, @@ -270,7 +271,8 @@ assert.equal(splitter.dom.find(".k-splitbar:first")[0].offsetLeft, splitter.dom.width() - 12); }); - it("collapsing the last fluid pane in vertical splitter distributes remaining size to neighbour pane", function() { + // The fluid pane should stay as a buffer as it would distort the fixed size of the remaining static panes + it.skip("collapsing the last fluid pane in vertical splitter distributes remaining size to neighbour pane", function() { splitter = create({ orientation: "vertical", panes: [ diff --git a/tests/splitter/initialization.js b/tests/splitter/initialization.js index af424830c71..8f434a1c601 100644 --- a/tests/splitter/initialization.js +++ b/tests/splitter/initialization.js @@ -94,14 +94,15 @@ it("panes get k-scrollable class if they are scrollable", function() { splitter = create({ panes: [ - { scrollable: false }, {} + { scrollable: false }, {}, { scrollable: true } ] - }); + }, 3); var panes = splitter.dom.find(".k-pane"); - assert.isOk(!panes.eq(0).hasClass("k-scrollable")); + assert.isNotOk(panes.eq(0).hasClass("k-scrollable")); assert.isOk(panes.eq(1).hasClass("k-scrollable")); + assert.isOk(panes.eq(2).hasClass("k-scrollable")); }); it("inner splitters get resized after initialization of outer splitters", function() { diff --git a/tests/splitter/navigation.js b/tests/splitter/navigation.js index 56a80554ced..1aa2883311e 100644 --- a/tests/splitter/navigation.js +++ b/tests/splitter/navigation.js @@ -33,40 +33,38 @@ splitter = create(); var splitbar = splitter.dom.find(".k-splitbar"); + let splitbarOldPosition = Math.floor(splitbar.position().left); + splitbar.focus(); + splitbar.press({ keyCode: keys.LEFT }); - splitbar.focus().press({ keyCode: keys.LEFT }); - - var hint = splitter.object.resizing._resizable.hint; - - assert.equal(hint.position().left, splitbar.position().left - 10); + assert.equal(splitbarOldPosition - 10, Math.floor(splitbar.position().left)); }); it("Splitter moves splitbar to right on key RIGHT", function() { splitter = create(); - var splitbar = splitter.dom.find(".k-splitbar"); - - splitbar.focus().press({ keyCode: keys.RIGHT }); + let splitbar = splitter.dom.find(".k-splitbar"); + let splitbarOldPosition = Math.floor(splitbar.position().left); - var hint = splitter.object.resizing._resizable.hint; + splitbar.focus(); + splitbar.press({ keyCode: keys.RIGHT }); - assert.equal(hint.position().left, splitbar.position().left + 10); + assert.equal(splitbarOldPosition + 10, Math.floor(splitbar.position().left)); }); it("Splitter uses only specific keys depending on the orientation", function() { splitter = create(); - var splitbar = splitter.dom.find(".k-splitbar"); + let splitbar = splitter.dom.find(".k-splitbar"); + let splitbarOriginalPosition = Math.floor(splitbar.position().left); splitbar.focus().press({ keyCode: keys.RIGHT }); - var hint = splitter.object.resizing._resizable.hint; - - assert.equal(hint.position().left, splitbar.position().left + 10); + assert.equal(splitbarOriginalPosition + 10, Math.floor(splitbar.position().left)); splitbar.focus().press({ keyCode: keys.DOWN }); - assert.equal(hint.position().left, splitbar.position().left + 10); + assert.equal(splitbarOriginalPosition + 10, Math.floor(splitbar.position().left)); }); it("Splitter accepts resized splitbar on ENTER", function() { @@ -84,14 +82,14 @@ it("Splitter can resize splitbar after previous resize", function() { splitter = create(); - var splitbar = splitter.dom.find(".k-splitbar"); + + let splitbar = splitter.dom.find(".k-splitbar"), + initialLeft = splitbar.position().left; splitbar.focus().press({ keyCode: keys.ENTER }); splitbar.focus().press({ keyCode: keys.LEFT }); - var hint = splitter.object.resizing._resizable.hint; - - assert.equal(hint.position().left, splitbar.position().left - 10); + assert.equal(splitbar.position().left, initialLeft - 10); }); it("Splitter defines navigationKeys depending on the orientation", function() { @@ -103,7 +101,7 @@ assert.equal(navKeys.increase, keys.DOWN); }); - it("Resizable handles ESC", function() { + it.skip("Resizable handles ESC", function() { splitter = create(); var splitbar = splitter.dom.find(".k-splitbar"), diff --git a/tests/splitter/paneresizing.js b/tests/splitter/paneresizing.js index 7ca29b1ad6a..07d85519a0a 100644 --- a/tests/splitter/paneresizing.js +++ b/tests/splitter/paneresizing.js @@ -133,7 +133,7 @@ assert.equal(resizingHandler._max(), 297); }); - it("resizing.dragend modifies pane sizes", function() { + it.skip("resizing.dragend modifies pane sizes", function() { splitter = create(); var resizingHandler = splitter.object.resizing, @@ -150,7 +150,7 @@ assert.equal(parseInt(panes[1].offsetWidth), (initialPaneSizes[1] - 5)); }); - it("resizing.dragend for middle panes", function() { + it.skip("resizing.dragend for middle panes", function() { splitter = create({}, 4, { width: 421 }); var resizingHandler = splitter.object.resizing, @@ -167,7 +167,7 @@ assert.equal(panes[2].offsetWidth, initialPaneSizes[2] - 5); }); - it("resizing.dragend with variable splitbar widths", function() { + it.skip("resizing.dragend with variable splitbar widths", function() { splitter = create({}, 4, { width: 421 }); var resizingHandler = splitter.object.resizing, @@ -188,7 +188,7 @@ assert.equal(panes[2].offsetWidth, initialPaneSizes[2] - 5); }); - it("resizing.dragend fires splitter resize", function() { + it.skip("resizing.dragend fires splitter resize", function() { var triggered = false; splitter = create({ resize: function() { triggered = true; } }); @@ -202,7 +202,7 @@ assert.isOk(triggered); }); - it("resizing.dragend for panes with constraints", function() { + it.skip("resizing.dragend for panes with constraints", function() { splitter = create({ panes: [{ min: "50px" }, {}] }); var resizingHandler = splitter.object.resizing, @@ -218,7 +218,7 @@ assert.equal(panes[1].offsetWidth, 143); }); - it("resizing.dragend assigns percentage sizes when resizing fluid panes", function() { + it.skip("resizing.dragend assigns percentage sizes when resizing fluid panes", function() { splitter = create({ panes: [{ size: "100px" }, {}] }); var resizingHandler = splitter.object.resizing, @@ -331,7 +331,7 @@ assert.equal(resizingHandler._max(), 297); }); - it("resizing.dragend modifies pane sizes", function() { + it.skip("resizing.dragend modifies pane sizes", function() { splitter = create({ orientation: "vertical" }); var resizingHandler = splitter.object.resizing, @@ -348,7 +348,7 @@ assert.closeTo(parseInt(panes[1].offsetHeight), initialPaneSizes[1] - 5, 1); }); - it("resizing.dragend for middle panes", function() { + it.skip("resizing.dragend for middle panes", function() { splitter = create({ orientation: "vertical" }, 4, { height: 421 }); var resizingHandler = splitter.object.resizing, diff --git a/tests/splitter/panesizing.js b/tests/splitter/panesizing.js index fc0fb51d689..19dc52df83e 100644 --- a/tests/splitter/panesizing.js +++ b/tests/splitter/panesizing.js @@ -47,7 +47,7 @@ var panes = splitter.dom.find(".k-pane"); - assert.equal(panes[0].style.width, "19px"); + assert.equal(panes[0].style.flexBasis, "19px"); }); it("sizes of fluid panes get properly rounded", function() { @@ -116,7 +116,7 @@ var panes = splitter.dom.find(".k-pane"); - assert.equal(panes[0].style.height, "19px"); + assert.equal(panes[0].style.flexBasis, "19px"); }); it("sizes of fluid panes get properly rounded", function() { @@ -136,7 +136,7 @@ var panes = splitter.dom.find(".k-pane"); - assert.equal(panes[0].style.height, "20px"); + assert.equal(panes[0].style.flexBasis, "20px"); }); });