@bagelink/vue 0.0.130 → 0.0.134

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.
@@ -16,7 +16,7 @@
16
16
  </Transition>
17
17
  <div class="img-label">
18
18
  <p>
19
- {{ form.dragDrop }} <span>{{ form.browse }}</span>
19
+ {{ dragDropLabel }} <span>{{ browseLabel }}</span>
20
20
  </p>
21
21
  </div>
22
22
  <div class="uploading-wrap">
@@ -75,16 +75,16 @@ const props = withDefaults(
75
75
  private?: 1 | 0;
76
76
  singleFile?: boolean;
77
77
  beforeUpload?: () => Promise<any>;
78
- form: {
79
- dragDrop: string
80
- browse: string
81
- }
78
+ dragDropLabel?: string;
79
+ browseLabel?: string;
82
80
  }>(),
83
81
  {
84
82
  private: 0,
85
83
  entity: '',
86
84
  id: '',
87
85
  beforeUpload: async () => { },
86
+ dragDropLabel: 'Drag and drop your files here',
87
+ browseLabel: 'Browse',
88
88
  },
89
89
  );
90
90
 
@@ -11,7 +11,7 @@
11
11
  @click="sort(field.id)"
12
12
  >
13
13
  <div class="flex">
14
- {{ field.label || field.id }}
14
+ {{ field?.label || field.id }}
15
15
  <div
16
16
  class="list-arrows"
17
17
  :class="{ sorted: sortField === field.id }"
@@ -1,6 +1,5 @@
1
1
  <template>
2
2
  <div class="table-list-wrap h-100">
3
- <!-- <div v-for="field in schema" :key="field.id">{{ parseLocale(field.label) }}</div> -->
4
3
  <table class="infinite-wrapper">
5
4
  <thead class="row first-row">
6
5
  <th
@@ -10,7 +9,7 @@
10
9
  @click="sort(field.id)"
11
10
  >
12
11
  <div class="flex">
13
- {{ parseLocale(field.label || field.id) }}
12
+ {{ field?.label || field?.id }}
14
13
  <div
15
14
  class="list-arrows"
16
15
  :class="{ sorted: sortField === field.id }"
@@ -65,7 +64,7 @@
65
64
 
66
65
  <script setup lang="ts">
67
66
  import { useSlots } from 'vue';
68
- import { MaterialIcon, parseLocale } from '@bagelink/vue';
67
+ import { MaterialIcon } from '@bagelink/vue';
69
68
 
70
69
  const slots = useSlots();
71
70
  const loading = $ref(true);
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- {{ field.label || field.id }}
3
+ {{ field?.label || field.id }}
4
4
 
5
5
  <Btn
6
6
  color="gray"
@@ -11,7 +11,7 @@
11
11
  :id="field.id"
12
12
  v-model="inputVal"
13
13
  type="color"
14
- :placeholder="field.placeholder || field.label"
14
+ :placeholder="field?.placeholder || field.label"
15
15
  :class="{ 'no-edit': !editMode }"
16
16
  :required="required"
17
17
  v-bind="nativeInputAttrs"
@@ -11,20 +11,20 @@
11
11
  v-if="deleteCandidate === i"
12
12
  >
13
13
  <p class="txt14">
14
- {{ form.sure }}
14
+ {{ context?.formPlaceholders?.sure }}
15
15
  </p>
16
16
  <Btn
17
17
  thin
18
18
  color="red"
19
19
  @click="deleteContact(address.id)"
20
20
  >
21
- {{ form.delete }}
21
+ {{ context?.formPlaceholders?.delete }}
22
22
  </Btn>
23
23
  <Btn
24
24
  thin
25
25
  @click="deleteCandidate = -1"
26
26
  >
27
- {{ form.cancel }}
27
+ {{ context?.formPlaceholders?.cancel }}
28
28
  </Btn>
29
29
  </div>
30
30
  <Checkbox
@@ -35,29 +35,29 @@
35
35
  class="bglform-contact-label"
