@bagelink/vue 0.0.74 → 0.0.83
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/dist/components/Btn.vue.d.ts +79 -0
- package/dist/components/Comments.vue.d.ts +23 -0
- package/dist/components/ContactSubmissions.vue.d.ts +12 -0
- package/dist/components/DataPreview.vue.d.ts +42 -0
- package/dist/components/DropDown.vue.d.ts +14 -0
- package/dist/components/FormSchema.vue.d.ts +42 -0
- package/dist/components/LangText.vue.d.ts +15 -0
- package/dist/components/ListItem.vue.d.ts +23 -0
- package/dist/components/ListView.vue.d.ts +36 -0
- package/dist/components/MaterialIcon.vue.d.ts +18 -0
- package/dist/components/Modal.vue.d.ts +35 -0
- package/dist/components/ModalForm.vue.d.ts +44 -0
- package/dist/components/NavBar.vue.d.ts +60 -0
- package/dist/components/PageTitle.vue.d.ts +21 -0
- package/dist/components/PersonPreviewFormkit.vue.d.ts +20 -0
- package/dist/components/RTXEditor.vue.d.ts +40 -0
- package/dist/components/RouterWrapper.vue.d.ts +2 -0
- package/dist/components/TabbedLayout.vue.d.ts +35 -0
- package/dist/components/TableSchema.vue.d.ts +29 -0
- package/dist/components/TopBar.vue.d.ts +9 -0
- package/dist/components/charts/BarChart.vue.d.ts +33 -0
- package/dist/components/form/MaterialIcon.vue.d.ts +18 -0
- package/dist/components/form/inputs/CheckInput.vue.d.ts +40 -0
- package/dist/components/form/inputs/Checkbox.vue.d.ts +12 -0
- package/dist/components/form/inputs/CurrencyInput.vue.d.ts +42 -0
- package/dist/components/form/inputs/DateInput.vue.d.ts +43 -0
- package/dist/components/form/inputs/DatetimeInput.vue.d.ts +52 -0
- package/dist/components/form/inputs/DurationInput.vue.d.ts +52 -0
- package/dist/components/form/inputs/EmailInput.vue.d.ts +52 -0
- package/dist/components/form/inputs/FloatInput.vue.d.ts +52 -0
- package/dist/components/form/inputs/IntInput.vue.d.ts +52 -0
- package/dist/components/form/inputs/JSONInput.vue.d.ts +52 -0
- package/dist/components/form/inputs/LinkField.vue.d.ts +63 -0
- package/dist/components/form/inputs/Password.vue.d.ts +46 -0
- package/dist/components/form/inputs/PasswordInput.vue.d.ts +52 -0
- package/dist/components/form/inputs/ReadOnlyInput.vue.d.ts +20 -0
- package/dist/components/form/inputs/RichTextEditor.vue.d.ts +52 -0
- package/dist/components/form/inputs/SelectField.vue.d.ts +51 -0
- package/dist/components/form/inputs/TableField.vue.d.ts +44 -0
- package/dist/components/form/inputs/TextInput.vue.d.ts +56 -0
- package/dist/components/form/inputs/index.d.ts +17 -0
- package/dist/components/formkit/AddressArray.vue.d.ts +37 -0
- package/dist/components/formkit/BankDetailsArray.vue.d.ts +41 -0
- package/dist/components/formkit/ContactArrayFormKit.vue.d.ts +33 -0
- package/dist/components/formkit/FileUploader.vue.d.ts +36 -0
- package/dist/components/formkit/MiscFields.vue.d.ts +17 -0
- package/dist/components/formkit/Toggle.vue.d.ts +6 -0
- package/dist/components/formkit/index.d.ts +9 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/components/whatsapp/form/TextVariableExamples.vue.d.ts +6 -0
- package/dist/components/whatsapp/interfaces.d.ts +49 -0
- package/dist/index.cjs +26500 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +26500 -0
- package/dist/plugins/bagel.d.ts +9 -0
- package/dist/plugins/modal.d.ts +24 -0
- package/dist/style.css +2110 -0
- package/dist/types/BagelField.d.ts +39 -0
- package/dist/types/BtnOptions.d.ts +13 -0
- package/dist/types/Person.d.ts +47 -0
- package/dist/types/file.d.ts +12 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/objects.d.ts +3 -0
- package/dist/utils/strings.d.ts +1 -0
- package/package.json +3 -3
- package/src/components/DataPreview.vue +2 -1
- package/src/components/FormSchema.vue +1 -1
- package/src/components/PersonPreview.vue +2 -4
- package/src/components/PersonPreviewFormkit.vue +2 -4
- package/src/components/form/inputs/DatetimeInput.vue +2 -3
- package/src/components/form/inputs/DurationInput.vue +6 -7
- package/src/components/form/inputs/DynamicLinkField.vue +3 -7
- package/src/components/form/inputs/EmailInput.vue +6 -5
- package/src/components/form/inputs/FloatInput.vue +6 -5
- package/src/components/form/inputs/IntInput.vue +5 -6
- package/src/components/form/inputs/JSONInput.vue +4 -5
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface BaseBagelField {
|
|
2
|
+
id: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
is_array?: boolean;
|
|
7
|
+
can_add?: boolean;
|
|
8
|
+
can_delete?: boolean | (() => boolean);
|
|
9
|
+
allow_array_add?: boolean;
|
|
10
|
+
editMode?: boolean;
|
|
11
|
+
inputType: 'ItemRef' | 'SelectField' | 'PlainText' | 'ImageField' | 'ReadOnlyInput' | 'DateInput' | 'CurrencyInput' | 'CheckInput' | 'NumberInput' | 'LinkField' | 'TextArea' | 'Password' | 'Contact' | 'ColorPicker' | 'FormRow' | 'BagelForm';
|
|
12
|
+
description?: string;
|
|
13
|
+
helpText?: string;
|
|
14
|
+
currency?: string;
|
|
15
|
+
refCollection?: string;
|
|
16
|
+
refFields?: string[];
|
|
17
|
+
file_key?: string;
|
|
18
|
+
fields?: any;
|
|
19
|
+
pattern?: string;
|
|
20
|
+
fieldClass?: string;
|
|
21
|
+
link?: string;
|
|
22
|
+
}
|
|
23
|
+
export type NestedField = BagelField & {
|
|
24
|
+
skipIndex?: boolean;
|
|
25
|
+
ignoreModelPath?: boolean;
|
|
26
|
+
};
|
|
27
|
+
export type NestedBagelFormFields = NestedField[] & Record<string, NestedField>;
|
|
28
|
+
export interface NestedBagelForm extends BaseBagelField {
|
|
29
|
+
inputType: 'BagelForm';
|
|
30
|
+
fields: NestedBagelFormFields;
|
|
31
|
+
}
|
|
32
|
+
export interface SelectBagelField extends BaseBagelField {
|
|
33
|
+
inputType: 'SelectField';
|
|
34
|
+
options: string | {
|
|
35
|
+
label: string;
|
|
36
|
+
value: string | number;
|
|
37
|
+
}[];
|
|
38
|
+
}
|
|
39
|
+
export type BagelField = BaseBagelField | SelectBagelField | NestedBagelForm;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MaterialIcons } from './materialIcons';
|
|
2
|
+
export interface BtnOptions {
|
|
3
|
+
onClick?: () => void;
|
|
4
|
+
color?: 'light' | 'red' | 'gray' | 'black' | 'blue';
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
icon?: MaterialIcons;
|
|
7
|
+
flat?: boolean;
|
|
8
|
+
thin?: boolean;
|
|
9
|
+
type?: 'button' | 'submit' | 'reset';
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
role?: string;
|
|
12
|
+
value?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface BankDetails {
|
|
2
|
+
bank_name: string;
|
|
3
|
+
branch: string;
|
|
4
|
+
account_number: string;
|
|
5
|
+
bank_account_holder: string;
|
|
6
|
+
iban?: string;
|
|
7
|
+
swift?: string;
|
|
8
|
+
bank_address?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface NewPerson {
|
|
12
|
+
first_name?: string;
|
|
13
|
+
last_name?: string;
|
|
14
|
+
email?: string;
|
|
15
|
+
phone?: string;
|
|
16
|
+
gender?: string;
|
|
17
|
+
bank_details?: BankDetails;
|
|
18
|
+
}
|
|
19
|
+
interface Email {
|
|
20
|
+
id?: string;
|
|
21
|
+
email: string;
|
|
22
|
+
primary: boolean;
|
|
23
|
+
label: string;
|
|
24
|
+
}
|
|
25
|
+
interface Phone {
|
|
26
|
+
id?: string;
|
|
27
|
+
phone: string;
|
|
28
|
+
primary: boolean;
|
|
29
|
+
label: string;
|
|
30
|
+
}
|
|
31
|
+
interface Role {
|
|
32
|
+
id: string;
|
|
33
|
+
role: string;
|
|
34
|
+
ref_id: string;
|
|
35
|
+
}
|
|
36
|
+
export interface Person {
|
|
37
|
+
id: string;
|
|
38
|
+
first_name: string;
|
|
39
|
+
last_name: string;
|
|
40
|
+
email: Email[];
|
|
41
|
+
phone: Phone[];
|
|
42
|
+
date_of_birth: string;
|
|
43
|
+
gender: string;
|
|
44
|
+
roles: Role[];
|
|
45
|
+
bank_details: BankDetails[];
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BagelField } from '../types/BagelField';
|
|
2
|
+
export declare const debounce: (fn: () => void, delay?: number) => void;
|
|
3
|
+
export declare const keyToLabel: (key: string) => string;
|
|
4
|
+
export declare function computeFields(modelValue: Record<string, any>): BagelField[];
|
|
5
|
+
export declare const copyText: (text: string, cb?: ((msg: string) => void) | undefined) => Promise<void>;
|
|
6
|
+
export declare const useFormkit: () => unknown;
|
|
7
|
+
export declare const initials: (...strArr: string[]) => string;
|
|
8
|
+
export declare const parseLocale: (str: string, $t?: (_str: string) => string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatString(str: string, format: 'pascal' | 'camel' | 'snake' | 'titleCase'): string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bagelink/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.83",
|
|
5
5
|
"description": "Bagel core sdk packages",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Neveh Allon",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"prosemirror-state": "^1.4.3",
|
|
66
66
|
"prosemirror-view": "^1.32.4",
|
|
67
67
|
"@vue-macros/reactivity-transform": "^0.4.0",
|
|
68
|
-
"@bagelink/sdk": "0.0.
|
|
68
|
+
"@bagelink/sdk": "0.0.83"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@bagelink/sdk": "*"
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
},
|
|
90
90
|
"scripts": {
|
|
91
91
|
"dev": "tsx watch src/index.ts",
|
|
92
|
-
"build": "
|
|
92
|
+
"build": "vite build",
|
|
93
93
|
"start": "tsx src/index.ts"
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -49,7 +49,8 @@ import { keyToLabel, parseLocale } from '#/utils';
|
|
|
49
49
|
|
|
50
50
|
const keysToIgnore = ['id', 'person_id', 'person', 'created_at', 'updated_at'];
|
|
51
51
|
|
|
52
|
-
const props =
|
|
52
|
+
// const props =
|
|
53
|
+
withDefaults(defineProps<{
|
|
53
54
|
data: Record<string, any>,
|
|
54
55
|
schema?: Record<string, any>[],
|
|
55
56
|
title?: string,
|
|
@@ -30,7 +30,7 @@ import { reactive } from 'vue';
|
|
|
30
30
|
import { type FormKitSchemaDefinition } from '@formkit/core';
|
|
31
31
|
|
|
32
32
|
import { Btn } from '#/components';
|
|
33
|
-
import { useModal } from '
|
|
33
|
+
import { useModal } from '#';
|
|
34
34
|
|
|
35
35
|
const { showModal } = useModal();
|
|
36
36
|
const emits = defineEmits(['update:modelValue', 'submit']);
|
|
@@ -76,11 +76,9 @@
|
|
|
76
76
|
|
|
77
77
|
<script lang="ts" setup>
|
|
78
78
|
import type { FormKitSchemaDefinition } from '@formkit/core';
|
|
79
|
-
import { useBagel } from '#';
|
|
79
|
+
import { useBagel, useModal } from '#';
|
|
80
80
|
import type { Person } from '#/types';
|
|
81
|
-
import {
|
|
82
|
-
initials, useModal,
|
|
83
|
-
} from '#/utils';
|
|
81
|
+
import { initials } from '#/utils';
|
|
84
82
|
import { Btn, MaterialIcon } from '#/components';
|
|
85
83
|
|
|
86
84
|
// const toast = useToast(); // TODO: use toast
|
|
@@ -77,11 +77,9 @@
|
|
|
77
77
|
|
|
78
78
|
<script lang="ts" setup>
|
|
79
79
|
import type { FormKitSchemaDefinition } from '@formkit/core';
|
|
80
|
-
import { useBagel } from '#';
|
|
80
|
+
import { useBagel, useModal } from '#';
|
|
81
81
|
import type { Person } from '#/types';
|
|
82
|
-
import {
|
|
83
|
-
useModal, initials,
|
|
84
|
-
} from '#/utils';
|
|
82
|
+
import { initials } from '#/utils';
|
|
85
83
|
import { Btn, MaterialIcon } from '#/components';
|
|
86
84
|
|
|
87
85
|
// const toast = useToast(); // TODO: use toast
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
<label v-if="label">
|
|
8
8
|
<LangText :input="label" />
|
|
9
9
|
</label>
|
|
10
|
+
<!-- :placeholder="bagelApp.translate(placeholder, true)" -->
|
|
10
11
|
<input
|
|
11
12
|
:value="modelValue?.split('.')[0] || ''"
|
|
12
13
|
type="datetime-local"
|
|
13
14
|
@input="handleInput"
|
|
14
|
-
:placeholder="
|
|
15
|
+
:placeholder="placeholder"
|
|
15
16
|
:class="{ 'no-edit': !editMode }"
|
|
16
17
|
>
|
|
17
18
|
</div>
|
|
@@ -19,8 +20,6 @@
|
|
|
19
20
|
|
|
20
21
|
<script setup lang="ts">
|
|
21
22
|
import { onMounted } from 'vue';
|
|
22
|
-
// @ts-ignore TODO: remove this Nati
|
|
23
|
-
import { bagelApp } from '../../../index';
|
|
24
23
|
|
|
25
24
|
const emits = defineEmits(['update:modelValue']);
|
|
26
25
|
// @ts-ignore TODO: remove this Nati
|
|
@@ -8,26 +8,25 @@
|
|
|
8
8
|
<LangText :input="label" />
|
|
9
9
|
</label>
|
|
10
10
|
<!-- :title="formatDuration(modelValue)" -->
|
|
11
|
+
<!-- :placeholder="bagelApp.translate(placeholder, true)" -->
|
|
11
12
|
<input
|
|
12
13
|
:value="modelValue"
|
|
13
14
|
:title="modelValue"
|
|
14
15
|
type="number"
|
|
15
16
|
@input="handleInput"
|
|
16
|
-
:placeholder="
|
|
17
|
+
:placeholder="placeholder"
|
|
17
18
|
:class="{ 'no-edit': !editMode }"
|
|
18
19
|
>
|
|
19
20
|
</div>
|
|
20
21
|
</template>
|
|
21
22
|
|
|
22
23
|
<script setup lang="ts">
|
|
23
|
-
//
|
|
24
|
-
import { bagelApp } from '../../../index';
|
|
25
|
-
// @ts-ignore TODO: remove this Nati
|
|
26
|
-
// import { formatDuration } from '../../../composables';
|
|
24
|
+
// TODO: remove this Nati ?
|
|
27
25
|
|
|
28
26
|
const emits = defineEmits(['update:modelValue']);
|
|
29
|
-
|
|
30
|
-
const props =
|
|
27
|
+
|
|
28
|
+
// const props =
|
|
29
|
+
withDefaults(
|
|
31
30
|
defineProps<{
|
|
32
31
|
description?: string;
|
|
33
32
|
label?: string;
|
|
@@ -41,10 +41,8 @@
|
|
|
41
41
|
|
|
42
42
|
<script lang="ts" setup>
|
|
43
43
|
import { onMounted, ref } from 'vue';
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// @ts-ignore TODO: remove this Nati
|
|
47
|
-
import { bagelApp } from '../../../index';
|
|
44
|
+
import { formatString } from '#/utils/strings';
|
|
45
|
+
// TODO: remove this Nati ?
|
|
48
46
|
|
|
49
47
|
const props = withDefaults(
|
|
50
48
|
defineProps<{
|
|
@@ -61,7 +59,6 @@ const props = withDefaults(
|
|
|
61
59
|
label: '',
|
|
62
60
|
useId: false,
|
|
63
61
|
filters: {},
|
|
64
|
-
bagelApp,
|
|
65
62
|
},
|
|
66
63
|
);
|
|
67
64
|
const showList = ref(false);
|
|
@@ -84,7 +81,7 @@ function handleSelect(item: ListItem) {
|
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
async function getLinkOptions(inputString: string) {
|
|
87
|
-
linkOptions.value = await props.bagelApp
|
|
84
|
+
linkOptions.value = await props.bagelApp?.entity.getLinkedFieldList({
|
|
88
85
|
entity: props.entity,
|
|
89
86
|
txt: inputString,
|
|
90
87
|
reference_entity: '',
|
|
@@ -98,7 +95,6 @@ interface ListItem {
|
|
|
98
95
|
description?: string;
|
|
99
96
|
}
|
|
100
97
|
|
|
101
|
-
// @ts-ignore TODO: remove this Nati
|
|
102
98
|
const initialized = ref(false);
|
|
103
99
|
|
|
104
100
|
async function initList(e: Event) {
|
|
@@ -12,19 +12,20 @@
|
|
|
12
12
|
maxlength="140"
|
|
13
13
|
type="email"
|
|
14
14
|
@input="handleInput"
|
|
15
|
-
:placeholder="bagelApp.translate(placeholder, true)"
|
|
16
15
|
:class="{ 'no-edit': !editMode }"
|
|
16
|
+
:placeholder="placeholder"
|
|
17
17
|
>
|
|
18
|
+
<!-- :placeholder="bagelApp.translate(placeholder, true)" -->
|
|
18
19
|
</div>
|
|
19
20
|
</template>
|
|
20
21
|
|
|
21
22
|
<script setup lang="ts">
|
|
22
|
-
//
|
|
23
|
-
import { bagelApp } from '../../../index';
|
|
23
|
+
// TODO: remove this Nati?
|
|
24
24
|
|
|
25
25
|
const emits = defineEmits(['update:modelValue']);
|
|
26
|
-
|
|
27
|
-
const props =
|
|
26
|
+
|
|
27
|
+
// const props =
|
|
28
|
+
withDefaults(
|
|
28
29
|
defineProps<{
|
|
29
30
|
description?: string;
|
|
30
31
|
label?: string;
|
|
@@ -11,19 +11,20 @@
|
|
|
11
11
|
:value="modelValue"
|
|
12
12
|
type="number"
|
|
13
13
|
@input="handleInput"
|
|
14
|
-
:placeholder="bagelApp.translate(placeholder, true)"
|
|
15
14
|
:class="{ 'no-edit': !editMode }"
|
|
15
|
+
:placeholder="placeholder"
|
|
16
16
|
>
|
|
17
|
+
<!-- :placeholder="bagelApp.translate(placeholder, true)" -->
|
|
17
18
|
</div>
|
|
18
19
|
</template>
|
|
19
20
|
|
|
20
21
|
<script setup lang="ts">
|
|
21
|
-
//
|
|
22
|
-
import { bagelApp } from '../../../index';
|
|
22
|
+
// TODO: remove this Nati ?
|
|
23
23
|
|
|
24
24
|
const emits = defineEmits(['update:modelValue']);
|
|
25
|
-
|
|
26
|
-
const props =
|
|
25
|
+
|
|
26
|
+
// const props =
|
|
27
|
+
withDefaults(
|
|
27
28
|
defineProps<{
|
|
28
29
|
description?: string;
|
|
29
30
|
label?: string;
|
|
@@ -11,20 +11,19 @@
|
|
|
11
11
|
:value="modelValue"
|
|
12
12
|
type="number"
|
|
13
13
|
@input="handleInput"
|
|
14
|
-
:placeholder="bagelApp.translate(placeholder, true)"
|
|
15
14
|
:class="{ 'no-edit': !editMode }"
|
|
15
|
+
:placeholder="placeholder"
|
|
16
16
|
>
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<script setup lang="ts">
|
|
21
|
-
//
|
|
22
|
-
import { bagelApp } from '../../../index';
|
|
21
|
+
// TODO: remove this Nati ?
|
|
23
22
|
|
|
24
|
-
// @ts-ignore TODO: remove this Nati
|
|
25
23
|
const emits = defineEmits(['update:modelValue']);
|
|
26
|
-
|
|
27
|
-
const props =
|
|
24
|
+
|
|
25
|
+
// const props =
|
|
26
|
+
withDefaults(
|
|
28
27
|
defineProps<{
|
|
29
28
|
description?: string;
|
|
30
29
|
label?: string;
|
|
@@ -10,19 +10,18 @@
|
|
|
10
10
|
<textarea
|
|
11
11
|
:value="modelValue"
|
|
12
12
|
@input="handleInput"
|
|
13
|
-
:placeholder="bagelApp.translate(placeholder, true)"
|
|
14
13
|
:class="{ 'no-edit': !editMode }"
|
|
14
|
+
:placeholder="placeholder"
|
|
15
15
|
/>
|
|
16
16
|
</div>
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script setup lang="ts">
|
|
20
|
-
//
|
|
21
|
-
import { bagelApp } from '../../../index';
|
|
20
|
+
// TODO: remove this Nati ?
|
|
22
21
|
|
|
23
22
|
const emits = defineEmits(['update:modelValue']);
|
|
24
|
-
//
|
|
25
|
-
|
|
23
|
+
// const props =
|
|
24
|
+
withDefaults(
|
|
26
25
|
defineProps<{
|
|
27
26
|
description?: string;
|
|
28
27
|
label?: string;
|