@wavemaker/react-runtime 11.14.1-16.6404

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 (402) hide show
  1. package/actions/base-action.js +32 -0
  2. package/actions/login-action.js +53 -0
  3. package/actions/logout-action.js +41 -0
  4. package/actions/navigation-action.js +145 -0
  5. package/actions/notification-action.js +147 -0
  6. package/actions/timer-action.js +164 -0
  7. package/actions/toast-provider.js +111 -0
  8. package/actions/toast.js +115 -0
  9. package/actions/toast.service.js +94 -0
  10. package/actions/types/index.js +11 -0
  11. package/components/advanced/carousel/index.js +456 -0
  12. package/components/advanced/carousel/props.js +5 -0
  13. package/components/advanced/carousel/template.js +72 -0
  14. package/components/advanced/login/index.js +307 -0
  15. package/components/advanced/login/props.js +5 -0
  16. package/components/advanced/marquee/index.js +158 -0
  17. package/components/advanced/marquee/props.js +5 -0
  18. package/components/basic/anchor/index.js +239 -0
  19. package/components/basic/anchor/props.js +5 -0
  20. package/components/basic/audio/index.js +61 -0
  21. package/components/basic/html/index.js +158 -0
  22. package/components/basic/icon/index.js +85 -0
  23. package/components/basic/iframe/iframe.utils.js +10 -0
  24. package/components/basic/iframe/index.js +95 -0
  25. package/components/basic/label/index.js +139 -0
  26. package/components/basic/message/index.js +120 -0
  27. package/components/basic/message/props.js +5 -0
  28. package/components/basic/picture/index.js +117 -0
  29. package/components/basic/picture/props.js +5 -0
  30. package/components/basic/progress-bar/index.js +168 -0
  31. package/components/basic/progress-bar/props.js +18 -0
  32. package/components/basic/progress-circle/index.js +196 -0
  33. package/components/basic/progress-circle/props.js +16 -0
  34. package/components/basic/richtexteditor/index.js +533 -0
  35. package/components/basic/richtexteditor/props.js +5 -0
  36. package/components/basic/search/index.js +1023 -0
  37. package/components/basic/search/props.js +5 -0
  38. package/components/basic/search/providers.js +350 -0
  39. package/components/basic/spinner/index.js +202 -0
  40. package/components/basic/spinner/props.js +12 -0
  41. package/components/basic/tile/index.js +91 -0
  42. package/components/basic/tree/Components/TreeNodeComponent.js +142 -0
  43. package/components/basic/tree/index.js +503 -0
  44. package/components/basic/tree/props.js +5 -0
  45. package/components/basic/tree/utils.js +154 -0
  46. package/components/basic/video/index.js +85 -0
  47. package/components/basic/video/props.js +5 -0
  48. package/components/chart/components/barColumnChart/index.js +132 -0
  49. package/components/chart/components/barColumnChart/props.js +5 -0
  50. package/components/chart/components/bubbleChart/index.js +176 -0
  51. package/components/chart/components/bubbleChart/props.js +5 -0
  52. package/components/chart/components/chartLegend/components/ClassicLegendItem.js +39 -0
  53. package/components/chart/components/chartLegend/components/FuriousLegendItem.js +81 -0
  54. package/components/chart/components/chartLegend/index.js +69 -0
  55. package/components/chart/components/chartLegend/props.js +5 -0
  56. package/components/chart/components/chartLegend/utils.js +31 -0
  57. package/components/chart/components/chartTooltip/index.js +53 -0
  58. package/components/chart/components/chartTooltip/styles.js +37 -0
  59. package/components/chart/components/chartTooltip/utils.js +23 -0
  60. package/components/chart/components/cumulativeLineChart/index.js +113 -0
  61. package/components/chart/components/cumulativeLineChart/props.js +5 -0
  62. package/components/chart/components/cumulativeLineChart/utils.js +34 -0
  63. package/components/chart/components/index.js +40 -0
  64. package/components/chart/components/lineAreaChart/index.js +140 -0
  65. package/components/chart/components/lineAreaChart/props.js +5 -0
  66. package/components/chart/components/noDataMessage/index.js +27 -0
  67. package/components/chart/components/pieDonutChart/index.js +171 -0
  68. package/components/chart/components/pieDonutChart/props.js +5 -0
  69. package/components/chart/constant.js +72 -0
  70. package/components/chart/index.js +930 -0
  71. package/components/chart/props.js +5 -0
  72. package/components/chart/utils.js +691 -0
  73. package/components/common/AppSpinner.js +36 -0
  74. package/components/common/app-spinner.js +26 -0
  75. package/components/common/index.js +12 -0
  76. package/components/constants.js +1208 -0
  77. package/components/container/accordion/accordion-pane/index.js +108 -0
  78. package/components/container/accordion/accordion-pane/props.js +11 -0
  79. package/components/container/accordion/index.js +232 -0
  80. package/components/container/accordion/props.js +13 -0
  81. package/components/container/alignment-utils.js +183 -0
  82. package/components/container/index.js +188 -0
  83. package/components/container/layout-grid/grid-column/index.js +34 -0
  84. package/components/container/layout-grid/grid-row/index.js +24 -0
  85. package/components/container/layout-grid/index.js +33 -0
  86. package/components/container/linear-layout/index.js +72 -0
  87. package/components/container/linear-layout/linear-layout-item/index.js +43 -0
  88. package/components/container/panel/components/panel-header/index.js +144 -0
  89. package/components/container/panel/components/panel-header/props.js +5 -0
  90. package/components/container/panel/hooks.js +144 -0
  91. package/components/container/panel/index.js +286 -0
  92. package/components/container/panel/props.js +5 -0
  93. package/components/container/props.js +5 -0
  94. package/components/container/tabs/index.js +379 -0
  95. package/components/container/tabs/props.js +20 -0
  96. package/components/container/tabs/tab-pane/index.js +42 -0
  97. package/components/container/tabs/tab-pane/props.js +5 -0
  98. package/components/container/wizard/WizardContext.js +16 -0
  99. package/components/container/wizard/components/StepComponents.js +100 -0
  100. package/components/container/wizard/components/WizardStep.js +89 -0
  101. package/components/container/wizard/index.js +710 -0
  102. package/components/container/wizard/props.js +5 -0
  103. package/components/container/wizard/utils.js +133 -0
  104. package/components/container/wizard/wizard-action/index.js +22 -0
  105. package/components/container/wizard/wizard-step/index.js +94 -0
  106. package/components/data/card/card-actions/index.js +24 -0
  107. package/components/data/card/card-content/index.js +38 -0
  108. package/components/data/card/card-footer/index.js +24 -0
  109. package/components/data/card/index.js +246 -0
  110. package/components/data/card/props.js +5 -0
  111. package/components/data/form/base-form/constant.js +39 -0
  112. package/components/data/form/base-form/index.js +460 -0
  113. package/components/data/form/base-form/props.js +29 -0
  114. package/components/data/form/base-form/utils.js +42 -0
  115. package/components/data/form/dynamic-fields/index.js +196 -0
  116. package/components/data/form/dynamic-fields/props.js +5 -0
  117. package/components/data/form/dynamic-fields/utils.js +237 -0
  118. package/components/data/form/form-action/index.js +71 -0
  119. package/components/data/form/form-body/index.js +26 -0
  120. package/components/data/form/form-context.js +34 -0
  121. package/components/data/form/form-controller/props.js +19 -0
  122. package/components/data/form/form-controller/validation-contrustor.js +313 -0
  123. package/components/data/form/form-controller/withFormController.js +320 -0
  124. package/components/data/form/form-field/base-field.js +138 -0
  125. package/components/data/form/form-field/index.js +36 -0
  126. package/components/data/form/form-field/props.js +5 -0
  127. package/components/data/form/form-footer/index.js +26 -0
  128. package/components/data/form/form-header/index.js +56 -0
  129. package/components/data/form/index.js +39 -0
  130. package/components/data/form/props.js +5 -0
  131. package/components/data/list/components/GroupHeader.js +35 -0
  132. package/components/data/list/components/GroupedListItems.js +98 -0
  133. package/components/data/list/components/ListContainer.js +27 -0
  134. package/components/data/list/components/ListDND.js +241 -0
  135. package/components/data/list/components/ListHeader.js +59 -0
  136. package/components/data/list/components/ListItem.js +148 -0
  137. package/components/data/list/components/ListItemWithTemplate.js +59 -0
  138. package/components/data/list/components/ListItems.js +231 -0
  139. package/components/data/list/components/ListPagination.js +165 -0
  140. package/components/data/list/components/LoadMoreButton.js +39 -0
  141. package/components/data/list/components/NoDataMessage.js +22 -0
  142. package/components/data/list/components/StandardListItems.js +84 -0
  143. package/components/data/list/components/index.js +119 -0
  144. package/components/data/list/components/props.js +5 -0
  145. package/components/data/list/hooks/index.js +75 -0
  146. package/components/data/list/hooks/props.js +5 -0
  147. package/components/data/list/hooks/useCurrentPageItems.js +48 -0
  148. package/components/data/list/hooks/useGroupedData.js +37 -0
  149. package/components/data/list/hooks/useListData.js +60 -0
  150. package/components/data/list/hooks/useListEffects.js +285 -0
  151. package/components/data/list/hooks/useListEventHandlers.js +291 -0
  152. package/components/data/list/hooks/useListPagination.js +168 -0
  153. package/components/data/list/hooks/useListState.js +98 -0
  154. package/components/data/list/hooks/useListStateManager.js +195 -0
  155. package/components/data/list/hooks/usePaginatedGroupedData.js +121 -0
  156. package/components/data/list/index.js +611 -0
  157. package/components/data/list/props.js +5 -0
  158. package/components/data/list/templates/media-template.js +53 -0
  159. package/components/data/list/utils/constants.js +81 -0
  160. package/components/data/list/utils/list-helpers.js +173 -0
  161. package/components/data/list/utils/list-widget-methods.js +114 -0
  162. package/components/data/live-filter/index.js +279 -0
  163. package/components/data/live-filter/props.js +12 -0
  164. package/components/data/live-form/index.js +93 -0
  165. package/components/data/live-form/props.js +16 -0
  166. package/components/data/pagination/components/BasicPagination.js +77 -0
  167. package/components/data/pagination/components/ClassicPagination.js +191 -0
  168. package/components/data/pagination/components/InlinePagination.js +99 -0
  169. package/components/data/pagination/components/LoadingComponent.js +31 -0
  170. package/components/data/pagination/components/PageSizeSelector.js +175 -0
  171. package/components/data/pagination/components/PagerNavigation.js +105 -0
  172. package/components/data/pagination/components/TotalRecords.js +52 -0
  173. package/components/data/pagination/components/index.js +47 -0
  174. package/components/data/pagination/components/props.js +5 -0
  175. package/components/data/pagination/hooks/index.js +19 -0
  176. package/components/data/pagination/hooks/props.js +5 -0
  177. package/components/data/pagination/hooks/useNavigationSize.js +44 -0
  178. package/components/data/pagination/hooks/usePagination.js +796 -0
  179. package/components/data/pagination/index.js +322 -0
  180. package/components/data/table/components/AddNewRow.js +190 -0
  181. package/components/data/table/components/EditableCell.js +91 -0
  182. package/components/data/table/components/FieldValidationError.js +24 -0
  183. package/components/data/table/components/RowExpansionButton.js +74 -0
  184. package/components/data/table/components/TableBody.js +279 -0
  185. package/components/data/table/components/TableFilters.js +325 -0
  186. package/components/data/table/components/TableFooterActions.js +48 -0
  187. package/components/data/table/components/TableHeader.js +174 -0
  188. package/components/data/table/components/TablePanelHeading.js +68 -0
  189. package/components/data/table/components/index.js +74 -0
  190. package/components/data/table/hooks/index.js +219 -0
  191. package/components/data/table/hooks/useCellState.js +117 -0
  192. package/components/data/table/hooks/useDynamicColumns.js +85 -0
  193. package/components/data/table/hooks/useEditingState.js +47 -0
  194. package/components/data/table/hooks/useFormWidget.js +184 -0
  195. package/components/data/table/hooks/usePaginationState.js +60 -0
  196. package/components/data/table/hooks/usePanelStructure.js +40 -0
  197. package/components/data/table/hooks/useResponsiveColumns.js +34 -0
  198. package/components/data/table/hooks/useRowExpansion.js +110 -0
  199. package/components/data/table/hooks/useRowHandlers.js +38 -0
  200. package/components/data/table/hooks/useRowSelection.js +213 -0
  201. package/components/data/table/hooks/useServerSideSorting.js +165 -0
  202. package/components/data/table/hooks/useTableColumns.js +263 -0
  203. package/components/data/table/hooks/useTableData.js +154 -0
  204. package/components/data/table/hooks/useTableEdit.js +467 -0
  205. package/components/data/table/hooks/useTableEffects.js +139 -0
  206. package/components/data/table/hooks/useTableFilter.js +389 -0
  207. package/components/data/table/hooks/useTableInitialization.js +103 -0
  208. package/components/data/table/hooks/useTableState.js +69 -0
  209. package/components/data/table/hooks/useTableStateManager.js +558 -0
  210. package/components/data/table/index.js +1295 -0
  211. package/components/data/table/live-table/index.js +232 -0
  212. package/components/data/table/props.js +5 -0
  213. package/components/data/table/table-action/index.js +78 -0
  214. package/components/data/table/table-column/index.js +35 -0
  215. package/components/data/table/table-row/index.js +49 -0
  216. package/components/data/table/table-row-action/index.js +74 -0
  217. package/components/data/table/utils/buildSelectionColumns.js +173 -0
  218. package/components/data/table/utils/columnBuilder.js +209 -0
  219. package/components/data/table/utils/columnProxy.js +48 -0
  220. package/components/data/table/utils/columnWidthDistribution.js +98 -0
  221. package/components/data/table/utils/constants.js +80 -0
  222. package/components/data/table/utils/crud-handlers.js +518 -0
  223. package/components/data/table/utils/dynamic-columns.js +118 -0
  224. package/components/data/table/utils/index.js +607 -0
  225. package/components/data/table/utils/renderDisplayCell.js +183 -0
  226. package/components/data/table/utils/selectionUtils.js +166 -0
  227. package/components/data/table/utils/table-helpers.js +100 -0
  228. package/components/data/table/utils/validation.js +124 -0
  229. package/components/data/types.js +113 -0
  230. package/components/data/utils/field-data-utils.js +66 -0
  231. package/components/data/utils/filter-field-util.js +81 -0
  232. package/components/data/utils/index.js +216 -0
  233. package/components/dialogs/alert-dialog/index.js +80 -0
  234. package/components/dialogs/confirm-dialog/index.js +105 -0
  235. package/components/dialogs/dialog/index.js +56 -0
  236. package/components/dialogs/dialog-actions/index.js +18 -0
  237. package/components/dialogs/dialog-body/index.js +21 -0
  238. package/components/dialogs/dialog-content/index.js +30 -0
  239. package/components/dialogs/dialog-header/index.js +93 -0
  240. package/components/dialogs/iframe-dialog/index.js +114 -0
  241. package/components/dialogs/index.js +129 -0
  242. package/components/dialogs/login-dialog/index.js +369 -0
  243. package/components/dialogs/login-dialog/props.js +5 -0
  244. package/components/dialogs/page-dialog/index.js +96 -0
  245. package/components/dialogs/withDialogWrapper.js +108 -0
  246. package/components/form/button/index.js +216 -0
  247. package/components/form/button-group/index.js +60 -0
  248. package/components/input/calendar/index.js +546 -0
  249. package/components/input/calendar/props.js +5 -0
  250. package/components/input/calendar/utils.js +340 -0
  251. package/components/input/chips/SortableChip/index.js +115 -0
  252. package/components/input/chips/SortableChip/props.js +5 -0
  253. package/components/input/chips/index.js +488 -0
  254. package/components/input/chips/props.js +5 -0
  255. package/components/input/chips/utils.js +259 -0
  256. package/components/input/color-picker/index.js +678 -0
  257. package/components/input/color-picker/props.js +5 -0
  258. package/components/input/composite/index.js +137 -0
  259. package/components/input/currency/index.js +263 -0
  260. package/components/input/currency/props.js +5 -0
  261. package/components/input/default/checkbox/index.js +230 -0
  262. package/components/input/default/checkbox/props.js +5 -0
  263. package/components/input/default/checkboxset/index.js +476 -0
  264. package/components/input/default/checkboxset/props.js +5 -0
  265. package/components/input/default/radioset/index.js +379 -0
  266. package/components/input/default/radioset/props.js +5 -0
  267. package/components/input/default/switch/index.js +490 -0
  268. package/components/input/default/switch/prop.js +5 -0
  269. package/components/input/epoch/date/components/DatePickerPopover.js +220 -0
  270. package/components/input/epoch/date/index.js +520 -0
  271. package/components/input/epoch/date/props.js +5 -0
  272. package/components/input/epoch/date/styled.js +70 -0
  273. package/components/input/epoch/date/utils.js +108 -0
  274. package/components/input/epoch/datetime/index.js +656 -0
  275. package/components/input/epoch/datetime/props.js +5 -0
  276. package/components/input/epoch/datetime/styled.js +90 -0
  277. package/components/input/epoch/datetime/utils.js +244 -0
  278. package/components/input/epoch/time/index.js +412 -0
  279. package/components/input/epoch/time/props.js +5 -0
  280. package/components/input/epoch/time/utils.js +209 -0
  281. package/components/input/fileupload/Utils.js +134 -0
  282. package/components/input/fileupload/components/ListItems.js +140 -0
  283. package/components/input/fileupload/components/MultiUpload.js +85 -0
  284. package/components/input/fileupload/components/SingleUpload.js +65 -0
  285. package/components/input/fileupload/index.js +170 -0
  286. package/components/input/fileupload/props.js +5 -0
  287. package/components/input/fileupload/useFileUpload.js +400 -0
  288. package/components/input/number/index.js +295 -0
  289. package/components/input/number/props.js +5 -0
  290. package/components/input/rating/index.js +368 -0
  291. package/components/input/rating/props.js +5 -0
  292. package/components/input/select/index.js +344 -0
  293. package/components/input/select/props.js +5 -0
  294. package/components/input/slider/index.js +167 -0
  295. package/components/input/slider/props.js +5 -0
  296. package/components/input/text/index.js +434 -0
  297. package/components/input/text/props.js +5 -0
  298. package/components/input/text/util.js +179 -0
  299. package/components/input/textarea/index.js +347 -0
  300. package/components/input/textarea/props.js +5 -0
  301. package/components/layout/footer/index.js +30 -0
  302. package/components/layout/header/index.js +30 -0
  303. package/components/layout/leftnav/index.js +44 -0
  304. package/components/layout/rightnav/index.js +32 -0
  305. package/components/layout/topnav/index.js +34 -0
  306. package/components/navbar/index.js +41 -0
  307. package/components/navbar/nav/index.js +102 -0
  308. package/components/navbar/nav/props.js +5 -0
  309. package/components/navbar/nav-item/index.js +44 -0
  310. package/components/navigation/breadcrumb/index.js +56 -0
  311. package/components/navigation/breadcrumb/props.js +5 -0
  312. package/components/navigation/menu/components/ListItems.js +66 -0
  313. package/components/navigation/menu/constants.js +101 -0
  314. package/components/navigation/menu/index.js +807 -0
  315. package/components/navigation/menu/props.js +5 -0
  316. package/components/navigation/popover/index.js +209 -0
  317. package/components/navigation/popover/props.js +15 -0
  318. package/components/page/content/index.js +28 -0
  319. package/components/page/error-boundary/index.js +108 -0
  320. package/components/page/index.js +137 -0
  321. package/components/page/page-content/index.js +23 -0
  322. package/components/page/partial/index.js +36 -0
  323. package/components/page/partial-container/index.js +48 -0
  324. package/components/page/props.js +5 -0
  325. package/components/page/toast-container/index.js +33 -0
  326. package/components/prefab/container/index.js +46 -0
  327. package/components/prefab/index.js +67 -0
  328. package/context/AppContext.js +25 -0
  329. package/context/AppSpinnerProvider.js +43 -0
  330. package/context/LocalizationProvider.js +79 -0
  331. package/context/PrefabContext.js +66 -0
  332. package/context/WidgetProvider.js +187 -0
  333. package/core/app-config.js +1 -0
  334. package/core/app.service.js +357 -0
  335. package/core/appVariablesStore.js +20 -0
  336. package/core/appstore.js +88 -0
  337. package/core/constants/currency-constant.js +1071 -0
  338. package/core/constants/events.js +34 -0
  339. package/core/constants/index.js +27 -0
  340. package/core/dialog.service.js +76 -0
  341. package/core/event-notifier.js +151 -0
  342. package/core/formatter/date-formatters.js +222 -0
  343. package/core/formatter/index.js +131 -0
  344. package/core/formatter/number-formatters.js +142 -0
  345. package/core/formatter/security-formatters.js +323 -0
  346. package/core/formatter/string-formatters.js +52 -0
  347. package/core/formatter/types.js +18 -0
  348. package/core/formatters.js +24 -0
  349. package/core/proxy-service.js +412 -0
  350. package/core/script-registry.js +63 -0
  351. package/core/security.service.js +11 -0
  352. package/core/util/common.js +33 -0
  353. package/core/util/dom.js +107 -0
  354. package/core/util/index.js +136 -0
  355. package/core/util/security.js +184 -0
  356. package/core/util/utils.js +189 -0
  357. package/core/widget-observer.js +98 -0
  358. package/higherOrder/BaseApp.js +430 -0
  359. package/higherOrder/BaseAppProps.js +5 -0
  360. package/higherOrder/BaseDateTime.js +251 -0
  361. package/higherOrder/BasePage.js +715 -0
  362. package/higherOrder/BasePartial.js +124 -0
  363. package/higherOrder/BasePrefab.js +145 -0
  364. package/higherOrder/DataNav.js +377 -0
  365. package/higherOrder/helper.js +43 -0
  366. package/higherOrder/props.js +5 -0
  367. package/higherOrder/withBaseWrapper.js +183 -0
  368. package/hooks/useAccess.js +308 -0
  369. package/hooks/useAppConfig.js +42 -0
  370. package/hooks/useAuth.js +562 -0
  371. package/hooks/useDataSourceSubscription.js +125 -0
  372. package/hooks/useDebounce.js +76 -0
  373. package/hooks/useDeviceVisibility.js +49 -0
  374. package/hooks/useHttp.js +338 -0
  375. package/libs/index.js +20 -0
  376. package/mui-config/theme-provider.js +17 -0
  377. package/mui-config/theme.js +371 -0
  378. package/package-lock.json +10177 -0
  379. package/package.json +95 -0
  380. package/store/index.js +33 -0
  381. package/store/middleware/navigationMiddleware.js +48 -0
  382. package/store/slices/appConfigSlice.js +103 -0
  383. package/store/slices/authSlice.js +508 -0
  384. package/store/slices/i18nSlice.js +206 -0
  385. package/types/index.js +15 -0
  386. package/utils/dataset-util.js +174 -0
  387. package/utils/eval-expression.js +32 -0
  388. package/utils/form-state.util.js +140 -0
  389. package/utils/form-utils.js +187 -0
  390. package/utils/format-util.js +260 -0
  391. package/utils/page-params-util.js +24 -0
  392. package/utils/resource-url.js +27 -0
  393. package/utils/state-persistance.js +343 -0
  394. package/utils/style-utils.js +73 -0
  395. package/utils/transformedDataset-utils.js +633 -0
  396. package/utils/widget-cleanup-util.js +84 -0
  397. package/utils/widgets.js +99 -0
  398. package/variables/base-variable.js +173 -0
  399. package/variables/constants.js +27 -0
  400. package/variables/live-variable.js +166 -0
  401. package/variables/model-variable.js +77 -0
  402. package/variables/service-variable.js +307 -0
