@brightspace-ui/core 3.18.0 → 3.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -297,6 +297,40 @@ The `getUTCDateTimeRange(rangeType, diff)` helper function can be used to get th
|
|
297
297
|
</d2l-filter>
|
298
298
|
```
|
299
299
|
|
300
|
+
## Dimension Set Value: Date-Time Range
|
301
|
+
|
302
|
+
This component is built to be used alongside the [d2l-filter-dimension-set](#d2l-filter-dimension-set) component. It will give you a selectable filter value which expands to allow the user to select a date range using either the `d2l-input-date-time-range` or `d2l-input-date-range` component (depending on the `type` of the component). Selection triggers the `d2l-filter-change` event, with `start-value` and `end-value` (in UTC) being included in the changes for the `selected` item.
|
303
|
+
|
304
|
+
<!-- docs: demo code properties name:d2l-filter-dimension-set-date-time-range-value align:start autoOpen:true autoSize:false size:large -->
|
305
|
+
```html
|
306
|
+
<script type="module">
|
307
|
+
import '@brightspace-ui/core/components/filter/filter.js';
|
308
|
+
import '@brightspace-ui/core/components/filter/filter-dimension-set.js';
|
309
|
+
import '@brightspace-ui/core/components/filter/filter-dimension-set-date-text-value.js';
|
310
|
+
import '@brightspace-ui/core/components/filter/filter-dimension-set-date-time-range-value.js';
|
311
|
+
</script>
|
312
|
+
<d2l-filter>
|
313
|
+
<d2l-filter-dimension-set key="dates" text="Dates">
|
314
|
+
<d2l-filter-dimension-set-date-text-value key="48hours" range="48hours"></d2l-filter-dimension-set-date-text-value>
|
315
|
+
<d2l-filter-dimension-set-date-text-value key="14days" range="14days"></d2l-filter-dimension-set-date-text-value>
|
316
|
+
<d2l-filter-dimension-set-date-time-range-value key="custom" selected></d2l-filter-dimension-set-date-time-range-value>
|
317
|
+
</d2l-filter-dimension-set>
|
318
|
+
</d2l-filter>
|
319
|
+
```
|
320
|
+
<!-- docs: start hidden content -->
|
321
|
+
### Properties
|
322
|
+
|
323
|
+
| Property | Type | Description |
|
324
|
+
|---|---|---|
|
325
|
+
| `key` | String, required | Unique identifier within a dimension for the value |
|
326
|
+
| `disabled` | Boolean, default: `false` | Whether the value in the filter is disabled or not |
|
327
|
+
| `end-value` | String | Value of the end date or date-time input. Expected to be in UTC. |
|
328
|
+
| `selected` | Boolean, default: `false` | Whether the value in the filter is selected or not |
|
329
|
+
| `start-value` | String | Value of the start date or date-time input. Expected to be in UTC. |
|
330
|
+
| `text` | String, default: `"Custom Date Range"` (localized) | Text for the value in the list. This would override the default value. |
|
331
|
+
| `type` | String, default: `"date-time"` | Type of range input. Can be either `date-time` or `date`. |
|
332
|
+
<!-- docs: end hidden content -->
|
333
|
+
|
300
334
|
## Search and Paging
|
301
335
|
|
302
336
|
Most filters will not need search or paging features since filter value lists are generally short. For longer lists of filter values when Search is necessary, it can be enabled by setting search-type to `automatic` or `manual`.
|
@@ -20,7 +20,8 @@ class FilterDimensionSetDateTimeRangeValue extends LocalizeCoreElement(LitElemen
|
|
20
20
|
*/
|
21
21
|
disabled: { type: Boolean, reflect: true },
|
22
22
|
/**
|
23
|
-
*
|
23
|
+
* Value of the end date or date-time input. Expected to be in UTC.
|
24
|
+
* @type {string}
|
24
25
|
*/
|
25
26
|
endValue: { type: String, attribute: 'end-value' },
|
26
27
|
/**
|
@@ -34,7 +35,8 @@ class FilterDimensionSetDateTimeRangeValue extends LocalizeCoreElement(LitElemen
|
|
34
35
|
*/
|
35
36
|
selected: { type: Boolean, reflect: true },
|
36
37
|
/**
|
37
|
-
*
|
38
|
+
* Value of the start date or date-time input. Expected to be in UTC.
|
39
|
+
* @type {string}
|
38
40
|
*/
|
39
41
|
startValue: { type: String, attribute: 'start-value' },
|
40
42
|
/**
|
package/custom-elements.json
CHANGED
@@ -3873,11 +3873,21 @@
|
|
3873
3873
|
"path": "./components/filter/filter-dimension-set-date-time-range-value.js",
|
3874
3874
|
"description": "A component to represent a possible custom date range or date-time range value that can be selected for a dimension set (the main filter dimension type).\nThe start-value and end-value will be included in the d2l-filter-change event and formatted as an ISO string in UTC time.\nThis component does not render anything, but instead gathers data needed for the d2l-filter.",
|
3875
3875
|
"attributes": [
|
3876
|
+
{
|
3877
|
+
"name": "end-value",
|
3878
|
+
"description": "Value of the end date or date-time input. Expected to be in UTC.",
|
3879
|
+
"type": "string"
|
3880
|
+
},
|
3876
3881
|
{
|
3877
3882
|
"name": "key",
|
3878
3883
|
"description": "REQUIRED: Unique key to represent this value in the dimension",
|
3879
3884
|
"type": "string"
|
3880
3885
|
},
|
3886
|
+
{
|
3887
|
+
"name": "start-value",
|
3888
|
+
"description": "Value of the start date or date-time input. Expected to be in UTC.",
|
3889
|
+
"type": "string"
|
3890
|
+
},
|
3881
3891
|
{
|
3882
3892
|
"name": "text",
|
3883
3893
|
"description": "Defaults to \"Custom Date Range\" (localized). Can be overridden if desired.",
|
@@ -3903,12 +3913,24 @@
|
|
3903
3913
|
}
|
3904
3914
|
],
|
3905
3915
|
"properties": [
|
3916
|
+
{
|
3917
|
+
"name": "endValue",
|
3918
|
+
"attribute": "end-value",
|
3919
|
+
"description": "Value of the end date or date-time input. Expected to be in UTC.",
|
3920
|
+
"type": "string"
|
3921
|
+
},
|
3906
3922
|
{
|
3907
3923
|
"name": "key",
|
3908
3924
|
"attribute": "key",
|
3909
3925
|
"description": "REQUIRED: Unique key to represent this value in the dimension",
|
3910
3926
|
"type": "string"
|
3911
3927
|
},
|
3928
|
+
{
|
3929
|
+
"name": "startValue",
|
3930
|
+
"attribute": "start-value",
|
3931
|
+
"description": "Value of the start date or date-time input. Expected to be in UTC.",
|
3932
|
+
"type": "string"
|
3933
|
+
},
|
3912
3934
|
{
|
3913
3935
|
"name": "text",
|
3914
3936
|
"attribute": "text",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.19.0",
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
5
5
|
"type": "module",
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|