@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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
function personIds(value) {
|
|
5
|
+
return Array.isArray(value) ? value : value == null ? [] : [value];
|
|
6
|
+
}
|
|
7
|
+
function useSelectedPeople(props, value, options) {
|
|
8
|
+
const cache = vue.shallowRef(/* @__PURE__ */ new Map());
|
|
9
|
+
vue.watch([options, value], () => {
|
|
10
|
+
const next = /* @__PURE__ */ new Map();
|
|
11
|
+
for (const id of personIds(value.value)) {
|
|
12
|
+
const person = options.value.find((option) => option.value === id) ?? cache.value.get(id);
|
|
13
|
+
if (person) next.set(id, person);
|
|
14
|
+
}
|
|
15
|
+
cache.value = next;
|
|
16
|
+
}, { immediate: true, flush: "sync" });
|
|
17
|
+
function resolve(id) {
|
|
18
|
+
const current = options.value.find((option) => option.value === id);
|
|
19
|
+
if (current) return current;
|
|
20
|
+
if (typeof props.fallbackOption === "function") return props.fallbackOption(id);
|
|
21
|
+
if (props.fallbackOption !== false) {
|
|
22
|
+
if (!props.multiple && props.label) return { ...cache.value.get(id), value: id, label: props.label };
|
|
23
|
+
const cached = cache.value.get(id);
|
|
24
|
+
if (cached) return cached;
|
|
25
|
+
}
|
|
26
|
+
return { value: id, label: props.fallbackOption === false ? props.defaultText ?? "-" : !props.multiple && props.label || id || (props.defaultText ?? "-") };
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
people: vue.computed(() => personIds(value.value).map(resolve)),
|
|
30
|
+
resolve
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function peopleText(value, props) {
|
|
34
|
+
return personIds(value).map((id) => {
|
|
35
|
+
const option = Array.isArray(props.options) ? props.options.find((person) => person.value === id) : void 0;
|
|
36
|
+
if (option) return option.label;
|
|
37
|
+
if (typeof props.fallbackOption === "function") return props.fallbackOption(id).label;
|
|
38
|
+
return !props.multiple && props.label || id || (props.defaultText ?? "-");
|
|
39
|
+
}).join(", ");
|
|
40
|
+
}
|
|
41
|
+
exports.peopleText = peopleText;
|
|
42
|
+
exports.personIds = personIds;
|
|
43
|
+
exports.useSelectedPeople = useSelectedPeople;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
--c-progress-font-size: var(--c-sys-font-size-sm);
|
|
7
7
|
--c-progress-text-color: var(--c-sys-color-content-secondary);
|
|
8
8
|
--c-progress-track-color: var(--c-sys-color-state-hover);
|
|
9
|
-
--c-progress-default-color: var(--c-sys-color-
|
|
10
|
-
--c-progress-primary-color: var(--c-sys-color-
|
|
9
|
+
--c-progress-default-color: var(--c-sys-color-action-primary);
|
|
10
|
+
--c-progress-primary-color: var(--c-sys-color-action-primary);
|
|
11
11
|
--c-progress-secondary-color: var(--c-sys-color-content-secondary);
|
|
12
12
|
--c-progress-tertiary-color: var(--c-sys-color-content-tertiary);
|
|
13
13
|
--c-progress-info-color: var(--c-sys-color-content-info);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
--c-radio-control-size: 14px;
|
|
8
8
|
--c-radio-control-color-disabled: var(--c-sys-color-content-disabled);
|
|
9
9
|
--c-radio-control-color-error: var(--c-sys-color-content-danger);
|
|
10
|
-
--c-radio-control-color-checked: var(--c-sys-color-
|
|
10
|
+
--c-radio-control-color-checked: var(--c-sys-color-action-primary);
|
|
11
11
|
--c-radio-action-padding: calc((var(--c-internal-radio-mask-height) / 2) - (var(--c-radio-control-size) / 2));
|
|
12
12
|
--c-radio-label-text-color: var(--c-sys-color-content-primary);
|
|
13
13
|
--c-radio-label-text-color-disabled: var(--c-sys-color-content-disabled);
|
package/lib/rate/style/index.css
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
--c-rate-disabled-color: var(--c-sys-color-content-disabled);
|
|
7
7
|
--c-rate-error-color: var(--c-sys-color-content-danger);
|
|
8
8
|
--c-rate-active-scale: 1.2;
|
|
9
|
-
--c-rate-focus-color: var(--c-sys-color-
|
|
9
|
+
--c-rate-focus-color: var(--c-sys-color-action-primary);
|
|
10
10
|
--c-rate-focus-width: 2px;
|
|
11
11
|
--c-rate-focus-offset: 2px;
|
|
12
12
|
--c-rate-size: var(--c-font-size-title-3);
|
package/lib/ripple/index.js
CHANGED
|
@@ -10,6 +10,12 @@ const waves = /* @__PURE__ */ new WeakMap();
|
|
|
10
10
|
function ownedRipples(element) {
|
|
11
11
|
return Array.from(element.children).filter((child) => waves.has(child));
|
|
12
12
|
}
|
|
13
|
+
function stopObserverIfIdle(element, state) {
|
|
14
|
+
if (!state.tasker && !ownedRipples(element).length) {
|
|
15
|
+
state.migrationObserver?.disconnect();
|
|
16
|
+
state.migrationObserver = void 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
13
19
|
function transitionTime(element, property) {
|
|
14
20
|
const style = element.ownerDocument.defaultView?.getComputedStyle(element);
|
|
15
21
|
if (!style) {
|
|
@@ -49,6 +55,8 @@ function clearTasks(element) {
|
|
|
49
55
|
if (!state) {
|
|
50
56
|
return;
|
|
51
57
|
}
|
|
58
|
+
state.migrationObserver?.disconnect();
|
|
59
|
+
state.migrationObserver = void 0;
|
|
52
60
|
state.timers.forEach((timer) => window.clearTimeout(timer));
|
|
53
61
|
state.timers.clear();
|
|
54
62
|
state.tasker = null;
|
|
@@ -106,18 +114,25 @@ function createRipple(event) {
|
|
|
106
114
|
if (!_ripple) {
|
|
107
115
|
return;
|
|
108
116
|
}
|
|
117
|
+
syncOwnerDocument(this);
|
|
109
118
|
_ripple.removeRipple();
|
|
110
119
|
if (_ripple.disabled || _ripple.tasker || !context_index.default.enableRipple) {
|
|
111
120
|
return;
|
|
112
121
|
}
|
|
122
|
+
watchOwnerDuringGesture(this, _ripple);
|
|
113
123
|
const task = () => {
|
|
114
124
|
const current = () => this._ripple === _ripple && !_ripple.disabled && context_index.default.enableRipple;
|
|
115
125
|
if (!current()) {
|
|
126
|
+
if (this._ripple === _ripple) {
|
|
127
|
+
_ripple.tasker = null;
|
|
128
|
+
stopObserverIfIdle(this, _ripple);
|
|
129
|
+
}
|
|
116
130
|
return;
|
|
117
131
|
}
|
|
118
132
|
_ripple.tasker = null;
|
|
119
133
|
const { x, y, centerX, centerY, size } = computeRippleStyles(this, event);
|
|
120
134
|
if (!current()) {
|
|
135
|
+
if (this._ripple === _ripple) clearTasks(this);
|
|
121
136
|
return;
|
|
122
137
|
}
|
|
123
138
|
const ripple = this.ownerDocument.createElement("div");
|
|
@@ -130,6 +145,7 @@ function createRipple(event) {
|
|
|
130
145
|
ripple.dataset.createdAt = String(performance.now());
|
|
131
146
|
setStyles(this);
|
|
132
147
|
if (!current()) {
|
|
148
|
+
if (this._ripple === _ripple) clearTasks(this);
|
|
133
149
|
return;
|
|
134
150
|
}
|
|
135
151
|
this.appendChild(ripple);
|
|
@@ -137,6 +153,7 @@ function createRipple(event) {
|
|
|
137
153
|
waves.set(ripple, wave);
|
|
138
154
|
const expansion = transitionTime(ripple, "transform");
|
|
139
155
|
if (!current() || waves.get(ripple) !== wave) {
|
|
156
|
+
if (!current() && this._ripple === _ripple) clearTasks(this);
|
|
140
157
|
return;
|
|
141
158
|
}
|
|
142
159
|
wave.expandUntil += expansion;
|
|
@@ -145,10 +162,12 @@ function createRipple(event) {
|
|
|
145
162
|
() => {
|
|
146
163
|
const wave2 = waves.get(ripple);
|
|
147
164
|
if (!wave2 || !current()) {
|
|
165
|
+
if (!current() && this._ripple === _ripple) clearTasks(this);
|
|
148
166
|
return;
|
|
149
167
|
}
|
|
150
168
|
const expansion2 = transitionTime(ripple, "transform");
|
|
151
169
|
if (!current() || waves.get(ripple) !== wave2) {
|
|
170
|
+
if (!current() && this._ripple === _ripple) clearTasks(this);
|
|
152
171
|
return;
|
|
153
172
|
}
|
|
154
173
|
wave2.expandUntil = performance.now() + expansion2;
|
|
@@ -168,6 +187,7 @@ function removeRipple() {
|
|
|
168
187
|
const task = () => {
|
|
169
188
|
const ripples = ownedRipples(this);
|
|
170
189
|
if (!ripples.length) {
|
|
190
|
+
stopObserverIfIdle(this, _ripple);
|
|
171
191
|
return;
|
|
172
192
|
}
|
|
173
193
|
const lastRipple = ripples[ripples.length - 1];
|
|
@@ -192,7 +212,10 @@ function removeRipple() {
|
|
|
192
212
|
() => {
|
|
193
213
|
waves.delete(lastRipple);
|
|
194
214
|
lastRipple.remove();
|
|
195
|
-
if (!ownedRipples(this).length)
|
|
215
|
+
if (!ownedRipples(this).length) {
|
|
216
|
+
restoreStyles(this);
|
|
217
|
+
stopObserverIfIdle(this, _ripple);
|
|
218
|
+
}
|
|
196
219
|
},
|
|
197
220
|
Math.max(MINIMUM_REMOVAL_DELAY, transitionTime(lastRipple, "opacity"))
|
|
198
221
|
);
|
|
@@ -211,6 +234,7 @@ function forbidRippleTask() {
|
|
|
211
234
|
_ripple.timers.delete(_ripple.tasker);
|
|
212
235
|
}
|
|
213
236
|
_ripple.tasker = null;
|
|
237
|
+
stopObserverIfIdle(this, _ripple);
|
|
214
238
|
}
|
|
215
239
|
function createTouchRipple(event) {
|
|
216
240
|
if (this._ripple) {
|
|
@@ -246,6 +270,9 @@ function removeKeyboardRipple(event) {
|
|
|
246
270
|
}
|
|
247
271
|
const releaseGroups = /* @__PURE__ */ new WeakMap();
|
|
248
272
|
const releaseEvents = ["touchend", "mouseup", "touchcancel", "dragend"];
|
|
273
|
+
function releaseOnMovedHost() {
|
|
274
|
+
if (this._ripple && this._ripple.document !== this.ownerDocument) syncOwnerDocument(this);
|
|
275
|
+
}
|
|
249
276
|
function bindListeners(el) {
|
|
250
277
|
const state = el._ripple;
|
|
251
278
|
if (!state || state.listening || state.disabled) return;
|
|
@@ -253,6 +280,9 @@ function bindListeners(el) {
|
|
|
253
280
|
el.addEventListener("touchstart", createTouchRipple, { passive: true });
|
|
254
281
|
el.addEventListener("mousedown", createMouseRipple, { passive: true });
|
|
255
282
|
el.addEventListener("touchmove", forbidRippleTask, { passive: true });
|
|
283
|
+
el.addEventListener("mouseup", releaseOnMovedHost);
|
|
284
|
+
el.addEventListener("touchend", releaseOnMovedHost);
|
|
285
|
+
el.addEventListener("touchcancel", releaseOnMovedHost);
|
|
256
286
|
el.addEventListener("dragstart", removeRipple, { passive: true });
|
|
257
287
|
el.addEventListener("keydown", createKeyboardRipple);
|
|
258
288
|
el.addEventListener("keyup", removeKeyboardRipple);
|
|
@@ -284,6 +314,9 @@ function unbindListeners(el) {
|
|
|
284
314
|
el.removeEventListener("touchstart", createTouchRipple);
|
|
285
315
|
el.removeEventListener("mousedown", createMouseRipple);
|
|
286
316
|
el.removeEventListener("touchmove", forbidRippleTask);
|
|
317
|
+
el.removeEventListener("mouseup", releaseOnMovedHost);
|
|
318
|
+
el.removeEventListener("touchend", releaseOnMovedHost);
|
|
319
|
+
el.removeEventListener("touchcancel", releaseOnMovedHost);
|
|
287
320
|
el.removeEventListener("dragstart", removeRipple);
|
|
288
321
|
const group = releaseGroups.get(state.document);
|
|
289
322
|
if (group && group.hosts.delete(el) && !group.hosts.size) {
|
|
@@ -294,6 +327,28 @@ function unbindListeners(el) {
|
|
|
294
327
|
releaseGroups.delete(state.document);
|
|
295
328
|
}
|
|
296
329
|
}
|
|
330
|
+
function syncOwnerDocument(el) {
|
|
331
|
+
const state = el._ripple;
|
|
332
|
+
if (!state || state.document === el.ownerDocument) return;
|
|
333
|
+
clearTasks(el);
|
|
334
|
+
unbindListeners(el);
|
|
335
|
+
state.document = el.ownerDocument;
|
|
336
|
+
bindListeners(el);
|
|
337
|
+
}
|
|
338
|
+
function watchOwnerDuringGesture(el, state) {
|
|
339
|
+
if (state.migrationObserver || typeof MutationObserver === "undefined") return;
|
|
340
|
+
let connected = el.isConnected;
|
|
341
|
+
const observer = new MutationObserver(() => {
|
|
342
|
+
if (el._ripple !== state) return;
|
|
343
|
+
if (state.document !== el.ownerDocument) syncOwnerDocument(el);
|
|
344
|
+
else if (connected && !el.isConnected) clearTasks(el);
|
|
345
|
+
else if (el.isConnected) connected = true;
|
|
346
|
+
});
|
|
347
|
+
const root = el.getRootNode();
|
|
348
|
+
observer.observe(root, { childList: true, subtree: true });
|
|
349
|
+
if (root !== state.document) observer.observe(state.document, { childList: true, subtree: true });
|
|
350
|
+
state.migrationObserver = observer;
|
|
351
|
+
}
|
|
297
352
|
function mounted(el, binding) {
|
|
298
353
|
el._ripple = {
|
|
299
354
|
document: el.ownerDocument,
|
|
@@ -313,6 +368,7 @@ function unmounted(el) {
|
|
|
313
368
|
delete el._ripple;
|
|
314
369
|
}
|
|
315
370
|
function updated(el, binding) {
|
|
371
|
+
syncOwnerDocument(el);
|
|
316
372
|
const newBinding = {
|
|
317
373
|
color: binding.value?.color,
|
|
318
374
|
disabled: binding.value?.disabled
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
--c-scheduler-lane-height: 38px;
|
|
58
58
|
--c-scheduler-font-size: 14px;
|
|
59
59
|
--c-scheduler-line-height: 1.5;
|
|
60
|
-
--c-scheduler-focus-color: var(--c-sys-color-
|
|
60
|
+
--c-scheduler-focus-color: var(--c-sys-color-action-primary);
|
|
61
61
|
--c-scheduler-now-color: var(--c-sys-color-content-danger);
|
|
62
62
|
--c-scheduler-now-width: 2px;
|
|
63
63
|
--c-scheduler-now-z-index: 3;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const globalConfig = require("../_utils/global-config.js");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const base$1 = require("../button/base.js");
|
|
6
|
+
const base = require("../input/base.js");
|
|
7
7
|
const FieldSelect_vue_vue_type_script_setup_true_lang = require("./FieldSelect.vue.js");
|
|
8
8
|
const _hoisted_1 = ["for"];
|
|
9
9
|
const _hoisted_2 = ["disabled", "onClick"];
|
|
@@ -76,7 +76,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
76
76
|
vue.createTextVNode(vue.toDisplayString(__props.settings.label), 1)
|
|
77
77
|
])
|
|
78
78
|
], 10, _hoisted_1)) : vue.createCommentVNode("", true),
|
|
79
|
-
vue.createVNode(vue.unref(
|
|
79
|
+
vue.createVNode(vue.unref(base.default), vue.mergeProps({
|
|
80
80
|
ref_key: "inputRef",
|
|
81
81
|
ref: inputRef,
|
|
82
82
|
loading: __props.settings.loading && __props.settings.loadingMode === "line",
|
|
@@ -122,7 +122,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
122
122
|
key: "2"
|
|
123
123
|
} : void 0
|
|
124
124
|
]), 1040, ["loading", "loading-mode", "model-value", "empty-value", "input-attrs", "error", "placeholder", "class", "onUpdate:modelValue", "onInput", "onChange", "onClear", "onPressEnter", "onBlur", "onFocus"]),
|
|
125
|
-
vue.createVNode(vue.unref(
|
|
125
|
+
vue.createVNode(vue.unref(base$1.default), {
|
|
126
126
|
class: vue.normalizeClass(vue.unref(n)("cancel")),
|
|
127
127
|
variant: "text",
|
|
128
128
|
disabled: __props.state.searchDisabled,
|
package/lib/search/props.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const props$1 = require("../field-decorator/props.js");
|
|
4
4
|
const emptyValue = require("../_utils/empty-value.js");
|
|
5
|
-
require("../input/index.js");
|
|
6
5
|
const props = require("../input/props.js");
|
|
7
6
|
const searchProps = {
|
|
8
7
|
...props$1.fieldLoadingProps,
|
package/lib/search/search.vue.js
CHANGED
|
@@ -7,7 +7,7 @@ const context = require("../_components/field-presentation/context.js");
|
|
|
7
7
|
const FieldPresentation_vue_vue_type_script_setup_true_lang = require("../_components/field-presentation/FieldPresentation.vue.js");
|
|
8
8
|
const emptyValue = require("../_utils/empty-value.js");
|
|
9
9
|
const globalConfig = require("../_utils/global-config.js");
|
|
10
|
-
const
|
|
10
|
+
const base = require("../button/base.js");
|
|
11
11
|
const icon_index = require("../icon/index.js");
|
|
12
12
|
const input_vue_vue_type_script_setup_true_lang = require("../input/input.vue.js");
|
|
13
13
|
const InputGroup_vue_vue_type_script_setup_true_lang = require("../input/InputGroup.vue.js");
|
|
@@ -235,7 +235,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
235
235
|
]),
|
|
236
236
|
_: 3
|
|
237
237
|
}, 8, ["open", "popup-container", "onUpdate:open", "onSelect"]),
|
|
238
|
-
vue.unref(effectiveShowAction) ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
238
|
+
vue.unref(effectiveShowAction) ? (vue.openBlock(), vue.createBlock(vue.unref(base.default), vue.mergeProps({
|
|
239
239
|
key: 2,
|
|
240
240
|
status: _ctx.searchButton ? "primary" : void 0,
|
|
241
241
|
variant: _ctx.searchButton ? void 0 : "text"
|
package/lib/select/props.js
CHANGED
|
@@ -10,6 +10,8 @@ const formControl = require("../_utils/form-control.js");
|
|
|
10
10
|
const popupContainer = require("../_utils/popup-container.js");
|
|
11
11
|
const selectProps = {
|
|
12
12
|
...props.fieldLoadingProps,
|
|
13
|
+
/** 弹出编辑是否需要确认;未设置时单选即提交,多选保留确认。 */
|
|
14
|
+
needConfirm: { type: Boolean, default: void 0 },
|
|
13
15
|
openTriggerTarget: openTrigger.openTriggerTargetProp,
|
|
14
16
|
/** 异步候选加载器;显式 options 优先,组件管理加载和请求取消。 */
|
|
15
17
|
/** 内置本地过滤是否区分大小写;自定义过滤函数优先。 */
|
package/lib/select/select.js
CHANGED
|
@@ -10,7 +10,7 @@ const SelectionEditor_vue_vue_type_script_setup_true_lang = require("../_compone
|
|
|
10
10
|
const MenuPresentation_vue_vue_type_script_setup_true_lang = require("../_components/selection-field/MenuPresentation.vue.js");
|
|
11
11
|
const SelectionField_vue_vue_type_script_setup_true_lang = require("../_components/selection-field/SelectionField.vue.js");
|
|
12
12
|
const is = require("../_utils/is.js");
|
|
13
|
-
const
|
|
13
|
+
const base = require("../input/base.js");
|
|
14
14
|
const InputFeedback_vue_vue_type_script_setup_true_lang = require("../input/InputFeedback.vue.js");
|
|
15
15
|
const globalConfig = require("../_utils/global-config.js");
|
|
16
16
|
const emits = require("./emits.js");
|
|
@@ -88,7 +88,7 @@ const Select = /* @__PURE__ */ vue.defineComponent({
|
|
|
88
88
|
"onRemove": (key) => controller.handleRemove(String(key)),
|
|
89
89
|
"onClear": controller.clearSelection
|
|
90
90
|
}, {
|
|
91
|
-
default: () => [(props2.filterable || props2.creatable) && vue.createVNode(
|
|
91
|
+
default: () => [(props2.filterable || props2.creatable) && vue.createVNode(base.default, {
|
|
92
92
|
"modelValue": controller.computedInputValue,
|
|
93
93
|
"editMode": "direct",
|
|
94
94
|
"hint": false,
|
|
@@ -154,7 +154,7 @@ const Select = /* @__PURE__ */ vue.defineComponent({
|
|
|
154
154
|
"disabled": controller.mergedDisabled,
|
|
155
155
|
"readonly": controller.mergedReadonly,
|
|
156
156
|
"limit": props2.limit,
|
|
157
|
-
"needConfirm": controller.deferred,
|
|
157
|
+
"needConfirm": controller.deferred && controller.needConfirm,
|
|
158
158
|
"pending": controller.session.pending,
|
|
159
159
|
"error": controller.session.error || controller.presentationError,
|
|
160
160
|
"onOpen": controller.handleOpenChange,
|
|
@@ -177,7 +177,7 @@ const Select = /* @__PURE__ */ vue.defineComponent({
|
|
|
177
177
|
editMode: "direct",
|
|
178
178
|
readPretty: false,
|
|
179
179
|
beforeCommit: void 0,
|
|
180
|
-
open: void 0,
|
|
180
|
+
open: controller.needConfirm ? void 0 : true,
|
|
181
181
|
defaultOpen: true,
|
|
182
182
|
modelValue: controller.session.value,
|
|
183
183
|
disabled: controller.mergedDisabled || controller.session.pending,
|
|
@@ -186,6 +186,12 @@ const Select = /* @__PURE__ */ vue.defineComponent({
|
|
|
186
186
|
onKeydown: (event) => emit("keydown", event),
|
|
187
187
|
onSearch: (...args) => emit("search", ...args),
|
|
188
188
|
onChange: () => {
|
|
189
|
+
},
|
|
190
|
+
onClear: () => {
|
|
191
|
+
if (!controller.needConfirm) void controller.session.commit();
|
|
192
|
+
},
|
|
193
|
+
onRemove: () => {
|
|
194
|
+
if (!controller.needConfirm) void controller.session.commit();
|
|
189
195
|
}
|
|
190
196
|
}, slots)
|
|
191
197
|
}) : vue.createVNode(SelectionEditor_vue_vue_type_script_setup_true_lang.default, {
|
|
@@ -7,28 +7,31 @@
|
|
|
7
7
|
* Popup Box
|
|
8
8
|
**********************************************/
|
|
9
9
|
--c-select-popup-max-height: 200px;
|
|
10
|
-
--c-select-popup-border-radius: var(--c-sys-radius-
|
|
10
|
+
--c-select-popup-border-radius: var(--c-sys-radius-lg);
|
|
11
11
|
--c-select-popup-padding-vertical: var(--c-sys-space-2);
|
|
12
12
|
--c-select-popup-font-size: var(--c-sys-font-size-md);
|
|
13
13
|
--c-select-popup-bg: var(--c-sys-color-surface-overlay);
|
|
14
|
-
--c-select-popup-border-color: var(--c-sys-color-border-
|
|
15
|
-
--c-select-popup-box-shadow: 0
|
|
14
|
+
--c-select-popup-border-color: var(--c-sys-color-border-subtle);
|
|
15
|
+
--c-select-popup-box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
|
|
16
16
|
/**********************************************
|
|
17
17
|
* Popup Options
|
|
18
18
|
* status: default / disabled / selected / hover
|
|
19
19
|
**********************************************/
|
|
20
20
|
--c-select-popup-option-height: 36px;
|
|
21
21
|
--c-select-popup-option-font-weight-selected: var(--c-sys-font-weight-medium);
|
|
22
|
-
--c-select-popup-option-padding-horizontal: var(--c-sys-space-
|
|
23
|
-
--c-select-popup-
|
|
22
|
+
--c-select-popup-option-padding-horizontal: var(--c-sys-space-4);
|
|
23
|
+
--c-select-popup-padding-horizontal: var(--c-sys-space-3);
|
|
24
|
+
--c-select-popup-option-border-radius: var(--c-sys-radius-lg);
|
|
25
|
+
--c-select-popup-option-bg: transparent;
|
|
24
26
|
--c-select-popup-option-bg-hover: var(--c-sys-color-state-hover);
|
|
25
|
-
--c-select-popup-option-bg-selected:
|
|
26
|
-
--c-select-popup-option-bg-
|
|
27
|
+
--c-select-popup-option-bg-selected: transparent;
|
|
28
|
+
--c-select-popup-option-bg-selected-hover: var(--c-select-popup-option-bg-hover);
|
|
29
|
+
--c-select-popup-option-bg-disabled: transparent;
|
|
27
30
|
--c-select-popup-option-text-color: var(--c-sys-color-content-primary);
|
|
28
31
|
--c-select-popup-option-text-color-hover: var(--c-sys-color-content-primary);
|
|
29
|
-
--c-select-popup-option-text-color-selected: var(--c-sys-color-
|
|
32
|
+
--c-select-popup-option-text-color-selected: var(--c-sys-color-action-primary);
|
|
30
33
|
--c-select-popup-option-text-color-disabled: var(--c-sys-color-content-disabled);
|
|
31
|
-
--c-select-popup-option-check-color: var(--c-sys-color-
|
|
34
|
+
--c-select-popup-option-check-color: var(--c-sys-color-action-primary);
|
|
32
35
|
--c-select-popup-option-check-size: var(--c-sys-font-size-md);
|
|
33
36
|
--c-select-popup-option-check-gap: var(--c-sys-space-4);
|
|
34
37
|
--c-select-popup-group-title-height: 20px;
|
|
@@ -69,6 +72,8 @@
|
|
|
69
72
|
list-style: none;
|
|
70
73
|
}
|
|
71
74
|
.c-select-dropdown-list-wrapper {
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
padding-inline: var(--c-select-popup-padding-horizontal);
|
|
72
77
|
max-height: var(--c-select-popup-max-height);
|
|
73
78
|
overflow-y: auto;
|
|
74
79
|
}
|
|
@@ -80,6 +85,8 @@
|
|
|
80
85
|
box-sizing: border-box;
|
|
81
86
|
width: 100%;
|
|
82
87
|
padding: 0 var(--c-select-popup-option-padding-horizontal);
|
|
88
|
+
border-radius: var(--c-select-popup-option-border-radius);
|
|
89
|
+
transition: background-color var(--c-sys-motion-duration-fast) var(--c-sys-motion-easing-standard), color var(--c-sys-motion-duration-fast) var(--c-sys-motion-easing-standard);
|
|
83
90
|
color: var(--c-select-popup-option-text-color);
|
|
84
91
|
font-size: var(--c-select-popup-font-size);
|
|
85
92
|
line-height: var(--c-select-popup-option-height);
|
|
@@ -119,11 +126,14 @@
|
|
|
119
126
|
font-weight: var(--c-select-popup-option-font-weight-selected);
|
|
120
127
|
background-color: var(--c-select-popup-option-bg-selected);
|
|
121
128
|
}
|
|
122
|
-
.c-select-dropdown .c-select-option-active,
|
|
123
|
-
.c-select-dropdown .c-select-option:not(.c-select-
|
|
129
|
+
.c-select-dropdown .c-select-option-active:not(.c-select-option-selected):not(.c-select-option-disabled),
|
|
130
|
+
.c-select-dropdown .c-select-option:not(.c-select-option-selected):not(.c-select-option-disabled):hover {
|
|
124
131
|
color: var(--c-select-popup-option-text-color-hover);
|
|
125
132
|
background-color: var(--c-select-popup-option-bg-hover);
|
|
126
|
-
|
|
133
|
+
}
|
|
134
|
+
.c-select-dropdown .c-select-option-selected:not(.c-select-option-disabled):hover,
|
|
135
|
+
.c-select-dropdown .c-select-option-selected.c-select-option-active:not(.c-select-option-disabled) {
|
|
136
|
+
background-color: var(--c-select-popup-option-bg-selected-hover);
|
|
127
137
|
}
|
|
128
138
|
.c-select-dropdown .c-select-option-disabled {
|
|
129
139
|
color: var(--c-select-popup-option-text-color-disabled);
|
|
@@ -115,6 +115,7 @@ function useSelectController(props, { emit }) {
|
|
|
115
115
|
() => props.modelValue !== void 0 ? props.modelValue : _value.value
|
|
116
116
|
);
|
|
117
117
|
const deferred = vue.computed(() => editMode.value !== "direct");
|
|
118
|
+
const needConfirm = vue.computed(() => props.needConfirm ?? props.multiple);
|
|
118
119
|
const publish = (value) => {
|
|
119
120
|
_value.value = value;
|
|
120
121
|
emit("update:modelValue", value);
|
|
@@ -336,6 +337,10 @@ function useSelectController(props, { emit }) {
|
|
|
336
337
|
handleOpenChange(false);
|
|
337
338
|
}
|
|
338
339
|
}
|
|
340
|
+
nativeOwner?.onSelect?.(ev);
|
|
341
|
+
if (deferred.value && !needConfirm.value) {
|
|
342
|
+
void session.commit(ev);
|
|
343
|
+
}
|
|
339
344
|
};
|
|
340
345
|
const handleSearch = useFieldSearch.useFieldSearch(
|
|
341
346
|
() => props.searchDelay,
|
|
@@ -375,6 +380,9 @@ function useSelectController(props, { emit }) {
|
|
|
375
380
|
}
|
|
376
381
|
const newKeys = computedValueObjects.value.map((item) => item.key).filter((_key) => _key !== key);
|
|
377
382
|
session.update(getValueFromValueKeys(newKeys));
|
|
383
|
+
if (deferred.value && !needConfirm.value) {
|
|
384
|
+
void session.commit();
|
|
385
|
+
}
|
|
378
386
|
emit("remove", optionInfo?.value);
|
|
379
387
|
};
|
|
380
388
|
const clearSelection = (e) => {
|
|
@@ -399,6 +407,7 @@ function useSelectController(props, { emit }) {
|
|
|
399
407
|
clearedValue = [];
|
|
400
408
|
}
|
|
401
409
|
session.update(clearedValue);
|
|
410
|
+
if (deferred.value && !needConfirm.value) void session.commit();
|
|
402
411
|
updateInputValue("");
|
|
403
412
|
if (!deferred.value) {
|
|
404
413
|
eventHandlers.value?.onClear?.();
|
|
@@ -504,7 +513,9 @@ function useSelectController(props, { emit }) {
|
|
|
504
513
|
props: vue.shallowReactive(props),
|
|
505
514
|
listboxId,
|
|
506
515
|
activeDescendant: vue.computed(() => computedOpen.value && !loading.value && activeKey.value && enabledOptionKeys.value.includes(activeKey.value) && (optionRefs.value[activeKey.value] || !props.virtualListProps && optionInfoMap.get(activeKey.value)?.ref) ? getOptionId(activeKey.value) : void 0),
|
|
507
|
-
provideNativeEditorOwner: () => vue.provide(nativeEditorOwner.selectNativeEditorOwner, { source, selectedOptions: _selectedOption
|
|
516
|
+
provideNativeEditorOwner: () => vue.provide(nativeEditorOwner.selectNativeEditorOwner, { source, selectedOptions: _selectedOption, onSelect: (event) => {
|
|
517
|
+
if (!needConfirm.value) void session.commit(event);
|
|
518
|
+
} }),
|
|
508
519
|
loading,
|
|
509
520
|
refresh: source.refresh,
|
|
510
521
|
registerPresentation: presentationState.register,
|
|
@@ -550,7 +561,8 @@ function useSelectController(props, { emit }) {
|
|
|
550
561
|
handleDropdownReachBottom,
|
|
551
562
|
session,
|
|
552
563
|
deferred,
|
|
553
|
-
canConfirm
|
|
564
|
+
canConfirm,
|
|
565
|
+
needConfirm
|
|
554
566
|
};
|
|
555
567
|
}
|
|
556
568
|
exports.useSelectController = useSelectController;
|
package/lib/slider/Slider.vue.js
CHANGED
|
@@ -5,20 +5,34 @@ const globalConfig = require("../_utils/global-config.js");
|
|
|
5
5
|
const sizeLength = require("../_utils/size-length.js");
|
|
6
6
|
const model = require("./model.js");
|
|
7
7
|
const errorDescription = require("../form/error-description.js");
|
|
8
|
+
const labelContext = require("../form/label-context.js");
|
|
8
9
|
const props = require("./props.js");
|
|
9
10
|
const SliderInput_vue_vue_type_script_setup_true_lang = require("./SliderInput.vue.js");
|
|
10
11
|
const useSliderForm = require("./use-slider-form.js");
|
|
11
12
|
const useVue = require("@cedar-design/use-vue");
|
|
12
|
-
const _hoisted_1 = ["
|
|
13
|
-
const _hoisted_2 = ["
|
|
13
|
+
const _hoisted_1 = ["role", "aria-labelledby"];
|
|
14
|
+
const _hoisted_2 = ["tabindex", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "aria-readonly", "aria-invalid", "aria-describedby", "onPointerdown", "onKeydown", "onFocus", "onMouseenter"];
|
|
15
|
+
const _hoisted_3 = ["id"];
|
|
14
16
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
15
|
-
...{ name: globalConfig.createNamespace("slider").name },
|
|
17
|
+
...{ name: globalConfig.createNamespace("slider").name, inheritAttrs: false },
|
|
16
18
|
__name: "Slider",
|
|
17
19
|
props: props.sliderProps,
|
|
18
20
|
emits: ["update:modelValue", "change", "start", "end"],
|
|
19
21
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
20
22
|
const { n, classes } = globalConfig.createNamespace("slider");
|
|
21
23
|
const props2 = __props;
|
|
24
|
+
const attrs = vue.useAttrs();
|
|
25
|
+
const formLabel = labelContext.useFormItemLabel();
|
|
26
|
+
const rangeGroupLabel = vue.computed(() => {
|
|
27
|
+
const label = formLabel?.value;
|
|
28
|
+
return props2.range && attrs.role == null && attrs["aria-labelledby"] == null && label?.target && label.target === attrs.id ? label.id : void 0;
|
|
29
|
+
});
|
|
30
|
+
const singleLabelledBy = vue.computed(() => {
|
|
31
|
+
if (props2.range) return void 0;
|
|
32
|
+
if (attrs["aria-labelledby"] != null) return attrs["aria-labelledby"];
|
|
33
|
+
const label = formLabel?.value;
|
|
34
|
+
return props2.ariaLabel == null && label?.target && label.target === attrs.id ? label.id : void 0;
|
|
35
|
+
});
|
|
22
36
|
const { describe: describeError } = errorDescription.useFormErrorDescription();
|
|
23
37
|
const emit = __emit;
|
|
24
38
|
const { mergedDisabled, mergedReadonly, mergedError, eventHandlers } = useSliderForm.useSliderForm(props2);
|
|
@@ -292,21 +306,22 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
292
306
|
vue.onBeforeUnmount(cleanup);
|
|
293
307
|
vue.onDeactivated(cleanup);
|
|
294
308
|
return (_ctx, _cache) => {
|
|
295
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
309
|
+
return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
|
|
296
310
|
ref_key: "root",
|
|
297
|
-
ref: root
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
)
|
|
311
|
+
ref: root
|
|
312
|
+
}, _ctx.$attrs, {
|
|
313
|
+
class: vue.unref(classes)(
|
|
314
|
+
vue.unref(n)(),
|
|
315
|
+
vue.unref(n)(`--${_ctx.orientation}`),
|
|
316
|
+
[isDisabled.value, vue.unref(n)("--disabled")],
|
|
317
|
+
[vue.unref(mergedReadonly), vue.unref(n)("--readonly")],
|
|
318
|
+
[vue.unref(mergedError), vue.unref(n)("--error")],
|
|
319
|
+
[_ctx.marks, vue.unref(n)("--marks")]
|
|
307
320
|
),
|
|
308
|
-
style:
|
|
309
|
-
|
|
321
|
+
style: customStyle.value,
|
|
322
|
+
role: _ctx.$attrs.role ?? (_ctx.range && (rangeGroupLabel.value || typeof _ctx.$attrs["aria-labelledby"] === "string" && _ctx.$attrs["aria-labelledby"].trim()) ? "group" : void 0),
|
|
323
|
+
"aria-labelledby": _ctx.$attrs["aria-labelledby"] ?? rangeGroupLabel.value
|
|
324
|
+
}), [
|
|
310
325
|
vue.createElementVNode("div", {
|
|
311
326
|
ref_key: "track",
|
|
312
327
|
ref: track,
|
|
@@ -345,6 +360,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
345
360
|
role: "slider",
|
|
346
361
|
tabindex: isDisabled.value ? void 0 : 0,
|
|
347
362
|
"aria-label": thumbLabel(index),
|
|
363
|
+
"aria-labelledby": singleLabelledBy.value,
|
|
348
364
|
"aria-valuemin": index === 1 && _ctx.range ? values.value[0] : bounds.value.min,
|
|
349
365
|
"aria-valuemax": index === 0 ? values.value[1] : bounds.value.max,
|
|
350
366
|
"aria-valuenow": values.value[index],
|
|
@@ -374,8 +390,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
374
390
|
id: `${tooltipId}-${index}`,
|
|
375
391
|
class: vue.normalizeClass(vue.unref(n)("tooltip")),
|
|
376
392
|
role: "tooltip"
|
|
377
|
-
}, vue.toDisplayString(format(values.value[index])), 11,
|
|
378
|
-
], 46,
|
|
393
|
+
}, vue.toDisplayString(format(values.value[index])), 11, _hoisted_3)) : vue.createCommentVNode("", true)
|
|
394
|
+
], 46, _hoisted_2);
|
|
379
395
|
}), 128))
|
|
380
396
|
], 34),
|
|
381
397
|
_ctx.showInput ? (vue.openBlock(), vue.createBlock(SliderInput_vue_vue_type_script_setup_true_lang.default, {
|
|
@@ -389,12 +405,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
389
405
|
readonly: vue.unref(mergedReadonly),
|
|
390
406
|
error: vue.unref(mergedError),
|
|
391
407
|
"aria-label": _ctx.ariaLabel,
|
|
408
|
+
"aria-labelledby": singleLabelledBy.value,
|
|
409
|
+
"aria-describedby": _ctx.$attrs["aria-describedby"],
|
|
392
410
|
"aria-invalid": _ctx.$attrs["aria-invalid"],
|
|
393
411
|
onChange: inputChange,
|
|
394
412
|
onFocus: _cache[2] || (_cache[2] = ($event) => vue.unref(eventHandlers)?.onFocus?.()),
|
|
395
413
|
onBlur: _cache[3] || (_cache[3] = ($event) => vue.unref(eventHandlers)?.onBlur?.())
|
|
396
|
-
}, null, 8, ["model-value", "min", "max", "step", "range", "disabled", "readonly", "error", "aria-label", "aria-invalid"])) : vue.createCommentVNode("", true)
|
|
397
|
-
],
|
|
414
|
+
}, null, 8, ["model-value", "min", "max", "step", "range", "disabled", "readonly", "error", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid"])) : vue.createCommentVNode("", true)
|
|
415
|
+
], 16, _hoisted_1);
|
|
398
416
|
};
|
|
399
417
|
}
|
|
400
418
|
});
|
|
@@ -17,6 +17,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
17
17
|
readonly: Boolean,
|
|
18
18
|
error: Boolean,
|
|
19
19
|
ariaLabel: [String, Array],
|
|
20
|
+
ariaLabelledby: String,
|
|
21
|
+
ariaDescribedby: String,
|
|
20
22
|
ariaInvalid: { type: [String, Boolean], default: void 0 }
|
|
21
23
|
},
|
|
22
24
|
emits: ["change", "focus", "blur"],
|
|
@@ -40,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
40
42
|
disabled: __props.disabled,
|
|
41
43
|
readonly: __props.readonly,
|
|
42
44
|
error: __props.error,
|
|
43
|
-
"input-attrs": { "aria-label": label(0), "aria-invalid": __props.ariaInvalid },
|
|
45
|
+
"input-attrs": { "aria-label": label(0), "aria-labelledby": __props.ariaLabelledby, "aria-describedby": __props.ariaDescribedby, "aria-invalid": __props.ariaInvalid },
|
|
44
46
|
onChange: _cache[0] || (_cache[0] = (value) => emit("change", 0, value ?? void 0)),
|
|
45
47
|
onFocus: _cache[1] || (_cache[1] = ($event) => emit("focus")),
|
|
46
48
|
onBlur: _cache[2] || (_cache[2] = ($event) => emit("blur"))
|
|
@@ -54,7 +56,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
54
56
|
disabled: __props.disabled,
|
|
55
57
|
readonly: __props.readonly,
|
|
56
58
|
error: __props.error,
|
|
57
|
-
"input-attrs": { "aria-label": label(1), "aria-invalid": __props.ariaInvalid },
|
|
59
|
+
"input-attrs": { "aria-label": label(1), "aria-labelledby": __props.ariaLabelledby, "aria-describedby": __props.ariaDescribedby, "aria-invalid": __props.ariaInvalid },
|
|
58
60
|
onChange: _cache[3] || (_cache[3] = (value) => emit("change", 1, value ?? void 0)),
|
|
59
61
|
onFocus: _cache[4] || (_cache[4] = ($event) => emit("focus")),
|
|
60
62
|
onBlur: _cache[5] || (_cache[5] = ($event) => emit("blur"))
|