@voicenter-team/voicenter-ui-plus 4.0.0-beta.6 → 4.0.0-beta.8
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/README.md +4 -1
- package/library/assets/components/VcFilterBar/VcFilterAddMenu.css +1 -0
- package/library/assets/components/VcFilterBar/VcFilterBar.css +1 -0
- package/library/assets/components/VcFilterBar/VcFilterChip.css +1 -0
- package/library/assets/components/VcFilterBar/VcFilterChipEditor.css +1 -0
- package/library/assets/components/VcFilterBar/VcFilterEditorModal.css +1 -0
- package/library/assets/components/VcFilterBar/VcFilterEditorPanel.css +1 -0
- package/library/assets/components/VcFilterBar/editors/VcFilterBooleanEditor.css +1 -0
- package/library/assets/components/VcFilterBar/editors/VcFilterMultiselectEditor.css +1 -0
- package/library/assets/components/VcFilterBar/editors/VcFilterRangeEditor.css +1 -0
- package/library/assets/components/VcFilterBar/editors/VcFilterSelectEditor.css +1 -0
- package/library/assets/components/VcFilterBar/editors/VcFilterTextEditor.css +1 -0
- package/library/assets/components/VcFilterBar/editors/VcFilterTextListEditor.css +1 -0
- package/library/assets/components/VcTimeInput/VcTimeInput.css +1 -1
- package/library/components/VcFilterBar/VcFilterAddMenu.vue.mjs +380 -0
- package/library/components/VcFilterBar/VcFilterAddMenu.vue3.mjs +5 -0
- package/library/components/VcFilterBar/VcFilterBar.vue.mjs +469 -0
- package/library/components/VcFilterBar/VcFilterBar.vue3.mjs +5 -0
- package/library/components/VcFilterBar/VcFilterChip.vue.mjs +136 -0
- package/library/components/VcFilterBar/VcFilterChip.vue3.mjs +5 -0
- package/library/components/VcFilterBar/VcFilterChipEditor.vue.mjs +133 -0
- package/library/components/VcFilterBar/VcFilterChipEditor.vue3.mjs +5 -0
- package/library/components/VcFilterBar/VcFilterEditorModal.vue.mjs +90 -0
- package/library/components/VcFilterBar/VcFilterEditorModal.vue3.mjs +5 -0
- package/library/components/VcFilterBar/VcFilterEditorPanel.vue.mjs +179 -0
- package/library/components/VcFilterBar/VcFilterEditorPanel.vue3.mjs +5 -0
- package/library/components/VcFilterBar/editors/VcFilterBooleanEditor.vue.mjs +62 -0
- package/library/components/VcFilterBar/editors/VcFilterBooleanEditor.vue3.mjs +5 -0
- package/library/components/VcFilterBar/editors/VcFilterMultiselectEditor.vue.mjs +199 -0
- package/library/components/VcFilterBar/editors/VcFilterMultiselectEditor.vue3.mjs +5 -0
- package/library/components/VcFilterBar/editors/VcFilterRangeEditor.vue.mjs +124 -0
- package/library/components/VcFilterBar/editors/VcFilterRangeEditor.vue3.mjs +5 -0
- package/library/components/VcFilterBar/editors/VcFilterSelectEditor.vue.mjs +96 -0
- package/library/components/VcFilterBar/editors/VcFilterSelectEditor.vue3.mjs +5 -0
- package/library/components/VcFilterBar/editors/VcFilterTextEditor.vue.mjs +58 -0
- package/library/components/VcFilterBar/editors/VcFilterTextEditor.vue3.mjs +5 -0
- package/library/components/VcFilterBar/editors/VcFilterTextListEditor.vue.mjs +155 -0
- package/library/components/VcFilterBar/editors/VcFilterTextListEditor.vue3.mjs +5 -0
- package/library/components/VcFilterBar/filterBarChip.mjs +59 -0
- package/library/components/VcFilterBar/filterBarDate.mjs +69 -0
- package/library/components/VcFilterBar/filterBarDraft.mjs +86 -0
- package/library/components/VcFilterBar/filterBarEditors.mjs +36 -0
- package/library/components/VcFilterBar/filterBarErrors.mjs +57 -0
- package/library/components/VcFilterBar/filterBarModel.mjs +378 -0
- package/library/components/VcFilterBar/filterBarOptions.mjs +253 -0
- package/library/components/VcFilterBar/filterBarSearch.mjs +89 -0
- package/library/components/VcFilterBar/filterBarValidate.mjs +99 -0
- package/library/components/VcTimeInput/VcTimeInput.vue.mjs +178 -36
- package/library/index.mjs +227 -162
- package/library/index.mjs.br +0 -0
- package/library/index.mjs.gz +0 -0
- package/library/localization/locales/en.json.mjs +51 -1
- package/library/plugin-components.gen.mjs +125 -122
- package/library/plugin.mjs +225 -160
- package/library/plugin.mjs.br +0 -0
- package/library/plugin.mjs.gz +0 -0
- package/library/style.css +25 -1
- package/library/style.css.br +0 -0
- package/library/style.css.gz +0 -0
- package/library/tokens/tokens.mjs +2 -0
- package/library/types/components/VcFilterBar/VcFilterAddMenu.vue.d.ts +39 -0
- package/library/types/components/VcFilterBar/VcFilterBar.vue.d.ts +132 -0
- package/library/types/components/VcFilterBar/VcFilterChip.vue.d.ts +42 -0
- package/library/types/components/VcFilterBar/VcFilterChipEditor.vue.d.ts +46 -0
- package/library/types/components/VcFilterBar/VcFilterEditorModal.vue.d.ts +40 -0
- package/library/types/components/VcFilterBar/VcFilterEditorPanel.vue.d.ts +116 -0
- package/library/types/components/VcFilterBar/editors/VcFilterBooleanEditor.vue.d.ts +66 -0
- package/library/types/components/VcFilterBar/editors/VcFilterMultiselectEditor.vue.d.ts +73 -0
- package/library/types/components/VcFilterBar/editors/VcFilterRangeEditor.vue.d.ts +62 -0
- package/library/types/components/VcFilterBar/editors/VcFilterSelectEditor.vue.d.ts +62 -0
- package/library/types/components/VcFilterBar/editors/VcFilterTextEditor.vue.d.ts +68 -0
- package/library/types/components/VcFilterBar/editors/VcFilterTextListEditor.vue.d.ts +64 -0
- package/library/types/components/VcFilterBar/filterBarChip.d.ts +23 -0
- package/library/types/components/VcFilterBar/filterBarDate.d.ts +14 -0
- package/library/types/components/VcFilterBar/filterBarDraft.d.ts +28 -0
- package/library/types/components/VcFilterBar/filterBarEditors.d.ts +7 -0
- package/library/types/components/VcFilterBar/filterBarErrors.d.ts +22 -0
- package/library/types/components/VcFilterBar/filterBarModel.d.ts +83 -0
- package/library/types/components/VcFilterBar/filterBarOptions.d.ts +52 -0
- package/library/types/components/VcFilterBar/filterBarSearch.d.ts +23 -0
- package/library/types/components/VcFilterBar/filterBarValidate.d.ts +34 -0
- package/library/types/components/VcJsonSchema/Components/JsonSchemaEditor.vue.d.ts +1 -1
- package/library/types/components/VcTimeInput/VcTimeInput.vue.d.ts +29 -6
- package/library/types/components/exports.d.ts +3 -1
- package/library/types/components.gen.d.ts +1 -0
- package/library/types/entity/components/Table/VcEntityListTable.vue.d.ts +3 -3
- package/library/types/index.d.ts +8 -0
- package/library/types/localization/locales/en.json.d.ts +51 -1
- package/library/types/tokens/tokens.d.ts +2 -1
- package/library/types/types/VcFilterBar.types.d.ts +329 -0
- package/library/types/types/VcTimeInput.types.d.ts +3 -0
- package/library/types/types/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import '../../assets/components/VcFilterBar/VcFilterChipEditor.css';
|
|
2
|
+
import { defineComponent, ref, openBlock, createBlock, withCtx, unref, withDirectives, createElementBlock, withKeys, withModifiers, createVNode, createCommentVNode, createElementVNode, nextTick } from "vue";
|
|
3
|
+
import _sfc_main$1 from "../VcPopover/VcPopover.vue.mjs";
|
|
4
|
+
import '../../assets/components/VcFilterBar/VcFilterEditorPanel.css';import '../../assets/components/VcFilterBar/VcFilterChip.css';import '../../assets/components/VcPopover/VcPopover.css';/* empty css */
|
|
5
|
+
import { ClickOutside } from "element-plus";
|
|
6
|
+
import { tVU } from "../../localization/index.mjs";
|
|
7
|
+
import _sfc_main$3 from "./VcFilterChip.vue.mjs";
|
|
8
|
+
/* empty css */
|
|
9
|
+
import _sfc_main$2 from "./VcFilterEditorPanel.vue.mjs";
|
|
10
|
+
/* empty css */
|
|
11
|
+
import { useFilterDraft } from "./filterBarDraft.mjs";
|
|
12
|
+
const _hoisted_1 = ["aria-label", "onKeydown"];
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "VcFilterChipEditor",
|
|
15
|
+
props: {
|
|
16
|
+
field: {},
|
|
17
|
+
mode: {},
|
|
18
|
+
value: { type: [Array, Object, String, Boolean, Number] },
|
|
19
|
+
modelValue: {},
|
|
20
|
+
modelOptions: {},
|
|
21
|
+
editorSlots: {},
|
|
22
|
+
footerSlot: { type: Function },
|
|
23
|
+
optionsCaption: {},
|
|
24
|
+
error: {},
|
|
25
|
+
refused: {}
|
|
26
|
+
},
|
|
27
|
+
emits: ["update:modelValue", "remove"],
|
|
28
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const emit = __emit;
|
|
31
|
+
const open = ref(false);
|
|
32
|
+
const referenceRef = ref();
|
|
33
|
+
const draft = useFilterDraft({
|
|
34
|
+
model: () => props.modelValue,
|
|
35
|
+
modelOptions: () => props.modelOptions
|
|
36
|
+
});
|
|
37
|
+
function toggle() {
|
|
38
|
+
if (open.value) {
|
|
39
|
+
close();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
draft.start({
|
|
43
|
+
field: props.field,
|
|
44
|
+
origin: "edit",
|
|
45
|
+
mode: props.mode,
|
|
46
|
+
value: props.value
|
|
47
|
+
});
|
|
48
|
+
open.value = true;
|
|
49
|
+
void nextTick(() => {
|
|
50
|
+
var _a;
|
|
51
|
+
return (_a = document.querySelector(".vc-filter-chip-editor input")) == null ? void 0 : _a.focus();
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function close() {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
if (!open.value) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const next = draft.result();
|
|
60
|
+
open.value = false;
|
|
61
|
+
draft.clear();
|
|
62
|
+
if (next) {
|
|
63
|
+
emit("update:modelValue", next);
|
|
64
|
+
}
|
|
65
|
+
(_b = (_a = referenceRef.value) == null ? void 0 : _a.querySelector(".vc-filter-chip__main")) == null ? void 0 : _b.focus();
|
|
66
|
+
}
|
|
67
|
+
__expose({
|
|
68
|
+
open: toggle,
|
|
69
|
+
close
|
|
70
|
+
});
|
|
71
|
+
return (_ctx, _cache) => {
|
|
72
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
73
|
+
open: open.value,
|
|
74
|
+
trigger: "manual",
|
|
75
|
+
placement: "bottom-start",
|
|
76
|
+
"popover-width": 320,
|
|
77
|
+
"popover-class": "vc-filter-add-menu__popover"
|
|
78
|
+
}, {
|
|
79
|
+
reference: withCtx(() => [
|
|
80
|
+
createElementVNode("span", {
|
|
81
|
+
ref_key: "referenceRef",
|
|
82
|
+
ref: referenceRef,
|
|
83
|
+
class: "vc-filter-chip-editor__reference"
|
|
84
|
+
}, [
|
|
85
|
+
createVNode(_sfc_main$3, {
|
|
86
|
+
field: __props.field,
|
|
87
|
+
mode: __props.mode,
|
|
88
|
+
value: __props.value,
|
|
89
|
+
error: __props.error,
|
|
90
|
+
refused: __props.refused,
|
|
91
|
+
onEdit: toggle,
|
|
92
|
+
onRemove: _cache[0] || (_cache[0] = ($event) => emit("remove"))
|
|
93
|
+
}, null, 8, ["field", "mode", "value", "error", "refused"])
|
|
94
|
+
], 512)
|
|
95
|
+
]),
|
|
96
|
+
default: withCtx(() => [
|
|
97
|
+
open.value && unref(draft).field.value ? withDirectives((openBlock(), createElementBlock("div", {
|
|
98
|
+
key: 0,
|
|
99
|
+
class: "vc-filter-chip-editor",
|
|
100
|
+
role: "dialog",
|
|
101
|
+
"aria-label": __props.field.label,
|
|
102
|
+
onKeydown: withKeys(withModifiers(close, ["stop", "prevent"]), ["esc"])
|
|
103
|
+
}, [
|
|
104
|
+
createVNode(_sfc_main$2, {
|
|
105
|
+
field: unref(draft).field.value,
|
|
106
|
+
mode: unref(draft).mode.value,
|
|
107
|
+
value: unref(draft).value.value,
|
|
108
|
+
blocked: unref(draft).blocked.value,
|
|
109
|
+
"can-exclude": unref(draft).canExclude.value,
|
|
110
|
+
"commit-label": unref(tVU).t("voicenterUi.filterBar.done"),
|
|
111
|
+
"can-commit": unref(draft).canCommit.value,
|
|
112
|
+
error: __props.error,
|
|
113
|
+
refused: __props.refused,
|
|
114
|
+
preview: unref(draft).preview.value,
|
|
115
|
+
"editor-slots": __props.editorSlots,
|
|
116
|
+
"footer-slot": __props.footerSlot,
|
|
117
|
+
caption: __props.optionsCaption,
|
|
118
|
+
"onUpdate:mode": unref(draft).setMode,
|
|
119
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => unref(draft).value.value = $event),
|
|
120
|
+
onCommit: close
|
|
121
|
+
}, null, 8, ["field", "mode", "value", "blocked", "can-exclude", "commit-label", "can-commit", "error", "refused", "preview", "editor-slots", "footer-slot", "caption", "onUpdate:mode"])
|
|
122
|
+
], 40, _hoisted_1)), [
|
|
123
|
+
[unref(ClickOutside), close, referenceRef.value]
|
|
124
|
+
]) : createCommentVNode("", true)
|
|
125
|
+
]),
|
|
126
|
+
_: 1
|
|
127
|
+
}, 8, ["open"]);
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
export {
|
|
132
|
+
_sfc_main as default
|
|
133
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import '../../assets/components/VcFilterBar/VcFilterEditorModal.css';
|
|
2
|
+
import { defineComponent, computed, ref, openBlock, createBlock, unref, withCtx, createCommentVNode } from "vue";
|
|
3
|
+
import _sfc_main$1 from "../VcModal/VcModal.vue.mjs";
|
|
4
|
+
import '../../assets/components/VcFilterBar/VcFilterEditorPanel.css';import '../../assets/components/VcModal/VcModal.css';/* empty css */
|
|
5
|
+
import { tVU } from "../../localization/index.mjs";
|
|
6
|
+
import { convertToUnit } from "../../utils/helpers.mjs";
|
|
7
|
+
import _sfc_main$2 from "./VcFilterEditorPanel.vue.mjs";
|
|
8
|
+
/* empty css */
|
|
9
|
+
import { useFilterDraft } from "./filterBarDraft.mjs";
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
__name: "VcFilterEditorModal",
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: {},
|
|
14
|
+
modelOptions: {},
|
|
15
|
+
editorSlots: {},
|
|
16
|
+
footerSlot: { type: Function },
|
|
17
|
+
optionsCaption: {}
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:modelValue"],
|
|
20
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const emit = __emit;
|
|
23
|
+
const draft = useFilterDraft({
|
|
24
|
+
model: () => props.modelValue,
|
|
25
|
+
modelOptions: () => props.modelOptions
|
|
26
|
+
});
|
|
27
|
+
const width = computed(() => {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
const value = (_b = (_a = draft.field.value) == null ? void 0 : _a.editorContainer) == null ? void 0 : _b.width;
|
|
30
|
+
return value === void 0 ? "40rem" : convertToUnit(value);
|
|
31
|
+
});
|
|
32
|
+
const error = ref();
|
|
33
|
+
const refused = ref([]);
|
|
34
|
+
function open(next) {
|
|
35
|
+
error.value = next.error;
|
|
36
|
+
refused.value = next.refused ?? [];
|
|
37
|
+
draft.start(next);
|
|
38
|
+
}
|
|
39
|
+
function cancel() {
|
|
40
|
+
draft.clear();
|
|
41
|
+
}
|
|
42
|
+
function commit() {
|
|
43
|
+
const next = draft.result();
|
|
44
|
+
draft.clear();
|
|
45
|
+
if (next) {
|
|
46
|
+
emit("update:modelValue", next);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
__expose({ open });
|
|
50
|
+
return (_ctx, _cache) => {
|
|
51
|
+
var _a;
|
|
52
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
53
|
+
visible: !!unref(draft).field.value,
|
|
54
|
+
header: ((_a = unref(draft).field.value) == null ? void 0 : _a.label) ?? "",
|
|
55
|
+
width: width.value,
|
|
56
|
+
"data-test-name": "vc-filter-editor-modal",
|
|
57
|
+
onClose: cancel
|
|
58
|
+
}, {
|
|
59
|
+
default: withCtx(() => [
|
|
60
|
+
unref(draft).field.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
61
|
+
key: 0,
|
|
62
|
+
field: unref(draft).field.value,
|
|
63
|
+
mode: unref(draft).mode.value,
|
|
64
|
+
value: unref(draft).value.value,
|
|
65
|
+
applied: unref(draft).applied.value,
|
|
66
|
+
blocked: unref(draft).blocked.value,
|
|
67
|
+
"can-exclude": unref(draft).canExclude.value,
|
|
68
|
+
"show-title": false,
|
|
69
|
+
"commit-label": unref(draft).origin.value === "add" ? unref(tVU).t("voicenterUi.filterBar.addFilter") : unref(tVU).t("voicenterUi.filterBar.done"),
|
|
70
|
+
"can-commit": unref(draft).canCommit.value,
|
|
71
|
+
error: error.value,
|
|
72
|
+
refused: refused.value,
|
|
73
|
+
preview: unref(draft).preview.value,
|
|
74
|
+
"editor-slots": __props.editorSlots,
|
|
75
|
+
"footer-slot": __props.footerSlot,
|
|
76
|
+
caption: __props.optionsCaption,
|
|
77
|
+
class: "vc-filter-editor-modal__panel",
|
|
78
|
+
"onUpdate:mode": unref(draft).setMode,
|
|
79
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => unref(draft).value.value = $event),
|
|
80
|
+
onCommit: commit
|
|
81
|
+
}, null, 8, ["field", "mode", "value", "applied", "blocked", "can-exclude", "commit-label", "can-commit", "error", "refused", "preview", "editor-slots", "footer-slot", "caption", "onUpdate:mode"])) : createCommentVNode("", true)
|
|
82
|
+
]),
|
|
83
|
+
_: 1
|
|
84
|
+
}, 8, ["visible", "header", "width"]);
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export {
|
|
89
|
+
_sfc_main as default
|
|
90
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import '../../assets/components/VcFilterBar/VcFilterEditorPanel.css';
|
|
2
|
+
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, createBlock, unref, createCommentVNode, toDisplayString, createVNode, resolveDynamicComponent, mergeProps, withCtx, createTextVNode } from "vue";
|
|
3
|
+
import { ArrowLeft, Info } from "@lucide/vue";
|
|
4
|
+
import _sfc_main$4 from "../VcButton/VcButton.vue.mjs";
|
|
5
|
+
import '../../assets/components/VcRadioButtons/VcRadioButtonsGroup.css';import '../../assets/components/VcIcon/VcIcon.css';import '../../assets/components/VcButton/VcButtonIcon.css';import '../../assets/components/VcButton/VcButton.css';/* empty css */
|
|
6
|
+
import _sfc_main$1 from "../VcButton/VcButtonIcon.vue.mjs";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import _sfc_main$3 from "../VcIcon/VcIcon.vue.mjs";
|
|
9
|
+
/* empty css */
|
|
10
|
+
import _sfc_main$2 from "../VcRadioButtons/VcRadioButtonsGroup.vue.mjs";
|
|
11
|
+
/* empty css */
|
|
12
|
+
import { tVU } from "../../localization/index.mjs";
|
|
13
|
+
import { getEditorSlot, BUILT_IN_EDITORS } from "./filterBarEditors.mjs";
|
|
14
|
+
const _hoisted_1 = ["data-test"];
|
|
15
|
+
const _hoisted_2 = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "vc-filter-editor-panel__head"
|
|
18
|
+
};
|
|
19
|
+
const _hoisted_3 = { class: "vc-filter-editor-panel__head-start" };
|
|
20
|
+
const _hoisted_4 = {
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "vc-filter-editor-panel__title"
|
|
23
|
+
};
|
|
24
|
+
const _hoisted_5 = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "vc-filter-editor-panel__note"
|
|
27
|
+
};
|
|
28
|
+
const _hoisted_6 = {
|
|
29
|
+
key: 2,
|
|
30
|
+
class: "vc-filter-editor-panel__error",
|
|
31
|
+
role: "alert"
|
|
32
|
+
};
|
|
33
|
+
const _hoisted_7 = { class: "vc-filter-editor-panel__foot" };
|
|
34
|
+
const _hoisted_8 = { class: "vc-filter-editor-panel__foot-start" };
|
|
35
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
36
|
+
__name: "VcFilterEditorPanel",
|
|
37
|
+
props: {
|
|
38
|
+
field: {},
|
|
39
|
+
mode: {},
|
|
40
|
+
value: { type: [Array, Object, String, Boolean, Number], default: void 0 },
|
|
41
|
+
applied: { default: () => [] },
|
|
42
|
+
blocked: { default: () => [] },
|
|
43
|
+
canExclude: { type: Boolean, default: false },
|
|
44
|
+
showBack: { type: Boolean, default: false },
|
|
45
|
+
showTitle: { type: Boolean, default: true },
|
|
46
|
+
commitLabel: {},
|
|
47
|
+
canCommit: { type: Boolean, default: false },
|
|
48
|
+
editorSlots: { default: void 0 },
|
|
49
|
+
footerSlot: { type: Function, default: void 0 },
|
|
50
|
+
preview: { default: void 0 },
|
|
51
|
+
caption: { default: void 0 },
|
|
52
|
+
error: { default: void 0 },
|
|
53
|
+
refused: { default: () => [] }
|
|
54
|
+
},
|
|
55
|
+
emits: ["update:mode", "update:value", "back", "commit"],
|
|
56
|
+
setup(__props, { emit: __emit }) {
|
|
57
|
+
const props = __props;
|
|
58
|
+
const emit = __emit;
|
|
59
|
+
const modeOptions = computed(() => [
|
|
60
|
+
{
|
|
61
|
+
value: "include",
|
|
62
|
+
label: tVU.t("voicenterUi.filterBar.include")
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
value: "exclude",
|
|
66
|
+
label: tVU.t("voicenterUi.filterBar.exclude")
|
|
67
|
+
}
|
|
68
|
+
]);
|
|
69
|
+
function onMode(mode) {
|
|
70
|
+
if (mode === "include" || mode === "exclude") {
|
|
71
|
+
emit("update:mode", mode);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const editorBindings = computed(() => ({
|
|
75
|
+
modelValue: props.value,
|
|
76
|
+
field: props.field,
|
|
77
|
+
mode: props.mode,
|
|
78
|
+
blocked: props.blocked,
|
|
79
|
+
applied: props.applied,
|
|
80
|
+
error: props.error,
|
|
81
|
+
refused: props.refused,
|
|
82
|
+
...props.field.kind === "multiselect" && props.caption ? { caption: props.caption } : {}
|
|
83
|
+
}));
|
|
84
|
+
const isBuiltIn = computed(() => !getEditorSlot(props.field, props.editorSlots) && !props.field.editor);
|
|
85
|
+
const editorComponent = computed(() => {
|
|
86
|
+
const slot = getEditorSlot(props.field, props.editorSlots);
|
|
87
|
+
if (slot) {
|
|
88
|
+
const fromSlot = () => slot({
|
|
89
|
+
value: props.value,
|
|
90
|
+
update: (value) => emit("update:value", value),
|
|
91
|
+
field: props.field,
|
|
92
|
+
mode: props.mode,
|
|
93
|
+
blocked: props.blocked,
|
|
94
|
+
applied: props.applied,
|
|
95
|
+
close: () => emit("commit")
|
|
96
|
+
});
|
|
97
|
+
return fromSlot;
|
|
98
|
+
}
|
|
99
|
+
return props.field.editor ?? BUILT_IN_EDITORS[props.field.kind];
|
|
100
|
+
});
|
|
101
|
+
const footerRenderer = computed(() => {
|
|
102
|
+
const slot = props.footerSlot;
|
|
103
|
+
if (!slot) {
|
|
104
|
+
return void 0;
|
|
105
|
+
}
|
|
106
|
+
return () => slot({
|
|
107
|
+
field: props.field,
|
|
108
|
+
mode: props.mode,
|
|
109
|
+
value: props.value,
|
|
110
|
+
preview: props.preview
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
return (_ctx, _cache) => {
|
|
114
|
+
return openBlock(), createElementBlock("div", {
|
|
115
|
+
class: "vc-filter-editor-panel",
|
|
116
|
+
"data-test": `vc-filter-editor-${__props.field.key}`
|
|
117
|
+
}, [
|
|
118
|
+
__props.showTitle || __props.canExclude ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
119
|
+
createElementVNode("span", _hoisted_3, [
|
|
120
|
+
__props.showBack ? (openBlock(), createBlock(_sfc_main$1, {
|
|
121
|
+
key: 0,
|
|
122
|
+
icon: unref(ArrowLeft),
|
|
123
|
+
small: "",
|
|
124
|
+
plain: "",
|
|
125
|
+
color: "secondary",
|
|
126
|
+
"aria-label": unref(tVU).t("voicenterUi.filterBar.back"),
|
|
127
|
+
"data-test": "vc-filter-menu-back",
|
|
128
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("back"))
|
|
129
|
+
}, null, 8, ["icon", "aria-label"])) : createCommentVNode("", true),
|
|
130
|
+
__props.showTitle ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(__props.field.label), 1)) : createCommentVNode("", true)
|
|
131
|
+
]),
|
|
132
|
+
__props.canExclude ? (openBlock(), createBlock(_sfc_main$2, {
|
|
133
|
+
key: 0,
|
|
134
|
+
"model-value": __props.mode,
|
|
135
|
+
radios: modeOptions.value,
|
|
136
|
+
config: { valueKey: "value", labelKey: "label" },
|
|
137
|
+
size: "small",
|
|
138
|
+
"aria-label": __props.field.label,
|
|
139
|
+
"data-test": "vc-filter-menu-mode",
|
|
140
|
+
"onUpdate:modelValue": onMode
|
|
141
|
+
}, null, 8, ["model-value", "radios", "aria-label"])) : createCommentVNode("", true)
|
|
142
|
+
])) : createCommentVNode("", true),
|
|
143
|
+
__props.mode === "exclude" ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
144
|
+
createVNode(_sfc_main$3, {
|
|
145
|
+
icon: unref(Info),
|
|
146
|
+
class: "vc-filter-editor-panel__note-icon"
|
|
147
|
+
}, null, 8, ["icon"]),
|
|
148
|
+
createElementVNode("span", null, toDisplayString(unref(tVU).t("voicenterUi.filterBar.excludeNote")), 1)
|
|
149
|
+
])) : createCommentVNode("", true),
|
|
150
|
+
__props.error && !isBuiltIn.value ? (openBlock(), createElementBlock("p", _hoisted_6, toDisplayString(__props.error), 1)) : createCommentVNode("", true),
|
|
151
|
+
editorComponent.value ? (openBlock(), createBlock(resolveDynamicComponent(editorComponent.value), mergeProps({
|
|
152
|
+
key: `${__props.field.key}:${__props.mode}`
|
|
153
|
+
}, editorBindings.value, {
|
|
154
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => emit("update:value", $event)),
|
|
155
|
+
onClose: _cache[2] || (_cache[2] = ($event) => emit("commit"))
|
|
156
|
+
}), null, 16)) : createCommentVNode("", true),
|
|
157
|
+
createElementVNode("div", _hoisted_7, [
|
|
158
|
+
createElementVNode("span", _hoisted_8, [
|
|
159
|
+
footerRenderer.value ? (openBlock(), createBlock(resolveDynamicComponent(footerRenderer.value), { key: 0 })) : createCommentVNode("", true)
|
|
160
|
+
]),
|
|
161
|
+
createVNode(_sfc_main$4, {
|
|
162
|
+
size: "small",
|
|
163
|
+
disabled: !__props.canCommit,
|
|
164
|
+
"data-test": "vc-filter-menu-commit",
|
|
165
|
+
onClick: _cache[3] || (_cache[3] = ($event) => emit("commit"))
|
|
166
|
+
}, {
|
|
167
|
+
default: withCtx(() => [
|
|
168
|
+
createTextVNode(toDisplayString(__props.commitLabel), 1)
|
|
169
|
+
]),
|
|
170
|
+
_: 1
|
|
171
|
+
}, 8, ["disabled"])
|
|
172
|
+
])
|
|
173
|
+
], 8, _hoisted_1);
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
export {
|
|
178
|
+
_sfc_main as default
|
|
179
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import '../../../assets/components/VcFilterBar/editors/VcFilterBooleanEditor.css';
|
|
2
|
+
import { defineComponent, computed, openBlock, createElementBlock, toDisplayString, createCommentVNode, createVNode } from "vue";
|
|
3
|
+
import _sfc_main$1 from "../../VcRadioButtons/VcRadioButtonsGroup.vue.mjs";
|
|
4
|
+
import '../../../assets/components/VcRadioButtons/VcRadioButtonsGroup.css';/* empty css */
|
|
5
|
+
import { tVU } from "../../../localization/index.mjs";
|
|
6
|
+
const _hoisted_1 = { class: "vc-filter-boolean-editor" };
|
|
7
|
+
const _hoisted_2 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "vc-filter-boolean-editor__error",
|
|
10
|
+
role: "alert"
|
|
11
|
+
};
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
__name: "VcFilterBooleanEditor",
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: { type: [Array, Object, String, Boolean, Number], default: void 0 },
|
|
16
|
+
field: {},
|
|
17
|
+
mode: {},
|
|
18
|
+
blocked: { default: () => [] },
|
|
19
|
+
applied: { default: () => [] },
|
|
20
|
+
error: { default: void 0 },
|
|
21
|
+
refused: { default: () => [] }
|
|
22
|
+
},
|
|
23
|
+
emits: ["update:modelValue"],
|
|
24
|
+
setup(__props, { emit: __emit }) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const emit = __emit;
|
|
27
|
+
const options = computed(() => [
|
|
28
|
+
{
|
|
29
|
+
value: "yes",
|
|
30
|
+
label: tVU.t("voicenterUi.filterBar.yes")
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
value: "no",
|
|
34
|
+
label: tVU.t("voicenterUi.filterBar.no")
|
|
35
|
+
}
|
|
36
|
+
]);
|
|
37
|
+
const selected = computed(() => {
|
|
38
|
+
if (props.modelValue === true) {
|
|
39
|
+
return "yes";
|
|
40
|
+
}
|
|
41
|
+
return props.modelValue === false ? "no" : void 0;
|
|
42
|
+
});
|
|
43
|
+
function onChange(value) {
|
|
44
|
+
emit("update:modelValue", value === "yes" ? true : value === "no" ? false : void 0);
|
|
45
|
+
}
|
|
46
|
+
return (_ctx, _cache) => {
|
|
47
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
48
|
+
__props.error ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(__props.error), 1)) : createCommentVNode("", true),
|
|
49
|
+
createVNode(_sfc_main$1, {
|
|
50
|
+
"model-value": selected.value,
|
|
51
|
+
radios: options.value,
|
|
52
|
+
config: { valueKey: "value", labelKey: "label" },
|
|
53
|
+
"aria-label": __props.field.label,
|
|
54
|
+
"onUpdate:modelValue": onChange
|
|
55
|
+
}, null, 8, ["model-value", "radios", "aria-label"])
|
|
56
|
+
]);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
export {
|
|
61
|
+
_sfc_main as default
|
|
62
|
+
};
|