@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
|
@@ -6,6 +6,7 @@ const withFieldPresentation = require("../_components/field-presentation/with-fi
|
|
|
6
6
|
const SelectionEditor_vue_vue_type_script_setup_true_lang = require("../_components/selected-options/SelectionEditor.vue.js");
|
|
7
7
|
const autoComplete = require("./auto-complete.js");
|
|
8
8
|
const _AutoComplete = withFieldPresentation.withFieldPresentation(autoComplete.default, {
|
|
9
|
+
selectionConfirmation: "select",
|
|
9
10
|
methods: ["focus", "blur", "refresh"],
|
|
10
11
|
defaultPresentation: context.defaultSelectionPresentation,
|
|
11
12
|
intent: "input",
|
|
@@ -7,6 +7,8 @@ const emptyValue = require("../_utils/empty-value.js");
|
|
|
7
7
|
const popupContainer = require("../_utils/popup-container.js");
|
|
8
8
|
const autoCompleteProps = {
|
|
9
9
|
...props$2.fieldLoadingProps,
|
|
10
|
+
/** 弹出编辑是否需要确认;默认选中候选项即提交,自定义文本通过确认提交。 */
|
|
11
|
+
needConfirm: { type: Boolean, default: void 0 },
|
|
10
12
|
searchDelay: { type: Number, default: 250 },
|
|
11
13
|
/** 清空动作产生的模型值;省略保留原默认值。 */
|
|
12
14
|
...props$1.fieldPresentationProps,
|
|
@@ -54,11 +54,16 @@
|
|
|
54
54
|
color: var(--c-auto-complete-option-text-color-selected);
|
|
55
55
|
background-color: var(--c-auto-complete-option-bg-selected);
|
|
56
56
|
}
|
|
57
|
-
.c-select-dropdown:where(.c-auto-complete__dropdown) .c-select-option-active,
|
|
58
|
-
.c-select-dropdown:where(.c-auto-complete__dropdown) .c-select-option:not(.c-select-
|
|
57
|
+
.c-select-dropdown:where(.c-auto-complete__dropdown) .c-select-option-active:not(.c-select-option-selected):not(.c-select-option-disabled),
|
|
58
|
+
.c-select-dropdown:where(.c-auto-complete__dropdown) .c-select-option:not(.c-select-option-selected):not(.c-select-option-disabled):hover {
|
|
59
59
|
color: var(--c-auto-complete-option-text-color-hover);
|
|
60
60
|
background-color: var(--c-auto-complete-option-bg-hover);
|
|
61
61
|
}
|
|
62
|
+
.c-select-dropdown:where(.c-auto-complete__dropdown) .c-select-option-selected.c-select-option-active:not(.c-select-option-disabled),
|
|
63
|
+
.c-select-dropdown:where(.c-auto-complete__dropdown) .c-select-option-selected:not(.c-select-option-disabled):hover {
|
|
64
|
+
color: var(--c-auto-complete-option-text-color-selected);
|
|
65
|
+
background-color: var(--c-auto-complete-option-bg-hover);
|
|
66
|
+
}
|
|
62
67
|
.c-select-dropdown:where(.c-auto-complete__dropdown) .c-select-option-disabled {
|
|
63
68
|
color: var(--c-auto-complete-option-text-color-disabled);
|
|
64
69
|
background-color: var(--c-auto-complete-option-bg-disabled);
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
--c-back-top-background: var(--c-sys-color-surface-raised);
|
|
13
13
|
--c-back-top-text-color: var(--c-sys-color-content-brand);
|
|
14
14
|
--c-back-top-hover-background: var(--c-sys-color-state-hover);
|
|
15
|
-
--c-back-top-focus-color: var(--c-sys-color-
|
|
15
|
+
--c-back-top-focus-color: var(--c-sys-color-action-primary);
|
|
16
16
|
--c-back-top-focus-width: 2px;
|
|
17
17
|
--c-back-top-focus-offset: 2px;
|
|
18
18
|
--c-back-top-z-index: var(--c-z-index-local-sticky);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const components = require("../_utils/maple/components.js");
|
|
4
|
+
const Button_vue_vue_type_script_setup_true_lang = require("./Button.vue.js");
|
|
5
|
+
const Button = components.withPropsDefaultsSetter(Button_vue_vue_type_script_setup_true_lang.default, Button_vue_vue_type_script_setup_true_lang.default.props);
|
|
6
|
+
exports.default = Button;
|
package/lib/button/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const globalConfig = require("../_utils/global-config.js");
|
|
4
|
-
const
|
|
4
|
+
const base = require("./base.js");
|
|
5
5
|
const ButtonGroup_vue_vue_type_script_setup_true_lang = require("./ButtonGroup.vue.js");
|
|
6
6
|
const props = require("./props.js");
|
|
7
7
|
const groupProps = require("./group-props.js");
|
|
8
8
|
const Button = globalConfig.withInstall(
|
|
9
|
-
|
|
10
|
-
Object.assign(
|
|
9
|
+
base.default,
|
|
10
|
+
Object.assign(base.default, {
|
|
11
11
|
Group: ButtonGroup_vue_vue_type_script_setup_true_lang.default
|
|
12
12
|
}),
|
|
13
|
-
{ components: [
|
|
13
|
+
{ components: [base.default, ButtonGroup_vue_vue_type_script_setup_true_lang.default] }
|
|
14
14
|
);
|
|
15
15
|
const _ButtonComponent = Button;
|
|
16
16
|
const _ButtonGroupComponent = ButtonGroup_vue_vue_type_script_setup_true_lang.default;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
--c-button-disabled-color: var(--c-color-fill-2);
|
|
16
16
|
--c-button-disabled-solid-text-color: var(--c-sys-color-content-on-dark);
|
|
17
17
|
--c-button-disabled-text-color: var(--c-sys-color-content-disabled);
|
|
18
|
-
--c-button-focus-color: var(--c-sys-color-
|
|
18
|
+
--c-button-focus-color: var(--c-sys-color-action-primary);
|
|
19
19
|
--c-button-info-color: var(--c-sys-color-status-info);
|
|
20
20
|
--c-button-info-disabled-color: rgb(var(--c-blue-3));
|
|
21
21
|
--c-button-info-foreground-color: var(--c-sys-color-content-info);
|
package/lib/card/Card.vue.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const iconsVue = require("@cedar-design/icons-vue");
|
|
5
5
|
const sharedVue = require("@cedar-design/shared-vue");
|
|
6
|
-
const
|
|
6
|
+
const base = require("../button/base.js");
|
|
7
7
|
const lock = require("../context/lock.js");
|
|
8
8
|
const zIndex = require("../context/zIndex.js");
|
|
9
9
|
const icon_index = require("../icon/index.js");
|
|
@@ -62,25 +62,25 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
62
62
|
let stopInactiveFocusTracking;
|
|
63
63
|
function trackInactiveFocus() {
|
|
64
64
|
stopInactiveFocusTracking?.();
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
65
|
+
const document2 = card.value?.ownerDocument;
|
|
66
|
+
if (!document2) return;
|
|
67
67
|
const remember = (target) => {
|
|
68
68
|
const element = target;
|
|
69
|
-
if (element && typeof element.focus === "function" && !card.value?.contains(element) && element !==
|
|
69
|
+
if (element && typeof element.focus === "function" && !card.value?.contains(element) && element !== document2.body && element !== document2.documentElement) {
|
|
70
70
|
returnFocus = element;
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
|
-
remember(
|
|
73
|
+
remember(document2.activeElement);
|
|
74
74
|
const onFocus = (event) => remember(event.target);
|
|
75
|
-
|
|
76
|
-
stopInactiveFocusTracking = () =>
|
|
75
|
+
document2.addEventListener("focusin", onFocus, true);
|
|
76
|
+
stopInactiveFocusTracking = () => document2.removeEventListener("focusin", onFocus, true);
|
|
77
77
|
}
|
|
78
78
|
function updateReturnFocus(open) {
|
|
79
|
-
const
|
|
80
|
-
if (!
|
|
81
|
-
const focused =
|
|
79
|
+
const document2 = card.value?.ownerDocument;
|
|
80
|
+
if (!document2) return;
|
|
81
|
+
const focused = document2.activeElement;
|
|
82
82
|
if (open) {
|
|
83
|
-
returnFocus = focused && focused !==
|
|
83
|
+
returnFocus = focused && focused !== document2.body && focused !== document2.documentElement ? focused : null;
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
const target = returnFocus;
|
|
@@ -94,6 +94,29 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
94
94
|
const { onStackTop } = popupLayer.usePopupLayer(wantsFloating, zIndex$1, () => card.value?.ownerDocument, true);
|
|
95
95
|
const available = () => active && !disposed;
|
|
96
96
|
let openingWaiting = false;
|
|
97
|
+
let cancelOpeningFrames;
|
|
98
|
+
function waitForOwnerFrames(view) {
|
|
99
|
+
cancelOpeningFrames?.();
|
|
100
|
+
return new Promise((resolve) => {
|
|
101
|
+
let handle;
|
|
102
|
+
let settled = false;
|
|
103
|
+
const finish = (completed) => {
|
|
104
|
+
if (settled) return;
|
|
105
|
+
settled = true;
|
|
106
|
+
if (cancelOpeningFrames === cancel) cancelOpeningFrames = void 0;
|
|
107
|
+
resolve(completed);
|
|
108
|
+
};
|
|
109
|
+
const cancel = () => {
|
|
110
|
+
if (handle !== void 0) view.cancelAnimationFrame?.(handle);
|
|
111
|
+
finish(false);
|
|
112
|
+
};
|
|
113
|
+
cancelOpeningFrames = cancel;
|
|
114
|
+
handle = view.requestAnimationFrame(() => {
|
|
115
|
+
if (settled) return;
|
|
116
|
+
handle = view.requestAnimationFrame(() => finish(true));
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
}
|
|
97
120
|
let reducedMotion = false;
|
|
98
121
|
let stopMotionTracking;
|
|
99
122
|
function trackMotion(element) {
|
|
@@ -129,6 +152,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
129
152
|
wantsFloating,
|
|
130
153
|
(value) => {
|
|
131
154
|
const token = ++generation;
|
|
155
|
+
cancelOpeningFrames?.();
|
|
132
156
|
if (!active) {
|
|
133
157
|
if (!disposed && value) trackInactiveFocus();
|
|
134
158
|
else {
|
|
@@ -159,6 +183,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
159
183
|
return;
|
|
160
184
|
}
|
|
161
185
|
const token = ++generation;
|
|
186
|
+
cancelOpeningFrames?.();
|
|
162
187
|
const element = card.value;
|
|
163
188
|
let consumed = false;
|
|
164
189
|
clearTimeout(floater.value ?? void 0);
|
|
@@ -185,7 +210,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
185
210
|
dropdownFloaterTop = floaterTop.value;
|
|
186
211
|
dropdownFloaterLeft = floaterLeft.value;
|
|
187
212
|
showFloatingButtons.value = true;
|
|
188
|
-
if (!reducedMotion)
|
|
213
|
+
if (!reducedMotion) {
|
|
214
|
+
const view = element.ownerDocument.defaultView;
|
|
215
|
+
if (view && typeof document !== "undefined" && element.ownerDocument !== document && typeof view.requestAnimationFrame === "function") {
|
|
216
|
+
if (!await waitForOwnerFrames(view)) return;
|
|
217
|
+
} else {
|
|
218
|
+
await sharedVue.doubleRaf();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
189
221
|
if (!current(token, element) || !wantsFloating()) {
|
|
190
222
|
return;
|
|
191
223
|
}
|
|
@@ -207,6 +239,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
207
239
|
return;
|
|
208
240
|
}
|
|
209
241
|
const token = ++generation;
|
|
242
|
+
cancelOpeningFrames?.();
|
|
210
243
|
const element = card.value;
|
|
211
244
|
let consumed = false;
|
|
212
245
|
clearTimeout(dropper);
|
|
@@ -295,6 +328,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
295
328
|
}
|
|
296
329
|
});
|
|
297
330
|
function cleanup() {
|
|
331
|
+
cancelOpeningFrames?.();
|
|
298
332
|
openingWaiting = false;
|
|
299
333
|
active = false;
|
|
300
334
|
generation++;
|
|
@@ -440,7 +474,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
440
474
|
})
|
|
441
475
|
}, [
|
|
442
476
|
vue.renderSlot(_ctx.$slots, "close-button", {}, () => [
|
|
443
|
-
vue.createVNode(vue.unref(
|
|
477
|
+
vue.createVNode(vue.unref(base.default), {
|
|
444
478
|
"data-card-cover": "",
|
|
445
479
|
class: vue.normalizeClass(vue.unref(classes)(vue.unref(n)("close-button"), vue.unref(n)("$-elevation--6"))),
|
|
446
480
|
"aria-label": props2.closeButtonAriaLabel ?? vue.unref(closeLabel),
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
--c-carousel-card-opacity: 0.6;
|
|
29
29
|
--c-carousel-focus-width: 2px;
|
|
30
30
|
--c-carousel-focus-offset: 2px;
|
|
31
|
-
--c-carousel-focus-color: var(--c-sys-color-
|
|
31
|
+
--c-carousel-focus-color: var(--c-sys-color-action-primary);
|
|
32
32
|
}
|
|
33
33
|
.c-carousel {
|
|
34
34
|
position: relative;
|
|
@@ -6,7 +6,7 @@ const formBridge = require("../_components/field-presentation/form-bridge.js");
|
|
|
6
6
|
const errorDescription = require("../form/error-description.js");
|
|
7
7
|
const context = require("../_components/selected-options/context.js");
|
|
8
8
|
const SelectedOptions_vue_vue_type_script_setup_true_lang = require("../_components/selected-options/SelectedOptions.vue.js");
|
|
9
|
-
const
|
|
9
|
+
const base = require("../input/base.js");
|
|
10
10
|
const globalConfig = require("../_utils/global-config.js");
|
|
11
11
|
const baseCascaderPanel = require("./base-cascader-panel.js");
|
|
12
12
|
const cascaderSearchPanel = require("./cascader-search-panel.js");
|
|
@@ -46,7 +46,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
46
46
|
onClear: __props.controller.clearSelection
|
|
47
47
|
}, {
|
|
48
48
|
default: vue.withCtx(() => [
|
|
49
|
-
__props.searchable ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
49
|
+
__props.searchable ? (vue.openBlock(), vue.createBlock(vue.unref(base.default), {
|
|
50
50
|
key: 0,
|
|
51
51
|
"model-value": __props.controller.computedInputValue,
|
|
52
52
|
"edit-mode": "direct",
|
|
@@ -4,10 +4,12 @@ const vue = require("vue");
|
|
|
4
4
|
const iconsVue = require("@cedar-design/icons-vue");
|
|
5
5
|
const formBridge = require("../_components/field-presentation/form-bridge.js");
|
|
6
6
|
const is = require("../_utils/is.js");
|
|
7
|
-
const
|
|
7
|
+
const base = require("../checkbox/base.js");
|
|
8
8
|
const globalConfig = require("../_utils/global-config.js");
|
|
9
9
|
const context = require("./context.js");
|
|
10
10
|
const utils = require("./utils.js");
|
|
11
|
+
const INTERACTIVE_ROLES = /* @__PURE__ */ new Set(["button", "link", "checkbox", "radio", "switch", "textbox", "combobox", "menuitem", "menuitemcheckbox", "menuitemradio", "option", "treeitem", "gridcell", "slider", "spinbutton", "tab"]);
|
|
12
|
+
const CONCRETE_ROLES = new Set("alert alertdialog application article banner blockquote button caption cell checkbox code columnheader combobox comment complementary contentinfo definition deletion directory document emphasis feed figure form generic grid gridcell group heading image img insertion link list listbox listitem log main mark marquee math menu menubar menuitem menuitemcheckbox menuitemradio meter navigation none note option paragraph presentation progressbar radio radiogroup region row rowgroup rowheader scrollbar search searchbox sectionfooter sectionheader separator slider spinbutton status strong suggestion subscript superscript switch tab table tablist tabpanel term textbox time timer toolbar tooltip tree treegrid treeitem doc-abstract doc-acknowledgments doc-afterword doc-appendix doc-backlink doc-biblioentry doc-bibliography doc-biblioref doc-chapter doc-colophon doc-conclusion doc-cover doc-credit doc-credits doc-dedication doc-endnote doc-endnotes doc-epigraph doc-epilogue doc-errata doc-example doc-footnote doc-foreword doc-glossary doc-glossref doc-index doc-introduction doc-noteref doc-notice doc-pagebreak doc-pagefooter doc-pageheader doc-pagelist doc-part doc-preface doc-prologue doc-pullquote doc-qna doc-subtitle doc-tip doc-toc graphics-document graphics-object graphics-symbol".split(" "));
|
|
11
13
|
function ownsOptionClick(event) {
|
|
12
14
|
if (event.defaultPrevented) return false;
|
|
13
15
|
const boundary = event.currentTarget;
|
|
@@ -25,7 +27,10 @@ function ownsOptionClick(event) {
|
|
|
25
27
|
if (item === boundary) break;
|
|
26
28
|
const element = item;
|
|
27
29
|
if (element?.nodeType !== 1 || typeof element.matches !== "function") continue;
|
|
28
|
-
|
|
30
|
+
const primaryRole = element.getAttribute("role")?.trim().split(/\s+/).find((role) => CONCRETE_ROLES.has(role));
|
|
31
|
+
if (primaryRole && INTERACTIVE_ROLES.has(primaryRole)) return false;
|
|
32
|
+
if (element.hasAttribute("tabindex") && element.tabIndex >= 0) return false;
|
|
33
|
+
if (element.matches('li[data-cascader-key], button, a[href], input, select, textarea, summary, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"])')) return false;
|
|
29
34
|
if (element.matches("label") && (element.htmlFor || element.querySelector("input, button, select, textarea"))) return false;
|
|
30
35
|
}
|
|
31
36
|
return true;
|
|
@@ -90,7 +95,9 @@ const CascaderOption = /* @__PURE__ */ vue.defineComponent({
|
|
|
90
95
|
},
|
|
91
96
|
onMouseleave: (event) => {
|
|
92
97
|
const element = event.currentTarget;
|
|
93
|
-
const
|
|
98
|
+
const nodeRoot = element.getRootNode();
|
|
99
|
+
const focusRoot = "activeElement" in nodeRoot ? nodeRoot : element.ownerDocument;
|
|
100
|
+
const focused = focusRoot.activeElement;
|
|
94
101
|
let focusedOption = focused?.closest("[data-cascader-key]");
|
|
95
102
|
const panelSelector = `.${globalConfig.getPrefixCls("cascader")}-panel, .${globalConfig.getPrefixCls("cascader")}-editor-panel`;
|
|
96
103
|
const panel = element.closest(panelSelector);
|
|
@@ -171,7 +178,7 @@ const CascaderOption = /* @__PURE__ */ vue.defineComponent({
|
|
|
171
178
|
}, events), [props.multiple && vue.createVNode("span", {
|
|
172
179
|
"class": `${prefixCls}-checkbox`,
|
|
173
180
|
"onClick": (event) => event.stopPropagation()
|
|
174
|
-
}, [vue.createVNode(
|
|
181
|
+
}, [vue.createVNode(base.default, {
|
|
175
182
|
"editMode": "direct",
|
|
176
183
|
"uninjectGroupContext": true,
|
|
177
184
|
"modelValue": Boolean(checkedStatus.value.checked),
|
|
@@ -183,9 +190,7 @@ const CascaderOption = /* @__PURE__ */ vue.defineComponent({
|
|
|
183
190
|
if (props.option.disabled || props.option.selectionDisabled) {
|
|
184
191
|
return;
|
|
185
192
|
}
|
|
186
|
-
const task = handlePathChange(new Event("change"));
|
|
187
193
|
cascaderCtx.onClickOption?.(props.option, Boolean(checked));
|
|
188
|
-
return task;
|
|
189
194
|
}
|
|
190
195
|
}, null)]), vue.createVNode("div", {
|
|
191
196
|
"class": `${prefixCls}-label`
|
|
@@ -4,6 +4,7 @@ const vue = require("vue");
|
|
|
4
4
|
const optionLabels = require("../_components/field-presentation/option-labels.js");
|
|
5
5
|
const CascaderEditor_vue_vue_type_script_setup_true_lang = require("./CascaderEditor.vue.js");
|
|
6
6
|
const cascaderFieldAdapter = {
|
|
7
|
+
selectionConfirmation: "update",
|
|
7
8
|
pauseSelectionWhileLoading: true,
|
|
8
9
|
methods: ["focus", "blur", "refresh"],
|
|
9
10
|
text: (value, props) => optionLabels.optionValueText(value, { ...props, showPathLabel: true }),
|
package/lib/cascader/props.js
CHANGED
|
@@ -9,6 +9,8 @@ const formControl = require("../_utils/form-control.js");
|
|
|
9
9
|
const popupContainer = require("../_utils/popup-container.js");
|
|
10
10
|
const cascaderProps = {
|
|
11
11
|
...props.fieldLoadingProps,
|
|
12
|
+
/** 弹出编辑是否需要确认;未设置时单选即提交,多选保留确认。 */
|
|
13
|
+
needConfirm: { type: Boolean, default: void 0 },
|
|
12
14
|
openTriggerTarget: openTrigger.openTriggerTargetProp,
|
|
13
15
|
/** 内置本地过滤是否区分大小写;自定义过滤函数优先。 */
|
|
14
16
|
caseSensitive: { type: Boolean, default: false },
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
--c-cascader-size-item-height: 36px;
|
|
12
12
|
--c-cascader-font-item-size: var(--c-sys-font-size-md);
|
|
13
13
|
--c-cascader-margin-item-icon-left: var(--c-sys-space-5);
|
|
14
|
-
--c-cascader-item-check-color: var(--c-sys-color-
|
|
14
|
+
--c-cascader-item-check-color: var(--c-sys-color-action-primary);
|
|
15
15
|
--c-cascader-item-check-size: var(--c-sys-font-size-md);
|
|
16
16
|
--c-cascader-item-text-color: var(--c-sys-color-content-primary);
|
|
17
17
|
--c-cascader-item-icon-color: var(--c-sys-color-content-secondary);
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
--c-cascader-padding-item-right: var(--c-sys-space-5);
|
|
20
20
|
--c-cascader-size-item-icon: 12px;
|
|
21
21
|
--c-cascader-item-text-color-hover: var(--c-cascader-item-text-color);
|
|
22
|
-
--c-cascader-item-text-color-active: var(--c-
|
|
22
|
+
--c-cascader-item-text-color-active: var(--c-sys-color-action-primary);
|
|
23
23
|
--c-cascader-item-text-color-disabled: var(--c-sys-color-content-disabled);
|
|
24
24
|
--c-cascader-item-text-color-disabled-active: var(--c-sys-color-content-disabled);
|
|
25
|
-
--c-cascader-item-bg-active:
|
|
26
|
-
--c-cascader-item-bg-hover: var(--c-
|
|
25
|
+
--c-cascader-item-bg-active: transparent;
|
|
26
|
+
--c-cascader-item-bg-hover: var(--c-color-fill-2);
|
|
27
27
|
--c-cascader-item-bg-disabled: transparent;
|
|
28
28
|
--c-cascader-item-bg-disabled-active: var(--c-color-fill-2);
|
|
29
29
|
--c-cascader-checkbox-bg-hover: var(--c-color-fill-3);
|
|
@@ -222,17 +222,44 @@
|
|
|
222
222
|
.c-cascader-search-option-disabled:hover .c-cascader-option-check {
|
|
223
223
|
color: var(--c-cascader-item-text-color-disabled);
|
|
224
224
|
}
|
|
225
|
-
.c-cascader-option-active
|
|
226
|
-
|
|
227
|
-
|
|
225
|
+
.c-cascader-option-active,
|
|
226
|
+
.c-cascader-search-option-active {
|
|
227
|
+
color: var(--c-cascader-item-text-color-hover);
|
|
228
|
+
background-color: var(--c-cascader-item-bg-hover);
|
|
228
229
|
transition: all var(--c-sys-motion-duration-standard) var(--c-sys-motion-easing-standard);
|
|
229
230
|
}
|
|
230
|
-
.c-cascader-option-
|
|
231
|
+
.c-cascader-option-selected,
|
|
232
|
+
.c-cascader-search-option-selected {
|
|
231
233
|
color: var(--c-cascader-item-text-color-active);
|
|
232
234
|
background-color: var(--c-cascader-item-bg-active);
|
|
233
235
|
}
|
|
236
|
+
.c-cascader-option-selected:hover,
|
|
237
|
+
.c-cascader-search-option-selected:hover,
|
|
238
|
+
.c-cascader-option-selected.c-cascader-option-active,
|
|
239
|
+
.c-cascader-search-option-selected.c-cascader-option-active,
|
|
240
|
+
.c-cascader-option-selected.c-cascader-search-option-active,
|
|
241
|
+
.c-cascader-search-option-selected.c-cascader-search-option-active,
|
|
242
|
+
.c-cascader-option-selected.c-cascader-search-option-hover,
|
|
243
|
+
.c-cascader-search-option-selected.c-cascader-search-option-hover {
|
|
244
|
+
color: var(--c-cascader-item-text-color-active);
|
|
245
|
+
background-color: var(--c-cascader-item-bg-hover);
|
|
246
|
+
}
|
|
234
247
|
.c-cascader-option-active.c-cascader-option-disabled,
|
|
235
|
-
.c-cascader-option-active.c-cascader-option-disabled
|
|
248
|
+
.c-cascader-option-active.c-cascader-search-option-disabled,
|
|
249
|
+
.c-cascader-search-option-active.c-cascader-option-disabled,
|
|
250
|
+
.c-cascader-search-option-active.c-cascader-search-option-disabled,
|
|
251
|
+
.c-cascader-option-active.c-cascader-option-disabled:hover,
|
|
252
|
+
.c-cascader-option-active.c-cascader-search-option-disabled:hover,
|
|
253
|
+
.c-cascader-search-option-active.c-cascader-option-disabled:hover,
|
|
254
|
+
.c-cascader-search-option-active.c-cascader-search-option-disabled:hover,
|
|
255
|
+
.c-cascader-option-selected.c-cascader-option-disabled,
|
|
256
|
+
.c-cascader-option-selected.c-cascader-search-option-disabled,
|
|
257
|
+
.c-cascader-search-option-selected.c-cascader-option-disabled,
|
|
258
|
+
.c-cascader-search-option-selected.c-cascader-search-option-disabled,
|
|
259
|
+
.c-cascader-option-selected.c-cascader-option-disabled:hover,
|
|
260
|
+
.c-cascader-option-selected.c-cascader-search-option-disabled:hover,
|
|
261
|
+
.c-cascader-search-option-selected.c-cascader-option-disabled:hover,
|
|
262
|
+
.c-cascader-search-option-selected.c-cascader-search-option-disabled:hover {
|
|
236
263
|
color: var(--c-cascader-item-text-color-disabled-active);
|
|
237
264
|
background-color: var(--c-cascader-item-bg-disabled-active);
|
|
238
265
|
}
|
|
@@ -8,9 +8,11 @@ function useCascaderFocus(activeKey) {
|
|
|
8
8
|
vue.onBeforeUnmount(() => cancelPendingFocus?.());
|
|
9
9
|
return (root, option, originPanel, panelSelector) => {
|
|
10
10
|
const key = activeKey.value;
|
|
11
|
-
if (!key || !root.contains(option) || root.ownerDocument.activeElement !== option) return;
|
|
12
|
-
cancelPendingFocus?.();
|
|
13
11
|
const document = root.ownerDocument;
|
|
12
|
+
const nodeRoot = root.getRootNode();
|
|
13
|
+
const focusRoot = "activeElement" in nodeRoot ? nodeRoot : document;
|
|
14
|
+
if (!key || !root.contains(option) || focusRoot.activeElement !== option) return;
|
|
15
|
+
cancelPendingFocus?.();
|
|
14
16
|
const view = document.defaultView;
|
|
15
17
|
if (!view) return;
|
|
16
18
|
let observer;
|
|
@@ -26,13 +28,14 @@ function useCascaderFocus(activeKey) {
|
|
|
26
28
|
if (cancelPendingFocus === cleanup) cancelPendingFocus = void 0;
|
|
27
29
|
};
|
|
28
30
|
const onFocus = (next) => {
|
|
29
|
-
if (next.target !== option) cleanup();
|
|
31
|
+
if (next.target !== option && !next.composedPath().includes(option)) cleanup();
|
|
30
32
|
};
|
|
31
33
|
const attempt = () => {
|
|
32
34
|
if (done) return;
|
|
33
|
-
const focused =
|
|
34
|
-
const
|
|
35
|
-
|
|
35
|
+
const focused = focusRoot.activeElement;
|
|
36
|
+
const docFocus = document.activeElement;
|
|
37
|
+
const lostToRemoval = !option.isConnected && (docFocus === document.body || docFocus === document.documentElement) && (focused === null || focused === document.body || focused === document.documentElement);
|
|
38
|
+
if (!root.isConnected || root.getRootNode() !== nodeRoot || activeKey.value !== key || focused !== option && !lostToRemoval) {
|
|
36
39
|
cleanup();
|
|
37
40
|
return;
|
|
38
41
|
}
|