@web-atoms/core 2.4.31 → 2.4.33

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 (28) hide show
  1. package/dist/tsconfig.tsbuildinfo +1 -1
  2. package/dist/web/services/NotifcationPopup.global.less.css +13 -0
  3. package/dist/web/services/NotifcationPopup.global.less.css.map +1 -0
  4. package/dist/web/services/NotificationPopup.d.ts +1 -0
  5. package/dist/web/services/NotificationPopup.d.ts.map +1 -1
  6. package/dist/web/services/NotificationPopup.js +4 -16
  7. package/dist/web/services/NotificationPopup.js.map +1 -1
  8. package/dist/web/services/PopupService.d.ts +1 -0
  9. package/dist/web/services/PopupService.d.ts.map +1 -1
  10. package/dist/web/services/PopupService.global.less.css +83 -0
  11. package/dist/web/services/PopupService.global.less.css.map +1 -0
  12. package/dist/web/services/PopupService.js +4 -98
  13. package/dist/web/services/PopupService.js.map +1 -1
  14. package/dist/web/services/PopupWindow.d.ts +1 -0
  15. package/dist/web/services/PopupWindow.d.ts.map +1 -1
  16. package/dist/web/services/PopupWindow.global.less.css +148 -0
  17. package/dist/web/services/PopupWindow.global.less.css.map +1 -0
  18. package/dist/web/services/PopupWindow.js +3 -161
  19. package/dist/web/services/PopupWindow.js.map +1 -1
  20. package/gulpfile.mjs +41 -0
  21. package/package.json +7 -3
  22. package/src/index.d.ts +5 -0
  23. package/src/web/services/NotifcationPopup.global.less +11 -0
  24. package/src/web/services/NotificationPopup.tsx +3 -12
  25. package/src/web/services/PopupService.global.less +91 -0
  26. package/src/web/services/PopupService.tsx +5 -97
  27. package/src/web/services/PopupWindow.global.less +157 -0
  28. package/src/web/services/PopupWindow.tsx +2 -160
@@ -1,18 +1,9 @@
1
1
  import XNode from "../../core/XNode";
2
- import styled from "../../style/styled";
3
2
  import { PopupWindow } from "./PopupService";
4
3
 
5
- const css = styled.css `
6
- padding: 5px;
7
- font-size: larger;
8
- & .error {
9
- color: red;
10
- border-color: red;
11
- }
12
- & .warning {
13
- background-color: lightyellow;
14
- }
15
- `.installLocal();
4
+ import "./NotifcationPopup.global.less";
5
+
6
+ const css = "web-atoms-notification-popup";
16
7
 
17
8
  export default function NotificationPopup({
18
9
  message,
@@ -0,0 +1,91 @@
1
+
2
+ [data-force-contain=none] {
3
+ contain: none !important;
4
+ }
5
+
6
+ *[data-inline-popup=left] {
7
+ position: relative;
8
+ height: 0px;
9
+ width: 0px;
10
+ left: 0px;
11
+
12
+ & > * {
13
+ position: absolute;
14
+ left: 0px;
15
+ top: 0px;
16
+ padding: 5px;
17
+ max-height: 300px;
18
+ overflow: auto;
19
+ border-radius: 5px;
20
+ background-color: #ffffff;
21
+ z-index: 200;
22
+ box-shadow: rgba(50, 50, 105, 0.07) 0px 2px 5px 0px, rgba(0, 0, 0, 0.03) 0px 1px 1px 0px;;
23
+ border: solid 1px rgba(0, 0, 0, 0.05);
24
+ }
25
+ }
26
+
27
+ *[data-inline-popup=right] {
28
+ position: absolute;
29
+ height: 0px;
30
+ width: 0px;
31
+ right: 0px;
32
+
33
+
34
+ & > * {
35
+ position: absolute;
36
+ right: 0px;
37
+ top: 0px;
38
+ padding: 5px;
39
+ max-height: 300px;
40
+ overflow: auto;
41
+ border-radius: 5px;
42
+ background-color: #ffffff;
43
+ z-index: 200;
44
+ box-shadow: rgba(50, 50, 105, 0.07) 0px 2px 5px 0px, rgba(0, 0, 0, 0.03) 0px 1px 1px 0px;;
45
+ border: solid 1px rgba(0, 0, 0, 0.05);
46
+ }
47
+ }
48
+
49
+ *[data-inline-popup=inline-left] {
50
+ position: relative;
51
+ height: 0px;
52
+ width: 0px;
53
+ left: 0px;
54
+
55
+ & > * {
56
+ position: absolute;
57
+ left: 0px;
58
+ top: 0px;
59
+ padding: 5px;
60
+ max-height: 300px;
61
+ overflow: auto;
62
+ border-radius: 5px;
63
+ background-color: #ffffff;
64
+ z-index: 200;
65
+ box-shadow: rgba(50, 50, 105, 0.07) 0px 2px 5px 0px, rgba(0, 0, 0, 0.03) 0px 1px 1px 0px;;
66
+ border: solid 1px rgba(0, 0, 0, 0.05);
67
+ }
68
+ }
69
+
70
+ *[data-center-popup] {
71
+ position: fixed;
72
+ left: 50%;
73
+ top: 50%;
74
+ transform: translate(-50%, -50%);
75
+ z-index: 10000;
76
+ padding: 5px;
77
+ background-color: #ffffff;
78
+ border: solid 1px lightgray;
79
+ border-radius: 5px;
80
+ box-shadow: rgba(50, 50, 105, 0.15) 0px 2px 5px 0px, rgba(0, 0, 0, 0.05) 0px 1px 1px 0px;;
81
+ display: inline-block;
82
+ }
83
+
84
+ .web-atoms-popup-local {
85
+ padding: 5px;
86
+ background-color: #ffffff;
87
+ border: solid 1px lightgray;
88
+ border-radius: 5px;
89
+ box-shadow: rgba(50, 50, 105, 0.15) 0px 2px 5px 0px, rgba(0, 0, 0, 0.05) 0px 1px 1px 0px;;
90
+ display: inline-block;
91
+ }
@@ -1,14 +1,15 @@
1
1
  import { App } from "../../App";
2
2
  import { AtomDisposableList } from "../../core/AtomDisposableList";
3
3
  import { getOwnInheritedProperty } from "../../core/InheritedProperty";
4
- import { CancelToken, IClassOf, IDisposable, IRect } from "../../core/types";
5
- import XNode, { constructorNeedsArgumentsSymbol } from "../../core/XNode";
6
- import styled from "../../style/styled";
4
+ import { CancelToken } from "../../core/types";
5
+ import XNode from "../../core/XNode";
7
6
  import { AtomControl } from "../controls/AtomControl";
8
7
 
8
+ import "./PopupService.global.less";
9
9
 
10
10
  import PopupWindowA, { ConfirmPopup } from "./PopupWindow";
11
11
 
12
+
12
13
  export const PopupWindow = PopupWindowA;
13
14
 
14
15
  // let lastTarget = null;
@@ -18,100 +19,7 @@ document.body.addEventListener("click", (e) => {
18
19
  }
19
20
  });
20
21
 
21
- styled.css `
22
-
23
- [data-force-contain=none] {
24
- contain: none !important;
25
- }
26
-
27
- *[data-inline-popup=left] {
28
- position: relative;
29
- height: 0px;
30
- width: 0px;
31
- left: 0px;
32
-
33
- & > * {
34
- position: absolute;
35
- left: 0px;
36
- top: 0px;
37
- padding: 5px;
38
- max-height: 300px;
39
- overflow: auto;
40
- border-radius: 5px;
41
- background-color: #ffffff;
42
- z-index: 200;
43
- box-shadow: rgba(50, 50, 105, 0.07) 0px 2px 5px 0px, rgba(0, 0, 0, 0.03) 0px 1px 1px 0px;;
44
- border: solid 1px rgba(0, 0, 0, 0.05);
45
- }
46
- }
47
-
48
- *[data-inline-popup=right] {
49
- position: absolute;
50
- height: 0px;
51
- width: 0px;
52
- right: 0px;
53
-
54
-
55
- & > * {
56
- position: absolute;
57
- right: 0px;
58
- top: 0px;
59
- padding: 5px;
60
- max-height: 300px;
61
- overflow: auto;
62
- border-radius: 5px;
63
- background-color: #ffffff;
64
- z-index: 200;
65
- box-shadow: rgba(50, 50, 105, 0.07) 0px 2px 5px 0px, rgba(0, 0, 0, 0.03) 0px 1px 1px 0px;;
66
- border: solid 1px rgba(0, 0, 0, 0.05);
67
- }
68
- }
69
-
70
- *[data-inline-popup=inline-left] {
71
- position: relative;
72
- height: 0px;
73
- width: 0px;
74
- left: 0px;
75
-
76
- & > * {
77
- position: absolute;
78
- left: 0px;
79
- top: 0px;
80
- padding: 5px;
81
- max-height: 300px;
82
- overflow: auto;
83
- border-radius: 5px;
84
- background-color: #ffffff;
85
- z-index: 200;
86
- box-shadow: rgba(50, 50, 105, 0.07) 0px 2px 5px 0px, rgba(0, 0, 0, 0.03) 0px 1px 1px 0px;;
87
- border: solid 1px rgba(0, 0, 0, 0.05);
88
- }
89
- }
90
-
91
- *[data-center-popup] {
92
- position: fixed;
93
- left: 50%;
94
- top: 50%;
95
- transform: translate(-50%, -50%);
96
- z-index: 10000;
97
- padding: 5px;
98
- background-color: #ffffff;
99
- border: solid 1px lightgray;
100
- border-radius: 5px;
101
- box-shadow: rgba(50, 50, 105, 0.15) 0px 2px 5px 0px, rgba(0, 0, 0, 0.05) 0px 1px 1px 0px;;
102
- display: inline-block;
103
- }
104
-
105
- `.withId("popup-service-styles").installGlobal();
106
-
107
- const popupCss = styled.css `
108
- padding: 5px;
109
- background-color: #ffffff;
110
- border: solid 1px lightgray;
111
- border-radius: 5px;
112
- box-shadow: rgba(50, 50, 105, 0.15) 0px 2px 5px 0px, rgba(0, 0, 0, 0.05) 0px 1px 1px 0px;;
113
- display: inline-block;
114
- `.installLocal();
22
+ const popupCss = "web-atoms-popup-local";
115
23
 
116
24
  export interface IPopupOptions {
117
25
  /**
@@ -0,0 +1,157 @@
1
+ [data-popup-window=popup-window] {
2
+ position: absolute;
3
+ border: solid 1px lightgray;
4
+ border-radius: 5px;
5
+ background-color: canvas;
6
+ color: canvastext;
7
+ top: 50%;
8
+ left: 50%;
9
+ transform: translate(-50%, -50%);
10
+ box-shadow: 0 0 20px 1px rgba(0 0 0 / 75%);
11
+
12
+ display: grid;
13
+ align-items: stretch;
14
+ justify-items: stretch;
15
+ grid-template-rows: auto auto 1fr auto;
16
+ grid-template-columns: auto 1fr auto;
17
+ opacity: 0;
18
+ transition: opacity 0.3s cubic-bezier(0.55, 0.09, 0.97, 0.32) ;
19
+ overflow: hidden;
20
+
21
+ [data-window-modal-background=background] {
22
+ position: absolute;
23
+ top: 0;
24
+ left: 0;
25
+ bottom: 0;
26
+ right: 0;
27
+ }
28
+
29
+ &[data-no-width=true] {
30
+ max-width: 95%;
31
+ min-width: 300px;
32
+ }
33
+ &[data-no-height=true] {
34
+ max-height: 95%;
35
+ min-height: 100px;
36
+ }
37
+
38
+ &[data-maximize=true] {
39
+ width: 90%;
40
+ height: 90%;
41
+ }
42
+
43
+ &[data-ready=true] {
44
+ opacity: 1;
45
+ }
46
+ &[data-dragging=true] {
47
+ opacity: 0.5;
48
+ }
49
+ & > [data-window-element=icon] {
50
+ grid-row: 1;
51
+ grid-column: 1;
52
+ z-index: 2;
53
+ }
54
+ & > [data-window-element=title] {
55
+ grid-row: 1;
56
+ grid-column: 2;
57
+ font-size: medium;
58
+ overflow: hidden;
59
+ white-space: nowrap;
60
+ text-overflow: ellipsis;
61
+ cursor: move;
62
+ padding: var(--spacing, 5px);
63
+ color: var(--accent-text-color, #424242);
64
+ z-index: 2;
65
+ }
66
+ & > [data-window-element=close] {
67
+ grid-row: 1;
68
+ grid-column: 3;
69
+ color: white;
70
+ background-color: red;
71
+ border-radius: 9999px;
72
+ border: none;
73
+ outline: none;
74
+ /* padding: 5px; */
75
+ font-family: monospace;
76
+ height: 20px;
77
+ width: 20px;
78
+ margin: 5px;
79
+ cursor: pointer;
80
+ text-transform: capitalize;
81
+ z-index: 2;
82
+ }
83
+ & > [data-window-element=action-bar] {
84
+ grid-row: 1;
85
+ grid-column: 1 / span 3;
86
+ align-self: stretch;
87
+ justify-self: stretch;
88
+ background-color: var(--accent-color, rgba(211, 211, 211, 0.2));
89
+ border-top-left-radius: 5px;
90
+ border-top-right-radius: 5px;
91
+ z-index: 1;
92
+ }
93
+ & > [data-window-element=header] {
94
+ margin-top: 5px;
95
+ grid-row: 2;
96
+ grid-column: 1 / span 3;
97
+ }
98
+ & > [data-window-element=content] {
99
+ margin-top: 5px;
100
+ grid-row: 3;
101
+ grid-column: 1 / span 3;
102
+ position: relative;
103
+ overflow: auto;
104
+ padding: var(--spacing-medium, 7px);
105
+ &[data-maximize=true] {
106
+ width: 90vw;
107
+ height: 90vh;
108
+ }
109
+ }
110
+ & > [data-window-element=footer] {
111
+ margin-top: 5px;
112
+ grid-row: 4;
113
+ grid-column: 1 / span 3;
114
+ padding-top: 5px;
115
+ padding-bottom: 5px;
116
+ background-color: var(--command-bar-color, #80808025);
117
+
118
+ & > button, & > * > button {
119
+ border-radius: 9999px;
120
+ padding: 5px;
121
+ padding-left: 20px;
122
+ padding-right: 20px;
123
+ border-width: 1px;
124
+ border-color: transparent;
125
+ margin: 5px;
126
+ margin-left: 10px;
127
+ }
128
+ }
129
+ }
130
+
131
+ body > div[data-popup-window=popup-window], body > div[data-window-modal-background] {
132
+ position: fixed;
133
+ }
134
+
135
+ [data-confirm-popup=confirm-popup] {
136
+ & >[data-window-element=content] > [data-element=details] {
137
+ margin-top: 5px;
138
+ overflow: auto;
139
+ max-width: 80vw;
140
+ max-height: 50vh;
141
+ }
142
+ & > [data-window-element=footer] {
143
+
144
+ & > .yes {
145
+ background-color: #01af01;
146
+ color: white;
147
+ }
148
+ & > .no {
149
+ background-color: red;
150
+ color: white;
151
+ }
152
+ & > .cancel {
153
+ background-color: gray;
154
+ color: white;
155
+ }
156
+ }
157
+ }
@@ -3,12 +3,13 @@ import { BindableProperty } from "../../core/BindableProperty";
3
3
  import XNode from "../../core/XNode";
4
4
  import sleep from "../../core/sleep";
5
5
  import { CancelToken, IClassOf, IDisposable, IRect } from "../../core/types";
6
- import styled from "../../style/styled";
7
6
  import { AtomControl } from "../controls/AtomControl";
8
7
  import { ChildEnumerator } from "../core/AtomUI";
9
8
  import type PopupService from "./PopupService";
10
9
  import type { IDialogOptions } from "./PopupService";
11
10
 
11
+ import "./PopupWindow.global.less";
12
+
12
13
  let popupService: typeof PopupService;
13
14
 
14
15
  const loadPopupService = async () => {
@@ -52,141 +53,6 @@ const focus = (popup: PopupWindow) => {
52
53
  (anyAutofocus as HTMLElement).focus?.();
53
54
  };
54
55
 
55
- styled.css `
56
- position: absolute;
57
- border: solid 1px lightgray;
58
- border-radius: 5px;
59
- background-color: canvas;
60
- color: canvastext;
61
- top: 50%;
62
- left: 50%;
63
- transform: translate(-50%, -50%);
64
- box-shadow: 0 0 20px 1px rgba(0 0 0 / 75%);
65
-
66
- display: grid;
67
- align-items: stretch;
68
- justify-items: stretch;
69
- grid-template-rows: auto auto 1fr auto;
70
- grid-template-columns: auto 1fr auto;
71
- opacity: 0;
72
- transition: opacity 0.3s cubic-bezier(0.55, 0.09, 0.97, 0.32) ;
73
- overflow: hidden;
74
-
75
- [data-window-modal-background=background] {
76
- position: absolute;
77
- top: 0;
78
- left: 0;
79
- bottom: 0;
80
- right: 0;
81
- }
82
-
83
- &[data-no-width=true] {
84
- max-width: 95%;
85
- min-width: 300px;
86
- }
87
- &[data-no-height=true] {
88
- max-height: 95%;
89
- min-height: 100px;
90
- }
91
-
92
- &[data-maximize=true] {
93
- width: 90%;
94
- height: 90%;
95
- }
96
-
97
- &[data-ready=true] {
98
- opacity: 1;
99
- }
100
- &[data-dragging=true] {
101
- opacity: 0.5;
102
- }
103
- & > [data-window-element=icon] {
104
- grid-row: 1;
105
- grid-column: 1;
106
- z-index: 2;
107
- }
108
- & > [data-window-element=title] {
109
- grid-row: 1;
110
- grid-column: 2;
111
- font-size: medium;
112
- overflow: hidden;
113
- white-space: nowrap;
114
- text-overflow: ellipsis;
115
- cursor: move;
116
- padding: var(--spacing, 5px);
117
- color: var(--accent-text-color, #424242);
118
- z-index: 2;
119
- }
120
- & > [data-window-element=close] {
121
- grid-row: 1;
122
- grid-column: 3;
123
- color: white;
124
- background-color: red;
125
- border-radius: 9999px;
126
- border: none;
127
- outline: none;
128
- /* padding: 5px; */
129
- font-family: monospace;
130
- height: 20px;
131
- width: 20px;
132
- margin: 5px;
133
- cursor: pointer;
134
- text-transform: capitalize;
135
- z-index: 2;
136
- }
137
- & > [data-window-element=action-bar] {
138
- grid-row: 1;
139
- grid-column: 1 / span 3;
140
- align-self: stretch;
141
- justify-self: stretch;
142
- background-color: var(--accent-color, rgba(211, 211, 211, 0.2));
143
- border-top-left-radius: 5px;
144
- border-top-right-radius: 5px;
145
- z-index: 1;
146
- }
147
- & > [data-window-element=header] {
148
- margin-top: 5px;
149
- grid-row: 2;
150
- grid-column: 1 / span 3;
151
- }
152
- & > [data-window-element=content] {
153
- margin-top: 5px;
154
- grid-row: 3;
155
- grid-column: 1 / span 3;
156
- position: relative;
157
- overflow: auto;
158
- padding: var(--spacing-medium, 7px);
159
- &[data-maximize=true] {
160
- width: 90vw;
161
- height: 90vh;
162
- }
163
- }
164
- & > [data-window-element=footer] {
165
- margin-top: 5px;
166
- grid-row: 4;
167
- grid-column: 1 / span 3;
168
- padding-top: 5px;
169
- padding-bottom: 5px;
170
- background-color: var(--command-bar-color, #80808025);
171
-
172
- & > button, & > * > button {
173
- border-radius: 9999px;
174
- padding: 5px;
175
- padding-left: 20px;
176
- padding-right: 20px;
177
- border-width: 1px;
178
- border-color: transparent;
179
- margin: 5px;
180
- margin-left: 10px;
181
- }
182
- }
183
-
184
- `.installGlobal("[data-popup-window=popup-window]")
185
-
186
- styled.css `
187
- position: fixed;
188
- `.installGlobal("body > div[data-popup-window=popup-window], body > div[data-window-modal-background]");
189
-
190
56
  export default class PopupWindow extends AtomControl {
191
57
 
192
58
  public static async showWindow<T>(options?: IDialogOptions): Promise<T>;
@@ -461,30 +327,6 @@ export default class PopupWindow extends AtomControl {
461
327
  // @ts-ignore
462
328
  delete PopupWindow.prototype.init;
463
329
 
464
- styled.css `
465
- & >[data-window-element=content] > [data-element=details] {
466
- margin-top: 5px;
467
- overflow: auto;
468
- max-width: 80vw;
469
- max-height: 50vh;
470
- }
471
- & > [data-window-element=footer] {
472
-
473
- & > .yes {
474
- background-color: #01af01;
475
- color: white;
476
- }
477
- & > .no {
478
- background-color: red;
479
- color: white;
480
- }
481
- & > .cancel {
482
- background-color: gray;
483
- color: white;
484
- }
485
- }
486
- `.installGlobal("[data-confirm-popup=confirm-popup]")
487
-
488
330
  export class ConfirmPopup extends PopupWindow {
489
331
 
490
332
  public static async confirm({