Skip to content

Commit 4971f99

Browse files
committed
fix build errors
1 parent 5f61638 commit 4971f99

File tree

8 files changed

+87
-91
lines changed

8 files changed

+87
-91
lines changed

src/gallery/pages/AutoForm.tsx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ function AutoFormContent() {
2828
</div>
2929
)}`}
3030
>
31-
<AutoForm
32-
className="mx-auto max-w-3xl"
33-
type="QueryBookings"
34-
onSuccess={onSuccess}
31+
<AutoForm
32+
panelClass="mx-auto max-w-3xl"
33+
type="QueryBookings"
34+
onSuccess={onSuccess}
3535
/>
3636
{results && (
3737
<div>
@@ -85,11 +85,11 @@ function AutoFormContent() {
8585
type="QueryBookings"
8686
/>`}
8787
>
88-
<AutoForm
89-
className="mx-auto max-w-3xl"
88+
<AutoForm
89+
panelClass="mx-auto max-w-3xl"
9090
value={request}
9191
onChange={setRequest}
92-
type="QueryBookings"
92+
type="QueryBookings"
9393
/>
9494
</CodeExample>
9595

@@ -98,10 +98,10 @@ function AutoFormContent() {
9898
description="AutoCreateForm can be used to create an automated form based on a AutoQuery CRUD Create Request DTO definition which can be rendered in a traditional inline Form with card formStyle option:"
9999
code={`<AutoCreateForm type="CreateBooking" formStyle="card" />`}
100100
>
101-
<AutoCreateForm
102-
className="mx-auto max-w-3xl"
103-
type="CreateBooking"
104-
formStyle="card"
101+
<AutoCreateForm
102+
panelClass="mx-auto max-w-3xl"
103+
type="CreateBooking"
104+
formStyle="card"
105105
/>
106106
</CodeExample>
107107

@@ -122,12 +122,12 @@ function AutoFormContent() {
122122
subHeading="Manage reservations for MyApp hotels."
123123
/>`}
124124
>
125-
<AutoEditForm
126-
className="mx-auto max-w-3xl"
127-
value={booking}
128-
type="UpdateBooking"
129-
deleteType="DeleteBooking"
130-
heading="Change an existing Room Booking"
125+
<AutoEditForm
126+
panelClass="mx-auto max-w-3xl"
127+
value={booking}
128+
type="UpdateBooking"
129+
deleteType="DeleteBooking"
130+
heading="Change an existing Room Booking"
131131
subHeading="Manage reservations for MyApp hotels."
132132
formStyle="card"
133133
/>
@@ -158,11 +158,11 @@ function AutoFormContent() {
158158
</div>
159159
</AutoEditForm>`}
160160
>
161-
<AutoEditForm
162-
className="mx-auto max-w-3xl mb-4"
163-
value={booking}
164-
formStyle="card"
165-
type="UpdateBooking"
161+
<AutoEditForm
162+
panelClass="mx-auto max-w-3xl mb-4"
163+
value={booking}
164+
formStyle="card"
165+
type="UpdateBooking"
166166
deleteType="DeleteBooking"
167167
>
168168
<div slot="heading">

src/gallery/pages/Autocomplete.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export default function AutocompletePage() {
9696
>
9797
{({ displayName, profileUrl }: any) => (
9898
<div className="flex items-center">
99-
<Icon className="h-6 w-6 flex-shrink-0 rounded-full" src={profileUrl} loading="lazy" />
99+
<Icon className="h-6 w-6 flex-shrink-0 rounded-full" src={profileUrl} />
100100
<span className="ml-3 truncate">{displayName}</span>
101101
</div>
102102
)}
@@ -149,7 +149,7 @@ export default function AutocompletePage() {
149149
>
150150
{({ displayName, profileUrl }: any) => (
151151
<div className="flex items-center">
152-
<Icon className="h-6 w-6 flex-shrink-0 rounded-full" src={profileUrl} loading="lazy" />
152+
<Icon className="h-6 w-6 flex-shrink-0 rounded-full" src={profileUrl} />
153153
<span className="ml-3 truncate">{displayName}</span>
154154
</div>
155155
)}

src/gallery/pages/CustomInputs.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ function PhoneInput({ id, value, onChange, label, placeholder, help, className,
1717
return val
1818
}
1919

20-
const handleChange = (newValue: string) => {
21-
const formatted = formatPhone(newValue)
20+
const handleChange = (newValue: string | number) => {
21+
const formatted = formatPhone(String(newValue))
2222
onChange?.(formatted)
2323
}
2424

2525
return (
2626
<TextInput
2727
id={id}
2828
value={value}
29-
onChange={handleChange}
29+
onChange={handleChange as any}
3030
label={label}
3131
placeholder={placeholder || "(123) 456-7890"}
3232
help={help}
@@ -307,7 +307,7 @@ const volumeInput: InputInfo = {
307307
label: 'Phone Number',
308308
help: 'Auto-formats as you type'
309309
} as InputInfo}
310-
value={dynamicModel}
310+
value={dynamicModel as any}
311311
onChange={setDynamicModel}
312312
api={null}
313313
/>
@@ -318,7 +318,7 @@ const volumeInput: InputInfo = {
318318
label: 'Theme Color',
319319
help: 'Pick your brand color'
320320
} as InputInfo}
321-
value={dynamicModel}
321+
value={dynamicModel as any}
322322
onChange={setDynamicModel}
323323
api={null}
324324
/>
@@ -331,7 +331,7 @@ const volumeInput: InputInfo = {
331331
max: '100',
332332
step: 5
333333
} as InputInfo}
334-
value={dynamicModel}
334+
value={dynamicModel as any}
335335
onChange={setDynamicModel}
336336
api={null}
337337
/>

src/gallery/pages/DataGrid.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,13 @@ const tracks = [
7070
}}
7171
/>`}
7272
>
73-
<DataGrid
74-
items={forecasts}
75-
className="max-w-screen-md"
73+
<DataGrid
74+
items={forecasts}
75+
className="max-w-screen-md"
7676
tableStyle={['stripedRows','uppercaseHeadings']}
7777
headerTitles={{ temperatureC:'TEMP. (C)', temperatureF:'TEMP. (F)' }}
78-
headerSlots={{
79-
'date-header': () => <span className="text-indigo-600">Date</span>
80-
}}
81-
columnSlots={{
78+
slots={{
79+
'date-header': () => <span className="text-indigo-600">Date</span>,
8280
date: ({ date }: any) => new Intl.DateTimeFormat().format(new Date(date)),
8381
temperatureC: ({ temperatureC }: any) => <>{temperatureC}&deg;</>,
8482
temperatureF: ({ temperatureF }: any) => <>{temperatureF}&deg;</>,
@@ -110,19 +108,17 @@ const tracks = [
110108
}}
111109
/>`}
112110
>
113-
<DataGrid
111+
<DataGrid
114112
items={bookings}
115113
visibleFrom={{ name:'xl', bookingStartDate:'sm', bookingEndDate:'xl' }}
116114
onHeaderSelected={headerSelected}
117115
onRowSelected={rowSelected}
118116
isSelected={(row: any) => selected === row.id}
119-
columnSlots={{
117+
slots={{
120118
id: ({ id }: any) => <span className="text-gray-900">{id}</span>,
121119
name: ({ name }: any) => name,
122120
cost: ({ cost }: any) => <span dangerouslySetInnerHTML={{ __html: currency(cost) }} />,
123-
createdBy: ({ createdBy }: any) => <span dangerouslySetInnerHTML={{ __html: createdBy }} />
124-
}}
125-
headerSlots={{
121+
createdBy: ({ createdBy }: any) => <span dangerouslySetInnerHTML={{ __html: createdBy }} />,
126122
'roomNumber-header': () => <><span className="hidden lg:inline">Room </span>No</>,
127123
'bookingStartDate-header': () => <>Start<span className="hidden lg:inline"> Date</span></>,
128124
'bookingEndDate-header': () => <>End<span className="hidden lg:inline"> Date</span></>,

src/gallery/pages/FileInput.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ function FileInputContent() {
5454
onChange={setFiles}
5555
/>`}
5656
>
57-
<FileInput
58-
id="profileUrls"
59-
label="Multiple File Uploads"
60-
multiple
57+
<FileInput
58+
id="profileUrls"
59+
label="Multiple File Uploads"
60+
multiple
6161
files={files}
62-
onChange={setFiles}
62+
onChange={setFiles as any}
6363
className="max-w-lg"
6464
/>
6565
</CodeExample>
@@ -131,11 +131,11 @@ const submit = async (e: React.FormEvent) => {
131131
formStyle="card"
132132
/>`}
133133
>
134-
<AutoEditForm
135-
type="UpdateContact"
136-
value={contact}
137-
formStyle="card"
138-
className="max-w-3xl"
134+
<AutoEditForm
135+
type="UpdateContact"
136+
value={contact}
137+
formStyle="card"
138+
panelClass="max-w-3xl"
139139
/>
140140
</CodeExample>
141141
</GalleryLayout>

src/gallery/pages/FormInputs.tsx

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ function BookingsForm({ id }: { id: number }) {
8080
<ErrorSummary except={visibleFields} className="mb-4" />
8181
<div className="grid grid-cols-6 gap-6">
8282
<div className="col-span-6 sm:col-span-3">
83-
<TextInput
84-
id="name"
83+
<TextInput
84+
id="name"
8585
value={request.name}
8686
onChange={(value) => updateField('name', value)}
87-
required
88-
placeholder="Name for this booking"
87+
placeholder="Name for this booking"
88+
{...{ required: true } as any}
8989
/>
9090
</div>
9191
<div className="col-span-6 sm:col-span-3">
@@ -97,32 +97,30 @@ function BookingsForm({ id }: { id: number }) {
9797
/>
9898
</div>
9999
<div className="col-span-6 sm:col-span-3">
100-
<TextInput
101-
type="number"
102-
id="roomNumber"
100+
<TextInput
101+
type="number"
102+
id="roomNumber"
103103
value={request.roomNumber}
104104
onChange={(value) => updateField('roomNumber', value)}
105-
min={0}
106-
required
105+
{...{ min: 0, required: true } as any}
107106
/>
108107
</div>
109108
<div className="col-span-6 sm:col-span-3">
110-
<TextInput
111-
type="number"
112-
id="cost"
109+
<TextInput
110+
type="number"
111+
id="cost"
113112
value={request.cost}
114113
onChange={(value) => updateField('cost', value)}
115-
min={0}
116-
required
114+
{...{ min: 0, required: true } as any}
117115
/>
118116
</div>
119117
<div className="col-span-6 sm:col-span-3">
120-
<TextInput
121-
type="date"
122-
id="bookingStartDate"
118+
<TextInput
119+
type="date"
120+
id="bookingStartDate"
123121
value={request.bookingStartDate}
124122
onChange={(value) => updateField('bookingStartDate', value)}
125-
required
123+
{...{ required: true } as any}
126124
/>
127125
</div>
128126
<div className="col-span-6 sm:col-span-3">
@@ -153,7 +151,7 @@ function BookingsForm({ id }: { id: number }) {
153151
)}
154152
</div>
155153
<div>
156-
<PrimaryButton onClick={submit}>Update Booking</PrimaryButton>
154+
<PrimaryButton onClick={submit as any}>Update Booking</PrimaryButton>
157155
</div>
158156
</div>
159157
</div>

src/gallery/pages/Formats.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default function FormatsPage() {
4848
title="Icon with custom class"
4949
code={`<PreviewFormat value="/pages/vue/1.jpg" format={Formats.icon} className="w-40 h-40 rounded-full" />`}
5050
>
51-
<PreviewFormat value="https://blazor-gallery.servicestack.net/profiles/1.jpg" format={Formats.icon} className="w-40 h-40 rounded-full" />
51+
<PreviewFormat value="https://blazor-gallery.servicestack.net/profiles/1.jpg" format={Formats.icon} {...{ className: "w-40 h-40 rounded-full" } as any} />
5252
</CodeExample>
5353

5454
<CodeExample
@@ -67,18 +67,17 @@ export default function FormatsPage() {
6767

6868
<CodeExample
6969
title="Attachment (Document) with classes"
70-
code={`<PreviewFormat
71-
value="/content/hosting.md"
72-
format={Formats.attachment}
73-
className="text-xl text-indigo-700 font-semibold"
74-
iconClass="w-8 h-8"
70+
code={`<PreviewFormat
71+
value="/content/hosting.md"
72+
format={Formats.attachment}
73+
className="text-xl text-indigo-700 font-semibold"
74+
iconClass="w-8 h-8"
7575
/>`}
7676
>
77-
<PreviewFormat
78-
value="/content/hosting.md"
79-
format={Formats.attachment}
80-
className="text-xl text-indigo-700 font-semibold"
81-
iconClass="w-8 h-8"
77+
<PreviewFormat
78+
value="/content/hosting.md"
79+
format={Formats.attachment}
80+
{...{ className: "text-xl text-indigo-700 font-semibold", iconClass: "w-8 h-8" } as any}
8281
/>
8382
</CodeExample>
8483

@@ -93,7 +92,7 @@ export default function FormatsPage() {
9392
title="Link with class"
9493
code={`<PreviewFormat value="https://servicestack.net/react" format={Formats.link} className="text-xl text-blue-600" />`}
9594
>
96-
<PreviewFormat value="https://servicestack.net/react" format={Formats.link} className="text-xl text-blue-600" />
95+
<PreviewFormat value="https://servicestack.net/react" format={Formats.link} {...{ className: "text-xl text-blue-600" } as any} />
9796
</CodeExample>
9897

9998
<CodeExample

src/gallery/pages/TagInput.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,22 @@ function TagInputForm() {
3535
<ErrorSummary except={visibleFields} />
3636
<div className="grid grid-cols-12 gap-6">
3737
<div className="col-span-6">
38-
<TextInput
38+
<TextInput
39+
id="firstName"
3940
value={request.firstName}
4041
onChange={(value) => updateField('firstName', value)}
4142
/>
4243
</div>
4344
<div className="col-span-6">
44-
<TextInput
45+
<TextInput
46+
id="lastName"
4547
value={request.lastName}
4648
onChange={(value) => updateField('lastName', value)}
4749
/>
4850
</div>
4951
<div className="col-span-12">
50-
<TagInput
52+
<TagInput
53+
id="skills"
5154
value={request.skills}
5255
onChange={(value) => updateField('skills', value)}
5356
label="Technology Skills"
@@ -90,11 +93,11 @@ function TagInputContent() {
9093
formStyle="card"
9194
/>`}
9295
>
93-
<AutoEditForm
94-
type="UpdateContact"
95-
value={contact}
96-
formStyle="card"
97-
className="max-w-3xl"
96+
<AutoEditForm
97+
type="UpdateContact"
98+
value={contact}
99+
formStyle="card"
100+
panelClass="max-w-3xl"
98101
/>
99102
</CodeExample>
100103

0 commit comments

Comments
 (0)