@design.estate/dees-catalog 1.0.191 → 1.0.193

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 (36) hide show
  1. package/dist_bundle/bundle.js +326 -229
  2. package/dist_bundle/bundle.js.map +4 -4
  3. package/dist_ts_web/00_commitinfo_data.js +1 -1
  4. package/dist_ts_web/elements/dees-button.demo.d.ts +1 -0
  5. package/dist_ts_web/elements/dees-button.demo.js +15 -0
  6. package/dist_ts_web/elements/dees-button.js +3 -12
  7. package/dist_ts_web/elements/dees-contextmenu.demo.js +1 -1
  8. package/dist_ts_web/elements/dees-contextmenu.js +2 -2
  9. package/dist_ts_web/elements/dees-mobilenavigation.d.ts +1 -1
  10. package/dist_ts_web/elements/dees-mobilenavigation.js +6 -5
  11. package/dist_ts_web/elements/dees-modal.d.ts +25 -0
  12. package/dist_ts_web/elements/dees-modal.demo.d.ts +1 -0
  13. package/dist_ts_web/elements/dees-modal.demo.js +37 -0
  14. package/dist_ts_web/elements/dees-modal.js +171 -0
  15. package/dist_ts_web/elements/dees-simple-appdash.d.ts +1 -1
  16. package/dist_ts_web/elements/dees-simple-appdash.js +3 -3
  17. package/dist_ts_web/elements/dees-simple-login.d.ts +1 -1
  18. package/dist_ts_web/elements/dees-simple-login.demo.js +2 -2
  19. package/dist_ts_web/elements/dees-simple-login.js +4 -4
  20. package/dist_ts_web/elements/index.d.ts +1 -0
  21. package/dist_ts_web/elements/index.js +2 -1
  22. package/dist_watch/bundle.js +746 -3184
  23. package/dist_watch/bundle.js.map +4 -4
  24. package/package.json +2 -2
  25. package/ts_web/00_commitinfo_data.ts +1 -1
  26. package/ts_web/elements/dees-button.demo.ts +15 -0
  27. package/ts_web/elements/dees-button.ts +2 -11
  28. package/ts_web/elements/dees-contextmenu.demo.ts +1 -1
  29. package/ts_web/elements/dees-contextmenu.ts +1 -1
  30. package/ts_web/elements/dees-mobilenavigation.ts +5 -4
  31. package/ts_web/elements/dees-modal.demo.ts +37 -0
  32. package/ts_web/elements/dees-modal.ts +186 -0
  33. package/ts_web/elements/dees-simple-appdash.ts +1 -1
  34. package/ts_web/elements/dees-simple-login.demo.ts +1 -1
  35. package/ts_web/elements/dees-simple-login.ts +2 -2
  36. package/ts_web/elements/index.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design.estate/dees-catalog",
3
- "version": "1.0.191",
3
+ "version": "1.0.193",
4
4
  "private": false,
5
5
  "description": "website for lossless.com",
6
6
  "main": "dist_ts_web/index.js",
@@ -24,7 +24,7 @@
24
24
  "@fortawesome/free-solid-svg-icons": "^6.4.2",
25
25
  "@push.rocks/smartpromise": "^4.0.3",
26
26
  "@push.rocks/smartstring": "^4.0.9",
27
- "@tsclass/tsclass": "^4.0.42",
27
+ "@tsclass/tsclass": "^4.0.43",
28
28
  "highlight.js": "11.8.0",
29
29
  "pdfjs-dist": "^3.10.111"
30
30
  },
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-catalog',
6
- version: '1.0.191',
6
+ version: '1.0.193',
7
7
  description: 'website for lossless.com'
8
8
  }
