neo.mjs 4.3.0 → 4.3.2

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 (44) hide show
  1. package/apps/website/view/MainContainer.mjs +1 -0
  2. package/apps/website/view/MainContainerController.mjs +7 -0
  3. package/apps/website/view/blog/List.mjs +41 -3
  4. package/apps/website/view/examples/List.mjs +28 -3
  5. package/apps/website/view/examples/TabContainer.mjs +7 -4
  6. package/apps/website/view/home/DeveloperIntroComponent.mjs +227 -225
  7. package/apps/website/view/home/ExecutiveIntroComponent.mjs +242 -240
  8. package/buildScripts/addConfig.mjs +1 -0
  9. package/examples/tab/container/MainContainer.mjs +78 -5
  10. package/package.json +1 -1
  11. package/resources/scss/src/apps/website/blog/List.scss +2 -2
  12. package/resources/scss/src/apps/website/examples/List.scss +2 -2
  13. package/resources/scss/src/apps/website/home/TabContainer.scss +6 -1
  14. package/resources/scss/src/button/Base.scss +10 -8
  15. package/resources/scss/src/calendar/view/calendars/ColorsList.scss +5 -2
  16. package/resources/scss/src/component/Label.scss +2 -1
  17. package/resources/scss/src/form/field/Radio.scss +6 -4
  18. package/resources/scss/src/form/field/Text.scss +4 -3
  19. package/resources/scss/src/layout/Card.scss +6 -10
  20. package/resources/scss/src/list/Base.scss +11 -3
  21. package/resources/scss/src/tab/Container.scss +2 -1
  22. package/resources/scss/src/tab/header/Toolbar.scss +1 -1
  23. package/resources/scss/src/table/Container.scss +3 -1
  24. package/resources/scss/src/toolbar/Base.scss +69 -3
  25. package/resources/scss/src/tree/List.scss +11 -1
  26. package/resources/scss/theme-dark/button/Base.scss +4 -0
  27. package/resources/scss/theme-light/button/Base.scss +4 -0
  28. package/src/calendar/view/calendars/ColorsList.mjs +18 -0
  29. package/src/calendar/view/calendars/EditContainer.mjs +7 -9
  30. package/src/component/Base.mjs +184 -114
  31. package/src/container/Base.mjs +3 -3
  32. package/src/draggable/toolbar/DragZone.mjs +5 -6
  33. package/src/form/field/Text.mjs +3 -1
  34. package/src/layout/Base.mjs +5 -7
  35. package/src/layout/Card.mjs +32 -35
  36. package/src/layout/Fit.mjs +11 -11
  37. package/src/layout/Flexbox.mjs +32 -40
  38. package/src/layout/HBox.mjs +1 -1
  39. package/src/layout/VBox.mjs +1 -1
  40. package/src/list/Base.mjs +27 -5
  41. package/src/tab/Container.mjs +11 -11
  42. package/src/tab/header/Button.mjs +2 -2
  43. package/src/table/Container.mjs +11 -3
  44. package/src/tree/List.mjs +4 -0