@@ -0,0 +1,412 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _material = require("@mui/material");
11
+ var _xDatePickers = require("@mui/x-date-pickers");
12
+ var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
13
+ var _clsx = _interopRequireDefault(require("clsx"));
14
+ var _BaseDateTime = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/BaseDateTime"));
15
+ var _utils = require("./utils");
16
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
17
+ var __jsx = _react["default"].createElement;
18
+ var WmTime = function WmTime(props) {
19
+ // Destructure props with defaults
20
+ var name = props.name,
21
+ _props$required = props.required,
22
+ required = _props$required === void 0 ? false : _props$required,
23
+ _props$placeholder = props.placeholder,
24
+ placeholder = _props$placeholder === void 0 ? "Select time" : _props$placeholder,
25
+ hint = props.hint,
26
+ arialabel = props.arialabel,
27
+ _props$tabindex = props.tabindex,
28
+ tabindex = _props$tabindex === void 0 ? 0 : _props$tabindex,
29
+ shortcutkey = props.shortcutkey,
30
+ datavalue = props.datavalue,
31
+ _props$timepattern = props.timepattern,
32
+ timepattern = _props$timepattern === void 0 ? _utils.DEFAULT_TIMEPATTERN : _props$timepattern,
33
+ _props$hourstep = props.hourstep,
34
+ hourstep = _props$hourstep === void 0 ? 1 : _props$hourstep,
35
+ _props$minutestep = props.minutestep,
36
+ minutestep = _props$minutestep === void 0 ? 1 : _props$minutestep,
37
+ _props$outputformat = props.outputformat,
38
+ outputformat = _props$outputformat === void 0 ? _utils.DEFAULT_OUTPUT_FORMAT : _props$outputformat,
39
+ mintime = props.mintime,
40
+ maxtime = props.maxtime,
41
+ _props$autofocus = props.autofocus,
42
+ autofocus = _props$autofocus === void 0 ? false : _props$autofocus,
43
+ _props$readonly = props.readonly,
44
+ readonly = _props$readonly === void 0 ? false : _props$readonly,
45
+ _props$disabled = props.disabled,
46
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
47
+ _props$showdropdownon = props.showdropdownon,
48
+ showdropdownon = _props$showdropdownon === void 0 ? "default" : _props$showdropdownon,
49
+ _props$secondsstep = props.secondsstep,
50
+ secondsstep = _props$secondsstep === void 0 ? 1 : _props$secondsstep,
51
+ _props$dataentrymode = props.dataentrymode,
52
+ dataentrymode = _props$dataentrymode === void 0 ? "default" : _props$dataentrymode,
53
+ className = props.className,
54
+ invokeOnChange = props.invokeOnChange,
55
+ setShowPicker = props.setShowPicker,
56
+ showPicker = props.showPicker,
57
+ listener = props.listener,
58
+ onChange = props.onChange,
59
+ onClick = props.onClick,
60
+ _onFocus = props.onFocus,
61
+ _onBlur = props.onBlur,
62
+ _onMouseEnter = props.onMouseEnter,
63
+ _onMouseLeave = props.onMouseLeave,
64
+ onBeforeload = props.onBeforeload;
65
+
66
+ // State
67
+ var _useState = (0, _react.useState)(null),
68
+ internalValue = _useState[0],
69
+ setInternalValue = _useState[1];
70
+ var _useState2 = (0, _react.useState)(""),
71
+ displayValue = _useState2[0],
72
+ setDisplayValue = _useState2[1];
73
+ var _useState3 = (0, _react.useState)(false),
74
+ isCurrentTime = _useState3[0],
75
+ setIsCurrentTime = _useState3[1];
76
+ var _useState4 = (0, _react.useState)({
77
+ isValid: true
78
+ }),
79
+ validationResult = _useState4[0],
80
+ setValidationResult = _useState4[1];
81
+
82
+ // Refs
83
+ var onBeforeloadExecutedRef = (0, _react.useRef)(false);
84
+ var timeIntervalRef = (0, _react.useRef)(null);
85
+ var anchorRef = (0, _react.useRef)(null);
86
+
87
+ // Computed values
88
+ var isReadOnly = (0, _react.useMemo)(function () {
89
+ return readonly || dataentrymode !== "undefined" && dataentrymode !== "default";
90
+ }, [readonly, dataentrymode]);
91
+ var timeFormatOptions = (0, _react.useMemo)(function () {
92
+ return (0, _utils.parseTimeFormat)(timepattern);
93
+ }, [timepattern]);
94
+ var minTimeObj = (0, _react.useMemo)(function () {
95
+ return (0, _utils.parseTimeObj)(mintime);
96
+ }, [mintime]);
97
+ var maxTimeObj = (0, _react.useMemo)(function () {
98
+ return (0, _utils.parseTimeObj)(maxtime);
99
+ }, [maxtime]);
100
+ // Helper functions
101
+ var isDropDownDisplayEnabledOnInput = (0, _react.useCallback)(function (dropdownvalue) {
102
+ return dropdownvalue === "default";
103
+ }, []);
104
+ var handleTimeChange = (0, _react.useCallback)(function (newTime, event) {
105
+ var shouldClosePicker = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
106
+ if (!newTime) {
107
+ setInternalValue(null);
108
+ setDisplayValue("");
109
+ setValidationResult({
110
+ isValid: true
111
+ });
112
+ if (shouldClosePicker) setShowPicker === null || setShowPicker === void 0 || setShowPicker(false);
113
+ return;
114
+ }
115
+ var validation = (0, _utils.validateTimeRange)(newTime, minTimeObj, maxTimeObj);
116
+ setValidationResult(validation);
117
+ if (validation.isValid) {
118
+ setInternalValue((0, _momentTimezone["default"])(newTime));
119
+ var formattedValue = (0, _utils.formatDisplayTimeValue)(newTime, timepattern);
120
+ setDisplayValue(formattedValue);
121
+ invokeOnChange === null || invokeOnChange === void 0 || invokeOnChange(newTime, {
122
+ $event: event,
123
+ type: "change"
124
+ });
125
+ if (name && listener !== null && listener !== void 0 && listener.Widgets[name]) {
126
+ listener.Widgets[name].displayValue = formattedValue;
127
+ }
128
+ (0, _utils.updateListener)(name, listener, props, formattedValue, (0, _utils.formatDisplayTimeValue)(newTime, "timestamp"), (0, _utils.formatDisplayTimeValue)(newTime, outputformat));
129
+ if (onChange && name && listener !== null && listener !== void 0 && listener.Widgets[name]) {
130
+ onChange({}, name && (listener === null || listener === void 0 ? void 0 : listener.Widgets[name]), formattedValue, displayValue);
131
+ }
132
+ }
133
+ if (shouldClosePicker) setShowPicker === null || setShowPicker === void 0 || setShowPicker(false);
134
+ }, [minTimeObj, maxTimeObj, timepattern, invokeOnChange, setShowPicker]);
135
+ var handlePickerAccept = (0, _react.useCallback)(function (value) {
136
+ if (value && value.isValid()) {
137
+ handleTimeChange(value.toDate(), undefined, true);
138
+ }
139
+ }, [handleTimeChange]);
140
+ var handlePickerClose = (0, _react.useCallback)(function () {
141
+ setShowPicker === null || setShowPicker === void 0 || setShowPicker(false);
142
+ }, [setShowPicker]);
143
+ var handleInputChange = (0, _react.useCallback)(function (event) {
144
+ try {
145
+ var inputValue = event.target.value;
146
+ if (!inputValue) {
147
+ handleTimeChange(null, event, false);
148
+ return;
149
+ }
150
+ var formatValidation = (0, _utils.validateTimeFormat)(inputValue, timepattern, required);
151
+ if (!formatValidation.isValid) {
152
+ setValidationResult(formatValidation);
153
+ setDisplayValue(inputValue);
154
+ return;
155
+ }
156
+ var parsedTime = (0, _utils.parseTimeValue)(inputValue, timepattern);
157
+ if (parsedTime && parsedTime.isValid()) {
158
+ var rangeValidation = (0, _utils.validateTimeRange)(parsedTime.toDate(), minTimeObj, maxTimeObj);
159
+ setValidationResult(rangeValidation);
160
+ if (rangeValidation.isValid) {
161
+ handleTimeChange(parsedTime.toDate(), event, false);
162
+ } else {
163
+ setDisplayValue(inputValue);
164
+ }
165
+ } else {
166
+ if (required) {
167
+ setValidationResult({
168
+ isValid: false,
169
+ errorType: "format",
170
+ message: "Invalid time format. Expected: ".concat(timepattern)
171
+ });
172
+ }
173
+ setDisplayValue(inputValue);
174
+ }
175
+ } catch (error) {
176
+ console.error("Error in handleInputChange:", error);
177
+ setValidationResult({
178
+ isValid: false,
179
+ errorType: "format",
180
+ message: "Error processing input"
181
+ });
182
+ }
183
+ }, [handleTimeChange, timepattern, minTimeObj, maxTimeObj]);
184
+ var handleClick = (0, _react.useCallback)(function (event) {
185
+ try {
186
+ if (disabled || readonly || isCurrentTime) return;
187
+
188
+ // Ensure the input gets focus on click
189
+ if (anchorRef.current && !anchorRef.current.contains(document.activeElement)) {
190
+ anchorRef.current.focus();
191
+ }
192
+ if (isDropDownDisplayEnabledOnInput(showdropdownon)) {
193
+ setShowPicker === null || setShowPicker === void 0 || setShowPicker(true);
194
+ }
195
+ if (onClick && name) {
196
+ onClick(event, listener === null || listener === void 0 ? void 0 : listener.Widgets[name]);
197
+ }
198
+ } catch (error) {
199
+ console.error("Error in handleClick:", error);
200
+ }
201
+ }, [disabled, readonly, isCurrentTime, showdropdownon, isDropDownDisplayEnabledOnInput, setShowPicker]);
202
+ var handleInputKeyDown = (0, _react.useCallback)(function (event) {
203
+ try {
204
+ if (shortcutkey && event.altKey && event.key.toLowerCase() === shortcutkey.toLowerCase()) {
205
+ var _anchorRef$current;
206
+ event.preventDefault();
207
+ (_anchorRef$current = anchorRef.current) === null || _anchorRef$current === void 0 || _anchorRef$current.focus();
208
+ return;
209
+ }
210
+ if (isDropDownDisplayEnabledOnInput(showdropdownon)) {
211
+ if (event.key === "Enter" || event.key === "ArrowDown") {
212
+ event.preventDefault();
213
+ setShowPicker === null || setShowPicker === void 0 || setShowPicker(true);
214
+ } else if (event.key === "Escape") {
215
+ setShowPicker === null || setShowPicker === void 0 || setShowPicker(false);
216
+ }
217
+ }
218
+ } catch (error) {
219
+ console.error("Error in handleInputKeyDown:", error);
220
+ }
221
+ }, [shortcutkey, showdropdownon, isDropDownDisplayEnabledOnInput, setShowPicker]);
222
+ var handleTimePickerChange = (0, _react.useCallback)(function (newValue) {
223
+ if (newValue && newValue.isValid()) {
224
+ var newDate = newValue.toDate();
225
+ setInternalValue((0, _momentTimezone["default"])(newDate));
226
+ setDisplayValue((0, _utils.formatDisplayTimeValue)(newDate, timepattern));
227
+ } else {
228
+ setInternalValue(null);
229
+ setDisplayValue("");
230
+ }
231
+ }, [timepattern]);
232
+
233
+ // Data value effect
234
+ (0, _react.useEffect)(function () {
235
+ if (datavalue === "CURRENT_TIME") {
236
+ setIsCurrentTime(true);
237
+ var now = (0, _momentTimezone["default"])();
238
+ setInternalValue(now);
239
+ setDisplayValue((0, _utils.formatDisplayTimeValue)(now, timepattern));
240
+ timeIntervalRef.current = setInterval(function () {
241
+ var current = (0, _momentTimezone["default"])();
242
+ setInternalValue(current);
243
+ setDisplayValue((0, _utils.formatDisplayTimeValue)(current, timepattern));
244
+ (0, _utils.updateListener)(name, listener, props, (0, _utils.formatDisplayTimeValue)(current, timepattern), (0, _utils.formatDisplayTimeValue)(current, "timestamp"), (0, _utils.formatDisplayTimeValue)(current, outputformat));
245
+ }, 1000);
246
+ } else {
247
+ if (timeIntervalRef.current) {
248
+ clearInterval(timeIntervalRef.current);
249
+ timeIntervalRef.current = null;
250
+ }
251
+ setIsCurrentTime(false);
252
+ if (datavalue) {
253
+ var parsed;
254
+ if (typeof datavalue === "string" && /^\d+$/.test(datavalue)) {
255
+ parsed = (0, _momentTimezone["default"])(parseInt(datavalue, 10));
256
+ } else if (typeof datavalue === "number") {
257
+ parsed = (0, _momentTimezone["default"])(datavalue);
258
+ } else if (datavalue instanceof Date) {
259
+ parsed = (0, _momentTimezone["default"])(datavalue);
260
+ } else {
261
+ parsed = (0, _momentTimezone["default"])(datavalue, timepattern);
262
+ }
263
+ setInternalValue(parsed);
264
+ setDisplayValue((0, _utils.formatDisplayTimeValue)(parsed, timepattern));
265
+ (0, _utils.updateListener)(name, listener, props, (0, _utils.formatDisplayTimeValue)(parsed, timepattern), (0, _utils.formatDisplayTimeValue)(parsed, "timestamp"), (0, _utils.formatDisplayTimeValue)(parsed, outputformat));
266
+ } else {
267
+ setInternalValue(null);
268
+ setDisplayValue("");
269
+ }
270
+ }
271
+ return function () {
272
+ if (timeIntervalRef.current) {
273
+ clearInterval(timeIntervalRef.current);
274
+ timeIntervalRef.current = null;
275
+ }
276
+ };
277
+ }, [datavalue, timepattern]);
278
+
279
+ // Shortcut key setup
280
+ (0, _react.useEffect)(function () {
281
+ if (!shortcutkey) return;
282
+ var handleGlobalKeyDown = function handleGlobalKeyDown(event) {
283
+ if (event.altKey && event.key.toLowerCase() === shortcutkey.toLowerCase()) {
284
+ var _anchorRef$current2;
285
+ event.preventDefault();
286
+ (_anchorRef$current2 = anchorRef.current) === null || _anchorRef$current2 === void 0 || _anchorRef$current2.focus();
287
+ }
288
+ };
289
+ document.addEventListener("keydown", handleGlobalKeyDown);
290
+ return function () {
291
+ return document.removeEventListener("keydown", handleGlobalKeyDown);
292
+ };
293
+ }, [shortcutkey]);
294
+ (0, _react.useEffect)(function () {
295
+ var _props$listener;
296
+ if (onBeforeload && name && (_props$listener = props.listener) !== null && _props$listener !== void 0 && (_props$listener = _props$listener.Widgets) !== null && _props$listener !== void 0 && _props$listener[name] && !onBeforeloadExecutedRef.current) {
297
+ var _props$listener2;
298
+ var syntheticEvent = {};
299
+ onBeforeload(syntheticEvent, (_props$listener2 = props.listener) === null || _props$listener2 === void 0 || (_props$listener2 = _props$listener2.Widgets) === null || _props$listener2 === void 0 ? void 0 : _props$listener2[name]);
300
+ onBeforeloadExecutedRef.current = true;
301
+ }
302
+ }, [onBeforeload, name, props.listener]);
303
+
304
+ // Render the main TextField component
305
+ var renderTextField = (0, _react.useCallback)(function () {
306
+ return __jsx(_material.TextField, {
307
+ inputRef: anchorRef,
308
+ autoFocus: autofocus && !disabled && !readonly && !isReadOnly,
309
+ fullWidth: true,
310
+ name: name,
311
+ required: required,
312
+ disabled: disabled || readonly,
313
+ "aria-readonly": readonly || isCurrentTime,
314
+ value: displayValue,
315
+ onChange: handleInputChange,
316
+ onClick: handleClick,
317
+ onFocus: function onFocus(event) {
318
+ return _onFocus && name && _onFocus(event, listener === null || listener === void 0 ? void 0 : listener.Widgets[name]);
319
+ },
320
+ onBlur: function onBlur(event) {
321
+ var _listener$Widgets;
322
+ return _onBlur && name && listener !== null && listener !== void 0 && (_listener$Widgets = listener.Widgets) !== null && _listener$Widgets !== void 0 && _listener$Widgets[name] ? _onBlur(event, listener.Widgets[name]) : undefined;
323
+ },
324
+ onMouseEnter: function onMouseEnter(event) {
325
+ var _listener$Widgets2;
326
+ return _onMouseEnter && name && listener !== null && listener !== void 0 && (_listener$Widgets2 = listener.Widgets) !== null && _listener$Widgets2 !== void 0 && _listener$Widgets2[name] ? _onMouseEnter(event, listener.Widgets[name]) : undefined;
327
+ },
328
+ onMouseLeave: function onMouseLeave(event) {
329
+ var _listener$Widgets3;
330
+ return _onMouseLeave && name && listener !== null && listener !== void 0 && (_listener$Widgets3 = listener.Widgets) !== null && _listener$Widgets3 !== void 0 && _listener$Widgets3[name] ? _onMouseLeave(event, listener.Widgets[name]) : undefined;
331
+ },
332
+ onKeyDown: handleInputKeyDown,
333
+ placeholder: placeholder,
334
+ error: !validationResult.isValid,
335
+ helperText: validationResult.message || "",
336
+ slotProps: {
337
+ htmlInput: {
338
+ tabIndex: readonly || isReadOnly || isCurrentTime ? -1 : tabindex,
339
+ readOnly: isReadOnly || readonly || isCurrentTime,
340
+ className: "form-control app-textbox app-dateinput display-input",
341
+ "aria-label": arialabel || placeholder,
342
+ accessKey: shortcutkey,
343
+ role: "timer",
344
+ "aria-atomic": isCurrentTime ? "true" : "false",
345
+ title: hint,
346
+ onFocus: readonly || isReadOnly || isCurrentTime ? function (e) {
347
+ return e.target.blur();
348
+ } : undefined
349
+ }
350
+ },
351
+ InputProps: {
352
+ className: readonly || isReadOnly ? "readonly" : "",
353
+ endAdornment: __jsx(_material.Box, {
354
+ component: "span",
355
+ className: "input-group-btn dropdown-toggle"
356
+ }, __jsx(_material.Button, {
357
+ className: "btn btn-default btn-date",
358
+ variant: "contained",
359
+ disableRipple: false,
360
+ onClick: function onClick() {
361
+ return setShowPicker === null || setShowPicker === void 0 ? void 0 : setShowPicker(true);
362
+ },
363
+ "aria-label": "Select time",
364
+ "aria-haspopup": "true",
365
+ "aria-expanded": showPicker ? "true" : "false",
366
+ tabIndex: readonly || isReadOnly || isCurrentTime ? -1 : tabindex,
367
+ disableTouchRipple: true,
368
+ disabled: disabled || readonly || isCurrentTime
369
+ }, __jsx("span", {
370
+ className: "app-icon wm-sl-l sl-time",
371
+ "aria-hidden": "true"
372
+ })))
373
+ }
374
+ });
375
+ }, [name, required, disabled, isCurrentTime, displayValue, handleInputChange, handleClick, handleInputKeyDown, placeholder, tabindex, arialabel, shortcutkey, isReadOnly, readonly, validationResult, setShowPicker, showPicker, hint]);
376
+ var views = ["hours", "minutes"];
377
+ if (timeFormatOptions.hasSeconds) views.push("seconds");
378
+ return __jsx(_material.Box, {
379
+ className: (0, _clsx["default"])(_utils.DEFAULT_CLASS, className)
380
+ }, renderTextField(), showPicker && __jsx(_xDatePickers.TimePicker, {
381
+ disableIgnoringDatePartForTimeValidation: true,
382
+ open: showPicker,
383
+ onClose: handlePickerClose,
384
+ onAccept: handlePickerAccept,
385
+ value: internalValue,
386
+ onChange: handleTimePickerChange,
387
+ timeSteps: {
388
+ minutes: minutestep,
389
+ hours: hourstep,
390
+ seconds: secondsstep
391
+ },
392
+ minTime: minTimeObj ? (0, _momentTimezone["default"])(minTimeObj) : undefined,
393
+ maxTime: maxTimeObj ? (0, _momentTimezone["default"])(maxTimeObj) : undefined,
394
+ ampm: timeFormatOptions.is12Hour,
395
+ views: views,
396
+ skipDisabled: true,
397
+ ampmInClock: timeFormatOptions.is12Hour,
398
+ format: timepattern,
399
+ slotProps: {
400
+ textField: {
401
+ hidden: true
402
+ },
403
+ popper: {
404
+ anchorEl: anchorRef.current,
405
+ placement: "bottom-start",
406
+ sx: _utils.TIME_PICKER_STYLES
407
+ }
408
+ }
409
+ }));
410
+ };
411
+ WmTime.displayName = "WmTime";
412
+ var _default = exports["default"] = (0, _BaseDateTime["default"])(WmTime);
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,209 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.TIME_PICKER_STYLES = exports.READONLY_STYLES = exports.DEFAULT_TIMEPATTERN = exports.DEFAULT_OUTPUT_FORMAT = exports.DEFAULT_CLASS = void 0;
8
+ exports.formatDisplayTimeValue = formatDisplayTimeValue;
9
+ exports.getSupportedTimeFormats = getSupportedTimeFormats;
10
+ exports.parseTimeFormat = parseTimeFormat;
11
+ exports.parseTimeObj = parseTimeObj;
12
+ exports.parseTimeValue = parseTimeValue;
13
+ exports.updateListener = updateListener;
14
+ exports.validateTimeFormat = validateTimeFormat;
15
+ exports.validateTimeRange = validateTimeRange;
16
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
+ var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
18
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
21
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
22
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
23
+ function parseTimeFormat() {
24
+ var timepattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "hh:mm a";
25
+ var hasSeconds = timepattern.toLowerCase().includes("s");
26
+ var is12Hour = timepattern.includes("h");
27
+ return {
28
+ format: timepattern,
29
+ hasSeconds: hasSeconds,
30
+ is12Hour: is12Hour
31
+ };
32
+ }
33
+ function getSupportedTimeFormats() {
34
+ return ["HH:mm:ss", "HH:mm", "H:mm:ss", "H:mm", "hh:mm:ss a", "hh:mm a", "h:mm:ss a", "h:mm a", "HH:mm:ss.SSS"];
35
+ }
36
+ function parseTimeValue(value, timepattern) {
37
+ if (!value) return null;
38
+ try {
39
+ if (value === "CURRENT_TIME") {
40
+ return (0, _momentTimezone["default"])();
41
+ }
42
+ if (typeof value === "number") {
43
+ return (0, _momentTimezone["default"])(value);
44
+ }
45
+ if (value instanceof Date) {
46
+ return (0, _momentTimezone["default"])(value);
47
+ }
48
+ if (typeof value === "string") {
49
+ var parsed = (0, _momentTimezone["default"])(value, timepattern, true);
50
+ if (parsed.isValid()) return parsed;
51
+ var formats = getSupportedTimeFormats();
52
+ var _iterator = _createForOfIteratorHelper(formats),
53
+ _step;
54
+ try {
55
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
56
+ var format = _step.value;
57
+ parsed = (0, _momentTimezone["default"])(value, format, true);
58
+ if (parsed.isValid()) return parsed;
59
+ }
60
+ } catch (err) {
61
+ _iterator.e(err);
62
+ } finally {
63
+ _iterator.f();
64
+ }
65
+ parsed = (0, _momentTimezone["default"])(value);
66
+ if (parsed.isValid()) return parsed;
67
+ }
68
+ return null;
69
+ } catch (error) {
70
+ console.warn("Error parsing time value:", error);
71
+ return null;
72
+ }
73
+ }
74
+ function formatDisplayTimeValue(value, pattern) {
75
+ if (!value) return "";
76
+ try {
77
+ var momentObj = _momentTimezone["default"].isMoment(value) ? value : (0, _momentTimezone["default"])(value);
78
+ if (pattern === "timestamp") {
79
+ return momentObj.valueOf().toString();
80
+ }
81
+ return momentObj.isValid() ? momentObj.format(pattern) : "";
82
+ } catch (error) {
83
+ console.warn("Error formatting display value:", error);
84
+ return "";
85
+ }
86
+ }
87
+ function validateTimeRange(timeValue, minTime, maxTime) {
88
+ if (!timeValue) return {
89
+ isValid: true
90
+ };
91
+ try {
92
+ var timeToCheck = _momentTimezone["default"].isMoment(timeValue) ? timeValue : (0, _momentTimezone["default"])(timeValue);
93
+ if (!timeToCheck.isValid()) {
94
+ return {
95
+ isValid: false,
96
+ errorType: "format",
97
+ message: "Invalid time format"
98
+ };
99
+ }
100
+ var timeToCheckMinutes = timeToCheck.hours() * 60 + timeToCheck.minutes();
101
+ if (minTime) {
102
+ var minMoment = typeof minTime === "string" ? (0, _momentTimezone["default"])(minTime, ["HH:mm", "H:mm", "hh:mm a", "h:mm a"], true) : (0, _momentTimezone["default"])(minTime);
103
+ if (minMoment.isValid()) {
104
+ var minMinutes = minMoment.hours() * 60 + minMoment.minutes();
105
+ if (timeToCheckMinutes < minMinutes) {
106
+ return {
107
+ isValid: false,
108
+ errorType: "mintime",
109
+ message: "Time must be later than ".concat(minMoment.format("HH:mm"))
110
+ };
111
+ }
112
+ }
113
+ }
114
+ if (maxTime) {
115
+ var maxMoment = typeof maxTime === "string" ? (0, _momentTimezone["default"])(maxTime, ["HH:mm", "H:mm", "hh:mm a", "h:mm a"], true) : (0, _momentTimezone["default"])(maxTime);
116
+ if (maxMoment.isValid()) {
117
+ var maxMinutes = maxMoment.hours() * 60 + maxMoment.minutes();
118
+ if (timeToCheckMinutes > maxMinutes) {
119
+ return {
120
+ isValid: false,
121
+ errorType: "maxtime",
122
+ message: "Time must be earlier than ".concat(maxMoment.format("HH:mm"))
123
+ };
124
+ }
125
+ }
126
+ }
127
+ return {
128
+ isValid: true
129
+ };
130
+ } catch (error) {
131
+ console.warn("Error validating time range:", error);
132
+ return {
133
+ isValid: false,
134
+ errorType: "format",
135
+ message: "Validation error"
136
+ };
137
+ }
138
+ }
139
+ function validateTimeFormat(inputValue, pattern, required) {
140
+ if (!inputValue.trim()) return {
141
+ isValid: true
142
+ };
143
+ try {
144
+ var parsed = (0, _momentTimezone["default"])(inputValue, pattern, true);
145
+ if (!parsed.isValid() && required) {
146
+ return {
147
+ isValid: false,
148
+ errorType: "format",
149
+ message: "Invalid time format. Expected: ".concat(pattern)
150
+ };
151
+ }
152
+ return {
153
+ isValid: true
154
+ };
155
+ } catch (error) {
156
+ return {
157
+ isValid: false,
158
+ errorType: "format",
159
+ message: "Invalid time format"
160
+ };
161
+ }
162
+ }
163
+ function parseTimeObj(timeValue) {
164
+ if (!timeValue) return null;
165
+ try {
166
+ return typeof timeValue === "string" ? (0, _momentTimezone["default"])(timeValue, getSupportedTimeFormats(), true).toDate() : timeValue instanceof Date ? timeValue : null;
167
+ } catch (error) {
168
+ console.warn("Error parsing time object:", error);
169
+ return null;
170
+ }
171
+ }
172
+
173
+ // Constants
174
+ var DEFAULT_CLASS = exports.DEFAULT_CLASS = "input-group app-timeinput";
175
+ var DEFAULT_TIMEPATTERN = exports.DEFAULT_TIMEPATTERN = "h:mm:ss a";
176
+ var DEFAULT_OUTPUT_FORMAT = exports.DEFAULT_OUTPUT_FORMAT = "HH:mm:ss";
177
+
178
+ // Styling constants
179
+ var READONLY_STYLES = exports.READONLY_STYLES = {
180
+ cursor: "not-allowed"
181
+ };
182
+ var TIME_PICKER_STYLES = exports.TIME_PICKER_STYLES = {
183
+ "& .MuiPaper-root": {
184
+ background: "var(--wm-timepicker-background)",
185
+ padding: "var(--wm-timepicker-padding)",
186
+ borderRadius: "var(--wm-timepicker-border-radius)",
187
+ width: "auto",
188
+ boxShadow: "none"
189
+ },
190
+ "& .Mui-selected": {
191
+ backgroundColor: "var(--wm-btn-secondary-background) !important",
192
+ color: "var(--wm-btn-secondary-color) !important"
193
+ },
194
+ "& .Mui-selected:hover": {
195
+ backgroundColor: "var(--wm-btn-secondary-background) !important",
196
+ color: "var(--wm-btn-secondary-color) !important"
197
+ }
198
+ };
199
+ function updateListener(name, listener, props, displayValue, timestamp, datavalue) {
200
+ // Update listener widget display value
201
+
202
+ if (listener !== null && listener !== void 0 && listener.onChange) {
203
+ listener.onChange(name || "", _objectSpread(_objectSpread({}, props), {}, {
204
+ displayValue: displayValue,
205
+ timestamp: timestamp,
206
+ datavalue: datavalue
207
+ }));
208
+ }
209
+ }