@bagelink/vue 0.0.74 → 0.0.85

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.
Files changed (77) hide show
  1. package/dist/components/Btn.vue.d.ts +79 -0
  2. package/dist/components/Comments.vue.d.ts +23 -0
  3. package/dist/components/ContactSubmissions.vue.d.ts +12 -0
  4. package/dist/components/DataPreview.vue.d.ts +42 -0
  5. package/dist/components/DropDown.vue.d.ts +14 -0
  6. package/dist/components/FormSchema.vue.d.ts +42 -0
  7. package/dist/components/LangText.vue.d.ts +15 -0
  8. package/dist/components/ListItem.vue.d.ts +23 -0
  9. package/dist/components/ListView.vue.d.ts +36 -0
  10. package/dist/components/MaterialIcon.vue.d.ts +18 -0
  11. package/dist/components/Modal.vue.d.ts +35 -0
  12. package/dist/components/ModalForm.vue.d.ts +44 -0
  13. package/dist/components/NavBar.vue.d.ts +60 -0
  14. package/dist/components/PageTitle.vue.d.ts +21 -0
  15. package/dist/components/PersonPreviewFormkit.vue.d.ts +20 -0
  16. package/dist/components/RTXEditor.vue.d.ts +40 -0
  17. package/dist/components/RouterWrapper.vue.d.ts +2 -0
  18. package/dist/components/TabbedLayout.vue.d.ts +35 -0
  19. package/dist/components/TableSchema.vue.d.ts +29 -0
  20. package/dist/components/TopBar.vue.d.ts +9 -0
  21. package/dist/components/charts/BarChart.vue.d.ts +33 -0
  22. package/dist/components/form/MaterialIcon.vue.d.ts +18 -0
  23. package/dist/components/form/inputs/CheckInput.vue.d.ts +40 -0
  24. package/dist/components/form/inputs/Checkbox.vue.d.ts +12 -0
  25. package/dist/components/form/inputs/CurrencyInput.vue.d.ts +42 -0
  26. package/dist/components/form/inputs/DateInput.vue.d.ts +43 -0
  27. package/dist/components/form/inputs/DatetimeInput.vue.d.ts +52 -0
  28. package/dist/components/form/inputs/DurationInput.vue.d.ts +52 -0
  29. package/dist/components/form/inputs/EmailInput.vue.d.ts +52 -0
  30. package/dist/components/form/inputs/FloatInput.vue.d.ts +52 -0
  31. package/dist/components/form/inputs/IntInput.vue.d.ts +52 -0
  32. package/dist/components/form/inputs/JSONInput.vue.d.ts +52 -0
  33. package/dist/components/form/inputs/LinkField.vue.d.ts +63 -0
  34. package/dist/components/form/inputs/Password.vue.d.ts +46 -0
  35. package/dist/components/form/inputs/PasswordInput.vue.d.ts +52 -0
  36. package/dist/components/form/inputs/ReadOnlyInput.vue.d.ts +20 -0
  37. package/dist/components/form/inputs/RichTextEditor.vue.d.ts +52 -0
  38. package/dist/components/form/inputs/SelectField.vue.d.ts +51 -0
  39. package/dist/components/form/inputs/TableField.vue.d.ts +44 -0
  40. package/dist/components/form/inputs/TextInput.vue.d.ts +56 -0
  41. package/dist/components/form/inputs/index.d.ts +17 -0
  42. package/dist/components/formkit/AddressArray.vue.d.ts +37 -0
  43. package/dist/components/formkit/BankDetailsArray.vue.d.ts +41 -0
  44. package/dist/components/formkit/ContactArrayFormKit.vue.d.ts +33 -0
  45. package/dist/components/formkit/FileUploader.vue.d.ts +36 -0
  46. package/dist/components/formkit/MiscFields.vue.d.ts +17 -0
  47. package/dist/components/formkit/Toggle.vue.d.ts +6 -0
  48. package/dist/components/formkit/index.d.ts +9 -0
  49. package/dist/components/index.d.ts +20 -0
  50. package/dist/components/whatsapp/form/TextVariableExamples.vue.d.ts +6 -0
  51. package/dist/components/whatsapp/interfaces.d.ts +49 -0
  52. package/dist/index.cjs +26461 -0
  53. package/dist/index.d.ts +6 -0
  54. package/dist/index.mjs +26461 -0
  55. package/dist/plugins/bagel.d.ts +9 -0
  56. package/dist/plugins/modal.d.ts +24 -0
  57. package/dist/style.css +2110 -0
  58. package/dist/types/BagelField.d.ts +39 -0
  59. package/dist/types/BtnOptions.d.ts +13 -0
  60. package/dist/types/Person.d.ts +47 -0
  61. package/dist/types/file.d.ts +12 -0
  62. package/dist/types/index.d.ts +4 -0
  63. package/dist/utils/index.d.ts +8 -0
  64. package/dist/utils/objects.d.ts +3 -0
  65. package/dist/utils/strings.d.ts +1 -0
  66. package/package.json +3 -3
  67. package/src/components/DataPreview.vue +2 -1
  68. package/src/components/FormSchema.vue +1 -1
  69. package/src/components/PersonPreview.vue +2 -4
  70. package/src/components/PersonPreviewFormkit.vue +2 -4
  71. package/src/components/form/inputs/DatetimeInput.vue +2 -3
  72. package/src/components/form/inputs/DurationInput.vue +6 -7
  73. package/src/components/form/inputs/DynamicLinkField.vue +3 -7
  74. package/src/components/form/inputs/EmailInput.vue +6 -5
  75. package/src/components/form/inputs/FloatInput.vue +6 -5
  76. package/src/components/form/inputs/IntInput.vue +5 -6
  77. 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,12 @@
