@leavittsoftware/web 5.6.0 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leavittsoftware/web",
3
- "version": "5.6.0",
3
+ "version": "5.7.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "files": [
@@ -40,5 +40,5 @@
40
40
  "url": "https://github.com/LeavittSoftware/titanium-elements/issues"
41
41
  },
42
42
  "homepage": "https://github.com/LeavittSoftware/titanium-elements/#readme",
43
- "gitHead": "2bf67dc1ccba81f1a64ad02e38a72fb2d21526a3"
43
+ "gitHead": "7088482c6b295ba1b6edb4ab2afc4260a3ed6b7f"
44
44
  }
@@ -0,0 +1,17 @@
1
+ import '@material/web/dialog/dialog';
2
+ import '@material/web/button/text-button';
3
+ import '@material/web/button/filled-tonal-button';
4
+ import { LitElement } from 'lit';
5
+ import { MdDialog } from '@material/web/dialog/dialog';
6
+ export default class TitaniumConfirmationDialog extends LitElement {
7
+ #private;
8
+ accessor text: string;
9
+ accessor headline: string;
10
+ accessor confirmActionText: string;
11
+ accessor cancelActionText: string;
12
+ protected accessor dialog: MdDialog;
13
+ open: (headline: string, text: string) => Promise<"cancel" | "confirmed">;
14
+ static styles: import("lit").CSSResult[];
15
+ render(): import("lit-html").TemplateResult<1>;
16
+ }
17
+ //# sourceMappingURL=confirmation-dialog.d.ts.map
@@ -0,0 +1,108 @@
1
+ import { __decorate } from "tslib";
2
+ import '@material/web/dialog/dialog';
3
+ import '@material/web/button/text-button';
4
+ import '@material/web/button/filled-tonal-button';
5
+ import { css, html, LitElement, nothing } from 'lit';
6
+ import { customElement, property, query } from 'lit/decorators.js';
7
+ import { p } from '../styles/p';
8
+ import { dialogZIndexHack } from '../hacks/dialog-zindex-hack';
9
+ import { dialogCloseNavigationHack, dialogOpenNavigationHack } from '../hacks/dialog-navigation-hack';
10
+ let TitaniumConfirmationDialog = class TitaniumConfirmationDialog extends LitElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.#confirmActionText_accessor_storage = 'Confirm';
14
+ this.#cancelActionText_accessor_storage = 'Cancel';
15
+ this.open = async (headline, text) => {
16
+ this.headline = headline;
17
+ this.text = text;
18
+ this.dialog.returnValue = '';
19
+ this.dialog.show();
20
+ return await new Promise((resolve) => {
21
+ this.#resolve = resolve;
22
+ });
23
+ };
24
+ }
25
+ #text_accessor_storage;
26
+ get text() { return this.#text_accessor_storage; }
27
+ set text(value) { this.#text_accessor_storage = value; }
28
+ #headline_accessor_storage;
29
+ get headline() { return this.#headline_accessor_storage; }
30
+ set headline(value) { this.#headline_accessor_storage = value; }
31
+ #confirmActionText_accessor_storage;
32
+ get confirmActionText() { return this.#confirmActionText_accessor_storage; }
33
+ set confirmActionText(value) { this.#confirmActionText_accessor_storage = value; }
34
+ #cancelActionText_accessor_storage;
35
+ get cancelActionText() { return this.#cancelActionText_accessor_storage; }
36
+ set cancelActionText(value) { this.#cancelActionText_accessor_storage = value; }
37
+ #dialog_accessor_storage;
38
+ get dialog() { return this.#dialog_accessor_storage; }
39
+ set dialog(value) { this.#dialog_accessor_storage = value; }
40
+ #resolve;
41
+ static { this.styles = [
42
+ p,
43
+ css `
44
+ main {
45
+ display: grid;
46
+ padding: 6px 24px 0 24px;
47
+ gap: 12px;
48
+ }
49
+
50
+ md-dialog {
51
+ max-width: 550px;
52
+ max-height: calc(100vh - 24px);
53
+ }
54
+
55
+ b,
56
+ strong {
57
+ font-weight: 500;
58
+ }
59
+ `,
60
+ ]; }
61
+ render() {
62
+ return html `
63
+ <md-dialog
64
+ @open=${(e) => {
65
+ dialogZIndexHack(e.target);
66
+ dialogOpenNavigationHack(e.target);
67
+ }}
68
+ @close=${(e) => {
69
+ dialogCloseNavigationHack(e.target);
70
+ if (e.target.returnValue === 'confirmed') {
71
+ return this.#resolve('confirmed');
72
+ }
73
+ return this.#resolve('cancel');
74
+ }}
75
+ >
76
+ <div slot="headline">${this.headline}</div>
77
+ <main part="content-container">
78
+ ${this.text ? html `<p>${this.text}</p>` : nothing}
79
+ <slot slot="content"></slot>
80
+ </main>
81
+ <div slot="actions">
82
+ <md-text-button @click=${() => this.dialog.close('cancel')}>${this.cancelActionText}</md-text-button>
83
+ <md-filled-tonal-button @click=${() => this.dialog.close('confirmed')}>${this.confirmActionText}</md-filled-tonal-button>
84
+ </div>
85
+ </md-dialog>
86
+ `;
87
+ }
88
+ };
89
+ __decorate([
90
+ property({ type: String })
91
+ ], TitaniumConfirmationDialog.prototype, "text", null);
92
+ __decorate([
93
+ property({ type: String })
94
+ ], TitaniumConfirmationDialog.prototype, "headline", null);
95
+ __decorate([
96
+ property({ type: String })
97
+ ], TitaniumConfirmationDialog.prototype, "confirmActionText", null);
98
+ __decorate([
99
+ property({ type: String })
100
+ ], TitaniumConfirmationDialog.prototype, "cancelActionText", null);
101
+ __decorate([
102
+ query('md-dialog')
103
+ ], TitaniumConfirmationDialog.prototype, "dialog", null);
104
+ TitaniumConfirmationDialog = __decorate([
105
+ customElement('titanium-confirmation-dialog')
106
+ ], TitaniumConfirmationDialog);
107
+ export default TitaniumConfirmationDialog;
108
+ //# sourceMappingURL=confirmation-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirmation-dialog.js","sourceRoot":"","sources":["confirmation-dialog.ts"],"names":[],"mappings":";AAAA,OAAO,6BAA6B,CAAC;AACrC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,0CAA0C,CAAC;AAElD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EA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