@verdocs/web-sdk 1.15.1 → 1.15.2
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/dist/cjs/{TemplateStore-fe148e97.js → TemplateStore-a7745f0a.js} +1 -1
- package/dist/cjs/{Templates-1a86703d.js → Templates-6fb62dcd.js} +15 -0
- package/dist/cjs/{index-7c19ba1d.js → index-961181ce.js} +37 -602
- package/dist/cjs/index-db620f37.js +575 -0
- package/dist/cjs/ipc-test.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-2c6835c6.js → utils-67dac0c3.js} +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-button-panel_3.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +5 -6
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-field-date.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-field-initial.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-field-signature.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-organization-card.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-pagination_3.cjs.entry.js +169 -0
- package/dist/cjs/verdocs-preview.cjs.entry.js +5 -4
- package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-send.cjs.entry.js +5 -4
- package/dist/cjs/verdocs-sign.cjs.entry.js +3 -2
- package/dist/cjs/{verdocs-pagination_4.cjs.entry.js → verdocs-status-indicator.cjs.entry.js} +0 -161
- package/dist/cjs/verdocs-template-attachments_2.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +5 -4
- package/dist/cjs/verdocs-template-name.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-reminders.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-star.cjs.entry.js +67 -0
- package/dist/cjs/verdocs-template-visibility.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-templates-list.cjs.entry.js +595 -111
- package/dist/cjs/verdocs-view.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +38 -43
- package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.css +31 -0
- package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +144 -0
- package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.stories.js +27 -0
- package/dist/collection/components/templates/verdocs-templates-list/verdocs-templates-list.css +98 -17
- package/dist/collection/components/templates/verdocs-templates-list/verdocs-templates-list.js +175 -221
- package/dist/collection/components/templates/verdocs-templates-list/verdocs-templates-list.stories.js +8 -6
- package/dist/components/Templates.js +15 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +1 -1
- package/dist/components/verdocs-envelopes-list.js +4 -7
- package/dist/components/verdocs-template-star.d.ts +11 -0
- package/dist/components/verdocs-template-star.js +6 -0
- package/dist/components/verdocs-template-star2.js +82 -0
- package/dist/components/verdocs-templates-list.js +634 -123
- package/dist/docs.json +223 -61
- package/dist/esm/{TemplateStore-c15956ae.js → TemplateStore-ad36abff.js} +1 -1
- package/dist/esm/{Templates-3760f311.js → Templates-1893bda7.js} +15 -1
- package/dist/esm/{index-914ed6f7.js → index-2685d184.js} +1 -566
- package/dist/esm/index-8dc8fdc4.js +568 -0
- package/dist/esm/ipc-test.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-a8284581.js → utils-ef800713.js} +2 -2
- package/dist/esm/verdocs-build.entry.js +2 -2
- package/dist/esm/verdocs-button-panel_3.entry.js +2 -2
- package/dist/esm/verdocs-envelope-document-page.entry.js +3 -2
- package/dist/esm/verdocs-envelope-sidebar.entry.js +2 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +5 -6
- package/dist/esm/verdocs-field-checkbox.entry.js +3 -2
- package/dist/esm/verdocs-field-date.entry.js +3 -2
- package/dist/esm/verdocs-field-dropdown.entry.js +3 -2
- package/dist/esm/verdocs-field-initial.entry.js +3 -2
- package/dist/esm/verdocs-field-payment.entry.js +3 -2
- package/dist/esm/verdocs-field-radio-button.entry.js +3 -2
- package/dist/esm/verdocs-field-signature.entry.js +3 -2
- package/dist/esm/verdocs-field-textarea.entry.js +3 -2
- package/dist/esm/verdocs-field-textbox.entry.js +3 -2
- package/dist/esm/verdocs-field-timestamp.entry.js +3 -2
- package/dist/esm/verdocs-organization-card.entry.js +2 -1
- package/dist/esm/verdocs-pagination_3.entry.js +163 -0
- package/dist/esm/verdocs-preview.entry.js +5 -4
- package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm/verdocs-send.entry.js +5 -4
- package/dist/esm/verdocs-sign.entry.js +3 -2
- package/dist/esm/{verdocs-pagination_4.entry.js → verdocs-status-indicator.entry.js} +2 -160
- package/dist/esm/verdocs-template-attachments_2.entry.js +2 -2
- package/dist/esm/verdocs-template-document-page_2.entry.js +3 -2
- package/dist/esm/verdocs-template-fields_4.entry.js +5 -4
- package/dist/esm/verdocs-template-name.entry.js +2 -2
- package/dist/esm/verdocs-template-reminders.entry.js +2 -2
- package/dist/esm/verdocs-template-star.entry.js +63 -0
- package/dist/esm/verdocs-template-visibility.entry.js +2 -2
- package/dist/esm/verdocs-templates-list.entry.js +592 -108
- package/dist/esm/verdocs-view.entry.js +3 -2
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/{TemplateStore-c15956ae.js → TemplateStore-ad36abff.js} +1 -1
- package/dist/esm-es5/{Templates-3760f311.js → Templates-1893bda7.js} +1 -1
- package/dist/esm-es5/index-2685d184.js +1 -0
- package/dist/esm-es5/index-8dc8fdc4.js +1 -0
- package/dist/esm-es5/ipc-test.entry.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{utils-a8284581.js → utils-ef800713.js} +2 -2
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-button-panel_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm-es5/verdocs-organization-card.entry.js +1 -1
- package/dist/esm-es5/verdocs-pagination_3.entry.js +1 -0
- package/dist/esm-es5/verdocs-preview.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-send.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -0
- package/dist/esm-es5/verdocs-template-attachments_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-name.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-reminders.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js +1 -0
- package/dist/esm-es5/verdocs-template-visibility.entry.js +1 -1
- package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.d.ts +8 -16
- package/dist/types/components/templates/verdocs-template-star/verdocs-template-star.d.ts +35 -0
- package/dist/types/components/templates/verdocs-template-star/verdocs-template-star.stories.d.ts +6 -0
- package/dist/types/components/templates/verdocs-templates-list/verdocs-templates-list.d.ts +24 -29
- package/dist/types/components.d.ts +89 -27
- package/dist/verdocs-web-sdk/p-067b43ba.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-09ee5e46.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-0ae14e45.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-831e2651.system.entry.js → p-0b369a3e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b2a0cef4.entry.js → p-0e1c0da5.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-11942b39.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-11de0d75.system.js +1 -0
- package/dist/verdocs-web-sdk/p-1cf38cea.system.js +1 -1
- package/dist/verdocs-web-sdk/p-1d010a79.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-46013b8a.entry.js → p-20fcfef9.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-2118b452.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-21629ed8.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-253b6f06.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-2961d1a8.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-2a4566ab.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-35841b7c.js +1 -0
- package/dist/verdocs-web-sdk/p-38d7c3f2.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-3ed5dc5c.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-3fe6dc00.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-42f1012f.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-45b1c6cd.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-e34783b1.entry.js → p-4615a245.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-4a7dcb1b.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-3399a2a2.system.entry.js → p-4eb69794.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-4fe4e161.js +1 -0
- package/dist/verdocs-web-sdk/{p-dee333ac.system.entry.js → p-52f9cfba.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-5612d642.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-56943696.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-5abf9fab.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-5c5a5baf.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-3cac4136.system.js → p-5ef54155.system.js} +2 -2
- package/dist/verdocs-web-sdk/p-62f70c53.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-63f9586c.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6570268f.js +1 -0
- package/dist/verdocs-web-sdk/p-67df4e57.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-68dc38f8.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6cc3de8d.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-c02c16e1.js → p-6f4149c4.js} +1 -1
- package/dist/verdocs-web-sdk/{p-90f5c0fa.system.entry.js → p-7028e5fd.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-eac4674e.system.entry.js → p-715c5b9d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-73371d7a.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-fb3d4091.system.js → p-75455b2d.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4cdc37f8.entry.js → p-78c38cec.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-63abfff5.system.entry.js → p-79cf7768.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-7bc3f0ae.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-7d992b01.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-823225c2.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-82f6faac.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-8603a0d0.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-8c4abfcc.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-90371251.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-951d9c70.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-9dde58a8.system.js +1 -0
- package/dist/verdocs-web-sdk/p-a3ac0082.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-cb17023f.entry.js → p-a3b3cdf5.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-3a10e87d.entry.js → p-a6a8d20f.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-ac18bc08.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-b2c5baae.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-b3401d8e.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-b6dba09e.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-b995ebab.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-bd077b3e.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-aefbafc3.system.entry.js → p-bf8cf9ff.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-c6c2b890.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-a6ecbbd5.js → p-c8b879d1.js} +2 -2
- package/dist/verdocs-web-sdk/p-cb283760.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-ce097fdf.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-783d4ad4.system.entry.js → p-ce626e5b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-d2d18696.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-d4765b46.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-db67fbd1.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-efcde7ca.entry.js → p-dda7674c.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-e32ec792.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-4e02f533.entry.js → p-f88d1bb0.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-fc8bba36.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/esm-es5/index-914ed6f7.js +0 -1
- package/dist/esm-es5/verdocs-pagination_4.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-01de4163.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-134aad4b.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-14638f0c.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-1a0cccea.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-23686c43.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-2730089c.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-2dbe3de7.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-2e164979.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-2ff7c8c3.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-38434761.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-3eccbc81.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-3fadef3d.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-40f3a175.js +0 -1
- package/dist/verdocs-web-sdk/p-42acf76c.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-4bbc74d9.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-5ba13ab8.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-5c2d7886.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-634a5760.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6c267fdd.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-871f33f9.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-8d32aca4.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-90f5a645.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-92917e74.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-92b2d9e4.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-92ca2aef.system.js +0 -1
- package/dist/verdocs-web-sdk/p-9416d327.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-95332ec8.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-9f76bbe1.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a4391c14.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a7eef6e9.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a824c9a6.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-c0d8f0db.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-c220af42.js +0 -1
- package/dist/verdocs-web-sdk/p-c53aefe5.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-cd0eb575.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-d497b3c1.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-dc9c4361.system.js +0 -1
- package/dist/verdocs-web-sdk/p-e2e972fc.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e646e8ef.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e6512cc3.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e72c075e.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e971511e.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e989b3ce.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f623b887.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f6594380.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f7ea7b36.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-fbd3e8df.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-ff3e5717.entry.js +0 -1
@@ -1,9 +1,10 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-b18c0348.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
3
|
import { P as Permissions, V as VerdocsEndpoint, c as canPerformTemplateAction } from './VerdocsEndpoint-45286fc7.js';
|
4
|
-
import { a as getSummary } from './Templates-
|
4
|
+
import { a as getSummary, d as deleteTemplate } from './Templates-1893bda7.js';
|
5
5
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
6
6
|
import { S as SDKError } from './errors-9b5498c8.js';
|
7
|
+
import { r as requiredArgs, t as toDate, a as getTimezoneOffsetInMilliseconds, l as locale, g as getDefaultOptions } from './index-8dc8fdc4.js';
|
7
8
|
|
8
9
|
/**
|
9
10
|
* Confirm whether the user has all of the specified permissions.
|
@@ -12,6 +13,491 @@ var userHasPermissions = function (session, permissions) {
|
|
12
13
|
return permissions.every(function (perm) { return ((session === null || session === void 0 ? void 0 : session.permissions) || []).includes(perm); });
|
13
14
|
};
|
14
15
|
|
16
|
+
/**
|
17
|
+
* @name compareAsc
|
18
|
+
* @category Common Helpers
|
19
|
+
* @summary Compare the two dates and return -1, 0 or 1.
|
20
|
+
*
|
21
|
+
* @description
|
22
|
+
* Compare the two dates and return 1 if the first date is after the second,
|
23
|
+
* -1 if the first date is before the second or 0 if dates are equal.
|
24
|
+
*
|
25
|
+
* @param {Date|Number} dateLeft - the first date to compare
|
26
|
+
* @param {Date|Number} dateRight - the second date to compare
|
27
|
+
* @returns {Number} the result of the comparison
|
28
|
+
* @throws {TypeError} 2 arguments required
|
29
|
+
*
|
30
|
+
* @example
|
31
|
+
* // Compare 11 February 1987 and 10 July 1989:
|
32
|
+
* const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))
|
33
|
+
* //=> -1
|
34
|
+
*
|
35
|
+
* @example
|
36
|
+
* // Sort the array of dates:
|
37
|
+
* const result = [
|
38
|
+
* new Date(1995, 6, 2),
|
39
|
+
* new Date(1987, 1, 11),
|
40
|
+
* new Date(1989, 6, 10)
|
41
|
+
* ].sort(compareAsc)
|
42
|
+
* //=> [
|
43
|
+
* // Wed Feb 11 1987 00:00:00,
|
44
|
+
* // Mon Jul 10 1989 00:00:00,
|
45
|
+
* // Sun Jul 02 1995 00:00:00
|
46
|
+
* // ]
|
47
|
+
*/
|
48
|
+
function compareAsc(dirtyDateLeft, dirtyDateRight) {
|
49
|
+
requiredArgs(2, arguments);
|
50
|
+
var dateLeft = toDate(dirtyDateLeft);
|
51
|
+
var dateRight = toDate(dirtyDateRight);
|
52
|
+
var diff = dateLeft.getTime() - dateRight.getTime();
|
53
|
+
if (diff < 0) {
|
54
|
+
return -1;
|
55
|
+
} else if (diff > 0) {
|
56
|
+
return 1;
|
57
|
+
// Return 0 if diff is 0; return NaN if diff is NaN
|
58
|
+
} else {
|
59
|
+
return diff;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
/**
|
64
|
+
* @name differenceInCalendarMonths
|
65
|
+
* @category Month Helpers
|
66
|
+
* @summary Get the number of calendar months between the given dates.
|
67
|
+
*
|
68
|
+
* @description
|
69
|
+
* Get the number of calendar months between the given dates.
|
70
|
+
*
|
71
|
+
* @param {Date|Number} dateLeft - the later date
|
72
|
+
* @param {Date|Number} dateRight - the earlier date
|
73
|
+
* @returns {Number} the number of calendar months
|
74
|
+
* @throws {TypeError} 2 arguments required
|
75
|
+
*
|
76
|
+
* @example
|
77
|
+
* // How many calendar months are between 31 January 2014 and 1 September 2014?
|
78
|
+
* const result = differenceInCalendarMonths(
|
79
|
+
* new Date(2014, 8, 1),
|
80
|
+
* new Date(2014, 0, 31)
|
81
|
+
* )
|
82
|
+
* //=> 8
|
83
|
+
*/
|
84
|
+
function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {
|
85
|
+
requiredArgs(2, arguments);
|
86
|
+
var dateLeft = toDate(dirtyDateLeft);
|
87
|
+
var dateRight = toDate(dirtyDateRight);
|
88
|
+
var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();
|
89
|
+
var monthDiff = dateLeft.getMonth() - dateRight.getMonth();
|
90
|
+
return yearDiff * 12 + monthDiff;
|
91
|
+
}
|
92
|
+
|
93
|
+
/**
|
94
|
+
* @name differenceInMilliseconds
|
95
|
+
* @category Millisecond Helpers
|
96
|
+
* @summary Get the number of milliseconds between the given dates.
|
97
|
+
*
|
98
|
+
* @description
|
99
|
+
* Get the number of milliseconds between the given dates.
|
100
|
+
*
|
101
|
+
* @param {Date|Number} dateLeft - the later date
|
102
|
+
* @param {Date|Number} dateRight - the earlier date
|
103
|
+
* @returns {Number} the number of milliseconds
|
104
|
+
* @throws {TypeError} 2 arguments required
|
105
|
+
*
|
106
|
+
* @example
|
107
|
+
* // How many milliseconds are between
|
108
|
+
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
109
|
+
* const result = differenceInMilliseconds(
|
110
|
+
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
111
|
+
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
112
|
+
* )
|
113
|
+
* //=> 1100
|
114
|
+
*/
|
115
|
+
function differenceInMilliseconds(dateLeft, dateRight) {
|
116
|
+
requiredArgs(2, arguments);
|
117
|
+
return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
|
118
|
+
}
|
119
|
+
|
120
|
+
var roundingMap = {
|
121
|
+
ceil: Math.ceil,
|
122
|
+
round: Math.round,
|
123
|
+
floor: Math.floor,
|
124
|
+
trunc: function trunc(value) {
|
125
|
+
return value < 0 ? Math.ceil(value) : Math.floor(value);
|
126
|
+
} // Math.trunc is not supported by IE
|
127
|
+
};
|
128
|
+
|
129
|
+
var defaultRoundingMethod = 'trunc';
|
130
|
+
function getRoundingMethod(method) {
|
131
|
+
return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
|
132
|
+
}
|
133
|
+
|
134
|
+
/**
|
135
|
+
* @name endOfDay
|
136
|
+
* @category Day Helpers
|
137
|
+
* @summary Return the end of a day for the given date.
|
138
|
+
*
|
139
|
+
* @description
|
140
|
+
* Return the end of a day for the given date.
|
141
|
+
* The result will be in the local timezone.
|
142
|
+
*
|
143
|
+
* @param {Date|Number} date - the original date
|
144
|
+
* @returns {Date} the end of a day
|
145
|
+
* @throws {TypeError} 1 argument required
|
146
|
+
*
|
147
|
+
* @example
|
148
|
+
* // The end of a day for 2 September 2014 11:55:00:
|
149
|
+
* const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))
|
150
|
+
* //=> Tue Sep 02 2014 23:59:59.999
|
151
|
+
*/
|
152
|
+
function endOfDay(dirtyDate) {
|
153
|
+
requiredArgs(1, arguments);
|
154
|
+
var date = toDate(dirtyDate);
|
155
|
+
date.setHours(23, 59, 59, 999);
|
156
|
+
return date;
|
157
|
+
}
|
158
|
+
|
159
|
+
/**
|
160
|
+
* @name endOfMonth
|
161
|
+
* @category Month Helpers
|
162
|
+
* @summary Return the end of a month for the given date.
|
163
|
+
*
|
164
|
+
* @description
|
165
|
+
* Return the end of a month for the given date.
|
166
|
+
* The result will be in the local timezone.
|
167
|
+
*
|
168
|
+
* @param {Date|Number} date - the original date
|
169
|
+
* @returns {Date} the end of a month
|
170
|
+
* @throws {TypeError} 1 argument required
|
171
|
+
*
|
172
|
+
* @example
|
173
|
+
* // The end of a month for 2 September 2014 11:55:00:
|
174
|
+
* const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
|
175
|
+
* //=> Tue Sep 30 2014 23:59:59.999
|
176
|
+
*/
|
177
|
+
function endOfMonth(dirtyDate) {
|
178
|
+
requiredArgs(1, arguments);
|
179
|
+
var date = toDate(dirtyDate);
|
180
|
+
var month = date.getMonth();
|
181
|
+
date.setFullYear(date.getFullYear(), month + 1, 0);
|
182
|
+
date.setHours(23, 59, 59, 999);
|
183
|
+
return date;
|
184
|
+
}
|
185
|
+
|
186
|
+
/**
|
187
|
+
* @name isLastDayOfMonth
|
188
|
+
* @category Month Helpers
|
189
|
+
* @summary Is the given date the last day of a month?
|
190
|
+
*
|
191
|
+
* @description
|
192
|
+
* Is the given date the last day of a month?
|
193
|
+
*
|
194
|
+
* @param {Date|Number} date - the date to check
|
195
|
+
* @returns {Boolean} the date is the last day of a month
|
196
|
+
* @throws {TypeError} 1 argument required
|
197
|
+
*
|
198
|
+
* @example
|
199
|
+
* // Is 28 February 2014 the last day of a month?
|
200
|
+
* const result = isLastDayOfMonth(new Date(2014, 1, 28))
|
201
|
+
* //=> true
|
202
|
+
*/
|
203
|
+
function isLastDayOfMonth(dirtyDate) {
|
204
|
+
requiredArgs(1, arguments);
|
205
|
+
var date = toDate(dirtyDate);
|
206
|
+
return endOfDay(date).getTime() === endOfMonth(date).getTime();
|
207
|
+
}
|
208
|
+
|
209
|
+
/**
|
210
|
+
* @name differenceInMonths
|
211
|
+
* @category Month Helpers
|
212
|
+
* @summary Get the number of full months between the given dates.
|
213
|
+
*
|
214
|
+
* @description
|
215
|
+
* Get the number of full months between the given dates using trunc as a default rounding method.
|
216
|
+
*
|
217
|
+
* @param {Date|Number} dateLeft - the later date
|
218
|
+
* @param {Date|Number} dateRight - the earlier date
|
219
|
+
* @returns {Number} the number of full months
|
220
|
+
* @throws {TypeError} 2 arguments required
|
221
|
+
*
|
222
|
+
* @example
|
223
|
+
* // How many full months are between 31 January 2014 and 1 September 2014?
|
224
|
+
* const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))
|
225
|
+
* //=> 7
|
226
|
+
*/
|
227
|
+
function differenceInMonths(dirtyDateLeft, dirtyDateRight) {
|
228
|
+
requiredArgs(2, arguments);
|
229
|
+
var dateLeft = toDate(dirtyDateLeft);
|
230
|
+
var dateRight = toDate(dirtyDateRight);
|
231
|
+
var sign = compareAsc(dateLeft, dateRight);
|
232
|
+
var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));
|
233
|
+
var result;
|
234
|
+
|
235
|
+
// Check for the difference of less than month
|
236
|
+
if (difference < 1) {
|
237
|
+
result = 0;
|
238
|
+
} else {
|
239
|
+
if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {
|
240
|
+
// This will check if the date is end of Feb and assign a higher end of month date
|
241
|
+
// to compare it with Jan
|
242
|
+
dateLeft.setDate(30);
|
243
|
+
}
|
244
|
+
dateLeft.setMonth(dateLeft.getMonth() - sign * difference);
|
245
|
+
|
246
|
+
// Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full
|
247
|
+
// If so, result must be decreased by 1 in absolute value
|
248
|
+
var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign;
|
249
|
+
|
250
|
+
// Check for cases of one full calendar month
|
251
|
+
if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) {
|
252
|
+
isLastMonthNotFull = false;
|
253
|
+
}
|
254
|
+
result = sign * (difference - Number(isLastMonthNotFull));
|
255
|
+
}
|
256
|
+
|
257
|
+
// Prevent negative zero
|
258
|
+
return result === 0 ? 0 : result;
|
259
|
+
}
|
260
|
+
|
261
|
+
/**
|
262
|
+
* @name differenceInSeconds
|
263
|
+
* @category Second Helpers
|
264
|
+
* @summary Get the number of seconds between the given dates.
|
265
|
+
*
|
266
|
+
* @description
|
267
|
+
* Get the number of seconds between the given dates.
|
268
|
+
*
|
269
|
+
* @param {Date|Number} dateLeft - the later date
|
270
|
+
* @param {Date|Number} dateRight - the earlier date
|
271
|
+
* @param {Object} [options] - an object with options.
|
272
|
+
* @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)
|
273
|
+
* @returns {Number} the number of seconds
|
274
|
+
* @throws {TypeError} 2 arguments required
|
275
|
+
*
|
276
|
+
* @example
|
277
|
+
* // How many seconds are between
|
278
|
+
* // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?
|
279
|
+
* const result = differenceInSeconds(
|
280
|
+
* new Date(2014, 6, 2, 12, 30, 20, 0),
|
281
|
+
* new Date(2014, 6, 2, 12, 30, 7, 999)
|
282
|
+
* )
|
283
|
+
* //=> 12
|
284
|
+
*/
|
285
|
+
function differenceInSeconds(dateLeft, dateRight, options) {
|
286
|
+
requiredArgs(2, arguments);
|
287
|
+
var diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;
|
288
|
+
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
|
289
|
+
}
|
290
|
+
|
291
|
+
function assign(target, object) {
|
292
|
+
if (target == null) {
|
293
|
+
throw new TypeError('assign requires that input parameter not be null or undefined');
|
294
|
+
}
|
295
|
+
for (var property in object) {
|
296
|
+
if (Object.prototype.hasOwnProperty.call(object, property)) {
|
297
|
+
target[property] = object[property];
|
298
|
+
}
|
299
|
+
}
|
300
|
+
return target;
|
301
|
+
}
|
302
|
+
|
303
|
+
function cloneObject(object) {
|
304
|
+
return assign({}, object);
|
305
|
+
}
|
306
|
+
|
307
|
+
var MINUTES_IN_DAY = 1440;
|
308
|
+
var MINUTES_IN_ALMOST_TWO_DAYS = 2520;
|
309
|
+
var MINUTES_IN_MONTH = 43200;
|
310
|
+
var MINUTES_IN_TWO_MONTHS = 86400;
|
311
|
+
|
312
|
+
/**
|
313
|
+
* @name formatDistance
|
314
|
+
* @category Common Helpers
|
315
|
+
* @summary Return the distance between the given dates in words.
|
316
|
+
*
|
317
|
+
* @description
|
318
|
+
* Return the distance between the given dates in words.
|
319
|
+
*
|
320
|
+
* | Distance between dates | Result |
|
321
|
+
* |-------------------------------------------------------------------|---------------------|
|
322
|
+
* | 0 ... 30 secs | less than a minute |
|
323
|
+
* | 30 secs ... 1 min 30 secs | 1 minute |
|
324
|
+
* | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |
|
325
|
+
* | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |
|
326
|
+
* | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |
|
327
|
+
* | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |
|
328
|
+
* | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |
|
329
|
+
* | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |
|
330
|
+
* | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |
|
331
|
+
* | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |
|
332
|
+
* | 1 yr ... 1 yr 3 months | about 1 year |
|
333
|
+
* | 1 yr 3 months ... 1 yr 9 month s | over 1 year |
|
334
|
+
* | 1 yr 9 months ... 2 yrs | almost 2 years |
|
335
|
+
* | N yrs ... N yrs 3 months | about N years |
|
336
|
+
* | N yrs 3 months ... N yrs 9 months | over N years |
|
337
|
+
* | N yrs 9 months ... N+1 yrs | almost N+1 years |
|
338
|
+
*
|
339
|
+
* With `options.includeSeconds == true`:
|
340
|
+
* | Distance between dates | Result |
|
341
|
+
* |------------------------|----------------------|
|
342
|
+
* | 0 secs ... 5 secs | less than 5 seconds |
|
343
|
+
* | 5 secs ... 10 secs | less than 10 seconds |
|
344
|
+
* | 10 secs ... 20 secs | less than 20 seconds |
|
345
|
+
* | 20 secs ... 40 secs | half a minute |
|
346
|
+
* | 40 secs ... 60 secs | less than a minute |
|
347
|
+
* | 60 secs ... 90 secs | 1 minute |
|
348
|
+
*
|
349
|
+
* @param {Date|Number} date - the date
|
350
|
+
* @param {Date|Number} baseDate - the date to compare with
|
351
|
+
* @param {Object} [options] - an object with options.
|
352
|
+
* @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed
|
353
|
+
* @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first
|
354
|
+
* @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
|
355
|
+
* @returns {String} the distance in words
|
356
|
+
* @throws {TypeError} 2 arguments required
|
357
|
+
* @throws {RangeError} `date` must not be Invalid Date
|
358
|
+
* @throws {RangeError} `baseDate` must not be Invalid Date
|
359
|
+
* @throws {RangeError} `options.locale` must contain `formatDistance` property
|
360
|
+
*
|
361
|
+
* @example
|
362
|
+
* // What is the distance between 2 July 2014 and 1 January 2015?
|
363
|
+
* const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))
|
364
|
+
* //=> '6 months'
|
365
|
+
*
|
366
|
+
* @example
|
367
|
+
* // What is the distance between 1 January 2015 00:00:15
|
368
|
+
* // and 1 January 2015 00:00:00, including seconds?
|
369
|
+
* const result = formatDistance(
|
370
|
+
* new Date(2015, 0, 1, 0, 0, 15),
|
371
|
+
* new Date(2015, 0, 1, 0, 0, 0),
|
372
|
+
* { includeSeconds: true }
|
373
|
+
* )
|
374
|
+
* //=> 'less than 20 seconds'
|
375
|
+
*
|
376
|
+
* @example
|
377
|
+
* // What is the distance from 1 January 2016
|
378
|
+
* // to 1 January 2015, with a suffix?
|
379
|
+
* const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {
|
380
|
+
* addSuffix: true
|
381
|
+
* })
|
382
|
+
* //=> 'about 1 year ago'
|
383
|
+
*
|
384
|
+
* @example
|
385
|
+
* // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?
|
386
|
+
* import { eoLocale } from 'date-fns/locale/eo'
|
387
|
+
* const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {
|
388
|
+
* locale: eoLocale
|
389
|
+
* })
|
390
|
+
* //=> 'pli ol 1 jaro'
|
391
|
+
*/
|
392
|
+
|
393
|
+
function formatDistance(dirtyDate, dirtyBaseDate, options) {
|
394
|
+
var _ref, _options$locale;
|
395
|
+
requiredArgs(2, arguments);
|
396
|
+
var defaultOptions = getDefaultOptions();
|
397
|
+
var locale$1 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : locale;
|
398
|
+
if (!locale$1.formatDistance) {
|
399
|
+
throw new RangeError('locale must contain formatDistance property');
|
400
|
+
}
|
401
|
+
var comparison = compareAsc(dirtyDate, dirtyBaseDate);
|
402
|
+
if (isNaN(comparison)) {
|
403
|
+
throw new RangeError('Invalid time value');
|
404
|
+
}
|
405
|
+
var localizeOptions = assign(cloneObject(options), {
|
406
|
+
addSuffix: Boolean(options === null || options === void 0 ? void 0 : options.addSuffix),
|
407
|
+
comparison: comparison
|
408
|
+
});
|
409
|
+
var dateLeft;
|
410
|
+
var dateRight;
|
411
|
+
if (comparison > 0) {
|
412
|
+
dateLeft = toDate(dirtyBaseDate);
|
413
|
+
dateRight = toDate(dirtyDate);
|
414
|
+
} else {
|
415
|
+
dateLeft = toDate(dirtyDate);
|
416
|
+
dateRight = toDate(dirtyBaseDate);
|
417
|
+
}
|
418
|
+
var seconds = differenceInSeconds(dateRight, dateLeft);
|
419
|
+
var offsetInSeconds = (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1000;
|
420
|
+
var minutes = Math.round((seconds - offsetInSeconds) / 60);
|
421
|
+
var months;
|
422
|
+
|
423
|
+
// 0 up to 2 mins
|
424
|
+
if (minutes < 2) {
|
425
|
+
if (options !== null && options !== void 0 && options.includeSeconds) {
|
426
|
+
if (seconds < 5) {
|
427
|
+
return locale$1.formatDistance('lessThanXSeconds', 5, localizeOptions);
|
428
|
+
} else if (seconds < 10) {
|
429
|
+
return locale$1.formatDistance('lessThanXSeconds', 10, localizeOptions);
|
430
|
+
} else if (seconds < 20) {
|
431
|
+
return locale$1.formatDistance('lessThanXSeconds', 20, localizeOptions);
|
432
|
+
} else if (seconds < 40) {
|
433
|
+
return locale$1.formatDistance('halfAMinute', 0, localizeOptions);
|
434
|
+
} else if (seconds < 60) {
|
435
|
+
return locale$1.formatDistance('lessThanXMinutes', 1, localizeOptions);
|
436
|
+
} else {
|
437
|
+
return locale$1.formatDistance('xMinutes', 1, localizeOptions);
|
438
|
+
}
|
439
|
+
} else {
|
440
|
+
if (minutes === 0) {
|
441
|
+
return locale$1.formatDistance('lessThanXMinutes', 1, localizeOptions);
|
442
|
+
} else {
|
443
|
+
return locale$1.formatDistance('xMinutes', minutes, localizeOptions);
|
444
|
+
}
|
445
|
+
}
|
446
|
+
|
447
|
+
// 2 mins up to 0.75 hrs
|
448
|
+
} else if (minutes < 45) {
|
449
|
+
return locale$1.formatDistance('xMinutes', minutes, localizeOptions);
|
450
|
+
|
451
|
+
// 0.75 hrs up to 1.5 hrs
|
452
|
+
} else if (minutes < 90) {
|
453
|
+
return locale$1.formatDistance('aboutXHours', 1, localizeOptions);
|
454
|
+
|
455
|
+
// 1.5 hrs up to 24 hrs
|
456
|
+
} else if (minutes < MINUTES_IN_DAY) {
|
457
|
+
var hours = Math.round(minutes / 60);
|
458
|
+
return locale$1.formatDistance('aboutXHours', hours, localizeOptions);
|
459
|
+
|
460
|
+
// 1 day up to 1.75 days
|
461
|
+
} else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) {
|
462
|
+
return locale$1.formatDistance('xDays', 1, localizeOptions);
|
463
|
+
|
464
|
+
// 1.75 days up to 30 days
|
465
|
+
} else if (minutes < MINUTES_IN_MONTH) {
|
466
|
+
var days = Math.round(minutes / MINUTES_IN_DAY);
|
467
|
+
return locale$1.formatDistance('xDays', days, localizeOptions);
|
468
|
+
|
469
|
+
// 1 month up to 2 months
|
470
|
+
} else if (minutes < MINUTES_IN_TWO_MONTHS) {
|
471
|
+
months = Math.round(minutes / MINUTES_IN_MONTH);
|
472
|
+
return locale$1.formatDistance('aboutXMonths', months, localizeOptions);
|
473
|
+
}
|
474
|
+
months = differenceInMonths(dateRight, dateLeft);
|
475
|
+
|
476
|
+
// 2 months up to 12 months
|
477
|
+
if (months < 12) {
|
478
|
+
var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH);
|
479
|
+
return locale$1.formatDistance('xMonths', nearestMonth, localizeOptions);
|
480
|
+
|
481
|
+
// 1 year up to max Date
|
482
|
+
} else {
|
483
|
+
var monthsSinceStartOfYear = months % 12;
|
484
|
+
var years = Math.floor(months / 12);
|
485
|
+
|
486
|
+
// N years up to 1 years 3 months
|
487
|
+
if (monthsSinceStartOfYear < 3) {
|
488
|
+
return locale$1.formatDistance('aboutXYears', years, localizeOptions);
|
489
|
+
|
490
|
+
// N years 3 months up to N years 9 months
|
491
|
+
} else if (monthsSinceStartOfYear < 9) {
|
492
|
+
return locale$1.formatDistance('overXYears', years, localizeOptions);
|
493
|
+
|
494
|
+
// N years 9 months up to N year 12 months
|
495
|
+
} else {
|
496
|
+
return locale$1.formatDistance('almostXYears', years + 1, localizeOptions);
|
497
|
+
}
|
498
|
+
}
|
499
|
+
}
|
500
|
+
|
15
501
|
/**
|
16
502
|
* Various helpers to identify available operations for a template by a user.
|
17
503
|
*
|
@@ -38,49 +524,93 @@ var userCanCreateTemplate = function (session) {
|
|
38
524
|
return userCanCreatePersonalTemplate(session) || userCanCreateOrgTemplate(session) || userCanCreatePublicTemplate(session);
|
39
525
|
};
|
40
526
|
|
41
|
-
const verdocsTemplatesListCss = "verdocs-templates-list{font-family:\"Inter\",
|
527
|
+
const verdocsTemplatesListCss = "verdocs-templates-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-templates-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-templates-list .header .filter{width:150px}verdocs-templates-list .header verdocs-text-input{margin:0}verdocs-templates-list .header verdocs-text-input input{height:32px}verdocs-templates-list .filter{-ms-flex-align:center;align-items:center}verdocs-templates-list .template{width:100%;margin:3px 0;background:#ffffff}verdocs-templates-list .template:hover{cursor:pointer;background:#f5f5fa}verdocs-templates-list .template .inner{gap:10px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-templates-list .template .inner svg{width:24px;height:24px}verdocs-templates-list .name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:black;font-size:18px;margin-left:10px}@media screen and (max-width: 1300px){verdocs-templates-list .name{font-size:16px}}verdocs-templates-list .spacer{margin:0;height:30px;-ms-flex:0 0 1px;flex:0 0 1px;display:-ms-flexbox;display:flex;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-templates-list .spacer{margin:12px 0;border-top:1px solid #dad8dd;border-right:none}}verdocs-templates-list .empty-text{font-size:20px;text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-templates-list .ownership{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 100px;flex:0 0 100px;font-size:16px;margin:0 0 0 10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-templates-list .ownership svg{width:24px;height:24px;margin-right:8px}verdocs-templates-list .last-used{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 280px;flex:0 0 280px;font-size:16px;margin:0 0 0 10px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-templates-list .last-used svg{width:24px;height:24px;margin-right:8px}verdocs-templates-list .usage{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;font-size:16px;margin:0 0 0 10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-templates-list .usage svg{width:24px;height:24px;margin-right:8px}";
|
42
528
|
|
43
|
-
const TemplateIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
|
529
|
+
const TemplateIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" /></svg>`;
|
530
|
+
const GlobeAltIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" /></svg>`;
|
531
|
+
const LockClosedIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z" /></svg>`;
|
532
|
+
const BuildingOfficeIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 6.75h1.5m-1.5 3h1.5m-1.5 3h1.5m3-6H15m-1.5 3H15m-1.5 3H15M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21" /></svg>`;
|
533
|
+
const CalendarIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5" /></svg>`;
|
534
|
+
const EnvelopeIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75" /></svg>`;
|
535
|
+
const SharingFilters = [
|
536
|
+
{ value: 'all', label: 'All' },
|
537
|
+
{ value: 'personal', label: 'Personal' },
|
538
|
+
{ value: 'shared', label: 'Shared' },
|
539
|
+
{ value: 'public', label: 'Public' },
|
540
|
+
];
|
541
|
+
const StarredFilters = [
|
542
|
+
{ value: 'all', label: 'All' },
|
543
|
+
{ value: 'starred', label: 'Starred' },
|
544
|
+
{ value: 'unstarred', label: 'Not Starred' },
|
545
|
+
];
|
546
|
+
const SortOptions = [
|
547
|
+
{ value: 'name', label: 'Name' },
|
548
|
+
{ value: 'created_at', label: 'Created' },
|
549
|
+
{ value: 'updated_at', label: 'Last Updated' },
|
550
|
+
{ value: 'last_used_at', label: 'Last Used' },
|
551
|
+
{ value: 'counter', label: 'Most Used' },
|
552
|
+
{ value: 'star_counter', label: 'Most Starred' },
|
553
|
+
];
|
44
554
|
const VerdocsTemplatesList = class {
|
45
555
|
constructor(hostRef) {
|
46
556
|
registerInstance(this, hostRef);
|
47
557
|
this.sdkError = createEvent(this, "sdkError", 7);
|
48
|
-
this.
|
49
|
-
this.
|
50
|
-
this.
|
51
|
-
this.handleOptionSelected = (
|
52
|
-
|
53
|
-
if (
|
54
|
-
|
55
|
-
|
56
|
-
|
558
|
+
this.viewTemplate = createEvent(this, "viewTemplate", 7);
|
559
|
+
this.editTemplate = createEvent(this, "editTemplate", 7);
|
560
|
+
this.templateDeleted = createEvent(this, "templateDeleted", 7);
|
561
|
+
this.handleOptionSelected = (option, template) => {
|
562
|
+
var _a, _b;
|
563
|
+
if (option === 'createdoc') {
|
564
|
+
(_a = this.viewTemplate) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template: template });
|
565
|
+
}
|
566
|
+
else if (option === 'createlink') {
|
567
|
+
VerdocsToast('This feature is coming soon!');
|
568
|
+
}
|
569
|
+
else if (option === 'signnow') {
|
570
|
+
VerdocsToast('This feature is coming soon!');
|
571
|
+
}
|
572
|
+
else if (option === 'submitted') {
|
573
|
+
VerdocsToast('This feature is coming soon!');
|
574
|
+
}
|
575
|
+
else if (option === 'link') {
|
576
|
+
VerdocsToast('This feature is coming soon!');
|
577
|
+
}
|
578
|
+
else if (option === 'edit') {
|
579
|
+
(_b = this.editTemplate) === null || _b === void 0 ? void 0 : _b.emit({ endpoint: this.endpoint, template: template });
|
580
|
+
}
|
581
|
+
else if (option === 'delete') {
|
582
|
+
this.confirmDelete = template;
|
57
583
|
}
|
58
|
-
else ;
|
59
584
|
};
|
60
585
|
this.endpoint = VerdocsEndpoint.getDefault();
|
61
|
-
this.items = 5;
|
62
|
-
this.view = undefined;
|
63
|
-
this.page = 0;
|
64
|
-
this.count = 0;
|
65
|
-
this.loading = true;
|
66
|
-
this.name = '';
|
67
|
-
this.containing = '';
|
68
586
|
this.sharing = 'all';
|
69
587
|
this.starred = 'all';
|
70
588
|
this.sort = 'updated_at';
|
71
|
-
this.
|
589
|
+
this.name = '';
|
590
|
+
this.selectedPage = 0;
|
591
|
+
this.count = 0;
|
592
|
+
this.loading = true;
|
593
|
+
this.confirmDelete = null;
|
72
594
|
this.templates = [];
|
73
595
|
}
|
74
596
|
async componentWillLoad() {
|
597
|
+
this.endpoint.loadSession();
|
598
|
+
if (!this.endpoint.session) {
|
599
|
+
console.log('[TEMPLATES] Must be authenticated');
|
600
|
+
return;
|
601
|
+
}
|
602
|
+
return this.queryTemplates();
|
603
|
+
}
|
604
|
+
async queryTemplates() {
|
75
605
|
var _a, _b, _c;
|
76
606
|
try {
|
77
607
|
this.endpoint.loadSession();
|
78
608
|
if (!this.endpoint.session) {
|
79
|
-
console.log('[
|
609
|
+
console.log('[TEMPLATES] Must be authenticated');
|
80
610
|
return;
|
81
611
|
}
|
82
612
|
let queryParams = {
|
83
|
-
page: this.
|
613
|
+
page: this.selectedPage,
|
84
614
|
ascending: this.sort === 'name' || this.sort === 'star_counter',
|
85
615
|
sort_by: this.sort,
|
86
616
|
};
|
@@ -89,20 +619,20 @@ const VerdocsTemplatesList = class {
|
|
89
619
|
queryParams.is_public = this.sharing === 'public';
|
90
620
|
}
|
91
621
|
if (this.starred !== 'all') {
|
92
|
-
|
93
|
-
queryParams['is_starred'] = this.starred === 'starred';
|
622
|
+
queryParams.is_starred = this.starred === 'starred';
|
94
623
|
}
|
95
624
|
if (this.name.trim() !== '') {
|
96
625
|
queryParams.name = this.name.trim();
|
97
626
|
}
|
627
|
+
console.log('qp', queryParams, this.name);
|
98
628
|
const response = await getSummary(this.endpoint, queryParams);
|
99
|
-
console.log('[TEMPLATES] Got
|
629
|
+
console.log('[TEMPLATES] Got templates', response);
|
100
630
|
this.templates = response.result;
|
101
631
|
this.count = response.total;
|
102
632
|
this.loading = false;
|
103
633
|
}
|
104
634
|
catch (e) {
|
105
|
-
console.log('[
|
635
|
+
console.log('[TEMPLATES] Error with preview session', e);
|
106
636
|
(_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));
|
107
637
|
}
|
108
638
|
}
|
@@ -126,15 +656,35 @@ const VerdocsTemplatesList = class {
|
|
126
656
|
// return hasPermission && canPreview;
|
127
657
|
return hasPermission;
|
128
658
|
}
|
659
|
+
deleteTemplate(template) {
|
660
|
+
this.confirmDelete = null;
|
661
|
+
deleteTemplate(this.endpoint, template.id)
|
662
|
+
.then(() => {
|
663
|
+
var _a;
|
664
|
+
console.log('[TEMPLATES] Deleted template', template);
|
665
|
+
(_a = this.templateDeleted) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template: template });
|
666
|
+
return this.queryTemplates();
|
667
|
+
})
|
668
|
+
.catch(e => {
|
669
|
+
var _a, _b, _c;
|
670
|
+
console.log('[TEMPLATES] Error deleting template', template);
|
671
|
+
(_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));
|
672
|
+
});
|
673
|
+
}
|
129
674
|
render() {
|
130
|
-
|
131
|
-
return (h(Host, { style: { minHeight: '300px' } }, h("verdocs-loader", null)));
|
132
|
-
}
|
133
|
-
return (h(Host, null, h("div", { class: "header" }, h("div", { class: "filter" }, h("verdocs-text-input", { id: "verdocs-filter-name", value: this.name, autocomplete: "off", placeholder: "Filter by Name...", onInput: (e) => {
|
675
|
+
return (h(Host, null, h("div", { class: "header" }, h("div", { class: "filter" }, h("verdocs-text-input", { id: "verdocs-filter-name", value: this.name, autocomplete: "off", placeholder: "Filter by Name...", onFocusout: (e) => {
|
134
676
|
this.name = e.target.value;
|
135
|
-
|
136
|
-
|
137
|
-
|
677
|
+
return this.queryTemplates();
|
678
|
+
} })), h("verdocs-quick-filter", { label: "Sharing", value: this.sharing, options: SharingFilters, onOptionSelected: e => {
|
679
|
+
this.sharing = e.detail.value;
|
680
|
+
return this.queryTemplates();
|
681
|
+
} }), h("verdocs-quick-filter", { label: "Starred", value: this.starred, options: StarredFilters, onOptionSelected: e => {
|
682
|
+
this.starred = e.detail.value;
|
683
|
+
return this.queryTemplates();
|
684
|
+
} }), h("verdocs-quick-filter", { label: "Sort By", value: this.sort, options: SortOptions, onOptionSelected: e => {
|
685
|
+
this.sort = e.detail.value;
|
686
|
+
return this.queryTemplates();
|
687
|
+
} }), this.loading && h("verdocs-spinner", { mode: "dark", size: 24 }), h("div", { style: { display: 'flex', flex: '1' } })), this.templates.map(summary => {
|
138
688
|
const MENU_OPTIONS = [
|
139
689
|
// [disabled]="!canSendEnvelope"
|
140
690
|
{ label: 'Preview / Send', id: 'createdoc', disabled: !this.canPreview(summary) },
|
@@ -150,80 +700,14 @@ const VerdocsTemplatesList = class {
|
|
150
700
|
{ label: 'Edit', id: 'edit', disabled: !this.canEdit(summary) },
|
151
701
|
{ label: 'Delete', id: 'delete', disabled: !this.canDelete(summary) },
|
152
702
|
];
|
153
|
-
return (h("div", { class: "template", onClick: () => {
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
// if (e.target.checked) {
|
162
|
-
// this.selectedEnvelopes = [...this.selectedEnvelopes, envelope];
|
163
|
-
// } else {
|
164
|
-
// this.selectedEnvelopes = this.selectedEnvelopes.filter(e => e.id !== envelope.id);
|
165
|
-
// }
|
166
|
-
// }}
|
167
|
-
// />
|
168
|
-
//
|
169
|
-
// <div class="vert-spacer" />
|
170
|
-
//
|
171
|
-
// <span innerHTML={DocumentIcon} />
|
172
|
-
//
|
173
|
-
// <div class="envelope-name">
|
174
|
-
// {envelope.name}: <div class="envelope-recipients">{envelope.recipients.map(r => r.full_name).join(', ')}</div>
|
175
|
-
// </div>
|
176
|
-
//
|
177
|
-
// <div class="vert-spacer" />
|
178
|
-
//
|
179
|
-
// <verdocs-status-indicator envelope={envelope} style={{width: '125px'}} />
|
180
|
-
//
|
181
|
-
// <div class="vert-spacer" />
|
182
|
-
//
|
183
|
-
// <div class="last-modified">{new Date(envelope.updated_at).toLocaleString()}</div>
|
184
|
-
//
|
185
|
-
// <div class="vert-spacer" />
|
186
|
-
//
|
187
|
-
// <verdocs-dropdown
|
188
|
-
// options={[
|
189
|
-
// {label: 'View Envelope', id: 'view'},
|
190
|
-
// {label: 'Finish Envelope', id: 'finish', disabled: !userCanFinish},
|
191
|
-
// {label: 'Download', id: 'download'},
|
192
|
-
// {label: 'Cancel', id: 'cancel', disabled: !userCanCancel},
|
193
|
-
// ]}
|
194
|
-
// onOptionSelected={e => {
|
195
|
-
// switch (e.detail.id) {
|
196
|
-
// case 'view':
|
197
|
-
// this.viewEnvelope?.emit({endpoint: this.endpoint, envelope});
|
198
|
-
// break;
|
199
|
-
// case 'finish':
|
200
|
-
// this.finishLater?.emit({endpoint: this.endpoint, envelope});
|
201
|
-
// break;
|
202
|
-
// case 'download':
|
203
|
-
// this.downloadEnvelope(envelope);
|
204
|
-
// break;
|
205
|
-
// case 'cancel':
|
206
|
-
// if (window.confirm('Are you sure you want to cancel this envelope?')) {
|
207
|
-
// cancelEnvelope(this.endpoint, envelope.id)
|
208
|
-
// .then(r => {
|
209
|
-
// console.log('Cancel result', r);
|
210
|
-
// VerdocsToast('Envelope canceled');
|
211
|
-
// })
|
212
|
-
// .catch(e => {
|
213
|
-
// console.log('cxl error', e);
|
214
|
-
// VerdocsToast('Unable to cancel envelope: ' + e.messabge, {style: 'error'});
|
215
|
-
// });
|
216
|
-
// }
|
217
|
-
// break;
|
218
|
-
// }
|
219
|
-
// }}
|
220
|
-
// />
|
221
|
-
// </div>
|
222
|
-
// </div>
|
223
|
-
);
|
224
|
-
}), !this.templates.length ? (h("div", { class: "mt-4 border-2 px-20 py-20 text-center" }, "No matching templates found. Please adjust your filters and try again.")) : (h("div", null)
|
225
|
-
// <Pagination page={this.page} total={this.count} onSelectPage={setPage} />
|
226
|
-
)));
|
703
|
+
return (h("div", { class: "template", onClick: () => {
|
704
|
+
var _a;
|
705
|
+
(_a = this.viewTemplate) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template: summary });
|
706
|
+
} }, h("div", { class: "inner" }, h("verdocs-template-star", { template: summary, endpoint: this.endpoint }), h("div", { class: "spacer icon-spacer" }), h("span", { innerHTML: TemplateIcon }), h("div", { class: "name" }, summary.name), h("div", { class: "spacer usage-spacer" }), h("div", { class: "usage" }, h("span", { innerHTML: EnvelopeIcon }), summary.counter || '--'), h("div", { class: "spacer last-used-spacer" }), h("div", { class: "last-used" }, h("span", { innerHTML: CalendarIcon }), h("span", { style: { marginRight: '5px' } }, "Last Used:"), summary.last_used_at ? formatDistance(new Date(summary.last_used_at), new Date()) : 'Never'), h("div", { class: "spacer ownership-spacer" }), summary.is_public && (h("div", { class: "ownership" }, h("span", { innerHTML: GlobeAltIcon }), " Public")), !summary.is_public && !summary.is_personal && (h("div", { class: "ownership" }, h("span", { innerHTML: LockClosedIcon }), " Private")), !summary.is_public && summary.is_personal && (h("div", { class: "ownership" }, h("span", { innerHTML: BuildingOfficeIcon }), " Shared")), h("verdocs-dropdown", { options: MENU_OPTIONS, onOptionSelected: e => this.handleOptionSelected(e.detail.id, summary) }))));
|
707
|
+
}), !this.templates.length ? (h("div", { class: "empty-text" }, "No matching templates found. Please adjust your filters and try again.")) : (h("div", { style: { marginTop: '10px' } }, h("verdocs-pagination", { selectedPage: this.selectedPage, perPage: 10, itemCount: this.count, onSelectPage: e => {
|
708
|
+
this.selectedPage = e.detail.selectedPage;
|
709
|
+
return this.queryTemplates();
|
710
|
+
} }))), this.confirmDelete && (h("verdocs-ok-dialog", { heading: "Delete this Template?", message: "This operation cannot be undone.", onNext: () => this.deleteTemplate(this.confirmDelete), onExit: () => (this.confirmDelete = null), showCancel: true }))));
|
227
711
|
}
|
228
712
|
};
|
229
713
|
VerdocsTemplatesList.style = verdocsTemplatesListCss;
|