Skip to content

Commit f7464ee

Browse files
committed
Sync with Kendo UI Professional
1 parent cda4344 commit f7464ee

File tree

7 files changed

+203
-3
lines changed

7 files changed

+203
-3
lines changed

docs-aspnet/_config-mvc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ html-helpers/editors/rating/razor-page.md,
9898
html-helpers/editors/slider/razor-page.md,
9999
html-helpers/editors/switch/razor-page.md,
100100
html-helpers/editors/upload/razor-page.md,
101+
html-helpers/editors/timedurationpicker/razor-page.md,
101102
html-helpers/editors/captcha/razor-page.md,
102103
html-helpers/editors/dropdownlist/troubleshooting.md,
103104
html-helpers/editors/imageeditor/razor-page.md,

docs-aspnet/html-helpers/editors/timedurationpicker/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Events
33
page_title: TimeDurationPicker Events
44
description: "Learn how to handle the events of the Telerik UI TimeDurationPicker component for {{ site.framework }}."
55
slug: htmlhelpers_timedurationpickerhelper_events
6-
position: 7
6+
position: 8
77
---
88

99
# TimeDurationPicker Events
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: Model Binding
3+
page_title: Model Binding
4+
description: "Learn how to implement model binding with the Telerik UI TimeDurationPicker component for {{ site.framework }}."
5+
slug: htmlhelpers_timedurationpickerhelper_model_binding
6+
position: 6
7+
---
8+
9+
# Model Binding
10+
11+
You can bind the Telerik UI for {{ site.framework }} TimeDurationPicker to model fields, allowing you to edit and submit model properties directly.
12+
13+
The component is designed to work with the `decimal?` (nullable decimal) type. The value is expressed in milliseconds.
14+
15+
## Example
16+
17+
```csharp Model
18+
public class TimeDurationPickerViewModel
19+
{
20+
public decimal? Duration { get; set; }
21+
}
22+
```
23+
```csharp Controller
24+
public ActionResult Index()
25+
{
26+
var model = new TimeDurationPickerViewModel
27+
{
28+
// 1 hour 30 minutes in milliseconds
29+
Duration = 5400000m
30+
};
31+
32+
return View(model);
33+
}
34+
```
35+
```HtmlHelper
36+
@model TimeDurationPickerViewModel
37+
38+
@(Html.Kendo().TimeDurationPickerFor(m => m.Duration)
39+
.InputMode("numeric")
40+
.Columns(c =>
41+
{
42+
c.Hours().Format("## hours");
43+
c.Minutes().Format("## minutes");
44+
})
45+
)
46+
```
47+
{% if site.core %}
48+
```TagHelper
49+
@addTagHelper *, Kendo.Mvc
50+
@model TimeDurationPickerViewModel
51+
52+
<kendo-timedurationpicker for="Duration" input-mode="numeric">
53+
<timedurationpicker-columns>
54+
<timedurationpicker-column name="hours" format="## hours"></timedurationpicker-column>
55+
<timedurationpicker-column name="minutes" format="## minutes"></timedurationpicker-column>
56+
</timedurationpicker-columns>
57+
</kendo-timedurationpicker>
58+
```
59+
{% endif %}
60+
61+
## Notes
62+
63+
* The recommended binding type is `decimal?`.
64+
* The unit of the value is milliseconds.
65+
* Validation attributes such as `[Required]` are supported.
66+
* Use the `InputMode()` and `Columns()` configuration to define how the duration values are displayed and ensure proper accessibility labeling.labeling may break in some scenarios.
67+
68+
## See Also
69+
70+
* [TimeDurationPicker Overview]({% slug htmlhelpers_timedurationpickerhelper_overview %})
71+
* [Server-Side API](/api/timedurationpicker)
72+
{% if site.core %}
73+
* [TagHelper API](/api/taghelpers/timedurationpicker)
74+
{% endif %}

