fmihel-windeco-components 2.0.0-beta.6 → 2.0.0-beta.61

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 (117) hide show
  1. package/copy-to +19 -3
  2. package/dev-bs/App.jsx +1 -1
  3. package/dev-bs/style/custom.scss +1 -1
  4. package/dist/windeco-components.js +2 -4
  5. package/dist/windeco-components.js.LICENSE.txt +3 -0
  6. package/jsx/Btn.jsx +9 -7
  7. package/jsx/BtnIcon.jsx +36 -15
  8. package/jsx/CheckBox.jsx +9 -8
  9. package/jsx/Collapse.jsx +2 -7
  10. package/jsx/ComboBox/ComboItem.jsx +5 -2
  11. package/jsx/ComboBox/ComboList.jsx +18 -12
  12. package/jsx/ComboBox.jsx +42 -15
  13. package/jsx/Container/Cols.jsx +11 -0
  14. package/jsx/Container/Row.jsx +18 -0
  15. package/jsx/Container.jsx +25 -5
  16. package/jsx/Edit.jsx +32 -29
  17. package/jsx/Gap/Gap.jsx +4 -6
  18. package/jsx/Group.jsx +8 -9
  19. package/jsx/Icon.jsx +6 -7
  20. package/jsx/Label.jsx +13 -11
  21. package/jsx/List/ListItem.jsx +5 -9
  22. package/jsx/List/ListNode.jsx +3 -25
  23. package/jsx/{List/List.jsx → List.jsx} +8 -22
  24. package/jsx/Modal.jsx +10 -5
  25. package/jsx/ModalDialog/Header.jsx +0 -0
  26. package/jsx/ModalDialog/ModalDialogAPI.js +15 -6
  27. package/jsx/ModalDialog.jsx +47 -28
  28. package/jsx/NavBar/NavItem.jsx +36 -25
  29. package/jsx/NavBar/NavLogo.jsx +5 -3
  30. package/jsx/NavBar.jsx +36 -60
  31. package/jsx/OnResize.jsx +126 -0
  32. package/jsx/StaticText.jsx +30 -0
  33. package/jsx/Table/TBody.jsx +13 -1
  34. package/jsx/Table/TD.jsx +41 -2
  35. package/jsx/Table/TH.jsx +12 -1
  36. package/jsx/Table/THead.jsx +4 -0
  37. package/jsx/Table/TR.jsx +40 -13
  38. package/jsx/Table.jsx +48 -27
  39. package/jsx/TableFixed/Data.jsx +35 -29
  40. package/jsx/TableFixed/Header.jsx +4 -0
  41. package/jsx/TableFixed/TD.jsx +27 -1
  42. package/jsx/TableFixed/TR.jsx +12 -2
  43. package/jsx/TableFixed/utils.js +1 -1
  44. package/jsx/TableFixed.jsx +49 -32
  45. package/jsx/Text.jsx +11 -12
  46. package/jsx/arch/NavBar/NavItem.jsx +45 -0
  47. package/jsx/arch/NavBar/NavLogo.jsx +23 -0
  48. package/jsx/{NavBar → arch/NavBar}/NavMenu.jsx +3 -3
  49. package/jsx/arch/NavBar.jsx +81 -0
  50. package/jsx/index.js +27 -18
  51. package/package.json +8 -7
  52. package/style/Btn.scss +36 -24
  53. package/style/BtnIcon.scss +51 -30
  54. package/style/CheckBox.scss +26 -33
  55. package/style/ComboBox.scss +70 -56
  56. package/style/Container.scss +3 -44
  57. package/style/Edit.scss +48 -33
  58. package/style/Gap.scss +10 -5
  59. package/style/Group.scss +51 -75
  60. package/style/Icon.scss +2 -3
  61. package/style/Label.scss +31 -14
  62. package/style/List.scss +22 -35
  63. package/style/Modal.scss +8 -4
  64. package/style/ModalDialog.scss +28 -30
  65. package/style/NavBar.scss +186 -194
  66. package/style/ScrollBar.scss +28 -42
  67. package/style/Table.scss +31 -33
  68. package/style/TableFixed.scss +21 -26
  69. package/style/Text.scss +1 -51
  70. package/style/arch/ComboBox.scss +1 -1
  71. package/style/arch/NavBar.scss +236 -0
  72. package/style/{utils.scss → arch/utils.scss} +27 -1
  73. package/style/{vars.scss → arch/vars.scss} +71 -87
  74. package/style/ctrls.scss +18 -18
  75. package/style/define/defineThemeVars.scss +3 -0
  76. package/style/define/get-var.scss +13 -0
  77. package/style/index.scss +3 -0
  78. package/style/readme.txt +1 -1
  79. package/style/theme-dark.scss +38 -0
  80. package/style/theme-default.scss +191 -0
  81. package/style/utils/font-family.scss +37 -0
  82. package/style/utils/getThemingRootClass.scss +3 -0
  83. package/style/utils/h.scss +34 -0
  84. package/style/utils/margin.scss +33 -0
  85. package/style/utils/no-border.scss +10 -0
  86. package/style/utils/padding.scss +33 -0
  87. package/style/utils/panel.scss +36 -0
  88. package/style/utils/screen.scss +139 -0
  89. package/style/utils/stretch.scss +3 -0
  90. package/style/utils/text-style.scss +32 -0
  91. package/style/utils/transition.scss +9 -0
  92. package/{jsx/Utils → utils}/abs.js +2 -2
  93. package/{jsx/Collapse → utils}/collapse.js +2 -2
  94. package/utils/css.js +56 -0
  95. package/utils/display.js +2 -0
  96. package/utils/get.js +24 -0
  97. package/{jsx/Utils → utils}/isCompact.js +1 -1
  98. package/utils/navbar.js +28 -0
  99. package/utils/parentDOM.js +21 -0
  100. package/utils/style.js +15 -0
  101. package/{jsx/Utils → utils}/theme.js +1 -1
  102. package/{jsx/Utils → utils}/timer.js +15 -10
  103. package/jsx/Container/Col.jsx +0 -24
  104. /package/style/{all.scss → arch/all.scss} +0 -0
  105. /package/{jsx/Utils → utils}/DOM.js +0 -0
  106. /package/{jsx/Utils → utils}/areaDOM.js +0 -0
  107. /package/{jsx/Utils → utils}/childDOM.js +0 -0
  108. /package/{jsx/Utils → utils}/filter.js +0 -0
  109. /package/{jsx/Utils → utils}/getId.js +0 -0
  110. /package/{jsx/Utils → utils}/isMobile.js +0 -0
  111. /package/{jsx/Utils → utils}/map.js +0 -0
  112. /package/{jsx/Utils → utils}/mouse.js +0 -0
  113. /package/{jsx/Utils → utils}/onResizeScreen.js +0 -0
  114. /package/{jsx/Utils → utils}/screen.js +0 -0
  115. /package/{jsx/Utils → utils}/size.js +0 -0
  116. /package/{jsx/Utils → utils}/throttle.js +0 -0
  117. /package/{jsx/Utils → utils}/translate.js +0 -0
