Skip to content

Commit 3584f63

Browse files
committed
WIP
1 parent d2f724d commit 3584f63

File tree

7 files changed

+83
-80
lines changed

7 files changed

+83
-80
lines changed

packages/documentation/components/component-form/ComponentForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ export default defineComponent({
153153
if (props.slots.some((slot) => slot.name === slotName)) continue
154154
155155
result.push({
156-
name: slotName,
157156
content: [`\t${slotName} content`],
157+
name: slotName,
158158
renderedString: `${slotName} content`,
159159
})
160160
}

packages/documentation/pages/(main)/usage/components/form-fields/+Page.vue

Whitespace-only changes.

packages/documentation/pages/(main)/usage/components/pagination/+Page.vue

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,28 +134,108 @@
134134
:total="500"
135135
/>
136136
</CodePreview>
137+
138+
<KtForm v-model:value="settings">
139+
<ComponentForm
140+
:component="component"
141+
:hiddenProps="{
142+
'onUpdate:page': (val: number) => (settings.page = val),
143+
}"
144+
:props="settings"
145+
>
146+
<template #component-form-settings>
147+
<div>
148+
<h4>Settings</h4>
149+
<KtFieldSingleSelect
150+
formKey="pagingStyle"
151+
hideClear
152+
label="Paging style"
153+
:options="[
154+
{ label: 'expand (default)', value: 'expand' },
155+
{ label: 'flex', value: 'flex' },
156+
{ label: 'fraction', value: 'fraction' },
157+
]"
158+
/>
159+
<KtFieldToggle
160+
v-show="settings.pagingStyle === 'flex'"
161+
formKey="fixedWidth"
162+
isOptional
163+
label="Fixed width"
164+
type="switch"
165+
>
166+
<template #helpText>
167+
<code>fixedWidth</code> only has an effect if
168+
<code>pagingStyle</code> is set to <code>flex</code>
169+
</template>
170+
</KtFieldToggle>
171+
</div>
172+
<div>
173+
<h4>Numbers</h4>
174+
<KtFieldNumber formKey="page" hideClear label="Page" />
175+
<KtFieldNumber formKey="pageSize" hideClear label="Page size" />
176+
<KtFieldNumber formKey="total" hideClear label="Total" />
177+
<KtFieldNumber
178+
formKey="adjacentAmount"
179+
hideClear
180+
label="Adjacent Pages"
181+
/>
182+
</div>
183+
</template>
184+
</ComponentForm>
185+
</KtForm>
186+
187+
<!-- Scape goat element to redirect eslint's anger -->
188+
<div />
137189
</template>
138190

139191
<script lang="ts">
140192
import { defineComponent, ref } from 'vue'
141193
142-
import { KtPagination } from '@3yourmind/kotti-ui'
194+
import type { Kotti } from '@3yourmind/kotti-ui'
195+
import {
196+
KtFieldNumber,
197+
KtFieldSingleSelect,
198+
KtFieldToggle,
199+
KtForm,
200+
KtPagination,
201+
} from '@3yourmind/kotti-ui'
143202
144203
import CodePreview from '~/components/CodePreview.vue'
204+
import ComponentForm from '~/components/component-form/ComponentForm.vue'
145205
import ComponentInfo from '~/components/component-info/ComponentInfo.vue'
146206
147207
export default defineComponent({
148208
name: 'DocumentationPageUsageComponentsPagination',
149209
components: {
150210
CodePreview,
151211
ComponentInfo,
212+
ComponentForm,
213+
KtFieldSingleSelect,
214+
KtFieldNumber,
215+
KtFieldToggle,
216+
KtForm,
152217
KtPagination,
153218
},
154219
setup() {
155220
return {
156221
component: KtPagination,
157222
page50: ref(1),
158223
page500: ref(1),
224+
settings: ref<{
225+
adjacentAmount: Kotti.FieldNumber.Value
226+
fixedWidth: Kotti.FieldToggle.Value
227+
page: Kotti.FieldNumber.Value
228+
pageSize: Kotti.FieldNumber.Value
229+
pagingStyle: 'expand' | 'flex' | 'fraction'
230+
total: Kotti.FieldNumber.Value
231+
}>({
232+
adjacentAmount: 2,
233+
fixedWidth: false,
234+
page: 1,
235+
pageSize: 10,
236+
pagingStyle: 'expand',
237+
total: 100,
238+
}),
159239
}
160240
},
161241
})