36
36
  v-model="address.label"
37
37
  type="text"
38
- :placeholder="form.label"
38
+ :placeholder="context?.formPlaceholders?.label"
39
39
  >
40
40
  <div class="bglform-contact-address">
41
41
  <input
42
42
  v-model="address.street"
43
- :placeholder="form.street"
43
+ :placeholder="context?.formPlaceholders?.street"
44
44
  type="text"
45
45
  >
46
46
  <div class="bglform-contact-address-flex">
47
47
  <input
48
48
  v-model="address.city"
49
- :placeholder="form.city"
49
+ :placeholder="context?.formPlaceholders?.city"
50
50
  type="text"
51
51
  >
52
52
  <input
53
53
  v-model="address.postal_code"
54
- :placeholder="form.zip"
54
+ :placeholder="context?.formPlaceholders?.zip"
55
55
  type="text"
56
56
  >
57
57
  </div>
58
58
  <input
59
59
  v-model="address.country"
60
- :placeholder="form.country"
60
+ :placeholder="context?.formPlaceholders?.country"
61
61
  type="text"
62
62
  >
63
63
  </div>
@@ -77,7 +77,7 @@
77
77
  thin
78
78
  @click="addNew"
79
79
  >
80
- {{ form.add }}
80
+ {{ context?.formPlaceholders?.add }}
81
81
  {{ context?.label }}
82
82
  </Btn>
83
83
  </div>
@@ -91,20 +91,26 @@ import { watch } from 'vue';
91
91
  import { Btn, useBagel } from '@bagelink/vue';
92
92
  import Checkbox from '../form/inputs/Checkbox.vue';
93
93
 
94
+ export interface AddressArrContext {
95
+
96
+ label?: string;
97
+ formPlaceholders?: {
98
+ add?: string;
99
+ cancel?: string;
100
+ city?: string;
101
+ country?: string;
102
+ delete?: string;
103
+ label?: string;
104
+ sure?: string;
105
+ zip?: string;
106
+ street?: string;
107
+ };
108
+ [key: string]: any;
109
+
110
+ }
94
111
  const bagel = useBagel();
95
112
  const props = defineProps<{
96
- context: Record<string, any>;
97
- form: {
98
- add: string;
99
- cancel: string;
100
- city: string;
101
- country: string;
102
- delete: string;
103
- label: string;
104
- sure: string;
105
- zip: string;
106
- street: string;
107
- };
113
+ context: AddressArrContext
108
114
  }>();
109
115
 
110
116
  let val = $ref<any[]>([]);
@@ -11,20 +11,20 @@
11
11
  v-if="deleteCandidate === i"
12
12
  >
13
13
  <p class="txt14">
14
- {{ form.sure }}
14
+ {{ context?.formPlaceholders?.sure }}
15
15
  </p>
16
16
  <Btn
17
17
  thin
18
18
  color="red"
19
19
  @click="deleteContact(bank_account.id)"
20
20
  >
21
- {{ form.delete }}
21
+ {{ context?.formPlaceholders?.delete }}
22
22
  </Btn>
23
23
  <Btn
24
24
  thin
25
25
  @click="deleteCandidate = -1"
26
26
  >
27
- {{ form.cancel }}
27
+ {{ context?.formPlaceholders?.cancel }}
28
28
  </Btn>
29
29
  </div>
30
30
  <Checkbox
@@ -35,25 +35,25 @@
35
35
  class="bglform-contact-label"
36
36
  v-model="bank_account.label"
37
37
  type="text"
38
- :placeholder="form.label"
38
+ :placeholder="context?.formPlaceholders?.label"
39
39
  >
40
40
  <div class="bglform-contact-address">
41
41
  <input
42
42
  v-model="bank_account.bank_name"
43
- :placeholder="form.bankName"
43
+ :placeholder="context?.formPlaceholders?.bankName"
44
44
  type="text"
45
45
  required
46
46
  >
