@bagelink/vue 1.2.13 → 1.2.18

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 (131) hide show
  1. package/dist/components/calendar/CalendarTypes.d.ts +13 -0
  2. package/dist/components/calendar/CalendarTypes.d.ts.map +1 -0
  3. package/dist/components/calendar/Index.vue.d.ts +39 -507
  4. package/dist/components/calendar/Index.vue.d.ts.map +1 -1
  5. package/dist/components/calendar/utils.d.ts +31 -0
  6. package/dist/components/calendar/utils.d.ts.map +1 -0
  7. package/dist/components/calendar/views/AgendaView.vue.d.ts +16 -0
  8. package/dist/components/calendar/views/AgendaView.vue.d.ts.map +1 -0
  9. package/dist/components/calendar/views/DayView.vue.d.ts +50 -0
  10. package/dist/components/calendar/views/DayView.vue.d.ts.map +1 -0
  11. package/dist/components/calendar/views/MonthView.vue.d.ts +20 -0
  12. package/dist/components/calendar/views/MonthView.vue.d.ts.map +1 -0
  13. package/dist/components/calendar/views/WeekView.vue.d.ts +33 -0
  14. package/dist/components/calendar/views/WeekView.vue.d.ts.map +1 -0
  15. package/dist/components/form/BglMultiStepForm.vue.d.ts +63 -0
  16. package/dist/components/form/BglMultiStepForm.vue.d.ts.map +1 -0
  17. package/dist/components/form/FieldArray.vue.d.ts.map +1 -1
  18. package/dist/components/form/index.d.ts +1 -0
  19. package/dist/components/form/index.d.ts.map +1 -1
  20. package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts.map +1 -1
  21. package/dist/components/form/inputs/DateInput.vue.d.ts +3 -3
  22. package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
  23. package/dist/components/form/inputs/DatePicker.vue.d.ts +3 -3
  24. package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
  25. package/dist/components/form/inputs/RichText/components/EditorToolbar.vue.d.ts.map +1 -1
  26. package/dist/components/form/inputs/RichText/components/gridBox.vue.d.ts +6 -3
  27. package/dist/components/form/inputs/RichText/components/gridBox.vue.d.ts.map +1 -1
  28. package/dist/components/form/inputs/RichText/composables/useCommands.d.ts.map +1 -1
  29. package/dist/components/form/inputs/RichText/config.d.ts.map +1 -1
  30. package/dist/components/form/inputs/RichText/utils/commands.d.ts.map +1 -1
  31. package/dist/components/form/inputs/RichText/utils/formatting.d.ts.map +1 -1
  32. package/dist/components/form/inputs/RichText/utils/table.d.ts.map +1 -1
  33. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  34. package/dist/index.cjs +2364 -3769
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.mjs +2365 -3770
  38. package/dist/style.css +607 -631
  39. package/dist/utils/BagelFormUtils.d.ts +4 -2
  40. package/dist/utils/BagelFormUtils.d.ts.map +1 -1
  41. package/dist/utils/calendar/EDate.d.ts +2 -0
  42. package/dist/utils/calendar/EDate.d.ts.map +1 -0
  43. package/dist/utils/calendar/Helpers.d.ts +19 -0
  44. package/dist/utils/calendar/Helpers.d.ts.map +1 -0
  45. package/dist/utils/calendar/constants.d.ts +3 -0
  46. package/dist/utils/calendar/constants.d.ts.map +1 -0
  47. package/dist/utils/calendar/dateUtils.d.ts +30 -0
  48. package/dist/utils/calendar/dateUtils.d.ts.map +1 -0
  49. package/dist/utils/calendar/event.interface.d.ts +32 -0
  50. package/dist/utils/calendar/event.interface.d.ts.map +1 -0
  51. package/dist/utils/calendar/time.d.ts +117 -0
  52. package/dist/utils/calendar/time.d.ts.map +1 -0
  53. package/dist/utils/calendar/types.d.ts +27 -0
  54. package/dist/utils/calendar/types.d.ts.map +1 -0
  55. package/dist/utils/calendar/typings.d.ts +87 -0
  56. package/dist/utils/calendar/typings.d.ts.map +1 -0
  57. package/dist/utils/calendar/week.d.ts +117 -0
  58. package/dist/utils/calendar/week.d.ts.map +1 -0
  59. package/package.json +1 -1
  60. package/src/components/calendar/CalendarTypes.ts +13 -0
  61. package/src/components/calendar/Index.vue +124 -389
  62. package/src/components/calendar/utils.ts +70 -0
  63. package/src/components/calendar/views/AgendaView.vue +263 -0
  64. package/src/components/calendar/views/DayView.vue +417 -0
  65. package/src/components/calendar/views/MonthView.vue +313 -0
  66. package/src/components/calendar/views/WeekView.vue +432 -0
  67. package/src/components/form/BglMultiStepForm.vue +323 -70
  68. package/src/components/form/FieldArray.vue +1 -1
  69. package/src/components/form/index.ts +1 -0
  70. package/src/components/form/inputs/CodeEditor/Index.vue +11 -0
  71. package/src/components/form/inputs/DateInput.vue +3 -3
  72. package/src/components/form/inputs/DatePicker.vue +3 -3
  73. package/src/components/form/inputs/RichText/components/EditorToolbar.vue +3 -4
  74. package/src/components/form/inputs/RichText/components/gridBox.vue +4 -1
  75. package/src/components/form/inputs/RichText/composables/useCommands.ts +22 -3
  76. package/src/components/form/inputs/RichText/config.ts +9 -7
  77. package/src/components/form/inputs/RichText/utils/commands.ts +307 -23
  78. package/src/components/form/inputs/RichText/utils/formatting.ts +117 -17
  79. package/src/components/form/inputs/RichText/utils/table.ts +36 -1
  80. package/src/components/form/inputs/SelectInput.vue +2 -0
  81. package/src/components/form/inputs/Upload/upload.types.d.ts +0 -1
  82. package/src/index.ts +2 -2
  83. package/src/styles/inputs.css +138 -137
  84. package/src/styles/layout.css +3 -2
  85. package/src/styles/mobilLayout.css +4 -2
  86. package/src/utils/BagelFormUtils.ts +6 -2
  87. package/src/utils/calendar/EDate.ts +0 -0
  88. package/src/{components/calendar/helpers → utils/calendar}/Helpers.ts +6 -6
  89. package/src/utils/calendar/constants.ts +2 -0
  90. package/src/utils/{timeAgo.ts → calendar/dateUtils.ts} +38 -1
  91. package/src/utils/calendar/event.interface.ts +33 -0
  92. package/src/{components/calendar/helpers/Time.ts → utils/calendar/time.ts} +15 -15
  93. package/src/utils/calendar/types.ts +27 -0
  94. package/src/{components/calendar/typings/config.interface.ts → utils/calendar/typings.ts} +13 -6
  95. package/src/utils/calendar/week.ts +588 -0
  96. package/src/components/calendar/assets/base.css +0 -60
  97. package/src/components/calendar/components/header/Header.vue +0 -153
  98. package/src/components/calendar/components/month/AgendaEventTile.vue +0 -135
  99. package/src/components/calendar/components/month/AgendaEvents.vue +0 -72
  100. package/src/components/calendar/components/month/Day.vue +0 -256
  101. package/src/components/calendar/components/month/Event.vue +0 -164
  102. package/src/components/calendar/components/month/Month.vue +0 -241
  103. package/src/components/calendar/components/month/WeekDay.vue +0 -15
  104. package/src/components/calendar/components/partials/EventFlyout.vue +0 -430
  105. package/src/components/calendar/components/week/Day.vue +0 -198
  106. package/src/components/calendar/components/week/DayEvent.vue +0 -584
  107. package/src/components/calendar/components/week/DayTimeline.vue +0 -80
  108. package/src/components/calendar/components/week/FullDayEvent.vue +0 -121
  109. package/src/components/calendar/components/week/Week.vue +0 -414
  110. package/src/components/calendar/components/week/WeekTimeline.vue +0 -101
  111. package/src/components/calendar/constants.ts +0 -13
  112. package/src/components/calendar/helpers/DayIntervals.ts +0 -48
  113. package/src/components/calendar/helpers/EDate.ts +0 -18
  114. package/src/components/calendar/helpers/Errors.ts +0 -69
  115. package/src/components/calendar/helpers/EventChange.ts +0 -88
  116. package/src/components/calendar/helpers/EventConcurrency.ts +0 -69
  117. package/src/components/calendar/helpers/EventFlyoutPosition.ts +0 -96
  118. package/src/components/calendar/helpers/EventPosition.ts +0 -154
  119. package/src/components/calendar/helpers/EventsFilter.ts +0 -50
  120. package/src/components/calendar/helpers/Week.ts +0 -37
  121. package/src/components/calendar/language/index.ts +0 -41
  122. package/src/components/calendar/language/keys.ts +0 -99
  123. package/src/components/calendar/models/Event.ts +0 -112
  124. package/src/components/calendar/styles/_mixins.css +0 -21
  125. package/src/components/calendar/styles/_variables.css +0 -47
  126. package/src/components/calendar/typings/interfaces/day.interface.ts +0 -10
  127. package/src/components/calendar/typings/interfaces/event.interface.ts +0 -32
  128. package/src/components/calendar/typings/interfaces/full-day-events-week.type.ts +0 -8
  129. package/src/components/calendar/typings/interfaces/period.interface.ts +0 -5
  130. package/src/components/calendar/typings/interfaces/time-modes.ts +0 -11
  131. package/src/components/calendar/typings/types.ts +0 -27