packages/kotti-ui/source/kotti-pagination/components/PaginationFlexible.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export default defineComponent({
9696
showRightDots: computed(
9797
() =>
9898
showLastPage.value &&
99-
!neighborValues.value.includes(props.maximumPage),
99+
!neighborValues.value.includes(props.maximumPage - 1),
100100
),
101101
}
102102
},

packages/kotti-ui/source/kotti-toaster/KtToast.vue

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -59,55 +59,9 @@ export default defineComponent({
5959
display: contents;
6060
}
6161
62-
<<<<<<< HEAD
6362
.kt-toast > * {
6463
box-shadow:
6564
0 4px 6px 0 rgba(0 0 0 / 10%),
6665
0 2px 4px 0 rgba(0 0 0 / 6%);
67-
=======
68-
background-color: var(--ui-01);
69-
70-
border-radius: var(--border-radius);
71-
/* border: 1px solid var(--gray-20); */
72-
overflow: hidden;
73-
74-
filter: drop-shadow(0 20px 13px rgb(0 0 0 / 0.03))
75-
drop-shadow(0 8px 5px rgb(0 0 0 / 0.08));
76-
77-
&__icon,
78-
&__close {
79-
.yoco {
80-
font-size: var(--unit-6);
81-
height: var(--unit-6);
82-
width: var(--unit-6);
83-
}
84-
}
85-
86-
&__icon {
87-
display: flex;
88-
89-
padding: var(--unit-2) var(--unit-2) var(--unit-2) var(--unit-4);
90-
}
91-
92-
&__text {
93-
flex: 1;
94-
padding-block: var(--unit-2);
95-
}
96-
97-
&__close {
98-
display: flex;
99-
align-items: center;
100-
justify-content: center;
101-
102-
padding: var(--unit-2) var(--unit-4) var(--unit-2) var(--unit-2);
103-
104-
cursor: pointer;
105-
106-
&:hover {
107-
background-color: var(--interactive-01);
108-
color: #fff;
109-
}
110-
}
111-
>>>>>>> 4f75dff3d (wip: Make KtToaster Greater Again)
11266
}
11367
</style>

packages/kotti-ui/source/kotti-toaster/create-toaster.test.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,31 +46,7 @@ describe('createToaster', () => {
4646

4747
describe('.abort()', () => {
4848
it('can abort a toast', () => {
49-
<<<<<<< HEAD
5049
const toaster = createToaster()
51-
=======
52-
// default: Record<string, never>
53-
const toaster = createToaster<{
54-
error: Record<string, never>
55-
success: { tbd: true }
56-
}>()
57-
58-
const success = toaster.withOptions({ type: 'success' })
59-
const error = toaster.withOptions({ type: 'error' })
60-
61-
error({ text: 'something' })
62-
63-
// wrong, surplus key
64-
success({ custom: { tbd: true, wrong: true }, text: 'sdsdf' })
65-
66-
success({ text: 'wow' })
67-
68-
// correct
69-
success({ custom: { tbd: true }, text: 'sdsdf' })
70-
71-
// wrong, custom missing
72-
success({ text: 'simple' })
73-
>>>>>>> 4f75dff3d (wip: Make KtToaster Greater Again)
7450

7551
const toast = toaster.show({ duration: 1, text: 'test' })
7652
expect(() => {

packages/kotti-ui/source/kotti-toaster/create-toaster.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ type IsEmptyObject<T> = T extends Record<string, never> ? true : false
8080

8181
// messages
8282

83-
<<<<<<< HEAD
84-
=======
85-
// type MessageTypes = Record<string, Record<string, unknown>>
86-
>>>>>>> 4f75dff3d (wip: Make KtToaster Greater Again)
8783
type MessageTypes = {
8884
[key: string]: Record<string, unknown>
8985
default: Record<string, never>
@@ -103,10 +99,7 @@ type Messages<MESSAGE_TYPES extends MessageTypes> = {
10399
type MessagesNoDefault<MESSAGE_TYPES extends MessageTypes> = {
104100
[KEY in keyof MESSAGE_TYPES]: {
105101
duration?: number | null
106-
<<<<<<< HEAD
107102
header?: string | null
108-
=======
109-
>>>>>>> 4f75dff3d (wip: Make KtToaster Greater Again)
110103
text: string
111104
type: KEY
112105
} & (IsEmptyObject<MESSAGE_TYPES[KEY]> extends true

0 commit comments

Comments
 (0)