@aquera/nile-elements 0.0.35 → 0.0.36-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 (150) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js +13 -7
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.d.ts +10 -4
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js +105 -39
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/theme.d.ts +9 -0
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/theme.js +10 -0
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/theme.js.map +1 -0
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/edit-write.d.ts +5 -0
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/edit-write.js +5 -0
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/edit-write.js.map +1 -0
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/expand-2.d.ts +5 -0
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/expand-2.js +5 -0
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/expand-2.js.map +1 -0
  15. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.d.ts +2 -0
  16. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js +2 -0
  17. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js.map +1 -1
  18. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +13 -10
  19. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
  20. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +1 -0
  21. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +11 -7
  22. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  23. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  24. package/demo/filenames.txt +1 -1
  25. package/dist/index.cjs.js +1 -1
  26. package/dist/index.esm.js +1 -1
  27. package/dist/index.iife.js +111 -92
  28. package/dist/nile-badge/index.cjs.js +1 -1
  29. package/dist/nile-badge/index.esm.js +1 -1
  30. package/dist/nile-badge/nile-badge.cjs.js +1 -1
  31. package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
  32. package/dist/nile-badge/nile-badge.esm.js +1 -1
  33. package/dist/nile-button/index.cjs.js +1 -1
  34. package/dist/nile-button/index.esm.js +1 -1
  35. package/dist/nile-button/nile-button.cjs.js +1 -1
  36. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  37. package/dist/nile-button/nile-button.esm.js +1 -1
  38. package/dist/nile-code-editor/extensionSetup.cjs.js +2 -2
  39. package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
  40. package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
  41. package/dist/nile-code-editor/index.cjs.js +1 -1
  42. package/dist/nile-code-editor/index.esm.js +1 -1
  43. package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
  44. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  45. package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
  46. package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
  47. package/dist/nile-code-editor/nile-code-editor.css.esm.js +15 -9
  48. package/dist/nile-code-editor/nile-code-editor.esm.js +17 -9
  49. package/dist/nile-code-editor/theme.cjs.js +2 -0
  50. package/dist/nile-code-editor/theme.cjs.js.map +1 -0
  51. package/dist/nile-code-editor/theme.esm.js +1 -0
  52. package/dist/nile-dialog/index.cjs.js +1 -1
  53. package/dist/nile-dialog/index.esm.js +1 -1
  54. package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
  55. package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
  56. package/dist/nile-dialog/nile-dialog.esm.js +1 -1
  57. package/dist/nile-icon/icons/svg/edit-write.cjs.js +2 -0
  58. package/dist/nile-icon/icons/svg/edit-write.cjs.js.map +1 -0
  59. package/dist/nile-icon/icons/svg/edit-write.esm.js +1 -0
  60. package/dist/nile-icon/icons/svg/expand-2.cjs.js +2 -0
  61. package/dist/nile-icon/icons/svg/expand-2.cjs.js.map +1 -0
  62. package/dist/nile-icon/icons/svg/expand-2.esm.js +1 -0
  63. package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
  64. package/dist/nile-icon/icons/svg/index.esm.js +1 -1
  65. package/dist/nile-icon/index.cjs.js +1 -1
  66. package/dist/nile-icon/index.cjs.js.map +1 -1
  67. package/dist/nile-icon/index.esm.js +1 -1
  68. package/dist/nile-icon-button/index.cjs.js +1 -1
  69. package/dist/nile-icon-button/index.esm.js +1 -1
  70. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  71. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  72. package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
  73. package/dist/nile-input/index.cjs.js +1 -1
  74. package/dist/nile-input/index.esm.js +1 -1
  75. package/dist/nile-input/nile-input.cjs.js +1 -1
  76. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  77. package/dist/nile-input/nile-input.esm.js +1 -1
  78. package/dist/nile-menu-item/index.cjs.js +1 -1
  79. package/dist/nile-menu-item/index.esm.js +1 -1
  80. package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
  81. package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
  82. package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
  83. package/dist/nile-option/index.cjs.js +1 -1
  84. package/dist/nile-option/index.esm.js +1 -1
  85. package/dist/nile-option/nile-option.cjs.js +1 -1
  86. package/dist/nile-option/nile-option.cjs.js.map +1 -1
  87. package/dist/nile-option/nile-option.esm.js +1 -1
  88. package/dist/nile-select/index.cjs.js +1 -1
  89. package/dist/nile-select/index.esm.js +1 -1
  90. package/dist/nile-select/nile-select.cjs.js +1 -1
  91. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  92. package/dist/nile-select/nile-select.esm.js +1 -1
  93. package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
  94. package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
  95. package/dist/nile-switcher/nile-switcher.css.cjs.js +1 -1
  96. package/dist/nile-switcher/nile-switcher.css.cjs.js.map +1 -1
  97. package/dist/nile-switcher/nile-switcher.css.esm.js +13 -10
  98. package/dist/nile-switcher/nile-switcher.esm.js +29 -27
  99. package/dist/nile-tab/index.cjs.js +1 -1
  100. package/dist/nile-tab/index.esm.js +1 -1
  101. package/dist/nile-tab/nile-tab.cjs.js +1 -1
  102. package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
  103. package/dist/nile-tab/nile-tab.esm.js +1 -1
  104. package/dist/nile-tab-group/index.cjs.js +1 -1
  105. package/dist/nile-tab-group/index.esm.js +1 -1
  106. package/dist/nile-tab-group/nile-tab-group.cjs.js +1 -1
  107. package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
  108. package/dist/nile-tab-group/nile-tab-group.esm.js +1 -1
  109. package/dist/nile-tag/index.cjs.js +1 -1
  110. package/dist/nile-tag/index.esm.js +1 -1
  111. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  112. package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
  113. package/dist/nile-tag/nile-tag.esm.js +1 -1
  114. package/dist/nile-toast/index.cjs.js +1 -1
  115. package/dist/nile-toast/index.esm.js +1 -1
  116. package/dist/nile-toast/nile-toast.cjs.js +1 -1
  117. package/dist/nile-toast/nile-toast.cjs.js.map +1 -1
  118. package/dist/nile-toast/nile-toast.esm.js +1 -1
  119. package/dist/src/nile-code-editor/nile-code-editor.css.js +13 -7
  120. package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
  121. package/dist/src/nile-code-editor/nile-code-editor.d.ts +10 -4
  122. package/dist/src/nile-code-editor/nile-code-editor.js +105 -39
  123. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  124. package/dist/src/nile-code-editor/theme.d.ts +9 -0
  125. package/dist/src/nile-code-editor/theme.js +10 -0
  126. package/dist/src/nile-code-editor/theme.js.map +1 -0
  127. package/dist/src/nile-icon/icons/svg/edit-write.d.ts +5 -0
  128. package/dist/src/nile-icon/icons/svg/edit-write.js +5 -0
  129. package/dist/src/nile-icon/icons/svg/edit-write.js.map +1 -0
  130. package/dist/src/nile-icon/icons/svg/expand-2.d.ts +5 -0
  131. package/dist/src/nile-icon/icons/svg/expand-2.js +5 -0
  132. package/dist/src/nile-icon/icons/svg/expand-2.js.map +1 -0
  133. package/dist/src/nile-icon/icons/svg/index.d.ts +2 -0
  134. package/dist/src/nile-icon/icons/svg/index.js +2 -0
  135. package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
  136. package/dist/src/nile-switcher/nile-switcher.css.js +13 -10
  137. package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
  138. package/dist/src/nile-switcher/nile-switcher.d.ts +1 -0
  139. package/dist/src/nile-switcher/nile-switcher.js +11 -7
  140. package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  141. package/dist/tsconfig.tsbuildinfo +1 -1
  142. package/package.json +1 -1
  143. package/src/nile-code-editor/nile-code-editor.css.ts +13 -7
  144. package/src/nile-code-editor/nile-code-editor.ts +100 -42
  145. package/src/nile-code-editor/theme.ts +9 -0
  146. package/src/nile-icon/icons/svg/edit-write.ts +5 -0
  147. package/src/nile-icon/icons/svg/expand-2.ts +5 -0
  148. package/src/nile-icon/icons/svg/index.ts +2 -0
  149. package/src/nile-switcher/nile-switcher.css.ts +13 -10
  150. package/src/nile-switcher/nile-switcher.ts +12 -7
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.35",
6
+ "version": "0.0.36-2",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -19,13 +19,18 @@ export const styles = css`
19
19
  display: flex;
20
20
  justify-content: flex-end;
21
21
  flex-direction: row-reverse;
22
- gap: 0.6rem;
22
+ padding: 5px;
23
+ border-radius: 5px;
24
+ border: 1px solid rgb(204, 204, 204);
25
+ }
26
+
27
+ .error {
28
+ border-color: #e5434d;
23
29
  }
24
30
 
25
31
  .cm-editor {
26
- overflow: hidden;
27
- width: 100%;
28
- height: 100%;
32
+ flex: 1;
33
+ min-width: 0;
29
34
  }
30
35
 
31
36
  .ͼ1.cm-focused {
@@ -33,10 +38,11 @@ export const styles = css`
33
38
  }
