ru.coon 2.5.25 → 2.5.26

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 (526) hide show
  1. package/.gitattributes +1 -1
  2. package/.husky/pre-commit +0 -0
  3. package/CHANGELOG.md +17 -0
  4. package/Readme.md +24 -24
  5. package/TODO.md +7 -7
  6. package/doc/changelog.md +118 -118
  7. package/doc/shortcuts.md +5 -5
  8. package/jsdoc.config.json +29 -29
  9. package/package.json +82 -82
  10. package/sass/src/common/plugin/form/PeriodPicker.scss +8 -8
  11. package/src/CustomXMLReader.js +42 -42
  12. package/src/FieldsHelper.js +141 -141
  13. package/src/MessageResources.js +58 -58
  14. package/src/SystemProperties.js +208 -208
  15. package/src/chart/BaseChart.js +81 -81
  16. package/src/chart/ChartComponent.js +14 -14
  17. package/src/chart/editor/CoonChartEditor.js +189 -189
  18. package/src/chart/editor/CoonChartEditorViewModel.js +28 -28
  19. package/src/chart/editor/DataSourceChartBindForm.js +153 -153
  20. package/src/command/ASyncBaseJSONCommand.js +15 -15
  21. package/src/command/DeletePropertyFromConfigurationCommand.js +18 -18
  22. package/src/command/GetAllPropertiesWithDefaultCommand.js +6 -6
  23. package/src/command/GetPropertyFromConfigurationCommand.js +18 -18
  24. package/src/command/Readme.md +4 -4
  25. package/src/command/SavePropertyFromConfigurationCommand.js +18 -18
  26. package/src/command/characteristic/CharacteristicValuesCommand.js +50 -50
  27. package/src/command/characteristic/SetEntityCharacteristicsCommand.js +49 -49
  28. package/src/common/baseModel.js +39 -39
  29. package/src/common/button/ForeignButton.js +132 -132
  30. package/src/common/command/AddNoteCommand.js +42 -42
  31. package/src/common/command/DeleteNoteCommand.js +40 -40
  32. package/src/common/command/GetNoteCommand.js +40 -40
  33. package/src/common/command/SaveNoteCommand.js +42 -42
  34. package/src/common/component/DFVCharacteristicField.js +24 -24
  35. package/src/common/component/ExternalFrame.scss +8 -8
  36. package/src/common/component/FinanceDocumentDateWindow.js +47 -47
  37. package/src/common/component/ForeignSelectWindow.js +93 -93
  38. package/src/common/component/HotkeyHelpText.js +43 -43
  39. package/src/common/component/HotkeyHelpText.scss +34 -34
  40. package/src/common/component/PropertyDict.js +279 -279
  41. package/src/common/component/TreeComponentStructure.js +155 -155
  42. package/src/common/component/TreeComponentStructure.scss +5 -5
  43. package/src/common/component/YearPanel.js +76 -76
  44. package/src/common/component/characteristic/CharacteristicPanelController.js +90 -90
  45. package/src/common/component/characteristic/characteristicAlgorithm/CharacteristicAlgorithmListController.js +133 -133
  46. package/src/common/component/characteristic/characteristicGroup/CharacteristicGroupPanelController.js +47 -47
  47. package/src/common/component/editor/CharacteristicAddTypeGrid.js +101 -101
  48. package/src/common/component/editor/CharacteristicColumnModel.js +35 -35
  49. package/src/common/component/editor/CharacteristicForeignWindow.js +76 -76
  50. package/src/common/component/editor/CharacteristicHistoryPanel.js +110 -110
  51. package/src/common/component/editor/CharacteristicHistoryPanelAudit.js +73 -73
  52. package/src/common/component/editor/CharacteristicHistoryPanelWithDeletedChars.js +136 -136
  53. package/src/common/component/editor/CharacteristicHistoryUserAudit.js +49 -49
  54. package/src/common/component/editor/CharacteristicLoaderByCharacteristicEntityPlugin.js +41 -41
  55. package/src/common/component/editor/CharacteristicTypeLoaderPlugin.js +38 -38
  56. package/src/common/component/editor/EditorFactory.js +515 -515
  57. package/src/common/component/editor/HistoryListForTypeCharacteristicEditor.js +51 -51
  58. package/src/common/component/editor/HistoryTypedCharacteristicEditor.js +240 -240
  59. package/src/common/component/editor/creators/BaseEditorCreator.js +22 -22
  60. package/src/common/component/editor/creators/ByReportEditorCreator.js +8 -8
  61. package/src/common/component/editor/creators/CustomPanelEditorCreator.js +66 -66
  62. package/src/common/component/editor/creators/NumberEditorCreator.js +44 -44
  63. package/src/common/component/editor/creators/SimpleReportEditorCreator.js +37 -37
  64. package/src/common/component/editor/creators/TriggerFieldEditorCreator.js +127 -127
  65. package/src/common/component/settings/commands/getUserSettingsCommand.js +6 -6
  66. package/src/common/component/settings/commands/setUserPropValueCommand.js +23 -23
  67. package/src/common/component/settings/modules/settingClosePageConfirmation.js +27 -27
  68. package/src/common/component/settings/modules/settingShowNeedReloadMessage.js +75 -75
  69. package/src/common/component/settings/modules/settingwindowHolder.js +21 -21
  70. package/src/common/component/settings/stores/userSettingsStoreService.js +37 -37
  71. package/src/common/field/BankBikField.js +15 -15
  72. package/src/common/field/BankKppField.js +16 -16
  73. package/src/common/field/BankOgrnField.js +71 -71
  74. package/src/common/field/BankOgrnIpField.js +23 -23
  75. package/src/common/field/BankPaymentAccountField.js +48 -48
  76. package/src/common/field/DatePickerPresetsField.js +256 -256
  77. package/src/common/field/FieldsHelper.js +198 -198
  78. package/src/common/field/ForeignField.js +186 -186
  79. package/src/common/field/IDField.js +22 -22
  80. package/src/common/field/InnField.js +86 -86
  81. package/src/common/field/OpenDialogField.js +16 -16
  82. package/src/common/field/PhoneField.js +38 -38
  83. package/src/common/field/PropertyField.js +83 -83
  84. package/src/common/field/ReportValueField.js +128 -128
  85. package/src/common/field/ReportValueField.scss +2 -2
  86. package/src/common/field/SelectIconClassField.js +58 -58
  87. package/src/common/field/SnilsField.js +35 -35
  88. package/src/common/field/checkbox/CustomValueCheckBox.js +113 -113
  89. package/src/common/field/combo/AbstractComponentsComboBox.js +32 -32
  90. package/src/common/field/combo/BillingLookupComboBox.js +21 -21
  91. package/src/common/field/combo/CommandComboBox.js +17 -17
  92. package/src/common/field/combo/CommandComboBox.scss +19 -19
  93. package/src/common/field/combo/ConstantList.js +26 -26
  94. package/src/common/field/combo/GridComboBox.js +148 -148
  95. package/src/common/field/combo/IsweDynamicCheckboxGroup.js +17 -17
  96. package/src/common/field/combo/PanelComboBox.js +21 -21
  97. package/src/common/field/combo/TownTypeComboBox.js +21 -21
  98. package/src/common/field/fieldset/DateTimeField.js +143 -143
  99. package/src/common/field/fieldset/SelectAccountsRangeFieldSet.js +65 -65
  100. package/src/common/field/fieldset/TimePicker.js +92 -92
  101. package/src/common/field/numberfield/MoneyNumberField.js +177 -177
  102. package/src/common/field/radio/DynamicRadioGroup.js +87 -87
  103. package/src/common/field/withDefault.js +37 -37
  104. package/src/common/panel/DayPicker.js +63 -63
  105. package/src/common/panel/DayPicker.scss +15 -15
  106. package/src/common/panel/MainUploadPanel.scss +13 -13
  107. package/src/common/panel/SelectIconClassPanel.scss +38 -38
  108. package/src/common/panel/SelectIconClassPanelTemplate.scss +14 -14
  109. package/src/common/panel/StopwatchWindow.js +44 -44
  110. package/src/common/panel/UIElementPickerPanel.js +176 -0
  111. package/src/common/panel/WindowWrap.js +0 -0
  112. package/src/common/panel/WindowWrap.scss +8 -8
  113. package/src/common/panel/dropzone/UniversalMultiUploadForm.scss +29 -29
  114. package/src/common/panel/dropzone/UniversalMultiUploadFormController.js +233 -233
  115. package/src/common/panel/dropzone/UniversalMultiUploadFormViewModel.js +10 -10
  116. package/src/common/panel/dropzone/UploadDropZone.js +56 -56
  117. package/src/common/panel/dropzone/UploadDropZone.scss +36 -36
  118. package/src/common/panel/widget/LinkWindow.js +67 -67
  119. package/src/common/panel/widget/LinkWindowController.js +69 -69
  120. package/src/common/panel/widget/MainSettingsWindow.js +121 -121
  121. package/src/common/panel/widget/MainSettingsWindowController.js +68 -68
  122. package/src/common/panel/widget/PinWindow.js +42 -42
  123. package/src/common/panel/widget/PinWindowController.js +48 -48
  124. package/src/common/panel/widget/SettingsModel.js +15 -15
  125. package/src/common/panel/widget/SettingsWindow.js +154 -154
  126. package/src/common/panel/widget/SettingsWindowController.js +44 -44
  127. package/src/common/panel/widget/WidgetPanel.js +19 -19
  128. package/src/common/panel/widget/WidgetPanel.scss +157 -157
  129. package/src/common/panel/widget/WidgetPanelViewModel.js +13 -13
  130. package/src/common/plugin/form/CopyPastePlugin.js +68 -68
  131. package/src/common/plugin/form/CountRowsToFieldLabel.js +25 -25
  132. package/src/common/plugin/form/DragDropFilePlugin.js +2 -2
  133. package/src/common/plugin/form/FieldDependsPlugin.js +215 -215
  134. package/src/common/plugin/form/PeriodMenu.js +58 -58
  135. package/src/common/plugin/form/PeriodPickerPlugin.js +51 -51
  136. package/src/common/plugin/form/RequiredFlagPlugin.js +79 -79
  137. package/src/common/plugin/mixin/defaults.js +17 -17
  138. package/src/common/tree/BaseContextMenu.js +50 -50
  139. package/src/common/tree/ContextMenuItem.js +18 -18
  140. package/src/common/tree/NodeTreeLoader.js +61 -61
  141. package/src/common/trigger/WikiTrigger.js +20 -20
  142. package/src/eventBus.js +73 -73
  143. package/src/info.js +39 -39
  144. package/src/info.scss +12 -12
  145. package/src/log.js +219 -219
  146. package/src/logSender.js +63 -63
  147. package/src/model/MoParameterFields.js +7 -7
  148. package/src/model/SimpleEntityCharacteristicBeanFields.js +6 -6
  149. package/src/model/VisualCharacteristicValueFields.js +6 -6
  150. package/src/model/VisualCharacteristicValuesFields.js +17 -17
  151. package/src/nav/AppNavTab.js +106 -106
  152. package/src/nav/AppNavTab.scss +20 -20
  153. package/src/nav/AppNavigationBar.js +88 -88
  154. package/src/nav/AppNavigationBar.scss +9 -9
  155. package/src/nav/AppNavigationBarViewController.js +66 -66
  156. package/src/nav/AppNavigationMenu.scss +64 -64
  157. package/src/nav/WindowBarMixin.js +27 -27
  158. package/src/nav/editor/NavigateElementEditorController.js +34 -34
  159. package/src/nav/editor/NavigateElementEditorView.js +94 -94
  160. package/src/nav/editor/NavigateElementEditorViewModel.js +22 -22
  161. package/src/nav/editor/menu/NavMenuTreeController.js +401 -401
  162. package/src/nav/editor/menu/NavMenuTreeView.js +146 -146
  163. package/src/nav/editor/menu/NavMenuTreeView.scss +104 -104
  164. package/src/nav/editor/menu/command/AddMenuCommand.js +20 -20
  165. package/src/nav/editor/menu/command/DeleteMenuCommand.js +20 -20
  166. package/src/nav/editor/menu/command/GetMenuCommand.js +20 -20
  167. package/src/nav/editor/menu/command/SaveMenuCommand.js +20 -20
  168. package/src/nav/editor/menu/form/NavMenuFormViewController.js +133 -133
  169. package/src/nav/editor/menu/form/NavMenuFormViewModel.js +24 -24
  170. package/src/nav/editor/workspace/NavWorkspaceListController.js +179 -179
  171. package/src/nav/editor/workspace/NavWorkspaceListView.js +59 -59
  172. package/src/nav/editor/workspace/NavWorkspaceListView.scss +35 -35
  173. package/src/nav/editor/workspace/command/AddWorkspaceCommand.js +20 -20
  174. package/src/nav/editor/workspace/command/DeleteWorkspaceCommand.js +20 -20
  175. package/src/nav/editor/workspace/command/GetWorkspaceCommand.js +20 -20
  176. package/src/nav/editor/workspace/command/SaveWorkspaceCommand.js +20 -20
  177. package/src/nav/editor/workspace/form/NavWorkspaceFormController.js +108 -108
  178. package/src/nav/editor/workspace/form/NavWorkspaceFormView.js +79 -79
  179. package/src/nav/editor/workspace/form/NavWorkspaceFormViewModel.js +18 -18
  180. package/src/nav/menu/NavMenuPanel.scss +11 -11
  181. package/src/nav/menu/WorkspaceMenuView.scss +218 -218
  182. package/src/nav/state.js +86 -86
  183. package/src/nav/windowHolder.js +97 -97
  184. package/src/nav/windowHolderTab.js +39 -39
  185. package/src/nav/windowHolderTab.scss +13 -13
  186. package/src/report/column/BigNumColumn.js +43 -43
  187. package/src/report/column/Check.js +49 -49
  188. package/src/report/column/CounterColumn.js +26 -26
  189. package/src/report/column/DynamicActionColumn.js +74 -74
  190. package/src/report/column/HintColumn.js +19 -19
  191. package/src/report/column/HintDateColumn.js +19 -19
  192. package/src/report/column/HintTimeIntervalColumn.js +33 -33
  193. package/src/report/column/IconSvgColumn.js +15 -15
  194. package/src/report/column/MoneyColumn.js +25 -25
  195. package/src/report/column/MultiFilesColumn.scss +8 -8
  196. package/src/report/column/MultiLineColumn.js +17 -17
  197. package/src/report/column/PercentColumn.js +38 -38
  198. package/src/report/column/SoftWrapColumn.js +18 -18
  199. package/src/report/column/TimeIntervalColumn.js +34 -34
  200. package/src/report/command/ConvertReportCommand.js +41 -41
  201. package/src/report/command/ExecuteAllReportsCommand.js +53 -53
  202. package/src/report/command/GetExcelFromRowsOrReportData.js +5 -5
  203. package/src/report/command/GetExcelReportDataCommand.js +5 -5
  204. package/src/report/command/GetPdfReportDataCommand.js +7 -7
  205. package/src/report/command/GetReportCommand.js +39 -39
  206. package/src/report/command/GetReportFieldsCommand.js +42 -42
  207. package/src/report/command/GetReportInfoCommand.js +29 -29
  208. package/src/report/command/GetReportRevisionCommand.js +25 -25
  209. package/src/report/command/GetReportVersionListCommand.js +28 -28
  210. package/src/report/command/PublisherPdfCommand.js +52 -52
  211. package/src/report/command/RestoreReportCommand.js +27 -27
  212. package/src/report/component/BoundListPagingToolbar.scss +7 -7
  213. package/src/report/component/EXTJSReportUploadForm.js +175 -175
  214. package/src/report/component/ErrorWindow.scss +15 -15
  215. package/src/report/component/EventKeyBox.js +20 -20
  216. package/src/report/component/IsweSimplestReportCombo.js +40 -40
  217. package/src/report/component/LookupCombo.js +24 -24
  218. package/src/report/component/ParameterizedReportCombo.scss +85 -85
  219. package/src/report/component/ReportPanel.scss +69 -69
  220. package/src/report/component/SimpleReportTag.scss +18 -18
  221. package/src/report/component/SubentityCombo.js +12 -12
  222. package/src/report/component/reportpanel/FilterPanel.scss +16 -16
  223. package/src/report/component/reportpanel/FilterPanelLegend.js +71 -71
  224. package/src/report/component/reportpanel/FilterPanelLegend.scss +23 -23
  225. package/src/report/component/reportpanel/ReportGrid.scss +19 -19
  226. package/src/report/component/reportpanel/ReportStore.js +55 -55
  227. package/src/report/component/reportpanel/ReportTreeStore.js +38 -38
  228. package/src/report/component/settings/AddVersioningTab.js +19 -19
  229. package/src/report/component/settings/ReportFieldPropertiesGrid.js +80 -80
  230. package/src/report/component/settings/ReportFormEditPanel.scss +87 -87
  231. package/src/report/component/settings/field/ReportFormFieldsGrid.scss +5 -5
  232. package/src/report/component/settings/parameter/ReportFormParameterEditPanel.js +64 -64
  233. package/src/report/component/settings/parameter/ReportFormParameterEditPanelController.js +124 -124
  234. package/src/report/component/settings/parameter/ReportFormParametersGridController.js +91 -91
  235. package/src/report/component/settings/plugin/PluginSelectWindow.js +245 -245
  236. package/src/report/component/settings/plugin/ReportFormPluginGrid.js +24 -16
  237. package/src/report/component/settings/plugin/ReportFormPluginGridController.js +25 -8
  238. package/src/report/component/settings/plugin/ReportFormPluginPanel.js +3 -1
  239. package/src/report/component/settings/plugin/ReportFormPluginSettings.js +208 -0
  240. package/src/report/component/settings/plugin/SpecificPluginSelectWindow.js +8 -8
  241. package/src/report/component/settings/property/ReportPropertiesPanel.scss +12 -12
  242. package/src/report/component/tab/ReportTabView.js +59 -59
  243. package/src/report/model/AccountDocumentBean.js +33 -33
  244. package/src/report/model/AccountDocumentBeanFields.js +35 -35
  245. package/src/report/model/ActionCodeBean.js +17 -17
  246. package/src/report/model/ActionCodeBeanFields.js +8 -8
  247. package/src/report/model/ActionCodeGroupBean.js +18 -18
  248. package/src/report/model/ActionCodeGroupBeanFields.js +9 -9
  249. package/src/report/model/BillingDocumentFields.js +29 -29
  250. package/src/report/model/BillingDocumentStateBean.js +20 -20
  251. package/src/report/model/BillingDocumentStateBeanFields.js +11 -11
  252. package/src/report/model/CharacteristicBean.js +37 -37
  253. package/src/report/model/CharacteristicBeanFields.js +30 -30
  254. package/src/report/model/ColorPluginBean.js +16 -16
  255. package/src/report/model/ColorPluginBeanFields.js +16 -16
  256. package/src/report/model/ComboValueWrapper.js +16 -16
  257. package/src/report/model/ComboValueWrapperFields.js +6 -6
  258. package/src/report/model/ConfigReportPropertyBeanFields.js +7 -7
  259. package/src/report/model/ConfigureCharacteristicBean.js +36 -36
  260. package/src/report/model/ConfigureCharacteristicBeanFields.js +27 -27
  261. package/src/report/model/FiltersPluginBean.js +12 -12
  262. package/src/report/model/FiltersPluginBeanFields.js +6 -6
  263. package/src/report/model/GroupButtonsPluginBean.js +16 -16
  264. package/src/report/model/GroupButtonsPluginBeanFields.js +13 -13
  265. package/src/report/model/LimitBean.js +27 -27
  266. package/src/report/model/LimitBeanFields.js +21 -21
  267. package/src/report/model/LimitDetailsBeanFields.js +12 -12
  268. package/src/report/model/LogRequestBean.js +19 -19
  269. package/src/report/model/LogRequestFields.js +11 -11
  270. package/src/report/model/LookupBean.js +16 -16
  271. package/src/report/model/LookupBeanFields.js +7 -7
  272. package/src/report/model/MenuGroupCharacteristicTypeBean.js +17 -17
  273. package/src/report/model/MenuGroupCharacteristicTypeBeanFields.js +8 -8
  274. package/src/report/model/RawCharacteristicValueBean.js +21 -21
  275. package/src/report/model/RawCharacteristicValueBeanFields.js +12 -12
  276. package/src/report/model/ReportAccessGroupBean.js +18 -18
  277. package/src/report/model/ReportAccessGroupBeanFields.js +9 -9
  278. package/src/report/model/ReportBeanFields.js +12 -12
  279. package/src/report/model/ReportFieldBean.js +26 -26
  280. package/src/report/model/ReportFieldBeanFields.js +10 -10
  281. package/src/report/model/ReportFieldPropertyBean.js +20 -20
  282. package/src/report/model/ReportFieldPropertyBeanFields.js +17 -17
  283. package/src/report/model/ReportFormBeanFields.js +20 -20
  284. package/src/report/model/ReportMaintenanceBean.js +26 -26
  285. package/src/report/model/ReportMaintenanceBeanFields.js +23 -23
  286. package/src/report/model/ReportNavigationContextBeanFields.js +16 -16
  287. package/src/report/model/ReportParameterBeanFields.js +14 -14
  288. package/src/report/model/ReportParameterMaintenanceBean.js +33 -33
  289. package/src/report/model/ReportParameterMaintenanceBeanFields.js +29 -29
  290. package/src/report/model/ReportPluginBeanFields.js +10 -10
  291. package/src/report/model/ReportPluginMaintenanceBean.js +22 -22
  292. package/src/report/model/ReportPluginMaintenanceBeanFields.js +17 -17
  293. package/src/report/model/ReportPropertyBean.js +19 -19
  294. package/src/report/model/ReportPropertyBeanFields.js +13 -13
  295. package/src/report/model/SummaryPluginBeanFields.js +7 -7
  296. package/src/report/model/ToggleColumnsPluginBean.js +12 -12
  297. package/src/report/model/ToggleColumnsPluginBeanFields.js +6 -6
  298. package/src/report/model/TownBeanFields.js +7 -7
  299. package/src/report/model/TownTypeBean.js +17 -17
  300. package/src/report/model/TownTypeBeanFields.js +8 -8
  301. package/src/report/model/UsersGroupsValueBean.js +16 -16
  302. package/src/report/model/UsersGroupsValueBeanFields.js +7 -7
  303. package/src/report/model/WizardBean.js +17 -17
  304. package/src/report/model/WizardBeanFields.js +8 -8
  305. package/src/report/plugin/SearchByPropButton.js +15 -15
  306. package/src/report/plugin/SettingsManagerPlugin/SettingsManagerPlugin.js +193 -193
  307. package/src/report/plugin/SettingsManagerPlugin/model/SMPProfileEntry.js +28 -28
  308. package/src/report/plugin/SettingsManagerPlugin/store/SMPAbstractEntryStore.js +89 -89
  309. package/src/report/plugin/SettingsManagerPlugin/store/SMPLocalEntryStore.js +64 -64
  310. package/src/report/plugin/SettingsManagerPlugin/store/SMPRemoteEntryStore.js +6 -6
  311. package/src/report/plugin/SettingsManagerPlugin/view/SMPMainView.js +300 -300
  312. package/src/report/plugin/SettingsManagerPlugin/view/SMPMainView.scss +3 -3
  313. package/src/report/plugin/SettingsManagerPlugin/view/SMPMainViewController.js +183 -183
  314. package/src/report/plugin/SettingsManagerPlugin/view/SMPMainViewModel.js +82 -82
  315. package/src/report/plugin/comboBtnWrapper.js +27 -27
  316. package/src/report/plugin/configPanel/BasePluginConfig.js +256 -256
  317. package/src/report/plugin/configPanel/CalculateCellSumPluginConfigPanel.js +29 -29
  318. package/src/report/plugin/configPanel/ChangeFieldValuePluginConfigGrid.js +110 -110
  319. package/src/report/plugin/configPanel/ExecuteCommandButtonPluginConfigPanel.scss +5 -5
  320. package/src/report/plugin/configPanel/GridEditorPluginConfigGrid.js +145 -145
  321. package/src/report/plugin/configPanel/GridFiltersPluginConfigPanelFiltersGrid.js +107 -107
  322. package/src/report/plugin/configPanel/GridRowAddPluginConfigPanel.js +146 -146
  323. package/src/report/plugin/configPanel/GridRowStylePluginConfigPropertyGrid.js +185 -185
  324. package/src/report/plugin/configPanel/GridToolbarButtonPluginConfigPanel.js +249 -249
  325. package/src/report/plugin/configPanel/GroupButtonsPluginConfigGrid.js +149 -149
  326. package/src/report/plugin/configPanel/GroupRowsPluginConfigPanel.scss +3 -3
  327. package/src/report/plugin/configPanel/SelectRowsPluginConfigPanel.js +35 -35
  328. package/src/report/plugin/configPanel/SetParameterPluginConfigPanel.js +108 -108
  329. package/src/report/plugin/configPanel/SpecificPluginConfig.js +45 -45
  330. package/src/report/plugin/configPanel/TextToTitleConfigPanel.js +74 -74
  331. package/src/report/plugin/configPanel/ToggleColumnsPluginConfigPanelAdditionalColumnsGrid.js +94 -94
  332. package/src/report/plugin/configPanel/ToolbarButtonPluginConfigPanel.js +164 -164
  333. package/src/report/plugin/configPanel/ToolbarItemPluginConfigPanel.js +83 -83
  334. package/src/report/plugin/configPanel/TreeFilterPluginConfigPanel.js +38 -38
  335. package/src/report/plugin/configPanel/common/pluginDescriptionLabel.js +7 -7
  336. package/src/report/plugin/configPanel/common/pluginDescriptionLabel.scss +8 -8
  337. package/src/report/plugin/configPanel/openCustomPanelButtonPlugin/ReportFormContextXTypeMappingGrid.js +71 -71
  338. package/src/report/plugin/configPanel/reportGroupsFieldValidationPlugin/RequiredParametersTree.js +157 -157
  339. package/src/report/plugin/configPanel/reportGroupsFieldValidationPlugin/UnusedParametersTree.js +66 -66
  340. package/src/report/plugin/form/ComboCustomSort.js +39 -39
  341. package/src/report/plugin/form/ComboLoadingProgress.js +78 -78
  342. package/src/report/plugin/form/CopyToClipboardPlugin.js +75 -75
  343. package/src/report/plugin/form/DatePeriodValidatePluginFactory.js +79 -79
  344. package/src/report/plugin/form/EnterConfirmFormPlugin.js +55 -55
  345. package/src/report/plugin/form/FieldOnEnterChangePlugin.js +27 -27
  346. package/src/report/plugin/form/FormFieldHidding.js +32 -32
  347. package/src/report/plugin/form/ReadOnlyFieldPlugin.js +24 -24
  348. package/src/report/plugin/form/ReportGroupsFieldValidationPlugin.js +222 -222
  349. package/src/report/plugin/form/ValidateFieldPlugin.js +42 -42
  350. package/src/report/plugin/form/WindowCheckStatePlugin.js +84 -84
  351. package/src/report/plugin/grid/AddRowButtonPlugin.js +33 -33
  352. package/src/report/plugin/grid/BadgeButtonPlugin.js +70 -70
  353. package/src/report/plugin/grid/CalculateCellSumPlugin.js +186 -186
  354. package/src/report/plugin/grid/ChangeFieldValueButtonPlugin.js +79 -79
  355. package/src/report/plugin/grid/CopyCellToSource.js +80 -80
  356. package/src/report/plugin/grid/CustomColumnSortPlugin.js +39 -39
  357. package/src/report/plugin/grid/DataSourceSelectionPlugin.js +164 -164
  358. package/src/report/plugin/grid/DeleteRowButtonPlugin.js +145 -145
  359. package/src/report/plugin/grid/ExecuteApiCommandButtonPlugin.js +23 -23
  360. package/src/report/plugin/grid/ExecuteCommandAndSaveNotePlugin.js +49 -49
  361. package/src/report/plugin/grid/ExecuteCommandButtonPlugin.js +136 -136
  362. package/src/report/plugin/grid/ExporterPlugin.js +43 -43
  363. package/src/report/plugin/grid/FilterGridColumnsPlugin.js +79 -79
  364. package/src/report/plugin/grid/FormPanelStatePlugin.js +91 -91
  365. package/src/report/plugin/grid/GetAdditionalContextPlugin.js +73 -73
  366. package/src/report/plugin/grid/GridContextMenu.js +83 -83
  367. package/src/report/plugin/grid/GridContextPlugin.js +248 -248
  368. package/src/report/plugin/grid/GridEditButtonsDeleteBehavior.js +62 -62
  369. package/src/report/plugin/grid/GridFiltersByKeyPressingPlugin.js +99 -99
  370. package/src/report/plugin/grid/GridFiltersInHeadersPlugin.js +69 -69
  371. package/src/report/plugin/grid/GridFiltersPlugin.js +164 -164
  372. package/src/report/plugin/grid/GridFiltersPopupPlugin.js +106 -106
  373. package/src/report/plugin/grid/GridHistoryBehaviorPlugin.js +260 -260
  374. package/src/report/plugin/grid/GridHistoryBehaviorStep.js +45 -45
  375. package/src/report/plugin/grid/GridNoSelectPlugin.js +30 -30
  376. package/src/report/plugin/grid/GridRecordViewerPlugin.js +97 -97
  377. package/src/report/plugin/grid/GridRowAddPlugin.js +40 -40
  378. package/src/report/plugin/grid/GridRowCountPlugin.js +57 -57
  379. package/src/report/plugin/grid/GridRowEditingByEnterPlugin.js +44 -44
  380. package/src/report/plugin/grid/GridRowStylePlugin.scss +56 -56
  381. package/src/report/plugin/grid/GridRowTooltipForCellPlugin.js +118 -118
  382. package/src/report/plugin/grid/GridStoreDependency.js +63 -63
  383. package/src/report/plugin/grid/GridToolbarButtonPlugin.js +205 -205
  384. package/src/report/plugin/grid/GroupButtonsPlugin.js +120 -120
  385. package/src/report/plugin/grid/GroupRowsPlugin.js +133 -133
  386. package/src/report/plugin/grid/HideItemPlugin.js +54 -54
  387. package/src/report/plugin/grid/MenuPanel.js +44 -44
  388. package/src/report/plugin/grid/MultiEditorPlugin.js +119 -119
  389. package/src/report/plugin/grid/OpenURLButtonPlugin.js +48 -48
  390. package/src/report/plugin/grid/PrintPdfButtonPlugin.js +210 -210
  391. package/src/report/plugin/grid/ReportBoxContainerPlugin.js +30 -30
  392. package/src/report/plugin/grid/ReportCharacteristicBindPluginPanel.js +66 -66
  393. package/src/report/plugin/grid/ReportContainerPlugin.js +69 -69
  394. package/src/report/plugin/grid/ReportTabContainerPlugin.js +67 -67
  395. package/src/report/plugin/grid/ReportTabContainerPlugin.scss +3 -3
  396. package/src/report/plugin/grid/RestoreSelectionPlugin.js +93 -93
  397. package/src/report/plugin/grid/SaveTreeViewConfiguration.js +46 -46
  398. package/src/report/plugin/grid/SetCheckboxesPlugin.js +88 -88
  399. package/src/report/plugin/grid/SetParameterPlugin.js +139 -139
  400. package/src/report/plugin/grid/SetReportParameterPlugin.js +108 -108
  401. package/src/report/plugin/grid/SetSingleParameterPlugin.js +68 -68
  402. package/src/report/plugin/grid/SetValuePlugin.js +13 -13
  403. package/src/report/plugin/grid/StoreFiltersByKeyPressingPlugin.js +114 -114
  404. package/src/report/plugin/grid/SummaryPlugin.js +109 -109
  405. package/src/report/plugin/grid/TextToTitlePlugin.js +93 -93
  406. package/src/report/plugin/grid/ToggleColumnsPlugin.js +161 -161
  407. package/src/report/plugin/grid/ToggleColumnsPlugin.scss +7 -7
  408. package/src/report/plugin/grid/ToolbarButtonPlugin.scss +3 -3
  409. package/src/report/plugin/grid/ToolbarItemPlugin.js +142 -142
  410. package/src/report/plugin/grid/ToolbarSeparatorPlugin.js +16 -16
  411. package/src/report/plugin/grid/UpdateGridPlugin.js +82 -82
  412. package/src/report/plugin/htmlEditor/ToolbarCombo.js +18 -18
  413. package/src/report/plugin/htmlEditor/ToolbarElement.js +34 -34
  414. package/src/report/plugin/report/BindDataViewPanelPlugin.js +65 -65
  415. package/src/report/plugin/report/IsweBindCustomPanelPlugin.js +68 -68
  416. package/src/report/store/AccountDocumentStore.js +49 -49
  417. package/src/report/store/ActionCodeGroupStore.js +19 -19
  418. package/src/report/store/ActionCodeStore.js +20 -20
  419. package/src/report/store/BillingDocumentStateListStore.js +22 -22
  420. package/src/report/store/BillingLookupStore.js +36 -36
  421. package/src/report/store/CharacteristicListStore.js +26 -26
  422. package/src/report/store/ColorPluginStore.js +19 -19
  423. package/src/report/store/ComboValueWrapperStore.js +18 -18
  424. package/src/report/store/FiltersPluginStore.js +19 -19
  425. package/src/report/store/GroupButtonsPluginStore.js +19 -19
  426. package/src/report/store/LimitDetailsStore.js +24 -24
  427. package/src/report/store/LimitStore.js +28 -28
  428. package/src/report/store/LookupStore.js +19 -19
  429. package/src/report/store/MenuGroupCharacteristicTypeListStore.js +18 -18
  430. package/src/report/store/RawCharacteristicValueListStore.js +18 -18
  431. package/src/report/store/RefStore.js +19 -19
  432. package/src/report/store/ReportFieldPropertyStore.js +25 -25
  433. package/src/report/store/ReportFieldStore.js +22 -22
  434. package/src/report/store/ReportNavigationContextStore.js +24 -24
  435. package/src/report/store/ReportParameterStore.js +21 -21
  436. package/src/report/store/ReportPluginStore.js +29 -29
  437. package/src/report/store/ReportPropertyStore.js +23 -23
  438. package/src/report/store/RequestLogStore.js +18 -18
  439. package/src/report/store/SimpleCharacteristicListStore.js +19 -19
  440. package/src/report/store/SimpleFilterPluginStore.js +19 -19
  441. package/src/report/store/SummaryPluginStore.js +19 -19
  442. package/src/report/store/ToggleColumnsPluginStore.js +19 -19
  443. package/src/report/store/TownTypeStore.js +19 -19
  444. package/src/report/store/WizardStore.js +20 -20
  445. package/src/research/ResearchTreeView.scss +19 -19
  446. package/src/research/TabItemWrapper.js +44 -44
  447. package/src/research/TabItemWrapperViewModel.js +19 -19
  448. package/src/research/command/GetCoonChartStructure.js +63 -63
  449. package/src/research/command/GetReportStructure.js +154 -154
  450. package/src/research/command/GetUiStructure.js +124 -124
  451. package/src/research/command/GetWidgetPanelStructure.js +76 -76
  452. package/src/security/Manager.js +30 -30
  453. package/src/security/Map.js +48 -48
  454. package/src/security/PropertyDataParser.js +135 -135
  455. package/src/security/component/role/RoleStore.js +4 -4
  456. package/src/security/component/role/RoleTagField.js +17 -17
  457. package/src/security/component/ui/UiCPRestrictionEditor.scss +4 -4
  458. package/src/security/component/ui/UiCPRestrictionEditorController.js +166 -166
  459. package/src/security/restriction/Visibility.js +45 -45
  460. package/src/security/type/uiElement.js +54 -54
  461. package/src/stateProvider.js +20 -20
  462. package/src/uielement/command/ExecuteApiCommand.js +15 -15
  463. package/src/uielement/command/GetMenuTreeCommand.js +23 -23
  464. package/src/uielement/command/GetNavigateUIMenuEntryCommand.js +23 -23
  465. package/src/uielement/command/GetNextUIMenuEntryCommand.js +22 -22
  466. package/src/uielement/command/GetUIElementPropertyDocLinkCommand.js +18 -18
  467. package/src/uielement/command/GetUIElementRevisionCommand.js +25 -25
  468. package/src/uielement/command/GetUIElementVersionListCommand.js +27 -27
  469. package/src/uielement/component/CodemirrorEditor.js +68 -68
  470. package/src/uielement/component/MenuItemList.scss +35 -35
  471. package/src/uielement/component/UiCPVisualEditor.scss +108 -108
  472. package/src/uielement/component/UiCustomPanel.js +44 -44
  473. package/src/uielement/component/UiCustomPanelViewModel.js +15 -15
  474. package/src/uielement/component/UiElementController.js +205 -205
  475. package/src/uielement/component/UiElementLookupCombo.js +190 -190
  476. package/src/uielement/component/UiElementPropertyController.js +111 -111
  477. package/src/uielement/component/UiElementPropertyInfoController.js +23 -23
  478. package/src/uielement/component/UiElementPropertyPanel.js +80 -80
  479. package/src/uielement/component/formchips/Chip.js +87 -87
  480. package/src/uielement/component/formchips/FilterConditionToolbar.js +115 -115
  481. package/src/uielement/component/formchips/FilterConditionToolbar.scss +46 -46
  482. package/src/uielement/component/formchips/FilterConditionToolbarController.js +169 -169
  483. package/src/uielement/component/settings/AddVersioningTab.js +26 -26
  484. package/src/uielement/component/settings/EXTJSUiPanelImportJsonForm.js +42 -42
  485. package/src/uielement/component/settings/FrameView.js +113 -113
  486. package/src/uielement/component/settings/FrameViewController.js +132 -132
  487. package/src/uielement/component/settings/PropertyModel.js +8 -8
  488. package/src/uielement/component/settings/PropertyTreePanel.js +121 -121
  489. package/src/uielement/component/settings/UiCustomPanelAnnotationWindow.js +71 -71
  490. package/src/uielement/component/settings/config/UiCPConfigPanelController.scss +24 -24
  491. package/src/uielement/component/settings/linter/rule/BindRule.js +40 -40
  492. package/src/uielement/component/settings/linter/rule/BracesRule.js +68 -68
  493. package/src/uielement/component/settings/linter/rule/HandlerRule.js +45 -45
  494. package/src/uielement/component/settings/linter/rule/LayoutRule.js +24 -24
  495. package/src/uielement/component/settings/linter/rule/ReferenceRule.js +53 -53
  496. package/src/uielement/component/settings/linter/rule/XtypeRule.js +31 -31
  497. package/src/uielement/component/settings/plugin/UiCustomPanelPluginGrid.js +206 -206
  498. package/src/uielement/component/settings/plugin/UiCustomPanelPluginGrid.scss +11 -11
  499. package/src/uielement/component/settings/plugin/UiCustomPanelPluginGridController.js +205 -205
  500. package/src/uielement/component/settings/plugin/UiCustomPanelPluginPanel.scss +11 -11
  501. package/src/uielement/component/settings/plugin/UiCustomPanelPluginSelectWindow.js +152 -152
  502. package/src/uielement/component/settings/version/UiCPVersionPanel.scss +15 -15
  503. package/src/uielement/model/UIElementBeanFields.js +8 -8
  504. package/src/uielement/model/UiElementPropertyModel.js +31 -31
  505. package/src/uielement/plugin/AddBindingsPlugin.js +18 -18
  506. package/src/uielement/plugin/AddDoInitSupportPlugin.js +66 -66
  507. package/src/uielement/plugin/AddOutputParamsPlugin.js +22 -22
  508. package/src/uielement/plugin/ExecuteApiCommandPlugin.js +52 -52
  509. package/src/uielement/plugin/ExecuteCommandPlugin.js +8 -3
  510. package/src/uielement/plugin/ExecuteFunctionPlugin.js +26 -26
  511. package/src/uielement/plugin/FireEventPlugin.js +31 -31
  512. package/src/uielement/plugin/MethodChainPlugin.js +24 -24
  513. package/src/uielement/plugin/OpenPanelPlugin.js +90 -90
  514. package/src/uielement/plugin/configPanel/AddBindingsPluginConfigPanelFormEditor.scss +29 -29
  515. package/src/uielement/plugin/configPanel/AddDoInitSupportPluginConfigPanel.js +214 -214
  516. package/src/uielement/plugin/configPanel/AddDoInitSupportPluginPropertiesGrid.js +62 -62
  517. package/src/uielement/plugin/configPanel/AddDoInitSupportPluginPropertiesGridController.js +102 -102
  518. package/src/uielement/plugin/configPanel/AddOutputParamsPluginConfigPanelFormEditor.js +110 -110
  519. package/src/uielement/plugin/configPanel/ExecuteApiCommandPluginConfigPanel.js +850 -850
  520. package/src/uielement/plugin/configPanel/ExecuteFunctionPluginConfigPanelFormEditor.js +86 -86
  521. package/src/uielement/plugin/configPanel/FireEventPluginConfigPanelFormEditor.js +107 -107
  522. package/src/uielement/plugin/configPanel/OpenPanelPluginConfigPanelFormEditor.js +239 -239
  523. package/src/uielement/plugin/configPanel/PrintPdfPluginConfigPanelFormEditor.js +350 -350
  524. package/src/userSettings.js +161 -161
  525. package/src/version.js +1 -1
  526. package/util/update.js +75 -75
