@conduction/nextcloud-vue 2.186.0 → 2.187.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 (35) hide show
  1. package/dist/esm/components/CnChartWidget/CnChartWidget.vue.js +1 -1
  2. package/dist/esm/components/CnChartWidget/CnChartWidget2.vue.js +58 -0
  3. package/dist/esm/components/CnChartWidget/CnChartWidget2.vue.js.map +1 -1
  4. package/dist/esm/components/CnChartWidget/CnChartWidget3.vue.js +2 -2
  5. package/dist/esm/components/CnChartWidget/CnChartWidget3.vue.js.map +1 -1
  6. package/dist/esm/components/CnPeopleWidget/CnPeopleWidget.vue.js +1 -1
  7. package/dist/esm/components/CnPeopleWidget/CnPeopleWidget2.vue.js +281 -27
  8. package/dist/esm/components/CnPeopleWidget/CnPeopleWidget2.vue.js.map +1 -1
  9. package/dist/esm/components/CnPeopleWidget/CnPeopleWidget3.vue.js +86 -33
  10. package/dist/esm/components/CnPeopleWidget/CnPeopleWidget3.vue.js.map +1 -1
  11. package/dist/esm/components/CnPeopleWidget/peopleCache.js +76 -0
  12. package/dist/esm/components/CnPeopleWidget/peopleCache.js.map +1 -0
  13. package/dist/esm/components/CnPeopleWidgetForm/CnPeopleWidgetForm.vue.js +1 -1
  14. package/dist/esm/components/CnPeopleWidgetForm/CnPeopleWidgetForm2.vue.js +40 -9
  15. package/dist/esm/components/CnPeopleWidgetForm/CnPeopleWidgetForm2.vue.js.map +1 -1
  16. package/dist/esm/components/CnPeopleWidgetForm/CnPeopleWidgetForm3.vue.js +35 -26
  17. package/dist/esm/components/CnPeopleWidgetForm/CnPeopleWidgetForm3.vue.js.map +1 -1
  18. package/dist/esm/components/CnTextWidget/CnTextWidget.vue.js +1 -1
  19. package/dist/esm/components/CnTextWidget/CnTextWidget2.vue.js +32 -12
  20. package/dist/esm/components/CnTextWidget/CnTextWidget2.vue.js.map +1 -1
  21. package/dist/esm/components/CnTextWidget/CnTextWidget3.vue.js.map +1 -1
  22. package/dist/esm/l10n/nl.json.js +4 -0
  23. package/dist/esm/l10n/nl.json.js.map +1 -1
  24. package/dist/esm/library-style.js +1 -1
  25. package/dist/esm/nextcloud-vue.css +206 -150
  26. package/dist/nextcloud-vue.cjs.js +1366 -864
  27. package/dist/nextcloud-vue.cjs.js.map +2 -2
  28. package/dist/nextcloud-vue.css +206 -150
  29. package/l10n/nl.json +4 -0
  30. package/package.json +1 -1
  31. package/src/components/CnChartWidget/CnChartWidget.vue +60 -2
  32. package/src/components/CnPeopleWidget/CnPeopleWidget.vue +402 -56
  33. package/src/components/CnPeopleWidget/peopleCache.js +73 -0
  34. package/src/components/CnPeopleWidgetForm/CnPeopleWidgetForm.vue +45 -11
  35. package/src/components/CnTextWidget/CnTextWidget.vue +32 -12
@@ -36,10 +36,24 @@ const _hoisted_14 = {
36
36
  class: "cn-people-widget__sub"
37
37
  };
38
38
  const _hoisted_15 = {
39
+ key: 3,
40
+ class: "cn-people-widget__sub"
41
+ };
42
+ const _hoisted_16 = {
43
+ key: 0,
44
+ class: "cn-people-widget__fields"
45
+ };
46
+ const _hoisted_17 = ["aria-label"];
47
+ const _hoisted_18 = ["aria-label", "onClick"];
48
+ const _hoisted_19 = {
49
+ key: 1,
50
+ class: "cn-people-widget__sub cn-people-widget__field"
51
+ };
52
+ const _hoisted_20 = {
39
53
  key: 5,
40
54
  class: "cn-people-widget__footer"
41
55
  };
42
- const _hoisted_16 = ["disabled"];
56
+ const _hoisted_21 = ["disabled"];
43
57
 
44
58
  function render(_ctx, _cache, $props, $setup, $data, $options) {
45
59
  return (openBlock(), createElementBlock("div", {
@@ -51,7 +65,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
51
65
  type: "search",
52
66
  class: "cn-people-widget__search",
53
67
  "aria-label": $options.t('nextcloud-vue', 'Search by name or email'),
54
- placeholder: $options.t('nextcloud-vue', 'Search by name or email…')
68
+ placeholder: $options.searchPlaceholder
55
69
  }, null, 8 /* PROPS */, _hoisted_2), [
56
70
  [vModelText, $data.search]
57
71
  ]),
@@ -63,7 +77,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
63
77
  onClick: _cache[1] || (_cache[1] = (...args) => ($options.forceRefresh && $options.forceRefresh(...args)))
64
78
  }, " ↻ ", 8 /* PROPS */, _hoisted_3)
65
79
  ]),
66
- ($data.loading && $data.users.length === 0)
80
+ (($data.loading || $data.searchPending) && $options.displayedUsers.length === 0)
67
81
  ? (openBlock(), createElementBlock("div", _hoisted_4, toDisplayString($options.t('nextcloud-vue', 'Loading…')), 1 /* TEXT */))
68
82
  : ($data.error)
69
83
  ? (openBlock(), createElementBlock("div", _hoisted_5, [
@@ -76,54 +90,93 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
76
90
  ]))
77
91
  : (!$options.hasSource)
78
92
  ? (openBlock(), createElementBlock("div", _hoisted_6, toDisplayString($options.t('nextcloud-vue', 'No people directory available')), 1 /* TEXT */))
79
- : ($options.filteredUsers.length === 0)
80
- ? (openBlock(), createElementBlock("div", _hoisted_7, toDisplayString($data.search ? $options.t('nextcloud-vue', 'No users match your search') : $options.t('nextcloud-vue', 'No people to show')), 1 /* TEXT */))
93
+ : ($options.displayedUsers.length === 0)
94
+ ? (openBlock(), createElementBlock("div", _hoisted_7, toDisplayString($data.search.trim() ? $options.t('nextcloud-vue', 'No users match your search') : $options.t('nextcloud-vue', 'No matching users.')), 1 /* TEXT */))
81
95
  : (openBlock(), createElementBlock("div", {
82
96
  key: 4,
83
97
  class: "cn-people-widget__items",
84
98
  style: normalizeStyle($options.gridStyle),
85
99
  role: "list"
86
100
  }, [
87
- (openBlock(true), createElementBlock(Fragment, null, renderList($options.filteredUsers, (user) => {
88
- return (openBlock(), createElementBlock("a", {
101
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.displayedUsers, (user) => {
102
+ return (openBlock(), createElementBlock("div", {
89
103
  key: user.uid,
90
- href: $options.profileUrl(user.uid),
91
104
  class: "cn-people-widget__item",
92
105
  role: "listitem"
93
106
  }, [
94
- (user.avatarUrl)
95
- ? (openBlock(), createElementBlock("img", {
96
- key: 0,
97
- src: user.avatarUrl,
98
- width: $options.avatarSize,
99
- height: $options.avatarSize,
100
- alt: "",
101
- class: "cn-people-widget__avatar"
102
- }, null, 8 /* PROPS */, _hoisted_9))
103
- : createCommentVNode("v-if", true),
104
- createElementVNode("div", _hoisted_10, [
105
- createElementVNode("strong", _hoisted_11, toDisplayString(user.displayName || user.uid), 1 /* TEXT */),
106
- ($options.layout !== 'grid' && user.role)
107
- ? (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(user.role), 1 /* TEXT */))
108
- : createCommentVNode("v-if", true),
109
- ($options.layout !== 'grid' && (user.organisation || user.department))
110
- ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(user.organisation || user.department), 1 /* TEXT */))
107
+ createElementVNode("a", {
108
+ href: $options.profileUrl(user.uid),
109
+ class: "cn-people-widget__link"
110
+ }, [
111
+ ($options.showAvatar && user.avatarUrl)
112
+ ? (openBlock(), createElementBlock("img", {
113
+ key: 0,
114
+ src: user.avatarUrl,
115
+ width: $options.avatarSize,
116
+ height: $options.avatarSize,
117
+ alt: "",
118
+ class: "cn-people-widget__avatar"
119
+ }, null, 8 /* PROPS */, _hoisted_9))
111
120
  : createCommentVNode("v-if", true),
112
- ($options.layout !== 'grid' && user.email)
113
- ? (openBlock(), createElementBlock("span", _hoisted_14, toDisplayString(user.email), 1 /* TEXT */))
114
- : createCommentVNode("v-if", true)
115
- ])
116
- ], 8 /* PROPS */, _hoisted_8))
121
+ createElementVNode("div", _hoisted_10, [
122
+ createElementVNode("strong", _hoisted_11, toDisplayString(user.displayName || user.uid), 1 /* TEXT */),
123
+ ($options.layout !== 'grid')
124
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
125
+ ($options.shows('role') && user.role)
126
+ ? (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(user.role), 1 /* TEXT */))
127
+ : createCommentVNode("v-if", true),
128
+ ($options.shows('organisation') && (user.organisation || user.department))
129
+ ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(user.organisation || user.department), 1 /* TEXT */))
130
+ : createCommentVNode("v-if", true),
131
+ ($options.shows('email') && user.email)
132
+ ? (openBlock(), createElementBlock("span", _hoisted_14, toDisplayString(user.email), 1 /* TEXT */))
133
+ : createCommentVNode("v-if", true),
134
+ ($options.shows('phone') && user.phone)
135
+ ? (openBlock(), createElementBlock("span", _hoisted_15, toDisplayString(user.phone), 1 /* TEXT */))
136
+ : createCommentVNode("v-if", true)
137
+ ], 64 /* STABLE_FRAGMENT */))
138
+ : createCommentVNode("v-if", true)
139
+ ])
140
+ ], 8 /* PROPS */, _hoisted_8),
141
+ ($options.layout !== 'grid' && $options.customFieldsOf(user).length > 0)
142
+ ? (openBlock(), createElementBlock("div", _hoisted_16, [
143
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.customFieldsOf(user), (field) => {
144
+ return (openBlock(), createElementBlock(Fragment, {
145
+ key: field.key
146
+ }, [
147
+ (field.type === 'tags')
148
+ ? (openBlock(), createElementBlock("ul", {
149
+ key: 0,
150
+ class: "cn-people-widget__tags",
151
+ "aria-label": field.label
152
+ }, [
153
+ (openBlock(true), createElementBlock(Fragment, null, renderList(field.values, (tag) => {
154
+ return (openBlock(), createElementBlock("li", { key: tag }, [
155
+ createElementVNode("button", {
156
+ type: "button",
157
+ class: normalizeClass(["cn-people-widget__tag", { 'cn-people-widget__tag--match': $options.tagMatches(tag) }]),
158
+ "aria-label": $options.t('nextcloud-vue', 'Find everyone tagged {tag}', { tag }),
159
+ onClick: $event => ($options.searchTag(tag))
160
+ }, toDisplayString(tag), 11 /* TEXT, CLASS, PROPS */, _hoisted_18)
161
+ ]))
162
+ }), 128 /* KEYED_FRAGMENT */))
163
+ ], 8 /* PROPS */, _hoisted_17))
164
+ : (openBlock(), createElementBlock("span", _hoisted_19, toDisplayString(field.label) + ": " + toDisplayString(field.values.join(', ')), 1 /* TEXT */))
165
+ ], 64 /* STABLE_FRAGMENT */))
166
+ }), 128 /* KEYED_FRAGMENT */))
167
+ ]))
168
+ : createCommentVNode("v-if", true)
169
+ ]))
117
170
  }), 128 /* KEYED_FRAGMENT */))
118
171
  ], 4 /* STYLE */)),
