@aquera/nile-elements 0.0.106 → 0.0.107

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 (30) hide show
  1. package/README.md +5 -0
  2. package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
  3. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  4. package/dist/nile-code-editor/nile-code-editor.esm.js +2 -2
  5. package/dist/nile-input/nile-input.cjs.js +1 -1
  6. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  7. package/dist/nile-input/nile-input.esm.js +3 -3
  8. package/dist/nile-tab/nile-tab.cjs.js +1 -1
  9. package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
  10. package/dist/nile-tab/nile-tab.esm.js +1 -1
  11. package/dist/nile-tab-group/nile-tab-group.cjs.js +1 -1
  12. package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
  13. package/dist/nile-tab-group/nile-tab-group.esm.js +2 -2
  14. package/dist/src/nile-code-editor/nile-code-editor.d.ts +2 -1
  15. package/dist/src/nile-code-editor/nile-code-editor.js +12 -1
  16. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  17. package/dist/src/nile-input/nile-input.d.ts +1 -0
  18. package/dist/src/nile-input/nile-input.js +5 -1
  19. package/dist/src/nile-input/nile-input.js.map +1 -1
  20. package/dist/src/nile-tab/nile-tab.js +2 -2
  21. package/dist/src/nile-tab/nile-tab.js.map +1 -1
  22. package/dist/src/nile-tab-group/nile-tab-group.js +3 -3
  23. package/dist/src/nile-tab-group/nile-tab-group.js.map +1 -1
  24. package/dist/tsconfig.tsbuildinfo +1 -1
  25. package/package.json +2 -1
  26. package/src/nile-code-editor/nile-code-editor.ts +14 -2
  27. package/src/nile-input/nile-input.ts +3 -1
  28. package/src/nile-tab/nile-tab.ts +2 -2
  29. package/src/nile-tab-group/nile-tab-group.ts +3 -3
  30. package/web-dev-server.config.mjs +1 -1
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent nile-elements following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "nile-elements",
6
- "version": "0.0.106",
6
+ "version": "0.0.107",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -115,6 +115,7 @@
115
115
  "composed-offset-position": "^0.0.4",
116
116
  "@codemirror/lang-javascript": "6.2.1",
117
117
  "@codemirror/lang-sql": "6.7.0",
118
+ "@codemirror/lang-json": "^6.0.1",
118
119
  "codemirror": "6.0.1",
119
120
  "chalk": "5.3.0",
120
121
  "figlet": "1.7.0"
@@ -30,6 +30,7 @@ import {
30
30
  scopeCompletionSource,
31
31
  } from '@codemirror/lang-javascript';
32
32
  import { sql } from '@codemirror/lang-sql';
33
+ import { json } from '@codemirror/lang-json';
33
34
  import { autocompletion } from '@codemirror/autocomplete';
34
35
  import NileElement from '../internal/nile-element';
35
36
  import { basicSetup } from './extensionSetup';
@@ -54,7 +55,7 @@ export class NileCodeEditor extends NileElement {
54
55
 
55
56
  @property({ type: Object, reflect: true , attribute: true }) customAutoCompletions: object = {};
56
57
 
57
- @property({ type: String, reflect: true , attribute: true}) language: 'javascript' | 'sql' = 'javascript'
58
+ @property({ type: String, reflect: true , attribute: true}) language: 'javascript' | 'sql' | 'json' = 'javascript';
58
59
 
59
60
  @property({ type: String, reflect: true , attribute: 'error-message' }) errorMessage: string = '';
60
61
 
@@ -194,7 +195,7 @@ export class NileCodeEditor extends NileElement {
194
195
  const customAutoCompletions = this.customCompletionComp.of(javascriptLanguage.data.of({
195
196
  autocomplete: scopeCompletionSource(this.customAutoCompletions),
196
197
  }));
197
- const language = this.language == "sql" ? sql() : javascript()
198
+ const language = this.getLanguageExtension()
198
199
  let startState = EditorState.create({
199
200
  doc: !this.multiline ? this.convertToSingleLine(this.value) : this.value,
200
201
  extensions: [
@@ -265,6 +266,17 @@ export class NileCodeEditor extends NileElement {
265
266
  getLineNumbersExension() {
266
267
  return this.lineNumbers || this.multiline ? lineNumbers() : [];
267
268
  }
269
+
270
+ getLanguageExtension(){
271
+ switch(this.language){
272
+ case 'sql':
273
+ return sql();
274
+ case 'json':
275
+ return json();
276
+ default:
277
+ return javascript();
278
+ }
279
+ }
268
280
 
269
281
  getReadOnlyExtension() {
270
282
  return EditorState.readOnly.of(this.readonly);
@@ -203,6 +203,8 @@ export class NileInput extends NileElement implements NileFormControl {
203
203
  })
204
204
  spellcheck = true;
205
205
 
206
+ @property({ type: Boolean, reflect: true }) canSavePassword = false;
207
+
206
208
  /**
207
209
  * Tells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual
208
210
  * keyboard on supportive devices.
@@ -576,7 +578,7 @@ export class NileInput extends NileElement implements NileFormControl {
576
578
  ? 'input__password'
577
579
  : ''
578
580
  }"
579
- type=${this.type === 'password' ? 'text' : this.type}
581
+ type=${this.type === 'password' && !this.canSavePassword ? 'text' : this.type}
580
582
  title=${
581
583
  this
582
584
  .title /* An empty title prevents browser validation tooltips from appearing on hover */
@@ -64,12 +64,12 @@ export class NileTab extends NileElement {
64
64
 
65
65
  private handleCloseClick(event: Event) {
66
66
  event.stopPropagation();
67
- this.emit('nile-close');
67
+ this.emit('nile-close',undefined,false);
68
68
  }
69
69
 
70
70
  @watch('active')
71
71
  handleActiveChange() {
72
- if(this.active) this.emit('nile-toggle-change',{ value: this.panel })
72
+ if(this.active) this.emit('nile-toggle-change',{ value: this.panel },false)
73
73
  this.setAttribute('aria-selected', this.active ? 'true' : 'false');
74
74
  }
75
75
 
@@ -113,11 +113,11 @@ export class NileTabGroup extends NileElement {
113
113
 
114
114
  // After the first update...
115
115
  this.updateComplete.then(() => {
116
+ this.syncTabsAndPanels();
116
117
  if(this.activeTabProp) this.activeTabName=this.activeTabProp;
117
118
  else this.activeTabName=this.getActiveTab().panel;
118
119
  this.syncIndicator();
119
120
 
120
- this.syncTabsAndPanels();
121
121
  this.mutationObserver.observe(this, { attributes: true, childList: true, subtree: true });
122
122
  this.resizeObserver.observe(this.nav);
123
123
  // Wait for tabs and tab panels to be registered
@@ -387,10 +387,10 @@ export class NileTabGroup extends NileElement {
387
387
  // Emit events
388
388
  if (options.emitEvents) {
389
389
  if (previousTab) {
390
- this.emit('nile-tab-hide', { value: previousTab.panel });
390
+ this.emit('nile-tab-hide', { value: previousTab.panel },false);
391
391
  }
392
392
 
393
- this.emit('nile-tab-show', { value: this.activeTab.panel });
393
+ this.emit('nile-tab-show', { value: this.activeTab.panel },false);
394
394
  }
395
395
  }
396
396
  }
@@ -9,7 +9,7 @@ export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
9
9
  watch: !hmr,
10
10
  /** Resolve bare module imports */
11
11
  nodeResolve: {
12
- exportConditions: ['browser', 'development'],
12
+ exportConditions: ['browser', 'production'],
13
13
  },
14
14
 
15
15
  /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */