@nextcloud/vue 8.0.0-beta.8 → 8.0.0-beta.9

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 (223) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/Components/NcActionButton.cjs +8 -8
  3. package/dist/Components/NcActionButton.cjs.map +1 -1
  4. package/dist/Components/NcActionButton.mjs +10 -10
  5. package/dist/Components/NcActionButton.mjs.map +1 -1
  6. package/dist/Components/NcActionInput.cjs +23 -18
  7. package/dist/Components/NcActionInput.cjs.map +1 -1
  8. package/dist/Components/NcActionInput.mjs +20 -14
  9. package/dist/Components/NcActionInput.mjs.map +1 -1
  10. package/dist/Components/NcActionLink.cjs +7 -7
  11. package/dist/Components/NcActionLink.cjs.map +1 -1
  12. package/dist/Components/NcActionLink.mjs +4 -4
  13. package/dist/Components/NcActionLink.mjs.map +1 -1
  14. package/dist/Components/NcActionRouter.cjs +8 -8
  15. package/dist/Components/NcActionRouter.cjs.map +1 -1
  16. package/dist/Components/NcActionRouter.mjs +4 -4
  17. package/dist/Components/NcActionRouter.mjs.map +1 -1
  18. package/dist/Components/NcActionText.cjs +10 -10
  19. package/dist/Components/NcActionText.cjs.map +1 -1
  20. package/dist/Components/NcActionText.mjs +11 -11
  21. package/dist/Components/NcActionText.mjs.map +1 -1
  22. package/dist/Components/NcActionTextEditable.cjs +1 -1
  23. package/dist/Components/NcActionTextEditable.mjs +1 -1
  24. package/dist/Components/NcActions.cjs +67 -63
  25. package/dist/Components/NcActions.cjs.map +1 -1
  26. package/dist/Components/NcActions.mjs +75 -71
  27. package/dist/Components/NcActions.mjs.map +1 -1
  28. package/dist/Components/NcAppContent.cjs +1 -1
  29. package/dist/Components/NcAppContent.mjs +1 -1
  30. package/dist/Components/NcAppNavigation.cjs +1 -1
  31. package/dist/Components/NcAppNavigation.mjs +1 -1
  32. package/dist/Components/NcAppNavigationItem.cjs +12 -12
  33. package/dist/Components/NcAppNavigationItem.cjs.map +1 -1
  34. package/dist/Components/NcAppNavigationItem.mjs +15 -15
  35. package/dist/Components/NcAppNavigationItem.mjs.map +1 -1
  36. package/dist/Components/NcAppNavigationNewItem.cjs +1 -1
  37. package/dist/Components/NcAppNavigationNewItem.mjs +1 -1
  38. package/dist/Components/NcAppNavigationSettings.cjs +1 -1
  39. package/dist/Components/NcAppNavigationSettings.mjs +1 -1
  40. package/dist/Components/NcAppNavigationToggle.cjs +1 -1
  41. package/dist/Components/NcAppNavigationToggle.mjs +1 -1
  42. package/dist/Components/NcAppSettingsDialog.cjs +57 -108
  43. package/dist/Components/NcAppSettingsDialog.cjs.map +1 -1
  44. package/dist/Components/NcAppSettingsDialog.mjs +59 -110
  45. package/dist/Components/NcAppSettingsDialog.mjs.map +1 -1
  46. package/dist/Components/NcAppSidebar.cjs +5 -5
  47. package/dist/Components/NcAppSidebar.cjs.map +1 -1
  48. package/dist/Components/NcAppSidebar.mjs +5 -5
  49. package/dist/Components/NcAppSidebar.mjs.map +1 -1
  50. package/dist/Components/NcAppSidebarTab.cjs +3 -3
  51. package/dist/Components/NcAppSidebarTab.cjs.map +1 -1
  52. package/dist/Components/NcAppSidebarTab.mjs +5 -5
  53. package/dist/Components/NcAppSidebarTab.mjs.map +1 -1
  54. package/dist/Components/NcAvatar.cjs +1 -1
  55. package/dist/Components/NcAvatar.mjs +1 -1
  56. package/dist/Components/NcBreadcrumbs.cjs +2 -2
  57. package/dist/Components/NcBreadcrumbs.cjs.map +1 -1
  58. package/dist/Components/NcBreadcrumbs.mjs +2 -2
  59. package/dist/Components/NcBreadcrumbs.mjs.map +1 -1
  60. package/dist/Components/NcCheckboxRadioSwitch.cjs +157 -42
  61. package/dist/Components/NcCheckboxRadioSwitch.cjs.map +1 -1
  62. package/dist/Components/NcCheckboxRadioSwitch.mjs +168 -53
  63. package/dist/Components/NcCheckboxRadioSwitch.mjs.map +1 -1
  64. package/dist/Components/NcColorPicker.cjs +1 -1
  65. package/dist/Components/NcColorPicker.mjs +1 -1
  66. package/dist/Components/NcDashboardWidget.cjs +1 -1
  67. package/dist/Components/NcDashboardWidget.mjs +2 -2
  68. package/dist/Components/NcDashboardWidgetItem.cjs +11 -11
  69. package/dist/Components/NcDashboardWidgetItem.cjs.map +1 -1
  70. package/dist/Components/NcDashboardWidgetItem.mjs +9 -9
  71. package/dist/Components/NcDashboardWidgetItem.mjs.map +1 -1
  72. package/dist/Components/NcDateTime.cjs +1 -1
  73. package/dist/Components/NcDateTime.mjs +1 -1
  74. package/dist/Components/NcDateTimePicker.cjs +2 -2
  75. package/dist/Components/NcDateTimePicker.mjs +4 -4
  76. package/dist/Components/NcDateTimePickerNative.cjs +1 -1
  77. package/dist/Components/NcDateTimePickerNative.mjs +1 -1
  78. package/dist/Components/NcDialog.cjs +171 -0
  79. package/dist/Components/NcDialog.cjs.map +1 -0
  80. package/dist/Components/NcDialog.mjs +177 -0
  81. package/dist/Components/NcDialog.mjs.map +1 -0
  82. package/dist/Components/NcDialogButton.cjs +69 -0
  83. package/dist/Components/NcDialogButton.cjs.map +1 -0
  84. package/dist/Components/NcDialogButton.mjs +74 -0
  85. package/dist/Components/NcDialogButton.mjs.map +1 -0
  86. package/dist/Components/NcEmojiPicker.cjs +1 -1
  87. package/dist/Components/NcEmojiPicker.mjs +1 -1
  88. package/dist/Components/NcIconSvgWrapper.cjs +29 -14
  89. package/dist/Components/NcIconSvgWrapper.cjs.map +1 -1
  90. package/dist/Components/NcIconSvgWrapper.mjs +32 -17
  91. package/dist/Components/NcIconSvgWrapper.mjs.map +1 -1
  92. package/dist/Components/NcListItem.cjs +3 -3
  93. package/dist/Components/NcListItem.cjs.map +1 -1
  94. package/dist/Components/NcListItem.mjs +3 -3
  95. package/dist/Components/NcListItem.mjs.map +1 -1
  96. package/dist/Components/NcListItemIcon.cjs +20 -12
  97. package/dist/Components/NcListItemIcon.cjs.map +1 -1
  98. package/dist/Components/NcListItemIcon.mjs +21 -13
  99. package/dist/Components/NcListItemIcon.mjs.map +1 -1
  100. package/dist/Components/NcModal.cjs +24 -26
  101. package/dist/Components/NcModal.cjs.map +1 -1
  102. package/dist/Components/NcModal.mjs +54 -56
  103. package/dist/Components/NcModal.mjs.map +1 -1
  104. package/dist/Components/NcNoteCard.cjs +4 -4
  105. package/dist/Components/NcNoteCard.cjs.map +1 -1
  106. package/dist/Components/NcNoteCard.mjs +3 -3
  107. package/dist/Components/NcNoteCard.mjs.map +1 -1
  108. package/dist/Components/NcPasswordField.cjs +49 -38
  109. package/dist/Components/NcPasswordField.cjs.map +1 -1
  110. package/dist/Components/NcPasswordField.mjs +59 -48
  111. package/dist/Components/NcPasswordField.mjs.map +1 -1
  112. package/dist/Components/NcRelatedResourcesPanel.cjs +29 -13
  113. package/dist/Components/NcRelatedResourcesPanel.cjs.map +1 -1
  114. package/dist/Components/NcRelatedResourcesPanel.mjs +41 -25
  115. package/dist/Components/NcRelatedResourcesPanel.mjs.map +1 -1
  116. package/dist/Components/NcRichContenteditable.cjs +2 -2
  117. package/dist/Components/NcRichContenteditable.mjs +2 -2
  118. package/dist/Components/NcRichText.cjs +1 -1
  119. package/dist/Components/NcRichText.mjs +3 -3
  120. package/dist/Components/NcSelect.cjs +34 -29
  121. package/dist/Components/NcSelect.cjs.map +1 -1
  122. package/dist/Components/NcSelect.mjs +48 -43
  123. package/dist/Components/NcSelect.mjs.map +1 -1
  124. package/dist/Components/NcSelectTags.cjs +1 -1
  125. package/dist/Components/NcSelectTags.mjs +1 -1
  126. package/dist/Components/NcSettingsInputText.cjs +1 -1
  127. package/dist/Components/NcSettingsInputText.mjs +1 -1
  128. package/dist/Components/NcSettingsSection.cjs +1 -1
  129. package/dist/Components/NcSettingsSection.mjs +1 -1
  130. package/dist/Components/NcSettingsSelectGroup.cjs +1 -1
  131. package/dist/Components/NcSettingsSelectGroup.mjs +1 -1
  132. package/dist/Components/NcTextArea.cjs +167 -0
  133. package/dist/Components/NcTextArea.cjs.map +1 -0
  134. package/dist/Components/NcTextArea.mjs +172 -0
  135. package/dist/Components/NcTextArea.mjs.map +1 -0
  136. package/dist/Components/NcTextField.cjs +37 -13
  137. package/dist/Components/NcTextField.cjs.map +1 -1
  138. package/dist/Components/NcTextField.mjs +45 -21
  139. package/dist/Components/NcTextField.mjs.map +1 -1
  140. package/dist/Components/NcTimezonePicker.cjs +1 -1
  141. package/dist/Components/NcTimezonePicker.mjs +1 -1
  142. package/dist/Components/NcUserBubble.cjs +4 -4
  143. package/dist/Components/NcUserBubble.cjs.map +1 -1
  144. package/dist/Components/NcUserBubble.mjs +4 -4
  145. package/dist/Components/NcUserBubble.mjs.map +1 -1
  146. package/dist/assets/index-236620b0.css +150 -0
  147. package/dist/assets/{index-03ec5f40.css → index-400b48a6.css} +7 -7
  148. package/dist/assets/{index-33da80f0.css → index-4611417f.css} +8 -9
  149. package/dist/assets/{index-01e5adf4.css → index-4b75fe20.css} +11 -11
  150. package/dist/assets/{index-294382c8.css → index-574438d6.css} +43 -38
  151. package/dist/assets/{index-c7905a53.css → index-57b305d3.css} +3 -3
  152. package/dist/assets/{index-de0326c7.css → index-5ee8a575.css} +69 -78
  153. package/dist/assets/{index-9354264c.css → index-6f721577.css} +16 -16
  154. package/dist/assets/{index-fec4bb7b.css → index-73867d38.css} +17 -16
  155. package/dist/assets/{index-becfbea7.css → index-8304db49.css} +23 -22
  156. package/dist/assets/{index-5eff69c7.css → index-9dcf6260.css} +32 -30
  157. package/dist/assets/{index-23e64bbb.css → index-9e44e336.css} +9 -9
  158. package/dist/assets/{index-0557f12a.css → index-9e9587e1.css} +4 -4
  159. package/dist/assets/index-abb90c97.css +164 -0
  160. package/dist/assets/{index-5072b6ee.css → index-af72a30b.css} +11 -10
  161. package/dist/assets/{index-194e9415.css → index-c06ad941.css} +70 -58
  162. package/dist/assets/{index-fbdeb5ab.css → index-c5ae3bc4.css} +11 -11
  163. package/dist/assets/index-dc612aa3.css +112 -0
  164. package/dist/assets/{index-376d2dec.css → index-e7c55791.css} +67 -67
  165. package/dist/assets/{index-165fce0e.css → index-e7eadba7.css} +13 -13
  166. package/dist/assets/{index-6405cd50.css → index-e828b286.css} +4 -4
  167. package/dist/assets/{index-0ab8e182.css → index-eea65531.css} +23 -22
  168. package/dist/assets/{index-1cf8eeb4.css → index-f85aa003.css} +13 -32
  169. package/dist/assets/{referencePickerModal-0acecb5e.css → referencePickerModal-3a127978.css} +55 -55
  170. package/dist/chunks/{NcAppNavigationToggle-960658a0.cjs → NcAppNavigationToggle-841d3015.cjs} +1 -1
  171. package/dist/chunks/{NcAppNavigationToggle-960658a0.cjs.map → NcAppNavigationToggle-841d3015.cjs.map} +1 -1
  172. package/dist/chunks/{NcAppNavigationToggle-d868f651.mjs → NcAppNavigationToggle-e358aa47.mjs} +1 -1
  173. package/dist/chunks/{NcAppNavigationToggle-d868f651.mjs.map → NcAppNavigationToggle-e358aa47.mjs.map} +1 -1
  174. package/dist/chunks/{NcInputConfirmCancel-f881168d.mjs → NcInputConfirmCancel-44052477.mjs} +16 -9
  175. package/dist/chunks/NcInputConfirmCancel-44052477.mjs.map +1 -0
  176. package/dist/chunks/{NcInputConfirmCancel-0c4bee9a.cjs → NcInputConfirmCancel-6bea0fdc.cjs} +11 -4
  177. package/dist/chunks/NcInputConfirmCancel-6bea0fdc.cjs.map +1 -0
  178. package/dist/chunks/{NcRichText-d385dc10.cjs → NcRichText-332fe454.cjs} +2 -2
  179. package/dist/chunks/{NcRichText-1c3d2654.mjs.map → NcRichText-332fe454.cjs.map} +1 -1
  180. package/dist/chunks/{NcRichText-1c3d2654.mjs → NcRichText-8fda53c8.mjs} +9 -9
  181. package/dist/chunks/{NcRichText-d385dc10.cjs.map → NcRichText-8fda53c8.mjs.map} +1 -1
  182. package/dist/chunks/{NcSettingsSelectGroup-47d9c113.cjs → NcSettingsSelectGroup-a5ff8c36.cjs} +1 -1
  183. package/dist/chunks/{NcSettingsSelectGroup-47d9c113.cjs.map → NcSettingsSelectGroup-a5ff8c36.cjs.map} +1 -1
  184. package/dist/chunks/{NcSettingsSelectGroup-0f4a0f94.mjs → NcSettingsSelectGroup-fdd3309c.mjs} +2 -2
  185. package/dist/chunks/{NcSettingsSelectGroup-0f4a0f94.mjs.map → NcSettingsSelectGroup-fdd3309c.mjs.map} +1 -1
  186. package/dist/chunks/{ScopeComponent-97a014a1.mjs → ScopeComponent-9519afcc.mjs} +1 -1
  187. package/dist/chunks/{ScopeComponent-97a014a1.mjs.map → ScopeComponent-9519afcc.mjs.map} +1 -1
  188. package/dist/chunks/{ScopeComponent-1c75ec38.cjs → ScopeComponent-e060526a.cjs} +1 -1
  189. package/dist/chunks/{ScopeComponent-1c75ec38.cjs.map → ScopeComponent-e060526a.cjs.map} +1 -1
  190. package/dist/chunks/{actionText-b0bd6eb7.cjs → actionText-54bc24a6.cjs} +1 -1
  191. package/dist/chunks/{actionText-9f5c55bd.mjs.map → actionText-54bc24a6.cjs.map} +1 -1
  192. package/dist/chunks/{actionText-9f5c55bd.mjs → actionText-a64be267.mjs} +1 -1
  193. package/dist/chunks/{actionText-b0bd6eb7.cjs.map → actionText-a64be267.mjs.map} +1 -1
  194. package/dist/chunks/{index-2a5b8ace.cjs → index-032137a6.cjs} +63 -29
  195. package/dist/chunks/index-032137a6.cjs.map +1 -0
  196. package/dist/chunks/{index-6c221fa0.mjs → index-fb2ee22c.mjs} +72 -38
  197. package/dist/chunks/index-fb2ee22c.mjs.map +1 -0
  198. package/dist/chunks/l10n-05a09c66.mjs +31 -0
  199. package/dist/chunks/l10n-05a09c66.mjs.map +1 -0
  200. package/dist/chunks/{l10n-c5f5f001.mjs → l10n-9aa6482d.mjs} +1 -1
  201. package/dist/chunks/{l10n-c5f5f001.mjs.map → l10n-9aa6482d.mjs.map} +1 -1
  202. package/dist/chunks/l10n-b1d264c7.cjs +29 -0
  203. package/dist/chunks/l10n-b1d264c7.cjs.map +1 -0
  204. package/dist/chunks/{l10n-4326316a.cjs → l10n-c7bd0ea6.cjs} +1 -1
  205. package/dist/chunks/{l10n-4326316a.cjs.map → l10n-c7bd0ea6.cjs.map} +1 -1
  206. package/dist/chunks/{referencePickerModal-9b4ff88d.cjs → referencePickerModal-279a483d.cjs} +2 -2
  207. package/dist/chunks/{referencePickerModal-9b4ff88d.cjs.map → referencePickerModal-279a483d.cjs.map} +1 -1
  208. package/dist/chunks/{referencePickerModal-0fde503d.mjs → referencePickerModal-443a4c57.mjs} +2 -2
  209. package/dist/chunks/{referencePickerModal-0fde503d.mjs.map → referencePickerModal-443a4c57.mjs.map} +1 -1
  210. package/dist/index.cjs +105 -99
  211. package/dist/index.cjs.map +1 -1
  212. package/dist/index.mjs +138 -129
  213. package/dist/index.mjs.map +1 -1
  214. package/package.json +6 -3
  215. package/dist/assets/index-7768d5e5.css +0 -148
  216. package/dist/chunks/NcInputConfirmCancel-0c4bee9a.cjs.map +0 -1
  217. package/dist/chunks/NcInputConfirmCancel-f881168d.mjs.map +0 -1
  218. package/dist/chunks/index-2a5b8ace.cjs.map +0 -1
  219. package/dist/chunks/index-6c221fa0.mjs.map +0 -1
  220. package/dist/chunks/l10n-27a75c40.mjs +0 -31
  221. package/dist/chunks/l10n-27a75c40.mjs.map +0 -1
  222. package/dist/chunks/l10n-903083c4.cjs +0 -29
  223. package/dist/chunks/l10n-903083c4.cjs.map +0 -1