docs-aspnet/html-helpers/editors/timedurationpicker/overview.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,20 @@ To configure the TimeDurationPicker, pass the configuration options as attribute
7070
* [Columns]({% slug htmlhelpers_timedurationpickerhelper_columns %})&mdash;The TimeDurationPicker allows you to configure the columns displayed in the popup and apply formatting to the input value.
7171
* [Shortcuts]({% slug htmlhelpers_timedurationpickerhelper_shortcuts %})&mdash;You can add TimeDurationPicker buttons that hold certain time frame values.
7272
* [Appearance]({% slug htmlhelpers_timedurationpickerhelper_appearance %})&mdash;You can use various built-in styling options that control the appearance of the TimeDurationPicker.
73+
* [Adaptiveness]({% slug htmlhelpers_timedurationpicker_adaptive_mode_aspnetcore %})&mdash;The TimeDurationPicker supports adaptive mode that provides mobile-friendly rendering by automatically adjusting its popup layout based on screen size.
74+
* [Model Binding]({% slug htmlhelpers_timedurationpickerhelper_model_binding %})&mdash;Bind the TimeDurationPicker to a model field of type `decimal?` and configure the input mode and columns.
7375
* [Events]({% slug htmlhelpers_timedurationpickerhelper_events %})&mdash;Handling the events of the TimeDurationPicker allows you to implement custom functionality.
76+
* [Accessibility]({% slug htmlhelpers_timedurationpicker_accessibility %})&mdash;The TimeDurationPicker is accessible by screen readers and provides WAI-ARIA, Section 508, WCAG 2.2, and [keyboard support]({% slug htmlhelpers_timedurationpickerhelper_keyboard_navigation %}).
7477

7578
## Next Steps
7679

7780
* [Getting Started with the TimeDurationPicker]({% slug htmlhelpers_timedurationpickerhelper_getting_started %})
7881
* [Basic Usage of the TimeDurationPicker for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/timedurationpicker)
82+
{% if site.core %}
83+
* [TimeDurationPicker in Razor Pages]({%slug htmlhelpers_timedurationpickerhelper_razorpage_aspnetcore%})
84+
{% endif %}
85+
86+
7987

8088
## See Also
8189

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
title: Razor Pages
3+
page_title: Razor Pages
4+
description: "Learn how to use the Telerik UI TimeDurationPicker component for {{ site.framework }} in a Razor Pages application."
5+
slug: htmlhelpers_timedurationpickerhelper_razorpage_aspnetcore
6+
position: 7
7+
---
8+
9+
# TimeDurationPicker in Razor Pages
10+
11+
Razor Pages is an alternative to the MVC pattern that makes page-focused coding easier and more productive. This approach consists of a `cshtml` file and a `cshtml.cs` file (by design, the two files have the same name).
12+
13+
You can seamlessly integrate the Telerik UI TimeDurationPicker for {{ site.framework }} in Razor Pages applications.
14+
15+
This article describes how to configure the TimeDurationPicker component in a Razor Pages scenario.
16+
17+
## Binding the TimeDurationPicker to a PageModel Property
18+
19+
To bind the TimeDurationPicker to a property from the `PageModel`, follow the next steps:
20+
21+
1. Add a property to the `PageModel` that must bind to the TimeDurationPicker.
22+
23+
```csharp Index.cshtml.cs
24+
public class IndexModel : PageModel
25+
{
26+
[BindProperty]
27+
public decimal? Duration { get; set; }
28+
29+
public void OnGet()
30+
{
31+
// Assign a value in milliseconds (1h 30m = 5400000 ms)
32+
Duration = 5400000m;
33+
}
34+
35+
public void OnPost()
36+
{
37+
// Duration will be populated with the submitted value
38+
}
39+
}
40+
```
41+
42+
1. Declare the `PageModel` at the top of the page.
43+
44+
```Razor
45+
@page
46+
@model IndexModel
47+
```
48+
49+
1. Bind the TimeDurationPicker to the property using the `TimeDurationPickerFor()` configuration.
50+
51+
```HtmlHelper
52+
@page
53+
@model IndexModel
54+
55+
@(Html.Kendo().TimeDurationPickerFor(m => m.Duration)
56+
.InputMode("numeric")
57+
.Columns(c =>
58+
{
59+
c.Hours().Format("## hours ");
60+
c.Minutes().Format(" ## minutes");
61+
})
62+
)
63+
```
64+
```TagHelper
65+
@page
66+
@model IndexModel
67+
@addTagHelper *, Kendo.Mvc
68+
69+
<kendo-timedurationpicker for="Duration" input-mode="numeric">
70+
<timedurationpicker-columns>
71+
<timedurationpicker-column name="hours" format="## hours "></timedurationpicker-column>
72+
<timedurationpicker-column name="minutes" format=" ## minutes"></timedurationpicker-column>
73+
</timedurationpicker-columns>
74+
</kendo-timedurationpicker>
75+
```
76+
77+
## Notes
78+
79+
* The recommended binding type is `decimal?`.
80+
* The unit of the value is milliseconds.
81+
* Validation attributes such as `[BindProperty]` and data annotations like `[Required]` are supported.
82+
* Use the `InputMode()` and `Columns()` configuration (or their TagHelper equivalents) to explicitly define how the duration values are displayed.
83+
84+
## See Also
85+
86+
* [Using Telerik UI for ASP.NET Core in Razor Pages](https://docs.telerik.com/aspnet-core/getting-started/razor-pages#using-telerik-ui-for-aspnet-core-in-razor-pages)
87+
* [TimeDurationPicker Overview]({% slug htmlhelpers_timedurationpickerhelper_overview %})
88+
* [Server-Side HtmlHelper API of the TimeDurationPicker](/api/timedurationpicker)
89+
* [Server-Side TagHelper API of the TimeDurationPicker](/api/taghelpers/timedurationpicker)
90+
* [Knowledge Base Section](/knowledge-base)

docs/api/javascript/ui/aiprompt.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,22 @@ Specifies the maximum number of characters allowed in the textarea.
348348
});
349349
</script>
350350

