aloha-vue 2.62.1 → 2.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/CHANGELOG.md +1070 -1065
  2. package/dist/aloha-vue.css +14 -6
  3. package/dist/aloha-vue.css.map +1 -1
  4. package/dist/aloha-vue.es.js +17124 -16976
  5. package/dist/aloha-vue.umd.js +69 -69
  6. package/package.json +99 -99
  7. package/scss/_base.scss +62 -62
  8. package/scss/aloha-vue.scss +68 -68
  9. package/scss/components/AFilters.scss +304 -304
  10. package/scss/components/AFormElement/AValidatedJson.scss +6 -6
  11. package/scss/components/AMenu.scss +627 -627
  12. package/scss/components/AModal.scss +44 -44
  13. package/scss/components/APagination.scss +167 -167
  14. package/scss/components/ARate.scss +78 -78
  15. package/scss/components/AResizer.scss +63 -63
  16. package/scss/components/ATable.scss +819 -819
  17. package/scss/components/ATableForm.scss +309 -288
  18. package/scss/components/AVerticalScroll.scss +47 -47
  19. package/scss/components/AWizard.scss +669 -669
  20. package/scss/components/ui/ADatepicker.scss +342 -342
  21. package/scss/components/ui/ADatepickerRange.scss +45 -45
  22. package/scss/components/ui/AFieldset.scss +78 -78
  23. package/scss/components/ui/AInputNumber.scss +62 -62
  24. package/scss/components/ui/AInputNumberRange.scss +30 -30
  25. package/scss/components/ui/ASelect.scss +236 -236
  26. package/scss/components/ui/ASlider.scss +186 -186
  27. package/scss/components/ui/ASwitch.scss +148 -148
  28. package/scss/components/ui/ui.scss +254 -254
  29. package/scss/text/text_alignment.scss +39 -39
  30. package/scss/text/text_transform.scss +51 -51
  31. package/scss/text/text_wrapping.scss +40 -40
  32. package/scss/utils/badge.scss +45 -45
  33. package/scss/utils/checkbox_radio.scss +134 -134
  34. package/scss/utils/color.scss +46 -46
  35. package/scss/utils/dropdown.scss +185 -185
  36. package/scss/utils/list.scss +75 -75
  37. package/scss/utils/modal.scss +173 -173
  38. package/scss/utils/sizing.scss +137 -137
  39. package/scss/utils/spacing.scss +63 -63
  40. package/scss/utils/tooltip.scss +63 -63
  41. package/src/AAccordion/AAccordion.js +206 -206
  42. package/src/AAccordion/compositionAPI/IndexesForOpenAPI.js +63 -63
  43. package/src/AAccordion/compositionAPI/ToggleAPI.js +85 -85
  44. package/src/AAlert/AAlert.js +216 -216
  45. package/src/AAlert/compositionAPI/ClassAPI.js +21 -21
  46. package/src/AAlert/i18n/AAlertI18n.js +19 -19
  47. package/src/AAlert/i18n/ar.json +2 -2
  48. package/src/AAlert/i18n/de.json +2 -2
  49. package/src/AAlert/i18n/en.json +2 -2
  50. package/src/AAlert/i18n/es.json +2 -2
  51. package/src/AAlert/i18n/fr.json +2 -2
  52. package/src/AAlert/i18n/hr.json +2 -2
  53. package/src/AAlert/i18n/it.json +2 -2
  54. package/src/AAlert/i18n/ru.json +2 -2
  55. package/src/AButton/AButton.js +275 -275
  56. package/src/ACarousel/ACarousel.js +361 -361
  57. package/src/ACarousel/ACarouselBtn/ACarouselBtn.js +75 -75
  58. package/src/ACarousel/ACarouselBtn/compositionAPI/ClassAPI.js +16 -16
  59. package/src/ACarousel/ACarouselBtn/compositionAPI/TextAPI.js +25 -25
  60. package/src/ACarousel/ACarouselControls/ACarouselControls.js +114 -114
  61. package/src/ACarousel/ACarouselControls/ACarouselControlsIndicator/ACarouselControlsIndicator.js +146 -146
  62. package/src/ACarousel/ACarouselControls/ACarouselControlsIndicator/compositionAPI/ActiveAPI.js +33 -33
  63. package/src/ACarousel/ACarouselControls/ACarouselControlsIndicator/compositionAPI/AttributesAPI.js +40 -40
  64. package/src/ACarousel/ACarouselControls/ACarouselControlsIndicator/compositionAPI/EventsAPI.js +25 -25
  65. package/src/ACarousel/ACarouselControls/ACarouselControlsIndicator/compositionAPI/IconAPI.js +20 -20
  66. package/src/ACarousel/ACarouselControls/compositionAPI/AriaLabelAPI.js +20 -20
  67. package/src/ACarousel/ACarouselItem/ACarouselItem.js +83 -83
  68. package/src/ACarousel/ACarouselItem/compositionAPI/AttributesAPI.js +39 -39
  69. package/src/ACarousel/ACarouselItem/compositionAPI/IsActiveAPI.js +21 -21
  70. package/src/ACarousel/compositionAPI/ActiveAPI.js +111 -111
  71. package/src/ACarousel/compositionAPI/AriaLabelAPI.js +25 -25
  72. package/src/ACarousel/compositionAPI/ArrowsAPI.js +17 -17
  73. package/src/ACarousel/compositionAPI/ClassAPI.js +44 -44
  74. package/src/ACarousel/compositionAPI/DataAPI.js +41 -41
  75. package/src/ACarousel/compositionAPI/IndicatorsAPI.js +148 -148
  76. package/src/ACarousel/compositionAPI/TextsAPI.js +25 -25
  77. package/src/ACarousel/i18n/ACarouselI18n.js +19 -19
  78. package/src/ACarousel/i18n/ar.json +8 -8
  79. package/src/ACarousel/i18n/de.json +8 -8
  80. package/src/ACarousel/i18n/en.json +8 -8
  81. package/src/ACarousel/i18n/es.json +8 -8
  82. package/src/ACarousel/i18n/fr.json +8 -8
  83. package/src/ACarousel/i18n/hr.json +8 -8
  84. package/src/ACarousel/i18n/it.json +8 -8
  85. package/src/ACarousel/i18n/ru.json +8 -8
  86. package/src/ACollapse/ACollapse.js +103 -103
  87. package/src/ADropdown/ADropdown.js +544 -544
  88. package/src/ADropdown/ADropdownGroup.js +85 -85
  89. package/src/ADropdown/compositionAPI/ActionsAPI.js +147 -147
  90. package/src/ADropdown/compositionAPI/AttributesAPI.js +100 -100
  91. package/src/AElement/AElement.js +518 -518
  92. package/src/AElement/compositionAPI/AttributesAPI.js +51 -51
  93. package/src/AElement/compositionAPI/ClickAPI.js +30 -30
  94. package/src/AElement/compositionAPI/ComponentLocalAPI.js +23 -23
  95. package/src/AElement/compositionAPI/DisabledAPI.js +22 -22
  96. package/src/AElement/compositionAPI/HtmlTitleAPI.js +33 -33
  97. package/src/AElement/compositionAPI/KeydownAPI.js +35 -35
  98. package/src/AElement/compositionAPI/LoadingAPI.js +22 -22
  99. package/src/AElement/compositionAPI/RouterLinkAPI.js +20 -20
  100. package/src/AElement/compositionAPI/SwitchAPI.js +33 -33
  101. package/src/AElement/compositionAPI/TagAPI.js +34 -34
  102. package/src/AElement/compositionAPI/TextAPI.js +78 -78
  103. package/src/AElement/compositionAPI/TitleAPI.js +29 -29
  104. package/src/AFilters/AFilterCenter/AFilterCenter.js +154 -154
  105. package/src/AFilters/AFilterCenter/AFilterCenterItem/AFilterCenterItem.js +207 -207
  106. package/src/AFilters/AFilters/AFilters.js +282 -282
  107. package/src/AFilters/i18n/ar.json +30 -30
  108. package/src/AFilters/i18n/en.json +30 -30
  109. package/src/AFilters/i18n/es.json +30 -30
  110. package/src/AFilters/i18n/fr.json +30 -30
  111. package/src/AFilters/i18n/hr.json +30 -30
  112. package/src/AFilters/i18n/it.json +30 -30
  113. package/src/AFilters/i18n/ru.json +30 -30
  114. package/src/AGroupButtonDropdown/compositionAPI/ActionsAPI.js +143 -143
  115. package/src/ALink/ALink.js +253 -253
  116. package/src/AMenu/AMenu.js +578 -578
  117. package/src/AMenu/AMenuBreadcrumbs/compositionAPI/RenderTruncatedAPI.js +74 -74
  118. package/src/AMenu/AMenuButtonToggle/AMenuButtonToggle.js +94 -94
  119. package/src/AMenu/AMenuButtonToggle/compositionAPI/ToggleAPI.js +95 -95
  120. package/src/AMenu/AMenuPanelLink/AMenuPanelLink.js +250 -250
  121. package/src/AMenu/compositionAPI/BackdropAPI.js +42 -42
  122. package/src/AMenu/compositionAPI/KeydownAPI.js +197 -197
  123. package/src/AMenu/compositionAPI/LinkClickAPI.js +48 -48
  124. package/src/AMenu/compositionAPI/MenuAttributesAPI.js +51 -51
  125. package/src/AMenu/compositionAPI/PanelsAPI.js +78 -78
  126. package/src/AMenu/compositionAPI/ResizeAPI.js +74 -74
  127. package/src/AModal/AModal.js +530 -530
  128. package/src/AModalForm/AModalForm.js +383 -383
  129. package/src/AModalWizard/AModalWizard.js +563 -563
  130. package/src/ANotification/ANotification.js +60 -60
  131. package/src/APagination/APagination.js +111 -111
  132. package/src/APagination/APaginationCountPerPage/APaginationCountPerPage.js +209 -209
  133. package/src/APagination/APaginationCountPerPage/compositionAPI/MainAPI.js +40 -40
  134. package/src/APagination/APaginationCountPerPage/compositionAPI/TextsAPI.js +54 -54
  135. package/src/APagination/APaginationPages/APaginationPages.js +282 -282
  136. package/src/APagination/APaginationPages/compositionAPI/PaginationItemsAPI.js +102 -102
  137. package/src/APagination/APaginationPages/compositionAPI/TextsAPI.js +74 -74
  138. package/src/APagination/compositionAPI/ComponentsAPI.js +79 -79
  139. package/src/APagination/i18n/ar.json +12 -12
  140. package/src/APagination/i18n/es.json +12 -12
  141. package/src/APagination/i18n/fr.json +12 -12
  142. package/src/APagination/i18n/hr.json +12 -12
  143. package/src/APagination/i18n/it.json +12 -12
  144. package/src/APagination/i18n/ru.json +12 -12
  145. package/src/APopup/APopup.js +115 -115
  146. package/src/ATable/ATable.js +1163 -1163
  147. package/src/ATable/ATableHeaderThAction/ATableHeaderThAction.js +241 -241
  148. package/src/ATable/ATableSortingAdditional/__tests__/ATableSortingAdditional.ModelAPI.test.js +200 -200
  149. package/src/ATable/ATableSortingAdditional/compositionAPI/ModelAPI.js +152 -152
  150. package/src/ATable/ATableTd/ATableTd.js +145 -145
  151. package/src/ATable/ATableTdAction/ATableTdAction.js +223 -223
  152. package/src/ATable/ATableTopPanel/ATableTopPanel.js +433 -433
  153. package/src/ATable/compositionAPI/ColumnActionAPI.js +105 -105
  154. package/src/ATable/compositionAPI/ColumnStylesAPI.js +50 -50
  155. package/src/ATable/compositionAPI/ColumnsGroupedAPI.js +187 -187
  156. package/src/ATable/compositionAPI/PaginationModesAPI.js +44 -44
  157. package/src/ATable/compositionAPI/PreviewAPI.js +201 -201
  158. package/src/ATable/compositionAPI/PreviewRightResizeAPI.js +135 -135
  159. package/src/ATable/compositionAPI/ScrollControlAPI.js +249 -249
  160. package/src/ATable/compositionAPI/SortAPI.js +86 -86
  161. package/src/ATable/compositionAPI/WidthAPI.js +73 -73
  162. package/src/ATableForm/ATableForm.js +610 -602
  163. package/src/ATableForm/ATableFormCell/ATableFormCell.js +183 -183
  164. package/src/ATableForm/ATableFormCell/compositionAPI/DisabledAPI.js +20 -20
  165. package/src/ATableForm/ATableFormCell/compositionAPI/ReadonlyAPI.js +28 -28
  166. package/src/ATableForm/ATableFormCellAction/ATableFormCellAction.js +282 -282
  167. package/src/ATableForm/ATableFormCellAction/compositionAPI/DeleteAPI.js +80 -80
  168. package/src/ATableForm/ATableFormCellAction/compositionAPI/DisabledAPI.js +60 -60
  169. package/src/ATableForm/ATableFormCellAction/compositionAPI/HiddenAPI.js +46 -46
  170. package/src/ATableForm/ATableFormCellAction/compositionAPI/IdsAPI.js +31 -31
  171. package/src/ATableForm/ATableFormCellAction/compositionAPI/StylesAPI.js +29 -28
  172. package/src/ATableForm/ATableFormCellAction/compositionAPI/TitleAPI.js +47 -47
  173. package/src/ATableForm/ATableFormCellDnd/ATableFormCellDnd.js +6 -1
  174. package/src/ATableForm/ATableFormCellDnd/compositionAPI/IdAPI.js +21 -21
  175. package/src/ATableForm/ATableFormCellList/compositionAPI/DataAPI.js +61 -61
  176. package/src/ATableForm/ATableFormRow/ATableFormRow.js +580 -582
  177. package/src/ATableForm/ATableFormRow/compositionAPI/ErrorsAPI.js +40 -40
  178. package/src/ATableForm/ATableFormRow/compositionAPI/FocusAPI.js +55 -55
  179. package/src/ATableForm/ATableFormRow/compositionAPI/IdAPI.js +19 -19
  180. package/src/ATableForm/__tests__/ATableForm.DragAndDropAPI.test.js +48 -0
  181. package/src/ATableForm/__tests__/ATableForm.ListView.test.js +668 -495
  182. package/src/ATableForm/compositionAPI/ClassesAPI.js +23 -23
  183. package/src/ATableForm/compositionAPI/ColumnsAPI.js +4 -2
  184. package/src/ATableForm/compositionAPI/ColumnsGrowAPI.js +191 -190
  185. package/src/ATableForm/compositionAPI/DeleteAPI.js +9 -9
  186. package/src/ATableForm/compositionAPI/DragAndDropAPI.js +6 -5
  187. package/src/ATableForm/compositionAPI/EditAPI.js +127 -128
  188. package/src/ATableForm/compositionAPI/RowsAPI.js +42 -42
  189. package/src/ATableForm/compositionAPI/StylesAPI.js +62 -62
  190. package/src/ATableForm/compositionAPI/WidthsAPI.js +21 -21
  191. package/src/ATableForm/i18n/ATableFormI18n.js +19 -19
  192. package/src/ATabs/ATabsContent/ATabsContent.js +102 -102
  193. package/src/ATabs/ATabsTab/ATabsTab.js +185 -185
  194. package/src/ATooltip/ATooltip.js +221 -221
  195. package/src/ATranslation/compositionAPI/UtilsAPI.js +187 -187
  196. package/src/AVerticalScroll/compositionAPI/ScrollAPI.js +55 -55
  197. package/src/AWizard/AWizard.js +467 -467
  198. package/src/compositionAPI/AEventOutsideAPI.js +46 -46
  199. package/src/compositionAPI/AMobileAPI.js +32 -32
  200. package/src/compositionAPI/APageTabTitleAPI.js +84 -84
  201. package/src/compositionAPI/ARemPxAPI.js +47 -47
  202. package/src/compositionAPI/FocusByDestroyAPI.js +67 -67
  203. package/src/const/AKeys.js +9 -9
  204. package/src/directives/AOnHooks.js +0 -0
  205. package/src/i18n/allLanguages.js +377 -377
  206. package/src/i18n/ar.json +4 -4
  207. package/src/i18n/de.json +4 -4
  208. package/src/i18n/en.json +4 -4
  209. package/src/i18n/es.json +4 -4
  210. package/src/i18n/fr.json +4 -4
  211. package/src/i18n/hr.json +4 -4
  212. package/src/i18n/it.json +4 -4
  213. package/src/i18n/ru.json +4 -4
  214. package/src/index.js +402 -402
  215. package/src/plugins/AAlertPlugin.js +53 -53
  216. package/src/plugins/ACarouselPlugin.js +34 -34
  217. package/src/plugins/ADatepickerPlugin.js +57 -57
  218. package/src/plugins/AFiltersPlugin.js +102 -102
  219. package/src/plugins/AInputCurrencyPlugin.js +31 -31
  220. package/src/plugins/AMobilePlugin.js +32 -32
  221. package/src/plugins/ARemPxPlugin.js +37 -37
  222. package/src/plugins/ASelectPlugin.js +54 -54
  223. package/src/plugins/ASelectStylesPlugin.js +2376 -2376
  224. package/src/temp/px_to_rem_mapping_1_to_800.md +802 -802
  225. package/src/ui/ACheckbox/ACheckbox.js +929 -929
  226. package/src/ui/ACheckbox/ACheckboxItem/ACheckboxItem.js +0 -0
  227. package/src/ui/ACheckboxRadioGroups/ACheckboxRadioGroups.js +0 -0
  228. package/src/ui/ADatepicker/ADatepicker.js +807 -807
  229. package/src/ui/ADatepicker/ADatepickerCalendarPanel/ADatepickerCalendarPanel.js +796 -796
  230. package/src/ui/ADatepicker/ADatepickerCalendarPanel/compositionAPI/CalendarAPI.js +51 -51
  231. package/src/ui/ADatepicker/compositionAPI/LanguagesAPI.js +92 -92
  232. package/src/ui/ADatepicker/compositionAPI/PlaceholderAPI.js +55 -55
  233. package/src/ui/ADatepicker/i18n/ADatepickerI18n.js +19 -19
  234. package/src/ui/ADatepicker/i18n/ar.json +47 -47
  235. package/src/ui/ADatepicker/i18n/de.json +48 -48
  236. package/src/ui/ADatepicker/i18n/en.json +48 -48
  237. package/src/ui/ADatepicker/i18n/es.json +47 -47
  238. package/src/ui/ADatepicker/i18n/fr.json +47 -47
  239. package/src/ui/ADatepicker/i18n/hr.json +47 -47
  240. package/src/ui/ADatepicker/i18n/it.json +47 -47
  241. package/src/ui/ADatepicker/i18n/ru.json +48 -48
  242. package/src/ui/ADatepicker/panel/APanelDate/APanelDate.js +196 -196
  243. package/src/ui/ADatepicker/panel/APanelDate/compositionAPI/DatesAPI.js +66 -66
  244. package/src/ui/ADatepicker/panel/APanelDate/compositionAPI/FocusAPI.js +96 -96
  245. package/src/ui/ADatepicker/panel/APanelDate/compositionAPI/FocusActiveAPI.js +27 -27
  246. package/src/ui/ADatepicker/panel/APanelDate/compositionAPI/SelectAPI.js +21 -21
  247. package/src/ui/ADatepicker/panel/APanelDate/compositionAPI/TableAPI.js +128 -128
  248. package/src/ui/ADatepicker/panel/APanelMonth/APanelMonth.js +129 -129
  249. package/src/ui/ADatepicker/panel/APanelMonth/compositionAPI/FocusAPI.js +94 -94
  250. package/src/ui/ADatepicker/panel/APanelMonth/compositionAPI/FocusActiveAPI.js +21 -21
  251. package/src/ui/ADatepicker/panel/APanelMonth/compositionAPI/MonthsAPI.js +51 -51
  252. package/src/ui/ADatepicker/panel/APanelMonth/compositionAPI/SelectAPI.js +29 -29
  253. package/src/ui/ADatepicker/panel/APanelYearItem/APanelYearItem.js +75 -75
  254. package/src/ui/ADatepicker/panel/APanelYearItem/compositionAPI/AttributesAPI.js +35 -35
  255. package/src/ui/ADatepicker/panel/APanelYearItem/compositionAPI/SelectAPI.js +35 -35
  256. package/src/ui/ADatepickerRange/ADatepickerRange.js +537 -537
  257. package/src/ui/AErrors/AErrors.js +149 -149
  258. package/src/ui/AErrors/AErrorsElement/AErrorsElement.js +0 -0
  259. package/src/ui/AErrors/i18n/AErrorsI18n.js +19 -19
  260. package/src/ui/AErrors/i18n/ar.json +3 -3
  261. package/src/ui/AErrors/i18n/de.json +2 -2
  262. package/src/ui/AErrors/i18n/en.json +3 -3
  263. package/src/ui/AErrors/i18n/es.json +3 -3
  264. package/src/ui/AErrors/i18n/fr.json +3 -3
  265. package/src/ui/AErrors/i18n/hr.json +3 -3
  266. package/src/ui/AErrors/i18n/it.json +3 -3
  267. package/src/ui/AErrors/i18n/ru.json +3 -3
  268. package/src/ui/AErrorsText/AErrorsText.js +62 -62
  269. package/src/ui/AFieldset/AFieldset.js +535 -535
  270. package/src/ui/AFieldset/compositionAPI/ModelAPI.js +54 -54
  271. package/src/ui/AForm/AForm.js +252 -252
  272. package/src/ui/AFormElement/AFormElement.js +160 -160
  273. package/src/ui/AFormElementBtnClear/AFormElementBtnClear.js +86 -86
  274. package/src/ui/AFormElementBtnClear/i18n/AFormElementBtnClearI18n.js +19 -19
  275. package/src/ui/AFormElementBtnClear/i18n/ar.json +2 -2
  276. package/src/ui/AFormElementBtnClear/i18n/de.json +2 -2
  277. package/src/ui/AFormElementBtnClear/i18n/en.json +2 -2
  278. package/src/ui/AFormElementBtnClear/i18n/es.json +2 -2
  279. package/src/ui/AFormElementBtnClear/i18n/fr.json +2 -2
  280. package/src/ui/AFormElementBtnClear/i18n/hr.json +2 -2
  281. package/src/ui/AFormElementBtnClear/i18n/it.json +2 -2
  282. package/src/ui/AFormElementBtnClear/i18n/ru.json +2 -2
  283. package/src/ui/AFormHelpText/AFormHelpText.js +37 -37
  284. package/src/ui/AFormLabelDescription/AFormLabelDescription.js +43 -43
  285. package/src/ui/AFormReadonly/AFormReadonly.js +193 -193
  286. package/src/ui/AGroup/AGroup.js +427 -427
  287. package/src/ui/AInput/AInput.js +516 -516
  288. package/src/ui/AInput/compositionAPI/ClassAPI.js +43 -43
  289. package/src/ui/AInputCurrency/AInputCurrency.js +620 -620
  290. package/src/ui/AInputCurrency/compositionAPI/IncreaseDecreaseAPI.js +76 -76
  291. package/src/ui/AInputCurrency/compositionAPI/InputEventsAPI.js +751 -751
  292. package/src/ui/AInputCurrency/compositionAPI/ModelAPI.js +88 -88
  293. package/src/ui/AInputCurrency/compositionAPI/UtilsAPI.js +54 -54
  294. package/src/ui/AInputFile/AInputFile.js +247 -247
  295. package/src/ui/AInputNumber/AInputNumber.js +497 -497
  296. package/src/ui/AInputNumber/compositionAPI/InputEventsAPI.js +196 -196
  297. package/src/ui/AInputNumber/compositionAPI/ModelAPI.js +72 -72
  298. package/src/ui/AInputNumberRange/AInputNumberRange.js +517 -517
  299. package/src/ui/AJson/AJson.js +434 -434
  300. package/src/ui/ALabel/ALabel.js +0 -0
  301. package/src/ui/AMultiselectOrdered/AMultiselectOrdered.js +935 -935
  302. package/src/ui/AOneCheckbox/AOneCheckbox.js +366 -366
  303. package/src/ui/ARadio/ARadio.js +924 -924
  304. package/src/ui/ARadio/ARadioItem/ARadioItem.js +0 -0
  305. package/src/ui/ARequired/ARequired.js +0 -0
  306. package/src/ui/ARouterLinkConfig/ARouterLinkConfig.js +391 -391
  307. package/src/ui/ARouterLinkConfig/compositionAPI/DataFormAPI.js +102 -102
  308. package/src/ui/ARouterLinkConfig/compositionAPI/ModelLocalAPI.js +96 -96
  309. package/src/ui/ARouterLinkConfig/compositionAPI/RouteAPI.js +51 -51
  310. package/src/ui/ASelect/ASelect.js +1339 -1339
  311. package/src/ui/ASelect/ASelectElement/ASelectElement.js +0 -0
  312. package/src/ui/ASelect/ASelectValueCloseable/ASelectValueCloseable.js +1 -1
  313. package/src/ui/ASelect/ASelectValueCloseable/compositionAPI/CloseAPI.js +28 -28
  314. package/src/ui/ASelect/compositionAPI/ToggleAPI.js +255 -255
  315. package/src/ui/ASelect/i18n/ar.json +6 -6
  316. package/src/ui/ASelect/i18n/de.json +7 -7
  317. package/src/ui/ASelect/i18n/en.json +6 -6
  318. package/src/ui/ASelect/i18n/es.json +6 -6
  319. package/src/ui/ASelect/i18n/fr.json +6 -6
  320. package/src/ui/ASelect/i18n/hr.json +6 -6
  321. package/src/ui/ASelect/i18n/it.json +6 -6
  322. package/src/ui/ASelect/i18n/ru.json +6 -6
  323. package/src/ui/ASelectIcon/ASelectIcon.js +386 -386
  324. package/src/ui/ASelectStyle/ASelectStyle.js +391 -391
  325. package/src/ui/ASelectStyle/compositionAPI/DataAPI.js +68 -68
  326. package/src/ui/ASelectStyle/compositionAPI/EventsAPI.js +24 -24
  327. package/src/ui/ASelectStyle/compositionAPI/KeyLabelCallbackAPI.js +15 -15
  328. package/src/ui/ASelectStyle/compositionAPI/TypeAPI.js +24 -24
  329. package/src/ui/ASelectStyle/i18n/ASelectStyleI18n.js +19 -19
  330. package/src/ui/ASelectStyle/i18n/ar.json +277 -277
  331. package/src/ui/ASelectStyle/i18n/de.json +277 -277
  332. package/src/ui/ASelectStyle/i18n/en.json +277 -277
  333. package/src/ui/ASelectStyle/i18n/es.json +277 -277
  334. package/src/ui/ASelectStyle/i18n/fr.json +277 -277
  335. package/src/ui/ASelectStyle/i18n/hr.json +277 -277
  336. package/src/ui/ASelectStyle/i18n/it.json +277 -277
  337. package/src/ui/ASelectStyle/i18n/ru.json +277 -277
  338. package/src/ui/ASlider/ASlider.js +672 -672
  339. package/src/ui/ASlider/compositionAPI/AriaAttributesAPI.js +121 -121
  340. package/src/ui/ASlider/compositionAPI/AttributesAPI.js +15 -15
  341. package/src/ui/ASlider/compositionAPI/DataAPI.js +115 -115
  342. package/src/ui/ASlider/compositionAPI/DragAndDropAPI.js +198 -198
  343. package/src/ui/ASlider/compositionAPI/LabelAPI.js +13 -13
  344. package/src/ui/ASlider/compositionAPI/MarksAPI.js +32 -32
  345. package/src/ui/ASlider/compositionAPI/SliderAPI.js +289 -289
  346. package/src/ui/ASlider/compositionAPI/StopsAPI.js +47 -47
  347. package/src/ui/ASlider/compositionAPI/StylesAPI.js +79 -79
  348. package/src/ui/ASlider/compositionAPI/TitleAPI.js +42 -42
  349. package/src/ui/ASlider/i18n/ASliderI18n.js +19 -19
  350. package/src/ui/ASlider/i18n/en.json +4 -4
  351. package/src/ui/ASwitch/ASwitch.js +442 -442
  352. package/src/ui/ATemplate/ATemplate.js +0 -0
  353. package/src/ui/ATextarea/ATextarea.js +437 -437
  354. package/src/ui/AUiComponents.js +59 -59
  355. package/src/ui/AUiContainerComponents.js +12 -12
  356. package/src/ui/AValidatedJson/AValidatedJson.js +594 -594
  357. package/src/ui/AValidatedJson/AValidatedJsonItem/compositionAPI/DeleteAPI.js +63 -63
  358. package/src/ui/AValidatedJson/AValidatedJsonItem/compositionAPI/DetailsAPI.js +59 -59
  359. package/src/ui/AValidatedJson/AValidatedJsonItem/compositionAPI/MoveAPI.js +50 -50
  360. package/src/ui/AValidatedJson/AValidatedJsonItem/compositionAPI/UpdateAPI.js +48 -48
  361. package/src/ui/AValidatedJson/AValidatedJsonModalCreateOrUpdate/composiitionAPI/DataFormAPI.js +69 -69
  362. package/src/ui/AValidatedJson/AValidatedJsonModalCreateOrUpdate/composiitionAPI/DisabledAPI.js +35 -35
  363. package/src/ui/AValidatedJson/AValidatedJsonModalCreateOrUpdate/composiitionAPI/ModelAPI.js +31 -31
  364. package/src/ui/AValidatedJson/AValidatedJsonModalCreateOrUpdate/composiitionAPI/SaveAPI.js +115 -115
  365. package/src/ui/AValidatedJson/AValidatedJsonModalCreateOrUpdate/composiitionAPI/TextAPI.js +25 -25
  366. package/src/ui/AValidatedJson/compositionAPI/AValidatedJsonErrorLabelsAPI.js +18 -18
  367. package/src/ui/AValidatedJson/compositionAPI/AttributesAPI.js +15 -15
  368. package/src/ui/AValidatedJson/compositionAPI/ChildrenAPI.js +70 -70
  369. package/src/ui/AValidatedJson/compositionAPI/EventsAPI.js +19 -19
  370. package/src/ui/AValidatedJson/compositionAPI/JsonModeAPI.js +119 -119
  371. package/src/ui/AValidatedJson/compositionAPI/ListModeAPI.js +144 -144
  372. package/src/ui/AValidatedJson/compositionAPI/ModelAPI.js +38 -38
  373. package/src/ui/AValidatedJson/compositionAPI/SingleModeAPI.js +112 -112
  374. package/src/ui/AValidatedJson/compositionAPI/TranslateAPI.js +22 -22
  375. package/src/ui/AValidatedJson/i18n/AValidatedJsonI18n.js +19 -19
  376. package/src/ui/AValidatedJson/i18n/ar.json +3 -3
  377. package/src/ui/AValidatedJson/i18n/de.json +22 -22
  378. package/src/ui/AValidatedJson/i18n/en.json +3 -3
  379. package/src/ui/AValidatedJson/i18n/es.json +3 -3
  380. package/src/ui/AValidatedJson/i18n/fr.json +3 -3
  381. package/src/ui/AValidatedJson/i18n/hr.json +3 -3
  382. package/src/ui/AValidatedJson/i18n/it.json +3 -3
  383. package/src/ui/AValidatedJson/i18n/ru.json +6 -6
  384. package/src/ui/compositionApi/UIDataGroupAPI.js +94 -94
  385. package/src/ui/compositionApi/UiAPI.js +185 -185
  386. package/src/ui/compositionApi/UiClearButtonAPI.js +19 -19
  387. package/src/ui/compositionApi/UiDataSortAPI.js +29 -29
  388. package/src/ui/compositionApi/UiDataWithKeyIdAndLabelAPI.js +155 -155
  389. package/src/ui/const/AUiTypes.js +69 -69
  390. package/src/ui/mixins/UiMixinProps.js +129 -129
  391. package/src/ui/utils/utils.js +79 -79
  392. package/src/utils/__tests__/utils.aOrderBy.test.js +237 -237
  393. package/src/utils/__tests__/utils.aSortBy.test.js +331 -331
  394. package/src/utils/__tests__/utilsArray.aFirst.test.js +54 -54
  395. package/src/utils/__tests__/utilsArray.aLast.test.js +54 -54
  396. package/src/utils/__tests__/utilsLang.isArguments.test.js +52 -52
  397. package/src/utils/__tests__/utilsLang.isArray.test.js +50 -50
  398. package/src/utils/__tests__/utilsLang.isArrayBuffer.test.js +48 -48
  399. package/src/utils/__tests__/utilsLang.isBoolean.test.js +56 -56
  400. package/src/utils/__tests__/utilsLang.isBuffer.test.js +47 -47
  401. package/src/utils/__tests__/utilsLang.isDate.test.js +54 -54
  402. package/src/utils/__tests__/utilsLang.isElement.test.js +53 -53
  403. package/src/utils/__tests__/utilsLang.isError.test.js +52 -52
  404. package/src/utils/__tests__/utilsLang.isFinite.test.js +57 -57
  405. package/src/utils/__tests__/utilsLang.isFunction.test.js +46 -46
  406. package/src/utils/__tests__/utilsLang.isInteger.test.js +58 -58
  407. package/src/utils/__tests__/utilsLang.isMap.test.js +50 -50
  408. package/src/utils/__tests__/utilsLang.isNaN.test.js +55 -55
  409. package/src/utils/__tests__/utilsLang.isNil.test.js +57 -57
  410. package/src/utils/__tests__/utilsLang.isNull.test.js +53 -53
  411. package/src/utils/__tests__/utilsLang.isNumber.test.js +54 -54
  412. package/src/utils/__tests__/utilsLang.isObject.test.js +49 -49
  413. package/src/utils/__tests__/utilsLang.isObjectLike.test.js +45 -45
  414. package/src/utils/__tests__/utilsLang.isPlainObject.test.js +60 -60
  415. package/src/utils/__tests__/utilsLang.isPromise.test.js +93 -93
  416. package/src/utils/__tests__/utilsLang.isRegExp.test.js +46 -46
  417. package/src/utils/__tests__/utilsLang.isSet.test.js +50 -50
  418. package/src/utils/__tests__/utilsLang.isString.test.js +50 -50
  419. package/src/utils/__tests__/utilsLang.isSymbol.test.js +45 -45
  420. package/src/utils/__tests__/utilsLang.isUndefined.test.js +57 -57
  421. package/src/utils/__tests__/utilsLang.isWeakMap.test.js +49 -49
  422. package/src/utils/__tests__/utilsLang.isWeakSet.test.js +49 -49
  423. package/src/utils/actions.js +67 -67
  424. package/src/utils/autosize.js +277 -277
  425. package/src/utils/isBrowser.js +12 -12
  426. package/src/utils/utils.js +253 -253
  427. package/src/utils/utilsArray.js +29 -29
  428. package/src/utils/utilsDOM.js +188 -188
  429. package/src/utils/utilsLang.js +346 -346
