@kubex/zinc 1.1.185 → 2.0.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/.browserslistrc +2 -0
- package/.github/workflows/js_build_and_deploy.yaml +54 -1
- package/.github/workflows/test.yaml +27 -0
- package/dist/chunks/zn.UWJLIXDT.js +1 -0
- package/dist/custom-elements.json +9998 -2345
- package/dist/vscode.html-custom-data.json +1022 -67
- package/dist/web-types.json +2129 -177
- package/dist/zn.d.ts +2293 -416
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +2310 -1637
- package/docs/_includes/default.njk +4 -1
- package/docs/assets/scripts/docs.js +22 -6
- package/docs/assets/styles/docs.css +9 -2
- package/docs/data/report-table-day-compare.json +380 -0
- package/docs/data/report-table.json +314 -0
- package/docs/pages/components/avatar-group.md +57 -0
- package/docs/pages/components/badge.md +67 -0
- package/docs/pages/components/button.md +41 -1
- package/docs/pages/components/chat-message.md +16 -0
- package/docs/pages/components/checkbox.md +1 -1
- package/docs/pages/components/chip.md +25 -13
- package/docs/pages/components/color-picker.md +37 -0
- package/docs/pages/components/copy-button.md +2 -2
- package/docs/pages/components/data-table-filter.md +33 -50
- package/docs/pages/components/data-table-search.md +4 -4
- package/docs/pages/components/data-table.md +27 -3
- package/docs/pages/components/date-range.md +116 -0
- package/docs/pages/components/dialog.md +29 -37
- package/docs/pages/components/diff-row.md +28 -0
- package/docs/pages/components/diff.md +46 -0
- package/docs/pages/components/editor.md +55 -0
- package/docs/pages/components/icon.md +46 -1
- package/docs/pages/components/input.md +30 -11
- package/docs/pages/components/item.md +35 -0
- package/docs/pages/components/key-value.md +25 -0
- package/docs/pages/components/menu.md +74 -7
- package/docs/pages/components/nav-item.md +15 -0
- package/docs/pages/components/nav-list.md +132 -0
- package/docs/pages/components/navbar.md +100 -1
- package/docs/pages/components/page.md +242 -74
- package/docs/pages/components/priority-list.md +43 -5
- package/docs/pages/components/query-builder.md +23 -0
- package/docs/pages/components/radio-group.md +33 -1
- package/docs/pages/components/radio.md +1 -1
- package/docs/pages/components/report-table.md +202 -0
- package/docs/pages/components/stat.md +30 -0
- package/docs/pages/components/tile.md +11 -0
- package/docs/pages/components/tooltip.md +1 -1
- package/docs/pages/components/translation-grid.md +86 -0
- package/docs/pages/components/vertical-stepper.md +108 -64
- package/package.json +2 -1
- package/scss/_global-spacing.scss +2 -2
- package/scss/_root.scss +11 -171
- package/scss/boot.scss +14 -0
- package/scss/mixins/_helper-mixins.scss +24 -2
- package/scss/mixins/_motion-mixins.scss +126 -0
- package/scss/mixins/_spacing-mixins.scss +4 -3
- package/scss/mixins/_tab-indicator-mixins.scss +12 -0
- package/scss/mixins/_typography-mixins.scss +1 -1
- package/scss/mixins/index.scss +14 -0
- package/scss/shared/_base.scss +32 -1
- package/scss/shared/_button-mixin.scss +7 -5
- package/scss/shared/_table.scss +35 -4
- package/scss/shared/nav.scss +4 -0
- package/scss/shared/shimmer.scss +1 -1
- package/scss/table-controls.scss +206 -0
- package/scss/themes/_dark.scss +1 -3
- package/scss/themes/_index.scss +1 -1
- package/scss/themes/_light.scss +46 -6
- package/scss/themes/_modes.scss +11 -11
- package/scss/themes/_openbyte.scss +944 -0
- package/scss/themes/_typography.scss +4 -2
- package/scss/variables/index.scss +0 -9
- package/src/components/alert/alert.component.ts +14 -4
- package/src/components/alert/alert.scss +55 -69
- package/src/components/alert/alert.test.ts +8 -0
- package/src/components/animated-button/animated-button.component.ts +3 -2
- package/src/components/animated-button/animated-button.scss +6 -23
- package/src/components/animated-button/animated-button.test.ts +4 -3
- package/src/components/avatar-group/avatar-group.component.ts +84 -0
- package/src/components/avatar-group/avatar-group.scss +54 -0
- package/src/components/avatar-group/avatar-group.test.ts +59 -0
- package/src/components/avatar-group/index.ts +12 -0
- package/src/components/badge/badge.component.ts +49 -0
- package/src/components/badge/badge.scss +80 -0
- package/src/components/badge/badge.test.ts +34 -0
- package/src/components/badge/index.ts +12 -0
- package/src/components/bulk-actions/bulk-actions.component.ts +14 -2
- package/src/components/button/button.component.ts +228 -8
- package/src/components/button/button.scss +115 -32
- package/src/components/button/button.test.ts +122 -0
- package/src/components/button-menu/button-menu.component.ts +32 -11
- package/src/components/button-menu/button-menu.scss +5 -1
- package/src/components/channel-tile/channel-tile.component.ts +34 -27
- package/src/components/channel-tile/channel-tile.scss +76 -43
- package/src/components/chart/builders.test.ts +46 -0
- package/src/components/chart/builders.ts +27 -3
- package/src/components/chart/chart-live.test.ts +4 -6
- package/src/components/chart/chart.component.ts +125 -5
- package/src/components/chart/chart.scss +121 -0
- package/src/components/chart/chart.test.ts +81 -0
- package/src/components/chat-message/chat-message.component.ts +21 -1
- package/src/components/chat-message/chat-message.scss +13 -2
- package/src/components/chat-message/chat-message.test.ts +9 -0
- package/src/components/checkbox/checkbox.component.ts +61 -27
- package/src/components/checkbox/checkbox.scss +58 -25
- package/src/components/checkbox-group/checkbox-group.component.ts +7 -1
- package/src/components/chip/chip.component.ts +11 -1
- package/src/components/chip/chip.scss +91 -26
- package/src/components/chip/chip.test.ts +17 -0
- package/src/components/collapsible/collapsible.component.ts +17 -3
- package/src/components/collapsible/collapsible.scss +19 -10
- package/src/components/color-picker/color-picker.component.ts +277 -0
- package/src/components/color-picker/color-picker.scss +141 -0
- package/src/components/color-picker/color-picker.test.ts +57 -0
- package/src/components/color-picker/index.ts +12 -0
- package/src/components/cols/cols.component.ts +10 -0
- package/src/components/cols/cols.test.ts +17 -0
- package/src/components/confirm/confirm.component.ts +20 -6
- package/src/components/confirm/confirm.test.ts +52 -0
- package/src/components/content-block/content-block.component.ts +38 -9
- package/src/components/content-block/content-block.scss +11 -5
- package/src/components/content-block/content-block.test.ts +26 -0
- package/src/components/copy-button/copy-button.component.ts +2 -2
- package/src/components/copy-button/copy-button.scss +17 -4
- package/src/components/data-select/data-select.component.ts +3 -1
- package/src/components/data-table/data-table.component.ts +362 -140
- package/src/components/data-table/data-table.scss +133 -60
- package/src/components/data-table/data-table.test.ts +356 -4
- package/src/components/data-table-filter/data-table-filter.component.ts +426 -406
- package/src/components/data-table-filter/data-table-filter.scss +176 -148
- package/src/components/data-table-filter/data-table-filter.test.ts +271 -273
- package/src/components/data-table-search/data-table-search.component.ts +4 -2
- package/src/components/data-table-search/data-table-search.scss +8 -1
- package/src/components/data-table-search/data-table-search.test.ts +29 -0
- package/src/components/date-range/date-range-math.test.ts +78 -0
- package/src/components/date-range/date-range-math.ts +105 -0
- package/src/components/date-range/date-range.component.ts +375 -0
- package/src/components/date-range/date-range.scss +272 -0
- package/src/components/date-range/date-range.test.ts +247 -0
- package/src/components/date-range/index.ts +12 -0
- package/src/components/datepicker/datepicker.component.ts +44 -7
- package/src/components/datepicker/datepicker.scss +9 -0
- package/src/components/datepicker/datepicker.test.ts +2 -2
- package/src/components/dialog/dialog.component.ts +38 -19
- package/src/components/dialog/dialog.scss +65 -36
- package/src/components/dialog/dialog.test.ts +14 -0
- package/src/components/diff/diff.component.ts +55 -0
- package/src/components/diff/diff.scss +46 -0
- package/src/components/diff/diff.test.ts +15 -0
- package/src/components/diff/index.ts +12 -0
- package/src/components/diff-row/diff-row.component.ts +75 -0
- package/src/components/diff-row/diff-row.scss +70 -0
- package/src/components/diff-row/diff-row.test.ts +37 -0
- package/src/components/diff-row/index.ts +12 -0
- package/src/components/dropdown/dropdown.component.ts +12 -10
- package/src/components/dropdown/dropdown.scss +2 -0
- package/src/components/editor/editor.component.ts +159 -11
- package/src/components/editor/editor.scss +250 -1
- package/src/components/editor/editor.test.ts +31 -3
- package/src/components/editor/modules/ai/panel/ai-panel.scss +0 -1
- package/src/components/editor/modules/attachment/attachment.ts +53 -31
- package/src/components/editor/modules/context-menu/context-menu.ts +17 -0
- package/src/components/editor/modules/dialog/dialog.component.ts +23 -1
- package/src/components/editor/modules/dialog/dialog.test.ts +28 -0
- package/src/components/editor/modules/emoji/emoji.ts +4 -5
- package/src/components/editor/modules/merge-field/merge-field.ts +83 -0
- package/src/components/editor/modules/toolbar/toolbar.component.ts +121 -68
- package/src/components/editor/modules/toolbar/toolbar.scss +38 -0
- package/src/components/editor/modules/toolbar/toolbar.ts +25 -1
- package/src/components/empty-state/empty-state.component.ts +6 -1
- package/src/components/empty-state/empty-state.scss +21 -4
- package/src/components/expanding-action/expanding-action.component.ts +22 -34
- package/src/components/expanding-action/expanding-action.scss +3 -45
- package/src/components/expanding-action/expanding-action.test.ts +2 -1
- package/src/components/file/file.component.ts +30 -2
- package/src/components/file/file.scss +6 -0
- package/src/components/flow-builder/flow-builder.component.ts +36 -3
- package/src/components/flow-builder/flow-builder.scss +0 -6
- package/src/components/flow-builder/modules/flow-canvas/flow-canvas.component.ts +8 -0
- package/src/components/flow-builder/modules/flow-canvas/flow-canvas.scss +10 -5
- package/src/components/flow-builder/modules/flow-node/flow-node.component.ts +17 -0
- package/src/components/flow-builder/modules/flow-node/flow-node.scss +10 -0
- package/src/components/form-actions/form-actions.component.ts +48 -2
- package/src/components/form-actions/form-actions.scss +1 -1
- package/src/components/form-group/form-group.component.ts +10 -3
- package/src/components/form-group/form-group.scss +37 -4
- package/src/components/form-group/form-group.test.ts +10 -0
- package/src/components/header/header.component.ts +11 -4
- package/src/components/header/header.scss +47 -5
- package/src/components/hover-container/hover-container.component.ts +4 -5
- package/src/components/icon/icon.component.ts +95 -9
- package/src/components/icon/icon.scss +70 -6
- package/src/components/icon/icon.test.ts +55 -0
- package/src/components/icon-picker/icon-picker.component.ts +35 -1
- package/src/components/inline-edit/inline-edit.component.ts +38 -8
- package/src/components/inline-edit/inline-edit.scss +128 -19
- package/src/components/input/input.component.ts +173 -297
- package/src/components/input/input.scss +65 -43
- package/src/components/input/input.test.ts +86 -4
- package/src/components/item/item.component.ts +12 -0
- package/src/components/item/item.scss +102 -3
- package/src/components/item/item.test.ts +23 -0
- package/src/components/key/key.component.ts +2 -2
- package/src/components/key/key.scss +11 -0
- package/src/components/key-value/index.ts +12 -0
- package/src/components/key-value/key-value.component.ts +160 -0
- package/src/components/key-value/key-value.scss +20 -0
- package/src/components/key-value/key-value.test.ts +22 -0
- package/src/components/markdown-editor/markdown-editor.component.ts +8 -1
- package/src/components/menu/menu.component.ts +21 -2
- package/src/components/menu/menu.scss +43 -23
- package/src/components/menu/menu.test.ts +33 -0
- package/src/components/menu-item/menu-item.component.ts +13 -2
- package/src/components/menu-item/menu-item.scss +56 -23
- package/src/components/menu-item/menu-item.test.ts +31 -0
- package/src/components/menu-item/submenu-controller.ts +25 -15
- package/src/components/menu-label/index.ts +12 -0
- package/src/components/menu-label/menu-label.component.ts +30 -0
- package/src/components/menu-label/menu-label.scss +18 -0
- package/src/components/nav-item/index.ts +12 -0
- package/src/components/nav-item/nav-item.component.ts +83 -0
- package/src/components/nav-item/nav-item.scss +128 -0
- package/src/components/nav-list/index.ts +12 -0
- package/src/components/nav-list/nav-list.component.ts +313 -0
- package/src/components/nav-list/nav-list.scss +87 -0
- package/src/components/nav-list/nav-list.test.ts +250 -0
- package/src/components/navbar/navbar.component.ts +235 -171
- package/src/components/navbar/navbar.scss +333 -169
- package/src/components/navbar/navbar.test.ts +63 -143
- package/src/components/page/page.component.ts +114 -29
- package/src/components/page/page.scss +223 -95
- package/src/components/page/page.test.ts +214 -3
- package/src/components/page-builder/page-builder.component.ts +51 -5
- package/src/components/page-builder/page-builder.scss +6 -1
- package/src/components/page-nav/page-nav.component.ts +25 -3
- package/src/components/page-nav/page-nav.scss +10 -2
- package/src/components/pagination/pagination.scss +1 -1
- package/src/components/panel/panel.component.ts +14 -13
- package/src/components/panel/panel.scss +14 -10
- package/src/components/panel/panel.test.ts +42 -0
- package/src/components/popup/popup.component.ts +20 -13
- package/src/components/popup/popup.test.ts +21 -1
- package/src/components/priority-list/priority-list.component.ts +157 -172
- package/src/components/priority-list/priority-list.scss +113 -17
- package/src/components/priority-list/priority-list.test.ts +301 -3
- package/src/components/progress-bar/progress-bar.component.ts +1 -1
- package/src/components/progress-bar/progress-bar.scss +16 -4
- package/src/components/progress-tile/progress-tile.scss +1 -1
- package/src/components/query-builder/query-builder.component.ts +85 -10
- package/src/components/query-builder/query-builder.scss +7 -1
- package/src/components/query-builder/query-builder.test.ts +40 -0
- package/src/components/radio/radio.component.ts +57 -18
- package/src/components/radio/radio.scss +101 -26
- package/src/components/radio-group/radio-group.component.ts +45 -7
- package/src/components/radio-group/radio-group.scss +17 -0
- package/src/components/radio-group/radio-group.test.ts +63 -2
- package/src/components/rating/rating.component.ts +23 -0
- package/src/components/rating/rating.scss +1 -1
- package/src/components/remarkd-editor/remarkd-editor.component.ts +60 -5
- package/src/components/remarkd-editor/remarkd-editor.scss +12 -4
- package/src/components/report-table/index.ts +12 -0
- package/src/components/report-table/report-format.test.ts +86 -0
- package/src/components/report-table/report-format.ts +72 -0
- package/src/components/report-table/report-math.test.ts +74 -0
- package/src/components/report-table/report-math.ts +252 -0
- package/src/components/report-table/report-table.component.ts +681 -0
- package/src/components/report-table/report-table.scss +328 -0
- package/src/components/report-table/report-table.test.ts +702 -0
- package/src/components/reveal/reveal.component.ts +15 -1
- package/src/components/reveal/reveal.scss +5 -0
- package/src/components/schedule-builder/schedule-builder.component.ts +23 -8
- package/src/components/scroll-container/scroll-container.component.ts +19 -1
- package/src/components/scroll-container/scroll-container.scss +6 -1
- package/src/components/select/select.component.ts +52 -36
- package/src/components/select/select.scss +42 -25
- package/src/components/select/select.test.ts +14 -2
- package/src/components/settings-container/settings-container.scss +18 -5
- package/src/components/sidebar/sidebar.component.ts +8 -1
- package/src/components/sidebar/sidebar.scss +6 -1
- package/src/components/skeleton/skeleton.component.ts +3 -3
- package/src/components/skeleton/skeleton.scss +6 -6
- package/src/components/skeleton/skeleton.test.ts +9 -0
- package/src/components/slash-menu/slash-menu.scss +1 -1
- package/src/components/slideout/slideout.component.ts +20 -3
- package/src/components/slideout/slideout.scss +13 -6
- package/src/components/slideout/slideout.test.ts +19 -0
- package/src/components/split-button/split-button.component.ts +1 -1
- package/src/components/split-pane/split-pane.component.ts +71 -8
- package/src/components/split-pane/split-pane.scss +145 -41
- package/src/components/split-pane/split-pane.test.ts +23 -3
- package/src/components/stat/stat.component.ts +209 -14
- package/src/components/stat/stat.scss +305 -5
- package/src/components/stat/stat.test.ts +143 -2
- package/src/components/status-indicator/status-indicator.scss +22 -21
- package/src/components/stepper/stepper.scss +3 -3
- package/src/components/tab/tab.component.ts +1 -0
- package/src/components/table/table.component.ts +12 -1
- package/src/components/table/table.scss +21 -13
- package/src/components/table/table.test.ts +17 -0
- package/src/components/tabs/tabs.component.ts +150 -37
- package/src/components/tabs/tabs.scss +48 -7
- package/src/components/tabs/tabs.test.ts +169 -0
- package/src/components/textarea/textarea.component.ts +25 -3
- package/src/components/textarea/textarea.scss +10 -0
- package/src/components/textarea/textarea.test.ts +8 -4
- package/src/components/theme-editor/theme-editor.scss +0 -6
- package/src/components/tile/tile.component.ts +32 -2
- package/src/components/tile/tile.scss +40 -7
- package/src/components/tile/tile.test.ts +10 -0
- package/src/components/toggle/toggle.component.ts +23 -7
- package/src/components/toggle/toggle.scss +36 -29
- package/src/components/toggle/toggle.test.ts +17 -0
- package/src/components/tooltip/tooltip.component.ts +3 -0
- package/src/components/tooltip/tooltip.scss +11 -6
- package/src/components/tooltip/tooltip.test.ts +12 -0
- package/src/components/translation-field/index.ts +12 -0
- package/src/components/translation-field/translation-field.component.ts +55 -0
- package/src/components/translation-field/translation-field.scss +101 -0
- package/src/components/translation-fields/index.ts +12 -0
- package/src/components/translation-fields/translation-fields.component.ts +80 -0
- package/src/components/translation-fields/translation-fields.scss +60 -0
- package/src/components/translation-grid/index.ts +12 -0
- package/src/components/translation-grid/translation-grid.component.ts +157 -0
- package/src/components/translation-grid/translation-grid.scss +138 -0
- package/src/components/translation-grid/translation-grid.test.ts +28 -0
- package/src/components/vertical-stepper/vertical-stepper.component.ts +35 -9
- package/src/components/vertical-stepper/vertical-stepper.scss +110 -39
- package/src/components/vertical-stepper/vertical-stepper.test.ts +35 -0
- package/src/components/well/well.scss +2 -2
- package/src/events/events.ts +2 -0
- package/src/events/zn-chart-click.ts +13 -0
- package/src/events/zn-report-change.ts +7 -0
- package/src/form-control.scss +36 -3
- package/src/internal/anchored-popover.ts +175 -0
- package/src/internal/animate.ts +19 -5
- package/src/internal/cosmic-border.ts +15 -0
- package/src/internal/form.ts +1 -1
- package/src/internal/hover-intent.ts +15 -0
- package/src/internal/input-modality.ts +15 -0
- package/src/internal/pointer-intent.ts +37 -0
- package/src/internal/reorder.ts +625 -0
- package/src/internal/scroll.ts +51 -3
- package/src/internal/selection-card.ts +1 -1
- package/src/internal/tab-indicator.ts +92 -0
- package/src/internal/table-sort.ts +25 -0
- package/src/internal/table-tabs.ts +108 -0
- package/src/internal/test-drag.ts +35 -0
- package/src/internal/theme-openbyte.test.ts +126 -0
- package/src/internal/theme.ts +4 -4
- package/src/internal/zinc-element.ts +2 -2
- package/src/selection-card.scss +25 -0
- package/src/types/web-test-runner-commands.d.ts +1 -0
- package/src/utilities/color.test.ts +43 -0
- package/src/utilities/color.ts +189 -0
- package/src/zinc.ts +14 -0
- package/.github/workflows/eleventy_build.yml +0 -42
- package/scss/themes/_aura.scss +0 -114
|
@@ -33,11 +33,8 @@
|
|
|
33
33
|
pointer-events: none;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
.priority-list__item {
|
|
39
|
-
transition: transform 200ms ease, opacity 200ms ease, box-shadow 200ms ease;
|
|
40
|
-
}
|
|
36
|
+
.priority-list--drag-active .priority-list__item {
|
|
37
|
+
cursor: grabbing;
|
|
41
38
|
}
|
|
42
39
|
|
|
43
40
|
.priority-list__item {
|
|
@@ -52,20 +49,21 @@
|
|
|
52
49
|
user-select: none;
|
|
53
50
|
-webkit-user-drag: element;
|
|
54
51
|
position: relative;
|
|
52
|
+
// Its own layer, or Chrome draws the drag image over a white box that shows at the rounded corners
|
|
53
|
+
transform: translate(0, 0);
|
|
55
54
|
|
|
56
55
|
&:hover {
|
|
57
|
-
|
|
58
|
-
border-color: rgb(var(--zn-color-primary-500));
|
|
56
|
+
border-color: rgb(var(--zn-primary));
|
|
59
57
|
|
|
60
58
|
.priority-list__handle {
|
|
61
|
-
color: rgb(var(--zn-
|
|
59
|
+
color: rgb(var(--zn-primary));
|
|
62
60
|
}
|
|
63
61
|
}
|
|
64
62
|
|
|
65
63
|
&:focus-visible {
|
|
66
|
-
outline: 2px solid rgb(var(--zn-
|
|
64
|
+
outline: 2px solid rgb(var(--zn-primary));
|
|
67
65
|
outline-offset: -1px;
|
|
68
|
-
border-color: rgb(var(--zn-
|
|
66
|
+
border-color: rgb(var(--zn-primary));
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
&:active {
|
|
@@ -73,13 +71,22 @@
|
|
|
73
71
|
}
|
|
74
72
|
}
|
|
75
73
|
|
|
76
|
-
// The
|
|
74
|
+
// The dragged row's slot. An inset outline, as hover and last-child rules reset the border and flush panels clip it.
|
|
75
|
+
// The border is hidden so it doesn't show between the dashes or past the outline's rounded corners.
|
|
76
|
+
.priority-list__item--dragging,
|
|
77
|
+
.priority-list__item--dragging:hover {
|
|
78
|
+
border-color: transparent;
|
|
79
|
+
}
|
|
80
|
+
|
|
77
81
|
.priority-list__item--dragging {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
background: rgb(var(--zn-color-primary-50, var(--zn-panel)));
|
|
82
|
+
outline: 1px dashed var(--zn-color-primary-400);
|
|
83
|
+
outline-offset: -1px;
|
|
84
|
+
background: rgba(var(--zn-primary), 0.06);
|
|
82
85
|
box-shadow: none;
|
|
86
|
+
|
|
87
|
+
> * {
|
|
88
|
+
opacity: 0;
|
|
89
|
+
}
|
|
83
90
|
}
|
|
84
91
|
|
|
85
92
|
.priority-list__item--disabled {
|
|
@@ -121,8 +128,7 @@
|
|
|
121
128
|
flex: 1;
|
|
122
129
|
min-width: 0;
|
|
123
130
|
overflow: hidden;
|
|
124
|
-
//
|
|
125
|
-
// which would override the item-level draggable behaviour
|
|
131
|
+
// A press anywhere on the content grabs the row, not the content
|
|
126
132
|
pointer-events: none;
|
|
127
133
|
|
|
128
134
|
::slotted(*) {
|
|
@@ -131,6 +137,37 @@
|
|
|
131
137
|
}
|
|
132
138
|
}
|
|
133
139
|
|
|
140
|
+
// Tiles fill the row; the row supplies the padding
|
|
141
|
+
.priority-list__content ::slotted(zn-tile) {
|
|
142
|
+
--zn-tile-padding-inline: 0;
|
|
143
|
+
--zn-tile-padding-block: 0;
|
|
144
|
+
--zn-tile-min-height: 0;
|
|
145
|
+
--zn-tile-hover-background: transparent;
|
|
146
|
+
--zn-tile-hover-caption-color: rgb(var(--zn-primary));
|
|
147
|
+
--zn-tile-hover-caption-decoration: underline;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.priority-list__content ::slotted(zn-tile[href]),
|
|
151
|
+
.priority-list__content ::slotted(zn-tile[data-uri]) {
|
|
152
|
+
pointer-events: auto;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.priority-list__item--locked {
|
|
156
|
+
cursor: default;
|
|
157
|
+
|
|
158
|
+
&:active {
|
|
159
|
+
cursor: default;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.priority-list__handle {
|
|
163
|
+
cursor: default;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&:hover .priority-list__handle {
|
|
167
|
+
color: var(--zn-priority-list-handle-color);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
134
171
|
.priority-list__actions {
|
|
135
172
|
display: flex;
|
|
136
173
|
align-items: center;
|
|
@@ -145,6 +182,65 @@
|
|
|
145
182
|
}
|
|
146
183
|
}
|
|
147
184
|
|
|
185
|
+
.priority-list__move {
|
|
186
|
+
display: flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
gap: var(--zn-spacing-3x-small);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.priority-list__item--selectable {
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.priority-list__item--selected,
|
|
196
|
+
.priority-list__item--selected:hover {
|
|
197
|
+
background: var(--zn-priority-list-selected-background, rgba(var(--zn-primary), 0.08));
|
|
198
|
+
box-shadow: inset 3px 0 0 rgb(var(--zn-primary));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
:host([hide-priority]) .priority-list__priority {
|
|
202
|
+
display: none;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
:host([flush]) {
|
|
206
|
+
// The shared focus-ring margin would inset the rows from the panel edges.
|
|
207
|
+
--zn-form-control-input-margin: 0;
|
|
208
|
+
|
|
209
|
+
.form-control__label {
|
|
210
|
+
position: absolute;
|
|
211
|
+
width: 1px;
|
|
212
|
+
height: 1px;
|
|
213
|
+
margin: -1px;
|
|
214
|
+
overflow: hidden;
|
|
215
|
+
clip: rect(0, 0, 0, 0);
|
|
216
|
+
white-space: nowrap;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.priority-list {
|
|
220
|
+
gap: 0;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.priority-list__item {
|
|
224
|
+
padding-inline: var(--zn-panel-padding, var(--zn-spacing-medium));
|
|
225
|
+
border: 0;
|
|
226
|
+
border-bottom: 1px solid var(--zn-table-row-divider-color, rgb(var(--zn-border-color)));
|
|
227
|
+
border-radius: 0;
|
|
228
|
+
|
|
229
|
+
&:last-child {
|
|
230
|
+
border-bottom: 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&:hover {
|
|
234
|
+
border-color: var(--zn-table-row-divider-color, rgb(var(--zn-border-color)));
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Set while dragging to the radius of any panel corner the row sits in
|
|
239
|
+
.priority-list__item--dragging {
|
|
240
|
+
border-radius: var(--zn-priority-list-drag-radius, 0);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
148
244
|
// Size variants
|
|
149
245
|
:host([size="small"]) {
|
|
150
246
|
.priority-list__item {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '../../../dist/zn.min.js';
|
|
2
|
-
import {expect, fixture, html} from '@open-wc/testing';
|
|
2
|
+
import {aTimeout, expect, fixture, html} from '@open-wc/testing';
|
|
3
|
+
import {centre, drop, dragTo, startDrag} from '../../internal/test-drag';
|
|
3
4
|
|
|
4
5
|
describe('<zn-priority-list>', () => {
|
|
5
6
|
it('should render a component', async () => {
|
|
@@ -176,7 +177,10 @@ describe('<zn-priority-list>', () => {
|
|
|
176
177
|
|
|
177
178
|
await el.updateComplete;
|
|
178
179
|
const item = el.shadowRoot.querySelector('.priority-list__item');
|
|
179
|
-
|
|
180
|
+
startDrag(item);
|
|
181
|
+
await el.updateComplete;
|
|
182
|
+
expect(el.shadowRoot.querySelector('.priority-list__item--dragging')).to.not.exist;
|
|
183
|
+
drop(0, 0);
|
|
180
184
|
expect(item.getAttribute('tabindex')).to.equal('-1');
|
|
181
185
|
});
|
|
182
186
|
|
|
@@ -204,7 +208,7 @@ describe('<zn-priority-list>', () => {
|
|
|
204
208
|
});
|
|
205
209
|
|
|
206
210
|
const item = el.shadowRoot.querySelector('.priority-list__item');
|
|
207
|
-
item.dispatchEvent(new KeyboardEvent('keydown', {key: 'ArrowDown', bubbles: true, composed: true, cancelable: true}));
|
|
211
|
+
item.dispatchEvent(new KeyboardEvent('keydown', {key: 'ArrowDown', altKey: true, bubbles: true, composed: true, cancelable: true}));
|
|
208
212
|
await el.updateComplete;
|
|
209
213
|
|
|
210
214
|
document.removeEventListener('zn-register-element', onRegister);
|
|
@@ -213,4 +217,298 @@ describe('<zn-priority-list>', () => {
|
|
|
213
217
|
expect(submitter).to.exist;
|
|
214
218
|
expect(submitter!.getAttribute('formaction')).to.equal('/save');
|
|
215
219
|
});
|
|
220
|
+
|
|
221
|
+
it('draws flush rows divided edge to edge without priority numbers', async () => {
|
|
222
|
+
const el = await fixture(html`
|
|
223
|
+
<zn-priority-list label="Order" flush hide-priority style="--zn-border-color: 1, 2, 3">
|
|
224
|
+
<div value="a">A</div>
|
|
225
|
+
<div value="b">B</div>
|
|
226
|
+
</zn-priority-list>
|
|
227
|
+
`) as any;
|
|
228
|
+
await el.updateComplete;
|
|
229
|
+
|
|
230
|
+
const [first, last] = el.shadowRoot.querySelectorAll('.priority-list__item');
|
|
231
|
+
expect(getComputedStyle(first).borderTopWidth).to.equal('0px');
|
|
232
|
+
expect(getComputedStyle(first).borderRadius).to.equal('0px');
|
|
233
|
+
expect(getComputedStyle(first).borderBottomWidth).to.equal('1px');
|
|
234
|
+
expect(getComputedStyle(last).borderBottomWidth).to.equal('0px');
|
|
235
|
+
expect(getComputedStyle(el.shadowRoot.querySelector('.priority-list__priority')).display).to.equal('none');
|
|
236
|
+
expect(getComputedStyle(el.shadowRoot.querySelector('.form-control__label')).position).to.equal('absolute');
|
|
237
|
+
expect(getComputedStyle(el.shadowRoot.querySelector('.form-control-input')).margin).to.equal('0px');
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
it('keeps actions inside tile items clickable', async () => {
|
|
241
|
+
const el = await fixture(html`
|
|
242
|
+
<zn-priority-list>
|
|
243
|
+
<zn-tile value="a" caption="Second chance">
|
|
244
|
+
<zn-button slot="actions" label="Edit"></zn-button>
|
|
245
|
+
</zn-tile>
|
|
246
|
+
</zn-priority-list>
|
|
247
|
+
`) as any;
|
|
248
|
+
await el.updateComplete;
|
|
249
|
+
const tile = el.querySelector('zn-tile');
|
|
250
|
+
await tile.updateComplete;
|
|
251
|
+
|
|
252
|
+
expect(getComputedStyle(tile).pointerEvents).to.equal('none');
|
|
253
|
+
expect(getComputedStyle(tile.shadowRoot.querySelector('.tile__right')).pointerEvents).to.equal('auto');
|
|
254
|
+
expect(el.shadowRoot.querySelector('.priority-list__item').getAttribute('aria-label')).to.equal('Second chance - priority 1');
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it('re-renders when an item locks after first render', async () => {
|
|
258
|
+
const el = await fixture(html`
|
|
259
|
+
<zn-priority-list move-buttons>
|
|
260
|
+
<div value="a">A</div>
|
|
261
|
+
<div value="b">B</div>
|
|
262
|
+
</zn-priority-list>
|
|
263
|
+
`) as any;
|
|
264
|
+
await el.updateComplete;
|
|
265
|
+
|
|
266
|
+
el.querySelector('[value=b]').setAttribute('locked', '');
|
|
267
|
+
await new Promise(r => setTimeout(r));
|
|
268
|
+
await el.updateComplete;
|
|
269
|
+
|
|
270
|
+
expect(el.shadowRoot.querySelectorAll('.priority-list__item--locked')).to.have.length(1);
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
it('keeps a locked item in place', async () => {
|
|
274
|
+
const el = await fixture(html`
|
|
275
|
+
<zn-priority-list>
|
|
276
|
+
<div value="a">A</div>
|
|
277
|
+
<div value="b">B</div>
|
|
278
|
+
<div value="c" locked>C</div>
|
|
279
|
+
</zn-priority-list>
|
|
280
|
+
`) as any;
|
|
281
|
+
await el.updateComplete;
|
|
282
|
+
|
|
283
|
+
const items = el.shadowRoot.querySelectorAll('.priority-list__item');
|
|
284
|
+
items[2].dispatchEvent(new KeyboardEvent('keydown', {key: 'Home', altKey: true, bubbles: true}));
|
|
285
|
+
items[1].dispatchEvent(new KeyboardEvent('keydown', {key: 'End', altKey: true, bubbles: true}));
|
|
286
|
+
await el.updateComplete;
|
|
287
|
+
|
|
288
|
+
expect(el.value).to.deep.equal(['a', 'b', 'c']);
|
|
289
|
+
startDrag(items[2]);
|
|
290
|
+
await el.updateComplete;
|
|
291
|
+
expect(el.shadowRoot.querySelector('.priority-list__item--dragging')).to.not.exist;
|
|
292
|
+
drop(0, 0);
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it('keeps one tab stop and moves focus with plain arrows', async () => {
|
|
296
|
+
const el = await fixture(html`
|
|
297
|
+
<zn-priority-list>
|
|
298
|
+
<div value="a">A</div>
|
|
299
|
+
<div value="b">B</div>
|
|
300
|
+
</zn-priority-list>
|
|
301
|
+
`) as any;
|
|
302
|
+
await el.updateComplete;
|
|
303
|
+
|
|
304
|
+
const [first, second] = el.shadowRoot.querySelectorAll('.priority-list__item');
|
|
305
|
+
expect([first.getAttribute('tabindex'), second.getAttribute('tabindex')]).to.deep.equal(['0', '-1']);
|
|
306
|
+
|
|
307
|
+
first.focus();
|
|
308
|
+
first.dispatchEvent(new KeyboardEvent('keydown', {key: 'ArrowDown', bubbles: true, composed: true, cancelable: true}));
|
|
309
|
+
await el.updateComplete;
|
|
310
|
+
|
|
311
|
+
expect(el.value).to.deep.equal(['a', 'b']);
|
|
312
|
+
expect(el.shadowRoot.activeElement).to.equal(second);
|
|
313
|
+
expect([first.getAttribute('tabindex'), second.getAttribute('tabindex')]).to.deep.equal(['-1', '0']);
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
it('moves items with the move buttons', async () => {
|
|
317
|
+
const el = await fixture(html`
|
|
318
|
+
<zn-priority-list move-buttons>
|
|
319
|
+
<div value="a">A</div>
|
|
320
|
+
<div value="b">B</div>
|
|
321
|
+
<div value="c" locked>C</div>
|
|
322
|
+
</zn-priority-list>
|
|
323
|
+
`) as any;
|
|
324
|
+
await el.updateComplete;
|
|
325
|
+
|
|
326
|
+
const rows = () => [...el.shadowRoot.querySelectorAll('.priority-list__item')] as HTMLElement[];
|
|
327
|
+
const [first, second, locked] = rows();
|
|
328
|
+
expect(first.querySelector('zn-button[label="Move up"]')!.hasAttribute('disabled')).to.be.true;
|
|
329
|
+
expect(second.querySelector('zn-button[label="Move down"]')!.hasAttribute('disabled')).to.be.true;
|
|
330
|
+
expect(locked.querySelector('zn-button')).to.not.exist;
|
|
331
|
+
|
|
332
|
+
const down = first.querySelector('zn-button[label="Move down"]') as any;
|
|
333
|
+
await down.updateComplete;
|
|
334
|
+
down.shadowRoot.querySelector('button').click();
|
|
335
|
+
await el.updateComplete;
|
|
336
|
+
expect(el.value).to.deep.equal(['b', 'a', 'c']);
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
describe('dragging', () => {
|
|
340
|
+
const over = (target: HTMLElement, edge: 'top' | 'bottom') => {
|
|
341
|
+
const rect = target.getBoundingClientRect();
|
|
342
|
+
dragTo(centre(target).x, edge === 'top' ? rect.top + 1 : rect.bottom - 1);
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
const setup = async () => {
|
|
346
|
+
const el = await fixture(html`
|
|
347
|
+
<zn-priority-list>
|
|
348
|
+
<div value="a">A</div>
|
|
349
|
+
<div value="b">B</div>
|
|
350
|
+
<div value="c">C</div>
|
|
351
|
+
</zn-priority-list>
|
|
352
|
+
`) as any;
|
|
353
|
+
await el.updateComplete;
|
|
354
|
+
const reorders: string[][] = [];
|
|
355
|
+
el.addEventListener('zn-reorder', () => reorders.push([...el.value]));
|
|
356
|
+
const rows = () => [...el.shadowRoot.querySelectorAll('.priority-list__item')] as HTMLElement[];
|
|
357
|
+
return {el, reorders, rows};
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
it('swaps only once the pointer crosses the target midpoint', async () => {
|
|
361
|
+
const {el, reorders, rows} = await setup();
|
|
362
|
+
|
|
363
|
+
startDrag(rows()[0]);
|
|
364
|
+
over(rows()[1], 'top');
|
|
365
|
+
expect(el.value).to.deep.equal(['a', 'b', 'c']);
|
|
366
|
+
|
|
367
|
+
over(rows()[1], 'bottom');
|
|
368
|
+
expect(el.value).to.deep.equal(['b', 'a', 'c']);
|
|
369
|
+
await el.updateComplete;
|
|
370
|
+
|
|
371
|
+
const {x, y} = centre(rows()[1]);
|
|
372
|
+
drop(x, y);
|
|
373
|
+
expect(reorders).to.deep.equal([['b', 'a', 'c']]);
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
it('restores the order and stays silent when let go outside the list', async () => {
|
|
377
|
+
const {el, reorders, rows} = await setup();
|
|
378
|
+
|
|
379
|
+
startDrag(rows()[0]);
|
|
380
|
+
over(rows()[2], 'bottom');
|
|
381
|
+
expect(el.value).to.deep.equal(['b', 'c', 'a']);
|
|
382
|
+
await el.updateComplete;
|
|
383
|
+
|
|
384
|
+
const list = el.shadowRoot.querySelector('.priority-list').getBoundingClientRect();
|
|
385
|
+
drop(list.right + 50, list.bottom + 50);
|
|
386
|
+
expect(el.value).to.deep.equal(['a', 'b', 'c']);
|
|
387
|
+
expect(reorders).to.be.empty;
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
it('restores the order when Escape is pressed mid-drag', async () => {
|
|
391
|
+
const {el, reorders, rows} = await setup();
|
|
392
|
+
|
|
393
|
+
startDrag(rows()[0]);
|
|
394
|
+
over(rows()[1], 'bottom');
|
|
395
|
+
expect(el.value).to.deep.equal(['b', 'a', 'c']);
|
|
396
|
+
await el.updateComplete;
|
|
397
|
+
|
|
398
|
+
window.dispatchEvent(new KeyboardEvent('keydown', {key: 'Escape'}));
|
|
399
|
+
await el.updateComplete;
|
|
400
|
+
expect(el.value).to.deep.equal(['a', 'b', 'c']);
|
|
401
|
+
expect(el.shadowRoot.querySelector('.priority-list__item--dragging')).to.not.exist;
|
|
402
|
+
expect(reorders).to.be.empty;
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
it('treats a press without movement as a click', async () => {
|
|
406
|
+
const {el, rows} = await setup();
|
|
407
|
+
const {x, y} = centre(rows()[0]);
|
|
408
|
+
rows()[0].dispatchEvent(new PointerEvent('pointerdown', {pointerId: 1, button: 0, clientX: x, clientY: y, bubbles: true, composed: true}));
|
|
409
|
+
dragTo(x + 2, y);
|
|
410
|
+
await el.updateComplete;
|
|
411
|
+
expect(el.shadowRoot.querySelector('.priority-list__item--dragging')).to.not.exist;
|
|
412
|
+
drop(x + 2, y);
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
it('puts the move buttons ahead of the item actions, with tooltips', async () => {
|
|
417
|
+
const el = await fixture(html`
|
|
418
|
+
<zn-priority-list move-buttons>
|
|
419
|
+
<div value="a">A</div>
|
|
420
|
+
<zn-button slot="action-a" tooltip="Edit"></zn-button>
|
|
421
|
+
</zn-priority-list>
|
|
422
|
+
`) as any;
|
|
423
|
+
await el.updateComplete;
|
|
424
|
+
|
|
425
|
+
const actions = el.shadowRoot.querySelector('.priority-list__actions');
|
|
426
|
+
expect(actions.firstElementChild.classList.contains('priority-list__move')).to.be.true;
|
|
427
|
+
expect(actions.lastElementChild.getAttribute('name')).to.equal('action-a');
|
|
428
|
+
expect(actions.querySelector('zn-button[label="Move up"]').getAttribute('tooltip')).to.equal('Move up');
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
it('keeps a linked tile clickable without letting its link take the drag', async () => {
|
|
432
|
+
const el = await fixture(html`
|
|
433
|
+
<zn-priority-list>
|
|
434
|
+
<zn-tile value="a" caption="Second chance" href="/steps/a"></zn-tile>
|
|
435
|
+
<zn-tile value="b" caption="Confirmation"></zn-tile>
|
|
436
|
+
</zn-priority-list>
|
|
437
|
+
`) as any;
|
|
438
|
+
await el.updateComplete;
|
|
439
|
+
const [linked, plain] = el.querySelectorAll('zn-tile');
|
|
440
|
+
await linked.updateComplete;
|
|
441
|
+
|
|
442
|
+
expect(getComputedStyle(linked).pointerEvents).to.equal('auto');
|
|
443
|
+
expect(getComputedStyle(plain).pointerEvents).to.equal('none');
|
|
444
|
+
expect(linked.shadowRoot.querySelector('a.tile__link').getAttribute('draggable')).to.equal('false');
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
it('selects an item on click and passes the click on to it', async () => {
|
|
448
|
+
const el = await fixture(html`
|
|
449
|
+
<zn-priority-list label="Sections" selectable selected="a">
|
|
450
|
+
<div value="a">A</div>
|
|
451
|
+
<div value="b">B</div>
|
|
452
|
+
</zn-priority-list>
|
|
453
|
+
`) as any;
|
|
454
|
+
await el.updateComplete;
|
|
455
|
+
|
|
456
|
+
const clicked: string[] = [];
|
|
457
|
+
el.querySelector('[value="b"]').addEventListener('click', () => clicked.push('b'));
|
|
458
|
+
const selected: string[] = [];
|
|
459
|
+
el.addEventListener('zn-select', (e: CustomEvent) => selected.push(e.detail.item.getAttribute('value')));
|
|
460
|
+
|
|
461
|
+
const items = el.shadowRoot.querySelectorAll('.priority-list__item');
|
|
462
|
+
expect(items[0].getAttribute('aria-selected')).to.equal('true');
|
|
463
|
+
items[1].click();
|
|
464
|
+
await el.updateComplete;
|
|
465
|
+
|
|
466
|
+
expect(el.selected).to.equal('b');
|
|
467
|
+
expect(clicked).to.deep.equal(['b']);
|
|
468
|
+
expect(selected).to.deep.equal(['b']);
|
|
469
|
+
expect(el.shadowRoot.querySelectorAll('.priority-list__item')[1].getAttribute('aria-selected')).to.equal('true');
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
it('follows the item zn-tabs marks active', async () => {
|
|
473
|
+
const el = await fixture(html`
|
|
474
|
+
<zn-priority-list label="Sections" selectable selected="a">
|
|
475
|
+
<div value="a">A</div>
|
|
476
|
+
<div value="b">B</div>
|
|
477
|
+
</zn-priority-list>
|
|
478
|
+
`) as any;
|
|
479
|
+
await el.updateComplete;
|
|
480
|
+
|
|
481
|
+
el.querySelector('[value="b"]').classList.add('zn-tb-active');
|
|
482
|
+
await new Promise(resolve => setTimeout(resolve));
|
|
483
|
+
await el.updateComplete;
|
|
484
|
+
|
|
485
|
+
expect(el.shadowRoot.querySelectorAll('.priority-list__item')[1].getAttribute('aria-selected')).to.equal('true');
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
it('should round the placeholder to the panel corner it moves into while dragging', async () => {
|
|
489
|
+
const panel = await fixture(html`
|
|
490
|
+
<zn-panel flush style="--zn-panel-border-radius: 12px">
|
|
491
|
+
<zn-priority-list flush>
|
|
492
|
+
<div value="a">A</div>
|
|
493
|
+
<div value="b">B</div>
|
|
494
|
+
<div value="c">C</div>
|
|
495
|
+
</zn-priority-list>
|
|
496
|
+
</zn-panel>
|
|
497
|
+
`);
|
|
498
|
+
const el = panel.querySelector('zn-priority-list')!;
|
|
499
|
+
await el.updateComplete;
|
|
500
|
+
const rows = () => [...el.shadowRoot!.querySelectorAll<HTMLElement>('.priority-list__item')];
|
|
501
|
+
const placeholderRadius = () => getComputedStyle(el.shadowRoot!.querySelector('.priority-list__item--dragging')!).borderRadius;
|
|
502
|
+
|
|
503
|
+
startDrag(rows()[1]);
|
|
504
|
+
await aTimeout(50);
|
|
505
|
+
expect(placeholderRadius()).to.equal('0px');
|
|
506
|
+
|
|
507
|
+
const top = rows()[0].getBoundingClientRect();
|
|
508
|
+
dragTo(centre(rows()[0]).x, top.top + 1);
|
|
509
|
+
await el.updateComplete;
|
|
510
|
+
expect(placeholderRadius()).to.equal('12px 12px 0px 0px');
|
|
511
|
+
window.dispatchEvent(new KeyboardEvent('keydown', {key: 'Escape'}));
|
|
512
|
+
drop(0, 0);
|
|
513
|
+
});
|
|
216
514
|
});
|
|
@@ -10,19 +10,19 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
:host([color="info"]) {
|
|
13
|
-
--zn-progress-bar-color:
|
|
13
|
+
--zn-progress-bar-color: var(--zn-color-info-solid);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
:host([color="error"]) {
|
|
17
|
-
--zn-progress-bar-color:
|
|
17
|
+
--zn-progress-bar-color: var(--zn-color-danger-solid);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
:host([color="success"]) {
|
|
21
|
-
--zn-progress-bar-color:
|
|
21
|
+
--zn-progress-bar-color: var(--zn-color-success-solid);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
:host([color="warning"]) {
|
|
25
|
-
--zn-progress-bar-color:
|
|
25
|
+
--zn-progress-bar-color: var(--zn-color-warning-solid);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.header {
|
|
@@ -60,3 +60,15 @@
|
|
|
60
60
|
.footer {
|
|
61
61
|
margin-top: var(--zn-spacing-x-small);
|
|
62
62
|
}
|
|
63
|
+
|
|
64
|
+
[part="track"] {
|
|
65
|
+
fill: var(--zn-progress-track-color, rgba(var(--zn-border-color)));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[part="fill"] {
|
|
69
|
+
transition: width 300ms var(--zn-ease-out);
|
|
70
|
+
|
|
71
|
+
@media (prefers-reduced-motion: reduce) {
|
|
72
|
+
transition: none;
|
|
73
|
+
}
|
|
74
|
+
}
|