@@ -3,7 +3,7 @@ import type { BglFormSchemaFnT } from '@bagelink/vue'
3
3
 
4
4
  import type { ComponentExposed, ComponentProps } from 'vue-component-type-helpers'
5
5
  import { BagelForm, Btn, useBglSchema } from '@bagelink/vue'
6
- import { watch } from 'vue'
6
+ import { ref, watch, computed } from 'vue'
7
7
 
8
8
  const props = withDefaults(
9
9
  defineProps<{
@@ -14,56 +14,123 @@ const props = withDefaults(
14
14
  )
15
15
  >
16
16
  schema: BglFormSchemaFnT<T>
17
+ showProgress?: boolean
18
+ rtl?: boolean
19
+ stepLabels?: string[]
20
+ allowStepNavigation?: boolean
21
+ validateOnSteps?: boolean
22
+ /** Animation direction - auto detects based on step change or can be forced */
23
+ direction?: 'auto' | 'left' | 'right'
17
24
  }>(),
18
25
  {
19
- bagelFormProps: () => ({})
26
+ bagelFormProps: () => ({}),
27
+ showProgress: false,
28
+ rtl: false,
29
+ allowStepNavigation: false,
30
+ validateOnSteps: true,
31
+ direction: 'auto'
20
32
  }
21
33
  )