119
- ($data.hasMore && !$data.error)
120
- ? (openBlock(), createElementBlock("footer", _hoisted_15, [
172
+ ($options.canLoadMore && !$data.error)
173
+ ? (openBlock(), createElementBlock("footer", _hoisted_20, [
121
174
  createElementVNode("button", {
122
175
  type: "button",
123
176
  class: "cn-people-widget__load-more",
124
177
  disabled: $data.loading,
125
178
  onClick: _cache[3] || (_cache[3] = (...args) => ($options.loadMore && $options.loadMore(...args)))
126
- }, toDisplayString($data.loading ? $options.t('nextcloud-vue', 'Loading…') : $options.t('nextcloud-vue', 'Load more')), 9 /* TEXT, PROPS */, _hoisted_16)
179
+ }, toDisplayString($data.loading ? $options.t('nextcloud-vue', 'Loading…') : $options.t('nextcloud-vue', 'Load more')), 9 /* TEXT, PROPS */, _hoisted_21)
127
180
  ]))
128
181
  : createCommentVNode("v-if", true)
129
182
  ], 2 /* CLASS */))
@@ -1 +1 @@
1
- {"version":3,"file":"CnPeopleWidget3.vue.js","sources":["../../../../src/components/CnPeopleWidget/CnPeopleWidget.vue?vue&type=template&id=2cb5d787&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-people-widget\" :class=\"layoutClass\">\n\t\t<header class=\"cn-people-widget__header\">\n\t\t\t<input\n\t\t\t\tv-model=\"search\"\n\t\t\t\ttype=\"search\"\n\t\t\t\tclass=\"cn-people-widget__search\"\n\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Search by name or email')\"\n\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Search by name or email…')\">\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-people-widget__refresh\"\n\t\t\t\t:title=\"t('nextcloud-vue', 'Refresh')\"\n\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Refresh')\"\n\t\t\t\t@click=\"forceRefresh\">\n\t\t\t\t&#x21bb;\n\t\t\t</button>\n\t\t</header>\n\n\t\t<div v-if=\"loading && users.length === 0\" class=\"cn-people-widget__state\">\n\t\t\t{{ t('nextcloud-vue', 'Loading…') }}\n\t\t</div>\n\n\t\t<div v-else-if=\"error\" class=\"cn-people-widget__state cn-people-widget__state--error\">\n\t\t\t<p>{{ t('nextcloud-vue', 'Failed to load users') }}</p>\n\t\t\t<button type=\"button\" class=\"cn-people-widget__retry\" @click=\"forceRefresh\">\n\t\t\t\t{{ t('nextcloud-vue', 'Retry') }}\n\t\t\t</button>\n\t\t</div>\n\n\t\t<div v-else-if=\"!hasSource\" class=\"cn-people-widget__state\">\n\t\t\t{{ t('nextcloud-vue', 'No people directory available') }}\n\t\t</div>\n\n\t\t<div v-else-if=\"filteredUsers.length === 0\" class=\"cn-people-widget__state\">\n\t\t\t{{ search ? t('nextcloud-vue', 'No users match your search') : t('nextcloud-vue', 'No people to show') }}\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else\n\t\t\tclass=\"cn-people-widget__items\"\n\t\t\t:style=\"gridStyle\"\n\t\t\trole=\"list\">\n\t\t\t<a\n\t\t\t\tv-for=\"user in filteredUsers\"\n\t\t\t\t:key=\"user.uid\"\n\t\t\t\t:href=\"profileUrl(user.uid)\"\n\t\t\t\tclass=\"cn-people-widget__item\"\n\t\t\t\trole=\"listitem\">\n\t\t\t\t<img\n\t\t\t\t\tv-if=\"user.avatarUrl\"\n\t\t\t\t\t:src=\"user.avatarUrl\"\n\t\t\t\t\t:width=\"avatarSize\"\n\t\t\t\t\t:height=\"avatarSize\"\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tclass=\"cn-people-widget__avatar\">\n\t\t\t\t<div class=\"cn-people-widget__meta\">\n\t\t\t\t\t<strong class=\"cn-people-widget__name\">{{ user.displayName || user.uid }}</strong>\n\t\t\t\t\t<span v-if=\"layout !== 'grid' && user.role\" class=\"cn-people-widget__sub\">{{ user.role }}</span>\n\t\t\t\t\t<span v-if=\"layout !== 'grid' && (user.organisation || user.department)\" class=\"cn-people-widget__sub\">\n\t\t\t\t\t\t{{ user.organisation || user.department }}\n\t\t\t\t\t</span>\n\t\t\t\t\t<span v-if=\"layout !== 'grid' && user.email\" class=\"cn-people-widget__sub\">{{ user.email }}</span>\n\t\t\t\t</div>\n\t\t\t</a>\n\t\t</div>\n\n\t\t<footer v-if=\"hasMore && !error\" class=\"cn-people-widget__footer\">\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-people-widget__load-more\"\n\t\t\t\t:disabled=\"loading\"\n\t\t\t\t@click=\"loadMore\">\n\t\t\t\t{{ loading ? t('nextcloud-vue', 'Loading…') : t('nextcloud-vue', 'Load more') }}\n\t\t\t</button>\n\t\t</footer>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\n\nconst ALLOWED_LAYOUTS = ['card', 'grid', 'list']\nconst DEFAULT_LAYOUT = 'grid'\nconst PAGE_SIZE = 50\n\n/**\n * CnPeopleWidget — renders a paginated, group-filterable user directory in one\n * of three layout modes (`card`, `grid`, `list`).\n *\n * Data origin (decoupling seam): the people directory is read through a\n * consumer-supplied `dataSource` prop OR the `cnPeopleSource` injection — an\n * object exposing `fetchPeople({ offset, limit, filters, excludeDisabled,\n * sortBy }) => Promise<{ users, total, hasMore }>`. The canonical backing is a\n * Nextcloud user-provisioning / Contacts source surfaced by the consuming app;\n * this renderer never imports a sibling-app module path nor assumes a backend\n * route. When neither prop nor injection is supplied the widget degrades to an\n * empty state (\"No people directory available\") and performs no request.\n *\n * Search is a client-side substring filter on the loaded page (name + email).\n * Pagination is offset-based: each \"Load more\" appends one {@link PAGE_SIZE}\n * page. A single failed fetch surfaces a retryable error state rather than\n * throwing.\n *\n * @spec openspec/changes/cn-widget-library/specs/cn-widget-library/spec.md\n */\nexport default {\n\tname: 'CnPeopleWidget',\n\n\tinject: {\n\t\tcnPeopleSource: {\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Persisted widget content `{layout, filters, excludeDisabled,\n\t\t * sortBy, columns}`.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * Consumer-supplied data source overriding the `cnPeopleSource`\n\t\t * injection. Must expose `fetchPeople(args) => Promise<{users, total,\n\t\t * hasMore}>`. When `null` the injection (then the empty state) is used.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tdataSource: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tusers: [],\n\t\t\ttotal: 0,\n\t\t\thasMore: false,\n\t\t\tloading: false,\n\t\t\terror: null,\n\t\t\tsearch: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The active data source (prop wins over injection).\n\t\t *\n\t\t * @return {object|null} the resolved source, or `null`.\n\t\t */\n\t\tsource() {\n\t\t\tconst candidate = this.dataSource || this.cnPeopleSource\n\t\t\treturn candidate && typeof candidate.fetchPeople === 'function' ? candidate : null\n\t\t},\n\n\t\t/**\n\t\t * Whether a usable people source is configured.\n\t\t *\n\t\t * @return {boolean} true when a source exists.\n\t\t */\n\t\thasSource() {\n\t\t\treturn this.source !== null\n\t\t},\n\n\t\t/**\n\t\t * The validated layout mode (defaults to `grid`).\n\t\t *\n\t\t * @return {string} one of card/grid/list.\n\t\t */\n\t\tlayout() {\n\t\t\tconst value = this.content && this.content.layout\n\t\t\treturn ALLOWED_LAYOUTS.includes(value) ? value : DEFAULT_LAYOUT\n\t\t},\n\n\t\t/**\n\t\t * The layout CSS modifier class.\n\t\t *\n\t\t * @return {string} the layout class.\n\t\t */\n\t\tlayoutClass() {\n\t\t\treturn `cn-people-widget--${this.layout}`\n\t\t},\n\n\t\t/**\n\t\t * The validated grid column count.\n\t\t *\n\t\t * @return {number} the column count.\n\t\t */\n\t\tcolumns() {\n\t\t\tconst raw = this.content && this.content.columns\n\t\t\tif (typeof raw === 'number' && [2, 3, 4].includes(raw)) {\n\t\t\t\treturn raw\n\t\t\t}\n\t\t\treturn this.layout === 'grid' ? 4 : 3\n\t\t},\n\n\t\t/**\n\t\t * The inline grid style (no columns in list mode).\n\t\t *\n\t\t * @return {object} the style object.\n\t\t */\n\t\tgridStyle() {\n\t\t\tif (this.layout === 'list') {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\treturn { 'grid-template-columns': `repeat(${this.columns}, minmax(0, 1fr))` }\n\t\t},\n\n\t\t/**\n\t\t * The avatar pixel size for the current layout.\n\t\t *\n\t\t * @return {number} the avatar size.\n\t\t */\n\t\tavatarSize() {\n\t\t\tif (this.layout === 'card') {\n\t\t\t\treturn 80\n\t\t\t}\n\t\t\tif (this.layout === 'list') {\n\t\t\t\treturn 44\n\t\t\t}\n\t\t\treturn 64\n\t\t},\n\n\t\t/**\n\t\t * The client-side search filter result.\n\t\t *\n\t\t * @return {object[]} the filtered users.\n\t\t */\n\t\tfilteredUsers() {\n\t\t\tif (!this.search) {\n\t\t\t\treturn this.users\n\t\t\t}\n\t\t\tconst needle = this.search.toLowerCase()\n\t\t\treturn this.users.filter((user) => {\n\t\t\t\tconst name = (user.displayName || '').toLowerCase()\n\t\t\t\tconst email = (user.email || '').toLowerCase()\n\t\t\t\treturn name.includes(needle) || email.includes(needle)\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The fetch arguments derived from content (drives the reload watch).\n\t\t *\n\t\t * @return {object} the fetch argument shape.\n\t\t */\n\t\tfetchArgs() {\n\t\t\tconst filters = Array.isArray(this.content && this.content.filters) ? this.content.filters : []\n\t\t\treturn {\n\t\t\t\tfilters,\n\t\t\t\texcludeDisabled: !(this.content && this.content.excludeDisabled === false),\n\t\t\t\tsortBy: (this.content && this.content.sortBy) || 'displayName',\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tfetchArgs: {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.forceRefresh()\n\t\t\t},\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.fetchPage(0)\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Build a profile link for a uid.\n\t\t *\n\t\t * @param {string} uid the user id.\n\t\t * @return {string} the profile URL.\n\t\t */\n\t\tprofileUrl(uid) {\n\t\t\treturn `/u/${encodeURIComponent(uid)}`\n\t\t},\n\n\t\t/**\n\t\t * Append the next page of users.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadMore() {\n\t\t\tif (this.loading || !this.hasMore) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait this.fetchPage(this.users.length)\n\t\t},\n\n\t\t/**\n\t\t * Clear the loaded set and refetch from the first page.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tforceRefresh() {\n\t\t\tthis.users = []\n\t\t\tthis.total = 0\n\t\t\tthis.hasMore = false\n\t\t\tthis.fetchPage(0)\n\t\t},\n\n\t\t/**\n\t\t * Fetch one page from the configured source. A missing source or a\n\t\t * fetch failure degrades to the empty / error state without throwing.\n\t\t *\n\t\t * @param {number} offset the page offset.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchPage(offset) {\n\t\t\tif (!this.source) {\n\t\t\t\tthis.users = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tthis.error = null\n\t\t\ttry {\n\t\t\t\tconst data = await this.source.fetchPeople({\n\t\t\t\t\toffset,\n\t\t\t\t\tlimit: PAGE_SIZE,\n\t\t\t\t\t...this.fetchArgs,\n\t\t\t\t}) || {}\n\t\t\t\tconst incoming = Array.isArray(data.users) ? data.users : []\n\t\t\t\tthis.users = offset === 0 ? incoming : this.users.concat(incoming)\n\t\t\t\tthis.total = typeof data.total === 'number' ? data.total : this.users.length\n\t\t\t\tthis.hasMore = data.hasMore === true\n\t\t\t} catch (err) {\n\t\t\t\tthis.error = err\n\t\t\t\tif (offset === 0) {\n\t\t\t\t\tthis.users = []\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-people-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tgap: 8px;\n\tpadding: 8px;\n\toverflow: hidden;\n}\n\n.cn-people-widget__header {\n\tdisplay: flex;\n\tgap: 6px;\n\talign-items: center;\n\tflex: 0 0 auto;\n}\n\n.cn-people-widget__search {\n\tflex: 1 1 auto;\n\tpadding: 4px 8px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n}\n\n.cn-people-widget__refresh,\n.cn-people-widget__retry,\n.cn-people-widget__load-more {\n\tborder: 1px solid var(--color-border);\n\tbackground: var(--color-background-hover);\n\tborder-radius: var(--border-radius);\n\tpadding: 2px 8px;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--color-main-text);\n}\n\n.cn-people-widget__items {\n\tflex: 1 1 auto;\n\toverflow-y: auto;\n\tdisplay: grid;\n\tgap: 8px;\n}\n\n.cn-people-widget--list .cn-people-widget__items {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.cn-people-widget__item {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: center;\n\tpadding: 6px;\n\tborder-radius: var(--border-radius);\n\tcolor: var(--color-main-text);\n\ttext-decoration: none;\n\tborder: 1px solid transparent;\n}\n\n.cn-people-widget--card .cn-people-widget__item,\n.cn-people-widget--grid .cn-people-widget__item {\n\tflex-direction: column;\n\ttext-align: center;\n}\n\n.cn-people-widget--card .cn-people-widget__item {\n\tborder: 1px solid var(--color-border);\n\tbackground: var(--color-main-background);\n\tmin-height: 200px;\n}\n\n.cn-people-widget__item:hover {\n\tbackground: var(--color-background-hover);\n\tborder-color: var(--color-border);\n}\n\n.cn-people-widget__avatar {\n\tborder-radius: 50%;\n\tobject-fit: cover;\n\tbackground: var(--color-background-darker);\n}\n\n.cn-people-widget__meta {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-people-widget__name {\n\tfont-weight: 600;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tmax-width: 100%;\n}\n\n.cn-people-widget__sub {\n\tfont-size: 12px;\n\tcolor: var(--color-text-maxcontrast);\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-people-widget__state {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 8px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tpadding: 16px;\n\ttext-align: center;\n}\n\n.cn-people-widget__footer {\n\tflex: 0 0 auto;\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding-top: 4px;\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","_createElementVNode","_toDisplayString","_openBlock","_Fragment","_renderList"],"mappings":";;AAYU,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,0BAA0B;;;;;AAiBE,EAAA,KAAK,EAAC;;;;AAI3C,EAAA,KAAA,EAAA;;;;AAOuB,EAAA,KAAK,EAAC;;;;AAI5B,EAAA,KAAA,EAAA;;;;AAsBC,MAAA,WAAA,GAAA,EAAA,KAAE,EAAA,wBAAA;AACE,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC,wBAAwB;;;AAClC,EAAA,KAAA,EAAA;;;;AACH,EAAA,KAAA,EAAA;;;;AAG4C,EAAA,KAAK,EAAC;;;;AAKnC,EAAA,KAAA,EAAA;;;;;uBAlEjBA,kBAAA;IAAE,KAAK,EAAAC,cAAA,CAAA,CAAC,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EAAAG,eAAA,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,CAAA,YAAA;;AACH,sBAAA,CAAA,QAAA,CAAA,MAAA,gBAAA,IAAA,CAAA,YAAA,IAAA,IAAA,CAAA,UAAA,CAAA;wCAADH,kBAAA,SAAA,6BACE,IAAA,CAAA,YAAA,IAAA,IAAA,CAAA,UAAA,CAAA,EAAA,CAAA,YAAA;;uBAEU,QAAA,CAAA,MAAK,KAAA,MAAA,IAAgB,IAAI,CAAC,KAAK;AAA3C,2BAAAI,SAAA,EAAA,EAAAJ,kBAAA,CAA8D,MAAA,EAA9D,WAA8D,EAAAG,eAAA,CAAA,IAAA,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;;;;;;AAKnD,IAAA,CAAA,KAAA,CAAA,OAAK,KAAA,KAAA,CAAA,KAAA;AAAjB,SAAAC,SAAA,EAAA,EAAAJ,kBAAA,WAAA;UACAE,kBAAA;AACA,YAAA,IAAI,EAAC,QAAE;AACP,YAAA,KAAK,EAAC,6BAAA;AACL,YAAA,QAAC,EAAA,KAAA,CAAA,OAAA;;;;;;;;"}
1
+ {"version":3,"file":"CnPeopleWidget3.vue.js","sources":["../../../../src/components/CnPeopleWidget/CnPeopleWidget.vue?vue&type=template&id=60b9b1b1&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-people-widget\" :class=\"layoutClass\">\n\t\t<header class=\"cn-people-widget__header\">\n\t\t\t<input\n\t\t\t\tv-model=\"search\"\n\t\t\t\ttype=\"search\"\n\t\t\t\tclass=\"cn-people-widget__search\"\n\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Search by name or email')\"\n\t\t\t\t:placeholder=\"searchPlaceholder\">\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-people-widget__refresh\"\n\t\t\t\t:title=\"t('nextcloud-vue', 'Refresh')\"\n\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Refresh')\"\n\t\t\t\t@click=\"forceRefresh\">\n\t\t\t\t&#x21bb;\n\t\t\t</button>\n\t\t</header>\n\n\t\t<div v-if=\"(loading || searchPending) && displayedUsers.length === 0\" class=\"cn-people-widget__state\">\n\t\t\t{{ t('nextcloud-vue', 'Loading…') }}\n\t\t</div>\n\n\t\t<div v-else-if=\"error\" class=\"cn-people-widget__state cn-people-widget__state--error\">\n\t\t\t<p>{{ t('nextcloud-vue', 'Failed to load users') }}</p>\n\t\t\t<button type=\"button\" class=\"cn-people-widget__retry\" @click=\"forceRefresh\">\n\t\t\t\t{{ t('nextcloud-vue', 'Retry') }}\n\t\t\t</button>\n\t\t</div>\n\n\t\t<div v-else-if=\"!hasSource\" class=\"cn-people-widget__state\">\n\t\t\t{{ t('nextcloud-vue', 'No people directory available') }}\n\t\t</div>\n\n\t\t<div v-else-if=\"displayedUsers.length === 0\" class=\"cn-people-widget__state\">\n\t\t\t{{ search.trim() ? t('nextcloud-vue', 'No users match your search') : t('nextcloud-vue', 'No matching users.') }}\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else\n\t\t\tclass=\"cn-people-widget__items\"\n\t\t\t:style=\"gridStyle\"\n\t\t\trole=\"list\">\n\t\t\t<div\n\t\t\t\tv-for=\"user in displayedUsers\"\n\t\t\t\t:key=\"user.uid\"\n\t\t\t\tclass=\"cn-people-widget__item\"\n\t\t\t\trole=\"listitem\">\n\t\t\t\t<a :href=\"profileUrl(user.uid)\" class=\"cn-people-widget__link\">\n\t\t\t\t\t<img\n\t\t\t\t\t\tv-if=\"showAvatar && user.avatarUrl\"\n\t\t\t\t\t\t:src=\"user.avatarUrl\"\n\t\t\t\t\t\t:width=\"avatarSize\"\n\t\t\t\t\t\t:height=\"avatarSize\"\n\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\tclass=\"cn-people-widget__avatar\">\n\t\t\t\t\t<div class=\"cn-people-widget__meta\">\n\t\t\t\t\t\t<strong class=\"cn-people-widget__name\">{{ user.displayName || user.uid }}</strong>\n\t\t\t\t\t\t<template v-if=\"layout !== 'grid'\">\n\t\t\t\t\t\t\t<span v-if=\"shows('role') && user.role\" class=\"cn-people-widget__sub\">{{ user.role }}</span>\n\t\t\t\t\t\t\t<span v-if=\"shows('organisation') && (user.organisation || user.department)\" class=\"cn-people-widget__sub\">\n\t\t\t\t\t\t\t\t{{ user.organisation || user.department }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span v-if=\"shows('email') && user.email\" class=\"cn-people-widget__sub\">{{ user.email }}</span>\n\t\t\t\t\t\t\t<span v-if=\"shows('phone') && user.phone\" class=\"cn-people-widget__sub\">{{ user.phone }}</span>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t\t<div v-if=\"layout !== 'grid' && customFieldsOf(user).length > 0\" class=\"cn-people-widget__fields\">\n\t\t\t\t\t<template v-for=\"field in customFieldsOf(user)\" :key=\"field.key\">\n\t\t\t\t\t\t<ul\n\t\t\t\t\t\t\tv-if=\"field.type === 'tags'\"\n\t\t\t\t\t\t\tclass=\"cn-people-widget__tags\"\n\t\t\t\t\t\t\t:aria-label=\"field.label\">\n\t\t\t\t\t\t\t<li v-for=\"tag in field.values\" :key=\"tag\">\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-people-widget__tag\"\n\t\t\t\t\t\t\t\t\t:class=\"{ 'cn-people-widget__tag--match': tagMatches(tag) }\"\n\t\t\t\t\t\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Find everyone tagged {tag}', { tag })\"\n\t\t\t\t\t\t\t\t\t@click=\"searchTag(tag)\">\n\t\t\t\t\t\t\t\t\t{{ tag }}\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<span v-else class=\"cn-people-widget__sub cn-people-widget__field\">\n\t\t\t\t\t\t\t{{ field.label }}: {{ field.values.join(', ') }}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</template>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<footer v-if=\"canLoadMore && !error\" class=\"cn-people-widget__footer\">\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-people-widget__load-more\"\n\t\t\t\t:disabled=\"loading\"\n\t\t\t\t@click=\"loadMore\">\n\t\t\t\t{{ loading ? t('nextcloud-vue', 'Loading…') : t('nextcloud-vue', 'Load more') }}\n\t\t\t</button>\n\t\t</footer>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { clearPeoplePages, readPeoplePage, storePeoplePage } from './peopleCache.js'\n\nconst ALLOWED_LAYOUTS = ['card', 'grid', 'list']\nconst DEFAULT_LAYOUT = 'grid'\nconst PAGE_SIZE = 50\nconst MIN_SERVER_QUERY = 2\nconst SEARCH_DEBOUNCE_MS = 300\n\n/**\n * CnPeopleWidget — renders a paginated, group-filterable user directory in one\n * of three layout modes (`card`, `grid`, `list`).\n *\n * Data origin (decoupling seam): the people directory is read through a\n * consumer-supplied `dataSource` prop OR the `cnPeopleSource` injection — an\n * object exposing `fetchPeople({ offset, limit, filters, excludeDisabled,\n * sortBy, showBirthdays }) => Promise<{ users, total, hasMore }>` and,\n * optionally, `searchPeople({ q, ...same }) => Promise<{ users, total,\n * hasMore }>` for a directory-wide search. When neither prop nor injection is\n * supplied the widget degrades to an empty state (\"No people directory\n * available\") and performs no request.\n *\n * Search: with a `searchPeople` source, a query of {@link MIN_SERVER_QUERY} or\n * more characters is asked of the source (debounced, never cached, a late\n * answer to an older query is dropped); shorter queries, and sources without\n * `searchPeople`, filter the loaded page on name and email. A tag on a card is\n * a button that searches for it; tags matching the query are highlighted.\n *\n * Fields: `content.showFields` picks the role, organisation, email and phone\n * lines on card and list layouts. When it is an object, only the keys set to\n * `true` show; the avatar and each custom profile field (`user.customFields`,\n * `[{key, label, type: 'text'|'tags', values}]`) show unless their key is\n * explicitly `false`. The grid layout shows avatar and name only.\n *\n * Pages are cached in memory for 60 seconds per argument set, across\n * remounts; Refresh drops the cache and fetches again. Pagination is\n * offset-based: each \"Load more\" appends one {@link PAGE_SIZE} page. A failed\n * fetch surfaces a retryable error state rather than throwing.\n *\n * @spec openspec/changes/cn-widget-library/specs/cn-widget-library/spec.md\n */\nexport default {\n\tname: 'CnPeopleWidget',\n\n\tinject: {\n\t\tcnPeopleSource: {\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Persisted widget content `{layout, filters, excludeDisabled,\n\t\t * showBirthdays, sortBy, columns, showFields}`.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * Consumer-supplied data source overriding the `cnPeopleSource`\n\t\t * injection. Must expose `fetchPeople(args)` and may expose\n\t\t * `searchPeople(args)`. When `null` the injection (then the empty\n\t\t * state) is used.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tdataSource: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tusers: [],\n\t\t\ttotal: 0,\n\t\t\thasMore: false,\n\t\t\tloading: false,\n\t\t\terror: null,\n\t\t\tsearch: '',\n\t\t\tsearchResults: [],\n\t\t\tsearchHasMore: false,\n\t\t\tsearchPending: false,\n\t\t\tsearchTimer: null,\n\t\t\tsearchSeq: 0,\n\t\t\tpageSeq: 0,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The active data source (prop wins over injection).\n\t\t *\n\t\t * @return {object|null} the resolved source, or `null`.\n\t\t */\n\t\tsource() {\n\t\t\tconst candidate = this.dataSource || this.cnPeopleSource\n\t\t\treturn candidate && typeof candidate.fetchPeople === 'function' ? candidate : null\n\t\t},\n\n\t\t/**\n\t\t * Whether a usable people source is configured.\n\t\t *\n\t\t * @return {boolean} true when a source exists.\n\t\t */\n\t\thasSource() {\n\t\t\treturn this.source !== null\n\t\t},\n\n\t\t/**\n\t\t * Whether the source can search the whole directory.\n\t\t *\n\t\t * @return {boolean} true when it exposes `searchPeople`.\n\t\t */\n\t\tcanSearchServer() {\n\t\t\treturn this.source !== null && typeof this.source.searchPeople === 'function'\n\t\t},\n\n\t\t/**\n\t\t * The search box placeholder.\n\t\t *\n\t\t * @return {string} the localised placeholder.\n\t\t */\n\t\tsearchPlaceholder() {\n\t\t\treturn this.canSearchServer\n\t\t\t\t? t('nextcloud-vue', 'Search by name, email or expertise…')\n\t\t\t\t: t('nextcloud-vue', 'Search by name or email…')\n\t\t},\n\n\t\t/**\n\t\t * The validated layout mode (defaults to `grid`).\n\t\t *\n\t\t * @return {string} one of card/grid/list.\n\t\t */\n\t\tlayout() {\n\t\t\tconst value = this.content && this.content.layout\n\t\t\treturn ALLOWED_LAYOUTS.includes(value) ? value : DEFAULT_LAYOUT\n\t\t},\n\n\t\t/**\n\t\t * The layout CSS modifier class.\n\t\t *\n\t\t * @return {string} the layout class.\n\t\t */\n\t\tlayoutClass() {\n\t\t\treturn `cn-people-widget--${this.layout}`\n\t\t},\n\n\t\t/**\n\t\t * The validated grid column count.\n\t\t *\n\t\t * @return {number} the column count.\n\t\t */\n\t\tcolumns() {\n\t\t\tconst raw = this.content && this.content.columns\n\t\t\tif (typeof raw === 'number' && [2, 3, 4].includes(raw)) {\n\t\t\t\treturn raw\n\t\t\t}\n\t\t\treturn this.layout === 'grid' ? 4 : 3\n\t\t},\n\n\t\t/**\n\t\t * The inline grid style (no columns in list mode).\n\t\t *\n\t\t * @return {object} the style object.\n\t\t */\n\t\tgridStyle() {\n\t\t\tif (this.layout === 'list') {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\treturn { 'grid-template-columns': `repeat(${this.columns}, minmax(0, 1fr))` }\n\t\t},\n\n\t\t/**\n\t\t * The avatar pixel size for the current layout.\n\t\t *\n\t\t * @return {number} the avatar size.\n\t\t */\n\t\tavatarSize() {\n\t\t\tif (this.layout === 'card') {\n\t\t\t\treturn 80\n\t\t\t}\n\t\t\tif (this.layout === 'list') {\n\t\t\t\treturn 44\n\t\t\t}\n\t\t\treturn 64\n\t\t},\n\n\t\t/**\n\t\t * The `showFields` map when one is configured, else `null` (show all).\n\t\t *\n\t\t * @return {object|null} the field map.\n\t\t */\n\t\tshowFields() {\n\t\t\tconst value = this.content && this.content.showFields\n\t\t\treturn value && typeof value === 'object' && !Array.isArray(value) ? value : null\n\t\t},\n\n\t\t/**\n\t\t * Whether avatars show (unless `showFields.avatar` is `false`).\n\t\t *\n\t\t * @return {boolean} true when avatars show.\n\t\t */\n\t\tshowAvatar() {\n\t\t\treturn !(this.showFields && this.showFields.avatar === false)\n\t\t},\n\n\t\t/**\n\t\t * The trimmed query when it goes to the source, else ''.\n\t\t *\n\t\t * @return {string} the server query.\n\t\t */\n\t\tserverQuery() {\n\t\t\tif (!this.canSearchServer) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst query = (this.search || '').trim()\n\t\t\treturn query.length >= MIN_SERVER_QUERY ? query : ''\n\t\t},\n\n\t\t/**\n\t\t * The users to show: server results for a server query, else the\n\t\t * loaded pages filtered on name and email.\n\t\t *\n\t\t * @return {object[]} the users.\n\t\t */\n\t\tdisplayedUsers() {\n\t\t\tif (this.serverQuery) {\n\t\t\t\treturn this.searchResults\n\t\t\t}\n\t\t\tif (!this.search) {\n\t\t\t\treturn this.users\n\t\t\t}\n\t\t\tconst needle = this.search.toLowerCase()\n\t\t\treturn this.users.filter((user) => {\n\t\t\t\tconst name = (user.displayName || '').toLowerCase()\n\t\t\t\tconst email = (user.email || '').toLowerCase()\n\t\t\t\treturn name.includes(needle) || email.includes(needle)\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Whether another page can be appended.\n\t\t *\n\t\t * @return {boolean} true when Load more applies.\n\t\t */\n\t\tcanLoadMore() {\n\t\t\treturn this.serverQuery ? this.searchHasMore : this.hasMore\n\t\t},\n\n\t\t/**\n\t\t * The fetch arguments derived from content (drives the reload watch).\n\t\t *\n\t\t * @return {object} the fetch argument shape.\n\t\t */\n\t\tfetchArgs() {\n\t\t\tconst filters = Array.isArray(this.content && this.content.filters) ? this.content.filters : []\n\t\t\treturn {\n\t\t\t\tfilters,\n\t\t\t\texcludeDisabled: !(this.content && this.content.excludeDisabled === false),\n\t\t\t\tshowBirthdays: !(this.content && this.content.showBirthdays === false),\n\t\t\t\tsortBy: (this.content && this.content.sortBy) || 'displayName',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The cache key of the current argument set.\n\t\t *\n\t\t * @return {string} the serialised arguments.\n\t\t */\n\t\tcacheKey() {\n\t\t\treturn JSON.stringify({ ...this.fetchArgs, limit: PAGE_SIZE })\n\t\t},\n\t},\n\n\twatch: {\n\t\tfetchArgs: {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.resetPages()\n\t\t\t\tthis.fetchPage(0)\n\t\t\t\tif (this.serverQuery) {\n\t\t\t\t\tthis.fetchSearch(0)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\n\t\tserverQuery(query) {\n\t\t\tclearTimeout(this.searchTimer)\n\t\t\tthis.searchSeq++\n\t\t\tthis.searchResults = []\n\t\t\tthis.searchHasMore = false\n\t\t\tthis.searchPending = query !== ''\n\t\t\tif (query) {\n\t\t\t\tthis.searchTimer = setTimeout(() => this.fetchSearch(0), SEARCH_DEBOUNCE_MS)\n\t\t\t}\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.fetchPage(0)\n\t},\n\n\tbeforeUnmount() {\n\t\tclearTimeout(this.searchTimer)\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Build a profile link for a uid.\n\t\t *\n\t\t * @param {string} uid the user id.\n\t\t * @return {string} the profile URL.\n\t\t */\n\t\tprofileUrl(uid) {\n\t\t\treturn `/u/${encodeURIComponent(uid)}`\n\t\t},\n\n\t\t/**\n\t\t * Whether a standard field line shows under `showFields`.\n\t\t *\n\t\t * @param {string} field the field name.\n\t\t * @return {boolean} true when it shows.\n\t\t */\n\t\tshows(field) {\n\t\t\treturn this.showFields === null || this.showFields[field] === true\n\t\t},\n\n\t\t/**\n\t\t * The custom profile fields of a user that have values and are not\n\t\t * switched off in `showFields`.\n\t\t *\n\t\t * @param {object} user the user record.\n\t\t * @return {object[]} the fields.\n\t\t */\n\t\tcustomFieldsOf(user) {\n\t\t\tif (!Array.isArray(user.customFields)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn user.customFields.filter((field) => field\n\t\t\t\t&& Array.isArray(field.values)\n\t\t\t\t&& field.values.length > 0\n\t\t\t\t&& !(this.showFields && this.showFields[field.key] === false))\n\t\t},\n\n\t\t/**\n\t\t * Whether a tag holds the current query, for highlighting.\n\t\t *\n\t\t * @param {string} tag the tag.\n\t\t * @return {boolean} true when it matches.\n\t\t */\n\t\ttagMatches(tag) {\n\t\t\tconst query = (this.search || '').trim().toLowerCase()\n\t\t\treturn query.length >= MIN_SERVER_QUERY && String(tag).toLowerCase().includes(query)\n\t\t},\n\n\t\t/**\n\t\t * Search for everyone with this tag.\n\t\t *\n\t\t * @param {string} tag the tag.\n\t\t * @return {void}\n\t\t */\n\t\tsearchTag(tag) {\n\t\t\tthis.search = String(tag)\n\t\t},\n\n\t\t/**\n\t\t * Append the next page of users or search results.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadMore() {\n\t\t\tif (this.loading || !this.canLoadMore) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.serverQuery) {\n\t\t\t\tawait this.fetchSearch(this.searchResults.length)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait this.fetchPage(this.users.length)\n\t\t},\n\n\t\t/**\n\t\t * Forget the loaded pages (not the cache).\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tresetPages() {\n\t\t\tthis.users = []\n\t\t\tthis.total = 0\n\t\t\tthis.hasMore = false\n\t\t},\n\n\t\t/**\n\t\t * Drop the cache and refetch from the first page.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tforceRefresh() {\n\t\t\tclearPeoplePages(this.cacheKey)\n\t\t\tthis.resetPages()\n\t\t\tthis.fetchPage(0)\n\t\t\tif (this.serverQuery) {\n\t\t\t\tthis.fetchSearch(0)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Fetch one page from the configured source, or take it from the\n\t\t * cache while fresh. A missing source or a fetch failure degrades to\n\t\t * the empty / error state without throwing.\n\t\t *\n\t\t * @param {number} offset the page offset.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchPage(offset) {\n\t\t\tif (!this.source) {\n\t\t\t\tthis.users = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst cacheKey = this.cacheKey\n\t\t\tconst cached = readPeoplePage(cacheKey, offset)\n\t\t\tif (cached) {\n\t\t\t\tthis.applyPage(cached, offset)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst seq = ++this.pageSeq\n\t\t\tthis.loading = true\n\t\t\tthis.error = null\n\t\t\ttry {\n\t\t\t\tconst data = await this.source.fetchPeople({\n\t\t\t\t\toffset,\n\t\t\t\t\tlimit: PAGE_SIZE,\n\t\t\t\t\t...this.fetchArgs,\n\t\t\t\t}) || {}\n\t\t\t\tif (seq !== this.pageSeq) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst page = {\n\t\t\t\t\tusers: Array.isArray(data.users) ? data.users : [],\n\t\t\t\t\ttotal: data.total,\n\t\t\t\t\thasMore: data.hasMore === true,\n\t\t\t\t}\n\t\t\t\tstorePeoplePage(cacheKey, offset, page)\n\t\t\t\tthis.applyPage(page, offset)\n\t\t\t} catch (err) {\n\t\t\t\tif (seq !== this.pageSeq) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.error = err\n\t\t\t\tif (offset === 0) {\n\t\t\t\t\tthis.users = []\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (seq === this.pageSeq) {\n\t\t\t\t\tthis.loading = false\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Put a fetched or cached page into the loaded set.\n\t\t *\n\t\t * @param {object} page the `{users, total, hasMore}` page.\n\t\t * @param {number} offset the page offset.\n\t\t * @return {void}\n\t\t */\n\t\tapplyPage(page, offset) {\n\t\t\tthis.error = null\n\t\t\tthis.users = offset === 0 ? page.users : this.users.concat(page.users)\n\t\t\tthis.total = typeof page.total === 'number' ? page.total : this.users.length\n\t\t\tthis.hasMore = page.hasMore\n\t\t},\n\n\t\t/**\n\t\t * Fetch one page of directory-wide search results. Never cached; a late\n\t\t * answer to an older query is dropped.\n\t\t *\n\t\t * @param {number} offset the index of the first match.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchSearch(offset) {\n\t\t\tconst query = this.serverQuery\n\t\t\tif (!query) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst seq = ++this.searchSeq\n\t\t\tthis.loading = true\n\t\t\tthis.error = null\n\t\t\ttry {\n\t\t\t\tconst data = await this.source.searchPeople({\n\t\t\t\t\tq: query,\n\t\t\t\t\toffset,\n\t\t\t\t\tlimit: PAGE_SIZE,\n\t\t\t\t\t...this.fetchArgs,\n\t\t\t\t}) || {}\n\t\t\t\tif (seq !== this.searchSeq) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst incoming = Array.isArray(data.users) ? data.users : []\n\t\t\t\tthis.searchResults = offset === 0 ? incoming : this.searchResults.concat(incoming)\n\t\t\t\tthis.searchHasMore = data.hasMore === true\n\t\t\t} catch (err) {\n\t\t\t\tif (seq === this.searchSeq) {\n\t\t\t\t\tthis.error = err\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (seq === this.searchSeq) {\n\t\t\t\t\tthis.loading = false\n\t\t\t\t\tthis.searchPending = false\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-people-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tgap: 8px;\n\tpadding: 8px;\n\toverflow: hidden;\n}\n\n.cn-people-widget__header {\n\tdisplay: flex;\n\tgap: 6px;\n\talign-items: center;\n\tflex: 0 0 auto;\n}\n\n.cn-people-widget__search {\n\tflex: 1 1 auto;\n\tpadding: 4px 8px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n}\n\n.cn-people-widget__refresh,\n.cn-people-widget__retry,\n.cn-people-widget__load-more {\n\tborder: 1px solid var(--color-border);\n\tbackground: var(--color-background-hover);\n\tborder-radius: var(--border-radius);\n\tpadding: 2px 8px;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--color-main-text);\n}\n\n.cn-people-widget__items {\n\tflex: 1 1 auto;\n\toverflow-y: auto;\n\tdisplay: grid;\n\tgap: 8px;\n}\n\n.cn-people-widget--list .cn-people-widget__items {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.cn-people-widget__item {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding: 6px;\n\tborder-radius: var(--border-radius);\n\tborder: 1px solid transparent;\n}\n\n.cn-people-widget--list .cn-people-widget__item {\n\tflex-direction: row;\n\tflex-wrap: wrap;\n\talign-items: center;\n}\n\n.cn-people-widget__link {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: center;\n\tmin-width: 0;\n\tcolor: var(--color-main-text);\n\ttext-decoration: none;\n}\n\n.cn-people-widget--list .cn-people-widget__link {\n\tflex: 1 1 auto;\n}\n\n.cn-people-widget--card .cn-people-widget__link,\n.cn-people-widget--grid .cn-people-widget__link {\n\tflex-direction: column;\n\ttext-align: center;\n}\n\n.cn-people-widget__fields {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tmin-width: 0;\n}\n\n.cn-people-widget--card .cn-people-widget__fields {\n\talign-items: center;\n\ttext-align: center;\n}\n\n.cn-people-widget__tags {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-people-widget--card .cn-people-widget__tags {\n\tjustify-content: center;\n}\n\n.cn-people-widget__tag {\n\tpadding: 0 8px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-pill, 999px);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tfont-size: 12px;\n\tline-height: 20px;\n\tcursor: pointer;\n}\n\n.cn-people-widget__tag:hover,\n.cn-people-widget__tag:focus-visible {\n\tbackground: var(--color-background-hover);\n}\n\n.cn-people-widget__tag--match {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text, var(--color-main-text));\n\tfont-weight: 600;\n}\n\n.cn-people-widget--card .cn-people-widget__item {\n\tborder: 1px solid var(--color-border);\n\tbackground: var(--color-main-background);\n\tmin-height: 200px;\n}\n\n.cn-people-widget__item:hover,\n.cn-people-widget__item:focus-within {\n\tbackground: var(--color-background-hover);\n\tborder-color: var(--color-border);\n}\n\n.cn-people-widget__avatar {\n\tborder-radius: 50%;\n\tobject-fit: cover;\n\tbackground: var(--color-background-darker);\n}\n\n.cn-people-widget__meta {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-people-widget__name {\n\tfont-weight: 600;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tmax-width: 100%;\n}\n\n.cn-people-widget__sub {\n\tfont-size: 12px;\n\tcolor: var(--color-text-maxcontrast);\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-people-widget__state {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 8px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tpadding: 16px;\n\ttext-align: center;\n}\n\n.cn-people-widget__footer {\n\tflex: 0 0 auto;\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding-top: 4px;\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","_createElementVNode","_toDisplayString","_openBlock","_Fragment","_renderList"],"mappings":";;AAYU,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,0BAA0B;;;;;AAiBe,EAAA,KAAA,EAAA;;;;AAIlD,EAAA,KAAA,EAAA;;;;AAOuB,EAAA,KAAK,EAAC;;;;AAI5B,EAAA,KAAA,EAAA;;;;AAsBC,MAAA,WAAA,GAAA,EAAA,KAAM,EAAC,wBAAwB;AAC3B,MAAA,WAAA,GAAA,EAAA,KAAA,EAAA,wBAAA;;;AAEkC,EAAA,KAAK,EAAC;;;;AACrC,EAAA,KAAA,EAAA;;;;AAGiC,EAAA,KAAK,EAAC;;;;AACN,EAAA,KAAK,EAAC;;;;AAIvB,EAAA,KAAA,EAAA;;;;;;AAiBxB,EAAA,KAAA,EAAA;;;;AAQa,EAAA,KAAA,EAAA;;;;;uBA5FjBA,kBAAA;IAAE,KAAK,EAAAC,cAAA,CAAA,CAAC,kBAAkB,EAAK,QAAA,CAAA,WAAA,CAAA;;;qBAE/BC,kBAAA,CAKiC,OAAA,EAAA;qEAJ5B,KAAA,CAAA,MAAA,IAAA,MAAA,CAAA,CAAA;AACL,QAAA,IAAI,EAAC,QAAO;AACZ,QAAA,KAAK,EAAC,0BAA0B;AAC/B,QAAA,YAAU,EAAE,QAAA,CAAA,CAAC,CAAA,eAAA,EAAA,yBAAA,CAAA;AACb,QAAA,WAAW,EAAE,QAAA,CAAA;;qBAJT,KAAA,CAAA,MAAA;;MAKLA,kBAAA,CAOG,QAAA,EAAA;AANH,QAAA,IAAI,EAAC,QAAE;AACP,QAAA,KAAK,E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AA,CAAA,CAAC,uBAAC,EAAA,EAAA,8BAAA,EACL,QAAA,CAAA,UAAA,CAAA,GAAA,CAAA,EAAA,CAAA,CAAA;0CACD,YAAA,EAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,4BAAA,EAAA,EAAA,GAAA,EAAA,CAAA;0CACA,OAAK,EAAA,MAAA,KAAE,QAAA,CAAA,SAAS,CAAC,GAAG,CAAA;2DAClB,GAAG,CAAA,EAAA,EAAA,2BAAA,WAAA;;;;AAIT,mCAAAG,SAAA,EAAA,EAAAJ,kBAAA,SAAA,6BACC,KAAA,CAAA,KAAA,CAAA,GAAA,IAAA,GAAAG,eAAA,CAAA,KAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;;AAOS,IAAA,CAAA,QAAA,CAAA,WAAK,KAAA,KAAA,CAAA,KAAA;AAAjB,SAAAC,SAAA,EAAA,EAAAJ,kBAAA,WAAA;UACAE,kBAAA;AACA,YAAA,IAAI,EAAC,QAAE;AACP,YAAA,KAAK,EAAC,6BAAA;AACL,YAAA,QAAC,EAAA,KAAA,CAAA,OAAA;;;;;;;;"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: 2026 Conduction B.V.
3
+ * SPDX-License-Identifier: EUPL-1.2
4
+ *
5
+ * In-memory page cache for CnPeopleWidget. It lives at module level so a
6
+ * widget that is unmounted and mounted again (switching dashboards) is
7
+ * served from it instead of asking the directory again.
8
+ */
9
+
10
+ /** How long a cached page stays fresh, in milliseconds. */
11
+ const PEOPLE_CACHE_TTL_MS = 60 * 1000;
12
+
13
+ const pages = new Map();
14
+
15
+ /**
16
+ * The cache key of one page.
17
+ *
18
+ * @param {string} baseKey the serialised fetch arguments, without the offset.
19
+ * @param {number} offset the page offset.
20
+ * @return {string} the key.
21
+ */
22
+ function keyOf(baseKey, offset) {
23
+ return `${baseKey}|${offset}`
24
+ }
25
+
26
+ /**
27
+ * A cached page that is still fresh, or `null`.
28
+ *
29
+ * @param {string} baseKey the serialised fetch arguments.
30
+ * @param {number} offset the page offset.
31
+ * @return {object|null} the cached `{users, total, hasMore}` page.
32
+ */
33
+ function readPeoplePage(baseKey, offset) {
34
+ const entry = pages.get(keyOf(baseKey, offset));
35
+ if (!entry) {
36
+ return null
37
+ }
38
+ if (Date.now() - entry.storedAt >= PEOPLE_CACHE_TTL_MS) {
39
+ pages.delete(keyOf(baseKey, offset));
40
+ return null
41
+ }
42
+ return entry.page
43
+ }
44
+
45
+ /**
46
+ * Keep a page.
47
+ *
48
+ * @param {string} baseKey the serialised fetch arguments.
49
+ * @param {number} offset the page offset.
50
+ * @param {object} page the `{users, total, hasMore}` page.
51
+ * @return {void}
52
+ */
53
+ function storePeoplePage(baseKey, offset, page) {
54
+ pages.set(keyOf(baseKey, offset), { page, storedAt: Date.now() });
55
+ }
56
+
57
+ /**
58
+ * Drop every cached page of one argument set, or the whole cache.
59
+ *
60
+ * @param {string} [baseKey] the serialised fetch arguments; all when omitted.
61
+ * @return {void}
62
+ */
63
+ function clearPeoplePages(baseKey) {
64
+ if (baseKey === undefined) {
65
+ pages.clear();
66
+ return
67
+ }
68
+ for (const key of [...pages.keys()]) {
69
+ if (key.startsWith(`${baseKey}|`)) {
70
+ pages.delete(key);
71
+ }
72
+ }
73
+ }
74
+
75
+ export { PEOPLE_CACHE_TTL_MS, clearPeoplePages, readPeoplePage, storePeoplePage };
76
+ //# sourceMappingURL=peopleCache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"peopleCache.js","sources":["../../../../src/components/CnPeopleWidget/peopleCache.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * In-memory page cache for CnPeopleWidget. It lives at module level so a\n * widget that is unmounted and mounted again (switching dashboards) is\n * served from it instead of asking the directory again.\n */\n\n/** How long a cached page stays fresh, in milliseconds. */\nexport const PEOPLE_CACHE_TTL_MS = 60 * 1000\n\nconst pages = new Map()\n\n/**\n * The cache key of one page.\n *\n * @param {string} baseKey the serialised fetch arguments, without the offset.\n * @param {number} offset the page offset.\n * @return {string} the key.\n */\nfunction keyOf(baseKey, offset) {\n\treturn `${baseKey}|${offset}`\n}\n\n/**\n * A cached page that is still fresh, or `null`.\n *\n * @param {string} baseKey the serialised fetch arguments.\n * @param {number} offset the page offset.\n * @return {object|null} the cached `{users, total, hasMore}` page.\n */\nexport function readPeoplePage(baseKey, offset) {\n\tconst entry = pages.get(keyOf(baseKey, offset))\n\tif (!entry) {\n\t\treturn null\n\t}\n\tif (Date.now() - entry.storedAt >= PEOPLE_CACHE_TTL_MS) {\n\t\tpages.delete(keyOf(baseKey, offset))\n\t\treturn null\n\t}\n\treturn entry.page\n}\n\n/**\n * Keep a page.\n *\n * @param {string} baseKey the serialised fetch arguments.\n * @param {number} offset the page offset.\n * @param {object} page the `{users, total, hasMore}` page.\n * @return {void}\n */\nexport function storePeoplePage(baseKey, offset, page) {\n\tpages.set(keyOf(baseKey, offset), { page, storedAt: Date.now() })\n}\n\n/**\n * Drop every cached page of one argument set, or the whole cache.\n *\n * @param {string} [baseKey] the serialised fetch arguments; all when omitted.\n * @return {void}\n */\nexport function clearPeoplePages(baseKey) {\n\tif (baseKey === undefined) {\n\t\tpages.clear()\n\t\treturn\n\t}\n\tfor (const key of [...pages.keys()]) {\n\t\tif (key.startsWith(`${baseKey}|`)) {\n\t\t\tpages.delete(key)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACY,MAAC,mBAAmB,GAAG,EAAE,GAAG;;AAExC,MAAM,KAAK,GAAG,IAAI,GAAG;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE;AAChC,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE;AAChD,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC;AAC/C,CAAC,IAAI,CAAC,KAAK,EAAE;AACb,EAAE,OAAO;AACT,CAAC;AACD,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,QAAQ,IAAI,mBAAmB,EAAE;AACzD,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC;AACrC,EAAE,OAAO;AACT,CAAC;AACD,CAAC,OAAO,KAAK,CAAC;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;AACvD,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,OAAO,EAAE;AAC1C,CAAC,IAAI,OAAO,KAAK,SAAS,EAAE;AAC5B,EAAE,KAAK,CAAC,KAAK;AACb,EAAE;AACF,CAAC;AACD,CAAC,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE;AACtC,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;AACrC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG;AACnB,EAAE;AACF,CAAC;AACD;;"}
@@ -2,7 +2,7 @@ import script from './CnPeopleWidgetForm2.vue.js';
2
2
  import { render } from './CnPeopleWidgetForm3.vue.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-53a2b86c";
5
+ script.__scopeId = "data-v-085c8426";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -1,6 +1,8 @@
1
1
  import { translate } from '@nextcloud/l10n';
2
2
  import { NcSelect } from '@nextcloud/vue';
3
3
 
4
+ const SORT_KEYS = ['displayName', 'group'];
5
+
4
6
  const DEFAULT_CONTENT = Object.freeze({
5
7
  layout: 'grid',
6
8
  selectionMode: 'filter',
@@ -30,7 +32,10 @@ const DEFAULT_CONTENT = Object.freeze({
30
32
  * (selectionMode, selectedUsers, filterOperator, showFields) travel through
31
33
  * untouched from their defaults. Group filter persists as the canonical
32
34
  * `[{fieldName:'group', operator:'in', values:[...]}]` shape. Emits
33
- * `update:content` on change and exposes `validate()` (birthday window 0..30).
35
+ * `update:content` on change and exposes `validate()`: a birthday window
36
+ * typed outside 0..30 keeps the form invalid until it is corrected, and a
37
+ * stored unknown `sortBy` is shown as Display name with a message, keeping
38
+ * the form invalid until a sort key is picked.
34
39
  */
35
40
  var script = {
36
41
  name: 'CnPeopleWidgetForm',
@@ -65,6 +70,8 @@ var script = {
65
70
 
66
71
  data() {
67
72
  const initial = this.editingWidget?.content || this.value || {};
73
+ const storedSortBy = initial.sortBy ?? DEFAULT_CONTENT.sortBy;
74
+ const sortByKnown = SORT_KEYS.includes(storedSortBy);
68
75
  const groupFilter = (initial.filters || [])
69
76
  .find((f) => f && f.fieldName === 'group');
70
77
  return {
@@ -87,7 +94,11 @@ var script = {
87
94
  ? initial.birthdayWindowDays
88
95
  : DEFAULT_CONTENT.birthdayWindowDays,
89
96
 
90
- sortBy: initial.sortBy ?? DEFAULT_CONTENT.sortBy,
97
+ sortBy: sortByKnown ? storedSortBy : DEFAULT_CONTENT.sortBy,
98
+ sortByError: sortByKnown
99
+ ? ''
100
+ : translate('nextcloud-vue', 'Unknown sort key "{key}". Display name is used instead.', { key: String(storedSortBy) }),
101
+
91
102
  columns: typeof initial.columns === 'number'
92
103
  ? initial.columns
93
104
  : DEFAULT_CONTENT.columns,
@@ -169,6 +180,18 @@ var script = {
169
180
  this.$emit('update:content', this.assembledContent);
170
181
  },
171
182
 
183
+ /**
184
+ * Set the sort key; picking one confirms it and clears the
185
+ * unknown-key message.
186
+ *
187
+ * @param {string} value the chosen sort key.
188
+ * @return {void}
189
+ */
190
+ updateSortBy(value) {
191
+ this.sortByError = '';
192
+ this.updateField('sortBy', value);
193
+ },
194
+
172
195
  /**
173
196
  * Parse the comma-separated group input into the canonical filters
174
197
  * shape and re-emit the assembled content.
@@ -185,20 +208,22 @@ var script = {
185
208
  },
186
209
 
187
210
  /**
188
- * Validate + clamp the birthday window to the 0..30 range, recording a
189
- * localised inline error when out of range.
211
+ * Validate the birthday window against the 0..30 range. An out-of-range
212
+ * value records a localised inline error, which keeps `validate()`
213
+ * failing until a valid value is typed; the last valid value stays in
214
+ * the content.
190
215
  *
191
216
  * @param {string|number} raw the input value.
192
217
  * @return {void}
193
218
  */
194
219
  updateBirthdayWindow(raw) {
195
220
  const numeric = Number(raw);
196
- if (!Number.isFinite(numeric) || numeric < 0 || numeric > 30) {
221
+ if (raw === '' || !Number.isFinite(numeric) || numeric < 0 || numeric > 30) {
197
222
  this.birthdayWindowError = translate('nextcloud-vue', 'Must be between 0 and 30');
198
- return
223
+ } else {
224
+ this.birthdayWindowError = '';
225
+ this.birthdayWindowDays = Math.floor(numeric);
199
226
  }
200
- this.birthdayWindowError = '';
201
- this.birthdayWindowDays = Math.floor(numeric);
202
227
  this.$emit('update:content', this.assembledContent);
203
228
  },
204
229
 
@@ -209,6 +234,12 @@ var script = {
209
234
  */
210
235
  validate() {
211
236
  const errors = [];
237
+ if (this.sortByError) {
238
+ errors.push(this.sortByError);
239
+ }
240
+ if (this.showBirthdays && this.birthdayWindowError) {
241
+ errors.push(this.birthdayWindowError);
242
+ }
212
243
  if (typeof this.birthdayWindowDays !== 'number'
213
244
  || this.birthdayWindowDays < 0
214
245
  || this.birthdayWindowDays > 30) {
@@ -217,7 +248,7 @@ var script = {
217
248
  if (!['card', 'grid', 'list'].includes(this.layout)) {
218
249
  errors.push(translate('nextcloud-vue', 'Invalid layout'));
219
250
  }
220
- if (!['displayName', 'group'].includes(this.sortBy)) {
251
+ if (!SORT_KEYS.includes(this.sortBy)) {
221
252
  errors.push(translate('nextcloud-vue', 'Invalid sort key'));
222
253
  }
223
254
  return errors
@@ -1 +1 @@
1
- {"version":3,"file":"CnPeopleWidgetForm2.vue.js","sources":["../../../../src/components/CnPeopleWidgetForm/CnPeopleWidgetForm.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-people-widget-form\">\n\t\t<NcSelect\n\t\t\t:modelValue=\"layout\"\n\t\t\t:options=\"layoutOptions\"\n\t\t\t:inputLabel=\"t('nextcloud-vue', 'Layout')\"\n\t\t\t:reduce=\"(option) => option.value\"\n\t\t\tlabel=\"label\"\n\t\t\t:clearable=\"false\"\n\t\t\t@update:modelValue=\"updateField('layout', $event)\" />\n\n\t\t<NcSelect\n\t\t\t:modelValue=\"sortBy\"\n\t\t\t:options=\"sortByOptions\"\n\t\t\t:inputLabel=\"t('nextcloud-vue', 'Sort by')\"\n\t\t\t:reduce=\"(option) => option.value\"\n\t\t\tlabel=\"label\"\n\t\t\t:clearable=\"false\"\n\t\t\t@update:modelValue=\"updateField('sortBy', $event)\" />\n\n\t\t<label class=\"cn-people-widget-form__field\">\n\t\t\t{{ t('nextcloud-vue', 'Group filter (comma-separated, blank for all)') }}\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tclass=\"cn-people-widget-form__input\"\n\t\t\t\t:value=\"groupFilterText\"\n\t\t\t\t:placeholder=\"t('nextcloud-vue', 'e.g. management, product')\"\n\t\t\t\t@input=\"updateGroupFilter($event.target.value)\">\n\t\t</label>\n\n\t\t<label class=\"cn-people-widget-form__field cn-people-widget-form__field--inline\">\n\t\t\t<input\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t:checked=\"excludeDisabled\"\n\t\t\t\t@change=\"updateField('excludeDisabled', $event.target.checked)\">\n\t\t\t{{ t('nextcloud-vue', 'Exclude disabled users') }}\n\t\t</label>\n\n\t\t<label class=\"cn-people-widget-form__field cn-people-widget-form__field--inline\">\n\t\t\t<input\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t:checked=\"showBirthdays\"\n\t\t\t\t@change=\"updateField('showBirthdays', $event.target.checked)\">\n\t\t\t{{ t('nextcloud-vue', 'Show birthdays') }}\n\t\t</label>\n\n\t\t<label v-if=\"showBirthdays\" class=\"cn-people-widget-form__field\">\n\t\t\t{{ t('nextcloud-vue', 'Birthday window (days, 0–30)') }}\n\t\t\t<input\n\t\t\t\ttype=\"number\"\n\t\t\t\tclass=\"cn-people-widget-form__input\"\n\t\t\t\tmin=\"0\"\n\t\t\t\tmax=\"30\"\n\t\t\t\t:value=\"birthdayWindowDays\"\n\t\t\t\t@input=\"updateBirthdayWindow($event.target.value)\">\n\t\t\t<span v-if=\"birthdayWindowError\" class=\"cn-people-widget-form__error\">\n\t\t\t\t{{ birthdayWindowError }}\n\t\t\t</span>\n\t\t</label>\n\n\t\t<label v-if=\"layout !== 'list'\" class=\"cn-people-widget-form__field\">\n\t\t\t{{ t('nextcloud-vue', 'Columns') }}\n\t\t\t<select\n\t\t\t\t:value=\"columns\"\n\t\t\t\tclass=\"cn-people-widget-form__input\"\n\t\t\t\t@change=\"updateField('columns', Number($event.target.value))\">\n\t\t\t\t<option :value=\"2\">\n\t\t\t\t\t2\n\t\t\t\t</option>\n\t\t\t\t<option :value=\"3\">\n\t\t\t\t\t3\n\t\t\t\t</option>\n\t\t\t\t<option :value=\"4\">\n\t\t\t\t\t4\n\t\t\t\t</option>\n\t\t\t</select>\n\t\t</label>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcSelect } from '@nextcloud/vue'\n\nconst DEFAULT_CONTENT = Object.freeze({\n\tlayout: 'grid',\n\tselectionMode: 'filter',\n\tselectedUsers: [],\n\tfilters: [],\n\tfilterOperator: 'AND',\n\texcludeDisabled: true,\n\tshowBirthdays: true,\n\tbirthdayWindowDays: 7,\n\tsortBy: 'displayName',\n\tcolumns: 3,\n\tshowFields: {\n\t\tdisplayName: true,\n\t\trole: true,\n\t\torganisation: true,\n\t\temail: true,\n\t\tphone: true,\n\t\tavatar: true,\n\t\tbirthdate: true,\n\t},\n})\n\n/**\n * CnPeopleWidgetForm — the `CnAddWidgetModal` sub-form for creating or editing\n * a `people` widget placement. Exposes layout, sort, group filter, exclude\n * disabled, show birthdays + window, and columns; less common keys\n * (selectionMode, selectedUsers, filterOperator, showFields) travel through\n * untouched from their defaults. Group filter persists as the canonical\n * `[{fieldName:'group', operator:'in', values:[...]}]` shape. Emits\n * `update:content` on change and exposes `validate()` (birthday window 0..30).\n */\nexport default {\n\tname: 'CnPeopleWidgetForm',\n\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\n\tprops: {\n\t\t/** The placement being edited, or `null` in create mode. */\n\t\teditingWidget: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Initial content values when not editing (registry defaults). */\n\t\tvalue: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ ...DEFAULT_CONTENT }),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted with the assembled content blob on every change.\n\t\t *\n\t\t * @event update:content\n\t\t * @type {object}\n\t\t */\n\t\t'update:content',\n\t],\n\n\tdata() {\n\t\tconst initial = this.editingWidget?.content || this.value || {}\n\t\tconst groupFilter = (initial.filters || [])\n\t\t\t.find((f) => f && f.fieldName === 'group')\n\t\treturn {\n\t\t\tlayout: initial.layout ?? DEFAULT_CONTENT.layout,\n\t\t\tselectionMode: initial.selectionMode ?? DEFAULT_CONTENT.selectionMode,\n\t\t\tselectedUsers: Array.isArray(initial.selectedUsers)\n\t\t\t\t? [...initial.selectedUsers]\n\t\t\t\t: [...DEFAULT_CONTENT.selectedUsers],\n\n\t\t\tfilterOperator: initial.filterOperator ?? DEFAULT_CONTENT.filterOperator,\n\t\t\texcludeDisabled: typeof initial.excludeDisabled === 'boolean'\n\t\t\t\t? initial.excludeDisabled\n\t\t\t\t: DEFAULT_CONTENT.excludeDisabled,\n\n\t\t\tshowBirthdays: typeof initial.showBirthdays === 'boolean'\n\t\t\t\t? initial.showBirthdays\n\t\t\t\t: DEFAULT_CONTENT.showBirthdays,\n\n\t\t\tbirthdayWindowDays: typeof initial.birthdayWindowDays === 'number'\n\t\t\t\t? initial.birthdayWindowDays\n\t\t\t\t: DEFAULT_CONTENT.birthdayWindowDays,\n\n\t\t\tsortBy: initial.sortBy ?? DEFAULT_CONTENT.sortBy,\n\t\t\tcolumns: typeof initial.columns === 'number'\n\t\t\t\t? initial.columns\n\t\t\t\t: DEFAULT_CONTENT.columns,\n\n\t\t\tshowFields: { ...DEFAULT_CONTENT.showFields, ...(initial.showFields || {}) },\n\t\t\tgroupFilterValues: groupFilter && Array.isArray(groupFilter.values)\n\t\t\t\t? [...groupFilter.values]\n\t\t\t\t: [],\n\n\t\t\tbirthdayWindowError: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** Layout select options. */\n\t\tlayoutOptions() {\n\t\t\treturn [\n\t\t\t\t{ value: 'card', label: t('nextcloud-vue', 'Card') },\n\t\t\t\t{ value: 'grid', label: t('nextcloud-vue', 'Grid') },\n\t\t\t\t{ value: 'list', label: t('nextcloud-vue', 'List') },\n\t\t\t]\n\t\t},\n\n\t\t/** Sort select options. */\n\t\tsortByOptions() {\n\t\t\treturn [\n\t\t\t\t{ value: 'displayName', label: t('nextcloud-vue', 'Display name') },\n\t\t\t\t{ value: 'group', label: t('nextcloud-vue', 'Group') },\n\t\t\t]\n\t\t},\n\n\t\t/** Comma-joined group filter values for the text input. */\n\t\tgroupFilterText() {\n\t\t\treturn this.groupFilterValues.join(', ')\n\t\t},\n\n\t\t/** The canonical filters array assembled from the group input. */\n\t\tassembledFilters() {\n\t\t\tif (this.groupFilterValues.length === 0) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn [{\n\t\t\t\tfieldName: 'group',\n\t\t\t\toperator: 'in',\n\t\t\t\tvalues: this.groupFilterValues,\n\t\t\t}]\n\t\t},\n\n\t\t/** The full content blob assembled from the current field values. */\n\t\tassembledContent() {\n\t\t\treturn {\n\t\t\t\tlayout: this.layout,\n\t\t\t\tselectionMode: this.selectionMode,\n\t\t\t\tselectedUsers: this.selectedUsers,\n\t\t\t\tfilters: this.assembledFilters,\n\t\t\t\tfilterOperator: this.filterOperator,\n\t\t\t\texcludeDisabled: this.excludeDisabled,\n\t\t\t\tshowBirthdays: this.showBirthdays,\n\t\t\t\tbirthdayWindowDays: this.birthdayWindowDays,\n\t\t\t\tsortBy: this.sortBy,\n\t\t\t\tcolumns: this.columns,\n\t\t\t\tshowFields: this.showFields,\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Set a field and notify the parent.\n\t\t *\n\t\t * @param {string} field one of the form's reactive keys.\n\t\t * @param {unknown} value the new value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateField(field, value) {\n\t\t\tthis[field] = value\n\t\t\tthis.$emit('update:content', this.assembledContent)\n\t\t},\n\n\t\t/**\n\t\t * Parse the comma-separated group input into the canonical filters\n\t\t * shape and re-emit the assembled content.\n\t\t *\n\t\t * @param {string} raw the textbox value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateGroupFilter(raw) {\n\t\t\tthis.groupFilterValues = (raw || '')\n\t\t\t\t.split(',')\n\t\t\t\t.map((part) => part.trim())\n\t\t\t\t.filter((part) => part.length > 0)\n\t\t\tthis.$emit('update:content', this.assembledContent)\n\t\t},\n\n\t\t/**\n\t\t * Validate + clamp the birthday window to the 0..30 range, recording a\n\t\t * localised inline error when out of range.\n\t\t *\n\t\t * @param {string|number} raw the input value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateBirthdayWindow(raw) {\n\t\t\tconst numeric = Number(raw)\n\t\t\tif (!Number.isFinite(numeric) || numeric < 0 || numeric > 30) {\n\t\t\t\tthis.birthdayWindowError = t('nextcloud-vue', 'Must be between 0 and 30')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.birthdayWindowError = ''\n\t\t\tthis.birthdayWindowDays = Math.floor(numeric)\n\t\t\tthis.$emit('update:content', this.assembledContent)\n\t\t},\n\n\t\t/**\n\t\t * Validate the form; an empty array means valid.\n\t\t *\n\t\t * @return {string[]} the validation errors.\n\t\t */\n\t\tvalidate() {\n\t\t\tconst errors = []\n\t\t\tif (typeof this.birthdayWindowDays !== 'number'\n\t\t\t\t|| this.birthdayWindowDays < 0\n\t\t\t\t|| this.birthdayWindowDays > 30) {\n\t\t\t\terrors.push(t('nextcloud-vue', 'Birthday window must be between 0 and 30'))\n\t\t\t}\n\t\t\tif (!['card', 'grid', 'list'].includes(this.layout)) {\n\t\t\t\terrors.push(t('nextcloud-vue', 'Invalid layout'))\n\t\t\t}\n\t\t\tif (!['displayName', 'group'].includes(this.sortBy)) {\n\t\t\t\terrors.push(t('nextcloud-vue', 'Invalid sort key'))\n\t\t\t}\n\t\t\treturn errors\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-people-widget-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-people-widget-form__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tfont-size: 14px;\n}\n\n.cn-people-widget-form__field--inline {\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 8px;\n}\n\n.cn-people-widget-form__input {\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tfont: inherit;\n}\n\n.cn-people-widget-form__error {\n\tcolor: var(--color-error, #c00);\n\tfont-size: 12px;\n}\n</style>\n"],"names":["t"],"mapp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AAO,IAAI,CAAC,kBAAiB,KAAM;OACnC,IAAI,CAAC,kBAAiB,GAAI;OAC1B,IAAI,CAAC,kBAAiB,GAAI,EAAE,EAAE;AACjC,IAAA,MAAM,CAAC,IAAI,CAACA,SAAC,CAAC,eAAe,EAAE,0CAA0C,CAAC;AAC3E,GAAA;GACA,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;IACpD,MAAM,CAAC,IAAI,CAACA,SAAC,CAAC,eAAe,EAAE,gBAAgB,CAAC;AACjD,GAAA;GACA,IAAI,CAAC,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;IACpD,MAAM,CAAC,IAAI,CAACA,SAAC,CAAC,eAAe,EAAE,kBAAkB,CAAC;AACnD,GAAA;GACA,OAAO;EACR,CAAC;EACD;AACF;;"}
1
+ {"version":3,"file":"CnPeopleWidgetForm2.vue.js","sources":["../../../../src/components/CnPeopleWidgetForm/CnPeopleWidgetForm.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-people-widget-form\">\n\t\t<NcSelect\n\t\t\t:modelValue=\"layout\"\n\t\t\t:options=\"layoutOptions\"\n\t\t\t:inputLabel=\"t('nextcloud-vue', 'Layout')\"\n\t\t\t:reduce=\"(option) => option.value\"\n\t\t\tlabel=\"label\"\n\t\t\t:clearable=\"false\"\n\t\t\t@update:modelValue=\"updateField('layout', $event)\" />\n\n\t\t<NcSelect\n\t\t\t:modelValue=\"sortBy\"\n\t\t\t:options=\"sortByOptions\"\n\t\t\t:inputLabel=\"t('nextcloud-vue', 'Sort by')\"\n\t\t\t:reduce=\"(option) => option.value\"\n\t\t\tlabel=\"label\"\n\t\t\t:clearable=\"false\"\n\t\t\t@update:modelValue=\"updateSortBy($event)\" />\n\t\t<p v-if=\"sortByError\" class=\"cn-people-widget-form__error\" role=\"alert\">\n\t\t\t{{ sortByError }}\n\t\t</p>\n\n\t\t<label class=\"cn-people-widget-form__field\">\n\t\t\t{{ t('nextcloud-vue', 'Group filter (comma-separated, blank for all)') }}\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tclass=\"cn-people-widget-form__input\"\n\t\t\t\t:value=\"groupFilterText\"\n\t\t\t\t:placeholder=\"t('nextcloud-vue', 'e.g. management, product')\"\n\t\t\t\t@input=\"updateGroupFilter($event.target.value)\">\n\t\t</label>\n\n\t\t<label class=\"cn-people-widget-form__field cn-people-widget-form__field--inline\">\n\t\t\t<input\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t:checked=\"excludeDisabled\"\n\t\t\t\t@change=\"updateField('excludeDisabled', $event.target.checked)\">\n\t\t\t{{ t('nextcloud-vue', 'Exclude disabled users') }}\n\t\t</label>\n\n\t\t<label class=\"cn-people-widget-form__field cn-people-widget-form__field--inline\">\n\t\t\t<input\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t:checked=\"showBirthdays\"\n\t\t\t\t@change=\"updateField('showBirthdays', $event.target.checked)\">\n\t\t\t{{ t('nextcloud-vue', 'Show birthdays') }}\n\t\t</label>\n\n\t\t<label v-if=\"showBirthdays\" class=\"cn-people-widget-form__field\">\n\t\t\t{{ t('nextcloud-vue', 'Birthday window (days, 0–30)') }}\n\t\t\t<input\n\t\t\t\ttype=\"number\"\n\t\t\t\tclass=\"cn-people-widget-form__input\"\n\t\t\t\tmin=\"0\"\n\t\t\t\tmax=\"30\"\n\t\t\t\t:value=\"birthdayWindowDays\"\n\t\t\t\t@input=\"updateBirthdayWindow($event.target.value)\">\n\t\t\t<span v-if=\"birthdayWindowError\" class=\"cn-people-widget-form__error\" role=\"alert\">\n\t\t\t\t{{ birthdayWindowError }}\n\t\t\t</span>\n\t\t</label>\n\n\t\t<label v-if=\"layout !== 'list'\" class=\"cn-people-widget-form__field\">\n\t\t\t{{ t('nextcloud-vue', 'Columns') }}\n\t\t\t<select\n\t\t\t\t:value=\"columns\"\n\t\t\t\tclass=\"cn-people-widget-form__input\"\n\t\t\t\t@change=\"updateField('columns', Number($event.target.value))\">\n\t\t\t\t<option :value=\"2\">\n\t\t\t\t\t2\n\t\t\t\t</option>\n\t\t\t\t<option :value=\"3\">\n\t\t\t\t\t3\n\t\t\t\t</option>\n\t\t\t\t<option :value=\"4\">\n\t\t\t\t\t4\n\t\t\t\t</option>\n\t\t\t</select>\n\t\t</label>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcSelect } from '@nextcloud/vue'\n\nconst SORT_KEYS = ['displayName', 'group']\n\nconst DEFAULT_CONTENT = Object.freeze({\n\tlayout: 'grid',\n\tselectionMode: 'filter',\n\tselectedUsers: [],\n\tfilters: [],\n\tfilterOperator: 'AND',\n\texcludeDisabled: true,\n\tshowBirthdays: true,\n\tbirthdayWindowDays: 7,\n\tsortBy: 'displayName',\n\tcolumns: 3,\n\tshowFields: {\n\t\tdisplayName: true,\n\t\trole: true,\n\t\torganisation: true,\n\t\temail: true,\n\t\tphone: true,\n\t\tavatar: true,\n\t\tbirthdate: true,\n\t},\n})\n\n/**\n * CnPeopleWidgetForm — the `CnAddWidgetModal` sub-form for creating or editing\n * a `people` widget placement. Exposes layout, sort, group filter, exclude\n * disabled, show birthdays + window, and columns; less common keys\n * (selectionMode, selectedUsers, filterOperator, showFields) travel through\n * untouched from their defaults. Group filter persists as the canonical\n * `[{fieldName:'group', operator:'in', values:[...]}]` shape. Emits\n * `update:content` on change and exposes `validate()`: a birthday window\n * typed outside 0..30 keeps the form invalid until it is corrected, and a\n * stored unknown `sortBy` is shown as Display name with a message, keeping\n * the form invalid until a sort key is picked.\n */\nexport default {\n\tname: 'CnPeopleWidgetForm',\n\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\n\tprops: {\n\t\t/** The placement being edited, or `null` in create mode. */\n\t\teditingWidget: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Initial content values when not editing (registry defaults). */\n\t\tvalue: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ ...DEFAULT_CONTENT }),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted with the assembled content blob on every change.\n\t\t *\n\t\t * @event update:content\n\t\t * @type {object}\n\t\t */\n\t\t'update:content',\n\t],\n\n\tdata() {\n\t\tconst initial = this.editingWidget?.content || this.value || {}\n\t\tconst storedSortBy = initial.sortBy ?? DEFAULT_CONTENT.sortBy\n\t\tconst sortByKnown = SORT_KEYS.includes(storedSortBy)\n\t\tconst groupFilter = (initial.filters || [])\n\t\t\t.find((f) => f && f.fieldName === 'group')\n\t\treturn {\n\t\t\tlayout: initial.layout ?? DEFAULT_CONTENT.layout,\n\t\t\tselectionMode: initial.selectionMode ?? DEFAULT_CONTENT.selectionMode,\n\t\t\tselectedUsers: Array.isArray(initial.selectedUsers)\n\t\t\t\t? [...initial.selectedUsers]\n\t\t\t\t: [...DEFAULT_CONTENT.selectedUsers],\n\n\t\t\tfilterOperator: initial.filterOperator ?? DEFAULT_CONTENT.filterOperator,\n\t\t\texcludeDisabled: typeof initial.excludeDisabled === 'boolean'\n\t\t\t\t? initial.excludeDisabled\n\t\t\t\t: DEFAULT_CONTENT.excludeDisabled,\n\n\t\t\tshowBirthdays: typeof initial.showBirthdays === 'boolean'\n\t\t\t\t? initial.showBirthdays\n\t\t\t\t: DEFAULT_CONTENT.showBirthdays,\n\n\t\t\tbirthdayWindowDays: typeof initial.birthdayWindowDays === 'number'\n\t\t\t\t? initial.birthdayWindowDays\n\t\t\t\t: DEFAULT_CONTENT.birthdayWindowDays,\n\n\t\t\tsortBy: sortByKnown ? storedSortBy : DEFAULT_CONTENT.sortBy,\n\t\t\tsortByError: sortByKnown\n\t\t\t\t? ''\n\t\t\t\t: t('nextcloud-vue', 'Unknown sort key \"{key}\". Display name is used instead.', { key: String(storedSortBy) }),\n\n\t\t\tcolumns: typeof initial.columns === 'number'\n\t\t\t\t? initial.columns\n\t\t\t\t: DEFAULT_CONTENT.columns,\n\n\t\t\tshowFields: { ...DEFAULT_CONTENT.showFields, ...(initial.showFields || {}) },\n\t\t\tgroupFilterValues: groupFilter && Array.isArray(groupFilter.values)\n\t\t\t\t? [...groupFilter.values]\n\t\t\t\t: [],\n\n\t\t\tbirthdayWindowError: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** Layout select options. */\n\t\tlayoutOptions() {\n\t\t\treturn [\n\t\t\t\t{ value: 'card', label: t('nextcloud-vue', 'Card') },\n\t\t\t\t{ value: 'grid', label: t('nextcloud-vue', 'Grid') },\n\t\t\t\t{ value: 'list', label: t('nextcloud-vue', 'List') },\n\t\t\t]\n\t\t},\n\n\t\t/** Sort select options. */\n\t\tsortByOptions() {\n\t\t\treturn [\n\t\t\t\t{ value: 'displayName', label: t('nextcloud-vue', 'Display name') },\n\t\t\t\t{ value: 'group', label: t('nextcloud-vue', 'Group') },\n\t\t\t]\n\t\t},\n\n\t\t/** Comma-joined group filter values for the text input. */\n\t\tgroupFilterText() {\n\t\t\treturn this.groupFilterValues.join(', ')\n\t\t},\n\n\t\t/** The canonical filters array assembled from the group input. */\n\t\tassembledFilters() {\n\t\t\tif (this.groupFilterValues.length === 0) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn [{\n\t\t\t\tfieldName: 'group',\n\t\t\t\toperator: 'in',\n\t\t\t\tvalues: this.groupFilterValues,\n\t\t\t}]\n\t\t},\n\n\t\t/** The full content blob assembled from the current field values. */\n\t\tassembledContent() {\n\t\t\treturn {\n\t\t\t\tlayout: this.layout,\n\t\t\t\tselectionMode: this.selectionMode,\n\t\t\t\tselectedUsers: this.selectedUsers,\n\t\t\t\tfilters: this.assembledFilters,\n\t\t\t\tfilterOperator: this.filterOperator,\n\t\t\t\texcludeDisabled: this.excludeDisabled,\n\t\t\t\tshowBirthdays: this.showBirthdays,\n\t\t\t\tbirthdayWindowDays: this.birthdayWindowDays,\n\t\t\t\tsortBy: this.sortBy,\n\t\t\t\tcolumns: this.columns,\n\t\t\t\tshowFields: this.showFields,\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Set a field and notify the parent.\n\t\t *\n\t\t * @param {string} field one of the form's reactive keys.\n\t\t * @param {unknown} value the new value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateField(field, value) {\n\t\t\tthis[field] = value\n\t\t\tthis.$emit('update:content', this.assembledContent)\n\t\t},\n\n\t\t/**\n\t\t * Set the sort key; picking one confirms it and clears the\n\t\t * unknown-key message.\n\t\t *\n\t\t * @param {string} value the chosen sort key.\n\t\t * @return {void}\n\t\t */\n\t\tupdateSortBy(value) {\n\t\t\tthis.sortByError = ''\n\t\t\tthis.updateField('sortBy', value)\n\t\t},\n\n\t\t/**\n\t\t * Parse the comma-separated group input into the canonical filters\n\t\t * shape and re-emit the assembled content.\n\t\t *\n\t\t * @param {string} raw the textbox value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateGroupFilter(raw) {\n\t\t\tthis.groupFilterValues = (raw || '')\n\t\t\t\t.split(',')\n\t\t\t\t.map((part) => part.trim())\n\t\t\t\t.filter((part) => part.length > 0)\n\t\t\tthis.$emit('update:content', this.assembledContent)\n\t\t},\n\n\t\t/**\n\t\t * Validate the birthday window against the 0..30 range. An out-of-range\n\t\t * value records a localised inline error, which keeps `validate()`\n\t\t * failing until a valid value is typed; the last valid value stays in\n\t\t * the content.\n\t\t *\n\t\t * @param {string|number} raw the input value.\n\t\t * @return {void}\n\t\t */\n\t\tupdateBirthdayWindow(raw) {\n\t\t\tconst numeric = Number(raw)\n\t\t\tif (raw === '' || !Number.isFinite(numeric) || numeric < 0 || numeric > 30) {\n\t\t\t\tthis.birthdayWindowError = t('nextcloud-vue', 'Must be between 0 and 30')\n\t\t\t} else {\n\t\t\t\tthis.birthdayWindowError = ''\n\t\t\t\tthis.birthdayWindowDays = Math.floor(numeric)\n\t\t\t}\n\t\t\tthis.$emit('update:content', this.assembledContent)\n\t\t},\n\n\t\t/**\n\t\t * Validate the form; an empty array means valid.\n\t\t *\n\t\t * @return {string[]} the validation errors.\n\t\t */\n\t\tvalidate() {\n\t\t\tconst errors = []\n\t\t\tif (this.sortByError) {\n\t\t\t\terrors.push(this.sortByError)\n\t\t\t}\n\t\t\tif (this.showBirthdays && this.birthdayWindowError) {\n\t\t\t\terrors.push(this.birthdayWindowError)\n\t\t\t}\n\t\t\tif (typeof this.birthdayWindowDays !== 'number'\n\t\t\t\t|| this.birthdayWindowDays < 0\n\t\t\t\t|| this.birthdayWindowDays > 30) {\n\t\t\t\terrors.push(t('nextcloud-vue', 'Birthday window must be between 0 and 30'))\n\t\t\t}\n\t\t\tif (!['card', 'grid', 'list'].includes(this.layout)) {\n\t\t\t\terrors.push(t('nextcloud-vue', 'Invalid layout'))\n\t\t\t}\n\t\t\tif (!SORT_KEYS.includes(this.sortBy)) {\n\t\t\t\terrors.push(t('nextcloud-vue', 'Invalid sort key'))\n\t\t\t}\n\t\t\treturn errors\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-people-widget-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-people-widget-form__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tfont-size: 14px;\n}\n\n.cn-people-widget-form__field--inline {\n\tflex-direction: row;\n\talign-items: center;\n\tgap: 8px;\n}\n\n.cn-people-widget-form__input {\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tfont: inherit;\n}\n\n.cn-people-widget-form__error {\n\tcolor: var(--color-error, #c00);\n\tfont-size: 12px;\n}\n</style>\n"],"names":["t"],"mappings":";;;AA4FA,MAAM,SAAQ,GAAI,CAAC,aAAa,EAAE,OAAO;;AA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