@@ -0,0 +1,172 @@
1
+ import "../assets/index-236620b0.css";
2
+ import { G as s } from "../chunks/GenRandomId-cb9ccebe.mjs";
3
+ import r from "vue-material-design-icons/AlertCircleOutline.vue";
4
+ import l from "vue-material-design-icons/Check.vue";
5
+ import { n as i } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
6
+ const n = {
7
+ name: "NcTextArea",
8
+ components: {
9
+ AlertCircle: r,
10
+ Check: l
11
+ },
12
+ inheritAttrs: !1,
13
+ props: {
14
+ /**
15
+ * The value of the input field
16
+ */
17
+ value: {
18
+ type: String,
19
+ required: !0
20
+ },
21
+ /**
22
+ * The input label, always provide one for accessibility purposes.
23
+ * This will also be used as a placeholder unless the placeholder
24
+ * prop is populated with a different string.
25
+ */
26
+ label: {
27
+ type: String,
28
+ default: void 0
29
+ },
30
+ /**
31
+ * Pass in true if you want to use an external label. This is useful
32
+ * if you need a label that looks different from the one provided by
33
+ * this component
34
+ */
35
+ labelOutside: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
39
+ /**
40
+ * The placeholder of the input. This defaults as the string that's
41
+ * passed into the label prop. In order to remove the placeholder,
42
+ * pass in an empty string.
43
+ */
44
+ placeholder: {
45
+ type: String,
46
+ default: void 0
47
+ },
48
+ /**
49
+ * Toggles the success state of the component. Adds a checkmark icon.
50
+ * this cannot be used together with canClear.
51
+ */
52
+ success: {
53
+ type: Boolean,
54
+ default: !1
55
+ },
56
+ /**
57
+ * Toggles the error state of the component. Adds an error icon.
58
+ * this cannot be used together with canClear.
59
+ */
60
+ error: {
61
+ type: Boolean,
62
+ default: !1
63
+ },
64
+ /**
65
+ * Additional helper text message
66
+ *
67
+ * This will be displayed beneath the input field. In case the field is
68
+ * also marked as having an error, the text will be displayed in red.
69
+ */
70
+ helperText: {
71
+ type: String,
72
+ default: ""
73
+ },
74
+ /**
75
+ * Disable the input field
76
+ */
77
+ disabled: {
78
+ type: Boolean,
79
+ default: !1
80
+ },
81
+ /**
82
+ * Class to add to the input field.
83
+ * Necessary to use NcInputField in the NcActionInput component.
84
+ */
85
+ inputClass: {
86
+ type: [Object, String],
87
+ default: ""
88
+ },
89
+ /**
90
+ * The resize CSS property sets whether an element is resizable, and if
91
+ * so, in which directions.
92
+ */
93
+ resize: {
94
+ type: String,
95
+ default: "both",
96
+ validator: (t) => ["both", "vertical", "horizontal", "none"].includes(t)
97
+ }
98
+ },
99
+ emits: [
100
+ "update:value"
101
+ ],
102
+ computed: {
103
+ computedId() {
104
+ return this.$attrs.id && this.$attrs.id !== "" ? this.$attrs.id : this.inputName;
105
+ },
106
+ inputName() {
107
+ return "input" + s();
108
+ },
109
+ hasPlaceholder() {
110
+ return this.placeholder !== "" && this.placeholder !== void 0;
111
+ },
112
+ computedPlaceholder() {
113
+ return this.hasPlaceholder ? this.placeholder : this.label;
114
+ },
115
+ isValidLabel() {
116
+ const t = this.label || this.labelOutside;
117
+ return t || console.warn("You need to add a label to the NcInputField component. Either use the prop label or use an external one, as per the example in the documentation."), t;
118
+ },
119
+ ariaDescribedby() {
120
+ const t = [];
121
+ return this.helperText.length > 0 && t.push(`${this.inputName}-helper-text`), this.$attrs["aria-describedby"] && t.push(this.$attrs["aria-describedby"]), t.join(" ") || null;
122
+ }
123
+ },
124
+ methods: {
125
+ /**
126
+ * Focus the input element
127
+ *
128
+ * @public
129
+ */
130
+ focus() {
131
+ this.$refs.input.focus();
132
+ },
133
+ /**
134
+ * Select all the text in the input
135
+ *
136
+ * @public
137
+ */
138
+ select() {
139
+ this.$refs.input.select();
140
+ },
141
+ handleInput(t) {
142
+ this.$emit("update:value", t.target.value);
143
+ }
144
+ }
145
+ };
146
+ var d = function() {
147
+ var e = this, a = e._self._c;
148
+ return a("div", { staticClass: "textarea", class: { "textarea--disabled": e.disabled } }, [a("div", { staticClass: "textarea__main-wrapper" }, [a("textarea", e._g(e._b({ ref: "input", staticClass: "textarea__input", class: [
149
+ e.inputClass,
150
+ {
151
+ "textarea__input--label-outside": e.labelOutside,
152
+ "textarea__input--success": e.success,
153
+ "textarea__input--error": e.error
154
+ }
155
+ ], style: { resize: e.resize }, attrs: { id: e.computedId, type: e.type, disabled: e.disabled, placeholder: e.computedPlaceholder, "aria-describedby": e.ariaDescribedby, "aria-live": "polite" }, domProps: { value: e.value }, on: { input: e.handleInput } }, "textarea", e.$attrs, !1), e.$listeners)), e._v(" "), !e.labelOutside && e.isValidLabel ? a("label", { staticClass: "textarea__label", attrs: { for: e.computedId } }, [e._v(" " + e._s(e.label) + " ")]) : e._e()]), e.helperText.length > 0 ? a("p", { staticClass: "textarea__helper-text-message", class: {
156
+ "textarea__helper-text-message--error": e.error,
157
+ "textarea__helper-text-message--success": e.success
158
+ }, attrs: { id: `${e.inputName}-helper-text` } }, [e.success ? a("Check", { staticClass: "textarea__helper-text-message__icon", attrs: { size: 18 } }) : e.error ? a("AlertCircle", { staticClass: "textarea__helper-text-message__icon", attrs: { size: 18 } }) : e._e(), e._v(" " + e._s(e.helperText) + " ")], 1) : e._e()]);
159
+ }, o = [], u = /* @__PURE__ */ i(
160
+ n,
161
+ d,
162
+ o,
163
+ !1,
164
+ null,
165
+ "7144de10",
166
+ null,
167
+ null
168
+ );
169
+ const f = u.exports;
170
+ export {
171
+ f as default
172
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NcTextArea.mjs","sources":["../../src/components/NcTextArea/NcTextArea.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2023 Richard Steinmetz <richard@steinmetz.cloud>\n -\n - @author Richard Steinmetz <richard@steinmetz.cloud>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU General Public License as published by\n - the Free Software Foundation, either version 3 of the License, or\n - (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU General Public License for more details.\n -\n - You should have received a copy of the GNU General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n### Description\n\nThis component is a textarea field.\nIt extends and styles an HTMLTextAreaElement.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextArea label=\"Text area\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\thelper-text=\"This is a regular helper text.\" >\n\t\t</NcTextArea>\n\t\t<NcTextArea label=\"Success state\"\n\t\t\t:success=\"true\">\n\t\t</NcTextArea>\n\t\t<NcTextArea label=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\thelper-text=\"Helper texts will be styled accordingly.\"\n\t\t\t:error=\"true\">\n\t\t</NcTextArea>\n\t\t<NcTextArea label=\"Disabled\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextArea label=\"Disabled + Success\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextArea id=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Text area with external label\" />\n\t\t</div>\n\t\t<NcTextArea label=\"Custom size and no resize\"\n\t\t\tresize=\"none\"\n\t\t\trows=\"5\" />\n\t\t</NcTextArea>\n\t</div>\n</template>\n\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\twidth: 100%;\n\talign-items: center;\n\tgap: 14px;\n\n\t> label {\n\t\tflex-shrink: 0;\n\t}\n}\n</style>\n```\n</docs>\n\n<template>\n\t<div class=\"textarea\" :class=\"{ 'textarea--disabled': disabled }\">\n\t\t<div class=\"textarea__main-wrapper\">\n\t\t\t<textarea v-bind=\"$attrs\"\n\t\t\t\t:id=\"computedId\"\n\t\t\t\tref=\"input\"\n\t\t\t\tclass=\"textarea__input\"\n\t\t\t\t:type=\"type\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:placeholder=\"computedPlaceholder\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\taria-live=\"polite\"\n\t\t\t\t:class=\"[inputClass,\n\t\t\t\t\t{\n\t\t\t\t\t\t'textarea__input--label-outside': labelOutside,\n\t\t\t\t\t\t'textarea__input--success': success,\n\t\t\t\t\t\t'textarea__input--error': error,\n\t\t\t\t\t}]\"\n\t\t\t\t:style=\"{ resize: resize }\"\n\t\t\t\t:value=\"value\"\n\t\t\t\tv-on=\"$listeners\"\n\t\t\t\t@input=\"handleInput\" />\n\t\t\t<!-- Label -->\n\t\t\t<label v-if=\"!labelOutside && isValidLabel\"\n\t\t\t\tclass=\"textarea__label\"\n\t\t\t\t:for=\"computedId\">\n\t\t\t\t{{ label }}\n\t\t\t</label>\n\t\t</div>\n\t\t<p v-if=\"helperText.length > 0\"\n\t\t\t:id=\"`${inputName}-helper-text`\"\n\t\t\tclass=\"textarea__helper-text-message\"\n\t\t\t:class=\"{\n\t\t\t\t'textarea__helper-text-message--error': error,\n\t\t\t\t'textarea__helper-text-message--success': success,\n\t\t\t}\">\n\t\t\t<Check v-if=\"success\" class=\"textarea__helper-text-message__icon\" :size=\"18\" />\n\t\t\t<AlertCircle v-else-if=\"error\" class=\"textarea__helper-text-message__icon\" :size=\"18\" />\n\t\t\t{{ helperText }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nimport AlertCircle from 'vue-material-design-icons/AlertCircleOutline.vue'\nimport Check from 'vue-material-design-icons/Check.vue'\n\nexport default {\n\tname: 'NcTextArea',\n\n\tcomponents: {\n\t\tAlertCircle,\n\t\tCheck,\n\t},\n\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * The value of the input field\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * The input label, always provide one for accessibility purposes.\n\t\t * This will also be used as a placeholder unless the placeholder\n\t\t * prop is populated with a different string.\n\t\t */\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * Pass in true if you want to use an external label. This is useful\n\t\t * if you need a label that looks different from the one provided by\n\t\t * this component\n\t\t */\n\t\tlabelOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The placeholder of the input. This defaults as the string that's\n\t\t * passed into the label prop. In order to remove the placeholder,\n\t\t * pass in an empty string.\n\t\t */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * Toggles the success state of the component. Adds a checkmark icon.\n\t\t * this cannot be used together with canClear.\n\t\t */\n\t\tsuccess: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Toggles the error state of the component. Adds an error icon.\n\t\t * this cannot be used together with canClear.\n\t\t */\n\t\terror: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Additional helper text message\n\t\t *\n\t\t * This will be displayed beneath the input field. In case the field is\n\t\t * also marked as having an error, the text will be displayed in red.\n\t\t */\n\t\thelperText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Disable the input field\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Class to add to the input field.\n\t\t * Necessary to use NcInputField in the NcActionInput component.\n\t\t */\n\t\tinputClass: {\n\t\t\ttype: [Object, String],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The resize CSS property sets whether an element is resizable, and if\n\t\t * so, in which directions.\n\t\t */\n\t\tresize: {\n\t\t\ttype: String,\n\t\t\tdefault: 'both',\n\t\t\tvalidator: (value) => ['both', 'vertical', 'horizontal', 'none'].includes(value),\n\t\t}\n\t},\n\n\temits: [\n\t\t'update:value',\n\t],\n\n\tcomputed: {\n\t\tcomputedId() {\n\t\t\treturn this.$attrs.id && this.$attrs.id !== '' ? this.$attrs.id : this.inputName\n\t\t},\n\n\t\tinputName() {\n\t\t\treturn 'input' + GenRandomId()\n\t\t},\n\n\t\thasPlaceholder() {\n\t\t\treturn this.placeholder !== '' && this.placeholder !== undefined\n\t\t},\n\n\t\tcomputedPlaceholder() {\n\t\t\treturn this.hasPlaceholder ? this.placeholder : this.label\n\t\t},\n\n\t\tisValidLabel() {\n\t\t\tconst isValidLabel = this.label || this.labelOutside\n\t\t\tif (!isValidLabel) {\n\t\t\t\tconsole.warn('You need to add a label to the NcInputField component. Either use the prop label or use an external one, as per the example in the documentation.')\n\t\t\t}\n\t\t\treturn isValidLabel\n\t\t},\n\n\t\tariaDescribedby() {\n\t\t\tconst ariaDescribedby = []\n\t\t\tif (this.helperText.length > 0) {\n\t\t\t\tariaDescribedby.push(`${this.inputName}-helper-text`)\n\t\t\t}\n\t\t\tif (this.$attrs['aria-describedby']) {\n\t\t\t\tariaDescribedby.push(this.$attrs['aria-describedby'])\n\t\t\t}\n\t\t\treturn ariaDescribedby.join(' ') || null\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.input.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.input.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.$emit('update:value', event.target.value)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n\n.textarea {\n\tposition: relative;\n\twidth: 100%;\n\tborder-radius: var(--border-radius-large);\n\tmargin-block-start: 6px; // for the label in active state\n\tresize: vertical;\n\n\t&__main-wrapper {\n\t\tposition: relative;\n\t}\n\n\t&--disabled {\n\t\topacity: 0.7;\n\t\tfilter: saturate(0.7);\n\t}\n\n\t&__input {\n\t\tmargin: 0;\n\t\tpadding-inline: 10px 6px; // align with label 8px margin label + 4px padding label - 2px border input\n\t\twidth: 100%;\n\n\t\tfont-size: var(--default-font-size);\n\t\ttext-overflow: ellipsis;\n\n\t\tbackground-color: var(--color-main-background);\n\t\tcolor: var(--color-main-text);\n\t\tborder: 2px solid var(--color-border-maxcontrast);\n\t\tborder-radius: var(--border-radius-large);\n\n\t\tcursor: pointer;\n\n\t\t&:active:not([disabled]),\n\t\t&:hover:not([disabled]),\n\t\t&:focus:not([disabled]) {\n\t\t\tborder-color: var(--color-primary-element);\n\t\t}\n\n\t\t// Hide placeholder while not focussed -> show label instead (only if internal label is used)\n\t\t&:not(:focus,&--label-outside)::placeholder {\n\t\t\topacity: 0;\n\t\t}\n\n\t\t&:focus {\n\t\t\tcursor: text;\n\t\t}\n\n\t\t&:disabled {\n\t\t\tcursor: default;\n\t\t}\n\n\t\t&:focus-visible {\n\t\t\tbox-shadow: unset !important; // Override server rules\n\t\t}\n\n\t\t&--success {\n\t\t\tborder-color: var(--color-success) !important; //Override hover border color\n\t\t\t&:focus-visible {\n\t\t\t\tbox-shadow: rgb(248, 250, 252) 0px 0px 0px 2px, var(--color-primary-element) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px\n\t\t\t}\n\n\t\t\t// Align label text color with border color (on hover / focus)\n\t\t\t&:focus + .textarea__label,\n\t\t\t&:hover:not(:placeholder-shown) + .textarea__label {\n\t\t\t\tcolor: var(--color-success-text);\n\t\t\t}\n\t\t}\n\n\t\t&--error {\n\t\t\tborder-color: var(--color-error) !important; //Override hover border color\n\t\t\t&:focus-visible {\n\t\t\t\tbox-shadow: rgb(248, 250, 252) 0px 0px 0px 2px, var(--color-primary-element) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px\n\t\t\t}\n\n\t\t\t// Align label text color with border color (on hover / focus)\n\t\t\t&:focus + .textarea__label,\n\t\t\t&:hover:not(:placeholder-shown) + .textarea__label {\n\t\t\t\tcolor: var(--color-error-text);\n\t\t\t}\n\t\t}\n\n\t\t// Align label text color with border color (on hover / focus)\n\t\t&:not(&--success, &--error) {\n\t\t\t&:focus + .textarea__label,\n\t\t\t&:hover:not(:placeholder-shown) + .textarea__label {\n\t\t\t\tcolor: var(--color-primary-element);\n\t\t\t}\n\t\t}\n\t}\n\n\t&__label {\n\t\tposition: absolute;\n\t\tmargin-inline: 12px 0;\n\t\t// fix height and line height to center label\n\t\theight: 17px;\n\t\tmax-width: fit-content;\n\t\tline-height: 1;\n\t\tinset-block-start: 12px;\n\t\tinset-inline: 0;\n\t\t// Fix color so that users do not think the input already has content\n\t\tcolor: var(--color-text-maxcontrast);\n\t\t// only one line labels are allowed\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\t// forward events to input\n\t\tpointer-events: none;\n\t\t// Position transition\n\t\ttransition: height var(--animation-quick), inset-block-start var(--animation-quick), font-size var(--animation-quick), color var(--animation-quick), background-color var(--animation-quick) var(--animation-slow);\n\t}\n\n\t&__input:focus + &__label,\n\t&__input:not(:placeholder-shown) + &__label {\n\t\tinset-block-start: -6px;\n\t\tfont-size: 13px; // minimum allowed font size for accessibility\n\t\tbackground-color: var(--color-main-background);\n\t\theight: 14px;\n\t\tpadding-inline: 4px;\n\t\tmargin-inline-start: 8px;\n\n\t\ttransition: height var(--animation-quick), inset-block-start var(--animation-quick), font-size var(--animation-quick), color var(--animation-quick);\n\t}\n\n\t&__helper-text-message {\n\t\tpadding-block: 4px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\n\t\t&__icon {\n\t\t\tmargin-inline-end: 8px;\n\t\t}\n\n\t\t&--error {\n\t\t\tcolor: var(--color-error-text);\n\t\t}\n\n\t\t&--success {\n\t\t\tcolor: var(--color-success-text);\n\t\t}\n\t}\n}\n</style>\n"],"names":["_sfc_main","AlertCircle","Check","value","GenRandomId","isValidLabel","ariaDescribedby","event"],"mappings":";;;;;AAoIA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,EACA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,CAAA,QAAA,YAAA,cAAA,MAAA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,aAAA;AACA,aAAA,KAAA,OAAA,MAAA,KAAA,OAAA,OAAA,KAAA,KAAA,OAAA,KAAA,KAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,aAAA,UAAAC,EAAA;AAAA,IACA;AAAA,IAEA,iBAAA;AACA,aAAA,KAAA,gBAAA,MAAA,KAAA,gBAAA;AAAA,IACA;AAAA,IAEA,sBAAA;AACA,aAAA,KAAA,iBAAA,KAAA,cAAA,KAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,YAAAC,IAAA,KAAA,SAAA,KAAA;AACA,aAAAA,KACA,QAAA,KAAA,mJAAA,GAEAA;AAAA,IACA;AAAA,IAEA,kBAAA;AACA,YAAAC,IAAA,CAAA;AACA,aAAA,KAAA,WAAA,SAAA,KACAA,EAAA,KAAA,GAAA,KAAA,SAAA,cAAA,GAEA,KAAA,OAAA,kBAAA,KACAA,EAAA,KAAA,KAAA,OAAA,kBAAA,CAAA,GAEAA,EAAA,KAAA,GAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AACA,WAAA,MAAA,MAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,SAAA;AACA,WAAA,MAAA,MAAA,OAAA;AAAA,IACA;AAAA,IAEA,YAAAC,GAAA;AACA,WAAA,MAAA,gBAAAA,EAAA,OAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
- const l = require("./NcInputField.cjs"), o = require("vue-material-design-icons/Close.vue"), s = require("vue-material-design-icons/ArrowRight.vue"), i = require("vue-material-design-icons/UndoVariant.vue"), u = require("../chunks/l10n-903083c4.cjs"), a = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), r = (e) => e && e.__esModule ? e : { default: e }, c = /* @__PURE__ */ r(o), d = /* @__PURE__ */ r(s), p = /* @__PURE__ */ r(i), _ = {
2
+ const r = require("./NcInputField.cjs"), s = require("vue-material-design-icons/Close.vue"), i = require("vue-material-design-icons/ArrowRight.vue"), l = require("vue-material-design-icons/UndoVariant.vue"), u = require("../chunks/l10n-b1d264c7.cjs"), a = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), o = (e) => e && e.__esModule ? e : { default: e }, c = /* @__PURE__ */ o(s), d = /* @__PURE__ */ o(i), p = /* @__PURE__ */ o(l), _ = new Set(Object.keys(r.props)), f = {
3
3
  name: "NcTextField",
4
4
  components: {
5
- NcInputField: l,
5
+ NcInputField: r,
6
6
  Close: c.default,
7
7
  ArrowRight: d.default,
8
8
  Undo: p.default
@@ -10,10 +10,27 @@ const l = require("./NcInputField.cjs"), o = require("vue-material-design-icons/
10
10
  // Allow forwarding all attributes
11
11
  inheritAttrs: !1,
12
12
  props: {
13
- ...l.props,
13
+ /**
14
+ * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props
15
+ */
16
+ // Not an actual prop but needed to show in vue-styleguidist docs
17
+ // eslint-disable-next-line
18
+ " ": {},
19
+ // Reuse all the props from NcInputField for better typing and documentation
20
+ ...r.props,
21
+ // Redefined props
22
+ /**
23
+ * Label of the trailing button
24
+ */
25
+ trailingButtonLabel: {
26
+ type: String,
27
+ default: u.t("Clear text")
28
+ },
29
+ // Custom props
14
30
  /**
15
31
  * Specifies which material design icon should be used for the trailing
16
- * button. Value can be `close`, `arrowRight`, or `undo`.
32
+ * button.
33
+ * @type {'close'|'arrowRight'|'undo'}
17
34
  */
18
35
  trailingButtonIcon: {
19
36
  type: String,
@@ -29,8 +46,15 @@ const l = require("./NcInputField.cjs"), o = require("vue-material-design-icons/
29
46
  "update:value"
30
47
  ],
31
48
  computed: {
32
- clearTextLabel() {
33
- return this.trailingButtonLabel || u.t("Clear text");
49
+ propsAndAttrsToForward() {
50
+ return {
51
+ // Proxy all the HTML attributes
52
+ ...this.$attrs,
53
+ // Proxy original NcInputField's props
54
+ ...Object.fromEntries(
55
+ Object.entries(this.$props).filter(([e]) => _.has(e))
56
+ )
57
+ };
34
58
  }
35
59
  },
36
60
  methods: {
@@ -55,14 +79,14 @@ const l = require("./NcInputField.cjs"), o = require("vue-material-design-icons/
55
79
  }
56
80
  }
57
81
  };
58
- var f = function() {
82
+ var h = function() {
59
83
  var t = this, n = t._self._c;
60
- return n("NcInputField", t._g(t._b({ ref: "inputField", attrs: { "trailing-button-label": t.clearTextLabel }, on: { input: t.handleInput }, scopedSlots: t._u([t.type !== "search" ? { key: "trailing-button-icon", fn: function() {
84
+ return n("NcInputField", t._g(t._b({ ref: "inputField", on: { input: t.handleInput }, scopedSlots: t._u([t.type !== "search" ? { key: "trailing-button-icon", fn: function() {
61
85
  return [t.trailingButtonIcon === "close" ? n("Close", { attrs: { size: 20 } }) : t.trailingButtonIcon === "arrowRight" ? n("ArrowRight", { attrs: { size: 20 } }) : t.trailingButtonIcon === "undo" ? n("Undo", { attrs: { size: 20 } }) : t._e()];
62
- }, proxy: !0 } : null], null, !0) }, "NcInputField", { ...t.$attrs, ...t.$props }, !1), t.$listeners), [t._t("default")], 2);
63
- }, g = [], h = /* @__PURE__ */ a.normalizeComponent(
64
- _,
86
+ }, proxy: !0 } : null], null, !0) }, "NcInputField", t.propsAndAttrsToForward, !1), t.$listeners), [t._t("default")], 2);
87
+ }, g = [], m = /* @__PURE__ */ a.normalizeComponent(
65
88
  f,
89
+ h,
66
90
  g,
67
91
  !1,
68
92
  null,
@@ -70,5 +94,5 @@ var f = function() {
70
94
  null,
71
95
  null
72
96
  );
73
- const m = h.exports;
74
- module.exports = m;
97
+ const F = m.exports;
98
+ module.exports = F;
@@ -1 +1 @@
1
- {"version":3,"file":"NcTextField.cjs","sources":["../../src/components/NcTextField/NcTextField.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2022 Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @author Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose text field component.\nIt is recommended to not only provide a placeholder, but also a label.\nThe label should describe what input is expected and the placehold what format the input should have.\n\nNote: the inner html `input` element inherits all the attributes from the\nNcTextField component so you can add things like `autocomplete`, `maxlength`\nand `minlength`.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextField :value.sync=\"text1\"\n\t\t\tlabel=\"Leading icon and clear trailing button\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text1 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Magnify :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text4\"\n\t\t\tlabel=\"Internal label\"\n\t\t\tplaceholder=\"That can be used together with placeholder\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text4 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Lock :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text2\"\n\t\t\tlabel=\"Success state\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\t:success=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text3\"\n\t\t\tlabel=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\t:error=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField label=\"Disabled\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextField label=\"Disabled + Success\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextField :value.sync=\"text5\"\n\t\t\t\tid=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Input with external label\"\n\t\t\t\t@trailing-button-click=\"clearText\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\nimport Magnify from 'vue-material-design-icons/Magnify'\nimport Lock from 'vue-material-design-icons/Lock'\nimport Close from 'vue-material-design-icons/Close'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: '',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t}\n\t},\n\n\tcomponents: {\n\t\tMagnify,\n\t\tLock,\n\t\tClose,\n\t},\n\n\tmethods: {\n\t\tclearText() {\n\t\t\tthis.text1 = ''\n\t\t\tthis.text3 = ''\n\t\t}\n\t}\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\tpadding-right: 14px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField v-bind=\"{...$attrs, ...$props }\"\n\t\tref=\"inputField\"\n\t\t:trailing-button-label=\"clearTextLabel\"\n\t\tv-on=\"$listeners\"\n\t\t@input=\"handleInput\">\n\t\t<!-- Default slot for the leading icon -->\n\t\t<slot />\n\n\t\t<!-- Trailing icon slot, except for search type input as the browser already adds a trailing close icon -->\n\t\t<template v-if=\"type !== 'search'\" #trailing-button-icon>\n\t\t\t<Close v-if=\"trailingButtonIcon === 'close'\" :size=\"20\" />\n\t\t\t<ArrowRight v-else-if=\"trailingButtonIcon === 'arrowRight'\" :size=\"20\" />\n\t\t\t<Undo v-else-if=\"trailingButtonIcon === 'undo'\" :size=\"20\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\n\nimport NcInputField from '../NcInputField/NcInputField.vue'\n\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ArrowRight from 'vue-material-design-icons/ArrowRight.vue'\nimport Undo from 'vue-material-design-icons/UndoVariant.vue'\n\nimport { t } from '../../l10n.js'\n\nexport default {\n\tname: 'NcTextField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tClose,\n\t\tArrowRight,\n\t\tUndo,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t...NcInputField.props,\n\n\t\t/**\n\t\t * Specifies which material design icon should be used for the trailing\n\t\t * button. Value can be `close`, `arrowRight`, or `undo`.\n\t\t */\n\t\ttrailingButtonIcon: {\n\t\t\ttype: String,\n\t\t\tdefault: 'close',\n\t\t\tvalidator: (value) => [\n\t\t\t\t'close',\n\t\t\t\t'arrowRight',\n\t\t\t\t'undo',\n\t\t\t].includes(value),\n\t\t},\n\t},\n\n\temits: [\n\t\t'update:value',\n\t],\n\n\tcomputed: {\n\t\tclearTextLabel() {\n\t\t\treturn this.trailingButtonLabel || t('Clear text')\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.$emit('update:value', event.target.value)\n\t\t},\n\t},\n}\n</script>\n"],"names":["_sfc_main","NcInputField","Close","ArrowRight","Undo","value","t","event"],"mappings":";4bA+JAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,cAAAC;AAAAA,IACA,OAAAC,EAAA;AAAA,IACA,YAAAC,EAAA;AAAA,IACA,MAAAC,EAAA;AAAA,EACA;AAAA;AAAA,EAGA,cAAA;AAAA,EAEA,OAAA;AAAA,IACA,GAAAH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,oBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAI,MAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,iBAAA;AACA,aAAA,KAAA,uBAAAC,EAAA,EAAA,YAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AACA,WAAA,MAAA,WAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,SAAA;AACA,WAAA,MAAA,WAAA,OAAA;AAAA,IACA;AAAA,IAEA,YAAAC,GAAA;AACA,WAAA,MAAA,gBAAAA,EAAA,OAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcTextField.cjs","sources":["../../src/components/NcTextField/NcTextField.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2022 Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @author Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose text field component.\nIt is recommended to not only provide a placeholder, but also a label.\nThe label should describe what input is expected and the placehold what format the input should have.\n\nNote: the inner html `input` element inherits all the attributes from the\nNcTextField component so you can add things like `autocomplete`, `maxlength`\nand `minlength`.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextField :value.sync=\"text1\"\n\t\t\tlabel=\"Leading icon and clear trailing button\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text1 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Magnify :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text4\"\n\t\t\tlabel=\"Internal label\"\n\t\t\tplaceholder=\"That can be used together with placeholder\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text4 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Lock :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text2\"\n\t\t\tlabel=\"Success state\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\t:success=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text3\"\n\t\t\tlabel=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\t:error=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField label=\"Disabled\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextField label=\"Disabled + Success\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextField :value.sync=\"text5\"\n\t\t\t\tid=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Input with external label\"\n\t\t\t\t@trailing-button-click=\"clearText\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\nimport Magnify from 'vue-material-design-icons/Magnify'\nimport Lock from 'vue-material-design-icons/Lock'\nimport Close from 'vue-material-design-icons/Close'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: '',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t}\n\t},\n\n\tcomponents: {\n\t\tMagnify,\n\t\tLock,\n\t\tClose,\n\t},\n\n\tmethods: {\n\t\tclearText() {\n\t\t\tthis.text1 = ''\n\t\t\tthis.text3 = ''\n\t\t}\n\t}\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\tpadding-right: 14px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField v-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\tv-on=\"$listeners\"\n\t\t@input=\"handleInput\">\n\t\t<!-- Default slot for the leading icon -->\n\t\t<slot />\n\n\t\t<!-- Trailing icon slot, except for search type input as the browser already adds a trailing close icon -->\n\t\t<template v-if=\"type !== 'search'\" #trailing-button-icon>\n\t\t\t<Close v-if=\"trailingButtonIcon === 'close'\" :size=\"20\" />\n\t\t\t<ArrowRight v-else-if=\"trailingButtonIcon === 'arrowRight'\" :size=\"20\" />\n\t\t\t<Undo v-else-if=\"trailingButtonIcon === 'undo'\" :size=\"20\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\n\nimport NcInputField from '../NcInputField/NcInputField.vue'\n\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ArrowRight from 'vue-material-design-icons/ArrowRight.vue'\nimport Undo from 'vue-material-design-icons/UndoVariant.vue'\n\nimport { t } from '../../l10n.js'\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcTextField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tClose,\n\t\tArrowRight,\n\t\tUndo,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\n\t\t */\n\t\t// Not an actual prop but needed to show in vue-styleguidist docs\n\t\t// eslint-disable-next-line\n\t\t' ': {},\n\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t// Redefined props\n\n\t\t/**\n\t\t * Label of the trailing button\n\t\t */\n\t\ttrailingButtonLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: t('Clear text'),\n\t\t},\n\n\t\t// Custom props\n\n\t\t/**\n\t\t * Specifies which material design icon should be used for the trailing\n\t\t * button.\n\t\t * @type {'close'|'arrowRight'|'undo'}\n\t\t */\n\t\ttrailingButtonIcon: {\n\t\t\ttype: String,\n\t\t\tdefault: 'close',\n\t\t\tvalidator: (value) => [\n\t\t\t\t'close',\n\t\t\t\t'arrowRight',\n\t\t\t\t'undo',\n\t\t\t].includes(value),\n\t\t},\n\t},\n\n\temits: [\n\t\t'update:value',\n\t],\n\n\tcomputed: {\n\t\tpropsAndAttrsToForward() {\n\t\t\treturn {\n\t\t\t\t// Proxy all the HTML attributes\n\t\t\t\t...this.$attrs,\n\t\t\t\t// Proxy original NcInputField's props\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\tObject.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key)),\n\t\t\t\t),\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.$emit('update:value', event.target.value)\n\t\t},\n\t},\n}\n</script>\n"],"names":["NcInputFieldProps","NcInputField","_sfc_main","Close","ArrowRight","Undo","t","value","key","event"],"mappings":";4bA8JAA,IAAA,IAAA,IAAA,OAAA,KAAAC,EAAA,KAAA,CAAA,GAEAC,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,cAAAD;AAAAA,IACA,OAAAE,EAAA;AAAA,IACA,YAAAC,EAAA;AAAA,IACA,MAAAC,EAAA;AAAA,EACA;AAAA;AAAA,EAGA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,KAAA,CAAA;AAAA;AAAA,IAGA,GAAAJ,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,qBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAAK,EAAA,EAAA,YAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,oBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,yBAAA;AACA,aAAA;AAAA;AAAA,QAEA,GAAA,KAAA;AAAA;AAAA,QAEA,GAAA,OAAA;AAAA,UACA,OAAA,QAAA,KAAA,MAAA,EAAA,OAAA,CAAA,CAAAC,CAAA,MAAAR,EAAA,IAAAQ,CAAA,CAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AACA,WAAA,MAAA,WAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,SAAA;AACA,WAAA,MAAA,WAAA,OAAA;AAAA,IACA;AAAA,IAEA,YAAAC,GAAA;AACA,WAAA,MAAA,gBAAAA,EAAA,OAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;"}
@@ -1,24 +1,41 @@
1
- import r from "./NcInputField.mjs";
1
+ import n from "./NcInputField.mjs";
2
2
  import o from "vue-material-design-icons/Close.vue";
3
- import l from "vue-material-design-icons/ArrowRight.vue";
4
- import i from "vue-material-design-icons/UndoVariant.vue";
5
- import { t as s } from "../chunks/l10n-27a75c40.mjs";
3
+ import i from "vue-material-design-icons/ArrowRight.vue";
4
+ import s from "vue-material-design-icons/UndoVariant.vue";
5
+ import { t as l } from "../chunks/l10n-05a09c66.mjs";
6
6
  import { n as a } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
7
- const u = {
7
+ const u = new Set(Object.keys(n.props)), p = {
8
8
  name: "NcTextField",
9
9
  components: {
10
- NcInputField: r,
10
+ NcInputField: n,
11
11
  Close: o,
12
- ArrowRight: l,
13
- Undo: i
12
+ ArrowRight: i,
13
+ Undo: s
14
14
  },
15
15
  // Allow forwarding all attributes
16
16
  inheritAttrs: !1,
17
17
  props: {
18
- ...r.props,
18
+ /**
19
+ * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props
20
+ */
21
+ // Not an actual prop but needed to show in vue-styleguidist docs
22
+ // eslint-disable-next-line
23
+ " ": {},
24
+ // Reuse all the props from NcInputField for better typing and documentation
25
+ ...n.props,
26
+ // Redefined props
27
+ /**
28
+ * Label of the trailing button
29
+ */
30
+ trailingButtonLabel: {
31
+ type: String,
32
+ default: l("Clear text")
33
+ },
34
+ // Custom props
19
35
  /**
20
36
  * Specifies which material design icon should be used for the trailing
21
- * button. Value can be `close`, `arrowRight`, or `undo`.
37
+ * button.
38
+ * @type {'close'|'arrowRight'|'undo'}
22
39
  */
23
40
  trailingButtonIcon: {
24
41
  type: String,
@@ -34,8 +51,15 @@ const u = {
34
51
  "update:value"
35
52
  ],
36
53
  computed: {
37
- clearTextLabel() {
38
- return this.trailingButtonLabel || s("Clear text");
54
+ propsAndAttrsToForward() {
55
+ return {
56
+ // Proxy all the HTML attributes
57
+ ...this.$attrs,
58
+ // Proxy original NcInputField's props
59
+ ...Object.fromEntries(
60
+ Object.entries(this.$props).filter(([e]) => u.has(e))
61
+ )
62
+ };
39
63
  }
40
64
  },
41
65
  methods: {
@@ -61,21 +85,21 @@ const u = {
61
85
  }
62
86
  };
63
87
  var c = function() {
64
- var t = this, n = t._self._c;
65
- return n("NcInputField", t._g(t._b({ ref: "inputField", attrs: { "trailing-button-label": t.clearTextLabel }, on: { input: t.handleInput }, scopedSlots: t._u([t.type !== "search" ? { key: "trailing-button-icon", fn: function() {
66
- return [t.trailingButtonIcon === "close" ? n("Close", { attrs: { size: 20 } }) : t.trailingButtonIcon === "arrowRight" ? n("ArrowRight", { attrs: { size: 20 } }) : t.trailingButtonIcon === "undo" ? n("Undo", { attrs: { size: 20 } }) : t._e()];
67
- }, proxy: !0 } : null], null, !0) }, "NcInputField", { ...t.$attrs, ...t.$props }, !1), t.$listeners), [t._t("default")], 2);
68
- }, p = [], d = /* @__PURE__ */ a(
69
- u,
70
- c,
88
+ var t = this, r = t._self._c;
89
+ return r("NcInputField", t._g(t._b({ ref: "inputField", on: { input: t.handleInput }, scopedSlots: t._u([t.type !== "search" ? { key: "trailing-button-icon", fn: function() {
90
+ return [t.trailingButtonIcon === "close" ? r("Close", { attrs: { size: 20 } }) : t.trailingButtonIcon === "arrowRight" ? r("ArrowRight", { attrs: { size: 20 } }) : t.trailingButtonIcon === "undo" ? r("Undo", { attrs: { size: 20 } }) : t._e()];
91
+ }, proxy: !0 } : null], null, !0) }, "NcInputField", t.propsAndAttrsToForward, !1), t.$listeners), [t._t("default")], 2);
92
+ }, d = [], f = /* @__PURE__ */ a(
71
93
  p,
94
+ c,
95
+ d,
72
96
  !1,
73
97
  null,
74
98
  null,
75
99
  null,
76
100
  null
77
101
  );
78
- const F = d.exports;
102
+ const v = f.exports;
79
103
  export {
80
- F as default
104
+ v as default
81
105
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NcTextField.mjs","sources":["../../src/components/NcTextField/NcTextField.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2022 Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @author Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose text field component.\nIt is recommended to not only provide a placeholder, but also a label.\nThe label should describe what input is expected and the placehold what format the input should have.\n\nNote: the inner html `input` element inherits all the attributes from the\nNcTextField component so you can add things like `autocomplete`, `maxlength`\nand `minlength`.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextField :value.sync=\"text1\"\n\t\t\tlabel=\"Leading icon and clear trailing button\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text1 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Magnify :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text4\"\n\t\t\tlabel=\"Internal label\"\n\t\t\tplaceholder=\"That can be used together with placeholder\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text4 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Lock :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text2\"\n\t\t\tlabel=\"Success state\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\t:success=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text3\"\n\t\t\tlabel=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\t:error=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField label=\"Disabled\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextField label=\"Disabled + Success\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextField :value.sync=\"text5\"\n\t\t\t\tid=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Input with external label\"\n\t\t\t\t@trailing-button-click=\"clearText\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\nimport Magnify from 'vue-material-design-icons/Magnify'\nimport Lock from 'vue-material-design-icons/Lock'\nimport Close from 'vue-material-design-icons/Close'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: '',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t}\n\t},\n\n\tcomponents: {\n\t\tMagnify,\n\t\tLock,\n\t\tClose,\n\t},\n\n\tmethods: {\n\t\tclearText() {\n\t\t\tthis.text1 = ''\n\t\t\tthis.text3 = ''\n\t\t}\n\t}\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\tpadding-right: 14px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField v-bind=\"{...$attrs, ...$props }\"\n\t\tref=\"inputField\"\n\t\t:trailing-button-label=\"clearTextLabel\"\n\t\tv-on=\"$listeners\"\n\t\t@input=\"handleInput\">\n\t\t<!-- Default slot for the leading icon -->\n\t\t<slot />\n\n\t\t<!-- Trailing icon slot, except for search type input as the browser already adds a trailing close icon -->\n\t\t<template v-if=\"type !== 'search'\" #trailing-button-icon>\n\t\t\t<Close v-if=\"trailingButtonIcon === 'close'\" :size=\"20\" />\n\t\t\t<ArrowRight v-else-if=\"trailingButtonIcon === 'arrowRight'\" :size=\"20\" />\n\t\t\t<Undo v-else-if=\"trailingButtonIcon === 'undo'\" :size=\"20\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\n\nimport NcInputField from '../NcInputField/NcInputField.vue'\n\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ArrowRight from 'vue-material-design-icons/ArrowRight.vue'\nimport Undo from 'vue-material-design-icons/UndoVariant.vue'\n\nimport { t } from '../../l10n.js'\n\nexport default {\n\tname: 'NcTextField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tClose,\n\t\tArrowRight,\n\t\tUndo,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t...NcInputField.props,\n\n\t\t/**\n\t\t * Specifies which material design icon should be used for the trailing\n\t\t * button. Value can be `close`, `arrowRight`, or `undo`.\n\t\t */\n\t\ttrailingButtonIcon: {\n\t\t\ttype: String,\n\t\t\tdefault: 'close',\n\t\t\tvalidator: (value) => [\n\t\t\t\t'close',\n\t\t\t\t'arrowRight',\n\t\t\t\t'undo',\n\t\t\t].includes(value),\n\t\t},\n\t},\n\n\temits: [\n\t\t'update:value',\n\t],\n\n\tcomputed: {\n\t\tclearTextLabel() {\n\t\t\treturn this.trailingButtonLabel || t('Clear text')\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.$emit('update:value', event.target.value)\n\t\t},\n\t},\n}\n</script>\n"],"names":["_sfc_main","NcInputField","Close","ArrowRight","Undo","value","t","event"],"mappings":";;;;;;AA+JA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,cAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,MAAAC;AAAA,EACA;AAAA;AAAA,EAGA,cAAA;AAAA,EAEA,OAAA;AAAA,IACA,GAAAH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,oBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAI,MAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,iBAAA;AACA,aAAA,KAAA,uBAAAC,EAAA,YAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AACA,WAAA,MAAA,WAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,SAAA;AACA,WAAA,MAAA,WAAA,OAAA;AAAA,IACA;AAAA,IAEA,YAAAC,GAAA;AACA,WAAA,MAAA,gBAAAA,EAAA,OAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcTextField.mjs","sources":["../../src/components/NcTextField/NcTextField.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2022 Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @author Marco Ambrosini <marcoambrosini@pm.me>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose text field component.\nIt is recommended to not only provide a placeholder, but also a label.\nThe label should describe what input is expected and the placehold what format the input should have.\n\nNote: the inner html `input` element inherits all the attributes from the\nNcTextField component so you can add things like `autocomplete`, `maxlength`\nand `minlength`.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcTextField :value.sync=\"text1\"\n\t\t\tlabel=\"Leading icon and clear trailing button\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text1 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Magnify :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text4\"\n\t\t\tlabel=\"Internal label\"\n\t\t\tplaceholder=\"That can be used together with placeholder\"\n\t\t\ttrailing-button-icon=\"close\"\n\t\t\t:show-trailing-button=\"text4 !== ''\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t\t<Lock :size=\"20\" />\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text2\"\n\t\t\tlabel=\"Success state\"\n\t\t\tplaceholder=\"Placeholders are possible\"\n\t\t\t:success=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField :value.sync=\"text3\"\n\t\t\tlabel=\"Error state\"\n\t\t\tplaceholder=\"Enter something valid\"\n\t\t\t:error=\"true\"\n\t\t\t@trailing-button-click=\"clearText\">\n\t\t</NcTextField>\n\t\t<NcTextField label=\"Disabled\"\n\t\t\t:disabled=\"true\" />\n\t\t<NcTextField label=\"Disabled + Success\"\n\t\t\t:success=\"true\"\n\t\t\t:disabled=\"true\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">External label</label>\n\t\t\t<NcTextField :value.sync=\"text5\"\n\t\t\t\tid=\"textField\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Input with external label\"\n\t\t\t\t@trailing-button-click=\"clearText\" />\n\t\t</div>\n\t</div>\n</template>\n<script>\nimport Magnify from 'vue-material-design-icons/Magnify'\nimport Lock from 'vue-material-design-icons/Lock'\nimport Close from 'vue-material-design-icons/Close'\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: '',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t}\n\t},\n\n\tcomponents: {\n\t\tMagnify,\n\t\tLock,\n\t\tClose,\n\t},\n\n\tmethods: {\n\t\tclearText() {\n\t\t\tthis.text1 = ''\n\t\t\tthis.text3 = ''\n\t\t}\n\t}\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\tpadding-right: 14px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField v-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\tv-on=\"$listeners\"\n\t\t@input=\"handleInput\">\n\t\t<!-- Default slot for the leading icon -->\n\t\t<slot />\n\n\t\t<!-- Trailing icon slot, except for search type input as the browser already adds a trailing close icon -->\n\t\t<template v-if=\"type !== 'search'\" #trailing-button-icon>\n\t\t\t<Close v-if=\"trailingButtonIcon === 'close'\" :size=\"20\" />\n\t\t\t<ArrowRight v-else-if=\"trailingButtonIcon === 'arrowRight'\" :size=\"20\" />\n\t\t\t<Undo v-else-if=\"trailingButtonIcon === 'undo'\" :size=\"20\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\n\nimport NcInputField from '../NcInputField/NcInputField.vue'\n\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ArrowRight from 'vue-material-design-icons/ArrowRight.vue'\nimport Undo from 'vue-material-design-icons/UndoVariant.vue'\n\nimport { t } from '../../l10n.js'\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcTextField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tClose,\n\t\tArrowRight,\n\t\tUndo,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\n\t\t */\n\t\t// Not an actual prop but needed to show in vue-styleguidist docs\n\t\t// eslint-disable-next-line\n\t\t' ': {},\n\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t// Redefined props\n\n\t\t/**\n\t\t * Label of the trailing button\n\t\t */\n\t\ttrailingButtonLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: t('Clear text'),\n\t\t},\n\n\t\t// Custom props\n\n\t\t/**\n\t\t * Specifies which material design icon should be used for the trailing\n\t\t * button.\n\t\t * @type {'close'|'arrowRight'|'undo'}\n\t\t */\n\t\ttrailingButtonIcon: {\n\t\t\ttype: String,\n\t\t\tdefault: 'close',\n\t\t\tvalidator: (value) => [\n\t\t\t\t'close',\n\t\t\t\t'arrowRight',\n\t\t\t\t'undo',\n\t\t\t].includes(value),\n\t\t},\n\t},\n\n\temits: [\n\t\t'update:value',\n\t],\n\n\tcomputed: {\n\t\tpropsAndAttrsToForward() {\n\t\t\treturn {\n\t\t\t\t// Proxy all the HTML attributes\n\t\t\t\t...this.$attrs,\n\t\t\t\t// Proxy original NcInputField's props\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\tObject.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key)),\n\t\t\t\t),\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.$emit('update:value', event.target.value)\n\t\t},\n\t},\n}\n</script>\n"],"names":["NcInputFieldProps","NcInputField","_sfc_main","Close","ArrowRight","Undo","t","value","key","event"],"mappings":";;;;;;AA8JA,MAAAA,IAAA,IAAA,IAAA,OAAA,KAAAC,EAAA,KAAA,CAAA,GAEAC,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,cAAAD;AAAA,IACA,OAAAE;AAAA,IACA,YAAAC;AAAA,IACA,MAAAC;AAAA,EACA;AAAA;AAAA,EAGA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,KAAA,CAAA;AAAA;AAAA,IAGA,GAAAJ,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,qBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAAK,EAAA,YAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,oBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACA,EAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,yBAAA;AACA,aAAA;AAAA;AAAA,QAEA,GAAA,KAAA;AAAA;AAAA,QAEA,GAAA,OAAA;AAAA,UACA,OAAA,QAAA,KAAA,MAAA,EAAA,OAAA,CAAA,CAAAC,CAAA,MAAAR,EAAA,IAAAQ,CAAA,CAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAA;AACA,WAAA,MAAA,WAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,SAAA;AACA,WAAA,MAAA,WAAA,OAAA;AAAA,IACA;AAAA,IAEA,YAAAC,GAAA;AACA,WAAA,MAAA,gBAAAA,EAAA,OAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const O = require("../chunks/l10n-903083c4.cjs"), t = require("../chunks/logger-4998b668.cjs"), e = require("@nextcloud/calendar-js"), Z = require("./NcSelect.cjs"), Y = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs");
2
+ const O = require("../chunks/l10n-b1d264c7.cjs"), t = require("../chunks/logger-4998b668.cjs"), e = require("@nextcloud/calendar-js"), Z = require("./NcSelect.cjs"), Y = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs");
3
3
  /**
4
4
  * @copyright Copyright (c) 2019 Georg Ehrke
5
5
  *
@@ -1,4 +1,4 @@
1
- import { t as O } from "../chunks/l10n-27a75c40.mjs";
1
+ import { t as O } from "../chunks/l10n-05a09c66.mjs";
2
2
  import { l as t } from "../chunks/logger-3612e664.mjs";
3
3
  import { getTimezoneManager as Z } from "@nextcloud/calendar-js";
4
4
  import e from "./NcSelect.mjs";
@@ -1,5 +1,5 @@
1
- var f = require("../assets/index-23e64bbb.css");
2
- const a = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), s = require("../chunks/index-2a5b8ace.cjs"), n = require("./NcPopover.cjs"), i = {
1
+ var f = require("../assets/index-9e44e336.css");
2
+ const a = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), s = require("../chunks/index-032137a6.cjs"), n = require("./NcPopover.cjs"), i = {
3
3
  name: "NcUserBubbleDiv"
4
4
  };
5
5
  var o = function() {
@@ -173,7 +173,7 @@ const p = {
173
173
  var _ = function() {
174
174
  var e = this, r = e._self._c;
175
175
  return r(e.isPopoverComponent, { tag: "component", staticClass: "user-bubble__wrapper", attrs: { trigger: "hover focus", shown: e.open }, on: { "update:open": e.onOpenChange }, scopedSlots: e._u([{ key: "trigger", fn: function() {
176
- return [r(e.isLinkComponent, { tag: "component", staticClass: "user-bubble__content", class: e.primary ? "user-bubble__content--primary" : "", style: e.styles.content, attrs: { href: e.hasUrl ? e.url : null }, on: { click: e.onClick } }, [r("NcAvatar", e._b({ staticClass: "user-bubble__avatar", style: e.styles.avatar, attrs: { url: e.isCustomAvatar && e.isAvatarUrl ? e.avatarImage : void 0, "icon-class": e.isCustomAvatar && !e.isAvatarUrl ? e.avatarImage : void 0, user: e.user, "display-name": e.displayName, size: e.size - e.margin * 2, "disable-tooltip": !0, "disable-menu": !0 } }, "NcAvatar", e.$props, !1)), r("span", { staticClass: "user-bubble__name" }, [e._v(" " + e._s(e.displayName || e.user) + " ")]), e.$slots.name ? r("span", { staticClass: "user-bubble__secondary" }, [e._t("name")], 2) : e._e()], 1)];
176
+ return [r(e.isLinkComponent, { tag: "component", staticClass: "user-bubble__content", class: { "user-bubble__content--primary": e.primary }, style: e.styles.content, attrs: { href: e.hasUrl ? e.url : null }, on: { click: e.onClick } }, [r("NcAvatar", e._b({ staticClass: "user-bubble__avatar", style: e.styles.avatar, attrs: { url: e.isCustomAvatar && e.isAvatarUrl ? e.avatarImage : void 0, "icon-class": e.isCustomAvatar && !e.isAvatarUrl ? e.avatarImage : void 0, user: e.user, "display-name": e.displayName, size: e.size - e.margin * 2, "disable-tooltip": !0, "disable-menu": !0 } }, "NcAvatar", e.$props, !1)), r("span", { staticClass: "user-bubble__name" }, [e._v(" " + e._s(e.displayName || e.user) + " ")]), e.$slots.name ? r("span", { staticClass: "user-bubble__secondary" }, [e._t("name")], 2) : e._e()], 1)];
177
177
  }, proxy: !0 }], null, !0) }, [e._t("default")], 2);
178
178
  }, m = [], d = /* @__PURE__ */ a.normalizeComponent(
179
179
  p,
@@ -181,7 +181,7 @@ var _ = function() {
181
181
  m,
182
182
  !1,
183
183
  null,
184
- "25c04da2",
184
+ "14da7eb2",
185
185
  null,
186
186
  null
187
187
  );
@@ -1 +1 @@
1
- {"version":3,"file":"NcUserBubble.cjs","sources":["../../src/components/NcUserBubble/NcUserBubbleDiv.vue","../../src/components/NcUserBubble/NcUserBubble.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2021 Raimund Schlüßler <raimund.schluessler@mailbox.org>\n -\n - @author Raimund Schlüßler <raimund.schluessler@mailbox.org>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<template>\n\t<div>\n\t\t<slot name=\"trigger\" />\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'NcUserBubbleDiv',\n}\n</script>\n","<!--\n - @copyright Copyright (c) 2019 Jonas Sulzer <jonas@violoncello.ch>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n - @author Jonas Sulzer <jonas@violoncello.ch>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<docs>\n\n### General description\n\nThis component displays a user together with a small avatar in a grey bubble.\nIt's possible to use an actual user's avatar, just an image/icon as a url or an icon-class,\nto link the bubble to e.g. a users profile\nand to show a popover on hover with e.g. the full user name handle / email address or something else.\n\nThis component has the following slot:\n* a default slot which is for the content of the popover (this is passed to the popover component directly).\n\n### Examples\n\n```vue\n<p>\n\tSome text before <NcUserBubble user=\"admin\" display-name=\"Admin Example\" :url=\"'/test'\">@admin@foreign-host.com</NcUserBubble> and after the bubble.\n\t<NcUserBubble avatar-image=\"icon-group\" display-name=\"test group xyz\" :primary=\"true\">Hey there!</NcUserBubble>\n</p>\n```\n\n### Example with name slot\n\n```vue\n<template>\n<NcUserBubble\n\t:margin=\"4\"\n\t:size=\"30\"\n\tdisplay-name=\"Administrator\"\n\tuser=\"admin\">\n\t<template #name>\n\t\t<a href=\"#\"\n\t\t\ttitle=\"Remove user\"\n\t\t\tclass=\"icon-close\"\n\t\t\t@click=\"alert\" />\n\t</template>\n</NcUserBubble>\n</template>\n\n<style>\n.icon-close {\n\tdisplay: block;\n\theight: 100%;\n}\n</style>\n```\n\n</docs>\n<template>\n\t<component :is=\"isPopoverComponent\"\n\t\ttrigger=\"hover focus\"\n\t\t:shown=\"open\"\n\t\tclass=\"user-bubble__wrapper\"\n\t\t@update:open=\"onOpenChange\">\n\t\t<!-- Main userbubble structure -->\n\t\t<template #trigger>\n\t\t\t<component :is=\"isLinkComponent\"\n\t\t\t\tclass=\"user-bubble__content\"\n\t\t\t\t:style=\"styles.content\"\n\t\t\t\t:href=\"hasUrl ? url : null\"\n\t\t\t\t:class=\"primary ? 'user-bubble__content--primary' : ''\"\n\t\t\t\t@click=\"onClick\">\n\t\t\t\t<!-- NcAvatar -->\n\t\t\t\t<NcAvatar :url=\"isCustomAvatar && isAvatarUrl ? avatarImage : undefined\"\n\t\t\t\t\t:icon-class=\"isCustomAvatar && !isAvatarUrl ? avatarImage : undefined\"\n\t\t\t\t\t:user=\"user\"\n\t\t\t\t\t:display-name=\"displayName\"\n\t\t\t\t\t:size=\"size - (margin * 2)\"\n\t\t\t\t\t:style=\"styles.avatar\"\n\t\t\t\t\t:disable-tooltip=\"true\"\n\t\t\t\t\t:disable-menu=\"true\"\n\t\t\t\t\tv-bind=\"$props\"\n\t\t\t\t\tclass=\"user-bubble__avatar\" />\n\n\t\t\t\t<!-- Name -->\n\t\t\t\t<span class=\"user-bubble__name\">\n\t\t\t\t\t{{ displayName || user }}\n\t\t\t\t</span>\n\n\t\t\t\t<!-- @slot Optional slot just after the name -->\n\t\t\t\t<span v-if=\"$slots.name\" class=\"user-bubble__secondary\">\n\t\t\t\t\t<slot name=\"name\" />\n\t\t\t\t</span>\n\t\t\t</component>\n\t\t</template>\n\n\t\t<!-- @slot Main Popover content on userbubble hover/focus -->\n\t\t<slot />\n\t</component>\n</template>\n\n<script>\nimport NcUserBubbleDiv from './NcUserBubbleDiv.vue'\nimport NcAvatar from '../NcAvatar/index.js'\nimport NcPopover from '../NcPopover/index.js'\n\nexport default {\n\tname: 'NcUserBubble',\n\tcomponents: {\n\t\tNcAvatar,\n\t\tNcPopover,\n\t\tNcUserBubbleDiv,\n\t},\n\tprops: {\n\t\t/**\n\t\t * Override generated avatar, can be an url or an icon class\n\t\t */\n\t\tavatarImage: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Provide the user id if this is a user\n\t\t */\n\t\tuser: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Displayed label\n\t\t */\n\t\tdisplayName: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Whether or not to display the user-status\n\t\t */\n\t\tshowUserStatus: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Define the whole bubble as a link\n\t\t */\n\t\turl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t\tvalidator: url => {\n\t\t\t\ttry {\n\t\t\t\t\turl = new URL(url)\n\t\t\t\t\treturn !!url\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t/**\n\t\t * Default popover state. Requires the UserBubble\n\t\t * to have some content to render inside the popover\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Use the primary colour\n\t\t */\n\t\tprimary: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * This is the height of the component\n\t\t */\n\t\tsize: {\n\t\t\ttype: Number,\n\t\t\tdefault: 20,\n\t\t},\n\t\t/**\n\t\t * This is the margin of the avatar (size - margin = avatar size)\n\t\t */\n\t\tmargin: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\t},\n\temits: [\n\t\t'click',\n\t\t'update:open',\n\t],\n\tcomputed: {\n\t\t/**\n\t\t * If userbubble is empty, let's NOT\n\t\t * use the Popover component\n\t\t * We need a component instead of a simple div here,\n\t\t * because otherwise the trigger template will not be shown.\n\t\t *\n\t\t * @return {string} 'Popover' or 'UserBubbleDiv'\n\t\t */\n\t\tisPopoverComponent() {\n\t\t\treturn !this.popoverEmpty\n\t\t\t\t? 'NcPopover'\n\t\t\t\t: 'NcUserBubbleDiv'\n\t\t},\n\n\t\t/**\n\t\t * Is the provided avatar url valid or not\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisAvatarUrl() {\n\t\t\tif (!this.avatarImage) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst url = new URL(this.avatarImage)\n\t\t\t\treturn !!url\n\t\t\t} catch (error) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Do we have a custom avatar or not\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisCustomAvatar() {\n\t\t\treturn !!this.avatarImage\n\t\t},\n\n\t\thasUrl() {\n\t\t\treturn this.url && this.url.trim() !== ''\n\t\t},\n\n\t\tisLinkComponent() {\n\t\t\treturn this.hasUrl ? 'a' : 'div'\n\t\t},\n\n\t\tpopoverEmpty() {\n\t\t\tif ('default' in this.$slots) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\tstyles() {\n\t\t\treturn {\n\t\t\t\tcontent: {\n\t\t\t\t\theight: this.size + 'px',\n\t\t\t\t\tlineHeight: this.size + 'px',\n\t\t\t\t\tborderRadius: this.size / 2 + 'px',\n\t\t\t\t},\n\t\t\t\tavatar: {\n\t\t\t\t\tmarginLeft: this.margin + 'px',\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\tmethods: {\n\t\tonOpenChange(state) {\n\t\t\tthis.$emit('update:open', state)\n\t\t},\n\t\t/**\n\t\t * Catch and forward click event to parent\n\t\t *\n\t\t * @param {Event} event the click event\n\t\t */\n\t\tonClick(event) {\n\t\t\tthis.$emit('click', event)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.user-bubble {\n\t&__wrapper {\n\t\t// align inline with text\n\t\tdisplay: inline-block;\n\t\tvertical-align: middle;\n\t\t// shrink and allow grow to fit\n\t\tmin-width: 0;\n\t\tmax-width: 100%;\n\t}\n\n\t&__content {\n\t\tdisplay: inline-flex;\n\t\tmax-width: 100%;\n\t\tbackground-color: var(--color-background-dark);\n\n\t\t&--primary {\n\t\t\tcolor: var(--color-primary-element-text);\n\t\t\tbackground-color: var(--color-primary-element);\n\t\t}\n\n\t\t> :last-child {\n\t\t\t// border radius left padding\n\t\t\tpadding-right: 8px;\n\t\t}\n\t}\n\n\t&__avatar {\n\t\talign-self: center;\n\t}\n\n\t&__name {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__name,\n\t&__secondary {\n\t\t// proper spacing between avatar, name & slot\n\t\tpadding: 0;\n\t\tpadding-left: 4px;\n\t}\n}\n\n</style>\n"],"names":["_sfc_main$1","_sfc_main","Components_NcAvatar","Components_NcPopover","NcUserBubbleDiv","url","state","event"],"mappings":";kJA4BAA,IAAA;AAAA,EACA,MAAA;AACA;;;;;;;;;;;;;;;ACwFA,MAAAC,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC,EAAA;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,EACA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,KAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA;AACA,YAAA;AACA,iBAAAA,IAAA,IAAA,IAAAA,CAAA,GACA,CAAA,CAAAA;AAAA,QACA,QAAA;AACA,iBAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,OAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EACA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,qBAAA;AACA,aAAA,KAAA,eAEA,oBADA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAA;AACA,UAAA,CAAA,KAAA;AACA,eAAA;AAGA,UAAA;AAEA,eAAA,CAAA,CADA,IAAA,IAAA,KAAA,WAAA;AAAA,MAEA,QAAA;AACA,eAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AACA,aAAA,CAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,SAAA;AACA,aAAA,KAAA,OAAA,KAAA,IAAA,KAAA,MAAA;AAAA,IACA;AAAA,IAEA,kBAAA;AACA,aAAA,KAAA,SAAA,MAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,aAAA,eAAA,KAAA;AAAA,IAIA;AAAA,IAEA,SAAA;AACA,aAAA;AAAA,QACA,SAAA;AAAA,UACA,QAAA,KAAA,OAAA;AAAA,UACA,YAAA,KAAA,OAAA;AAAA,UACA,cAAA,KAAA,OAAA,IAAA;AAAA,QACA;AAAA,QACA,QAAA;AAAA,UACA,YAAA,KAAA,SAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EACA,SAAA;AAAA,IACA,aAAAC,GAAA;AACA,WAAA,MAAA,eAAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAAC,GAAA;AACA,WAAA,MAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcUserBubble.cjs","sources":["../../src/components/NcUserBubble/NcUserBubbleDiv.vue","../../src/components/NcUserBubble/NcUserBubble.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2021 Raimund Schlüßler <raimund.schluessler@mailbox.org>\n -\n - @author Raimund Schlüßler <raimund.schluessler@mailbox.org>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<template>\n\t<div>\n\t\t<slot name=\"trigger\" />\n\t</div>\n</template>\n\n<script>\nexport default {\n\tname: 'NcUserBubbleDiv',\n}\n</script>\n","<!--\n - @copyright Copyright (c) 2019 Jonas Sulzer <jonas@violoncello.ch>\n -\n - @author Marco Ambrosini <marcoambrosini@icloud.com>\n - @author Jonas Sulzer <jonas@violoncello.ch>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<docs>\n\n### General description\n\nThis component displays a user together with a small avatar in a grey bubble.\nIt's possible to use an actual user's avatar, just an image/icon as a url or an icon-class,\nto link the bubble to e.g. a users profile\nand to show a popover on hover with e.g. the full user name handle / email address or something else.\n\nThis component has the following slot:\n* a default slot which is for the content of the popover (this is passed to the popover component directly).\n\n### Examples\n\n```vue\n<p>\n\tSome text before <NcUserBubble user=\"admin\" display-name=\"Admin Example\" :url=\"'/test'\">@admin@foreign-host.com</NcUserBubble> and after the bubble.\n\t<NcUserBubble avatar-image=\"icon-group\" display-name=\"test group xyz\" :primary=\"true\">Hey there!</NcUserBubble>\n</p>\n```\n\n### Example with name slot\n\n```vue\n<template>\n<NcUserBubble\n\t:margin=\"4\"\n\t:size=\"30\"\n\tdisplay-name=\"Administrator\"\n\tuser=\"admin\">\n\t<template #name>\n\t\t<a href=\"#\"\n\t\t\ttitle=\"Remove user\"\n\t\t\tclass=\"icon-close\"\n\t\t\t@click=\"alert\" />\n\t</template>\n</NcUserBubble>\n</template>\n\n<style>\n.icon-close {\n\tdisplay: block;\n\theight: 100%;\n}\n</style>\n```\n\n</docs>\n<template>\n\t<component :is=\"isPopoverComponent\"\n\t\ttrigger=\"hover focus\"\n\t\t:shown=\"open\"\n\t\tclass=\"user-bubble__wrapper\"\n\t\t@update:open=\"onOpenChange\">\n\t\t<!-- Main userbubble structure -->\n\t\t<template #trigger>\n\t\t\t<component :is=\"isLinkComponent\"\n\t\t\t\tclass=\"user-bubble__content\"\n\t\t\t\t:style=\"styles.content\"\n\t\t\t\t:href=\"hasUrl ? url : null\"\n\t\t\t\t:class=\"{ 'user-bubble__content--primary': primary }\"\n\t\t\t\t@click=\"onClick\">\n\t\t\t\t<!-- NcAvatar -->\n\t\t\t\t<NcAvatar :url=\"isCustomAvatar && isAvatarUrl ? avatarImage : undefined\"\n\t\t\t\t\t:icon-class=\"isCustomAvatar && !isAvatarUrl ? avatarImage : undefined\"\n\t\t\t\t\t:user=\"user\"\n\t\t\t\t\t:display-name=\"displayName\"\n\t\t\t\t\t:size=\"size - (margin * 2)\"\n\t\t\t\t\t:style=\"styles.avatar\"\n\t\t\t\t\t:disable-tooltip=\"true\"\n\t\t\t\t\t:disable-menu=\"true\"\n\t\t\t\t\tv-bind=\"$props\"\n\t\t\t\t\tclass=\"user-bubble__avatar\" />\n\n\t\t\t\t<!-- Name -->\n\t\t\t\t<span class=\"user-bubble__name\">\n\t\t\t\t\t{{ displayName || user }}\n\t\t\t\t</span>\n\n\t\t\t\t<!-- @slot Optional slot just after the name -->\n\t\t\t\t<span v-if=\"$slots.name\" class=\"user-bubble__secondary\">\n\t\t\t\t\t<slot name=\"name\" />\n\t\t\t\t</span>\n\t\t\t</component>\n\t\t</template>\n\n\t\t<!-- @slot Main Popover content on userbubble hover/focus -->\n\t\t<slot />\n\t</component>\n</template>\n\n<script>\nimport NcUserBubbleDiv from './NcUserBubbleDiv.vue'\nimport NcAvatar from '../NcAvatar/index.js'\nimport NcPopover from '../NcPopover/index.js'\n\nexport default {\n\tname: 'NcUserBubble',\n\tcomponents: {\n\t\tNcAvatar,\n\t\tNcPopover,\n\t\tNcUserBubbleDiv,\n\t},\n\tprops: {\n\t\t/**\n\t\t * Override generated avatar, can be an url or an icon class\n\t\t */\n\t\tavatarImage: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Provide the user id if this is a user\n\t\t */\n\t\tuser: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/**\n\t\t * Displayed label\n\t\t */\n\t\tdisplayName: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * Whether or not to display the user-status\n\t\t */\n\t\tshowUserStatus: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Define the whole bubble as a link\n\t\t */\n\t\turl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t\tvalidator: url => {\n\t\t\t\ttry {\n\t\t\t\t\turl = new URL(url)\n\t\t\t\t\treturn !!url\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t/**\n\t\t * Default popover state. Requires the UserBubble\n\t\t * to have some content to render inside the popover\n\t\t */\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * Use the primary colour\n\t\t */\n\t\tprimary: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t/**\n\t\t * This is the height of the component\n\t\t */\n\t\tsize: {\n\t\t\ttype: Number,\n\t\t\tdefault: 20,\n\t\t},\n\t\t/**\n\t\t * This is the margin of the avatar (size - margin = avatar size)\n\t\t */\n\t\tmargin: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\t},\n\temits: [\n\t\t'click',\n\t\t'update:open',\n\t],\n\tcomputed: {\n\t\t/**\n\t\t * If userbubble is empty, let's NOT\n\t\t * use the Popover component\n\t\t * We need a component instead of a simple div here,\n\t\t * because otherwise the trigger template will not be shown.\n\t\t *\n\t\t * @return {string} 'Popover' or 'UserBubbleDiv'\n\t\t */\n\t\tisPopoverComponent() {\n\t\t\treturn !this.popoverEmpty\n\t\t\t\t? 'NcPopover'\n\t\t\t\t: 'NcUserBubbleDiv'\n\t\t},\n\n\t\t/**\n\t\t * Is the provided avatar url valid or not\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisAvatarUrl() {\n\t\t\tif (!this.avatarImage) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst url = new URL(this.avatarImage)\n\t\t\t\treturn !!url\n\t\t\t} catch (error) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Do we have a custom avatar or not\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisCustomAvatar() {\n\t\t\treturn !!this.avatarImage\n\t\t},\n\n\t\thasUrl() {\n\t\t\treturn this.url && this.url.trim() !== ''\n\t\t},\n\n\t\tisLinkComponent() {\n\t\t\treturn this.hasUrl ? 'a' : 'div'\n\t\t},\n\n\t\tpopoverEmpty() {\n\t\t\tif ('default' in this.$slots) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\tstyles() {\n\t\t\treturn {\n\t\t\t\tcontent: {\n\t\t\t\t\theight: this.size + 'px',\n\t\t\t\t\tlineHeight: this.size + 'px',\n\t\t\t\t\tborderRadius: this.size / 2 + 'px',\n\t\t\t\t},\n\t\t\t\tavatar: {\n\t\t\t\t\tmarginLeft: this.margin + 'px',\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\tmethods: {\n\t\tonOpenChange(state) {\n\t\t\tthis.$emit('update:open', state)\n\t\t},\n\t\t/**\n\t\t * Catch and forward click event to parent\n\t\t *\n\t\t * @param {Event} event the click event\n\t\t */\n\t\tonClick(event) {\n\t\t\tthis.$emit('click', event)\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.user-bubble {\n\t&__wrapper {\n\t\t// align inline with text\n\t\tdisplay: inline-block;\n\t\tvertical-align: middle;\n\t\t// shrink and allow grow to fit\n\t\tmin-width: 0;\n\t\tmax-width: 100%;\n\t}\n\n\t&__content {\n\t\tdisplay: inline-flex;\n\t\tmax-width: 100%;\n\t\tbackground-color: var(--color-background-dark);\n\n\t\t&--primary {\n\t\t\tcolor: var(--color-primary-element-text);\n\t\t\tbackground-color: var(--color-primary-element);\n\t\t}\n\n\t\t> :last-child {\n\t\t\t// border radius left padding\n\t\t\tpadding-right: 8px;\n\t\t}\n\t}\n\n\t&__avatar {\n\t\talign-self: center;\n\t}\n\n\t&__name {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__name,\n\t&__secondary {\n\t\t// proper spacing between avatar, name & slot\n\t\tpadding: 0;\n\t\tpadding-left: 4px;\n\t}\n}\n\n</style>\n"],"names":["_sfc_main$1","_sfc_main","Components_NcAvatar","Components_NcPopover","NcUserBubbleDiv","url","state","event"],"mappings":";kJA4BAA,IAAA;AAAA,EACA,MAAA;AACA;;;;;;;;;;;;;;;ACwFA,MAAAC,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC,EAAA;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,EACA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,KAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA;AACA,YAAA;AACA,iBAAAA,IAAA,IAAA,IAAAA,CAAA,GACA,CAAA,CAAAA;AAAA,QACA,QAAA;AACA,iBAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,OAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EACA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,qBAAA;AACA,aAAA,KAAA,eAEA,oBADA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAA;AACA,UAAA,CAAA,KAAA;AACA,eAAA;AAGA,UAAA;AAEA,eAAA,CAAA,CADA,IAAA,IAAA,KAAA,WAAA;AAAA,MAEA,QAAA;AACA,eAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AACA,aAAA,CAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,SAAA;AACA,aAAA,KAAA,OAAA,KAAA,IAAA,KAAA,MAAA;AAAA,IACA;AAAA,IAEA,kBAAA;AACA,aAAA,KAAA,SAAA,MAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,aAAA,eAAA,KAAA;AAAA,IAIA;AAAA,IAEA,SAAA;AACA,aAAA;AAAA,QACA,SAAA;AAAA,UACA,QAAA,KAAA,OAAA;AAAA,UACA,YAAA,KAAA,OAAA;AAAA,UACA,cAAA,KAAA,OAAA,IAAA;AAAA,QACA;AAAA,QACA,QAAA;AAAA,UACA,YAAA,KAAA,SAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EACA,SAAA;AAAA,IACA,aAAAC,GAAA;AACA,WAAA,MAAA,eAAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,QAAAC,GAAA;AACA,WAAA,MAAA,SAAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
- import "../assets/index-23e64bbb.css";
1
+ import "../assets/index-9e44e336.css";
2
2
  import { n as a } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
3
- import { N as s } from "../chunks/index-6c221fa0.mjs";
3
+ import { N as s } from "../chunks/index-fb2ee22c.mjs";
4
4
  import n from "./NcPopover.mjs";
5
5
  const i = {
6
6
  name: "NcUserBubbleDiv"
@@ -176,7 +176,7 @@ const c = {
176
176
  var m = function() {
177
177
  var e = this, r = e._self._c;
178
178
  return r(e.isPopoverComponent, { tag: "component", staticClass: "user-bubble__wrapper", attrs: { trigger: "hover focus", shown: e.open }, on: { "update:open": e.onOpenChange }, scopedSlots: e._u([{ key: "trigger", fn: function() {
179
- return [r(e.isLinkComponent, { tag: "component", staticClass: "user-bubble__content", class: e.primary ? "user-bubble__content--primary" : "", style: e.styles.content, attrs: { href: e.hasUrl ? e.url : null }, on: { click: e.onClick } }, [r("NcAvatar", e._b({ staticClass: "user-bubble__avatar", style: e.styles.avatar, attrs: { url: e.isCustomAvatar && e.isAvatarUrl ? e.avatarImage : void 0, "icon-class": e.isCustomAvatar && !e.isAvatarUrl ? e.avatarImage : void 0, user: e.user, "display-name": e.displayName, size: e.size - e.margin * 2, "disable-tooltip": !0, "disable-menu": !0 } }, "NcAvatar", e.$props, !1)), r("span", { staticClass: "user-bubble__name" }, [e._v(" " + e._s(e.displayName || e.user) + " ")]), e.$slots.name ? r("span", { staticClass: "user-bubble__secondary" }, [e._t("name")], 2) : e._e()], 1)];
179
+ return [r(e.isLinkComponent, { tag: "component", staticClass: "user-bubble__content", class: { "user-bubble__content--primary": e.primary }, style: e.styles.content, attrs: { href: e.hasUrl ? e.url : null }, on: { click: e.onClick } }, [r("NcAvatar", e._b({ staticClass: "user-bubble__avatar", style: e.styles.avatar, attrs: { url: e.isCustomAvatar && e.isAvatarUrl ? e.avatarImage : void 0, "icon-class": e.isCustomAvatar && !e.isAvatarUrl ? e.avatarImage : void 0, user: e.user, "display-name": e.displayName, size: e.size - e.margin * 2, "disable-tooltip": !0, "disable-menu": !0 } }, "NcAvatar", e.$props, !1)), r("span", { staticClass: "user-bubble__name" }, [e._v(" " + e._s(e.displayName || e.user) + " ")]), e.$slots.name ? r("span", { staticClass: "user-bubble__secondary" }, [e._t("name")], 2) : e._e()], 1)];
180
180
  }, proxy: !0 }], null, !0) }, [e._t("default")], 2);
181
181
  }, _ = [], d = /* @__PURE__ */ a(
182
182
  c,
@@ -184,7 +184,7 @@ var m = function() {
184
184
  _,
185
185
  !1,
186
186
  null,
187
- "25c04da2",
187
+ "14da7eb2",
188
188
  null,
189
189
  null
190
190
  );