22
34
 
23
- const emits = defineEmits(['submit'])
35
+ const emits = defineEmits(['submit', 'stepChange'])
24
36
 
25
37
  type BagelFormT = ComponentExposed<typeof BagelForm<T, P>>
26
38
 
27
- const formRef = $ref<BagelFormT>()
39
+ const formRef = ref<BagelFormT>()
28
40
 
29
- const formData = defineModel<T>(
30
- 'modelValue',
31
- { default: () => {}, required: true }
32
- )
41
+ const formData = defineModel<T>('modelValue', {
42
+ default: () => ({}),
43
+ required: true
44
+ })
45
+
46
+ const currentStep = ref(0)
47
+ const previousStep = ref(0)
48
+ const validatedSteps = ref<number[]>([])
33
49
 
34
50
  function reportValidity() {
35
- if (!formRef) return false
36
- return formRef.validateForm()
51
+ if (!formRef.value) return false
52
+ const isValid = formRef.value.validateForm()
53
+
54
+ if (isValid && !validatedSteps.value.includes(currentStep.value)) {
55
+ validatedSteps.value.push(currentStep.value)
56
+ }
57
+
58
+ return isValid
37
59
  }
38
60
 
39
- const computedSchema = $computed(
61
+ const computedSchema = computed(
40
62
  () => useBglSchema({ schema: props.schema })
41
63
  )
42
64
 
43
- const numberOfSteps = $ref(computedSchema.length)
44
-
45
- let currentStep = $ref(0)
65
+ const numberOfSteps = computed(() => computedSchema.value.length)
46
66
 
47
- const currentStepSchema = $computed(() => [computedSchema[currentStep]])
67
+ const currentStepSchema = computed(() => [computedSchema.value[currentStep.value]])
48
68
 
49
- let isStepping = $ref(false)
69
+ const isStepping = ref(false)
50
70
  let isSteppingTO: NodeJS.Timeout
71
+
72
+ // Tracks which way we're sliding (left or right)
73
+ const slideDirection = ref(props.rtl ? 'right' : 'left')
74
+
51
75
  watch(
52
- () => currentStep,
53
- () => {
76
+ () => currentStep.value,
77
+ (newStep, oldStep) => {
78
+ // Set direction based on step change
79
+ if (props.direction === 'auto') {
80
+ slideDirection.value = props.rtl
81
+ ? (newStep > oldStep ? 'right' : 'left')
82
+ : (newStep > oldStep ? 'left' : 'right')
83
+ } else {
84
+ slideDirection.value = props.direction
85
+ }
86
+
87
+ previousStep.value = oldStep
54
88
  clearTimeout(isSteppingTO)
55
- isStepping = true
56
- isSteppingTO = setTimeout(() => (isStepping = false), 600)
89
+ isStepping.value = true
90
+ isSteppingTO = setTimeout(() => (isStepping.value = false), 200)
91
+ emits('stepChange', {
92
+ newStep,
93
+ oldStep,
94
+ totalSteps: numberOfSteps.value,
95
+ direction: slideDirection.value
96
+ })
57
97
  }
58
98
  )
59
99
 
60
- const canDoNext = $computed(() => currentStep < numberOfSteps - 1)
100
+ const canDoNext = computed(() => currentStep.value < numberOfSteps.value - 1)
101
+
102
+ const isStepValidated = computed(() => (stepIndex: number) => validatedSteps.value.includes(stepIndex))
61
103
 
62
- function prevStep() { if (currentStep > 0) currentStep-- }
104
+ function prevStep() {
105
+ if (currentStep.value > 0) currentStep.value--
106
+ }
107
+
108
+ const formContainer = ref<HTMLElement>()
63
109
 
64
110
  function nextStep() {
65
- if (reportValidity() === false) return
66
- if (canDoNext) currentStep++
111
+ if (props.validateOnSteps && reportValidity() === false) return
112
+ if (canDoNext.value) currentStep.value++
113
+ }
114
+
115
+ function goToStep(stepIndex: number) {
116
+ // Can always go back, or to already validated steps
117
+ if (stepIndex < currentStep.value || validatedSteps.value.includes(stepIndex)) {
118
+ currentStep.value = stepIndex
119
+ return true
120
+ }
121
+
122
+ // For forward navigation to non-validated steps, validate current step first if needed
123
+ if (props.validateOnSteps && reportValidity() === false) {
124
+ return false
125
+ }
126
+
127
+ // Can only move one step forward at a time (prevent skipping)
128
+ if (stepIndex === currentStep.value + 1) {
129
+ currentStep.value = stepIndex
130
+ return true
131
+ }
132
+
133
+ return false
67
134
  }
68
135
 
69
136
  function handleSubmit() {
@@ -71,56 +138,242 @@ function handleSubmit() {
71
138
  emits('submit', formData.value)
72
139
  }
73
140
 
141
+ function reset() {
142
+ validatedSteps.value = []
143
+ currentStep.value = 0
144
+ // Clear form if BagelForm supports it
145
+ // if (formRef.value && typeof formRef.value.clearForm === 'function') {
146
+ // formRef.value.clearForm()
147
+ // }
148
+ }
149
+
74
150
  defineExpose({
75
151
  submit: handleSubmit,
76
- validateForm: formRef?.validateForm,
77
- // deleteItem: formRef?.deleteItem, // ! TODO: if (does not exist) remove!()
78
- isDirty: formRef?.isDirty,
79
- // clearForm: formRef?.clearForm, // ! TODO: if (does not exist) remove!()
152
+ validateForm: reportValidity,
153
+ isDirty: computed(() => formRef.value?.isDirty),
154
+ reset,
155
+ goToStep,
156
+ currentStep: computed(() => currentStep.value),
157
+ totalSteps: computed(() => numberOfSteps.value),
158
+ nextStep,
159
+ prevStep,
80
160
  })
81
161
  </script>
82
162
 
83
163
  <template>
84
- <transition
85
- :duration="600"
86
- name="fade"
87
- mode="out-in"
88
- >
89
- <template v-if="!isStepping">
90
- <div>
91
- <BagelForm
92
- ref="formRef"
93
- v-model=" formData"
94
- :schema="currentStepSchema"
95
- v-bind="bagelFormProps"
96
- >
97
- <template #success>
98
- <slot name="success" />
99
- </template>
100
- <template #error>
101
- <slot name="error" />
102
- </template>
103
- </BagelForm>
104
- </div>
105
- </template>
106
- </transition>
107
-
108
- <slot name="steppers" v-bind="{ prevStep, nextStep, submit: handleSubmit }">
109
- <Btn
110
- :disabled="currentStep === 0"
111
- value="Back"
112
- @click="prevStep"
113
- />
114
-
115
- <Btn
116
- v-if="canDoNext"
117
- value="Next"
118
- @click="nextStep"
119
- />
120
- <Btn
121
- v-else
122
- value="Submit"
123
- @click="handleSubmit"
124
- />
125
- </slot>
164
+ <div class="bgl-multi-step-form">
165
+ <!-- Progress indicator -->
166
+ <div v-if="showProgress" class="bgl-step-progress">
167
+ <slot
168
+ name="progress" v-bind="{
169
+ currentStep,
170
+ totalSteps: numberOfSteps,
171
+ goToStep,
172
+ stepLabels: props.stepLabels,
173
+ allowStepNavigation: props.allowStepNavigation,
174
+ isStepValidated,
175
+ }"
176
+ >
177
+ <div class="bgl-steps-indicator">
178
+ <div
179
+ v-for="(_, index) in numberOfSteps"
180
+ :key="index"
181
+ class="bgl-step-indicator" :class="[
182
+ { active: index === currentStep },
183
+ { completed: index < currentStep || isStepValidated(index) },
184
+ { clickable: props.allowStepNavigation },
185
+ ]"
186
+ @click="props.allowStepNavigation && goToStep(index)"
187
+ >
188
+ <span>{{ index + 1 }}</span>
189
+ <span v-if="props.stepLabels && props.stepLabels[index]" class="bgl-step-label">
190
+ {{ props.stepLabels[index] }}
191
+ </span>
192
+ </div>
193
+ </div>
194
+ </slot>
195
+ </div>
196
+
197
+ <div class="bgl-form-wrapper">
198
+ <transition
199
+ :name="slideDirection === 'right' ? 'slide-right' : 'slide-left'"
200
+ mode="out-in"
201
+ >
202
+ <div v-if="!isStepping" :key="currentStep" ref="formContainer" class="bgl-form-container">
203
+ <BagelForm
204
+ ref="formRef"
205
+ v-model="formData"
206
+ :schema="currentStepSchema"
207
+ v-bind="bagelFormProps"
208
+ >
209
+ <template v-if="$slots.success" #success>
210
+ <slot name="success" />
211
+ </template>
212
+ <template v-if="$slots.error" #error>
213
+ <slot name="error" />
214
+ </template>
215
+ </BagelForm>
216
+
217
+ <!-- Navigation buttons inside the form container to animate together -->
218
+ <div class="bgl-step-controls">
219
+ <slot
220
+ name="steppers" v-bind="{
221
+ prevStep,
222
+ nextStep,
223
+ submit: handleSubmit,
224
+ currentStep,
225
+ totalSteps: numberOfSteps,
226
+ canDoNext,
227
+ }"
228
+ >
229
+ <Btn :disabled="currentStep === 0" flat value="Back" class="px-3" @click="prevStep" />
230
+ <Btn v-if="canDoNext" value="Next" class="px-3" @click="nextStep" />
231
+ <Btn v-else value="Submit" @click="handleSubmit" />
232
+ </slot>
233
+ </div>
234
+ </div>
235
+ </transition>
236
+ </div>
237
+ </div>
126
238
  </template>
