@cedar-design/ui-vue 1.1.0 → 1.1.1
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/es/_components/field-presentation/EditorPanel.vue.mjs +1 -1
- package/es/_components/field-presentation/editor-pending.mjs +4 -0
- package/es/_components/field-presentation/with-field-presentation.mjs +33 -7
- package/es/_components/picker-field/PickerField.vue.mjs +6 -12
- package/es/_components/picker-field/range-labels.mjs +16 -0
- package/es/_components/selected-options/style/index.css +33 -15
- package/es/_components/selection-field/use-selection-session.mjs +1 -0
- package/es/_components/virtual-list-v2/VirtualList2.vue.mjs +21 -3
- package/es/_utils/modal-focus.mjs +9 -2
- package/es/_utils/modal-surface.mjs +9 -3
- package/es/anchor/style/index.css +1 -1
- package/es/auto-complete/auto-complete.mjs +2 -2
- package/es/auto-complete/presentation.mjs +1 -0
- package/es/auto-complete/props.mjs +2 -0
- package/es/auto-complete/style/index.css +7 -2
- package/es/back-top/style/index.css +1 -1
- package/es/button/base.mjs +6 -0
- package/es/button/index.mjs +8 -8
- package/es/button/style/index.css +1 -1
- package/es/card/Card.vue.mjs +46 -12
- package/es/carousel/style/index.css +1 -1
- package/es/cascader/CascaderMenu.vue.mjs +2 -2
- package/es/cascader/cascader-option.mjs +11 -6
- package/es/cascader/field-adapter.mjs +1 -0
- package/es/cascader/props.mjs +2 -0
- package/es/cascader/style/index.css +36 -9
- package/es/cascader/use-cascader-focus.mjs +9 -6
- package/es/cedar.css +187 -79
- package/es/cedar.esm.js +21694 -21413
- package/es/checkbox/base.mjs +6 -0
- package/es/checkbox/checkbox-group.vue.mjs +2 -2
- package/es/checkbox/index.mjs +1 -1
- package/es/checkbox/presentation.mjs +2 -2
- package/es/checkbox/style/index.css +1 -1
- package/es/countdown/use-countdown.mjs +7 -2
- package/es/date/DatePanelActions.vue.mjs +1 -1
- package/es/date/DateShortcuts.vue.mjs +1 -1
- package/es/date/picker/panels/Footer2.vue.mjs +1 -1
- package/es/date/picker/panels/Shortcuts2.vue.mjs +1 -1
- package/es/date/picker/style/index.css +1 -1
- package/es/dialog/Dialog.vue.mjs +1 -1
- package/es/ellipsis/style/index.css +1 -1
- package/es/form/FormItem2.vue.mjs +35 -7
- package/es/form/FormItemLabel.vue.mjs +4 -3
- package/es/form/focus-explicit-label.mjs +28 -0
- package/es/form/style/index.css +1 -1
- package/es/input/base.mjs +7 -0
- package/es/input/index.mjs +16 -16
- package/es/layout/style/index.css +1 -1
- package/es/nav-menu/style/index.css +1 -1
- package/es/pagination/PageInput.vue.mjs +2 -2
- package/es/pagination/style/index.css +2 -2
- package/es/people-select/PeopleSelect.mjs +23 -50
- package/es/people-select/Person.vue.mjs +1 -1
- package/es/people-select/emits.mjs +1 -1
- package/es/people-select/people-select.mjs +6 -8
- package/es/people-select/presentation.mjs +3 -1
- package/es/people-select/props.mjs +9 -3
- package/es/people-select/selection.mjs +43 -0
- package/es/people-select/style/index.css +6 -0
- package/es/progress/style/index.css +2 -2
- package/es/radio/style/index.css +1 -1
- package/es/rate/style/index.css +1 -1
- package/es/ripple/index.mjs +57 -1
- package/es/scheduler/style/index.css +1 -1
- package/es/search/HistoryContent.vue.mjs +3 -3
- package/es/search/props.mjs +0 -1
- package/es/search/search.vue.mjs +1 -1
- package/es/select/props.mjs +2 -0
- package/es/select/select.mjs +10 -4
- package/es/select/style/index.css +22 -12
- package/es/select/use-select-controller.mjs +14 -2
- package/es/slider/Slider.vue.mjs +39 -21
- package/es/slider/SliderInput.vue.mjs +4 -2
- package/es/slider/style/index.css +2 -2
- package/es/steps/style/index.css +10 -10
- package/es/switch/Switch.vue.mjs +6 -1
- package/es/switch/style/index.css +1 -1
- package/es/table/structural-slot.mjs +17 -0
- package/es/table/style/index.css +2 -2
- package/es/table/table-tbody.mjs +2 -1
- package/es/table/table-td.mjs +3 -2
- package/es/table/table-th.mjs +3 -2
- package/es/table/table-thead.mjs +2 -1
- package/es/table/table-tr.mjs +3 -2
- package/es/table/table.mjs +22 -5
- package/es/tabs/style/index.css +1 -1
- package/es/time/picker/Panel2.vue.mjs +1 -1
- package/es/time/picker/RangePanel2.vue.mjs +1 -1
- package/es/tree/style/index.css +1 -1
- package/es/tree-select/panel.mjs +3 -1
- package/es/tree-select/presentation.mjs +1 -0
- package/es/tree-select/props.mjs +2 -0
- package/es/tree-select/style/index.css +49 -7
- package/es/trigger/interaction.mjs +1 -1
- package/es/trigger/popup-move-focus.mjs +6 -6
- package/es/trigger/position.mjs +41 -3
- package/es/trigger/positioner.mjs +28 -5
- package/es/trigger/trigger.mjs +1 -1
- package/es/upload/composables/use-upload-queue.mjs +9 -1
- package/es/upload/composables/use-uploader.mjs +31 -11
- package/es/upload/upload.vue.mjs +10 -2
- package/lib/_components/field-presentation/EditorPanel.vue.js +3 -3
- package/lib/_components/field-presentation/editor-pending.js +4 -0
- package/lib/_components/field-presentation/with-field-presentation.js +32 -6
- package/lib/_components/picker-field/PickerField.vue.js +6 -12
- package/lib/_components/picker-field/range-labels.js +16 -0
- package/lib/_components/selected-options/style/index.css +33 -15
- package/lib/_components/selection-field/use-selection-session.js +1 -0
- package/lib/_components/virtual-list-v2/VirtualList2.vue.js +20 -2
- package/lib/_utils/modal-focus.js +9 -2
- package/lib/_utils/modal-surface.js +9 -3
- package/lib/anchor/style/index.css +1 -1
- package/lib/auto-complete/auto-complete.js +2 -2
- package/lib/auto-complete/presentation.js +1 -0
- package/lib/auto-complete/props.js +2 -0
- package/lib/auto-complete/style/index.css +7 -2
- package/lib/back-top/style/index.css +1 -1
- package/lib/button/base.js +6 -0
- package/lib/button/index.js +4 -4
- package/lib/button/style/index.css +1 -1
- package/lib/card/Card.vue.js +47 -13
- package/lib/carousel/style/index.css +1 -1
- package/lib/cascader/CascaderMenu.vue.js +2 -2
- package/lib/cascader/cascader-option.js +11 -6
- package/lib/cascader/field-adapter.js +1 -0
- package/lib/cascader/props.js +2 -0
- package/lib/cascader/style/index.css +36 -9
- package/lib/cascader/use-cascader-focus.js +9 -6
- package/lib/cedar.cjs.js +1149 -738
- package/lib/cedar.css +187 -79
- package/lib/checkbox/base.js +6 -0
- package/lib/checkbox/index.js +4 -4
- package/lib/checkbox/presentation.js +2 -2
- package/lib/checkbox/style/index.css +1 -1
- package/lib/countdown/use-countdown.js +7 -2
- package/lib/date/DatePanelActions.vue.js +3 -3
- package/lib/date/DateShortcuts.vue.js +2 -2
- package/lib/date/picker/panels/Footer2.vue.js +2 -2
- package/lib/date/picker/panels/Shortcuts2.vue.js +2 -2
- package/lib/date/picker/style/index.css +1 -1
- package/lib/dialog/Dialog.vue.js +3 -3
- package/lib/ellipsis/style/index.css +1 -1
- package/lib/form/FormItem2.vue.js +35 -7
- package/lib/form/FormItemLabel.vue.js +3 -2
- package/lib/form/focus-explicit-label.js +28 -0
- package/lib/form/style/index.css +1 -1
- package/lib/input/base.js +7 -0
- package/lib/input/index.js +4 -4
- package/lib/layout/style/index.css +1 -1
- package/lib/nav-menu/style/index.css +1 -1
- package/lib/pagination/PageInput.vue.js +2 -2
- package/lib/pagination/style/index.css +2 -2
- package/lib/people-select/PeopleSelect.js +22 -49
- package/lib/people-select/Person.vue.js +3 -3
- package/lib/people-select/emits.js +1 -1
- package/lib/people-select/people-select.js +6 -8
- package/lib/people-select/presentation.js +3 -1
- package/lib/people-select/props.js +9 -3
- package/lib/people-select/selection.js +43 -0
- package/lib/people-select/style/index.css +6 -0
- package/lib/progress/style/index.css +2 -2
- package/lib/radio/style/index.css +1 -1
- package/lib/rate/style/index.css +1 -1
- package/lib/ripple/index.js +57 -1
- package/lib/scheduler/style/index.css +1 -1
- package/lib/search/HistoryContent.vue.js +4 -4
- package/lib/search/props.js +0 -1
- package/lib/search/search.vue.js +2 -2
- package/lib/select/props.js +2 -0
- package/lib/select/select.js +10 -4
- package/lib/select/style/index.css +22 -12
- package/lib/select/use-select-controller.js +14 -2
- package/lib/slider/Slider.vue.js +38 -20
- package/lib/slider/SliderInput.vue.js +4 -2
- package/lib/slider/style/index.css +2 -2
- package/lib/steps/style/index.css +10 -10
- package/lib/switch/Switch.vue.js +5 -0
- package/lib/switch/style/index.css +1 -1
- package/lib/table/structural-slot.js +17 -0
- package/lib/table/style/index.css +2 -2
- package/lib/table/table-tbody.js +2 -1
- package/lib/table/table-td.js +3 -2
- package/lib/table/table-th.js +3 -2
- package/lib/table/table-thead.js +2 -1
- package/lib/table/table-tr.js +3 -2
- package/lib/table/table.js +21 -4
- package/lib/tabs/style/index.css +1 -1
- package/lib/time/picker/Panel2.vue.js +2 -2
- package/lib/time/picker/RangePanel2.vue.js +2 -2
- package/lib/tree/style/index.css +1 -1
- package/lib/tree-select/panel.js +3 -1
- package/lib/tree-select/presentation.js +1 -0
- package/lib/tree-select/props.js +2 -0
- package/lib/tree-select/style/index.css +49 -7
- package/lib/trigger/popup-move-focus.js +6 -6
- package/lib/trigger/position.js +40 -2
- package/lib/trigger/positioner.js +27 -4
- package/lib/trigger/trigger.js +1 -1
- package/lib/upload/composables/use-upload-queue.js +9 -1
- package/lib/upload/composables/use-uploader.js +31 -11
- package/lib/upload/upload.vue.js +9 -1
- package/package.json +6 -6
- package/types/_components/field-presentation/editor-pending.d.ts +3 -0
- package/types/_components/field-presentation/with-field-presentation.d.ts +2 -0
- package/types/_components/picker-field/range-labels.d.ts +1 -0
- package/types/_utils/modal-focus.d.ts +1 -0
- package/types/auto-complete/auto-complete.d.ts +9 -0
- package/types/auto-complete/index.d.ts +30 -0
- package/types/auto-complete/presentation.d.ts +9 -0
- package/types/auto-complete/props.d.ts +5 -0
- package/types/button/base.d.ts +266 -0
- package/types/button/index.d.ts +5 -1
- package/types/cascader/Cascader.vue.d.ts +9 -0
- package/types/cascader/index.d.ts +30 -0
- package/types/cascader/presentation.d.ts +15 -0
- package/types/cascader/props.d.ts +5 -0
- package/types/cascader/use-cascader-controller.d.ts +4 -0
- package/types/checkbox/base.d.ts +361 -0
- package/types/checkbox/index.d.ts +5 -1
- package/types/date/picker/DateRangePicker.vue.d.ts +12 -496
- package/types/date/picker/DateRangePickerPanel.vue.d.ts +12 -496
- package/types/date/picker/Picker.vue.d.ts +12 -496
- package/types/date/picker/PickerPanel.vue.d.ts +12 -496
- package/types/date/picker/panels/Footer.vue.d.ts +3 -124
- package/types/date/picker/panels/Shortcuts.vue.d.ts +3 -124
- package/types/date/picker/panels/date/Index.vue.d.ts +3 -124
- package/types/date/picker/panels/week/Index.vue.d.ts +3 -124
- package/types/form/FormItemLabel.vue.d.ts +2 -2
- package/types/form/context.d.ts +1 -1
- package/types/form/focus-explicit-label.d.ts +2 -0
- package/types/input/base.d.ts +481 -0
- package/types/input/index.d.ts +5 -1
- package/types/people-select/PeopleSelect.d.ts +38 -16
- package/types/people-select/emits.d.ts +3 -2
- package/types/people-select/index.d.ts +135 -63
- package/types/people-select/people-select.d.ts +47 -16
- package/types/people-select/presentation.d.ts +46 -16
- package/types/people-select/props.d.ts +17 -6
- package/types/people-select/selection.d.ts +11 -0
- package/types/people-select/types.d.ts +5 -1
- package/types/popconfirm/Popconfirm.vue.d.ts +2 -0
- package/types/popconfirm/index.d.ts +8 -0
- package/types/select/index.d.ts +30 -0
- package/types/select/native-editor-owner.d.ts +1 -0
- package/types/select/props.d.ts +5 -0
- package/types/select/select.d.ts +9 -0
- package/types/select/use-select-controller.d.ts +5 -0
- package/types/slider/SliderInput.vue.d.ts +4 -0
- package/types/table/structural-slot.d.ts +3 -0
- package/types/table/table-operation-td.d.ts +2 -0
- package/types/time/picker/Panel.vue.d.ts +3 -124
- package/types/time/picker/RangePanel.vue.d.ts +6 -248
- package/types/time/presentation/TimePanelContent.vue.d.ts +9 -372
- package/types/transfer/Transfer.vue.d.ts +4 -0
- package/types/transfer/TransferView.vue.d.ts +2 -0
- package/types/transfer/index.d.ts +16 -0
- package/types/transfer/presentation.d.ts +4 -0
- package/types/tree/BaseNode.vue.d.ts +2 -0
- package/types/tree/TransitionNodeList.vue.d.ts +2 -0
- package/types/tree-select/TreeSelect.vue.d.ts +13 -0
- package/types/tree-select/index.d.ts +50 -0
- package/types/tree-select/presentation.d.ts +13 -0
- package/types/tree-select/props.d.ts +5 -0
- package/types/trigger/position.d.ts +1 -0
- package/types/typography/EditContent.vue.d.ts +6 -0
- package/types/upload/composables/use-upload-queue.d.ts +1 -0
- package/types/upload/composables/use-uploader.d.ts +2 -0
- package/types/upload/upload.vue.d.ts +3 -3
- package/umd/_components/selected-options/style/index.css +33 -15
- package/umd/anchor/style/index.css +1 -1
- package/umd/auto-complete/style/index.css +7 -2
- package/umd/back-top/style/index.css +1 -1
- package/umd/button/style/index.css +1 -1
- package/umd/carousel/style/index.css +1 -1
- package/umd/cascader/style/index.css +36 -9
- package/umd/cedar.css +187 -79
- package/umd/cedar.js +6 -6
- package/umd/checkbox/style/index.css +1 -1
- package/umd/date/picker/style/index.css +1 -1
- package/umd/ellipsis/style/index.css +1 -1
- package/umd/form/style/index.css +1 -1
- package/umd/layout/style/index.css +1 -1
- package/umd/nav-menu/style/index.css +1 -1
- package/umd/pagination/style/index.css +2 -2
- package/umd/people-select/style/index.css +6 -0
- package/umd/progress/style/index.css +2 -2
- package/umd/radio/style/index.css +1 -1
- package/umd/rate/style/index.css +1 -1
- package/umd/scheduler/style/index.css +1 -1
- package/umd/select/style/index.css +22 -12
- package/umd/slider/style/index.css +2 -2
- package/umd/steps/style/index.css +10 -10
- package/umd/switch/style/index.css +1 -1
- package/umd/table/style/index.css +2 -2
- package/umd/tabs/style/index.css +1 -1
- package/umd/tree/style/index.css +1 -1
- package/umd/tree-select/style/index.css +49 -7
package/es/steps/style/index.css
CHANGED
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
--c-steps-circle-item-tail-color-wait: var(--c-sys-color-border-default);
|
|
28
28
|
--c-steps-circle-item-title-color-wait: var(--c-sys-color-content-secondary);
|
|
29
29
|
--c-steps-circle-item-description-color-wait: var(--c-sys-color-content-secondary);
|
|
30
|
-
--c-steps-circle-item-bg-process: var(--c-sys-color-
|
|
30
|
+
--c-steps-circle-item-bg-process: var(--c-sys-color-action-primary);
|
|
31
31
|
--c-steps-circle-item-border-color-process: transparent;
|
|
32
32
|
--c-steps-circle-item-icon-text-color-process: var(--c-sys-color-surface-default);
|
|
33
|
-
--c-steps-circle-item-tail-color-process: var(--c-sys-color-
|
|
33
|
+
--c-steps-circle-item-tail-color-process: var(--c-sys-color-action-primary);
|
|
34
34
|
--c-steps-circle-item-title-color-process: var(--c-sys-color-content-primary);
|
|
35
35
|
--c-steps-circle-item-description-color-process: var(--c-sys-color-content-secondary);
|
|
36
36
|
--c-steps-circle-item-bg-finish: var(--c-sys-color-state-selected);
|
|
37
37
|
--c-steps-circle-item-border-color-finish: transparent;
|
|
38
|
-
--c-steps-circle-item-icon-text-color-finish: var(--c-sys-color-
|
|
38
|
+
--c-steps-circle-item-icon-text-color-finish: var(--c-sys-color-action-primary);
|
|
39
39
|
--c-steps-circle-item-title-color-finish: var(--c-sys-color-content-primary);
|
|
40
40
|
--c-steps-circle-item-description-color-finish: var(--c-sys-color-content-secondary);
|
|
41
41
|
--c-steps-circle-item-bg-error: var(--c-sys-color-content-danger);
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
--c-steps-dot-item-tail-color-wait: var(--c-sys-color-border-default);
|
|
62
62
|
--c-steps-dot-item-title-color-wait: var(--c-sys-color-content-secondary);
|
|
63
63
|
--c-steps-dot-item-description-color-wait: var(--c-sys-color-content-secondary);
|
|
64
|
-
--c-steps-dot-item-bg-process: var(--c-sys-color-
|
|
65
|
-
--c-steps-dot-item-border-color-process: var(--c-sys-color-
|
|
66
|
-
--c-steps-dot-item-tail-color-process: var(--c-sys-color-
|
|
64
|
+
--c-steps-dot-item-bg-process: var(--c-sys-color-action-primary);
|
|
65
|
+
--c-steps-dot-item-border-color-process: var(--c-sys-color-action-primary);
|
|
66
|
+
--c-steps-dot-item-tail-color-process: var(--c-sys-color-action-primary);
|
|
67
67
|
--c-steps-dot-item-title-color-process: var(--c-sys-color-content-primary);
|
|
68
68
|
--c-steps-dot-item-description-color-process: var(--c-sys-color-content-secondary);
|
|
69
|
-
--c-steps-dot-item-bg-finish: var(--c-sys-color-
|
|
70
|
-
--c-steps-dot-item-border-color-finish: var(--c-sys-color-
|
|
69
|
+
--c-steps-dot-item-bg-finish: var(--c-sys-color-action-primary);
|
|
70
|
+
--c-steps-dot-item-border-color-finish: var(--c-sys-color-action-primary);
|
|
71
71
|
--c-steps-dot-item-title-color-finish: var(--c-sys-color-content-primary);
|
|
72
72
|
--c-steps-dot-item-description-color-finish: var(--c-sys-color-content-secondary);
|
|
73
73
|
--c-steps-dot-item-bg-error: var(--c-sys-color-content-danger);
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
--c-steps-arrow-item-bg-wait: var(--c-sys-color-surface-muted);
|
|
87
87
|
--c-steps-arrow-item-title-color-wait: var(--c-sys-color-content-secondary);
|
|
88
88
|
--c-steps-arrow-item-description-color-wait: var(--c-sys-color-content-secondary);
|
|
89
|
-
--c-steps-arrow-item-bg-process: var(--c-sys-color-
|
|
89
|
+
--c-steps-arrow-item-bg-process: var(--c-sys-color-action-primary);
|
|
90
90
|
--c-steps-arrow-item-title-color-process: var(--c-sys-color-surface-default);
|
|
91
91
|
--c-steps-arrow-item-description-color-process: var(--c-sys-color-surface-default);
|
|
92
92
|
--c-steps-arrow-item-bg-finish: var(--c-sys-color-state-selected);
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
--c-steps-navigation-arrow-spacing-right: var(--c-spacing-5);
|
|
105
105
|
--c-steps-navigation-ink-spacing-left: var(--c-spacing-none);
|
|
106
106
|
--c-steps-navigation-ink-spacing-right: 30px;
|
|
107
|
-
--c-steps-navigation-ink-bg: var(--c-sys-color-
|
|
107
|
+
--c-steps-navigation-ink-bg: var(--c-sys-color-action-primary);
|
|
108
108
|
--c-steps-changeable-hover-text-color: var(--c-sys-color-content-brand);
|
|
109
109
|
--c-steps-node-font-weight: var(--c-font-weight-500);
|
|
110
110
|
--c-steps-transition-duration-1: var(--c-transition-duration-1);
|
package/es/switch/Switch.vue.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, onBeforeUnmount, onDeactivated, onActivated,
|
|
1
|
+
import { defineComponent, ref, computed, inject, watch, onBeforeUnmount, onDeactivated, onActivated, openBlock, createElementBlock, mergeProps, withKeys, withModifiers, unref, createElementVNode, normalizeClass, renderSlot, createTextVNode, toDisplayString, createCommentVNode, normalizeStyle } from "vue";
|
|
2
|
+
import { fieldEditorControlPending } from "../_components/field-presentation/editor-pending.mjs";
|
|
2
3
|
import { invokeBeforeHook } from "../_hooks/use-action-guard.mjs";
|
|
3
4
|
import { createNamespace } from "../_utils/global-config.mjs";
|
|
4
5
|
import { useFormErrorDescription } from "../form/error-description.mjs";
|
|
@@ -20,6 +21,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
21
|
const current = computed(() => props.modelValue === void 0 ? internal.value : props.modelValue);
|
|
21
22
|
const checked = computed(() => current.value === props.checkedValue);
|
|
22
23
|
const pending = ref(false);
|
|
24
|
+
const editorPending = inject(fieldEditorControlPending, void 0);
|
|
25
|
+
watch(pending, (value) => {
|
|
26
|
+
if (editorPending) editorPending.value = value;
|
|
27
|
+
}, { flush: "sync" });
|
|
23
28
|
const busy = computed(() => props.loading || pending.value);
|
|
24
29
|
const rippleKey = ref(0);
|
|
25
30
|
let active = true;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
--c-switch-size-lg-scale: 1.2;
|
|
13
13
|
--c-switch-hit-area: 0px;
|
|
14
14
|
--c-switch-track-background: var(--c-sys-color-content-secondary);
|
|
15
|
-
--c-switch-track-active-background: var(--c-sys-color-
|
|
15
|
+
--c-switch-track-active-background: var(--c-sys-color-action-primary);
|
|
16
16
|
--c-switch-track-error-background: var(--c-sys-color-content-danger);
|
|
17
17
|
--c-switch-handle-background: var(--c-sys-color-surface-default);
|
|
18
18
|
--c-switch-handle-color: var(--c-sys-color-content-brand);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isVNode, Comment, Text, Fragment } from "vue";
|
|
2
|
+
function firstStructuralNode(nodes) {
|
|
3
|
+
if (Array.isArray(nodes)) {
|
|
4
|
+
for (const node of nodes) {
|
|
5
|
+
const result = firstStructuralNode(node);
|
|
6
|
+
if (result) return result;
|
|
7
|
+
}
|
|
8
|
+
return void 0;
|
|
9
|
+
}
|
|
10
|
+
if (!isVNode(nodes) || nodes.type === Comment) return void 0;
|
|
11
|
+
if (nodes.type === Text && !String(nodes.children ?? "").trim()) return void 0;
|
|
12
|
+
if (nodes.type === Fragment && Array.isArray(nodes.children)) return firstStructuralNode(nodes.children);
|
|
13
|
+
return nodes;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
firstStructuralNode
|
|
17
|
+
};
|
package/es/table/style/index.css
CHANGED
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
--c-table-header-cell-action-margin-left: 2px;
|
|
59
59
|
--c-table-th-actions-margin-left: 8px;
|
|
60
60
|
--c-table-header-filters-icon-color: var(--c-color-text-2);
|
|
61
|
-
--c-table-header-filters-icon-active-color: var(--c-sys-color-
|
|
61
|
+
--c-table-header-filters-icon-active-color: var(--c-sys-color-action-primary);
|
|
62
62
|
--c-table-header-filters-icon-hover-bg: var(--c-color-neutral-4);
|
|
63
63
|
--c-table-filters-icon-font-size: 16px;
|
|
64
64
|
--c-table-filters-width: 24px;
|
|
65
65
|
--c-table-filters-icon-hover-bg: var(--c-color-fill-4);
|
|
66
66
|
--c-table-header-sorter-icon-color: var(--c-color-neutral-5);
|
|
67
67
|
--c-table-header-sorter-icon-next-color: var(--c-color-neutral-6);
|
|
68
|
-
--c-table-header-sorter-icon-active-color: var(--c-sys-color-
|
|
68
|
+
--c-table-header-sorter-icon-active-color: var(--c-sys-color-action-primary);
|
|
69
69
|
--c-table-header-sorter-icon-margin-left: var(--c-spacing-4);
|
|
70
70
|
--c-table-header-sorter-icon-height: 8px;
|
|
71
71
|
--c-table-header-sorter-icon-width: 14px;
|
package/es/table/table-tbody.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineComponent, createVNode } from "vue";
|
|
2
2
|
import { createNamespace } from "../_utils/global-config.mjs";
|
|
3
|
+
import { firstStructuralNode } from "./structural-slot.mjs";
|
|
3
4
|
const {
|
|
4
5
|
name
|
|
5
6
|
} = createNamespace("tbody");
|
|
@@ -9,7 +10,7 @@ const Tbody = /* @__PURE__ */ defineComponent({
|
|
|
9
10
|
slots
|
|
10
11
|
}) {
|
|
11
12
|
return () => {
|
|
12
|
-
return createVNode(slots.tbody?.()
|
|
13
|
+
return createVNode(firstStructuralNode(slots.tbody?.()) ?? "tbody", null, {
|
|
13
14
|
default: slots.default
|
|
14
15
|
});
|
|
15
16
|
};
|
package/es/table/table-td.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import AutoTooltip from "../_components/auto-tooltip/auto-tooltip.mjs";
|
|
|
9
9
|
import _sfc_main from "./TableSlot.vue.mjs";
|
|
10
10
|
import { forwardTableSlot, forwardTableColumnSlot } from "./forward-table-slot.mjs";
|
|
11
11
|
import { getColumnLayoutKey, isTableExtraColumn } from "./extra-column.mjs";
|
|
12
|
+
import { firstStructuralNode } from "./structural-slot.mjs";
|
|
12
13
|
function _isSlot(s) {
|
|
13
14
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
14
15
|
}
|
|
@@ -228,11 +229,11 @@ const Td = /* @__PURE__ */ defineComponent({
|
|
|
228
229
|
}, [renderContent()])]);
|
|
229
230
|
};
|
|
230
231
|
return () => {
|
|
231
|
-
const customCell = slots.td?.({
|
|
232
|
+
const customCell = firstStructuralNode(slots.td?.({
|
|
232
233
|
record: props.record?.raw,
|
|
233
234
|
column: props.column,
|
|
234
235
|
rowIndex: props.rowIndex ?? -1
|
|
235
|
-
})
|
|
236
|
+
}));
|
|
236
237
|
const customHeaders = customCell?.props && Object.prototype.hasOwnProperty.call(customCell.props, "headers") && customCell.props.headers !== void 0 ? customCell.props.headers : props.headers;
|
|
237
238
|
return createVNode(customCell ?? "td", {
|
|
238
239
|
class: cls.value,
|
package/es/table/table-th.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineComponent, toRefs, inject, computed, createVNode, mergeProps, isVNode } from "vue";
|
|
2
2
|
import { getPrefixCls, createNamespace } from "../_utils/global-config.mjs";
|
|
3
|
+
import { firstStructuralNode } from "./structural-slot.mjs";
|
|
3
4
|
import { Checkbox } from "../checkbox/index.mjs";
|
|
4
5
|
import { Radio } from "../radio/index.mjs";
|
|
5
6
|
import { Button } from "../button/index.mjs";
|
|
@@ -348,9 +349,9 @@ const Th = /* @__PURE__ */ defineComponent({
|
|
|
348
349
|
const rowSpan = props.column.rowSpan ?? 1;
|
|
349
350
|
const resizeColumnName = typeof props.column.title === "string" ? props.column.title : props.column.dataIndex;
|
|
350
351
|
const translatedResizeLabel = t("table.resizeColumn", resizeColumnName);
|
|
351
|
-
const customHeader = props.customHeader ?? slots.th?.({
|
|
352
|
+
const customHeader = firstStructuralNode([props.customHeader]) ?? firstStructuralNode(slots.th?.({
|
|
352
353
|
column: props.column
|
|
353
|
-
})
|
|
354
|
+
}));
|
|
354
355
|
return createVNode(customHeader ?? "th", {
|
|
355
356
|
class: cls.value,
|
|
356
357
|
style: style.value,
|
package/es/table/table-thead.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineComponent, createVNode } from "vue";
|
|
2
2
|
import { createNamespace } from "../_utils/global-config.mjs";
|
|
3
|
+
import { firstStructuralNode } from "./structural-slot.mjs";
|
|
3
4
|
const {
|
|
4
5
|
name
|
|
5
6
|
} = createNamespace("thead");
|
|
@@ -9,7 +10,7 @@ const Thead = /* @__PURE__ */ defineComponent({
|
|
|
9
10
|
slots
|
|
10
11
|
}) {
|
|
11
12
|
return () => {
|
|
12
|
-
return createVNode(slots.thead?.()
|
|
13
|
+
return createVNode(firstStructuralNode(slots.thead?.()) ?? "thead", null, {
|
|
13
14
|
default: slots.default
|
|
14
15
|
});
|
|
15
16
|
};
|
package/es/table/table-tr.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { defineComponent, inject, computed, createVNode, isVNode, Fragment } fro
|
|
|
2
2
|
import { getPrefixCls, createNamespace } from "../_utils/global-config.mjs";
|
|
3
3
|
import { tableInjectionKey } from "./context.mjs";
|
|
4
4
|
import { orderPhysicalColumns } from "./column-direction.mjs";
|
|
5
|
+
import { firstStructuralNode } from "./structural-slot.mjs";
|
|
5
6
|
const {
|
|
6
7
|
name
|
|
7
8
|
} = createNamespace("tr");
|
|
@@ -34,10 +35,10 @@ const Tr = /* @__PURE__ */ defineComponent({
|
|
|
34
35
|
[`${prefixCls}-tr-checked`]: props.checked
|
|
35
36
|
}]);
|
|
36
37
|
return () => {
|
|
37
|
-
return createVNode(slots.tr?.({
|
|
38
|
+
return createVNode(firstStructuralNode(slots.tr?.({
|
|
38
39
|
rowIndex: props.rowIndex,
|
|
39
40
|
record: props.record?.raw
|
|
40
|
-
})
|
|
41
|
+
})) ?? "tr", {
|
|
41
42
|
class: cls.value
|
|
42
43
|
}, {
|
|
43
44
|
default: () => {
|
package/es/table/table.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, toRefs, computed, inject, ref, reactive, onMounted, onBeforeUnmount, watch, watchEffect, onActivated, onDeactivated, watchPostEffect, provide, useId, toRaw, createVNode, mergeProps, isVNode, Fragment, Teleport } from "vue";
|
|
1
|
+
import { defineComponent, toRefs, computed, inject, ref, reactive, onMounted, onBeforeUnmount, watch, watchEffect, onActivated, onDeactivated, watchPostEffect, provide, useId, shallowRef, getCurrentInstance, toRaw, createVNode, mergeProps, isVNode, Fragment, Teleport } from "vue";
|
|
2
2
|
import { useI18n } from "../locale/index.mjs";
|
|
3
3
|
import { useThemeScope } from "../theme-provider/context.mjs";
|
|
4
4
|
import { useElementResize } from "../_utils/resize-observer.mjs";
|
|
@@ -23,6 +23,7 @@ import _sfc_main$2 from "./TableSlot.vue.mjs";
|
|
|
23
23
|
import _sfc_main$1 from "./TableColumnSlot.vue.mjs";
|
|
24
24
|
import { forwardTableSlot } from "./forward-table-slot.mjs";
|
|
25
25
|
import Thead from "./table-thead.mjs";
|
|
26
|
+
import { firstStructuralNode } from "./structural-slot.mjs";
|
|
26
27
|
import Tbody from "./table-tbody.mjs";
|
|
27
28
|
import Tr from "./table-tr.mjs";
|
|
28
29
|
import Th from "./table-th.mjs";
|
|
@@ -1279,9 +1280,10 @@ const _Table = /* @__PURE__ */ defineComponent({
|
|
|
1279
1280
|
const semanticId = `c-table-header-${useId()}`;
|
|
1280
1281
|
const visibleHeaderId = (row, index) => `${semanticId}-visible-${row}-${index}`;
|
|
1281
1282
|
const visibleOperationId = (index) => `${semanticId}-visible-operation-${index}`;
|
|
1282
|
-
const
|
|
1283
|
+
const activeHeaderSlot = shallowRef(slots.th);
|
|
1284
|
+
const customHeaders = computed(() => groupColumns.value.map((row) => row.map((column) => firstStructuralNode(activeHeaderSlot.value?.({
|
|
1283
1285
|
column
|
|
1284
|
-
})
|
|
1286
|
+
})))));
|
|
1285
1287
|
const explicitHeaderName = (value) => typeof value === "string" && value.trim() ? value : void 0;
|
|
1286
1288
|
const semanticRows = (surface) => groupColumns.value.map((row, rowIndex) => [...rowIndex === 0 ? operations.value.map((_, index) => ({
|
|
1287
1289
|
id: `${semanticId}-${surface}-operation-${index}`,
|
|
@@ -1897,13 +1899,27 @@ const _Table = /* @__PURE__ */ defineComponent({
|
|
|
1897
1899
|
}
|
|
1898
1900
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
1899
1901
|
});
|
|
1902
|
+
const tableInstance = getCurrentInstance();
|
|
1903
|
+
let slotSnapshot = [];
|
|
1904
|
+
const currentSlotSnapshot = () => {
|
|
1905
|
+
const incoming = tableInstance.vnode.children;
|
|
1906
|
+
const raw = incoming && !Array.isArray(incoming) && typeof incoming === "object" ? incoming : {};
|
|
1907
|
+
const next = Object.keys(raw).filter((key) => key !== "_" && key !== "$stable").sort().flatMap((key) => [key, raw[key]]);
|
|
1908
|
+
if (next.length !== slotSnapshot.length || next.some((value, index) => value !== slotSnapshot[index])) {
|
|
1909
|
+
slotSnapshot = next;
|
|
1910
|
+
activeHeaderSlot.value = slots.th;
|
|
1911
|
+
}
|
|
1912
|
+
return slotSnapshot;
|
|
1913
|
+
};
|
|
1900
1914
|
const DeferredTable = /* @__PURE__ */ defineComponent({
|
|
1901
1915
|
props: {
|
|
1902
|
-
rowSlotState: Number
|
|
1916
|
+
rowSlotState: Number,
|
|
1917
|
+
slotSnapshot: Array
|
|
1903
1918
|
},
|
|
1904
1919
|
setup: () => () => renderTable()
|
|
1905
1920
|
});
|
|
1906
1921
|
const render = () => {
|
|
1922
|
+
const snapshot = currentSlotSnapshot();
|
|
1907
1923
|
if (slots.default) {
|
|
1908
1924
|
let _slot;
|
|
1909
1925
|
return createVNode(ResizeObserver, {
|
|
@@ -1933,7 +1949,8 @@ const _Table = /* @__PURE__ */ defineComponent({
|
|
|
1933
1949
|
"aria-busy": loadingProps.value.loading || void 0
|
|
1934
1950
|
}, tableInteractionEvents), [children.value, createVNode(_sfc_main, loadingProps.value, {
|
|
1935
1951
|
default: () => [props.pagination !== false && (flattenData.value.length > 0 || sortedData.value.length > 0) && isPaginationTop.value && renderPaginationArea(), createVNode(DeferredTable, {
|
|
1936
|
-
"rowSlotState": (slots.tr ? 1 : 0) | (slots["expand-row"] ? 2 : 0)
|
|
1952
|
+
"rowSlotState": (slots.tr ? 1 : 0) | (slots["expand-row"] ? 2 : 0),
|
|
1953
|
+
"slotSnapshot": snapshot
|
|
1937
1954
|
}, null), props.pagination !== false && (flattenData.value.length > 0 || sortedData.value.length > 0) && !isPaginationTop.value && renderPaginationArea()]
|
|
1938
1955
|
})])]
|
|
1939
1956
|
});
|
package/es/tabs/style/index.css
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:where([data-c-theme]) {
|
|
6
6
|
--c-tabs-background: var(--c-sys-color-surface-default);
|
|
7
7
|
--c-tabs-title-text-color: var(--c-sys-color-content-secondary);
|
|
8
|
-
--c-tabs-title-text-color-active: var(--c-sys-color-
|
|
8
|
+
--c-tabs-title-text-color-active: var(--c-sys-color-action-primary);
|
|
9
9
|
--c-tabs-title-text-color-disabled: var(--c-sys-color-content-disabled);
|
|
10
10
|
--c-tabs-muted-background: var(--c-sys-color-surface-muted);
|
|
11
11
|
--c-tabs-border-color: var(--c-sys-color-border-default);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { navigateTemporalColumns } from "../../_utils/temporal-keyboard.mjs";
|
|
2
2
|
import { defineComponent, toRefs, reactive, ref, watch, computed } from "vue";
|
|
3
3
|
import TimeColumn from "./TimeColumn.vue.mjs";
|
|
4
|
-
import
|
|
4
|
+
import Button from "../../button/base.mjs";
|
|
5
5
|
import { isUndefined, isDayjs } from "../../_utils/is.mjs";
|
|
6
6
|
import { dayjs } from "../../_utils/date.mjs";
|
|
7
7
|
import { getPrefixCls, createNamespace } from "../../_utils/global-config.mjs";
|
|
@@ -4,7 +4,7 @@ import Panel from "./Panel.vue.mjs";
|
|
|
4
4
|
import { isValidRangeValue, isTimeRangeNextDay } from "./utils/index.mjs";
|
|
5
5
|
import { getPrefixCls, createNamespace } from "../../_utils/global-config.mjs";
|
|
6
6
|
import { useI18n } from "../../locale/index.mjs";
|
|
7
|
-
import
|
|
7
|
+
import Button from "../../button/base.mjs";
|
|
8
8
|
const { name } = createNamespace("time-picker-range-panel");
|
|
9
9
|
const panelIndexes = [0, 1];
|
|
10
10
|
const _sfc_main = defineComponent({
|
package/es/tree/style/index.css
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
--c-tree-focus-outline-width: 2px;
|
|
7
7
|
--c-tree-title-text-color: var(--c-color-text-1);
|
|
8
8
|
--c-tree-title-text-color-hover: var(--c-color-text-1);
|
|
9
|
-
--c-tree-title-text-color-active: var(--c-sys-color-
|
|
9
|
+
--c-tree-title-text-color-active: var(--c-sys-color-action-primary);
|
|
10
10
|
--c-tree-title-text-color-disabled: var(--c-color-text-4);
|
|
11
11
|
--c-tree-title-text-color-active-disabled: var(--c-color-primary-light-3);
|
|
12
12
|
--c-tree-title-bg-hover: var(--c-color-fill-2);
|
package/es/tree-select/panel.mjs
CHANGED
|
@@ -195,7 +195,9 @@ const Panel = /* @__PURE__ */ defineComponent({
|
|
|
195
195
|
"aria-disabled": visibleNodeMap.value.get(key)?.disabled,
|
|
196
196
|
"aria-expanded": status.isLeaf ? void 0 : status.expanded,
|
|
197
197
|
"class": [`${prefixCls}-option`, {
|
|
198
|
-
[`${prefixCls}-option-active`]: key === activeKey.value
|
|
198
|
+
[`${prefixCls}-option-active`]: key === activeKey.value,
|
|
199
|
+
[`${prefixCls}-option-selected`]: status.selected || status.checked,
|
|
200
|
+
[`${prefixCls}-option-disabled`]: visibleNodeMap.value.get(key)?.disabled
|
|
199
201
|
}],
|
|
200
202
|
"onMouseenter": () => {
|
|
201
203
|
if (visibleNodeMap.value.has(key) && !visibleNodeMap.value.get(key)?.disabled) activeKey.value = key;
|
|
@@ -4,6 +4,7 @@ import { optionValueText } from "../_components/field-presentation/option-labels
|
|
|
4
4
|
import { withFieldPresentation } from "../_components/field-presentation/with-field-presentation.mjs";
|
|
5
5
|
import Base from "./TreeSelect.vue.mjs";
|
|
6
6
|
const _TreeSelect = withFieldPresentation(Base, {
|
|
7
|
+
selectionConfirmation: "update",
|
|
7
8
|
pauseSelectionWhileLoading: true,
|
|
8
9
|
editor: ({ props, attrs, value, update, emit, slots, disabled, readonly }) => h(
|
|
9
10
|
_sfc_main,
|
package/es/tree-select/props.mjs
CHANGED
|
@@ -5,6 +5,8 @@ import { popupContainerProp } from "../_utils/popup-container.mjs";
|
|
|
5
5
|
import { fieldLoadingProps } from "../field-decorator/props.mjs";
|
|
6
6
|
const treeSelectProps = {
|
|
7
7
|
...fieldLoadingProps,
|
|
8
|
+
/** 弹出编辑是否需要确认;未设置时单选即提交,多选保留确认。 */
|
|
9
|
+
needConfirm: { type: Boolean, default: void 0 },
|
|
8
10
|
openTriggerTarget: openTriggerTargetProp,
|
|
9
11
|
/** 内置字段匹配是否区分大小写。 */
|
|
10
12
|
caseSensitive: { type: Boolean, default: false },
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
:root,
|
|
5
5
|
:where([data-c-theme]) {
|
|
6
6
|
--c-tree-select-option-active-background: var(--c-color-fill-2);
|
|
7
|
-
--c-tree-select-option-radius: var(--c-
|
|
8
|
-
--c-tree-select-popup-padding-left: var(--c-
|
|
9
|
-
--c-tree-select-popup-padding-right: var(--c-
|
|
10
|
-
--c-tree-select-popup-padding-vertical: var(--c-
|
|
7
|
+
--c-tree-select-option-radius: var(--c-select-popup-option-border-radius);
|
|
8
|
+
--c-tree-select-popup-padding-left: var(--c-select-popup-padding-horizontal);
|
|
9
|
+
--c-tree-select-popup-padding-right: var(--c-select-popup-padding-horizontal);
|
|
10
|
+
--c-tree-select-popup-padding-vertical: var(--c-select-popup-padding-vertical);
|
|
11
11
|
--c-tree-select-highlight-font-weight: var(--c-font-weight-500);
|
|
12
12
|
}
|
|
13
13
|
.c-tree-select-popup {
|
|
14
|
+
--c-tree-title-text-color-active: var(--c-select-popup-option-text-color-selected);
|
|
14
15
|
box-sizing: border-box;
|
|
15
16
|
padding: var(--c-tree-select-popup-padding-vertical) 0;
|
|
16
17
|
background-color: var(--c-color-bg-popup);
|
|
@@ -26,7 +27,31 @@
|
|
|
26
27
|
overflow: auto;
|
|
27
28
|
}
|
|
28
29
|
.c-tree-select-popup .c-tree-node {
|
|
29
|
-
|
|
30
|
+
isolation: isolate;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
min-height: var(--c-select-popup-option-height);
|
|
33
|
+
padding-inline: var(--c-select-popup-option-padding-horizontal);
|
|
34
|
+
border-bottom: 0;
|
|
35
|
+
border-radius: var(--c-tree-select-option-radius);
|
|
36
|
+
}
|
|
37
|
+
.c-tree-select-popup .c-tree-node-title,
|
|
38
|
+
.c-tree-select-popup .c-tree-node-selected .c-tree-node-title {
|
|
39
|
+
position: static;
|
|
40
|
+
min-width: 0;
|
|
41
|
+
min-height: inherit;
|
|
42
|
+
margin: 0;
|
|
43
|
+
padding: 0;
|
|
44
|
+
background: transparent;
|
|
45
|
+
}
|
|
46
|
+
.c-tree-select-popup .c-tree-node-title-text {
|
|
47
|
+
flex: 1;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
}
|
|
50
|
+
.c-tree-select-popup .c-tree-node:hover .c-tree-select-option:not(.c-tree-select-option-selected):not(.c-tree-select-option-disabled)::before {
|
|
51
|
+
background: var(--c-tree-select-option-active-background);
|
|
52
|
+
}
|
|
53
|
+
.c-tree-select-popup .c-tree-node:hover .c-tree-select-option-selected:not(.c-tree-select-option-disabled)::before {
|
|
54
|
+
background: var(--c-select-popup-option-bg-selected-hover);
|
|
30
55
|
}
|
|
31
56
|
.c-tree-select-highlight {
|
|
32
57
|
font-weight: var(--c-tree-select-highlight-font-weight);
|
|
@@ -45,8 +70,25 @@
|
|
|
45
70
|
}
|
|
46
71
|
.c-tree-select-option {
|
|
47
72
|
display: block;
|
|
73
|
+
overflow-wrap: anywhere;
|
|
48
74
|
}
|
|
49
|
-
.c-tree-select-option
|
|
50
|
-
|
|
75
|
+
.c-tree-select-option::before {
|
|
76
|
+
content: '';
|
|
77
|
+
position: absolute;
|
|
78
|
+
inset: 0;
|
|
79
|
+
z-index: -1;
|
|
51
80
|
border-radius: var(--c-tree-select-option-radius);
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
}
|
|
83
|
+
.c-tree-select-option-active:not(.c-tree-select-option-selected):not(.c-tree-select-option-disabled)::before {
|
|
84
|
+
background: var(--c-tree-select-option-active-background);
|
|
85
|
+
}
|
|
86
|
+
.c-tree-select-option-selected:not(.c-tree-select-option-disabled) {
|
|
87
|
+
color: var(--c-select-popup-option-text-color-selected);
|
|
88
|
+
}
|
|
89
|
+
.c-tree-select-option-selected:not(.c-tree-select-option-disabled)::before {
|
|
90
|
+
background: var(--c-select-popup-option-bg-selected);
|
|
91
|
+
}
|
|
92
|
+
.c-tree-select-option-active.c-tree-select-option-selected:not(.c-tree-select-option-disabled)::before {
|
|
93
|
+
background: var(--c-select-popup-option-bg-selected-hover);
|
|
52
94
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, provide,
|
|
1
|
+
import { inject, provide, watch, onMounted, onActivated, onDeactivated, onBeforeUnmount, nextTick } from "vue";
|
|
2
2
|
import { bindTriggerEvents } from "./reference.mjs";
|
|
3
3
|
import { isTriggerReferenceClickBlocked } from "./reference-click.mjs";
|
|
4
4
|
const interactionKey = Symbol("trigger-interaction");
|
|
@@ -7,19 +7,19 @@ const shadowHostNames = /* @__PURE__ */ new Set(["article", "aside", "blockquote
|
|
|
7
7
|
function mayHideShadow(element) {
|
|
8
8
|
return !element.shadowRoot && (element.localName.includes("-") || shadowHostNames.has(element.localName));
|
|
9
9
|
}
|
|
10
|
-
function documentChain(start) {
|
|
10
|
+
function documentChain(start, allowPartial = false) {
|
|
11
11
|
const documents = [start], frames = [];
|
|
12
12
|
let current = start;
|
|
13
13
|
try {
|
|
14
14
|
while (current.defaultView && current.defaultView.parent !== current.defaultView) {
|
|
15
15
|
const frame = current.defaultView.frameElement;
|
|
16
|
-
if (!frame) return void 0;
|
|
16
|
+
if (!frame) return allowPartial ? { documents, frames } : void 0;
|
|
17
17
|
frames.push(frame);
|
|
18
18
|
current = frame.ownerDocument;
|
|
19
19
|
documents.push(current);
|
|
20
20
|
}
|
|
21
21
|
} catch {
|
|
22
|
-
return void 0;
|
|
22
|
+
return allowPartial ? { documents, frames } : void 0;
|
|
23
23
|
}
|
|
24
24
|
return { documents, frames };
|
|
25
25
|
}
|
|
@@ -28,7 +28,7 @@ function canRestore(owner, destination, anchor, focused) {
|
|
|
28
28
|
const current = owner.activeElement;
|
|
29
29
|
return (!current || current === owner.body || current === owner.documentElement || current === anchor) && (current !== anchor || deepestActive(anchor) === focused);
|
|
30
30
|
}
|
|
31
|
-
const from = documentChain(owner), to = documentChain(destination);
|
|
31
|
+
const from = documentChain(owner, true), to = documentChain(destination, true);
|
|
32
32
|
if (!from || !to) return false;
|
|
33
33
|
const common = from.documents.find((doc) => to.documents.includes(doc));
|
|
34
34
|
if (!common || !common.hasFocus()) return false;
|
|
@@ -77,8 +77,8 @@ function usePopupMoveFocus(target, inline, popup, visible) {
|
|
|
77
77
|
return (event) => {
|
|
78
78
|
if (!moving || moving !== event.target || event.relatedTarget) return false;
|
|
79
79
|
const owner = moving.ownerDocument;
|
|
80
|
-
const chain = documentChain(owner);
|
|
81
|
-
if (!chain) return false;
|
|
80
|
+
const chain = documentChain(owner, true);
|
|
81
|
+
if (!chain || !chain.documents[chain.documents.length - 1].hasFocus()) return false;
|
|
82
82
|
return chain.documents.every((doc) => {
|
|
83
83
|
const current = doc.activeElement;
|
|
84
84
|
return !current || current === doc.body || current === doc.documentElement || current === moving || chain.frames.includes(current);
|
package/es/trigger/position.mjs
CHANGED
|
@@ -87,12 +87,21 @@ function getScrollElements(element) {
|
|
|
87
87
|
const visited = /* @__PURE__ */ new Set();
|
|
88
88
|
while (root && !visited.has(root.ownerDocument)) {
|
|
89
89
|
visited.add(root.ownerDocument);
|
|
90
|
-
|
|
90
|
+
const parent = (node) => {
|
|
91
|
+
if (node.assignedSlot) return node.assignedSlot;
|
|
92
|
+
if (node.parentElement) return node.parentElement;
|
|
93
|
+
const tree = node.getRootNode();
|
|
94
|
+
return tree.nodeType === 11 && "host" in tree ? tree.host : null;
|
|
95
|
+
};
|
|
96
|
+
let current = parent(root);
|
|
97
|
+
const ancestors = /* @__PURE__ */ new Set();
|
|
91
98
|
while (current && current !== current.ownerDocument.documentElement) {
|
|
99
|
+
if (ancestors.has(current)) break;
|
|
100
|
+
ancestors.add(current);
|
|
92
101
|
const style = current.ownerDocument.defaultView?.getComputedStyle(current);
|
|
93
102
|
const overflow = `${style?.overflow ?? ""}${style?.overflowX ?? ""}${style?.overflowY ?? ""}`;
|
|
94
103
|
if (/(auto|scroll|overlay)/.test(overflow)) result.push(current);
|
|
95
|
-
current = current
|
|
104
|
+
current = parent(current);
|
|
96
105
|
}
|
|
97
106
|
try {
|
|
98
107
|
root = root.ownerDocument.defaultView?.frameElement ?? void 0;
|
|
@@ -102,6 +111,34 @@ function getScrollElements(element) {
|
|
|
102
111
|
}
|
|
103
112
|
return result;
|
|
104
113
|
}
|
|
114
|
+
function getSlotChangeRoots(element) {
|
|
115
|
+
const roots = [];
|
|
116
|
+
const visited = /* @__PURE__ */ new Set();
|
|
117
|
+
let current = element;
|
|
118
|
+
while (current && !visited.has(current)) {
|
|
119
|
+
visited.add(current);
|
|
120
|
+
const parentShadow = current.parentElement?.shadowRoot;
|
|
121
|
+
if (parentShadow) roots.push(parentShadow);
|
|
122
|
+
if (current.assignedSlot) {
|
|
123
|
+
current = current.assignedSlot;
|
|
124
|
+
} else if (current.parentElement) {
|
|
125
|
+
current = current.parentElement;
|
|
126
|
+
} else {
|
|
127
|
+
const tree = current.getRootNode();
|
|
128
|
+
if (tree.nodeType === 11 && "host" in tree) {
|
|
129
|
+
roots.push(tree);
|
|
130
|
+
current = tree.host;
|
|
131
|
+
} else {
|
|
132
|
+
try {
|
|
133
|
+
current = current.ownerDocument.defaultView?.frameElement;
|
|
134
|
+
} catch {
|
|
135
|
+
current = void 0;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return roots;
|
|
141
|
+
}
|
|
105
142
|
function getScrollViews(element) {
|
|
106
143
|
const result = [];
|
|
107
144
|
let document = element?.ownerDocument;
|
|
@@ -121,5 +158,6 @@ function getScrollViews(element) {
|
|
|
121
158
|
export {
|
|
122
159
|
calculatePopupPosition,
|
|
123
160
|
getScrollElements,
|
|
124
|
-
getScrollViews
|
|
161
|
+
getScrollViews,
|
|
162
|
+
getSlotChangeRoots
|
|
125
163
|
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { ref, watch, nextTick, onMounted, onActivated, onDeactivated, onBeforeUnmount } from "vue";
|
|
2
2
|
import { getArrowStyle } from "./arrow.mjs";
|
|
3
3
|
import { getPositioningSpace, translateRectBetweenDocuments, getRelativeRect, getTransformOrigin } from "./geometry.mjs";
|
|
4
|
-
import { getScrollElements, getScrollViews, calculatePopupPosition } from "./position.mjs";
|
|
4
|
+
import { getSlotChangeRoots, getScrollElements, getScrollViews, calculatePopupPosition } from "./position.mjs";
|
|
5
5
|
import { useElementResize } from "../_utils/resize-observer.mjs";
|
|
6
6
|
function rafThrottle(callback, ownerView) {
|
|
7
7
|
let frame;
|
|
8
8
|
let frameView;
|
|
9
9
|
let latest;
|
|
10
|
+
let latestTarget;
|
|
10
11
|
let generation = 0;
|
|
11
12
|
const run = (event) => {
|
|
12
13
|
latest = event;
|
|
14
|
+
latestTarget = event?.currentTarget ?? event?.target;
|
|
13
15
|
if (frame !== void 0) {
|
|
14
16
|
return;
|
|
15
17
|
}
|
|
@@ -27,8 +29,10 @@ function rafThrottle(callback, ownerView) {
|
|
|
27
29
|
frame = void 0;
|
|
28
30
|
frameView = void 0;
|
|
29
31
|
const currentEvent = latest;
|
|
32
|
+
const currentTarget = latestTarget;
|
|
30
33
|
latest = void 0;
|
|
31
|
-
|
|
34
|
+
latestTarget = void 0;
|
|
35
|
+
callback(currentEvent, currentTarget);
|
|
32
36
|
});
|
|
33
37
|
};
|
|
34
38
|
run.cancel = () => {
|
|
@@ -39,6 +43,7 @@ function rafThrottle(callback, ownerView) {
|
|
|
39
43
|
frame = void 0;
|
|
40
44
|
frameView = void 0;
|
|
41
45
|
latest = void 0;
|
|
46
|
+
latestTarget = void 0;
|
|
42
47
|
};
|
|
43
48
|
return run;
|
|
44
49
|
}
|
|
@@ -54,6 +59,7 @@ function useTriggerPositioner(options, context) {
|
|
|
54
59
|
let scrollPositions = /* @__PURE__ */ new WeakMap();
|
|
55
60
|
let windowPositions = /* @__PURE__ */ new WeakMap();
|
|
56
61
|
let scrollViews = [];
|
|
62
|
+
let slotRoots = [];
|
|
57
63
|
function update() {
|
|
58
64
|
const reference = context.reference.value;
|
|
59
65
|
const popup = context.popup.value;
|
|
@@ -142,10 +148,10 @@ function useTriggerPositioner(options, context) {
|
|
|
142
148
|
}
|
|
143
149
|
}
|
|
144
150
|
const scrolling = rafThrottle(
|
|
145
|
-
(
|
|
151
|
+
(_event, eventTarget) => {
|
|
146
152
|
const shouldClose = options.scrollToClose || context.globalScrollToClose.value;
|
|
147
|
-
if (shouldClose &&
|
|
148
|
-
const target =
|
|
153
|
+
if (shouldClose && eventTarget) {
|
|
154
|
+
const target = eventTarget;
|
|
149
155
|
const previous = scrollPositions.get(target) ?? [
|
|
150
156
|
target.scrollTop,
|
|
151
157
|
target.scrollLeft
|
|
@@ -190,11 +196,26 @@ function useTriggerPositioner(options, context) {
|
|
|
190
196
|
for (const element of scrollElements)
|
|
191
197
|
element.removeEventListener("scroll", scrolling);
|
|
192
198
|
for (const view of scrollViews) view.removeEventListener("scroll", onWindowScroll);
|
|
199
|
+
for (const slot of slotRoots) slot.removeEventListener("slotchange", onSlotChange);
|
|
200
|
+
slotRoots = [];
|
|
193
201
|
scrollViews = [];
|
|
194
202
|
scrollElements = [];
|
|
195
203
|
scrollPositions = /* @__PURE__ */ new WeakMap();
|
|
196
204
|
windowPositions = /* @__PURE__ */ new WeakMap();
|
|
197
205
|
}
|
|
206
|
+
function onSlotChange() {
|
|
207
|
+
positionGeneration++;
|
|
208
|
+
const reference = context.reference.value;
|
|
209
|
+
const popup = context.popup.value;
|
|
210
|
+
const nextElements = [.../* @__PURE__ */ new Set([...getScrollElements(reference), ...getScrollElements(popup)])];
|
|
211
|
+
const nextViews = [.../* @__PURE__ */ new Set([...getScrollViews(reference), ...getScrollViews(popup)])];
|
|
212
|
+
const nextRoots = [.../* @__PURE__ */ new Set([...getSlotChangeRoots(reference), ...getSlotChangeRoots(popup)])];
|
|
213
|
+
function changed(before, after) {
|
|
214
|
+
return before.length !== after.length || before.some((item, index) => item !== after[index]);
|
|
215
|
+
}
|
|
216
|
+
if (changed(scrollElements, nextElements) || changed(scrollViews, nextViews) || changed(slotRoots, nextRoots)) bindScroll();
|
|
217
|
+
nextTick(update);
|
|
218
|
+
}
|
|
198
219
|
function bindScroll() {
|
|
199
220
|
unbindScroll();
|
|
200
221
|
const reference = context.reference.value;
|
|
@@ -202,6 +223,8 @@ function useTriggerPositioner(options, context) {
|
|
|
202
223
|
const active = options.updateAtScroll || options.scrollToClose || context.globalUpdateAtScroll.value || context.globalScrollToClose.value;
|
|
203
224
|
if (!active || !reference || !popup || !context.visible.value || suspended)
|
|
204
225
|
return;
|
|
226
|
+
slotRoots = [.../* @__PURE__ */ new Set([...getSlotChangeRoots(reference), ...getSlotChangeRoots(popup)])];
|
|
227
|
+
for (const slot of slotRoots) slot.addEventListener("slotchange", onSlotChange);
|
|
205
228
|
scrollElements = [
|
|
206
229
|
.../* @__PURE__ */ new Set([
|
|
207
230
|
...getScrollElements(reference),
|