@@ -1,563 +1,736 @@
1
1
  import {
2
- h,
2
+ computed,
3
+ nextTick,
3
4
  reactive,
4
5
  ref,
5
6
  } from "vue";
6
- import {
7
- describe,
8
- expect,
9
- it,
10
- jest,
11
- } from "@jest/globals";
12
- import {
13
- mount,
14
- } from "@vue/test-utils";
15
-
16
- import AForm from "../../ui/AForm/AForm";
7
+ import {
8
+ describe,
9
+ expect,
10
+ it,
11
+ jest,
12
+ } from "@jest/globals";
13
+ import {
14
+ mount,
15
+ } from "@vue/test-utils";
16
+
17
+ import AForm from "../../ui/AForm/AForm";
17
18
  import ATableForm from "../ATableForm";
18
19
  import ATableFormCellList from "../ATableFormCellList/ATableFormCellList";
19
20
 
21
+ import CellDisabledAPI from "../ATableFormCell/compositionAPI/DisabledAPI";
22
+ import CellReadonlyAPI from "../ATableFormCell/compositionAPI/ReadonlyAPI";
23
+ import CellActionStylesAPI from "../ATableFormCellAction/compositionAPI/StylesAPI";
20
24
  import ColumnsAPI from "../compositionAPI/ColumnsAPI";