34
39
 
35
40
  .code-editor__icon__container {
36
- cursor: pointer;
41
+ display: none;
37
42
  }
38
-
39
- .code-editor__icon__container {
43
+ .code-mirror:hover > .code-editor__icon__container {
44
+ cursor: pointer;
45
+ display: flex;
40
46
  padding-right: 5px;
41
47
  }
42
48
  `;
@@ -11,6 +11,7 @@ import {
11
11
  property,
12
12
  CSSResultArray,
13
13
  TemplateResult,
14
+ PropertyValueMap,
14
15
  } from 'lit-element';
15
16
  import { customElement, query } from 'lit/decorators.js';
16
17
  import { styles } from './nile-code-editor.css';
@@ -27,6 +28,10 @@ import { autocompletion } from '@codemirror/autocomplete';
27
28
  import { CompletionContext, Completion } from '@codemirror/autocomplete';
28
29
  import NileElement from '../internal/nile-element';
29
30
  import { basicSetup } from './extensionSetup';
31
+ import { watch } from '../internal/watch';
32
+ import { PropertyValues } from 'lit';
33
+ import { classMap } from 'lit/directives/class-map.js';
34
+ import { Theme } from './theme';
30
35
 
31
36
  // Choose the appropriate mode for your use case
32
37
 
@@ -39,10 +44,12 @@ import { basicSetup } from './extensionSetup';
39
44
  @customElement('nile-code-editor')
40
45
  export class NileCodeEditor extends NileElement {
41
46
  @query('.code-mirror') codeEditor: HTMLInputElement;
42
- @property({ type: Boolean }) multiline: true;
43
- @property({ type: String }) value: true;
44
- @property({ type: String }) customOptions: any;
45
- @property({ type: String }) showLineNumbers: any;
47
+ @property({ type: Boolean, reflect: true }) multiline = false;
48
+ @property({ type: String }) value = '';
49
+ @property({ type: String }) customOptions: any = {};
50
+ @property({ type: Boolean }) updateValue: any = false;
51
+ @property({ attribute: 'error-message' }) errorMessage = '';
52
+ @property({ attribute: 'error' }) error = false;
46
53
 
47
54
  /**
48
55
  * The styles for CodeEditor
@@ -54,6 +61,12 @@ export class NileCodeEditor extends NileElement {
54
61
 
55
62
  connectedCallback(): void {
56
63
  super.connectedCallback();
64
+ this.emit('nile-init');
65
+ }
66
+
67
+ disconnectedCallback(): void {
68
+ super.disconnectedCallback();
69
+ this.emit('nile-destroy');
57
70
  }
58
71
 
59
72
  view: EditorView;
@@ -64,33 +77,62 @@ export class NileCodeEditor extends NileElement {
64
77
  }
65
78
  lineNumbersComp = new Compartment();
66
79
 
67
- updated() {
68
- const customAutoCompletions = javascriptLanguage.data.of({
69
- autocomplete: scopeCompletionSource(this.customOptions),
70
- });
71
- let startState = EditorState.create({
72
- doc: !this.multiline ? this.convertToSingleLine(this.value) : this.value,
73
- extensions: [
74
- basicSetup({
75
- lineNumbers: !!this.showLineNumbers,
76
- foldGutter: !this.multiline ? false : true,
77
- }),
78
- customAutoCompletions,
79
- autocompletion(),
80
- javascript(),
81
- !this.multiline ? this.restrictSingleLine() : [],
82
- EditorView.updateListener.of((v: ViewUpdate) => {
83
- if (v.docChanged) {
84
- this.emitValues(this.view.state.doc.toString());
85
- }
86
- }),
87
- ],
88
- });
89
-
90
- this.view = new EditorView({
91
- state: startState,
92
- parent: this.codeEditor,
93
- });
80
+ @watch(['value'], { waitUntilFirstUpdate: true })
81
+ handleValueChange() {}
82
+
83
+ updated(changedProperties: PropertyValues) {
84
+ super.updated(changedProperties);
85
+ if (changedProperties.has('value')) {
86
+ const customAutoCompletions = javascriptLanguage.data.of({
87
+ autocomplete: scopeCompletionSource(this.customOptions),
88
+ });
89
+ if (!this.view) {
90
+ let startState = EditorState.create({
91
+ doc: !this.multiline
92
+ ? this.convertToSingleLine(this.value)
93
+ : this.value,
94
+ extensions: [
95
+ basicSetup({
96
+ lineNumbers: !!this.multiline,
97
+ highlightActiveLine: false,
98
+ foldGutter: !!this.multiline,
99
+ }),
100
+ customAutoCompletions,
101
+ autocompletion(),
102
+ javascript(),
103
+ this.setTheme(),
104
+ !this.multiline ? this.restrictSingleLine() : [],
105
+ EditorView.updateListener.of((v: ViewUpdate) => {
106
+ if (v.docChanged) {
107
+ this.emitValues(this.view.state.doc.toString());
108
+ }
109
+ }),
110
+ ],
111
+ });
112
+
113
+ this.view = new EditorView({
114
+ state: startState,
115
+ parent: this.codeEditor,
116
+ });
117
+ } else {
118
+ if (this.updateValue) {
119
+ // Editor has already been initialized, update its state
120
+ this.view.dispatch({
121
+ changes: {
122
+ from: 0,
123
+ to: this.view.state.doc.length,
124
+ insert: !this.multiline
125
+ ? this.convertToSingleLine(this.value)
126
+ : this.value,
127
+ },
128
+ });
129
+ }
130
+ }
131
+ }
132
+ }
133
+
134
+ setTheme() {
135
+ return EditorView.theme(Theme);
94
136
  }
95
137
 
96
138
  emitValues(value: string) {
@@ -107,17 +149,33 @@ export class NileCodeEditor extends NileElement {
107
149
  );
108
150
  }
109
151
  public render(): TemplateResult {
110
- return html`<div class="code-mirror">
111
- ${!this.multiline
112
- ? html`<nile-icon
113
- name="fullscreenshrink"
114
- class="code-editor__icon__container"
115
- size="16"
116
- color="black"
117
- @click="${(e: CustomEvent) => this.expandCodeEditor()}"
118
- ></nile-icon>`
119
- : ''}
120
- </div>`;
152
+ const hasErrorMessage = !!this.errorMessage;
153
+ const hasError = !!this.error;
154
+ return html`<div
155
+ part="code-editor-base"
156
+ class=${classMap({
157
+ 'code-mirror': true,
158
+ error: hasError || hasErrorMessage,
159
+ 'code-mirror__singleline': !this.multiline,
160
+ })}
161
+ >
162
+ ${!this.multiline
163
+ ? html` <nile-icon
164
+ name="expand"
165
+ class="code-editor__icon__container"
166
+ size="16"
167
+ color="black"
168
+ @click="${(e: CustomEvent) => this.expandCodeEditor()}"
169
+ ></nile-icon>`
170
+ : ''}
171
+ </div>
172
+ ${hasErrorMessage
173
+ ? html`
174
+ <nile-form-error-message
175
+ >${this.errorMessage}</nile-form-error-message
176
+ >
177
+ `
178
+ : ``}`;
121
179
  }
122
180
 
123
181
  /* #endregion */
@@ -0,0 +1,9 @@
1
+ export const Theme = {
2
+ '&': {
3
+ fontSize: '14px',
4
+ fontFamily: 'Colfax-regular',
5
+ fontWeight: '400',
6
+ },
7
+ '.cm-content': {},
8
+ '.cm-scroller': {},
9
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Do not edit directly
3
+ */
4
+
5
+ export default "PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOC41IDEwLjAwMDFMNS41IDEwLjU0MDFMNiA3LjUwMDA2TDExLjczIDEuNzkwMDZDMTEuODIzIDEuNjk2MzMgMTEuOTMzNiAxLjYyMTk0IDEyLjA1NTQgMS41NzExN0MxMi4xNzczIDEuNTIwNCAxMi4zMDggMS40OTQyNiAxMi40NCAxLjQ5NDI2QzEyLjU3MiAxLjQ5NDI2IDEyLjcwMjcgMS41MjA0IDEyLjgyNDYgMS41NzExN0MxMi45NDY0IDEuNjIxOTQgMTMuMDU3IDEuNjk2MzMgMTMuMTUgMS43OTAwNkwxNC4yMSAyLjg1MDA2QzE0LjMwMzcgMi45NDMwMiAxNC4zNzgxIDMuMDUzNjMgMTQuNDI4OSAzLjE3NTQ4QzE0LjQ3OTcgMy4yOTczNCAxNC41MDU4IDMuNDI4MDUgMTQuNTA1OCAzLjU2MDA2QzE0LjUwNTggMy42OTIwNyAxNC40Nzk3IDMuODIyNzggMTQuNDI4OSAzLjk0NDY0QzE0LjM3ODEgNC4wNjY1IDE0LjMwMzcgNC4xNzcxIDE0LjIxIDQuMjcwMDZMOC41IDEwLjAwMDFaIiBzdHJva2U9IiMxRDI0MzMiIHN0cm9rZS13aWR0aD0iMS4zIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48cGF0aCBkPSJNMTMgMTAuNVYxMy41QzEzIDEzLjc2NTIgMTIuODk0NiAxNC4wMTk2IDEyLjcwNzEgMTQuMjA3MUMxMi41MTk2IDE0LjM5NDYgMTIuMjY1MiAxNC41IDEyIDE0LjVIMi41QzIuMjM0NzggMTQuNSAxLjk4MDQzIDE0LjM5NDYgMS43OTI4OSAxNC4yMDcxQzEuNjA1MzYgMTQuMDE5NiAxLjUgMTMuNzY1MiAxLjUgMTMuNVY0QzEuNSAzLjczNDc4IDEuNjA1MzYgMy40ODA0MyAxLjc5Mjg5IDMuMjkyODlDMS45ODA0MyAzLjEwNTM2IDIuMjM0NzggMyAyLjUgM0g1LjUiIHN0cm9rZT0iIzFEMjQzMyIgc3Ryb2tlLXdpZHRoPSIxLjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Do not edit directly
3
+ */
4
+
5
+ export default "PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTIuNSA2LjVIMS41VjEuNUg2LjVWMi41SDMuMkw2LjQgNS42TDUuNiA2LjRMMi41IDMuMlY2LjVaTTEzLjUgMTIuOFY5LjVIMTQuNVYxNC41SDkuNVYxMy41SDEyLjhMOS43IDEwLjRMMTAuNCA5LjZMMTMuNSAxMi44Wk05LjYgNS42TDEwLjQgNi40TDEzLjUgMy4yVjYuNUgxNC41VjEuNUg5LjVWMi41SDEyLjhMOS42IDUuNlpNNS42IDkuNkw2LjMgMTAuNEwzLjIgMTMuNUg2LjVWMTQuNUgxLjVWOS41SDIuNVYxMi44TDUuNiA5LjZaIiBmaWxsPSIjMDA1RUE2Ii8+PC9zdmc+";
@@ -106,6 +106,7 @@ export { default as draglist } from './draglist';
106
106
  export { default as droparrow } from './droparrow';
107
107
  export { default as dropdown } from './dropdown';
108
108
  export { default as editpencil } from './edit-pencil';
109
+ export { default as editwrite } from './edit-write';
109
110
  export { default as else } from './else';
110
111
  export { default as email } from './email';
111
112
  export { default as enable } from './enable';
@@ -119,6 +120,7 @@ export { default as every } from './every';
119
120
  export { default as exactmatch } from './exactmatch';
120
121
  export { default as execute } from './execute';
121
122
  export { default as expand1 } from './expand-1';
123
+ export { default as expand2 } from './expand-2';
122
124
  export { default as expand } from './expand';
123
125
  export { default as eye } from './eye';
124
126
  export { default as eyeclosed } from './eyeclosed';
@@ -16,6 +16,10 @@ export const styles = css`
16
16
  box-sizing: border-box;
17
17
  }
