-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: preparation to NPM publish (#1511)
- Loading branch information
1 parent
15b4e7a
commit f7254db
Showing
20 changed files
with
221 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { AcceptableFormValueOrNullish } from '../../types/components/shareableTypes'; | ||
import { Mode } from '../../constants/modes'; | ||
|
||
export interface ControlData { | ||
value: AcceptableFormValueOrNullish; | ||
mode: Mode; | ||
serviceName: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { GlobalConfig } from '../../types/globalConfig/globalConfig'; | ||
import { UtilBaseForm } from '../../types/components/BaseFormTypes'; | ||
import { AcceptableFormValueOrNullish } from '../../types/components/shareableTypes'; | ||
import { ControlData } from './CustomControl.types'; | ||
|
||
type ValueSetter = (newValue: AcceptableFormValueOrNullish) => void; | ||
|
||
export type CustomControlInstance<T extends typeof CustomControlBase = typeof CustomControlBase> = | ||
InstanceType<T>; | ||
|
||
export type CustomControlConstructor< | ||
T extends typeof CustomControlBase = typeof CustomControlBase | ||
> = new (...args: ConstructorParameters<T>) => CustomControlInstance<T>; | ||
|
||
export abstract class CustomControlBase { | ||
protected globalConfig: GlobalConfig; | ||
|
||
protected el: HTMLElement; | ||
|
||
protected data: ControlData; | ||
|
||
protected setValue: ValueSetter; | ||
|
||
protected util: UtilBaseForm; | ||
|
||
constructor( | ||
globalConfig: GlobalConfig, | ||
el: HTMLElement, | ||
data: ControlData, | ||
setValue: ValueSetter, | ||
util: UtilBaseForm | ||
) { | ||
this.globalConfig = globalConfig; | ||
this.el = el; | ||
this.data = data; | ||
this.setValue = setValue; | ||
this.util = util; | ||
} | ||
|
||
abstract render(): void; | ||
|
||
validation?(field: string, value: ControlData['value']): string | undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { z } from 'zod'; | ||
import { TabSchema } from '../../types/globalConfig/pages'; | ||
|
||
export type Tab = z.infer<typeof TabSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Tab } from './CustomTab.types'; | ||
|
||
export type CustomTabInstance<T extends typeof CustomTabBase = typeof CustomTabBase> = | ||
InstanceType<T>; | ||
|
||
export type CustomTabConstructor<T extends typeof CustomTabBase = typeof CustomTabBase> = new ( | ||
...args: ConstructorParameters<T> | ||
) => CustomTabInstance<T>; | ||
|
||
export abstract class CustomTabBase { | ||
protected tab: Tab; | ||
|
||
protected el: HTMLDivElement; | ||
|
||
constructor(tab: Tab, el: HTMLDivElement) { | ||
this.tab = tab; | ||
this.el = el; | ||
} | ||
|
||
abstract render(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.