neo.mjs 5.1.1 → 5.1.3

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.
@@ -419,18 +419,21 @@ fields: [{
419
419
  * (39) `if (/**/) {` if, blank char, parenthesis, blank char, curly bracket
420
420
  * (40) `for (/**/) {` for, blank char, parenthesis, blank char, curly bracket
421
421
  * (41) `switch(/**/) {` switch, parenthesis, blank char, curly bracket `// could get changed to use a blank char as well
422
- * (42) Use optional chaining => `?.` where it makes sense
422
+ * (42) `while (/**/) {` while, blank char, parenthesis, blank char, curly bracket
423
+ * (43) Use optional chaining => `?.` where it makes sense
423
424
  + Bad: `myView && myView.myFn && myView.myFn();`
424
425
  + Good: `myView?.myFn?.();`
425
426
  + https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
426
- * (43) Use method definitions (meaning avoid using the term `function`)
427
+ * (44) Use method definitions (meaning avoid using the term `function`)
427
428
  + Bad: `let obj = {a: function() {/**/}};`
428
429
  + Good: `let obj = {a() {/**/}};`
429
430
  + https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions
430
- * (44) Use shorthand property names when possible
431
+ * (45) Use shorthand property names when possible
431
432
  + Bad: `let obj = {record: record}`
432
433
  + Good: `let obj = {record};`
433
434
  + https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#property_definitions
434
- * (45) Do not use killing commas (while IE6 is luckily no longer an issue => file size)
435
- + Bad: `let obj = {a: 1,}`
435
+ * (46) Do not use killing commas (while IE6 is luckily no longer an issue => file size)
436
+ + Bad: `let obj = {a: 1,};`
437
+ + Bad: `let arr = [1,];`
436
438
  + Good: `let obj = {a: 1};`
439
+ + Good: `let arr = [1];`
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='5.1.1'
23
+ * @member {String} version='5.1.3'
24
24
  */
25
- version: '5.1.1'
25
+ version: '5.1.3'
26
26
  }
27
27
 
28
28
  /**
@@ -1,4 +1,17 @@
1
1
  [
2
+ {
3
+ "author" : "Torsten Dinkheller",
4
+ "authorImage" : "author_TorstenDinkheller.jpg",
5
+ "date" : "Feb 03, 2023",
6
+ "id" : 57,
7
+ "image" : "leveraging-overrides.jpg",
8
+ "name" : "Leveraging Overrides for Resilient Customizations and Effective Bugfixes in JavaScript Frameworks",
9
+ "provider" : "Medium",
10
+ "publisher" : "ITNEXT",
11
+ "selectedInto": [],
12
+ "type" : "Blog Post",
13
+ "url" : "https://itnext.io/leveraging-overrides-for-resilient-customizations-and-effective-bugfixes-in-javascript-frameworks-5b8ccfec0f8?source=friends_link&sk=790e868aac8b8570f0eee093adc30c00"
14
+ },
2
15
  {
3
16
  "author" : "Torsten Dinkheller",
4
17
  "authorImage" : "author_TorstenDinkheller.jpg",
@@ -74,7 +74,7 @@ function addHook(opts) {
74
74
  name = opts.name,
75
75
  len = contentArray.length,
76
76
  type = opts.type,
77
- j, methodName, nextLine,
77
+ index, j, methodName, nextLine,
78
78
 
79
79
  method = [
80
80
  '',
@@ -125,17 +125,18 @@ function addHook(opts) {
125
125
  );
126
126
 
127
127
  for (; i < len; i++) {
128
- if (contentArray[i].includes('}}')) {
128
+ if (contentArray[i].startsWith(' }')) {
129
129
  break;
130
130
  }
131
131
  }
132
132
 
133
133
  for (; i < len; i++) {
134
134
  if (contentArray[i].includes('*/')) {
135
- nextLine = contentArray[i + 1]
136
- methodName = nextLine.substring(0, nextLine.indexOf('(')).trim();
135
+ nextLine = contentArray[i + 1];
136
+ index = nextLine.indexOf('(');
137
+ methodName = index > -1 && nextLine.substring(0, index).trim();
137
138
 
138
- if (methodName === 'construct') {
139
+ if (!methodName || methodName === 'construct') {
139
140
  continue;
140
141
  }
141
142
 
@@ -324,7 +325,7 @@ if (programOpts.info) {
324
325
  for (; i < len; i++) {
325
326
  codeLine = contentArray[i];
326
327
 
327
- if (codeLine.includes(' }')) {
328
+ if (codeLine.startsWith(' }')) {
328
329
  addComma(contentArray, i - 1);
329
330
  addConfig({
330
331
  configName,
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='5.1.1'
23
+ * @member {String} version='5.1.3'
24
24
  */
25
- version: '5.1.1'
25
+ version: '5.1.3'
26
26
  }
27
27
 
28
28
  /**
@@ -1,4 +1,5 @@
1
1
  import BreadcrumbToolbar from '../../../../src/toolbar/Breadcrumb.mjs';
2
+ import Store from '../../../../src/data/Store.mjs';
2
3
  import Viewport from '../../../../src/container/Viewport.mjs';
3
4
 
4
5
  /**
@@ -16,8 +17,36 @@ class MainContainer extends Viewport {
16
17
  * @member {Object[]} items
17
18
  */
18
19
  items: [{
19
- module: BreadcrumbToolbar,
20
- flex : 'none'
20
+ module : BreadcrumbToolbar,
21
+ activeKey: 2,
22
+ flex : 'none',
23
+
24
+ store: {
25
+ module: Store,
26
+
27
+ model: {
28
+ fields: [{
29
+ name: 'id',
30
+ type: 'Integer'
31
+ }, {
32
+ name: 'name',
33
+ type: 'String'
34
+ }, {
35
+ name: 'parentId',
36
+ type: 'Integer'
37
+ }, {
38
+ name: 'route',
39
+ type: 'String'
40
+ }]
41
+ },
42
+
43
+ data: [
44
+ {id: 1, name: 'Home', parentId: null, route: '/home/'},
45
+ {id: 2, name: 'Accessibility', parentId: 1, route: '/home/accessibility/'},
46
+ {id: 3, name: 'Imprint', parentId: 1, route: '/home/imprint/'},
47
+ {id: 4, name: 'News', parentId: 1, route: '/home/news/'},
48
+ ]
49
+ }
21
50
  }],
22
51
  /**
23
52
  * @member {Object} layout={ntype:'vbox',align:'stretch'}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "5.1.1",
3
+ "version": "5.1.3",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -9,24 +9,6 @@
9
9
  }
10
10
  }
11
11
 
12
- .neo-disabled {
13
- .neo-button,
14
- &.neo-button {
15
- background-color: v(button-background-color-disabled);
16
- border-color : v(button-border-color-disabled);
17
- cursor : default;
18
- opacity : v(button-opacity-disabled);
19
-
20
- .neo-button-glyph {
21
- color: v(button-glyph-color-disabled);
22
- }
23
-
24
- .neo-button-text {
25
- color: v(button-text-color-disabled);
26
- }
27
- }
28
- }
29
-
30
12
  .neo-button {
31
13
  align-items : center;
32
14
  background-color : v(button-background-color);
@@ -37,6 +19,7 @@
37
19
  cursor : pointer;
38
20
  display : flex;
39
21
  flex-direction : row;
22
+ height : v(button-height);
40
23
  justify-content : center;
41
24
  margin : v(button-margin);
42
25
  padding : v(button-padding);
@@ -47,58 +30,6 @@
47
30
  white-space : nowrap;
48
31
  -webkit-appearance: button;
49
32
 
50
- &:active {
51
- background-color: v(button-active-background-color) !important;
52
- background-image: none !important;
53
- border-color : v(button-active-border-color);
54
- color : v(button-active-color) !important;
55
- }
56
-
57
- &:focus {
58
- outline: v(button-outline-active);
59
- }
60
-
61
- &:hover {
62
- background-color: v(button-hover-background-color);
63
- background-image: none !important;
64
- border-color : v(button-hover-border-color);
65
- color : v(button-hover-color);
66
- }
67
-
68
- &.neo-button-secondary {
69
- background-color: v(button-text-color);
70
- background-image: none;
71
-
72
- .neo-button-badge {
73
- background-color: v(button-badge-color);
74
- color : v(button-badge-background-color);
75
- }
76
-
77
- .neo-button-glyph {
78
- color: v(button-background-color);
79
- }
80
-
81
- .neo-button-text {
82
- color: v(button-background-color);
83
- }
84
- }
85
-
86
- &.neo-button-tertiary {
87
- background-color: transparent;
88
- background-image: none;
89
- border-width : 0;
90
- }
91
-
92
- &.no-text {
93
- .neo-button-glyph {
94
- margin: 0 !important;
95
- }
96
- }
97
-
98
- &.pressed {
99
- border-color: v(button-pressed-border-color);
100
- }
101
-
102
33
  .neo-button-badge {
103
34
  background-color: v(button-badge-background-color);
104
35
  border-radius : 5px;
@@ -166,6 +97,38 @@
166
97
  z-index : 2;
167
98
  }
168
99
 
100
+ &:active {
101
+ background-color: v(button-background-color-active) !important;
102
+ background-image: none !important;
103
+ border-color : v(button-border-color-active);
104
+
105
+ .neo-button-glyph {
106
+ color: v(button-glyph-color-active);
107
+ }
108
+
109
+ .neo-button-text {
110
+ color: v(button-text-color-active);
111
+ }
112
+ }
113
+
114
+ &:focus {
115
+ outline: v(button-outline-active);
116
+ }
117
+
118
+ &:hover {
119
+ background-color: v(button-background-color-hover);
120
+ background-image: none !important;
121
+ border-color : v(button-border-color-hover);
122
+
123
+ .neo-button-glyph {
124
+ color: v(button-glyph-color-hover);
125
+ }
126
+
127
+ .neo-button-text {
128
+ color: v(button-text-color-hover);
129
+ }
130
+ }
131
+
169
132
  &.icon-bottom {
170
133
  flex-direction: column-reverse;
171
134
 
@@ -189,4 +152,158 @@
189
152
  margin: 0 0 6px 0;
190
153
  }
191
154
  }
155
+
156
+ &.neo-button-secondary {
157
+ background-color: v(button-secondary-background-color);
158
+ background-image: v(button-secondary-background-image);
159
+ border : v(button-secondary-border-width) solid v(button-secondary-border-color);
160
+
161
+ .neo-button-badge {
162
+ background-color: v(button-secondary-badge-background-color);
163
+ color : v(button-secondary-badge-color);
164
+ }
165
+
166
+ .neo-button-glyph {
167
+ color: v(button-secondary-glyph-color);
168
+ }
169
+
170
+ .neo-button-ripple {
171
+ background-color: v(button-secondary-ripple-background-color);
172
+ }
173
+
174
+ .neo-button-text {
175
+ color: v(button-secondary-text-color);
176
+ }
177
+
178
+ &:active {
179
+ background-color: v(button-secondary-background-color-active) !important;
180
+ border-color : v(button-secondary-border-color-active);
181
+
182
+ .neo-button-glyph {
183
+ color: v(button-secondary-glyph-color-active);
184
+ }
185
+
186
+ .neo-button-text {
187
+ color: v(button-secondary-text-color-active);
188
+ }
189
+ }
190
+
191
+ &:hover {
192
+ background-color: v(button-secondary-background-color-hover);
193
+ border-color : v(button-secondary-border-color-hover);
194
+
195
+ .neo-button-glyph {
196
+ color: v(button-secondary-glyph-color-hover);
197
+ }
198
+
199
+ .neo-button-text {
200
+ color: v(button-secondary-text-color-hover);
201
+ }
202
+ }
203
+ }
204
+
205
+ &.neo-button-tertiary {
206
+ background-color: v(button-tertiary-background-color);
207
+ background-image: v(button-tertiary-background-image);
208
+ border : v(button-tertiary-border-width) solid v(button-tertiary-border-color);
209
+
210
+ .neo-button-badge {
211
+ background-color: v(button-tertiary-badge-background-color);
212
+ color : v(button-tertiary-badge-color);
213
+ }
214
+
215
+ .neo-button-glyph {
216
+ color: v(button-tertiary-glyph-color);
217
+ }
218
+
219
+ .neo-button-ripple {
220
+ background-color: v(button-tertiary-ripple-background-color);
221
+ }
222
+
223
+ .neo-button-text {
224
+ color: v(button-tertiary-text-color);
225
+ }
226
+
227
+ &:active {
228
+ background-color: v(button-tertiary-background-color-active) !important;
229
+ border-color : v(button-tertiary-border-color-active);
230
+
231
+ .neo-button-glyph {
232
+ color: v(button-tertiary-glyph-color-active);
233
+ }
234
+
235
+ .neo-button-text {
236
+ color: v(button-tertiary-text-color-active);
237
+ }
238
+ }
239
+
240
+ &:hover {
241
+ background-color: v(button-tertiary-background-color-hover);
242
+ border-color : v(button-tertiary-border-color-hover);
243
+
244
+ .neo-button-glyph {
245
+ color: v(button-tertiary-glyph-color-hover);
246
+ }
247
+
248
+ .neo-button-text {
249
+ color: v(button-tertiary-text-color-hover);
250
+ }
251
+ }
252
+ }
253
+
254
+ &.no-text {
255
+ .neo-button-glyph {
256
+ margin: 0 !important;
257
+ }
258
+ }
259
+
260
+ &.pressed {
261
+ border-color: v(button-pressed-border-color);
262
+ }
263
+ }
264
+
265
+ .neo-disabled {
266
+ .neo-button,
267
+ &.neo-button {
268
+ background-color: v(button-background-color-disabled);
269
+ border-color : v(button-border-color-disabled);
270
+ cursor : default;
271
+ opacity : v(button-opacity-disabled);
272
+
273
+ .neo-button-glyph {
274
+ color: v(button-glyph-color-disabled);
275
+ }
276
+
277
+ .neo-button-text {
278
+ color: v(button-text-color-disabled);
279
+ }
280
+
281
+ &.neo-button-secondary {
282
+ background-color: v(button-secondary-background-color-disabled);
283
+ border-color : v(button-secondary-border-color-disabled);
284
+ opacity : v(button-secondary-opacity-disabled);
285
+
286
+ .neo-button-glyph {
287
+ color: v(button-secondary-glyph-color-disabled);
288
+ }
289
+
290
+ .neo-button-text {
291
+ color: v(button-secondary-text-color-disabled);
292
+ }
293
+ }
294
+
295
+ &.neo-button-tertiary {
296
+ background-color: v(button-tertiary-background-color-disabled);
297
+ border-color : v(button-tertiary-border-color-disabled);
298
+ opacity : v(button-tertiary-opacity-disabled);
299
+
300
+ .neo-button-glyph {
301
+ color: v(button-tertiary-glyph-color-disabled);
302
+ }
303
+
304
+ .neo-button-text {
305
+ color: v(button-tertiary-text-color-disabled);
306
+ }
307
+ }
308
+ }
192
309
  }
@@ -2,69 +2,75 @@
2
2
  * CAROUSEL TRANSFORM
3
3
  */
4
4
  .neo-carousel {
5
- /**
6
- * VARS
7
- */
8
- --neo-carousel-translate-x: 0;
9
- --neo-carousel-translate-y: 0;
10
- --neo-carousel-transition-timing: cubic-bezier(.4,0,.2,1);
11
- --neo-carousel-duration: .7s;
5
+ /**
6
+ * VARS
7
+ */
8
+ --neo-carousel-duration : .7s;
9
+ --neo-carousel-transition-timing: cubic-bezier(.4, 0, .2, 1);
10
+ --neo-carousel-translate-x : 0;
11
+ --neo-carousel-translate-y : 0;
12
12
 
13
- .neo-carousel-inner {
14
- position: relative;
15
- overflow: hidden;
13
+ .neo-carousel-inner {
14
+ overflow: hidden;
15
+ position: relative;
16
16
 
17
- .neo-carousel-item {
18
- transition-timing-function: var(--neo-carousel-transition-timing);
19
- transition-duration: var(--neo-carousel-duration);
20
- transition-property: all;
21
- z-index: 10;
22
- inset: 0;
23
- position: absolute;
24
- transform: translate(var(--neo-carousel-translate-x), var(--neo-carousel-translate-y));
17
+ .neo-carousel-item {
18
+ inset : 0;
19
+ position : absolute;
20
+ transform : translate(var(--neo-carousel-translate-x), var(--neo-carousel-translate-y));
21
+ transition-duration : var(--neo-carousel-duration);
22
+ transition-property : all;
23
+ transition-timing-function: var(--neo-carousel-transition-timing);
24
+ z-index : 10;
25
+ }
25
26
  }
26
- }
27
27
  }
28
28
 
29
- .neo-carousel--translate-x-full{
30
- --neo-carousel-translate-x: -100%;
31
- transform: translate(var(--neo-carousel-translate-x),var(--neo-carousel-translate-y));
29
+ .neo-carousel--translate-x-full {
30
+ --neo-carousel-translate-x: -100%;
31
+
32
+ transform: translate(var(--neo-carousel-translate-x), var(--neo-carousel-translate-y));
32
33
  }
33
- .neo-carousel-translate-x-0{
34
- --neo-carousel-translate-x: 0;
35
- transform: translate(var(--neo-carousel-translate-x),var(--neo-carousel-translate-y));
34
+
35
+ .neo-carousel-translate-x-0 {
36
+ --neo-carousel-translate-x: 0;
37
+
38
+ transform: translate(var(--neo-carousel-translate-x), var(--neo-carousel-translate-y));
36
39
  }
37
- .neo-carousel-translate-x-full{
38
- --neo-carousel-translate-x: 100%;
39
- transform: translate(var(--neo-carousel-translate-x),var(--neo-carousel-translate-y));
40
+
41
+ .neo-carousel-translate-x-full {
42
+ --neo-carousel-translate-x: 100%;
43
+
44
+ transform: translate(var(--neo-carousel-translate-x), var(--neo-carousel-translate-y));
40
45
  }
41
46
 
42
47
  /**
43
48
  * BASE STYLING
44
49
  */
45
50
  .neo-carousel {
46
- padding: 15px;
47
- height: 14rem;
48
- background: var(--container-background-color);
51
+ background: var(--container-background-color);
52
+ height : 14rem;
53
+ padding : 15px;
49
54
 
50
- .neo-carousel-btn-bar {
51
- text-align: end;
55
+ .neo-carousel-btn-bar {
56
+ text-align: end;
52
57
 
53
- .neo-carousel-btn {
54
- padding: 15px;
55
- font-size: 18px;
58
+ .neo-carousel-btn {
59
+ font-size: 18px;
60
+ padding : 15px;
61
+ }
56
62
  }
57
- }
58
- .neo-carousel-inner {
59
- border-radius: 5px;
60
- height: 9rem;
61
- overflow: hidden;
62
- background-color: var(--button-active-color);
63
- color: var(--button-background-color);
64
63
 
65
- .neo-carousel-item {
66
- height: 9rem;
67
- padding: 15px;
64
+ .neo-carousel-inner {
65
+ background-color: var(--button-text-color-active);
66
+ border-radius : 5px;
67
+ color : var(--button-background-color);
68
+ height : 9rem;
69
+ overflow : hidden;
70
+
71
+ .neo-carousel-item {
72
+ height : 9rem;
73
+ padding: 15px;
74
+ }
68
75
  }
69
- }
70
76
  }
@@ -2,7 +2,7 @@
2
2
  // default styling to match buttons, since this is the most common use case
3
3
  background-color: v(button-background-color);
4
4
  background-image: v(button-background-image);
5
- border : 1px solid v(button-active-border-color);
5
+ border : 1px solid v(button-border-color-active);
6
6
 
7
7
  position: fixed;
8
8
  z-index : 1000;
@@ -18,6 +18,7 @@
18
18
  .neo-typeahead-input {
19
19
  border-color: transparent;
20
20
  color : v(selectfield-input-hint-color);
21
+ font : v(textfield-input-font);
21
22
  min-height : 25px;
22
23
  opacity : v(selectfield-input-hint-opacity);
23
24
  }
@@ -309,7 +309,6 @@
309
309
  flex-shrink : 1;
310
310
  margin : 0; // important for Safari => #1125
311
311
  min-height : v(textfield-input-height);
312
- width : 30px;
313
312
  }
314
313
  }
315
314
 
@@ -331,6 +330,7 @@
331
330
  min-width : 50px;
332
331
  padding : v(textfield-input-padding);
333
332
  transition : 250ms border-color cubic-bezier(0.4, 0, 0.2, 1);
333
+ width : 100%;
334
334
 
335
335
  &:focus {
336
336
  outline: none;
@@ -0,0 +1,17 @@
1
+ .neo-breadcrumb-toolbar {
2
+ .neo-button {
3
+ &:not(:last-child) {
4
+ margin-right: 30px;
5
+
6
+ &::after {
7
+ color : v(button-text-color);
8
+ content : "\f105";
9
+ display : block;
10
+ font-family : "Font Awesome 5 Free";
11
+ font-weight : 600;
12
+ position : absolute;
13
+ right : -20px;
14
+ }
15
+ }
16
+ }
17
+ }