18
18
 
19
+ .pointer-cursor {
20
+ cursor: pointer;
21
+ }
22
+
19
23
  .switcher__label {
20
24
  display: flex;
21
25
  align-items: center;
@@ -29,8 +33,11 @@ export const styles = css`
29
33
  letter-spacing: 0.2px;
30
34
  }
31
35
 
36
+ switcher-object-mapper:hover {
37
+ display: flex;
38
+ }
32
39
  .switcher-icon-container.current {
33
- background: var(--nile-colors-blue-400);
40
+ background: var(--nile-colors-primary-100);
34
41
  }
35
42
 
36
43
  .switcher-container {
@@ -47,6 +54,7 @@ export const styles = css`
47
54
 
48
55
  .switcher-inline > :nth-child(2) {
49
56
  flex: 1;
57
+ overflow: hidden;
50
58
  }
51
59
 
52
60
  .switcher-icons-container {
@@ -80,17 +88,12 @@ export const styles = css`
80
88
  padding-right: 10px;
81
89
  }
82
90
 
83
- nile-code-editor {
84
- overflow: hidden;
85
- padding-top: 2px;
86
- border-radius: 5px;
87
- border: 1px solid rgb(204, 204, 204);
91
+ .switcher-object-mapper-icon {
92
+ display: none;
88
93
  }
89
-
90
- .code-editor__no-border {
91
- border: none;
94
+ .switcher-object-mapper:hover > .switcher-object-mapper-icon {
95
+ display: block;
92
96
  }
93
-
94
97
  .switcher-object-mapper::part(input) {
95
98
  color: var(--nile-colors-primary-600);
96
99
  cursor: pointer;
@@ -177,6 +177,7 @@ export class NileSwitcher extends NileElement {
177
177
  } = Input;
178
178
 
179
179
  return html`<nile-select
180
+ part="dropdown"
180
181
  class="switcher-dropdown"
181
182
  .placeholder=${placeholder}
182
183
  .disabled="${disabled}"
@@ -276,7 +277,7 @@ export class NileSwitcher extends NileElement {
276
277
  const value =
277
278
  this.currentInput.mode === MODE.CREATE
278
279
  ? 'Click to Create - Not Mapped'
279
- : '';
280
+ : 'Click to Edit';
280
281
 
281
282
  return html`<nile-input
282
283
  class=${classMap({
@@ -312,9 +313,9 @@ export class NileSwitcher extends NileElement {
312
313
  noborder,
313
314
  } = Input;
314
315
  return html`<nile-code-editor
316
+ part="switcher-code-editor"
315
317
  class=${classMap({
316
318
  'code-editor': true,
317
- 'code-editor__no-border': !!noborder,
318
319
  })}
319
320
  @nile-expand="${(e: CustomEvent) =>
320
321
  this.handleExpand(e, INPUT_TYPE_NAMES.CODE_EDITOR)}"
@@ -323,7 +324,6 @@ export class NileSwitcher extends NileElement {
323
324
  .multiline="${multiLine}"
324
325
  .value="${value}"
325
326
  .customOptions="${customAutoCompletions}"
326
- .showLineNumbers="false"
327
327
  ></nile-code-editor> `;
328
328
  }
329
329
 
@@ -387,11 +387,15 @@ export class NileSwitcher extends NileElement {
387
387
  `;
388
388
  }
389
389
 
390
+ isToggleSwitch = (item: any) => {
391
+ return typeof item === 'undefined' || item;
392
+ };
393
+
390
394
  toggleField(currentInput: switchInputType, index: Number) {
391
- if (this.nileSwitchConfig.confirmation) {
392
- this.current = index;
393
- }
394
- this.emit('nile-switch', { input: this.currentInput });
395
+ this.emit('nile-switch', {
396
+ inputClicked: index,
397
+ currentInput: currentInput,
398
+ });
395
399
  }
396
400
 
397
401
  singleFieldSwitcher() {
@@ -438,6 +442,7 @@ export class NileSwitcher extends NileElement {
438
442
  const hasLabelSlot = this.hasSlotController.test('label');
439
443
  const align = this.nileSwitchConfig.align;
440
444
  return html`<div
445
+ part="base"
441
446
  class=${classMap({
442
447
  'switcher-block': align === POSITIONS.BLOCK,
443
448
  'switcher-inline': align === POSITIONS.INLINE,