@web-atoms/core 2.2.96 → 2.2.98

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.
@@ -1,17 +1,11 @@
1
1
  import { App } from "../../App";
2
2
  import { AtomDisposableList } from "../../core/AtomDisposableList";
3
- import Bind from "../../core/Bind";
4
- import { BindableProperty } from "../../core/BindableProperty";
5
- import Colors from "../../core/Colors";
6
3
  import { getOwnInheritedProperty } from "../../core/InheritedProperty";
7
- import sleep from "../../core/sleep";
8
4
  import { CancelToken, IClassOf, IDisposable, IRect } from "../../core/types";
9
5
  import XNode, { constructorNeedsArgumentsSymbol } from "../../core/XNode";
10
- import DISingleton from "../../di/DISingleton";
11
- import StyleRule from "../../style/StyleRule";
12
- import { AtomWindowViewModel } from "../../view-model/AtomWindowViewModel";
6
+ import styled from "../../style/styled";
13
7
  import { AtomControl } from "../controls/AtomControl";
14
- import CSS from "../styles/CSS";
8
+
15
9
 
16
10
  import PopupWindowA, { ConfirmPopup } from "./PopupWindow";
17
11
 
@@ -24,90 +18,143 @@ document.body.addEventListener("click", (e) => {
24
18
  }
25
19
  });
26
20
 
