@bagelink/vue 0.0.218 → 0.0.226-beta.0

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 (105) hide show
  1. package/dist/components/AccordionItem.vue.d.ts +23 -0
  2. package/dist/components/AccordionItem.vue.d.ts.map +1 -0
  3. package/dist/components/Avatar.vue.d.ts +20 -0
  4. package/dist/components/Avatar.vue.d.ts.map +1 -0
  5. package/dist/components/Card.vue.d.ts +27 -0
  6. package/dist/components/Card.vue.d.ts.map +1 -0
  7. package/dist/components/DataPreview.vue.d.ts +18 -18
  8. package/dist/components/DataPreview.vue.d.ts.map +1 -1
  9. package/dist/components/Drop.vue.d.ts +34 -0
  10. package/dist/components/Drop.vue.d.ts.map +1 -0
  11. package/dist/components/FileUploader.vue.d.ts +60 -0
  12. package/dist/components/FileUploader.vue.d.ts.map +1 -0
  13. package/dist/components/Modal.vue.d.ts.map +1 -1
  14. package/dist/components/ModalBglForm.vue.d.ts +50 -31
  15. package/dist/components/ModalBglForm.vue.d.ts.map +1 -1
  16. package/dist/components/NavBar.vue.d.ts +17 -12
  17. package/dist/components/NavBar.vue.d.ts.map +1 -1
  18. package/dist/components/TableSchema.vue.d.ts +5 -4
  19. package/dist/components/TableSchema.vue.d.ts.map +1 -1
  20. package/dist/components/Title.vue.d.ts +31 -0
  21. package/dist/components/Title.vue.d.ts.map +1 -0
  22. package/dist/components/form/BglField.vue.d.ts +19 -5
  23. package/dist/components/form/BglField.vue.d.ts.map +1 -1
  24. package/dist/components/form/BglForm.vue.d.ts +38 -27
  25. package/dist/components/form/BglForm.vue.d.ts.map +1 -1
  26. package/dist/components/form/ItemRef.vue.d.ts +1 -0
  27. package/dist/components/form/ItemRef.vue.d.ts.map +1 -1
  28. package/dist/components/form/index.d.ts +0 -3
  29. package/dist/components/form/index.d.ts.map +1 -1
  30. package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
  31. package/dist/components/form/inputs/DateInput.vue.d.ts +36 -38
  32. package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
  33. package/dist/components/form/inputs/FileUpload.vue.d.ts +25 -15
  34. package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -1
  35. package/dist/components/form/inputs/SelectField.vue.d.ts +1 -4
  36. package/dist/components/form/inputs/SelectField.vue.d.ts.map +1 -1
  37. package/dist/components/form/inputs/SelectInput.vue.d.ts +37 -0
  38. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -0
  39. package/dist/components/form/inputs/TableField.vue.d.ts.map +1 -1
  40. package/dist/components/form/inputs/ToggleInput.vue.d.ts +46 -0
  41. package/dist/components/form/inputs/ToggleInput.vue.d.ts.map +1 -0
  42. package/dist/components/form/inputs/index.d.ts +2 -3
  43. package/dist/components/form/inputs/index.d.ts.map +1 -1
  44. package/dist/components/formkit/index.d.ts +1 -2
  45. package/dist/components/formkit/index.d.ts.map +1 -1
  46. package/dist/components/index.d.ts +5 -4
  47. package/dist/components/index.d.ts.map +1 -1
  48. package/dist/index.cjs +14523 -13691
  49. package/dist/index.mjs +14524 -13692
  50. package/dist/plugins/bagel.d.ts +1 -1
  51. package/dist/plugins/bagel.d.ts.map +1 -1
  52. package/dist/plugins/modal.d.ts +1 -3
  53. package/dist/plugins/modal.d.ts.map +1 -1
  54. package/dist/style.css +744 -404
  55. package/dist/types/BagelForm.d.ts +8 -0
  56. package/dist/types/BagelForm.d.ts.map +1 -1
  57. package/dist/types/index.d.ts +1 -1
  58. package/dist/types/index.d.ts.map +1 -1
  59. package/dist/utils/index.d.ts +5 -2
  60. package/dist/utils/index.d.ts.map +1 -1
  61. package/package.json +12 -10
  62. package/src/components/AccordionItem.vue +100 -0
  63. package/src/components/Avatar.vue +47 -0
  64. package/src/components/Card.vue +13 -0
  65. package/src/components/Comments.vue +75 -75
  66. package/src/components/ContactArray.vue +10 -39
  67. package/src/components/DataPreview.vue +22 -49
  68. package/src/components/{DropDown.vue → Drop.vue} +55 -29
  69. package/src/components/FormKitTable.vue +121 -125
  70. package/src/components/Modal.vue +6 -23
  71. package/src/components/ModalBglForm.vue +10 -24
  72. package/src/components/NavBar.vue +33 -17
  73. package/src/components/RTXEditor.vue +69 -69
  74. package/src/components/TableSchema.vue +26 -72
  75. package/src/components/Title.vue +19 -0
  76. package/src/components/form/BglField.vue +29 -26
  77. package/src/components/form/BglForm.vue +19 -14
  78. package/src/components/form/index.ts +0 -3
  79. package/src/components/form/inputs/CheckInput.vue +20 -18
  80. package/src/components/form/inputs/DateInput.vue +16 -34
  81. package/src/components/form/inputs/FileUpload.vue +139 -19
  82. package/src/components/form/inputs/SelectField.vue +80 -138
  83. package/src/components/form/inputs/SelectInput.vue +517 -0
  84. package/src/components/form/inputs/TableField.vue +1 -5
  85. package/src/components/form/inputs/index.ts +2 -3
  86. package/src/components/formkit/index.ts +0 -3
  87. package/src/components/index.ts +5 -4
  88. package/src/plugins/bagel.ts +2 -2
  89. package/src/plugins/modal.ts +7 -13
  90. package/src/styles/inputs.css +2 -2
  91. package/src/styles/layout.css +1 -1
  92. package/src/styles/modal.css +3 -2
  93. package/src/styles/theme.css +7 -6
  94. package/src/types/BagelForm.ts +5 -0
  95. package/src/types/index.ts +1 -1
  96. package/src/utils/index.ts +26 -6
  97. package/src/components/ContactSubmissions.vue +0 -45
  98. package/src/components/PersonPreview.vue +0 -199
  99. package/src/components/PersonPreviewFormkit.vue +0 -178
  100. package/src/components/form/ItemRef.vue +0 -44
  101. package/src/components/form/MaterialIcon.vue +0 -19
  102. package/src/components/form/PlainInputField.vue +0 -79
  103. package/src/components/form/inputs/DynamicLinkField.vue +0 -137
  104. package/src/components/form/inputs/EmailInput.vue +0 -58
  105. package/src/types/Person.ts +0 -51
