lkt-step-process 2.0.2 → 2.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-step-process",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -0,0 +1,29 @@
1
+ <script setup lang="ts">
2
+
3
+ import { ButtonNavProps } from '../config/ButtonNavProps';
4
+
5
+ const props = withDefaults(defineProps<ButtonNavProps>(), {
6
+
7
+ });
8
+
9
+ const emit = defineEmits(['prev', 'next']);
10
+ </script>
11
+
12
+ <template>
13
+ <div class="lkt-step-process-buttons">
14
+ <lkt-button
15
+ ref="prevButtonRef"
16
+ v-if="prevButton"
17
+ v-show="!isLoading && !prevHidden"
18
+ v-bind="prevButton"
19
+ @click="emit('prev')"
20
+ />
21
+ <lkt-button
22
+ ref="nextButtonRef"
23
+ v-if="nextButton"
24
+ v-show="!isLoading && !nextHidden"
25
+ v-bind="nextButton"
26
+ @click="emit('next')"
27
+ />
28
+ </div>
29
+ </template>
@@ -3,10 +3,14 @@
3
3
  import {
4
4
  ButtonConfig,
5
5
  getDefaultValues,
6
+ ItemCrudButtonNavPosition,
7
+ ItemCrudButtonNavVisibility,
6
8
  StepProcess,
7
9
  StepProcessConfig,
8
10
  StepProcessStepConfig,
9
11
  } from 'lkt-vue-kernel';
12
+ import ButtonNav from '@/components/ButtonNav.vue';
13
+ import { ButtonNavProps } from '@/config/ButtonNavProps';
10
14
 
11
15
  const props = withDefaults(defineProps<StepProcessConfig>(), getDefaultValues(StepProcess));
12
16
 
@@ -106,6 +110,23 @@
106
110
  const r = [];
107
111
  if (currentStep.value) r.push(`step-${currentStep.value}`);
108
112
  return r.join(' ');
113
+ }),
114
+ computedRenderTopButtonNav = computed(() => {
115
+ if (props.buttonNavVisibility === ItemCrudButtonNavVisibility.Never) return false;
116
+ return !props.buttonNavPosition || props.buttonNavPosition === ItemCrudButtonNavPosition.Top;
117
+ }),
118
+ computedRenderBottomButtonNav = computed(() => {
119
+ if (props.buttonNavVisibility === ItemCrudButtonNavVisibility.Never) return false;
120
+ return props.buttonNavPosition === ItemCrudButtonNavPosition.Bottom;
121
+ }),
122
+ computedButtonNavProps = computed(() => {
123
+ return <ButtonNavProps>{
124
+ isLoading: isLoading.value,
125
+ prevHidden: prevHidden.value,
126
+ nextHidden: nextHidden.value,
127
+ prevButton: computedPrevButton.value,
128
+ nextButton: computedNextButton.value,
129
+ };
109
130
  });
110
131
 
111
132
  const onNext = (data: any) => {
@@ -145,22 +166,12 @@
145
166
  <article class="lkt-step-process" :class="classes">
146
167
  <lkt-header v-if="header && Object.keys(header).length > 0" v-bind="header" />
147
168
 
148
- <div class="lkt-step-process-buttons">
149
- <lkt-button
150
- ref="prevButtonRef"
151
- v-if="computedPrevButton"
152
- v-show="!isLoading && !prevHidden"
153
- v-bind="computedPrevButton"
154
- v-on:click="onPrev"
155
- />
156
- <lkt-button
157
- ref="nextButtonRef"
158
- v-if="computedNextButton"
159
- v-show="!isLoading && !nextHidden"
160
- v-bind="computedNextButton"
161
- v-on:click="onNext"
162
- />
163
- </div>
169
+ <button-nav
170
+ v-if="computedRenderTopButtonNav"
171
+ v-bind="computedButtonNavProps"
172
+ @prev="onPrev"
173
+ @next="onNext"
174
+ />
164
175
 
165
176
  <div class="lkt-step-process_content" v-if="!isLoading">
166
177
  <div class="lkt-grid-1">
@@ -170,5 +181,12 @@
170
181
  </div>
171
182
  </div>
172
183
  <lkt-loader v-if="isLoading" />
184
+
185
+ <button-nav
186
+ v-if="computedRenderBottomButtonNav"
187
+ v-bind="computedButtonNavProps"
188
+ @prev="onPrev"
189
+ @next="onNext"
190
+ />
173
191
  </article>
174
192
  </template>