neo.mjs 6.9.7 → 6.9.8

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 (89) hide show
  1. package/apps/ServiceWorker.mjs +2 -2
  2. package/apps/learnneo/neo-config.json +6 -6
  3. package/apps/learnneo/view/home/ContentTreeList.mjs +6 -8
  4. package/apps/learnneo/view/home/MainContainerController.mjs +22 -3
  5. package/docs/app/view/MainContainerController.mjs +12 -0
  6. package/examples/ServiceWorker.mjs +2 -2
  7. package/examples/button/base/neo-config.json +2 -1
  8. package/package.json +1 -1
  9. package/resources/data/learnneo/content.json +27 -0
  10. package/resources/data/learnneo/p/2023-10-01T18-29-19-158Z.md +7 -1
  11. package/resources/data/learnneo/p/2023-10-07T19-18-28-517Z.md +23 -15
  12. package/resources/data/learnneo/p/2023-10-14T19-25-08-153Z.md +15 -12
  13. package/resources/images/Neo_Vector.svg +3 -0
  14. package/resources/scss/src/apps/learnneo/Viewport.scss +9 -3
  15. package/resources/scss/src/apps/newwebsite/MainContainer.css +33 -0
  16. package/resources/scss/theme-neo-light/Global.scss +7 -0
  17. package/resources/scss/theme-neo-light/apps/covid/HeaderContainer.scss +10 -0
  18. package/resources/scss/theme-neo-light/apps/covid/country/Gallery.scss +7 -0
  19. package/resources/scss/theme-neo-light/apps/covid/country/Helix.scss +8 -0
  20. package/resources/scss/theme-neo-light/apps/covid/country/LineChartComponent.scss +3 -0
  21. package/resources/scss/theme-neo-light/apps/docs/ContentTabContainer.scss +4 -0
  22. package/resources/scss/theme-neo-light/apps/docs/HeaderContainer.scss +10 -0
  23. package/resources/scss/theme-neo-light/apps/docs/MainContainer.scss +3 -0
  24. package/resources/scss/theme-neo-light/apps/docs/classdetails/HeaderComponent.scss +4 -0
  25. package/resources/scss/theme-neo-light/apps/docs/classdetails/MembersList.scss +17 -0
  26. package/resources/scss/theme-neo-light/apps/docs/classdetails/TutorialComponent.scss +4 -0
  27. package/resources/scss/theme-neo-light/apps/website/HeaderContainer.scss +5 -0
  28. package/resources/scss/theme-neo-light/apps/website/MainContainer.scss +4 -0
  29. package/resources/scss/theme-neo-light/apps/website/blog/Container.scss +3 -0
  30. package/resources/scss/theme-neo-light/apps/website/home/TabContainer.scss +4 -0
  31. package/resources/scss/theme-neo-light/button/Base.scss +117 -0
  32. package/resources/scss/theme-neo-light/calendar/view/EditEventContainer.scss +5 -0
  33. package/resources/scss/theme-neo-light/calendar/view/MainContainer.scss +23 -0
  34. package/resources/scss/theme-neo-light/calendar/view/SettingsContainer.scss +3 -0
  35. package/resources/scss/theme-neo-light/calendar/view/YearComponent.scss +10 -0
  36. package/resources/scss/theme-neo-light/calendar/view/calendars/EditContainer.scss +5 -0
  37. package/resources/scss/theme-neo-light/calendar/view/calendars/List.scss +3 -0
  38. package/resources/scss/theme-neo-light/calendar/view/month/Component.scss +10 -0
  39. package/resources/scss/theme-neo-light/calendar/view/week/Component.scss +13 -0
  40. package/resources/scss/theme-neo-light/component/Base.scss +6 -0
  41. package/resources/scss/theme-neo-light/component/BoxLabel.scss +5 -0
  42. package/resources/scss/theme-neo-light/component/Chip.scss +14 -0
  43. package/resources/scss/theme-neo-light/component/DateSelector.scss +24 -0
  44. package/resources/scss/theme-neo-light/component/Process.scss +9 -0
  45. package/resources/scss/theme-neo-light/component/Progress.scss +3 -0
  46. package/resources/scss/theme-neo-light/component/Splitter.scss +5 -0
  47. package/resources/scss/theme-neo-light/component/StatusBadge.scss +19 -0
  48. package/resources/scss/theme-neo-light/component/Timer.scss +6 -0
  49. package/resources/scss/theme-neo-light/component/Toast.scss +9 -0
  50. package/resources/scss/theme-neo-light/component/Video.scss +4 -0
  51. package/resources/scss/theme-neo-light/container/Accordion.scss +5 -0
  52. package/resources/scss/theme-neo-light/container/AccordionItem.scss +10 -0
  53. package/resources/scss/theme-neo-light/container/Base.scss +4 -0
  54. package/resources/scss/theme-neo-light/container/Panel.scss +5 -0
  55. package/resources/scss/theme-neo-light/container/Viewport.scss +3 -0
  56. package/resources/scss/theme-neo-light/design-tokens/Components.scss +3 -0
  57. package/resources/scss/theme-neo-light/dialog/Base.scss +5 -0
  58. package/resources/scss/theme-neo-light/examples/ConfigurationPanel.scss +3 -0
  59. package/resources/scss/theme-neo-light/examples/calendar/basic/MainContainer.scss +4 -0
  60. package/resources/scss/theme-neo-light/form/Fieldset.scss +6 -0
  61. package/resources/scss/theme-neo-light/form/field/CheckBox.scss +8 -0
  62. package/resources/scss/theme-neo-light/form/field/FileUpload.scss +12 -0
  63. package/resources/scss/theme-neo-light/form/field/Picker.scss +5 -0
  64. package/resources/scss/theme-neo-light/form/field/Range.scss +4 -0
  65. package/resources/scss/theme-neo-light/form/field/Search.scss +3 -0
  66. package/resources/scss/theme-neo-light/form/field/Select.scss +9 -0
  67. package/resources/scss/theme-neo-light/form/field/Switch.scss +17 -0
  68. package/resources/scss/theme-neo-light/form/field/Text.scss +32 -0
  69. package/resources/scss/theme-neo-light/form/field/trigger/Base.scss +6 -0
  70. package/resources/scss/theme-neo-light/form/field/trigger/Time.scss +4 -0
  71. package/resources/scss/theme-neo-light/grid/Container.scss +7 -0
  72. package/resources/scss/theme-neo-light/grid/View.scss +13 -0
  73. package/resources/scss/theme-neo-light/grid/header/Button.scss +6 -0
  74. package/resources/scss/theme-neo-light/list/Base.scss +12 -0
  75. package/resources/scss/theme-neo-light/menu/List.scss +21 -0
  76. package/resources/scss/theme-neo-light/menu/Panel.scss +3 -0
  77. package/resources/scss/theme-neo-light/tab/Container.scss +3 -0
  78. package/resources/scss/theme-neo-light/tab/Strip.scss +5 -0
  79. package/resources/scss/theme-neo-light/tab/header/Button.scss +30 -0
  80. package/resources/scss/theme-neo-light/table/Container.scss +10 -0
  81. package/resources/scss/theme-neo-light/table/View.scss +13 -0
  82. package/resources/scss/theme-neo-light/table/header/Button.scss +7 -0
  83. package/resources/scss/theme-neo-light/toolbar/Base.scss +4 -0
  84. package/resources/scss/theme-neo-light/tree/List.scss +4 -0
  85. package/src/DefaultConfig.mjs +2 -2
  86. package/src/form/field/FileUpload.mjs +10 -8
  87. package/src/form/field/Text.mjs +2 -2
  88. package/src/main/addon/HighlightJS.mjs +35 -10
  89. package/src/vdom/Helper.mjs +2 -1
