@integry/sdk 4.7.39 → 4.7.41

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 (267) hide show
  1. package/dist/esm/index.csm.js +1 -1
  2. package/dist/umd/index.umd.js +1 -1
  3. package/package.json +6 -1
  4. package/.eslintignore +0 -1
  5. package/.vscode/launch.json +0 -17
  6. package/CHANGELOG_INTERNAL.md +0 -134
  7. package/README_INTERNAL.md +0 -176
  8. package/THIRD_PARTY_LICENSES +0 -525
  9. package/generateTests.js +0 -80
  10. package/jest.config.cjs +0 -10
  11. package/src/components/AddTagButton/index.ts +0 -23
  12. package/src/components/BasicSelect/index.ts +0 -123
  13. package/src/components/BasicSelect/styles.module.scss +0 -44
  14. package/src/components/Button/index.ts +0 -97
  15. package/src/components/Button/styles.module.scss +0 -152
  16. package/src/components/CheckboxGroup/Checkbox.ts +0 -104
  17. package/src/components/CheckboxGroup/index.ts +0 -190
  18. package/src/components/CheckboxGroup/styles.module.scss +0 -63
  19. package/src/components/CollapsedMenu/index.ts +0 -104
  20. package/src/components/CollapsedMenu/styles.module.scss +0 -46
  21. package/src/components/ConfigureFieldWrapper/index.ts +0 -85
  22. package/src/components/ConfigureFieldWrapper/styles.module.scss +0 -57
  23. package/src/components/EditableText/index.ts +0 -121
  24. package/src/components/EditableText/styles.module.scss +0 -38
  25. package/src/components/EditableTextArea/index.ts +0 -143
  26. package/src/components/EditableTextArea/styles.module.scss +0 -91
  27. package/src/components/ErrorMessage/index.ts +0 -16
  28. package/src/components/ErrorMessage/styles.module.scss +0 -19
  29. package/src/components/ErrorPage/index.ts +0 -42
  30. package/src/components/ErrorPage/styles.module.scss +0 -26
  31. package/src/components/Footer/index.ts +0 -41
  32. package/src/components/Footer/styles.module.scss +0 -40
  33. package/src/components/HTMLContent/index.tsx +0 -205
  34. package/src/components/HTMLContent/styles.module.scss +0 -3
  35. package/src/components/InfoBox/index.ts +0 -48
  36. package/src/components/InfoBox/styles.module.scss +0 -21
  37. package/src/components/Input/BaseInput/index.ts +0 -170
  38. package/src/components/Input/BaseInput/styles.module.scss +0 -95
  39. package/src/components/Input/DateInput/index.ts +0 -103
  40. package/src/components/Input/DateInput/styles.module.scss +0 -50
  41. package/src/components/Input/Input/index.ts +0 -225
  42. package/src/components/Input/Input/styles.module.scss +0 -16
  43. package/src/components/Input/PasswordInput/index.ts +0 -164
  44. package/src/components/Input/PasswordInput/styles.module.scss +0 -37
  45. package/src/components/Input/index.ts +0 -7
  46. package/src/components/Label/index.ts +0 -61
  47. package/src/components/Label/styles.module.scss +0 -41
  48. package/src/components/LargeLoader/index.ts +0 -25
  49. package/src/components/LargeLoader/styles.module.scss +0 -16
  50. package/src/components/Listbox/ListBoxItem.ts +0 -57
  51. package/src/components/Listbox/index.ts +0 -488
  52. package/src/components/Listbox/styles.module.scss +0 -197
  53. package/src/components/Loader/index.ts +0 -25
  54. package/src/components/Loader/styles.module.scss +0 -16
  55. package/src/components/MediaGallery/MediaGalleryModal.ts +0 -82
  56. package/src/components/MediaGallery/MediaSlider.ts +0 -76
  57. package/src/components/MediaGallery/index.ts +0 -92
  58. package/src/components/MediaGallery/styles.module.scss +0 -156
  59. package/src/components/MediaUpload/index.ts +0 -233
  60. package/src/components/MediaUpload/styles.module.scss +0 -118
  61. package/src/components/Modal/index.ts +0 -87
  62. package/src/components/Modal/styles.module.scss +0 -441
  63. package/src/components/MultipurposeField/Dropdown/ListBoxItem.tsx +0 -59
  64. package/src/components/MultipurposeField/Dropdown/index.tsx +0 -1202
  65. package/src/components/MultipurposeField/Dropdown/styles.module.scss +0 -215
  66. package/src/components/MultipurposeField/TagMenu/index.ts +0 -536
  67. package/src/components/MultipurposeField/TagMenu/styles.module.scss +0 -175
  68. package/src/components/MultipurposeField/TagOptions/index.tsx +0 -83
  69. package/src/components/MultipurposeField/TagOptions/styles.module.scss +0 -95
  70. package/src/components/MultipurposeField/index.tsx +0 -944
  71. package/src/components/MultipurposeField/styles.module.scss +0 -77
  72. package/src/components/NewModal/index.ts +0 -69
  73. package/src/components/NewModal/styles.module.scss +0 -70
  74. package/src/components/OverflowTooltip/index.tsx +0 -59
  75. package/src/components/PopUp/ConfirmationPopUp/index.ts +0 -58
  76. package/src/components/PopUp/ConfirmationPopUp/styles.module.scss +0 -49
  77. package/src/components/PopUp/SuccessPopUp/index.ts +0 -62
  78. package/src/components/PopUp/SuccessPopUp/styles.module.scss +0 -38
  79. package/src/components/RadioGroup/Radio.ts +0 -128
  80. package/src/components/RadioGroup/index.ts +0 -169
  81. package/src/components/RadioGroup/styles.module.scss +0 -81
  82. package/src/components/Search/index.ts +0 -69
  83. package/src/components/Search/styles.module.scss +0 -149
  84. package/src/components/TabBar/Tab.ts +0 -33
  85. package/src/components/TabBar/index.ts +0 -64
  86. package/src/components/TabBar/styles.module.scss +0 -43
  87. package/src/components/Tag/index.ts +0 -29
  88. package/src/components/Tag/styles.module.scss +0 -57
  89. package/src/components/TagsMenu/index.ts +0 -1697
  90. package/src/components/TagsMenu/styles.module.scss +0 -350
  91. package/src/components/TestComponent/index.ts +0 -71
  92. package/src/components/TestComponent/styles.module.scss +0 -152
  93. package/src/components/TextArea/index.ts +0 -172
  94. package/src/components/TextArea/styles.module.scss +0 -72
  95. package/src/components/TextContent/index.tsx +0 -128
  96. package/src/components/TextContent/styles.module.scss +0 -6
  97. package/src/components/ThreeDotLoader/index.ts +0 -39
  98. package/src/components/ThreeDotLoader/styles.module.scss +0 -41
  99. package/src/components/TimeInput/index.ts +0 -129
  100. package/src/components/TimeInput/styles.module.scss +0 -16
  101. package/src/components/Toggle/index.ts +0 -34
  102. package/src/components/Toggle/styles.module.scss +0 -56
  103. package/src/components/Toggle-v2/index.ts +0 -40
  104. package/src/components/Toggle-v2/styles.module.scss +0 -86
  105. package/src/components/Tooltip/index.ts +0 -271
  106. package/src/components/Tooltip/styles.module.scss +0 -105
  107. package/src/components/form/FunctionField/index.ts +0 -816
  108. package/src/components/form/FunctionField/styles.module.scss +0 -478
  109. package/src/components/form/ObjectField/__snapshots__/index.ts.test.tsx.snap +0 -3
  110. package/src/components/form/ObjectField/index.ts +0 -593
  111. package/src/components/form/ObjectField/index.ts.test.tsx +0 -213
  112. package/src/components/form/ObjectField/styles.module.scss +0 -103
  113. package/src/components/form/index.ts +0 -4
  114. package/src/contexts/AppContext.ts +0 -12
  115. package/src/declaration.d.ts +0 -7
  116. package/src/extensions/HMAC.ts +0 -25
  117. package/src/extensions/IntegryAPIError.ts +0 -19
  118. package/src/features/common/AccountDropdown/index.ts +0 -291
  119. package/src/features/common/AccountDropdown/styles.module.scss +0 -19
  120. package/src/features/common/ActionForm/index.ts +0 -2602
  121. package/src/features/common/ActionForm/styles.module.scss +0 -35
  122. package/src/features/common/AppCard/index.ts +0 -207
  123. package/src/features/common/AppCard/styles.module.scss +0 -117
  124. package/src/features/common/AppCardCompact/index.ts +0 -189
  125. package/src/features/common/AppCardCompact/styles.module.scss +0 -141
  126. package/src/features/common/AuthSelector/index.ts +0 -537
  127. package/src/features/common/AuthSelector/styles.module.scss +0 -161
  128. package/src/features/common/AuthSelectorCompact/index.ts +0 -706
  129. package/src/features/common/AuthSelectorCompact/styles.module.scss +0 -219
  130. package/src/features/common/AuthSelectorDropdown/index.ts +0 -704
  131. package/src/features/common/AuthSelectorDropdown/styles.module.scss +0 -361
  132. package/src/features/common/AuthSelectorV2/index.ts +0 -336
  133. package/src/features/common/AuthSelectorV2/styles.module.scss +0 -235
  134. package/src/features/common/DynamicField/index.ts +0 -402
  135. package/src/features/common/DynamicField/styles.module.scss +0 -266
  136. package/src/features/common/DynamicTypedField/index.ts +0 -504
  137. package/src/features/common/DynamicTypedField/styles.module.scss +0 -135
  138. package/src/features/common/FunctionForm/index.ts +0 -1095
  139. package/src/features/common/FunctionForm/styles.module.scss +0 -225
  140. package/src/features/common/MappingUI/index.ts +0 -649
  141. package/src/features/common/MappingUI/styles.module.scss +0 -121
  142. package/src/features/common/MarketplaceAppCard/index.ts +0 -279
  143. package/src/features/common/MarketplaceAppCard/styles.module.scss +0 -231
  144. package/src/features/common/MarketplaceAppCardCompact/index.ts +0 -283
  145. package/src/features/common/MarketplaceAppCardCompact/styles.module.scss +0 -255
  146. package/src/features/common/NewMappingUI/index.ts +0 -515
  147. package/src/features/common/NewMappingUI/styles.module.scss +0 -113
  148. package/src/features/common/RequestAppWidget/RequestAppModal/index.ts +0 -67
  149. package/src/features/common/RequestAppWidget/RequestAppModal/styles.module.scss +0 -23
  150. package/src/features/common/RequestAppWidget/index.ts +0 -48
  151. package/src/features/common/RequestAppWidget/request-app-form.ts +0 -89
  152. package/src/features/common/RequestAppWidget/styles.module.scss +0 -43
  153. package/src/features/common/SectionField/index.ts +0 -272
  154. package/src/features/common/SectionField/styles.module.scss +0 -67
  155. package/src/features/common/Step/index.ts +0 -827
  156. package/src/features/common/Step/styles.module.scss +0 -12
  157. package/src/features/common/StepNavigation/CollapsedSteps.ts +0 -131
  158. package/src/features/common/StepNavigation/NavItem.ts +0 -111
  159. package/src/features/common/StepNavigation/index.ts +0 -261
  160. package/src/features/common/StepNavigation/styles.module.scss +0 -117
  161. package/src/features/common/Steps/index.ts +0 -1140
  162. package/src/features/common/Steps/styles.module.scss +0 -314
  163. package/src/features/containers/AppFlowContainer/AppFlowListing/compactStyles.module.scss +0 -404
  164. package/src/features/containers/AppFlowContainer/AppFlowListing/flow-instance.tsx +0 -367
  165. package/src/features/containers/AppFlowContainer/AppFlowListing/flowCard.test.tsx +0 -58
  166. package/src/features/containers/AppFlowContainer/AppFlowListing/flowCard.tsx +0 -208
  167. package/src/features/containers/AppFlowContainer/AppFlowListing/flowCardCompact.test.tsx +0 -49
  168. package/src/features/containers/AppFlowContainer/AppFlowListing/flowCardCompact.tsx +0 -421
  169. package/src/features/containers/AppFlowContainer/AppFlowListing/flowInstanceCompact.tsx +0 -577
  170. package/src/features/containers/AppFlowContainer/AppFlowListing/index.tsx +0 -83
  171. package/src/features/containers/AppFlowContainer/AppFlowListing/styles.module.scss +0 -233
  172. package/src/features/containers/AppFlowContainer/AppFlowWrap/app-page-loader.tsx +0 -45
  173. package/src/features/containers/AppFlowContainer/AppFlowWrap/index.tsx +0 -1085
  174. package/src/features/containers/AppFlowContainer/AppFlowWrap/styles.module.scss +0 -465
  175. package/src/features/containers/AppFlowContainer/Authentication/index.ts +0 -610
  176. package/src/features/containers/AppFlowContainer/Authentication/styles.module.scss +0 -468
  177. package/src/features/containers/AppFlowContainer/index.ts +0 -114
  178. package/src/features/containers/AppPageContainer/AppPage/index.tsx +0 -262
  179. package/src/features/containers/AppPageContainer/AppPage/styles.module.scss +0 -120
  180. package/src/features/containers/AppPageContainer/IntegrationCard/index.ts +0 -165
  181. package/src/features/containers/AppPageContainer/IntegrationCard/styles.module.scss +0 -81
  182. package/src/features/containers/AppPageContainer/index.tsx +0 -93
  183. package/src/features/containers/AppPageContainer/styles.module.scss +0 -0
  184. package/src/features/containers/AppsForFlows/index.ts +0 -161
  185. package/src/features/containers/AppsForFlows/styles.module.scss +0 -280
  186. package/src/features/containers/AppsForFlowsCompact/index.ts +0 -161
  187. package/src/features/containers/AppsForFlowsCompact/styles.module.scss +0 -279
  188. package/src/features/containers/AuthSetupContainer/AppSelection.ts +0 -73
  189. package/src/features/containers/AuthSetupContainer/AuthTypeSelection.ts +0 -67
  190. package/src/features/containers/AuthSetupContainer/Footer.ts +0 -32
  191. package/src/features/containers/AuthSetupContainer/Header.ts +0 -39
  192. package/src/features/containers/AuthSetupContainer/PostAdditionPopup.ts +0 -27
  193. package/src/features/containers/AuthSetupContainer/index.ts +0 -349
  194. package/src/features/containers/AuthSetupContainer/styles.module.scss +0 -229
  195. package/src/features/containers/FlowSetupContainer/index.ts +0 -391
  196. package/src/features/containers/FlowSetupContainer/styles.module.scss +0 -18
  197. package/src/features/containers/MarkeplaceApps/index.ts +0 -583
  198. package/src/features/containers/MarkeplaceApps/styles.module.scss +0 -558
  199. package/src/features/containers/MarketplaceAppsCompact/index.ts +0 -585
  200. package/src/features/containers/MarketplaceAppsCompact/styles.module.scss +0 -563
  201. package/src/features/containers/MarketplaceAppsContainer/index.ts +0 -91
  202. package/src/features/containers/MarketplaceContainer/AppCard/index.ts +0 -91
  203. package/src/features/containers/MarketplaceContainer/AppCard/styles.module.scss +0 -66
  204. package/src/features/containers/MarketplaceContainer/AppListing/index.ts +0 -34
  205. package/src/features/containers/MarketplaceContainer/AppListing/styles.module.scss +0 -10
  206. package/src/features/containers/MarketplaceContainer/MarketplaceContentWrap/index.ts +0 -132
  207. package/src/features/containers/MarketplaceContainer/MarketplaceContentWrap/styles.module.scss +0 -117
  208. package/src/features/containers/MarketplaceContainer/index.ts +0 -242
  209. package/src/features/containers/MarketplaceContainer/styles.module.scss +0 -84
  210. package/src/features/containers/SDKContainer/index.ts +0 -817
  211. package/src/features/containers/SDKContainer/styles.module.scss +0 -266
  212. package/src/features/containers/SDKDebugContainer/index.ts +0 -137
  213. package/src/features/containers/SDKDebugContainer/styles.module.scss +0 -37
  214. package/src/features/containers/SDKFailedContainer/index.ts +0 -117
  215. package/src/features/containers/SDKFailedContainer/styles.module.scss +0 -57
  216. package/src/features/integrations/IntegrationRow/Icons.ts +0 -77
  217. package/src/features/integrations/IntegrationRow/index.ts +0 -129
  218. package/src/features/integrations/IntegrationRow/styles.module.scss +0 -62
  219. package/src/features/integrations/IntegrationsHeader/index.ts +0 -34
  220. package/src/features/integrations/IntegrationsHeader/styles.module.scss +0 -47
  221. package/src/features/integrations/IntegrationsList/index.ts +0 -252
  222. package/src/features/integrations/IntegrationsList/styles.module.scss +0 -67
  223. package/src/features/templates/Template/index.ts +0 -295
  224. package/src/features/templates/Template/styles.module.scss +0 -226
  225. package/src/features/templates/TemplatesView/index.ts +0 -368
  226. package/src/features/templates/TemplatesView/styles.module.scss +0 -71
  227. package/src/features/templates/TemplatesViewCompact/index.ts +0 -364
  228. package/src/features/templates/TemplatesViewCompact/styles.module.scss +0 -141
  229. package/src/hooks/useAutosizeTextArea.ts +0 -22
  230. package/src/hooks/useCustomRef.ts +0 -13
  231. package/src/hooks/useDebounce.ts +0 -17
  232. package/src/hooks/useElementResize.ts +0 -40
  233. package/src/hooks/useEventListener.ts +0 -42
  234. package/src/hooks/useHover.ts +0 -40
  235. package/src/hooks/useOnClickOutside.ts +0 -32
  236. package/src/index.ts +0 -2244
  237. package/src/index.umd.ts +0 -13
  238. package/src/interfaces/index.ts +0 -938
  239. package/src/modules/api/index.ts +0 -1325
  240. package/src/modules/api/responseHandler.ts +0 -38
  241. package/src/modules/event-emitter/index.ts +0 -72
  242. package/src/modules/event-emitter/runners/abstract.ts +0 -21
  243. package/src/modules/event-emitter/runners/default.ts +0 -11
  244. package/src/modules/event-emitter/runners/ntimes.ts +0 -28
  245. package/src/modules/event-emitter/types.ts +0 -34
  246. package/src/store/actionFunctions.ts +0 -1578
  247. package/src/store/index.ts +0 -17
  248. package/src/store/initialState.ts +0 -58
  249. package/src/types/index.ts +0 -320
  250. package/src/types/preact-compat.d.ts +0 -4
  251. package/src/types/store.ts +0 -366
  252. package/src/types/utils.ts +0 -19
  253. package/src/utils/ActivityOutputUtils.ts +0 -176
  254. package/src/utils/common.ts +0 -20
  255. package/src/utils/copyToClipboard.ts +0 -24
  256. package/src/utils/datetime.ts +0 -101
  257. package/src/utils/getUrlParam.ts +0 -11
  258. package/src/utils/isAuthMessage.ts +0 -16
  259. package/src/utils/isBrowser.ts +0 -1
  260. package/src/utils/jsonEncodeDecode.ts +0 -15
  261. package/src/utils/objectUtils.ts +0 -117
  262. package/src/utils/popup.ts +0 -30
  263. package/src/utils/searchJson.ts +0 -51
  264. package/src/utils/stepUtils.ts +0 -45
  265. package/src/utils/truncate.ts +0 -6
  266. package/test/setup.ts +0 -1
  267. package/vitest.config.ts +0 -16