351+
### promptTextArea.maxRows `Number` *(default: null)*
352+
353+
Specifies the maximum number of visible rows to which the textarea can auto-resize. Used in combination with `resize: "auto"`.
354+
355+
#### Example
356+
357+
<div id="aiprompt"></div>
358+
<script>
359+
$("#aiprompt").kendoAIPrompt({
360+
promptTextArea: {
361+
resize: "auto",
362+
maxRows: 3
363+
}
364+
});
365+
</script>
366+
351367
### promptTextArea.overflow `String`
352368

353369
Specifies the overflow behavior. Available options: `"auto"`, `"hidden"`, `"visible"`, `"scroll"`.
@@ -380,7 +396,7 @@ Specifies the placeholder text for the textarea.
380396

381397
### promptTextArea.resize `String`
382398

383-
Specifies the resize behavior. Available options: `"none"`, `"both"`, `"horizontal"`, `"vertical"`.
399+
Specifies the resize behavior. Available options: `"none"`, `"both"`, `"horizontal"`, `"vertical"`, `"auto"`.
384400

385401
#### Example
386402

src/kendo.validator.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const __meta__ = {
2222
MESSAGEBOX = "k-messagebox k-messagebox-error",
2323
INPUTINNER = ".k-input-inner",
2424
UPLOADBUTTONWRAPPER = ".k-upload-button-wrap",
25+
CHECKBOXWRAPPER= ".k-checkbox-wrap",
2526
INPUTWRAPPER = ".k-input",
2627
ARIAINVALID = "aria-invalid",
2728
ARIADESCRIBEDBY = "aria-describedby",
@@ -728,6 +729,7 @@ export const __meta__ = {
728729
containerElement = this._containerElement,
729730
inputs = containerElement.find(that._inputSelector);
730731
let sorted = [];
732+
let checkBoxNames = [];
731733

732734
for (let idx = 0, length = inputs.length; idx < length; idx++) {
733735
let input = $(inputs[idx]);
@@ -736,10 +738,19 @@ export const __meta__ = {
736738
// Add current name if:
737739
// - not present so far;
738740
// - present but not part of CheckBoxGroup or RadioGroup.
741+
739742
if (sorted.indexOf(input.attr(NAME)) === -1 ||
740743
(input.closest(".k-checkbox-list").length === 0 &&
741744
input.closest(".k-radio-list").length === 0)) {
742-
sorted.push(input.attr(NAME));
745+
if (input.parents(CHECKBOXWRAPPER).length) {
746+
checkBoxNames.push(input.attr(NAME));
747+
sorted.push(input.attr(NAME));
748+
}
749+
else {
750+
if (!checkBoxNames.includes(input.attr(NAME))) {
751+
sorted.push(input.attr(NAME));
752+
}
753+
}
743754
}
744755
}
745756
}

0 commit comments

Comments
 (0)