@nextcloud/vue 3.10.2 → 4.1.1

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 (290) hide show
  1. package/CHANGELOG.md +114 -19
  2. package/README.md +9 -10
  3. package/dist/Components/ActionButton.js +24 -3
  4. package/dist/Components/ActionButton.js.map +1 -1
  5. package/dist/Components/ActionCaption.js +23 -0
  6. package/dist/Components/ActionCaption.js.map +1 -0
  7. package/dist/Components/ActionCheckbox.js +24 -3
  8. package/dist/Components/ActionCheckbox.js.map +1 -1
  9. package/dist/Components/ActionInput.js +124 -21
  10. package/dist/Components/ActionInput.js.map +1 -1
  11. package/dist/Components/ActionLink.js +24 -3
  12. package/dist/Components/ActionLink.js.map +1 -1
  13. package/dist/Components/ActionRadio.js +24 -3
  14. package/dist/Components/ActionRadio.js.map +1 -1
  15. package/dist/Components/ActionRouter.js +23 -2
  16. package/dist/Components/ActionRouter.js.map +1 -1
  17. package/dist/Components/ActionSeparator.js +1 -1
  18. package/dist/Components/ActionSeparator.js.map +1 -1
  19. package/dist/Components/ActionText.js +23 -2
  20. package/dist/Components/ActionText.js.map +1 -1
  21. package/dist/Components/ActionTextEditable.js +45 -3
  22. package/dist/Components/ActionTextEditable.js.map +1 -1
  23. package/dist/Components/Actions.js +25 -4
  24. package/dist/Components/Actions.js.map +1 -1
  25. package/dist/Components/AppContent.js +21 -1
  26. package/dist/Components/AppContent.js.map +1 -1
  27. package/dist/Components/AppContentDetails.js +1 -1
  28. package/dist/Components/AppContentDetails.js.map +1 -1
  29. package/dist/Components/AppContentList.js +1 -1
  30. package/dist/Components/AppContentList.js.map +1 -1
  31. package/dist/Components/AppNavigation.js +109 -2
  32. package/dist/Components/AppNavigation.js.map +1 -1
  33. package/dist/Components/AppNavigationCaption.js +66 -1
  34. package/dist/Components/AppNavigationCaption.js.map +1 -1
  35. package/dist/Components/AppNavigationCounter.js +2 -2
  36. package/dist/Components/AppNavigationCounter.js.map +1 -1
  37. package/dist/Components/AppNavigationIconBullet.js +2 -2
  38. package/dist/Components/AppNavigationIconBullet.js.map +1 -1
  39. package/dist/Components/AppNavigationItem.js +49 -7
  40. package/dist/Components/AppNavigationItem.js.map +1 -1
  41. package/dist/Components/AppNavigationNew.js +1 -1
  42. package/dist/Components/AppNavigationNew.js.map +1 -1
  43. package/dist/Components/AppNavigationNewItem.js +2 -2
  44. package/dist/Components/AppNavigationNewItem.js.map +1 -1
  45. package/dist/Components/AppNavigationSettings.js +5 -5
  46. package/dist/Components/AppNavigationSettings.js.map +1 -1
  47. package/dist/Components/AppNavigationSpacer.js +1 -1
  48. package/dist/Components/AppNavigationSpacer.js.map +1 -1
  49. package/dist/Components/AppNavigationToggle.js +109 -2
  50. package/dist/Components/AppNavigationToggle.js.map +1 -1
  51. package/dist/Components/AppSettingsDialog.js +64 -22
  52. package/dist/Components/AppSettingsDialog.js.map +1 -1
  53. package/dist/Components/AppSettingsSection.js +1 -1
  54. package/dist/Components/AppSettingsSection.js.map +1 -1
  55. package/dist/Components/AppSidebar.js +38 -17
  56. package/dist/Components/AppSidebar.js.map +1 -1
  57. package/dist/Components/AppSidebarTab.js +1 -1
  58. package/dist/Components/AppSidebarTab.js.map +1 -1
  59. package/dist/Components/Avatar.js +9 -10
  60. package/dist/Components/Avatar.js.map +1 -1
  61. package/dist/Components/Breadcrumb.js +33 -12
  62. package/dist/Components/Breadcrumb.js.map +1 -1
  63. package/dist/Components/Breadcrumbs.js +59 -17
  64. package/dist/Components/Breadcrumbs.js.map +1 -1
  65. package/dist/Components/CheckboxRadioSwitch.js +44 -0
  66. package/dist/Components/CheckboxRadioSwitch.js.map +1 -0
  67. package/dist/Components/ColorPicker.js +6 -7
  68. package/dist/Components/ColorPicker.js.map +1 -1
  69. package/dist/Components/Content.js +2 -2
  70. package/dist/Components/Content.js.map +1 -1
  71. package/dist/Components/CounterBubble.js +23 -0
  72. package/dist/Components/CounterBubble.js.map +1 -0
  73. package/dist/Components/DatetimePicker.js +341 -3
  74. package/dist/Components/DatetimePicker.js.map +1 -1
  75. package/dist/Components/EmojiPicker.js +14 -14
  76. package/dist/Components/EmojiPicker.js.map +1 -1
  77. package/dist/Components/EmptyContent.js +2 -2
  78. package/dist/Components/EmptyContent.js.map +1 -1
  79. package/dist/Components/Highlight.js +3 -3
  80. package/dist/Components/Highlight.js.map +1 -1
  81. package/dist/Components/ListItem.js +130 -0
  82. package/dist/Components/ListItem.js.map +1 -0
  83. package/dist/Components/ListItemIcon.js +20 -21
  84. package/dist/Components/ListItemIcon.js.map +1 -1
  85. package/dist/Components/Modal.js +53 -11
  86. package/dist/Components/Modal.js.map +1 -1
  87. package/dist/Components/Multiselect.js +22 -23
  88. package/dist/Components/Multiselect.js.map +1 -1
  89. package/dist/Components/MultiselectTags.js +24 -25
  90. package/dist/Components/MultiselectTags.js.map +1 -1
  91. package/dist/Components/Popover.js +2 -2
  92. package/dist/Components/Popover.js.map +1 -1
  93. package/dist/Components/PopoverMenu.js +1 -1
  94. package/dist/Components/PopoverMenu.js.map +1 -1
  95. package/dist/Components/ProgressBar.js +2 -2
  96. package/dist/Components/ProgressBar.js.map +1 -1
  97. package/dist/Components/RichContenteditable.js +2 -2
  98. package/dist/Components/RichContenteditable.js.map +1 -1
  99. package/dist/Components/SettingsInputText.js +22 -1
  100. package/dist/Components/SettingsInputText.js.map +1 -1
  101. package/dist/Components/SettingsSection.js +2 -2
  102. package/dist/Components/SettingsSection.js.map +1 -1
  103. package/dist/Components/SettingsSelectGroup.js +41 -21
  104. package/dist/Components/SettingsSelectGroup.js.map +1 -1
  105. package/dist/Components/TimezonePicker.js +340 -0
  106. package/dist/Components/TimezonePicker.js.map +1 -0
  107. package/dist/Components/UserBubble.js +35 -36
  108. package/dist/Components/UserBubble.js.map +1 -1
  109. package/dist/Directives/Focus.js +1 -1
  110. package/dist/Directives/Focus.js.map +1 -1
  111. package/dist/Directives/Linkify.js +1 -1
  112. package/dist/Directives/Linkify.js.map +1 -1
  113. package/dist/Directives/Tooltip.js +2 -2
  114. package/dist/Directives/Tooltip.js.map +1 -1
  115. package/dist/Functions/usernameToColor.js +2 -3
  116. package/dist/Functions/usernameToColor.js.map +1 -1
  117. package/dist/Mixins/excludeClickOutsideClasses.js +2 -2
  118. package/dist/Mixins/excludeClickOutsideClasses.js.map +1 -1
  119. package/dist/Mixins/isFullscreen.js +1 -1
  120. package/dist/Mixins/isFullscreen.js.map +1 -1
  121. package/dist/Mixins/isMobile.js +1 -1
  122. package/dist/Mixins/isMobile.js.map +1 -1
  123. package/dist/Mixins/richEditor.js +1 -1
  124. package/dist/Mixins/richEditor.js.map +1 -1
  125. package/dist/ncvuecomponents.js +276 -69
  126. package/dist/ncvuecomponents.js.map +1 -1
  127. package/package.json +28 -43
  128. package/src/assets/action.scss +0 -132
  129. package/src/assets/iconfont/README.md +0 -30
  130. package/src/assets/iconfont/arrow-left-double.svg +0 -3
  131. package/src/assets/iconfont/arrow-left.svg +0 -3
  132. package/src/assets/iconfont/arrow-right-double.svg +0 -3
  133. package/src/assets/iconfont/arrow-right.svg +0 -3
  134. package/src/assets/iconfont/breadcrumb.svg +0 -1
  135. package/src/assets/iconfont/checkmark.svg +0 -1
  136. package/src/assets/iconfont/close.svg +0 -1
  137. package/src/assets/iconfont/confirm.svg +0 -1
  138. package/src/assets/iconfont/info.svg +0 -1
  139. package/src/assets/iconfont/menu.svg +0 -1
  140. package/src/assets/iconfont/more.svg +0 -1
  141. package/src/assets/iconfont/pause.svg +0 -1
  142. package/src/assets/iconfont/play.svg +0 -1
  143. package/src/assets/iconfont/triangle-s.svg +0 -1
  144. package/src/assets/iconfont/user-status-away.svg +0 -2
  145. package/src/assets/iconfont/user-status-dnd.svg +0 -2
  146. package/src/assets/iconfont/user-status-invisible.svg +0 -2
  147. package/src/assets/iconfont/user-status-online.svg +0 -2
  148. package/src/assets/inputs.scss +0 -104
  149. package/src/assets/variables.scss +0 -57
  150. package/src/components/ActionButton/ActionButton.vue +0 -160
  151. package/src/components/ActionButton/index.js +0 -24
  152. package/src/components/ActionCheckbox/ActionCheckbox.vue +0 -220
  153. package/src/components/ActionCheckbox/index.js +0 -24
  154. package/src/components/ActionInput/ActionInput.vue +0 -418
  155. package/src/components/ActionInput/index.js +0 -24
  156. package/src/components/ActionLink/ActionLink.vue +0 -132
  157. package/src/components/ActionLink/index.js +0 -24
  158. package/src/components/ActionRadio/ActionRadio.vue +0 -219
  159. package/src/components/ActionRadio/index.js +0 -24
  160. package/src/components/ActionRouter/ActionRouter.vue +0 -100
  161. package/src/components/ActionRouter/index.js +0 -24
  162. package/src/components/ActionSeparator/ActionSeparator.vue +0 -43
  163. package/src/components/ActionSeparator/index.js +0 -24
  164. package/src/components/ActionText/ActionText.vue +0 -87
  165. package/src/components/ActionText/index.js +0 -24
  166. package/src/components/ActionTextEditable/ActionTextEditable.vue +0 -306
  167. package/src/components/ActionTextEditable/index.js +0 -24
  168. package/src/components/Actions/Actions.vue +0 -764
  169. package/src/components/Actions/index.js +0 -24
  170. package/src/components/AppContent/AppContent.vue +0 -93
  171. package/src/components/AppContent/index.js +0 -23
  172. package/src/components/AppContentDetails/AppContentDetails.vue +0 -34
  173. package/src/components/AppContentDetails/index.js +0 -23
  174. package/src/components/AppContentList/AppContentList.vue +0 -44
  175. package/src/components/AppContentList/index.js +0 -23
  176. package/src/components/AppNavigation/AppNavigation.vue +0 -190
  177. package/src/components/AppNavigation/index.js +0 -23
  178. package/src/components/AppNavigationCaption/AppNavigationCaption.vue +0 -39
  179. package/src/components/AppNavigationCaption/index.js +0 -3
  180. package/src/components/AppNavigationCounter/AppNavigationCounter.vue +0 -82
  181. package/src/components/AppNavigationCounter/index.js +0 -25
  182. package/src/components/AppNavigationIconBullet/AppNavigationIconBullet.vue +0 -95
  183. package/src/components/AppNavigationIconBullet/index.js +0 -24
  184. package/src/components/AppNavigationItem/AppNavigationIconCollapsible.vue +0 -90
  185. package/src/components/AppNavigationItem/AppNavigationItem.vue +0 -629
  186. package/src/components/AppNavigationItem/InputConfirmCancel.vue +0 -134
  187. package/src/components/AppNavigationItem/index.js +0 -24
  188. package/src/components/AppNavigationNew/AppNavigationNew.vue +0 -76
  189. package/src/components/AppNavigationNew/index.js +0 -23
  190. package/src/components/AppNavigationNewItem/AppNavigationNewItem.vue +0 -165
  191. package/src/components/AppNavigationNewItem/index.js +0 -24
  192. package/src/components/AppNavigationSettings/AppNavigationSettings.vue +0 -105
  193. package/src/components/AppNavigationSettings/index.js +0 -23
  194. package/src/components/AppNavigationSpacer/AppNavigationSpacer.vue +0 -39
  195. package/src/components/AppNavigationSpacer/index.js +0 -23
  196. package/src/components/AppNavigationToggle/AppNavigationToggle.vue +0 -78
  197. package/src/components/AppNavigationToggle/index.js +0 -24
  198. package/src/components/AppSettingsDialog/AppSettingsDialog.vue +0 -331
  199. package/src/components/AppSettingsDialog/index.js +0 -25
  200. package/src/components/AppSettingsSection/AppSettingsSection.vue +0 -64
  201. package/src/components/AppSettingsSection/index.js +0 -25
  202. package/src/components/AppSidebar/AppSidebar.vue +0 -802
  203. package/src/components/AppSidebar/AppSidebarTabs.vue +0 -348
  204. package/src/components/AppSidebar/index.js +0 -23
  205. package/src/components/AppSidebarTab/AppSidebarTab.vue +0 -103
  206. package/src/components/AppSidebarTab/index.js +0 -23
  207. package/src/components/Avatar/Avatar.vue +0 -758
  208. package/src/components/Avatar/index.js +0 -25
  209. package/src/components/Breadcrumb/Breadcrumb.vue +0 -262
  210. package/src/components/Breadcrumb/index.js +0 -25
  211. package/src/components/Breadcrumbs/Breadcrumbs.vue +0 -537
  212. package/src/components/Breadcrumbs/index.js +0 -25
  213. package/src/components/ColorPicker/ColorPicker.vue +0 -380
  214. package/src/components/ColorPicker/index.js +0 -25
  215. package/src/components/Content/Content.vue +0 -77
  216. package/src/components/Content/index.js +0 -23
  217. package/src/components/DatetimePicker/DatetimePicker.vue +0 -195
  218. package/src/components/DatetimePicker/index.js +0 -28
  219. package/src/components/DatetimePicker/index.scss +0 -405
  220. package/src/components/EmojiPicker/EmojiPicker.vue +0 -302
  221. package/src/components/EmojiPicker/index.js +0 -23
  222. package/src/components/EmptyContent/EmptyContent.vue +0 -120
  223. package/src/components/EmptyContent/index.js +0 -24
  224. package/src/components/Highlight/Highlight.vue +0 -183
  225. package/src/components/Highlight/index.js +0 -25
  226. package/src/components/ListItemIcon/ListItemIcon.vue +0 -277
  227. package/src/components/ListItemIcon/index.js +0 -25
  228. package/src/components/Modal/Modal.vue +0 -833
  229. package/src/components/Modal/index.js +0 -27
  230. package/src/components/Multiselect/EllipsisedOption.vue +0 -141
  231. package/src/components/Multiselect/Multiselect.vue +0 -430
  232. package/src/components/Multiselect/index.js +0 -28
  233. package/src/components/Multiselect/index.scss +0 -290
  234. package/src/components/MultiselectTags/MultiselectTags.vue +0 -179
  235. package/src/components/MultiselectTags/api.js +0 -115
  236. package/src/components/MultiselectTags/index.js +0 -23
  237. package/src/components/Popover/Popover.vue +0 -208
  238. package/src/components/Popover/index.js +0 -25
  239. package/src/components/PopoverMenu/PopoverMenu.vue +0 -62
  240. package/src/components/PopoverMenu/PopoverMenuItem.vue +0 -382
  241. package/src/components/PopoverMenu/index.js +0 -24
  242. package/src/components/ProgressBar/ProgressBar.vue +0 -135
  243. package/src/components/ProgressBar/index.js +0 -25
  244. package/src/components/RichContenteditable/AutoCompleteResult.vue +0 -191
  245. package/src/components/RichContenteditable/MentionBubble.vue +0 -165
  246. package/src/components/RichContenteditable/RichContenteditable.vue +0 -517
  247. package/src/components/RichContenteditable/index.js +0 -25
  248. package/src/components/SettingsInputText/SettingsInputText.vue +0 -207
  249. package/src/components/SettingsInputText/index.js +0 -24
  250. package/src/components/SettingsSection/SettingsSection.vue +0 -151
  251. package/src/components/SettingsSection/index.js +0 -24
  252. package/src/components/SettingsSelectGroup/SettingsSelectGroup.vue +0 -149
  253. package/src/components/SettingsSelectGroup/index.js +0 -25
  254. package/src/components/UserBubble/UserBubble.vue +0 -319
  255. package/src/components/UserBubble/index.js +0 -25
  256. package/src/components/index.js +0 -110
  257. package/src/directives/Focus/index.js +0 -29
  258. package/src/directives/Linkify/index.js +0 -31
  259. package/src/directives/Tooltip/index.js +0 -32
  260. package/src/directives/Tooltip/index.scss +0 -117
  261. package/src/directives/index.js +0 -31
  262. package/src/fonts/iconfont-vue-f56d517.eot +0 -0
  263. package/src/fonts/iconfont-vue-f56d517.svg +0 -1
  264. package/src/fonts/iconfont-vue-f56d517.ttf +0 -0
  265. package/src/fonts/iconfont-vue-f56d517.woff +0 -0
  266. package/src/fonts/scss/iconfont-vue.scss +0 -115
  267. package/src/functions/usernameToColor/index.js +0 -25
  268. package/src/functions/usernameToColor/usernameToColor.js +0 -68
  269. package/src/index.js +0 -40
  270. package/src/l10n.js +0 -42
  271. package/src/mixins/actionGlobal.js +0 -59
  272. package/src/mixins/actionText.js +0 -85
  273. package/src/mixins/excludeClickOutsideClasses/index.js +0 -72
  274. package/src/mixins/index.js +0 -35
  275. package/src/mixins/isFullscreen/index.js +0 -46
  276. package/src/mixins/isMobile/index.js +0 -43
  277. package/src/mixins/l10n.js +0 -8
  278. package/src/mixins/richEditor/index.js +0 -160
  279. package/src/mixins/userStatus.js +0 -76
  280. package/src/utils/FindRanges.js +0 -47
  281. package/src/utils/GenColors.js +0 -79
  282. package/src/utils/GenRandomId.js +0 -31
  283. package/src/utils/GetChildren.js +0 -47
  284. package/src/utils/GetParent.js +0 -41
  285. package/src/utils/IsMobileState.js +0 -49
  286. package/src/utils/IsOutOfViewport.js +0 -36
  287. package/src/utils/ScopeComponent.js +0 -37
  288. package/src/utils/Timer.js +0 -61
  289. package/src/utils/ValidateChildren.js +0 -50
  290. package/src/utils/ValidateSlot.js +0 -57