21
- import DataAPI from "../ATableFormCellList/compositionAPI/DataAPI";
22
- import RowEditAPI from "../ATableFormRow/compositionAPI/EditAPI";
23
- import TableEditAPI from "../compositionAPI/EditAPI";
24
-
25
- jest.mock("../../ui/AForm/AForm", () => {
26
- const {
27
- h,
28
- } = require("vue");
29
-
30
- return {
31
- __esModule: true,
32
- default: {
33
- name: "AForm",
34
- props: {
35
- data: Array,
36
- errors: Object,
37
- idPrefix: String,
38
- modelValue: Object,
39
- readonly: Boolean,
40
- showErrors: Boolean,
41
- showRequiredText: Boolean,
42
- tag: String,
43
- useFlatErrors: Boolean,
44
- useFlatModel: Boolean,
45
- },
46
- emits: [
47
- "change",
48
- ],
49
- render() {
50
- return h(this.tag || "div", {}, this.data.map(item => {
51
- return h("div", {
52
- "data-column-id": item["data-column-id"],
53
- }, [
54
- h("input", {
55
- disabled: this.readonly || item.disabled,
56
- id: `${ this.idPrefix }${ item.id }`,
57
- }),
58
- ]);
59
- }));
60
- },
61
- },
62
- };
63
- });
64
-
65
- jest.mock("../../ui/AFormElement/AFormElement", () => {
66
- const {
67
- h,
68
- } = require("vue");
69
-
70
- return {
71
- __esModule: true,
72
- default: {
73
- name: "AFormElement",
74
- render() {
75
- return h("input");
25
+ import ColumnsGrowAPI from "../compositionAPI/ColumnsGrowAPI";
26
+ import DataAPI from "../ATableFormCellList/compositionAPI/DataAPI";
27
+ import RowEditAPI from "../ATableFormRow/compositionAPI/EditAPI";
28
+ import TableEditAPI from "../compositionAPI/EditAPI";
29
+
30
+ jest.mock("../../ui/AForm/AForm", () => {
31
+ const {
32
+ h,
33
+ } = require("vue");
34
+
35
+ return {
36
+ __esModule: true,
37
+ default: {
38
+ name: "AForm",
39
+ props: {
40
+ data: Array,
41
+ errors: Object,
42
+ idPrefix: String,
43
+ modelValue: Object,
44
+ readonly: Boolean,
45
+ showErrors: Boolean,
46
+ showRequiredText: Boolean,
47
+ tag: String,
48
+ useFlatErrors: Boolean,
49
+ useFlatModel: Boolean,
50
+ },
51
+ emits: [
52
+ "change",
53
+ ],
54
+ render() {
55
+ return h(this.tag || "div", {}, this.data.map(item => {
56
+ return h("div", {
57
+ "data-column-id": item["data-column-id"],
58
+ }, [
59
+ h("input", {
60
+ disabled: this.readonly || item.disabled,
61
+ id: `${ this.idPrefix }${ item.id }`,
62
+ }),
63
+ ]);
64
+ }));
65
+ },
66
+ },
67
+ };
68
+ });
69
+
70
+ jest.mock("../../ui/AFormElement/AFormElement", () => {
71
+ const {
72
+ h,
73
+ } = require("vue");
74
+
75
+ return {
76
+ __esModule: true,
77
+ default: {
78
+ name: "AFormElement",
79
+ render() {
80
+ return h("input");
81
+ },
82
+ },
83
+ };
84
+ });
85
+
86
+ jest.mock("../../index", () => {
87
+ const {
88
+ h,
89
+ } = require("vue");
90
+
91
+ return {
92
+ AAlert: {
93
+ name: "AAlert",
94
+ render() {
95
+ return h("div");
96
+ },
97
+ },
98
+ AConfirmAPI: () => ({
99
+ closeConfirm: jest.fn(),
100
+ openConfirm: jest.fn(),
101
+ }),
102
+ AErrors: {
103
+ name: "AErrors",
104
+ render() {
105
+ return h("div");
106
+ },
107
+ },
108
+ };
109
+ });
110
+
111
+ jest.mock("../../AButton/AButton", () => {
112
+ const {
113
+ h,
114
+ } = require("vue");
115
+
116
+ return {
117
+ __esModule: true,
118
+ default: {
119
+ name: "AButton",
120
+ props: {
121
+ disabled: Boolean,
122
+ id: String,
123
+ },
124
+ emits: [
125
+ "click",
126
+ ],
127
+ render() {
128
+ return h("button", {
129
+ disabled: this.disabled,
130
+ id: this.id,
131
+ onClick: $event => this.$emit("click", $event),
132
+ });
133
+ },
134
+ },
135
+ };
136
+ });
137
+
138
+ jest.mock("aloha-svg/dist/js/bootstrap/ChevronDown", () => ({
139
+ __esModule: true,
140
+ default: "<svg></svg>",
141
+ }));
142
+ jest.mock("aloha-svg/dist/js/bootstrap/ChevronUp", () => ({
143
+ __esModule: true,
144
+ default: "<svg></svg>",
145
+ }));
146
+ jest.mock("aloha-svg/dist/js/bootstrap/ExclamationCircleFill", () => ({
147
+ __esModule: true,
148
+ default: "<svg></svg>",
149
+ }));
150
+ jest.mock("aloha-svg/dist/js/bootstrap/Floppy2Fill", () => ({
151
+ __esModule: true,
152
+ default: "<svg></svg>",
153
+ }));
154
+ jest.mock("aloha-svg/dist/js/bootstrap/GripVertical", () => ({
155
+ __esModule: true,
156
+ default: "<svg></svg>",
157
+ }));
158
+ jest.mock("aloha-svg/dist/js/bootstrap/LockFill", () => ({
159
+ __esModule: true,
160
+ default: "<svg></svg>",
161
+ }));
162
+ jest.mock("aloha-svg/dist/js/bootstrap/PencilFill", () => ({
163
+ __esModule: true,
164
+ default: "<svg></svg>",
165
+ }));
166
+ jest.mock("aloha-svg/dist/js/bootstrap/Plus", () => ({
167
+ __esModule: true,
168
+ default: "<svg></svg>",
169
+ }));
170
+ jest.mock("aloha-svg/dist/js/bootstrap/Trash", () => ({
171
+ __esModule: true,
172
+ default: "<svg></svg>",
173
+ }));
174
+ jest.mock("aloha-svg/dist/js/bootstrap/XLg", () => ({
175
+ __esModule: true,
176
+ default: "<svg></svg>",
177
+ }));
178
+
179
+ describe("ATableForm list view", () => {
180
+ it("uses disabled fields for editable rows and readonly fields for non-editable rows", () => {
181
+ const props = reactive({
182
+ column: {
183
+ formElement: {},
76
184
  },
77
- },
78
- };
79
- });
185
+ isEditable: true,
186
+ isEditMode: false,
187
+ isFooter: false,
188
+ });
189
+ const {
190
+ disabledLocal,
191
+ } = CellDisabledAPI(props);
192
+ const {
193
+ readonlyLocal,
194
+ } = CellReadonlyAPI(props);
80
195
 
81
- jest.mock("../../index", () => {
82
- const {
83
- h,
84
- } = require("vue");
196
+ expect(disabledLocal.value).toBe(true);
197
+ expect(readonlyLocal.value).toBe(false);
85
198
 
86
- return {
87
- AAlert: {
88
- name: "AAlert",
89
- render() {
90
- return h("div");
91
- },
92
- },
93
- AConfirmAPI: () => ({
94
- closeConfirm: jest.fn(),
95
- openConfirm: jest.fn(),
96
- }),
97
- AErrors: {
98
- name: "AErrors",
99
- render() {
100
- return h("div");
101
- },
102
- },
103
- };
104
- });
199
+ props.isEditable = false;
105
200
 
106
- jest.mock("../../AButton/AButton", () => {
107
- const {
108
- h,
109
- } = require("vue");
201
+ expect(disabledLocal.value).toBe(false);
202
+ expect(readonlyLocal.value).toBe(true);
203
+ });
110
204
 
111
- return {
112
- __esModule: true,
113
- default: {
114
- name: "AButton",
115
- props: {
116
- disabled: Boolean,
117
- id: String,
118
- },
119
- emits: [
120
- "click",
121
- ],
122
- render() {
123
- return h("button", {
124
- disabled: this.disabled,
125
- id: this.id,
126
- onClick: $event => this.$emit("click", $event),
127
- });
205
+ it.each([
206
+ [true, true, 112],
207
+ [true, false, 64],
208
+ [false, true, 64],
209
+ [false, false, 64],
210
+ ])("uses the expected action width for editable=%s and deletable=%s", (isEditable, isDeletable, width) => {
211
+ const props = reactive({
212
+ hasActiveEditRow: false,
213
+ isActiveEditMode: false,
214
+ isDeletable,
215
+ isDeletableConfirm: false,
216
+ isEditable,
217
+ widths: {
218
+ actionsColumnDouble: 112,
219
+ actionsColumnSingle: 64,
128
220
  },
129
- },
130
- };
131
- });
221
+ });
222
+ const {
223
+ columnStyles,
224
+ } = CellActionStylesAPI(props);
132
225
 
133
- jest.mock("aloha-svg/dist/js/bootstrap/ChevronDown", () => ({
134
- __esModule: true,
135
- default: "<svg></svg>",
136
- }));
137
- jest.mock("aloha-svg/dist/js/bootstrap/ChevronUp", () => ({
138
- __esModule: true,
139
- default: "<svg></svg>",
140
- }));
141
- jest.mock("aloha-svg/dist/js/bootstrap/ExclamationCircleFill", () => ({
142
- __esModule: true,
143
- default: "<svg></svg>",
144
- }));
145
- jest.mock("aloha-svg/dist/js/bootstrap/Floppy2Fill", () => ({
146
- __esModule: true,
147
- default: "<svg></svg>",
148
- }));
149
- jest.mock("aloha-svg/dist/js/bootstrap/GripVertical", () => ({
150
- __esModule: true,
151
- default: "<svg></svg>",
152
- }));
153
- jest.mock("aloha-svg/dist/js/bootstrap/LockFill", () => ({
154
- __esModule: true,
155
- default: "<svg></svg>",
156
- }));
157
- jest.mock("aloha-svg/dist/js/bootstrap/PencilFill", () => ({
158
- __esModule: true,
159
- default: "<svg></svg>",
160
- }));
161
- jest.mock("aloha-svg/dist/js/bootstrap/Plus", () => ({
162
- __esModule: true,
163
- default: "<svg></svg>",
164
- }));
165
- jest.mock("aloha-svg/dist/js/bootstrap/Trash", () => ({
166
- __esModule: true,
167
- default: "<svg></svg>",
168
- }));
169
- jest.mock("aloha-svg/dist/js/bootstrap/XLg", () => ({
170
- __esModule: true,
171
- default: "<svg></svg>",
172
- }));
226
+ expect(columnStyles.value.width).toBe(`${ width }px`);
227
+ });
173
228
 
174
- describe("ATableForm list view", () => {
175
- it("enters edit mode by row click only when enabled and row edit is available", async() => {
176
- const rows = [
177
- {
178
- id: 1,
179
- name: "Editable",
180
- },
181
- {
182
- id: 2,
183
- name: "Disabled",
184
- },
185
- ];
186
- const wrapper = mount(ATableForm, {
187
- props: {
188
- actionsDisabledCallback: {
189
- edit: ({ row }) => row.id === 2,
190
- },
191
- columns: [
192
- {
193
- id: "name",
194
- label: "Name",
195
- formElement: {
196
- type: "text",
197
- },
198
- },
199
- ],
200
- isEditable: true,
201
- isEditOnRowClick: true,
202
- keyId: "id",
203
- rows,
204
- },
229
+ it("shows the actions column only for edit, delete, or an active add row", () => {
230
+ const isAddRowActive = ref(false);
231
+ const props = reactive({
232
+ columns: [{ id: "name" }],
233
+ isDeletable: false,
234
+ isDeletableConfirm: false,
235
+ isDragAndDrop: false,
236
+ isEditable: false,
237
+ rowView: "table",
205
238
  });
239
+ const {
240
+ allColumnsLength,
241
+ hasActionsColumn,
242
+ } = ColumnsAPI(props, {
243
+ isAddRowActive,
244
+ });
245
+
246
+ expect(hasActionsColumn.value).toBe(false);
247
+ expect(allColumnsLength.value).toBe(1);
206
248
 
207
- const bodyRows = wrapper.findAll("tbody tr.a_table_form__row");
249
+ props.isEditable = true;
250
+ expect(hasActionsColumn.value).toBe(true);
251
+ expect(allColumnsLength.value).toBe(2);
208
252
 
209
- await bodyRows[1].trigger("click");
210
- expect(wrapper.find("tbody tr.a_table_form__row_edit_on_click").exists()).toBe(true);
253
+ props.isEditable = false;
254
+ props.isDeletableConfirm = true;
255
+ expect(hasActionsColumn.value).toBe(true);
211
256
 
212
- await bodyRows[0].trigger("click");
213
- expect(wrapper.find("tbody tr.a_table_form__row_edit_on_click").exists()).toBe(false);
214
- expect(wrapper.find("tbody button[id$='_save']").exists()).toBe(true);
257
+ props.isDeletableConfirm = false;
258
+ isAddRowActive.value = true;
259
+ expect(hasActionsColumn.value).toBe(true);
215
260
  });
216
261
 
217
- it("does not enter edit mode by row click when the prop is disabled", async() => {
218
- const wrapper = mount(ATableForm, {
219
- props: {
220
- columns: [
221
- {
222
- id: "name",
223
- label: "Name",
224
- formElement: {
225
- type: "text",
226
- },
227
- },
228
- ],
229
- isEditable: true,
230
- rows: [
231
- {
232
- name: "Readonly row click",
233
- },
234
- ],
235
- },
236
- });
262
+ it("grows all columns equally only when no column has a positive grow value", async() => {
263
+ const resizeObserverOriginal = global.ResizeObserver;
264
+ global.ResizeObserver = class {
265
+ disconnect() {}
266
+ observe() {}
267
+ unobserve() {}
268
+ };
237
269
 
238
- await wrapper.find("tbody tr.a_table_form__row").trigger("click");
270
+ const wrapperElement = document.createElement("div");
271
+ const tableElement = document.createElement("table");
272
+ tableElement.id = "table_grow_fallback";
273
+ wrapperElement.getBoundingClientRect = () => ({ width: 500 });
274
+ wrapperElement.appendChild(tableElement);
275
+ document.body.appendChild(wrapperElement);
239
276
 
240
- expect(wrapper.find("tbody button[id$='_save']").exists()).toBe(false);
241
- });
277
+ const props = reactive({
278
+ id: "table_grow_fallback",
279
+ isColumnsGrow: true,
280
+ isDeletable: false,
281
+ isDeletableConfirm: false,
282
+ isDragAndDrop: false,
283
+ isEditable: true,
284
+ });
285
+ const columns = ref([
286
+ { grow: 0, id: "first", width: "100px" },
287
+ { id: "second", width: "100px" },
288
+ ]);
289
+ const columnsVisible = computed(() => columns.value);
290
+ const {
291
+ columnsStylesGrow,
292
+ destroyColumnsGrowObserver,
293
+ initColumnsGrowObserver,
294
+ } = ColumnsGrowAPI(props, {
295
+ columnsVisible,
296
+ hasActionsColumn: computed(() => true),
297
+ widthsLocal: computed(() => ({
298
+ actionsColumnDouble: 112,
299
+ actionsColumnSingle: 64,
300
+ dndColumn: 56,
301
+ })),
302
+ });
242
303
 
243
- it("focuses the clicked column after entering edit mode by row click", async() => {
244
- const wrapper = mount(ATableForm, {
245
- attachTo: document.body,
246
- props: {
247
- columns: [
248
- {
249
- id: "number",
250
- label: "Number",
251
- formElement: {
252
- type: "text",
253
- },
254
- },
255
- {
256
- id: "name",
257
- label: "Name",
258
- formElement: {
259
- type: "text",
260
- },
261
- },
262
- ],
263
- isEditable: true,
264
- isEditOnRowClick: true,
265
- rows: [
266
- {
267
- name: "Marta Ivanova",
268
- number: 1,
269
- },
270
- ],
304
+ initColumnsGrowObserver();
305
+
306
+ expect(columnsStylesGrow.value).toEqual({
307
+ first: {
308
+ maxWidth: "217px",
309
+ minWidth: "217px",
310
+ width: "217px",
311
+ },
312
+ second: {
313
+ maxWidth: "217px",
314
+ minWidth: "217px",
315
+ width: "217px",
271
316
  },
272
317
  });
273
318
 
274
- await wrapper.find("tbody [data-column-id='name']").trigger("click");
275
- await wrapper.vm.$nextTick();
319
+ columns.value = [
320
+ { grow: 1, id: "first", width: "100px" },
321
+ { grow: 0, id: "second", width: "100px" },
322
+ ];
323
+ await nextTick();
276
324
 
277
- expect(wrapper.find("tbody button[id$='_save']").exists()).toBe(true);
278
- expect(document.activeElement.closest("[data-column-id]").dataset.columnId).toBe("name");
325
+ expect(columnsStylesGrow.value.first.width).toBe("334px");
326
+ expect(columnsStylesGrow.value.second.width).toBe("100px");
279
327
 
280
- wrapper.unmount();
328
+ destroyColumnsGrowObserver();
329
+ wrapperElement.remove();
330
+ global.ResizeObserver = resizeObserverOriginal;
281
331
  });
282
332
 
283
- it("focuses the clicked form item in list view after entering edit mode by row click", async() => {
333
+ it("allows adding editable data when row editing is disabled", async() => {
284
334
  const wrapper = mount(ATableForm, {
285
- attachTo: document.body,
286
335
  props: {
336
+ addRow: jest.fn(),
287
337
  columns: [
288
- {
289
- id: "number",
290
- label: "Number",
291
- formElement: {
292
- type: "text",
293
- },
294
- },
295
338
  {
296
339
  id: "name",
297
- label: "Name",
298
340
  formElement: {
299
341
  type: "text",
300
342
  },
301
343
  },
302
344
  ],
303
- isEditable: true,
304
- isEditOnRowClick: true,
345
+ isAddable: true,
346
+ isEditable: false,
305
347
  rowView: "list",
306
- rows: [
307
- {
308
- name: "Marta Ivanova",
309
- number: 1,
310
- },
311
- ],
348
+ rows: [],
312
349
  },
313
350
  });
314
351
 
315
- await wrapper.find("tbody [data-column-id='name']").trigger("click");
316
- await wrapper.vm.$nextTick();
352
+ expect(wrapper.find(".a_table_form__cell_actions").exists()).toBe(false);
317
353
 
318
- expect(wrapper.find("tbody button[id$='_save']").exists()).toBe(true);
319
- expect(document.activeElement.closest("[data-column-id]").dataset.columnId).toBe("name");
354
+ await wrapper.find(".a_mt_3 button").trigger("click");
320
355
 
321
- wrapper.unmount();
356
+ expect(wrapper.find("tbody button[id$='_cancel']").exists()).toBe(true);
357
+ expect(wrapper.find("tbody button[id$='_save']").exists()).toBe(true);
358
+ expect(wrapper.findComponent(AForm).props("readonly")).toBe(false);
322
359
  });
323
360
 
324
- it("renders edit info slot instead of edit info alert", async() => {
361
+ it("allows DND but not row-click editing when rows are not editable", async() => {
325
362
  const wrapper = mount(ATableForm, {
326
363
  props: {
327
364
  columns: [
328
365
  {
329
366
  id: "name",
330
- label: "Name",
331
367
  formElement: {
332
368
  type: "text",
333
369
  },
334
370
  },
335
371
  ],
336
- isEditable: true,
372
+ isDragAndDrop: true,
373
+ isEditable: false,
337
374
  isEditOnRowClick: true,
338
- rows: [
339
- {
340
- name: "Marta Ivanova",
341
- },
342
- ],
343
- texts: {
344
- editInfoText: "Fallback edit info",
345
- },
346
- },
347
- slots: {
348
- editInfo: ({ row }) => h("div", {
349
- class: "test_edit_info_slot",
350
- }, row.name),
351
- },
352
- });
353
-
354
- await wrapper.find("tbody tr.a_table_form__row").trigger("click");
355
-
356
- expect(wrapper.find(".test_edit_info_slot").text()).toBe("Marta Ivanova");
357
- expect(wrapper.findComponent({
358
- name: "AAlert",
359
- }).exists()).toBe(false);
360
- });
361
-
362
- it("uses one content column and finds required fields recursively", () => {
363
- const props = reactive({
364
- columns: [
365
- {
366
- id: "fieldset",
367
- formElement: {
368
- children: [
369
- {
370
- id: "requiredChild",
371
- required: true,
372
- type: "text",
373
- },
374
- ],
375
- type: "fieldset",
376
- },
377
- },
378
- {
379
- id: "secondColumn",
380
- formElement: {
381
- type: "text",
382
- },
383
- },
384
- ],
385
- isAddable: false,
386
- isDeletable: true,
387
- isDeletableConfirm: false,
388
- isDragAndDrop: true,
389
- isEditable: true,
390
- rowView: "list",
391
- rows: [],
392
- });
393
- const {
394
- allColumnsLength,
395
- columnsVisible,
396
- hasActionsColumn,
397
- } = ColumnsAPI(props);
398
- const {
399
- hasRequiredEditableColumns,
400
- } = TableEditAPI(props, {
401
- columnsVisible,
402
- getRowKey: jest.fn(),
403
- });
404
-
405
- expect(allColumnsLength.value).toBe(3);
406
- expect(hasRequiredEditableColumns.value).toBe(true);
407
-
408
- props.rowView = "table";
409
- expect(allColumnsLength.value).toBe(4);
410
- expect(hasActionsColumn.value).toBe(true);
411
- });
412
-
413
- it("converts columns and nested fieldsets to AForm data", () => {
414
- const props = reactive({
415
- columns: [
416
- {
417
- id: "limits",
418
- label: "Limits",
419
- formElement: {
420
- type: "fieldset",
421
- children: [
422
- {
423
- id: "negative",
424
- label: "Negative",
425
- type: "integer",
426
- useRowReadonly: true,
427
- },
428
- ],
429
- },
430
- },
431
- ],
432
- isEditable: true,
433
- isEditMode: false,
434
- });
435
- const {
436
- dataForm,
437
- } = DataAPI(props);
438
-
439
- expect(dataForm.value).toEqual([
440
- {
441
- children: [
442
- {
443
- id: "negative",
444
- label: "Negative",
445
- readonly: true,
446
- type: "integer",
447
- useRowReadonly: true,
448
- },
449
- ],
450
- "data-column-id": "limits",
451
- disabled: true,
452
- id: "limits",
453
- label: "Limits",
454
- type: "fieldset",
455
- },
456
- ]);
457
-
458
- props.isEditMode = true;
459
-
460
- expect(dataForm.value[0].disabled).toBeUndefined();
461
- expect(dataForm.value[0].children[0].readonly).toBe(false);
462
- });
463
-
464
- it("passes the complete errors object to AForm and emits its full model", async() => {
465
- const errors = {
466
- negative: ["Value is too low"],
467
- };
468
- const wrapper = mount(ATableFormCellList, {
469
- props: {
470
- columns: [
471
- {
472
- id: "limits",
473
- formElement: {
474
- type: "fieldset",
475
- children: [
476
- {
477
- id: "negative",
478
- type: "integer",
479
- },
480
- ],
481
- },
482
- },
483
- ],
484
- errors,
485
- id: "table_0",
486
- isEditable: true,
487
- isEditMode: true,
488
- row: {
489
- negative: 10,
490
- },
491
- rowIndex: 0,
492
- rows: [],
375
+ rows: [{ name: "Readonly" }],
493
376
  },
494
377
  });
495
- const form = wrapper.findComponent(AForm);
496
378
 
497
- expect(form.props("errors")).toEqual(errors);
498
- expect(form.props("showErrors")).toBe(true);
499
- expect(form.props("showRequiredText")).toBe(false);
500
- expect(form.props("useFlatErrors")).toBe(true);
379
+ expect(wrapper.find("tbody .a_table_form__reorder_handle").attributes("draggable")).toBe("true");
501
380
 
502
- form.vm.$emit("change", {
503
- fullModel: {
504
- negative: 20,
505
- },
506
- id: "negative",
507
- item: {
508
- id: "negative",
509
- },
510
- model: 20,
511
- });
512
- await wrapper.vm.$nextTick();
381
+ await wrapper.find("tbody tr.a_table_form__row").trigger("click");
513
382
 
514
- expect(wrapper.emitted("updateRowData")[0][0]).toEqual(expect.objectContaining({
515
- column: wrapper.props("columns")[0],
516
- columnId: "negative",
517
- fullModel: {
518
- negative: 20,
519
- },
520
- model: 20,
521
- }));
383
+ expect(wrapper.find("tbody button[id$='_save']").exists()).toBe(false);
522
384
  });
523
385
 
524
- it("replaces the complete edit model and clears the changed field error", () => {
525
- const errorsLocal = ref({
526
- negative: ["Value is too low"],
527
- positive: ["Value is too high"],
528
- });
529
- const {
530
- modelLocal,
531
- updateModelLocal,
532
- } = RowEditAPI(reactive({
533
- changeModel: undefined,
534
- onCancelEditRow: jest.fn(),
535
- row: {
536
- negative: 10,
537
- positive: 10,
538
- },
539
- rowIndex: 0,
540
- rows: [],
541
- saveRow: jest.fn(),
542
- }), {
543
- errorsLocal,
544
- });
545
-
546
- updateModelLocal({
547
- columnId: "negative",
548
- fullModel: {
549
- negative: 20,
550
- positive: 10,
551
- },
552
- model: 20,
553
- });
554
-
555
- expect(modelLocal.value).toEqual({
556
- negative: 20,
557
- positive: 10,
558
- });
559
- expect(errorsLocal.value).toEqual({
560
- positive: ["Value is too high"],
561
- });
562
- });
563
- });
386
+ it("enters edit mode by row click only when enabled and row edit is available", async() => {
387
+ const rows = [
388
+ {
389
+ id: 1,
390
+ name: "Editable",
391
+ },
392
+ {
393
+ id: 2,
394
+ name: "Disabled",
395
+ },
396
+ ];
397
+ const wrapper = mount(ATableForm, {
398
+ props: {
399
+ actionsDisabledCallback: {
400
+ edit: ({ row }) => row.id === 2,
401
+ },
402
+ columns: [
403
+ {
404
+ id: "name",
405
+ label: "Name",
406
+ formElement: {
407
+ type: "text",
408
+ },
409
+ },
410
+ ],
411
+ isEditable: true,
412
+ isEditOnRowClick: true,
413
+ keyId: "id",
414
+ rows,
415
+ },
416
+ });
417
+
418
+ const bodyRows = wrapper.findAll("tbody tr.a_table_form__row");
419
+
420
+ await bodyRows[1].trigger("click");
421
+ expect(wrapper.find("tbody tr.a_table_form__row_edit_on_click").exists()).toBe(true);
422
+
423
+ await bodyRows[0].trigger("click");
424
+ expect(wrapper.find("tbody tr.a_table_form__row_edit_on_click").exists()).toBe(false);
425
+ expect(wrapper.find("tbody button[id$='_save']").exists()).toBe(true);
426
+ });
427
+
428
+ it("does not enter edit mode by row click when the prop is disabled", async() => {
429
+ const wrapper = mount(ATableForm, {
430
+ props: {
431
+ columns: [
432
+ {
433
+ id: "name",
434
+ label: "Name",
435
+ formElement: {
436
+ type: "text",
437
+ },
438
+ },
439
+ ],
440
+ isEditable: true,
441
+ rows: [
442
+ {
443
+ name: "Readonly row click",
444
+ },
445
+ ],
446
+ },
447
+ });
448
+
449
+ await wrapper.find("tbody tr.a_table_form__row").trigger("click");
450
+
451
+ expect(wrapper.find("tbody button[id$='_save']").exists()).toBe(false);
452
+ });
453
+
454
+ it("focuses the clicked column after entering edit mode by row click", async() => {
455
+ const wrapper = mount(ATableForm, {
456
+ attachTo: document.body,
457
+ props: {
458
+ columns: [
459
+ {
460
+ id: "number",
461
+ label: "Number",
462
+ formElement: {
463
+ type: "text",
464
+ },
465
+ },
466
+ {
467
+ id: "name",
468
+ label: "Name",
469
+ formElement: {
470
+ type: "text",
471
+ },
472
+ },
473
+ ],
474
+ isEditable: true,
475
+ isEditOnRowClick: true,
476
+ rows: [
477
+ {
478
+ name: "Marta Ivanova",
479
+ number: 1,
480
+ },
481
+ ],
482
+ },
483
+ });
484
+
485
+ await wrapper.find("tbody [data-column-id='name']").trigger("click");
486
+ await wrapper.vm.$nextTick();
487
+
488
+ expect(wrapper.find("tbody button[id$='_save']").exists()).toBe(true);
489
+ expect(document.activeElement.closest("[data-column-id]").dataset.columnId).toBe("name");
490
+
491
+ wrapper.unmount();
492
+ });
493
+
494
+ it("focuses the clicked form item in list view after entering edit mode by row click", async() => {
495
+ const wrapper = mount(ATableForm, {
496
+ attachTo: document.body,
497
+ props: {
498
+ columns: [
499
+ {
500
+ id: "number",
501
+ label: "Number",
502
+ formElement: {
503
+ type: "text",
504
+ },
505
+ },
506
+ {
507
+ id: "name",
508
+ label: "Name",
509
+ formElement: {
510
+ type: "text",
511
+ },
512
+ },
513
+ ],
514
+ isEditable: true,
515
+ isEditOnRowClick: true,
516
+ rowView: "list",
517
+ rows: [
518
+ {
519
+ name: "Marta Ivanova",
520
+ number: 1,
521
+ },
522
+ ],
523
+ },
524
+ });
525
+
526
+ await wrapper.find("tbody [data-column-id='name']").trigger("click");
527
+ await wrapper.vm.$nextTick();
528
+
529
+ expect(wrapper.find("tbody button[id$='_save']").exists()).toBe(true);
530
+ expect(document.activeElement.closest("[data-column-id]").dataset.columnId).toBe("name");
531
+
532
+ wrapper.unmount();
533
+ });
534
+
535
+ it("uses one content column and finds required fields recursively", () => {
536
+ const props = reactive({
537
+ columns: [
538
+ {
539
+ id: "fieldset",
540
+ formElement: {
541
+ children: [
542
+ {
543
+ id: "requiredChild",
544
+ required: true,
545
+ type: "text",
546
+ },
547
+ ],
548
+ type: "fieldset",
549
+ },
550
+ },
551
+ {
552
+ id: "secondColumn",
553
+ formElement: {
554
+ type: "text",
555
+ },
556
+ },
557
+ ],
558
+ isAddable: false,
559
+ isDeletable: true,
560
+ isDeletableConfirm: false,
561
+ isDragAndDrop: true,
562
+ isEditable: true,
563
+ rowView: "list",
564
+ rows: [],
565
+ });
566
+ const {
567
+ allColumnsLength,
568
+ columnsVisible,
569
+ hasActionsColumn,
570
+ } = ColumnsAPI(props);
571
+ const {
572
+ hasRequiredEditableColumns,
573
+ } = TableEditAPI(props, {
574
+ columnsVisible,
575
+ getRowKey: jest.fn(),
576
+ });
577
+
578
+ expect(allColumnsLength.value).toBe(3);
579
+ expect(hasRequiredEditableColumns.value).toBe(true);
580
+
581
+ props.rowView = "table";
582
+ expect(allColumnsLength.value).toBe(4);
583
+ expect(hasActionsColumn.value).toBe(true);
584
+ });
585
+
586
+ it("converts columns and nested fieldsets to AForm data", () => {
587
+ const props = reactive({
588
+ columns: [
589
+ {
590
+ id: "limits",
591
+ label: "Limits",
592
+ formElement: {
593
+ type: "fieldset",
594
+ children: [
595
+ {
596
+ id: "negative",
597
+ label: "Negative",
598
+ type: "integer",
599
+ useRowReadonly: true,
600
+ },
601
+ ],
602
+ },
603
+ },
604
+ ],
605
+ isEditable: true,
606
+ isEditMode: false,
607
+ });
608
+ const {
609
+ dataForm,
610
+ } = DataAPI(props);
611
+
612
+ expect(dataForm.value).toEqual([
613
+ {
614
+ children: [
615
+ {
616
+ id: "negative",
617
+ label: "Negative",
618
+ readonly: true,
619
+ type: "integer",
620
+ useRowReadonly: true,
621
+ },
622
+ ],
623
+ "data-column-id": "limits",
624
+ disabled: true,
625
+ id: "limits",
626
+ label: "Limits",
627
+ type: "fieldset",
628
+ },
629
+ ]);
630
+
631
+ props.isEditMode = true;
632
+
633
+ expect(dataForm.value[0].disabled).toBeUndefined();
634
+ expect(dataForm.value[0].children[0].readonly).toBe(false);
635
+ });
636
+
637
+ it("passes the complete errors object to AForm and emits its full model", async() => {
638
+ const errors = {
639
+ negative: ["Value is too low"],
640
+ };
641
+ const wrapper = mount(ATableFormCellList, {
642
+ props: {
643
+ columns: [
644
+ {
645
+ id: "limits",
646
+ formElement: {
647
+ type: "fieldset",
648
+ children: [
649
+ {
650
+ id: "negative",
651
+ type: "integer",
652
+ },
653
+ ],
654
+ },
655
+ },
656
+ ],
657
+ errors,
658
+ id: "table_0",
659
+ isEditable: true,
660
+ isEditMode: true,
661
+ row: {
662
+ negative: 10,
663
+ },
664
+ rowIndex: 0,
665
+ rows: [],
666
+ },
667
+ });
668
+ const form = wrapper.findComponent(AForm);
669
+
670
+ expect(form.props("errors")).toEqual(errors);
671
+ expect(form.props("showErrors")).toBe(true);
672
+ expect(form.props("showRequiredText")).toBe(false);
673
+ expect(form.props("useFlatErrors")).toBe(true);
674
+
675
+ form.vm.$emit("change", {
676
+ fullModel: {
677
+ negative: 20,
678
+ },
679
+ id: "negative",
680
+ item: {
681
+ id: "negative",
682
+ },
683
+ model: 20,
684
+ });
685
+ await wrapper.vm.$nextTick();
686
+
687
+ expect(wrapper.emitted("updateRowData")[0][0]).toEqual(expect.objectContaining({
688
+ column: wrapper.props("columns")[0],
689
+ columnId: "negative",
690
+ fullModel: {
691
+ negative: 20,
692
+ },
693
+ model: 20,
694
+ }));
695
+ });
696
+
697
+ it("replaces the complete edit model and clears the changed field error", () => {
698
+ const errorsLocal = ref({
699
+ negative: ["Value is too low"],
700
+ positive: ["Value is too high"],
701
+ });
702
+ const {
703
+ modelLocal,
704
+ updateModelLocal,
705
+ } = RowEditAPI(reactive({
706
+ changeModel: undefined,
707
+ onCancelEditRow: jest.fn(),
708
+ row: {
709
+ negative: 10,
710
+ positive: 10,
711
+ },
712
+ rowIndex: 0,
713
+ rows: [],
714
+ saveRow: jest.fn(),
715
+ }), {
716
+ errorsLocal,
717
+ });
718
+
719
+ updateModelLocal({
720
+ columnId: "negative",
721
+ fullModel: {
722
+ negative: 20,
723
+ positive: 10,
724
+ },
725
+ model: 20,
726
+ });
727
+
728
+ expect(modelLocal.value).toEqual({
729
+ negative: 20,
730
+ positive: 10,
731
+ });
732
+ expect(errorsLocal.value).toEqual({
733
+ positive: ["Value is too high"],
734
+ });
735
+ });
736
+ });