@@ -1,79 +0,0 @@
1
- <template>
2
- <div class="bagel-input">
3
- <label :for="formatString(name, 'pascal')">
4
- <LangText :input="formatString(name, 'titleCase')" />
5
- </label>
6
- <input
7
- v-if="type === 'checkbox'"
8
- ref="el"
9
- :checked="modelValue"
10
- class="ctl"
11
- type="checkbox"
12
- @change="handleCheck"
13
- >
14
- <input
15
- v-else-if="type === 'number'"
16
- ref="el"
17
- :name="formatString(name, 'pascal')"
18
- :type="type"
19
- :value="modelValue"
20
- class="ctl"
21
- @input="handleInput"
22
- >
23
- <input
24
- v-else-if="type === 'text'"
25
- ref="el"
26
- :name="formatString(name, 'pascal')"
27
- :type="type"
28
- :value="modelValue"
29
- class="ctl"
30
- @input="handleInput"
31
- >
32
- <textarea
33
- v-else-if="type === 'textarea'"
34
- ref="el"
35
- :name="formatString(name, 'pascal')"
36
- :type="type"
37
- :value="modelValue"
38
- class="ctl"
39
- @input="handleInput"
40
- />
41
- <div>
42
- <LangText :input="errorMessage" />
43
- </div>
44
- </div>
45
- </template>
46
-
47
- <script lang="ts" setup>
48
- import { onMounted, ref } from 'vue';
49
-
50
- import { formatString } from '@bagelink/vue';
51
- import LangText from '../LangText.vue';
52
-
53
- const props = defineProps<{
54
- type: 'text' | 'number' | 'password' | 'email' | 'checkbox' | 'textarea';
55
- name: string;
56
- value?: any;
57
- modelValue: any;
58
- errorMessage?: string;
59
- focus?: boolean;
60
- }>();
61
-
62
- const emits = defineEmits(['update:modelValue']);
63
- const el = ref<HTMLInputElement | null>(null);
64
- const handleInput = (e: Event) => {
65
- const el = e.target as HTMLInputElement;
66
- emits('update:modelValue', el.value);
67
- };
68
- const handleCheck = (e: Event) => {
69
- const el = e.target as HTMLInputElement;
70
- emits('update:modelValue', el.checked ? 1 : 0);
71
- };
72
- onMounted(() => {
73
- if (props.focus) {
74
- el.value?.focus();
75
- }
76
- });
77
- </script>
78
-
79
- <style scoped></style>
@@ -1,137 +0,0 @@
1
- <template>
2
- <div
3
- class="bagel-input"
4
- :class="{ small: small }"
5
- >
6
- <label v-if="label">
7
- <LangText :input="label" />
8
- </label>
9
-
10
- <input
11
- @keydown.enter="handleEnter"
12
- autocomplete="off"
13
- @click="showList = true"
14
- name="link-input"
15
- v-model="selectedItem"
16
- @focus="initList"
17
- @input="handleInput"
18
- :disabled="!editMode"
19
- >
20
-
21
- <div
22
- class="custom-select"
23
- name="link-input"
24
- :class="{ 'open-select': showList && linkOptions.length > 0 }"
25
- >
26
- <div class="custom-select-drop">
27
- <div
28
- v-for="item in linkOptions"
29
- :key="formatString(item.value, 'pascal')"
30
- @click.stop="handleSelect(item)"
31
- >
32
- {{
33
- useId || entity === 'Entity' ? item.value
34
- : item.label || item.description || item.value
35
- }}
36
- </div>
37
- </div>
38
- </div>
39
- </div>
40
- </template>
41
-
42
- <script lang="ts" setup>
43
- import { onMounted, ref } from 'vue';
44
- import { formatString } from '@bagelink/vue';
45
-
46
- // TODO: remove this Nati ?
47
-
48
- const props = withDefaults(
49
- defineProps<{
50
- label?: string;
51
- modelValue: any;
52
- useId?: false;
53
- bagelApp?: any;
54
- entity: string;
55
- editMode: boolean;
56
- filters?: any;
57
- small?: boolean;
58
- }>(),
59
- {
60
- label: '',
61
- useId: false,
62
- filters: {},
63
- },
64
- );
65
- const showList = ref(false);
66
- const linkOptions = ref<any>([]);
67
- const item = ref<ListItem>();
68
- const emits = defineEmits(['update:modelValue', 'selected']);
69
- const selectedItem = ref<any>();
70
-
71
- function handleSelect(item: ListItem) {
72
- showList.value = false;
73
- selectedItem.value = item;
74
- if (props.useId) {
75
- selectedItem.value = item.value;
76
- } else {
77
- selectedItem.value = item.label || item.description || item.value;
78
- }
79
-
80
- emits('update:modelValue', item.value);
81
- emits('selected');
82
- }
83
-
84
- async function getLinkOptions(inputString: string) {
85
- linkOptions.value = await props.bagelApp?.entity.getLinkedFieldList({
86
- entity: props.entity,
87
- txt: inputString,
88
- reference_entity: '',
89
- filters: props.filters,
90
- });
91
- }
92
-
93
- interface ListItem {
94
- value: string;
95
- label?: string;
96
- description?: string;
97
- }
98
-
99
- async function initList(e: Event) {
100
- await getLinkOptions(getElValue(e));
101
- showList.value = true;
102
- }
103
-
104
- function getElValue(e: Event) {
105
- const el = e.target as HTMLInputElement;
106
- return el.value.trim();
107
- }
108
-
109
- function handleEnter(e: Event) {
110
- emits('update:modelValue', getElValue(e));
111
- emits('selected');
112
- showList.value = false;
113
- }
114
-
115
- function handleClick(e: any) {
116
- const { target } = e;
117
- if (target.name != 'link-input' && showList.value == true) {
118
- showList.value = false;
119
- emits('update:modelValue', item.value);
120
- emits('selected');
121
- }
122
- // showList.value = false
123
- }
124
-
125
- const handleInput = async (e: Event) => {
126
- showList.value = true;
127
- const el = e.target as HTMLInputElement;
128
- emits('update:modelValue', el.value);
129
- await getLinkOptions(el.value);
130
- };
131
- onMounted(() => {
132
- selectedItem.value = props.modelValue;
133
- document.addEventListener('click', handleClick);
134
- });
135
- </script>
136
-
137
- <style scoped></style>
@@ -1,58 +0,0 @@
1
- <template>
2
- <div
3
- class="bagel-input"
4
- :title="description"
5
- :class="{ small: small }"
6
- >
7
- <label v-if="label">
8
- <LangText :input="label" />
9
- </label>
10
- <input
11
- :value="modelValue"
12
- maxlength="140"
13
- type="email"
14
- @input="handleInput"
15
- :class="{ 'no-edit': !editMode }"
16
- :placeholder="placeholder"
17
- >
18
- <!-- :placeholder="bagelApp.translate(placeholder, true)" -->
19
- </div>
20
- </template>
21
-
22
- <script setup lang="ts">
23
- // TODO: remove this Nati?
24
-
25
- const emits = defineEmits(['update:modelValue']);
26
-
27
- // const props =
28
- withDefaults(
29
- defineProps<{
30
- description?: string;
31
- label?: string;
32
- modelValue: any;
33
- placeholder?: string;
34
- editMode?: boolean;
35
- small?: boolean;
36
- }>(),
37
- {
38
- description: '',
39
- editMode: true,
40
- placeholder: '',
41
- label: '',
42
- },
43
- );
44
- const handleInput = (e: Event) => {
45
- const el = e.target as HTMLInputElement;
46
- emits('update:modelValue', el.value);
47
- };
48
- </script>
49
-
50
- <style scoped>
51
- input[type='email'] {
52
- direction: ltr;
53
- }
54
-
55
- [dir='rtl'] input[type='email'] {
56
- text-align: end;
57
- }
58
- </style>
@@ -1,51 +0,0 @@
1
- export interface BankDetailsInterface {
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
-
12
- export interface NewPerson {
13
- first_name?: string;
14
- last_name?: string;
15
- email?: string;
16
- phone?: string;
17
- gender?: string;
18
- bank_details?: BankDetailsInterface;
19
- }
20
-
21
- interface Email {
22
- id?: string;
23
- email: string;
24
- primary: boolean;
25
- label: string;
26
- }
27
-
28
- interface Phone {
29
- id?: string;
30
- phone: string;
31
- primary: boolean;
32
- label: string;
33
- }
34
-
35
- interface Role {
36
- id: string;
37
- role: string;
38
- ref_id: string;
39
- }
40
-
41
- export interface Person {
42
- id: string;
43
- first_name: string;
44
- last_name: string;
45
- email: Email[];
46
- phone: Phone[];
47
- date_of_birth: string;
48
- gender: string;
49
- roles: Role[];
50
- bank_details: BankDetailsInterface[];
51
- }