@@ -0,0 +1,15 @@
1
+ import { html } from '@design.estate/dees-element';
2
+
3
+ export const demoFunc = () => html`
4
+ <dees-button>This is a slotted Text</dees-button>
5
+ <p>
6
+ <dees-button text="Highlighted: This text shows" type="highlighted">Highlighted</dees-button>
7
+ </p>
8
+ <p><dees-button type="discreet">This is discreete button</dees-button></p>
9
+ <p><dees-button disabled>This is a disabled button</dees-button></p>
10
+ <p><dees-button type="big">This is a slotted Text</dees-button></p>
11
+ <p><dees-button status="normal">Normal Status</dees-button></p>
12
+ <p><dees-button disabled status="pending">Pending Status</dees-button></p>
13
+ <p><dees-button disabled status="success">Success Status</dees-button></p>
14
+ <p><dees-button disabled status="error">Error Status</dees-button></p>
15
+ `;
@@ -1,3 +1,4 @@
1
+ import { demoFunc } from './dees-button.demo.js';
1
2
  import {
2
3
  customElement,
3
4
  html,
@@ -20,17 +21,7 @@ declare global {
20
21
 
21
22
  @customElement('dees-button')
22
23
  export class DeesButton extends DeesElement {
23
- public static demo = () => html`
24
- <dees-button>This is a slotted Text</dees-button>
25
- <p><dees-button text="Highlighted: This text shows" type="highlighted">Highlighted</dees-button></p>
26
- <p><dees-button type="discreet">This is discreete button</dees-button></p>
27
- <p><dees-button disabled>This is a disabled button</dees-button></p>
28
- <p><dees-button type="big">This is a slotted Text</dees-button></p>
29
- <p><dees-button status="normal">Normal Status</dees-button></p>
30
- <p><dees-button disabled status="pending">Pending Status</dees-button></p>
31
- <p><dees-button disabled status="success">Success Status</dees-button></p>
32
- <p><dees-button disabled status="error">Error Status</dees-button></p>
33
- `;
24
+ public static demo = demoFunc;
34
25
 
35
26
  @property({
36
27
  reflect: true,
@@ -33,7 +33,7 @@ export const demoFunc = () => html`
33
33
  },
34
34
  },
35
35
  ]);
36
- }}>Hello</dees-button>
36
+ }}>Right-Click for contextmenu</dees-button>
37
37
  <dees-contextmenu class="withMargin"></dees-contextmenu>
38
38
  <dees-contextmenu
39
39
  class="withMargin"
@@ -31,7 +31,7 @@ export class DeesContextmenu extends DeesElement {
31
31
  eventArg.preventDefault();
32
32
  eventArg.stopPropagation();
33
33
  const contextMenu = new DeesContextmenu();
34
- contextMenu.style.position = 'absolute';
34
+ contextMenu.style.position = 'fixed';
35
35
  contextMenu.style.zIndex = '2000';
36
36
  contextMenu.style.top = `${eventArg.clientY.toString()}px`;
37
37
  contextMenu.style.left = `${eventArg.clientX.toString()}px`;
@@ -16,11 +16,12 @@ export class DeesMobilenavigation extends DeesElement {
16
16
  // STATIC
17
17
  public static demo = () => html`
18
18
  <dees-button @click=${() => {
19
- DeesMobilenavigation.createAndInit([
19
+ DeesMobilenavigation.createAndShow([
20
20
  {
21
21
  name: 'Test',
22
- action: () => {
22
+ action: async (deesMobileNav) => {
23
23
  alert('test');
24
+ return null;
24
25
  },
25
26
  },
26
27
  ]);
@@ -28,7 +29,7 @@ export class DeesMobilenavigation extends DeesElement {
28
29
  `;
29
30
 
30
31
  private static singletonRef: DeesMobilenavigation;
31
- public static async createAndInit(menuItemsArg: plugins.tsclass.website.IMenuItem[]) {
32
+ public static async createAndShow(menuItemsArg: plugins.tsclass.website.IMenuItem<DeesMobilenavigation>[]) {
32
33
  if (!this.singletonRef) {
33
34
  this.singletonRef = new DeesMobilenavigation();
34
35
  document.body.append(this.singletonRef);
@@ -134,7 +135,7 @@ export class DeesMobilenavigation extends DeesElement {
134
135
  class="menuItem"
135
136
  @click="${() => {
136
137
  this.hide();
137
- menuItem.action();
138
+ menuItem.action(this);
138
139
  }}"
139
140
  >
140
141
  ${menuItem.name}
@@ -0,0 +1,37 @@
1
+ import { html } from '@design.estate/dees-element';
2
+ import { DeesModal } from './dees-modal.js';
3
+
4
+ export const demoFunc = () => html`
5
+ <dees-button @click=${() => {
6
+ DeesModal.createAndShow({
7
+ heading: 'This is a heading',
8
+ content: html`
9
+ <dees-form>
10
+ <dees-input-text
11
+ .label=${'Username'}
12
+ >
13
+ </dees-input-text>
14
+ <dees-input-text
15
+ .label=${'Password'}
16
+ >
17
+ </dees-input-text>
18
+ </dees-form>
19
+ `,
20
+ menuOptions: [{
21
+ name: 'Cancel',
22
+ iconName: null,
23
+ action: async (deesModalArg) => {
24
+ deesModalArg.destroy();
25
+ return null;
26
+ }
27
+ }, {
28
+ name: 'Ok',
29
+ iconName: null,
30
+ action: async (deesModalArg) => {
31
+ deesModalArg.destroy();
32
+ return null;
33
+ }
34
+ }],
35
+ });
36
+ }}>open modal</dees-button>
37
+ `
@@ -0,0 +1,186 @@
1
+ import * as plugins from './plugins.js';
2
+ import { demoFunc } from './dees-modal.demo.js';
3
+ import {
4
+ customElement,
5
+ html,
6
+ DeesElement,
7
+ property,
8
+ type TemplateResult,
9
+ cssManager,
10
+ css,
11
+ type CSSResult,
12
+ unsafeCSS,
13
+ unsafeHTML,
14
+ state,
15
+ } from '@design.estate/dees-element';
16
+
17
+ import * as domtools from '@design.estate/dees-domtools';
18
+ import { DeesWindowLayer } from './dees-windowlayer.js';
19
+
20
+ declare global {
21
+ interface HTMLElementTagNameMap {
22
+ 'dees-modal': DeesModal;
23
+ }
24
+ }
25
+
26
+ @customElement('dees-modal')
27
+ export class DeesModal extends DeesElement {
28
+ // STATIC
29
+ public static demo = demoFunc;
30
+
31
+ public static async createAndShow(optionsArg: {
32
+ heading: string;
33
+ content: TemplateResult;
34
+ menuOptions: plugins.tsclass.website.IMenuItem<DeesModal>[];
35
+ }) {
36
+ const body = document.body;
37
+ const modal = new DeesModal();
38
+ modal.heading = optionsArg.heading;
39
+ modal.content = optionsArg.content;
40
+ modal.menuOptions = optionsArg.menuOptions;
41
+ modal.windowLayer = await DeesWindowLayer.createAndShow();
42
+ modal.windowLayer.addEventListener('click', async () => {
43
+ await modal.destroy();
44
+ });
45
+ body.append(modal.windowLayer);
46
+ body.append(modal);
47
+ }
48
+
49
+ // INSTANCE
50
+
51
+ @property({
52
+ type: String,
53
+ })
54
+ public heading = '';
55
+
56
+ @state({})
57
+ public content: TemplateResult;
58
+
59
+ @state({})
60
+ public menuOptions: plugins.tsclass.website.IMenuItem<DeesModal>[] = [];
61
+
62
+ constructor() {
63
+ super();
64
+ }
65
+
66
+ public static styles = [
67
+ cssManager.defaultStyles,
68
+ css`
69
+ :host {
70
+ font-family: 'Mona Sans', 'Inter', sans-serif;
71
+ color: ${cssManager.bdTheme('#333', '#fff')};
72
+ }
73
+ .modalContainer {
74
+ display: flex;
75
+ position: fixed;
76
+ width: 100vw;
77
+ height: 100vh;
78
+ box-sizing: border-box;
79
+ align-items: center;
80
+ justify-content: center;
81
+ z-index: 2000;
82
+ }
83
+ .modal {
84
+ will-change: transform;
85
+ transform: translateY(10px);
86
+ opacity: 0;
87
+ width: 480px;
88
+ min-height: 120px;
89
+ background: #111;
90
+ border-radius: 8px;
91
+ border: 1px solid #222;
92
+ transition: all 0.2s;
93
+ overflow: hidden;
94
+ }
95
+
96
+ .modal.show {
97
+ opacity: 1;
98
+ transform: translateY(0px);
99
+ }
100
+
101
+ .modal .heading {
102
+ height: 32px;
103
+ font-family: 'Hubot Sans', 'Inter', sans-serif;
104
+ line-height: 32px;
105
+ text-align: center;
106
+ font-weight: 600;
107
+ font-size: 12px;
108
+ border-bottom: 1px solid #222;
109
+ }
110
+
111
+ .modal .content {
112
+ padding: 16px;
113
+ }
114
+ .modal .bottomButtons {
115
+ display: grid;
116
+ border-top: 1px solid #222;
117
+ }
118
+
119
+ .modal .bottomButtons .bottomButton {
120
+ height: 40px;
121
+ line-height: 40px;
122
+ text-align: center;
123
+ font-size: 14px;
124
+ border-right: 1px solid #222;
125
+ cursor: pointer;
126
+ }
127
+ .modal .bottomButtons .bottomButton:hover {
128
+ background: #222;
129
+ }
130
+ .modal .bottomButtons .bottomButton:last-child {
131
+ border-right: none;
132
+ }
133
+ `,
134
+ ];
135
+
136
+ public render(): TemplateResult {
137
+ return html`
138
+ <style>
139
+ .modal .bottomButtons {
140
+ grid-template-columns: ${cssManager.cssGridColumns(this.menuOptions.length, 0)};
141
+ }
142
+ </style>
143
+ <div class="modalContainer" @click=${this.handleOutsideClick}>
144
+ <div class="modal">
145
+ <div class="heading">${this.heading}</div>
146
+ <div class="content">${this.content}</div>
147
+ <div class="bottomButtons">
148
+ ${this.menuOptions.map(
149
+ (actionArg) => html`
150
+ <div class="bottomButton" @click=${() => {
151
+ actionArg.action(this);
152
+ }}>${actionArg.name}</div>
153
+ `
154
+ )}
155
+ </div>
156
+ </div>
157
+ </div>
158
+ `;
159
+ }
160
+
161
+ private windowLayer: DeesWindowLayer;
162
+ public async firstUpdated(_changedProperties: Map<string | number | symbol, unknown>) {
163
+ super.firstUpdated(_changedProperties);
164
+ const domtools = await this.domtoolsPromise;
165
+ await domtools.convenience.smartdelay.delayFor(30);
166
+ const modal = this.shadowRoot.querySelector('.modal');
167
+ modal.classList.add('show');
168
+ }
169
+
170
+ public async handleOutsideClick(eventArg: MouseEvent) {
171
+ eventArg.stopPropagation();
172
+ const modalContainer = this.shadowRoot.querySelector('.modalContainer');
173
+ if (eventArg.target === modalContainer) {
174
+ await this.destroy();
175
+ }
176
+ }
177
+
178
+ public async destroy() {
179
+ const domtools = await this.domtoolsPromise;
180
+ const modal = this.shadowRoot.querySelector('.modal');
181
+ modal.classList.remove('show');
182
+ await domtools.convenience.smartdelay.delayFor(200);
183
+ document.body.removeChild(this);
184
+ await this.windowLayer.destroy();
185
+ }
186
+ }
@@ -25,7 +25,7 @@ export class DeesSimpleAppDash extends DeesElement {
25
25
  // INSTANCE
26
26
 
27
27
  @property()
28
- public title = 'Dees Simple Login';
28
+ public name = 'Dees Simple Login';
29
29
 
30
30
  public static styles = [
31
31
  cssManager.defaultStyles,
@@ -1,3 +1,3 @@
1
1
  import { html } from '@design.estate/dees-element';
2
2
 
3
- export const demoFunc = () => html` <dees-simple-login> Hello there </dees-simple-login> `;
3
+ export const demoFunc = () => html` <dees-simple-login name="someapp"> Hello there </dees-simple-login> `;
@@ -26,7 +26,7 @@ export class DeesSimpleLogin extends DeesElement {
26
26
  // INSTANCE
27
27
 
28
28
  @property()
29
- public title = 'Dees Simple Login';
29
+ public name = 'Dees Simple Login';
30
30
 
31
31
  public static styles = [
32
32
  cssManager.defaultStyles,
@@ -69,7 +69,7 @@ export class DeesSimpleLogin extends DeesElement {
69
69
  <div class="loginContainer">
70
70
  <div class="login">
71
71
  <dees-form>
72
- <div class="header">Login to ${this.title}</div>
72
+ <div class="header">Login to ${this.name}</div>
73
73
  <dees-input-text key="username" label="username" required></dees-input-text>
74
74
  <dees-input-text key="password" label="password" isPasswordBool required></dees-input-text>
75
75
  <dees-form-submit disabled>login</dees-form-submit>
@@ -14,6 +14,7 @@ export * from './dees-input-quantityselector.js';
14
14
  export * from './dees-input-radio.js';
15
15
  export * from './dees-input-text.js';
16
16
  export * from './dees-mobilenavigation.js';
17
+ export * from './dees-modal.js';
17
18
  export * from './dees-pdf.js';
18
19
  export * from './dees-simple-appdash.js';
19
20
  export * from './dees-simple-login.js';