@bagelink/vue 1.2.79 → 1.2.81
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/bin/experimentalGenTypedRoutes.ts +13 -2
- package/dist/components/form/BagelForm.vue.d.ts +1 -0
- package/dist/components/form/BagelForm.vue.d.ts.map +1 -1
- package/dist/components/form/BglMultiStepForm.vue.d.ts +7 -4
- package/dist/components/form/BglMultiStepForm.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts +14 -6
- package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/index.cjs +161 -134
- package/dist/index.mjs +161 -134
- package/dist/style.css +111 -81
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/form/BagelForm.vue +2 -1
- package/src/components/form/BglMultiStepForm.vue +47 -32
- package/src/components/form/inputs/CodeEditor/Index.vue +160 -98
- package/src/components/form/inputs/RichText/index.vue +12 -11
- package/src/utils/index.ts +38 -13
package/dist/style.css
CHANGED
|
@@ -1134,32 +1134,30 @@ fieldset[data-v-f7e758e5] {
|
|
|
1134
1134
|
.fi[data-v-f99f1900]:before{ content:" "
|
|
1135
1135
|
}
|
|
1136
1136
|
|
|
1137
|
-
.bgl-multi-step-form[data-v-
|
|
1137
|
+
.bgl-multi-step-form[data-v-9c0b618c] {
|
|
1138
1138
|
display: flex;
|
|
1139
1139
|
flex-direction: column;
|
|
1140
1140
|
gap: 1rem;
|
|
1141
1141
|
width: 100%;
|
|
1142
1142
|
/* Default transition duration */
|
|
1143
|
-
--transition-duration:
|
|
1143
|
+
--transition-duration: 300ms;
|
|
1144
1144
|
--move-distance: 35%;
|
|
1145
|
-
--ease-in:
|
|
1146
|
-
--ease-out:
|
|
1147
|
-
/* --ease-in: cubic-bezier(0.42, 0, 0.58, 1); */
|
|
1148
|
-
/* --ease-out: cubic-bezier(0.5, 0, 0.75, 0); */
|
|
1145
|
+
--ease-in: cubic-bezier(0.42, 0, 0.58, 1);
|
|
1146
|
+
--ease-out: cubic-bezier(0.42, 0, 0.58, 1);
|
|
1149
1147
|
}
|
|
1150
|
-
.bgl-steps-indicator[data-v-
|
|
1148
|
+
.bgl-steps-indicator[data-v-9c0b618c] {
|
|
1151
1149
|
display: flex;
|
|
1152
1150
|
justify-content: space-between;
|
|
1153
1151
|
align-items: center;
|
|
1154
1152
|
margin-bottom: 1rem;
|
|
1155
1153
|
}
|
|
1156
|
-
.bgl-step-indicator[data-v-
|
|
1154
|
+
.bgl-step-indicator[data-v-9c0b618c] {
|
|
1157
1155
|
display: flex;
|
|
1158
1156
|
flex-direction: column;
|
|
1159
1157
|
align-items: center;
|
|
1160
1158
|
position: relative;
|
|
1161
1159
|
}
|
|
1162
|
-
.bgl-step-indicator[data-v-
|
|
1160
|
+
.bgl-step-indicator[data-v-9c0b618c]::before {
|
|
1163
1161
|
content: '';
|
|
1164
1162
|
position: absolute;
|
|
1165
1163
|
top: 50%;
|
|
@@ -1169,10 +1167,10 @@ fieldset[data-v-f7e758e5] {
|
|
|
1169
1167
|
background: #e0e0e0;
|
|
1170
1168
|
z-index: -1;
|
|
1171
1169
|
}
|
|
1172
|
-
.bgl-step-indicator[data-v-
|
|
1170
|
+
.bgl-step-indicator[data-v-9c0b618c]:first-child::before {
|
|
1173
1171
|
display: none;
|
|
1174
1172
|
}
|
|
1175
|
-
.bgl-step-indicator > span[data-v-
|
|
1173
|
+
.bgl-step-indicator > span[data-v-9c0b618c]:first-child {
|
|
1176
1174
|
width: 30px;
|
|
1177
1175
|
height: 30px;
|
|
1178
1176
|
border-radius: 50%;
|
|
@@ -1183,73 +1181,77 @@ fieldset[data-v-f7e758e5] {
|
|
|
1183
1181
|
justify-content: center;
|
|
1184
1182
|
margin-bottom: 0.5rem;
|
|
1185
1183
|
}
|
|
1186
|
-
.bgl-step-indicator.active > span[data-v-
|
|
1184
|
+
.bgl-step-indicator.active > span[data-v-9c0b618c]:first-child {
|
|
1187
1185
|
background: var(--primary-color, #4CAF50);
|
|
1188
1186
|
color: white;
|
|
1189
1187
|
}
|
|
1190
|
-
.bgl-step-indicator.completed > span[data-v-
|
|
1188
|
+
.bgl-step-indicator.completed > span[data-v-9c0b618c]:first-child {
|
|
1191
1189
|
background: var(--success-color, #8BC34A);
|
|
1192
1190
|
color: white;
|
|
1193
1191
|
}
|
|
1194
|
-
.bgl-step-indicator.clickable[data-v-
|
|
1192
|
+
.bgl-step-indicator.clickable[data-v-9c0b618c] {
|
|
1195
1193
|
cursor: pointer;
|
|
1196
1194
|
}
|
|
1197
|
-
.bgl-step-label[data-v-
|
|
1195
|
+
.bgl-step-label[data-v-9c0b618c] {
|
|
1198
1196
|
font-size: 0.8rem;
|
|
1199
1197
|
max-width: 100px;
|
|
1200
1198
|
text-align: center;
|
|
1201
1199
|
}
|
|
1202
|
-
.bgl-form-wrapper[data-v-
|
|
1200
|
+
.bgl-form-wrapper[data-v-9c0b618c] {
|
|
1203
1201
|
display: grid;
|
|
1204
1202
|
overflow: clip;
|
|
1205
1203
|
height: auto;
|
|
1206
1204
|
transition: height var(--transition-duration) ease;
|
|
1207
1205
|
interpolate-size: allow-keywords;
|
|
1208
1206
|
}
|
|
1209
|
-
.bgl-form-wrapper > div[data-v-
|
|
1207
|
+
.bgl-form-wrapper > div[data-v-9c0b618c] {
|
|
1210
1208
|
grid-area: 1 / 1;
|
|
1211
1209
|
}
|
|
1212
|
-
.bgl-form-container[data-v-
|
|
1210
|
+
.bgl-form-container[data-v-9c0b618c] {
|
|
1213
1211
|
width: 100%;
|
|
1214
1212
|
display: flex;
|
|
1215
1213
|
flex-direction: column;
|
|
1216
1214
|
}
|
|
1217
|
-
.bgl-step-controls[data-v-
|
|
1215
|
+
.bgl-step-controls[data-v-9c0b618c] {
|
|
1218
1216
|
display: flex;
|
|
1219
1217
|
justify-content: center;
|
|
1220
1218
|
gap: 1rem;
|
|
1221
1219
|
grid-area: unset !important;
|
|
1220
|
+
margin-top: 2rem;
|
|
1222
1221
|
}
|
|
1223
1222
|
|
|
1224
1223
|
/* Slide Left Animation (going forward) */
|
|
1225
|
-
.slide-left-enter-active[data-v-
|
|
1226
|
-
transition: opacity
|
|
1224
|
+
.slide-left-enter-active[data-v-9c0b618c] {
|
|
1225
|
+
transition: opacity var(--transition-duration) var(--ease-in),
|
|
1226
|
+
transform var(--transition-duration) var(--ease-in);
|
|
1227
1227
|
}
|
|
1228
|
-
.slide-left-leave-active[data-v-
|
|
1229
|
-
transition: opacity
|
|
1228
|
+
.slide-left-leave-active[data-v-9c0b618c] {
|
|
1229
|
+
transition: opacity var(--transition-duration) var(--ease-out),
|
|
1230
|
+
transform var(--transition-duration) var(--ease-out);
|
|
1230
1231
|
}
|
|
1231
|
-
.slide-left-enter-from[data-v-
|
|
1232
|
+
.slide-left-enter-from[data-v-9c0b618c] {
|
|
1232
1233
|
opacity: 0;
|
|
1233
1234
|
transform: translateX(var(--move-distance));
|
|
1234
1235
|
}
|
|
1235
|
-
.slide-left-leave-to[data-v-
|
|
1236
|
+
.slide-left-leave-to[data-v-9c0b618c] {
|
|
1236
1237
|
opacity: 0;
|
|
1237
1238
|
transform: translateX(-30%);
|
|
1238
1239
|
}
|
|
1239
1240
|
|
|
1240
1241
|
/* Slide Right Animation (going back) */
|
|
1241
|
-
.slide-right-enter-active[data-v-
|
|
1242
|
-
transition:
|
|
1242
|
+
.slide-right-enter-active[data-v-9c0b618c] {
|
|
1243
|
+
transition: opacity var(--transition-duration) var(--ease-in),
|
|
1244
|
+
transform var(--transition-duration) var(--ease-in);
|
|
1243
1245
|
}
|
|
1244
|
-
.slide-right-leave-active[data-v-
|
|
1245
|
-
transition:
|
|
1246
|
-
|
|
1246
|
+
.slide-right-leave-active[data-v-9c0b618c] {
|
|
1247
|
+
transition: opacity var(--transition-duration) var(--ease-out),
|
|
1248
|
+
transform var(--transition-duration) var(--ease-out);
|
|
1247
1249
|
}
|
|
1248
|
-
.slide-right-enter-from[data-v-
|
|
1250
|
+
.slide-right-enter-from[data-v-9c0b618c] {
|
|
1249
1251
|
opacity: 0;
|
|
1250
1252
|
transform: translateX(-30%);
|
|
1251
1253
|
}
|
|
1252
|
-
.slide-right-leave-to[data-v-
|
|
1254
|
+
.slide-right-leave-to[data-v-9c0b618c] {
|
|
1253
1255
|
opacity: 0;
|
|
1254
1256
|
transform: translateX(var(--move-distance));
|
|
1255
1257
|
}
|
|
@@ -1370,42 +1372,78 @@ fieldset[data-v-f7e758e5] {
|
|
|
1370
1372
|
color: var(--label-color) !important;
|
|
1371
1373
|
}
|
|
1372
1374
|
|
|
1373
|
-
|
|
1375
|
+
/* Global styles */
|
|
1376
|
+
pre code.hljs {
|
|
1374
1377
|
padding: 0 !important;
|
|
1375
|
-
|
|
1376
|
-
position: absolute;
|
|
1378
|
+
background: transparent !important;
|
|
1377
1379
|
}
|
|
1378
1380
|
|
|
1379
|
-
.
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
word-wrap: break-word;
|
|
1383
|
-
caret-color: var(--bgl-white);
|
|
1384
|
-
color: var(--bgl-white);
|
|
1381
|
+
.code-editor-container[data-v-6ab9613f] {
|
|
1382
|
+
margin-bottom: 0.5rem;
|
|
1383
|
+
height: 100%;
|
|
1385
1384
|
}
|
|
1386
|
-
.
|
|
1387
|
-
|
|
1388
|
-
|
|
1385
|
+
.label[data-v-6ab9613f] {
|
|
1386
|
+
display: block;
|
|
1387
|
+
text-align: left;
|
|
1388
|
+
margin-bottom: 0.25rem;
|
|
1389
1389
|
}
|
|
1390
|
-
.code-editor-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1390
|
+
.code-editor-grandpa[data-v-6ab9613f] {
|
|
1391
|
+
background: #22252A;
|
|
1392
|
+
border-radius: 0.25rem;
|
|
1393
|
+
width: 100%;
|
|
1394
|
+
height: 100%;
|
|
1395
|
+
overflow: auto;
|
|
1396
|
+
padding: 1ch;
|
|
1397
|
+
padding-inline-start: 2ch;
|
|
1394
1398
|
}
|
|
1395
|
-
.code-editor-
|
|
1396
|
-
|
|
1397
|
-
|
|
1399
|
+
.code-editor-grandpa[data-v-6ab9613f]:focus-within {
|
|
1400
|
+
outline: solid 1px var(--border-color, #4f575f);
|
|
1401
|
+
box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.13);
|
|
1398
1402
|
}
|
|
1399
|
-
.
|
|
1400
|
-
|
|
1401
|
-
|
|
1403
|
+
.editor-content-papa[data-v-6ab9613f] {
|
|
1404
|
+
position: relative;
|
|
1405
|
+
width: 100%;
|
|
1406
|
+
padding-bottom: calc(100% - 5lh);
|
|
1402
1407
|
}
|
|
1403
|
-
.code-
|
|
1404
|
-
|
|
1405
|
-
|
|
1408
|
+
.code-display[data-v-6ab9613f],
|
|
1409
|
+
.code-input[data-v-6ab9613f] {
|
|
1410
|
+
inset: 0;
|
|
1411
|
+
margin: 0;
|
|
1412
|
+
padding: 0;
|
|
1413
|
+
width: 100%;
|
|
1414
|
+
height: 100%;
|
|
1415
|
+
overflow: auto;
|
|
1416
|
+
font-family: monospace;
|
|
1417
|
+
font-size: 1em;
|
|
1418
|
+
line-height: 1.5;
|
|
1419
|
+
tab-size: 2;
|
|
1420
|
+
word-break: keep-all;
|
|
1421
|
+
text-align: left;
|
|
1406
1422
|
}
|
|
1407
|
-
.code-
|
|
1408
|
-
|
|
1423
|
+
.code-display[data-v-6ab9613f] {
|
|
1424
|
+
position: relative;
|
|
1425
|
+
color: #fff;
|
|
1426
|
+
pointer-events: none;
|
|
1427
|
+
z-index: 1;
|
|
1428
|
+
}
|
|
1429
|
+
.code-display code[data-v-6ab9613f] {
|
|
1430
|
+
display: block;
|
|
1431
|
+
background: transparent !important;
|
|
1432
|
+
padding: 0 !important;
|
|
1433
|
+
}
|
|
1434
|
+
.code-input[data-v-6ab9613f] {
|
|
1435
|
+
position: absolute;
|
|
1436
|
+
background: transparent;
|
|
1437
|
+
color: transparent;
|
|
1438
|
+
caret-color: #fff;
|
|
1439
|
+
border: none;
|
|
1440
|
+
resize: none;
|
|
1441
|
+
outline: none;
|
|
1442
|
+
z-index: 2;
|
|
1443
|
+
}
|
|
1444
|
+
.code-input[data-v-6ab9613f]::selection {
|
|
1445
|
+
background-color: rgba(36, 102, 188, 0.3);
|
|
1446
|
+
color: transparent;
|
|
1409
1447
|
}
|
|
1410
1448
|
|
|
1411
1449
|
.colorInputPick{
|
|
@@ -2008,32 +2046,27 @@ input[type="range"][data-v-46e22f3e]:active::-webkit-slider-thumb {
|
|
|
2008
2046
|
.content-area li{
|
|
2009
2047
|
line-height: 1.65;
|
|
2010
2048
|
}
|
|
2011
|
-
.code-editor {
|
|
2012
|
-
flex: 1;
|
|
2013
|
-
min-height: 240px !important;
|
|
2014
|
-
height: 100%;
|
|
2015
|
-
}
|
|
2016
2049
|
|
|
2017
|
-
.rich-text-editor[data-v-
|
|
2050
|
+
.rich-text-editor[data-v-2782b5dd] {
|
|
2018
2051
|
background: var(--input-bg);
|
|
2019
2052
|
border: 1px solid var(--border-color);
|
|
2020
2053
|
transition: all 0.3s ease;
|
|
2021
2054
|
}
|
|
2022
|
-
.editor-container[data-v-
|
|
2055
|
+
.editor-container[data-v-2782b5dd] {
|
|
2023
2056
|
display: flex;
|
|
2024
|
-
gap:
|
|
2057
|
+
gap: 0.5rem;
|
|
2025
2058
|
}
|
|
2026
|
-
.content-area[data-v-
|
|
2027
|
-
.preview-area[data-v-
|
|
2059
|
+
.content-area[data-v-2782b5dd],
|
|
2060
|
+
.preview-area[data-v-2782b5dd] {
|
|
2028
2061
|
flex: 1;
|
|
2029
2062
|
min-height: 200px;
|
|
2030
2063
|
background: var(--bgl-richtext-color);
|
|
2031
2064
|
}
|
|
2032
|
-
.split-view[data-v-
|
|
2065
|
+
.split-view[data-v-2782b5dd] {
|
|
2033
2066
|
display: grid;
|
|
2034
2067
|
grid-template-columns: 1fr 1fr;
|
|
2035
2068
|
}
|
|
2036
|
-
.editableContent[data-v-
|
|
2069
|
+
.editableContent[data-v-2782b5dd] {
|
|
2037
2070
|
width: 100%;
|
|
2038
2071
|
min-height: 240px;
|
|
2039
2072
|
height: 100%;
|
|
@@ -2041,7 +2074,7 @@ input[type="range"][data-v-46e22f3e]:active::-webkit-slider-thumb {
|
|
|
2041
2074
|
outline: none;
|
|
2042
2075
|
background: transparent;
|
|
2043
2076
|
}
|
|
2044
|
-
.html-editor[data-v-
|
|
2077
|
+
.html-editor[data-v-2782b5dd] {
|
|
2045
2078
|
width: 100%;
|
|
2046
2079
|
height: 100%;
|
|
2047
2080
|
min-height: 200px;
|
|
@@ -2052,12 +2085,12 @@ input[type="range"][data-v-46e22f3e]:active::-webkit-slider-thumb {
|
|
|
2052
2085
|
color: white;
|
|
2053
2086
|
background-color: var(--bgl-black);
|
|
2054
2087
|
}
|
|
2055
|
-
.preview-area[data-v-
|
|
2088
|
+
.preview-area[data-v-2782b5dd] {
|
|
2056
2089
|
font-family: monospace;
|
|
2057
2090
|
white-space: pre-wrap;
|
|
2058
2091
|
overflow-x: auto;
|
|
2059
2092
|
}
|
|
2060
|
-
.fullscreen-mode[data-v-
|
|
2093
|
+
.fullscreen-mode[data-v-2782b5dd] {
|
|
2061
2094
|
position: fixed;
|
|
2062
2095
|
top: 0;
|
|
2063
2096
|
left: 0;
|
|
@@ -2066,18 +2099,15 @@ input[type="range"][data-v-46e22f3e]:active::-webkit-slider-thumb {
|
|
|
2066
2099
|
z-index: 9999;
|
|
2067
2100
|
padding: 2rem;
|
|
2068
2101
|
}
|
|
2069
|
-
.fullscreen-mode .editor-container[data-v-
|
|
2102
|
+
.fullscreen-mode .editor-container[data-v-2782b5dd] {
|
|
2070
2103
|
height: calc(100vh - 4rem);
|
|
2071
2104
|
}
|
|
2072
|
-
.fullscreen-mode .content-area[data-v-
|
|
2073
|
-
.fullscreen-mode .preview-area[data-v-
|
|
2105
|
+
.fullscreen-mode .content-area[data-v-2782b5dd],
|
|
2106
|
+
.fullscreen-mode .preview-area[data-v-2782b5dd] {
|
|
2074
2107
|
height: 100%;
|
|
2075
2108
|
overflow-y: auto;
|
|
2076
2109
|
}
|
|
2077
|
-
.
|
|
2078
|
-
height: 100% !important;
|
|
2079
|
-
}
|
|
2080
|
-
.debug-controls[data-v-30bcda4c] {
|
|
2110
|
+
.debug-controls[data-v-2782b5dd] {
|
|
2081
2111
|
display: flex;
|
|
2082
2112
|
gap: 0.5rem;
|
|
2083
2113
|
justify-content: flex-end;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAIrE,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,IAAI,GAAE,MAAY,QAO1D;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,UAMlC;AAED,wBAAgB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQ3D;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,iBAGtE;AAED,wBAAgB,QAAQ,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,UAG3C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,QAIrE;AAED,wBAAgB,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,UAOpE;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EAC7C,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,EACxB,QAAQ,CAAC,EAAE,GAAG,EACd,GAAG,CAAC,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AE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAO5C,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,sBAM5C;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,GAAE,GAAe,GAAG,GAAG,CAa1F"}
|
package/package.json
CHANGED
|
@@ -111,6 +111,7 @@ function updateFormData(fieldId: string, value: any) {
|
|
|
111
111
|
|
|
112
112
|
// Form validation
|
|
113
113
|
const validateForm = () => form.value?.reportValidity() ?? false
|
|
114
|
+
const checkValidity = () => form.value?.checkValidity() ?? false
|
|
114
115
|
const formError = ref<Error>()
|
|
115
116
|
// Form submission
|
|
116
117
|
async function handleSubmit() {
|
|
@@ -156,7 +157,7 @@ function handleSlotInputChange(event: Event) {
|
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
|
|
159
|
-
defineExpose({ form, isDirty, validateForm, resolveSchema, refreshSchema })
|
|
160
|
+
defineExpose({ form, isDirty, validateForm, resolveSchema, refreshSchema, checkValidity })
|
|
160
161
|
</script>
|
|
161
162
|
|
|
162
163
|
<template>
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import type { BglFormSchemaFnT } from '@bagelink/vue'
|
|
3
3
|
|
|
4
4
|
import type { ComponentExposed, ComponentProps } from 'vue-component-type-helpers'
|
|
5
|
-
import { BagelForm, Btn, useBglSchema } from '@bagelink/vue'
|
|
6
|
-
import { ref, watch, computed } from 'vue'
|
|
5
|
+
import { BagelForm, Btn, useBglSchema, sleep } from '@bagelink/vue'
|
|
6
|
+
import { ref, watch, computed, nextTick } from 'vue'
|
|
7
7
|
|
|
8
8
|
const props = withDefaults(
|
|
9
9
|
defineProps<{
|
|
@@ -13,7 +13,7 @@ const props = withDefaults(
|
|
|
13
13
|
'schema' | `${string}modelValue` | `ref${string}` | `onVnode${string}` | 'onSubmit'
|
|
14
14
|
)
|
|
15
15
|
>
|
|
16
|
-
schema
|
|
16
|
+
schema?: BglFormSchemaFnT<T>
|
|
17
17
|
showProgress?: boolean
|
|
18
18
|
rtl?: boolean
|
|
19
19
|
stepLabels?: string[]
|
|
@@ -119,9 +119,6 @@ const currentStepSchema = computed(() => {
|
|
|
119
119
|
return [computedSchema.value[actualIndex]]
|
|
120
120
|
})
|
|
121
121
|
|
|
122
|
-
const isStepping = ref(false)
|
|
123
|
-
let isSteppingTO: NodeJS.Timeout
|
|
124
|
-
|
|
125
122
|
// Tracks which way we're sliding (left or right)
|
|
126
123
|
const slideDirection = ref(props.rtl ? 'right' : 'left')
|
|
127
124
|
|
|
@@ -138,9 +135,7 @@ watch(
|
|
|
138
135
|
}
|
|
139
136
|
|
|
140
137
|
previousStep.value = oldStep
|
|
141
|
-
|
|
142
|
-
isStepping.value = true
|
|
143
|
-
isSteppingTO = setTimeout(() => (isStepping.value = false), 200)
|
|
138
|
+
// We don't need isStepping flag anymore
|
|
144
139
|
emits('stepChange', {
|
|
145
140
|
newStep,
|
|
146
141
|
oldStep,
|
|
@@ -150,19 +145,32 @@ watch(
|
|
|
150
145
|
}
|
|
151
146
|
)
|
|
152
147
|
|
|
153
|
-
const
|
|
148
|
+
const isLastStep = computed(() => currentStep.value === numberOfSteps.value - 1)
|
|
154
149
|
|
|
155
150
|
const isStepValidated = computed(() => (stepIndex: number) => validatedSteps.value.includes(stepIndex))
|
|
156
151
|
|
|
152
|
+
// Add a computed property to check if current step is valid
|
|
153
|
+
const isStepValid = ref(false)
|
|
154
|
+
|
|
155
|
+
async function checkCurrentStepValidity() {
|
|
156
|
+
await nextTick()
|
|
157
|
+
if (!props.validateOnSteps) isStepValid.value = true
|
|
158
|
+
else isStepValid.value = formRef.value?.checkValidity() ?? false
|
|
159
|
+
}
|
|
160
|
+
|
|
157
161
|
function prevStep() {
|
|
158
162
|
if (currentStep.value > 0) currentStep.value--
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
const formContainer = ref<HTMLElement>()
|
|
162
166
|
|
|
163
|
-
function nextStep() {
|
|
167
|
+
async function nextStep() {
|
|
168
|
+
// Always use reportValidity when attempting to move to next step
|
|
169
|
+
// This will show validation errors to the user
|
|
164
170
|
if (props.validateOnSteps && reportValidity() === false) return
|
|
165
|
-
if (
|
|
171
|
+
if (!isLastStep.value) currentStep.value++
|
|
172
|
+
await sleep(400)
|
|
173
|
+
checkCurrentStepValidity()
|
|
166
174
|
}
|
|
167
175
|
|
|
168
176
|
function goToStep(stepIndex: number) {
|
|
@@ -173,6 +181,7 @@ function goToStep(stepIndex: number) {
|
|
|
173
181
|
}
|
|
174
182
|
|
|
175
183
|
// For forward navigation to non-validated steps, validate current step first if needed
|
|
184
|
+
// This will show validation errors to the user
|
|
176
185
|
if (props.validateOnSteps && reportValidity() === false) {
|
|
177
186
|
return false
|
|
178
187
|
}
|
|
@@ -187,6 +196,7 @@ function goToStep(stepIndex: number) {
|
|
|
187
196
|
}
|
|
188
197
|
|
|
189
198
|
function handleSubmit() {
|
|
199
|
+
// Show validation errors to the user when submitting
|
|
190
200
|
if (reportValidity() === false) return
|
|
191
201
|
emits('submit', formData.value)
|
|
192
202
|
}
|
|
@@ -194,15 +204,11 @@ function handleSubmit() {
|
|
|
194
204
|
function reset() {
|
|
195
205
|
validatedSteps.value = []
|
|
196
206
|
currentStep.value = 0
|
|
197
|
-
// Clear form if BagelForm supports it
|
|
198
|
-
// if (formRef.value && typeof formRef.value.clearForm === 'function') {
|
|
199
|
-
// formRef.value.clearForm()
|
|
200
|
-
// }
|
|
201
207
|
}
|
|
202
208
|
|
|
203
209
|
// Re-evaluate filtered steps when formData changes
|
|
204
210
|
watch(() => formData.value, () => {
|
|
205
|
-
|
|
211
|
+
checkCurrentStepValidity()
|
|
206
212
|
if (currentStep.value >= numberOfSteps.value && numberOfSteps.value > 0) {
|
|
207
213
|
currentStep.value = 0
|
|
208
214
|
}
|
|
@@ -211,11 +217,13 @@ watch(() => formData.value, () => {
|
|
|
211
217
|
defineExpose({
|
|
212
218
|
submit: handleSubmit,
|
|
213
219
|
validateForm: reportValidity,
|
|
220
|
+
checkValidity: formRef.value?.checkValidity,
|
|
214
221
|
isDirty: computed(() => formRef.value?.isDirty),
|
|
215
222
|
reset,
|
|
216
223
|
goToStep,
|
|
217
224
|
currentStep: computed(() => currentStep.value),
|
|
218
225
|
totalSteps: computed(() => numberOfSteps.value),
|
|
226
|
+
isStepValid,
|
|
219
227
|
nextStep,
|
|
220
228
|
prevStep,
|
|
221
229
|
})
|
|
@@ -260,7 +268,7 @@ defineExpose({
|
|
|
260
268
|
:name="slideDirection === 'right' ? 'slide-right' : 'slide-left'"
|
|
261
269
|
mode="out-in"
|
|
262
270
|
>
|
|
263
|
-
<div
|
|
271
|
+
<div :key="currentStep" ref="formContainer" class="bgl-form-container">
|
|
264
272
|
<BagelForm
|
|
265
273
|
ref="formRef"
|
|
266
274
|
v-model="formData"
|
|
@@ -286,11 +294,17 @@ defineExpose({
|
|
|
286
294
|
submit: handleSubmit,
|
|
287
295
|
currentStep,
|
|
288
296
|
totalSteps: numberOfSteps,
|
|
289
|
-
|
|
297
|
+
isLastStep,
|
|
298
|
+
isStepValid,
|
|
290
299
|
}"
|
|
291
300
|
>
|
|
292
|
-
<Btn v-if="currentStep !== 0" color="gray" icon="arrow_back" click="prevStep" />
|
|
293
|
-
<Btn
|
|
301
|
+
<Btn v-if="currentStep !== 0" color="gray" icon="arrow_back" @click="prevStep" />
|
|
302
|
+
<Btn
|
|
303
|
+
v-if="!isLastStep"
|
|
304
|
+
icon="arrow_forward"
|
|
305
|
+
:disabled="props.validateOnSteps && !isStepValid"
|
|
306
|
+
@click="nextStep"
|
|
307
|
+
/>
|
|
294
308
|
<Btn v-else value="Submit" @click="handleSubmit" />
|
|
295
309
|
</slot>
|
|
296
310
|
</div>
|
|
@@ -305,12 +319,10 @@ defineExpose({
|
|
|
305
319
|
gap: 1rem;
|
|
306
320
|
width: 100%;
|
|
307
321
|
/* Default transition duration */
|
|
308
|
-
--transition-duration:
|
|
322
|
+
--transition-duration: 300ms;
|
|
309
323
|
--move-distance: 35%;
|
|
310
|
-
--ease-in:
|
|
311
|
-
--ease-out:
|
|
312
|
-
/* --ease-in: cubic-bezier(0.42, 0, 0.58, 1); */
|
|
313
|
-
/* --ease-out: cubic-bezier(0.5, 0, 0.75, 0); */
|
|
324
|
+
--ease-in: cubic-bezier(0.42, 0, 0.58, 1);
|
|
325
|
+
--ease-out: cubic-bezier(0.42, 0, 0.58, 1);
|
|
314
326
|
}
|
|
315
327
|
|
|
316
328
|
.bgl-steps-indicator {
|
|
@@ -398,16 +410,18 @@ defineExpose({
|
|
|
398
410
|
justify-content: center;
|
|
399
411
|
gap: 1rem;
|
|
400
412
|
grid-area: unset !important;
|
|
401
|
-
|
|
413
|
+
margin-top: 2rem;
|
|
402
414
|
}
|
|
403
415
|
|
|
404
416
|
/* Slide Left Animation (going forward) */
|
|
405
417
|
.slide-left-enter-active {
|
|
406
|
-
transition: opacity
|
|
418
|
+
transition: opacity var(--transition-duration) var(--ease-in),
|
|
419
|
+
transform var(--transition-duration) var(--ease-in);
|
|
407
420
|
}
|
|
408
421
|
|
|
409
422
|
.slide-left-leave-active {
|
|
410
|
-
transition: opacity
|
|
423
|
+
transition: opacity var(--transition-duration) var(--ease-out),
|
|
424
|
+
transform var(--transition-duration) var(--ease-out);
|
|
411
425
|
}
|
|
412
426
|
|
|
413
427
|
.slide-left-enter-from {
|
|
@@ -422,12 +436,13 @@ defineExpose({
|
|
|
422
436
|
|
|
423
437
|
/* Slide Right Animation (going back) */
|
|
424
438
|
.slide-right-enter-active {
|
|
425
|
-
transition:
|
|
439
|
+
transition: opacity var(--transition-duration) var(--ease-in),
|
|
440
|
+
transform var(--transition-duration) var(--ease-in);
|
|
426
441
|
}
|
|
427
442
|
|
|
428
443
|
.slide-right-leave-active {
|
|
429
|
-
transition:
|
|
430
|
-
|
|
444
|
+
transition: opacity var(--transition-duration) var(--ease-out),
|
|
445
|
+
transform var(--transition-duration) var(--ease-out);
|
|
431
446
|
}
|
|
432
447
|
|
|
433
448
|
.slide-right-enter-from {
|