@sinequa/atomic-angular 2.0.0 → 2.2.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.
- package/README.md +249 -249
- package/document-workspaces/i18n/de.json +11 -1
- package/document-workspaces/i18n/en.json +11 -1
- package/document-workspaces/i18n/fr.json +11 -1
- package/document-workspaces/i18n/ja.json +11 -1
- package/fesm2022/sinequa-atomic-angular-document-workspaces.mjs +1250 -108
- package/fesm2022/sinequa-atomic-angular-document-workspaces.mjs.map +1 -1
- package/fesm2022/sinequa-atomic-angular-workspace-elements.mjs +4 -1
- package/fesm2022/sinequa-atomic-angular-workspace-elements.mjs.map +1 -1
- package/fesm2022/sinequa-atomic-angular.mjs +170 -1
- package/fesm2022/sinequa-atomic-angular.mjs.map +1 -1
- package/package.json +6 -2
- package/providers/session-expiry/i18n/de.json +7 -0
- package/providers/session-expiry/i18n/en.json +7 -0
- package/providers/session-expiry/i18n/fr.json +7 -0
- package/types/sinequa-atomic-angular-document-workspaces.d.ts +501 -27
- package/types/sinequa-atomic-angular.d.ts +90 -36
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, Pipe, ViewEncapsulation, afterNextRender, assertInInjectionContext, booleanAttribute, computed, effect, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, Pipe, ViewEncapsulation, afterNextRender, assertInInjectionContext, booleanAttribute, computed, effect, forwardRef, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
3
3
|
import { withDevtools } from "@angular-architects/ngrx-toolkit";
|
|
4
4
|
import { patchState, signalStore, withComputed, withMethods, withState } from "@ngrx/signals";
|
|
5
|
-
import { ApiError,
|
|
5
|
+
import { ApiError, addWorkspaceDocuments, createHeaders, createWorkspace, deleteWorkspaceDocuments, deleteWorkspaces, fetchPreview, fetchPrincipal, fetchPrincipalsByIds, fetchUploadStatus, getWorkspace, globalConfig, listWorkspaceDocuments, listWorkspaces, onAuthEvent, searchPrincipals, tryAutoAuthentication, updateWorkspace } from "@sinequa/atomic";
|
|
6
6
|
import { Upload } from "tus-js-client";
|
|
7
7
|
import { toSignal } from "@angular/core/rxjs-interop";
|
|
8
8
|
import { TranslocoPipe, TranslocoService, provideTranslocoScope } from "@jsverse/transloco";
|
|
@@ -31,7 +31,7 @@ function workspaceColorFor(id) {
|
|
|
31
31
|
for (let i = 0; i < id.length; i++) hash = hash * 31 + id.charCodeAt(i) | 0;
|
|
32
32
|
return PALETTE[Math.abs(hash) % PALETTE.length];
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function mapWireWorkspaceToWorkspace(dto) {
|
|
35
35
|
return {
|
|
36
36
|
id: dto.id,
|
|
37
37
|
name: dto.name,
|
|
@@ -57,12 +57,12 @@ function mapDocumentStatus(status) {
|
|
|
57
57
|
default: return;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function mapWireDocumentToWorkspaceDocument(dto) {
|
|
61
61
|
const wire = dto;
|
|
62
62
|
return {
|
|
63
63
|
id: dto.id,
|
|
64
64
|
name: dto.name,
|
|
65
|
-
workspaceId: dto.
|
|
65
|
+
workspaceId: dto.workspaceId,
|
|
66
66
|
type: getDocumentType(dto.name),
|
|
67
67
|
createdAt: dto.createdAt ?? void 0,
|
|
68
68
|
status: mapDocumentStatus(wire.status),
|
|
@@ -119,11 +119,11 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
119
119
|
});
|
|
120
120
|
};
|
|
121
121
|
const loadDocuments = async (workspaceId, signal) => {
|
|
122
|
-
const res = await
|
|
122
|
+
const res = await listWorkspaceDocuments(workspaceId, {
|
|
123
123
|
page: 1,
|
|
124
124
|
pageSize: PAGE_SIZE
|
|
125
125
|
}, { signal });
|
|
126
|
-
const documents = res.documents.map(
|
|
126
|
+
const documents = res.documents.map(mapWireDocumentToWorkspaceDocument);
|
|
127
127
|
patchState(store, (state) => ({ documentPagination: {
|
|
128
128
|
...state.documentPagination,
|
|
129
129
|
[workspaceId]: {
|
|
@@ -143,12 +143,12 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
143
143
|
const load = async () => {
|
|
144
144
|
patchState(store, { loading: true });
|
|
145
145
|
try {
|
|
146
|
-
const res = await
|
|
146
|
+
const res = await listWorkspaces({
|
|
147
147
|
page: 1,
|
|
148
148
|
pageSize: PAGE_SIZE
|
|
149
149
|
});
|
|
150
150
|
patchState(store, {
|
|
151
|
-
workspaces: res.
|
|
151
|
+
workspaces: res.workspaces.map(mapWireWorkspaceToWorkspace),
|
|
152
152
|
pagination: {
|
|
153
153
|
page: res.page,
|
|
154
154
|
total: res.total
|
|
@@ -187,13 +187,13 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
187
187
|
try {
|
|
188
188
|
const current = store.workspaces();
|
|
189
189
|
const page = Math.min(store.pagination().page + 1, Math.floor(current.length / PAGE_SIZE) + 1);
|
|
190
|
-
const res = await
|
|
190
|
+
const res = await listWorkspaces({
|
|
191
191
|
page,
|
|
192
192
|
pageSize: PAGE_SIZE
|
|
193
193
|
});
|
|
194
194
|
patchState(store, (state) => {
|
|
195
195
|
const loaded = new Set(state.workspaces.map((w) => w.id));
|
|
196
|
-
const fresh = res.
|
|
196
|
+
const fresh = res.workspaces.map(mapWireWorkspaceToWorkspace).filter((w) => !loaded.has(w.id));
|
|
197
197
|
return {
|
|
198
198
|
workspaces: [...state.workspaces, ...fresh],
|
|
199
199
|
pagination: {
|
|
@@ -210,12 +210,12 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
210
210
|
return loadingMorePromise;
|
|
211
211
|
},
|
|
212
212
|
async fetch(id) {
|
|
213
|
-
const workspace =
|
|
213
|
+
const workspace = mapWireWorkspaceToWorkspace(await getWorkspace(id));
|
|
214
214
|
patchState(store, (state) => ({ workspaces: state.workspaces.some((w) => w.id === id) ? state.workspaces.map((w) => w.id === id ? workspace : w) : [...state.workspaces, workspace] }));
|
|
215
215
|
return workspace;
|
|
216
216
|
},
|
|
217
217
|
async create({ name, description = "", tags = [], owners = [], readers = [] }) {
|
|
218
|
-
const workspace =
|
|
218
|
+
const workspace = mapWireWorkspaceToWorkspace(await createWorkspace({
|
|
219
219
|
name,
|
|
220
220
|
description,
|
|
221
221
|
tags,
|
|
@@ -237,12 +237,12 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
237
237
|
},
|
|
238
238
|
async update(id, patch) {
|
|
239
239
|
if (!store.workspaces().some((w) => w.id === id)) return null;
|
|
240
|
-
const updated =
|
|
240
|
+
const updated = mapWireWorkspaceToWorkspace(await updateWorkspace(id, patch));
|
|
241
241
|
patchState(store, (state) => ({ workspaces: state.workspaces.map((w) => w.id === id ? updated : w) }));
|
|
242
242
|
return updated;
|
|
243
243
|
},
|
|
244
244
|
async remove(ids) {
|
|
245
|
-
const result = await
|
|
245
|
+
const result = await deleteWorkspaces(ids);
|
|
246
246
|
const succeeded = new Set(result.succeeded);
|
|
247
247
|
patchState(store, (state) => ({
|
|
248
248
|
workspaces: state.workspaces.filter((w) => !succeeded.has(w.id)),
|
|
@@ -256,7 +256,7 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
256
256
|
return {
|
|
257
257
|
succeeded: result.succeeded,
|
|
258
258
|
failed: result.failed.map((f) => ({
|
|
259
|
-
id: f.
|
|
259
|
+
id: f.workspaceId,
|
|
260
260
|
error: f.error
|
|
261
261
|
}))
|
|
262
262
|
};
|
|
@@ -279,12 +279,12 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
279
279
|
const pagination = store.documentPagination()[workspaceId];
|
|
280
280
|
if (!pagination || current.length >= pagination.total) return current;
|
|
281
281
|
const page = Math.min(pagination.page + 1, Math.floor(current.length / PAGE_SIZE) + 1);
|
|
282
|
-
const res = await
|
|
282
|
+
const res = await listWorkspaceDocuments(workspaceId, {
|
|
283
283
|
page,
|
|
284
284
|
pageSize: PAGE_SIZE
|
|
285
285
|
});
|
|
286
286
|
const loaded = new Set(current.map((d) => d.id));
|
|
287
|
-
const fresh = res.documents.map(
|
|
287
|
+
const fresh = res.documents.map(mapWireDocumentToWorkspaceDocument).filter((d) => !loaded.has(d.id));
|
|
288
288
|
const merged = [...current, ...fresh];
|
|
289
289
|
patchState(store, (state) => ({ documentPagination: {
|
|
290
290
|
...state.documentPagination,
|
|
@@ -316,13 +316,13 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
316
316
|
} }));
|
|
317
317
|
},
|
|
318
318
|
async saveDocuments(workspaceId, documents) {
|
|
319
|
-
const mapped = (await
|
|
319
|
+
const mapped = (await addWorkspaceDocuments(workspaceId, documents.map((d) => ({ name: d.name })))).map(mapWireDocumentToWorkspaceDocument);
|
|
320
320
|
setDocuments(workspaceId, [...store.documents()[workspaceId] ?? [], ...mapped]);
|
|
321
321
|
adjustDocumentCount(workspaceId, mapped.length);
|
|
322
322
|
return mapped;
|
|
323
323
|
},
|
|
324
324
|
async removeDocuments(workspaceId, documentIds) {
|
|
325
|
-
await
|
|
325
|
+
await deleteWorkspaceDocuments(workspaceId, documentIds);
|
|
326
326
|
const before = store.documents()[workspaceId] ?? [];
|
|
327
327
|
const after = before.filter((d) => !documentIds.includes(d.id));
|
|
328
328
|
setDocuments(workspaceId, after);
|
|
@@ -333,10 +333,10 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
333
333
|
const from = store.documents()[fromWorkspaceId] ?? [];
|
|
334
334
|
const moved = from.filter((d) => documentIds.includes(d.id));
|
|
335
335
|
if (!moved.length) return;
|
|
336
|
-
const created = await
|
|
337
|
-
setDocuments(toWorkspaceId, [...store.documents()[toWorkspaceId] ?? [], ...created.map(
|
|
336
|
+
const created = await addWorkspaceDocuments(toWorkspaceId, moved.map((d) => ({ name: d.name })));
|
|
337
|
+
setDocuments(toWorkspaceId, [...store.documents()[toWorkspaceId] ?? [], ...created.map(mapWireDocumentToWorkspaceDocument)]);
|
|
338
338
|
adjustDocumentCount(toWorkspaceId, created.length);
|
|
339
|
-
await
|
|
339
|
+
await deleteWorkspaceDocuments(fromWorkspaceId, documentIds);
|
|
340
340
|
const remaining = from.filter((d) => !documentIds.includes(d.id));
|
|
341
341
|
setDocuments(fromWorkspaceId, remaining);
|
|
342
342
|
adjustDocumentCount(fromWorkspaceId, remaining.length - from.length);
|
|
@@ -734,13 +734,13 @@ function isJobTerminal(job) {
|
|
|
734
734
|
return job.indexingStatus === "complete" || job.indexingStatus === "failed" || job.indexingStatus === "interrupted";
|
|
735
735
|
}
|
|
736
736
|
function allJobs(res) {
|
|
737
|
-
return (res.
|
|
737
|
+
return (res.workspaces ?? []).flatMap((c) => c.jobs ?? []);
|
|
738
738
|
}
|
|
739
|
-
function
|
|
740
|
-
return (res.
|
|
739
|
+
function workspaceJobs(res) {
|
|
740
|
+
return (res.workspaces ?? []).flatMap((c) => (c.jobs ?? []).map((job) => ({
|
|
741
741
|
job,
|
|
742
|
-
|
|
743
|
-
|
|
742
|
+
workspaceId: c.workspaceId,
|
|
743
|
+
workspaceName: c.workspaceName
|
|
744
744
|
})));
|
|
745
745
|
}
|
|
746
746
|
const FINISHED_UPLOAD_VISIBLE_MS = 12e4;
|
|
@@ -1059,7 +1059,7 @@ var UploadService = class UploadService {
|
|
|
1059
1059
|
}
|
|
1060
1060
|
async runPollTick(signal) {
|
|
1061
1061
|
const workspaceId = this.focusedWorkspaceId;
|
|
1062
|
-
const response = await fetchUploadStatus(workspaceId ? {
|
|
1062
|
+
const response = await fetchUploadStatus(workspaceId ? { workspaceId } : {}, { signal });
|
|
1063
1063
|
const jobs = allJobs(response);
|
|
1064
1064
|
const remote = await this.remoteJobs(response, signal);
|
|
1065
1065
|
let changed = this.tracker.applyRemoteJobs(remote);
|
|
@@ -1076,12 +1076,12 @@ var UploadService = class UploadService {
|
|
|
1076
1076
|
const me = (await this.currentUser.whenReady())?.id;
|
|
1077
1077
|
if (signal.aborted) return [];
|
|
1078
1078
|
const entries = [];
|
|
1079
|
-
for (const { job,
|
|
1080
|
-
if (this.focusedWorkspaceId && this.focusedWorkspaceId !==
|
|
1081
|
-
const workspaceName = this.workspaces.workspace(
|
|
1079
|
+
for (const { job, workspaceId, workspaceName: apiName } of workspaceJobs(response)) {
|
|
1080
|
+
if (this.focusedWorkspaceId && this.focusedWorkspaceId !== workspaceId) continue;
|
|
1081
|
+
const workspaceName = this.workspaces.workspace(workspaceId)?.name ?? apiName;
|
|
1082
1082
|
entries.push({
|
|
1083
1083
|
job,
|
|
1084
|
-
workspaceId
|
|
1084
|
+
workspaceId,
|
|
1085
1085
|
workspaceName,
|
|
1086
1086
|
mine: !!me && job.initiatedBy === me
|
|
1087
1087
|
});
|
|
@@ -2072,7 +2072,7 @@ function injectTextSearch({ root, query, debounce = 200 }) {
|
|
|
2072
2072
|
previous: () => move(-1)
|
|
2073
2073
|
};
|
|
2074
2074
|
}
|
|
2075
|
-
function injectWorkspaceFilter(workspaces) {
|
|
2075
|
+
function injectWorkspaceFilter(workspaces, options = {}) {
|
|
2076
2076
|
assertInInjectionContext(injectWorkspaceFilter);
|
|
2077
2077
|
const tab = signal("all", ...ngDevMode ? [{ debugName: "tab" }] : /* istanbul ignore next */ []);
|
|
2078
2078
|
const query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
|
|
@@ -2088,7 +2088,9 @@ function injectWorkspaceFilter(workspaces) {
|
|
|
2088
2088
|
};
|
|
2089
2089
|
}, ...ngDevMode ? [{ debugName: "counts" }] : /* istanbul ignore next */ []),
|
|
2090
2090
|
filtered: computed(() => workspaces().filter((w) => {
|
|
2091
|
-
|
|
2091
|
+
const inTab = tab() === "all" || tab() === "editor" === canWrite(w.currentUserRole);
|
|
2092
|
+
const inQuery = matchesText(w.name, query()) || options.fields?.() === "name+description" && matchesText(w.description, query());
|
|
2093
|
+
return inTab && inQuery;
|
|
2092
2094
|
}), ...ngDevMode ? [{ debugName: "filtered" }] : /* istanbul ignore next */ []),
|
|
2093
2095
|
clearQuery: () => query.set("")
|
|
2094
2096
|
};
|
|
@@ -10410,76 +10412,341 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
10410
10412
|
}]
|
|
10411
10413
|
}
|
|
10412
10414
|
});
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
if (!this.store.loaded()) this.store.ensureLoaded().then(() => this.status.set("ready"), () => this.status.set("error"));
|
|
10426
|
-
}
|
|
10427
|
-
select(id) {
|
|
10428
|
-
this.store.toggleSelected(id, true);
|
|
10429
|
-
this.announce();
|
|
10430
|
-
}
|
|
10431
|
-
toggle(id, checked) {
|
|
10432
|
-
this.store.toggleSelected(id, checked);
|
|
10433
|
-
this.announce();
|
|
10415
|
+
const MENTION_TABS = [
|
|
10416
|
+
{
|
|
10417
|
+
id: "all",
|
|
10418
|
+
labelKey: "documentWorkspaces.mention.tabAll"
|
|
10419
|
+
},
|
|
10420
|
+
{
|
|
10421
|
+
id: "editor",
|
|
10422
|
+
labelKey: "documentWorkspaces.mention.tabOwned"
|
|
10423
|
+
},
|
|
10424
|
+
{
|
|
10425
|
+
id: "reader",
|
|
10426
|
+
labelKey: "documentWorkspaces.mention.tabShared"
|
|
10434
10427
|
}
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10428
|
+
];
|
|
10429
|
+
function injectWorkspaceMention(options = {}) {
|
|
10430
|
+
assertInInjectionContext(injectWorkspaceMention);
|
|
10431
|
+
const store = inject(WorkspacesStore);
|
|
10432
|
+
const injector = inject(Injector);
|
|
10433
|
+
const filter = injectWorkspaceFilter(store.workspaces, { fields: options.searchFields });
|
|
10434
|
+
const loadStatus = signal(store.loaded() ? "ready" : "loading", ...ngDevMode ? [{ debugName: "loadStatus" }] : /* istanbul ignore next */ []);
|
|
10435
|
+
if (!store.loaded()) store.ensureLoaded().then(() => loadStatus.set("ready"), () => loadStatus.set("error"));
|
|
10436
|
+
const loadingMore = signal(false, ...ngDevMode ? [{ debugName: "loadingMore" }] : /* istanbul ignore next */ []);
|
|
10437
|
+
const hostIds = computed(() => options.selectedIds?.(), ...ngDevMode ? [{ debugName: "hostIds" }] : /* istanbul ignore next */ []);
|
|
10438
|
+
const listComplete = computed(() => store.loaded() && !store.hasMore() && !store.truncated(), ...ngDevMode ? [{ debugName: "listComplete" }] : /* istanbul ignore next */ []);
|
|
10439
|
+
const selectedIds = computed(() => {
|
|
10440
|
+
const host = hostIds();
|
|
10441
|
+
if (!host) return store.selectedIds();
|
|
10442
|
+
if (!listComplete()) return host;
|
|
10443
|
+
const known = new Set(store.workspaces().map((w) => w.id));
|
|
10444
|
+
return host.filter((id) => known.has(id));
|
|
10445
|
+
}, ...ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []);
|
|
10446
|
+
effect(() => {
|
|
10447
|
+
const host = hostIds();
|
|
10448
|
+
const kept = selectedIds();
|
|
10449
|
+
if (!host || host.length === kept.length) return;
|
|
10450
|
+
untracked(() => options.onSelectionChange?.({
|
|
10451
|
+
ids: [...kept],
|
|
10452
|
+
count: kept.length
|
|
10453
|
+
}));
|
|
10454
|
+
});
|
|
10455
|
+
const selectedSet = computed(() => new Set(selectedIds()), ...ngDevMode ? [{ debugName: "selectedSet" }] : /* istanbul ignore next */ []);
|
|
10456
|
+
const items = computed(() => {
|
|
10457
|
+
const only = options.predicate?.();
|
|
10458
|
+
return filter.filtered().filter((w) => !only || only(w)).map((w) => ({
|
|
10459
|
+
id: w.id,
|
|
10460
|
+
name: w.name,
|
|
10461
|
+
description: w.description,
|
|
10462
|
+
color: w.color,
|
|
10463
|
+
documentCount: w.documentCount,
|
|
10464
|
+
currentUserRole: w.currentUserRole,
|
|
10465
|
+
selected: selectedSet().has(w.id)
|
|
10466
|
+
}));
|
|
10467
|
+
}, ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
10468
|
+
const count = computed(() => selectedIds().length, ...ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []);
|
|
10469
|
+
const ticked = computed(() => items().filter((item) => item.selected).length, ...ngDevMode ? [{ debugName: "ticked" }] : /* istanbul ignore next */ []);
|
|
10470
|
+
const allSelected = computed(() => items().length > 0 && ticked() === items().length, ...ngDevMode ? [{ debugName: "allSelected" }] : /* istanbul ignore next */ []);
|
|
10471
|
+
const partiallySelected = computed(() => ticked() > 0 && !allSelected(), ...ngDevMode ? [{ debugName: "partiallySelected" }] : /* istanbul ignore next */ []);
|
|
10472
|
+
const commit = (ids) => {
|
|
10473
|
+
if (!options.selectedIds?.()) {
|
|
10474
|
+
const next = new Set(ids);
|
|
10475
|
+
for (const id of selectedSet()) if (!next.has(id)) store.toggleSelected(id, false);
|
|
10476
|
+
for (const id of next) if (!selectedSet().has(id)) store.toggleSelected(id, true);
|
|
10477
|
+
}
|
|
10478
|
+
options.onSelectionChange?.({
|
|
10479
|
+
ids: [...ids],
|
|
10480
|
+
count: ids.length
|
|
10439
10481
|
});
|
|
10482
|
+
};
|
|
10483
|
+
const toggle = (id, checked) => {
|
|
10484
|
+
const without = selectedIds().filter((selected) => selected !== id);
|
|
10485
|
+
commit(checked ? [...without, id] : without);
|
|
10486
|
+
};
|
|
10487
|
+
return {
|
|
10488
|
+
query: filter.query,
|
|
10489
|
+
clearQuery: filter.clearQuery,
|
|
10490
|
+
tab: filter.tab,
|
|
10491
|
+
tabs: MENTION_TABS,
|
|
10492
|
+
counts: filter.counts,
|
|
10493
|
+
status: loadStatus.asReadonly(),
|
|
10494
|
+
hasMore: store.hasMore,
|
|
10495
|
+
truncated: store.truncated,
|
|
10496
|
+
loadingMore: loadingMore.asReadonly(),
|
|
10497
|
+
async loadMore() {
|
|
10498
|
+
loadingMore.set(true);
|
|
10499
|
+
try {
|
|
10500
|
+
await store.loadMore();
|
|
10501
|
+
} finally {
|
|
10502
|
+
loadingMore.set(false);
|
|
10503
|
+
}
|
|
10504
|
+
},
|
|
10505
|
+
items,
|
|
10506
|
+
count,
|
|
10507
|
+
ids: selectedIds,
|
|
10508
|
+
allSelected,
|
|
10509
|
+
partiallySelected,
|
|
10510
|
+
isSelected: (id) => selectedSet().has(id),
|
|
10511
|
+
toggle,
|
|
10512
|
+
toggleAll: () => {
|
|
10513
|
+
const displayed = items().map((item) => item.id);
|
|
10514
|
+
if (allSelected()) {
|
|
10515
|
+
const drop = new Set(displayed);
|
|
10516
|
+
commit(selectedIds().filter((id) => !drop.has(id)));
|
|
10517
|
+
} else commit([.../* @__PURE__ */ new Set([...selectedIds(), ...displayed])]);
|
|
10518
|
+
},
|
|
10519
|
+
select: (id) => toggle(id, true),
|
|
10520
|
+
async create() {
|
|
10521
|
+
const result = await EditWorkspace.call({ mode: "add" }, { injector });
|
|
10522
|
+
if (typeof result !== "object") return null;
|
|
10523
|
+
const { workspace } = result;
|
|
10524
|
+
filter.tab.set("all");
|
|
10525
|
+
filter.clearQuery();
|
|
10526
|
+
toggle(workspace.id, true);
|
|
10527
|
+
options.onCreated?.(workspace);
|
|
10528
|
+
return workspace;
|
|
10529
|
+
}
|
|
10530
|
+
};
|
|
10531
|
+
}
|
|
10532
|
+
const WORKSPACE_MENTION = new InjectionToken("WORKSPACE_MENTION");
|
|
10533
|
+
function injectWorkspaceMentionScope() {
|
|
10534
|
+
const scope = inject(WORKSPACE_MENTION, { optional: true });
|
|
10535
|
+
if (!scope) throw new Error("[atomic] This piece must be placed inside a <workspace-mention>.");
|
|
10536
|
+
return scope;
|
|
10537
|
+
}
|
|
10538
|
+
function hasContent(slot) {
|
|
10539
|
+
return Array.from(slot.childNodes).some((node) => node.nodeType === Node.ELEMENT_NODE || node.nodeType === Node.TEXT_NODE && !!node.textContent?.trim());
|
|
10540
|
+
}
|
|
10541
|
+
var WorkspaceMentionNew = class WorkspaceMentionNew {
|
|
10542
|
+
variant = input("tertiary", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
|
|
10543
|
+
scheme = input("neutral", ...ngDevMode ? [{ debugName: "scheme" }] : /* istanbul ignore next */ []);
|
|
10544
|
+
size = input("sm", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
10545
|
+
mention = injectWorkspaceMentionScope();
|
|
10546
|
+
slot = viewChild.required("slot", ...ngDevMode ? [{ debugName: "slot" }] : /* istanbul ignore next */ []);
|
|
10547
|
+
custom = signal(false, ...ngDevMode ? [{ debugName: "custom" }] : /* istanbul ignore next */ []);
|
|
10548
|
+
ngAfterContentInit() {
|
|
10549
|
+
this.custom.set(hasContent(this.slot().nativeElement));
|
|
10550
|
+
}
|
|
10551
|
+
create() {
|
|
10552
|
+
this.mention.create();
|
|
10440
10553
|
}
|
|
10441
10554
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
10442
10555
|
minVersion: "12.0.0",
|
|
10443
10556
|
version: "22.2.1",
|
|
10444
10557
|
ngImport: i0,
|
|
10445
|
-
type:
|
|
10558
|
+
type: WorkspaceMentionNew,
|
|
10446
10559
|
deps: [],
|
|
10447
10560
|
target: i0.ɵɵFactoryTarget.Component
|
|
10448
10561
|
});
|
|
10449
10562
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
10450
10563
|
minVersion: "17.0.0",
|
|
10451
10564
|
version: "22.2.1",
|
|
10452
|
-
type:
|
|
10565
|
+
type: WorkspaceMentionNew,
|
|
10453
10566
|
isStandalone: true,
|
|
10454
|
-
selector: "workspace-mention-
|
|
10455
|
-
|
|
10456
|
-
|
|
10567
|
+
selector: "workspace-mention-new",
|
|
10568
|
+
inputs: {
|
|
10569
|
+
variant: {
|
|
10570
|
+
classPropertyName: "variant",
|
|
10571
|
+
publicName: "variant",
|
|
10572
|
+
isSignal: true,
|
|
10573
|
+
isRequired: false,
|
|
10574
|
+
transformFunction: null
|
|
10575
|
+
},
|
|
10576
|
+
scheme: {
|
|
10577
|
+
classPropertyName: "scheme",
|
|
10578
|
+
publicName: "scheme",
|
|
10579
|
+
isSignal: true,
|
|
10580
|
+
isRequired: false,
|
|
10581
|
+
transformFunction: null
|
|
10582
|
+
},
|
|
10583
|
+
size: {
|
|
10584
|
+
classPropertyName: "size",
|
|
10585
|
+
publicName: "size",
|
|
10586
|
+
isSignal: true,
|
|
10587
|
+
isRequired: false,
|
|
10588
|
+
transformFunction: null
|
|
10589
|
+
}
|
|
10590
|
+
},
|
|
10591
|
+
host: { classAttribute: "inline-block" },
|
|
10457
10592
|
providers: [provideTranslocoScope("document-workspaces")],
|
|
10593
|
+
viewQueries: [{
|
|
10594
|
+
propertyName: "slot",
|
|
10595
|
+
first: true,
|
|
10596
|
+
predicate: ["slot"],
|
|
10597
|
+
descendants: true,
|
|
10598
|
+
isSignal: true
|
|
10599
|
+
}],
|
|
10458
10600
|
ngImport: i0,
|
|
10459
10601
|
template: `
|
|
10460
|
-
|
|
10602
|
+
<button type="button" [variant]="variant()" [scheme]="scheme()" [size]="size()" (click)="create()">
|
|
10603
|
+
<span #slot class="contents"><ng-content /></span>
|
|
10604
|
+
@if (!custom()) {
|
|
10605
|
+
<plus-icon />
|
|
10606
|
+
{{ "documentWorkspaces.mention.newWorkspace" | transloco }}
|
|
10607
|
+
}
|
|
10608
|
+
</button>
|
|
10609
|
+
`,
|
|
10610
|
+
isInline: true,
|
|
10611
|
+
dependencies: [
|
|
10612
|
+
{
|
|
10613
|
+
kind: "directive",
|
|
10614
|
+
type: ButtonComponent,
|
|
10615
|
+
selector: "button",
|
|
10616
|
+
inputs: [
|
|
10617
|
+
"class",
|
|
10618
|
+
"variant",
|
|
10619
|
+
"scheme",
|
|
10620
|
+
"iconOnly",
|
|
10621
|
+
"size"
|
|
10622
|
+
]
|
|
10623
|
+
},
|
|
10624
|
+
{
|
|
10625
|
+
kind: "component",
|
|
10626
|
+
type: PlusIcon,
|
|
10627
|
+
selector: "plus, plus-icon, Plus, PlusIcon",
|
|
10628
|
+
inputs: ["class"]
|
|
10629
|
+
},
|
|
10630
|
+
{
|
|
10631
|
+
kind: "pipe",
|
|
10632
|
+
type: TranslocoPipe,
|
|
10633
|
+
name: "transloco"
|
|
10634
|
+
}
|
|
10635
|
+
],
|
|
10636
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
10637
|
+
});
|
|
10638
|
+
};
|
|
10639
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
10640
|
+
minVersion: "12.0.0",
|
|
10641
|
+
version: "22.2.1",
|
|
10642
|
+
ngImport: i0,
|
|
10643
|
+
type: WorkspaceMentionNew,
|
|
10644
|
+
decorators: [{
|
|
10645
|
+
type: Component,
|
|
10646
|
+
args: [{
|
|
10647
|
+
selector: "workspace-mention-new",
|
|
10648
|
+
imports: [
|
|
10649
|
+
TranslocoPipe,
|
|
10650
|
+
ButtonComponent,
|
|
10651
|
+
PlusIcon
|
|
10652
|
+
],
|
|
10653
|
+
providers: [provideTranslocoScope("document-workspaces")],
|
|
10654
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10655
|
+
host: { class: "inline-block" },
|
|
10656
|
+
template: `
|
|
10657
|
+
<button type="button" [variant]="variant()" [scheme]="scheme()" [size]="size()" (click)="create()">
|
|
10658
|
+
<span #slot class="contents"><ng-content /></span>
|
|
10659
|
+
@if (!custom()) {
|
|
10660
|
+
<plus-icon />
|
|
10661
|
+
{{ "documentWorkspaces.mention.newWorkspace" | transloco }}
|
|
10662
|
+
}
|
|
10663
|
+
</button>
|
|
10664
|
+
`
|
|
10665
|
+
}]
|
|
10666
|
+
}],
|
|
10667
|
+
propDecorators: {
|
|
10668
|
+
variant: [{
|
|
10669
|
+
type: i0.Input,
|
|
10670
|
+
args: [{
|
|
10671
|
+
isSignal: true,
|
|
10672
|
+
alias: "variant",
|
|
10673
|
+
required: false
|
|
10674
|
+
}]
|
|
10675
|
+
}],
|
|
10676
|
+
scheme: [{
|
|
10677
|
+
type: i0.Input,
|
|
10678
|
+
args: [{
|
|
10679
|
+
isSignal: true,
|
|
10680
|
+
alias: "scheme",
|
|
10681
|
+
required: false
|
|
10682
|
+
}]
|
|
10683
|
+
}],
|
|
10684
|
+
size: [{
|
|
10685
|
+
type: i0.Input,
|
|
10686
|
+
args: [{
|
|
10687
|
+
isSignal: true,
|
|
10688
|
+
alias: "size",
|
|
10689
|
+
required: false
|
|
10690
|
+
}]
|
|
10691
|
+
}],
|
|
10692
|
+
slot: [{
|
|
10693
|
+
type: i0.ViewChild,
|
|
10694
|
+
args: ["slot", { isSignal: true }]
|
|
10695
|
+
}]
|
|
10696
|
+
}
|
|
10697
|
+
});
|
|
10698
|
+
var WorkspaceMentionRows = class WorkspaceMentionRows {
|
|
10699
|
+
mention = injectWorkspaceMentionScope();
|
|
10700
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
10701
|
+
minVersion: "12.0.0",
|
|
10702
|
+
version: "22.2.1",
|
|
10703
|
+
ngImport: i0,
|
|
10704
|
+
type: WorkspaceMentionRows,
|
|
10705
|
+
deps: [],
|
|
10706
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
10707
|
+
});
|
|
10708
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
10709
|
+
minVersion: "17.0.0",
|
|
10710
|
+
version: "22.2.1",
|
|
10711
|
+
type: WorkspaceMentionRows,
|
|
10712
|
+
isStandalone: true,
|
|
10713
|
+
selector: "workspace-mention-rows",
|
|
10714
|
+
host: { classAttribute: "block min-h-0 max-h-(--workspace-mention-rows-max-height,18rem) flex-1 overflow-auto" },
|
|
10715
|
+
providers: [provideTranslocoScope("document-workspaces")],
|
|
10716
|
+
ngImport: i0,
|
|
10717
|
+
template: `
|
|
10718
|
+
@switch (mention.status()) {
|
|
10461
10719
|
@case ("loading") {
|
|
10462
|
-
<p class="px-
|
|
10720
|
+
<p class="px-(--spacing-xs) py-(--spacing-2xs) text-(length:--size-base) text-(--font-primary-muted)">{{ "documentWorkspaces.mention.loading" | transloco }}</p>
|
|
10463
10721
|
}
|
|
10464
10722
|
@case ("error") {
|
|
10465
|
-
<p class="px-
|
|
10723
|
+
<p class="px-(--spacing-xs) py-(--spacing-2xs) text-(length:--size-base) text-(--font-error-base)" role="alert">{{ "documentWorkspaces.mention.loadError" | transloco }}</p>
|
|
10466
10724
|
}
|
|
10467
10725
|
@default {
|
|
10468
|
-
|
|
10469
|
-
@
|
|
10470
|
-
<
|
|
10471
|
-
|
|
10472
|
-
|
|
10473
|
-
<workspace-icon size="md" [color]="item.color" />
|
|
10474
|
-
<span class="flex min-w-0 flex-col">
|
|
10475
|
-
<span class="truncate text-sm font-semibold text-(--font-neutral-black)">{{ item.name }}</span>
|
|
10476
|
-
<span class="text-xs text-(--font-primary-muted)">{{ "documentWorkspaces.mention.documentCount" | transloco: { count: item.documentCount } }}</span>
|
|
10477
|
-
</span>
|
|
10478
|
-
</span>
|
|
10479
|
-
</checkbox>
|
|
10480
|
-
</li>
|
|
10726
|
+
@if (!mention.items().length) {
|
|
10727
|
+
@if (mention.query()) {
|
|
10728
|
+
<p class="px-(--spacing-xs) py-(--spacing-2xs) text-(length:--size-base) text-(--font-primary-muted)" data-testid="no-match">{{ "documentWorkspaces.mention.noMatch" | transloco }}</p>
|
|
10729
|
+
} @else {
|
|
10730
|
+
<p class="px-(--spacing-xs) py-(--spacing-2xs) text-(length:--size-base) text-(--font-primary-muted)" data-testid="empty">{{ "documentWorkspaces.mention.empty" | transloco }}</p>
|
|
10481
10731
|
}
|
|
10482
|
-
|
|
10732
|
+
} @else {
|
|
10733
|
+
<!-- The checkbox carries the semantics (a checkbox in a list): no listbox/option around it. -->
|
|
10734
|
+
<ul class="flex flex-col">
|
|
10735
|
+
@for (item of mention.items(); track item.id) {
|
|
10736
|
+
<li class="rounded-(--radius-sm) hover:bg-(--bg-primary-lightest) data-selected:bg-(--bg-primary-lighter)" [attr.data-selected]="item.selected ? '' : null">
|
|
10737
|
+
<checkbox class="w-full items-center gap-(--spacing-xs) px-(--spacing-xs) py-(--spacing-2xs)" [checked]="item.selected" (checkedChange)="mention.toggle(item.id, $event)">
|
|
10738
|
+
<span class="flex items-center gap-(--spacing-xs)">
|
|
10739
|
+
<workspace-icon size="md" [color]="item.color" />
|
|
10740
|
+
<span class="flex min-w-0 flex-col">
|
|
10741
|
+
<span class="truncate text-(length:--size-base) font-semibold text-(--font-neutral-black)">{{ item.name }}</span>
|
|
10742
|
+
<span class="text-(length:--size-sm) text-(--font-primary-muted)">{{ "documentWorkspaces.mention.documentCount" | transloco: { count: item.documentCount } }}</span>
|
|
10743
|
+
</span>
|
|
10744
|
+
</span>
|
|
10745
|
+
</checkbox>
|
|
10746
|
+
</li>
|
|
10747
|
+
}
|
|
10748
|
+
</ul>
|
|
10749
|
+
}
|
|
10483
10750
|
}
|
|
10484
10751
|
}
|
|
10485
10752
|
`,
|
|
@@ -10518,11 +10785,11 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
10518
10785
|
minVersion: "12.0.0",
|
|
10519
10786
|
version: "22.2.1",
|
|
10520
10787
|
ngImport: i0,
|
|
10521
|
-
type:
|
|
10788
|
+
type: WorkspaceMentionRows,
|
|
10522
10789
|
decorators: [{
|
|
10523
10790
|
type: Component,
|
|
10524
10791
|
args: [{
|
|
10525
|
-
selector: "workspace-mention-
|
|
10792
|
+
selector: "workspace-mention-rows",
|
|
10526
10793
|
imports: [
|
|
10527
10794
|
TranslocoPipe,
|
|
10528
10795
|
CheckboxComponent,
|
|
@@ -10530,40 +10797,915 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
10530
10797
|
],
|
|
10531
10798
|
providers: [provideTranslocoScope("document-workspaces")],
|
|
10532
10799
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10533
|
-
host: { class: "block max-h-
|
|
10800
|
+
host: { class: "block min-h-0 max-h-(--workspace-mention-rows-max-height,18rem) flex-1 overflow-auto" },
|
|
10534
10801
|
template: `
|
|
10535
|
-
@switch (status()) {
|
|
10802
|
+
@switch (mention.status()) {
|
|
10536
10803
|
@case ("loading") {
|
|
10537
|
-
<p class="px-
|
|
10804
|
+
<p class="px-(--spacing-xs) py-(--spacing-2xs) text-(length:--size-base) text-(--font-primary-muted)">{{ "documentWorkspaces.mention.loading" | transloco }}</p>
|
|
10538
10805
|
}
|
|
10539
10806
|
@case ("error") {
|
|
10540
|
-
<p class="px-
|
|
10807
|
+
<p class="px-(--spacing-xs) py-(--spacing-2xs) text-(length:--size-base) text-(--font-error-base)" role="alert">{{ "documentWorkspaces.mention.loadError" | transloco }}</p>
|
|
10541
10808
|
}
|
|
10542
10809
|
@default {
|
|
10543
|
-
|
|
10544
|
-
@
|
|
10545
|
-
<
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
<workspace-icon size="md" [color]="item.color" />
|
|
10549
|
-
<span class="flex min-w-0 flex-col">
|
|
10550
|
-
<span class="truncate text-sm font-semibold text-(--font-neutral-black)">{{ item.name }}</span>
|
|
10551
|
-
<span class="text-xs text-(--font-primary-muted)">{{ "documentWorkspaces.mention.documentCount" | transloco: { count: item.documentCount } }}</span>
|
|
10552
|
-
</span>
|
|
10553
|
-
</span>
|
|
10554
|
-
</checkbox>
|
|
10555
|
-
</li>
|
|
10810
|
+
@if (!mention.items().length) {
|
|
10811
|
+
@if (mention.query()) {
|
|
10812
|
+
<p class="px-(--spacing-xs) py-(--spacing-2xs) text-(length:--size-base) text-(--font-primary-muted)" data-testid="no-match">{{ "documentWorkspaces.mention.noMatch" | transloco }}</p>
|
|
10813
|
+
} @else {
|
|
10814
|
+
<p class="px-(--spacing-xs) py-(--spacing-2xs) text-(length:--size-base) text-(--font-primary-muted)" data-testid="empty">{{ "documentWorkspaces.mention.empty" | transloco }}</p>
|
|
10556
10815
|
}
|
|
10557
|
-
|
|
10816
|
+
} @else {
|
|
10817
|
+
<!-- The checkbox carries the semantics (a checkbox in a list): no listbox/option around it. -->
|
|
10818
|
+
<ul class="flex flex-col">
|
|
10819
|
+
@for (item of mention.items(); track item.id) {
|
|
10820
|
+
<li class="rounded-(--radius-sm) hover:bg-(--bg-primary-lightest) data-selected:bg-(--bg-primary-lighter)" [attr.data-selected]="item.selected ? '' : null">
|
|
10821
|
+
<checkbox class="w-full items-center gap-(--spacing-xs) px-(--spacing-xs) py-(--spacing-2xs)" [checked]="item.selected" (checkedChange)="mention.toggle(item.id, $event)">
|
|
10822
|
+
<span class="flex items-center gap-(--spacing-xs)">
|
|
10823
|
+
<workspace-icon size="md" [color]="item.color" />
|
|
10824
|
+
<span class="flex min-w-0 flex-col">
|
|
10825
|
+
<span class="truncate text-(length:--size-base) font-semibold text-(--font-neutral-black)">{{ item.name }}</span>
|
|
10826
|
+
<span class="text-(length:--size-sm) text-(--font-primary-muted)">{{ "documentWorkspaces.mention.documentCount" | transloco: { count: item.documentCount } }}</span>
|
|
10827
|
+
</span>
|
|
10828
|
+
</span>
|
|
10829
|
+
</checkbox>
|
|
10830
|
+
</li>
|
|
10831
|
+
}
|
|
10832
|
+
</ul>
|
|
10833
|
+
}
|
|
10558
10834
|
}
|
|
10559
10835
|
}
|
|
10560
10836
|
`
|
|
10561
10837
|
}]
|
|
10562
|
-
}]
|
|
10563
|
-
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10838
|
+
}]
|
|
10839
|
+
});
|
|
10840
|
+
var WorkspaceMentionSearch = class WorkspaceMentionSearch {
|
|
10841
|
+
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
10842
|
+
textSize = input(...ngDevMode ? [void 0, { debugName: "textSize" }] : /* istanbul ignore next */ []);
|
|
10843
|
+
placeholder = input(...ngDevMode ? [void 0, { debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
10844
|
+
ariaLabel = input(void 0, {
|
|
10845
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
10846
|
+
alias: "aria-label"
|
|
10847
|
+
});
|
|
10848
|
+
mention = injectWorkspaceMentionScope();
|
|
10849
|
+
searchForm = form(this.mention.query);
|
|
10850
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
10851
|
+
minVersion: "12.0.0",
|
|
10852
|
+
version: "22.2.1",
|
|
10853
|
+
ngImport: i0,
|
|
10854
|
+
type: WorkspaceMentionSearch,
|
|
10855
|
+
deps: [],
|
|
10856
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
10857
|
+
});
|
|
10858
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
10859
|
+
minVersion: "17.1.0",
|
|
10860
|
+
version: "22.2.1",
|
|
10861
|
+
type: WorkspaceMentionSearch,
|
|
10862
|
+
isStandalone: true,
|
|
10863
|
+
selector: "workspace-mention-search",
|
|
10864
|
+
inputs: {
|
|
10865
|
+
size: {
|
|
10866
|
+
classPropertyName: "size",
|
|
10867
|
+
publicName: "size",
|
|
10868
|
+
isSignal: true,
|
|
10869
|
+
isRequired: false,
|
|
10870
|
+
transformFunction: null
|
|
10871
|
+
},
|
|
10872
|
+
textSize: {
|
|
10873
|
+
classPropertyName: "textSize",
|
|
10874
|
+
publicName: "textSize",
|
|
10875
|
+
isSignal: true,
|
|
10876
|
+
isRequired: false,
|
|
10877
|
+
transformFunction: null
|
|
10878
|
+
},
|
|
10879
|
+
placeholder: {
|
|
10880
|
+
classPropertyName: "placeholder",
|
|
10881
|
+
publicName: "placeholder",
|
|
10882
|
+
isSignal: true,
|
|
10883
|
+
isRequired: false,
|
|
10884
|
+
transformFunction: null
|
|
10885
|
+
},
|
|
10886
|
+
ariaLabel: {
|
|
10887
|
+
classPropertyName: "ariaLabel",
|
|
10888
|
+
publicName: "aria-label",
|
|
10889
|
+
isSignal: true,
|
|
10890
|
+
isRequired: false,
|
|
10891
|
+
transformFunction: null
|
|
10892
|
+
}
|
|
10893
|
+
},
|
|
10894
|
+
host: { classAttribute: "block" },
|
|
10895
|
+
providers: [provideTranslocoScope("document-workspaces")],
|
|
10896
|
+
ngImport: i0,
|
|
10897
|
+
template: `
|
|
10898
|
+
<SearchInput
|
|
10899
|
+
class="w-full"
|
|
10900
|
+
[size]="size()"
|
|
10901
|
+
[textSize]="textSize()"
|
|
10902
|
+
[formField]="searchForm"
|
|
10903
|
+
[placeholder]="placeholder() ?? ('documentWorkspaces.mention.searchPlaceholder' | transloco)"
|
|
10904
|
+
[aria-label]="ariaLabel() ?? placeholder() ?? ('documentWorkspaces.mention.searchPlaceholder' | transloco)"
|
|
10905
|
+
[clearLabel]="'documentWorkspaces.common.clearSearch' | transloco" />
|
|
10906
|
+
`,
|
|
10907
|
+
isInline: true,
|
|
10908
|
+
dependencies: [
|
|
10909
|
+
{
|
|
10910
|
+
kind: "directive",
|
|
10911
|
+
type: FormField,
|
|
10912
|
+
selector: "[formField]",
|
|
10913
|
+
inputs: ["formField"],
|
|
10914
|
+
exportAs: ["formField"]
|
|
10915
|
+
},
|
|
10916
|
+
{
|
|
10917
|
+
kind: "component",
|
|
10918
|
+
type: SearchInputComponent,
|
|
10919
|
+
selector: "SearchInput, search-input, searchinput",
|
|
10920
|
+
inputs: [
|
|
10921
|
+
"value",
|
|
10922
|
+
"placeholder",
|
|
10923
|
+
"disabled",
|
|
10924
|
+
"aria-label",
|
|
10925
|
+
"hotkey",
|
|
10926
|
+
"clearLabel",
|
|
10927
|
+
"class",
|
|
10928
|
+
"size",
|
|
10929
|
+
"textSize"
|
|
10930
|
+
],
|
|
10931
|
+
outputs: ["valueChange"]
|
|
10932
|
+
},
|
|
10933
|
+
{
|
|
10934
|
+
kind: "pipe",
|
|
10935
|
+
type: TranslocoPipe,
|
|
10936
|
+
name: "transloco"
|
|
10937
|
+
}
|
|
10938
|
+
],
|
|
10939
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
10940
|
+
});
|
|
10941
|
+
};
|
|
10942
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
10943
|
+
minVersion: "12.0.0",
|
|
10944
|
+
version: "22.2.1",
|
|
10945
|
+
ngImport: i0,
|
|
10946
|
+
type: WorkspaceMentionSearch,
|
|
10947
|
+
decorators: [{
|
|
10948
|
+
type: Component,
|
|
10949
|
+
args: [{
|
|
10950
|
+
selector: "workspace-mention-search",
|
|
10951
|
+
imports: [
|
|
10952
|
+
TranslocoPipe,
|
|
10953
|
+
FormField,
|
|
10954
|
+
SearchInputComponent
|
|
10955
|
+
],
|
|
10956
|
+
providers: [provideTranslocoScope("document-workspaces")],
|
|
10957
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10958
|
+
host: { class: "block" },
|
|
10959
|
+
template: `
|
|
10960
|
+
<SearchInput
|
|
10961
|
+
class="w-full"
|
|
10962
|
+
[size]="size()"
|
|
10963
|
+
[textSize]="textSize()"
|
|
10964
|
+
[formField]="searchForm"
|
|
10965
|
+
[placeholder]="placeholder() ?? ('documentWorkspaces.mention.searchPlaceholder' | transloco)"
|
|
10966
|
+
[aria-label]="ariaLabel() ?? placeholder() ?? ('documentWorkspaces.mention.searchPlaceholder' | transloco)"
|
|
10967
|
+
[clearLabel]="'documentWorkspaces.common.clearSearch' | transloco" />
|
|
10968
|
+
`
|
|
10969
|
+
}]
|
|
10970
|
+
}],
|
|
10971
|
+
propDecorators: {
|
|
10972
|
+
size: [{
|
|
10973
|
+
type: i0.Input,
|
|
10974
|
+
args: [{
|
|
10975
|
+
isSignal: true,
|
|
10976
|
+
alias: "size",
|
|
10977
|
+
required: false
|
|
10978
|
+
}]
|
|
10979
|
+
}],
|
|
10980
|
+
textSize: [{
|
|
10981
|
+
type: i0.Input,
|
|
10982
|
+
args: [{
|
|
10983
|
+
isSignal: true,
|
|
10984
|
+
alias: "textSize",
|
|
10985
|
+
required: false
|
|
10986
|
+
}]
|
|
10987
|
+
}],
|
|
10988
|
+
placeholder: [{
|
|
10989
|
+
type: i0.Input,
|
|
10990
|
+
args: [{
|
|
10991
|
+
isSignal: true,
|
|
10992
|
+
alias: "placeholder",
|
|
10993
|
+
required: false
|
|
10994
|
+
}]
|
|
10995
|
+
}],
|
|
10996
|
+
ariaLabel: [{
|
|
10997
|
+
type: i0.Input,
|
|
10998
|
+
args: [{
|
|
10999
|
+
isSignal: true,
|
|
11000
|
+
alias: "aria-label",
|
|
11001
|
+
required: false
|
|
11002
|
+
}]
|
|
11003
|
+
}]
|
|
11004
|
+
}
|
|
11005
|
+
});
|
|
11006
|
+
var WorkspaceMentionSelectAll = class WorkspaceMentionSelectAll {
|
|
11007
|
+
mention = injectWorkspaceMentionScope();
|
|
11008
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
11009
|
+
minVersion: "12.0.0",
|
|
11010
|
+
version: "22.2.1",
|
|
11011
|
+
ngImport: i0,
|
|
11012
|
+
type: WorkspaceMentionSelectAll,
|
|
11013
|
+
deps: [],
|
|
11014
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
11015
|
+
});
|
|
11016
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
11017
|
+
minVersion: "17.0.0",
|
|
11018
|
+
version: "22.2.1",
|
|
11019
|
+
type: WorkspaceMentionSelectAll,
|
|
11020
|
+
isStandalone: true,
|
|
11021
|
+
selector: "workspace-mention-select-all",
|
|
11022
|
+
host: { classAttribute: "block" },
|
|
11023
|
+
providers: [provideTranslocoScope("document-workspaces")],
|
|
11024
|
+
ngImport: i0,
|
|
11025
|
+
template: `
|
|
11026
|
+
@if (mention.status() === "ready" && mention.items().length) {
|
|
11027
|
+
<checkbox class="items-center gap-(--spacing-xs)" [checked]="mention.allSelected()" [indeterminate]="mention.partiallySelected()" (checkedChange)="mention.toggleAll()">
|
|
11028
|
+
<span class="text-(length:--size-base) text-(--font-neutral-black)">{{ (mention.allSelected() ? "documentWorkspaces.mention.unselectAll" : "documentWorkspaces.mention.selectAll") | transloco }}</span>
|
|
11029
|
+
</checkbox>
|
|
11030
|
+
}
|
|
11031
|
+
`,
|
|
11032
|
+
isInline: true,
|
|
11033
|
+
dependencies: [{
|
|
11034
|
+
kind: "component",
|
|
11035
|
+
type: CheckboxComponent,
|
|
11036
|
+
selector: "checkbox, Checkbox",
|
|
11037
|
+
inputs: [
|
|
11038
|
+
"checked",
|
|
11039
|
+
"disabled",
|
|
11040
|
+
"indeterminate",
|
|
11041
|
+
"hint",
|
|
11042
|
+
"class",
|
|
11043
|
+
"aria-label"
|
|
11044
|
+
],
|
|
11045
|
+
outputs: ["checkedChange"]
|
|
11046
|
+
}, {
|
|
11047
|
+
kind: "pipe",
|
|
11048
|
+
type: TranslocoPipe,
|
|
11049
|
+
name: "transloco"
|
|
11050
|
+
}],
|
|
11051
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
11052
|
+
});
|
|
11053
|
+
};
|
|
11054
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
11055
|
+
minVersion: "12.0.0",
|
|
11056
|
+
version: "22.2.1",
|
|
11057
|
+
ngImport: i0,
|
|
11058
|
+
type: WorkspaceMentionSelectAll,
|
|
11059
|
+
decorators: [{
|
|
11060
|
+
type: Component,
|
|
11061
|
+
args: [{
|
|
11062
|
+
selector: "workspace-mention-select-all",
|
|
11063
|
+
imports: [TranslocoPipe, CheckboxComponent],
|
|
11064
|
+
providers: [provideTranslocoScope("document-workspaces")],
|
|
11065
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11066
|
+
host: { class: "block" },
|
|
11067
|
+
template: `
|
|
11068
|
+
@if (mention.status() === "ready" && mention.items().length) {
|
|
11069
|
+
<checkbox class="items-center gap-(--spacing-xs)" [checked]="mention.allSelected()" [indeterminate]="mention.partiallySelected()" (checkedChange)="mention.toggleAll()">
|
|
11070
|
+
<span class="text-(length:--size-base) text-(--font-neutral-black)">{{ (mention.allSelected() ? "documentWorkspaces.mention.unselectAll" : "documentWorkspaces.mention.selectAll") | transloco }}</span>
|
|
11071
|
+
</checkbox>
|
|
11072
|
+
}
|
|
11073
|
+
`
|
|
11074
|
+
}]
|
|
11075
|
+
}]
|
|
11076
|
+
});
|
|
11077
|
+
var WorkspaceMention = class WorkspaceMention {
|
|
11078
|
+
searchFields = input("name", ...ngDevMode ? [{ debugName: "searchFields" }] : /* istanbul ignore next */ []);
|
|
11079
|
+
selectedIds = input(void 0, ...ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []);
|
|
11080
|
+
predicate = input(void 0, ...ngDevMode ? [{ debugName: "predicate" }] : /* istanbul ignore next */ []);
|
|
11081
|
+
searchable = input(false, {
|
|
11082
|
+
...ngDevMode ? { debugName: "searchable" } : /* istanbul ignore next */ {},
|
|
11083
|
+
transform: booleanAttribute
|
|
11084
|
+
});
|
|
11085
|
+
selectAll = input(false, {
|
|
11086
|
+
...ngDevMode ? { debugName: "selectAll" } : /* istanbul ignore next */ {},
|
|
11087
|
+
transform: booleanAttribute
|
|
11088
|
+
});
|
|
11089
|
+
allowCreate = input(false, {
|
|
11090
|
+
...ngDevMode ? { debugName: "allowCreate" } : /* istanbul ignore next */ {},
|
|
11091
|
+
transform: booleanAttribute
|
|
11092
|
+
});
|
|
11093
|
+
selectionChanged = output();
|
|
11094
|
+
workspaceCreated = output();
|
|
11095
|
+
slot = viewChild.required("slot", ...ngDevMode ? [{ debugName: "slot" }] : /* istanbul ignore next */ []);
|
|
11096
|
+
custom = signal(false, ...ngDevMode ? [{ debugName: "custom" }] : /* istanbul ignore next */ []);
|
|
11097
|
+
state = injectWorkspaceMention({
|
|
11098
|
+
searchFields: () => this.searchFields(),
|
|
11099
|
+
selectedIds: () => this.selectedIds(),
|
|
11100
|
+
predicate: () => this.predicate(),
|
|
11101
|
+
onSelectionChange: (selection) => this.selectionChanged.emit(selection),
|
|
11102
|
+
onCreated: (workspace) => this.workspaceCreated.emit(workspace)
|
|
11103
|
+
});
|
|
11104
|
+
query = this.state.query;
|
|
11105
|
+
clearQuery = this.state.clearQuery;
|
|
11106
|
+
tab = this.state.tab;
|
|
11107
|
+
tabs = this.state.tabs;
|
|
11108
|
+
counts = this.state.counts;
|
|
11109
|
+
status = this.state.status;
|
|
11110
|
+
hasMore = this.state.hasMore;
|
|
11111
|
+
truncated = this.state.truncated;
|
|
11112
|
+
loadingMore = this.state.loadingMore;
|
|
11113
|
+
loadMore = this.state.loadMore;
|
|
11114
|
+
items = this.state.items;
|
|
11115
|
+
count = this.state.count;
|
|
11116
|
+
ids = this.state.ids;
|
|
11117
|
+
allSelected = this.state.allSelected;
|
|
11118
|
+
partiallySelected = this.state.partiallySelected;
|
|
11119
|
+
isSelected = this.state.isSelected;
|
|
11120
|
+
toggle = this.state.toggle;
|
|
11121
|
+
toggleAll = this.state.toggleAll;
|
|
11122
|
+
select = this.state.select;
|
|
11123
|
+
create = this.state.create;
|
|
11124
|
+
ngAfterContentInit() {
|
|
11125
|
+
this.custom.set(hasContent(this.slot().nativeElement));
|
|
11126
|
+
}
|
|
11127
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
11128
|
+
minVersion: "12.0.0",
|
|
11129
|
+
version: "22.2.1",
|
|
11130
|
+
ngImport: i0,
|
|
11131
|
+
type: WorkspaceMention,
|
|
11132
|
+
deps: [],
|
|
11133
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
11134
|
+
});
|
|
11135
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
11136
|
+
minVersion: "17.0.0",
|
|
11137
|
+
version: "22.2.1",
|
|
11138
|
+
type: WorkspaceMention,
|
|
11139
|
+
isStandalone: true,
|
|
11140
|
+
selector: "workspace-mention",
|
|
11141
|
+
inputs: {
|
|
11142
|
+
searchFields: {
|
|
11143
|
+
classPropertyName: "searchFields",
|
|
11144
|
+
publicName: "searchFields",
|
|
11145
|
+
isSignal: true,
|
|
11146
|
+
isRequired: false,
|
|
11147
|
+
transformFunction: null
|
|
11148
|
+
},
|
|
11149
|
+
selectedIds: {
|
|
11150
|
+
classPropertyName: "selectedIds",
|
|
11151
|
+
publicName: "selectedIds",
|
|
11152
|
+
isSignal: true,
|
|
11153
|
+
isRequired: false,
|
|
11154
|
+
transformFunction: null
|
|
11155
|
+
},
|
|
11156
|
+
predicate: {
|
|
11157
|
+
classPropertyName: "predicate",
|
|
11158
|
+
publicName: "predicate",
|
|
11159
|
+
isSignal: true,
|
|
11160
|
+
isRequired: false,
|
|
11161
|
+
transformFunction: null
|
|
11162
|
+
},
|
|
11163
|
+
searchable: {
|
|
11164
|
+
classPropertyName: "searchable",
|
|
11165
|
+
publicName: "searchable",
|
|
11166
|
+
isSignal: true,
|
|
11167
|
+
isRequired: false,
|
|
11168
|
+
transformFunction: null
|
|
11169
|
+
},
|
|
11170
|
+
selectAll: {
|
|
11171
|
+
classPropertyName: "selectAll",
|
|
11172
|
+
publicName: "selectAll",
|
|
11173
|
+
isSignal: true,
|
|
11174
|
+
isRequired: false,
|
|
11175
|
+
transformFunction: null
|
|
11176
|
+
},
|
|
11177
|
+
allowCreate: {
|
|
11178
|
+
classPropertyName: "allowCreate",
|
|
11179
|
+
publicName: "allowCreate",
|
|
11180
|
+
isSignal: true,
|
|
11181
|
+
isRequired: false,
|
|
11182
|
+
transformFunction: null
|
|
11183
|
+
}
|
|
11184
|
+
},
|
|
11185
|
+
outputs: {
|
|
11186
|
+
selectionChanged: "selectionChanged",
|
|
11187
|
+
workspaceCreated: "workspaceCreated"
|
|
11188
|
+
},
|
|
11189
|
+
host: { classAttribute: "contents" },
|
|
11190
|
+
providers: [{
|
|
11191
|
+
provide: WORKSPACE_MENTION,
|
|
11192
|
+
useExisting: forwardRef(() => WorkspaceMention)
|
|
11193
|
+
}],
|
|
11194
|
+
viewQueries: [{
|
|
11195
|
+
propertyName: "slot",
|
|
11196
|
+
first: true,
|
|
11197
|
+
predicate: ["slot"],
|
|
11198
|
+
descendants: true,
|
|
11199
|
+
isSignal: true
|
|
11200
|
+
}],
|
|
11201
|
+
exportAs: ["workspaceMention"],
|
|
11202
|
+
ngImport: i0,
|
|
11203
|
+
template: `
|
|
11204
|
+
<div #slot class="contents"><ng-content /></div>
|
|
11205
|
+
@if (!custom()) {
|
|
11206
|
+
<div class="flex min-h-0 flex-1 flex-col gap-(--spacing-2xs)">
|
|
11207
|
+
@if (searchable() || allowCreate()) {
|
|
11208
|
+
<div class="flex items-center gap-(--spacing-2xs) px-(--spacing-xs) pt-(--spacing-2xs)">
|
|
11209
|
+
@if (searchable()) {
|
|
11210
|
+
<workspace-mention-search class="min-w-0 flex-1" />
|
|
11211
|
+
}
|
|
11212
|
+
@if (allowCreate()) {
|
|
11213
|
+
<workspace-mention-new class="shrink-0" />
|
|
11214
|
+
}
|
|
11215
|
+
</div>
|
|
11216
|
+
}
|
|
11217
|
+
@if (selectAll()) {
|
|
11218
|
+
<workspace-mention-select-all class="px-(--spacing-xs)" />
|
|
11219
|
+
}
|
|
11220
|
+
<workspace-mention-rows />
|
|
11221
|
+
</div>
|
|
11222
|
+
}
|
|
11223
|
+
`,
|
|
11224
|
+
isInline: true,
|
|
11225
|
+
dependencies: [
|
|
11226
|
+
{
|
|
11227
|
+
kind: "component",
|
|
11228
|
+
type: WorkspaceMentionNew,
|
|
11229
|
+
selector: "workspace-mention-new",
|
|
11230
|
+
inputs: [
|
|
11231
|
+
"variant",
|
|
11232
|
+
"scheme",
|
|
11233
|
+
"size"
|
|
11234
|
+
]
|
|
11235
|
+
},
|
|
11236
|
+
{
|
|
11237
|
+
kind: "component",
|
|
11238
|
+
type: WorkspaceMentionRows,
|
|
11239
|
+
selector: "workspace-mention-rows"
|
|
11240
|
+
},
|
|
11241
|
+
{
|
|
11242
|
+
kind: "component",
|
|
11243
|
+
type: WorkspaceMentionSearch,
|
|
11244
|
+
selector: "workspace-mention-search",
|
|
11245
|
+
inputs: [
|
|
11246
|
+
"size",
|
|
11247
|
+
"textSize",
|
|
11248
|
+
"placeholder",
|
|
11249
|
+
"aria-label"
|
|
11250
|
+
]
|
|
11251
|
+
},
|
|
11252
|
+
{
|
|
11253
|
+
kind: "component",
|
|
11254
|
+
type: WorkspaceMentionSelectAll,
|
|
11255
|
+
selector: "workspace-mention-select-all"
|
|
11256
|
+
}
|
|
11257
|
+
],
|
|
11258
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
11259
|
+
});
|
|
11260
|
+
};
|
|
11261
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
11262
|
+
minVersion: "12.0.0",
|
|
11263
|
+
version: "22.2.1",
|
|
11264
|
+
ngImport: i0,
|
|
11265
|
+
type: WorkspaceMention,
|
|
11266
|
+
decorators: [{
|
|
11267
|
+
type: Component,
|
|
11268
|
+
args: [{
|
|
11269
|
+
selector: "workspace-mention",
|
|
11270
|
+
exportAs: "workspaceMention",
|
|
11271
|
+
imports: [
|
|
11272
|
+
WorkspaceMentionNew,
|
|
11273
|
+
WorkspaceMentionRows,
|
|
11274
|
+
WorkspaceMentionSearch,
|
|
11275
|
+
WorkspaceMentionSelectAll
|
|
11276
|
+
],
|
|
11277
|
+
providers: [{
|
|
11278
|
+
provide: WORKSPACE_MENTION,
|
|
11279
|
+
useExisting: forwardRef(() => WorkspaceMention)
|
|
11280
|
+
}],
|
|
11281
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11282
|
+
host: { class: "contents" },
|
|
11283
|
+
template: `
|
|
11284
|
+
<div #slot class="contents"><ng-content /></div>
|
|
11285
|
+
@if (!custom()) {
|
|
11286
|
+
<div class="flex min-h-0 flex-1 flex-col gap-(--spacing-2xs)">
|
|
11287
|
+
@if (searchable() || allowCreate()) {
|
|
11288
|
+
<div class="flex items-center gap-(--spacing-2xs) px-(--spacing-xs) pt-(--spacing-2xs)">
|
|
11289
|
+
@if (searchable()) {
|
|
11290
|
+
<workspace-mention-search class="min-w-0 flex-1" />
|
|
11291
|
+
}
|
|
11292
|
+
@if (allowCreate()) {
|
|
11293
|
+
<workspace-mention-new class="shrink-0" />
|
|
11294
|
+
}
|
|
11295
|
+
</div>
|
|
11296
|
+
}
|
|
11297
|
+
@if (selectAll()) {
|
|
11298
|
+
<workspace-mention-select-all class="px-(--spacing-xs)" />
|
|
11299
|
+
}
|
|
11300
|
+
<workspace-mention-rows />
|
|
11301
|
+
</div>
|
|
11302
|
+
}
|
|
11303
|
+
`
|
|
11304
|
+
}]
|
|
11305
|
+
}],
|
|
11306
|
+
propDecorators: {
|
|
11307
|
+
searchFields: [{
|
|
11308
|
+
type: i0.Input,
|
|
11309
|
+
args: [{
|
|
11310
|
+
isSignal: true,
|
|
11311
|
+
alias: "searchFields",
|
|
11312
|
+
required: false
|
|
11313
|
+
}]
|
|
11314
|
+
}],
|
|
11315
|
+
selectedIds: [{
|
|
11316
|
+
type: i0.Input,
|
|
11317
|
+
args: [{
|
|
11318
|
+
isSignal: true,
|
|
11319
|
+
alias: "selectedIds",
|
|
11320
|
+
required: false
|
|
11321
|
+
}]
|
|
11322
|
+
}],
|
|
11323
|
+
predicate: [{
|
|
11324
|
+
type: i0.Input,
|
|
11325
|
+
args: [{
|
|
11326
|
+
isSignal: true,
|
|
11327
|
+
alias: "predicate",
|
|
11328
|
+
required: false
|
|
11329
|
+
}]
|
|
11330
|
+
}],
|
|
11331
|
+
searchable: [{
|
|
11332
|
+
type: i0.Input,
|
|
11333
|
+
args: [{
|
|
11334
|
+
isSignal: true,
|
|
11335
|
+
alias: "searchable",
|
|
11336
|
+
required: false
|
|
11337
|
+
}]
|
|
11338
|
+
}],
|
|
11339
|
+
selectAll: [{
|
|
11340
|
+
type: i0.Input,
|
|
11341
|
+
args: [{
|
|
11342
|
+
isSignal: true,
|
|
11343
|
+
alias: "selectAll",
|
|
11344
|
+
required: false
|
|
11345
|
+
}]
|
|
11346
|
+
}],
|
|
11347
|
+
allowCreate: [{
|
|
11348
|
+
type: i0.Input,
|
|
11349
|
+
args: [{
|
|
11350
|
+
isSignal: true,
|
|
11351
|
+
alias: "allowCreate",
|
|
11352
|
+
required: false
|
|
11353
|
+
}]
|
|
11354
|
+
}],
|
|
11355
|
+
selectionChanged: [{
|
|
11356
|
+
type: i0.Output,
|
|
11357
|
+
args: ["selectionChanged"]
|
|
11358
|
+
}],
|
|
11359
|
+
workspaceCreated: [{
|
|
11360
|
+
type: i0.Output,
|
|
11361
|
+
args: ["workspaceCreated"]
|
|
11362
|
+
}],
|
|
11363
|
+
slot: [{
|
|
11364
|
+
type: i0.ViewChild,
|
|
11365
|
+
args: ["slot", { isSignal: true }]
|
|
11366
|
+
}]
|
|
11367
|
+
}
|
|
11368
|
+
});
|
|
11369
|
+
var WorkspaceMentionList = class WorkspaceMentionList {
|
|
11370
|
+
searchable = input(false, {
|
|
11371
|
+
...ngDevMode ? { debugName: "searchable" } : /* istanbul ignore next */ {},
|
|
11372
|
+
transform: booleanAttribute
|
|
11373
|
+
});
|
|
11374
|
+
selectAll = input(false, {
|
|
11375
|
+
...ngDevMode ? { debugName: "selectAll" } : /* istanbul ignore next */ {},
|
|
11376
|
+
transform: booleanAttribute
|
|
11377
|
+
});
|
|
11378
|
+
allowCreate = input(false, {
|
|
11379
|
+
...ngDevMode ? { debugName: "allowCreate" } : /* istanbul ignore next */ {},
|
|
11380
|
+
transform: booleanAttribute
|
|
11381
|
+
});
|
|
11382
|
+
searchFields = input("name", ...ngDevMode ? [{ debugName: "searchFields" }] : /* istanbul ignore next */ []);
|
|
11383
|
+
selectedIds = input(void 0, ...ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []);
|
|
11384
|
+
selectionChanged = output();
|
|
11385
|
+
workspaceCreated = output();
|
|
11386
|
+
mention = viewChild.required(WorkspaceMention, ...ngDevMode ? [{ debugName: "mention" }] : /* istanbul ignore next */ []);
|
|
11387
|
+
items = computed(() => this.mention().items(), ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
11388
|
+
select(id) {
|
|
11389
|
+
this.mention().select(id);
|
|
11390
|
+
}
|
|
11391
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
11392
|
+
minVersion: "12.0.0",
|
|
11393
|
+
version: "22.2.1",
|
|
11394
|
+
ngImport: i0,
|
|
11395
|
+
type: WorkspaceMentionList,
|
|
11396
|
+
deps: [],
|
|
11397
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
11398
|
+
});
|
|
11399
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
11400
|
+
minVersion: "17.2.0",
|
|
11401
|
+
version: "22.2.1",
|
|
11402
|
+
type: WorkspaceMentionList,
|
|
11403
|
+
isStandalone: true,
|
|
11404
|
+
selector: "workspace-mention-list",
|
|
11405
|
+
inputs: {
|
|
11406
|
+
searchable: {
|
|
11407
|
+
classPropertyName: "searchable",
|
|
11408
|
+
publicName: "searchable",
|
|
11409
|
+
isSignal: true,
|
|
11410
|
+
isRequired: false,
|
|
11411
|
+
transformFunction: null
|
|
11412
|
+
},
|
|
11413
|
+
selectAll: {
|
|
11414
|
+
classPropertyName: "selectAll",
|
|
11415
|
+
publicName: "selectAll",
|
|
11416
|
+
isSignal: true,
|
|
11417
|
+
isRequired: false,
|
|
11418
|
+
transformFunction: null
|
|
11419
|
+
},
|
|
11420
|
+
allowCreate: {
|
|
11421
|
+
classPropertyName: "allowCreate",
|
|
11422
|
+
publicName: "allowCreate",
|
|
11423
|
+
isSignal: true,
|
|
11424
|
+
isRequired: false,
|
|
11425
|
+
transformFunction: null
|
|
11426
|
+
},
|
|
11427
|
+
searchFields: {
|
|
11428
|
+
classPropertyName: "searchFields",
|
|
11429
|
+
publicName: "searchFields",
|
|
11430
|
+
isSignal: true,
|
|
11431
|
+
isRequired: false,
|
|
11432
|
+
transformFunction: null
|
|
11433
|
+
},
|
|
11434
|
+
selectedIds: {
|
|
11435
|
+
classPropertyName: "selectedIds",
|
|
11436
|
+
publicName: "selectedIds",
|
|
11437
|
+
isSignal: true,
|
|
11438
|
+
isRequired: false,
|
|
11439
|
+
transformFunction: null
|
|
11440
|
+
}
|
|
11441
|
+
},
|
|
11442
|
+
outputs: {
|
|
11443
|
+
selectionChanged: "selectionChanged",
|
|
11444
|
+
workspaceCreated: "workspaceCreated"
|
|
11445
|
+
},
|
|
11446
|
+
host: { classAttribute: "block" },
|
|
11447
|
+
viewQueries: [{
|
|
11448
|
+
propertyName: "mention",
|
|
11449
|
+
first: true,
|
|
11450
|
+
predicate: WorkspaceMention,
|
|
11451
|
+
descendants: true,
|
|
11452
|
+
isSignal: true
|
|
11453
|
+
}],
|
|
11454
|
+
ngImport: i0,
|
|
11455
|
+
template: `
|
|
11456
|
+
<workspace-mention
|
|
11457
|
+
[searchable]="searchable()"
|
|
11458
|
+
[selectAll]="selectAll()"
|
|
11459
|
+
[allowCreate]="allowCreate()"
|
|
11460
|
+
[searchFields]="searchFields()"
|
|
11461
|
+
[selectedIds]="selectedIds()"
|
|
11462
|
+
(selectionChanged)="selectionChanged.emit($event)"
|
|
11463
|
+
(workspaceCreated)="workspaceCreated.emit($event)" />
|
|
11464
|
+
`,
|
|
11465
|
+
isInline: true,
|
|
11466
|
+
dependencies: [{
|
|
11467
|
+
kind: "component",
|
|
11468
|
+
type: WorkspaceMention,
|
|
11469
|
+
selector: "workspace-mention",
|
|
11470
|
+
inputs: [
|
|
11471
|
+
"searchFields",
|
|
11472
|
+
"selectedIds",
|
|
11473
|
+
"predicate",
|
|
11474
|
+
"searchable",
|
|
11475
|
+
"selectAll",
|
|
11476
|
+
"allowCreate"
|
|
11477
|
+
],
|
|
11478
|
+
outputs: ["selectionChanged", "workspaceCreated"],
|
|
11479
|
+
exportAs: ["workspaceMention"]
|
|
11480
|
+
}],
|
|
11481
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
11482
|
+
});
|
|
11483
|
+
};
|
|
11484
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
11485
|
+
minVersion: "12.0.0",
|
|
11486
|
+
version: "22.2.1",
|
|
11487
|
+
ngImport: i0,
|
|
11488
|
+
type: WorkspaceMentionList,
|
|
11489
|
+
decorators: [{
|
|
11490
|
+
type: Component,
|
|
11491
|
+
args: [{
|
|
11492
|
+
selector: "workspace-mention-list",
|
|
11493
|
+
imports: [WorkspaceMention],
|
|
11494
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11495
|
+
host: { class: "block" },
|
|
11496
|
+
template: `
|
|
11497
|
+
<workspace-mention
|
|
11498
|
+
[searchable]="searchable()"
|
|
11499
|
+
[selectAll]="selectAll()"
|
|
11500
|
+
[allowCreate]="allowCreate()"
|
|
11501
|
+
[searchFields]="searchFields()"
|
|
11502
|
+
[selectedIds]="selectedIds()"
|
|
11503
|
+
(selectionChanged)="selectionChanged.emit($event)"
|
|
11504
|
+
(workspaceCreated)="workspaceCreated.emit($event)" />
|
|
11505
|
+
`
|
|
11506
|
+
}]
|
|
11507
|
+
}],
|
|
11508
|
+
propDecorators: {
|
|
11509
|
+
searchable: [{
|
|
11510
|
+
type: i0.Input,
|
|
11511
|
+
args: [{
|
|
11512
|
+
isSignal: true,
|
|
11513
|
+
alias: "searchable",
|
|
11514
|
+
required: false
|
|
11515
|
+
}]
|
|
11516
|
+
}],
|
|
11517
|
+
selectAll: [{
|
|
11518
|
+
type: i0.Input,
|
|
11519
|
+
args: [{
|
|
11520
|
+
isSignal: true,
|
|
11521
|
+
alias: "selectAll",
|
|
11522
|
+
required: false
|
|
11523
|
+
}]
|
|
11524
|
+
}],
|
|
11525
|
+
allowCreate: [{
|
|
11526
|
+
type: i0.Input,
|
|
11527
|
+
args: [{
|
|
11528
|
+
isSignal: true,
|
|
11529
|
+
alias: "allowCreate",
|
|
11530
|
+
required: false
|
|
11531
|
+
}]
|
|
11532
|
+
}],
|
|
11533
|
+
searchFields: [{
|
|
11534
|
+
type: i0.Input,
|
|
11535
|
+
args: [{
|
|
11536
|
+
isSignal: true,
|
|
11537
|
+
alias: "searchFields",
|
|
11538
|
+
required: false
|
|
11539
|
+
}]
|
|
11540
|
+
}],
|
|
11541
|
+
selectedIds: [{
|
|
11542
|
+
type: i0.Input,
|
|
11543
|
+
args: [{
|
|
11544
|
+
isSignal: true,
|
|
11545
|
+
alias: "selectedIds",
|
|
11546
|
+
required: false
|
|
11547
|
+
}]
|
|
11548
|
+
}],
|
|
11549
|
+
selectionChanged: [{
|
|
11550
|
+
type: i0.Output,
|
|
11551
|
+
args: ["selectionChanged"]
|
|
11552
|
+
}],
|
|
11553
|
+
workspaceCreated: [{
|
|
11554
|
+
type: i0.Output,
|
|
11555
|
+
args: ["workspaceCreated"]
|
|
11556
|
+
}],
|
|
11557
|
+
mention: [{
|
|
11558
|
+
type: i0.ViewChild,
|
|
11559
|
+
args: [i0.forwardRef(() => WorkspaceMention), { isSignal: true }]
|
|
11560
|
+
}]
|
|
11561
|
+
}
|
|
11562
|
+
});
|
|
11563
|
+
var WorkspaceMentionTabs = class WorkspaceMentionTabs {
|
|
11564
|
+
ariaLabel = input(void 0, {
|
|
11565
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
11566
|
+
alias: "aria-label"
|
|
11567
|
+
});
|
|
11568
|
+
mention = injectWorkspaceMentionScope();
|
|
11569
|
+
onTabChange(tab) {
|
|
11570
|
+
if (tab) this.mention.tab.set(tab);
|
|
11571
|
+
}
|
|
11572
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
11573
|
+
minVersion: "12.0.0",
|
|
11574
|
+
version: "22.2.1",
|
|
11575
|
+
ngImport: i0,
|
|
11576
|
+
type: WorkspaceMentionTabs,
|
|
11577
|
+
deps: [],
|
|
11578
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
11579
|
+
});
|
|
11580
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
11581
|
+
minVersion: "17.0.0",
|
|
11582
|
+
version: "22.2.1",
|
|
11583
|
+
type: WorkspaceMentionTabs,
|
|
11584
|
+
isStandalone: true,
|
|
11585
|
+
selector: "workspace-mention-tabs",
|
|
11586
|
+
inputs: { ariaLabel: {
|
|
11587
|
+
classPropertyName: "ariaLabel",
|
|
11588
|
+
publicName: "aria-label",
|
|
11589
|
+
isSignal: true,
|
|
11590
|
+
isRequired: false,
|
|
11591
|
+
transformFunction: null
|
|
11592
|
+
} },
|
|
11593
|
+
host: { classAttribute: "block max-w-full" },
|
|
11594
|
+
providers: [provideTranslocoScope("document-workspaces")],
|
|
11595
|
+
ngImport: i0,
|
|
11596
|
+
template: `
|
|
11597
|
+
<Tabs class="max-w-full">
|
|
11598
|
+
<TabList
|
|
11599
|
+
variant="inner"
|
|
11600
|
+
class="w-fit max-w-full"
|
|
11601
|
+
selectionMode="explicit"
|
|
11602
|
+
[softDisabled]="false"
|
|
11603
|
+
[attr.aria-label]="ariaLabel() ?? ('documentWorkspaces.mention.tabsLabel' | transloco)"
|
|
11604
|
+
[selectedTab]="mention.tab()"
|
|
11605
|
+
(selectedTabChange)="onTabChange($event)">
|
|
11606
|
+
@for (item of mention.tabs; track item.id) {
|
|
11607
|
+
<Tab [value]="item.id" variant="inner">
|
|
11608
|
+
<span>{{ item.labelKey | transloco }}</span>
|
|
11609
|
+
<Badge variant="number" fill="primary" scheme="sage" size="xs" class="shrink-0" [attr.data-testid]="'badge-' + item.id">{{ mention.counts()[item.id] }}</Badge>
|
|
11610
|
+
</Tab>
|
|
11611
|
+
}
|
|
11612
|
+
</TabList>
|
|
11613
|
+
</Tabs>
|
|
11614
|
+
`,
|
|
11615
|
+
isInline: true,
|
|
11616
|
+
dependencies: [
|
|
11617
|
+
{
|
|
11618
|
+
kind: "directive",
|
|
11619
|
+
type: BadgeComponent,
|
|
11620
|
+
selector: "badge, Badge",
|
|
11621
|
+
inputs: [
|
|
11622
|
+
"class",
|
|
11623
|
+
"variant",
|
|
11624
|
+
"fill",
|
|
11625
|
+
"scheme",
|
|
11626
|
+
"size",
|
|
11627
|
+
"aria-label"
|
|
11628
|
+
]
|
|
11629
|
+
},
|
|
11630
|
+
{
|
|
11631
|
+
kind: "directive",
|
|
11632
|
+
type: TabComponent,
|
|
11633
|
+
selector: "Tab",
|
|
11634
|
+
inputs: [
|
|
11635
|
+
"class",
|
|
11636
|
+
"variant",
|
|
11637
|
+
"size",
|
|
11638
|
+
"noTruncate"
|
|
11639
|
+
]
|
|
11640
|
+
},
|
|
11641
|
+
{
|
|
11642
|
+
kind: "directive",
|
|
11643
|
+
type: TabListComponent,
|
|
11644
|
+
selector: "TabList",
|
|
11645
|
+
inputs: ["class", "variant"]
|
|
11646
|
+
},
|
|
11647
|
+
{
|
|
11648
|
+
kind: "directive",
|
|
11649
|
+
type: TabsComponent,
|
|
11650
|
+
selector: "Tabs",
|
|
11651
|
+
inputs: ["class"]
|
|
11652
|
+
},
|
|
11653
|
+
{
|
|
11654
|
+
kind: "pipe",
|
|
11655
|
+
type: TranslocoPipe,
|
|
11656
|
+
name: "transloco"
|
|
11657
|
+
}
|
|
11658
|
+
],
|
|
11659
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
11660
|
+
});
|
|
11661
|
+
};
|
|
11662
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
11663
|
+
minVersion: "12.0.0",
|
|
11664
|
+
version: "22.2.1",
|
|
11665
|
+
ngImport: i0,
|
|
11666
|
+
type: WorkspaceMentionTabs,
|
|
11667
|
+
decorators: [{
|
|
11668
|
+
type: Component,
|
|
11669
|
+
args: [{
|
|
11670
|
+
selector: "workspace-mention-tabs",
|
|
11671
|
+
imports: [
|
|
11672
|
+
TranslocoPipe,
|
|
11673
|
+
BadgeComponent,
|
|
11674
|
+
TabComponent,
|
|
11675
|
+
TabListComponent,
|
|
11676
|
+
TabsComponent
|
|
11677
|
+
],
|
|
11678
|
+
providers: [provideTranslocoScope("document-workspaces")],
|
|
11679
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11680
|
+
host: { class: "block max-w-full" },
|
|
11681
|
+
template: `
|
|
11682
|
+
<Tabs class="max-w-full">
|
|
11683
|
+
<TabList
|
|
11684
|
+
variant="inner"
|
|
11685
|
+
class="w-fit max-w-full"
|
|
11686
|
+
selectionMode="explicit"
|
|
11687
|
+
[softDisabled]="false"
|
|
11688
|
+
[attr.aria-label]="ariaLabel() ?? ('documentWorkspaces.mention.tabsLabel' | transloco)"
|
|
11689
|
+
[selectedTab]="mention.tab()"
|
|
11690
|
+
(selectedTabChange)="onTabChange($event)">
|
|
11691
|
+
@for (item of mention.tabs; track item.id) {
|
|
11692
|
+
<Tab [value]="item.id" variant="inner">
|
|
11693
|
+
<span>{{ item.labelKey | transloco }}</span>
|
|
11694
|
+
<Badge variant="number" fill="primary" scheme="sage" size="xs" class="shrink-0" [attr.data-testid]="'badge-' + item.id">{{ mention.counts()[item.id] }}</Badge>
|
|
11695
|
+
</Tab>
|
|
11696
|
+
}
|
|
11697
|
+
</TabList>
|
|
11698
|
+
</Tabs>
|
|
11699
|
+
`
|
|
11700
|
+
}]
|
|
11701
|
+
}],
|
|
11702
|
+
propDecorators: { ariaLabel: [{
|
|
11703
|
+
type: i0.Input,
|
|
11704
|
+
args: [{
|
|
11705
|
+
isSignal: true,
|
|
11706
|
+
alias: "aria-label",
|
|
11707
|
+
required: false
|
|
11708
|
+
}]
|
|
10567
11709
|
}] }
|
|
10568
11710
|
});
|
|
10569
11711
|
const NEW_WORKSPACE_NAME_MAX = 50;
|
|
@@ -11587,6 +12729,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
11587
12729
|
}]
|
|
11588
12730
|
}
|
|
11589
12731
|
});
|
|
11590
|
-
export { ConfirmAction, ConfirmDialog, ConnectionBanner, CurrentUserService, DOCUMENT_ROW_COLUMNS, DocumentCard, DocumentPreviewPanel, DocumentRow, DocumentStatusBadge, DocumentTypeIcon, Dropzone, EditWorkspace, HighlightMatchPipe, HighlightedText, MemberRow, NEW_WORKSPACE_NAME_MAX, PickWorkspace, PrincipalAvatar, PrincipalDirectory, PrincipalPicker, ResizeHandle, RoleMenu, ShareDialog, ShareWorkspace, UPLOAD_FACTORY, UploadDialog, UploadDocuments, UploadFileList, UploadService, UploadTracker, UploadTrackerSection, UploadTrackerStore, WORKSPACE_ROW_COLUMNS, WorkspaceCard, WorkspaceDetail, WorkspaceEditDialog, WorkspaceIcon, WorkspaceList, WorkspaceMentionList, WorkspaceMessage, WorkspacePicker, WorkspacePickerDialog, WorkspacePickerLauncher, WorkspaceRoleTag, WorkspaceRow, WorkspacesShell, WorkspacesStore, WriterOnly, injectDocumentLabels, injectOnlineStatus, injectSelection, injectTextSearch, injectWorkspaceFilter, isFailed, isFinished, principalDisplayName };
|
|
12732
|
+
export { ConfirmAction, ConfirmDialog, ConnectionBanner, CurrentUserService, DOCUMENT_ROW_COLUMNS, DocumentCard, DocumentPreviewPanel, DocumentRow, DocumentStatusBadge, DocumentTypeIcon, Dropzone, EditWorkspace, HighlightMatchPipe, HighlightedText, MENTION_TABS, MemberRow, NEW_WORKSPACE_NAME_MAX, PickWorkspace, PrincipalAvatar, PrincipalDirectory, PrincipalPicker, ResizeHandle, RoleMenu, ShareDialog, ShareWorkspace, UPLOAD_FACTORY, UploadDialog, UploadDocuments, UploadFileList, UploadService, UploadTracker, UploadTrackerSection, UploadTrackerStore, WORKSPACE_MENTION, WORKSPACE_ROW_COLUMNS, WorkspaceCard, WorkspaceDetail, WorkspaceEditDialog, WorkspaceIcon, WorkspaceList, WorkspaceMention, WorkspaceMentionList, WorkspaceMentionNew, WorkspaceMentionRows, WorkspaceMentionSearch, WorkspaceMentionSelectAll, WorkspaceMentionTabs, WorkspaceMessage, WorkspacePicker, WorkspacePickerDialog, WorkspacePickerLauncher, WorkspaceRoleTag, WorkspaceRow, WorkspacesShell, WorkspacesStore, WriterOnly, injectDocumentLabels, injectOnlineStatus, injectSelection, injectTextSearch, injectWorkspaceFilter, injectWorkspaceMention, injectWorkspaceMentionScope, isFailed, isFinished, principalDisplayName };
|
|
11591
12733
|
|
|
11592
12734
|
//# sourceMappingURL=sinequa-atomic-angular-document-workspaces.mjs.map
|