@@ -13,7 +13,8 @@ class MainContainer extends ConfigurationViewport {
13
13
  static getConfig() {return {
14
14
  className : 'Neo.examples.tab.container.MainContainer',
15
15
  autoMount : true,
16
- configItemLabelWidth: 130,
16
+ configItemLabelWidth: 160,
17
+ configItemWidth : 280,
17
18
  layout : {ntype: 'hbox', align: 'stretch'}
18
19
  }}
19
20
 
@@ -121,6 +122,45 @@ class MainContainer extends ConfigurationViewport {
121
122
  labelText: 'Tab 1 text',
122
123
  listeners: {change: me.onFirstTabHeaderConfigChange.bind(me, 'text')},
123
124
  value : me.getFirstTabHeader().text
125
+ }, {
126
+ module : Radio,
127
+ checked : me.getBadgeTabHeader().badgePosition === 'bottom-left',
128
+ hideValueLabel: false,
129
+ labelText : 'badgePosition',
130
+ listeners : {change: me.onBadgeRadioChange.bind(me, 'badgePosition', 'bottom-left')},
131
+ name : 'badgePosition',
132
+ style : {marginTop: '50px'},
133
+ valueLabelText: 'bottom-left'
134
+ }, {
135
+ module : Radio,
136
+ checked : me.getBadgeTabHeader().badgePosition === 'bottom-right',
137
+ hideValueLabel: false,
138
+ labelText : '',
139
+ listeners : {change: me.onBadgeRadioChange.bind(me, 'badgePosition', 'bottom-right')},
140
+ name : 'badgePosition',
141
+ valueLabelText: 'bottom-right'
142
+ }, {
143
+ module : Radio,
144
+ checked : me.getBadgeTabHeader().badgePosition === 'top-left',
145
+ hideValueLabel: false,
146
+ labelText : '',
147
+ listeners : {change: me.onBadgeRadioChange.bind(me, 'badgePosition', 'top-left')},
148
+ name : 'badgePosition',
149
+ valueLabelText: 'top-left'
150
+ }, {
151
+ module : Radio,
152
+ checked : me.getBadgeTabHeader().badgePosition === 'top-right',
153
+ hideValueLabel: false,
154
+ labelText : '',
155
+ listeners : {change: me.onBadgeRadioChange.bind(me, 'badgePosition', 'top-right')},
156
+ name : 'badgePosition',
157
+ valueLabelText: 'top-right'
158
+ }, {
159
+ module : TextField,
160
+ labelText: 'badgeText',
161
+ listeners: {change: me.onBadgeConfigChange.bind(me, 'badgeText')},
162
+ style : {marginTop: '10px'},
163
+ value : me.getBadgeTabHeader().badgeText
124
164
  }];
125
165
  }
126
166
 
@@ -158,11 +198,17 @@ class MainContainer extends ConfigurationViewport {
158
198
  }
159
199
 
160
200
  /**
161
- * @param {String} config
162
- * @param {Object} opts
201
+ * @returns {Neo.tab.header.Button}
163
202
  */
