@bagelink/vue 0.0.1006 → 0.0.1010

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.
@@ -1 +1 @@
1
- {"version":3,"file":"timeAgo.d.ts","sourceRoot":"","sources":["../../src/utils/timeAgo.ts"],"names":[],"mappings":"AAAA,KAAK,sBAAsB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAmDvD,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,GAAE,sBAA6B,UA8B/E"}
1
+ {"version":3,"file":"timeAgo.d.ts","sourceRoot":"","sources":["../../src/utils/timeAgo.ts"],"names":[],"mappings":"AAAA,KAAK,sBAAsB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAsDvD,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,GAAE,sBAA6B,UAmC/E"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.1006",
4
+ "version": "0.0.1010",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import type { MaterialIcons, ThemeType } from '@bagelink/vue'
3
3
  import { MaterialIcon, Loading } from '@bagelink/vue'
4
- import { useSlots } from 'vue'
4
+ import { useSlots, type SetupContext } from 'vue'
5
5
  import { RouterLink } from 'vue-router'
6
6
 
7
7
  const props = withDefaults(
@@ -54,7 +54,7 @@ const bind = $computed(() => {
54
54
  }
55
55
  return obj
56
56
  })
57
- const slots = useSlots()
57
+ const slots: SetupContext["slots"] = useSlots()
58
58
  </script>
59
59
 
60
60
  <template>
@@ -80,8 +80,8 @@ onUnmounted(() => {
80
80
  :style="{ float: side ? 'left' : 'right' }"
81
81
  flat
82
82
  icon="close"
83
- @click="closeModal"
84
83
  thin
84
+ @click="closeModal"
85
85
  />
86
86
  <Title v-if="title" class="modal-title" tag="h3" :label="title" />
87
87
  </header>
@@ -113,6 +113,8 @@ onUnmounted(() => {
113
113
  <style>
114
114
  .modal{
115
115
  color: var(--bgl-popup-text);
116
+ /* display: flex;
117
+ flex-direction: column; */
116
118
  }
117
119
  .modal-title {
118
120
  text-align: center;
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import {
3
3
  BagelForm,
4
- type BglFormSchemaT,
4
+ type BglFormSchemaFnT,
5
5
  Btn,
6
6
  type BtnOptions,
7
7
  Modal,
@@ -14,7 +14,7 @@ const props = defineProps<{
14
14
  width?: string
15
15
  dismissable?: boolean
16
16
  actions?: BtnOptions[]
17
- schema: BglFormSchemaT | (() => BglFormSchemaT)
17
+ schema: BglFormSchemaFnT<any>
18
18
 
19
19
  onSubmit?: (formData: any) => Promise<void>
20
20
 
@@ -2,6 +2,7 @@
2
2
  import {
3
3
  CheckInput,
4
4
  DateInput,
5
+ FieldArray,
5
6
  type Field,
6
7
  FileUpload,
7
8
  RichText,
@@ -33,6 +34,7 @@ const is = $computed(() => {
33
34
  customAttrs.multiline = true
34
35
  return TextInput
35
36
  }
37
+ if (props.field.$el === 'array') return FieldArray
36
38
  if (props.field.$el === 'select') return SelectInput
37
39
  if (props.field.$el === 'toggle') return ToggleInput
38
40
  if (props.field.$el === 'check') return CheckInput
@@ -0,0 +1,103 @@
1
+ <script lang="ts" setup generic="T extends Record<string, any>">
2
+ import type {
3
+ AttributeFn,
4
+ AttributeValue,
5
+ Attributes,
6
+ BagelFieldOptions,
7
+ BglFormSchemaFnT,
8
+ Field,
9
+ } from '@bagelink/vue'
10
+ import { BglForm, Btn } from '@bagelink/vue'
11
+ import Card from '../Card.vue'
12
+
13
+ const props = withDefaults(
14
+ defineProps<{
15
+ el?: any
16
+ id: string
17
+ label?: string
18
+ placeholder?: string
19
+ children?: Field<T>[]
20
+ class?: AttributeValue | AttributeFn<T>
21
+ attrs?: Attributes<T>
22
+ required?: boolean
23
+ disabled?: boolean
24
+ helptext?: string
25
+ options?: BagelFieldOptions<T>
26
+ defaultValue?: any
27
+ add?: boolean
28
+ delete?: boolean
29
+ schema: BglFormSchemaFnT
30
+ modelValue: T[]
31
+ }>(),
32
+ {
33
+ delete: true,
34
+ add: true,
35
+ el: 'div',
36
+ }
37
+ )
38
+
39
+ const emit = defineEmits(['update:modelValue'])
40
+
41
+ const data = $ref<T[]>(props.modelValue || [])
42
+
43
+ function emitValue() {
44
+ emit('update:modelValue', data)
45
+ }
46
+
47
+ function deleteItem(i: number) {
48
+ data.splice(i, 1)
49
+ emitValue()
50
+ }
51
+
52
+ function addItem() {
53
+ data.push({} as any)
54
+ emitValue()
55
+ }
56
+
57
+ const computedField = $computed(
58
+ () => ({
59
+ label: props.label,
60
+ placeholder: props.placeholder,
61
+ children: props.children,
62
+ class: props.class,
63
+ attrs: props.attrs,
64
+ required: props.required,
65
+ disabled: props.disabled,
66
+ helptext: props.helptext,
67
+ options: props.options,
68
+ defaultValue: props.defaultValue,
69
+ $el: props.el,
70
+ }) as Field<T>
71
+ ) as Field<Record<string, any>>
72
+ </script>
73
+
74
+ <template>
75
+ <div>
76
+ <p class="label mb-05">
77
+ {{ label }}
78
+ </p>
79
+ <div>
80
+ <Card v-for="(_, i) in data" :key="i" outline thin class="mb-05 itemBox bg-white transition">
81
+ <BglForm v-if="schema" v-model="data[i]" :schema="schema" @update:model-value="emitValue" />
82
+ <Btn
83
+ v-if="props.delete"
84
+ icon="delete"
85
+ value="Delete"
86
+ class="txt10 opacity-7 color-red"
87
+ thin
88
+ flat
89
+ @click="deleteItem(i)"
90
+ />
91
+ </Card>
92
+ <Btn v-if="add" icon="add" color="gray" class="w-100" @click="addItem">
93
+ <p>Add {{ label }}</p>
94
+ </Btn>
95
+ </div>
96
+ </div>
97
+ </template>
98
+
99
+ <style scoped>
100
+ .itemBox:hover {
101
+ outline: 1px solid var(--bgl-primary);
102
+ }
103
+ </style>
@@ -2,4 +2,5 @@ export { default as BglField } from './BglField.vue'
2
2
  export { default as BglForm } from './BglForm.vue'
3
3
  export { default as BagelForm } from './BglForm.vue'
4
4
  export { default as BglMultiStepForm } from './BglMultiStepForm.vue'
5
+ export { default as FieldArray } from './FieldArray.vue'
5
6
  export * from './inputs'
@@ -67,6 +67,14 @@ watch(() => editor.state.content, (newValue) => {
67
67
  </div>
68
68
  </template>
69
69
 
70
+ <style>
71
+ .content-area p,
72
+ .content-area span,
73
+ .content-area li{
74
+ line-height: 1.65;
75
+ }
76
+ </style>
77
+
70
78
  <style scoped>
71
79
  .rich-text-editor {
72
80
  background: var(--input-bg);
@@ -140,4 +148,4 @@ watch(() => editor.state.content, (newValue) => {
140
148
  .fullscreen-mode .code-editor{
141
149
  height: 100% !important;
142
150
  }
143
- </style>
151
+ </style
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import type { NavLink } from '@bagelink/vue'
3
- import { Btn, Card, Icon } from '@bagelink/vue'
3
+ import { Btn, Card, Icon, useDebounceFn } from '@bagelink/vue'
4
4
  import { useSlots } from 'vue'
5
5
 
6
6
  const props = defineProps<{
@@ -14,11 +14,10 @@ const emit = defineEmits(['update:open'])
14
14
  const slots = useSlots()
15
15
 
16
16
  let isOpen = $ref(props.open)
17
-
18
- function toggleMenu() {
17
+ const toggleMenu = useDebounceFn(() => {
19
18
  isOpen = !isOpen
20
19
  emit('update:open', isOpen)
21
- }
20
+ })
22
21
  </script>
23
22
 
24
23
  <template>
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import type { VNode } from 'vue'
2
+ import type { SetupContext, VNode } from 'vue'
3
3
  import { type Tab, TabsNav } from '@bagelink/vue'
4
4
  import { defineComponent, h, useSlots } from 'vue'
5
5
 
@@ -12,7 +12,7 @@ const props = defineProps<{
12
12
  }>()
13
13
 
14
14
  const emit = defineEmits(['update:modelValue'])
15
- const slots = useSlots()
15
+ const slots: SetupContext["slots"] = useSlots()
16
16
  const group = Math.random().toString(36).slice(7)
17
17
  const { currentTab } = useTabs(group)
18
18
 
@@ -34,7 +34,9 @@ function updateIndicator() {
34
34
  if (activeTab && tabsWrap.value) {
35
35
  const { offsetLeft, offsetWidth } = activeTab
36
36
  tabsWrap.value.style.setProperty('--indicator-left', `${offsetLeft}px`)
37
- tabsWrap.value.style.setProperty('--indicator-width', `${offsetWidth}px`)
37
+ if (tabsWrap.value) {
38
+ tabsWrap.value.style.setProperty('--indicator-width', `${offsetWidth}px`)
39
+ }
38
40
  }
39
41
  }
40
42
 
@@ -75,7 +77,7 @@ onBeforeUnmount(() => {
75
77
 
76
78
  <template>
77
79
  <div
78
- ref="tabsWrap" class="grid auto-flow-columns relative fit-content bgl_tabs_wrap"
80
+ ref="tabsWrap" class="grid auto-flow-columns relative fit-content bgl_tabs_wrap overflow-hidden"
79
81
  :class="{ 'bgl_flat-tabs': flat, 'bgl_vertical-tabs': vertical }"
80
82
  >
81
83
  <button
@@ -941,101 +941,451 @@
941
941
  max-width: 100px;
942
942
  }
943
943
 
944
+ .w110,
945
+ .w110px {
946
+ max-width: 110px;
947
+ }
948
+
949
+ .w120,
950
+ .w120px {
951
+ max-width: 120px;
952
+ }
953
+
954
+ .w130,
955
+ .w130px {
956
+ max-width: 130px;
957
+ }
958
+
959
+ .w140,
960
+ .w140px {
961
+ max-width: 140px;
962
+ }
963
+
944
964
  .w150,
945
965
  .w150px {
946
966
  max-width: 150px;
947
967
  }
948
968
 
969
+ .w160,
970
+ .w160px {
971
+ max-width: 160px;
972
+ }
973
+
974
+ .w170,
975
+ .w170px {
976
+ max-width: 170px;
977
+ }
978
+
979
+ .w180,
980
+ .w180px {
981
+ max-width: 180px;
982
+ }
983
+
984
+ .w190,
985
+ .w190px {
986
+ max-width: 190px;
987
+ }
988
+
949
989
  .w200,
950
990
  .w200px {
951
991
  max-width: 200px;
952
992
  }
953
993
 
994
+ .w210,
995
+ .w210px {
996
+ max-width: 210px;
997
+ }
998
+
999
+ .w220,
1000
+ .w220px {
1001
+ max-width: 220px;
1002
+ }
1003
+
1004
+ .w230,
1005
+ .w230px {
1006
+ max-width: 230px;
1007
+ }
1008
+
1009
+ .w240,
1010
+ .w240px {
1011
+ max-width: 240px;
1012
+ }
1013
+
954
1014
  .w250,
955
1015
  .w250px {
956
1016
  max-width: 250px;
957
1017
  }
958
1018
 
1019
+ .w260,
1020
+ .w260px {
1021
+ max-width: 260px;
1022
+ }
1023
+
1024
+ .w270,
1025
+ .w270px {
1026
+ max-width: 270px;
1027
+ }
1028
+
1029
+ .w280,
1030
+ .w280px {
1031
+ max-width: 280px;
1032
+ }
1033
+
1034
+ .w290,
1035
+ .w290px {
1036
+ max-width: 290px;
1037
+ }
1038
+
959
1039
  .w300,
960
1040
  .w300px {
961
1041
  max-width: 300px;
962
1042
  }
963
1043
 
1044
+ .w310,
1045
+ .w310px {
1046
+ max-width: 310px;
1047
+ }
1048
+
1049
+ .w320,
1050
+ .w320px {
1051
+ max-width: 320px;
1052
+ }
1053
+
1054
+ .w330,
1055
+ .w330px {
1056
+ max-width: 330px;
1057
+ }
1058
+
1059
+ .w340,
1060
+ .w340px {
1061
+ max-width: 340px;
1062
+ }
1063
+
964
1064
  .w350,
965
1065
  .w350px {
966
1066
  max-width: 350px;
967
1067
  }
968
1068
 
1069
+ .w360,
1070
+ .w360px {
1071
+ max-width: 360px;
1072
+ }
1073
+
1074
+ .w370,
1075
+ .w370px {
1076
+ max-width: 370px;
1077
+ }
1078
+
1079
+ .w380,
1080
+ .w380px {
1081
+ max-width: 380px;
1082
+ }
1083
+
1084
+ .w390,
1085
+ .w390px {
1086
+ max-width: 390px;
1087
+ }
1088
+
969
1089
  .w400,
970
1090
  .w400px {
971
1091
  max-width: 400px;
972
1092
  }
973
1093
 
1094
+ .w410,
1095
+ .w410px {
1096
+ max-width: 410px;
1097
+ }
1098
+
1099
+ .w420,
1100
+ .w420px {
1101
+ max-width: 420px;
1102
+ }
1103
+
1104
+ .w430,
1105
+ .w430px {
1106
+ max-width: 430px;
1107
+ }
1108
+
1109
+ .w440,
1110
+ .w440px {
1111
+ max-width: 440px;
1112
+ }
1113
+
974
1114
  .w450,
975
1115
  .w450px {
976
1116
  max-width: 450px;
977
1117
  }
978
1118
 
1119
+ .w460,
1120
+ .w460px {
1121
+ max-width: 460px;
1122
+ }
1123
+
1124
+ .w470,
1125
+ .w470px {
1126
+ max-width: 470px;
1127
+ }
1128
+
1129
+ .w480,
1130
+ .w480px {
1131
+ max-width: 480px;
1132
+ }
1133
+
1134
+ .w490,
1135
+ .w490px {
1136
+ max-width: 490px;
1137
+ }
1138
+
979
1139
  .w500,
980
1140
  .w500px {
981
1141
  max-width: 500px;
982
1142
  }
983
1143
 
1144
+ .w510,
1145
+ .w510px {
1146
+ max-width: 510px;
1147
+ }
1148
+
1149
+ .w520,
1150
+ .w520px {
1151
+ max-width: 520px;
1152
+ }
1153
+
1154
+ .w530,
1155
+ .w530px {
1156
+ max-width: 530px;
1157
+ }
1158
+
1159
+ .w540,
1160
+ .w540px {
1161
+ max-width: 540px;
1162
+ }
1163
+
984
1164
  .w550,
985
1165
  .w550px {
986
1166
  max-width: 550px;
987
1167
  }
988
1168
 
1169
+ .w560,
1170
+ .w560px {
1171
+ max-width: 560px;
1172
+ }
1173
+
1174
+ .w570,
1175
+ .w570px {
1176
+ max-width: 570px;
1177
+ }
1178
+
1179
+ .w580,
1180
+ .w580px {
1181
+ max-width: 580px;
1182
+ }
1183
+
1184
+ .w590,
1185
+ .w590px {
1186
+ max-width: 590px;
1187
+ }
1188
+
989
1189
  .w600,
990
1190
  .w600px {
991
1191
  max-width: 600px;
992
1192
  }
993
1193
 
1194
+ .w610,
1195
+ .w610px {
1196
+ max-width: 610px;
1197
+ }
1198
+
1199
+ .w620,
1200
+ .w620px {
1201
+ max-width: 620px;
1202
+ }
1203
+
1204
+ .w630,
1205
+ .w630px {
1206
+ max-width: 630px;
1207
+ }
1208
+
1209
+ .w640,
1210
+ .w640px {
1211
+ max-width: 640px;
1212
+ }
1213
+
994
1214
  .w650,
995
1215
  .w650px {
996
1216
  max-width: 650px;
997
1217
  }
998
1218
 
1219
+ .w660,
1220
+ .w660px {
1221
+ max-width: 660px;
1222
+ }
1223
+
1224
+ .w670,
1225
+ .w670px {
1226
+ max-width: 670px;
1227
+ }
1228
+
1229
+ .w680,
1230
+ .w680px {
1231
+ max-width: 680px;
1232
+ }
1233
+
1234
+ .w690,
1235
+ .w690px {
1236
+ max-width: 690px;
1237
+ }
1238
+
999
1239
  .w700,
1000
1240
  .w700px {
1001
1241
  max-width: 700px;
1002
1242
  }
1003
1243
 
1244
+ .w710,
1245
+ .w710px {
1246
+ max-width: 710px;
1247
+ }
1248
+
1249
+ .w720,
1250
+ .w720px {
1251
+ max-width: 720px;
1252
+ }
1253
+
1254
+ .w730,
1255
+ .w730px {
1256
+ max-width: 730px;
1257
+ }
1258
+
1259
+ .w740,
1260
+ .w740px {
1261
+ max-width: 740px;
1262
+ }
1263
+
1004
1264
  .w750,
1005
1265
  .w750px {
1006
1266
  max-width: 750px;
1007
1267
  }
1008
1268
 
1269
+ .w760,
1270
+ .w760px {
1271
+ max-width: 760px;
1272
+ }
1273
+
1009
1274
  .w770,
1010
1275
  .w770px {
1011
1276
  max-width: 770px;
1012
1277
  }
1013
1278
 
1279
+ .w780,
1280
+ .w780px {
1281
+ max-width: 780px;
1282
+ }
1283
+
1284
+ .w790,
1285
+ .w790px {
1286
+ max-width: 790px;
1287
+ }
1288
+
1014
1289
  .w800,
1015
1290
  .w800px {
1016
1291
  max-width: 800px;
1017
1292
  }
1018
1293
 
1294
+ .w810,
1295
+ .w810px {
1296
+ max-width: 810px;
1297
+ }
1298
+
1299
+ .w820,
1300
+ .w820px {
1301
+ max-width: 820px;
1302
+ }
1303
+
1304
+ .w830,
1305
+ .w830px {
1306
+ max-width: 830px;
1307
+ }
1308
+
1309
+ .w840,
1310
+ .w840px {
1311
+ max-width: 840px;
1312
+ }
1313
+
1019
1314
  .w850,
1020
1315
  .w850px {
1021
1316
  max-width: 850px;
1022
1317
  }
1023
1318
 
1319
+ .w860,
1320
+ .w860px {
1321
+ max-width: 860px;
1322
+ }
1323
+
1324
+ .w870,
1325
+ .w870px {
1326
+ max-width: 870px;
1327
+ }
1328
+
1329
+ .w880,
1330
+ .w880px {
1331
+ max-width: 880px;
1332
+ }
1333
+
1334
+ .w890,
1335
+ .w890px {
1336
+ max-width: 890px;
1337
+ }
1338
+
1024
1339
  .w900,
1025
1340
  .w900px {
1026
1341
  max-width: 900px;
1027
1342
  }
1028
1343
 
1344
+ .w910,
1345
+ .w910px {
1346
+ max-width: 910px;
1347
+ }
1348
+
1349
+ .w920,
1350
+ .w920px {
1351
+ max-width: 920px;
1352
+ }
1353
+
1354
+ .w930,
1355
+ .w930px {
1356
+ max-width: 930px;
1357
+ }
1358
+
1359
+ .w940,
1360
+ .w940px {
1361
+ max-width: 940px;
1362
+ }
1363
+
1029
1364
  .w950,
1030
1365
  .w950px {
1031
1366
  max-width: 950px;
1032
1367
  }
1033
1368
 
1369
+ .w960,
1370
+ .w960px {
1371
+ max-width: 960px;
1372
+ }
1373
+
1034
1374
  .w970,
1035
1375
  .w970px {
1036
1376
  max-width: 970px;
1037
1377
  }
1038
1378
 
1379
+ .w980,
1380
+ .w980px {
1381
+ max-width: 980px;
1382
+ }
1383
+
1384
+ .w990,
1385
+ .w990px {
1386
+ max-width: 990px;
1387
+ }
1388
+
1039
1389
  .w1000,
1040
1390
  .w1000px {
1041
1391
  max-width: 1000px;