239
+
240
+ <style scoped>
241
+ .bgl-multi-step-form {
242
+ display: flex;
243
+ flex-direction: column;
244
+ gap: 1rem;
245
+ /* Default transition duration */
246
+ --transition-duration: 200ms;
247
+ --move-distance: 35%;
248
+ --ease-in: ease-in-out;
249
+ --ease-out: ease-in-out;
250
+ /* --ease-in: cubic-bezier(0.42, 0, 0.58, 1); */
251
+ /* --ease-out: cubic-bezier(0.5, 0, 0.75, 0); */
252
+ }
253
+
254
+ .bgl-steps-indicator {
255
+ display: flex;
256
+ justify-content: space-between;
257
+ align-items: center;
258
+ margin-bottom: 1rem;
259
+ }
260
+
261
+ .bgl-step-indicator {
262
+ display: flex;
263
+ flex-direction: column;
264
+ align-items: center;
265
+ position: relative;
266
+ }
267
+
268
+ .bgl-step-indicator::before {
269
+ content: '';
270
+ position: absolute;
271
+ top: 50%;
272
+ right: 50%;
273
+ height: 2px;
274
+ width: 100%;
275
+ background: #e0e0e0;
276
+ z-index: -1;
277
+ }
278
+
279
+ .bgl-step-indicator:first-child::before {
280
+ display: none;
281
+ }
282
+
283
+ .bgl-step-indicator > span:first-child {
284
+ width: 30px;
285
+ height: 30px;
286
+ border-radius: 50%;
287
+ background: #e0e0e0;
288
+ color: #555;
289
+ display: flex;
290
+ align-items: center;
291
+ justify-content: center;
292
+ margin-bottom: 0.5rem;
293
+ }
294
+
295
+ .bgl-step-indicator.active > span:first-child {
296
+ background: var(--primary-color, #4CAF50);
297
+ color: white;
298
+ }
299
+
300
+ .bgl-step-indicator.completed > span:first-child {
301
+ background: var(--success-color, #8BC34A);
302
+ color: white;
303
+ }
304
+
305
+ .bgl-step-indicator.clickable {
306
+ cursor: pointer;
307
+ }
308
+
309
+ .bgl-step-label {
310
+ font-size: 0.8rem;
311
+ max-width: 100px;
312
+ text-align: center;
313
+ }
314
+
315
+ .bgl-form-wrapper {
316
+ display: grid;
317
+ overflow: clip;
318
+ height: auto;
319
+ min-height: 300px;
320
+ transition: height var(--transition-duration) ease;
321
+ interpolate-size: allow-keywords;
322
+ }
323
+
324
+ .bgl-form-wrapper > div {
325
+ grid-area: 1 / 1;
326
+ }
327
+
328
+ .bgl-form-container {
329
+ width: 100%;
330
+ display: flex;
331
+ flex-direction: column;
332
+ }
333
+
334
+ .bgl-step-controls {
335
+ display: flex;
336
+ justify-content: center;
337
+ gap: 1rem;
338
+ margin-top: 1.5rem;
339
+ }
340
+
341
+ /* Slide Left Animation (going forward) */
342
+ .slide-left-enter-active {
343
+ transition: opacity, transform calc(var(--transition-duration) * 1.2) var(--ease-in);
344
+ }
345
+
346
+ .slide-left-leave-active {
347
+ transition: opacity, transform var(--transition-duration) var(--ease-out);
348
+ }
349
+
350
+ .slide-left-enter-from {
351
+ opacity: 0;
352
+ transform: translateX(var(--move-distance));
353
+ }
354
+
355
+ .slide-left-leave-to {
356
+ opacity: 0;
357
+ transform: translateX(-30%);
358
+ }
359
+
360
+ /* Slide Right Animation (going back) */
361
+ .slide-right-enter-active {
362
+ transition: all calc(var(--transition-duration) * 1.2) var(--ease-in);
363
+ }
364
+
365
+ .slide-right-leave-active {
366
+ transition: all var(--transition-duration) var(--ease-out);
367
+ transition-property: opacity, transform;
368
+ }
369
+
370
+ .slide-right-enter-from {
371
+ opacity: 0;
372
+ transform: translateX(-30%);
373
+ }
374
+
375
+ .slide-right-leave-to {
376
+ opacity: 0;
377
+ transform: translateX(var(--move-distance));
378
+ }
379
+ </style>
@@ -7,7 +7,7 @@ import type {
7
7
  BglFormSchemaFnT,
8
8
  Field,
9
9
  } from '@bagelink/vue'
10
- import { BagelForm, Btn, Loading } from '@bagelink/vue'
10
+ import { BagelForm, Btn, Loading, Icon } from '@bagelink/vue'
11
11
  import { ref, onMounted, computed, watch } from 'vue'
12
12
 
13
13
  const props = withDefaults(
@@ -1,4 +1,5 @@
1
1
  export { default as BglForm } from './BagelForm.vue'
2
2
  export { default as BagelForm } from './BagelForm.vue'
3
+ export { default as BagelMultiStepForm } from './BglMultiStepForm.vue'
3
4
  export { default as FieldArray } from './FieldArray.vue'
4
5
  export * from './inputs'
@@ -151,6 +151,17 @@ pre code.hljs{
151
151
  background: #282c34;
152
152
  height: max-content;
153
153
  }
154
+ .code-editor-wrap:focus-within, .code-editor-wrap:focus-visible, .code-editor-wrap:focus {
155
+ box-shadow: inset 0 0 10px #00000021;
156
+ outline: solid 1px var(--border-color);
157
+ /* outline: -webkit-focus-ring-color auto 1px; */
158
+
159
+ }
160
+
161
+ .code-editor-wrap:focus-within:has(textarea:focus) + .label,
162
+ .label:has(+ .code-editor-wrap:focus-within) {
163
+ color: var(--bgl-primary) !important;
164
+ }
154
165
 
155
166
  .code-editor {
156
167
  color: transparent;
@@ -1,9 +1,9 @@
1
1
  <script setup lang="ts">
2
- import type { ModeType } from '../../calendar/typings/types'
2
+ import type { ModeType } from '../../../utils/calendar/typings'
3
3
  import { TextInput, Dropdown, formatDate } from '@bagelink/vue'
4
4
  import { onClickOutside } from '@vueuse/core'
5
5
  import { ref, onMounted } from 'vue'
6
- import { WEEK_START_DAY } from '../../calendar/helpers/Time'
6
+ import { WEEK_START_DAY } from '../../../utils/calendar/time'
7
7
  import DatePicker from './DatePicker.vue'
8
8
 
9
9
  const props = withDefaults(
@@ -30,7 +30,7 @@ const props = withDefaults(
30
30
  enableTime: false,
31
31
  editMode: true,
32
32
  small: false,
33
- mode: 'day',
33
+ mode: () => ({ mode: 'day' }),
34
34
  firstDayOfWeek: WEEK_START_DAY.SUNDAY,
35
35
  locale: ''
36
36
  },
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
- import type { DateViewMode, ModeType } from '../../calendar/typings/types'
2
+ import type { DateViewMode, ModeType } from '../../../utils/calendar/typings'
3
3
  import { Btn, NumberInput } from '@bagelink/vue'
4
4
  import { computed, ref } from 'vue'
5
- import Time, { WEEK_START_DAY } from '../../calendar/helpers/Time'
5
+ import Time, { WEEK_START_DAY } from '../../../utils/calendar/time'
6
6
 
7
7
  const props = withDefaults(
8
8
  defineProps<{
@@ -15,7 +15,7 @@ const props = withDefaults(
15
15
  enableTime?: boolean
16
16
  }>(),
17
17
  {
18
- mode: 'day',
18
+ mode: () => ({ mode: 'day' }),
19
19
  firstDayOfWeek: WEEK_START_DAY.SUNDAY,
20
20
  locale: '',
21
21
  enableTime: false
@@ -23,10 +23,9 @@ function runAction(name: ToolbarConfigOption, value?: string) {
23
23
  <Dropdown v-if="action.name === 'insertTable'" placement="bottom-start" thin flat icon="table">
24
24
  <template #default="{ hide }">
25
25
  <GridBox
26
- :gridSize="5" @select="$event => {
27
- runAction('insertTable', $event);
28
- ($event.target as any)?.blur();
29
- hide()
26
+ :gridSize="5" @select="(value) => {
27
+ runAction('insertTable', value);
28
+ hide();
30
29
  }"
31
30
  />
32
31
  </template>
@@ -1,7 +1,10 @@
1
1
  <script setup lang="ts">
2
+ const props = defineProps<{
3
+ gridSize?: number
4
+ }>()
2
5
  const emit = defineEmits(['select'])
3
6
  const fb = 1
4
- const base = 5
7
+ const base = props.gridSize || 5
5
8
  const hoveredRow = $ref(fb)
6
9
  const hoveredCol = $ref(fb)
7
10
 
@@ -7,13 +7,19 @@ export function useCommands(state: EditorState, debug?: { logCommand: (command:
7
7
 
8
8
  return {
9
9
  execute: (command: string, value?: string) => {
10
- if (!state.doc) return
10
+ console.log(`[useCommands] Executing command: ${command}`, value ? `with value: ${value}` : '')
11
+
12
+ if (!state.doc) {
13
+ console.log('[useCommands] No document available, skipping command')
14
+ return
15
+ }
11
16
 
12
17
  // Log command if debug is enabled
13
18
  debug?.logCommand(command, value)
14
19
 
15
20
  // Handle view state commands directly
16
21
  if (['splitView', 'codeView', 'fullScreen'].includes(command)) {
22
+ console.log(`[useCommands] Handling view state command: ${command}`)
17
23
  switch (command) {
18
24
  case 'splitView':
19
25
  state.isSplitView = !state.isSplitView
@@ -28,14 +34,26 @@ export function useCommands(state: EditorState, debug?: { logCommand: (command:
28
34
  }
29
35
 
30
36
  // Focus the editor before executing command
31
- state.doc.body.focus()
37
+ try {
38
+ state.doc.body.focus()
39
+ console.log('[useCommands] Editor focused')
40
+ } catch (e) {
41
+ console.error('[useCommands] Error focusing editor:', e)
42
+ }
32
43
 
33
44
  // Execute the command
34
- executor.execute(command, value)
45
+ try {
46
+ console.log('[useCommands] Executing command via executor')
47
+ executor.execute(command, value)
48
+ console.log('[useCommands] Command execution completed')
49
+ } catch (e) {
50
+ console.error('[useCommands] Error during command execution:', e)
51
+ }
35
52
 
36
53
  // Update content state only if it has changed
37
54
  const newContent = state.doc.body.innerHTML
38
55
  if (newContent !== state.content) {
56
+ console.log('[useCommands] Content changed, updating state')
39
57
  state.content = newContent
40
58
  }
41
59
 
@@ -47,6 +65,7 @@ export function useCommands(state: EditorState, debug?: { logCommand: (command:
47
65
  || state.rangeCount !== selection.rangeCount
48
66
 
49
67
  if (hasSelectionChanged) {
68
+ console.log('[useCommands] Selection changed, updating state')
50
69
  state.selection = selection
51
70
  state.range = selection.getRangeAt(0).cloneRange()
52
71
  state.rangeCount = selection.rangeCount
@@ -102,13 +102,15 @@ export const toolbarOptions: ToolbarOption[] = [
102
102
  { name: 'fontColor', label: 'Font Color', icon: 'format_color_text' },
103
103
  { name: 'bgColor', label: 'Background Color', icon: 'format_color_fill' },
104
104
  { name: 'insertTable', label: 'Insert Table', icon: 'table' },
105
- { name: 'deleteTable', label: 'Delete Table', icon: 'table_rows' },
106
- { name: 'insertRowAbove', label: 'Insert Row Above', icon: 'table_rows' },
107
- { name: 'insertRowBelow', label: 'Insert Row Below', icon: 'table_rows' },
108
- { name: 'deleteRow', label: 'Delete Row', icon: 'table_rows' },
109
- { name: 'insertColumnLeft', label: 'Insert Column Left', icon: 'add_column_left' },
110
- { name: 'insertColumnRight', label: 'Insert Column Right', icon: 'add_column_right' },
111
- { name: 'deleteColumn', label: 'Delete Column', icon: 'view_column' },
105
+ { name: 'deleteTable', label: 'Delete Table', icon: 'delete_sweep' },
106
+ { name: 'mergeCells', label: 'Merge Cells', icon: 'table_chart' },
107
+ { name: 'splitCells', label: 'Split Cells', icon: 'dashboard' },
108
+ { name: 'addRowBefore', label: 'Insert Row Above', icon: 'add_box' },
109
+ { name: 'addRowAfter', label: 'Insert Row Below', icon: 'vertical_align_bottom' },
110
+ { name: 'deleteRow', label: 'Delete Row', icon: 'remove' },
111
+ { name: 'insertColumnLeft', label: 'Insert Column Left', icon: 'format_indent_decrease' },
112
+ { name: 'insertColumnRight', label: 'Insert Column Right', icon: 'format_indent_increase' },
113
+ { name: 'deleteColumn', label: 'Delete Column', icon: 'view_week' },
112
114
  { name: 'separator' },
113
115
  { name: 'undo', label: 'Undo', icon: 'undo' },
114
116
  { name: 'redo', label: 'Redo', icon: 'redo' },