27
- CSS(StyleRule()
28
- .custom("contain", "none !important")
29
- , "[data-force-contain=none]");
30
-
31
- CSS(StyleRule()
32
- .position("relative")
33
- .height(0)
34
- .width(0)
35
- .left(0)
36
- .child(StyleRule("*")
37
- .position("absolute")
38
- .left(0)
39
- .top(0)
40
- .padding(5)
41
- .maxHeight(300)
42
- .overflow("auto")
43
- .borderRadius(5)
44
- .backgroundColor(Colors.white)
45
- .zIndex(200)
46
- .defaultBoxShadow()
47
- )
48
- , "*[data-inline-popup=left]");
49
-
50
- CSS(StyleRule()
51
- .position("absolute")
52
- .height(0)
53
- .width(0)
54
- .right(0)
55
- .child(StyleRule("*")
56
- .position("absolute")
57
- .right(0)
58
- .top(0)
59
- .padding(5)
60
- .maxHeight(300)
61
- .overflow("auto")
62
- .borderRadius(5)
63
- .backgroundColor(Colors.white)
64
- .zIndex(200)
65
- .defaultBoxShadow()
66
- )
67
- , "*[data-inline-popup=right]");
68
-
69
- CSS(StyleRule()
70
- .position("relative")
71
- .height(0)
72
- .width(0)
73
- .left(0)
74
- .child(StyleRule("*")
75
- .position("absolute")
76
- .left(0)
77
- .top(0)
78
- .padding(5)
79
- .maxHeight(300)
80
- .overflow("auto")
81
- .borderRadius(5)
82
- .backgroundColor(Colors.white)
83
- .zIndex(200)
84
- .defaultBoxShadow()
85
- )
86
- , "*[data-inline-popup=inline-left]");
87
-
88
- CSS(StyleRule("popup")
89
- .position("fixed")
90
- .left("50%")
91
- .top("50%")
92
- .transform("translate(-50%, -50%)" as any)
93
- .zIndex(10000)
94
- .padding(5)
95
- .backgroundColor(Colors.white)
96
- .border("solid 1px lightgray")
97
- .borderRadius(5)
98
- .boxShadow("rgba(50, 50, 105, 0.15) 0px 2px 5px 0px, rgba(0, 0, 0, 0.05) 0px 1px 1px 0px;")
99
- .display("inline-block")
100
- , "*[data-center-popup]");
101
-
102
-
103
- const popupCss = CSS(StyleRule("popup")
104
- .padding(5)
105
- .backgroundColor(Colors.white)
106
- .border("solid 1px lightgray")
107
- .borderRadius(5)
108
- .boxShadow("rgba(50, 50, 105, 0.15) 0px 2px 5px 0px, rgba(0, 0, 0, 0.05) 0px 1px 1px 0px;")
109
- .display("inline-block")
110
- );
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
+ div[data-confirm-popup=confirm-popup] {
106
+
107
+ display: grid;
108
+
109
+ & .yes {
110
+ border-radius: 9999px;
111
+ padding-left: 10px;
112
+ padding-right: 10px;
113
+ border-width: 1px;
114
+ border-color: #00000000;
115
+ margin: 5px;
116
+ margin-right: 10px;
117
+ background-color: #90ee90;
118
+ }
119
+
120
+ & .no {
121
+ border-radius: 9999px;
122
+ padding-left: 10px;
123
+ padding-right: 10px;
124
+ border-width: 1px;
125
+ border-color: #00000000;
126
+ margin: 5px;
127
+ margin-right: 10px;
128
+ background-color: #ff0000;
129
+ color: #ffffff;
130
+ }
131
+
132
+ & .cancel {
133
+ border-radius: 9999px;
134
+ padding-left: 10px;
135
+ padding-right: 10px;
136
+ border-width: 1px;
137
+ border-color: #00000000;
138
+ margin: 5px;
139
+ margin-right: 10px;
140
+ background-color: #808080;
141
+ }
142
+
143
+ & > [data-element=message] {
144
+ overflow: auto;
145
+ }
146
+ }
147
+
148
+ `.withId("popup-service-styles").installGlobal();
149
+
150
+ const popupCss = styled.css `
151
+ padding: 5px;
152
+ background-color: #ffffff;
153
+ border: solid 1px lightgray;
154
+ border-radius: 5px;
155
+ box-shadow: rgba(50, 50, 105, 0.15) 0px 2px 5px 0px, rgba(0, 0, 0, 0.05) 0px 1px 1px 0px;;
156
+ display: inline-block;
157
+ `.installLocal();
111
158
 
112
159
  export interface IPopupOptions {
113
160
  /**
@@ -153,92 +200,6 @@ export interface IDialogOptions {
153
200
  maximize?: boolean;
154
201
  }
155
202
 
156
- // CSS(StyleRule()
157
- // .position("absolute")
158
- // .border("solid 1px lightgray")
159
- // .borderRadius(5)
160
- // .backgroundColor(Colors.white)
161
- // .top("50%")
162
- // .left("50%")
163
- // .transform("translate(-50%,-50%)" as any)
164
- // .boxShadow("0 0 20px 1px rgb(0 0 0 / 75%)")
165
- // .display("grid")
166
- // .alignItems("center")
167
- // .justifyItems("center")
168
- // .gridTemplateRows("auto 1fr")
169
- // .gridTemplateColumns("1fr")
170
- // .opacity("0")
171
- // .transition("opacity 0.3s cubic-bezier(0.55, 0.09, 0.97, 0.32)")
172
- // .and(StyleRule("[data-ready=true]")
173
- // .opacity("1")
174
- // )
175
- // .and(StyleRule("[data-dragging=true]")
176
- // .opacity("0.5")
177
- // )
178
- // .child(StyleRule(".title")
179
- // .justifySelf("stretch")
180
- // .display("flex")
181
- // .minWidth(0)
182
- // .backgroundColor(Colors.lightGray.withAlphaPercent(0.2))
183
- // .padding(5)
184
- // .alignItems("center")
185
- // .justifyItems("center")
186
- // .child(
187
- // StyleRule(".title-text")
188
- // .cursor("move")
189
- // .flexStretch()
190
- // .textEllipsis()
191
- // )
192
- // .child(StyleRule("*")
193
- // .flex("1 1 100%")
194
- // )
195
- // .child(StyleRule(".popup-close-button")
196
- // .fontFamily("arial")
197
- // .fontSize(15)
198
- // .flex("1 0 auto")
199
- // .cursor("pointer")
200
- // .width(30)
201
- // .height(30)
202
- // .backgroundColor(Colors.red.withAlphaPercent(0.1))
203
- // .border("none")
204
- // .borderRadius(9999)
205
- // .textTransform("capitalize")
206
- // .hoverBackgroundColor(Colors.red)
207
- // )
208
- // )
209
- // .child(StyleRule("*[data-window-content=window-content]")
210
- // .margin(5)
211
- // .alignSelf("stretch")
212
- // .justifySelf("stretch")
213
- // .flexStretch()
214
- // .overflow("auto")
215
- // // This is done to avoid absolute position
216
- // // to run out of content area
217
- // .position("relative")
218
- // // .display("flex")
219
- // // .child(StyleRule("*")
220
- // // .flex("1 1 100%")
221
- // // )
222
- // // .and(StyleRule("[data-window-content-fill] > *")
223
- // // .maximizeAbsolute()
224
- // // )
225
- // )
226
- // .child(StyleRule(" * > .command-bar")
227
- // .backgroundColor(Colors.lightGray.withAlphaPercent(0.6))
228
- // .display("flex")
229
- // .margin(0)
230
- // .padding(5)
231
- // .gap(5)
232
- // .nested(StyleRule("button")
233
- // .borderWidth(1)
234
- // .borderRadius(9999)
235
- // .padding(5)
236
- // .paddingLeft(10)
237
- // .paddingRight(10)
238
- // )
239
- // )
240
- // , "*[data-popup-window=popup-window]");
241
-
242
203
  export class PopupControl extends AtomControl {
243
204
 
244
205
  public static showControl<T>(
@@ -497,44 +458,6 @@ export class PopupControl extends AtomControl {
497
458
  // // @ts-ignore
498
459
  // delete PopupWindow.prototype.init;
499
460
 
500
- CSS(StyleRule()
501
- .display("grid")
502
- .nested(StyleRule(".yes")
503
- .borderRadius(9999)
504
- .paddingLeft(10)
505
- .paddingRight(10)
506
- .borderWidth(1)
507
- .borderColor(Colors.transparent)
508
- .margin(5)
509
- .marginRight(10)
510
- .backgroundColor(Colors.lightGreen)
511
- )
512
- .nested(StyleRule(".no")
513
- .borderRadius(9999)
514
- .paddingLeft(10)
515
- .paddingRight(10)
516
- .borderWidth(1)
517
- .borderColor(Colors.transparent)
518
- .margin(5)
519
- .marginRight(10)
520
- .backgroundColor(Colors.red)
521
- .color(Colors.white)
522
- )
523
- .nested(StyleRule(".cancel")
524
- .borderRadius(9999)
525
- .paddingLeft(10)
526
- .paddingRight(10)
527
- .borderWidth(1)
528
- .borderColor(Colors.transparent)
529
- .margin(5)
530
- .marginRight(10)
531
- .backgroundColor(Colors.gray)
532
- )
533
- .child(StyleRule("[data-element=message]")
534
- .overflow("auto")
535
- )
536
- , "div[data-confirm-popup=confirm-popup]");
537
-
538
461
  // class ConfirmPopup extends PopupWindow {
539
462
 
540
463
  // public static async confirm({
@@ -34,14 +34,14 @@ const focus = (popup: PopupWindow) => {
34
34
  // supplied cancelToken was cancelled
35
35
  const anyAutofocus = element.querySelector(`*[autofocus]`);
36
36
  if (!anyAutofocus) {
37
- const windowContent = element.querySelector("[data-window-content]");
38
- if (windowContent) {
39
- const firstInput = windowContent.querySelector("input,button,a") as HTMLInputElement;
40
- if (firstInput) {
41
- firstInput.focus();
42
- return;
43
- }
44
- }
37
+ // const windowContent = element.querySelector("[data-window-content]");
38
+ // if (windowContent) {
39
+ // const firstInput = windowContent.querySelector("input,button,a") as HTMLInputElement;
40
+ // if (firstInput) {
41
+ // firstInput.focus();
42
+ // return;
43
+ // }
44
+ // }
45
45
 
46
46
  const cb = element.querySelector(".popup-close-button") as HTMLButtonElement;
47
47
  if (cb) {
@@ -49,6 +49,7 @@ const focus = (popup: PopupWindow) => {
49
49
  }
50
50
  return;
51
51
  }
52
+ (anyAutofocus as HTMLElement).focus?.();
52
53
  };
53
54
 
54
55
  styled.css `