@@ -0,0 +1,10 @@
1
+ :root .neo-theme-neo-light { // .neo-table-container
2
+ --table-container-border-color : #ddd;
3
+ --table-container-cell-background-color : #fff;
4
+ --table-container-cell-background-color-even: #f2f2f2;
5
+ --table-container-cell-border-bottom : 1px solid #ddd;
6
+ --table-container-cell-height : 32px;
7
+ --table-container-cell-padding : 2px 10px 2px;
8
+ --table-container-color : #666;
9
+ --table-container-header-cell-border-bottom : 1px solid #ddd;
10
+ }
@@ -0,0 +1,13 @@
1
+ :root .neo-theme-neo-light { // .neo-table-view
2
+ --table-cell-background-color-hover : #{lighten(#33343d, 70%)};
3
+ --table-cellmodel-selected-cell-background-color : #{lighten(#64B5F6, 22%)};
4
+ --table-cellmodel-selected-cell-color : #2b2b2b;
5
+ --table-cellmodel-selected-column-cell-background-color: #{lighten(#4f558a, 52%)};
6
+ --table-cellmodel-selected-column-cell-color : #2b2b2b;
7
+ --table-cellrowmodel-selected-cell-background-color : #{lighten(#64B5F6, 22%)};
8
+ --table-cellrowmodel-selected-cell-color : #2b2b2b;
9
+ --table-cellrowmodel-selected-row-cell-background-color: #{lighten(#4f558a, 52%)};
10
+ --table-cellrowmodel-selected-row-cell-color : #2b2b2b;
11
+ --table-rowmodel-selected-cell-background-color : #{lighten(#64B5F6, 22%)};
12
+ --table-rowmodel-selected-cell-color : #2b2b2b;
13
+ }
@@ -0,0 +1,7 @@
1
+ :root .neo-theme-neo-light { // .neo-table-header-button
2
+ --table-header-button-background-color : #5d83a7;
3
+ --table-header-button-background-image : none;
4
+ --table-header-button-color : #fff;
5
+ --table-header-button-glyph-color : #fff;
6
+ --table-header-button-ripple-background-color: #{darken(#5d83a7, 10%)};
7
+ }
@@ -0,0 +1,4 @@
1
+ :root .neo-theme-neo-light { // .neo-toolbar
2
+ --toolbar-background-color: #fff;
3
+ --toolbar-padding : 5px;
4
+ }
@@ -0,0 +1,4 @@
1
+ :root .neo-theme-neo-light { // .neo-tree-list
2
+ --tree-list-color : #666;
3
+ --tree-list-menu-item-color: #1c60a0;
4
+ }
@@ -236,12 +236,12 @@ const DefaultConfig = {
236
236
  useVdomWorker: true,
237
237
  /**
238
238
  * buildScripts/injectPackageVersion.mjs will update this value
239
- * @default '6.9.7'
239
+ * @default '6.9.8'
240
240
  * @memberOf! module:Neo
241
241
  * @name config.version
242
242
  * @type String
243
243
  */
244
- version: '6.9.7'
244
+ version: '6.9.8'
245
245
  };
