@verdocs/web-sdk 2.2.6 → 2.2.7

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 (126) hide show
  1. package/dist/cjs/{Primitives-be5088cb.js → Primitives-a59870a2.js} +20 -0
  2. package/dist/cjs/{Profiles-244e8254.js → Profiles-54271244.js} +15 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
  5. package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
  6. package/dist/cjs/{verdocs-button_2.cjs.entry.js → verdocs-button_3.cjs.entry.js} +48 -0
  7. package/dist/cjs/verdocs-checkbox_3.cjs.entry.js +56 -0
  8. package/dist/cjs/{verdocs-dialog_2.cjs.entry.js → verdocs-dialog_3.cjs.entry.js} +26 -2
  9. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-pagination_3.cjs.entry.js +1 -1
  11. package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +160 -27
  12. package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +1 -1
  14. package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  17. package/dist/collection/collection-manifest.json +1 -0
  18. package/dist/collection/components/controls/verdocs-table/verdocs-table.css +9 -8
  19. package/dist/collection/components/controls/verdocs-tabs/verdocs-tabs.css +33 -0
  20. package/dist/collection/components/controls/verdocs-tabs/verdocs-tabs.js +102 -0
  21. package/dist/collection/components/controls/verdocs-tabs/verdocs-tabs.stories.js +25 -0
  22. package/dist/collection/components/dialogs/verdocs-dialog/verdocs-dialog.js +0 -1
  23. package/dist/collection/components/settings/verdocs-settings-api-keys/verdocs-settings-api-keys.js +8 -11
  24. package/dist/collection/components/settings/verdocs-settings-members/verdocs-settings-members.css +31 -7
  25. package/dist/collection/components/settings/verdocs-settings-members/verdocs-settings-members.js +137 -10
  26. package/dist/components/{Strings.js → Members.js} +6 -6
  27. package/dist/components/Primitives.js +18 -1
  28. package/dist/components/Profiles.js +15 -1
  29. package/dist/components/index.d.ts +1 -0
  30. package/dist/components/index.js +1 -0
  31. package/dist/components/verdocs-dialog2.js +0 -1
  32. package/dist/components/verdocs-settings-api-keys2.js +9 -11
  33. package/dist/components/verdocs-settings-members2.js +193 -15
  34. package/dist/components/verdocs-settings-profile2.js +1 -1
  35. package/dist/components/verdocs-settings.js +26 -20
  36. package/dist/components/verdocs-table2.js +1 -1
  37. package/dist/components/verdocs-tabs.d.ts +11 -0
  38. package/dist/components/verdocs-tabs.js +6 -0
  39. package/dist/components/verdocs-tabs2.js +46 -0
  40. package/dist/docs.json +100 -5
  41. package/dist/esm/Primitives-8fe93caf.js +37 -0
  42. package/dist/esm/{Profiles-7645e6f1.js → Profiles-4cc942ef.js} +15 -1
  43. package/dist/esm/loader.js +1 -1
  44. package/dist/esm/verdocs-activity-box.entry.js +1 -1
  45. package/dist/esm/verdocs-auth.entry.js +1 -1
  46. package/dist/esm/{verdocs-button_2.entry.js → verdocs-button_3.entry.js} +49 -2
  47. package/dist/esm/verdocs-checkbox_3.entry.js +50 -0
  48. package/dist/esm/{verdocs-dialog_2.entry.js → verdocs-dialog_3.entry.js} +26 -3
  49. package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
  50. package/dist/esm/verdocs-pagination_3.entry.js +1 -1
  51. package/dist/esm/verdocs-settings-api-keys_4.entry.js +160 -27
  52. package/dist/esm/verdocs-sign.entry.js +1 -1
  53. package/dist/esm/verdocs-template-fields_4.entry.js +1 -1
  54. package/dist/esm/verdocs-templates-list.entry.js +1 -1
  55. package/dist/esm/verdocs-view.entry.js +1 -1
  56. package/dist/esm/verdocs-web-sdk.js +1 -1
  57. package/dist/esm-es5/Primitives-8fe93caf.js +1 -0
  58. package/dist/esm-es5/Profiles-4cc942ef.js +1 -0
  59. package/dist/esm-es5/loader.js +1 -1
  60. package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
  61. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  62. package/dist/esm-es5/verdocs-button_3.entry.js +1 -0
  63. package/dist/esm-es5/verdocs-checkbox_3.entry.js +1 -0
  64. package/dist/esm-es5/verdocs-dialog_3.entry.js +1 -0
  65. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  66. package/dist/esm-es5/verdocs-pagination_3.entry.js +1 -1
  67. package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
  68. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  69. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  70. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  71. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  72. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  73. package/dist/types/components/controls/verdocs-tabs/verdocs-tabs.d.ts +31 -0
  74. package/dist/types/components/controls/verdocs-tabs/verdocs-tabs.stories.d.ts +7 -0
  75. package/dist/types/components/settings/verdocs-settings-members/verdocs-settings-members.d.ts +17 -1
  76. package/dist/types/components.d.ts +38 -0
  77. package/dist/verdocs-web-sdk/{p-68487ce7.system.entry.js → p-02bbfba3.system.entry.js} +1 -1
  78. package/dist/verdocs-web-sdk/p-0578c85b.system.entry.js +1 -0
  79. package/dist/verdocs-web-sdk/{p-4c9d9cd6.entry.js → p-0899dd63.entry.js} +1 -1
  80. package/dist/verdocs-web-sdk/p-19a0fdf2.entry.js +1 -0
  81. package/dist/verdocs-web-sdk/{p-690a485e.system.entry.js → p-1b10240a.system.entry.js} +1 -1
  82. package/dist/verdocs-web-sdk/p-3a0c5966.system.entry.js +1 -0
  83. package/dist/verdocs-web-sdk/p-3bcd86ea.system.js +1 -0
  84. package/dist/verdocs-web-sdk/{p-4f0c253e.system.entry.js → p-3cf4bd84.system.entry.js} +1 -1
  85. package/dist/verdocs-web-sdk/p-4f8dbb97.entry.js +1 -0
  86. package/dist/verdocs-web-sdk/p-5e808a0b.js +1 -0
  87. package/dist/verdocs-web-sdk/p-647cdb84.system.js +1 -1
  88. package/dist/verdocs-web-sdk/p-6572cc71.system.entry.js +1 -0
  89. package/dist/verdocs-web-sdk/{p-0d590026.entry.js → p-7967b361.entry.js} +1 -1
  90. package/dist/verdocs-web-sdk/{p-dfcbcf0b.entry.js → p-803924f3.entry.js} +1 -1
  91. package/dist/verdocs-web-sdk/p-937cd171.system.entry.js +1 -0
  92. package/dist/verdocs-web-sdk/{p-a1eb425e.system.entry.js → p-96ca789b.system.entry.js} +1 -1
  93. package/dist/verdocs-web-sdk/{p-075dc36d.js → p-983da2f6.js} +1 -1
  94. package/dist/verdocs-web-sdk/{p-e9d2b68a.entry.js → p-a2b83969.entry.js} +1 -1
  95. package/dist/verdocs-web-sdk/{p-043eab3f.system.entry.js → p-c556a377.system.entry.js} +1 -1
  96. package/dist/verdocs-web-sdk/p-cb9985fe.entry.js +1 -0
  97. package/dist/verdocs-web-sdk/p-cfead4df.entry.js +1 -0
  98. package/dist/verdocs-web-sdk/{p-dd5460ea.entry.js → p-d277233c.entry.js} +1 -1
  99. package/dist/verdocs-web-sdk/{p-b3e0db4b.system.entry.js → p-e0a212a1.system.entry.js} +1 -1
  100. package/dist/verdocs-web-sdk/{p-b4ac7a21.entry.js → p-ed38d3d2.entry.js} +1 -1
  101. package/dist/verdocs-web-sdk/p-f65a1b9e.system.js +1 -0
  102. package/dist/verdocs-web-sdk/{p-986f78e3.entry.js → p-f7fecffd.entry.js} +1 -1
  103. package/dist/verdocs-web-sdk/{p-1d7846c9.entry.js → p-fb609f37.entry.js} +1 -1
  104. package/dist/verdocs-web-sdk/{p-bf8bded0.system.entry.js → p-fb71f28a.system.entry.js} +1 -1
  105. package/dist/verdocs-web-sdk/{p-febebe69.system.entry.js → p-ff850808.system.entry.js} +1 -1
  106. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  107. package/package.json +2 -2
  108. package/dist/cjs/verdocs-checkbox_4.cjs.entry.js +0 -104
  109. package/dist/esm/Primitives-054bc6e5.js +0 -20
  110. package/dist/esm/verdocs-checkbox_4.entry.js +0 -97
  111. package/dist/esm-es5/Primitives-054bc6e5.js +0 -1
  112. package/dist/esm-es5/Profiles-7645e6f1.js +0 -1
  113. package/dist/esm-es5/verdocs-button_2.entry.js +0 -1
  114. package/dist/esm-es5/verdocs-checkbox_4.entry.js +0 -1
  115. package/dist/esm-es5/verdocs-dialog_2.entry.js +0 -1
  116. package/dist/verdocs-web-sdk/p-0fecb805.entry.js +0 -1
  117. package/dist/verdocs-web-sdk/p-13585ecc.system.entry.js +0 -1
  118. package/dist/verdocs-web-sdk/p-4821f318.system.entry.js +0 -1
  119. package/dist/verdocs-web-sdk/p-7291906c.js +0 -1
  120. package/dist/verdocs-web-sdk/p-77f04115.entry.js +0 -1
  121. package/dist/verdocs-web-sdk/p-8a77db15.entry.js +0 -1
  122. package/dist/verdocs-web-sdk/p-96c4637b.system.entry.js +0 -1
  123. package/dist/verdocs-web-sdk/p-bc442f6c.system.entry.js +0 -1
  124. package/dist/verdocs-web-sdk/p-c9ac0d2f.entry.js +0 -1
  125. package/dist/verdocs-web-sdk/p-cbebc039.system.js +0 -1
  126. package/dist/verdocs-web-sdk/p-d50523fd.system.js +0 -1
