orio-ui 1.19.0 → 1.23.2
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 +12 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +5 -2
- package/dist/runtime/canvas.d.ts +21 -0
- package/dist/runtime/canvas.js +49 -0
- package/dist/runtime/components/Button.vue +2 -1
- package/dist/runtime/components/Canvas/REQUIREMENTS.md +174 -0
- package/dist/runtime/components/Canvas/components/Stage.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/components/Stage.vue +150 -0
- package/dist/runtime/components/Canvas/components/Stage.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/components/ToolButton.d.vue.ts +24 -0
- package/dist/runtime/components/Canvas/components/ToolButton.vue +62 -0
- package/dist/runtime/components/Canvas/components/ToolButton.vue.d.ts +24 -0
- package/dist/runtime/components/Canvas/components/Toolbar.d.vue.ts +24 -0
- package/dist/runtime/components/Canvas/components/Toolbar.vue +48 -0
- package/dist/runtime/components/Canvas/components/Toolbar.vue.d.ts +24 -0
- package/dist/runtime/components/Canvas/composables/useCanvasHistory.d.ts +17 -0
- package/dist/runtime/components/Canvas/composables/useCanvasHistory.js +76 -0
- package/dist/runtime/components/Canvas/composables/useCanvasNodes.d.ts +13 -0
- package/dist/runtime/components/Canvas/composables/useCanvasNodes.js +60 -0
- package/dist/runtime/components/Canvas/composables/useCanvasSetup.d.ts +5 -0
- package/dist/runtime/components/Canvas/composables/useCanvasSetup.js +19 -0
- package/dist/runtime/components/Canvas/context.d.ts +38 -0
- package/dist/runtime/components/Canvas/context.js +11 -0
- package/dist/runtime/components/Canvas/index.d.vue.ts +77 -0
- package/dist/runtime/components/Canvas/index.vue +208 -0
- package/dist/runtime/components/Canvas/index.vue.d.ts +77 -0
- package/dist/runtime/components/Canvas/registry.d.ts +1 -0
- package/dist/runtime/components/Canvas/registry.js +2 -0
- package/dist/runtime/components/Canvas/tools/ColorPickerWidget.d.vue.ts +7 -0
- package/dist/runtime/components/Canvas/tools/ColorPickerWidget.vue +32 -0
- package/dist/runtime/components/Canvas/tools/ColorPickerWidget.vue.d.ts +7 -0
- package/dist/runtime/components/Canvas/tools/clearTool.d.ts +1 -0
- package/dist/runtime/components/Canvas/tools/clearTool.js +16 -0
- package/dist/runtime/components/Canvas/tools/colorPickerTool.d.ts +6 -0
- package/dist/runtime/components/Canvas/tools/colorPickerTool.js +15 -0
- package/dist/runtime/components/Canvas/tools/drawTool.d.ts +16 -0
- package/dist/runtime/components/Canvas/tools/drawTool.js +92 -0
- package/dist/runtime/components/Canvas/tools/eraseTool.d.ts +5 -0
- package/dist/runtime/components/Canvas/tools/eraseTool.js +62 -0
- package/dist/runtime/components/Canvas/tools/exportTool.d.ts +18 -0
- package/dist/runtime/components/Canvas/tools/exportTool.js +89 -0
- package/dist/runtime/components/Canvas/tools/highlightTool.d.ts +11 -0
- package/dist/runtime/components/Canvas/tools/highlightTool.js +51 -0
- package/dist/runtime/components/Canvas/tools/hitTest.d.ts +20 -0
- package/dist/runtime/components/Canvas/tools/hitTest.js +111 -0
- package/dist/runtime/components/Canvas/tools/imageTool.d.ts +18 -0
- package/dist/runtime/components/Canvas/tools/imageTool.js +163 -0
- package/dist/runtime/components/Canvas/tools/moveTool.d.ts +5 -0
- package/dist/runtime/components/Canvas/tools/moveTool.js +94 -0
- package/dist/runtime/components/Canvas/tools/redoTool.d.ts +1 -0
- package/dist/runtime/components/Canvas/tools/redoTool.js +17 -0
- package/dist/runtime/components/Canvas/tools/resizeTool.d.ts +7 -0
- package/dist/runtime/components/Canvas/tools/resizeTool.js +132 -0
- package/dist/runtime/components/Canvas/tools/rotateTool.d.ts +5 -0
- package/dist/runtime/components/Canvas/tools/rotateTool.js +109 -0
- package/dist/runtime/components/Canvas/tools/textTool.d.ts +14 -0
- package/dist/runtime/components/Canvas/tools/textTool.js +99 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Clear.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Clear.vue +12 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Clear.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Draw.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Draw.vue +12 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Draw.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Erase.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Erase.vue +12 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Erase.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Export.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Export.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Export.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Highlight.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Highlight.vue +12 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Highlight.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Image.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Image.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Image.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Move.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Move.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Move.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Redo.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Redo.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Redo.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Resize.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Resize.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Resize.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Rotate.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Rotate.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Rotate.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Text.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Text.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Text.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Transform.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Transform.vue +14 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Transform.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Undo.d.vue.ts +3 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Undo.vue +13 -0
- package/dist/runtime/components/Canvas/tools/tooltips/Undo.vue.d.ts +3 -0
- package/dist/runtime/components/Canvas/tools/transformHandles.d.ts +74 -0
- package/dist/runtime/components/Canvas/tools/transformHandles.js +191 -0
- package/dist/runtime/components/Canvas/tools/transformTool.d.ts +7 -0
- package/dist/runtime/components/Canvas/tools/transformTool.js +210 -0
- package/dist/runtime/components/Canvas/tools/undoTool.d.ts +1 -0
- package/dist/runtime/components/Canvas/tools/undoTool.js +17 -0
- package/dist/runtime/components/Canvas/types.d.ts +125 -0
- package/dist/runtime/components/Canvas/types.js +3 -0
- package/dist/runtime/components/CheckBox.vue +6 -3
- package/dist/runtime/components/CheckboxGroup.vue +2 -1
- package/dist/runtime/components/ControlElement.d.vue.ts +5 -0
- package/dist/runtime/components/ControlElement.vue +19 -3
- package/dist/runtime/components/ControlElement.vue.d.ts +5 -0
- package/dist/runtime/components/DateRangePicker.vue +16 -4
- package/dist/runtime/components/Icon.vue +2 -2
- package/dist/runtime/components/Input.vue +2 -1
- package/dist/runtime/components/ListItem.d.vue.ts +29 -0
- package/dist/runtime/components/ListItem.vue +72 -0
- package/dist/runtime/components/ListItem.vue.d.ts +29 -0
- package/dist/runtime/components/LocaleSwitcher.d.vue.ts +13 -0
- package/dist/runtime/components/LocaleSwitcher.vue +43 -0
- package/dist/runtime/components/LocaleSwitcher.vue.d.ts +13 -0
- package/dist/runtime/components/NavButton.vue +2 -1
- package/dist/runtime/components/NumberInput/Horizontal.vue +2 -1
- package/dist/runtime/components/NumberInput/Vertical.vue +2 -1
- package/dist/runtime/components/NumberInput/index.vue +2 -1
- package/dist/runtime/components/RadioButton.vue +2 -1
- package/dist/runtime/components/Selector.vue +24 -22
- package/dist/runtime/components/SwitchButton.vue +2 -1
- package/dist/runtime/components/Tag.d.vue.ts +3 -2
- package/dist/runtime/components/Tag.vue +1 -0
- package/dist/runtime/components/Tag.vue.d.ts +3 -2
- package/dist/runtime/components/TaggableSelector.d.vue.ts +16 -0
- package/dist/runtime/components/TaggableSelector.vue +35 -0
- package/dist/runtime/components/TaggableSelector.vue.d.ts +16 -0
- package/dist/runtime/components/Textarea.vue +2 -1
- package/dist/runtime/components/Tooltip.vue +17 -7
- package/dist/runtime/components/ZoomableContainer.d.vue.ts +48 -0
- package/dist/runtime/components/ZoomableContainer.vue +238 -0
- package/dist/runtime/components/ZoomableContainer.vue.d.ts +48 -0
- package/dist/runtime/components/gallery/Carousel.vue +1 -1
- package/dist/runtime/components/gallery/CarouselPreview.d.vue.ts +31 -0
- package/dist/runtime/components/gallery/CarouselPreview.vue +64 -0
- package/dist/runtime/components/gallery/CarouselPreview.vue.d.ts +31 -0
- package/dist/runtime/components/view/Dates.vue +5 -3
- package/dist/runtime/components/view/KeyBinds.d.vue.ts +7 -0
- package/dist/runtime/components/view/KeyBinds.vue +36 -0
- package/dist/runtime/components/view/KeyBinds.vue.d.ts +7 -0
- package/dist/runtime/components/view/Text.vue +4 -4
- package/dist/runtime/composables/useInertia.d.ts +10 -0
- package/dist/runtime/composables/useInertia.js +49 -0
- package/dist/runtime/composables/usePinchZoom.d.ts +13 -0
- package/dist/runtime/composables/usePinchZoom.js +66 -0
- package/dist/runtime/composables/useValidation.js +11 -1
- package/dist/runtime/i18n/en.json +20 -0
- package/dist/runtime/i18n/index.d.ts +11 -0
- package/dist/runtime/i18n/index.js +19 -0
- package/dist/runtime/i18n/uk.json +20 -0
- package/dist/runtime/index.d.ts +8 -1
- package/dist/runtime/index.js +19 -1
- package/dist/runtime/plugins/i18n.d.ts +2 -0
- package/dist/runtime/plugins/i18n.js +18 -0
- package/dist/runtime/utils/icon-registry.js +13 -1
- package/package.json +9 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface ListItemProps {
|
|
2
|
+
selectable?: boolean;
|
|
3
|
+
}
|
|
4
|
+
type __VLS_Props = ListItemProps;
|
|
5
|
+
type __VLS_ModelProps = {
|
|
6
|
+
"selected"?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
|
+
declare var __VLS_1: {}, __VLS_8: {}, __VLS_10: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
start?: (props: typeof __VLS_1) => any;
|
|
12
|
+
} & {
|
|
13
|
+
default?: (props: typeof __VLS_8) => any;
|
|
14
|
+
} & {
|
|
15
|
+
end?: (props: typeof __VLS_10) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
"update:selected": (value: boolean | undefined) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
"onUpdate:selected"?: ((value: boolean | undefined) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface LocaleOption {
|
|
2
|
+
code: string;
|
|
3
|
+
flag: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
interface Props {
|
|
7
|
+
locales?: LocaleOption[];
|
|
8
|
+
}
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
10
|
+
locales: LocaleOption[];
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
locales: { type: Array, required: false, default: () => [
|
|
6
|
+
{ code: "en", flag: "\u{1F1EC}\u{1F1E7}", label: "English" },
|
|
7
|
+
{ code: "uk", flag: "\u{1F1FA}\u{1F1E6}", label: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430" }
|
|
8
|
+
] }
|
|
9
|
+
});
|
|
10
|
+
const { locale } = useI18n();
|
|
11
|
+
const selected = computed({
|
|
12
|
+
get: () => props.locales.find((l) => l.code === locale.value) ?? props.locales[0],
|
|
13
|
+
set: (val) => {
|
|
14
|
+
locale.value = val.code;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<orio-selector
|
|
21
|
+
v-model="selected"
|
|
22
|
+
:options="locales"
|
|
23
|
+
field="code"
|
|
24
|
+
option-name="label"
|
|
25
|
+
>
|
|
26
|
+
<template #trigger-label>
|
|
27
|
+
<span class="locale-trigger">
|
|
28
|
+
<span class="locale-flag">{{ selected.flag }}</span>
|
|
29
|
+
<span class="locale-label">{{ selected.label }}</span>
|
|
30
|
+
</span>
|
|
31
|
+
</template>
|
|
32
|
+
<template #option="{ option }">
|
|
33
|
+
<span class="locale-option">
|
|
34
|
+
<span class="locale-flag">{{ option.flag }}</span>
|
|
35
|
+
<span>{{ option.label }}</span>
|
|
36
|
+
</span>
|
|
37
|
+
</template>
|
|
38
|
+
</orio-selector>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<style scoped>
|
|
42
|
+
.locale-option,.locale-trigger{align-items:center;display:flex;gap:.5rem}.locale-flag{font-size:1.25em;line-height:1}
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface LocaleOption {
|
|
2
|
+
code: string;
|
|
3
|
+
flag: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
interface Props {
|
|
7
|
+
locales?: LocaleOption[];
|
|
8
|
+
}
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
10
|
+
locales: LocaleOption[];
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -10,7 +10,8 @@ const props = defineProps({
|
|
|
10
10
|
id: { type: String, required: false },
|
|
11
11
|
label: { type: String, required: false },
|
|
12
12
|
layout: { type: String, required: false },
|
|
13
|
-
size: { type: String, required: false }
|
|
13
|
+
size: { type: String, required: false },
|
|
14
|
+
fill: { type: Boolean, required: false }
|
|
14
15
|
});
|
|
15
16
|
const { disabled, active } = toRefs(props);
|
|
16
17
|
const slots = useSlots();
|
|
@@ -12,7 +12,8 @@ defineProps({
|
|
|
12
12
|
group: { type: Boolean, required: false },
|
|
13
13
|
id: { type: String, required: false },
|
|
14
14
|
label: { type: String, required: false },
|
|
15
|
-
size: { type: String, required: false }
|
|
15
|
+
size: { type: String, required: false },
|
|
16
|
+
fill: { type: Boolean, required: false }
|
|
16
17
|
});
|
|
17
18
|
const modelValue = defineModel({ type: Number, ...{ default: 0 } });
|
|
18
19
|
const { pressAndHold, stop } = usePressAndHold();
|
|
@@ -12,7 +12,8 @@ defineProps({
|
|
|
12
12
|
group: { type: Boolean, required: false },
|
|
13
13
|
id: { type: String, required: false },
|
|
14
14
|
label: { type: String, required: false },
|
|
15
|
-
size: { type: String, required: false }
|
|
15
|
+
size: { type: String, required: false },
|
|
16
|
+
fill: { type: Boolean, required: false }
|
|
16
17
|
});
|
|
17
18
|
const modelValue = defineModel({ type: Number, ...{ default: 0 } });
|
|
18
19
|
const { pressAndHold, stop } = usePressAndHold();
|
|
@@ -12,7 +12,8 @@ const props = defineProps({
|
|
|
12
12
|
group: { type: Boolean, required: false },
|
|
13
13
|
id: { type: String, required: false },
|
|
14
14
|
label: { type: String, required: false },
|
|
15
|
-
size: { type: String, required: false }
|
|
15
|
+
size: { type: String, required: false },
|
|
16
|
+
fill: { type: Boolean, required: false }
|
|
16
17
|
});
|
|
17
18
|
const { min, max, step, decimalPlaces } = toRefs(props);
|
|
18
19
|
const modelValue = defineModel({ type: Number, ...{ default: 0 } });
|
|
@@ -11,7 +11,8 @@ const props = defineProps({
|
|
|
11
11
|
id: { type: String, required: false },
|
|
12
12
|
label: { type: String, required: false },
|
|
13
13
|
layout: { type: String, required: false },
|
|
14
|
-
size: { type: String, required: false }
|
|
14
|
+
size: { type: String, required: false },
|
|
15
|
+
fill: { type: Boolean, required: false }
|
|
15
16
|
});
|
|
16
17
|
</script>
|
|
17
18
|
|
|
@@ -2,21 +2,27 @@
|
|
|
2
2
|
import { computed, ref, toRef, toRefs } from "vue";
|
|
3
3
|
import { useControlTokens } from "../composables/useControlSize";
|
|
4
4
|
import { useListKeyboard } from "../composables/useListKeyboard";
|
|
5
|
+
import { useI18n } from "vue-i18n";
|
|
6
|
+
const { t } = useI18n();
|
|
5
7
|
const props = defineProps({
|
|
6
8
|
options: { type: Array, required: true },
|
|
7
9
|
multiple: { type: Boolean, required: false },
|
|
8
10
|
field: { type: String, required: false, default: "id" },
|
|
9
11
|
optionName: { type: String, required: false },
|
|
10
|
-
placeholder: { type: String, required: false
|
|
12
|
+
placeholder: { type: String, required: false },
|
|
11
13
|
appearance: { type: String, required: false },
|
|
12
14
|
error: { type: [String, null], required: false },
|
|
13
15
|
group: { type: Boolean, required: false },
|
|
14
16
|
id: { type: String, required: false },
|
|
15
17
|
label: { type: String, required: false },
|
|
16
18
|
layout: { type: String, required: false },
|
|
17
|
-
size: { type: String, required: false }
|
|
19
|
+
size: { type: String, required: false },
|
|
20
|
+
fill: { type: Boolean, required: false }
|
|
18
21
|
});
|
|
19
|
-
const { field, optionName
|
|
22
|
+
const { field, optionName } = toRefs(props);
|
|
23
|
+
const resolvedPlaceholder = computed(
|
|
24
|
+
() => props.placeholder ?? t("selector.placeholder")
|
|
25
|
+
);
|
|
20
26
|
const modelValue = defineModel({ type: null, ...{
|
|
21
27
|
required: true
|
|
22
28
|
} });
|
|
@@ -59,7 +65,7 @@ function isOptionSelected(option) {
|
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
67
|
function getOptionLabel(option) {
|
|
62
|
-
if (!option) return
|
|
68
|
+
if (!option) return resolvedPlaceholder.value;
|
|
63
69
|
if (typeof option === "string") return option;
|
|
64
70
|
if (optionName.value) return String(option[label.value]);
|
|
65
71
|
return JSON.stringify(option);
|
|
@@ -133,7 +139,11 @@ const {
|
|
|
133
139
|
{{ getOptionLabel(modelValue) }}
|
|
134
140
|
</template>
|
|
135
141
|
<template v-else-if="Array.isArray(modelValue)">
|
|
136
|
-
<span>
|
|
142
|
+
<span>
|
|
143
|
+
{{
|
|
144
|
+
t("selector.selected", { count: modelValue.length })
|
|
145
|
+
}}
|
|
146
|
+
</span>
|
|
137
147
|
</template>
|
|
138
148
|
</slot>
|
|
139
149
|
</div>
|
|
@@ -151,15 +161,14 @@ const {
|
|
|
151
161
|
role="listbox"
|
|
152
162
|
:aria-multiselectable="multiple || void 0"
|
|
153
163
|
>
|
|
154
|
-
<
|
|
164
|
+
<orio-list-item
|
|
155
165
|
v-for="(option, index) in options"
|
|
156
166
|
:key="getOptionKey(option)"
|
|
167
|
+
:selectable="multiple"
|
|
168
|
+
:selected="isOptionSelected(option)"
|
|
157
169
|
role="option"
|
|
158
170
|
:aria-selected="isOptionSelected(option)"
|
|
159
|
-
:class="{
|
|
160
|
-
selected: isOptionSelected(option),
|
|
161
|
-
highlighted: index === highlightedIndex
|
|
162
|
-
}"
|
|
171
|
+
:class="{ highlighted: index === highlightedIndex }"
|
|
163
172
|
@click="toggleOption(option, toggle)"
|
|
164
173
|
@mouseenter="highlightedIndex = index"
|
|
165
174
|
>
|
|
@@ -172,10 +181,10 @@ const {
|
|
|
172
181
|
>
|
|
173
182
|
{{ getOptionLabel(option) }}
|
|
174
183
|
</slot>
|
|
175
|
-
</
|
|
184
|
+
</orio-list-item>
|
|
176
185
|
</ul>
|
|
177
186
|
<slot v-else name="no-options">
|
|
178
|
-
<orio-empty-state title="
|
|
187
|
+
<orio-empty-state :title="t('selector.noOptions')" size="small" />
|
|
179
188
|
</slot>
|
|
180
189
|
<slot name="options-addon" />
|
|
181
190
|
</div>
|
|
@@ -232,19 +241,12 @@ const {
|
|
|
232
241
|
padding: 0;
|
|
233
242
|
margin: 0;
|
|
234
243
|
}
|
|
235
|
-
.selector-content ul
|
|
244
|
+
.selector-content ul :deep(.list-item) {
|
|
236
245
|
padding: var(--control-py) var(--control-px);
|
|
237
246
|
cursor: pointer;
|
|
238
|
-
transition: background-color 0.15s ease, color 0.15s ease;
|
|
239
|
-
color: var(--color-text);
|
|
240
|
-
}
|
|
241
|
-
.selector-content ul li:hover, .selector-content ul li.highlighted {
|
|
242
|
-
background-color: var(--color-surface); /* neutral lift */
|
|
243
247
|
}
|
|
244
|
-
.selector-content ul
|
|
245
|
-
background-color: var(--color-
|
|
246
|
-
color: var(--color-accent-soft-darker);
|
|
247
|
-
font-weight: 400;
|
|
248
|
+
.selector-content ul :deep(.list-item).highlighted:not(.selected) {
|
|
249
|
+
background-color: var(--color-surface);
|
|
248
250
|
}
|
|
249
251
|
|
|
250
252
|
.trigger-content {
|
|
@@ -7,7 +7,8 @@ const props = defineProps({
|
|
|
7
7
|
id: { type: String, required: false },
|
|
8
8
|
label: { type: String, required: false },
|
|
9
9
|
layout: { type: String, required: false },
|
|
10
|
-
size: { type: String, required: false }
|
|
10
|
+
size: { type: String, required: false },
|
|
11
|
+
fill: { type: Boolean, required: false }
|
|
11
12
|
});
|
|
12
13
|
const modelValue = defineModel({ type: Boolean, ...{ required: false } });
|
|
13
14
|
function toggle() {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export type TagStyle = "neutral" | "accent";
|
|
2
|
-
interface
|
|
2
|
+
export interface TagProps {
|
|
3
3
|
text: string;
|
|
4
|
+
id?: string;
|
|
4
5
|
variant?: TagStyle;
|
|
5
6
|
}
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<TagProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TagProps> & Readonly<{}>, {
|
|
7
8
|
variant: TagStyle;
|
|
8
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
10
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export type TagStyle = "neutral" | "accent";
|
|
2
|
-
interface
|
|
2
|
+
export interface TagProps {
|
|
3
3
|
text: string;
|
|
4
|
+
id?: string;
|
|
4
5
|
variant?: TagStyle;
|
|
5
6
|
}
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<TagProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TagProps> & Readonly<{}>, {
|
|
7
8
|
variant: TagStyle;
|
|
8
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
10
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SelectProps } from "./Selector.vue.js";
|
|
2
|
+
import type { TagProps } from "./Tag.vue.js";
|
|
3
|
+
type __VLS_Props = SelectProps;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
modelValue?: TagProps[];
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
"update:modelValue": (value: TagProps[] | undefined) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
|
+
"onUpdate:modelValue"?: ((value: TagProps[] | undefined) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
optionName: string;
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
options: { type: Array, required: true },
|
|
4
|
+
multiple: { type: Boolean, required: false },
|
|
5
|
+
field: { type: String, required: false },
|
|
6
|
+
optionName: { type: String, required: false, default: "text" },
|
|
7
|
+
placeholder: { type: String, required: false },
|
|
8
|
+
appearance: { type: String, required: false },
|
|
9
|
+
error: { type: [String, null], required: false },
|
|
10
|
+
group: { type: Boolean, required: false },
|
|
11
|
+
id: { type: String, required: false },
|
|
12
|
+
label: { type: String, required: false },
|
|
13
|
+
layout: { type: String, required: false },
|
|
14
|
+
size: { type: String, required: false },
|
|
15
|
+
fill: { type: Boolean, required: false }
|
|
16
|
+
});
|
|
17
|
+
const modelValue = defineModel({ type: Array });
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<orio-selector v-bind="props" v-model="modelValue" multiple>
|
|
22
|
+
<template #trigger-label>
|
|
23
|
+
<orio-tag
|
|
24
|
+
v-for="tag in modelValue"
|
|
25
|
+
:key="tag.id"
|
|
26
|
+
:text="tag.text"
|
|
27
|
+
:variant="tag.variant"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
30
|
+
</orio-selector>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<style scoped>
|
|
34
|
+
:deep(.trigger-content){display:flex;flex-wrap:wrap;gap:.5rem;text-align:left}
|
|
35
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SelectProps } from "./Selector.vue.js";
|
|
2
|
+
import type { TagProps } from "./Tag.vue.js";
|
|
3
|
+
type __VLS_Props = SelectProps;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
modelValue?: TagProps[];
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
"update:modelValue": (value: TagProps[] | undefined) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
|
+
"onUpdate:modelValue"?: ((value: TagProps[] | undefined) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
optionName: string;
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -7,7 +7,8 @@ const props = defineProps({
|
|
|
7
7
|
group: { type: Boolean, required: false },
|
|
8
8
|
id: { type: String, required: false },
|
|
9
9
|
label: { type: String, required: false },
|
|
10
|
-
size: { type: String, required: false }
|
|
10
|
+
size: { type: String, required: false },
|
|
11
|
+
fill: { type: Boolean, required: false }
|
|
11
12
|
});
|
|
12
13
|
</script>
|
|
13
14
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref, computed, nextTick } from "vue";
|
|
2
|
+
import { ref, computed, nextTick, toRefs, watch } from "vue";
|
|
3
3
|
import { useEventListener } from "@vueuse/core";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
text: { type: String, required: false, default: void 0 },
|
|
@@ -8,6 +8,10 @@ const props = defineProps({
|
|
|
8
8
|
disabled: { type: Boolean, required: false, default: false },
|
|
9
9
|
offset: { type: Number, required: false, default: 8 }
|
|
10
10
|
});
|
|
11
|
+
const { disabled } = toRefs(props);
|
|
12
|
+
watch(disabled, () => {
|
|
13
|
+
if (disabled.value) hideTooltip();
|
|
14
|
+
});
|
|
11
15
|
const isVisible = ref(false);
|
|
12
16
|
const trigger = ref(null);
|
|
13
17
|
const tooltip = ref(null);
|
|
@@ -42,7 +46,7 @@ function calculatePosition() {
|
|
|
42
46
|
position.value = { top, left };
|
|
43
47
|
}
|
|
44
48
|
function showTooltip() {
|
|
45
|
-
if (
|
|
49
|
+
if (disabled.value) return;
|
|
46
50
|
if (props.delay > 0) {
|
|
47
51
|
showTimeout = setTimeout(() => {
|
|
48
52
|
isVisible.value = true;
|
|
@@ -75,7 +79,9 @@ const tooltipStyle = computed(() => ({
|
|
|
75
79
|
top: `${position.value.top}px`,
|
|
76
80
|
left: `${position.value.left}px`
|
|
77
81
|
}));
|
|
78
|
-
const arrowClass = computed(
|
|
82
|
+
const arrowClass = computed(
|
|
83
|
+
() => `orio-tooltip-arrow orio-tooltip-arrow-${props.placement}`
|
|
84
|
+
);
|
|
79
85
|
</script>
|
|
80
86
|
|
|
81
87
|
<template>
|
|
@@ -91,22 +97,26 @@ const arrowClass = computed(() => `arrow-${props.placement}`);
|
|
|
91
97
|
<Teleport v-if="isVisible" to="body">
|
|
92
98
|
<div
|
|
93
99
|
ref="tooltip"
|
|
94
|
-
class="tooltip"
|
|
100
|
+
class="orio-tooltip"
|
|
95
101
|
:style="tooltipStyle"
|
|
96
102
|
role="tooltip"
|
|
97
103
|
:aria-hidden="!isVisible"
|
|
98
104
|
>
|
|
99
|
-
<div class="content">
|
|
105
|
+
<div class="orio-tooltip-content">
|
|
100
106
|
<slot name="content">
|
|
101
107
|
{{ text }}
|
|
102
108
|
</slot>
|
|
103
109
|
</div>
|
|
104
|
-
<div :class="
|
|
110
|
+
<div :class="arrowClass" />
|
|
105
111
|
</div>
|
|
106
112
|
</Teleport>
|
|
107
113
|
</div>
|
|
108
114
|
</template>
|
|
109
115
|
|
|
110
116
|
<style scoped>
|
|
111
|
-
.trigger{align-items:center;display:inline-flex;justify-content:center}
|
|
117
|
+
.trigger{align-items:center;display:inline-flex;justify-content:center}
|
|
118
|
+
</style>
|
|
119
|
+
|
|
120
|
+
<style>
|
|
121
|
+
.orio-tooltip{pointer-events:none;position:absolute;z-index:9999}.orio-tooltip-content{background-color:rgba(0,0,0,.9);border-radius:var(--border-radius-sm,4px);box-shadow:0 2px 8px rgba(0,0,0,.15);color:#fff;font-size:var(--font-md);padding:.5rem .75rem;white-space:nowrap}.orio-tooltip-arrow{border-style:solid;height:0;position:absolute;width:0}.orio-tooltip-arrow-top{border-color:rgba(0,0,0,.9) transparent transparent;border-width:4px 4px 0;bottom:-4px;left:50%;transform:translateX(-50%)}.orio-tooltip-arrow-bottom{border-color:transparent transparent rgba(0,0,0,.9);border-width:0 4px 4px;left:50%;top:-4px;transform:translateX(-50%)}.orio-tooltip-arrow-left{border-color:transparent transparent transparent rgba(0,0,0,.9);border-width:4px 0 4px 4px;right:-4px;top:50%;transform:translateY(-50%)}.orio-tooltip-arrow-right{border-color:transparent rgba(0,0,0,.9) transparent transparent;border-width:4px 4px 4px 0;left:-4px;top:50%;transform:translateY(-50%)}
|
|
112
122
|
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface ZoomableContainerProps {
|
|
2
|
+
minScale?: number;
|
|
3
|
+
maxScale?: number;
|
|
4
|
+
initialScale?: number;
|
|
5
|
+
zoomSpeed?: number;
|
|
6
|
+
wheelPanSpeed?: number;
|
|
7
|
+
}
|
|
8
|
+
declare function setScaleAt(target: number, px: number, py: number): void;
|
|
9
|
+
declare function panBy(dx: number, dy: number): void;
|
|
10
|
+
declare function centerWorld(): void;
|
|
11
|
+
declare function resetView(): void;
|
|
12
|
+
declare var __VLS_1: {
|
|
13
|
+
scale: number;
|
|
14
|
+
tx: number;
|
|
15
|
+
ty: number;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_Slots = {} & {
|
|
18
|
+
default?: (props: typeof __VLS_1) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_base: import("vue").DefineComponent<ZoomableContainerProps, {
|
|
21
|
+
scale: import("vue").Ref<number, number>;
|
|
22
|
+
tx: import("vue").Ref<number, number>;
|
|
23
|
+
ty: import("vue").Ref<number, number>;
|
|
24
|
+
setScaleAt: typeof setScaleAt;
|
|
25
|
+
panBy: typeof panBy;
|
|
26
|
+
resetView: typeof resetView;
|
|
27
|
+
centerWorld: typeof centerWorld;
|
|
28
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
29
|
+
"update:scale": (value: number) => any;
|
|
30
|
+
"update:translate": (x: number, y: number) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<ZoomableContainerProps> & Readonly<{
|
|
32
|
+
"onUpdate:scale"?: ((value: number) => any) | undefined;
|
|
33
|
+
"onUpdate:translate"?: ((x: number, y: number) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
minScale: number;
|
|
36
|
+
maxScale: number;
|
|
37
|
+
initialScale: number;
|
|
38
|
+
zoomSpeed: number;
|
|
39
|
+
wheelPanSpeed: number;
|
|
40
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
42
|
+
declare const _default: typeof __VLS_export;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|