164
- onFirstTabHeaderConfigChange(config, opts) {
165
- this.exampleComponent.getTabBar().items[0][config] = opts.value;
203
+ getBadgeTabHeader() {
204
+ let tabHeaders = this.exampleComponent.getTabBar().items,
205
+ item
206
+
207
+ for (item of tabHeaders) {
208
+ if (item.text === 'Tab 3') {
209
+ return item;
210
+ }
211
+ }
166
212
  }
167
213
 
168
214
  /**
@@ -172,6 +218,33 @@ class MainContainer extends ConfigurationViewport {
172
218
  return this.exampleComponent.getTabBar().items[0];
173
219
  }
174
220
 
221
+ /**
222
+ * @param {String} config
223
+ * @param {Object} opts
224
+ */
225
+ onBadgeConfigChange(config, opts) {
226
+ this.getBadgeTabHeader()[config] = opts.value;
227
+ }
228
+
229
+ /**
230
+ * @param {String} config
231
+ * @param {String} value
232
+ * @param {Object} opts
233
+ */
234
+ onBadgeRadioChange(config, value, opts) {
235
+ if (opts.value === true) { // we only want to listen to check events, not uncheck
236
+ this.getBadgeTabHeader()[config] = value;
237
+ }
238
+ }
239
+
240
+ /**
241
+ * @param {String} config
242
+ * @param {Object} opts
243
+ */
244
+ onFirstTabHeaderConfigChange(config, opts) {
245
+ this.exampleComponent.getTabBar().items[0][config] = opts.value;
246
+ }
247
+
175
248
  /**
176
249
  * @param {Object} data
177
250
  * @param {Neo.component.Base} data.component
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "4.3.0",
3
+ "version": "4.3.2",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,4 +1,4 @@
1
- .website-blog-list.neo-list-container.neo-list {
1
+ .website-blog-list.neo-list {
2
2
  transition: padding v(website-transition-duration) ease-out;
3
3
 
4
4
  .neo-list-item {
@@ -180,4 +180,4 @@
180
180
  width : 44px;
181
181
  }
182
182
  }
183
- }
183
+ }
@@ -1,4 +1,4 @@
1
- .website-examples-list.neo-list-container.neo-list {
1
+ .website-examples-list.neo-list {
2
2
  transition: padding v(website-transition-duration) ease-out;
3
3
 
4
4
  .neo-list-item {
@@ -154,4 +154,4 @@
154
154
  margin-top: 20px;
155
155
  }
156
156
  }
157
- }
157
+ }
@@ -8,8 +8,13 @@
8
8
  flex : auto !important;
9
9
  font-weight: 400;
10
10
  overflow-y : auto;
11
+ position : relative;
11
12
  word-break : break-word;
12
13
 
14
+ .neo-absolute {
15
+ position: absolute;
16
+ }
17
+
13
18
  a {
14
19
  color: #1c60a0;
15
20
  }
@@ -109,4 +114,4 @@
109
114
  }
110
115
  }
111
116
  }
112
- }
117
+ }
@@ -64,27 +64,29 @@
64
64
  color : v(button-badge-color);
65
65
  margin-left : auto;
66
66
  padding : 3px;
67
+ pointer-events : none;
67
68
  position : absolute;
69
+ user-select : none;
68
70
  z-index : 2;
69
71
 
70
72
  &.neo-bottom-left {
71
- bottom: -10px;
72
- left : -10px;
73
+ bottom: v(button-badge-margin-top);
74
+ left : v(button-badge-margin-left);
73
75
  }
74
76
 
75
77
  &.neo-bottom-right {
76
- bottom: -10px;
77
- right : -10px;
78
+ bottom: v(button-badge-margin-top);
79
+ right : v(button-badge-margin-left);
78
80
  }
79
81
 
80
82
  &.neo-top-left {
81
- left: -10px;
82
- top : -10px;
83
+ left: v(button-badge-margin-left);
84
+ top : v(button-badge-margin-top);
83
85
  }
84
86
 
85
87
  &.neo-top-right {
86
- right: -10px;
87
- top : -10px;
88
+ right: v(button-badge-margin-left);
89
+ top : v(button-badge-margin-top);
88
90
  }
89
91
  }
90
92
 
@@ -1,4 +1,6 @@
1
1
  .neo-calendars-colors-list {
2
+ overflow: visible;
3
+
2
4
  &:focus {
3
5
  outline: none;
4
6
  }
@@ -7,11 +9,12 @@
7
9
  border-radius: 50%;
8
10
  display : inline-block;
9
11
  height : 1.5em;
10
- margin-right : 0.3em;
12
+ margin : 0.3em 0.3em 0.3em 0;
13
+ transition : box-shadow .2s;
11
14
  width : 1.5em;
12
15
 
13
16
  &.neo-selected {
14
- box-shadow: 0 0 0 3px currentColor;
17
+ box-shadow: 0 0 0 0.25em currentColor;
15
18
  }
16
19
  }
17
20
  }
@@ -1,3 +1,4 @@
1
1
  .neo-label {
2
+ user-select: none;
2
3
  white-space: nowrap;
3
- }
4
+ }
@@ -26,11 +26,13 @@
26
26
  }
27
27
 
28
28
  .neo-radio-label {
29
- color : v(textfield-label-color);
30
- display: inline-block;
29
+ color : v(textfield-label-color);
30
+ display : inline-block;
31
+ user-select: none;
31
32
  }
32
33
 
33
34
  .neo-radio-value-label {
34
- color: v(textfield-label-color);
35
+ color : v(textfield-label-color);
36
+ user-select: none;
35
37
  }
36
- }
38
+ }
@@ -232,8 +232,9 @@
232
232
  }
233
233
 
234
234
  .neo-textfield-label {
235
- color : v(textfield-label-color);
236
- display: inline-block;
237
- flex : 0 0 auto;
235
+ color : v(textfield-label-color);
236
+ display : inline-block;
237
+ flex : 0 0 auto;
238
+ user-select: none;
238
239
  }
239
240
  }
@@ -1,16 +1,12 @@
1
1
  .neo-layout-card {
2
2
  display : flex;
3
3
  align-items: stretch;
4
- }
5
-
6
- .neo-layout-card-item {
7
- flex: 1 0 100%;
8
4
 
9
- &.active-item {
5
+ > * {
6
+ flex: 1 0 100%;
10
7
 
8
+ &.neo-inactive-item {
9
+ display: none !important;
10
+ }
11
11
  }
12
-
13
- &.inactive-item {
14
- display: none !important;
15
- }
16
- }
12
+ }
@@ -1,7 +1,8 @@
1
- .neo-list-container {
1
+ .neo-list-wrapper {
2
2
  background-color: v(list-container-background-color);
3
3
  border : v(list-container-border);
4
- overflow : auto;
4
+ overflow : hidden;
5
+ position : relative;
5
6
  }
6
7
 
7
8
  .neo-list {
@@ -12,6 +13,7 @@
12
13
  margin-inline-start : 0;
13
14
  margin-inline-end : 0;
14
15
  padding-inline-start: 0;
16
+ overflow : auto;
15
17
 
16
18
  &.neo-use-checkicons {
17
19
  .neo-list-item:before {
@@ -28,6 +30,12 @@
28
30
  }
29
31
  }
30
32
 
33
+ &.neo-use-wrapper-node {
34
+ height : 100%;
35
+ position: absolute;
36
+ width : 100%;
37
+ }
38
+
31
39
  .neo-list-item {
32
40
  background-color: v(list-item-background-color);
33
41
  cursor : pointer;
@@ -51,4 +59,4 @@
51
59
  color: v(list-item-highlight-search-color);
52
60
  }
53
61
  }
54
- }
62
+ }
@@ -29,7 +29,8 @@
29
29
  }
30
30
 
31
31
  .neo-tab-content-container {
32
- border: v(tab-container-content-border);
32
+ border : v(tab-container-content-border);
33
+ overflow: hidden;
33
34
  }
34
35
 
35
36
  .neo-tab-header-toolbar {
@@ -62,4 +62,4 @@
62
62
  animation-duration: 0ms !important;
63
63
  }
64
64
  }
65
- }
65
+ }
@@ -1,5 +1,6 @@
1
1
  .neo-table-wrapper {
2
2
  overflow: auto;
3
+ position: relative;
3
4
  height : 100%;
4
5
  }
5
6
 
@@ -12,6 +13,7 @@
12
13
  font-weight : 400;
13
14
  line-height : 19px;
14
15
  overflow : auto;
16
+ position : absolute;
15
17
 
16
18
  tr {
17
19
  height : 32px !important;
@@ -118,4 +120,4 @@
118
120
  }
119
121
  }
120
122
 
121
- #myTableContainer ::-webkit-scrollbar-track:horizontal {margin-left: 400px;}
123
+ #myTableContainer ::-webkit-scrollbar-track:horizontal {margin-left: 400px;}
@@ -24,12 +24,45 @@
24
24
  }
25
25
  }
26
26
 
27
+ .neo-button-badge {
28
+ transform : rotate(180deg);
29
+ writing-mode: vertical-rl;
30
+
31
+ &.neo-bottom-left {
32
+ bottom: v(button-badge-margin-top);
33
+ left : unset;
34
+ right : v(button-badge-margin-left);
35
+ top : unset;
36
+ }
37
+
38
+ &.neo-bottom-right {
39
+ bottom: unset;
40
+ left : unset;
41
+ right : v(button-badge-margin-left);
42
+ top : v(button-badge-margin-top);
43
+ }
44
+
45
+ &.neo-top-left {
46
+ bottom: v(button-badge-margin-top);
47
+ left : v(button-badge-margin-left);
48
+ right : unset;
49
+ top : unset;
50
+ }
51
+
52
+ &.neo-top-right {
53
+ bottom: unset;
54
+ left : v(button-badge-margin-left);
55
+ right : unset;
56
+ top : v(button-badge-margin-top);
57
+ }
58
+ }
59
+
27
60
  .neo-button-glyph {
28
61
  transform: rotate(-90deg);
29
62
  }
30
63
 
31
64
  .neo-button-text {
32
- transform: rotate(180deg);
65
+ transform : rotate(180deg);
33
66
  writing-mode: vertical-rl;
34
67
  }
35
68
 
@@ -58,6 +91,38 @@
58
91
  }
59
92
  }
60
93
 
94
+ .neo-button-badge {
95
+ writing-mode: vertical-lr;
96
+
97
+ &.neo-bottom-left {
98
+ bottom: unset;
99
+ left : v(button-badge-margin-left);
100
+ right : unset;
101
+ top : v(button-badge-margin-top);
102
+ }
103
+
104
+ &.neo-bottom-right {
105
+ bottom: v(button-badge-margin-top);
106
+ left : v(button-badge-margin-left);
107
+ right : unset;
108
+ top : unset;
109
+ }
110
+
111
+ &.neo-top-left {
112
+ bottom: unset;
113
+ left : unset;
114
+ right : v(button-badge-margin-left);
115
+ top : v(button-badge-margin-top);
116
+ }
117
+
118
+ &.neo-top-right {
119
+ bottom: v(button-badge-margin-top);
120
+ left : unset;
121
+ right : v(button-badge-margin-left);
122
+ top : unset;
123
+ }
124
+ }
125
+
61
126
  .neo-button-glyph {
62
127
  transform: rotate(90deg);
63
128
  }
@@ -73,7 +138,8 @@
73
138
  }
74
139
  }
75
140
 
76
- &.neo-dock-bottom, &.neo-dock-top {
141
+ &.neo-dock-bottom,
142
+ &.neo-dock-top {
77
143
  .neo-button {
78
144
  &.icon-left {
79
145
  .neo-button-glyph {
@@ -85,4 +151,4 @@
85
151
  margin: 0 10px 0 5px;
86
152
  }
87
153
  }
88
- }
154
+ }
@@ -4,6 +4,16 @@
4
4
  display : flex;
5
5
  position: relative;
6
6
 
7
+ .neo-list {
8
+ overflow: visible;
9
+ }
10
+
11
+ .neo-list-container {
12
+ background-color: v(list-container-background-color);
13
+ border : v(list-container-border);
14
+ overflow : auto;
15
+ }
16
+
7
17
  .neo-list-folder {
8
18
  + .neo-list {
9
19
  display: none;
@@ -85,4 +95,4 @@
85
95
  content: "\f07c";
86
96
  }
87
97
  }
88
- }
98
+ }
@@ -8,6 +8,8 @@ $neoMap: map-merge($neoMap, (
8
8
  'button-background-gradient-start': #434749,
9
9
  'button-badge-background-color' : #64b5f6,
10
10
  'button-badge-color' : #282828,
11
+ 'button-badge-margin-left' : -10px,
12
+ 'button-badge-margin-top' : -10px,
11
13
  'button-border' : 1px solid #2b2b2b,
12
14
  'button-border-radius' : 0,
13
15
  'button-glyph-color' : #bbb,
@@ -38,6 +40,8 @@ $neoMap: map-merge($neoMap, (
38
40
  --button-background-gradient-start: #{neo(button-background-gradient-start)};
39
41
  --button-badge-background-color : #{neo(button-badge-background-color)};
40
42
  --button-badge-color : #{neo(button-badge-color)};
43
+ --button-badge-margin-left : #{neo(button-badge-margin-left)};
44
+ --button-badge-margin-top : #{neo(button-badge-margin-top)};
41
45
  --button-border : #{neo(button-border)};
42
46
  --button-border-radius : #{neo(button-border-radius)};
43
47
  --button-glyph-color : #{neo(button-glyph-color)};
@@ -8,6 +8,8 @@ $neoMap: map-merge($neoMap, (
8
8
  'button-background-gradient-start': #434749,
9
9
  'button-badge-background-color' : #1c60a0,
10
10
  'button-badge-color' : #fff,
11
+ 'button-badge-margin-left' : -10px,
12
+ 'button-badge-margin-top' : -10px,
11
13
  'button-border' : 1px solid #ddd,
12
14
  'button-border-radius' : 3px,
13
15
  'button-glyph-color' : #1c60a0,
@@ -38,6 +40,8 @@ $neoMap: map-merge($neoMap, (
38
40
  --button-background-gradient-start: #{neo(button-background-gradient-start)};
39
41
  --button-badge-background-color : #{neo(button-badge-background-color)};
40
42
  --button-badge-color : #{neo(button-badge-color)};
43
+ --button-badge-margin-left : #{neo(button-badge-margin-left)};
44
+ --button-badge-margin-top : #{neo(button-badge-margin-top)};
41
45
  --button-border : #{neo(button-border)};
42
46
  --button-border-radius : #{neo(button-border-radius)};
43
47
  --button-glyph-color : #{neo(button-glyph-color)};
@@ -21,6 +21,10 @@ class ColorsList extends List {
21
21
  * @member {String[]} cls=['neo-calendars-colors-list','neo-list']
22
22
  */
23
23
  cls: ['neo-calendars-colors-list', 'neo-list'],
24
+ /**
25
+ * @member {Boolean} useWrapperNode=false
26
+ */
27
+ useWrapperNode: false,
24
28
  /**
25
29
  * The list gets used as a form field, so we are adjusting the selection based on this config
26
30
  * @member {String} value_=null
@@ -63,6 +67,20 @@ class ColorsList extends List {
63
67
  }};
64
68
  }
65
69
 
70
+ /**
71
+ * @returns {Object}
72
+ */
73
+ getVdomRoot() {
74
+ return this.vdom;
75
+ }
76
+
77
+ /**
78
+ * @returns {Object}
79
+ */
80
+ getVnodeRoot() {
81
+ return this.vnode;
82
+ }
83
+
66
84
  /**
67
85
  *
68
86
  */
@@ -64,9 +64,7 @@ class EditContainer extends FormContainer {
64
64
  afterSetMounted(value, oldValue) {
65
65
  super.afterSetMounted(value, oldValue);
66
66
 
67
- if (value) {
68
- this.getField('name').focus();
69
- }
67
+ value && this.getField('name').focus();
70
68
  }
71
69
 
72
70
  /**
@@ -117,12 +115,12 @@ class EditContainer extends FormContainer {
117
115
 
118
116
  if (record) {
119
117
  me.colorsList = Neo.create({
120
- module : ColorsList,
121
- appName : me.appName,
122
- listeners: {change: me.onColorChange, scope: me},
123
- parentId : me.parentId,
124
- style : {marginTop: '0.5em'},
125
- value : record.color,
118
+ module : ColorsList,
119
+ appName : me.appName,
120
+ listeners : {change: me.onColorChange, scope: me},
121
+ parentId : me.parentId,
122
+ value : record.color,
123
+ wrapperStyle: {marginTop: '0.2em'},
126
124
  ...me.colorsListConfig
127
125
  });
128
126