@nextcloud/vue 9.11.0 → 9.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/assets/NcAppContent.css +20 -20
  3. package/dist/assets/NcAppNavigation.css +13 -13
  4. package/dist/assets/NcAppNavigationItem.css +45 -49
  5. package/dist/assets/NcAppNavigationList.css +2 -26
  6. package/dist/assets/NcAppNavigationNewItem.css +0 -4
  7. package/dist/assets/NcAppNavigationSettings.css +6 -6
  8. package/dist/assets/NcAppSettingsDialog.css +3 -3
  9. package/dist/assets/NcAppSettingsShortcutsSection.css +1 -1
  10. package/dist/assets/NcAppSidebar.css +28 -28
  11. package/dist/assets/NcAssistantButton.css +9 -9
  12. package/dist/assets/NcAssistantContent.css +3 -3
  13. package/dist/assets/NcAssistantIcon.css +4 -4
  14. package/dist/assets/NcAvatar.css +26 -26
  15. package/dist/assets/NcBlurHash.css +2 -2
  16. package/dist/assets/NcDateTimePicker.css +234 -234
  17. package/dist/assets/NcDialog.css +16 -16
  18. package/dist/assets/NcFilePicker.css +1 -1
  19. package/dist/assets/NcFormBox.css +11 -11
  20. package/dist/assets/NcFormBoxButton.css +2 -2
  21. package/dist/assets/NcFormBoxItem.css +15 -15
  22. package/dist/assets/NcFormBoxSwitch.css +2 -2
  23. package/dist/assets/NcFormGroup.css +7 -7
  24. package/dist/assets/NcHotkey.css +8 -8
  25. package/dist/assets/NcHotkeyList.css +2 -2
  26. package/dist/assets/NcIconToggleSwitch.css +4 -4
  27. package/dist/assets/NcKbd.css +3 -3
  28. package/dist/assets/NcModal.css +69 -63
  29. package/dist/assets/NcPopover.css +16 -16
  30. package/dist/assets/NcProfileHoverCard.css +82 -59
  31. package/dist/assets/NcRadioGroup.css +2 -2
  32. package/dist/assets/NcRadioGroupButton.css +14 -14
  33. package/dist/assets/NcRichContenteditable.css +17 -17
  34. package/dist/assets/NcRichText.css +2 -2
  35. package/dist/assets/NcUploadPicker.css +41 -0
  36. package/dist/assets/autolink.css +3 -3
  37. package/dist/chunks/NcActionInput.mjs +2 -2
  38. package/dist/chunks/NcActions.mjs +2 -2
  39. package/dist/chunks/NcAppContent.mjs +171 -298
  40. package/dist/chunks/NcAppContent.mjs.map +1 -1
  41. package/dist/chunks/NcAppContentList.vue_vue_type_script_setup_true_lang.mjs +21 -0
  42. package/dist/chunks/NcAppContentList.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
  43. package/dist/chunks/NcAppNavigation.mjs +9 -6
  44. package/dist/chunks/NcAppNavigation.mjs.map +1 -1
  45. package/dist/chunks/NcAppNavigationItem.mjs +6 -29
  46. package/dist/chunks/NcAppNavigationItem.mjs.map +1 -1
  47. package/dist/chunks/NcAppNavigationList.mjs +8 -138
  48. package/dist/chunks/NcAppNavigationList.mjs.map +1 -1
  49. package/dist/chunks/NcAppNavigationNewItem.mjs +1 -1
  50. package/dist/chunks/NcAppNavigationNewItem.mjs.map +1 -1
  51. package/dist/chunks/NcAppNavigationSearch.mjs +2 -2
  52. package/dist/chunks/NcAppNavigationSettings.mjs +8 -8
  53. package/dist/chunks/NcAppSettingsDialog.mjs +5 -5
  54. package/dist/chunks/NcAppSettingsShortcutsSection.mjs +3 -3
  55. package/dist/chunks/NcAppSidebar.mjs +15 -15
  56. package/dist/chunks/NcAppSidebar.mjs.map +1 -1
  57. package/dist/chunks/NcAssistantButton.mjs +7 -7
  58. package/dist/chunks/NcAssistantContent.mjs +3 -3
  59. package/dist/chunks/NcAssistantIcon.mjs +4 -4
  60. package/dist/chunks/NcAvatar.mjs +30 -10
  61. package/dist/chunks/NcAvatar.mjs.map +1 -1
  62. package/dist/chunks/NcBlurHash.mjs +2 -2
  63. package/dist/chunks/NcCheckboxRadioSwitch.mjs +1 -1
  64. package/dist/chunks/NcCollectionList.mjs +3 -3
  65. package/dist/chunks/NcColorPicker.mjs +2 -2
  66. package/dist/chunks/NcContent.mjs +2 -2
  67. package/dist/chunks/NcDashboardWidget.mjs +4 -4
  68. package/dist/chunks/NcDashboardWidget.mjs.map +1 -1
  69. package/dist/chunks/NcDateTimePicker.mjs +7 -4
  70. package/dist/chunks/NcDateTimePicker.mjs.map +1 -1
  71. package/dist/chunks/NcDateTimePickerNative.mjs +2 -2
  72. package/dist/chunks/NcDialog.mjs +1 -1
  73. package/dist/chunks/NcDialog.mjs.map +1 -1
  74. package/dist/chunks/NcDialogButton.vue_vue_type_script_setup_true_lang.mjs +2 -2
  75. package/dist/chunks/NcEmojiPicker.mjs +2 -2
  76. package/dist/chunks/NcFilePicker.mjs +6 -5
  77. package/dist/chunks/NcFilePicker.mjs.map +1 -1
  78. package/dist/chunks/NcFormBox.mjs +5 -5
  79. package/dist/chunks/NcFormBoxButton.mjs +2 -2
  80. package/dist/chunks/NcFormBoxItem.mjs +8 -8
  81. package/dist/chunks/NcFormBoxSwitch.mjs +2 -2
  82. package/dist/chunks/NcFormGroup.mjs +7 -7
  83. package/dist/chunks/NcHotkey.mjs +4 -4
  84. package/dist/chunks/NcHotkeyList.mjs +4 -4
  85. package/dist/chunks/NcIconToggleSwitch.mjs +2 -2
  86. package/dist/chunks/NcKbd.mjs +4 -4
  87. package/dist/chunks/NcMentionBubble.vue_vue_type_style_index_0_scoped_3c4a673d_lang.mjs +7 -7
  88. package/dist/chunks/NcMentionBubble.vue_vue_type_style_index_0_scoped_3c4a673d_lang.mjs.map +1 -1
  89. package/dist/chunks/NcModal.mjs +18 -11
  90. package/dist/chunks/NcModal.mjs.map +1 -1
  91. package/dist/chunks/NcPasswordField.mjs +2 -2
  92. package/dist/chunks/NcPopover.mjs +2 -2
  93. package/dist/chunks/NcProfileHoverCard.mjs +205 -157
  94. package/dist/chunks/NcProfileHoverCard.mjs.map +1 -1
  95. package/dist/chunks/NcRadioGroup.mjs +2 -2
  96. package/dist/chunks/NcRadioGroupButton.mjs +6 -6
  97. package/dist/chunks/NcReferenceWidget.mjs +2 -2
  98. package/dist/chunks/NcRelatedResourcesPanel.mjs +4 -4
  99. package/dist/chunks/NcRichContenteditable.mjs +12 -12
  100. package/dist/chunks/NcRichText.mjs +3 -3
  101. package/dist/chunks/NcRichText.mjs.map +1 -1
  102. package/dist/chunks/NcSettingsSection.mjs +2 -2
  103. package/dist/chunks/NcSettingsSelectGroup.mjs +2 -2
  104. package/dist/chunks/NcTextField.vue_vue_type_script_setup_true_lang.mjs +2 -2
  105. package/dist/chunks/NcTimezonePicker.vue_vue_type_script_setup_true_lang.mjs +2 -2
  106. package/dist/chunks/NcUploadPicker.mjs +269 -0
  107. package/dist/chunks/NcUploadPicker.mjs.map +1 -0
  108. package/dist/chunks/NcUserStatusIcon.mjs +2 -2
  109. package/dist/chunks/_l10n.mjs +91 -89
  110. package/dist/chunks/_l10n.mjs.map +1 -1
  111. package/dist/chunks/autolink.mjs +3 -3
  112. package/dist/chunks/colors.mjs +2 -2
  113. package/dist/chunks/mdi.mjs +7 -5
  114. package/dist/chunks/mdi.mjs.map +1 -1
  115. package/dist/chunks/referencePickerModal.mjs +5 -5
  116. package/dist/components/NcActionInput/NcActionInput.vue.d.ts +3 -3
  117. package/dist/components/NcAppContent/NcAppContent.vue.d.ts +77 -149
  118. package/dist/components/NcAppContent/index.d.ts +5 -0
  119. package/dist/components/NcAppContentList/NcAppContentList.vue.d.ts +28 -27
  120. package/dist/components/NcAppContentList/index.d.ts +4 -0
  121. package/dist/components/NcAppContentList/index.mjs +2 -2
  122. package/dist/components/NcAppNavigationItem/NcAppNavigationItem.vue.d.ts +0 -4
  123. package/dist/components/NcAppNavigationList/NcAppNavigationList.vue.d.ts +1 -57
  124. package/dist/components/NcAvatar/NcAvatar.vue.d.ts +26 -0
  125. package/dist/components/NcCollectionList/NcCollectionList.vue.d.ts +26 -0
  126. package/dist/components/NcCollectionList/NcCollectionListItem.vue.d.ts +13 -0
  127. package/dist/components/NcDashboardWidget/NcDashboardWidget.vue.d.ts +26 -0
  128. package/dist/components/NcDashboardWidgetItem/NcDashboardWidgetItem.vue.d.ts +13 -0
  129. package/dist/components/NcDateTimePicker/NcDateTimePicker.vue.d.ts +2 -2
  130. package/dist/components/NcFilePicker/NcFilePicker.vue.d.ts +7 -0
  131. package/dist/components/NcListItemIcon/NcListItemIcon.vue.d.ts +14 -1
  132. package/dist/components/NcModal/NcModal.vue.d.ts +3 -0
  133. package/dist/components/NcProfileHoverCard/NcProfileHoverCard.vue.d.ts +6 -0
  134. package/dist/components/NcRichText/NcReferencePicker/NcReferencePickerModal.vue.d.ts +8 -0
  135. package/dist/components/NcUploadPicker/NcUploadPicker.vue.d.ts +180 -0
  136. package/dist/components/NcUploadPicker/index.d.ts +6 -0
  137. package/dist/components/NcUploadPicker/index.mjs +5 -0
  138. package/dist/components/NcUploadPicker/index.mjs.map +1 -0
  139. package/dist/components/index.d.ts +3 -2
  140. package/dist/composables/useFormatDateTime/index.mjs +2 -2
  141. package/dist/index.mjs +169 -167
  142. package/dist/index.mjs.map +1 -1
  143. package/dist/utils/getAvatarUrl.d.ts +4 -0
  144. package/package.json +26 -12
  145. package/dist/chunks/NcAppContentList.mjs +0 -33
  146. package/dist/chunks/NcAppContentList.mjs.map +0 -1
  147. package/dist/chunks/highlight.mjs +0 -5
  148. package/dist/chunks/highlight.mjs.map +0 -1
  149. package/dist/components/NcAppNavigationList/highlight.d.ts +0 -12