@@ -130,6 +131,7 @@ const focus = (popup: PopupWindow) => {
130
131
  grid-column: 1 / span 3;
131
132
  position: relative;
132
133
  overflow: auto;
134
+ padding: var(--spacing-medium, 7px);
133
135
  }
134
136
  & > [data-window-element=footer] {
135
137
  margin-top: 5px;
@@ -1,35 +0,0 @@
1
- export declare function combine(...names: any[]): string;
2
- declare const CommonStyles: {
3
- combine: typeof combine;
4
- color: {
5
- yellow: string;
6
- green: string;
7
- red: string;
8
- };
9
- backgroundColor: {
10
- yellow: string;
11
- green: string;
12
- red: string;
13
- };
14
- bold: string;
15
- margin5: string;
16
- padding5: string;
17
- borderRadius9999: string;
18
- borderRadius5: string;
19
- italic: string;
20
- overflow: {
21
- auto: string;
22
- hidden: string;
23
- };
24
- flex: {
25
- inline: string;
26
- stretch: string;
27
- alignItemsCenter: string;
28
- horizontal: string;
29
- vertical: string;
30
- justifyContentSpaceAround: string;
31
- toString: () => string;
32
- };
33
- };
34
- export default CommonStyles;
35
- //# sourceMappingURL=CommonStyles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommonStyles.d.ts","sourceRoot":"","sources":["../../../src/web/styles/CommonStyles.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,CAAC,GAAI,KAAK,EAAE,GAAG,EAAE,UAavC;AAOD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,69 +0,0 @@
1
- System.register(["../../core/Colors", "../../style/StyleRule", "./CSS"], function (_export, _context) {
2
- "use strict";
3
-
4
- var Colors, StyleRule, CSS, CommonStyles;
5
- function combine(...names) {
6
- const r = [];
7
- for (const iterator of names) {
8
- if (!iterator) {
9
- continue;
10
- }
11
- const v = iterator.toString();
12
- if (!v) {
13
- continue;
14
- }
15
- r.push(v);
16
- }
17
- return r.join(" ");
18
- }
19
- function CSSToString(s) {
20
- const name = CSS(s);
21
- return () => name;
22
- }
23
- _export("combine", combine);
24
- return {
25
- setters: [function (_coreColors) {
26
- Colors = _coreColors.default;
27
- }, function (_styleStyleRule) {
28
- StyleRule = _styleStyleRule.default;
29
- }, function (_CSS) {
30
- CSS = _CSS.default;
31
- }],
32
- execute: function () {
33
- CommonStyles = {
34
- combine,
35
- color: {
36
- yellow: CSS(StyleRule().color(Colors.yellow)),
37
- green: CSS(StyleRule().color(Colors.green)),
38
- red: CSS(StyleRule().color(Colors.red))
39
- },
40
- backgroundColor: {
41
- yellow: CSS(StyleRule().backgroundColor(Colors.yellow)),
42
- green: CSS(StyleRule().backgroundColor(Colors.green)),
43
- red: CSS(StyleRule().backgroundColor(Colors.red))
44
- },
45
- bold: CSS(StyleRule().fontWeight("bold")),
46
- margin5: CSS(StyleRule().margin(5)),
47
- padding5: CSS(StyleRule().padding(5)),
48
- borderRadius9999: CSS(StyleRule().borderRadius(9999)),
49
- borderRadius5: CSS(StyleRule().borderRadius(5)),
50
- italic: CSS(StyleRule().fontStyle("italic")),
51
- overflow: {
52
- auto: CSS(StyleRule().overflow("auto")),
53
- hidden: CSS(StyleRule().overflow("hidden"))
54
- },
55
- flex: {
56
- inline: CSS(StyleRule().display("inline-flex")),
57
- stretch: CSS(StyleRule().flexStretch()),
58
- alignItemsCenter: CSS(StyleRule().alignItems("center")),
59
- horizontal: CSS(StyleRule().flexDirection("row")),
60
- vertical: CSS(StyleRule().flexDirection("column")),
61
- justifyContentSpaceAround: CSS(StyleRule().justifyContent("space-around")),
62
- toString: CSSToString(StyleRule().display("flex"))
63
- }
64
- };
65
- _export("default", CommonStyles);
66
- }
67
- };
68
- });
69
- //# sourceMappingURL=CommonStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["combine","names","r","iterator","v","toString","push","join","CSSToString","s","name","CSS","_export","setters","_coreColors","Colors","default","_styleStyleRule","StyleRule","_CSS","execute","CommonStyles","color","yellow","green","red","backgroundColor","bold","fontWeight","margin5","margin","padding5","padding","borderRadius9999","borderRadius","borderRadius5","italic","fontStyle","overflow","auto","hidden","flex","inline","display","stretch","flexStretch","alignItemsCenter","alignItems","horizontal","flexDirection","vertical","justifyContentSpaceAround","justifyContent"],"sources":["../../../src/web/styles/CommonStyles.ts"],"sourcesContent":[null],"mappings":"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"}
@@ -1,64 +0,0 @@
1
- import Colors from "../../core/Colors";
2
- import StyleRule, { AtomStyleRules } from "../../style/StyleRule";
3
- import CSS from "./CSS";
4
-
5
- export function combine(... names: any[]) {
6
- const r = [];
7
- for (const iterator of names) {
8
- if (!iterator) {
9
- continue;
10
- }
11
- const v = iterator.toString();
12
- if (!v) {
13
- continue;
14
- }
15
- r.push(v);
16
- }
17
- return r.join(" ");
18
- }
19
-
20
- function CSSToString(s) {
21
- const name = CSS(s);
22
- return () => name;
23
- }
24
-
25
- const CommonStyles = {
26
- combine,
27
- color: {
28
- yellow: CSS(StyleRule()
29
- .color(Colors.yellow)),
30
- green: CSS(StyleRule()
31
- .color(Colors.green)),
32
- red: CSS(StyleRule()
33
- .color(Colors.red)),
34
- },
35
- backgroundColor: {
36
- yellow: CSS(StyleRule()
37
- .backgroundColor(Colors.yellow)),
38
- green: CSS(StyleRule()
39
- .backgroundColor(Colors.green)),
40
- red: CSS(StyleRule()
41
- .backgroundColor(Colors.red)),
42
- },
43
- bold: CSS(StyleRule().fontWeight("bold")),
44
- margin5: CSS(StyleRule().margin(5)),
45
- padding5: CSS(StyleRule().padding(5)),
46
- borderRadius9999: CSS(StyleRule().borderRadius(9999)),
47
- borderRadius5: CSS(StyleRule().borderRadius(5)),
48
- italic: CSS(StyleRule().fontStyle("italic")),
49
- overflow: {
50
- auto: CSS(StyleRule().overflow("auto")),
51
- hidden: CSS(StyleRule().overflow("hidden"))
52
- },
53
- flex: {
54
- inline: CSS(StyleRule().display("inline-flex")),
55
- stretch: CSS(StyleRule().flexStretch()),
56
- alignItemsCenter: CSS(StyleRule().alignItems("center")),
57
- horizontal: CSS(StyleRule().flexDirection("row")),
58
- vertical: CSS(StyleRule().flexDirection("column")),
59
- justifyContentSpaceAround: CSS(StyleRule().justifyContent("space-around")),
60
- toString: CSSToString(StyleRule().display("flex"))
61
- },
62
- };
63
-
64
- export default CommonStyles;