nexus-shared 1.1.5 → 1.1.7

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.
Files changed (70) hide show
  1. package/package.json +8 -4
  2. package/src/api-services/preference-service.tsx +5 -0
  3. package/src/api-services/system-service.tsx +322 -0
  4. package/src/components/documents/button.tsx +136 -0
  5. package/src/components/documents/icon-box.tsx +92 -0
  6. package/src/components/documents/page-title.tsx +7 -0
  7. package/src/components/documents/tab-button.tsx +169 -0
  8. package/src/components/index.js +0 -0
  9. package/src/components/inputs/checkbox-input.tsx +66 -0
  10. package/src/components/inputs/input-box.tsx +45 -0
  11. package/src/components/inputs/input-element.tsx +65 -0
  12. package/src/components/inputs/input-form.tsx +50 -0
  13. package/src/components/inputs/input.tsx +181 -0
  14. package/src/components/inputs/number-input.tsx +108 -0
  15. package/src/components/inputs/radiobox-input.tsx +53 -0
  16. package/src/components/inputs/textarea-input.tsx +47 -0
  17. package/src/components/inputs/textbox-input.tsx +45 -0
  18. package/src/components/layouts/global-dialogbox.tsx +433 -0
  19. package/src/components/layouts/global-layout.tsx +63 -0
  20. package/src/components/layouts/layout-helpers.tsx +21 -0
  21. package/src/components/layouts/utility-menu.tsx +69 -0
  22. package/src/components/panels/theme-panel.tsx +44 -0
  23. package/src/helpers/bitwise-helpers.tsx +11 -0
  24. package/src/helpers/browser-helpers.tsx +71 -0
  25. package/src/helpers/datasource-helpers.tsx +99 -0
  26. package/src/helpers/element-helpers.tsx +57 -0
  27. package/src/helpers/input-helpers.tsx +24 -0
  28. package/src/helpers/string-helpers.tsx +28 -0
  29. package/src/helpers/utility-helpers.tsx +44 -0
  30. package/src/index.ts +67 -11
  31. package/src/interfaces/browser-interfaces.tsx +23 -0
  32. package/src/interfaces/button-interfaces.tsx +63 -0
  33. package/src/interfaces/datasource-interfaces.tsx +22 -0
  34. package/src/interfaces/datatable-interfaces.tsx +25 -0
  35. package/src/interfaces/dialogbox-interfaces.tsx +5 -0
  36. package/src/interfaces/http-interfaces.tsx +15 -0
  37. package/src/interfaces/icon-interfaces.tsx +126 -0
  38. package/src/interfaces/input-interfaces.tsx +360 -0
  39. package/src/interfaces/layout-interfaces.tsx +191 -0
  40. package/src/interfaces/menu-interfaces.tsx +36 -0
  41. package/src/interfaces/permission-interfaces.tsx +9 -0
  42. package/src/interfaces/storage-interfaces.tsx +3 -0
  43. package/src/interfaces/system-interfaces.tsx +22 -0
  44. package/src/interfaces/theme-interfaces.tsx +209 -0
  45. package/src/interfaces/type-interfaces.tsx +22 -0
  46. package/src/nexus-client.tsx +21 -0
  47. package/src/nexus.environments.tsx +34 -0
  48. package/src/services/loader-service.tsx +168 -0
  49. package/src/services/localstorage-service.tsx +43 -0
  50. package/src/services/theme-service.tsx +147 -0
  51. package/src/styles/nexus.animation.css +269 -0
  52. package/src/styles/nexus.core.css +119 -0
  53. package/src/styles/nexus.dialog.css +141 -0
  54. package/src/styles/nexus.icon.css +50 -0
  55. package/src/styles/nexus.input.css +207 -0
  56. package/src/styles/nexus.loader.css +11 -0
  57. package/src/styles/nexus.logic.css +18 -0
  58. package/src/styles/nexus.utility.css +347 -0
  59. package/src/client/index.ts +0 -1
  60. package/src/client/nexus-selectable-list.css +0 -131
  61. package/src/client/nexus-selectable-list.tsx +0 -111
  62. package/src/client.ts +0 -7
  63. package/src/interface.ts +0 -5
  64. package/src/interfaces/index.ts +0 -6
  65. package/src/interfaces/nexus-base.ts +0 -5
  66. package/src/interfaces/nexus-list.ts +0 -24
  67. package/src/server/index.ts +0 -1
  68. package/src/server/nexus-stat-list.css +0 -92
  69. package/src/server/nexus-stat-list.tsx +0 -46
  70. package/src/server.ts +0 -7