@@ -1,170 +0,0 @@
1
- import { html, Component } from 'htm/preact';
2
- import { forwardRef } from 'preact/compat';
3
- import { TagButton } from '@/components/AddTagButton';
4
- import HTMLContent from '@/components/HTMLContent';
5
- import { useState } from 'preact/hooks';
6
-
7
- import styles from './styles.module.scss';
8
-
9
- interface BaseInputProps extends Partial<HTMLInputElement> {
10
- placeholder: string;
11
- value: string;
12
- control?: Component;
13
- handleChange?: (id: string) => void;
14
- handleBlur?: () => void;
15
- handleFocus?: () => void;
16
- isReadOnly?: boolean;
17
- className?: string;
18
- onAddTag?: () => void;
19
- fieldId?: string;
20
- showDeleteIcon?: boolean;
21
- handleDeleteIconClick?: () => void;
22
- isButtonEnabled?: boolean;
23
- buttonText?: string;
24
- onButtonClickScript?: string;
25
- buttonScriptRequiresAuthToken?: boolean;
26
- apiHandler?: any;
27
- }
28
-
29
- /**
30
- * BaseInput component
31
- *
32
- */
33
- const BaseInput = forwardRef((props: BaseInputProps, ref) => {
34
- const {
35
- placeholder,
36
- value,
37
- type = 'text',
38
- control,
39
- handleChange = () => null,
40
- handleBlur = () => null,
41
- handleFocus = () => null,
42
- isReadOnly = false,
43
- className = '',
44
- onAddTag,
45
- fieldId = '',
46
- id = '',
47
- showDeleteIcon = false,
48
- handleDeleteIconClick,
49
- isButtonEnabled = false,
50
- buttonText = '',
51
- onButtonClickScript = '',
52
- buttonScriptRequiresAuthToken = false,
53
- apiHandler,
54
- } = props;
55
-
56
- const [isActionClicked, setIsActionClicked] = useState(false);
57
-
58
- const handleInputChange = (e: MouseEvent) => {
59
- if (!isReadOnly && e.currentTarget instanceof HTMLInputElement) {
60
- const { value: newValue } = e.currentTarget;
61
- handleChange(newValue);
62
- }
63
- };
64
-
65
- const handleDateChange = (e: InputEvent) => {
66
- if (
67
- !isReadOnly &&
68
- e.currentTarget instanceof HTMLInputElement &&
69
- e.currentTarget.type === 'date'
70
- ) {
71
- const { value: newValue } = e.currentTarget;
72
- handleChange(newValue);
73
- }
74
- };
75
-
76
- const handleActionReturned = (val: string) => {
77
- if (handleChange) {
78
- handleChange(val);
79
- }
80
- setIsActionClicked(false);
81
- };
82
-
83
- const handleActionCancelled = () => {
84
- setIsActionClicked(false);
85
- };
86
-
87
- return html`
88
- <div
89
- class=${`${styles.inputWrapper} ${className ? styles[className] : ''} ${
90
- showDeleteIcon ? styles.withDeleteIcon : ''
91
- }`}
92
- id=${fieldId}
93
- style="position: relative;"
94
- >
95
- <input
96
- type=${type}
97
- placeholder=${placeholder}
98
- value=${value}
99
- onkeyup=${handleInputChange}
100
- onchange=${handleDateChange}
101
- onblur=${handleBlur}
102
- onfocus=${handleFocus}
103
- readonly=${isReadOnly}
104
- ref=${ref}
105
- id=${id}
106
- class=${`${isReadOnly ? styles.readonly : ''} ${
107
- styles[className || '']
108
- }`}
109
- />
110
- ${isButtonEnabled &&
111
- html`
112
- <a
113
- href="#"
114
- class=${styles.inputButtonLink}
115
- onClick=${(e: MouseEvent) => {
116
- e.preventDefault();
117
- setIsActionClicked(true);
118
- }}
119
- >
120
- ${buttonText}
121
- </a>
122
- `}
123
- ${showDeleteIcon &&
124
- html`
125
- <button
126
- class="${styles.removeButton}"
127
- onClick=${() => {
128
- if (handleDeleteIconClick) {
129
- handleDeleteIconClick();
130
- }
131
- }}
132
- tabindex="-1"
133
- >
134
- <svg
135
- width="15"
136
- height="15"
137
- viewBox="0 0 15 15"
138
- fill="none"
139
- xmlns="http://www.w3.org/2000/svg"
140
- >
141
- <path d="M1.5 4.1999H13.65" stroke="#999999" />
142
- <path
143
- d="M11.6254 5.5498V6.2248L10.9504 13.6498H4.20039L3.52539 6.2248V5.5498"
144
- stroke="#999999"
145
- stroke-linejoin="round"
146
- />
147
- <path
148
- d="M5.55078 3.525V2.175C5.55078 1.80221 5.85299 1.5 6.22578 1.5H8.92578C9.29857 1.5 9.60078 1.80221 9.60078 2.175V3.525"
149
- stroke="#999999"
150
- />
151
- </svg>
152
- </button>
153
- `}
154
- ${onAddTag && html` <${TagButton} onClick=${onAddTag} /> `}
155
- ${control && html`<${control} //>`}
156
- </div>
157
- ${isButtonEnabled &&
158
- isActionClicked &&
159
- html`<${HTMLContent}
160
- htmlContent=${onButtonClickScript}
161
- isAction=${true}
162
- handleChange=${handleActionReturned}
163
- handleCancel=${handleActionCancelled}
164
- requiresAuthToken=${buttonScriptRequiresAuthToken}
165
- apiHandler=${apiHandler}
166
- />`}
167
- `;
168
- });
169
-
170
- export { BaseInput, BaseInputProps };
@@ -1,95 +0,0 @@
1
- .inputWrapper {
2
- position: relative;
3
- width: 100%;
4
- margin-top: 8px;
5
- input {
6
- width: 100%;
7
- color: #333;
8
- display: block;
9
- box-sizing: border-box;
10
- appearance: none;
11
- padding: 12px 12px;
12
- border-radius: 4px;
13
- border: 1px solid #e2e0db;
14
- font-size: 14px;
15
- outline: none;
16
- height: 40px;
17
- font-family: Inter;
18
- font-size: 12px;
19
- font-style: normal;
20
- font-weight: 400;
21
- line-height: 20px; /* 166.667% */
22
-
23
- &:focus {
24
- outline: none;
25
- }
26
- &::placeholder {
27
- color: var(--black-and-grey-draft-and-tooltip-desc, #999);
28
- font-family: Inter;
29
- font-size: 12px;
30
- font-style: normal;
31
- font-weight: 400;
32
- line-height: 20px; /* 166.667% */
33
- }
34
- &.readonly {
35
- cursor: auto !important;
36
- }
37
- }
38
- &.request-app-form-field {
39
- margin-top: 6px;
40
- input {
41
- border: 1px solid #ada9bb;
42
- border-radius: 5px;
43
- height: 37px;
44
- font-style: normal;
45
- font-weight: 400;
46
- font-size: 14px;
47
- line-height: 20px;
48
- color: #333333;
49
- font-family: inherit;
50
- &::placeholder {
51
- line-height: 17px;
52
- color: #8c8c8c;
53
- }
54
- }
55
- }
56
- .removeButton {
57
- background: none;
58
- border: none;
59
- color: #999999; /* Red color */
60
- cursor: pointer;
61
- font-size: 18px; /* Size of the delete icon */
62
- padding: 0;
63
- display: flex;
64
- justify-content: center;
65
- align-items: center;
66
- margin-right: 10px;
67
- }
68
-
69
- .removeButton:hover {
70
- color: #999999; /* Darker red on hover */
71
- }
72
- .inputButtonLink {
73
- position: absolute;
74
- right: 15px;
75
- top: 50%;
76
- transform: translateY(-50%);
77
- font-size: 12px;
78
- text-decoration: none;
79
- color: #007bff; /* Adjust to match your theme */
80
- cursor: pointer;
81
- }
82
- }
83
- .withDeleteIcon {
84
- border: 1px solid #e2e0db;
85
- border-radius: 4px;
86
- display: flex;
87
- width: 100%;
88
- box-sizing: border-box;
89
- input {
90
- border: none;
91
- }
92
- tags {
93
- border: none;
94
- }
95
- }
@@ -1,103 +0,0 @@
1
- import { html } from 'htm/preact';
2
- import { ErrorMessage } from '@/components/ErrorMessage';
3
- import { Label } from '@/components/Label';
4
- import { Hint } from '@/components/Tooltip';
5
- import { BaseInput } from '../BaseInput';
6
-
7
- import styles from './styles.module.scss';
8
-
9
- interface DateInputProps {
10
- title: string;
11
- description: string;
12
- placeholder: string;
13
- showStepValidation?: boolean;
14
- isRequired?: boolean;
15
- value?: string;
16
- onChange?: (val: string) => void;
17
- isReadOnly?: boolean;
18
- isChanged?: boolean;
19
- }
20
-
21
- /**
22
- * DateInput component
23
- *
24
- */
25
- const DateInput = (props: DateInputProps) => {
26
- const {
27
- title,
28
- description,
29
- placeholder,
30
- value,
31
- showStepValidation = false,
32
- isRequired = false,
33
- onChange = () => null,
34
- isReadOnly = false,
35
- isChanged = false,
36
- } = props;
37
-
38
- return html`
39
- <${Hint} dismissOnClick=${false} position="top" deltaY=${0}>
40
- <div class="${styles.dateGroupWrapper}">
41
- <fieldset>
42
- <${Label} title=${title} description=${description}
43
- isRequired=${isRequired} labelTag=${isReadOnly && isChanged ? 'Changed' : ''} //>
44
- ${isReadOnly && html `<span class=${styles.readonlyHint} data-hint=${isReadOnly ? `Cannot modify user selection` : ''}></span>`}
45
- <${BaseInput}
46
- type="date"
47
- placeholder=${placeholder}
48
- handleChange=${onChange}
49
- value=${value}
50
- control=${() => html` <div
51
- role="button"
52
- class=${`${styles.visibilityToggle} ${isReadOnly ? styles.readonly : ''}`}
53
- onclick=${() => {
54
- if (!isReadOnly && value) onChange('');
55
- }}
56
- >
57
- ${!value || isReadOnly
58
- ? html`
59
- <svg
60
- width="25"
61
- height="26"
62
- viewBox="0 0 25 26"
63
- fill="none"
64
- xmlns="http://www.w3.org/2000/svg"
65
- >
66
- <path
67
- fill-rule="evenodd"
68
- clip-rule="evenodd"
69
- d="M16.9543 5.5464H19.335L19.3349 5.54639C20.6491 5.54639 21.7156 6.61204 21.7156 7.92812L21.7147 19.8323C21.7147 21.1466 20.6482 22.2131 19.334 22.2131H5.04866C3.73449 22.2131 2.66797 21.1466 2.66797 19.8323V7.92719C2.66797 6.61296 3.73444 5.54639 5.04866 5.54639L7.42936 5.5473V4.35641C7.42936 3.69791 7.96262 3.16553 8.62019 3.16553C9.27777 3.16553 9.81102 3.69791 9.81102 4.35641V5.5464L14.5717 5.5473V4.35641C14.5717 3.69791 15.105 3.16553 15.7626 3.16553C16.4201 3.16553 16.9534 3.69791 16.9534 4.35641L16.9543 5.5464ZM4.04688 20.8324H20.3369L20.3358 8.7124H4.04688V20.8324Z"
70
- fill="#999999"
71
- />
72
- </svg>
73
- `
74
- : html`
75
- <svg
76
- width="18"
77
- height="18"
78
- viewBox="0 0 18 18"
79
- fill="none"
80
- xmlns="http://www.w3.org/2000/svg"
81
- >
82
- <path
83
- fill-rule="evenodd"
84
- clip-rule="evenodd"
85
- d="M9 0C13.9673 0 18 4.03275 18 9C18 13.9673 13.9673 18 9 18C4.03275 18 0 13.9673 0 9C0 4.03275 4.03275 0 9 0ZM9 0.75C13.5533 0.75 17.25 4.44675 17.25 9C17.25 13.5533 13.5533 17.25 9 17.25C4.44675 17.25 0.75 13.5533 0.75 9C0.75 4.44675 4.44675 0.75 9 0.75ZM9 8.46975L12.9697 4.5L13.5 5.03025L9.53025 9L13.5 12.9697L12.9697 13.5L9 9.53025L5.03025 13.5L4.5 12.9697L8.46975 9L4.5 5.03025L5.03025 4.5L9 8.46975Z"
86
- fill="black"
87
- />
88
- </svg>
89
- `}
90
- </div>`}
91
- isReadOnly=${isReadOnly}
92
- ><//>
93
- </fieldset>
94
- ${showStepValidation &&
95
- isRequired &&
96
- !value &&
97
- html`<${ErrorMessage}>Please enter a date<//>`}
98
- </div>
99
- <//>
100
- `;
101
- };
102
-
103
- export { DateInput, DateInputProps };
@@ -1,50 +0,0 @@
1
- .dateGroupWrapper {
2
- fieldset {
3
- border: none;
4
- padding: 0;
5
- margin: 0;
6
- }
7
-
8
- input[type='date'] {
9
- position: relative;
10
- cursor: pointer;
11
- }
12
-
13
- input[type='date']::-webkit-calendar-picker-indicator {
14
- position: absolute;
15
- top: 0;
16
- right: 0;
17
- width: 100%;
18
- height: 100%;
19
- padding: 0;
20
- color: transparent;
21
- background: transparent;
22
- }
23
- .visibilityToggle {
24
- display: flex;
25
- align-items: center;
26
- position: absolute;
27
- top: 0;
28
- right: 10px;
29
- bottom: 0;
30
- margin: 0 auto;
31
- svg {
32
- cursor: pointer;
33
- width: 20px;
34
- &:hover {
35
- opacity: 0.5;
36
- }
37
- }
38
- &.readonly {
39
- svg {
40
- cursor: auto;
41
- }
42
- }
43
- }
44
- .readonlyHint {
45
- width: 100%;
46
- height: -webkit-fill-available;
47
- z-index: 99;
48
- position: absolute;
49
- }
50
- }
@@ -1,225 +0,0 @@
1
- import { html } from 'htm/preact';
2
- import { useEffect, useState } from 'preact/hooks';
3
- import { forwardRef } from 'preact/compat';
4
- import { ErrorMessage } from '@/components/ErrorMessage';
5
- import { Label } from '@/components/Label';
6
- import { Hint } from '@/components/Tooltip';
7
-
8
- import { BaseInput } from '../BaseInput';
9
- import styles from './styles.module.scss';
10
-
11
- interface InputProps {
12
- id: string;
13
- title: string;
14
- description: string;
15
- placeholder: string;
16
- value?: string;
17
- regex: string | null;
18
- regexErrorMessage: string | null;
19
- isRequired?: boolean;
20
- showStepValidation?: boolean;
21
- onChange?: (
22
- val: string | string[],
23
- passesRegexTest?: boolean,
24
- index?: number,
25
- ) => void;
26
- isReadOnly?: boolean;
27
- isChanged?: boolean;
28
- className?: string;
29
- handleFocus?: () => void;
30
- handleBlur?: () => void;
31
- ref?: any;
32
- fieldId: string;
33
- hideError?: boolean;
34
- isArray?: boolean; // New prop to check if the input is an array
35
- isButtonEnabled?: boolean;
36
- buttonText?: string;
37
- onButtonClickScript?: string;
38
- buttonScriptRequiresAuthToken?: boolean;
39
- apiHandler?: any;
40
- showLabel?: boolean;
41
- forceShowDeleteIcon?: boolean;
42
- handleRemoveInputFromParent?: (index: number) => void;
43
- }
44
-
45
- /**
46
- * Input component for handling both single and array inputs
47
- */
48
- const Input = forwardRef((props: InputProps, ref) => {
49
- const {
50
- id,
51
- title,
52
- description,
53
- placeholder,
54
- value,
55
- regex,
56
- regexErrorMessage,
57
- showStepValidation = false,
58
- isRequired = false,
59
- onChange = () => null,
60
- handleFocus = () => null,
61
- handleBlur = () => null,
62
- isReadOnly = false,
63
- isChanged = false,
64
- className = '',
65
- fieldId = `input-field`,
66
- hideError = false,
67
- isArray = false, // Default to false
68
- isButtonEnabled = false,
69
- buttonText = 'Add',
70
- onButtonClickScript = '',
71
- buttonScriptRequiresAuthToken = false,
72
- apiHandler,
73
- showLabel = true,
74
- forceShowDeleteIcon = false,
75
- handleRemoveInputFromParent,
76
- } = props;
77
-
78
- let parsedValue = [''];
79
- if (value) {
80
- if (typeof value === 'string' || typeof value === 'number') {
81
- if (isArray) {
82
- try {
83
- parsedValue = JSON.parse(value);
84
- if (Array.isArray(parsedValue) && parsedValue.length === 0) {
85
- parsedValue = [''];
86
- }
87
- } catch (e) {
88
- parsedValue = [value];
89
- }
90
- } else {
91
- parsedValue = [value];
92
- }
93
- } else {
94
- parsedValue = value;
95
- }
96
- }
97
- const [values, setValues] = useState(parsedValue); // Track array of values
98
- const [invalidInput, setInvalidInput] = useState(false);
99
- const [showErrorOnFocusLoss, setShowErrorOnFocusLoss] = useState(true);
100
-
101
- // validate on first render
102
- useEffect(() => {
103
- if (regex && values[values.length - 1] !== '') {
104
- const invalid = !new RegExp(regex.replace(/^\/|\/$/g, '')).test(
105
- `${values[values.length - 1]}`,
106
- );
107
- setInvalidInput(invalid);
108
- }
109
- }, [regex, values]);
110
-
111
- const handleAddInput = () => {
112
- setValues((prevValues) => {
113
- const newValues = [...prevValues, ''];
114
- onChange(newValues);
115
- return newValues;
116
- });
117
- };
118
-
119
- const handleChange = (inputValue: string, index: number) => {
120
- let isValidInput = true;
121
- if (
122
- regex &&
123
- inputValue !== '' &&
124
- !new RegExp(regex.replace(/^\/|\/$/g, '')).test(inputValue)
125
- ) {
126
- isValidInput = false;
127
- setInvalidInput(true);
128
- } else {
129
- setInvalidInput(false);
130
- const newValues = [...values];
131
- newValues[index] = inputValue;
132
- setValues(newValues);
133
- if (isArray) {
134
- onChange(newValues, false, index);
135
- } else {
136
- onChange(newValues[0]);
137
- }
138
- }
139
-
140
- if (
141
- isArray &&
142
- index === values.length - 1 &&
143
- inputValue !== '' &&
144
- isValidInput
145
- ) {
146
- handleAddInput();
147
- }
148
- };
149
-
150
- const handleRemoveInput = (index: number) => {
151
- if (forceShowDeleteIcon && handleRemoveInputFromParent) {
152
- handleRemoveInputFromParent(index);
153
- return;
154
- }
155
- setValues((prevValues) => {
156
- const newValues = prevValues.filter((_, i) => i !== index);
157
- onChange(newValues);
158
- return newValues;
159
- });
160
- };
161
-
162
- const validate = () => {
163
- if (handleBlur) handleBlur();
164
- setShowErrorOnFocusLoss(true);
165
- };
166
-
167
- return html`
168
- <${Hint} dismissOnClick=${false} position="top" deltaY=${0}>
169
- <div
170
- class="${styles.inputGroupWrapper} ${styles[
171
- className || ''
172
- ]} integry-container__input"
173
- >
174
- <fieldset>
175
- ${showLabel
176
- ? html`<${Label} title=${title} description=${description}
177
- isRequired=${isRequired}
178
- labelTag=${isReadOnly && isChanged ? 'Changed' : ''} //>`
179
- : html``}
180
- ${isReadOnly &&
181
- html`<span
182
- class=${styles.readonlyHint}
183
- data-hint=${isReadOnly ? `` : ''}
184
- ></span>`}
185
- ${values.map((inputValue, index) => {
186
- const inputId = isArray ? `${id}-${index}` : id;
187
- return html`
188
- <div key=${index} class="${styles.inputWrapper}">
189
- <${BaseInput}
190
- type="text"
191
- placeholder=${placeholder}
192
- handleChange=${(valueReceived: string) =>
193
- handleChange(valueReceived, index)}
194
- handleBlur=${validate}
195
- handleFocus=${handleFocus}
196
- value=${isArray ? inputValue : value}
197
- isReadOnly=${isReadOnly}
198
- className="${className}"
199
- ref=${ref}
200
- fieldId=${fieldId}
201
- id="${inputId}"
202
- showDeleteIcon=${forceShowDeleteIcon ||
203
- (values.length > 1 && index !== values.length - 1)}
204
- handleDeleteIconClick=${() => handleRemoveInput(index)}
205
- isButtonEnabled=${isButtonEnabled}
206
- buttonText=${buttonText}
207
- onButtonClickScript=${onButtonClickScript}
208
- buttonScriptRequiresAuthToken=${buttonScriptRequiresAuthToken}
209
- apiHandler=${apiHandler}
210
- />
211
- </div>
212
- `;
213
- })}
214
- ${!hideError &&
215
- (showStepValidation || showErrorOnFocusLoss || value) &&
216
- invalidInput &&
217
- value &&
218
- html`<${ErrorMessage}>${regexErrorMessage || 'Invalid input'}<//>`}
219
- </fieldset>
220
- </div>
221
- <//>
222
- `;
223
- });
224
-
225
- export { Input, InputProps };
@@ -1,16 +0,0 @@
1
- .inputGroupWrapper {
2
- fieldset {
3
- padding: 0;
4
- margin: 0;
5
- border: none;
6
- margin-bottom: 24px;
7
- }
8
- .readonlyHint {
9
- width: 100%;
10
- height: -webkit-fill-available;
11
- z-index: 99;
12
- position: absolute;
13
- background-color: #eee;
14
- opacity: 0.5;
15
- }
16
- }