@brightspace-ui/core 2.102.0 → 2.104.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.
- package/README.md +7 -7
- package/components/alert/alert.js +1 -1
- package/components/breadcrumbs/breadcrumb.js +2 -2
- package/components/breadcrumbs/breadcrumbs.js +1 -1
- package/components/button/button-icon.js +3 -4
- package/components/button/button-mixin.js +1 -1
- package/components/button/button-move.js +245 -0
- package/components/button/button-subtle.js +1 -1
- package/components/button/demo/button-move.html +46 -0
- package/components/button/floating-buttons.js +1 -1
- package/components/calendar/calendar.js +1 -1
- package/components/card/card-footer-link.js +2 -2
- package/components/card/card.js +2 -2
- package/components/collapsible-panel/collapsible-panel.js +2 -2
- package/components/count-badge/count-badge-icon.js +1 -1
- package/components/count-badge/count-badge-mixin.js +1 -1
- package/components/count-badge/count-badge.js +1 -1
- package/components/dialog/dialog-mixin.js +1 -1
- package/components/dropdown/dropdown-button.js +1 -1
- package/components/dropdown/dropdown-content-mixin.js +1 -1
- package/components/dropdown/dropdown-context-menu.js +1 -1
- package/components/dropdown/dropdown-menu.js +1 -1
- package/components/dropdown/dropdown-more.js +1 -1
- package/components/empty-state/empty-state-simple.js +1 -1
- package/components/filter/filter-overflow-group.js +1 -1
- package/components/filter/filter.js +2 -2
- package/components/focus-trap/focus-trap.js +1 -1
- package/components/form/form-errory-summary.js +1 -1
- package/components/html-block/demo/html-block.html +1 -1
- package/components/html-block/html-block.js +1 -1
- package/components/icons/icon-custom.js +1 -1
- package/components/icons/icon.js +1 -1
- package/components/inputs/README.md +1 -1
- package/components/inputs/demo/input-radio-label-simple-test.js +1 -1
- package/components/inputs/demo/input-radio-label-test.js +1 -1
- package/components/inputs/demo/input-select-test.js +1 -1
- package/components/inputs/docs/input-radio.md +1 -1
- package/components/inputs/docs/input-select-styles.md +1 -1
- package/components/inputs/input-checkbox-spacer.js +1 -1
- package/components/inputs/input-checkbox.js +2 -2
- package/components/inputs/input-color.js +1 -1
- package/components/inputs/input-date-range.js +2 -2
- package/components/inputs/input-date-time-range.js +2 -2
- package/components/inputs/input-date-time.js +3 -3
- package/components/inputs/input-date.js +2 -2
- package/components/inputs/input-fieldset.js +1 -1
- package/components/inputs/input-number.js +2 -2
- package/components/inputs/input-percent.js +3 -3
- package/components/inputs/input-radio-spacer.js +1 -1
- package/components/inputs/input-search.js +2 -2
- package/components/inputs/input-text.js +3 -3
- package/components/inputs/input-textarea.js +3 -3
- package/components/inputs/input-time-range.js +2 -2
- package/components/inputs/input-time.js +2 -2
- package/components/link/link.js +1 -1
- package/components/list/list-item-drag-handle.js +94 -126
- package/components/list/list-item-drag-image.js +1 -1
- package/components/list/list-item-generic-layout.js +2 -3
- package/components/list/list-item-mixin.js +2 -2
- package/components/list/list-item-placement-marker.js +1 -1
- package/components/menu/menu-item-checkbox.js +1 -1
- package/components/menu/menu-item-radio.js +1 -1
- package/components/menu/menu-item-return.js +1 -1
- package/components/menu/menu.js +1 -1
- package/components/meter/meter-circle.js +1 -1
- package/components/meter/meter-linear.js +1 -1
- package/components/meter/meter-radial.js +1 -1
- package/components/object-property-list/object-property-list-item-link.js +1 -1
- package/components/offscreen/offscreen.js +1 -1
- package/components/overflow-group/overflow-group.js +1 -1
- package/components/paging/pager-load-more.js +1 -1
- package/components/scroll-wrapper/demo/scroll-wrapper-test.js +1 -1
- package/components/scroll-wrapper/scroll-wrapper.js +1 -1
- package/components/selection/selection-action-dropdown.js +1 -1
- package/components/selection/selection-action.js +1 -1
- package/components/selection/selection-controls.js +1 -1
- package/components/selection/selection-input.js +1 -1
- package/components/selection/selection-mixin.js +1 -1
- package/components/selection/selection-select-all-pages.js +1 -1
- package/components/selection/selection-select-all.js +1 -1
- package/components/skeleton/skeleton-mixin.js +1 -1
- package/components/switch/switch-mixin.js +2 -2
- package/components/table/demo/table-test.js +1 -1
- package/components/table/table-col-sort-button.js +1 -1
- package/components/table/table-wrapper.js +1 -1
- package/components/tabs/tab-internal.js +1 -1
- package/components/tabs/tabs.js +2 -2
- package/components/tag-list/tag-list-item-mixin.js +1 -1
- package/components/tag-list/tag-list.js +2 -2
- package/components/tooltip/tooltip-help.js +1 -1
- package/components/tooltip/tooltip.js +1 -1
- package/custom-elements.json +60 -0
- package/helpers/demo/prism.html +3 -3
- package/mixins/{arrow-keys-mixin.md → arrow-keys/README.md} +2 -2
- package/mixins/arrow-keys/arrow-keys-mixin.js +125 -0
- package/mixins/{demo → arrow-keys/demo}/arrow-keys-mixin.html +2 -2
- package/mixins/{demo → arrow-keys/demo}/arrow-keys-test.js +1 -1
- package/mixins/arrow-keys-mixin.js +1 -125
- package/mixins/{focus-mixin.md → focus/README.md} +1 -1
- package/mixins/focus/focus-mixin.js +43 -0
- package/mixins/focus-mixin.js +1 -43
- package/mixins/{interactive-mixin.md → interactive/README.md} +1 -1
- package/mixins/{interactive-mixin.js → interactive/interactive-mixin.js} +4 -4
- package/mixins/{labelled-mixin.md → labelled/README.md} +2 -2
- package/mixins/{demo → labelled/demo}/labelled-mixin.html +3 -3
- package/mixins/labelled/labelled-mixin.js +215 -0
- package/mixins/labelled-mixin.js +1 -215
- package/mixins/{provider-mixin.md → provider/README.md} +3 -3
- package/mixins/provider/provider-mixin.js +35 -0
- package/mixins/provider-mixin.js +1 -35
- package/mixins/{rtl-mixin.md → rtl/README.md} +1 -1
- package/mixins/rtl/rtl-mixin.js +40 -0
- package/mixins/rtl-mixin.js +1 -40
- package/mixins/theme/theme-mixin.js +19 -0
- package/mixins/theme-mixin.js +1 -19
- package/mixins/{visible-on-ancestor-mixin.md → visible-on-ancestor/README.md} +1 -1
- package/mixins/visible-on-ancestor/visible-on-ancestor-mixin.js +160 -0
- package/mixins/visible-on-ancestor-mixin.js +1 -160
- package/package.json +1 -1
- package/templates/primary-secondary/primary-secondary.js +1 -1
- package/tools/dom-test-helpers.js +4 -3
|
@@ -23,7 +23,7 @@ Import the label styles and `RtlMixin` and include them in your component:
|
|
|
23
23
|
|
|
24
24
|
```javascript
|
|
25
25
|
import {inputLabelStyles} from '@brightspace-ui/core/components/inputs/input-label-styles.js';
|
|
26
|
-
import {RtlMixin} from '@brightspace-ui/core/mixins/rtl-mixin.js';
|
|
26
|
+
import {RtlMixin} from '@brightspace-ui/core/mixins/rtl/rtl-mixin.js';
|
|
27
27
|
|
|
28
28
|
class MyElem extends RtlMixin(LitElement) {
|
|
29
29
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html, LitElement } from 'lit';
|
|
2
2
|
import { radioStyles } from '../input-radio-styles.js';
|
|
3
|
-
import { RtlMixin } from '../../../mixins/rtl-mixin.js';
|
|
3
|
+
import { RtlMixin } from '../../../mixins/rtl/rtl-mixin.js';
|
|
4
4
|
|
|
5
5
|
class TestInputRadioLabelSimple extends RtlMixin(LitElement) {
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css, html, LitElement } from 'lit';
|
|
2
2
|
import { radioStyles } from '../input-radio-styles.js';
|
|
3
|
-
import { RtlMixin } from '../../../mixins/rtl-mixin.js';
|
|
3
|
+
import { RtlMixin } from '../../../mixins/rtl/rtl-mixin.js';
|
|
4
4
|
|
|
5
5
|
class TestInputRadioLabel extends RtlMixin(LitElement) {
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css, html, LitElement } from 'lit';
|
|
2
|
-
import { RtlMixin } from '../../../mixins/rtl-mixin.js';
|
|
2
|
+
import { RtlMixin } from '../../../mixins/rtl/rtl-mixin.js';
|
|
3
3
|
import { selectStyles } from '../input-select-styles.js';
|
|
4
4
|
import { SkeletonMixin } from '../../../components/skeleton/skeleton-mixin.js';
|
|
5
5
|
|
|
@@ -39,7 +39,7 @@ For disabled items, add the `d2l-input-radio-label-disabled` class on the label
|
|
|
39
39
|
```html
|
|
40
40
|
<script type="module">
|
|
41
41
|
import { html, LitElement } from 'lit';
|
|
42
|
-
import { RtlMixin } from '@brightspace-ui/core/mixins/rtl-mixin.js';
|
|
42
|
+
import { RtlMixin } from '@brightspace-ui/core/mixins/rtl/rtl-mixin.js';
|
|
43
43
|
import { radioStyles } from '@brightspace-ui/core/components/inputs/input-radio-styles.js';
|
|
44
44
|
|
|
45
45
|
class MyRadioElem extends RtlMixin(LitElement) {
|
|
@@ -56,7 +56,7 @@ Note: in order for RTL to function correctly, make sure your component uses the
|
|
|
56
56
|
```html
|
|
57
57
|
<script type="module">
|
|
58
58
|
import { css, html, LitElement } from 'lit';
|
|
59
|
-
import { RtlMixin } from '@brightspace-ui/core/mixins/rtl-mixin.js';
|
|
59
|
+
import { RtlMixin } from '@brightspace-ui/core/mixins/rtl/rtl-mixin.js';
|
|
60
60
|
import { selectStyles } from '@brightspace-ui/core/components/inputs/input-select-styles.js';
|
|
61
61
|
import { SkeletonMixin } from '@brightspace-ui/core/components/skeleton/skeleton-mixin.js';
|
|
62
62
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import '../colors/colors.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
4
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
5
5
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
6
6
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
7
7
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
8
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
8
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
9
9
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
10
10
|
|
|
11
11
|
export const checkboxStyles = css`
|
|
@@ -4,7 +4,7 @@ import '../tooltip/tooltip.js';
|
|
|
4
4
|
import { css, html, LitElement, nothing, unsafeCSS } from 'lit';
|
|
5
5
|
import { buttonStyles } from '../button/button-styles.js';
|
|
6
6
|
import { classMap } from 'lit/directives/class-map.js';
|
|
7
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
7
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
8
8
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
|
9
9
|
import { getFocusPseudoClass } from '../../helpers/focus.js';
|
|
10
10
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -4,12 +4,12 @@ import './input-fieldset.js';
|
|
|
4
4
|
import '../tooltip/tooltip.js';
|
|
5
5
|
import { css, html, LitElement } from 'lit';
|
|
6
6
|
import { formatDateTimeInISO, getDateFromISODate, parseISODateTime } from '../../helpers/dateTime.js';
|
|
7
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
7
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
8
8
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
|
9
9
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
10
10
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
11
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
12
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
12
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
13
13
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
14
14
|
|
|
15
15
|
export function getShiftedEndDate(startValue, endValue, prevStartValue, inclusive) {
|
|
@@ -5,12 +5,12 @@ import '../tooltip/tooltip.js';
|
|
|
5
5
|
import { convertLocalToUTCDateTime, convertUTCToLocalDateTime } from '@brightspace-ui/intl/lib/dateTime.js';
|
|
6
6
|
import { css, html, LitElement } from 'lit';
|
|
7
7
|
import { formatDateTimeInISO, getAdjustedTime, getDateFromISODateTime, getDateNoConversion, parseISODateTime } from '../../helpers/dateTime.js';
|
|
8
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
8
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
9
9
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
|
10
10
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
11
11
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
12
12
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
13
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
13
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
14
14
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
15
15
|
|
|
16
16
|
function _isSameDate(date1, date2) {
|
|
@@ -13,15 +13,15 @@ import { formatDateInISO,
|
|
|
13
13
|
parseISODate,
|
|
14
14
|
parseISODateTime,
|
|
15
15
|
parseISOTime } from '../../helpers/dateTime.js';
|
|
16
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
16
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
17
17
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
|
18
18
|
import { getDefaultTime } from './input-time.js';
|
|
19
19
|
import { getDocumentLocaleSettings } from '@brightspace-ui/intl/lib/common.js';
|
|
20
20
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
21
21
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
22
|
-
import { LabelledMixin } from '../../mixins/labelled-mixin.js';
|
|
22
|
+
import { LabelledMixin } from '../../mixins/labelled/labelled-mixin.js';
|
|
23
23
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
24
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
24
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
25
25
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
26
26
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
27
27
|
|
|
@@ -8,11 +8,11 @@ import './input-text.js';
|
|
|
8
8
|
import { css, html, LitElement } from 'lit';
|
|
9
9
|
import { formatDate, parseDate } from '@brightspace-ui/intl/lib/dateTime.js';
|
|
10
10
|
import { formatDateInISO, getDateFromISODate, getDateTimeDescriptorShared, getToday } from '../../helpers/dateTime.js';
|
|
11
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
11
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
12
12
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
|
13
13
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
14
14
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
15
|
-
import { LabelledMixin } from '../../mixins/labelled-mixin.js';
|
|
15
|
+
import { LabelledMixin } from '../../mixins/labelled/labelled-mixin.js';
|
|
16
16
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
17
17
|
import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
|
|
18
18
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
@@ -2,7 +2,7 @@ import { css, html, LitElement } from 'lit';
|
|
|
2
2
|
import { classMap } from 'lit/directives/class-map.js';
|
|
3
3
|
import { inputLabelStyles } from './input-label-styles.js';
|
|
4
4
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
5
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
5
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
6
6
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './input-text.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
3
|
import { formatNumber, getNumberDescriptor, parseNumber } from '@brightspace-ui/intl/lib/number.js';
|
|
4
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
4
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
5
5
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
|
6
6
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
7
7
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
|
-
import { LabelledMixin } from '../../mixins/labelled-mixin.js';
|
|
8
|
+
import { LabelledMixin } from '../../mixins/labelled/labelled-mixin.js';
|
|
9
9
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
10
10
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './input-number.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
3
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
4
4
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
|
-
import { LabelledMixin } from '../../mixins/labelled-mixin.js';
|
|
6
|
+
import { LabelledMixin } from '../../mixins/labelled/labelled-mixin.js';
|
|
7
7
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
8
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
8
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
9
9
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -2,11 +2,11 @@ import '../button/button-icon.js';
|
|
|
2
2
|
import '../colors/colors.js';
|
|
3
3
|
import './input-text.js';
|
|
4
4
|
import { css, html, LitElement } from 'lit';
|
|
5
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
5
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
6
6
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
7
7
|
import { inputStyles } from './input-styles.js';
|
|
8
8
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
9
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
9
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
10
10
|
|
|
11
11
|
const INPUT_TIMEOUT_MS = 400;
|
|
12
12
|
|
|
@@ -2,17 +2,17 @@ import '../colors/colors.js';
|
|
|
2
2
|
import '../tooltip/tooltip.js';
|
|
3
3
|
import { css, html, LitElement, nothing } from 'lit';
|
|
4
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
5
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
6
6
|
import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
|
|
7
7
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
|
8
8
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
9
9
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
10
10
|
import { inputLabelStyles } from './input-label-styles.js';
|
|
11
11
|
import { inputStyles } from './input-styles.js';
|
|
12
|
-
import { LabelledMixin } from '../../mixins/labelled-mixin.js';
|
|
12
|
+
import { LabelledMixin } from '../../mixins/labelled/labelled-mixin.js';
|
|
13
13
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
14
14
|
import { PerfMonitor } from '../../helpers/perfMonitor.js';
|
|
15
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
15
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
16
16
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
17
17
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
18
18
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import '../tooltip/tooltip.js';
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
3
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
4
4
|
import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
|
|
5
5
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
|
6
6
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
7
7
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
8
|
import { inputLabelStyles } from './input-label-styles.js';
|
|
9
9
|
import { inputStyles } from './input-styles.js';
|
|
10
|
-
import { LabelledMixin } from '../../mixins/labelled-mixin.js';
|
|
10
|
+
import { LabelledMixin } from '../../mixins/labelled/labelled-mixin.js';
|
|
11
11
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
12
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
12
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
13
13
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
14
14
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
15
15
|
|
|
@@ -4,12 +4,12 @@ import '../tooltip/tooltip.js';
|
|
|
4
4
|
import { css, html, LitElement } from 'lit';
|
|
5
5
|
import { formatDateInISOTime, formatTimeInISO, getAdjustedTime, getDateFromISOTime, isValidTime, parseISOTime } from '../../helpers/dateTime.js';
|
|
6
6
|
import { getDefaultTime, getIntervalNumber, getTimeAtInterval } from './input-time.js';
|
|
7
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
7
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
8
8
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
|
9
9
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
10
10
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
11
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
12
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
12
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
13
13
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
14
14
|
|
|
15
15
|
export function getShiftedEndTime(startValue, endValue, prevStartValue, inclusive) {
|
|
@@ -7,13 +7,13 @@ import { css, html, LitElement } from 'lit';
|
|
|
7
7
|
import { formatDateInISOTime, getDateFromISOTime, getToday } from '../../helpers/dateTime.js';
|
|
8
8
|
import { formatTime, parseTime } from '@brightspace-ui/intl/lib/dateTime.js';
|
|
9
9
|
import { bodySmallStyles } from '../typography/styles.js';
|
|
10
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
10
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
11
11
|
import { FormElementMixin } from '../form/form-element-mixin.js';
|
|
12
12
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
13
13
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
14
14
|
import { inputLabelStyles } from './input-label-styles.js';
|
|
15
15
|
import { inputStyles } from './input-styles.js';
|
|
16
|
-
import { LabelledMixin } from '../../mixins/labelled-mixin.js';
|
|
16
|
+
import { LabelledMixin } from '../../mixins/labelled/labelled-mixin.js';
|
|
17
17
|
import { offscreenStyles } from '../offscreen/offscreen.js';
|
|
18
18
|
import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
|
|
19
19
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
package/components/link/link.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../colors/colors.js';
|
|
2
2
|
import { css, html, LitElement, unsafeCSS } from 'lit';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
-
import { FocusMixin } from '../../mixins/focus-mixin.js';
|
|
4
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
5
5
|
import { getFocusPseudoClass } from '../../helpers/focus.js';
|
|
6
6
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
7
7
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import '../button/button-icon.js';
|
|
2
1
|
import '../icons/icon.js';
|
|
3
2
|
import '../tooltip/tooltip.js';
|
|
4
3
|
import { css, html, LitElement } from 'lit';
|
|
5
4
|
import { buttonStyles } from '../button/button-styles.js';
|
|
6
5
|
import { findComposedAncestor } from '../../helpers/dom.js';
|
|
7
|
-
import {
|
|
6
|
+
import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
|
|
8
7
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
9
8
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
10
|
-
import {
|
|
9
|
+
import { moveActions } from '../button/button-move.js';
|
|
10
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
11
11
|
|
|
12
12
|
const keyCodes = Object.freeze({
|
|
13
13
|
DOWN: 40,
|
|
@@ -43,7 +43,7 @@ let hasDisplayedKeyboardTooltip = false;
|
|
|
43
43
|
/**
|
|
44
44
|
* @fires d2l-list-item-drag-handle-action - Dispatched when an action performed on the drag handle
|
|
45
45
|
*/
|
|
46
|
-
class ListItemDragHandle extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
46
|
+
class ListItemDragHandle extends LocalizeCoreElement(FocusMixin(RtlMixin(LitElement))) {
|
|
47
47
|
|
|
48
48
|
static get properties() {
|
|
49
49
|
return {
|
|
@@ -79,33 +79,6 @@ class ListItemDragHandle extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
79
79
|
.d2l-list-item-drag-handle-dragger-button {
|
|
80
80
|
background-color: unset;
|
|
81
81
|
display: block;
|
|
82
|
-
}
|
|
83
|
-
.d2l-list-item-drag-handle-keyboard-button {
|
|
84
|
-
display: grid;
|
|
85
|
-
gap: 2px;
|
|
86
|
-
grid-auto-rows: 1fr 1fr;
|
|
87
|
-
position: relative;
|
|
88
|
-
}
|
|
89
|
-
.d2l-list-item-drag-handle-keyboard-button-up,
|
|
90
|
-
.d2l-list-item-drag-handle-keyboard-button-down {
|
|
91
|
-
height: 1.1rem;
|
|
92
|
-
left: -0.2rem;
|
|
93
|
-
position: absolute;
|
|
94
|
-
width: 1.3rem;
|
|
95
|
-
}
|
|
96
|
-
.d2l-list-item-drag-handle-keyboard-button-up {
|
|
97
|
-
top: -0.25rem;
|
|
98
|
-
}
|
|
99
|
-
.d2l-list-item-drag-handle-keyboard-button-down {
|
|
100
|
-
bottom: -0.25rem;
|
|
101
|
-
}
|
|
102
|
-
:host([dir="rtl"]) .d2l-list-item-drag-handle-keyboard-button-up,
|
|
103
|
-
:host([dir="rtl"]) .d2l-list-item-drag-handle-keyboard-button-down {
|
|
104
|
-
left: auto;
|
|
105
|
-
right: -0.2rem;
|
|
106
|
-
}
|
|
107
|
-
.d2l-list-item-drag-handle-dragger-button,
|
|
108
|
-
.d2l-list-item-drag-handle-keyboard-button {
|
|
109
82
|
margin: 0;
|
|
110
83
|
min-height: 1.8rem;
|
|
111
84
|
padding: 0;
|
|
@@ -119,20 +92,6 @@ class ListItemDragHandle extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
119
92
|
height: 0.9rem;
|
|
120
93
|
width: 0.9rem;
|
|
121
94
|
}
|
|
122
|
-
.d2l-button-up-icon,
|
|
123
|
-
.d2l-button-down-icon {
|
|
124
|
-
border-radius: 0.1rem;
|
|
125
|
-
height: 0.85rem;
|
|
126
|
-
width: 0.9rem;
|
|
127
|
-
}
|
|
128
|
-
.d2l-button-up-icon {
|
|
129
|
-
border-top-left-radius: 0.3rem;
|
|
130
|
-
border-top-right-radius: 0.3rem;
|
|
131
|
-
}
|
|
132
|
-
.d2l-button-down-icon {
|
|
133
|
-
border-bottom-left-radius: 0.3rem;
|
|
134
|
-
border-bottom-right-radius: 0.3rem;
|
|
135
|
-
}
|
|
136
95
|
button,
|
|
137
96
|
button[disabled]:hover,
|
|
138
97
|
button[disabled]:focus {
|
|
@@ -143,14 +102,6 @@ class ListItemDragHandle extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
143
102
|
.d2l-list-item-drag-handle-dragger-button:focus {
|
|
144
103
|
background-color: var(--d2l-color-mica);
|
|
145
104
|
}
|
|
146
|
-
.d2l-list-item-drag-handle-keyboard-button:hover,
|
|
147
|
-
.d2l-list-item-drag-handle-keyboard-button:focus {
|
|
148
|
-
background-color: transparent;
|
|
149
|
-
}
|
|
150
|
-
.d2l-list-item-drag-handle-keyboard-button:hover > d2l-icon,
|
|
151
|
-
.d2l-list-item-drag-handle-keyboard-button:focus > d2l-icon {
|
|
152
|
-
background-color: var(--d2l-color-mica);
|
|
153
|
-
}
|
|
154
105
|
button[disabled] {
|
|
155
106
|
cursor: default;
|
|
156
107
|
opacity: 0.5;
|
|
@@ -178,6 +129,10 @@ class ListItemDragHandle extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
178
129
|
this._movingElement = false;
|
|
179
130
|
}
|
|
180
131
|
|
|
132
|
+
static get focusElementSelector() {
|
|
133
|
+
return '.d2l-list-item-drag-handle-button';
|
|
134
|
+
}
|
|
135
|
+
|
|
181
136
|
render() {
|
|
182
137
|
return this._keyboardActive && !this.disabled ? this._renderKeyboardDragging() : this._renderDragger();
|
|
183
138
|
}
|
|
@@ -192,11 +147,6 @@ class ListItemDragHandle extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
192
147
|
this._keyboardActive = true;
|
|
193
148
|
}
|
|
194
149
|
|
|
195
|
-
focus() {
|
|
196
|
-
const node = getFirstFocusableDescendant(this);
|
|
197
|
-
if (node) node.focus();
|
|
198
|
-
}
|
|
199
|
-
|
|
200
150
|
get _defaultLabel() {
|
|
201
151
|
const namespace = 'components.list-item-drag-handle';
|
|
202
152
|
const defaultLabel = this.localize(`${namespace}.${'default'}`, 'name', this.text);
|
|
@@ -212,37 +162,96 @@ class ListItemDragHandle extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
212
162
|
}));
|
|
213
163
|
}
|
|
214
164
|
|
|
215
|
-
|
|
216
|
-
this._dispatchAction(
|
|
165
|
+
async _doAction(action) {
|
|
166
|
+
this._dispatchAction(action);
|
|
167
|
+
const cell = findComposedAncestor(this, (parent) => parent.hasAttribute && parent.hasAttribute('draggable'));
|
|
168
|
+
if (cell) await cell.updateComplete;
|
|
169
|
+
await this.updateComplete;
|
|
170
|
+
this.focus();
|
|
171
|
+
this._movingElement = false;
|
|
217
172
|
}
|
|
218
173
|
|
|
219
|
-
|
|
220
|
-
this.
|
|
174
|
+
_onDraggerButtonClick() {
|
|
175
|
+
this.activateKeyboardMode();
|
|
221
176
|
}
|
|
222
177
|
|
|
223
|
-
|
|
224
|
-
if (
|
|
178
|
+
_onDraggerButtonKeydown(e) {
|
|
179
|
+
if (e.keyCode !== keyCodes.ENTER && e.keyCode !== keyCodes.SPACE) return;
|
|
180
|
+
e.preventDefault();
|
|
181
|
+
this.activateKeyboardMode();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
_onKeyboardButtonFocusIn() {
|
|
185
|
+
if (hasDisplayedKeyboardTooltip) return;
|
|
186
|
+
this._displayKeyboardTooltip = true;
|
|
187
|
+
hasDisplayedKeyboardTooltip = true;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
_onKeyboardButtonFocusOut(e) {
|
|
191
|
+
this._displayKeyboardTooltip = false;
|
|
192
|
+
if (this._movingElement) {
|
|
193
|
+
this._movingElement = false;
|
|
194
|
+
e.stopPropagation();
|
|
195
|
+
e.preventDefault();
|
|
225
196
|
return;
|
|
226
197
|
}
|
|
198
|
+
this._keyboardActive = false;
|
|
199
|
+
this._dispatchAction(dragActions.save);
|
|
200
|
+
e.stopPropagation();
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
async _onMoveButtonAction(e) {
|
|
204
|
+
|
|
227
205
|
let action = null;
|
|
228
|
-
switch (e.
|
|
229
|
-
case
|
|
206
|
+
switch (e.detail.action) {
|
|
207
|
+
case moveActions.up:
|
|
230
208
|
this._movingElement = true;
|
|
231
209
|
action = dragActions.up;
|
|
232
210
|
this.updateComplete.then(() => this.blur()); // tell screenreaders to refocus
|
|
233
211
|
break;
|
|
234
|
-
case
|
|
212
|
+
case moveActions.down:
|
|
235
213
|
this._movingElement = true;
|
|
236
214
|
action = dragActions.down;
|
|
237
215
|
break;
|
|
238
|
-
case
|
|
216
|
+
case moveActions.right:
|
|
217
|
+
this._movingElement = true;
|
|
218
|
+
action = (this.dir === 'rtl' ? dragActions.unnest : dragActions.nest);
|
|
219
|
+
break;
|
|
220
|
+
case moveActions.left:
|
|
221
|
+
this._movingElement = true;
|
|
222
|
+
action = (this.dir === 'rtl' ? dragActions.nest : dragActions.unnest) ;
|
|
223
|
+
break;
|
|
224
|
+
case moveActions.rootHome:
|
|
225
|
+
this._movingElement = true;
|
|
226
|
+
action = dragActions.rootFirst;
|
|
227
|
+
break;
|
|
228
|
+
case moveActions.home:
|
|
239
229
|
this._movingElement = true;
|
|
240
|
-
action =
|
|
230
|
+
action = dragActions.first;
|
|
241
231
|
break;
|
|
242
|
-
case
|
|
232
|
+
case moveActions.rootEnd:
|
|
243
233
|
this._movingElement = true;
|
|
244
|
-
action =
|
|
234
|
+
action = dragActions.rootLast;
|
|
245
235
|
break;
|
|
236
|
+
case moveActions.end:
|
|
237
|
+
this._movingElement = true;
|
|
238
|
+
action = dragActions.last;
|
|
239
|
+
break;
|
|
240
|
+
default:
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
this._doAction(action);
|
|
245
|
+
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
async _onMoveButtonKeydown(e) {
|
|
249
|
+
if (!this._keyboardActive) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
let action = null;
|
|
254
|
+
switch (e.keyCode) {
|
|
246
255
|
case keyCodes.TAB:
|
|
247
256
|
action = e.shiftKey ? dragActions.previousElement : dragActions.nextElement;
|
|
248
257
|
break;
|
|
@@ -250,14 +259,6 @@ class ListItemDragHandle extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
250
259
|
action = dragActions.cancel;
|
|
251
260
|
this.updateComplete.then(() => this._keyboardActive = false);
|
|
252
261
|
break;
|
|
253
|
-
case keyCodes.RIGHT:
|
|
254
|
-
this._movingElement = true;
|
|
255
|
-
action = (this.dir === 'rtl' ? dragActions.unnest : dragActions.nest);
|
|
256
|
-
break;
|
|
257
|
-
case keyCodes.LEFT:
|
|
258
|
-
this._movingElement = true;
|
|
259
|
-
action = (this.dir === 'rtl' ? dragActions.nest : dragActions.unnest) ;
|
|
260
|
-
break;
|
|
261
262
|
case keyCodes.ENTER:
|
|
262
263
|
case keyCodes.SPACE:
|
|
263
264
|
action = dragActions.save;
|
|
@@ -266,49 +267,19 @@ class ListItemDragHandle extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
266
267
|
default:
|
|
267
268
|
return;
|
|
268
269
|
}
|
|
269
|
-
this._dispatchAction(action);
|
|
270
|
-
e.preventDefault();
|
|
271
|
-
e.stopPropagation();
|
|
272
|
-
const cell = findComposedAncestor(this, (parent) => parent.hasAttribute && parent.hasAttribute('draggable'));
|
|
273
|
-
if (cell) await cell.updateComplete;
|
|
274
|
-
await this.updateComplete;
|
|
275
|
-
this.focus();
|
|
276
|
-
this._movingElement = false;
|
|
277
|
-
}
|
|
278
270
|
|
|
279
|
-
|
|
280
|
-
if (hasDisplayedKeyboardTooltip) return;
|
|
281
|
-
this._displayKeyboardTooltip = true;
|
|
282
|
-
hasDisplayedKeyboardTooltip = true;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
_onFocusOutKeyboardButton(e) {
|
|
286
|
-
this._displayKeyboardTooltip = false;
|
|
287
|
-
if (this._movingElement) {
|
|
288
|
-
this._movingElement = false;
|
|
289
|
-
e.stopPropagation();
|
|
290
|
-
e.preventDefault();
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
this._keyboardActive = false;
|
|
294
|
-
this._dispatchAction(dragActions.save);
|
|
271
|
+
e.preventDefault();
|
|
295
272
|
e.stopPropagation();
|
|
296
|
-
|
|
273
|
+
this._doAction(action);
|
|
297
274
|
|
|
298
|
-
_onInactiveKeyboard(e) {
|
|
299
|
-
if (e.type === 'click' || e.keyCode === keyCodes.ENTER || e.keyCode === keyCodes.SPACE) {
|
|
300
|
-
this._dispatchAction(dragActions.active);
|
|
301
|
-
this._keyboardActive = true;
|
|
302
|
-
e.preventDefault();
|
|
303
|
-
}
|
|
304
275
|
}
|
|
305
276
|
|
|
306
277
|
_renderDragger() {
|
|
307
278
|
return html`
|
|
308
279
|
<button
|
|
309
|
-
class="d2l-list-item-drag-handle-dragger-button"
|
|
310
|
-
@click="${this.
|
|
311
|
-
@keydown="${this.
|
|
280
|
+
class="d2l-list-item-drag-handle-dragger-button d2l-list-item-drag-handle-button"
|
|
281
|
+
@click="${this._onDraggerButtonClick}"
|
|
282
|
+
@keydown="${this._onDraggerButtonKeydown}"
|
|
312
283
|
aria-label="${this._defaultLabel}"
|
|
313
284
|
?disabled="${this.disabled}">
|
|
314
285
|
<d2l-icon icon="tier1:dragger" class="d2l-button-dragger-icon"></d2l-icon>
|
|
@@ -318,19 +289,16 @@ class ListItemDragHandle extends LocalizeCoreElement(RtlMixin(LitElement)) {
|
|
|
318
289
|
|
|
319
290
|
_renderKeyboardDragging() {
|
|
320
291
|
return html`
|
|
321
|
-
<button
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
@focusin="${this.
|
|
325
|
-
@focusout="${this.
|
|
292
|
+
<d2l-button-move
|
|
293
|
+
class="d2l-list-item-drag-handle-button"
|
|
294
|
+
@d2l-button-move-action="${this._onMoveButtonAction}"
|
|
295
|
+
@focusin="${this._onKeyboardButtonFocusIn}"
|
|
296
|
+
@focusout="${this._onKeyboardButtonFocusOut}"
|
|
326
297
|
id="${this._buttonId}"
|
|
327
|
-
@keydown="${this.
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
<div class="d2l-list-item-drag-handle-keyboard-button-down" @click="${this._dispatchActionDown}"></div>
|
|
332
|
-
</button>
|
|
333
|
-
${this._displayKeyboardTooltip ? html`<d2l-tooltip align="start" for="${this._buttonId}" for-type="descriptor">${this._renderTooltipContent()}</d2l-tooltip>` : ''}
|
|
298
|
+
@keydown="${this._onMoveButtonKeydown}"
|
|
299
|
+
text="${this._defaultLabel}">
|
|
300
|
+
</d2l-button-move>
|
|
301
|
+
${this._displayKeyboardTooltip ? html`<d2l-tooltip align="start" announced for="${this._buttonId}" for-type="descriptor">${this._renderTooltipContent()}</d2l-tooltip>` : ''}
|
|
334
302
|
`;
|
|
335
303
|
}
|
|
336
304
|
|
|
@@ -4,7 +4,7 @@ import { css, html, LitElement } from 'lit';
|
|
|
4
4
|
import { bodySmallStyles } from '../typography/styles.js';
|
|
5
5
|
import { formatNumber } from '@brightspace-ui/intl/lib/number.js';
|
|
6
6
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
7
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
7
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
8
8
|
import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
9
9
|
|
|
10
10
|
class ListItemDragImage extends LocalizeCoreElement(SkeletonMixin(RtlMixin(LitElement))) {
|