aloha-vue 2.84.0 → 2.86.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 (246) hide show
  1. package/CHANGELOG.md +1208 -1196
  2. package/README.md +117 -117
  3. package/dist/aloha-vue.css +13806 -13601
  4. package/dist/aloha-vue.css.map +1 -1
  5. package/dist/aloha-vue.es.js +60168 -57382
  6. package/dist/aloha-vue.umd.js +319 -319
  7. package/package.json +1 -1
  8. package/scss/components/AButton.scss +6 -6
  9. package/scss/components/ADivider.scss +9 -9
  10. package/scss/components/AElement.scss +6 -6
  11. package/scss/components/AGroupButtonDropdown.scss +4 -4
  12. package/scss/components/AIcon.scss +17 -17
  13. package/scss/components/ALoading.scss +18 -18
  14. package/scss/components/AMenu.scss +634 -634
  15. package/scss/components/AProgressCirle.scss +43 -43
  16. package/scss/components/AShowMore.scss +9 -9
  17. package/scss/components/ATableForm.scss +7 -7
  18. package/scss/components/ATabs.scss +186 -186
  19. package/scss/components/ui/AColorPicker.scss +223 -0
  20. package/scss/components/ui/AJson.scss +11 -11
  21. package/scss/components/ui/ui.scss +1 -0
  22. package/scss/text/text_line_height.scss +17 -17
  23. package/scss/text/text_size.scss +88 -88
  24. package/scss/utils/acordion.scss +173 -173
  25. package/scss/utils/alert.scss +81 -81
  26. package/scss/utils/aloha_prefix.scss +1 -1
  27. package/scss/utils/backdrop.scss +24 -24
  28. package/scss/utils/border.scss +65 -65
  29. package/scss/utils/breakpoint.scss +48 -48
  30. package/scss/utils/button_close.scss +22 -22
  31. package/scss/utils/button_group.scss +69 -69
  32. package/scss/utils/color_utils.scss +234 -234
  33. package/scss/utils/display.scss +67 -67
  34. package/scss/utils/flex.scss +141 -141
  35. package/scss/utils/float.scss +10 -10
  36. package/scss/utils/global.scss +44 -44
  37. package/scss/utils/global_variables.scss +26 -26
  38. package/scss/utils/grid.scss +95 -95
  39. package/scss/utils/list_columns.scss +31 -31
  40. package/scss/utils/list_group.scss +127 -127
  41. package/scss/utils/notification.scss +36 -36
  42. package/scss/utils/overflow.scss +40 -40
  43. package/scss/utils/pagination.scss +94 -94
  44. package/scss/utils/position.scss +90 -90
  45. package/scss/utils/progress.scss +70 -70
  46. package/scss/utils/screenreader.scss +16 -16
  47. package/scss/utils/spinner.scss +35 -35
  48. package/scss/utils/utils.scss +19 -19
  49. package/scss/utils/vars_global.scss +12 -12
  50. package/src/AAlert/i18n/AAlertI18n.js +4 -0
  51. package/src/AAlert/i18n/nl.json +3 -0
  52. package/src/AAlert/i18n/pl.json +3 -0
  53. package/src/ACarousel/i18n/ACarouselI18n.js +4 -0
  54. package/src/ACarousel/i18n/nl.json +9 -0
  55. package/src/ACarousel/i18n/pl.json +9 -0
  56. package/src/ACloak/i18n/ACloakI18n.js +4 -0
  57. package/src/ACloak/i18n/nl.json +3 -0
  58. package/src/ACloak/i18n/pl.json +3 -0
  59. package/src/ADisclosure/i18n/ADisclosureI18n.js +4 -0
  60. package/src/ADisclosure/i18n/nl.json +4 -0
  61. package/src/ADisclosure/i18n/pl.json +4 -0
  62. package/src/AFilters/i18n/AFiltersI18n.js +4 -0
  63. package/src/AFilters/i18n/nl.json +30 -0
  64. package/src/AFilters/i18n/pl.json +30 -0
  65. package/src/AGroupButtonDropdown/AGroupButtonDropdown.js +119 -119
  66. package/src/ALinkCopy/i18n/ALinkCopyI18n.js +4 -0
  67. package/src/ALinkCopy/i18n/nl.json +4 -0
  68. package/src/ALinkCopy/i18n/pl.json +4 -0
  69. package/src/ALoading/i18n/ALoadingI18n.js +4 -0
  70. package/src/ALoading/i18n/nl.json +3 -0
  71. package/src/ALoading/i18n/pl.json +3 -0
  72. package/src/AMenu/i18n/AMenu2I18n.js +4 -0
  73. package/src/AMenu/i18n/nl.json +14 -0
  74. package/src/AMenu/i18n/pl.json +14 -0
  75. package/src/AModal/compositionAPI/ZIndexAPI.js +48 -48
  76. package/src/AModal/i18n/AModalI18n.js +4 -0
  77. package/src/AModal/i18n/nl.json +7 -0
  78. package/src/AModal/i18n/pl.json +7 -0
  79. package/src/APagination/i18n/APaginationI18n.js +4 -0
  80. package/src/APagination/i18n/nl.json +12 -0
  81. package/src/APagination/i18n/pl.json +12 -0
  82. package/src/AProgress/AProgress.js +141 -141
  83. package/src/AProgressCircle/AProgressCircle.js +160 -160
  84. package/src/AShowMore/i18n/AShowMoreI18n.js +4 -0
  85. package/src/AShowMore/i18n/nl.json +6 -0
  86. package/src/AShowMore/i18n/pl.json +6 -0
  87. package/src/ASpinner/i18n/ASpinnerI18n.js +4 -0
  88. package/src/ASpinner/i18n/nl.json +3 -0
  89. package/src/ASpinner/i18n/pl.json +3 -0
  90. package/src/ATable/ATableHeaderTh/ATableHeaderTh.js +188 -188
  91. package/src/ATable/i18n/ATableI18n.js +4 -0
  92. package/src/ATable/i18n/nl.json +54 -0
  93. package/src/ATable/i18n/pl.json +54 -0
  94. package/src/ATableForm/i18n/ATableFormI18n.js +4 -0
  95. package/src/ATableForm/i18n/nl.json +18 -0
  96. package/src/ATableForm/i18n/pl.json +18 -0
  97. package/src/ATranslation/ATranslation.js +46 -0
  98. package/src/ATranslation/__tests__/ATranslation.test.js +121 -0
  99. package/src/ATranslation/compositionAPI/UtilsAPI.js +6 -1
  100. package/src/ATranslation/compositionAPI/__tests__/UtilsAPI.getTranslatedText.test.js +38 -0
  101. package/src/AVerticalScroll/i18n/AVerticalScrollI18n.js +4 -0
  102. package/src/AVerticalScroll/i18n/nl.json +4 -0
  103. package/src/AVerticalScroll/i18n/pl.json +4 -0
  104. package/src/AWizard/i18n/AWizardI18n.js +4 -0
  105. package/src/AWizard/i18n/nl.json +16 -0
  106. package/src/AWizard/i18n/pl.json +16 -0
  107. package/src/PVP/new.txt +39 -39
  108. package/src/PuxDatepicker/PuxDatepicker.js +670 -670
  109. package/src/PuxDatepicker/PuxDatepicker.pug +131 -131
  110. package/src/PuxDatepicker/PuxDatepicker.vue +2 -2
  111. package/src/PuxDatepicker/PuxDatepickerCalendarPanel/PuxDatepickerCalendarPanel.pug +136 -136
  112. package/src/PuxDatepicker/PuxDatepickerCalendarPanel/PuxDatepickerCalendarPanel.vue +2 -2
  113. package/src/PuxDatepicker/PuxDatepickerIcon/PuxDatepickerIcon.js +30 -30
  114. package/src/PuxDatepicker/PuxDatepickerIcon/PuxDatepickerIcon.pug +6 -6
  115. package/src/PuxDatepicker/PuxDatepickerIcon/PuxDatepickerIcon.vue +2 -2
  116. package/src/PuxDatepicker/locale/languages.js +174 -174
  117. package/src/PuxDatepicker/mixins/PanelMixin.js +76 -76
  118. package/src/PuxDatepicker/panel/PanelDate/PanelDate.pug +41 -41
  119. package/src/PuxDatepicker/panel/PanelDate/PanelDate.vue +2 -2
  120. package/src/PuxDatepicker/panel/PanelMonth/PanelMonth.pug +16 -16
  121. package/src/PuxDatepicker/panel/PanelMonth/PanelMonth.vue +2 -2
  122. package/src/PuxDatepicker/panel/PanelTime/PanelTime.pug +20 -20
  123. package/src/PuxDatepicker/panel/PanelTime/PanelTime.vue +2 -2
  124. package/src/PuxDatepicker/panel/PanelYear/PanelYear.pug +16 -16
  125. package/src/PuxDatepicker/panel/PanelYear/PanelYear.vue +2 -2
  126. package/src/PuxDatepicker/panel/PanelYearItem/PanelYearItem.js +55 -55
  127. package/src/PuxDatepicker/panel/PanelYearItem/PanelYearItem.pug +9 -9
  128. package/src/PuxDatepicker/panel/PanelYearItem/PanelYearItem.vue +2 -2
  129. package/src/PuxDatepicker/utils/keysCode.js +9 -9
  130. package/src/PuxDatepicker/utils/scroll-into-view.js +23 -23
  131. package/src/PuxDatepicker/utils/transform.js +23 -23
  132. package/src/filters/i18n/Filters18n.js +4 -0
  133. package/src/filters/i18n/nl.json +11 -0
  134. package/src/filters/i18n/pl.json +11 -0
  135. package/src/i18n/allLanguages.js +96 -0
  136. package/src/i18n/nl.json +4 -0
  137. package/src/i18n/pl.json +4 -0
  138. package/src/index.js +4 -0
  139. package/src/ui/ACheckbox/ACheckbox.js +5 -0
  140. package/src/ui/ACheckbox/i18n/ACheckboxI18n.js +4 -0
  141. package/src/ui/ACheckbox/i18n/nl.json +5 -0
  142. package/src/ui/ACheckbox/i18n/pl.json +5 -0
  143. package/src/ui/AColorPicker/AColorPicker.js +697 -0
  144. package/src/ui/AColorPicker/AColorPickerSaturation/AColorPickerSaturation.js +102 -0
  145. package/src/ui/AColorPicker/AColorPickerSaturation/compositionAPI/SaturationAPI.js +77 -0
  146. package/src/ui/AColorPicker/AColorPickerSlider/AColorPickerSlider.js +125 -0
  147. package/src/ui/AColorPicker/AColorPickerSlider/compositionAPI/SliderAPI.js +73 -0
  148. package/src/ui/AColorPicker/__tests__/AColorPicker.test.js +139 -0
  149. package/src/ui/AColorPicker/__tests__/colorUtils.test.js +92 -0
  150. package/src/ui/AColorPicker/compositionAPI/ColorStateAPI.js +108 -0
  151. package/src/ui/AColorPicker/compositionAPI/ConfirmAPI.js +36 -0
  152. package/src/ui/AColorPicker/compositionAPI/InputAPI.js +63 -0
  153. package/src/ui/AColorPicker/compositionAPI/KeyboardStepAPI.js +42 -0
  154. package/src/ui/AColorPicker/compositionAPI/PointerDragAPI.js +70 -0
  155. package/src/ui/AColorPicker/compositionAPI/PopoverAPI.js +179 -0
  156. package/src/ui/AColorPicker/compositionAPI/PredefineAPI.js +42 -0
  157. package/src/ui/AColorPicker/compositionAPI/ToggleClassAPI.js +24 -0
  158. package/src/ui/AColorPicker/i18n/AColorPickerI18n.js +25 -0
  159. package/src/ui/AColorPicker/i18n/ar.json +13 -0
  160. package/src/ui/AColorPicker/i18n/de.json +13 -0
  161. package/src/ui/AColorPicker/i18n/en.json +13 -0
  162. package/src/ui/AColorPicker/i18n/es.json +13 -0
  163. package/src/ui/AColorPicker/i18n/fr.json +13 -0
  164. package/src/ui/AColorPicker/i18n/hr.json +13 -0
  165. package/src/ui/AColorPicker/i18n/it.json +13 -0
  166. package/src/ui/AColorPicker/i18n/nl.json +13 -0
  167. package/src/ui/AColorPicker/i18n/pl.json +13 -0
  168. package/src/ui/AColorPicker/i18n/ru.json +13 -0
  169. package/src/ui/AColorPicker/i18n/uk.json +13 -0
  170. package/src/ui/AColorPicker/utils/colorUtils.js +281 -0
  171. package/src/ui/ADatepicker/ADatepickerCalendarPanel/ADatepickerCalendarPanel.js +68 -68
  172. package/src/ui/ADatepicker/i18n/ADatepickerI18n.js +4 -0
  173. package/src/ui/ADatepicker/i18n/nl.json +58 -0
  174. package/src/ui/ADatepicker/i18n/pl.json +58 -0
  175. package/src/ui/ADatepicker/panel/APanelTime/APanelTime.js +147 -147
  176. package/src/ui/ADatepicker/panel/APanelYear/APanelYear.js +123 -123
  177. package/src/ui/ADatepickerAlt/ADatepickerCalendarPanel/ADatepickerCalendarPanel.js +804 -804
  178. package/src/ui/ADatepickerAlt/panel/APanelDate/APanelDate.js +353 -353
  179. package/src/ui/ADatepickerAlt/panel/APanelMonth/APanelMonth.js +187 -187
  180. package/src/ui/ADatepickerAlt/panel/APanelTime/APanelTime.js +303 -303
  181. package/src/ui/ADatepickerAlt/panel/APanelYear/APanelYear.js +162 -162
  182. package/src/ui/ADatepickerRange/i18n/ADatepickerRangeI18n.js +4 -0
  183. package/src/ui/ADatepickerRange/i18n/nl.json +4 -0
  184. package/src/ui/ADatepickerRange/i18n/pl.json +4 -0
  185. package/src/ui/AErrors/i18n/AErrorsI18n.js +4 -0
  186. package/src/ui/AErrors/i18n/nl.json +3 -0
  187. package/src/ui/AErrors/i18n/pl.json +3 -0
  188. package/src/ui/AFieldset/__tests__/AFieldset.ClassColumn.test.js +1 -0
  189. package/src/ui/AFieldset/i18n/AFieldsetI18n.js +4 -0
  190. package/src/ui/AFieldset/i18n/nl.json +4 -0
  191. package/src/ui/AFieldset/i18n/pl.json +4 -0
  192. package/src/ui/AFormElementBtnClear/i18n/AFormElementBtnClearI18n.js +4 -0
  193. package/src/ui/AFormElementBtnClear/i18n/nl.json +3 -0
  194. package/src/ui/AFormElementBtnClear/i18n/pl.json +3 -0
  195. package/src/ui/AInput/i18n/AInputI18n.js +4 -0
  196. package/src/ui/AInput/i18n/nl.json +4 -0
  197. package/src/ui/AInput/i18n/pl.json +4 -0
  198. package/src/ui/AInputCurrency/i18n/AInputCurrencyI18n.js +4 -0
  199. package/src/ui/AInputCurrency/i18n/nl.json +4 -0
  200. package/src/ui/AInputCurrency/i18n/pl.json +4 -0
  201. package/src/ui/AInputNumber/i18n/AInputNumberI18n.js +4 -0
  202. package/src/ui/AInputNumber/i18n/nl.json +4 -0
  203. package/src/ui/AInputNumber/i18n/pl.json +4 -0
  204. package/src/ui/AInputNumberRange/i18n/AInputNumberRangeI18n.js +4 -0
  205. package/src/ui/AInputNumberRange/i18n/nl.json +4 -0
  206. package/src/ui/AInputNumberRange/i18n/pl.json +4 -0
  207. package/src/ui/AJson/i18n/AJsonI18n.js +4 -0
  208. package/src/ui/AJson/i18n/nl.json +8 -0
  209. package/src/ui/AJson/i18n/pl.json +8 -0
  210. package/src/ui/AMultiselectOrdered/i18n/AMultiselectOrderedI18n.js +4 -0
  211. package/src/ui/AMultiselectOrdered/i18n/nl.json +12 -0
  212. package/src/ui/AMultiselectOrdered/i18n/pl.json +12 -0
  213. package/src/ui/ARadio/i18n/ARadioI18n.js +4 -0
  214. package/src/ui/ARadio/i18n/nl.json +5 -0
  215. package/src/ui/ARadio/i18n/pl.json +5 -0
  216. package/src/ui/ARequired/i18n/ARequiredI18n.js +4 -0
  217. package/src/ui/ARequired/i18n/nl.json +3 -0
  218. package/src/ui/ARequired/i18n/pl.json +3 -0
  219. package/src/ui/ARouterLinkConfig/i18n/ARouterLinkConfigI18n.js +4 -0
  220. package/src/ui/ARouterLinkConfig/i18n/nl.json +14 -0
  221. package/src/ui/ARouterLinkConfig/i18n/pl.json +14 -0
  222. package/src/ui/ASelect/i18n/ASelectI18n.js +4 -0
  223. package/src/ui/ASelect/i18n/ar.json +5 -5
  224. package/src/ui/ASelect/i18n/de.json +4 -4
  225. package/src/ui/ASelect/i18n/en.json +5 -5
  226. package/src/ui/ASelect/i18n/es.json +5 -5
  227. package/src/ui/ASelect/i18n/fr.json +5 -5
  228. package/src/ui/ASelect/i18n/hr.json +5 -5
  229. package/src/ui/ASelect/i18n/it.json +5 -5
  230. package/src/ui/ASelect/i18n/nl.json +11 -0
  231. package/src/ui/ASelect/i18n/pl.json +11 -0
  232. package/src/ui/ASelect/i18n/ru.json +5 -5
  233. package/src/ui/ASelectStyle/i18n/ASelectStyleI18n.js +4 -0
  234. package/src/ui/ASelectStyle/i18n/nl.json +292 -0
  235. package/src/ui/ASelectStyle/i18n/pl.json +292 -0
  236. package/src/ui/ASlider/i18n/ASliderI18n.js +4 -0
  237. package/src/ui/ASlider/i18n/nl.json +5 -0
  238. package/src/ui/ASlider/i18n/pl.json +5 -0
  239. package/src/ui/ASwitch/i18n/ASwitchI18n.js +4 -0
  240. package/src/ui/ASwitch/i18n/nl.json +5 -0
  241. package/src/ui/ASwitch/i18n/pl.json +5 -0
  242. package/src/ui/AUiComponents.js +2 -0
  243. package/src/ui/AValidatedJson/i18n/AValidatedJsonI18n.js +4 -0
  244. package/src/ui/AValidatedJson/i18n/nl.json +25 -0
  245. package/src/ui/AValidatedJson/i18n/pl.json +25 -0
  246. package/src/ui/compositionApi/__tests__/UiStyleHideAPI.test.js +9 -4