1
+ export type StorageFile = {
2
+ organization: string[];
3
+ name: string;
4
+ url: string;
5
+ mimetype?: string;
6
+ size?: number;
7
+ extension?: string;
8
+ path?: string;
9
+ id?: string;
10
+ created_at?: Date | string;
11
+ updated_at?: Date | string;
12
+ };
@@ -0,0 +1,4 @@
1
+ export type { BankDetails, NewPerson, Person } from './Person';
2
+ export type { Tables, TableToTypeMapping } from '@bagelink/sdk';
3
+ export type { StorageFile } from './file';
4
+ export type { BagelField } from './BagelField';
@@ -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,3 @@
1
+ import { BagelField } from '../types';
2
+ export declare function getPropByPath(obj: Record<string, any>, propPath?: string, bagelField?: BagelField): {};
3
+ export declare function setPropByPath(obj: Record<string, any>, path?: string, value?: any): void;
@@ -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.74",
4
+ "version": "0.0.85",
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.74"
68
+ "@bagelink/sdk": "0.0.85"
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": "tsc --noEmit && vite 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 = withDefaults(defineProps<{
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 '#/utils';
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="bagelApp.translate(placeholder, true)"
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="bagelApp.translate(placeholder, true)"
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
- // @ts-ignore TODO: remove this Nati
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
- // @ts-ignore TODO: remove this Nati
30
- const props = withDefaults(
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
- // @ts-ignore TODO: remove this Nati
45
- import { formatString } from '../../../composables';
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.entity.getLinkedFieldList({
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
- // @ts-ignore TODO: remove this Nati
23
- import { bagelApp } from '../../../index';
23
+ // TODO: remove this Nati?
24
24
 
25
25
  const emits = defineEmits(['update:modelValue']);
26
- // @ts-ignore TODO: remove this Nati
27
- const props = withDefaults(
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
- // @ts-ignore TODO: remove this Nati
22
- import { bagelApp } from '../../../index';
22
+ // TODO: remove this Nati ?
23
23
 
24
24
  const emits = defineEmits(['update:modelValue']);
25
- // @ts-ignore TODO: remove this Nati
26
- const props = withDefaults(
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
- // @ts-ignore TODO: remove this Nati
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
- // @ts-ignore TODO: remove this Nati
27
- const props = withDefaults(
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
- // @ts-ignore TODO: remove this Nati
21
- import { bagelApp } from '../../../index';
20
+ // TODO: remove this Nati ?
22
21
 
23
22
  const emits = defineEmits(['update:modelValue']);
24
- // @ts-ignore TODO: remove this Nati
25
- const props = withDefaults(
23
+ // const props =
24
+ withDefaults(
26
25
  defineProps<{
27
26
  description?: string;
28
27
  label?: string;