47
47
  <div class="bglform-contact-address-flex">
48
48
  <input
49
49
  v-model="bank_account.branch"
50
- :placeholder="form.bankBranch"
50
+ :placeholder="context?.formPlaceholders?.bankBranch"
51
51
  type="text"
52
52
  required
53
53
  >
54
54
  <input
55
55
  v-model="bank_account.account_number"
56
- :placeholder="form.bankAccount"
56
+ :placeholder="context?.formPlaceholders?.bankAccount"
57
57
  type="text"
58
58
  required
59
59
  >
@@ -61,13 +61,13 @@
61
61
  <div class="grid gap-2">
62
62
  <input
63
63
  v-model="bank_account.bank_account_holder"
64
- :placeholder="form.bankAccountHolder"
64
+ :placeholder="context?.formPlaceholders?.bankAccountHolder"
65
65
  type="text"
66
66
  required
67
67
  >
68
68
  <input
69
69
  v-model="bank_account.bank_account_holder_id"
70
- :placeholder="form.bankAccountHolderID"
70
+ :placeholder="context?.formPlaceholders?.bankAccountHolderID"
71
71
  type="text"
72
72
  >
73
73
  <input
@@ -82,7 +82,7 @@
82
82
  >
83
83
  <input
84
84
  v-model="bank_account.bank_address"
85
- :placeholder="form.bankAddress"
85
+ :placeholder="context?.formPlaceholders?.bankAddress"
86
86
  type="text"
87
87
  >
88
88
  </div>
@@ -103,7 +103,7 @@
103
103
  thin
104
104
  @click="val.push({})"
105
105
  >
106
- {{ form.add }} {{ context?.label }}
106
+ {{ context?.formPlaceholders?.add }} {{ context?.label }}
107
107
  </Btn>
108
108
  </div>
109
109
  </div>
@@ -116,23 +116,27 @@ import { watch } from 'vue';
116
116
  import { Btn, useBagel } from '@bagelink/vue';
117
117
  import Checkbox from '../form/inputs/Checkbox.vue';
118
118
 
119
+ export interface BankDetailsContext {
120
+ label?: string;
121
+ formPlaceholders?: {
122
+ sure?: string;
123
+ delete?: string;
124
+ cancel?: string;
125
+ label?: string;
126
+ bankName?: string;
127
+ bankBranch?: string;
128
+ bankAccount?: string;
129
+ bankAccountHolder?: string;
130
+ bankAccountHolderID?: string;
131
+ bankAddress?: string;
132
+ add?: string;
133
+ };
134
+ [key: string]: any;
135
+ }
119
136
  const bagel = useBagel();
120
137
 
121
138
  const props = defineProps<{
122
- context: Record<string, any>;
123
- form: {
124
- sure: string
125
- delete: string
126
- cancel: string
127
- label: string
128
- bankName: string
129
- bankBranch: string
130
- bankAccount: string
131
- bankAccountHolder: string
132
- bankAccountHolderID: string
133
- bankAddress: string
134
- add: string
135
- }
139
+ context: BankDetailsContext;
136
140
  }>();
137
141
 
138
142
  let val = $ref<any[]>([]);
@@ -27,3 +27,6 @@ export {
27
27
  ToggleSwitchInput,
28
28
  FileUploadInput,
29
29
  };
30
+
31
+ export type{ BankDetailsContext } from './BankDetailsArray.vue';
32
+ export type{ AddressArrContext } from './AddressArray.vue';
@@ -50,11 +50,4 @@ export const useFormkit = () => {
50
50
 
51
51
  export const initials = (...strArr: string[]) => strArr.map((str) => str?.charAt(0)).join('');
52
52
 
53
- export const parseLocale = (str: string, i18nT = (_str: string) => _str) => {
54
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
55
- const [_, w] = str.split(/\$t\('?"?|'?"?\)/);
56
- if (!w) return str;
57
- return i18nT(w);
58
- };
59
-
60
53
  export { formatString } from './strings';