@signature.digital/catalog 1.5.0 → 1.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signature.digital/catalog",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "private": false,
5
5
  "description": "A comprehensive catalog of customizable web components designed for building and managing e-signature applications.",
6
6
  "exports": {
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@signature.digital/catalog',
6
- version: '1.5.0',
6
+ version: '1.6.0',
7
7
  description: 'A comprehensive catalog of customizable web components designed for building and managing e-signature applications.'
8
8
  }
@@ -14,6 +14,7 @@ export class SdigWorkspaceInbox extends DeesElement {
14
14
  public static demoGroups = ['Signature Digital Workspace'];
15
15
 
16
16
  @property({ type: String }) public accessor density: TDensity = 'comfortable';
17
+ @property({ attribute: false }) public accessor documents: IDocumentRow[] = demoDocuments;
17
18
  @state() private accessor filter: string = 'all';
18
19
  @state() private accessor search: string = '';
19
20
 
@@ -45,7 +46,7 @@ export class SdigWorkspaceInbox extends DeesElement {
45
46
  `];
46
47
 
47
48
  private get filteredDocuments(): IDocumentRow[] {
48
- return demoDocuments
49
+ return this.documents
49
50
  .filter((doc) => this.filter === 'all' || doc.status === this.filter)
50
51
  .filter((doc) => !this.search || doc.title.toLowerCase().includes(this.search.toLowerCase()));
51
52
  }
@@ -62,23 +63,30 @@ export class SdigWorkspaceInbox extends DeesElement {
62
63
  }
63
64
 
64
65
  private openDocument(doc: IDocumentRow) {
66
+ this.dispatchEvent(new CustomEvent('document-open', {
67
+ detail: { document: doc },
68
+ bubbles: true,
69
+ composed: true,
70
+ }));
65
71
  requestWorkspaceView(this, doc.status === 'signed' ? 'audit' : 'sign');
66
72
  }
67
73
 
68
74
  public render(): TemplateResult {
75
+ const documents = this.documents;
69
76
  const filters = [
70
- { id: 'all', label: 'All', count: demoDocuments.length },
71
- { id: 'awaiting', label: 'Awaiting', count: demoDocuments.filter((doc) => doc.status === 'awaiting').length },
72
- { id: 'signed', label: 'Completed', count: demoDocuments.filter((doc) => doc.status === 'signed').length },
73
- { id: 'draft', label: 'Drafts', count: demoDocuments.filter((doc) => doc.status === 'draft').length },
74
- { id: 'declined', label: 'Declined', count: demoDocuments.filter((doc) => doc.status === 'declined').length },
77
+ { id: 'all', label: 'All', count: documents.length },
78
+ { id: 'awaiting', label: 'Awaiting', count: documents.filter((doc) => doc.status === 'awaiting').length },
79
+ { id: 'signed', label: 'Completed', count: documents.filter((doc) => doc.status === 'signed').length },
80
+ { id: 'draft', label: 'Drafts', count: documents.filter((doc) => doc.status === 'draft').length },
81
+ { id: 'declined', label: 'Declined', count: documents.filter((doc) => doc.status === 'declined').length },
75
82
  ];
83
+ const attentionCount = documents.filter((doc) => doc.status === 'awaiting').length;
76
84
 
77
85
  return html`
78
86
  ${topBar({
79
87
  breadcrumb: ['signature.digital', 'Lossless GmbH', 'Inbox'],
80
88
  title: 'Inbox',
81
- subtitle: pill(`${demoDocuments.filter((doc) => doc.status === 'awaiting').length} need attention`, 'info'),
89
+ subtitle: pill(`${attentionCount} need attention`, 'info'),
82
90
  actions: html`${actionButton('Import', 'outline', 'upload')}${actionButton('New document', 'primary', 'plus', () => requestWorkspaceView(this, 'compose'))}`,
83
91
  })}
84
92
  <div class="filterbar">
@@ -1,5 +1,5 @@
1
- import { DeesElement, property, state, html, customElement, type TemplateResult, css } from '@design.estate/dees-element';
2
- import { icon, type TDensity, type TWorkspaceTheme, type TWorkspaceView } from './sdig-workspace.shared.js';
1
+ import { DeesElement, property, html, customElement, type TemplateResult, css } from '@design.estate/dees-element';
2
+ import { demoDocuments, icon, type IDocumentRow, type TDensity, type TWorkspaceTheme, type TWorkspaceView } from './sdig-workspace.shared.js';
3
3
  import './sdig-workspace-inbox.js';
4
4
  import './sdig-workspace-compose.js';
5
5
  import './sdig-workspace-sign.js';
@@ -22,11 +22,14 @@ export class SdigWorkspace extends DeesElement {
22
22
  @property({ type: String }) public accessor density: TDensity = 'comfortable';
23
23
  @property({ type: String, reflect: true }) public accessor theme: TWorkspaceTheme = 'dark';
24
24
  @property({ type: String }) public accessor initialView: TWorkspaceView = 'inbox';
25
- @state() private accessor view: TWorkspaceView = 'inbox';
25
+ @property({ type: String, reflect: true }) public accessor view: TWorkspaceView = 'inbox';
26
+ @property({ attribute: false }) public accessor documents: IDocumentRow[] = demoDocuments;
26
27
 
27
28
  public connectedCallback = async () => {
28
29
  await super.connectedCallback();
29
- this.view = this.initialView || 'inbox';
30
+ if (this.view === 'inbox' && this.initialView !== 'inbox') {
31
+ this.view = this.initialView;
32
+ }
30
33
  this.addEventListener('workspace-view-request', this.handleViewRequest as EventListener);
31
34
  };
32
35
 
@@ -131,7 +134,7 @@ export class SdigWorkspace extends DeesElement {
131
134
 
132
135
  private renderSidebar(): TemplateResult {
133
136
  const navItems = [
134
- { id: 'inbox', label: 'Inbox', icon: 'inbox', count: 4 },
137
+ { id: 'inbox', label: 'Inbox', icon: 'inbox', count: this.documents.length },
135
138
  { id: 'compose', label: 'Compose', icon: 'plus' },
136
139
  { id: 'templates', label: 'Templates', icon: 'folder', count: 12 },
137
140
  { id: 'audit', label: 'Audit Trail', icon: 'shield' },
@@ -157,7 +160,7 @@ export class SdigWorkspace extends DeesElement {
157
160
 
158
161
  private renderView(): TemplateResult {
159
162
  switch (this.view) {
160
- case 'inbox': return html`<sdig-workspace-inbox class="view-host" .density=${this.density}></sdig-workspace-inbox>`;
163
+ case 'inbox': return html`<sdig-workspace-inbox class="view-host" .density=${this.density} .documents=${this.documents}></sdig-workspace-inbox>`;
161
164
  case 'compose': return html`<sdig-workspace-compose class="view-host"></sdig-workspace-compose>`;
162
165
  case 'sign': return html`<sdig-workspace-sign class="view-host"></sdig-workspace-sign>`;
163
166
  case 'audit': return html`<sdig-workspace-audit class="view-host"></sdig-workspace-audit>`;
@@ -165,7 +168,7 @@ export class SdigWorkspace extends DeesElement {
165
168
  case 'templates': return html`<sdig-workspace-placeholder class="view-host" label="Templates" subtitle="Reusable agreement templates"></sdig-workspace-placeholder>`;
166
169
  case 'team': return html`<sdig-workspace-placeholder class="view-host" label="Team" subtitle="Workspace members & roles"></sdig-workspace-placeholder>`;
167
170
  case 'settings': return html`<sdig-workspace-placeholder class="view-host" label="Settings" subtitle="Workspace, billing, security"></sdig-workspace-placeholder>`;
168
- default: return html`<sdig-workspace-inbox class="view-host" .density=${this.density}></sdig-workspace-inbox>`;
171
+ default: return html`<sdig-workspace-inbox class="view-host" .density=${this.density} .documents=${this.documents}></sdig-workspace-inbox>`;
169
172
  }
170
173
  }
171
174