@@ -1,24 +0,0 @@
1
- /**
2
- * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
3
- *
4
- * @author John Molakvoæ <skjnldsv@protonmail.com>
5
- *
6
- * @license GNU AGPL version 3 or any later version
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU Affero General Public License as
10
- * published by the Free Software Foundation, either version 3 of the
11
- * License, or (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU Affero General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU Affero General Public License
19
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
- import ActionCheckbox from './ActionCheckbox'
23
-
24
- export default ActionCheckbox
@@ -1,418 +0,0 @@
1
- <!--
2
- - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
3
- -
4
- - @author John Molakvoæ <skjnldsv@protonmail.com>
5
- - @author Marco Ambrosini <marcoambrosini@pm.me>
6
- -
7
- - @license GNU AGPL version 3 or any later version
8
- -
9
- - This program is free software: you can redistribute it and/or modify
10
- - it under the terms of the GNU Affero General Public License as
11
- - published by the Free Software Foundation, either version 3 of the
12
- - License, or (at your option) any later version.
13
- -
14
- - This program is distributed in the hope that it will be useful,
15
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- - GNU Affero General Public License for more details.
18
- -
19
- - You should have received a copy of the GNU Affero General Public License
20
- - along with this program. If not, see <http://www.gnu.org/licenses/>.
21
- -
22
- -->
23
-
24
- <docs>
25
- This component is made to be used inside of the [Actions](#Actions) component slots.
26
- All undocumented attributes will be bound to the input, the datepicker or the multiselect component, e.g. `maxlength`, `not-before`.
27
- For the multiselect component, all events will be passed through. Please see the multiselect component's documentation for more details and examples.
28
- ```
29
- <Actions>
30
- <ActionInput icon="icon-edit" value="This is an input" />
31
- <ActionInput icon="icon-edit">This is the placeholder</ActionInput>
32
- <ActionInput icon="icon-close" :disabled="true" value="This is a disabled input" />
33
- <ActionInput icon="icon-edit" type="date">Please pick a date</ActionInput>
34
- <ActionInput icon="icon-edit" type="multiselect" :options="['Apple', 'Banana', 'Cherry']">Please pick a fruit</ActionInput>
35
- </Actions>
36
- ```
37
- </docs>
38
-
39
- <template>
40
- <li class="action" :class="{ 'action--disabled': disabled }">
41
- <span :class="{ 'action-input--picker': isDatePickerType , 'action-input-picker--disabled': disabled}"
42
- class="action-input"
43
- @mouseleave="onLeave">
44
- <!-- @slot Manually provide icon -->
45
- <slot name="icon">
46
- <span :class="[isIconUrl ? 'action-input__icon--url' : icon]"
47
- :style="{ backgroundImage: isIconUrl ? `url(${icon})` : null }"
48
- class="action-input__icon" />
49
- </slot>
50
-
51
- <!-- form and input -->
52
- <form ref="form"
53
- class="action-input__form"
54
- :disabled="disabled"
55
- @submit.prevent="onSubmit">
56
-
57
- <DatetimePicker v-if="isDatePickerType"
58
- ref="datetimepicker"
59
- :value="value"
60
- :placeholder="text"
61
- :disabled="disabled"
62
- :type="isDatePickerType"
63
- :input-class="['mx-input', { focusable: isFocusable }]"
64
- class="action-input__picker"
65
- v-bind="$attrs"
66
- @input="onInput"
67
- @change="onChange" />
68
-
69
- <Multiselect v-else-if="isMultiselectType"
70
- :value="value"
71
- :placeholder="text"
72
- :disabled="disabled"
73
- :class="{ focusable: isFocusable }"
74
- class="action-input__multi"
75
- v-bind="$attrs"
76
- v-on="$listeners" />
77
-
78
- <template v-else>
79
- <input :id="id" type="submit" class="action-input__submit">
80
-
81
- <input :type="type"
82
- :value="value"
83
- :placeholder="text"
84
- :disabled="disabled"
85
- v-bind="$attrs"
86
- :class="{ focusable: isFocusable }"
87
- class="action-input__input"
88
- @input="onInput"
89
- @change="onChange">
90
- <!-- allow the custom font to inject a ::before
91
- not possible on input[type=submit] -->
92
- <label v-show="!disabled" :for="id" class="action-input__label" />
93
- </template>
94
- </form>
95
- </span>
96
- </li>
97
- </template>
98
-
99
- <script>
100
- import ActionGlobalMixin from '../../mixins/actionGlobal'
101
- import GenRandomId from '../../utils/GenRandomId'
102
- import DatetimePicker from '../DatetimePicker'
103
- import Multiselect from '../Multiselect'
104
-
105
- export default {
106
- name: 'ActionInput',
107
-
108
- components: {
109
- DatetimePicker,
110
- Multiselect,
111
- },
112
-
113
- mixins: [ActionGlobalMixin],
114
-
115
- props: {
116
- /**
117
- * id attribute of the checkbox element
118
- */
119
- id: {
120
- type: String,
121
- default: () => 'action-' + GenRandomId(),
122
- validator: id => id.trim() !== '',
123
- },
124
- /**
125
- * Icon to show with the action, can be either a CSS class or an URL
126
- */
127
- icon: {
128
- type: String,
129
- default: '',
130
- required: true,
131
- },
132
- /**
133
- * type attribute of the input field
134
- */
135
- type: {
136
- type: String,
137
- default: 'text',
138
- validator(type) {
139
- return ['date', 'datetime-local', 'month', 'multiselect',
140
- 'number', 'password', 'search', 'tel',
141
- 'text', 'time', 'url', 'week', 'color',
142
- 'email'].indexOf(type) > -1
143
- },
144
- },
145
- /**
146
- * value attribute of the input field
147
- */
148
- value: {
149
- type: [String, Date, Number],
150
- default: '',
151
- },
152
- /**
153
- * disabled state of the input field
154
- */
155
- disabled: {
156
- type: Boolean,
157
- default: false,
158
- },
159
- },
160
-
161
- computed: {
162
- isIconUrl() {
163
- try {
164
- return new URL(this.icon)
165
- } catch (error) {
166
- return false
167
- }
168
- },
169
-
170
- isMultiselectType() {
171
- return this.type === 'multiselect'
172
- },
173
-
174
- isDatePickerType() {
175
- switch (this.type) {
176
- case 'date':
177
- case 'month':
178
- case 'time':
179
- return this.type
180
-
181
- case 'datetime-local':
182
- return 'datetime'
183
- }
184
- return false
185
- },
186
- /**
187
- * determines if the action is focusable
188
- * @returns {boolean} is the action focusable ?
189
- */
190
- isFocusable() {
191
- return !this.disabled
192
- },
193
- },
194
-
195
- methods: {
196
- // closing datepicker popup on mouseleave = unfocus
197
- onLeave() {
198
- if (this.$refs.datetimepicker && this.$refs.datetimepicker.$refs.datepicker) {
199
- this.$refs.datetimepicker.$refs.datepicker.closePopup()
200
- }
201
- },
202
- onInput(event) {
203
- /**
204
- * Emitted on input events of the text field
205
- * @type {Event|Date}
206
- */
207
- this.$emit('input', event)
208
- /**
209
- * Emitted when the inputs value changes
210
- * ! DatetimePicker only send the value
211
- * @type {string|Date}
212
- */
213
- this.$emit('update:value', event.target ? event.target.value : event)
214
- },
215
- onSubmit(event) {
216
- event.preventDefault()
217
- event.stopPropagation()
218
- if (!this.disabled) {
219
- /**
220
- * Emitted on submit of the input field
221
- * @type {Event}
222
- */
223
- this.$emit('submit', event)
224
- } else {
225
- // ignore submit
226
- return false
227
- }
228
- },
229
- onChange(event) {
230
- /**
231
- * Emitted on change of the input field
232
- * @type {Event}
233
- */
234
- this.$emit('change', event)
235
- },
236
- },
237
- }
238
- </script>
239
-
240
- <style lang="scss" scoped>
241
- @import '../../fonts/scss/iconfont-vue';
242
- @import '../../assets/inputs';
243
- @import '../../assets/action';
244
- @include action-active;
245
- @include action--disabled;
246
-
247
- $input-margin: 4px;
248
-
249
- .action-input {
250
- display: flex;
251
- align-items: flex-start;
252
-
253
- width: 100%;
254
- height: auto;
255
- margin: 0;
256
- padding: 0;
257
-
258
- cursor: pointer;
259
- white-space: nowrap;
260
-
261
- color: var(--color-main-text);
262
- border: 0;
263
- border-radius: 0; // otherwise Safari will cut the border-radius area
264
- background-color: transparent;
265
- box-shadow: none;
266
-
267
- font-weight: normal;
268
-
269
- // do not change the opacity of the datepicker
270
- &:not(.action-input--picker) {
271
- opacity: $opacity_normal;
272
- &:hover,
273
- &:focus {
274
- opacity: $opacity_full;
275
- }
276
- }
277
-
278
- // only change for the icon then
279
- &--picker {
280
- .action-input__icon {
281
- opacity: $opacity_normal;
282
- }
283
- &:hover .action-input__icon,
284
- &:focus .action-input__icon {
285
- opacity: $opacity_full;
286
- }
287
- }
288
-
289
- & > span {
290
- cursor: pointer;
291
- white-space: nowrap;
292
- }
293
-
294
- &__icon {
295
- min-width: 0; /* Overwrite icons*/
296
- min-height: 0;
297
- /* Keep padding to define the width to
298
- assure correct position of a possible text */
299
- padding: #{$clickable-area / 2} 0 #{$clickable-area / 2} $clickable-area;
300
-
301
- background-position: #{$icon-margin} center;
302
- background-size: $icon-size;
303
- }
304
-
305
- // Forms & text inputs
306
- &__form {
307
- display: flex;
308
- align-items: center;
309
- flex: 1 1 auto;
310
-
311
- margin: $input-margin 0;
312
- padding-right: $icon-margin;
313
- }
314
-
315
- &__submit {
316
- position: absolute;
317
- left: -10000px;
318
- top: auto;
319
- width: 1px;
320
- height: 1px;
321
- overflow: hidden;
322
- }
323
-
324
- &__label {
325
- display: flex;
326
- align-items: center;
327
- justify-content: center;
328
-
329
- width: #{$clickable-area - $input-margin * 2};
330
- height: #{$clickable-area - $input-margin * 2};
331
- box-sizing: border-box;
332
- margin: 0 0 0 -8px;
333
- padding: 7px 6px;
334
-
335
- cursor: pointer;
336
-
337
- opacity: $opacity_full;
338
- color: var(--color-text-lighter);
339
- border: 1px solid var(--color-border-dark);
340
- border-left-color: transparent;
341
- border-radius: 0 var(--border-radius) var(--border-radius) 0;
342
- /* Avoid background under border */
343
- background-color: var(--color-main-background);
344
- background-clip: padding-box;
345
-
346
- font-size: $icon-size;
347
-
348
- @include iconfont('confirm');
349
- }
350
-
351
- /* Inputs inside popover supports text, submit & reset */
352
- &__input {
353
- flex: 1 1 auto;
354
-
355
- min-width: $clickable-area * 3;
356
- min-height: #{$clickable-area - $input-margin * 2}; /* twice the element margin-y */
357
- max-height: #{$clickable-area - $input-margin * 2}; /* twice the element margin-y */
358
- margin: 0;
359
-
360
- // if disabled, change cursor
361
- &:disabled {
362
- cursor: default;
363
- }
364
-
365
- /* only show confirm borders if input is not focused */
366
- &:not(:active):not(:hover):not(:focus) {
367
- &:invalid {
368
- & + .action-input__label {
369
- border-color: var(--color-error);
370
- border-left-color: transparent;
371
- }
372
- }
373
- &:not(:disabled) + .action-input__label {
374
- &:active,
375
- &:hover,
376
- &:focus {
377
- border-color: var(--color-primary-element);
378
- border-radius: var(--border-radius);
379
- }
380
- }
381
- }
382
- &:active,
383
- &:hover,
384
- &:focus {
385
- &:not(:disabled) + .action-input__label {
386
- /* above previous input */
387
- z-index: 2;
388
-
389
- border-color: var(--color-primary-element);
390
- border-left-color: transparent;
391
- }
392
- }
393
- }
394
-
395
- &__picker::v-deep { // stylelint-disable-line
396
- .mx-input {
397
- margin: 0;
398
- }
399
- }
400
-
401
- &__multi {
402
- width: 100%;
403
- }
404
- }
405
-
406
- // if a form is the last of the list
407
- // add the same bottomMargin as the right padding
408
- // for visual balance
409
- li:last-child > .action-input {
410
- margin-bottom: $icon-margin - $input-margin;
411
- }
412
-
413
- // same for first item
414
- li:first-child > .action-input {
415
- margin-top: $icon-margin - $input-margin;
416
- }
417
-
418
- </style>
@@ -1,24 +0,0 @@
1
- /**
2
- * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
3
- *
4
- * @author John Molakvoæ <skjnldsv@protonmail.com>
5
- *
6
- * @license GNU AGPL version 3 or any later version
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU Affero General Public License as
10
- * published by the Free Software Foundation, either version 3 of the
11
- * License, or (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU Affero General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU Affero General Public License
19
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
- import ActionInput from './ActionInput'
23
-
24
- export default ActionInput