nexus-shared 1.1.20 → 2.0.0
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.
- package/LICENSE +21 -0
- package/README.md +903 -0
- package/dist/Client.Index.d.ts +44 -0
- package/dist/Client.Index.js +49 -0
- package/dist/Components/Documents/Button.d.ts +29 -0
- package/dist/Components/Documents/Button.js +11 -0
- package/dist/Components/Documents/Menu.d.ts +102 -0
- package/dist/Components/Documents/Menu.js +238 -0
- package/dist/Components/Documents/SplitButton.d.ts +64 -0
- package/dist/Components/Documents/SplitButton.js +127 -0
- package/dist/Components/Documents/TabButtons.d.ts +62 -0
- package/dist/Components/Documents/TabButtons.js +19 -0
- package/dist/Components/Forms/ApiForm.d.ts +21 -0
- package/dist/Components/Forms/ApiForm.js +99 -0
- package/dist/Components/Forms/Crud.d.ts +17 -0
- package/dist/Components/Forms/Crud.js +556 -0
- package/dist/Components/Forms/CrudParts.d.ts +15 -0
- package/dist/Components/Forms/CrudParts.js +36 -0
- package/dist/Components/Forms/Form.d.ts +52 -0
- package/dist/Components/Forms/Form.js +319 -0
- package/dist/Components/Forms/SubmitForm.d.ts +65 -0
- package/dist/Components/Forms/SubmitForm.js +198 -0
- package/dist/Components/Inputs/Calendar.d.ts +69 -0
- package/dist/Components/Inputs/Calendar.js +258 -0
- package/dist/Components/Inputs/CheckBox.d.ts +53 -0
- package/dist/Components/Inputs/CheckBox.js +87 -0
- package/dist/Components/Inputs/CheckBoxGroup.d.ts +20 -0
- package/dist/Components/Inputs/CheckBoxGroup.js +80 -0
- package/dist/Components/Inputs/ChoiceField.d.ts +122 -0
- package/dist/Components/Inputs/ChoiceField.js +169 -0
- package/dist/Components/Inputs/DatePicker.d.ts +54 -0
- package/dist/Components/Inputs/DatePicker.js +246 -0
- package/dist/Components/Inputs/DateRangePicker.d.ts +62 -0
- package/dist/Components/Inputs/DateRangePicker.js +283 -0
- package/dist/Components/Inputs/DateTimePicker.d.ts +75 -0
- package/dist/Components/Inputs/DateTimePicker.js +399 -0
- package/dist/Components/Inputs/Dropdown.d.ts +117 -0
- package/dist/Components/Inputs/Dropdown.js +839 -0
- package/dist/Components/Inputs/DropdownParts.d.ts +84 -0
- package/dist/Components/Inputs/DropdownParts.js +102 -0
- package/dist/Components/Inputs/EditorShell.d.ts +45 -0
- package/dist/Components/Inputs/EditorShell.js +214 -0
- package/dist/Components/Inputs/Field.d.ts +53 -0
- package/dist/Components/Inputs/Field.js +16 -0
- package/dist/Components/Inputs/GroupForm.d.ts +20 -0
- package/dist/Components/Inputs/GroupForm.js +170 -0
- package/dist/Components/Inputs/InputField.d.ts +59 -0
- package/dist/Components/Inputs/InputField.js +169 -0
- package/dist/Components/Inputs/InputRenderer.d.ts +35 -0
- package/dist/Components/Inputs/InputRenderer.js +99 -0
- package/dist/Components/Inputs/MarkdownEditor.d.ts +67 -0
- package/dist/Components/Inputs/MarkdownEditor.js +289 -0
- package/dist/Components/Inputs/NumberBox.d.ts +53 -0
- package/dist/Components/Inputs/NumberBox.js +228 -0
- package/dist/Components/Inputs/RadioGroup.d.ts +20 -0
- package/dist/Components/Inputs/RadioGroup.js +43 -0
- package/dist/Components/Inputs/ReadOnlyNotice.d.ts +36 -0
- package/dist/Components/Inputs/ReadOnlyNotice.js +116 -0
- package/dist/Components/Inputs/RichTextEditor.d.ts +103 -0
- package/dist/Components/Inputs/RichTextEditor.js +1170 -0
- package/dist/Components/Inputs/RichTextParts.d.ts +63 -0
- package/dist/Components/Inputs/RichTextParts.js +157 -0
- package/dist/Components/Inputs/RowsInput.d.ts +104 -0
- package/dist/Components/Inputs/RowsInput.js +259 -0
- package/dist/Components/Inputs/Slider.d.ts +87 -0
- package/dist/Components/Inputs/Slider.js +216 -0
- package/dist/Components/Inputs/TabularForm.d.ts +23 -0
- package/dist/Components/Inputs/TabularForm.js +283 -0
- package/dist/Components/Inputs/TextArea.d.ts +43 -0
- package/dist/Components/Inputs/TextArea.js +31 -0
- package/dist/Components/Inputs/TextBox.d.ts +52 -0
- package/dist/Components/Inputs/TextBox.js +58 -0
- package/dist/Components/Inputs/TextField.d.ts +31 -0
- package/dist/Components/Inputs/TextField.js +35 -0
- package/dist/Components/Inputs/TimePanel.d.ts +34 -0
- package/dist/Components/Inputs/TimePanel.js +288 -0
- package/dist/Components/Inputs/TimePicker.d.ts +54 -0
- package/dist/Components/Inputs/TimePicker.js +239 -0
- package/dist/Components/Inputs/TreeView.d.ts +160 -0
- package/dist/Components/Inputs/TreeView.js +947 -0
- package/dist/Components/Layouts/MessageBox.d.ts +71 -0
- package/dist/Components/Layouts/MessageBox.js +104 -0
- package/dist/Components/Layouts/Popup.d.ts +92 -0
- package/dist/Components/Layouts/Popup.js +376 -0
- package/dist/Components/Layouts/PopupContext.d.ts +2 -0
- package/dist/Components/Layouts/PopupContext.js +4 -0
- package/dist/Components/Layouts/PopupDock.d.ts +22 -0
- package/dist/Components/Layouts/PopupDock.js +121 -0
- package/dist/Components/Layouts/PopupHost.d.ts +56 -0
- package/dist/Components/Layouts/PopupHost.js +163 -0
- package/dist/Components/Layouts/PopupRules.d.ts +30 -0
- package/dist/Components/Layouts/PopupRules.js +63 -0
- package/dist/Components/Layouts/ThemePicker.d.ts +13 -0
- package/dist/Components/Layouts/ThemePicker.js +22 -0
- package/dist/Components/Layouts/ThemeScript.d.ts +14 -0
- package/dist/Components/Layouts/ThemeScript.js +13 -0
- package/dist/Components/Layouts/ThemeSwitcher.d.ts +13 -0
- package/dist/Components/Layouts/ThemeSwitcher.js +29 -0
- package/dist/Components/Layouts/Toaster.d.ts +76 -0
- package/dist/Components/Layouts/Toaster.js +172 -0
- package/dist/Components/Viewers/DataTable.d.ts +25 -0
- package/dist/Components/Viewers/DataTable.js +542 -0
- package/dist/Components/Viewers/DataTableParts.d.ts +134 -0
- package/dist/Components/Viewers/DataTableParts.js +145 -0
- package/dist/Components/Viewers/MarkdownView.d.ts +26 -0
- package/dist/Components/Viewers/MarkdownView.js +79 -0
- package/dist/Components/Viewers/RichTextView.d.ts +18 -0
- package/dist/Components/Viewers/RichTextView.js +17 -0
- package/dist/Helpers/AnimationHelpers.d.ts +6 -0
- package/dist/Helpers/AnimationHelpers.js +35 -0
- package/dist/Helpers/ApiClient.d.ts +74 -0
- package/dist/Helpers/ApiClient.js +197 -0
- package/dist/Helpers/ApiFormHelpers.d.ts +26 -0
- package/dist/Helpers/ApiFormHelpers.js +56 -0
- package/dist/Helpers/ApiModules.d.ts +135 -0
- package/dist/Helpers/ApiModules.js +194 -0
- package/dist/Helpers/ApiResponses.d.ts +41 -0
- package/dist/Helpers/ApiResponses.js +159 -0
- package/dist/Helpers/ApiRoutes.d.ts +150 -0
- package/dist/Helpers/ApiRoutes.js +191 -0
- package/dist/Helpers/ApiToasts.d.ts +21 -0
- package/dist/Helpers/ApiToasts.js +22 -0
- package/dist/Helpers/ClassHelpers.d.ts +3 -0
- package/dist/Helpers/ClassHelpers.js +4 -0
- package/dist/Helpers/CrudBackend.d.ts +56 -0
- package/dist/Helpers/CrudBackend.js +119 -0
- package/dist/Helpers/CrudHelpers.d.ts +76 -0
- package/dist/Helpers/CrudHelpers.js +202 -0
- package/dist/Helpers/DateHelpers.d.ts +88 -0
- package/dist/Helpers/DateHelpers.js +363 -0
- package/dist/Helpers/DatePreferences.d.ts +14 -0
- package/dist/Helpers/DatePreferences.js +94 -0
- package/dist/Helpers/DateTimeHelpers.d.ts +87 -0
- package/dist/Helpers/DateTimeHelpers.js +286 -0
- package/dist/Helpers/DragHelpers.d.ts +129 -0
- package/dist/Helpers/DragHelpers.js +281 -0
- package/dist/Helpers/DropdownHelpers.d.ts +56 -0
- package/dist/Helpers/DropdownHelpers.js +180 -0
- package/dist/Helpers/FormDrafts.d.ts +18 -0
- package/dist/Helpers/FormDrafts.js +76 -0
- package/dist/Helpers/FormStore.d.ts +231 -0
- package/dist/Helpers/FormStore.js +734 -0
- package/dist/Helpers/InputParamsHelpers.d.ts +79 -0
- package/dist/Helpers/InputParamsHelpers.js +388 -0
- package/dist/Helpers/MarkdownEditing.d.ts +27 -0
- package/dist/Helpers/MarkdownEditing.js +250 -0
- package/dist/Helpers/MarkdownHelpers.d.ts +82 -0
- package/dist/Helpers/MarkdownHelpers.js +775 -0
- package/dist/Helpers/MessageBuilder.d.ts +74 -0
- package/dist/Helpers/MessageBuilder.js +254 -0
- package/dist/Helpers/NepaliCalendar.d.ts +25 -0
- package/dist/Helpers/NepaliCalendar.js +107 -0
- package/dist/Helpers/NumberHelpers.d.ts +71 -0
- package/dist/Helpers/NumberHelpers.js +202 -0
- package/dist/Helpers/Permissions.d.ts +62 -0
- package/dist/Helpers/Permissions.js +133 -0
- package/dist/Helpers/PopoverHelpers.d.ts +43 -0
- package/dist/Helpers/PopoverHelpers.js +91 -0
- package/dist/Helpers/RichTextHelpers.d.ts +77 -0
- package/dist/Helpers/RichTextHelpers.js +1072 -0
- package/dist/Helpers/RowsStore.d.ts +160 -0
- package/dist/Helpers/RowsStore.js +584 -0
- package/dist/Helpers/TableColumns.d.ts +40 -0
- package/dist/Helpers/TableColumns.js +254 -0
- package/dist/Helpers/TableExport.d.ts +30 -0
- package/dist/Helpers/TableExport.js +97 -0
- package/dist/Helpers/TableHelpers.d.ts +102 -0
- package/dist/Helpers/TableHelpers.js +281 -0
- package/dist/Helpers/TableStore.d.ts +142 -0
- package/dist/Helpers/TableStore.js +530 -0
- package/dist/Helpers/ThemeHelpers.d.ts +15 -0
- package/dist/Helpers/ThemeHelpers.js +16 -0
- package/dist/Helpers/TimeHelpers.d.ts +73 -0
- package/dist/Helpers/TimeHelpers.js +253 -0
- package/dist/Helpers/TreeStore.d.ts +188 -0
- package/dist/Helpers/TreeStore.js +577 -0
- package/dist/Helpers/ValidationHelpers.d.ts +124 -0
- package/dist/Helpers/ValidationHelpers.js +301 -0
- package/dist/Interfaces/ApiInterfaces.d.ts +149 -0
- package/dist/Interfaces/ApiInterfaces.js +24 -0
- package/dist/Interfaces/CrudInterfaces.d.ts +171 -0
- package/{src/sso-client.tsx → dist/Interfaces/CrudInterfaces.js} +1 -1
- package/dist/Interfaces/DateInterfaces.d.ts +154 -0
- package/dist/Interfaces/DateInterfaces.js +29 -0
- package/dist/Interfaces/FormInterfaces.d.ts +352 -0
- package/dist/Interfaces/FormInterfaces.js +1 -0
- package/dist/Interfaces/InputInterfaces.d.ts +141 -0
- package/dist/Interfaces/InputInterfaces.js +1 -0
- package/dist/Interfaces/MessageInterfaces.d.ts +111 -0
- package/dist/Interfaces/MessageInterfaces.js +5 -0
- package/dist/Interfaces/TableInterfaces.d.ts +291 -0
- package/dist/Interfaces/TableInterfaces.js +1 -0
- package/dist/Interfaces/ThemeInterfaces.d.ts +17 -0
- package/dist/Interfaces/ThemeInterfaces.js +17 -0
- package/dist/Interfaces/TypeInterfaces.d.ts +4 -0
- package/dist/Interfaces/TypeInterfaces.js +1 -0
- package/dist/Server.Index.d.ts +2 -0
- package/dist/Server.Index.js +5 -0
- package/dist/Services/ApiProxy.d.ts +32 -0
- package/dist/Services/ApiProxy.js +111 -0
- package/dist/Services/BrowserApi.d.ts +78 -0
- package/dist/Services/BrowserApi.js +111 -0
- package/dist/Services/ServerApi.d.ts +49 -0
- package/dist/Services/ServerApi.js +75 -0
- package/dist/Services/ThemeService.d.ts +17 -0
- package/dist/Services/ThemeService.js +83 -0
- package/dist/Shared.Index.d.ts +43 -0
- package/dist/Shared.Index.js +47 -0
- package/package.json +82 -33
- package/src/Styles/Nexus.Base.css +70 -0
- package/src/Styles/Nexus.Button.css +151 -0
- package/src/Styles/Nexus.Calendar.css +275 -0
- package/src/Styles/Nexus.Choice.css +345 -0
- package/src/Styles/Nexus.Crud.css +84 -0
- package/src/Styles/Nexus.DateTime.css +81 -0
- package/src/Styles/Nexus.Dropdown.css +774 -0
- package/src/Styles/Nexus.Editor.css +297 -0
- package/src/Styles/Nexus.Form.css +298 -0
- package/src/Styles/Nexus.Index.css +34 -0
- package/src/Styles/Nexus.Input.css +637 -0
- package/src/Styles/Nexus.Markdown.css +265 -0
- package/src/Styles/Nexus.Menu.css +249 -0
- package/src/Styles/Nexus.Popup.css +731 -0
- package/src/Styles/Nexus.RichText.css +463 -0
- package/src/Styles/Nexus.Rows.css +566 -0
- package/src/Styles/Nexus.Slider.css +278 -0
- package/src/Styles/Nexus.Tab.Buttons.css +364 -0
- package/src/Styles/Nexus.Table.css +1014 -0
- package/src/Styles/Nexus.Theme.Picker.css +159 -0
- package/src/Styles/Nexus.Themes.css +194 -0
- package/src/Styles/Nexus.Time.css +147 -0
- package/src/Styles/Nexus.Toast.css +265 -0
- package/src/Styles/Nexus.Tokens.css +72 -0
- package/src/Styles/Nexus.Tree.css +435 -0
- package/src/api-services/authentication-service.tsx +0 -23
- package/src/api-services/preference-service.tsx +0 -5
- package/src/api-services/system-service.tsx +0 -34
- package/src/client.ts +0 -31
- package/src/components/documents/button.tsx +0 -142
- package/src/components/documents/icon-box.tsx +0 -93
- package/src/components/documents/page-title.tsx +0 -7
- package/src/components/documents/tab-button.tsx +0 -172
- package/src/components/documents/tag.tsx +0 -30
- package/src/components/index.js +0 -0
- package/src/components/inputs/checkbox-input.tsx +0 -66
- package/src/components/inputs/input-box.tsx +0 -48
- package/src/components/inputs/input-element.tsx +0 -65
- package/src/components/inputs/input-form.tsx +0 -164
- package/src/components/inputs/input.tsx +0 -181
- package/src/components/inputs/number-input.tsx +0 -108
- package/src/components/inputs/radiobox-input.tsx +0 -53
- package/src/components/inputs/textarea-input.tsx +0 -47
- package/src/components/inputs/textbox-input.tsx +0 -45
- package/src/components/layouts/global-dialogbox.tsx +0 -431
- package/src/components/layouts/global-layout.tsx +0 -59
- package/src/components/layouts/layout-helpers.tsx +0 -20
- package/src/components/layouts/panels/user-panel.tsx +0 -112
- package/src/components/layouts/utility-menu.tsx +0 -49
- package/src/components/panels/theme-panel.tsx +0 -46
- package/src/helpers/bitwise-helpers.tsx +0 -11
- package/src/helpers/browser-helpers.tsx +0 -156
- package/src/helpers/datasource-helpers.tsx +0 -99
- package/src/helpers/element-helpers.tsx +0 -57
- package/src/helpers/input-helpers.tsx +0 -74
- package/src/helpers/string-helpers.tsx +0 -28
- package/src/helpers/utility-helpers.tsx +0 -45
- package/src/helpers/validation-helpers.tsx +0 -302
- package/src/index.ts +0 -26
- package/src/interface.ts +0 -19
- package/src/interfaces/auth-token-interfaces.tsx +0 -6
- package/src/interfaces/browser-interfaces.tsx +0 -36
- package/src/interfaces/button-interfaces.tsx +0 -63
- package/src/interfaces/datasource-interfaces.tsx +0 -22
- package/src/interfaces/datatable-interfaces.tsx +0 -25
- package/src/interfaces/dialogbox-interfaces.tsx +0 -5
- package/src/interfaces/exception-interfaces.tsx +0 -99
- package/src/interfaces/http-interfaces.tsx +0 -129
- package/src/interfaces/icon-interfaces.tsx +0 -129
- package/src/interfaces/input-interfaces.tsx +0 -410
- package/src/interfaces/layout-interfaces.tsx +0 -191
- package/src/interfaces/menu-interfaces.tsx +0 -49
- package/src/interfaces/message-interfaces.tsx +0 -32
- package/src/interfaces/permission-interfaces.tsx +0 -9
- package/src/interfaces/storage-interfaces.tsx +0 -5
- package/src/interfaces/system-interfaces.tsx +0 -22
- package/src/interfaces/theme-interfaces.tsx +0 -123
- package/src/interfaces/type-interfaces.tsx +0 -28
- package/src/interfaces/user-interfaces.tsx +0 -47
- package/src/nexus-client.tsx +0 -21
- package/src/nexus.environments.tsx +0 -66
- package/src/proxy-api/proxy-backend.tsx +0 -60
- package/src/proxy-api/proxy-constants.tsx +0 -28
- package/src/proxy-api/proxy-helpers.tsx +0 -91
- package/src/proxy-api-client.tsx +0 -1
- package/src/proxy-api-server.tsx +0 -2
- package/src/services/http-client-services.tsx +0 -75
- package/src/services/http-services.tsx +0 -158
- package/src/services/loader-service.tsx +0 -185
- package/src/services/localstorage-service.tsx +0 -119
- package/src/services/message-services.tsx +0 -383
- package/src/services/theme-service.tsx +0 -161
- package/src/services/user-services.tsx +0 -10
- package/src/sso-config/auth-token-validation.ts +0 -16
- package/src/sso-config/callback-route.tsx +0 -35
- package/src/sso-config/cookie-encryption.ts +0 -51
- package/src/sso-config/cookie-helpers.tsx +0 -102
- package/src/sso-config/forgot-password-route.tsx +0 -36
- package/src/sso-config/oauth-callback-state.ts +0 -61
- package/src/sso-config/pkce-helpers.ts +0 -9
- package/src/sso-config/provider-complete-route.tsx +0 -18
- package/src/sso-config/redirect-context-actions.tsx +0 -45
- package/src/sso-config/redirect-context-helpers.tsx +0 -159
- package/src/sso-config/redirect-context-persist.tsx +0 -18
- package/src/sso-config/redirect-context-route.tsx +0 -45
- package/src/sso-config/refresh-route.tsx +0 -23
- package/src/sso-config/sign-in-route.tsx +0 -74
- package/src/sso-config/sign-out-route.tsx +0 -57
- package/src/sso-config/sign-up-route.tsx +0 -57
- package/src/sso-config/sso-backend-flow.ts +0 -38
- package/src/sso-config/sso-complete-route.tsx +0 -50
- package/src/sso-config/sso-config.ts +0 -59
- package/src/sso-config/sso-interfaces.tsx +0 -99
- package/src/sso-config/sso-response-helpers.tsx +0 -20
- package/src/sso-server.tsx +0 -21
- package/src/styles/nexus.animation.css +0 -269
- package/src/styles/nexus.core.css +0 -119
- package/src/styles/nexus.dialog.css +0 -144
- package/src/styles/nexus.icon.css +0 -51
- package/src/styles/nexus.input.css +0 -207
- package/src/styles/nexus.loader.css +0 -11
- package/src/styles/nexus.logic.css +0 -47
- package/src/styles/nexus.utility.css +0 -347
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { CreateClone } from "../../helpers/datasource-helpers";
|
|
2
|
-
import { GetInputClasses, GetInputId, GetParentKey } from "../../helpers/input-helpers";
|
|
3
|
-
import { IsNullOrEmpty } from "../../helpers/string-helpers";
|
|
4
|
-
import { Debounce } from "../../helpers/utility-helpers";
|
|
5
|
-
import { DEFAULT_TEXTAREA_ROWS, EInputTypes, ICheckbox, IElement, IInputCreateResults, IInputRootParameters, ILinkbutton, INumber, IRadiobox, ISlider, ISubmitbutton, ITextarea, ITextbox, MAX_INPUT_TYPE, OnFormChangeHandler, REQUIRED_TEXT1 } from "../../interfaces/input-interfaces";
|
|
6
|
-
import { UN } from "../../interfaces/type-interfaces";
|
|
7
|
-
import { CreateCheckbox } from "./checkbox-input";
|
|
8
|
-
import { CreateElement, CreateInputButton, CreateInputLink } from "./input-element";
|
|
9
|
-
import { CreateNumber } from "./number-input";
|
|
10
|
-
import { CreateRadiobox } from "./radiobox-input";
|
|
11
|
-
import { CreateTextarea } from "./textarea-input";
|
|
12
|
-
import { CreateTextbox } from "./textbox-input";
|
|
13
|
-
|
|
14
|
-
const _getInputType = (inputType: EInputTypes) => {
|
|
15
|
-
switch (inputType) {
|
|
16
|
-
case EInputTypes.Checkbox:
|
|
17
|
-
return "checkbox";
|
|
18
|
-
case EInputTypes.Textarea:
|
|
19
|
-
return "textarea";
|
|
20
|
-
case EInputTypes.Number:
|
|
21
|
-
return "number";
|
|
22
|
-
case EInputTypes.Slider:
|
|
23
|
-
case EInputTypes.Range:
|
|
24
|
-
return "range";
|
|
25
|
-
default:
|
|
26
|
-
return "text";
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export function CreateInput(param: ITextbox | ISlider | ICheckbox | ITextarea | INumber) {
|
|
31
|
-
const isTextarea = param.inputType === EInputTypes.Textarea;
|
|
32
|
-
const isNumber = param.inputType === EInputTypes.Number;
|
|
33
|
-
const isSlider = param.inputType === EInputTypes.Slider || param.inputType === EInputTypes.Range;
|
|
34
|
-
const isCheckbox = param.inputType === EInputTypes.Checkbox;
|
|
35
|
-
const isRadiobox = param.inputType === EInputTypes.Radiobox;
|
|
36
|
-
|
|
37
|
-
const inputType = _getInputType(param.inputType);
|
|
38
|
-
const input = document.createElement(isTextarea ? "textarea" : "input");
|
|
39
|
-
if (!isTextarea) (input as HTMLInputElement).type = inputType;
|
|
40
|
-
if (isCheckbox || isRadiobox) {
|
|
41
|
-
if ((param as ICheckbox).groupId) (input as HTMLInputElement).name = (param as ICheckbox).groupId!;
|
|
42
|
-
else if (isRadiobox) (input as HTMLInputElement).name = GetInputId(param as IRadiobox);
|
|
43
|
-
|
|
44
|
-
// No need to set type
|
|
45
|
-
} else if (isTextarea) (input as HTMLTextAreaElement).rows = (param as ITextarea).rows ?? DEFAULT_TEXTAREA_ROWS;
|
|
46
|
-
else if (isNumber) {
|
|
47
|
-
const numberParam = param as INumber;
|
|
48
|
-
const numberInput = input as HTMLInputElement;
|
|
49
|
-
const decimalPlaces = numberParam.floatingPoint ?? 0;
|
|
50
|
-
numberInput.type = "number";
|
|
51
|
-
|
|
52
|
-
if (numberParam.step) numberInput.step = numberParam.step.toString();
|
|
53
|
-
else numberInput.step = decimalPlaces > 0 ? (1 / Math.pow(10, decimalPlaces)).toString() : "1";
|
|
54
|
-
|
|
55
|
-
if (numberParam.minLength !== undefined && numberParam.minLength !== null) numberInput.min = numberParam.minLength.toString();
|
|
56
|
-
if (numberParam.maxLength !== undefined && numberParam.maxLength !== null) numberInput.max = numberParam.maxLength.toString();
|
|
57
|
-
} else if (isSlider) {
|
|
58
|
-
(input as HTMLInputElement).type = "range";
|
|
59
|
-
(input as HTMLInputElement).step = (param as ISlider).step?.toString() ?? "1";
|
|
60
|
-
(input as HTMLInputElement).min = (param as ISlider).minLength?.toString() ?? "0";
|
|
61
|
-
(input as HTMLInputElement).max = (param as ISlider).maxLength?.toString() ?? "100";
|
|
62
|
-
} else (input as HTMLInputElement).type = (param as ITextbox).isPassword ? "password" : "text";
|
|
63
|
-
if (!isSlider && !isNumber) {
|
|
64
|
-
if ((param as ITextbox).minLength) (input as HTMLInputElement).minLength = (param as ITextbox).minLength ?? 0;
|
|
65
|
-
if ((param as ITextbox).maxLength) (input as HTMLInputElement).maxLength = (param as ITextbox).maxLength ?? 0;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
input.className = `${GetInputClasses(param.inputSize, param.defaultClass)}${isTextarea ? " sb" : ""}`;
|
|
69
|
-
input.autocomplete = param.autoComplete ?? "on";
|
|
70
|
-
input.required = !!param.isRequired;
|
|
71
|
-
input.readOnly = !!param.isReadonly;
|
|
72
|
-
input.disabled = !!param.isReadonly;
|
|
73
|
-
input.id = param.id;
|
|
74
|
-
input.placeholder = param.placeholder ?? "";
|
|
75
|
-
input.value = param.defaultValue?.toString() ?? "";
|
|
76
|
-
|
|
77
|
-
return input;
|
|
78
|
-
}
|
|
79
|
-
export const CreateInputs = (inputs: IInputRootParameters<any>[], onChanged: OnFormChangeHandler, index: number, isTabularForm: boolean, parentElement: HTMLElement | null, defaultValue?: any): IInputCreateResults[] => {
|
|
80
|
-
if (inputs.length === 0 || !onChanged) {
|
|
81
|
-
//TODO: WarningMessage("Invalid Inputs", "Please provide valid inputs, onChanged function and parent element.");
|
|
82
|
-
return [];
|
|
83
|
-
}
|
|
84
|
-
const inputValues: any = {};
|
|
85
|
-
const onChangedDebounced = Debounce(onChanged, 10);
|
|
86
|
-
|
|
87
|
-
const results: IInputCreateResults[] = [];
|
|
88
|
-
const pushResult = (result: IInputCreateResults) => results.push(result);
|
|
89
|
-
const handleInputChange = (currentValue: any, isInitilizing: boolean, isForcedChanged: boolean, isDisposed: boolean, currentKey: string, dataSource?: any[]) => {
|
|
90
|
-
if (inputValues[currentKey] === currentValue && !isForcedChanged && !isDisposed) return;
|
|
91
|
-
|
|
92
|
-
inputValues[currentKey] = currentValue;
|
|
93
|
-
(isInitilizing && !isTabularForm ? onChangedDebounced : onChanged)(inputValues, isInitilizing, isForcedChanged, isDisposed, currentKey, index, undefined, dataSource);
|
|
94
|
-
const result = results.find((x) => GetInputId(x.input) === currentKey);
|
|
95
|
-
if (result) {
|
|
96
|
-
const timeout = setTimeout(() => {
|
|
97
|
-
clearTimeout(timeout);
|
|
98
|
-
const children = results.filter((x) => GetParentKey(x.input.parentKey) === currentKey);
|
|
99
|
-
for (const child of children) {
|
|
100
|
-
child.input.defaultValue = inputValues[child.input.id];
|
|
101
|
-
child.onParentChanged?.(currentValue, isInitilizing, isForcedChanged, isDisposed, currentKey, index, undefined, dataSource);
|
|
102
|
-
}
|
|
103
|
-
}, 1);
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
const udpatedInputs = (CreateClone(inputs) as IInputRootParameters<any>[]).sort((a, b) => a.displayOrder - b.displayOrder);
|
|
107
|
-
for (const ipt of udpatedInputs) {
|
|
108
|
-
const ELEMENT_ID = GetInputId(ipt);
|
|
109
|
-
ipt.defaultValue = defaultValue?.[ELEMENT_ID] ?? ipt.defaultValue;
|
|
110
|
-
if (ipt.inputType < MAX_INPUT_TYPE) {
|
|
111
|
-
ipt.onChanged = (currentValue: any, isInitilizing: boolean, isForcedChanged: boolean, isDisposed: boolean, currentKey: string, dataSource?: any | any[]) => handleInputChange(currentValue, isInitilizing, isForcedChanged, isDisposed, currentKey, dataSource);
|
|
112
|
-
if ((ipt as any).isRequired && !IsNullOrEmpty(ipt.placeholder)) ipt.placeholder += ` ${REQUIRED_TEXT1}`;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
switch (ipt.inputType) {
|
|
116
|
-
case EInputTypes.Textbox: {
|
|
117
|
-
pushResult(CreateTextbox(ipt as ITextbox, parentElement, isTabularForm));
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
case EInputTypes.Number: {
|
|
121
|
-
pushResult(CreateNumber(ipt as INumber, parentElement, isTabularForm));
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
case EInputTypes.Textarea: {
|
|
125
|
-
pushResult(CreateTextarea(ipt as ITextarea, parentElement, isTabularForm));
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
case EInputTypes.Checkbox: {
|
|
129
|
-
pushResult(CreateCheckbox(ipt as ICheckbox, parentElement, isTabularForm));
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
case EInputTypes.Radiobox: {
|
|
133
|
-
pushResult(CreateRadiobox(ipt as IRadiobox, parentElement, isTabularForm));
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
case EInputTypes.LinkButton: {
|
|
137
|
-
pushResult(CreateInputLink(ipt as ILinkbutton, parentElement, isTabularForm));
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
case EInputTypes.HtmlElement: {
|
|
141
|
-
pushResult(CreateElement(ipt as IElement, parentElement, isTabularForm));
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
case EInputTypes.SubmitButton: {
|
|
145
|
-
pushResult(CreateInputButton(ipt as ISubmitbutton, parentElement, isTabularForm));
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
/*
|
|
149
|
-
case EInputTypes.MultiSelection:
|
|
150
|
-
case EInputTypes.SingleSelection: {
|
|
151
|
-
pushResult(CreateSelection(ipt as ISelection, parentElement, isTabularForm));
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
case EInputTypes.TabularForm: {
|
|
156
|
-
pushResult(CreateTabular(ipt as ITablularForm, parentElement));
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
case EInputTypes.Datepicker: {
|
|
161
|
-
pushResult(CreateDatepicker(ipt as IDate, parentElement, isTabularForm));
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
case EInputTypes.Slider:
|
|
165
|
-
case EInputTypes.Range: {
|
|
166
|
-
pushResult(CreateSlider(ipt as ISlider, parentElement, isTabularForm));
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
*/
|
|
172
|
-
default:
|
|
173
|
-
break;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return results;
|
|
177
|
-
};
|
|
178
|
-
export const DisposeInputs = (inputs: IInputCreateResults[] | UN, invokeOnChanged?: boolean) => {
|
|
179
|
-
if (!inputs || inputs.length === 0) return;
|
|
180
|
-
for (const input of inputs) input.dispose(invokeOnChanged);
|
|
181
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { GetInputId, SetHaveValueClass } from "../../helpers/input-helpers";
|
|
2
|
-
import { IsNullOrEmpty } from "../../helpers/string-helpers";
|
|
3
|
-
import { IInputCreateResults, INumber } from "../../interfaces/input-interfaces";
|
|
4
|
-
import { CreateInput } from "./input";
|
|
5
|
-
import { CreateInputBox, CreateInputWrapper } from "./input-box";
|
|
6
|
-
|
|
7
|
-
function getDecimalPlaces(param: INumber): number {
|
|
8
|
-
const fp = param.floatingPoint;
|
|
9
|
-
if (fp === undefined || fp === null || fp < 0) return 0;
|
|
10
|
-
return Math.floor(fp);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function roundToDecimalPlaces(value: number, decimalPlaces: number): number {
|
|
14
|
-
if (decimalPlaces <= 0) return Math.round(value);
|
|
15
|
-
const factor = Math.pow(10, decimalPlaces);
|
|
16
|
-
return Math.round(value * factor) / factor;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function parseNumber(raw: string): number | null {
|
|
20
|
-
const trimmed = raw.trim();
|
|
21
|
-
if (trimmed === "") return null;
|
|
22
|
-
const parsed = Number(trimmed);
|
|
23
|
-
return Number.isFinite(parsed) ? parsed : null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function adjustValue(value: number, raw: string, param: INumber, decimalPlaces: number, forceClamp = false): number {
|
|
27
|
-
let result = roundToDecimalPlaces(value, decimalPlaces);
|
|
28
|
-
if (!param.isAutoAdjust) return result;
|
|
29
|
-
|
|
30
|
-
const inputLength = raw.trim().length;
|
|
31
|
-
|
|
32
|
-
if (param.minLength !== undefined && param.minLength !== null) {
|
|
33
|
-
const minLength = String(param.minLength).length;
|
|
34
|
-
if ((forceClamp || inputLength >= minLength) && result < param.minLength) result = param.minLength;
|
|
35
|
-
}
|
|
36
|
-
if (param.maxLength !== undefined && param.maxLength !== null) {
|
|
37
|
-
const maxLength = String(param.maxLength).length;
|
|
38
|
-
if ((forceClamp || inputLength >= maxLength) && result > param.maxLength) result = param.maxLength;
|
|
39
|
-
}
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export const CreateNumber = (param: INumber, parentElement: HTMLElement | null, isTabular: boolean = false) => {
|
|
44
|
-
const ELEMENT_ID = GetInputId(param);
|
|
45
|
-
const hasPlaceholder = !IsNullOrEmpty(param.placeholder);
|
|
46
|
-
const decimalPlaces = getDecimalPlaces(param);
|
|
47
|
-
|
|
48
|
-
const input = CreateInput(param) as HTMLInputElement;
|
|
49
|
-
const box = CreateInputBox(param, input, null, isTabular);
|
|
50
|
-
const wrapper = isTabular ? box : CreateInputWrapper(param, box, parentElement);
|
|
51
|
-
|
|
52
|
-
function handleChanged(val: number | undefined | null, isInit: boolean, isForced: boolean, isDisposed: boolean) {
|
|
53
|
-
param.onChanged?.(val ?? null, isInit, isForced, isDisposed, ELEMENT_ID, undefined);
|
|
54
|
-
SetHaveValueClass(input, (val !== undefined && val !== null) || hasPlaceholder);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function forceChangeDefaultValue(defaultValue: number | null): boolean {
|
|
58
|
-
if (defaultValue === null || defaultValue === undefined) {
|
|
59
|
-
input.value = "";
|
|
60
|
-
handleChanged(null, false, true, false);
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
const adjusted = adjustValue(defaultValue, defaultValue.toString(), param, decimalPlaces, true);
|
|
64
|
-
input.value = adjusted.toString();
|
|
65
|
-
handleChanged(adjusted, false, true, false);
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function onInputChanged() {
|
|
70
|
-
if (param.isAutoAdjust) return;
|
|
71
|
-
const parsed = parseNumber(input.value);
|
|
72
|
-
handleChanged(parsed, false, false, false);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function onBlur() {
|
|
76
|
-
if (!param.isAutoAdjust) return;
|
|
77
|
-
const raw = input.value;
|
|
78
|
-
const parsed = parseNumber(raw);
|
|
79
|
-
if (parsed === null) {
|
|
80
|
-
handleChanged(null, false, false, false);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const adjusted = adjustValue(parsed, raw, param, decimalPlaces, true);
|
|
84
|
-
input.value = adjusted.toString();
|
|
85
|
-
handleChanged(adjusted, false, false, false);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (!param.isAutoAdjust) input.addEventListener("input", onInputChanged);
|
|
89
|
-
if (param.isAutoAdjust) input.addEventListener("blur", onBlur);
|
|
90
|
-
|
|
91
|
-
// Keep initial display as loaded from DB/default — do not round or clamp on init.
|
|
92
|
-
handleChanged(param.defaultValue ?? null, true, false, false);
|
|
93
|
-
|
|
94
|
-
return {
|
|
95
|
-
input: param,
|
|
96
|
-
inputElement: input,
|
|
97
|
-
rootElement: wrapper,
|
|
98
|
-
forceChangeDefaultValue: forceChangeDefaultValue,
|
|
99
|
-
dispose: function (invokeOnChanged?: boolean) {
|
|
100
|
-
if (invokeOnChanged !== false) handleChanged(null, false, true, true);
|
|
101
|
-
input.removeEventListener("input", onInputChanged);
|
|
102
|
-
input.removeEventListener("blur", onBlur);
|
|
103
|
-
input.remove();
|
|
104
|
-
box.remove();
|
|
105
|
-
wrapper.remove();
|
|
106
|
-
},
|
|
107
|
-
} as IInputCreateResults;
|
|
108
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { GetInputId, SetHaveValueClass } from "../../helpers/input-helpers";
|
|
2
|
-
import { IInputCreateResults, IRadiobox } from "../../interfaces/input-interfaces";
|
|
3
|
-
import { CreateInput } from "./input";
|
|
4
|
-
import { CreateInputBox, CreateInputWrapper } from "./input-box";
|
|
5
|
-
|
|
6
|
-
export const CreateRadiobox = (param: IRadiobox, parentElement: HTMLElement | null, isTabular: boolean, isCheckbox: boolean = false) => {
|
|
7
|
-
const input = CreateInput(param) as HTMLInputElement;
|
|
8
|
-
const ELEMENT_ID = GetInputId(param);
|
|
9
|
-
|
|
10
|
-
input.classList.add("pr");
|
|
11
|
-
input.classList.remove("ipt");
|
|
12
|
-
input.defaultChecked = param.defaultValue ?? false;
|
|
13
|
-
input.type = "radio";
|
|
14
|
-
if (isCheckbox) input.classList.add("checkbox");
|
|
15
|
-
|
|
16
|
-
const box = CreateInputBox(param, input, null, isTabular);
|
|
17
|
-
const label = box.querySelector("label") as HTMLLabelElement;
|
|
18
|
-
if (label) label.className = "p2 ilb hc o08";
|
|
19
|
-
const wrapper = isTabular ? box : CreateInputWrapper(param, box, parentElement);
|
|
20
|
-
|
|
21
|
-
box.classList.add("df", "ac", "pl3", "ipt-bxh");
|
|
22
|
-
box.classList.remove("ipt-bx");
|
|
23
|
-
|
|
24
|
-
function handleChanged(val: boolean, isInit: boolean, isForced: boolean, isDisposed: boolean) {
|
|
25
|
-
if (!val) return;
|
|
26
|
-
|
|
27
|
-
param.onChanged?.(param.checkedValue, isInit, isForced, isDisposed, ELEMENT_ID, undefined);
|
|
28
|
-
}
|
|
29
|
-
function forceChangeDefaultValue(defaultValue: boolean): boolean {
|
|
30
|
-
input.value = defaultValue.toString();
|
|
31
|
-
handleChanged(defaultValue, false, true, false);
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
function onInputChanged(e: Event) {
|
|
35
|
-
handleChanged(input.checked, false, false, false);
|
|
36
|
-
}
|
|
37
|
-
input.addEventListener("input", onInputChanged);
|
|
38
|
-
SetHaveValueClass(input, true);
|
|
39
|
-
handleChanged(input.checked, true, false, false);
|
|
40
|
-
return {
|
|
41
|
-
input: param,
|
|
42
|
-
inputElement: input,
|
|
43
|
-
rootElement: wrapper,
|
|
44
|
-
forceChangeDefaultValue: forceChangeDefaultValue,
|
|
45
|
-
dispose: function (invokeOnChanged?: boolean) {
|
|
46
|
-
if (invokeOnChanged !== false) handleChanged(param.defaultValue ?? false, false, true, true);
|
|
47
|
-
input.removeEventListener("input", onInputChanged);
|
|
48
|
-
input.remove();
|
|
49
|
-
box.remove();
|
|
50
|
-
wrapper.remove();
|
|
51
|
-
},
|
|
52
|
-
} as IInputCreateResults;
|
|
53
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { GetInputId, SetHaveValueClass } from "../../helpers/input-helpers";
|
|
2
|
-
import { IsNullOrEmpty } from "../../helpers/string-helpers";
|
|
3
|
-
import { IInputCreateResults, ITextarea } from "../../interfaces/input-interfaces";
|
|
4
|
-
import { CreateInput } from "./input";
|
|
5
|
-
import { CreateInputBox, CreateInputWrapper } from "./input-box";
|
|
6
|
-
|
|
7
|
-
export const CreateTextarea = (param: ITextarea, parentElement: HTMLElement | null, isTabular: boolean = false) => {
|
|
8
|
-
const ELEMENT_ID = GetInputId(param);
|
|
9
|
-
const hasPlaceholder = !IsNullOrEmpty(param.placeholder);
|
|
10
|
-
|
|
11
|
-
const input = CreateInput(param) as HTMLTextAreaElement;
|
|
12
|
-
const box = CreateInputBox(param, input, null, isTabular);
|
|
13
|
-
const wrapper = isTabular ? box : CreateInputWrapper(param, box, parentElement);
|
|
14
|
-
|
|
15
|
-
box.classList.add("textarea-box");
|
|
16
|
-
|
|
17
|
-
function handleChanged(val: string | undefined | null, isInit: boolean, isForced: boolean, isDisposed: boolean) {
|
|
18
|
-
const value = val?.trim() ?? null;
|
|
19
|
-
const isNullorEmpty = IsNullOrEmpty(value);
|
|
20
|
-
param.onChanged?.(isNullorEmpty ? null : value, isInit, isForced, isDisposed, ELEMENT_ID, undefined);
|
|
21
|
-
SetHaveValueClass(input, !isNullorEmpty || hasPlaceholder);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function forceChangeDefaultValue(defaultValue: string | null): boolean {
|
|
25
|
-
input.value = defaultValue ?? "";
|
|
26
|
-
handleChanged(defaultValue, false, true, false);
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
function onInputChanged(e: Event) {
|
|
30
|
-
handleChanged((e.currentTarget as HTMLInputElement).value, false, false, false);
|
|
31
|
-
}
|
|
32
|
-
input.addEventListener("input", onInputChanged);
|
|
33
|
-
handleChanged(param.defaultValue, true, false, false);
|
|
34
|
-
return {
|
|
35
|
-
input: param,
|
|
36
|
-
inputElement: input,
|
|
37
|
-
rootElement: wrapper,
|
|
38
|
-
forceChangeDefaultValue: forceChangeDefaultValue,
|
|
39
|
-
dispose: function (invokeOnChanged?: boolean) {
|
|
40
|
-
if (invokeOnChanged !== false) handleChanged(null, false, true, true);
|
|
41
|
-
input.removeEventListener("input", onInputChanged);
|
|
42
|
-
input.remove();
|
|
43
|
-
box.remove();
|
|
44
|
-
wrapper.remove();
|
|
45
|
-
},
|
|
46
|
-
} as IInputCreateResults;
|
|
47
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { GetInputId, SetHaveValueClass } from "../../helpers/input-helpers";
|
|
2
|
-
import { IsNullOrEmpty } from "../../helpers/string-helpers";
|
|
3
|
-
import { IInputCreateResults, ITextbox } from "../../interfaces/input-interfaces";
|
|
4
|
-
import { CreateInput } from "./input";
|
|
5
|
-
import { CreateInputBox, CreateInputWrapper } from "./input-box";
|
|
6
|
-
|
|
7
|
-
export const CreateTextbox = (param: ITextbox, parentElement: HTMLElement | null, isTabular: boolean = false) => {
|
|
8
|
-
const ELEMENT_ID = GetInputId(param);
|
|
9
|
-
const hasPlaceholder = !IsNullOrEmpty(param.placeholder);
|
|
10
|
-
|
|
11
|
-
const input = CreateInput(param);
|
|
12
|
-
const box = CreateInputBox(param, input, null, isTabular);
|
|
13
|
-
const wrapper = isTabular ? box : CreateInputWrapper(param, box, parentElement);
|
|
14
|
-
|
|
15
|
-
function handleChanged(val: string | undefined | null, isInit: boolean, isForced: boolean, isDisposed: boolean) {
|
|
16
|
-
const value = val?.trim() ?? null;
|
|
17
|
-
const isNullorEmpty = IsNullOrEmpty(value);
|
|
18
|
-
param.onChanged?.(isNullorEmpty ? null : value, isInit, isForced, isDisposed, ELEMENT_ID, undefined);
|
|
19
|
-
SetHaveValueClass(input, !isNullorEmpty || hasPlaceholder);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function forceChangeDefaultValue(defaultValue: string | null): boolean {
|
|
23
|
-
input.value = defaultValue ?? "";
|
|
24
|
-
handleChanged(defaultValue, false, true, false);
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
function onInputChanged(e: Event) {
|
|
28
|
-
handleChanged((e.currentTarget as HTMLInputElement).value, false, false, false);
|
|
29
|
-
}
|
|
30
|
-
input.addEventListener("input", onInputChanged);
|
|
31
|
-
handleChanged(param.defaultValue, true, false, false);
|
|
32
|
-
return {
|
|
33
|
-
input: param,
|
|
34
|
-
inputElement: input,
|
|
35
|
-
rootElement: wrapper,
|
|
36
|
-
forceChangeDefaultValue: forceChangeDefaultValue,
|
|
37
|
-
dispose: function (invokeOnChanged?: boolean) {
|
|
38
|
-
if (invokeOnChanged !== false) handleChanged(null, false, true, true);
|
|
39
|
-
input.removeEventListener("input", onInputChanged);
|
|
40
|
-
input.remove();
|
|
41
|
-
box.remove();
|
|
42
|
-
wrapper.remove();
|
|
43
|
-
},
|
|
44
|
-
} as IInputCreateResults;
|
|
45
|
-
};
|