@aquera/nile-elements 1.5.8 → 1.5.9-patch-1

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.
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": "1.5.8",
6
+ "version": "1.5.9-patch-1",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -39,7 +39,7 @@ import { autocompletion,acceptCompletion, closeCompletion,CompletionContext,Comp
39
39
  import NileElement from '../internal/nile-element';
40
40
  import { basicSetup } from './extensionSetup';
41
41
  import { classMap } from 'lit/directives/class-map.js';
42
- import { Theme as DefaultTheme, customisedThemeCss, fontFamily } from './theme';
42
+ import { Theme as DefaultTheme, customisedThemeCss, fontFamily, readOnlyTheme } from './theme';
43
43
  import { keymap } from '@codemirror/view';
44
44
 
45
45
  // Choose the appropriate mode for your use case
@@ -109,6 +109,8 @@ export class NileCodeEditor extends NileElement {
109
109
 
110
110
  @property({ type: Object, attribute: false }) autoCompleteStyle: { width?: string; multiline?: boolean } | undefined = undefined;
111
111
 
112
+ @property({ type: Boolean, reflect: true, attribute: true }) hideReadOnlyCursor: boolean = false;
113
+
112
114
  public view: EditorView;
113
115
  public viewState:EditorState;
114
116
  private timeOut: any = null;
@@ -586,13 +588,7 @@ export class NileCodeEditor extends NileElement {
586
588
  }
587
589
 
588
590
  getReadOnlyExtension() {
589
- if(this.readonly || this.disabled) {
590
- return [
591
- EditorState.readOnly.of(true),
592
- EditorView.editable.of(false),
593
- ]
594
- }
595
- return [];
591
+ return (this.readonly || this.disabled) ? [EditorState.readOnly.of(true), this.hideReadOnlyCursor ? EditorView.theme(readOnlyTheme) : []] : [];
596
592
  }
597
593
 
598
594
  getSingleLineExtension() {
@@ -48,6 +48,12 @@ export const fontFamily = {
48
48
  }
49
49
  }
50
50
 
51
+ export const readOnlyTheme = {
52
+ '.cm-cursor': {
53
+ display: 'none !important'
54
+ },
55
+ };
56
+
51
57
  export const customisedThemeCss = {
52
58
  '.cm-content' : {
53
59
  fontFamily: 'inherit',
@@ -164,3 +170,4 @@ export const customisedThemeCss = {
164
170
  marginLeft: '18px',
165
171
  }
166
172
  };
173
+
@@ -449,10 +449,12 @@ export class NileDropdown extends NileElement {
449
449
  }
450
450
 
451
451
  private updateTriggerDisabledState() {
452
- const trigger = this.querySelector('[slot="trigger"]') as HTMLElement | null;
452
+ const trigger = this.querySelector('[slot="trigger"]') as any;
453
453
  if (!trigger) return;
454
- if ('disabled' in trigger) {
455
- (trigger as any).disabled = this.disabled;
454
+ const triggerAlreadyDisabled = trigger.hasAttribute('disabled');
455
+ if (this.disabled || triggerAlreadyDisabled) {
456
+ trigger.disabled = true;
457
+ this.disabled = true;
456
458
  }
457
459
  }
458
460
 
@@ -989,7 +989,7 @@
989
989
  },
990
990
  {
991
991
  "name": "nile-code-editor",
992
- "description": "Nile icon component.\n\nEvents:\n\n * `nile-focus` {`Event`} - \n\n * `nile-blur` {`Event`} - \n\nAttributes:\n\n * `value` {`string`} - \n\n * `expandIcon` {`string`} - \n\n * `placeholder` {`string`} - \n\n * `customAutoCompletions` - \n\n * `customCompletionsPaths` {`string[]`} - \n\n * `language` {`\"html\" | \"javascript\" | \"sql\" | \"json\"`} - \n\n * `error-message` {`string`} - \n\n * `error` {`boolean`} - \n\n * `enableSearch` {`boolean`} - \n\n * `noborder` {`boolean`} - \n\n * `multiline` {`boolean`} - \n\n * `enableFoldGutters` {`boolean`} - \n\n * `allowVariableInCustomSuggestion` {`boolean`} - \n\n * `lineNumbers` {`boolean`} - \n\n * `lineNumbersMultiline` {`boolean`} - \n\n * `hasScroller` {`boolean`} - \n\n * `expandable` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `disabled` {`boolean`} - \n\n * `debounce` {`boolean`} - \n\n * `debounceTimeout` {`number`} - \n\n * `aboveCursor` {`boolean`} - \n\n * `tabCompletion` {`boolean`} - \n\n * `defaultFont` {`boolean`} - \n\nProperties:\n\n * `codeEditor` {`HTMLInputElement`} - \n\n * `value` {`string`} - \n\n * `expandIcon` {`string`} - \n\n * `placeholder` {`string`} - \n\n * `customAutoCompletions` - \n\n * `customCompletionsPaths` {`string[]`} - \n\n * `language` {`\"html\" | \"javascript\" | \"sql\" | \"json\"`} - \n\n * `errorMessage` {`string`} - \n\n * `error` {`boolean`} - \n\n * `enableSearch` {`boolean`} - \n\n * `noborder` {`boolean`} - \n\n * `multiline` {`boolean`} - \n\n * `enableFoldGutters` {`boolean`} - \n\n * `allowVariableInCustomSuggestion` {`boolean`} - \n\n * `lineNumbers` {`boolean`} - \n\n * `disableSyntaxHighlighting` {`boolean`} - \n\n * `customThemeCSS` {`object | null`} - \n\n * `lineNumbersMultiline` {`boolean`} - \n\n * `hasScroller` {`boolean`} - \n\n * `expandable` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `disabled` {`boolean`} - \n\n * `debounce` {`boolean`} - \n\n * `debounceTimeout` {`number`} - \n\n * `aboveCursor` {`boolean`} - \n\n * `tabCompletion` {`boolean`} - \n\n * `defaultFont` {`boolean`} - \n\n * `autoCompleteStyle` {`{ width?: string | undefined; multiline?: boolean | undefined; } | undefined`} - \n\n * `view` - \n\n * `viewState` - \n\n * `timeOut` - \n\n * `resizeObserver` - \n\n * `lineNumbersComp` - \n\n * `restrictSingleLineComp` - \n\n * `readOnlyComp` - \n\n * `customCompletionComp` - \n\n * `placeholderComp` - \n\n * `defaultSyntaxHighlightingComp` - \n\n * `themeComp` - \n\n * `autoCompletionComp` - \n\n * `autoCompleteStyleComp` - \n\n * `isSpacePressed` {`boolean`} - \n\n * `customAutocomplete` - Custom autocomplete handler for code editor suggestions\n\n * `insertBetweenCode` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
992
+ "description": "Nile icon component.\n\nEvents:\n\n * `nile-focus` {`Event`} - \n\n * `nile-blur` {`Event`} - \n\nAttributes:\n\n * `value` {`string`} - \n\n * `expandIcon` {`string`} - \n\n * `placeholder` {`string`} - \n\n * `customAutoCompletions` - \n\n * `customCompletionsPaths` {`string[]`} - \n\n * `language` {`\"html\" | \"javascript\" | \"sql\" | \"json\"`} - \n\n * `error-message` {`string`} - \n\n * `error` {`boolean`} - \n\n * `enableSearch` {`boolean`} - \n\n * `noborder` {`boolean`} - \n\n * `multiline` {`boolean`} - \n\n * `enableFoldGutters` {`boolean`} - \n\n * `allowVariableInCustomSuggestion` {`boolean`} - \n\n * `lineNumbers` {`boolean`} - \n\n * `lineNumbersMultiline` {`boolean`} - \n\n * `hasScroller` {`boolean`} - \n\n * `expandable` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `disabled` {`boolean`} - \n\n * `debounce` {`boolean`} - \n\n * `debounceTimeout` {`number`} - \n\n * `aboveCursor` {`boolean`} - \n\n * `tabCompletion` {`boolean`} - \n\n * `defaultFont` {`boolean`} - \n\n * `hideReadOnlyCursor` {`boolean`} - \n\nProperties:\n\n * `codeEditor` {`HTMLInputElement`} - \n\n * `value` {`string`} - \n\n * `expandIcon` {`string`} - \n\n * `placeholder` {`string`} - \n\n * `customAutoCompletions` - \n\n * `customCompletionsPaths` {`string[]`} - \n\n * `language` {`\"html\" | \"javascript\" | \"sql\" | \"json\"`} - \n\n * `errorMessage` {`string`} - \n\n * `error` {`boolean`} - \n\n * `enableSearch` {`boolean`} - \n\n * `noborder` {`boolean`} - \n\n * `multiline` {`boolean`} - \n\n * `enableFoldGutters` {`boolean`} - \n\n * `allowVariableInCustomSuggestion` {`boolean`} - \n\n * `lineNumbers` {`boolean`} - \n\n * `disableSyntaxHighlighting` {`boolean`} - \n\n * `customThemeCSS` {`object | null`} - \n\n * `lineNumbersMultiline` {`boolean`} - \n\n * `hasScroller` {`boolean`} - \n\n * `expandable` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `disabled` {`boolean`} - \n\n * `debounce` {`boolean`} - \n\n * `debounceTimeout` {`number`} - \n\n * `aboveCursor` {`boolean`} - \n\n * `tabCompletion` {`boolean`} - \n\n * `defaultFont` {`boolean`} - \n\n * `autoCompleteStyle` {`{ width?: string | undefined; multiline?: boolean | undefined; } | undefined`} - \n\n * `hideReadOnlyCursor` {`boolean`} - \n\n * `view` - \n\n * `viewState` - \n\n * `timeOut` - \n\n * `resizeObserver` - \n\n * `lineNumbersComp` - \n\n * `restrictSingleLineComp` - \n\n * `readOnlyComp` - \n\n * `customCompletionComp` - \n\n * `placeholderComp` - \n\n * `defaultSyntaxHighlightingComp` - \n\n * `themeComp` - \n\n * `autoCompletionComp` - \n\n * `autoCompleteStyleComp` - \n\n * `isSpacePressed` {`boolean`} - \n\n * `customAutocomplete` - Custom autocomplete handler for code editor suggestions\n\n * `insertBetweenCode` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
993
993
  "attributes": [
994
994
  {
995
995
  "name": "value",
@@ -1117,6 +1117,11 @@
1117
1117
  "description": "`defaultFont` {`boolean`} - \n\nProperty: defaultFont\n\nDefault: false",
1118
1118
  "valueSet": "v"
1119
1119
  },
1120
+ {
1121
+ "name": "hideReadOnlyCursor",
1122
+ "description": "`hideReadOnlyCursor` {`boolean`} - \n\nProperty: hideReadOnlyCursor\n\nDefault: false",
1123
+ "valueSet": "v"
1124
+ },
1120
1125
  {
1121
1126
  "name": "onnile-focus",
1122
1127
  "description": "`nile-focus` {`Event`} - "