@@ -2,7 +2,7 @@ import '../assets/NcActions.css';
2
2
  import { openBlock, createElementBlock, mergeProps, createElementVNode, toDisplayString, createCommentVNode, Comment, Fragment, Text, warn, h, computed } from "vue";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper.mjs";
4
4
  import { u as useTrapStackControl } from "./useTrapStackControl.mjs";
5
- import { r as register, F as t5, a as t } from "./_l10n.mjs";
5
+ import { r as register, G as t4, a as t } from "./_l10n.mjs";
6
6
  import { c as createElementId } from "./createElementId.mjs";
7
7
  import { N as NcButton } from "./NcButton.mjs";
8
8
  import { N as NcPopover } from "./NcPopover.mjs";
@@ -50,7 +50,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
50
50
  ], 16, _hoisted_1);
51
51
  }
52
52
  const IconDotsHorizontal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
53
- register(t5);
53
+ register(t4);
54
54
  function isSlotPopulated(vnodes) {
55
55
  return Array.isArray(vnodes) && vnodes.some((node) => {
56
56
  if (node === null) {
@@ -1,21 +1,21 @@
1
1
  import '../assets/NcAppContent.css';
2
- import { getBuilder } from "@nextcloud/browser-storage";
3
- import { getCapabilities } from "@nextcloud/capabilities";
2
+ import { defineComponent, watch, onMounted, onBeforeUnmount, openBlock, createBlock, unref, normalizeClass, withCtx, createVNode, useModel, ref, computed, createElementBlock, toDisplayString, createCommentVNode, Fragment, withModifiers, withDirectives, createElementVNode, renderSlot, vShow, mergeModels } from "vue";
4
3
  import { emit } from "@nextcloud/event-bus";
5
- import { useSwipe } from "@vueuse/core";
4
+ import { useCurrentElement, useSwipe } from "@vueuse/core";
6
5
  import { Splitpanes, Pane } from "splitpanes";
7
- import { defineComponent, watch, onMounted, onBeforeUnmount, openBlock, createBlock, unref, normalizeClass, withCtx, createVNode, resolveComponent, createElementBlock, toDisplayString, createCommentVNode, Fragment, withModifiers, withDirectives, createElementVNode, renderSlot, vShow } from "vue";
8
6
  import { m as mdiArrowRight } from "./mdi.mjs";
9
7
  import { useIsMobile } from "../composables/useIsMobile/index.mjs";
10
- import { r as register, G as t28, a as t } from "./_l10n.mjs";
8
+ import { r as register, J as t29, a as t } from "./_l10n.mjs";
11
9
  import { N as NcButton } from "./NcButton.mjs";
12
10
  import { N as NcIconSvgWrapper } from "./NcIconSvgWrapper.mjs";
13
11
  import { _ as _export_sfc } from "./_plugin-vue_export-helper.mjs";
14
- import { u as useLocalizedAppName, a as useAppName } from "./appName.mjs";
12
+ import { a as useAppName, u as useLocalizedAppName } from "./appName.mjs";
15
13
  import { l as logger } from "./logger.mjs";
16
14
  import { i as isRtl } from "./rtl.mjs";
17
15
  import "splitpanes/dist/splitpanes.css";
18
- register(t28);
16
+ import { getBuilder } from "@nextcloud/browser-storage";
17
+ import { getCapabilities } from "@nextcloud/capabilities";
18
+ register(t29);
19
19
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
20
20
  __name: "NcAppContentDetailsToggle",
21
21
  setup(__props) {
@@ -57,324 +57,197 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
57
57
  }
58
58
  });
59
59
  const NcAppContentDetailsToggle = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-a28923a1"]]);
60
+ const _hoisted_1 = {
61
+ key: 0,
62
+ class: "hidden-visually"
63
+ };
64
+ const _hoisted_2 = { class: "app-content-wrapper__list" };
65
+ const _hoisted_3 = {
66
+ key: 1,
67
+ class: "app-content-wrapper"
68
+ };
60
69
  const browserStorage = getBuilder("nextcloud").persist().build();
61
70
  const instanceName = getCapabilities().theming?.name ?? "Nextcloud";
62
- const _sfc_main = {
63
- name: "NcAppContent",
64
- components: {
65
- NcAppContentDetailsToggle,
66
- Pane,
67
- Splitpanes
68
- },
69
- props: {
70
- /**
71
- * Allows to disable the control by swipe of the app navigation open state.
72
- */
73
- disableSwipe: {
74
- type: Boolean,
75
- default: false
76
- },
77
- /**
78
- * Allows you to set the default width of the resizable list in % on vertical-split
79
- * or respectively the default height on horizontal-split.
80
- *
81
- * Must be between `listMinWidth` and `listMaxWidth`.
82
- */
83
- listSize: {
84
- type: Number,
85
- default: 20
86
- },
87
- /**
88
- * Allows you to set the minimum width of the list column in % on vertical-split
89
- * or respectively the minimum height on horizontal-split.
90
- */
91
- listMinWidth: {
92
- type: Number,
93
- default: 15
94
- },
95
- /**
96
- * Allows you to set the maximum width of the list column in % on vertical-split
97
- * or respectively the maximum height on horizontal-split.
98
- */
99
- listMaxWidth: {
100
- type: Number,
101
- default: 40
102
- },
103
- /**
104
- * Specify the config key for the pane config sizes
105
- * Default is the global var appName if you use the webpack-vue-config
106
- */
107
- paneConfigKey: {
108
- type: String,
109
- default: ""
110
- },
111
- /**
112
- * When in mobile view, only the list or the details are shown.
113
- *
114
- * If you provide a list, you need to provide a variable
115
- * that will be set to true by the user when an element of
116
- * the list gets selected. The details will then show a back
117
- * arrow to return to the list that will update this prop to false.
118
- */
119
- showDetails: {
120
- type: Boolean,
121
- default: true
122
- },
123
- /**
124
- * Content layout used when there is a list together with content:
125
- * - `vertical-split` - a 2-column layout with list and default content separated vertically
126
- * - `no-split` - a single column layout; List is shown when `showDetails` is `false`, otherwise the default slot content is shown with a back button to return to the list.
127
- * - 'horizontal-split' - a 2-column layout with list and default content separated horizontally
128
- * On mobile screen `no-split` layout is forced.
129
- */
130
- layout: {
131
- type: String,
132
- default: "vertical-split",
133
- validator(value) {
134
- return ["no-split", "vertical-split", "horizontal-split"].includes(value);
71
+ const _sfc_main = /* @__PURE__ */ defineComponent({
72
+ __name: "NcAppContent",
73
+ props: /* @__PURE__ */ mergeModels({
74
+ disableSwipe: { type: Boolean, default: false },
75
+ listSize: { default: 20 },
76
+ listMinWidth: { default: 15 },
77
+ listMaxWidth: { default: 40 },
78
+ paneConfigKey: { default: "" },
79
+ layout: { default: "vertical-split" },
80
+ pageHeading: { default: () => void 0 },
81
+ pageTitle: { default: () => void 0 }
82
+ }, {
83
+ "showDetails": { type: Boolean, ...{ default: true } },
84
+ "showDetailsModifiers": {}
85
+ }),
86
+ emits: /* @__PURE__ */ mergeModels(["resizeList", "update:showDetails"], ["update:showDetails"]),
87
+ setup(__props, { emit: __emit }) {
88
+ const showDetails = useModel(__props, "showDetails");
89
+ const emit$1 = __emit;
90
+ const appName = useAppName();
91
+ const localizedAppName = useLocalizedAppName();
92
+ const isMobile = useIsMobile();
93
+ const element = useCurrentElement();
94
+ const swipe = useSwipe(
95
+ // Swiping can be disabled by not providing a target to listen on
96
+ () => __props.disableSwipe ? void 0 : element.value,
97
+ {
98
+ onSwipeEnd(_event, direction) {
99
+ const minSwipeX = 70;
100
+ const touchZone = 300;
101
+ if (Math.abs(swipe.lengthX.value) > minSwipeX) {
102
+ if (swipe.coordsStart.x < touchZone / 2 && direction === "right") {
103
+ emit("toggle-navigation", {
104
+ open: true
105
+ });
106
+ } else if (swipe.coordsStart.x < touchZone * 1.5 && direction === "left") {
107
+ emit("toggle-navigation", {
108
+ open: false
109
+ });
110
+ }
111
+ }
112
+ }
135
113
  }
136
- },
137
- /**
138
- * Specify the `<h1>` page heading
139
- */
140
- pageHeading: {
141
- type: String,
142
- default: null
143
- },
144
- /**
145
- * Allow setting the page's `<title>`
146
- *
147
- * If a page heading is set it defaults to `{pageHeading} - {appName} - {instanceName}` e.g. `Favorites - Files - MyPersonalCloud`.
148
- * When the page heading and the app name is the same only one is used, e.g. `Files - Files - MyPersonalCloud` is shown as `Files - MyPersonalCloud`.
149
- * When setting the prop then the following format will be used: `{pageTitle} - {instanceName}`
150
- */
151
- pageTitle: {
152
- type: String,
153
- default: null
154
- }
155
- },
156
- emits: [
157
- "update:showDetails",
158
- "resizeList"
159
- ],
160
- setup() {
161
- return {
162
- appName: useAppName(),
163
- localizedAppName: useLocalizedAppName(),
164
- isMobile: useIsMobile(),
165
- isRtl
166
- };
167
- },
168
- data() {
169
- return {
170
- contentHeight: 0,
171
- swiping: {},
172
- listPaneSize: this.restorePaneConfig()
173
- };
174
- },
175
- computed: {
176
- paneConfigID() {
177
- if (this.paneConfigKey !== "") {
178
- return `pane-list-size-${this.paneConfigKey}`;
114
+ );
115
+ const listPaneSize = ref();
116
+ const paneConfigID = computed(() => {
117
+ if (__props.paneConfigKey !== "") {
118
+ return `pane-list-size-${__props.paneConfigKey}`;
179
119
  }
180
- try {
181
- return `pane-list-size-${this.appName}`;
182
- } catch {
183
- logger.info("[NcAppContent]: falling back to global nextcloud pane config");
184
- return "pane-list-size-nextcloud";
120
+ return `pane-list-size-${appName}`;
121
+ });
122
+ const paneDefaults = computed(() => ({
123
+ list: {
124
+ size: __props.listSize,
125
+ min: __props.listMinWidth,
126
+ max: __props.listMaxWidth
127
+ },
128
+ // set the inverse values of the details column
129
+ // based on the provided (or default) values of the list column
130
+ details: {
131
+ size: 100 - __props.listSize,
132
+ min: 100 - __props.listMaxWidth,
133
+ max: 100 - __props.listMinWidth
185
134
  }
186
- },
187
- detailsPaneSize() {
188
- if (this.listPaneSize) {
189
- return 100 - this.listPaneSize;
135
+ }));
136
+ const detailsPaneSize = computed(() => {
137
+ if (listPaneSize.value) {
138
+ return 100 - listPaneSize.value;
190
139
  }
191
- return this.paneDefaults.details.size;
192
- },
193
- paneDefaults() {
194
- return {
195
- list: {
196
- size: this.listSize,
197
- min: this.listMinWidth,
198
- max: this.listMaxWidth
199
- },
200
- // set the inverse values of the details column
201
- // based on the provided (or default) values of the list column
202
- details: {
203
- size: 100 - this.listSize,
204
- min: 100 - this.listMaxWidth,
205
- max: 100 - this.listMinWidth
206
- }
207
- };
208
- },
209
- realPageTitle() {
140
+ return paneDefaults.value.details.size;
141
+ });
142
+ const realPageTitle = computed(() => {
210
143
  const entries = /* @__PURE__ */ new Set();
211
- if (this.pageTitle) {
212
- for (const part of this.pageTitle.split(" - ")) {
144
+ if (__props.pageTitle) {
145
+ for (const part of __props.pageTitle.split(" - ")) {
213
146
  entries.add(part);
214
147
  }
215
- } else if (this.pageHeading) {
216
- for (const part of this.pageHeading.split(" - ")) {
148
+ } else if (__props.pageHeading) {
149
+ for (const part of __props.pageHeading.split(" - ")) {
217
150
  entries.add(part);
218
151
  }
219
152
  if (entries.size > 0) {
220
- entries.add(this.localizedAppName);
153
+ entries.add(localizedAppName);
221
154
  }
222
155
  } else {
223
156
  return null;
224
157
  }
225
158
  entries.add(instanceName);
226
159
  return [...entries.values()].join(" - ");
227
- }
228
- },
229
- watch: {
230
- realPageTitle: {
231
- immediate: true,
232
- handler() {
233
- if (this.realPageTitle !== null) {
234
- document.title = this.realPageTitle;
235
- }
236
- }
237
- },
238
- paneConfigKey: {
239
- immediate: true,
240
- handler() {
241
- this.restorePaneConfig();
160
+ });
161
+ watch(realPageTitle, () => {
162
+ if (realPageTitle.value !== null) {
163
+ document.title = realPageTitle.value;
242
164
  }
165
+ }, { immediate: true });
166
+ watch(() => __props.paneConfigKey, restorePaneConfig, { immediate: true });
167
+ onMounted(restorePaneConfig);
168
+ function handlePaneResize(event) {
169
+ const size = Math.trunc(event.panes[0].size);
170
+ browserStorage.setItem(paneConfigID.value, JSON.stringify(size));
171
+ listPaneSize.value = size;
172
+ emit$1("resizeList", { size });
173
+ logger.debug("[NcAppContent] pane config", { listPaneSize: size });
243
174
  }
244
- },
245
- mounted() {
246
- if (!this.disableSwipe) {
247
- this.swiping = useSwipe(this.$el, {
248
- onSwipeEnd: this.handleSwipe
249
- });
250
- }
251
- this.restorePaneConfig();
252
- },
253
- methods: {
254
- /**
255
- * handle the swipe event
256
- *
257
- * @param {TouchEvent} e The touch event
258
- * @param {import('@vueuse/core').SwipeDirection} direction The swipe direction of the event
259
- */
260
- handleSwipe(e, direction) {
261
- const minSwipeX = 70;
262
- const touchZone = 300;
263
- if (Math.abs(this.swiping.lengthX) > minSwipeX) {
264
- if (this.swiping.coordsStart.x < touchZone / 2 && direction === "right") {
265
- emit("toggle-navigation", {
266
- open: true
267
- });
268
- } else if (this.swiping.coordsStart.x < touchZone * 1.5 && direction === "left") {
269
- emit("toggle-navigation", {
270
- open: false
271
- });
272
- }
175
+ function restorePaneConfig() {
176
+ const size = parseInt(browserStorage.getItem(paneConfigID.value) ?? "", 10);
177
+ if (!isNaN(size) && size !== listPaneSize.value) {
178
+ logger.debug("[NcAppContent] pane config", { listPaneSize: size });
179
+ listPaneSize.value = size;
273
180
  }
274
- },
275
- handlePaneResize(event) {
276
- const listPaneSize = parseInt(event.panes[0].size, 10);
277
- browserStorage.setItem(this.paneConfigID, JSON.stringify(listPaneSize));
278
- this.listPaneSize = listPaneSize;
279
- this.$emit("resizeList", { size: listPaneSize });
280
- logger.debug("[NcAppContent] pane config", { listPaneSize });
281
- },
282
- // browserStorage is not reactive, we need to update this manually
283
- restorePaneConfig() {
284
- const listPaneSize = parseInt(browserStorage.getItem(this.paneConfigID), 10);
285
- if (!isNaN(listPaneSize) && listPaneSize !== this.listPaneSize) {
286
- logger.debug("[NcAppContent] pane config", { listPaneSize });
287
- this.listPaneSize = listPaneSize;
288
- return listPaneSize;
289
- }
290
- },
291
- /**
292
- * The user clicked the back arrow from the details view
293
- */
294
- hideDetails() {
295
- this.$emit("update:showDetails", false);
296
181
  }
297
- }
298
- };
299
- const _hoisted_1 = {
300
- key: 0,
301
- class: "hidden-visually"
302
- };
303
- const _hoisted_2 = { class: "app-content-wrapper__list" };
304
- const _hoisted_3 = {
305
- key: 1,
306
- class: "app-content-wrapper"
307
- };
308
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
309
- const _component_NcAppContentDetailsToggle = resolveComponent("NcAppContentDetailsToggle");
310
- const _component_Pane = resolveComponent("Pane");
311
- const _component_Splitpanes = resolveComponent("Splitpanes");
312
- return openBlock(), createElementBlock("main", {
313
- id: "app-content-vue",
314
- class: normalizeClass(["app-content no-snapper", { "app-content--has-list": !!_ctx.$slots.list }])
315
- }, [
316
- $props.pageHeading ? (openBlock(), createElementBlock("h1", _hoisted_1, toDisplayString($props.pageHeading), 1)) : createCommentVNode("", true),
317
- !!_ctx.$slots.list ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
318
- $setup.isMobile || $props.layout === "no-split" ? (openBlock(), createElementBlock("div", {
319
- key: 0,
320
- class: normalizeClass(["app-content-wrapper app-content-wrapper--no-split", {
321
- "app-content-wrapper--show-details": $props.showDetails,
322
- "app-content-wrapper--show-list": !$props.showDetails,
323
- "app-content-wrapper--mobile": $setup.isMobile
324
- }])
182
+ return (_ctx, _cache) => {
183
+ return openBlock(), createElementBlock("main", {
184
+ id: "app-content-vue",
185
+ class: normalizeClass(["app-content no-snapper", { "app-content--has-list": !!_ctx.$slots.list }])
325
186
  }, [
326
- $props.showDetails ? (openBlock(), createBlock(_component_NcAppContentDetailsToggle, {
327
- key: 0,
328
- onClick: withModifiers($options.hideDetails, ["stop", "prevent"])
329
- }, null, 8, ["onClick"])) : createCommentVNode("", true),
330
- withDirectives(createElementVNode("div", _hoisted_2, [
331
- renderSlot(_ctx.$slots, "list", {}, void 0, true)
332
- ], 512), [
333
- [vShow, !$props.showDetails]
334
- ]),
335
- $props.showDetails ? renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true) : createCommentVNode("", true)
336
- ], 2)) : $props.layout === "vertical-split" || $props.layout === "horizontal-split" ? (openBlock(), createElementBlock("div", _hoisted_3, [
337
- createVNode(_component_Splitpanes, {
338
- horizontal: $props.layout === "horizontal-split",
339
- class: normalizeClass(["default-theme", {
340
- "splitpanes--horizontal": $props.layout === "horizontal-split",
341
- "splitpanes--vertical": $props.layout === "vertical-split"
342
- }]),
343
- rtl: $setup.isRtl,
344
- onResized: $options.handlePaneResize
345
- }, {
346
- default: withCtx(() => [
347
- createVNode(_component_Pane, {
348
- class: "splitpanes__pane-list",
349
- size: $data.listPaneSize || $options.paneDefaults.list.size,
350
- minSize: $options.paneDefaults.list.min,
351
- maxSize: $options.paneDefaults.list.max
352
- }, {
353
- default: withCtx(() => [
354
- renderSlot(_ctx.$slots, "list", {}, void 0, true)
355
- ]),
356
- _: 3
357
- }, 8, ["size", "minSize", "maxSize"]),
358
- createVNode(_component_Pane, {
359
- class: "splitpanes__pane-details",
360
- size: $options.detailsPaneSize,
361
- minSize: $options.paneDefaults.details.min,
362
- maxSize: $options.paneDefaults.details.max
187
+ __props.pageHeading ? (openBlock(), createElementBlock("h1", _hoisted_1, toDisplayString(__props.pageHeading), 1)) : createCommentVNode("", true),
188
+ !!_ctx.$slots.list ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
189
+ unref(isMobile) || __props.layout === "no-split" ? (openBlock(), createElementBlock("div", {
190
+ key: 0,
191
+ class: normalizeClass(["app-content-wrapper app-content-wrapper--no-split", {
192
+ "app-content-wrapper--show-details": showDetails.value,
193
+ "app-content-wrapper--show-list": !showDetails.value,
194
+ "app-content-wrapper--mobile": unref(isMobile)
195
+ }])
196
+ }, [
197
+ showDetails.value ? (openBlock(), createBlock(NcAppContentDetailsToggle, {
198
+ key: 0,
199
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => showDetails.value = false, ["stop", "prevent"]))
200
+ })) : createCommentVNode("", true),
201
+ withDirectives(createElementVNode("div", _hoisted_2, [
202
+ renderSlot(_ctx.$slots, "list", {}, void 0, true)
203
+ ], 512), [
204
+ [vShow, !showDetails.value]
205
+ ]),
206
+ showDetails.value ? renderSlot(_ctx.$slots, "default", {}, void 0, true, 1) : createCommentVNode("", true)
207
+ ], 2)) : __props.layout === "vertical-split" || __props.layout === "horizontal-split" ? (openBlock(), createElementBlock("div", _hoisted_3, [
208
+ createVNode(unref(Splitpanes), {
209
+ horizontal: __props.layout === "horizontal-split",
210
+ class: normalizeClass(["default-theme", {
211
+ "splitpanes--horizontal": __props.layout === "horizontal-split",
212
+ "splitpanes--vertical": __props.layout === "vertical-split"
213
+ }]),
214
+ rtl: unref(isRtl),
215
+ onResized: handlePaneResize
363
216
  }, {
364
217
  default: withCtx(() => [
365
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
218
+ createVNode(unref(Pane), {
219
+ class: "splitpanes__pane-list",
220
+ size: listPaneSize.value || paneDefaults.value.list.size,
221
+ minSize: paneDefaults.value.list.min,
222
+ maxSize: paneDefaults.value.list.max
223
+ }, {
224
+ default: withCtx(() => [
225
+ renderSlot(_ctx.$slots, "list", {}, void 0, true)
226
+ ]),
227
+ _: 3
228
+ }, 8, ["size", "minSize", "maxSize"]),
229
+ createVNode(unref(Pane), {
230
+ class: "splitpanes__pane-details",
231
+ size: detailsPaneSize.value,
232
+ minSize: paneDefaults.value.details.min,
233
+ maxSize: paneDefaults.value.details.max
234
+ }, {
235
+ default: withCtx(() => [
236
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
237
+ ]),
238
+ _: 3
239
+ }, 8, ["size", "minSize", "maxSize"])
366
240
  ]),
367
241
  _: 3
368
- }, 8, ["size", "minSize", "maxSize"])
369
- ]),
370
- _: 3
371
- }, 8, ["horizontal", "class", "rtl", "onResized"])
372
- ])) : createCommentVNode("", true)
373
- ], 64)) : createCommentVNode("", true),
374
- !_ctx.$slots.list ? renderSlot(_ctx.$slots, "default", { key: 2 }, void 0, true) : createCommentVNode("", true)
375
- ], 2);
376
- }
377
- const NcAppContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-51427d61"]]);
242
+ }, 8, ["horizontal", "class", "rtl"])
243
+ ])) : createCommentVNode("", true)
244
+ ], 64)) : createCommentVNode("", true),
245
+ !_ctx.$slots.list ? renderSlot(_ctx.$slots, "default", {}, void 0, true, 2) : createCommentVNode("", true)
246
+ ], 2);
247
+ };
248
+ }
249
+ });
250
+ const NcAppContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5de09463"]]);
378
251
  export {
379
252
  NcAppContent as N
380
253
  };