zwischenstand

This commit is contained in:
2024-02-13 16:36:09 +00:00
parent 0b4a474180
commit 49e55a90f7
173 changed files with 15832 additions and 1359 deletions

12
types/content.d.ts vendored
View File

@@ -1,7 +1,7 @@
interface Page {
interface Content {
path: string
active: boolean
type: "page" | "teamMembers" | "jobOffers"
type: "page"
pageTitle: string
rows: Row[]
id: string
@@ -13,10 +13,16 @@ interface Page {
}
interface Row {
title: string
backgroundImage: string
columns: Column[]
}
type Column =
| { contentType: "image"; image: string; icons: { icon: string; link: string }[] }
| { contentType: "images"; images: string[] }
| { contentType: "moduleImport"; moduleImport: string }
| { contentType: "form"; moduleImport: string }
| { contentType: "text"; text: string }
| { contentType: "googleMaps" }
type Module = { type: "form"; form: DBFormObj; id: string } | { type: ""; id: string }

View File

@@ -1,52 +1,21 @@
interface FormValues {
[key: string]: CustomHTMLElement
blockGroups?: Set<number>
}
interface FormObj {
formRows?: string[]
index?: number
formTitle?: string
formValues?: Writable<FormValues>
honey?: boolean
agreement?: boolean
}
// Before transformation
interface TempFormBefore {
[rowName: string]: TempFormRowBefore
}
interface TempFormRowBefore {
[newKey: string]: [any, boolean, boolean]
}
// After transformation
interface TempFormAfter {
[rowName: string]: Array<[string, [any, boolean, boolean]]>
}
interface TempFormIndices {
[rowName: string]: {
[newKey: string]: number
}
}
type ValueEntry =
| [string, [boolean | string | any, boolean]]
| [string, [any, CustomHTMLElement, string | null, boolean]]
type ObjectEntry = [string, CustomHTMLElement]
interface DBFormObj {
emailSubject: string
emailReciever: string
emailCC: string[]
emailIntroduction: string
rows: DBFormRow[]
}
interface DBFormRow {
title: string
// Common Interfaces
interface StandardInputProperties {
emailTitle: string
columns: FormColumn[]
placeholder: string
notRequired: boolean
fieldOrder: number
textTitle: string
groupTitle: string
}
interface TimeRange {
from: string
to: string
}
interface DateRange {
from: Date
to: Date
}
interface Block {
@@ -61,7 +30,7 @@ interface LabelNumberInput {
block: Block[]
}
type inputWidgets =
type InputWidgets =
| "labelNumber"
| "times"
| "select"
@@ -69,21 +38,67 @@ type inputWidgets =
| "customCalendar"
| "number"
| "checkboxGroup"
| "test"
| "text"
| "multiSelect"
| "timeSelect"
| "standardSelect"
type StandardInputProperties = {
emailTitle: string
placeholder: string
notRequired: boolean
fieldOrder: number
textTitle: string
// Form Related Interfaces
interface FormValues {
[key: string]: CustomHTMLElement
blockGroups?: Set<number>
}
interface FormObj {
formRows?: string[]
index?: number
formTitle?: string
formValues?: Writable<FormValues>
honey?: boolean
agreement?: boolean
}
interface TempFormBefore {
[rowName: string]: TempFormRowBefore
}
interface TempFormRowBefore {
[newKey: string]: [any, boolean, boolean]
}
interface TempFormAfter {
[rowName: string]: Array<[string, [any, boolean, boolean]]>
}
interface TempFormIndices {
[rowName: string]: {
[newKey: string]: number
}
}
// DB Related Interfaces
interface DBFormObj {
emailSubject: string
emailReciever: string
emailCC: string[]
emailIntroduction: string
sendFormBtnText: string
rows: DBFormRow[]
}
interface DBFormRow {
title: string
emailTitle: string
columns: FormColumn[]
}
// Input Widgets Interfaces
interface CheckboxGroupInput {
groupTitle: string
checkboxes: {
standardInputProperties: StandardInputProperties[]
standardInputProperties: StandardInputProperties
emailTitle?: string
textTitle?: string
}[]
}
@@ -94,10 +109,7 @@ interface DateInput {
interface DatePickerInput {
standardInputProperties: StandardInputProperties
props: {
allowedDateRanges: {
from: Date
to: Date
}
allowedDateRanges: DateRange
excludeDates: string[]
}
}
@@ -109,7 +121,7 @@ interface MultiSelectInput {
}
options: {
name: string
}
}[]
}
interface NumberInput {
@@ -125,20 +137,66 @@ interface TextInput {
interface TimesInput {
standardInputProperties: StandardInputProperties
times: {
from: string
to: string
times: TimeRange[]
}
interface TimeSelect {
selectEntries: {
leftSide: string
rightSide: string
}[]
standardInputProperties: StandardInputProperties
}
interface StandardSelect {
selectEntries: {
shownValue: string
value: string
defaultValue: boolean
}[]
standardInputProperties: StandardInputProperties
}
// Widget Interface
interface Widget {
text: (TextInput & StandardInputProperties)[]
number: NumberInput & StandardInputProperties
date: DateInput & StandardInputProperties
times: TimesInput & StandardInputProperties
checkboxGroup: CheckboxGroupInput
datepicker: DatePickerInput & StandardInputProperties
multiselect: MultiSelectInput & StandardInputProperties
labelNumber: LabelNumberInput[] & StandardInputProperties
timeSelect: TimeSelect & StandardInputProperties
standardSelect: StandardSelect & StandardInputProperties
}
interface FormColumn {
inputWidgets: inputWidgets
labelNumberInput?: LabelNumber
checkboxGroupInput?: CheckboxGroupInput
dateInput?: DateInputInput
datePickerInput?: DatePickerInput
multiSelectInput?: MultiSelectInput
numberInput?: NumberInput
timesInput?: TimesInput
textInput?: TextInput
emailTitle: string
title: string
annotation: string
inputWidgets: InputWidgets[]
labelNumberInput: LabelNumberInput[]
checkboxGroupInput: CheckboxGroupInput
dateInput: DateInput
datePickerInput: DatePickerInput
multiSelectInput: MultiSelectInput
numberInput: NumberInput
timesInput: TimesInput
textInput: TextInput[]
timeSelect: TimeSelect
standardSelect: StandardSelect
}
type ValueEntry =
| [string, [boolean | string | any, boolean]]
| [string, [any, CustomHTMLElement, string | null, boolean]]
type ObjectEntry = [string, CustomHTMLElement]
interface FormValues {
[key: string]: CustomHTMLElement
blockGroups?: Set<number>
}
interface CustomHTMLElement extends HTMLElement {
checked?: boolean
value?: any
required?: boolean
getAttribute(attr: string): string | null
}

0
types/modules.d.ts vendored
View File

View File

@@ -1,9 +1,12 @@
interface Navigation {
tree: number
pages: NavElement[]
elements: NavElement[]
}
interface NavElement {
endpoint: boolean
name: string
page: string
image: FileField
page?: string
elements?: NavElement[]
}