@aquera/nile-elements 0.0.36 → 0.0.37-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/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js +11 -4
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.d.ts +7 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js +59 -23
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/edit-write.d.ts +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/edit-write.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/edit-write.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/expand-2.d.ts +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/expand-2.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/expand-2.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.d.ts +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +2 -12
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +3 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +20 -13
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/demo/filenames.txt +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +226 -221
- package/dist/nile-badge/index.cjs.js +1 -1
- package/dist/nile-badge/index.esm.js +1 -1
- package/dist/nile-badge/nile-badge.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
- package/dist/nile-badge/nile-badge.esm.js +1 -1
- package/dist/nile-button/index.cjs.js +1 -1
- package/dist/nile-button/index.esm.js +1 -1
- package/dist/nile-button/nile-button.cjs.js +1 -1
- package/dist/nile-button/nile-button.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.esm.js +1 -1
- package/dist/nile-code-editor/extensionSetup.cjs.js +2 -2
- package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.esm.js +13 -6
- package/dist/nile-code-editor/nile-code-editor.esm.js +17 -12
- package/dist/nile-dialog/index.cjs.js +1 -1
- package/dist/nile-dialog/index.esm.js +1 -1
- package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
- package/dist/nile-dialog/nile-dialog.esm.js +1 -1
- package/dist/nile-icon/icons/svg/edit-write.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/edit-write.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/edit-write.esm.js +1 -0
- package/dist/nile-icon/icons/svg/expand-2.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/expand-2.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/expand-2.esm.js +1 -0
- package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/index.esm.js +1 -1
- package/dist/nile-icon/index.cjs.js +1 -1
- package/dist/nile-icon/index.cjs.js.map +1 -1
- package/dist/nile-icon/index.esm.js +1 -1
- package/dist/nile-icon-button/index.cjs.js +1 -1
- package/dist/nile-icon-button/index.esm.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
- package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
- package/dist/nile-input/index.cjs.js +1 -1
- package/dist/nile-input/index.esm.js +1 -1
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.esm.js +1 -1
- package/dist/nile-menu-item/index.cjs.js +1 -1
- package/dist/nile-menu-item/index.esm.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
- package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
- package/dist/nile-option/index.cjs.js +1 -1
- package/dist/nile-option/index.esm.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.esm.js +1 -1
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/index.esm.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.esm.js +1 -1
- package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
- package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
- package/dist/nile-switcher/nile-switcher.css.cjs.js +1 -1
- package/dist/nile-switcher/nile-switcher.css.cjs.js.map +1 -1
- package/dist/nile-switcher/nile-switcher.css.esm.js +2 -12
- package/dist/nile-switcher/nile-switcher.esm.js +14 -11
- package/dist/nile-tab/index.cjs.js +1 -1
- package/dist/nile-tab/index.esm.js +1 -1
- package/dist/nile-tab/nile-tab.cjs.js +1 -1
- package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
- package/dist/nile-tab/nile-tab.esm.js +1 -1
- package/dist/nile-tab-group/index.cjs.js +1 -1
- package/dist/nile-tab-group/index.esm.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
- package/dist/nile-tab-group/nile-tab-group.esm.js +1 -1
- package/dist/nile-tag/index.cjs.js +1 -1
- package/dist/nile-tag/index.esm.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.esm.js +1 -1
- package/dist/nile-toast/index.cjs.js +1 -1
- package/dist/nile-toast/index.esm.js +1 -1
- package/dist/nile-toast/nile-toast.cjs.js +1 -1
- package/dist/nile-toast/nile-toast.cjs.js.map +1 -1
- package/dist/nile-toast/nile-toast.esm.js +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.css.js +11 -4
- package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.d.ts +7 -2
- package/dist/src/nile-code-editor/nile-code-editor.js +59 -23
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/edit-write.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/edit-write.js +5 -0
- package/dist/src/nile-icon/icons/svg/edit-write.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/expand-2.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/expand-2.js +5 -0
- package/dist/src/nile-icon/icons/svg/expand-2.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/index.d.ts +2 -0
- package/dist/src/nile-icon/icons/svg/index.js +2 -0
- package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.css.js +2 -12
- package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.d.ts +3 -1
- package/dist/src/nile-switcher/nile-switcher.js +20 -13
- package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-code-editor/nile-code-editor.css.ts +11 -4
- package/src/nile-code-editor/nile-code-editor.ts +52 -31
- package/src/nile-icon/icons/svg/edit-write.ts +5 -0
- package/src/nile-icon/icons/svg/expand-2.ts +5 -0
- package/src/nile-icon/icons/svg/index.ts +2 -0
- package/src/nile-switcher/nile-switcher.css.ts +2 -12
- package/src/nile-switcher/nile-switcher.ts +24 -12
package/package.json
CHANGED
@@ -19,12 +19,18 @@ export const styles = css`
|
|
19
19
|
display: flex;
|
20
20
|
justify-content: flex-end;
|
21
21
|
flex-direction: row-reverse;
|
22
|
+
padding: 5px;
|
23
|
+
border-radius: 5px;
|
24
|
+
border: 1px solid rgb(204, 204, 204);
|
25
|
+
}
|
26
|
+
|
27
|
+
.error {
|
28
|
+
border-color: #e5434d;
|
22
29
|
}
|
23
30
|
|
24
31
|
.cm-editor {
|
25
|
-
|
26
|
-
width:
|
27
|
-
height: 100%;
|
32
|
+
flex: 1;
|
33
|
+
min-width: 0;
|
28
34
|
}
|
29
35
|
|
30
36
|
.ͼ1.cm-focused {
|
@@ -37,7 +43,8 @@ export const styles = css`
|
|
37
43
|
.code-mirror:hover > .code-editor__icon__container {
|
38
44
|
cursor: pointer;
|
39
45
|
display: flex;
|
40
|
-
|
46
|
+
align-self: start;
|
47
|
+
padding: 5px 5px 0px 0px;
|
41
48
|
}
|
42
49
|
`;
|
43
50
|
|
@@ -44,9 +44,13 @@ import { Theme } from './theme';
|
|
44
44
|
@customElement('nile-code-editor')
|
45
45
|
export class NileCodeEditor extends NileElement {
|
46
46
|
@query('.code-mirror') codeEditor: HTMLInputElement;
|
47
|
-
@property({ type: Boolean }) multiline
|
48
|
-
@property({ type: String }) value
|
49
|
-
@property({ type: String }) customOptions: 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;
|
53
|
+
@property({ type: Boolean }) expandable: any = false;
|
50
54
|
|
51
55
|
/**
|
52
56
|
* The styles for CodeEditor
|
@@ -58,6 +62,12 @@ export class NileCodeEditor extends NileElement {
|
|
58
62
|
|
59
63
|
connectedCallback(): void {
|
60
64
|
super.connectedCallback();
|
65
|
+
this.emit('nile-init');
|
66
|
+
}
|
67
|
+
|
68
|
+
disconnectedCallback(): void {
|
69
|
+
super.disconnectedCallback();
|
70
|
+
this.emit('nile-destroy');
|
61
71
|
}
|
62
72
|
|
63
73
|
view: EditorView;
|
@@ -73,7 +83,6 @@ export class NileCodeEditor extends NileElement {
|
|
73
83
|
|
74
84
|
updated(changedProperties: PropertyValues) {
|
75
85
|
super.updated(changedProperties);
|
76
|
-
|
77
86
|
if (changedProperties.has('value')) {
|
78
87
|
const customAutoCompletions = javascriptLanguage.data.of({
|
79
88
|
autocomplete: scopeCompletionSource(this.customOptions),
|
@@ -92,7 +101,7 @@ export class NileCodeEditor extends NileElement {
|
|
92
101
|
customAutoCompletions,
|
93
102
|
autocompletion(),
|
94
103
|
javascript(),
|
95
|
-
|
104
|
+
this.setTheme(),
|
96
105
|
!this.multiline ? this.restrictSingleLine() : [],
|
97
106
|
EditorView.updateListener.of((v: ViewUpdate) => {
|
98
107
|
if (v.docChanged) {
|
@@ -107,16 +116,18 @@ export class NileCodeEditor extends NileElement {
|
|
107
116
|
parent: this.codeEditor,
|
108
117
|
});
|
109
118
|
} else {
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
119
|
+
if (this.updateValue) {
|
120
|
+
// Editor has already been initialized, update its state
|
121
|
+
this.view.dispatch({
|
122
|
+
changes: {
|
123
|
+
from: 0,
|
124
|
+
to: this.view.state.doc.length,
|
125
|
+
insert: !this.multiline
|
126
|
+
? this.convertToSingleLine(this.value)
|
127
|
+
: this.value,
|
128
|
+
},
|
129
|
+
});
|
130
|
+
}
|
120
131
|
}
|
121
132
|
}
|
122
133
|
}
|
@@ -139,23 +150,33 @@ export class NileCodeEditor extends NileElement {
|
|
139
150
|
);
|
140
151
|
}
|
141
152
|
public render(): TemplateResult {
|
153
|
+
const hasErrorMessage = !!this.errorMessage;
|
154
|
+
const hasError = !!this.error;
|
142
155
|
return html`<div
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
156
|
+
part="code-editor-base"
|
157
|
+
class=${classMap({
|
158
|
+
'code-mirror': true,
|
159
|
+
error: hasError || hasErrorMessage,
|
160
|
+
'code-mirror__singleline': !this.multiline,
|
161
|
+
})}
|
162
|
+
>
|
163
|
+
${this.expandable
|
164
|
+
? html` <nile-icon
|
165
|
+
name="expand-2"
|
166
|
+
class="code-editor__icon__container"
|
167
|
+
size="16"
|
168
|
+
color="black"
|
169
|
+
@click="${(e: CustomEvent) => this.expandCodeEditor()}"
|
170
|
+
></nile-icon>`
|
171
|
+
: ''}
|
172
|
+
</div>
|
173
|
+
${hasErrorMessage
|
174
|
+
? html`
|
175
|
+
<nile-form-error-message
|
176
|
+
>${this.errorMessage}</nile-form-error-message
|
177
|
+
>
|
178
|
+
`
|
179
|
+
: ``}`;
|
159
180
|
}
|
160
181
|
|
161
182
|
/* #endregion */
|
@@ -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';
|
@@ -37,7 +37,7 @@ export const styles = css`
|
|
37
37
|
display: flex;
|
38
38
|
}
|
39
39
|
.switcher-icon-container.current {
|
40
|
-
background: var(--nile-colors-
|
40
|
+
background: var(--nile-colors-primary-100);
|
41
41
|
}
|
42
42
|
|
43
43
|
.switcher-container {
|
@@ -54,6 +54,7 @@ export const styles = css`
|
|
54
54
|
|
55
55
|
.switcher-inline > :nth-child(2) {
|
56
56
|
flex: 1;
|
57
|
+
overflow: hidden;
|
57
58
|
}
|
58
59
|
|
59
60
|
.switcher-icons-container {
|
@@ -87,17 +88,6 @@ export const styles = css`
|
|
87
88
|
padding-right: 10px;
|
88
89
|
}
|
89
90
|
|
90
|
-
nile-code-editor {
|
91
|
-
overflow: hidden;
|
92
|
-
padding-top: 2px;
|
93
|
-
border-radius: 5px;
|
94
|
-
border: 1px solid rgb(204, 204, 204);
|
95
|
-
}
|
96
|
-
|
97
|
-
.code-editor__no-border {
|
98
|
-
border: none;
|
99
|
-
}
|
100
|
-
|
101
91
|
.switcher-object-mapper-icon {
|
102
92
|
display: none;
|
103
93
|
}
|
@@ -66,6 +66,7 @@ export interface switchInputType {
|
|
66
66
|
noborder?: boolean;
|
67
67
|
multiLine?: boolean;
|
68
68
|
expand?: boolean;
|
69
|
+
expandable?: boolean;
|
69
70
|
}
|
70
71
|
|
71
72
|
export enum POSITIONS {
|
@@ -106,7 +107,7 @@ export class NileSwitcher extends NileElement {
|
|
106
107
|
|
107
108
|
@property({ type: Object }) nileSwitchConfig: switchconfig;
|
108
109
|
|
109
|
-
@property({ type: Number }) current: Number =
|
110
|
+
@property({ type: Number }) current: Number = 1;
|
110
111
|
|
111
112
|
@property({ type: Object }) currentInput: switchInputType;
|
112
113
|
|
@@ -271,9 +272,10 @@ export class NileSwitcher extends NileElement {
|
|
271
272
|
</nile-content-editor>`;
|
272
273
|
}
|
273
274
|
|
274
|
-
renderObjectMapper() {
|
275
|
-
|
276
|
-
|
275
|
+
renderObjectMapper(Input: switchInputType) {
|
276
|
+
let { options, inputType, error, errorMessage, type, readonly, noborder } =
|
277
|
+
Input;
|
278
|
+
|
277
279
|
const value =
|
278
280
|
this.currentInput.mode === MODE.CREATE
|
279
281
|
? 'Click to Create - Not Mapped'
|
@@ -285,6 +287,8 @@ export class NileSwitcher extends NileElement {
|
|
285
287
|
'switcher-object-mapper--noborder': !!noborder,
|
286
288
|
})}
|
287
289
|
.value=${value}
|
290
|
+
.errorMessage=${errorMessage}
|
291
|
+
.error=${error}
|
288
292
|
readonly="true"
|
289
293
|
@click="${(e: CustomEvent) =>
|
290
294
|
this.handleChange(e, INPUT_TYPE_NAMES.OBJECT_MAPPER)}"
|
@@ -292,7 +296,7 @@ export class NileSwitcher extends NileElement {
|
|
292
296
|
<nile-icon
|
293
297
|
class="pointer-cursor switcher-object-mapper-icon"
|
294
298
|
slot="suffix"
|
295
|
-
name="
|
299
|
+
name="expand-2"
|
296
300
|
color="#005EA6"
|
297
301
|
size="16"
|
298
302
|
>
|
@@ -311,12 +315,12 @@ export class NileSwitcher extends NileElement {
|
|
311
315
|
error,
|
312
316
|
inputType,
|
313
317
|
noborder,
|
318
|
+
expandable,
|
314
319
|
} = Input;
|
315
320
|
return html`<nile-code-editor
|
316
|
-
part="code-editor"
|
321
|
+
part="switcher-code-editor"
|
317
322
|
class=${classMap({
|
318
323
|
'code-editor': true,
|
319
|
-
'code-editor__no-border': !!noborder,
|
320
324
|
})}
|
321
325
|
@nile-expand="${(e: CustomEvent) =>
|
322
326
|
this.handleExpand(e, INPUT_TYPE_NAMES.CODE_EDITOR)}"
|
@@ -324,6 +328,7 @@ export class NileSwitcher extends NileElement {
|
|
324
328
|
this.handleChange(e, INPUT_TYPE_NAMES.CODE_EDITOR)}"
|
325
329
|
.multiline="${multiLine}"
|
326
330
|
.value="${value}"
|
331
|
+
.expandable="${expandable}"
|
327
332
|
.customOptions="${customAutoCompletions}"
|
328
333
|
></nile-code-editor> `;
|
329
334
|
}
|
@@ -388,11 +393,15 @@ export class NileSwitcher extends NileElement {
|
|
388
393
|
`;
|
389
394
|
}
|
390
395
|
|
396
|
+
isToggleSwitch = (item: any) => {
|
397
|
+
return typeof item === 'undefined' || item;
|
398
|
+
};
|
399
|
+
|
391
400
|
toggleField(currentInput: switchInputType, index: Number) {
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
401
|
+
this.emit('nile-switch', {
|
402
|
+
inputClicked: index,
|
403
|
+
currentInput: currentInput,
|
404
|
+
});
|
396
405
|
}
|
397
406
|
|
398
407
|
singleFieldSwitcher() {
|
@@ -424,7 +433,10 @@ export class NileSwitcher extends NileElement {
|
|
424
433
|
INPUT_TYPE_NAMES.CONTENTEDITOR,
|
425
434
|
() => this.renderContentEditor(this.currentInput),
|
426
435
|
],
|
427
|
-
[
|
436
|
+
[
|
437
|
+
INPUT_TYPE_NAMES.OBJECT_MAPPER,
|
438
|
+
() => this.renderObjectMapper(this.currentInput),
|
439
|
+
],
|
428
440
|
[
|
429
441
|
INPUT_TYPE_NAMES.CODE_EDITOR,
|
430
442
|
() => this.renderCodeEditor(this.currentInput),
|