@@ -1,515 +1,515 @@
1
- Coon.common.component.editor.CharacteristicEditorTypes = {
2
- TEXT: 'TEXT',
3
- FLOAT: 'FLOAT',
4
- INT: 'INT',
5
- DATE: 'DATE',
6
- LIST: 'LIST',
7
- FOREIGN: 'FOREIGN',
8
- FILE: 'FILE',
9
- };
10
-
11
- Ext.define('Coon.common.component.editor.EditorFactory', {
12
- alternateClassName: [
13
- 'SigmaUtilities.view.common.component.editor.EditorFactory'
14
- ],
15
- constructor: {
16
- grid: undefined,
17
- editors: {},
18
- },
19
-
20
- getEditorForType: function(record, context) {
21
- return this.createEditor(this.compareEditor(record), record, context);
22
- },
23
-
24
- compareEditor: function(record) {
25
- let editorType = null;
26
-
27
- const entity = record.get(Coon.report.model.CharacteristicBeanFields.$entity);
28
-
29
- if (entity === 'ADV') {
30
- const type = record.get(Coon.report.model.CharacteristicBeanFields.$typeOfValue);
31
-
32
- if (type === 'TEXT') {
33
- editorType = Coon.common.component.editor.CharacteristicEditorTypes.TEXT;
34
- } else if (type === 'DATE') {
35
- editorType = Coon.common.component.editor.CharacteristicEditorTypes.DATE;
36
- } else if (type === 'MON' || type === 'BGDC' || type === 'PRCT' || type === 'PRPR') {
37
- editorType = Coon.common.component.editor.CharacteristicEditorTypes.FLOAT;
38
- } else if (type === 'INT') {
39
- editorType = Coon.common.component.editor.CharacteristicEditorTypes.INT;
40
- }
41
- } else if (entity === 'DFV') {
42
- editorType = Coon.common.component.editor.CharacteristicEditorTypes.LIST;
43
- } else if (entity === 'FKV') {
44
- editorType = Coon.common.component.editor.CharacteristicEditorTypes.FOREIGN;
45
- } else if (entity === 'FLV') {
46
- editorType = Coon.common.component.editor.CharacteristicEditorTypes.FILE;
47
- }
48
-
49
- return editorType;
50
- },
51
-
52
- createEditor: function(type, record, context) {
53
- if (!type) {
54
- throw new Ext.Error('Тип редактора не задан');
55
- }
56
- Coon.log.debug('createEditor', type);
57
- if (type === Coon.common.component.editor.CharacteristicEditorTypes.FOREIGN ||
58
- type === Coon.common.component.editor.CharacteristicEditorTypes.FILE ||
59
- !Ext.isEmpty(record.get(Coon.report.model.CharacteristicBeanFields.$editor))) {
60
- return new Coon.common.component.editor.CustomTypeEditor({
61
- record: record,
62
- context: context,
63
- grid: this.grid,
64
- });
65
- } else {
66
- let editor = this.editors[type];
67
- if (!editor) {
68
- switch (type) {
69
- case Coon.common.component.editor.CharacteristicEditorTypes.TEXT:
70
- editor = new Coon.common.component.editor.TextTypeEditor();
71
- break;
72
- case Coon.common.component.editor.CharacteristicEditorTypes.FLOAT:
73
- editor = new Coon.common.component.editor.NumberTypeEditor();
74
- break;
75
- case Coon.common.component.editor.CharacteristicEditorTypes.INT:
76
- editor = new Coon.common.component.editor.IntTypeEditor();
77
- break;
78
- case Coon.common.component.editor.CharacteristicEditorTypes.DATE:
79
- editor = new Coon.common.component.editor.DateTypeEditor();
80
- break;
81
- case Coon.common.component.editor.CharacteristicEditorTypes.LIST:
82
- editor = new Coon.common.component.editor.DFVTypeEditor();
83
- break;
84
- default:
85
- throw new Ext.Error('Не определен тип редактора');
86
- }
87
-
88
- this.editors[type] = editor;
89
- }
90
-
91
- return editor;
92
- }
93
- },
94
- });
95
-
96
- Ext.define('Coon.common.component.editor.TypeEditor', {
97
- extend: 'Ext.grid.CellEditor',
98
- alternateClassName: [
99
- 'SigmaUtilities.view.common.component.editor.TypeEditor'
100
- ],
101
-
102
- constructor: function(config) {
103
- this.record = config ? config.record : null;
104
- this.context = config ? config.context : null;
105
- this.grid = config ? config.grid : null;
106
- this.callParent([config]);
107
- },
108
-
109
- show: function() {
110
- this.callParent(arguments);
111
- this.prepare();
112
- },
113
-
114
- createField: Ext.emptyFn,
115
-
116
- setData: Ext.emptyFn,
117
-
118
- prepare: Ext.emptyFn,
119
- });
120
-
121
- /**
122
- * Текстовый редактор
123
- */
124
- Ext.define('Coon.common.component.editor.TextTypeEditor', {
125
- extend: 'Coon.common.component.editor.TypeEditor',
126
- alternateClassName: [
127
- 'SigmaUtilities.view.common.component.editor.TextTypeEditor'
128
- ],
129
- alias: 'widget.TextTypeEditor',
130
-
131
- config: {
132
- field: {
133
- xtype: 'textfield',
134
- allowBlank: true,
135
- maskRe: undefined,
136
- regex: undefined,
137
- regexText: undefined,
138
- },
139
- },
140
-
141
- setData: function(value, record) {
142
- const ns = Coon.report.model.CharacteristicBeanFields;
143
- const re = new RegExp('^\\d{10}$');
144
- if (record.recTyp && record.recTyp === 'passport' && re.test(value.replace(/\s/g, ''))) {
145
- value = value.slice(0, 2) + ' ' + value.slice(2, 4) + ' ' + value.slice(4);
146
- }
147
- record.set(ns.$valueDescription, value);
148
- },
149
-
150
- prepare: function() {
151
- const ns = Coon.report.model.CharacteristicBeanFields;
152
- const record = this.context.record;
153
- const type = this.grid.typeMap.get(record.get(ns.$type));
154
- const field = this.field;
155
- if (type && type[ns.$mask] !== ' ') {
156
- field.regexText = 'Некорректное заполнение поля';
157
- field.regex = new RegExp(type[ns.$mask]);
158
- field.maskRe = field.regex;
159
- record.recTyp = type[ns.$mask] === '^\\d{2}\\s*\\d{2}\\s*\\d{6}$' ? 'passport' : undefined;
160
- }
161
- if (type && type[ns.$mask] === ' ') {
162
- field.regexText = undefined;
163
- field.regex = undefined;
164
- field.maskRe = undefined;
165
- }
166
- },
167
- });
168
-
169
- /**
170
- * Числовой
171
- */
172
- Ext.define('Coon.common.component.editor.NumberTypeEditor', {
173
- extend: 'Coon.common.component.editor.TypeEditor',
174
- alternateClassName: [
175
- 'SigmaUtilities.view.common.component.editor.NumberTypeEditor'
176
- ],
177
- alias: 'widget.NumberTypeEditor',
178
-
179
- config: {
180
- field: {
181
- xtype: 'numberfield',
182
- allowBlank: true,
183
- minValue: undefined,
184
- maxValue: undefined,
185
- },
186
- },
187
-
188
- prepare: function() {
189
- const ns = Coon.report.model.CharacteristicBeanFields;
190
- const record = this.context.record;
191
- const type = this.grid.typeMap.get(record.get(ns.$type));
192
- const field = this.field;
193
- if (type && type.mask && type.mask.startsWith('minValue')) {
194
- const range = type[ns.$mask].split(';');
195
- field.minValue = range[0].slice(9);
196
- if (range.length === 2) {
197
- field.maxValue = range[1].slice(10);
198
- } else {
199
- field.maxValue = Number.POSITIVE_INFINITY;
200
- }
201
- } else {
202
- field.minValue = Number.NEGATIVE_INFINITY;
203
- }
204
- },
205
-
206
- setData: function(value, record) {
207
- const ns = Coon.report.model.CharacteristicBeanFields;
208
- const type = this.grid.typeMap.get(record.get(ns.$type));
209
- record.set(ns.$valueDescription, value);
210
- if (type.mask === 'minValue: 0' && value === 0) {
211
- record.set(ns.$valueDescription, 'Нет');
212
- }
213
- },
214
- });
215
-
216
- /**
217
- * Числовой
218
- */
219
- Ext.define('Coon.common.component.editor.IntTypeEditor', {
220
- extend: 'Coon.common.component.editor.NumberTypeEditor',
221
- alternateClassName: [
222
- 'SigmaUtilities.view.common.component.editor.IntTypeEditor'
223
- ],
224
- alias: 'widget.IntTypeEditor',
225
- config: {
226
- field: {
227
- xtype: 'numberfield',
228
- allowBlank: true,
229
- allowDecimals: false,
230
- },
231
- },
232
- });
233
-
234
- /**
235
- * Редактор дат
236
- */
237
- Ext.define('Coon.common.component.editor.DateTypeEditor', {
238
- extend: 'Coon.common.component.editor.TypeEditor',
239
- alternateClassName: [
240
- 'SigmaUtilities.view.common.component.editor.DateTypeEditor'
241
- ],
242
- alias: 'widget.DateTypeEditor',
243
-
244
- config: {
245
- field: {
246
- xtype: 'datefield',
247
- allowBlank: true,
248
- },
249
- },
250
-
251
- setData: function(value, record) {
252
- const ns = Coon.report.model.CharacteristicBeanFields;
253
- record.set(ns.$valueDescription, Ext.util.Format.dateRenderer('d.m.Y')(value));
254
- },
255
- });
256
-
257
- /**
258
- * Редактор DFV
259
- */
260
- Ext.define('Coon.common.component.editor.DFVTypeEditor', {
261
- extend: 'Coon.common.component.editor.TypeEditor',
262
- alternateClassName: [
263
- 'SigmaUtilities.view.common.component.editor.DFVTypeEditor'
264
- ],
265
- alias: 'widget.DFVTypeEditor',
266
-
267
- config: {
268
- field: {
269
- xtype: 'DFVCharacteristicField',
270
- characteristicType: '',
271
- listWidth: 350,
272
- allowBlank: true,
273
- loadOnRender: false,
274
- },
275
- },
276
-
277
- setData: function(value, record) {
278
- const ns = Coon.report.model.CharacteristicBeanFields;
279
- record.set(ns.$valueDescription, this.field.getVisibleValue());
280
- },
281
-
282
- prepare: function() {
283
- const record = this.context.record;
284
- const ns = Coon.report.model.CharacteristicBeanFields;
285
- const charType = record.get(ns.$type);
286
- const filterDate = record.get(ns.$filterDate);
287
- const value = record.get(ns.$value) && record.get(ns.$value).trim();
288
-
289
- this.field.setVisibleValue(record.get(ns.$valueDescription));
290
-
291
- if (charType !== this.field.characteristicType || this.field.effectiveDate !== filterDate) {
292
- this.field.setCharacteristicType(charType);
293
- this.field.setEffectiveDate(filterDate);
294
- this.field.on('load', function() {
295
- this.field.setValue(value);
296
- }, this, {single: true});
297
- this.field.doInit();
298
- }
299
- },
300
- });
301
-
302
- /**
303
- * Редактор внешних сущностей
304
- */
305
- Ext.define('Coon.common.component.editor.ForeignTypeEditor', {
306
- extend: 'Coon.common.component.editor.TypeEditor',
307
- alternateClassName: [
308
- 'SigmaUtilities.view.common.component.editor.ForeignTypeEditor'
309
- ],
310
- alias: 'widget.ForeignTypeEditor',
311
-
312
- createField: function() {
313
- const field = Ext.create('Coon.common.field.ForeignField', {
314
- searchForm: null,
315
- allowBlank: true,
316
- editable: false,
317
- });
318
-
319
- field.on('setValue', this.setValueHandler, this);
320
- field.initSearchForm = function(searchForm) {
321
- const ns = Coon.report.model.CharacteristicBeanFields;
322
-
323
- if (searchForm.doInit) {
324
- if (field.isAddMode) {
325
- searchForm.doInit.call(searchForm);
326
- } else {
327
- searchForm.doInit.call(searchForm, this.context.record.get(ns.$value));
328
- }
329
- }
330
- }.bind(this);
331
-
332
- return field;
333
- },
334
-
335
- setData: function(value, record) {
336
- const ns = Coon.report.model.CharacteristicBeanFields;
337
- record.set(ns.$valueDescription, this.field.getVisibleValue());
338
- },
339
-
340
- prepare: function() {
341
- const record = this.context.record;
342
- const ns = Coon.report.model.CharacteristicBeanFields;
343
-
344
- this.field.setVisibleValue(record.get(ns.$valueDescription));
345
-
346
-
347
- const refCode = record.get(ns.$editor) || record.get(ns.$type);
348
-
349
- this.editorCreator = null;
350
- if (Ext.ClassManager.aliasToName['widget.' + refCode]) {
351
- try {
352
- this.editorCreator = Ext.widget(refCode);
353
- } catch (e) {
354
- Coon.log.log(e);
355
- }
356
- }
357
-
358
- if (this.editorCreator) {
359
- let searchForm;
360
-
361
- this.field.isAddMode = false;
362
-
363
- if (this.editorCreator.searchByDefault) {
364
- searchForm = this.editorCreator.getSearchWindow();
365
- } else {
366
- if (record.get(ns.$value)) {
367
- searchForm = this.editorCreator.getEditWindow();
368
- } else {
369
- searchForm = this.editorCreator.getAddWindow();
370
- this.field.isAddMode = true;
371
- }
372
- }
373
-
374
- if (searchForm) {
375
- this.field.setSearchForm(searchForm);
376
- this.field.enable();
377
- return;
378
- }
379
- }
380
- this.field.disable();
381
- },
382
-
383
- setValueHandler: function(field, record) {
384
- this.editorCreator.processRecord(this.context.record, record);
385
-
386
- const ns = Coon.report.model.CharacteristicBeanFields;
387
- field.setValue(this.context.record.get(ns.$value), this.context.record.get(ns.$valueDescription));
388
- },
389
- });
390
-
391
-
392
- /**
393
- * Редактор внешних сущностей
394
- */
395
- Ext.define('Coon.common.component.editor.CustomTypeEditor', {
396
- extend: 'Coon.common.component.editor.TypeEditor',
397
- alternateClassName: [
398
- 'SigmaUtilities.view.common.component.editor.CustomTypeEditor'
399
- ],
400
- alias: 'widget.CustomTypeEditor',
401
- focusLeaveAction: 'setFocusLeaveAction',
402
-
403
- createField: function(record, context) {
404
- const ns = Coon.report.model.CharacteristicBeanFields;
405
-
406
- let field = null;
407
- const editorCode = record.get(ns.$editor);
408
- if (!Ext.isEmpty(editorCode)) {
409
- if (Ext.ClassManager.getByAlias('widget.' + editorCode)) {
410
- let editor = null;
411
- try {
412
- editor = Ext.widget(editorCode);
413
- if (editor.disableInternalEditor) {
414
- this.show = () => false;
415
- }
416
- } catch (e) {
417
- Coon.log.log(e);
418
- }
419
- if (editor) {
420
- field = editor.createField(record, this.grid);
421
-
422
- if (field.requiredInitField) {
423
- // Определение инициализирующих параметров из контекста
424
- const requiredArgs = field.requiredInitField();
425
- const listArgs = [];
426
-
427
- for (let i = 0; i < requiredArgs.length; i++) {
428
- const requiredArg = requiredArgs[i];
429
-
430
- if (Ext.isEmpty(context[requiredArg.name])) {
431
- if (requiredArg.required) {
432
- throw new Ext.Error(
433
- `Определен обязательный параметр инициализации ${requiredArg.name}, которого нет в контексте`
434
- );
435
- }
436
- listArgs.push(null);
437
- } else {
438
- listArgs.push(context[requiredArg.name]);
439
- }
440
- }
441
-
442
- field.doInit.apply(field, listArgs);
443
- editor.showPanel.call(editor, record, this.grid);
444
- field.on('change', this.afterEdit, this);
445
- }
446
-
447
- field.setValue(record.get(ns.$value));
448
- if (field.setVisibleValue) {
449
- field.setVisibleValue(record.get(ns.$valueDescription));
450
- }
451
- }
452
- } else {
453
- let uiElement = false;
454
- Coon.Function.doRequest(null, {
455
- params: {uiElementCd: editorCode, nullable: true},
456
- url: 'UIElement/get',
457
- callback: function(win, param, response) {
458
- uiElement = response.responseJSON || false;
459
- },
460
- }, true);
461
- if (uiElement) {
462
- let editor = null;
463
- try {
464
- editor = Ext.widget('CustomPanelEditorCreator', {uiElementCd: editorCode});
465
- } catch (e) {
466
- Coon.log.log(e);
467
- }
468
- if (editor) {
469
- field = editor.createField(record, this.grid);
470
- field.setValue(record.get(ns.$value));
471
- if (field.setVisibleValue) {
472
- field.setVisibleValue(record.get(ns.$valueDescription));
473
- }
474
- editor.showPanel(record, this.grid, uiElement);
475
- }
476
- }
477
- }
478
- }
479
- return field;
480
- },
481
-
482
- afterEdit: function() {
483
- this.completeEdit && this.completeEdit();
484
- if (this.boundEl || (this.context && this.context.getCell)) {
485
- this.restoreCell();
486
- }
487
- },
488
-
489
- setFocusLeaveAction: function() {
490
- if (this.field.requiredInitField) {
491
- return false;
492
- } else {
493
- this.completeEdit && this.completeEdit();
494
- }
495
- },
496
-
497
- setData: function(value, record) {
498
- const ns = Coon.report.model.CharacteristicBeanFields;
499
- if (this.field.getVisibleValue) {
500
- record.set(ns.$valueDescription, this.field.getVisibleValue());
501
- } else {
502
- record.set(ns.$valueDescription, null);
503
- }
504
- },
505
-
506
- prepare: function() {
507
- const record = this.context.record;
508
- const ns = Coon.report.model.CharacteristicBeanFields;
509
- this.field.setValue(record.get(ns.$value));
510
- if (this.field.setVisibleValue) {
511
- this.field.setVisibleValue(record.get(ns.$valueDescription));
512
- }
513
- },
514
- });
515
-
1
+ Coon.common.component.editor.CharacteristicEditorTypes = {
2
+ TEXT: 'TEXT',
3
+ FLOAT: 'FLOAT',
4
+ INT: 'INT',
5
+ DATE: 'DATE',
6
+ LIST: 'LIST',
7
+ FOREIGN: 'FOREIGN',
8
+ FILE: 'FILE',
9
+ };
10
+
11
+ Ext.define('Coon.common.component.editor.EditorFactory', {
12
+ alternateClassName: [
13
+ 'SigmaUtilities.view.common.component.editor.EditorFactory'
14
+ ],
15
+ constructor: {
16
+ grid: undefined,
17
+ editors: {},
18
+ },
19
+
20
+ getEditorForType: function(record, context) {
21
+ return this.createEditor(this.compareEditor(record), record, context);
22
+ },
23
+
24
+ compareEditor: function(record) {
25
+ let editorType = null;
26
+
27
+ const entity = record.get(Coon.report.model.CharacteristicBeanFields.$entity);
28
+
29
+ if (entity === 'ADV') {
30
+ const type = record.get(Coon.report.model.CharacteristicBeanFields.$typeOfValue);
31
+
32
+ if (type === 'TEXT') {
33
+ editorType = Coon.common.component.editor.CharacteristicEditorTypes.TEXT;
34
+ } else if (type === 'DATE') {
35
+ editorType = Coon.common.component.editor.CharacteristicEditorTypes.DATE;
36
+ } else if (type === 'MON' || type === 'BGDC' || type === 'PRCT' || type === 'PRPR') {
37
+ editorType = Coon.common.component.editor.CharacteristicEditorTypes.FLOAT;
38
+ } else if (type === 'INT') {
39
+ editorType = Coon.common.component.editor.CharacteristicEditorTypes.INT;
40
+ }
41
+ } else if (entity === 'DFV') {
42
+ editorType = Coon.common.component.editor.CharacteristicEditorTypes.LIST;
43
+ } else if (entity === 'FKV') {
44
+ editorType = Coon.common.component.editor.CharacteristicEditorTypes.FOREIGN;
45
+ } else if (entity === 'FLV') {
46
+ editorType = Coon.common.component.editor.CharacteristicEditorTypes.FILE;
47
+ }
48
+
49
+ return editorType;
50
+ },
51
+
52
+ createEditor: function(type, record, context) {
53
+ if (!type) {
54
+ throw new Ext.Error('Тип редактора не задан');
55
+ }
56
+ Coon.log.debug('createEditor', type);
57
+ if (type === Coon.common.component.editor.CharacteristicEditorTypes.FOREIGN ||
58
+ type === Coon.common.component.editor.CharacteristicEditorTypes.FILE ||
59
+ !Ext.isEmpty(record.get(Coon.report.model.CharacteristicBeanFields.$editor))) {
60
+ return new Coon.common.component.editor.CustomTypeEditor({
61
+ record: record,
62
+ context: context,
63
+ grid: this.grid,
64
+ });
65
+ } else {
66
+ let editor = this.editors[type];
67
+ if (!editor) {
68
+ switch (type) {
69
+ case Coon.common.component.editor.CharacteristicEditorTypes.TEXT:
70
+ editor = new Coon.common.component.editor.TextTypeEditor();
71
+ break;
72
+ case Coon.common.component.editor.CharacteristicEditorTypes.FLOAT:
73
+ editor = new Coon.common.component.editor.NumberTypeEditor();
74
+ break;
75
+ case Coon.common.component.editor.CharacteristicEditorTypes.INT:
76
+ editor = new Coon.common.component.editor.IntTypeEditor();
77
+ break;
78
+ case Coon.common.component.editor.CharacteristicEditorTypes.DATE:
79
+ editor = new Coon.common.component.editor.DateTypeEditor();
80
+ break;
81
+ case Coon.common.component.editor.CharacteristicEditorTypes.LIST:
82
+ editor = new Coon.common.component.editor.DFVTypeEditor();
83
+ break;
84
+ default:
85
+ throw new Ext.Error('Не определен тип редактора');
86
+ }
87
+
88
+ this.editors[type] = editor;
89
+ }
90
+
91
+ return editor;
92
+ }
93
+ },
94
+ });
95
+
96
+ Ext.define('Coon.common.component.editor.TypeEditor', {
97
+ extend: 'Ext.grid.CellEditor',
98
+ alternateClassName: [
99
+ 'SigmaUtilities.view.common.component.editor.TypeEditor'
100
+ ],
101
+
102
+ constructor: function(config) {
103
+ this.record = config ? config.record : null;
104
+ this.context = config ? config.context : null;
105
+ this.grid = config ? config.grid : null;
106
+ this.callParent([config]);
107
+ },
108
+
109
+ show: function() {
110
+ this.callParent(arguments);
111
+ this.prepare();
112
+ },
113
+
114
+ createField: Ext.emptyFn,
115
+
116
+ setData: Ext.emptyFn,
117
+
118
+ prepare: Ext.emptyFn,
119
+ });
120
+
121
+ /**
122
+ * Текстовый редактор
123
+ */
124
+ Ext.define('Coon.common.component.editor.TextTypeEditor', {
125
+ extend: 'Coon.common.component.editor.TypeEditor',
126
+ alternateClassName: [
127
+ 'SigmaUtilities.view.common.component.editor.TextTypeEditor'
128
+ ],
129
+ alias: 'widget.TextTypeEditor',
130
+
131
+ config: {
132
+ field: {
133
+ xtype: 'textfield',
134
+ allowBlank: true,
135
+ maskRe: undefined,
136
+ regex: undefined,
137
+ regexText: undefined,
138
+ },
139
+ },
140
+
141
+ setData: function(value, record) {
142
+ const ns = Coon.report.model.CharacteristicBeanFields;
143
+ const re = new RegExp('^\\d{10}$');
144
+ if (record.recTyp && record.recTyp === 'passport' && re.test(value.replace(/\s/g, ''))) {
145
+ value = value.slice(0, 2) + ' ' + value.slice(2, 4) + ' ' + value.slice(4);
146
+ }
147
+ record.set(ns.$valueDescription, value);
148
+ },
149
+
150
+ prepare: function() {
151
+ const ns = Coon.report.model.CharacteristicBeanFields;
152
+ const record = this.context.record;
153
+ const type = this.grid.typeMap.get(record.get(ns.$type));
154
+ const field = this.field;
155
+ if (type && type[ns.$mask] !== ' ') {
156
+ field.regexText = 'Некорректное заполнение поля';
157
+ field.regex = new RegExp(type[ns.$mask]);
158
+ field.maskRe = field.regex;
159
+ record.recTyp = type[ns.$mask] === '^\\d{2}\\s*\\d{2}\\s*\\d{6}$' ? 'passport' : undefined;
160
+ }
161
+ if (type && type[ns.$mask] === ' ') {
162
+ field.regexText = undefined;
163
+ field.regex = undefined;
164
+ field.maskRe = undefined;
165
+ }
166
+ },
167
+ });
168
+
169
+ /**
170
+ * Числовой
171
+ */
172
+ Ext.define('Coon.common.component.editor.NumberTypeEditor', {
173
+ extend: 'Coon.common.component.editor.TypeEditor',
174
+ alternateClassName: [
175
+ 'SigmaUtilities.view.common.component.editor.NumberTypeEditor'
176
+ ],
177
+ alias: 'widget.NumberTypeEditor',
178
+
179
+ config: {
180
+ field: {
181
+ xtype: 'numberfield',
182
+ allowBlank: true,
183
+ minValue: undefined,
184
+ maxValue: undefined,
185
+ },
186
+ },
187
+
188
+ prepare: function() {
189
+ const ns = Coon.report.model.CharacteristicBeanFields;
190
+ const record = this.context.record;
191
+ const type = this.grid.typeMap.get(record.get(ns.$type));
192
+ const field = this.field;
193
+ if (type && type.mask && type.mask.startsWith('minValue')) {
194
+ const range = type[ns.$mask].split(';');
195
+ field.minValue = range[0].slice(9);
196
+ if (range.length === 2) {
197
+ field.maxValue = range[1].slice(10);
198
+ } else {
199
+ field.maxValue = Number.POSITIVE_INFINITY;
200
+ }
201
+ } else {
202
+ field.minValue = Number.NEGATIVE_INFINITY;
203
+ }
204
+ },
205
+
206
+ setData: function(value, record) {
207
+ const ns = Coon.report.model.CharacteristicBeanFields;
208
+ const type = this.grid.typeMap.get(record.get(ns.$type));
209
+ record.set(ns.$valueDescription, value);
210
+ if (type.mask === 'minValue: 0' && value === 0) {
211
+ record.set(ns.$valueDescription, 'Нет');
212
+ }
213
+ },
214
+ });
215
+
216
+ /**
217
+ * Числовой
218
+ */
219
+ Ext.define('Coon.common.component.editor.IntTypeEditor', {
220
+ extend: 'Coon.common.component.editor.NumberTypeEditor',
221
+ alternateClassName: [
222
+ 'SigmaUtilities.view.common.component.editor.IntTypeEditor'
223
+ ],
224
+ alias: 'widget.IntTypeEditor',
225
+ config: {
226
+ field: {
227
+ xtype: 'numberfield',
228
+ allowBlank: true,
229
+ allowDecimals: false,
230
+ },
231
+ },
232
+ });
233
+
234
+ /**
235
+ * Редактор дат
236
+ */
237
+ Ext.define('Coon.common.component.editor.DateTypeEditor', {
238
+ extend: 'Coon.common.component.editor.TypeEditor',
239
+ alternateClassName: [
240
+ 'SigmaUtilities.view.common.component.editor.DateTypeEditor'
241
+ ],
242
+ alias: 'widget.DateTypeEditor',
243
+
244
+ config: {
245
+ field: {
246
+ xtype: 'datefield',
247
+ allowBlank: true,
248
+ },
249
+ },
250
+
251
+ setData: function(value, record) {
252
+ const ns = Coon.report.model.CharacteristicBeanFields;
253
+ record.set(ns.$valueDescription, Ext.util.Format.dateRenderer('d.m.Y')(value));
254
+ },
255
+ });
256
+
257
+ /**
258
+ * Редактор DFV
259
+ */
260
+ Ext.define('Coon.common.component.editor.DFVTypeEditor', {
261
+ extend: 'Coon.common.component.editor.TypeEditor',
262
+ alternateClassName: [
263
+ 'SigmaUtilities.view.common.component.editor.DFVTypeEditor'
264
+ ],
265
+ alias: 'widget.DFVTypeEditor',
266
+
267
+ config: {
268
+ field: {
269
+ xtype: 'DFVCharacteristicField',
270
+ characteristicType: '',
271
+ listWidth: 350,
272
+ allowBlank: true,
273
+ loadOnRender: false,
274
+ },
275
+ },
276
+
277
+ setData: function(value, record) {
278
+ const ns = Coon.report.model.CharacteristicBeanFields;
279
+ record.set(ns.$valueDescription, this.field.getVisibleValue());
280
+ },
281
+
282
+ prepare: function() {
283
+ const record = this.context.record;
284
+ const ns = Coon.report.model.CharacteristicBeanFields;
285
+ const charType = record.get(ns.$type);
286
+ const filterDate = record.get(ns.$filterDate);
287
+ const value = record.get(ns.$value) && record.get(ns.$value).trim();
288
+
289
+ this.field.setVisibleValue(record.get(ns.$valueDescription));
290
+
291
+ if (charType !== this.field.characteristicType || this.field.effectiveDate !== filterDate) {
292
+ this.field.setCharacteristicType(charType);
293
+ this.field.setEffectiveDate(filterDate);
294
+ this.field.on('load', function() {
295
+ this.field.setValue(value);
296
+ }, this, {single: true});
297
+ this.field.doInit();
298
+ }
299
+ },
300
+ });
301
+
302
+ /**
303
+ * Редактор внешних сущностей
304
+ */
305
+ Ext.define('Coon.common.component.editor.ForeignTypeEditor', {
306
+ extend: 'Coon.common.component.editor.TypeEditor',
307
+ alternateClassName: [
308
+ 'SigmaUtilities.view.common.component.editor.ForeignTypeEditor'
309
+ ],
310
+ alias: 'widget.ForeignTypeEditor',
311
+
312
+ createField: function() {
313
+ const field = Ext.create('Coon.common.field.ForeignField', {
314
+ searchForm: null,
315
+ allowBlank: true,
316
+ editable: false,
317
+ });
318
+
319
+ field.on('setValue', this.setValueHandler, this);
320
+ field.initSearchForm = function(searchForm) {
321
+ const ns = Coon.report.model.CharacteristicBeanFields;
322
+
323
+ if (searchForm.doInit) {
324
+ if (field.isAddMode) {
325
+ searchForm.doInit.call(searchForm);
326
+ } else {
327
+ searchForm.doInit.call(searchForm, this.context.record.get(ns.$value));
328
+ }
329
+ }
330
+ }.bind(this);
331
+
332
+ return field;
333
+ },
334
+
335
+ setData: function(value, record) {
336
+ const ns = Coon.report.model.CharacteristicBeanFields;
337
+ record.set(ns.$valueDescription, this.field.getVisibleValue());
338
+ },
339
+
340
+ prepare: function() {
341
+ const record = this.context.record;
342
+ const ns = Coon.report.model.CharacteristicBeanFields;
343
+
344
+ this.field.setVisibleValue(record.get(ns.$valueDescription));
345
+
346
+
347
+ const refCode = record.get(ns.$editor) || record.get(ns.$type);
348
+
349
+ this.editorCreator = null;
350
+ if (Ext.ClassManager.aliasToName['widget.' + refCode]) {
351
+ try {
352
+ this.editorCreator = Ext.widget(refCode);
353
+ } catch (e) {
354
+ Coon.log.log(e);
355
+ }
356
+ }
357
+
358
+ if (this.editorCreator) {
359
+ let searchForm;
360
+
361
+ this.field.isAddMode = false;
362
+
363
+ if (this.editorCreator.searchByDefault) {
364
+ searchForm = this.editorCreator.getSearchWindow();
365
+ } else {
366
+ if (record.get(ns.$value)) {
367
+ searchForm = this.editorCreator.getEditWindow();
368
+ } else {
369
+ searchForm = this.editorCreator.getAddWindow();
370
+ this.field.isAddMode = true;
371
+ }
372
+ }
373
+
374
+ if (searchForm) {
375
+ this.field.setSearchForm(searchForm);
376
+ this.field.enable();
377
+ return;
378
+ }
379
+ }
380
+ this.field.disable();
381
+ },
382
+
383
+ setValueHandler: function(field, record) {
384
+ this.editorCreator.processRecord(this.context.record, record);
385
+
386
+ const ns = Coon.report.model.CharacteristicBeanFields;
387
+ field.setValue(this.context.record.get(ns.$value), this.context.record.get(ns.$valueDescription));
388
+ },
389
+ });
390
+
391
+
392
+ /**
393
+ * Редактор внешних сущностей
394
+ */
395
+ Ext.define('Coon.common.component.editor.CustomTypeEditor', {
396
+ extend: 'Coon.common.component.editor.TypeEditor',
397
+ alternateClassName: [
398
+ 'SigmaUtilities.view.common.component.editor.CustomTypeEditor'
399
+ ],
400
+ alias: 'widget.CustomTypeEditor',
401
+ focusLeaveAction: 'setFocusLeaveAction',
402
+
403
+ createField: function(record, context) {
404
+ const ns = Coon.report.model.CharacteristicBeanFields;
405
+
406
+ let field = null;
407
+ const editorCode = record.get(ns.$editor);
408
+ if (!Ext.isEmpty(editorCode)) {
409
+ if (Ext.ClassManager.getByAlias('widget.' + editorCode)) {
410
+ let editor = null;
411
+ try {
412
+ editor = Ext.widget(editorCode);
413
+ if (editor.disableInternalEditor) {
414
+ this.show = () => false;
415
+ }
416
+ } catch (e) {
417
+ Coon.log.log(e);
418
+ }
419
+ if (editor) {
420
+ field = editor.createField(record, this.grid);
421
+
422
+ if (field.requiredInitField) {
423
+ // Определение инициализирующих параметров из контекста
424
+ const requiredArgs = field.requiredInitField();
425
+ const listArgs = [];
426
+
427
+ for (let i = 0; i < requiredArgs.length; i++) {
428
+ const requiredArg = requiredArgs[i];
429
+
430
+ if (Ext.isEmpty(context[requiredArg.name])) {
431
+ if (requiredArg.required) {
432
+ throw new Ext.Error(
433
+ `Определен обязательный параметр инициализации ${requiredArg.name}, которого нет в контексте`
434
+ );
435
+ }
436
+ listArgs.push(null);
437
+ } else {
438
+ listArgs.push(context[requiredArg.name]);
439
+ }
440
+ }
441
+
442
+ field.doInit.apply(field, listArgs);
443
+ editor.showPanel.call(editor, record, this.grid);
444
+ field.on('change', this.afterEdit, this);
445
+ }
446
+
447
+ field.setValue(record.get(ns.$value));
448
+ if (field.setVisibleValue) {
449
+ field.setVisibleValue(record.get(ns.$valueDescription));
450
+ }
451
+ }
452
+ } else {
453
+ let uiElement = false;
454
+ Coon.Function.doRequest(null, {
455
+ params: {uiElementCd: editorCode, nullable: true},
456
+ url: 'UIElement/get',
457
+ callback: function(win, param, response) {
458
+ uiElement = response.responseJSON || false;
459
+ },
460
+ }, true);
461
+ if (uiElement) {
462
+ let editor = null;
463
+ try {
464
+ editor = Ext.widget('CustomPanelEditorCreator', {uiElementCd: editorCode});
465
+ } catch (e) {
466
+ Coon.log.log(e);
467
+ }
468
+ if (editor) {
469
+ field = editor.createField(record, this.grid);
470
+ field.setValue(record.get(ns.$value));
471
+ if (field.setVisibleValue) {
472
+ field.setVisibleValue(record.get(ns.$valueDescription));
473
+ }
474
+ editor.showPanel(record, this.grid, uiElement);
475
+ }
476
+ }
477
+ }
478
+ }
479
+ return field;
480
+ },
481
+
482
+ afterEdit: function() {
483
+ this.completeEdit && this.completeEdit();
484
+ if (this.boundEl || (this.context && this.context.getCell)) {
485
+ this.restoreCell();
486
+ }
487
+ },
488
+
489
+ setFocusLeaveAction: function() {
490
+ if (this.field.requiredInitField) {
491
+ return false;
492
+ } else {
493
+ this.completeEdit && this.completeEdit();
494
+ }
495
+ },
496
+
497
+ setData: function(value, record) {
498
+ const ns = Coon.report.model.CharacteristicBeanFields;
499
+ if (this.field.getVisibleValue) {
500
+ record.set(ns.$valueDescription, this.field.getVisibleValue());
501
+ } else {
502
+ record.set(ns.$valueDescription, null);
503
+ }
504
+ },
505
+
506
+ prepare: function() {
507
+ const record = this.context.record;
508
+ const ns = Coon.report.model.CharacteristicBeanFields;
509
+ this.field.setValue(record.get(ns.$value));
510
+ if (this.field.setVisibleValue) {
511
+ this.field.setVisibleValue(record.get(ns.$valueDescription));
512
+ }
513
+ },
514
+ });
515
+