246
246
 
247
247
  Object.assign(DefaultConfig, {
@@ -1,5 +1,6 @@
1
- import Base from '../../form/field/Base.mjs';
2
- import NeoArray from '../../util/Array.mjs';
1
+ import Base from '../../form/field/Base.mjs';
2
+ import NeoArray from '../../util/Array.mjs';
3
+ import StringUtil from '../../util/String.mjs';
3
4
 
4
5
  const
5
6
  sizeRE = /^(\d+)(kb|mb|gb)?$/i,
@@ -404,15 +405,16 @@ class FileUpload extends Base {
404
405
  const
405
406
  file = files.item(0),
406
407
  pointPos = file.name.lastIndexOf('.'),
407
- type = pointPos > -1 ? file.name.slice(pointPos + 1) : '';
408
+ type = pointPos > -1 ? file.name.slice(pointPos + 1) : '',
409
+ escapedFileName = StringUtil.escapeHtml(file.name);
408
410
 
409
411
  if (me.types && !types[type]) {
410
- body.cn[0].innerHTML = file.name;
412
+ body.cn[0].innerHTML = escapedFileName;
411
413
  body.cn[1].innerHTML = `${me.invalidFileFormat} (.${type}) ${me.formatSize(file.size)}`;
412
414
  me.error = me.pleaseUseTheseTypes?.replace('{allowedFileTypes}', Object.keys(types).join(' .'))
413
415
  }
414
416
  else if (file.size > me.maxSize) {
415
- body.cn[0].innerHTML = file.name;
417
+ body.cn[0].innerHTML = escapedFileName;
416
418
  body.cn[1].innerHTML = me.formatSize(file.size);
417
419
  me.error = me.fileSizeMoreThan?.replace('{allowedFileSize}', String(me._maxSize).toUpperCase());
418
420
  }
@@ -444,8 +446,8 @@ class FileUpload extends Base {
444
446
  // We have to wait for the DOM to have changed, and the action button to be visible
445
447
  await new Promise(resolve => setTimeout(resolve, 100));
446
448
  me.focus(me.vdom.cn[2].id);
447
-
448
- me.vdom.cn[1].cn[0].innerHTML = file.name;
449
+
450
+ me.vdom.cn[1].cn[0].innerHTML = StringUtil.escapeHtml(file.name);
449
451
  me.update();
450
452
  me.state = 'uploading';
451
453
 
@@ -669,7 +671,7 @@ class FileUpload extends Base {
669
671
 
670
672
  me.documentId = document.id;
671
673
  me.fileSize = me.formatSize(document.size);
672
- me.vdom.cn[1].cn[0].innerHTML = document.fileName;
674
+ me.vdom.cn[1].cn[0].innerHTML = StringUtil.escapeHtml(document.fileName);
673
675
  me.state = me.documentStatusMap[document.status];
674
676
  }
675
677
  }
@@ -1283,7 +1283,7 @@ class Text extends Base {
1283
1283
  onInputValueChange(data) {
1284
1284
  let me = this,
1285
1285
  oldValue = me.value,
1286
- value = data.value,
1286
+ value = data.value ? data.value.toString().trim() : me.emptyValue,
1287
1287
  vnode = VNodeUtil.findChildVnode(me.vnode, {nodeName: 'input'});
1288
1288
 
1289
1289
  if (vnode) {
@@ -1482,7 +1482,7 @@ class Text extends Base {
1482
1482
  minLength = me.minLength,
1483
1483
  required = me.required,
1484
1484
  returnValue = true,
1485
- value = me.value,
1485
+ value = me.value ? me.value.toString().trim() : me.emptyValue,
1486
1486
  valueLength = value?.toString().length,
1487
1487
  inputPattern = me.inputPattern,
1488
1488
  isEmpty = value !== 0 && (!value || valueLength < 1),
@@ -32,6 +32,7 @@ class HighlightJS extends Base {
32
32
  */
33
33
  remote: {
34
34
  app: [
35
+ 'loadLibrary',
35
36
  'scrollIntoView',
36
37
  'syntaxHighlight',
37
38
  'switchTheme',
@@ -56,14 +57,26 @@ class HighlightJS extends Base {
56
57
  */
57
58
  construct(config) {
58
59
  super.construct(config);
60
+ }
61
+
62
+ /**
63
+ * @param {Object} data
64
+ * @returns {Boolean}
65
+ */
66
+ async loadLibrary(data) {
67
+ delete data.appName;
59
68
 
60
69
  let me = this;
61
70
 
62
- DomAccess.loadScript(me.highlightJsPath).then(() => {
71
+ me.set(data);
72
+
73
+ await DomAccess.loadScript(me.highlightJsPath).then(() => {
63
74
  DomAccess.addScript({src: me.highlightJsLineNumbersPath});
64
75
  });
65
76
 
66
77
  Stylesheet.createStyleSheet(null, 'hljs-theme', me.themePath)
78
+
79
+ return true
67
80
  }
68
81
 
69
82
  /**
@@ -85,17 +98,14 @@ class HighlightJS extends Base {
85
98
 
86
99
  /**
87
100
  * @param {Object} data
88
- * @param {String} data.vnodeId
101
+ * @returns {Boolean}
89
102
  */
90
- syntaxHighlight(data) {
91
- if (hljs) {
92
- let node = document.getElementById(data.vnodeId);
103
+ setConfigs(data) {
104
+ delete data.appName;
93
105
 
94
- hljs.highlightBlock(node);
95
- hljs.lineNumbersBlock(node);
96
- } else {
97
- console.error('highlight.js is not included inside the main thread.')
98
- }
106
+ this.set(data);
107
+
108
+ return true
99
109
  }
100
110
 
101
111
  /**
@@ -114,6 +124,21 @@ class HighlightJS extends Base {
114
124
  Stylesheet.createStyleSheet(null, 'hljs-theme', switchToTheme);
115
125
  }
116
126
 
127
+ /**
128
+ * @param {Object} data
129
+ * @param {String} data.vnodeId
130
+ */
131
+ syntaxHighlight(data) {
132
+ if (hljs) {
133
+ let node = document.getElementById(data.vnodeId);
134
+
135
+ hljs.highlightBlock(node);
136
+ hljs.lineNumbersBlock(node);
137
+ } else {
138
+ console.error('highlight.js is not included inside the main thread.')
139
+ }
140
+ }
141
+
117
142
  /**
118
143
  * @param {Object} data
119
144
  */
@@ -580,7 +580,8 @@ class Helper extends Base {
580
580
  string += ` ${key}`;
581
581
  }
582
582
  } else if (key !== 'removeDom') {
583
- string += ` ${key}="${value}"`;
583
+
584
+ string += ` ${key}="${value.replaceAll('"', '&quot;')}"`;
584
585
  }
585
586
  });
586
587