@getcortexlabs/mavis-core 0.1.0-rc.15 → 0.1.0-rc.16
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 +2 -2
- package/dist/avatar.d.ts +5 -0
- package/dist/avatar.d.ts.map +1 -1
- package/dist/capabilities.d.ts +17 -1827
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +9 -90
- package/dist/capabilities.js.map +1 -1
- package/dist/contracts.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/vue/advanced-collections.d.ts +16 -16
- package/dist/vue/animated-text.d.ts +4 -4
- package/dist/vue/chart.d.ts +5 -5
- package/dist/vue/command-palette.d.ts +4 -4
- package/dist/vue/component-props.d.ts +90 -20
- package/dist/vue/component-props.d.ts.map +1 -1
- package/dist/vue/component-props.js +4 -0
- package/dist/vue/component-props.js.map +1 -1
- package/dist/vue/composer.d.ts +11 -9
- package/dist/vue/composer.d.ts.map +1 -1
- package/dist/vue/composer.js +12 -16
- package/dist/vue/composer.js.map +1 -1
- package/dist/vue/configurator.d.ts +16 -16
- package/dist/vue/creative-controls.d.ts +11 -11
- package/dist/vue/dashboard-charts.d.ts +6 -6
- package/dist/vue/dashboard-effects.d.ts +7 -7
- package/dist/vue/date-picker.d.ts +52 -52
- package/dist/vue/discovery-controls.d.ts +8 -8
- package/dist/vue/editor-controls.d.ts +223 -0
- package/dist/vue/editor-controls.d.ts.map +1 -0
- package/dist/vue/editor-controls.js +323 -0
- package/dist/vue/editor-controls.js.map +1 -0
- package/dist/vue/global-components.d.ts +22 -1
- package/dist/vue/global-components.d.ts.map +1 -1
- package/dist/vue/image-cropper.d.ts +8 -8
- package/dist/vue/image-cropper.d.ts.map +1 -1
- package/dist/vue/index.d.ts +3 -2
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +1 -0
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/kanban.d.ts +2 -2
- package/dist/vue/marquee.d.ts +4 -4
- package/dist/vue/menu.d.ts +4 -4
- package/dist/vue/number-flow.d.ts +3 -3
- package/dist/vue/platform.d.ts +1 -2
- package/dist/vue/platform.d.ts.map +1 -1
- package/dist/vue/platform.js.map +1 -1
- package/dist/vue/props.d.ts +40 -40
- package/dist/vue/reveal-state.d.ts +1 -1
- package/dist/vue/scheduler.d.ts +10 -10
- package/dist/vue/screen-component-props.d.ts +10 -0
- package/dist/vue/screen-component-props.d.ts.map +1 -1
- package/dist/vue/screen-component-props.js +6 -0
- package/dist/vue/screen-component-props.js.map +1 -1
- package/dist/vue/scroll-frame.d.ts +28 -6
- package/dist/vue/scroll-frame.d.ts.map +1 -1
- package/dist/vue/scroll-frame.js +51 -4
- package/dist/vue/scroll-frame.js.map +1 -1
- package/dist/vue/speed-dial.d.ts +3 -3
- package/dist/vue/swipe-actions.d.ts +3 -3
- package/dist/vue/swipe-deck.d.ts +3 -3
- package/dist/vue/theme-provider.d.ts +17 -2
- package/dist/vue/theme-provider.d.ts.map +1 -1
- package/dist/vue/theme-provider.js +7 -1
- package/dist/vue/theme-provider.js.map +1 -1
- package/dist/vue/theme.d.ts +7 -0
- package/dist/vue/theme.d.ts.map +1 -1
- package/dist/vue/theme.js +23 -19
- package/dist/vue/theme.js.map +1 -1
- package/dist/vue/time-picker.d.ts +20 -20
- package/dist/vue/tour.d.ts +3 -3
- package/dist/vue/tree-view.d.ts +3 -3
- package/dist/vue/wayfinding-controls.d.ts +1 -1
- package/dist/vue/workflows.d.ts +3 -3
- package/package.json +1 -1
- package/src/avatar.ts +6 -0
- package/src/capabilities.ts +9 -90
- package/src/index.ts +2 -7
- package/src/vue/component-props.ts +4 -0
- package/src/vue/composer.ts +22 -16
- package/src/vue/editor-controls.ts +370 -0
- package/src/vue/global-components.ts +21 -1
- package/src/vue/index.ts +3 -1
- package/src/vue/platform.ts +1 -2
- package/src/vue/screen-component-props.ts +6 -0
- package/src/vue/scroll-frame.ts +70 -5
- package/src/vue/theme-provider.ts +14 -1
- package/src/vue/theme.ts +31 -18
- package/dist/macos-capabilities.generated.d.ts +0 -1738
- package/dist/macos-capabilities.generated.d.ts.map +0 -1
- package/dist/macos-capabilities.generated.js +0 -4191
- package/dist/macos-capabilities.generated.js.map +0 -1
- package/src/macos-capabilities.generated.ts +0 -4190
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { type Component, type PropType } from '@vue/runtime-core';
|
|
2
|
+
import { type AvatarMember } from '../avatar.js';
|
|
3
|
+
export declare const searchBarProps: {
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
clearLabel: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
cancelLabel: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
showCancel: BooleanConstructor;
|
|
17
|
+
id: StringConstructor;
|
|
18
|
+
label: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
placeholder: StringConstructor;
|
|
23
|
+
disabled: BooleanConstructor;
|
|
24
|
+
};
|
|
25
|
+
export declare const tagInputProps: {
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: PropType<readonly string[]>;
|
|
28
|
+
default: () => never[];
|
|
29
|
+
};
|
|
30
|
+
addLabel: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
removeLabel: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
maxTags: NumberConstructor;
|
|
39
|
+
id: StringConstructor;
|
|
40
|
+
label: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
required: true;
|
|
43
|
+
};
|
|
44
|
+
placeholder: StringConstructor;
|
|
45
|
+
disabled: BooleanConstructor;
|
|
46
|
+
};
|
|
47
|
+
export declare const avatarGroupProps: {
|
|
48
|
+
id: StringConstructor;
|
|
49
|
+
members: {
|
|
50
|
+
type: PropType<readonly AvatarMember[]>;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
53
|
+
maxVisible: {
|
|
54
|
+
type: NumberConstructor;
|
|
55
|
+
default: number;
|
|
56
|
+
};
|
|
57
|
+
size: {
|
|
58
|
+
type: PropType<"sm" | "md" | "lg" | "xl">;
|
|
59
|
+
default: "sm" | "md" | "lg" | "xl";
|
|
60
|
+
validator: (value: "sm" | "md" | "lg" | "xl") => boolean;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare function createEditorControls(ui: {
|
|
64
|
+
Row: Component;
|
|
65
|
+
Column: Component;
|
|
66
|
+
Input: Component;
|
|
67
|
+
Chip: Component;
|
|
68
|
+
Button: Component;
|
|
69
|
+
Avatar: Component;
|
|
70
|
+
}, platform: 'web' | 'native'): {
|
|
71
|
+
MTagInput: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
|
|
72
|
+
modelValue: {
|
|
73
|
+
type: PropType<readonly string[]>;
|
|
74
|
+
default: () => never[];
|
|
75
|
+
};
|
|
76
|
+
addLabel: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
default: string;
|
|
79
|
+
};
|
|
80
|
+
removeLabel: {
|
|
81
|
+
type: StringConstructor;
|
|
82
|
+
default: string;
|
|
83
|
+
};
|
|
84
|
+
maxTags: NumberConstructor;
|
|
85
|
+
id: StringConstructor;
|
|
86
|
+
label: {
|
|
87
|
+
type: StringConstructor;
|
|
88
|
+
required: true;
|
|
89
|
+
};
|
|
90
|
+
placeholder: StringConstructor;
|
|
91
|
+
disabled: BooleanConstructor;
|
|
92
|
+
}>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
93
|
+
[key: string]: any;
|
|
94
|
+
}>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
|
|
95
|
+
'update:modelValue': (_v: string[]) => true;
|
|
96
|
+
}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
97
|
+
modelValue: {
|
|
98
|
+
type: PropType<readonly string[]>;
|
|
99
|
+
default: () => never[];
|
|
100
|
+
};
|
|
101
|
+
addLabel: {
|
|
102
|
+
type: StringConstructor;
|
|
103
|
+
default: string;
|
|
104
|
+
};
|
|
105
|
+
removeLabel: {
|
|
106
|
+
type: StringConstructor;
|
|
107
|
+
default: string;
|
|
108
|
+
};
|
|
109
|
+
maxTags: NumberConstructor;
|
|
110
|
+
id: StringConstructor;
|
|
111
|
+
label: {
|
|
112
|
+
type: StringConstructor;
|
|
113
|
+
required: true;
|
|
114
|
+
};
|
|
115
|
+
placeholder: StringConstructor;
|
|
116
|
+
disabled: BooleanConstructor;
|
|
117
|
+
}>> & Readonly<{
|
|
118
|
+
"onUpdate:modelValue"?: ((_v: string[]) => any) | undefined;
|
|
119
|
+
}>, {
|
|
120
|
+
disabled: boolean;
|
|
121
|
+
modelValue: readonly string[];
|
|
122
|
+
addLabel: string;
|
|
123
|
+
removeLabel: string;
|
|
124
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
125
|
+
MSearchBar: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
|
|
126
|
+
modelValue: {
|
|
127
|
+
type: StringConstructor;
|
|
128
|
+
default: string;
|
|
129
|
+
};
|
|
130
|
+
clearLabel: {
|
|
131
|
+
type: StringConstructor;
|
|
132
|
+
default: string;
|
|
133
|
+
};
|
|
134
|
+
cancelLabel: {
|
|
135
|
+
type: StringConstructor;
|
|
136
|
+
default: string;
|
|
137
|
+
};
|
|
138
|
+
showCancel: BooleanConstructor;
|
|
139
|
+
id: StringConstructor;
|
|
140
|
+
label: {
|
|
141
|
+
type: StringConstructor;
|
|
142
|
+
required: true;
|
|
143
|
+
};
|
|
144
|
+
placeholder: StringConstructor;
|
|
145
|
+
disabled: BooleanConstructor;
|
|
146
|
+
}>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
147
|
+
[key: string]: any;
|
|
148
|
+
}>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
|
|
149
|
+
'update:modelValue': (_v: string) => true;
|
|
150
|
+
submit: (_v: string) => true;
|
|
151
|
+
clear: () => true;
|
|
152
|
+
cancel: () => true;
|
|
153
|
+
}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
154
|
+
modelValue: {
|
|
155
|
+
type: StringConstructor;
|
|
156
|
+
default: string;
|
|
157
|
+
};
|
|
158
|
+
clearLabel: {
|
|
159
|
+
type: StringConstructor;
|
|
160
|
+
default: string;
|
|
161
|
+
};
|
|
162
|
+
cancelLabel: {
|
|
163
|
+
type: StringConstructor;
|
|
164
|
+
default: string;
|
|
165
|
+
};
|
|
166
|
+
showCancel: BooleanConstructor;
|
|
167
|
+
id: StringConstructor;
|
|
168
|
+
label: {
|
|
169
|
+
type: StringConstructor;
|
|
170
|
+
required: true;
|
|
171
|
+
};
|
|
172
|
+
placeholder: StringConstructor;
|
|
173
|
+
disabled: BooleanConstructor;
|
|
174
|
+
}>> & Readonly<{
|
|
175
|
+
onCancel?: (() => any) | undefined;
|
|
176
|
+
onClear?: (() => any) | undefined;
|
|
177
|
+
onSubmit?: ((_v: string) => any) | undefined;
|
|
178
|
+
"onUpdate:modelValue"?: ((_v: string) => any) | undefined;
|
|
179
|
+
}>, {
|
|
180
|
+
disabled: boolean;
|
|
181
|
+
modelValue: string;
|
|
182
|
+
cancelLabel: string;
|
|
183
|
+
clearLabel: string;
|
|
184
|
+
showCancel: boolean;
|
|
185
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
186
|
+
MAvatarGroup: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
|
|
187
|
+
id: StringConstructor;
|
|
188
|
+
members: {
|
|
189
|
+
type: PropType<readonly AvatarMember[]>;
|
|
190
|
+
required: true;
|
|
191
|
+
};
|
|
192
|
+
maxVisible: {
|
|
193
|
+
type: NumberConstructor;
|
|
194
|
+
default: number;
|
|
195
|
+
};
|
|
196
|
+
size: {
|
|
197
|
+
type: PropType<"sm" | "md" | "lg" | "xl">;
|
|
198
|
+
default: "sm" | "md" | "lg" | "xl";
|
|
199
|
+
validator: (value: "sm" | "md" | "lg" | "xl") => boolean;
|
|
200
|
+
};
|
|
201
|
+
}>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
|
|
202
|
+
[key: string]: any;
|
|
203
|
+
}>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
204
|
+
id: StringConstructor;
|
|
205
|
+
members: {
|
|
206
|
+
type: PropType<readonly AvatarMember[]>;
|
|
207
|
+
required: true;
|
|
208
|
+
};
|
|
209
|
+
maxVisible: {
|
|
210
|
+
type: NumberConstructor;
|
|
211
|
+
default: number;
|
|
212
|
+
};
|
|
213
|
+
size: {
|
|
214
|
+
type: PropType<"sm" | "md" | "lg" | "xl">;
|
|
215
|
+
default: "sm" | "md" | "lg" | "xl";
|
|
216
|
+
validator: (value: "sm" | "md" | "lg" | "xl") => boolean;
|
|
217
|
+
};
|
|
218
|
+
}>> & Readonly<{}>, {
|
|
219
|
+
size: "sm" | "md" | "lg" | "xl";
|
|
220
|
+
maxVisible: number;
|
|
221
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=editor-controls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-controls.d.ts","sourceRoot":"","sources":["../../src/vue/editor-controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEpG,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,cAAc,CAAA;AAU7D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;CAM1B,CAAA;AACD,eAAO,MAAM,aAAa;;cAEK,QAAQ,CAAC,SAAS,MAAM,EAAE,CAAC;;;;;;;;;;;;;;;;;;;CAIzD,CAAA;AACD,eAAO,MAAM,gBAAgB;;;cAED,QAAQ,CAAC,SAAS,YAAY,EAAE,CAAC;;;;;;;;;;;;CAG5D,CAAA;AAED,wBAAgB,oBAAoB,CAClC,EAAE,EAAE;IACF,GAAG,EAAE,SAAS,CAAA;IACd,MAAM,EAAE,SAAS,CAAA;IACjB,KAAK,EAAE,SAAS,CAAA;IAChB,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,EAAE,SAAS,CAAA;IACjB,MAAM,EAAE,SAAS,CAAA;CAClB,EACD,QAAQ,EAAE,KAAK,GAAG,QAAQ;;;kBArBG,QAAQ,CAAC,SAAS,MAAM,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;kCA6FnB,MAAM,EAAE;;;kBA7FhB,QAAQ,CAAC,SAAS,MAAM,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCA4B1B,MAAM;qBACnB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAtBG,QAAQ,CAAC,SAAS,YAAY,EAAE,CAAC;;;;;;;;;;;;;;;;;kBAAjC,QAAQ,CAAC,SAAS,YAAY,EAAE,CAAC;;;;;;;;;;;;;;;;EAqV5D"}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { defineComponent, h, nextTick, ref } from '@vue/runtime-core';
|
|
2
|
+
import { avatarSizes } from '../avatar.js';
|
|
3
|
+
import { avatarProps } from './props.js';
|
|
4
|
+
import { useMavisTheme } from './theme.js';
|
|
5
|
+
const editorProps = {
|
|
6
|
+
id: String,
|
|
7
|
+
label: { type: String, required: true },
|
|
8
|
+
placeholder: String,
|
|
9
|
+
disabled: Boolean,
|
|
10
|
+
};
|
|
11
|
+
export const searchBarProps = {
|
|
12
|
+
...editorProps,
|
|
13
|
+
modelValue: { type: String, default: '' },
|
|
14
|
+
clearLabel: { type: String, default: 'Clear search' },
|
|
15
|
+
cancelLabel: { type: String, default: 'Cancel' },
|
|
16
|
+
showCancel: Boolean,
|
|
17
|
+
};
|
|
18
|
+
export const tagInputProps = {
|
|
19
|
+
...editorProps,
|
|
20
|
+
modelValue: { type: Array, default: () => [] },
|
|
21
|
+
addLabel: { type: String, default: 'Add tag' },
|
|
22
|
+
removeLabel: { type: String, default: 'Remove' },
|
|
23
|
+
maxTags: Number,
|
|
24
|
+
};
|
|
25
|
+
export const avatarGroupProps = {
|
|
26
|
+
id: String,
|
|
27
|
+
members: { type: Array, required: true },
|
|
28
|
+
maxVisible: { type: Number, default: 4 },
|
|
29
|
+
size: avatarProps.size,
|
|
30
|
+
};
|
|
31
|
+
export function createEditorControls(ui, platform) {
|
|
32
|
+
const web = platform === 'web';
|
|
33
|
+
const MSearchBar = defineComponent({
|
|
34
|
+
name: 'MSearchBar',
|
|
35
|
+
props: searchBarProps,
|
|
36
|
+
emits: {
|
|
37
|
+
'update:modelValue': (_v) => true,
|
|
38
|
+
submit: (_v) => true,
|
|
39
|
+
clear: () => true,
|
|
40
|
+
cancel: () => true,
|
|
41
|
+
},
|
|
42
|
+
setup(props, { emit, expose }) {
|
|
43
|
+
const editor = ref();
|
|
44
|
+
const focus = () => editor.value?.focus();
|
|
45
|
+
const blur = () => editor.value?.blur();
|
|
46
|
+
expose({ focus, blur });
|
|
47
|
+
return () => h(ui.Row, { gap: 'sm', align: 'center' }, {
|
|
48
|
+
default: () => [
|
|
49
|
+
h(ui.Input, {
|
|
50
|
+
ref: editor,
|
|
51
|
+
id: props.id,
|
|
52
|
+
label: props.label,
|
|
53
|
+
placeholder: props.placeholder,
|
|
54
|
+
width: 0,
|
|
55
|
+
grow: 1,
|
|
56
|
+
modelValue: props.modelValue,
|
|
57
|
+
disabled: props.disabled,
|
|
58
|
+
icon: 'search',
|
|
59
|
+
inputmode: 'search',
|
|
60
|
+
returnKey: 'search',
|
|
61
|
+
trailingAction: props.modelValue
|
|
62
|
+
? { icon: 'x', label: props.clearLabel }
|
|
63
|
+
: undefined,
|
|
64
|
+
'onUpdate:modelValue': (value) => {
|
|
65
|
+
if (!props.disabled)
|
|
66
|
+
emit('update:modelValue', value);
|
|
67
|
+
},
|
|
68
|
+
onSubmit: (value) => {
|
|
69
|
+
if (!props.disabled)
|
|
70
|
+
emit('submit', value);
|
|
71
|
+
},
|
|
72
|
+
onAction: () => {
|
|
73
|
+
if (props.disabled || !props.modelValue)
|
|
74
|
+
return;
|
|
75
|
+
emit('update:modelValue', '');
|
|
76
|
+
emit('clear');
|
|
77
|
+
void nextTick(focus);
|
|
78
|
+
},
|
|
79
|
+
}),
|
|
80
|
+
props.showCancel
|
|
81
|
+
? h(ui.Button, {
|
|
82
|
+
text: props.cancelLabel,
|
|
83
|
+
variant: 'ghost',
|
|
84
|
+
disabled: props.disabled,
|
|
85
|
+
onClick: () => {
|
|
86
|
+
if (!props.disabled) {
|
|
87
|
+
blur();
|
|
88
|
+
emit('cancel');
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
: null,
|
|
93
|
+
],
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
const MTagInput = defineComponent({
|
|
98
|
+
name: 'MTagInput',
|
|
99
|
+
props: tagInputProps,
|
|
100
|
+
emits: { 'update:modelValue': (_v) => true },
|
|
101
|
+
setup(props, { emit, expose }) {
|
|
102
|
+
const draft = ref('');
|
|
103
|
+
const editor = ref();
|
|
104
|
+
let composing = false;
|
|
105
|
+
let editVersion = 0;
|
|
106
|
+
const focus = () => editor.value?.focus();
|
|
107
|
+
expose({ focus, blur: () => editor.value?.blur() });
|
|
108
|
+
function add(value, finish, fromEditor = false) {
|
|
109
|
+
if (props.disabled)
|
|
110
|
+
return;
|
|
111
|
+
const parts = value.split(/[,\r\n]+/);
|
|
112
|
+
const tail = finish ? '' : (parts.pop() ?? '');
|
|
113
|
+
const result = [...props.modelValue];
|
|
114
|
+
const seen = new Set(result.map((tag) => tag.trim().toLowerCase()));
|
|
115
|
+
const remaining = [];
|
|
116
|
+
for (const part of parts) {
|
|
117
|
+
const tag = part.trim();
|
|
118
|
+
const key = tag.toLowerCase();
|
|
119
|
+
if (!tag || seen.has(key))
|
|
120
|
+
continue;
|
|
121
|
+
seen.add(key);
|
|
122
|
+
if (result.length < (props.maxTags ?? Infinity))
|
|
123
|
+
result.push(tag);
|
|
124
|
+
else
|
|
125
|
+
remaining.push(tag);
|
|
126
|
+
}
|
|
127
|
+
const nextDraft = [...remaining, tail].filter(Boolean).join(', ');
|
|
128
|
+
const version = ++editVersion;
|
|
129
|
+
// A native paste can add whole tags to an already-empty editor. Give the
|
|
130
|
+
// controlled field the input echo before clearing it, even if the final draft is unchanged.
|
|
131
|
+
if (fromEditor && nextDraft !== value) {
|
|
132
|
+
draft.value = value;
|
|
133
|
+
void nextTick(() => {
|
|
134
|
+
if (version === editVersion)
|
|
135
|
+
draft.value = nextDraft;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
else
|
|
139
|
+
draft.value = nextDraft;
|
|
140
|
+
if (result.length !== props.modelValue.length)
|
|
141
|
+
emit('update:modelValue', result);
|
|
142
|
+
}
|
|
143
|
+
function remove(index) {
|
|
144
|
+
if (!props.disabled && index >= 0)
|
|
145
|
+
emit('update:modelValue', props.modelValue.filter((_, i) => i !== index));
|
|
146
|
+
}
|
|
147
|
+
return () => {
|
|
148
|
+
if (props.maxTags !== undefined && (!Number.isInteger(props.maxTags) || props.maxTags < 0))
|
|
149
|
+
throw new RangeError('maxTags must be a nonnegative integer.');
|
|
150
|
+
const webEvents = web
|
|
151
|
+
? {
|
|
152
|
+
onCompositionstart: () => {
|
|
153
|
+
composing = true;
|
|
154
|
+
},
|
|
155
|
+
onCompositionend: (e) => {
|
|
156
|
+
composing = false;
|
|
157
|
+
add(e.target.value, false);
|
|
158
|
+
},
|
|
159
|
+
onKeydown: (e) => {
|
|
160
|
+
if (e.key === 'Backspace' &&
|
|
161
|
+
!e.repeat &&
|
|
162
|
+
!composing &&
|
|
163
|
+
!e.isComposing &&
|
|
164
|
+
!draft.value &&
|
|
165
|
+
e.target.tagName === 'INPUT' &&
|
|
166
|
+
props.modelValue.length &&
|
|
167
|
+
!props.disabled) {
|
|
168
|
+
e.preventDefault();
|
|
169
|
+
remove(props.modelValue.length - 1);
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
onPaste: (e) => {
|
|
173
|
+
const field = e.target;
|
|
174
|
+
const text = e.clipboardData?.getData('text/plain');
|
|
175
|
+
if (field.tagName !== 'INPUT' ||
|
|
176
|
+
!text ||
|
|
177
|
+
!/[,\r\n]/.test(text) ||
|
|
178
|
+
props.disabled ||
|
|
179
|
+
composing)
|
|
180
|
+
return;
|
|
181
|
+
e.preventDefault();
|
|
182
|
+
add(field.value.slice(0, field.selectionStart ?? 0) +
|
|
183
|
+
text +
|
|
184
|
+
field.value.slice(field.selectionEnd ?? field.value.length), true);
|
|
185
|
+
},
|
|
186
|
+
}
|
|
187
|
+
: {};
|
|
188
|
+
return h(ui.Column, { gap: 'sm', ...webEvents }, {
|
|
189
|
+
default: () => [
|
|
190
|
+
h(ui.Input, {
|
|
191
|
+
ref: editor,
|
|
192
|
+
id: props.id,
|
|
193
|
+
label: props.label,
|
|
194
|
+
placeholder: props.placeholder,
|
|
195
|
+
modelValue: draft.value,
|
|
196
|
+
disabled: props.disabled,
|
|
197
|
+
returnKey: 'done',
|
|
198
|
+
trailingAction: draft.value.trim()
|
|
199
|
+
? { icon: 'plus', label: props.addLabel }
|
|
200
|
+
: undefined,
|
|
201
|
+
'onUpdate:modelValue': (text) => {
|
|
202
|
+
if (composing) {
|
|
203
|
+
editVersion++;
|
|
204
|
+
draft.value = text;
|
|
205
|
+
}
|
|
206
|
+
else
|
|
207
|
+
add(text, !web && /[,\r\n]/.test(text) && text.length > draft.value.length + 1, true);
|
|
208
|
+
},
|
|
209
|
+
onSubmit: (text) => add(text, true),
|
|
210
|
+
onAction: () => {
|
|
211
|
+
add(draft.value, true);
|
|
212
|
+
void nextTick(focus);
|
|
213
|
+
},
|
|
214
|
+
}),
|
|
215
|
+
props.modelValue.length
|
|
216
|
+
? h(ui.Row, { wrap: true, gap: 'xs' }, {
|
|
217
|
+
default: () => props.modelValue.map((tag, i) => h(ui.Chip, {
|
|
218
|
+
key: tag,
|
|
219
|
+
label: tag,
|
|
220
|
+
removable: true,
|
|
221
|
+
removeLabel: props.removeLabel + ' ' + tag,
|
|
222
|
+
disabled: props.disabled,
|
|
223
|
+
onRemove: () => remove(i),
|
|
224
|
+
})),
|
|
225
|
+
})
|
|
226
|
+
: null,
|
|
227
|
+
],
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
const MAvatarGroup = defineComponent({
|
|
233
|
+
name: 'MAvatarGroup',
|
|
234
|
+
props: avatarGroupProps,
|
|
235
|
+
setup(props) {
|
|
236
|
+
const { theme } = useMavisTheme();
|
|
237
|
+
return () => {
|
|
238
|
+
if (!Number.isInteger(props.maxVisible) || props.maxVisible < 1)
|
|
239
|
+
throw new RangeError('maxVisible must be a positive integer.');
|
|
240
|
+
const seen = new Set();
|
|
241
|
+
for (const person of props.members) {
|
|
242
|
+
if (!person.id || seen.has(person.id))
|
|
243
|
+
throw new TypeError('Avatar members require unique ids.');
|
|
244
|
+
seen.add(person.id);
|
|
245
|
+
}
|
|
246
|
+
const visible = props.members.slice(0, props.maxVisible);
|
|
247
|
+
const extra = props.members.length - visible.length;
|
|
248
|
+
const size = avatarSizes[props.size];
|
|
249
|
+
const stride = Math.ceil(size * 0.82);
|
|
250
|
+
const count = visible.length + Number(extra > 0);
|
|
251
|
+
const width = count ? size + (count - 1) * stride : 0;
|
|
252
|
+
const colors = theme.value.colors;
|
|
253
|
+
const cell = (index) => web
|
|
254
|
+
? {
|
|
255
|
+
position: 'absolute',
|
|
256
|
+
left: index * stride + 'px',
|
|
257
|
+
top: 0,
|
|
258
|
+
width: size + 'px',
|
|
259
|
+
height: size + 'px',
|
|
260
|
+
borderRadius: '50%',
|
|
261
|
+
boxShadow: '0 0 0 2px ' + colors.surface,
|
|
262
|
+
}
|
|
263
|
+
: {
|
|
264
|
+
width: size,
|
|
265
|
+
height: size,
|
|
266
|
+
borderRadius: size / 2,
|
|
267
|
+
borderWidth: 2,
|
|
268
|
+
borderColor: colors.surface,
|
|
269
|
+
backgroundColor: colors.surface,
|
|
270
|
+
clipToBounds: true,
|
|
271
|
+
};
|
|
272
|
+
const cells = visible.map((person, i) => h(web ? 'span' : 'GridLayout', {
|
|
273
|
+
key: 'member:' + person.id,
|
|
274
|
+
...(!web ? { left: i * stride, top: 0 } : {}),
|
|
275
|
+
style: cell(i),
|
|
276
|
+
}, [h(ui.Avatar, { name: person.name, src: person.src, size: props.size })]));
|
|
277
|
+
if (extra)
|
|
278
|
+
cells.push(h(web ? 'span' : 'Label', {
|
|
279
|
+
key: 'overflow',
|
|
280
|
+
...(web
|
|
281
|
+
? {}
|
|
282
|
+
: {
|
|
283
|
+
left: visible.length * stride,
|
|
284
|
+
top: 0,
|
|
285
|
+
text: '+' + extra,
|
|
286
|
+
textAlignment: 'center',
|
|
287
|
+
verticalTextAlignment: 'middle',
|
|
288
|
+
}),
|
|
289
|
+
style: {
|
|
290
|
+
...cell(visible.length),
|
|
291
|
+
...(web
|
|
292
|
+
? {
|
|
293
|
+
display: 'grid',
|
|
294
|
+
placeItems: 'center',
|
|
295
|
+
fontSize: Math.round(size * 0.32) + 'px',
|
|
296
|
+
}
|
|
297
|
+
: { fontSize: Math.round(size * 0.32) }),
|
|
298
|
+
fontWeight: '600',
|
|
299
|
+
color: colors.onPrimary,
|
|
300
|
+
backgroundColor: colors.primary,
|
|
301
|
+
},
|
|
302
|
+
}, web ? '+' + extra : undefined));
|
|
303
|
+
return h(web ? 'span' : 'AbsoluteLayout', {
|
|
304
|
+
id: props.id,
|
|
305
|
+
...(web
|
|
306
|
+
? {
|
|
307
|
+
class: 'm-avatar-group',
|
|
308
|
+
style: {
|
|
309
|
+
position: 'relative',
|
|
310
|
+
display: 'inline-block',
|
|
311
|
+
width: width + 'px',
|
|
312
|
+
height: size + 'px',
|
|
313
|
+
alignSelf: 'flex-start',
|
|
314
|
+
},
|
|
315
|
+
}
|
|
316
|
+
: { width, height: size, horizontalAlignment: 'left' }),
|
|
317
|
+
}, cells);
|
|
318
|
+
};
|
|
319
|
+
},
|
|
320
|
+
});
|
|
321
|
+
return { MTagInput, MSearchBar, MAvatarGroup };
|
|
322
|
+
}
|
|
323
|
+
//# sourceMappingURL=editor-controls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-controls.js","sourceRoot":"","sources":["../../src/vue/editor-controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAiC,MAAM,mBAAmB,CAAA;AAEpG,OAAO,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,E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AC,OAAO,CAAC,MAAM,CAAC;4BACvB,GAAG,CAAC,GAAG;gCACL,CAAC,CAAC;oCACE,OAAO,EAAE,MAAM;oCACf,UAAU,EAAE,QAAQ;oCACpB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,IAAI;iCACzC;gCACH,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;4BAC1C,UAAU,EAAE,KAAK;4BACjB,KAAK,EAAE,MAAM,CAAC,SAAS;4BACvB,eAAe,EAAE,MAAM,CAAC,OAAO;yBAChC;qBACF,EACD,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,CAC9B,CACF,CAAA;gBACH,OAAO,CAAC,CACN,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,EAC/B;oBACE,EAAE,EAAE,KAAK,CAAC,EAAE;oBACZ,GAAG,CAAC,GAAG;wBACL,CAAC,CAAC;4BACE,KAAK,EAAE,gBAAgB;4BACvB,KAAK,EAAE;gCACL,QAAQ,EAAE,UAAU;gCACpB,OAAO,EAAE,cAAc;gCACvB,KAAK,EAAE,KAAK,GAAG,IAAI;gCACnB,MAAM,EAAE,IAAI,GAAG,IAAI;gCACnB,SAAS,EAAE,YAAY;6BACxB;yBACF;wBACH,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,CAAC;iBAC1D,EACD,KAAK,CACN,CAAA;YACH,CAAC,CAAA;QACH,CAAC;KACF,CAAC,CAAA;IACF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,CAAA;AAChD,CAAC"}
|
|
@@ -23,6 +23,9 @@ type InputEvents = {
|
|
|
23
23
|
/** Additional input attributes supplied by a renderer, without DOM dependencies in core. */
|
|
24
24
|
export interface InputPlatformAttributes {
|
|
25
25
|
}
|
|
26
|
+
/** Action attributes supplied by the card renderer. */
|
|
27
|
+
export interface CardPlatformAttributes {
|
|
28
|
+
}
|
|
26
29
|
type SheetEvents = {
|
|
27
30
|
'onUpdate:open'?: (value: boolean) => void;
|
|
28
31
|
onClose?: (reason: SheetCloseReason) => void;
|
|
@@ -142,6 +145,14 @@ declare module '@vue/runtime-core' {
|
|
|
142
145
|
onSelect?: (value: ChoiceValue, action: import('../screen-components.js').SpeedDialAction) => void;
|
|
143
146
|
onClose?: (reason: string) => void;
|
|
144
147
|
}>;
|
|
148
|
+
MAvatarGroup: DefineComponent<ComponentProps['MAvatarGroup']>;
|
|
149
|
+
MSearchBar: DefineComponent<ComponentProps['MSearchBar'] & Pick<InputEvents, 'onUpdate:modelValue' | 'onSubmit'> & {
|
|
150
|
+
onClear?: () => void;
|
|
151
|
+
onCancel?: () => void;
|
|
152
|
+
}, InputHandle>;
|
|
153
|
+
MTagInput: DefineComponent<ComponentProps['MTagInput'] & {
|
|
154
|
+
'onUpdate:modelValue'?: (tags: string[]) => void;
|
|
155
|
+
}, InputHandle>;
|
|
145
156
|
MComposer: DefineComponent<ComponentProps['MComposer'] & Omit<InputEvents, 'onSubmit'> & {
|
|
146
157
|
onSubmit?: (message: import('../screen-components.js').ComposerMessage) => void;
|
|
147
158
|
onAttach?: () => void;
|
|
@@ -158,7 +169,12 @@ declare module '@vue/runtime-core' {
|
|
|
158
169
|
}> & {
|
|
159
170
|
new (): {
|
|
160
171
|
scrollToTop(animated?: boolean): void;
|
|
172
|
+
preserveAnchor(change: () => void | Promise<void>): Promise<void>;
|
|
161
173
|
$slots: {
|
|
174
|
+
item?: (scope: {
|
|
175
|
+
itemKey: string;
|
|
176
|
+
index: number;
|
|
177
|
+
}) => unknown;
|
|
162
178
|
default?: () => unknown;
|
|
163
179
|
artwork?: () => unknown;
|
|
164
180
|
leading?: () => unknown;
|
|
@@ -174,7 +190,12 @@ declare module '@vue/runtime-core' {
|
|
|
174
190
|
new (): {
|
|
175
191
|
refresh(): Promise<boolean>;
|
|
176
192
|
cancel(): void;
|
|
193
|
+
preserveAnchor(change: () => void | Promise<void>): Promise<void>;
|
|
177
194
|
$slots: {
|
|
195
|
+
item?: (scope: {
|
|
196
|
+
itemKey: string;
|
|
197
|
+
index: number;
|
|
198
|
+
}) => unknown;
|
|
178
199
|
default?: (scope: {
|
|
179
200
|
state: import('../screen-components.js').RefreshState;
|
|
180
201
|
refresh(): Promise<boolean>;
|
|
@@ -371,7 +392,7 @@ declare module '@vue/runtime-core' {
|
|
|
371
392
|
onError?: (error: unknown) => void;
|
|
372
393
|
}>;
|
|
373
394
|
MBox: DefineComponent<ComponentProps['MBox']>;
|
|
374
|
-
MCard: DefineComponent<ComponentProps['MCard'] & Action>;
|
|
395
|
+
MCard: DefineComponent<ComponentProps['MCard'] & Action & CardPlatformAttributes>;
|
|
375
396
|
MText: DefineComponent<ComponentProps['MText']>;
|
|
376
397
|
MButton: DefineComponent<ComponentProps['MButton'] & Action> & {
|
|
377
398
|
new (): {
|