@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
|
@@ -54,9 +54,12 @@ function useCountdown(props, emit) {
|
|
|
54
54
|
let resumeOnActivate = false;
|
|
55
55
|
let generation = 0;
|
|
56
56
|
let handle;
|
|
57
|
-
function
|
|
57
|
+
function updateDisplay() {
|
|
58
58
|
timeData.value = splitTime(remaining);
|
|
59
59
|
showTime.value = parseFormat(props.format, timeData.value);
|
|
60
|
+
}
|
|
61
|
+
function display() {
|
|
62
|
+
updateDisplay();
|
|
60
63
|
emit("change", timeData.value);
|
|
61
64
|
}
|
|
62
65
|
function cancel() {
|
|
@@ -93,9 +96,11 @@ function useCountdown(props, emit) {
|
|
|
93
96
|
}
|
|
94
97
|
function pause() {
|
|
95
98
|
resumeOnActivate = false;
|
|
96
|
-
|
|
99
|
+
const wasRunning = running;
|
|
100
|
+
if (wasRunning) remaining = Math.max(0, deadline - performance.now());
|
|
97
101
|
running = false;
|
|
98
102
|
cancel();
|
|
103
|
+
if (wasRunning && mounted) updateDisplay();
|
|
99
104
|
}
|
|
100
105
|
function reset() {
|
|
101
106
|
if (!mounted) return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
-
const
|
|
4
|
+
const base = require("../button/base.js");
|
|
5
5
|
const globalConfig = require("../_utils/global-config.js");
|
|
6
6
|
const usePanelActionsLocale = require("./presentation/use-panel-actions-locale.js");
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -29,7 +29,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
29
29
|
selectNow: () => emit("select-now"),
|
|
30
30
|
nowDisabled: __props.nowDisabled
|
|
31
31
|
})), () => [
|
|
32
|
-
__props.showNow ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
32
|
+
__props.showNow ? (vue.openBlock(), vue.createBlock(vue.unref(base.default), {
|
|
33
33
|
key: 0,
|
|
34
34
|
variant: "text",
|
|
35
35
|
disabled: __props.nowDisabled,
|
|
@@ -40,7 +40,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
40
40
|
]),
|
|
41
41
|
_: 1
|
|
42
42
|
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
43
|
-
__props.showConfirm ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
43
|
+
__props.showConfirm ? (vue.openBlock(), vue.createBlock(vue.unref(base.default), {
|
|
44
44
|
key: 1,
|
|
45
45
|
status: "primary",
|
|
46
46
|
disabled: !__props.canConfirm,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
-
const
|
|
4
|
+
const base = require("../button/base.js");
|
|
5
5
|
const globalConfig = require("../_utils/global-config.js");
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
7
7
|
...{ name: globalConfig.createNamespace("date-shortcuts").name },
|
|
@@ -20,7 +20,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
20
20
|
class: vue.normalizeClass(vue.unref(classes)(vue.unref(n)(), vue.unref(n)(`--${__props.position}`)))
|
|
21
21
|
}, [
|
|
22
22
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.shortcuts, (shortcut, index) => {
|
|
23
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
23
|
+
return vue.openBlock(), vue.createBlock(vue.unref(base.default), {
|
|
24
24
|
key: index,
|
|
25
25
|
variant: "text",
|
|
26
26
|
disabled: __props.blocked || shortcut.disabled,
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const link_index = require("../../../link/index.js");
|
|
5
|
-
const
|
|
5
|
+
const base = require("../../../button/base.js");
|
|
6
6
|
const useInjectDatepickerTransform = require("../hooks/use-inject-datepicker-transform.js");
|
|
7
7
|
const globalConfig = require("../../../_utils/global-config.js");
|
|
8
8
|
const _sfc_main = vue.defineComponent({
|
|
9
9
|
name: globalConfig.createNamespace("date-picker-footer").name,
|
|
10
10
|
components: {
|
|
11
11
|
Link: link_index.Link,
|
|
12
|
-
Button:
|
|
12
|
+
Button: base.default
|
|
13
13
|
},
|
|
14
14
|
props: {
|
|
15
15
|
prefixCls: {
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const globalConfig = require("../../../_utils/global-config.js");
|
|
4
4
|
const vue = require("vue");
|
|
5
|
-
const
|
|
5
|
+
const base = require("../../../button/base.js");
|
|
6
6
|
const renderFunction = require("../../../_components/render-function.js");
|
|
7
7
|
const is = require("../../../_utils/is.js");
|
|
8
8
|
const useInjectDatepickerTransform = require("../hooks/use-inject-datepicker-transform.js");
|
|
9
9
|
const _sfc_main = vue.defineComponent({
|
|
10
10
|
name: globalConfig.createNamespace("date-picker-shortcuts").name,
|
|
11
11
|
components: {
|
|
12
|
-
Button:
|
|
12
|
+
Button: base.default,
|
|
13
13
|
RenderFunction: renderFunction.default
|
|
14
14
|
},
|
|
15
15
|
props: {
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
--c-date-picker-shortcuts-placement-item-margin-vertical: 5px;
|
|
100
100
|
--c-date-picker-shortcuts-inline-item-margin-vertical: 5px;
|
|
101
101
|
--c-date-picker-shortcuts-inline-item-margin-right: var(--c-spacing-5);
|
|
102
|
-
--c-date-picker-shortcuts-active-text-color: var(--c-sys-color-
|
|
102
|
+
--c-date-picker-shortcuts-active-text-color: var(--c-sys-color-action-primary);
|
|
103
103
|
--c-date-picker-transition-duration-1: var(--c-transition-duration-1);
|
|
104
104
|
--c-date-picker-transition-timing-function-linear: var(--c-transition-timing-function-linear);
|
|
105
105
|
}
|
package/lib/dialog/Dialog.vue.js
CHANGED
|
@@ -12,7 +12,7 @@ const IconHover = require("../_components/IconHover.vue.js");
|
|
|
12
12
|
const globalConfig = require("../_utils/global-config.js");
|
|
13
13
|
const is = require("../_utils/is.js");
|
|
14
14
|
const modalSurface = require("../_utils/modal-surface.js");
|
|
15
|
-
const
|
|
15
|
+
const base = require("../button/base.js");
|
|
16
16
|
const locale_index = require("../locale/index.js");
|
|
17
17
|
const props = require("./props.js");
|
|
18
18
|
const useDialog = require("./use-dialog.js");
|
|
@@ -264,7 +264,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
264
264
|
confirm: handleConfirm,
|
|
265
265
|
close: handleClose
|
|
266
266
|
}, () => [
|
|
267
|
-
_ctx.cancelButton ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
267
|
+
_ctx.cancelButton ? (vue.openBlock(), vue.createBlock(vue.unref(base.default), vue.mergeProps({
|
|
268
268
|
key: 0,
|
|
269
269
|
variant: "text"
|
|
270
270
|
}, _ctx.cancelButtonProps, {
|
|
@@ -277,7 +277,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
277
277
|
]),
|
|
278
278
|
_: 1
|
|
279
279
|
}, 16, ["loading", "disabled"])) : vue.createCommentVNode("", true),
|
|
280
|
-
_ctx.confirmButton ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
280
|
+
_ctx.confirmButton ? (vue.openBlock(), vue.createBlock(vue.unref(base.default), vue.mergeProps({
|
|
281
281
|
key: 1,
|
|
282
282
|
variant: "text"
|
|
283
283
|
}, _ctx.confirmButtonProps, {
|
|
@@ -18,6 +18,7 @@ const errorDescription = require("./error-description.js");
|
|
|
18
18
|
const labelContext = require("./label-context.js");
|
|
19
19
|
const itemDecoration = require("./item-decoration.js");
|
|
20
20
|
const itemProps = require("./item-props.js");
|
|
21
|
+
const types = require("./types.js");
|
|
21
22
|
const useFormItemLayout = require("./use-form-item-layout.js");
|
|
22
23
|
const utils = require("./utils.js");
|
|
23
24
|
const validateTrigger = require("./validate-trigger.js");
|
|
@@ -139,14 +140,38 @@ const _sfc_main = vue.defineComponent({
|
|
|
139
140
|
const isRequired = vue.computed(
|
|
140
141
|
() => mergedRules.value.some((item) => item.required)
|
|
141
142
|
);
|
|
142
|
-
const formItemCtx =
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
const formItemCtx = vue.inject(context.formItemInjectionKey, void 0);
|
|
144
|
+
const feedbackOwner = Symbol("form-item-feedback");
|
|
145
|
+
const feedbackSources = /* @__PURE__ */ new Map();
|
|
146
|
+
const updateValidateState = (field2, { status, message }, owner = feedbackOwner) => {
|
|
147
|
+
let sources = feedbackSources.get(field2);
|
|
148
|
+
if (!sources) {
|
|
149
|
+
sources = /* @__PURE__ */ new Map();
|
|
150
|
+
feedbackSources.set(field2, sources);
|
|
151
|
+
}
|
|
152
|
+
if (status || message) {
|
|
153
|
+
sources.delete(owner);
|
|
154
|
+
sources.set(owner, { status, message });
|
|
155
|
+
} else sources.delete(owner);
|
|
156
|
+
let effective = { status: "", message: "" };
|
|
157
|
+
for (const candidate of sources.values()) {
|
|
158
|
+
const rank = candidate.status ? types.VALIDATE_STATUSES.indexOf(candidate.status) : -1;
|
|
159
|
+
const currentRank = effective.status ? types.VALIDATE_STATUSES.indexOf(effective.status) : -1;
|
|
160
|
+
if (rank >= currentRank) effective = candidate;
|
|
161
|
+
}
|
|
162
|
+
if (!sources.size) feedbackSources.delete(field2);
|
|
163
|
+
validateStatus[field2] = effective.status;
|
|
164
|
+
validateMessage[field2] = effective.message;
|
|
146
165
|
if (props.noStyle) {
|
|
147
|
-
formItemCtx?.updateValidateState(field2,
|
|
166
|
+
formItemCtx?.updateValidateState(field2, effective, feedbackOwner);
|
|
148
167
|
}
|
|
149
168
|
};
|
|
169
|
+
vue.watch(() => props.noStyle, (noStyle) => {
|
|
170
|
+
if (!formItemCtx) return;
|
|
171
|
+
for (const name of Object.keys(validateStatus)) {
|
|
172
|
+
formItemCtx.updateValidateState(name, noStyle ? { status: validateStatus[name], message: validateMessage[name] ?? "" } : { status: "", message: "" }, feedbackOwner);
|
|
173
|
+
}
|
|
174
|
+
}, { flush: "sync" });
|
|
150
175
|
const computedFeedback = vue.computed(
|
|
151
176
|
() => props.feedback && computedValidateStatus.value ? computedValidateStatus.value : void 0
|
|
152
177
|
);
|
|
@@ -361,8 +386,6 @@ const _sfc_main = vue.defineComponent({
|
|
|
361
386
|
validateDisabled.value = false;
|
|
362
387
|
for (const name of Object.keys(validateStatus)) {
|
|
363
388
|
updateValidateState(name, { status: "", message: "" });
|
|
364
|
-
delete validateStatus[name];
|
|
365
|
-
delete validateMessage[name];
|
|
366
389
|
}
|
|
367
390
|
captureInitialValue();
|
|
368
391
|
registerCurrentField();
|
|
@@ -376,6 +399,11 @@ const _sfc_main = vue.defineComponent({
|
|
|
376
399
|
active = false;
|
|
377
400
|
fieldMounted = false;
|
|
378
401
|
validation.invalidate();
|
|
402
|
+
if (props.noStyle && formItemCtx) {
|
|
403
|
+
for (const name of Object.keys(validateStatus)) {
|
|
404
|
+
formItemCtx.updateValidateState(name, { status: "", message: "" }, feedbackOwner);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
379
407
|
unregisterCurrentField();
|
|
380
408
|
});
|
|
381
409
|
const cls = vue.computed(() => [
|
|
@@ -3,6 +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 tooltip_index = require("../tooltip/index.js");
|
|
6
|
+
const focusExplicitLabel = require("./focus-explicit-label.js");
|
|
6
7
|
const itemDecoration = require("./item-decoration.js");
|
|
7
8
|
const useFormLabelWidth = require("./use-form-label-width.js");
|
|
8
9
|
const _hoisted_1 = ["aria-label"];
|
|
@@ -30,7 +31,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
30
31
|
ref_key: "labelRef",
|
|
31
32
|
ref: labelRef,
|
|
32
33
|
class: __props.labelClass
|
|
33
|
-
}, __props.attrs), {
|
|
34
|
+
}, __props.attrs, { onClick: vue.unref(focusExplicitLabel.focusExplicitSlider) }), {
|
|
34
35
|
default: vue.withCtx(() => [
|
|
35
36
|
__props.required && __props.asteriskPosition === "start" ? (vue.openBlock(), vue.createElementBlock("strong", {
|
|
36
37
|
key: 0,
|
|
@@ -62,7 +63,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
62
63
|
vue.createTextVNode(" " + vue.toDisplayString(__props.showColon ? ":" : ""), 1)
|
|
63
64
|
]),
|
|
64
65
|
_: 3
|
|
65
|
-
}, 16, ["class"])),
|
|
66
|
+
}, 16, ["class", "onClick"])),
|
|
66
67
|
__props.tooltip ? (vue.openBlock(), vue.createBlock(vue.unref(tooltip_index.Tooltip), {
|
|
67
68
|
key: 0,
|
|
68
69
|
content: __props.tooltip,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function focusExplicitSlider(event) {
|
|
4
|
+
if (event.defaultPrevented || event.button !== 0) return;
|
|
5
|
+
const label = event.currentTarget;
|
|
6
|
+
if (!label || label.nodeType !== 1 || label.tagName !== "LABEL") return;
|
|
7
|
+
const origin = event.target;
|
|
8
|
+
const interactive = origin?.nodeType === 1 ? origin.closest('a[href],button,input,select,textarea,[contenteditable]:not([contenteditable="false"]),[role="button"],[role="link"],[role="checkbox"],[role="radio"],[role="switch"],[role="textbox"],[role="combobox"],[role="slider"]') : null;
|
|
9
|
+
if (interactive && interactive !== label && label.contains(interactive)) return;
|
|
10
|
+
const id = label.getAttribute("for");
|
|
11
|
+
if (!id || label.control) return;
|
|
12
|
+
const root = label.getRootNode();
|
|
13
|
+
if (typeof root.getElementById !== "function") return;
|
|
14
|
+
const target = root.getElementById(id);
|
|
15
|
+
if (!target) return;
|
|
16
|
+
const previous = root.activeElement;
|
|
17
|
+
const previousDocument = label.ownerDocument.activeElement;
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
if (event.defaultPrevented || !label.isConnected || label.getAttribute("for") !== id || root.getElementById(id) !== target || root.activeElement !== previous || label.ownerDocument.activeElement !== previousDocument) return;
|
|
20
|
+
const sliders = target.matches('[role="slider"]') ? [target] : Array.from(target.querySelectorAll('[role="slider"]'));
|
|
21
|
+
if (sliders.length !== 1) return;
|
|
22
|
+
const slider = sliders[0];
|
|
23
|
+
if (target !== slider && !Array.from(target.classList).some((name) => name.endsWith("-slider") && slider.classList.contains(`${name}__thumb`))) return;
|
|
24
|
+
if (slider.tabIndex < 0 || slider.getAttribute("aria-disabled") === "true" || slider.closest('[inert], [aria-hidden="true"]')) return;
|
|
25
|
+
slider.focus();
|
|
26
|
+
}, 0);
|
|
27
|
+
}
|
|
28
|
+
exports.focusExplicitSlider = focusExplicitSlider;
|
package/lib/form/style/index.css
CHANGED
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
--c-form-status-validating-focus-bg: var(--c-color-bg-2);
|
|
77
77
|
--c-form-status-validating-border-color: transparent;
|
|
78
78
|
--c-form-status-validating-hover-border-color: transparent;
|
|
79
|
-
--c-form-status-validating-focus-border-color: var(--c-sys-color-
|
|
79
|
+
--c-form-status-validating-focus-border-color: var(--c-sys-color-action-primary);
|
|
80
80
|
--c-form-status-validating-focus-shadow-size: var(--c-shadow-distance-none);
|
|
81
81
|
--c-form-status-validating-focus-shadow-color: var(--c-color-primary-light-2);
|
|
82
82
|
--c-form-status-validating-tip-text-color: var(--c-sys-color-content-brand);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const components = require("../_utils/maple/components.js");
|
|
4
|
+
const input_vue_vue_type_script_setup_true_lang = require("./input.vue.js");
|
|
5
|
+
const props = require("./props.js");
|
|
6
|
+
const SearchInput = components.withPropsDefaultsSetter(input_vue_vue_type_script_setup_true_lang.default, props.inputProps);
|
|
7
|
+
exports.default = SearchInput;
|
package/lib/input/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
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 InputGroup_vue_vue_type_script_setup_true_lang = require("./InputGroup.vue.js");
|
|
6
6
|
const InputGroupLabel_vue_vue_type_script_setup_true_lang = require("./InputGroupLabel.vue.js");
|
|
7
7
|
const InputPassword_vue_vue_type_script_setup_true_lang = require("./InputPassword.vue.js");
|
|
8
8
|
const props = require("./props.js");
|
|
9
9
|
const Input = globalConfig.withInstall(
|
|
10
|
-
|
|
11
|
-
Object.assign(
|
|
10
|
+
base.default,
|
|
11
|
+
Object.assign(base.default, {
|
|
12
12
|
Password: InputPassword_vue_vue_type_script_setup_true_lang.default,
|
|
13
13
|
Group: InputGroup_vue_vue_type_script_setup_true_lang.default,
|
|
14
14
|
GroupLabel: InputGroupLabel_vue_vue_type_script_setup_true_lang.default
|
|
15
15
|
}),
|
|
16
|
-
{ components: [
|
|
16
|
+
{ components: [base.default, InputGroup_vue_vue_type_script_setup_true_lang.default, InputPassword_vue_vue_type_script_setup_true_lang.default, InputGroupLabel_vue_vue_type_script_setup_true_lang.default] }
|
|
17
17
|
);
|
|
18
18
|
const _InputComponent = Input;
|
|
19
19
|
const _InputPasswordComponent = InputPassword_vue_vue_type_script_setup_true_lang.default;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:root,
|
|
5
5
|
:where([data-c-theme]) {
|
|
6
6
|
--c-layout-border-color: var(--c-color-border-2);
|
|
7
|
-
--c-layout-focus-color: var(--c-sys-color-
|
|
7
|
+
--c-layout-focus-color: var(--c-sys-color-action-primary);
|
|
8
8
|
--c-layout-trigger-height: var(--c-size-12);
|
|
9
9
|
--c-layout-font-color: var(--c-color-text-1);
|
|
10
10
|
--c-layout-sider-background-light: var(--c-color-bg-2);
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
--c-nav-menu-light-item-bg-hover: var(--c-color-fill-2);
|
|
10
10
|
--c-nav-menu-light-item-bg-selected: var(--c-color-fill-2);
|
|
11
11
|
--c-nav-menu-light-item-text-color: var(--c-color-text-2);
|
|
12
|
-
--c-nav-menu-light-item-text-color-selected: var(--c-sys-color-
|
|
12
|
+
--c-nav-menu-light-item-text-color-selected: var(--c-sys-color-action-primary);
|
|
13
13
|
--c-nav-menu-light-item-text-color-disabled: var(--c-color-text-4);
|
|
14
14
|
--c-nav-menu-row-height: 40px;
|
|
15
15
|
--c-nav-menu-row-height-xs: 28px;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
-
const
|
|
4
|
+
const base = require("../input/base.js");
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
6
6
|
__name: "PageInput",
|
|
7
7
|
props: {
|
|
@@ -14,7 +14,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
14
14
|
setup(__props, { emit: __emit }) {
|
|
15
15
|
const emit = __emit;
|
|
16
16
|
return (_ctx, _cache) => {
|
|
17
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
17
|
+
return vue.openBlock(), vue.createBlock(vue.unref(base.default), {
|
|
18
18
|
"edit-mode": "direct",
|
|
19
19
|
"model-value": __props.modelValue,
|
|
20
20
|
size: __props.size,
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
--c-pagination-touch-size: 44px;
|
|
22
22
|
--c-pagination-focus-width: 2px;
|
|
23
23
|
--c-pagination-focus-offset: 1px;
|
|
24
|
-
--c-pagination-focus-color: var(--c-sys-color-
|
|
24
|
+
--c-pagination-focus-color: var(--c-sys-color-action-primary);
|
|
25
25
|
--c-pagination-item-background: transparent;
|
|
26
26
|
--c-pagination-hover-background: var(--c-color-fill-1);
|
|
27
27
|
--c-pagination-active-background: var(--c-color-primary-light-1);
|
|
28
|
-
--c-pagination-active-color: var(--c-sys-color-
|
|
28
|
+
--c-pagination-active-color: var(--c-sys-color-action-primary);
|
|
29
29
|
--c-pagination-disabled-color: var(--c-color-text-4);
|
|
30
30
|
--c-pagination-disabled-background: var(--c-color-fill-1);
|
|
31
31
|
}
|
|
@@ -10,6 +10,7 @@ const globalConfig = require("../_utils/global-config.js");
|
|
|
10
10
|
const Person_vue_vue_type_script_setup_true_lang = require("./Person.vue.js");
|
|
11
11
|
const presentation = require("./presentation.js");
|
|
12
12
|
const props = require("./props.js");
|
|
13
|
+
const selection = require("./selection.js");
|
|
13
14
|
const _PeopleSelect = vue.defineComponent({
|
|
14
15
|
name: globalConfig.createNamespace("people-select").name,
|
|
15
16
|
inheritAttrs: false,
|
|
@@ -40,44 +41,16 @@ const _PeopleSelect = vue.defineComponent({
|
|
|
40
41
|
const options = vue.computed(
|
|
41
42
|
() => Array.isArray(props2.options) ? props2.options : source.data.value
|
|
42
43
|
);
|
|
43
|
-
const
|
|
44
|
-
vue.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const person = options.value.find(
|
|
48
|
-
(person2) => person2.value === value.value
|
|
49
|
-
);
|
|
50
|
-
if (person) selectedCache.value = person;
|
|
51
|
-
else if (selectedCache.value?.value !== value.value)
|
|
52
|
-
selectedCache.value = void 0;
|
|
53
|
-
},
|
|
54
|
-
{ immediate: true }
|
|
55
|
-
);
|
|
56
|
-
const selected = vue.computed(() => {
|
|
57
|
-
const current = options.value.find(
|
|
58
|
-
(person) => person.value === value.value
|
|
59
|
-
);
|
|
60
|
-
if (current) return current;
|
|
61
|
-
if (typeof props2.fallbackOption === "function" && value.value != null) {
|
|
62
|
-
return props2.fallbackOption(value.value);
|
|
63
|
-
}
|
|
64
|
-
if (props2.fallbackOption !== false && props2.label)
|
|
65
|
-
return {
|
|
66
|
-
...selectedCache.value,
|
|
67
|
-
value: value.value ?? "",
|
|
68
|
-
label: props2.label
|
|
69
|
-
};
|
|
70
|
-
if (props2.fallbackOption !== false && selectedCache.value?.value === value.value)
|
|
71
|
-
return selectedCache.value;
|
|
72
|
-
return {
|
|
73
|
-
value: value.value ?? "",
|
|
74
|
-
label: props2.fallbackOption === false ? props2.defaultText : props2.label || value.value || props2.defaultText
|
|
75
|
-
};
|
|
44
|
+
const selection$1 = selection.useSelectedPeople(props2, value, options);
|
|
45
|
+
const selected = vue.computed(() => selection$1.people.value[0] ?? {
|
|
46
|
+
value: "",
|
|
47
|
+
label: props2.label || props2.defaultText
|
|
76
48
|
});
|
|
77
49
|
const readScope = vue.computed(() => ({
|
|
78
50
|
value: value.value,
|
|
79
|
-
text: emptyPolicy.isEmpty(value.value) ? emptyPolicy.emptyText.value :
|
|
80
|
-
person: selected.value
|
|
51
|
+
text: emptyPolicy.isEmpty(value.value) ? emptyPolicy.emptyText.value : selection$1.people.value.map((person) => person.label).join(", "),
|
|
52
|
+
person: selected.value,
|
|
53
|
+
...props2.multiple ? { people: selection$1.people.value } : {}
|
|
81
54
|
}));
|
|
82
55
|
const childOptions = options;
|
|
83
56
|
async function load(query) {
|
|
@@ -113,15 +86,15 @@ const _PeopleSelect = vue.defineComponent({
|
|
|
113
86
|
if (emptyPolicy.isEmpty(value.value)) {
|
|
114
87
|
return emptyPolicy.emptyText.value;
|
|
115
88
|
}
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Person_vue_vue_type_script_setup_true_lang.default,
|
|
123
|
-
|
|
124
|
-
person
|
|
89
|
+
const renderPerson = (person) => {
|
|
90
|
+
const scope = {
|
|
91
|
+
person,
|
|
92
|
+
disabled: form.mergedDisabled.value || !person.value || !!person.disabled
|
|
93
|
+
};
|
|
94
|
+
const actions = slots.actions ? slots.actions(scope) : props2.renderActions?.(scope);
|
|
95
|
+
return vue.h(Person_vue_vue_type_script_setup_true_lang.default, {
|
|
96
|
+
key: person.value,
|
|
97
|
+
person,
|
|
125
98
|
showAvatar: props2.showAvatar,
|
|
126
99
|
disabled: scope.disabled,
|
|
127
100
|
showPhone: props2.showPhone,
|
|
@@ -129,9 +102,9 @@ const _PeopleSelect = vue.defineComponent({
|
|
|
129
102
|
call: props2.call,
|
|
130
103
|
chat: props2.chat,
|
|
131
104
|
onActionError: (error, action) => emit("action-error", error, action)
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
);
|
|
105
|
+
}, actions == null ? void 0 : { default: () => actions });
|
|
106
|
+
};
|
|
107
|
+
return props2.multiple ? vue.h("span", { class: "c-people-select-people" }, selection$1.people.value.map(renderPerson)) : renderPerson(selected.value);
|
|
135
108
|
};
|
|
136
109
|
const personSlots = () => ({
|
|
137
110
|
...slots,
|
|
@@ -153,8 +126,8 @@ const _PeopleSelect = vue.defineComponent({
|
|
|
153
126
|
ref: control,
|
|
154
127
|
modelValue: value.value,
|
|
155
128
|
options: childOptions.value,
|
|
156
|
-
label: selected.value.label,
|
|
157
|
-
fallbackOption: props2.fallbackOption === false ? false :
|
|
129
|
+
label: props2.multiple ? "" : selected.value.label,
|
|
130
|
+
fallbackOption: props2.fallbackOption === false ? false : selection$1.resolve,
|
|
158
131
|
loading: props2.loading || source.loading.value,
|
|
159
132
|
filterOption: props2.filterOption ?? !remote.value,
|
|
160
133
|
"onUpdate:modelValue": update,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const usePeopleTexts = require("./use-people-texts.js");
|
|
5
|
-
const
|
|
5
|
+
const base = require("../button/base.js");
|
|
6
6
|
const globalConfig = require("../_utils/global-config.js");
|
|
7
7
|
const _hoisted_1 = ["src"];
|
|
8
8
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -63,7 +63,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
63
63
|
}, ["stop"]))
|
|
64
64
|
}, [
|
|
65
65
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
66
|
-
__props.showPhone ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
66
|
+
__props.showPhone ? (vue.openBlock(), vue.createBlock(vue.unref(base.default), {
|
|
67
67
|
key: 0,
|
|
68
68
|
size: "xs",
|
|
69
69
|
variant: "text",
|
|
@@ -90,7 +90,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
90
90
|
])]),
|
|
91
91
|
_: 1
|
|
92
92
|
}, 8, ["disabled", "aria-label", "loading"])) : vue.createCommentVNode("", true),
|
|
93
|
-
__props.showChat ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
93
|
+
__props.showChat ? (vue.openBlock(), vue.createBlock(vue.unref(base.default), {
|
|
94
94
|
key: 1,
|
|
95
95
|
size: "xs",
|
|
96
96
|
variant: "text",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const identity = (value) => value === null || typeof value === "string";
|
|
3
|
+
const identity = (value) => value === null || typeof value === "string" || Array.isArray(value) && value.every((id) => typeof id === "string");
|
|
4
4
|
const peopleSelectEmits = {
|
|
5
5
|
"update:modelValue": identity,
|
|
6
6
|
"update:open": (open) => typeof open === "boolean",
|
|
@@ -4,6 +4,8 @@ const vue = require("vue");
|
|
|
4
4
|
const context = require("../_components/selected-options/context.js");
|
|
5
5
|
const useFormItem = require("../_hooks/use-form-item.js");
|
|
6
6
|
const select_index = require("../select/index.js");
|
|
7
|
+
const emits = require("./emits.js");
|
|
8
|
+
const selection = require("./selection.js");
|
|
7
9
|
const props = require("./props.js");
|
|
8
10
|
const globalConfig = require("../_utils/global-config.js");
|
|
9
11
|
const {
|
|
@@ -13,12 +15,7 @@ const Base = /* @__PURE__ */ vue.defineComponent({
|
|
|
13
15
|
name,
|
|
14
16
|
inheritAttrs: false,
|
|
15
17
|
props: props.peopleSelectProps,
|
|
16
|
-
emits:
|
|
17
|
-
"update:modelValue": (value) => value === null || typeof value === "string",
|
|
18
|
-
change: (value) => value === null || typeof value === "string",
|
|
19
|
-
clear: () => true,
|
|
20
|
-
search: (query) => typeof query === "string"
|
|
21
|
-
},
|
|
18
|
+
emits: emits.peopleSelectEmits,
|
|
22
19
|
setup(props2, {
|
|
23
20
|
emit,
|
|
24
21
|
attrs,
|
|
@@ -44,10 +41,10 @@ const Base = /* @__PURE__ */ vue.defineComponent({
|
|
|
44
41
|
...option
|
|
45
42
|
})));
|
|
46
43
|
const blocked = () => mergedDisabled.value || mergedReadonly.value || props2.loading;
|
|
47
|
-
const label = vue.computed(() =>
|
|
44
|
+
const label = vue.computed(() => selection.peopleText(value.value, props2));
|
|
48
45
|
const commit = (next) => {
|
|
49
46
|
if (blocked()) return;
|
|
50
|
-
const text = next === null ? null : typeof next === "string" ? next : "";
|
|
47
|
+
const text = next === null ? null : props2.multiple ? Array.isArray(next) ? next.filter((id) => typeof id === "string") : [] : typeof next === "string" ? next : "";
|
|
51
48
|
if (props2.modelValue === void 0) localValue.value = text;
|
|
52
49
|
emit("update:modelValue", text);
|
|
53
50
|
emit("change", text);
|
|
@@ -58,6 +55,7 @@ const Base = /* @__PURE__ */ vue.defineComponent({
|
|
|
58
55
|
name: props2.name
|
|
59
56
|
}, {
|
|
60
57
|
"placeholder": props2.placeholder,
|
|
58
|
+
"multiple": props2.multiple,
|
|
61
59
|
"clearable": props2.clearable,
|
|
62
60
|
"emptyValue": props2.emptyValue,
|
|
63
61
|
"filterable": props2.filterable,
|
|
@@ -4,9 +4,11 @@ const vue = require("vue");
|
|
|
4
4
|
const withFieldPresentation = require("../_components/field-presentation/with-field-presentation.js");
|
|
5
5
|
const SelectionEditor_vue_vue_type_script_setup_true_lang = require("../_components/selected-options/SelectionEditor.vue.js");
|
|
6
6
|
const peopleSelect = require("./people-select.js");
|
|
7
|
+
const selection = require("./selection.js");
|
|
7
8
|
const Presented = withFieldPresentation.withFieldPresentation(peopleSelect.default, {
|
|
9
|
+
selectionConfirmation: "update",
|
|
8
10
|
methods: ["focus", "blur"],
|
|
9
|
-
text:
|
|
11
|
+
text: selection.peopleText,
|
|
10
12
|
editor: ({ props, attrs, value, update, emit, slots, disabled, readonly }) => vue.h(
|
|
11
13
|
SelectionEditor_vue_vue_type_script_setup_true_lang.default,
|
|
12
14
|
{ kind: "people-select" },
|
|
@@ -6,6 +6,8 @@ const props = require("../select/props.js");
|
|
|
6
6
|
const props$1 = require("../_components/field-presentation/props.js");
|
|
7
7
|
const peopleSelectProps = {
|
|
8
8
|
...props$2.fieldLoadingProps,
|
|
9
|
+
/** 弹出编辑是否需要确认;未设置时单选即提交,多选保留确认。 */
|
|
10
|
+
needConfirm: { type: Boolean, default: void 0 },
|
|
9
11
|
...props$1.fieldPresentationProps,
|
|
10
12
|
emptyValue: emptyValue.emptyValueProp(),
|
|
11
13
|
/** Reactive display data for a selected value absent from options. */
|
|
@@ -43,9 +45,13 @@ const peopleSelectProps = {
|
|
|
43
45
|
type: String,
|
|
44
46
|
default: "-"
|
|
45
47
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
multiple: props.selectProps.multiple,
|
|
49
|
+
modelValue: { type: [String, Array], default: void 0 },
|
|
50
|
+
/** 非受控初始选中人员 ID 或 ID 数组,仅创建时读取。 */
|
|
51
|
+
defaultValue: {
|
|
52
|
+
type: [String, Array],
|
|
53
|
+
default: (props2) => props2.multiple ? [] : ""
|
|
54
|
+
},
|
|
49
55
|
isLabel: {
|
|
50
56
|
type: Boolean,
|
|
51
57
|
default: false
|