@@ -0,0 +1,697 @@
1
+ import {
2
+ computed,
3
+ h,
4
+ Teleport,
5
+ } from "vue";
6
+ import {
7
+ AButton,
8
+ AErrorsText,
9
+ AFormElementBtnClear,
10
+ AFormHelpText,
11
+ AFormLabelDescription,
12
+ AFormReadonly,
13
+ AIcon,
14
+ AInput,
15
+ ALabel,
16
+ ATranslation,
17
+ UiAPI,
18
+ UiClearButtonAPI,
19
+ UiDisabledAPI,
20
+ UIExcludeRenderAttributesAPI,
21
+ UiStyleHideAPI,
22
+ } from "../../index";
23
+
24
+ import AColorPickerSaturation from "./AColorPickerSaturation/AColorPickerSaturation";
25
+ import AColorPickerSlider from "./AColorPickerSlider/AColorPickerSlider";
26
+
27
+ import ColorStateAPI from "./compositionAPI/ColorStateAPI";
28
+ import ConfirmAPI from "./compositionAPI/ConfirmAPI";
29
+ import InputAPI from "./compositionAPI/InputAPI";
30
+ import PopoverAPI from "./compositionAPI/PopoverAPI";
31
+ import PredefineAPI from "./compositionAPI/PredefineAPI";
32
+ import ToggleClassAPI from "./compositionAPI/ToggleClassAPI";
33
+
34
+ import placements from "../../const/placements";
35
+ import {
36
+ COLOR_FORMATS,
37
+ } from "./utils/colorUtils";
38
+ import {
39
+ uniqueId,
40
+ } from "lodash-es";
41
+
42
+ const HUE_BACKGROUND = "linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)";
43
+
44
+ export default {
45
+ name: "AColorPicker",
46
+ inheritAttrs: false,
47
+ props: {
48
+ alwaysTranslate: {
49
+ type: Boolean,
50
+ required: false,
51
+ },
52
+ change: {
53
+ type: Function,
54
+ required: false,
55
+ default: () => {},
56
+ },
57
+ clearButtonClass: {
58
+ type: [String, Object],
59
+ required: false,
60
+ default: undefined,
61
+ },
62
+ colorFormat: {
63
+ type: String,
64
+ required: false,
65
+ default: "hex",
66
+ validator: value => COLOR_FORMATS.indexOf(value) !== -1,
67
+ },
68
+ dependencies: {
69
+ type: [Array, Object],
70
+ required: false,
71
+ default: undefined,
72
+ },
73
+ disabled: {
74
+ type: Boolean,
75
+ required: false,
76
+ },
77
+ errorIcon: {
78
+ type: [String, Object],
79
+ required: false,
80
+ default: undefined,
81
+ },
82
+ errors: {
83
+ type: [String, Array],
84
+ required: false,
85
+ default: undefined,
86
+ },
87
+ errorsClass: {
88
+ type: [String, Object],
89
+ required: false,
90
+ default: undefined,
91
+ },
92
+ excludeRenderAttributes: {
93
+ type: Array,
94
+ required: false,
95
+ default: () => [],
96
+ },
97
+ extra: {
98
+ type: Object,
99
+ required: false,
100
+ default: undefined,
101
+ },
102
+ helpText: {
103
+ type: String,
104
+ required: false,
105
+ default: undefined,
106
+ },
107
+ htmlId: {
108
+ type: String,
109
+ required: false,
110
+ default: undefined,
111
+ },
112
+ id: {
113
+ type: [String, Number],
114
+ required: false,
115
+ default: () => uniqueId("a_color_picker_"),
116
+ },
117
+ idPrefix: {
118
+ type: String,
119
+ required: false,
120
+ default: undefined,
121
+ },
122
+ isClearButton: {
123
+ type: Boolean,
124
+ required: false,
125
+ default: true,
126
+ },
127
+ isHide: {
128
+ type: Boolean,
129
+ required: false,
130
+ },
131
+ isLabelFloat: {
132
+ type: Boolean,
133
+ required: false,
134
+ default: true,
135
+ },
136
+ isRender: {
137
+ type: Boolean,
138
+ required: false,
139
+ default: true,
140
+ },
141
+ label: {
142
+ type: [String, Number],
143
+ required: false,
144
+ default: undefined,
145
+ },
146
+ labelClass: {
147
+ type: [String, Object],
148
+ required: false,
149
+ default: undefined,
150
+ },
151
+ labelDescription: {
152
+ type: String,
153
+ required: false,
154
+ default: undefined,
155
+ },
156
+ labelScreenReader: {
157
+ type: [String, Number],
158
+ required: false,
159
+ default: undefined,
160
+ },
161
+ modelDependencies: {
162
+ type: Object,
163
+ required: false,
164
+ default: () => ({}),
165
+ },
166
+ modelUndefined: {
167
+ type: [String, Number, Object, Array, Boolean],
168
+ required: false,
169
+ default: "",
170
+ },
171
+ modelValue: {
172
+ type: String,
173
+ required: false,
174
+ default: undefined,
175
+ },
176
+ panelDefaultColor: {
177
+ type: String,
178
+ required: false,
179
+ default: "#ff0000",
180
+ },
181
+ placement: {
182
+ type: String,
183
+ required: false,
184
+ default: "bottom-start",
185
+ validator: value => placements.indexOf(value) !== -1,
186
+ },
187
+ predefine: {
188
+ type: Array,
189
+ required: false,
190
+ default: () => [],
191
+ },
192
+ readonly: {
193
+ type: Boolean,
194
+ required: false,
195
+ },
196
+ readonlyDefault: {
197
+ type: String,
198
+ required: false,
199
+ default: "",
200
+ },
201
+ readonlyValueParentClass: {
202
+ type: [String, Object, Array],
203
+ required: false,
204
+ default: undefined,
205
+ },
206
+ required: {
207
+ type: Boolean,
208
+ required: false,
209
+ default: false,
210
+ },
211
+ showAlpha: {
212
+ type: Boolean,
213
+ required: false,
214
+ },
215
+ type: {
216
+ type: String,
217
+ required: false,
218
+ default: "colorPicker",
219
+ },
220
+ },
221
+ emits: [
222
+ "blur",
223
+ "close",
224
+ "focus",
225
+ "open",
226
+ "update:modelValue",
227
+ ],
228
+ setup(props, context) {
229
+ const {
230
+ disabledAttribut,
231
+ } = UiDisabledAPI(props);
232
+
233
+ const {
234
+ attributesToExcludeFromRender,
235
+ } = UIExcludeRenderAttributesAPI(props);
236
+
237
+ const {
238
+ componentStyleHide,
239
+ } = UiStyleHideAPI(props);
240
+
241
+ const {
242
+ alphaBackground,
243
+ alphaPercent,
244
+ cssColorLocal,
245
+ cssColorOpaqueLocal,
246
+ hsva,
247
+ hueCssColor,
248
+ modelCssColor,
249
+ modelTextColor,
250
+ rgbaLocal,
251
+ setAlphaPercent,
252
+ setColor,
253
+ setColorFromModel,
254
+ setHue,
255
+ setSaturationBrightness,
256
+ valueLocal,
257
+ } = ColorStateAPI(props);
258
+
259
+ const {
260
+ ariaDescribedbyLocal,
261
+ changeModel,
262
+ errorsId,
263
+ helpTextId,
264
+ htmlIdLocal,
265
+ isErrors,
266
+ isModel,
267
+ labelDescriptionId,
268
+ onBlur,
269
+ onFocus,
270
+ } = UiAPI(props, context);
271
+
272
+ const {
273
+ closePopover,
274
+ isOpen,
275
+ onPopupKeydown,
276
+ onToggleKeydown,
277
+ popupId,
278
+ popupRef,
279
+ toggleRef,
280
+ togglePopover,
281
+ } = PopoverAPI(props, context, {
282
+ htmlIdLocal,
283
+ setColorFromModel,
284
+ });
285
+
286
+ const {
287
+ applyInput,
288
+ inputErrors,
289
+ inputText,
290
+ onInputChange,
291
+ onInputKeydown,
292
+ } = InputAPI({
293
+ setColor,
294
+ valueLocal,
295
+ });
296
+
297
+ const {
298
+ clearColor,
299
+ confirmColor,
300
+ } = ConfirmAPI(props, {
301
+ applyInput,
302
+ changeModel,
303
+ closePopover,
304
+ valueLocal,
305
+ });
306
+
307
+ const {
308
+ predefineLocal,
309
+ selectPredefine,
310
+ } = PredefineAPI(props, {
311
+ rgbaLocal,
312
+ setColor,
313
+ });
314
+
315
+ const {
316
+ isClearButtonLocal,
317
+ } = UiClearButtonAPI(props, {
318
+ isModel,
319
+ });
320
+
321
+ const {
322
+ hasErrorIcon,
323
+ toggleClassBtns,
324
+ } = ToggleClassAPI(props, {
325
+ isClearButtonLocal,
326
+ isErrors,
327
+ });
328
+
329
+ const labelId = computed(() => `${ htmlIdLocal.value }_label`);
330
+ const valueId = computed(() => `${ htmlIdLocal.value }_value`);
331
+
332
+ const clearModelFromToggle = () => {
333
+ changeModel({
334
+ model: props.modelUndefined,
335
+ triggerDetails: "clear",
336
+ });
337
+ toggleRef.value?.focus();
338
+ };
339
+
340
+ return {
341
+ alphaBackground,
342
+ alphaPercent,
343
+ applyInput,
344
+ ariaDescribedbyLocal,
345
+ attributesToExcludeFromRender,
346
+ clearColor,
347
+ clearModelFromToggle,
348
+ componentStyleHide,
349
+ confirmColor,
350
+ cssColorLocal,
351
+ cssColorOpaqueLocal,
352
+ disabledAttribut,
353
+ errorsId,
354
+ hasErrorIcon,
355
+ helpTextId,
356
+ hsva,
357
+ htmlIdLocal,
358
+ hueCssColor,
359
+ inputErrors,
360
+ inputText,
361
+ isClearButtonLocal,
362
+ isErrors,
363
+ isModel,
364
+ isOpen,
365
+ labelDescriptionId,
366
+ labelId,
367
+ modelCssColor,
368
+ modelTextColor,
369
+ onBlur,
370
+ onFocus,
371
+ onInputChange,
372
+ onInputKeydown,
373
+ onPopupKeydown,
374
+ onToggleKeydown,
375
+ popupId,
376
+ popupRef,
377
+ predefineLocal,
378
+ selectPredefine,
379
+ setAlphaPercent,
380
+ setHue,
381
+ setSaturationBrightness,
382
+ toggleClassBtns,
383
+ togglePopover,
384
+ toggleRef,
385
+ valueId,
386
+ valueLocal,
387
+ };
388
+ },
389
+ render() {
390
+ if (!this.isRender) {
391
+ return null;
392
+ }
393
+
394
+ if (this.readonly) {
395
+ return h(AFormReadonly, {
396
+ ...this.$attrs,
397
+ valueParentClass: this.readonlyValueParentClass,
398
+ id: this.htmlIdLocal,
399
+ alwaysTranslate: this.alwaysTranslate,
400
+ excludeRenderAttributes: this.excludeRenderAttributes,
401
+ extra: this.extra,
402
+ helpText: this.helpText,
403
+ label: this.label,
404
+ labelClass: this.labelClass,
405
+ labelScreenReader: this.labelScreenReader,
406
+ modelValue: undefined,
407
+ readonlyDefault: this.readonlyDefault,
408
+ required: this.required,
409
+ style: this.componentStyleHide,
410
+ type: this.type,
411
+ }, this.isModel ?
412
+ () => [
413
+ h("span", {
414
+ class: "a_color_picker__readonly",
415
+ }, [
416
+ h("span", {
417
+ class: "a_color_picker__swatch",
418
+ style: {
419
+ "--a_color_picker_color": this.modelCssColor,
420
+ },
421
+ ariaHidden: true,
422
+ }),
423
+ h("span", {}, this.modelValue),
424
+ ]),
425
+ ] :
426
+ "");
427
+ }
428
+
429
+ const hasLabel = !!(this.label || this.labelScreenReader);
430
+
431
+ return h("div", {
432
+ ...this.$attrs,
433
+ style: this.componentStyleHide,
434
+ ...this.attributesToExcludeFromRender,
435
+ }, [
436
+ h("div", {
437
+ class: ["a_form_element__parent a_color_picker", {
438
+ a_form_element__parent_float: this.isLabelFloat,
439
+ a_form_element__parent_float_has_error_icon: this.hasErrorIcon,
440
+ a_form_element__parent_not_empty: this.isModel,
441
+ a_color_picker_has_color: this.isModel,
442
+ }],
443
+ style: this.isModel ?
444
+ {
445
+ "--a_color_picker_color": this.modelCssColor,
446
+ "--a_color_picker_text_color": this.modelTextColor,
447
+ } :
448
+ undefined,
449
+ }, [
450
+ hasLabel ?
451
+ h(ALabel, {
452
+ id: this.htmlIdLocal,
453
+ alwaysTranslate: this.alwaysTranslate,
454
+ extra: this.extra,
455
+ isError: this.isErrors,
456
+ isLabelFloat: this.isLabelFloat,
457
+ label: this.label,
458
+ labelClass: this.labelClass,
459
+ labelScreenReader: this.labelScreenReader,
460
+ required: this.required,
461
+ type: this.type,
462
+ }) :
463
+ "",
464
+ h(AFormLabelDescription, {
465
+ id: this.labelDescriptionId,
466
+ alwaysTranslate: this.alwaysTranslate,
467
+ html: this.labelDescription,
468
+ extra: this.extra,
469
+ isLabelFloat: this.isLabelFloat,
470
+ }),
471
+ h("div", {
472
+ class: "a_form_element",
473
+ }, [
474
+ this.hasErrorIcon ?
475
+ h(AIcon, {
476
+ icon: this.errorIcon,
477
+ class: "a_input__icon_error",
478
+ }) :
479
+ "",
480
+ h("button", {
481
+ ref: "toggleRef",
482
+ id: this.htmlIdLocal,
483
+ type: "button",
484
+ class: [
485
+ "a_form_control a_color_picker__toggle",
486
+ this.toggleClassBtns,
487
+ {
488
+ a_form_control_invalid: this.isErrors,
489
+ a_color_picker__toggle_empty: !this.isModel,
490
+ a_color_picker__toggle_open: this.isOpen,
491
+ },
492
+ ],
493
+ disabled: this.disabledAttribut,
494
+ "aria-haspopup": "dialog",
495
+ "aria-expanded": this.isOpen ? "true" : "false",
496
+ "aria-controls": this.isOpen ? this.popupId : undefined,
497
+ "aria-labelledby": hasLabel ? `${ this.labelId } ${ this.valueId }` : undefined,
498
+ "aria-describedby": this.ariaDescribedbyLocal,
499
+ "aria-invalid": this.isErrors ? "true" : undefined,
500
+ onClick: this.togglePopover,
501
+ onKeydown: this.onToggleKeydown,
502
+ onFocus: this.onFocus,
503
+ onBlur: this.onBlur,
504
+ }, [
505
+ this.isModel ?
506
+ h("span", {
507
+ id: this.valueId,
508
+ class: "a_color_picker__toggle__value",
509
+ }, this.modelValue) :
510
+ h(ATranslation, {
511
+ id: this.valueId,
512
+ alwaysTranslate: this.alwaysTranslate,
513
+ class: [
514
+ "a_color_picker__toggle__empty",
515
+ {
516
+ a_sr_only: this.isLabelFloat && hasLabel,
517
+ },
518
+ ],
519
+ tag: "span",
520
+ text: "_A_COLOR_PICKER_EMPTY_",
521
+ }),
522
+ ]),
523
+ this.isClearButtonLocal ?
524
+ h("div", {
525
+ class: "a_form_control__actions",
526
+ }, [
527
+ h(AFormElementBtnClear, {
528
+ alwaysTranslate: this.alwaysTranslate,
529
+ disabled: this.disabled,
530
+ class: this.clearButtonClass,
531
+ onClear: this.clearModelFromToggle,
532
+ }),
533
+ ]) :
534
+ "",
535
+ ]),
536
+ h(AFormHelpText, {
537
+ id: this.helpTextId,
538
+ alwaysTranslate: this.alwaysTranslate,
539
+ html: this.helpText,
540
+ extra: this.extra,
541
+ }),
542
+ this.isErrors && h(AErrorsText, {
543
+ id: this.errorsId,
544
+ alwaysTranslate: this.alwaysTranslate,
545
+ errors: this.errors,
546
+ errorsClass: this.errorsClass,
547
+ }),
548
+ ]),
549
+ h(Teleport, {
550
+ to: "body",
551
+ }, [
552
+ this.isOpen ?
553
+ h("div", {
554
+ ref: "popupRef",
555
+ id: this.popupId,
556
+ class: "a_color_picker__popup",
557
+ role: "dialog",
558
+ "aria-modal": "true",
559
+ "aria-labelledby": hasLabel ? this.labelId : undefined,
560
+ onKeydown: this.onPopupKeydown,
561
+ }, [
562
+ hasLabel ?
563
+ "" :
564
+ h(ATranslation, {
565
+ alwaysTranslate: this.alwaysTranslate,
566
+ class: "a_sr_only",
567
+ tag: "h2",
568
+ text: "_A_COLOR_PICKER_DIALOG_",
569
+ }),
570
+ h(AColorPickerSaturation, {
571
+ id: `${ this.htmlIdLocal }_saturation`,
572
+ alwaysTranslate: this.alwaysTranslate,
573
+ brightness: this.hsva.v,
574
+ hue: this.hsva.h,
575
+ saturation: this.hsva.s,
576
+ thumbColor: this.cssColorOpaqueLocal,
577
+ onChange: this.setSaturationBrightness,
578
+ }),
579
+ h("div", {
580
+ class: "a_color_picker__controls",
581
+ }, [
582
+ h("div", {
583
+ class: "a_color_picker__sliders",
584
+ }, [
585
+ h(AColorPickerSlider, {
586
+ id: `${ this.htmlIdLocal }_hue`,
587
+ alwaysTranslate: this.alwaysTranslate,
588
+ background: HUE_BACKGROUND,
589
+ class: "a_color_picker_slider_hue",
590
+ label: "_A_COLOR_PICKER_HUE_",
591
+ largeStep: 15,
592
+ max: 360,
593
+ modelValue: this.hsva.h,
594
+ thumbColor: this.hueCssColor,
595
+ valueText: `${ this.hsva.h }°`,
596
+ "onUpdate:modelValue": this.setHue,
597
+ }),
598
+ this.showAlpha ?
599
+ h(AColorPickerSlider, {
600
+ id: `${ this.htmlIdLocal }_alpha`,
601
+ alwaysTranslate: this.alwaysTranslate,
602
+ background: this.alphaBackground,
603
+ class: "a_color_picker_slider_alpha",
604
+ label: "_A_COLOR_PICKER_ALPHA_",
605
+ max: 100,
606
+ modelValue: this.alphaPercent,
607
+ thumbColor: this.cssColorLocal,
608
+ valueText: `${ this.alphaPercent } %`,
609
+ "onUpdate:modelValue": this.setAlphaPercent,
610
+ }) :
611
+ "",
612
+ ]),
613
+ h("span", {
614
+ class: "a_color_picker__swatch a_color_picker__preview",
615
+ style: {
616
+ "--a_color_picker_color": this.cssColorLocal,
617
+ },
618
+ ariaHidden: true,
619
+ }),
620
+ ]),
621
+ h(AInput, {
622
+ id: `${ this.htmlIdLocal }_input`,
623
+ alwaysTranslate: this.alwaysTranslate,
624
+ class: "a_color_picker__input",
625
+ errors: this.inputErrors,
626
+ inputAttributes: {
627
+ autocomplete: "off",
628
+ spellcheck: "false",
629
+ onKeydown: this.onInputKeydown,
630
+ },
631
+ isClearButton: false,
632
+ isLabelFloat: false,
633
+ label: "_A_COLOR_PICKER_INPUT_",
634
+ labelClass: "a_sr_only",
635
+ modelValue: this.inputText,
636
+ change: this.onInputChange,
637
+ onBlur: this.applyInput,
638
+ }),
639
+ this.predefineLocal.length ?
640
+ h("div", {
641
+ class: "a_color_picker__predefine",
642
+ role: "group",
643
+ "aria-label": undefined,
644
+ "aria-labelledby": `${ this.htmlIdLocal }_predefine_label`,
645
+ }, [
646
+ h(ATranslation, {
647
+ id: `${ this.htmlIdLocal }_predefine_label`,
648
+ alwaysTranslate: this.alwaysTranslate,
649
+ class: "a_sr_only",
650
+ tag: "span",
651
+ text: "_A_COLOR_PICKER_PREDEFINE_",
652
+ }),
653
+ this.predefineLocal.map(item => {
654
+ return h("button", {
655
+ key: item.value,
656
+ type: "button",
657
+ class: [
658
+ "a_color_picker__predefine__item",
659
+ {
660
+ a_color_picker__predefine__item_selected: item.isSelected,
661
+ },
662
+ ],
663
+ style: {
664
+ "--a_color_picker_color": item.cssColor,
665
+ },
666
+ title: item.value,
667
+ "aria-label": item.value,
668
+ "aria-pressed": item.isSelected ? "true" : "false",
669
+ onClick: () => this.selectPredefine(item),
670
+ });
671
+ }),
672
+ ]) :
673
+ "",
674
+ h("div", {
675
+ class: "a_color_picker__footer",
676
+ }, [
677
+ h(AButton, {
678
+ alwaysTranslate: this.alwaysTranslate,
679
+ class: "a_btn a_btn_link a_btn_small",
680
+ text: "_A_COLOR_PICKER_CLEAR_",
681
+ type: "button",
682
+ onClick: this.clearColor,
683
+ }),
684
+ h(AButton, {
685
+ alwaysTranslate: this.alwaysTranslate,
686
+ class: "a_btn a_btn_primary a_btn_small",
687
+ text: "_A_COLOR_PICKER_CONFIRM_",
688
+ type: "button",
689
+ onClick: this.confirmColor,
690
+ }),
691
+ ]),
692
+ ]) :
693
+ "",
694
+ ]),
695
+ ]);
696
+ },
697
+ };