@@ -0,0 +1,102 @@
1
+ import { Host, h } from '@stencil/core';
2
+ /**
3
+ * Display a simple row of selectable tabs.
4
+ */
5
+ export class VerdocsTabs {
6
+ constructor() {
7
+ this.tabs = [];
8
+ this.defaultTab = 0;
9
+ this.selectedTab = 0;
10
+ }
11
+ componentWillLoad() {
12
+ this.selectedTab = this.defaultTab || 0;
13
+ }
14
+ handleSelectTab(index) {
15
+ var _a;
16
+ this.selectedTab = index;
17
+ (_a = this.selectTab) === null || _a === void 0 ? void 0 : _a.emit({ tab: this.tabs[index], index });
18
+ }
19
+ render() {
20
+ return (h(Host, null, this.tabs.map((tab, index) => (h("div", { class: `tab ${index === this.selectedTab ? 'active' : ''} ${tab.disabled ? 'disabled' : ''}`, onClick: tab.disabled ? () => { } : () => this.handleSelectTab(index) }, tab.label))), h("div", { class: "flex flex-1" }), h("slot", null, h("div", null))));
21
+ }
22
+ static get is() { return "verdocs-tabs"; }
23
+ static get originalStyleUrls() {
24
+ return {
25
+ "$": ["verdocs-tabs.scss"]
26
+ };
27
+ }
28
+ static get styleUrls() {
29
+ return {
30
+ "$": ["verdocs-tabs.css"]
31
+ };
32
+ }
33
+ static get properties() {
34
+ return {
35
+ "tabs": {
36
+ "type": "unknown",
37
+ "mutable": false,
38
+ "complexType": {
39
+ "original": "ITab[]",
40
+ "resolved": "ITab[]",
41
+ "references": {
42
+ "ITab": {
43
+ "location": "local"
44
+ }
45
+ }
46
+ },
47
+ "required": false,
48
+ "optional": false,
49
+ "docs": {
50
+ "tags": [],
51
+ "text": "The tabs to display"
52
+ },
53
+ "defaultValue": "[]"
54
+ },
55
+ "defaultTab": {
56
+ "type": "number",
57
+ "mutable": false,
58
+ "complexType": {
59
+ "original": "number",
60
+ "resolved": "number",
61
+ "references": {}
62
+ },
63
+ "required": false,
64
+ "optional": false,
65
+ "docs": {
66
+ "tags": [],
67
+ "text": "The index of the initial tab to select."
68
+ },
69
+ "attribute": "default-tab",
70
+ "reflect": false,
71
+ "defaultValue": "0"
72
+ }
73
+ };
74
+ }
75
+ static get states() {
76
+ return {
77
+ "selectedTab": {}
78
+ };
79
+ }
80
+ static get events() {
81
+ return [{
82
+ "method": "selectTab",
83
+ "name": "selectTab",
84
+ "bubbles": true,
85
+ "cancelable": true,
86
+ "composed": true,
87
+ "docs": {
88
+ "tags": [],
89
+ "text": "Event fired when the user clicks a template to view it. Typically the host application will use this to navigate\nto the template preview. This is also fired when the user selects \"Preview/Send\" fropm the dropdown menu."
90
+ },
91
+ "complexType": {
92
+ "original": "{tab: ITab; index: number}",
93
+ "resolved": "{ tab: ITab; index: number; }",
94
+ "references": {
95
+ "ITab": {
96
+ "location": "local"
97
+ }
98
+ }
99
+ }
100
+ }];
101
+ }
102
+ }
@@ -0,0 +1,25 @@
1
+ import { html } from 'lit-html';
2
+ export default {
3
+ title: 'Controls/Tabs',
4
+ component: 'verdocs-tabs',
5
+ args: {
6
+ tabs: [
7
+ { id: 'id', header: 'ID' },
8
+ { id: 'name', header: 'Name' },
9
+ {
10
+ id: 'date',
11
+ header: 'Date',
12
+ renderHeader: () => 'Past Due Since',
13
+ renderCell: (_, row) => `<span style="color: red">${new Date(row.date).toLocaleDateString()}</a>`,
14
+ },
15
+ ],
16
+ data: [
17
+ { id: '123', name: 'Test 1', date: new Date() },
18
+ { id: '456', name: 'Test 2', date: new Date() },
19
+ ],
20
+ },
21
+ parameters: {
22
+ layout: 'fullscreen',
23
+ },
24
+ };
25
+ export const Table = ({ columns, data }) => html `<verdocs-table .columns=${columns} .data=${data} />`;
@@ -6,7 +6,6 @@ export class VerdocsDialog {
6
6
  // We need a separate event handler for clicking the background because it can receive events "through" other child components
7
7
  handleDismiss(e) {
8
8
  var _a;
9
- console.log('e', e.target.className);
10
9
  if (e.target.className === 'background-overlay') {
11
10
  e.preventDefault();
12
11
  (_a = this.exit) === null || _a === void 0 ? void 0 : _a.emit();
@@ -1,10 +1,10 @@
1
1
  import { VerdocsEndpoint } from '@verdocs/js-sdk';
2
- import { capitalize } from '@verdocs/js-sdk/Utils/Strings';
3
2
  import { ApiKeys, Members } from '@verdocs/js-sdk/Organizations';
3
+ import { formatFullName } from '@verdocs/js-sdk/Utils/Primitives';
4
4
  import { h, Host } from '@stencil/core';
5
5
  import { VerdocsToast } from '../../../utils/Toast';
6
6
  import { SDKError } from '../../../utils/errors';
7
- const ClockIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25zM12.75 6a.75.75 0 00-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 000-1.5h-3.75V6z" clip-rule="evenodd" /></svg>`;
7
+ // const ClockIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25zM12.75 6a.75.75 0 00-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 000-1.5h-3.75V6z" clip-rule="evenodd" /></svg>`;
8
8
  const TagIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M5.5 3A2.5 2.5 0 003 5.5v2.879a2.5 2.5 0 00.732 1.767l6.5 6.5a2.5 2.5 0 003.536 0l2.878-2.878a2.5 2.5 0 000-3.536l-6.5-6.5A2.5 2.5 0 008.38 3H5.5zM6 7a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" /></svg>`;
9
9
  const UserIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-5.5-2.5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zM10 12a5.99 5.99 0 00-4.793 2.39A6.483 6.483 0 0010 16.5a6.483 6.483 0 004.793-2.11A5.99 5.99 0 0010 12z" clip-rule="evenodd" /></svg>`;
10
10
  const TrashIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>`;
@@ -105,17 +105,17 @@ export class VerdocsSettingsApiKeys {
105
105
  });
106
106
  }
107
107
  render() {
108
- var _a, _b, _c, _d, _e, _f, _g;
109
- const profileOptions = this.members.map(member => ({ label: `${member.first_name} ${member.last_name}`, value: member.id }));
108
+ var _a, _b, _c, _d;
109
+ const profileOptions = this.members.map(member => ({ label: formatFullName(member), value: member.id }));
110
110
  if (!this.endpoint.session) {
111
111
  console.log('[SETTINGS] Must be authenticated');
112
112
  return h(Host, { class: "authentication-required" }, "Must be authenticated");
113
113
  }
114
- return (h(Host, null, h("h1", null, "API Keys"), h("verdocs-table", { data: this.keys, columns: [
114
+ return (h(Host, null, h("verdocs-table", { data: this.keys, columns: [
115
115
  {
116
116
  id: 'name',
117
117
  header: 'Name',
118
- renderCell: (_, row) => (h("div", null, h("div", { innerHTML: ClockIcon }), h("div", null, row.name))),
118
+ renderCell: (_, row) => (h("div", null, h("div", null, row.name))),
119
119
  },
120
120
  {
121
121
  id: 'client_id',
@@ -125,10 +125,7 @@ export class VerdocsSettingsApiKeys {
125
125
  {
126
126
  id: 'profile_id',
127
127
  header: 'Acts as',
128
- renderCell: (_, row) => {
129
- var _a, _b;
130
- return (h("div", null, h("div", { innerHTML: UserIcon }), h("div", null, capitalize((_a = row.profile) === null || _a === void 0 ? void 0 : _a.first_name), " ", capitalize((_b = row.profile) === null || _b === void 0 ? void 0 : _b.last_name))));
131
- },
128
+ renderCell: (_, row) => (h("div", null, h("div", { innerHTML: UserIcon }), h("div", null, formatFullName(row.profile)))),
132
129
  },
133
130
  {
134
131
  id: 'actions',
@@ -139,7 +136,7 @@ export class VerdocsSettingsApiKeys {
139
136
  this.newApiKeyName = e.target.value.trim();
140
137
  } }), h("p", null, "API keys must be associated with a profile. Actions performed via API calls using this key will \"act as\" this profile."), h("verdocs-select-input", { options: profileOptions, label: "Act as Profile", onInput: (e) => {
141
138
  this.newApiKeyProfileId = e.target.value;
142
- } }), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", label: "Cancel", onClick: () => (this.creatingKey = false) }), h("verdocs-button", { size: "small", label: "OK", onClick: () => this.handleCreateKey() }))))), this.createdKey && (h("verdocs-dialog", { onExit: () => (this.createdKey = null) }, h("div", { slot: "title", class: "heading" }, "API Key Details"), h("div", { class: "content" }, h("verdocs-text-input", { label: "Name", disabled: true, value: (_a = this.createdKey) === null || _a === void 0 ? void 0 : _a.name }), h("verdocs-text-input", { label: "Profile", disabled: true, value: `${(_c = (_b = this.createdKey) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.first_name} ${(_e = (_d = this.createdKey) === null || _d === void 0 ? void 0 : _d.profile) === null || _e === void 0 ? void 0 : _e.last_name}` }), h("p", null, "Please save the Client ID and Secret below. Be sure to never expose your secret key in insecure (Web or mobile environments)!"), h("verdocs-text-input", { label: "Client ID", disabled: true, value: (_f = this.createdKey) === null || _f === void 0 ? void 0 : _f.client_id, copyable: true }), h("verdocs-text-input", { label: "Secret Key", disabled: true, value: (_g = this.createdKey) === null || _g === void 0 ? void 0 : _g.client_secret, copyable: true }), h("div", { class: "buttons" }, h("verdocs-button", { size: "small", label: "Done", onClick: () => (this.createdKey = null) })))))));
139
+ } }), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", label: "Cancel", onClick: () => (this.creatingKey = false) }), h("verdocs-button", { size: "small", label: "OK", onClick: () => this.handleCreateKey() }))))), this.createdKey && (h("verdocs-dialog", { onExit: () => (this.createdKey = null) }, h("div", { slot: "title", class: "heading" }, "API Key Details"), h("div", { class: "content" }, h("verdocs-text-input", { label: "Name", disabled: true, value: (_a = this.createdKey) === null || _a === void 0 ? void 0 : _a.name }), h("verdocs-text-input", { label: "Profile", disabled: true, value: formatFullName((_b = this.createdKey) === null || _b === void 0 ? void 0 : _b.profile) }), h("p", null, "Please save the Client ID and Secret below. Be sure to never expose your secret key in insecure (Web or mobile environments)!"), h("verdocs-text-input", { label: "Client ID", disabled: true, value: (_c = this.createdKey) === null || _c === void 0 ? void 0 : _c.client_id, copyable: true }), h("verdocs-text-input", { label: "Secret Key", disabled: true, value: (_d = this.createdKey) === null || _d === void 0 ? void 0 : _d.client_secret, copyable: true }), h("div", { class: "buttons" }, h("verdocs-button", { size: "small", label: "Done", onClick: () => (this.createdKey = null) })))))));
143
140
  }
144
141
  static get is() { return "verdocs-settings-api-keys"; }
145
142
  static get originalStyleUrls() {
@@ -23,16 +23,40 @@ verdocs-settings-members .role {
23
23
  align-items: center;
24
24
  justify-content: center;
25
25
  }
26
- verdocs-settings-members .col.col-actions {
26
+ verdocs-settings-members .table {
27
+ margin: 12px 0;
28
+ }
29
+ verdocs-settings-members .data-col div {
30
+ gap: 12px;
31
+ display: flex;
27
32
  align-items: center;
28
- text-align: center;
33
+ flex-direction: row;
29
34
  }
30
- verdocs-settings-members .col.col-actions svg {
31
- cursor: pointer;
35
+ verdocs-settings-members .data-col svg {
32
36
  width: 24px;
33
37
  height: 24px;
34
- fill: #777777;
35
38
  }
36
- verdocs-settings-members .col.col-actions svg:hover {
37
- fill: red;
39
+ verdocs-settings-members .col-name svg,
40
+ verdocs-settings-members .col-client_id svg,
41
+ verdocs-settings-members .col-profile_id svg {
42
+ fill: #a1a1aa;
43
+ }
44
+ verdocs-settings-members .col-actions svg {
45
+ fill: #ffffff;
46
+ stroke: #a1a1aa;
47
+ }
48
+ verdocs-settings-members .col-actions svg:hover {
49
+ cursor: pointer;
50
+ stroke: red;
51
+ }
52
+ verdocs-settings-members .col-actions > div {
53
+ justify-content: center;
54
+ }
55
+ verdocs-settings-members .header-col.col-actions {
56
+ text-align: center;
57
+ }
58
+ verdocs-settings-members verdocs-dialog p {
59
+ font-size: 16px;
60
+ line-height: 18px;
61
+ margin: 0 0 1em 0;
38
62
  }
@@ -1,10 +1,14 @@
1
- import { Members } from '@verdocs/js-sdk/Organizations';
1
+ import { Profiles } from '@verdocs/js-sdk/Users';
2
2
  import { VerdocsEndpoint } from '@verdocs/js-sdk';
3
+ import { capitalize } from '@verdocs/js-sdk/Utils/Strings';
4
+ import { Members, Invitations } from '@verdocs/js-sdk/Organizations';
5
+ import { formatFullName, formatInitials } from '@verdocs/js-sdk/Utils/Primitives';
3
6
  import { h, Host } from '@stencil/core';
4
7
  import { VerdocsToast } from '../../../utils/Toast';
5
8
  import { SDKError } from '../../../utils/errors';
6
- import { capitalize } from '@verdocs/js-sdk/Utils/Strings';
9
+ import { format } from 'date-fns';
7
10
  const TrashIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>`;
11
+ const ArrowPathIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>`;
8
12
  const getRoleLabel = (roles) => {
9
13
  if (roles.find(role => role.name === 'owner') !== undefined)
10
14
  return 'Owner';
@@ -36,6 +40,16 @@ export class VerdocsSettingsMembers {
36
40
  constructor() {
37
41
  this.endpoint = VerdocsEndpoint.getDefault();
38
42
  this.members = [];
43
+ this.invited = [];
44
+ this.roles = [];
45
+ this.selectedTab = 0;
46
+ this.invitingMember = false;
47
+ this.newEmailAddress = '';
48
+ this.newRoleId = '';
49
+ this.submitting = false;
50
+ this.deletingInvitation = null;
51
+ this.resendingInvitation = null;
52
+ this.deletingMember = null;
39
53
  }
40
54
  componentWillLoad() {
41
55
  this.endpoint.loadSession();
@@ -45,31 +59,134 @@ export class VerdocsSettingsMembers {
45
59
  }
46
60
  }
47
61
  async componentDidLoad() {
48
- var _a, _b, _c;
62
+ this.loadMembers().catch((e) => console.log('Unknown Error', e));
63
+ }
64
+ async loadMembers() {
65
+ var _a, _b, _c, _d;
49
66
  try {
50
- this.members = await Members.getMembers(this.endpoint, this.endpoint.session.organization_id);
67
+ const [roles, members, invites] = await Promise.all([
68
+ Profiles.getRoles(this.endpoint),
69
+ Members.getMembers(this.endpoint, this.endpoint.session.organization_id),
70
+ Invitations.getInvitations(this.endpoint, this.endpoint.session.organization_id),
71
+ ]);
72
+ this.roles = roles;
73
+ this.members = members;
74
+ this.invited = invites;
75
+ this.newRoleId = ((_a = roles.find(role => role.name === 'member')) === null || _a === void 0 ? void 0 : _a.id) || '';
51
76
  }
52
77
  catch (e) {
53
- (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
78
+ (_b = this.sdkError) === null || _b === void 0 ? void 0 : _b.emit(new SDKError(e.message, (_c = e.response) === null || _c === void 0 ? void 0 : _c.status, (_d = e.response) === null || _d === void 0 ? void 0 : _d.data));
54
79
  VerdocsToast('Unable to load members. Please try again later');
55
80
  }
56
81
  }
82
+ async handleInviteMember() {
83
+ this.submitting = true;
84
+ Invitations.createInvitation(VerdocsEndpoint.getDefault(), this.endpoint.session.organization_id, {
85
+ email: this.newEmailAddress,
86
+ role_id: this.newRoleId,
87
+ organization_id: this.endpoint.session.organization_id,
88
+ })
89
+ .then(r => {
90
+ console.log('[SETTINGS] Invited member', r);
91
+ this.invitingMember = false;
92
+ this.submitting = false;
93
+ this.newRoleId = '';
94
+ this.newEmailAddress = '';
95
+ VerdocsToast('Invitation sent!', { style: 'success' });
96
+ this.loadMembers();
97
+ })
98
+ .catch(e => {
99
+ console.log('[SETTINGS] Unable to invite member', e);
100
+ this.invitingMember = false;
101
+ this.submitting = false;
102
+ this.newRoleId = '';
103
+ this.newEmailAddress = '';
104
+ VerdocsToast('Unable to invite member. Please try again later', { style: 'error' });
105
+ });
106
+ }
107
+ async handleDeleteMember() {
108
+ this.submitting = true;
109
+ Members.deleteMember(VerdocsEndpoint.getDefault(), this.deletingMember.organization_id, this.deletingMember.email)
110
+ .then(() => {
111
+ this.submitting = false;
112
+ this.deletingMember = null;
113
+ VerdocsToast('The member has been deleted.', { style: 'success' });
114
+ this.loadMembers();
115
+ })
116
+ .catch(e => {
117
+ this.submitting = false;
118
+ this.deletingMember = null;
119
+ console.log('Delete error', e);
120
+ VerdocsToast('Unable to cancel invitation. Please try again later', { style: 'error' });
121
+ });
122
+ }
123
+ async handleDeleteInvitation() {
124
+ this.submitting = true;
125
+ Invitations.deleteInvitation(VerdocsEndpoint.getDefault(), this.deletingInvitation.organization_id, this.deletingInvitation.email)
126
+ .then(() => {
127
+ this.submitting = false;
128
+ this.deletingInvitation = null;
129
+ VerdocsToast('The invitation has been cancelled.', { style: 'success' });
130
+ this.loadMembers();
131
+ })
132
+ .catch(e => {
133
+ this.submitting = false;
134
+ this.deletingInvitation = null;
135
+ console.log('Delete error', e);
136
+ VerdocsToast('Unable to cancel invitation. Please try again later', { style: 'error' });
137
+ });
138
+ }
139
+ async handleResendInvitation() {
140
+ this.submitting = true;
141
+ Invitations.resendInvitation(VerdocsEndpoint.getDefault(), this.resendingInvitation.organization_id, this.resendingInvitation.email)
142
+ .then(() => {
143
+ this.submitting = false;
144
+ this.resendingInvitation = null;
145
+ VerdocsToast('The invitation has been resent.', { style: 'success' });
146
+ this.loadMembers();
147
+ })
148
+ .catch(e => {
149
+ this.submitting = false;
150
+ this.resendingInvitation = null;
151
+ console.log('REsend error', e);
152
+ VerdocsToast('Unable to resend invitation. Please try again later', { style: 'error' });
153
+ });
154
+ }
57
155
  render() {
58
156
  if (!this.endpoint.session) {
59
157
  console.log('[SETTINGS] Must be authenticated');
60
158
  return h(Host, { class: "authentication-required" }, "Must be authenticated");
61
159
  }
62
- return (h(Host, null, h("h1", null, "Members"), h("verdocs-table", { data: this.members, columns: [
160
+ const roleOptions = this.roles.map(role => ({ label: getRoleLabel([{ name: role.name }]), value: role.id }));
161
+ return (h(Host, null, h("verdocs-tabs", { tabs: [{ label: `Members (${this.members.length})` }, { label: `Pending Invitations (${this.invited.length})` }], onSelectTab: e => (this.selectedTab = e.detail.index) }), this.selectedTab === 0 && (h("verdocs-table", { data: this.members, columns: [
63
162
  {
64
163
  id: 'name',
65
164
  renderHeader: () => 'Member',
66
- renderCell: (_, row) => (h("div", { style: { display: 'flex', flexDirection: 'row', gap: '10px', alignItems: 'center' } }, h("div", { class: "role", style: { backgroundColor: getRoleColor(row.roles) } }, row.first_name.charAt(0), " ", row.last_name.charAt(0)), h("span", null, capitalize(row.first_name), " ", capitalize(row.last_name)))),
165
+ renderCell: (_, row) => (h("div", { style: { display: 'flex', flexDirection: 'row', gap: '10px', alignItems: 'center' } }, h("div", { class: "role", style: { backgroundColor: getRoleColor(row.roles) } }, formatInitials(row)), h("span", null, formatFullName(row)))),
67
166
  },
68
167
  { id: 'email', header: 'E-mail Address' },
69
168
  { id: 'phone', header: 'Phone Number' },
70
169
  { id: 'roles', header: 'Role', renderCell: (_, row) => `${getRoleLabel(row.roles)}` },
71
- { id: 'actions', header: 'Actions', renderCell: () => h("span", { innerHTML: TrashIcon, onClick: () => { } }) },
72
- ] }), h("verdocs-button", { label: "Invite New Member", size: "normal", disabled: true })));
170
+ {
171
+ id: 'actions',
172
+ header: 'Actions',
173
+ renderCell: (_, row) => h("div", null, row.id !== this.endpoint.session.profile_id && h("div", { innerHTML: TrashIcon, onClick: () => (this.deletingMember = row) })),
174
+ },
175
+ ] })), this.selectedTab === 1 && (h("verdocs-table", { data: this.invited, columns: [
176
+ { id: 'email', header: 'E-mail Address' },
177
+ { id: 'generated_at', header: 'Invited', renderCell: (_, row) => h("div", null, format(new Date(row.generated_at), 'MMM d, Y')) },
178
+ { id: 'role_id', header: 'Role', renderCell: (_, row) => { var _a; return h("div", null, getRoleLabel([{ name: (_a = this.roles.find(r => r.id === row.role_id)) === null || _a === void 0 ? void 0 : _a.name }])); } },
179
+ { id: 'status', header: 'Status', renderCell: (_, row) => h("div", null, capitalize(row.status)) },
180
+ {
181
+ id: 'actions',
182
+ header: 'Actions',
183
+ renderCell: (_, row) => (h("div", null, h("div", { innerHTML: TrashIcon, onClick: () => (this.deletingInvitation = row) }), h("div", { innerHTML: ArrowPathIcon, onClick: () => (this.resendingInvitation = row) }))),
184
+ },
185
+ ] })), h("verdocs-button", { label: "Invite New Member", size: "normal", disabled: this.submitting, onClick: () => (this.invitingMember = true) }), this.invitingMember && (h("verdocs-dialog", { onExit: () => (this.invitingMember = false) }, h("div", { slot: "title", class: "heading" }, "Invite New Member"), h("div", { class: "content" }, h("verdocs-text-input", { label: "E-mail Address", placeholder: "Enter the user's email address...", id: "verdocs-invite-email", value: this.newEmailAddress, autocomplete: "off", required: true, onInput: (e) => (this.newEmailAddress = e.target.value), onFocusout: (e) => {
186
+ this.newEmailAddress = e.target.value.trim();
187
+ } }), h("div", { style: { marginBottom: '20px' } }), h("verdocs-select-input", { options: roleOptions, label: "Role", onInput: (e) => {
188
+ this.newRoleId = e.target.value;
189
+ } }), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", label: "Cancel", disabled: this.submitting, onClick: () => (this.invitingMember = false) }), h("verdocs-button", { size: "small", label: "OK", disabled: this.submitting || !this.newEmailAddress || !this.newRoleId, onClick: () => this.handleInviteMember() }))))), this.deletingMember && (h("verdocs-dialog", { onExit: () => (this.deletingMember = null) }, h("div", { slot: "title", class: "heading" }, "Delete Member?"), h("div", { class: "content" }, h("p", null, "Are you sure you want to delete this member? This action cannot be undone."), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", disabled: this.submitting, label: "Cancel", onClick: () => (this.deletingMember = null) }), h("verdocs-button", { size: "small", label: "OK", disabled: this.submitting, onClick: () => this.handleDeleteMember() }))))), this.deletingInvitation && (h("verdocs-dialog", { onExit: () => (this.deletingInvitation = null) }, h("div", { slot: "title", class: "heading" }, "Cancel Invitation?"), h("div", { class: "content" }, h("p", null, "Are you sure you want to cancel this invitation? This action cannot be undone."), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", disabled: this.submitting, label: "Cancel", onClick: () => (this.deletingInvitation = null) }), h("verdocs-button", { size: "small", label: "OK", disabled: this.submitting, onClick: () => this.handleDeleteInvitation() }))))), this.resendingInvitation && (h("verdocs-dialog", { onExit: () => (this.resendingInvitation = null) }, h("div", { slot: "title", class: "heading" }, "Resend Invitation?"), h("div", { class: "content" }, h("p", null, "The user will receive an email reminder to join your organization."), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", disabled: this.submitting, label: "Cancel", onClick: () => (this.resendingInvitation = null) }), h("verdocs-button", { size: "small", label: "OK", disabled: this.submitting, onClick: () => this.handleResendInvitation() })))))));
73
190
  }
74
191
  static get is() { return "verdocs-settings-members"; }
75
192
  static get originalStyleUrls() {
@@ -109,7 +226,17 @@ export class VerdocsSettingsMembers {
109
226
  }
110
227
  static get states() {
111
228
  return {
112
- "members": {}
229
+ "members": {},
230
+ "invited": {},
231
+ "roles": {},
232
+ "selectedTab": {},
233
+ "invitingMember": {},
234
+ "newEmailAddress": {},
235
+ "newRoleId": {},
236
+ "submitting": {},
237
+ "deletingInvitation": {},
238
+ "resendingInvitation": {},
239
+ "deletingMember": {}
113
240
  };
114
241
  }
115
242
  static get events() {
@@ -8,10 +8,10 @@ var getMembers = function (endpoint, organizationId) {
8
8
  .get("/organizations/".concat(organizationId, "/profiles"))
9
9
  .then(function (r) { return r.data; });
10
10
  };
11
+ var deleteMember = function (endpoint, organizationId, profileId) {
12
+ return endpoint.api //
13
+ .delete("/organizations/".concat(organizationId, "/profiles/").concat(profileId))
14
+ .then(function (r) { return r.data; });
15
+ };
11
16
 
12
- /**
13
- * Capitalize the first letter of a string.
14
- */
15
- var capitalize = function (str) { return str.charAt(0).toUpperCase() + str.slice(1); };
16
-
17
- export { capitalize as c, getMembers as g };
17
+ export { deleteMember as d, getMembers as g };
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Capitalize the first letter of a string.
3
+ */
4
+ var capitalize = function (str) { return str.charAt(0).toUpperCase() + str.slice(1); };
5
+
1
6
  /**
2
7
  * Create an array containing a sequence of integers, e.g. [START, START+1, START+2, ...] This is frequently useful
3
8
  * in rendering operations when there is no source array to .map() across.
@@ -7,6 +12,18 @@ var integerSequence = function (start, count) {
7
12
  .fill(1)
8
13
  .map(function (_, index) { return index + start; });
9
14
  };
15
+ /**
16
+ * Format a profile's full name
17
+ */
18
+ var formatFullName = function (profile) {
19
+ return profile ? "".concat(capitalize(profile.first_name), " ").concat(capitalize(profile.last_name)) : 'Invalid User';
20
+ };
21
+ /**
22
+ * Format a profile's initials
23
+ */
24
+ var formatInitials = function (profile) {
25
+ return profile ? "".concat(capitalize(profile.first_name).charAt(0), " ").concat(capitalize(profile.last_name).charAt(0)) : '--';
26
+ };
10
27
  /**
11
28
  * Generate suggested initials for a full name, e.g. "John Doe" will yield "JD".
12
29
  */
@@ -17,4 +34,4 @@ var fullNameToInitials = function (name) {
17
34
  .join('');
18
35
  };
19
36
 
20
- export { fullNameToInitials as f, integerSequence as i };
37
+ export { formatFullName as a, formatInitials as b, capitalize as c, fullNameToInitials as f, integerSequence as i };
@@ -21,6 +21,20 @@ var getCurrentProfile = function (endpoint) {
21
21
  .get('/profiles')
22
22
  .then(function (r) { return (r.data || []).find(function (profile) { return profile.current; }); });
23
23
  };
24
+ /**
25
+ * Get a list of system roles.
26
+ *
27
+ * ```typescript
28
+ * import {Profiles} from '@verdocs/js-sdk/Users';
29
+ *
30
+ * const roles = await Profiles.getRoles();
31
+ * ```
32
+ */
33
+ var getRoles = function (endpoint) {
34
+ return endpoint.api //
35
+ .get('/roles')
36
+ .then(function (r) { return r.data; });
37
+ };
24
38
  /**
25
39
  * Update a profile. For future expansion, the profile ID to update is required, but currently this must also be the
26
40
  * "current" profile for the caller.
@@ -54,4 +68,4 @@ var createBusinessAccount = function (endpoint, params) {
54
68
  .then(function (r) { return r.data; });
55
69
  };
56
70
 
57
- export { createBusinessAccount as c, getCurrentProfile as g, updateProfile as u };
71
+ export { getCurrentProfile as a, createBusinessAccount as c, getRoles as g, updateProfile as u };
@@ -56,6 +56,7 @@ export { VerdocsSignatureDialog as VerdocsSignatureDialog } from '../types/compo
56
56
  export { VerdocsQuickFilter as VerdocsSpinner } from '../types/components/controls/verdocs-spinner/verdocs-spinner';
57
57
  export { VerdocsStatusIndicator as VerdocsStatusIndicator } from '../types/components/envelopes/verdocs-status-indicator/verdocs-status-indicator';
58
58
  export { VerdocsTable as VerdocsTable } from '../types/components/controls/verdocs-table/verdocs-table';
59
+ export { VerdocsTabs as VerdocsTabs } from '../types/components/controls/verdocs-tabs/verdocs-tabs';
59
60
  export { VerdocsTemplateAttachments as VerdocsTemplateAttachments } from '../types/components/templates/verdocs-template-attachments/verdocs-template-attachments';
60
61
  export { VerdocsTemplateCard as VerdocsTemplateCard } from '../types/components/templates/verdocs-template-card/verdocs-template-card';
61
62
  export { VerdocsTemplateCreate as VerdocsTemplateCreate } from '../types/components/templates/verdocs-template-create/verdocs-template-create';
@@ -56,6 +56,7 @@ export { VerdocsSignatureDialog, defineCustomElement as defineCustomElementVerdo
56
56
  export { VerdocsSpinner, defineCustomElement as defineCustomElementVerdocsSpinner } from './verdocs-spinner.js';
57
57
  export { VerdocsStatusIndicator, defineCustomElement as defineCustomElementVerdocsStatusIndicator } from './verdocs-status-indicator.js';
58
58
  export { VerdocsTable, defineCustomElement as defineCustomElementVerdocsTable } from './verdocs-table.js';
59
+ export { VerdocsTabs, defineCustomElement as defineCustomElementVerdocsTabs } from './verdocs-tabs.js';
59
60
  export { VerdocsTemplateAttachments, defineCustomElement as defineCustomElementVerdocsTemplateAttachments } from './verdocs-template-attachments.js';
60
61
  export { VerdocsTemplateCard, defineCustomElement as defineCustomElementVerdocsTemplateCard } from './verdocs-template-card.js';
61
62
  export { VerdocsTemplateCreate, defineCustomElement as defineCustomElementVerdocsTemplateCreate } from './verdocs-template-create.js';
@@ -11,7 +11,6 @@ const VerdocsDialog = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
11
11
  // We need a separate event handler for clicking the background because it can receive events "through" other child components
12
12
  handleDismiss(e) {
13
13
  var _a;
14
- console.log('e', e.target.className);
15
14
  if (e.target.className === 'background-overlay') {
16
15
  e.preventDefault();
17
16
  (_a = this.exit) === null || _a === void 0 ? void 0 : _a.emit();
@@ -1,7 +1,8 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import './Types.js';
3
- import { g as getMembers, c as capitalize } from './Strings.js';
3
+ import { g as getMembers } from './Members.js';
4
4
  import { V as VerdocsEndpoint } from './VerdocsEndpoint.js';
5
+ import { a as formatFullName } from './Primitives.js';
5
6
  import { V as VerdocsToast } from './Toast.js';
6
7
  import { S as SDKError } from './errors.js';
7
8
  import { d as defineCustomElement$6 } from './verdocs-button2.js';
@@ -82,7 +83,7 @@ var deleteKey = function (endpoint, organizationId, clientId) {
82
83
 
83
84
  const verdocsSettingsApiKeysCss = "verdocs-settings-api-keys{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-settings-api-keys .table{margin:12px 0}verdocs-settings-api-keys .data-col div{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-settings-api-keys .data-col svg{width:24px;height:24px}verdocs-settings-api-keys .col-name svg,verdocs-settings-api-keys .col-client_id svg,verdocs-settings-api-keys .col-profile_id svg{fill:#a1a1aa}verdocs-settings-api-keys .col-actions svg{fill:#ffffff;stroke:#a1a1aa}verdocs-settings-api-keys .col-actions svg:hover{cursor:pointer;stroke:red}verdocs-settings-api-keys .col-actions>div{-ms-flex-pack:center;justify-content:center}verdocs-settings-api-keys .header-col.col-actions{text-align:center}verdocs-settings-api-keys verdocs-dialog p{font-size:16px;line-height:18px;margin:0 0 1em 0}";
84
85
 
85
- const ClockIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25zM12.75 6a.75.75 0 00-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 000-1.5h-3.75V6z" clip-rule="evenodd" /></svg>`;
86
+ // const ClockIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25zM12.75 6a.75.75 0 00-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 000-1.5h-3.75V6z" clip-rule="evenodd" /></svg>`;
86
87
  const TagIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M5.5 3A2.5 2.5 0 003 5.5v2.879a2.5 2.5 0 00.732 1.767l6.5 6.5a2.5 2.5 0 003.536 0l2.878-2.878a2.5 2.5 0 000-3.536l-6.5-6.5A2.5 2.5 0 008.38 3H5.5zM6 7a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" /></svg>`;
87
88
  const UserIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-5.5-2.5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zM10 12a5.99 5.99 0 00-4.793 2.39A6.483 6.483 0 0010 16.5a6.483 6.483 0 004.793-2.11A5.99 5.99 0 0010 12z" clip-rule="evenodd" /></svg>`;
88
89
  const TrashIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>`;
@@ -186,17 +187,17 @@ const VerdocsSettingsApiKeys = /*@__PURE__*/ proxyCustomElement(class extends HT
186
187
  });
187
188
  }
188
189
  render() {
189
- var _a, _b, _c, _d, _e, _f, _g;
190
- const profileOptions = this.members.map(member => ({ label: `${member.first_name} ${member.last_name}`, value: member.id }));
190
+ var _a, _b, _c, _d;
191
+ const profileOptions = this.members.map(member => ({ label: formatFullName(member), value: member.id }));
191
192
  if (!this.endpoint.session) {
192
193
  console.log('[SETTINGS] Must be authenticated');
193
194
  return h(Host, { class: "authentication-required" }, "Must be authenticated");
194
195
  }
195
- return (h(Host, null, h("h1", null, "API Keys"), h("verdocs-table", { data: this.keys, columns: [
196
+ return (h(Host, null, h("verdocs-table", { data: this.keys, columns: [
196
197
  {
197
198
  id: 'name',
198
199
  header: 'Name',
199
- renderCell: (_, row) => (h("div", null, h("div", { innerHTML: ClockIcon }), h("div", null, row.name))),
200
+ renderCell: (_, row) => (h("div", null, h("div", null, row.name))),
200
201
  },
201
202
  {
202
203
  id: 'client_id',
@@ -206,10 +207,7 @@ const VerdocsSettingsApiKeys = /*@__PURE__*/ proxyCustomElement(class extends HT
206
207
  {
207
208
  id: 'profile_id',
208
209
  header: 'Acts as',
209
- renderCell: (_, row) => {
210
- var _a, _b;
211
- return (h("div", null, h("div", { innerHTML: UserIcon }), h("div", null, capitalize((_a = row.profile) === null || _a === void 0 ? void 0 : _a.first_name), " ", capitalize((_b = row.profile) === null || _b === void 0 ? void 0 : _b.last_name))));
212
- },
210
+ renderCell: (_, row) => (h("div", null, h("div", { innerHTML: UserIcon }), h("div", null, formatFullName(row.profile)))),
213
211
  },
214
212
  {
215
213
  id: 'actions',
@@ -220,7 +218,7 @@ const VerdocsSettingsApiKeys = /*@__PURE__*/ proxyCustomElement(class extends HT
220
218
  this.newApiKeyName = e.target.value.trim();
221
219
  } }), h("p", null, "API keys must be associated with a profile. Actions performed via API calls using this key will \"act as\" this profile."), h("verdocs-select-input", { options: profileOptions, label: "Act as Profile", onInput: (e) => {
222
220
  this.newApiKeyProfileId = e.target.value;
223
- } }), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", label: "Cancel", onClick: () => (this.creatingKey = false) }), h("verdocs-button", { size: "small", label: "OK", onClick: () => this.handleCreateKey() }))))), this.createdKey && (h("verdocs-dialog", { onExit: () => (this.createdKey = null) }, h("div", { slot: "title", class: "heading" }, "API Key Details"), h("div", { class: "content" }, h("verdocs-text-input", { label: "Name", disabled: true, value: (_a = this.createdKey) === null || _a === void 0 ? void 0 : _a.name }), h("verdocs-text-input", { label: "Profile", disabled: true, value: `${(_c = (_b = this.createdKey) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.first_name} ${(_e = (_d = this.createdKey) === null || _d === void 0 ? void 0 : _d.profile) === null || _e === void 0 ? void 0 : _e.last_name}` }), h("p", null, "Please save the Client ID and Secret below. Be sure to never expose your secret key in insecure (Web or mobile environments)!"), h("verdocs-text-input", { label: "Client ID", disabled: true, value: (_f = this.createdKey) === null || _f === void 0 ? void 0 : _f.client_id, copyable: true }), h("verdocs-text-input", { label: "Secret Key", disabled: true, value: (_g = this.createdKey) === null || _g === void 0 ? void 0 : _g.client_secret, copyable: true }), h("div", { class: "buttons" }, h("verdocs-button", { size: "small", label: "Done", onClick: () => (this.createdKey = null) })))))));
221
+ } }), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", size: "small", label: "Cancel", onClick: () => (this.creatingKey = false) }), h("verdocs-button", { size: "small", label: "OK", onClick: () => this.handleCreateKey() }))))), this.createdKey && (h("verdocs-dialog", { onExit: () => (this.createdKey = null) }, h("div", { slot: "title", class: "heading" }, "API Key Details"), h("div", { class: "content" }, h("verdocs-text-input", { label: "Name", disabled: true, value: (_a = this.createdKey) === null || _a === void 0 ? void 0 : _a.name }), h("verdocs-text-input", { label: "Profile", disabled: true, value: formatFullName((_b = this.createdKey) === null || _b === void 0 ? void 0 : _b.profile) }), h("p", null, "Please save the Client ID and Secret below. Be sure to never expose your secret key in insecure (Web or mobile environments)!"), h("verdocs-text-input", { label: "Client ID", disabled: true, value: (_c = this.createdKey) === null || _c === void 0 ? void 0 : _c.client_id, copyable: true }), h("verdocs-text-input", { label: "Secret Key", disabled: true, value: (_d = this.createdKey) === null || _d === void 0 ? void 0 : _d.client_secret, copyable: true }), h("div", { class: "buttons" }, h("verdocs-button", { size: "small", label: "Done", onClick: () => (this.createdKey = null) })))))));
224
222
  }
225
223
  static get style() { return verdocsSettingsApiKeysCss; }
226
224
  }, [0, "verdocs-settings-api-keys", {