@@ -0,0 +1,63 @@
1
+ import { EIcons, EIconTypes } from "./icon-interfaces";
2
+ import { ESizes } from "./layout-interfaces";
3
+ import { EBackgrounds } from "./theme-interfaces";
4
+ import { ClickHandler, StringCallbackHandler, UN } from "./type-interfaces";
5
+
6
+ export const DEFAULT_BUTTON_CLASS = (column?: number | UN, padding?: number | UN, borderSize?: number | UN, background?: EBackgrounds | UN, defaultClass?: string | UN, needColumnSize?: boolean | UN) => {
7
+ const col = `btn pr h w100 sn db toh p${padding ?? 3} ${background ?? EBackgrounds.Background1} df ac ${borderSize ? "bb" + borderSize : ""} ${defaultClass ?? ""}`;
8
+ if (needColumnSize !== false) return `${col} col-sm-12 ${`col-${column ?? 12}`}`;
9
+ return col;
10
+ };
11
+
12
+ export const DEFAULT_LINK_BUTTON_STYLE: React.CSSProperties = {
13
+ color: "var(--B20)",
14
+ borderBottom: "var(--BRD1) solid var(--B20)",
15
+ width: "fit-content",
16
+ };
17
+
18
+ export enum ETargets {
19
+ Blank = "_blank",
20
+ Self = "_self",
21
+ Parent = "_parent",
22
+ Top = "_top",
23
+ }
24
+ export enum EButtonTypes {
25
+ BUTTON = "button",
26
+ SUBMIT = "submit",
27
+ }
28
+
29
+ export interface IButton {
30
+ label?: string | StringCallbackHandler | string | UN;
31
+ id?: string | UN;
32
+ icon?: EIcons | UN;
33
+ onClick?: ClickHandler | UN;
34
+ url?: string | UN;
35
+ background?: EBackgrounds | UN;
36
+ defaultClass?: string | UN;
37
+ displayOrder?: number | UN;
38
+ data?: any | Event | UN;
39
+ iconType?: EIconTypes | UN;
40
+ iconSize?: ESizes | UN;
41
+ columnSize?: number | UN;
42
+ borderSize?: number | UN;
43
+ target?: ETargets | UN;
44
+ }
45
+
46
+ export const GetButton = (label?: string | StringCallbackHandler | string | UN, id?: string | UN, url?: string | UN, icon?: EIcons | UN, onClick?: ClickHandler | UN, data?: any | Event | UN, background?: EBackgrounds | UN, defaultClass?: string | UN, displayOrder?: number | UN, iconType?: EIconTypes | UN, iconSize?: ESizes | UN, columnSize?: number | UN, borderSize?: number | UN, target?: ETargets | UN): IButton => {
47
+ return {
48
+ label: label,
49
+ id: id,
50
+ icon: icon,
51
+ onClick: onClick,
52
+ url: url,
53
+ background: background,
54
+ defaultClass: defaultClass,
55
+ displayOrder: displayOrder,
56
+ data: data,
57
+ iconType: iconType,
58
+ iconSize: iconSize,
59
+ columnSize: columnSize,
60
+ borderSize: borderSize,
61
+ target: target,
62
+ };
63
+ };
@@ -0,0 +1,22 @@
1
+ import { IApiInformations, IGetApiInformations } from "./http-interfaces";
2
+
3
+ export type DatasourceTypes = any[] | IApiInformations | IJoining | IGetApiInformations;
4
+
5
+ export interface IJoiningKey {
6
+ /** someting we do not need from just need only TOs
7
+ * LIKE: City case,
8
+ * City have , Cityname, Countryname, CountryCode so, we do not need FROMs, we need only TOs
9
+ */
10
+ from?: string;
11
+ to: string;
12
+ status?: string;
13
+ }
14
+ export interface IJoining {
15
+ /** Root Client side ID KEY */
16
+ rootFrom: string;
17
+ /** Root Servier side ID KEY */
18
+ rootTo: string;
19
+ joinings: IJoiningKey[];
20
+ /** Comes From Server */
21
+ apiInformation: IGetApiInformations;
22
+ }
@@ -0,0 +1,25 @@
1
+ import { IJoining } from "./datasource-interfaces";
2
+
3
+ export type OnRenderTableData = (data: any, object: any, index: number, tr: HTMLElement | null, td: HTMLElement | null, isDatatable?: boolean) => any;
4
+
5
+ export interface IColumn {
6
+ systemName: string;
7
+ displayName: string;
8
+ displayOrder: number;
9
+ isVisible: boolean;
10
+ isSearchable: boolean;
11
+ isSortable: boolean;
12
+ render?: OnRenderTableData;
13
+ defaultWidth?: number | string;
14
+ minWidth?: string | number;
15
+ maxWidth?: string | number;
16
+ joining?: IJoining;
17
+ defaultClass?: string;
18
+ childColumns?: IColumn[];
19
+ rowSpan?: number;
20
+ colSpan: number;
21
+ columnSize?: number;
22
+ isSerialNumber: boolean;
23
+ allowResize: boolean;
24
+ //filterInput?: IInputBaseParameters<any>;
25
+ }
@@ -0,0 +1,5 @@
1
+ export interface IDialogboxResults {
2
+ visibility: (isVisible: boolean, isInitial?: boolean) => void;
3
+ isValid: () => boolean;
4
+ destroy: () => void;
5
+ }
@@ -0,0 +1,15 @@
1
+ export enum EActionMethods {
2
+ Get = 1,
3
+ Post = 2,
4
+ Put = 3,
5
+ Delete = 4,
6
+ }
7
+ export interface IApiInformations {
8
+ api: string;
9
+ method: EActionMethods;
10
+ }
11
+ export interface IGetApiInformations extends IApiInformations {
12
+ cacheCode?: string;
13
+ /** In Minutes */
14
+ cacheLifetime?: number;
15
+ }
@@ -0,0 +1,126 @@
1
+ export const DEFAULT_ICON_ELEMENT_NAME = "ion-icon";
2
+ export const DEFAULT_SMALL_ICON_BOX_SIZE = 1 / 1.25;
3
+ export enum EIconTypes {
4
+ OUTLINED = "-outline",
5
+ SHARP = "-sharp",
6
+ FILLED = "",
7
+ }
8
+ export enum EIcons {
9
+ COPYRIGHT = "copyright",
10
+ WOMAN = "woman",
11
+ MAN = "man",
12
+ AT = "at",
13
+ BRIEFCASE = "briefcase",
14
+ LOCK_CLOSED = "lock-closed",
15
+ BOOKMARK = "bookmark",
16
+ CODE_WORKING = "code-working",
17
+ BOOKMARKS = "bookmarks",
18
+ READER = "reader",
19
+ SHARE_SOCIAL = "share-social",
20
+ ALERT_CIRCLE = "alert-circle",
21
+ SEND = "send",
22
+ FOOTBALL = "football",
23
+ BALLOON = "balloon",
24
+ SCHOOL = "school",
25
+ WALK = "walk",
26
+ GAME_CONTROLLER = "game-controller",
27
+ WATER = "water",
28
+ NOTIFICATIONS = "notifications",
29
+ LANGUAGE = "language",
30
+ CUBE = "cube",
31
+ FLAME = "flame",
32
+ BED = "bed",
33
+ DOCUMENT = "document",
34
+ START = "star",
35
+ CALENDAR = "calendar",
36
+ START_HALF = "star-half",
37
+ PEOPLE = "people",
38
+ MEGAPHONE = "megaphone",
39
+ SETTINGS = "settings",
40
+ PERSON_ADD = "person-add",
41
+ ANALYTICS = "analytics",
42
+ HOURGLASS = "hourglass",
43
+ STATS_CHART = "stats-chart",
44
+ GRID = "grid",
45
+ HEART = "heart",
46
+ CART = "cart",
47
+ REPEAT = "repeat",
48
+ HOME = "home",
49
+ WALLET = "wallet",
50
+ RELOAD = "reload",
51
+ CASH = "cash",
52
+ IMAGES = "images",
53
+ IMAGE = "image",
54
+ LOCK_OPEN = "lock-open",
55
+ CHATBOT_ELLIPSES = "chatbox-ellipses",
56
+ LOCATION = "location",
57
+ BUSINESS = "business",
58
+ CONSTRUCT = "construct",
59
+ CALENDER_NUMBER = "calendar-number",
60
+ HEART_CIRCLE = "heart-circle",
61
+ PERSON = "person",
62
+ CALL = "call",
63
+ FLAG = "flag",
64
+ TRANSGENDER = "transgender",
65
+ CARD = "card",
66
+ ID_CARD = "id-card",
67
+ MAIL = "mail",
68
+ MAIL_UNREAD = "mail-unread",
69
+ KEY = "key",
70
+ CREATE = "create",
71
+ MENU = "menu",
72
+ ARCHIVE = "archive",
73
+ ELLIPSIS_HORIZONTAL = "ellipsis-horizontal",
74
+ CHEVRON_DOWN = "chevron-down",
75
+ ARROW_FORWARD = "arrow-forward",
76
+ CHECKMARK_DOUBLE = "checkmark-done",
77
+ CLOSE = "close",
78
+ WARNING = "warning",
79
+ INFORMATION = "information",
80
+ HELP = "help",
81
+ HELP_CIRCLE = "help-circle",
82
+ TRASH_BIN = "trash-bin",
83
+ CLOUD_DOWNLOAD = "cloud-download",
84
+ CLOUD_UPLOAD = "cloud-upload",
85
+ EXIT = "exit",
86
+ CAMERA = "camera",
87
+ SUNNY = "sunny",
88
+ MOON = "moon",
89
+ COLOR_PALETTE = "color-palette",
90
+ RESIZE = "resize",
91
+ EXPAND = "expand",
92
+ REMOVE = "remove",
93
+ EYE = "eye",
94
+ OPTIONS = "options",
95
+ SEARCH = "search",
96
+ LIST = "list",
97
+ TRASH = "trash",
98
+ ADD = "add",
99
+ ADD_CIRCLE = "add-circle",
100
+ CARET_DOWN = "caret-down",
101
+ CARET_UP = "caret-up",
102
+ FUNNEL = "funnel",
103
+ BARBELL = "barbell",
104
+ DESKTOP = "desktop",
105
+ BUILD = "build",
106
+ BULB = "bulb",
107
+ NEWSPAPER = "newspaper",
108
+ CODE_SLASH = "code-slash",
109
+ GLOBE = "globe",
110
+ LEAF = "leaf",
111
+ REFRESH = "refresh",
112
+ LOGIN = "log-in",
113
+ SAVE = "save",
114
+ STOREFRONT = "storefront",
115
+ TEXT = "text",
116
+
117
+ LOGO_GOOGLE = "logo-google",
118
+ LOGO_FACEBOOK = "logo-facebook",
119
+ LOGO_INSTAGRAM = "logo-instagram",
120
+ LOGO_TIKTOK = "logo-tiktok",
121
+ LOGO_LINKEDIN = "logo-linkedin",
122
+ LOGO_GITHUB = "logo-github",
123
+ LOGO_TWITTER = "logo-twitter",
124
+ LOGO_WHATSAPP = "logo-whatsapp",
125
+ LOGO_YOUTUBE = "logo-youtube",
126
+ }
@@ -0,0 +1,360 @@
1
+ import { EButtonTypes, ETargets } from "./button-interfaces";
2
+ import { DatasourceTypes } from "./datasource-interfaces";
3
+ import { IColumn } from "./datatable-interfaces";
4
+ import { EIcons, EIconTypes } from "./icon-interfaces";
5
+ import { EFlexPositions, EOpacity, ESizes } from "./layout-interfaces";
6
+ import { EBackgrounds } from "./theme-interfaces";
7
+ import { ClickHandler, IInterface, UN } from "./type-interfaces";
8
+
9
+ export type OnInputChangeHandler<T> = (currentValue: T, isInitilizing: boolean, isForcedChanged: boolean, isDisposed: boolean, inputKey: string, dataSource?: any | any[]) => void;
10
+ export type OnElementLoad = (inputBox: HTMLElement | null, inputWrapper: HTMLElement | null, isInitilizing: boolean, isForcedChanged: boolean, isDisposed: boolean, currentKey: string, index: number) => void;
11
+ export type AutoCompletes = "on" | "off";
12
+ export type ForceChangeDefaultValue<T> = (defaultValue: T, type?: EValueChangeTypes, invokeOnChanged?: boolean | UN) => boolean;
13
+ export type OnFormChangeHandler = (currentValue: any, isInitilizing: boolean, isForcedChanged: boolean, isDisposed: boolean, currentKey: string, index: number, type?: EValueChangeTypes, dataSource?: any | any[]) => void;
14
+
15
+ export const DEFAULT_INPUT_BACKGROUND = EBackgrounds.Background1;
16
+ export const MAX_INPUT_TYPE = 1900;
17
+ export const DEFAULT_INPUT_BORDER_SIZE = 1;
18
+ export const DEFAULT_TEXTAREA_ROWS = 3;
19
+
20
+ export const REQUIRED_TEXT1 = "✲";
21
+
22
+ export enum EValueChangeTypes {
23
+ Default = 0,
24
+ ForceChanged = 1,
25
+ FormCleared = 2,
26
+ FormReset = 3,
27
+ Disposed = 4,
28
+ }
29
+ export enum ERegexs {
30
+ Fullname = "^[A-Za-z]+(?: [A-Za-z]+)*[0-9]?$",
31
+ Username = "^[A-Za-z0-9]{7,30}$",
32
+ ContactNumber = "^[0-9]{10}$",
33
+ /** Allow Null */
34
+ ContactNumber_NULL = "^$|^[0-9]{10}$",
35
+ Email = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
36
+ /** Allow Null */
37
+ Email_NULL = "^$|^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$",
38
+ EmailUsername = "^(?=.*[a-zA-Z0-9])[a-zA-Z0-9]+@[a-zA-Z0-9]+\\.[a-zA-Z]{2,}$|[a-zA-Z0-9]{8,100}$",
39
+ Password = "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*()_+{}|:,.<>?/~]).{8,30}$",
40
+ EmailUsernameContact = "^(?:[A-Za-z]+[A-Za-z0-9]{2,30}|[0-9]{10}|[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})$",
41
+ Hexadecimal = "^[0-9A-Fa-f]{8}$",
42
+ ContactEmail = "^(?:[0-9]{10}|[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})$",
43
+ }
44
+ export enum EInputTypes {
45
+ Textbox = 1,
46
+ Textarea = 5,
47
+ Texteditor = 10,
48
+ Timepicker = 15,
49
+ Datepicker = 20,
50
+ Datetimepicker = 25,
51
+ DateRangepicker = 30,
52
+ DatetimeRangepicker = 35,
53
+ SingleSelection = 40,
54
+ MultiSelection = 45,
55
+ Checkbox = 50,
56
+ Radiobox = 55,
57
+ Radiogroup = 60,
58
+ Number = 65,
59
+ TabularForm = 70,
60
+ InputForm = 75,
61
+ Range = 80,
62
+ Slider = 85,
63
+ LinkButton = 2000,
64
+ HtmlElement = 3000,
65
+ FormTitle = 4000,
66
+ SubmitButton = 5000,
67
+ }
68
+ export interface IInputIcon {
69
+ icon: EIcons;
70
+ iconSize?: ESizes | UN;
71
+ boxSize?: ESizes | UN;
72
+ opacity?: EOpacity | UN;
73
+ type?: EIconTypes | UN;
74
+ background?: EBackgrounds | UN;
75
+ onClicked?: ClickHandler | UN;
76
+ onMouseEnter?: ClickHandler | UN;
77
+ }
78
+ export interface IInputRootParameters<T> extends IInterface {
79
+ id: string;
80
+ inputType: EInputTypes;
81
+ columnSize: number;
82
+ displayOrder: number;
83
+ borderSize: number;
84
+ background?: EBackgrounds | UN;
85
+ inputSize?: ESizes | UN;
86
+ defaultClass?: string | UN;
87
+ autoAdjustColumn?: boolean | UN;
88
+ icon?: IInputIcon | UN;
89
+ parentKey?: string;
90
+ defaultValue?: T | UN;
91
+ onChanged?: OnInputChangeHandler<T> | UN;
92
+ placeholder?: string | UN;
93
+ label?: string | UN;
94
+ }
95
+ export interface IInputBaseParameters<T> extends IInputRootParameters<T> {
96
+ validatorKey?: string | UN;
97
+ isRequired: boolean;
98
+ autoComplete?: AutoCompletes | UN;
99
+ isReadonly?: boolean | UN;
100
+ }
101
+ export interface IElement extends IInputRootParameters<void> {
102
+ onLoad?: OnElementLoad | UN;
103
+ }
104
+ export interface IInputParameters<T> extends IInputBaseParameters<T> {
105
+ minLength?: number | UN;
106
+ maxLength?: number | UN;
107
+ }
108
+ export interface ILinkbutton extends IElement {
109
+ href: string;
110
+ onClicked?: ClickHandler | UN;
111
+ borderBottom?: boolean | UN;
112
+ opacity?: EOpacity | UN;
113
+ position?: EFlexPositions | UN;
114
+ target?: ETargets | UN;
115
+ }
116
+ export interface ISubmitbutton extends IElement {
117
+ onClicked?: ClickHandler | UN;
118
+ type?: EButtonTypes | UN;
119
+ }
120
+ export interface ITextbox extends IInputParameters<string | null> {
121
+ isPassword?: boolean | UN;
122
+ regexKey?: ERegexs | UN;
123
+ }
124
+ export interface ISlider extends IInputParameters<number | null> {
125
+ step?: number | UN;
126
+ showTitleOnTop?: boolean | UN;
127
+ }
128
+ export interface ICheckbox extends IInputBaseParameters<boolean | any> {
129
+ checkedValue?: any | UN;
130
+ groupId?: string | UN;
131
+ }
132
+ export interface IRadiobox extends ICheckbox {}
133
+ export interface ITextarea extends IInputParameters<string | null> {
134
+ isShowPreview?: boolean | UN;
135
+ rows?: number | UN;
136
+ regexKey?: ERegexs | UN;
137
+ }
138
+ export interface INumber extends IInputParameters<number | null> {
139
+ floatingPoint?: number | UN;
140
+ isAutoAdjust?: boolean | UN;
141
+ step?: number | string | UN;
142
+ }
143
+ export interface IDate extends IInputBaseParameters<string | Date | null> {
144
+ minDate?: Date | string | UN;
145
+ maxDate?: Date | string | UN;
146
+ }
147
+ export interface ISelection extends IInputBaseParameters<any | any[] | null> {
148
+ isSearchable: boolean | UN;
149
+ valueKey: string | UN;
150
+ labelKey: string | UN;
151
+ selectedLabel?: string | UN;
152
+ columnName?: string | UN;
153
+ dataSource: DatasourceTypes | UN;
154
+ onSelectionChanged?: OnInputChangeHandler<any | any[] | null> | UN;
155
+ columns?: IColumn[] | UN;
156
+ minDialogWidth?: number | UN;
157
+ bitwiseEnum?: any | UN;
158
+ }
159
+ export interface ITablularForm extends IInputParameters<any[]> {
160
+ inputs: IInputRootParameters<any>[];
161
+ disabledAdd?: boolean | UN;
162
+ disabledRemove?: boolean | UN;
163
+ }
164
+ export interface IInputCreateResults {
165
+ input: IInputRootParameters<any>;
166
+ /** This is input element like: textbox, textarea, checkbox */
167
+ inputElement: HTMLElement;
168
+ /** input element base parent like: formGroup/formWrapper */
169
+ rootElement: HTMLElement;
170
+ forceChangeDefaultValue: ForceChangeDefaultValue<any> | null;
171
+ dispose: (invokeOnChanged?: boolean | UN) => void;
172
+ onParentChanged?: OnFormChangeHandler | UN;
173
+ }
174
+ export interface IForm {
175
+ inputs: IInputRootParameters<any>[];
176
+ onChanged: OnFormChangeHandler;
177
+ index: number;
178
+ isTabularForm: boolean;
179
+ parentIdentifier: HTMLElement | UN | string;
180
+ defaultValue?: any | UN;
181
+ }
182
+ export interface IFormCreateResults {
183
+ inputResults: IInputCreateResults[];
184
+ formElement: HTMLElement;
185
+ dispose: (invokeOnChanged?: boolean) => void;
186
+ forceChangeDefaultValue: ForceChangeDefaultValue<any> | null;
187
+ }
188
+
189
+ export const GetForms = {
190
+ FORM: (inputs: IInputRootParameters<any>[], parentIdentifier: HTMLElement | string | UN, onChanged: OnFormChangeHandler, defaultValue?: any, index?: number, isTabularForm?: boolean): IForm => ({ inputs, onChanged, index: index ?? 0, isTabularForm: isTabularForm ?? false, parentIdentifier, defaultValue }),
191
+ };
192
+ export const GetInputs = {
193
+ ICON: (icon: EIcons, iconSize?: ESizes | UN, boxSize?: ESizes | UN, opacity?: EOpacity | UN, type?: EIconTypes | UN, background?: EBackgrounds | UN, onClicked?: ClickHandler | UN, onMouseEnter?: ClickHandler | UN): IInputIcon => ({
194
+ icon: icon,
195
+ iconSize: iconSize,
196
+ boxSize: boxSize,
197
+ opacity: opacity,
198
+ type: type,
199
+ background: background,
200
+ onClicked: onClicked,
201
+ onMouseEnter: onMouseEnter,
202
+ }),
203
+ TEXTBOX: (id: string, columnSize: number, displayOrder: number, label?: string | UN, placeholder?: string | UN, validatorKey?: string | UN, minLength?: number | UN, maxLength?: number | UN, regexKey?: ERegexs | UN, isPassword?: boolean | UN, isReadonly?: boolean | UN, isAutoComplete?: boolean | UN, defaultValue?: string | UN, background?: EBackgrounds | UN, borderSize?: number | UN, inputSize?: ESizes | UN, icon?: IInputIcon | UN, defaultClass?: string | UN, onChanged?: OnInputChangeHandler<string | null> | UN): ITextbox => ({
204
+ id: id,
205
+ columnSize: columnSize,
206
+ displayOrder: displayOrder,
207
+ label: label,
208
+ placeholder: placeholder,
209
+ validatorKey: validatorKey,
210
+ minLength: minLength,
211
+ maxLength: maxLength,
212
+ regexKey: regexKey,
213
+ defaultValue: defaultValue,
214
+ background: background,
215
+ borderSize: borderSize ?? DEFAULT_INPUT_BORDER_SIZE,
216
+ inputSize: inputSize,
217
+ isPassword: isPassword,
218
+ icon: icon,
219
+ isReadonly: isReadonly,
220
+ defaultClass: defaultClass,
221
+ onChanged: onChanged,
222
+ isRequired: (minLength !== undefined && minLength !== null && minLength > 0) ?? false,
223
+ inputType: EInputTypes.Textbox,
224
+ autoComplete: isAutoComplete !== false ? undefined : "off",
225
+ }),
226
+ TEXTAREA: (id: string, columnSize: number, displayOrder: number, label?: string | UN, placeholder?: string | UN, validatorKey?: string | UN, minLength?: number | UN, maxLength?: number | UN, rows?: number | UN, isShowPreview?: boolean | UN, defaultValue?: string | UN, regexKey?: ERegexs | UN, isReadonly?: boolean | UN, isAutoComplete?: boolean | UN, background?: EBackgrounds | UN, borderSize?: number | UN, inputSize?: ESizes | UN, icon?: IInputIcon | UN, defaultClass?: string | UN, onChanged?: OnInputChangeHandler<string | null> | UN): ITextarea => ({
227
+ id: id,
228
+ columnSize: columnSize,
229
+ displayOrder: displayOrder,
230
+ label: label,
231
+ placeholder: placeholder,
232
+ validatorKey: validatorKey,
233
+ minLength: minLength,
234
+ maxLength: maxLength,
235
+ isShowPreview: isShowPreview,
236
+ rows: rows ?? DEFAULT_TEXTAREA_ROWS,
237
+ regexKey: regexKey,
238
+ defaultValue: defaultValue,
239
+ background: background,
240
+ borderSize: borderSize ?? DEFAULT_INPUT_BORDER_SIZE,
241
+ inputSize: inputSize,
242
+ icon: icon,
243
+ isReadonly: isReadonly,
244
+ defaultClass: defaultClass,
245
+ onChanged: onChanged,
246
+ isRequired: (minLength !== undefined && minLength !== null && minLength > 0) ?? false,
247
+ inputType: EInputTypes.Textarea,
248
+ autoComplete: isAutoComplete !== false ? undefined : "off",
249
+ }),
250
+ NUMBER: (id: string, columnSize: number, displayOrder: number, label?: string | UN, placeholder?: string | UN, validatorKey?: string | UN, floatingPoint?: number | UN, isAutoAdjust?: boolean | UN, step?: number | string | UN, minLength?: number | UN, maxLength?: number | UN, defaultValue?: number | UN, isAutoComplete?: boolean | UN, background?: EBackgrounds | UN, borderSize?: number | UN, inputSize?: ESizes | UN, icon?: IInputIcon | UN, isReadonly?: boolean | UN, defaultClass?: string | UN, onChanged?: OnInputChangeHandler<number | null> | UN): INumber => ({
251
+ id: id,
252
+ columnSize: columnSize,
253
+ displayOrder: displayOrder,
254
+ label: label,
255
+ placeholder: placeholder,
256
+ validatorKey: validatorKey,
257
+ minLength: minLength,
258
+ maxLength: maxLength,
259
+ floatingPoint: floatingPoint,
260
+ isAutoAdjust: isAutoAdjust,
261
+ step: step,
262
+ defaultValue: defaultValue,
263
+ background: background,
264
+ borderSize: borderSize ?? DEFAULT_INPUT_BORDER_SIZE,
265
+ inputSize: inputSize,
266
+ icon: icon,
267
+ isReadonly: isReadonly,
268
+ defaultClass: defaultClass,
269
+ onChanged: onChanged,
270
+ isRequired: (minLength !== undefined && minLength !== null && minLength > 0) ?? false,
271
+ inputType: EInputTypes.Number,
272
+ autoComplete: isAutoComplete !== false ? undefined : "off",
273
+ }),
274
+
275
+ CHECKBOX: (id: string, columnSize: number, displayOrder: number, label?: string | UN, defaultValue?: boolean | UN, groupId?: string | UN, checkedValue?: any | UN, isAutoComplete?: boolean | UN, background?: EBackgrounds | UN, borderSize?: number | UN, inputSize?: ESizes | UN, icon?: IInputIcon | UN, isRequired?: boolean | UN, isReadonly?: boolean | UN, defaultClass?: string | UN, onChanged?: OnInputChangeHandler<boolean | any | null> | UN): ICheckbox => ({
276
+ id: id,
277
+ columnSize: columnSize,
278
+ displayOrder: displayOrder,
279
+ label: label,
280
+ defaultValue: defaultValue,
281
+ groupId: groupId,
282
+ checkedValue: checkedValue,
283
+ background: background,
284
+ borderSize: borderSize ?? 0,
285
+ inputSize: inputSize,
286
+ icon: icon,
287
+ isReadonly: isReadonly,
288
+ defaultClass: defaultClass,
289
+ onChanged: onChanged,
290
+ isRequired: isRequired ?? false,
291
+ inputType: EInputTypes.Checkbox,
292
+ autoComplete: isAutoComplete !== false ? undefined : "off",
293
+ }),
294
+ RADIOBOX: (id: string, columnSize: number, displayOrder: number, label?: string | UN, defaultValue?: boolean | UN, groupId?: string | UN, checkedValue?: any | UN, isAutoComplete?: boolean | UN, background?: EBackgrounds | UN, borderSize?: number | UN, inputSize?: ESizes | UN, icon?: IInputIcon | UN, isRequired?: boolean | UN, isReadonly?: boolean | UN, defaultClass?: string | UN, onChanged?: OnInputChangeHandler<boolean | any | null> | UN): ICheckbox => ({
295
+ id: id,
296
+ columnSize: columnSize,
297
+ displayOrder: displayOrder,
298
+ label: label,
299
+ groupId: groupId,
300
+ checkedValue: checkedValue,
301
+ defaultValue: defaultValue,
302
+ background: background,
303
+ borderSize: borderSize ?? 0,
304
+ inputSize: inputSize,
305
+ icon: icon,
306
+ isReadonly: isReadonly,
307
+ defaultClass: defaultClass,
308
+ onChanged: onChanged,
309
+ isRequired: isRequired ?? false,
310
+ inputType: EInputTypes.Radiobox,
311
+ autoComplete: isAutoComplete !== false ? undefined : "off",
312
+ }),
313
+ LINKBUTTON: (id: string, columnSize: number, displayOrder: number, href: string, label?: string | UN, onClicked?: ClickHandler | UN, onLoad?: OnElementLoad | UN, borderBottom?: boolean | UN, opacity?: EOpacity | UN, position?: EFlexPositions | UN, target?: ETargets | UN, background?: EBackgrounds | UN, borderSize?: number | UN, inputSize?: ESizes | UN, defaultClass?: string | UN): ILinkbutton => ({
314
+ id: id,
315
+ columnSize: columnSize,
316
+ displayOrder: displayOrder,
317
+ href: href,
318
+ label: label,
319
+ onClicked: onClicked,
320
+ onLoad: onLoad,
321
+ borderBottom: borderBottom,
322
+ opacity: opacity,
323
+ position: position,
324
+ target: target,
325
+ background: background,
326
+ borderSize: borderSize ?? 0,
327
+ inputSize: inputSize,
328
+ defaultClass: defaultClass,
329
+ inputType: EInputTypes.LinkButton,
330
+ }),
331
+ BUTTON: (
332
+ //
333
+ id: string,
334
+ columnSize: number,
335
+ displayOrder: number,
336
+ label?: string | UN,
337
+ onClicked?: ClickHandler | UN,
338
+ type?: EButtonTypes | UN,
339
+ onLoad?: OnElementLoad | UN,
340
+ background?: EBackgrounds | UN,
341
+ borderSize?: number | UN,
342
+ inputSize?: ESizes | UN,
343
+ defaultClass?: string | UN,
344
+ icon?: IInputIcon | UN,
345
+ ): ISubmitbutton => ({
346
+ id: id,
347
+ columnSize: columnSize,
348
+ displayOrder: displayOrder,
349
+ label: label,
350
+ type: type,
351
+ onClicked: onClicked,
352
+ onLoad: onLoad,
353
+ background: background ?? EBackgrounds.PrimaryColor,
354
+ borderSize: borderSize ?? DEFAULT_INPUT_BORDER_SIZE,
355
+ inputSize: inputSize,
356
+ defaultClass: defaultClass,
357
+ inputType: EInputTypes.SubmitButton,
358
+ icon: icon,
359
+ }),
360
+ };