@@ -0,0 +1,191 @@
1
+ @use "sass:map";
2
+ @use 'sass:meta';
3
+ @use "sass:color";
4
+ @use "sass:list";
5
+ @use './define/defineThemeVars.scss';
6
+
7
+
8
+
9
+ $defaults:(
10
+ 'primary':#0D6EFD,
11
+ 'secondary':#868e94,
12
+ 'success':#008b14,
13
+ 'danger':#C32F3D,
14
+ 'warning':#FF8A00,
15
+ 'info':#2C7BE5,
16
+ 'light':#EDF2F9,
17
+ 'dark':#0B1727,
18
+
19
+ 'red':#ff0000,
20
+ 'green':#008b14,
21
+ 'blue':#0D6EFD,
22
+ 'white':#FFFFFF,
23
+ 'black':#000000,
24
+ 'gray':#808080,
25
+ 'orange':#FF8A00,
26
+
27
+ 'bg':#F5F7FA,
28
+ 'color':#5E6E82,
29
+ 'color-high':#282f38,
30
+ 'color-down':#e8edf3,
31
+
32
+ 'size':32px,
33
+ 'gap':5px,
34
+ 'margin':2px,
35
+ 'padding':2px,
36
+ 'radius':0.25rem,
37
+ 'font-size':14px,
38
+ 'font-family':font-family('verdana'),
39
+ 'outline-width':2px,
40
+
41
+ 'hovering':0.95,
42
+
43
+ 'highlight':#2C7BE5,
44
+ 'high':#fdfdfd,
45
+ 'label':#5E6E82,
46
+ 'border':#CBD0DD,
47
+ 'outline':#CADEF8,
48
+ 'hover':#d9e0eb,
49
+ 'hover-color':#73777e,
50
+ 'select':#2C7BE5,
51
+ 'select-color':#FFFFFF,
52
+ 'header':#dee5ef,
53
+ 'deep':#FFFFFF,
54
+ 'transparent':rgba(0, 0, 0, 0),
55
+ //'block':#F5F7FA,
56
+ 'block':#FDFDFD,
57
+
58
+ 'alert':#ff0000,
59
+ 'url':#2C7BE5,
60
+
61
+ 'toggle':#e9edf1,
62
+ 'group':#F5F7FA,
63
+
64
+ 'colors-to-rgb':(
65
+ 'primary',
66
+ 'secondary',
67
+ 'success',
68
+ 'danger',
69
+ 'warning',
70
+ 'info',
71
+ 'light',
72
+ 'dark',
73
+
74
+ 'red',
75
+ 'green',
76
+ 'blue',
77
+ 'white',
78
+ 'black',
79
+ 'gray',
80
+ 'orange',
81
+ 'color',
82
+ 'bg',
83
+ 'border'
84
+ )
85
+ );
86
+
87
+ $wd-default-theme:'light';
88
+ $global-themes-vars:();
89
+
90
+
91
+ @mixin defineThemeVars($maps:(),$theme:$wd-default-theme){
92
+ $themeVars:();
93
+ //@debug $theme , $wd-default-theme;
94
+ @each $varName,$defaultValue in $defaults{
95
+
96
+ @if ($varName != 'colors-to-rgb'){
97
+ $value:if(map.has-key($map: $maps, $key: $varName),#{map.get($map: $maps, $key:$varName )},#{$defaultValue});
98
+
99
+ @if($theme == $wd-default-theme or #{$value} != #{$defaultValue}){
100
+ //@debug $varName, $value, $defaultValue, $theme == $wd-default-theme ,'or', $value != $defaultValue;
101
+ --v2-wd-#{$varName}:#{$value};
102
+ }
103
+ $themeVars:map.merge($themeVars,(#{$varName}:$value));
104
+ };
105
+ };
106
+
107
+
108
+
109
+ $colors:();
110
+ // @if (map-has-key($map: $defaults, $key:'colors-to-rgb' )){
111
+ @if (map.has-key($map: $defaults, $key:'colors-to-rgb' )){
112
+ $colors:list.join($colors,map.get($map:$defaults,$key:'colors-to-rgb'));
113
+ }
114
+
115
+ @if (map.has-key($map: $maps, $key:'colors-to-rgb' )){
116
+ $colors:list.join($colors,map-get($map:$maps,$key:'colors-to-rgb'));
117
+ }
118
+
119
+ //@debug $colors;
120
+
121
+ @each $varName in $colors{
122
+ $acolor:map.get($map:$defaults, $key:$varName );
123
+ @if (map.has-key($map:$maps,$key:$varName)){
124
+ $acolor:map.get($map:$maps, $key:$varName );
125
+ }
126
+
127
+
128
+ $r:color.channel($acolor, "red", $space: rgb);
129
+ $g:color.channel($acolor, "green", $space: rgb);
130
+ $b:color.channel($acolor, "blue", $space: rgb);
131
+ // $r:color.red($acolor);
132
+ // $g:color.green($acolor);
133
+ // $b:color.blue($acolor);
134
+ //--wd-#{$key}:#{meta.inspect($acolor)};
135
+ --v2-wd-#{$varName}-rgb:#{meta.inspect($r)},#{meta.inspect($g)},#{meta.inspect($b)} ;
136
+ }
137
+
138
+ $global-themes-vars:map.merge($global-themes-vars,(#{$theme}:$themeVars)) !global;
139
+ }
140
+
141
+
142
+ // define default theme
143
+ :root {
144
+ @include defineThemeVars();
145
+
146
+ --v2-wd-tick:url(#{'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAATklEQVR4nO3OMQoAIAwEwXtn/uV7tVFIocRCI8JOHbInAQDwkSrJNu6s3x41nkYjdu+ujLgajyIp8VUsNT4bkR4fiouX7Lgf8SwOADiiAWpFIUWn1ypTAAAAAElFTkSuQmCC'});
147
+ --v2-wd-cross:url(#{'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAx1JREFUaEPtmctqFUEQhk8UQXQrBNyoSNDHSOIyCzXeYjAG4y0ggs/hQgkR7xBwkbhQokZ0Iah5Cm8bXai4NLt4Af9fpg+dTt+qpjsQcaBIONNd9X9T1T01Mz2ddX70rHP9nX8eYC8y9ADWCzsLe7RGGRtHnKuwN7AjsC+huLEM7MGkl7DtzeTf+DsGm6sMMQH/d2Abmjgf8HcA9tkXNwTgijdza0OcRqDblngTNwjhAwiJrw0REh+FcAFS4mtBpMQHIVyA9xjZl1njPzHuOOxh5vjQsHM4cROWuyMuYmy/cWZP2ogfv8O2CgS1hZCKp7SPsF0+AP52EjbjWUQxJi2ERjxjHYIthAD4+ynYXSGEdHc6A/+3hDEo/hhs3r6aobqrCVFMPEFiC6cGhFb8UWj1dgGplV8Sorj4VAZMqZWAqCI+F4Dj3P4kZ6flwr4P2wI7kChX19+PZsEmm8dUCdmONZnIAXXHcLcJ1rw7WAKg3WIlECLxkhJai0yIxWsBamQiu+bbllCNTKjFt8mAAeHuxLZDupbMfJYNHxkfSxaKPVYb2PbBrW6/UgD7oUnl3L/TSgA8hZ8hpQhmjy8L1EdbgAuIfE0dvdP5hbkjMPVDURsATT/vY5W24it8aAFKiTdi1BAagNLiW0FIAWqJV0NIAM4jyo1CO1ds3YvKKRfgIiJOCcXzJnUPxnaaz7LmVWHOpsW5ozC+l40eOQCaK8/2gHfYJ010TSvOTPAtyWyMIAVQQryJXwUiBsBb/HVh2bhX3r14xSFCAJcQ+Uph8VUy4QPQij8Mhd03Zom1VywTLgB7m2nhlV/G+GHYs9SO4ZzXvChg78TNofuwbwNswokl2GaBEIo/CHsumGMP1UB8goOdxombAX6T4nexnKOteBNDCsHPXvtCACR7ZRMGSLjbSGo+dUFy18Q7OBqEdT/6+RZxCqK0eAOXglglnhND2+gOnHvtyUQt8SkIih+AfXVTGbuRuRC1xYcg3jZls0p8LAPG2W78w15kG4x35hepYi50/gT8XIZxU2FT9y3kN9ULFdJTz81/gHrXNs/zH1jFyDG0YnaaAAAAAElFTkSuQmCC'});
148
+ --v2-wd-cross-hover:url(#{'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAB40lEQVR4nO2ZsU7DMBCGPxATK0gIBpBYkGBn6gJCAjGx0gfsgBBLFzaEVNE3AHVApCy8BgN2ZdI4se/slND+m93m7v+U2D7bsNJKKq3V/XjcmwCcAjvA8HV01IYnm/cGeAMmdXm9ACbIJbDldA9yQ5i8fafrExj58lYCeMxbZYOoMG/lhZgDaDBvlRyixrxVJcQvgEDzVskgAsxbzUGsl/7QI8w8QN8kVinCPMA+cOh2zABMoL3I/CqISPNWB25jBmBey53AhwhCaB7gyW34BrEkcPCYSJmjbhrNApE6dtNClhQiR8yQUiJJwlxvtRYgVeKcn2QjgNLAPbAJXAueDZoUggBABSFR8IwWDACtQUSVKFEAkB0iur6KBoBsEKLiUAQAySHEla0YAJJBqMrycjkdJZP4URFCvadQARhtJIghlgrAfEIXihDqTdFyDuJOT6OdXsg6XUr81WIuaBbS1PPAg+C54Nnpf29oOr2l7PSmvtPHKp0+2GrDfOpc5cPdW23AUJlnBoJ8526jfLhbRAZT1fNCiHe3UV7IxsBXYKAkFxyREAUwdTt8g/gM2K0JtIgrpgJ4iTmd9kEs4pKvoMI8NC9kZYhFXLN+AGPN6fQJsA08t3zRfcXPRfe0rbwrLaW+Ab09DMLFyhacAAAAAElFTkSuQmCC'});
149
+
150
+
151
+ &.mobile{
152
+ --v2-wd-size:8.5vmin;
153
+ --v2-wd-font-size:4vmin;
154
+ --v2-wd-gap:1vmin;
155
+ --v2-wd-margin:calc(1vmin*0.5);
156
+ --v2-wd-padding:calc(1vmin*0.5);
157
+ }
158
+
159
+ }
160
+
161
+ $wd-bootstrap-maps:(
162
+ 'primary',
163
+ 'danger',
164
+ 'secondary',
165
+ 'success',
166
+ 'warning',
167
+ 'info',
168
+ 'light',
169
+ 'dark',
170
+ );
171
+
172
+ @each $key in $wd-bootstrap-maps{
173
+ .wd-#{$key}{
174
+ background-color: var(--v2-wd-#{$key});
175
+ @if (#{$key} !='light'){
176
+ color: var(--v2-wd-color-down);
177
+ }
178
+ &.wd-flat{
179
+ background-color:rgba(0,0,0,0);
180
+ //border: 1px solid var(--v2-wd-#{$key}) !important;
181
+ color: var(--v2-wd-#{$key});
182
+ }
183
+ &.only-text{
184
+ color: var(--v2-wd-#{$key});
185
+ }
186
+ }
187
+ .wd-#{$key}-color{
188
+ color: var(--v2-wd-#{$key});
189
+ }
190
+
191
+ }
@@ -0,0 +1,37 @@
1
+ @use 'sass:map';
2
+
3
+ $wd-fonts-family:(
4
+ 'arial':'Arial, sans-serif',
5
+ 'arial-black':'Arial Black, sans-serif',
6
+ 'comic':'Comic Sans MS, cursive',
7
+ 'courier':'Courier New, monospace',
8
+ 'franklin':'Franklin Gothic Medium, sans-serif',
9
+ 'gothic':'Franklin Gothic Medium, sans-serif',
10
+ 'georgia':'Georgia, serif',
11
+ 'impact':'Impact, sans-serif',
12
+ 'lucida':'Lucida Console, monospace',
13
+ 'console':'Lucida Console, monospace',
14
+ 'ms':'Microsoft Sans Serif, sans-serif',
15
+ 'palatino':'Palatino Linotype, serif',
16
+ 'sylfaen':'Sylfaen, serif',
17
+ 'tahoma':'Tahoma, sans-serif',
18
+ 'times':'Times New Roman, serif',
19
+ 'trebuchet':'Trebuchet MS, sans-serif',
20
+ 'verdana':'Verdana, sans-serif',
21
+ 'roboto':'Roboto, sans-serif'
22
+ );
23
+
24
+ //@include font-family('arial');
25
+ @function font-family($name:'roboto'){
26
+
27
+ @if map.has_key($wd-fonts-family,$name) {
28
+ @return #{map.get($wd-fonts-family, $name)};
29
+ }@else{
30
+ @debug --------------------------------------;
31
+ @warn 'font not exists ' $name ' set roboto';
32
+ @debug --------------------------------------;
33
+ @return #{map.get($wd-fonts-family, 'roboto')};
34
+
35
+ }
36
+
37
+ }
@@ -0,0 +1,3 @@
1
+ @function getThemingRootClass($theme){
2
+ @return if($theme!=$wd-default-theme,':root.'+$theme,':root');
3
+ }
@@ -0,0 +1,34 @@
1
+
2
+ [h1],h1,.h1{
3
+ font-size:1.6rem;
4
+ }
5
+
6
+ [h2],h2,.h2{
7
+ font-size: 1.5rem;
8
+ }
9
+
10
+ [h3],h3,.h3{
11
+ font-size: 1.2rem;
12
+ }
13
+
14
+ [h4],h4,.h4{
15
+ font-size: 1rem;
16
+ }
17
+
18
+ [h5],h5,.h5{
19
+ font-size: 0.8rem;
20
+ }
21
+
22
+ [h6],h6,.h6{
23
+ font-size: 0.7rem;
24
+ }
25
+
26
+ [h1],[h2],[h3],[h4],[h5],[h6],
27
+ h1,h2,h3,h4,h5,h6,
28
+ .h1,.h2,.h3,.h4,.h5,.h6{
29
+ padding: 0px;
30
+ margin: 0px;
31
+ text-shadow: 0px 0px 1px var(--v2-wd-color-high);
32
+ font-weight: normal;
33
+ color:var(--v2-wd-color-high);
34
+ }
@@ -0,0 +1,33 @@
1
+ [mg],.mg{
2
+ margin:var(--v2-wd-gap);
3
+ }
4
+
5
+ [mg0],.mg0{
6
+ margin:0px;
7
+ }
8
+
9
+ [mgl],.mgl{
10
+ margin-left:var(--v2-wd-gap);
11
+ }
12
+
13
+ [mgr],.mgr{
14
+ margin-right:var(--v2-wd-gap);
15
+ }
16
+
17
+ [mglr],.mglr{
18
+ margin-left:var(--v2-wd-gap);
19
+ margin-right:var(--v2-wd-gap);
20
+ }
21
+
22
+ [mgt],.mgt{
23
+ margin-top:var(--v2-wd-gap);
24
+ }
25
+
26
+ [mgb],.mgb{
27
+ margin-bottom:var(--v2-wd-gap);
28
+ }
29
+
30
+ [mgtb],.mgtb{
31
+ margin-top:var(--v2-wd-gap);
32
+ margin-bottom:var(--v2-wd-gap);
33
+ }
@@ -0,0 +1,10 @@
1
+ @mixin no-border{
2
+ border-color: rgba(0,0,0,0);
3
+ }
4
+
5
+ .no-border{
6
+ @include no-border;
7
+ &.wd-flat{
8
+ @include no-border;
9
+ }
10
+ }
@@ -0,0 +1,33 @@
1
+ [pd],.pd{
2
+ padding:var(--v2-wd-gap);
3
+ }
4
+
5
+ [pd0],.pd0{
6
+ padding:0px;
7
+ }
8
+
9
+ [pdl],.pdl{
10
+ padding-left:var(--v2-wd-gap);
11
+ }
12
+
13
+ [pdr],.pdr{
14
+ padding-right:var(--v2-wd-gap);
15
+ }
16
+
17
+ [pdlr],.pdlr{
18
+ padding-left:var(--v2-wd-gap);
19
+ padding-right:var(--v2-wd-gap);
20
+ }
21
+
22
+ [pdt],.pdt{
23
+ padding-top:var(--v2-wd-gap);
24
+ }
25
+
26
+ [pdb],.pdb{
27
+ padding-bottom:var(--v2-wd-gap);
28
+ }
29
+
30
+ [pdtb],.pdtb{
31
+ padding-top:var(--v2-wd-gap);
32
+ padding-bottom:var(--v2-wd-gap);
33
+ }
@@ -0,0 +1,36 @@
1
+ .wd-panel{
2
+ overflow: hidden;
3
+ min-height: calc(var(--v2-wd-size) + 4px);
4
+
5
+ display: -webkit-flex;
6
+ display: flex;
7
+ -webkit-flex-direction: row;
8
+ flex-direction: row;
9
+ -webkit-flex-wrap: nowrap;
10
+ flex-wrap: nowrap;
11
+ -webkit-justify-content: flex-start;
12
+ justify-content: flex-start;
13
+ -webkit-align-content: center;
14
+ align-content: center;
15
+ -webkit-align-items: center;
16
+ align-items: center;
17
+
18
+ &[filled]{
19
+ -webkit-justify-content: flex-start;
20
+ justify-content: flex-start;
21
+ -webkit-align-content: stretch;
22
+ align-content: stretch;
23
+ -webkit-align-items: stretch;
24
+ align-items: stretch;
25
+ }
26
+ &[center]{
27
+ -webkit-justify-content: center;
28
+ justify-content: center;
29
+ }
30
+ &[right]{
31
+ -webkit-justify-content: flex-end;
32
+ justify-content: flex-end;
33
+ }
34
+ }
35
+
36
+
@@ -0,0 +1,139 @@
1
+ $wd-large-width:900px;
2
+ $wd-middle-width:700px;
3
+ $wd-small-width:500px;
4
+
5
+ $wd-xs: 0;
6
+ $wd-sm: 576px;//mobile
7
+ $wd-md: 768px;
8
+ $wd-lg: 992px;//compact
9
+ $wd-xl: 1200px;
10
+ $wd-xxl: 1400px;
11
+
12
+ $wd-widths:('small':$wd-small-width,'middle':$wd-middle-width,'large':$wd-small-width);
13
+
14
+
15
+ @mixin less-large{
16
+ @media screen and (width <= $wd-large-width) {
17
+ @content;
18
+ }
19
+ }
20
+
21
+ @mixin less-middle{
22
+ @media screen and ( width <= $wd-middle-width) {
23
+ @content;
24
+ }
25
+ }
26
+
27
+ @mixin less-small{
28
+ @media screen and ( width <= $wd-small-width) {
29
+ @content;
30
+ }
31
+ }
32
+
33
+
34
+ @mixin more-large{
35
+ @media screen and (width > $wd-large-width) {
36
+ @content;
37
+ }
38
+ }
39
+
40
+ @mixin more-middle{
41
+ @media screen and ( width > $wd-middle-width) {
42
+ @content;
43
+ }
44
+ }
45
+
46
+ @mixin more-small{
47
+ @media screen and ( width > $wd-small-width) {
48
+ @content;
49
+ }
50
+ }
51
+
52
+
53
+ .hide-less-large{
54
+ @include less-large{
55
+ display: none !important;
56
+ }
57
+ }
58
+
59
+ .hide-less-middle{
60
+ @include less-middle{
61
+ display: none !important;
62
+ }
63
+ }
64
+
65
+ .hide-less-small{
66
+ @include less-small{
67
+ display: none !important;
68
+ }
69
+ }
70
+
71
+
72
+ .hide-more-large{
73
+ @include more-large{
74
+ display: none !important;
75
+ }
76
+ }
77
+
78
+ .hide-more-middle{
79
+ @include more-middle{
80
+ display: none !important;
81
+ }
82
+ }
83
+
84
+ .hide-more-small{
85
+ @include more-small{
86
+ display: none !important;
87
+ }
88
+ }
89
+
90
+
91
+ @mixin less-than($name){
92
+
93
+ @if ($name == 'large'){
94
+ @include less-large{
95
+ @content;
96
+ }
97
+ }@else if($name == 'middle'){
98
+ @include less-middle{
99
+ @content;
100
+ }
101
+ }@else if($name == 'small'){
102
+ @include less-small{
103
+ @content;
104
+ }
105
+ }@else{
106
+ @error 'not define code for width'+$name;
107
+ }
108
+ }
109
+
110
+ @mixin more-than($name){
111
+ @if ($name == 'large'){
112
+ @include more-large{
113
+ @content;
114
+ }
115
+ }@else if($name == 'middle'){
116
+ @include more-middle{
117
+ @content;
118
+ }
119
+ }@else if($name == 'small'){
120
+ @include more-small{
121
+ @content;
122
+ }
123
+ }@else{
124
+ @error 'not define code for width'+$name;
125
+ }
126
+ }
127
+
128
+
129
+ @mixin less($width){
130
+ @media (min-width:0px) and (max-width:$width){
131
+ @content;
132
+ }
133
+ }
134
+
135
+ @mixin more($width){
136
+ @media (min-width:$width){
137
+ @content;
138
+ }
139
+ }
@@ -0,0 +1,3 @@
1
+ .stretch,[stretch]{
2
+ flex:1 1 auto;
3
+ }
@@ -0,0 +1,32 @@
1
+ //---------------------------------------------------------
2
+ @mixin bold($color:var(--v2-wd-color)){
3
+ text-shadow: 0px 0px 1px $color;
4
+ }
5
+ [bold],.bold{
6
+ @include bold();
7
+ }
8
+
9
+ @mixin no-bold(){
10
+ text-shadow: none;
11
+ }
12
+
13
+
14
+ [no-bold],.no-bold{
15
+ @include no-bold();
16
+ }
17
+
18
+ //---------------------------------------------------------
19
+ [align-center],.align-center{
20
+ text-align: center;
21
+ }
22
+ [align-left],.align-left{
23
+ text-align: left;
24
+ }
25
+ [align-right],.align-right{
26
+ text-align: right;
27
+ }
28
+
29
+ //---------------------------------------------------------
30
+ [italic],.italic{
31
+ font-style: italic;
32
+ }
@@ -0,0 +1,9 @@
1
+ //@include transition(margin 0.2s);
2
+ @mixin transition($x...){
3
+ -webkit-transition: $x;
4
+ -moz-transition: $x;
5
+ -ms-transition: $x;
6
+ -o-transition: $x;
7
+ transition: $x;
8
+ }
9
+
@@ -1,8 +1,8 @@
1
1
  export default function abs(dom) {
2
2
  const rect = dom.getBoundingClientRect();
3
3
  return {
4
- x: rect.left + window.pageXOffset,
5
- y: rect.top + window.pageYOffset,
4
+ x: rect.left + window.scrollX,
5
+ y: rect.top + window.scrollY,
6
6
  w: rect.width,
7
7
  h: rect.height,
8
8
  };
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-param-reassign */
2
- import getsize from '../Utils/size';
3
- import timer from '../Utils/timer';
2
+ import getsize from './size';
3
+ import timer from './timer';
4
4
 
5
5
  function collapse({
6
6
  dom,
package/utils/css.js ADDED
@@ -0,0 +1,56 @@
1
+ /* eslint-disable no-param-reassign */
2
+
3
+ class Css {
4
+ /** добавить несколько классов в DOM */
5
+ addClass(dom, ...classNames) {
6
+ let all = dom.className.trim();
7
+ const classes = all.split(' ');
8
+ // eslint-disable-next-line array-callback-return
9
+ classNames.map((cls) => {
10
+ if (classes.indexOf(cls) === -1) {
11
+ all = `${all} ${cls}`;
12
+ classes.push(cls);
13
+ }
14
+ });
15
+ dom.className = all.trim();
16
+ }
17
+
18
+ /** удалить класс DOM */
19
+ removeClass(dom, ...classNames) {
20
+ dom.className = dom.className.split(' ').filter((it) => (classNames.indexOf(it) === -1)).join(' ').trim();
21
+ }
22
+
23
+ /** признак, что клас установлен */
24
+ haveClass(dom, className) {
25
+ return dom.className.split(' ').indexOf(className) >= 0;
26
+ }
27
+
28
+ /** добавляет если нет и удаляет если есть */
29
+ toggleClass(dom, className) {
30
+ if (this.haveClass(dom, className)) {
31
+ this.removeClass(dom, className);
32
+ } else {
33
+ this.addClass(dom, className);
34
+ }
35
+ }
36
+
37
+ /** если bool == true добаляет список классов classesOnTrue и удаляет classesOnFalse
38
+ * если bool == false добаляет список классов classesOnFalse и удаляет classesOnTrue
39
+ */
40
+ switchClass(dom, bool, classesOnTrue, classesOnFalse = []) {
41
+ if (bool) {
42
+ this.removeClass(dom, ...classesOnFalse);
43
+ this.addClass(dom, ...classesOnTrue);
44
+ } else {
45
+ this.removeClass(dom, ...classesOnTrue);
46
+ this.addClass(dom, ...classesOnFalse);
47
+ }
48
+ }
49
+
50
+ /** список классов как массив */
51
+ classes(dom) {
52
+ return dom.className.split(' ');
53
+ }
54
+ }
55
+
56
+ export default new Css();
@@ -0,0 +1,2 @@
1
+ /** возвращает свойство display только в с */
2
+ export default (need) => (need ? {} : { display: 'none' });
package/utils/get.js ADDED
@@ -0,0 +1,24 @@
1
+ export default function get(data, arrayOfName, defalt = false) {
2
+ let obj = data;
3
+
4
+ if (obj === undefined) {
5
+ return defalt;
6
+ }
7
+
8
+ try {
9
+ let nameOrIndex;
10
+ if (arrayOfName.length) {
11
+ for (let i = 0; i < arrayOfName.length; i++) {
12
+ nameOrIndex = obj[arrayOfName[i]];
13
+ if (nameOrIndex === undefined) {
14
+ return defalt;
15
+ }
16
+ obj = nameOrIndex;
17
+ }
18
+ return obj;
19
+ }
20
+ } catch (e) {
21
+ return defalt;
22
+ }
23
+ return defalt;
24
+ }
@@ -1,4 +1,4 @@
1
1
  import screen from './screen';
2
- import global from '../global';
2
+ import global from '../jsx/global';
3
3
 
4
4
  export default () => screen().width <= global.wd_middle_width;