@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.
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js +13 -7
- 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 +10 -4
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js +105 -39
- 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-code-editor/theme.d.ts +9 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/theme.js +10 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/theme.js.map +1 -0
- 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 +13 -10
- 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 +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +11 -7
- 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 +111 -92
- 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/index.cjs.js +1 -1
- package/dist/nile-code-editor/index.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 +15 -9
- package/dist/nile-code-editor/nile-code-editor.esm.js +17 -9
- package/dist/nile-code-editor/theme.cjs.js +2 -0
- package/dist/nile-code-editor/theme.cjs.js.map +1 -0
- package/dist/nile-code-editor/theme.esm.js +1 -0
- 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 +13 -10
- package/dist/nile-switcher/nile-switcher.esm.js +29 -27
- 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 +13 -7
- 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 +10 -4
- package/dist/src/nile-code-editor/nile-code-editor.js +105 -39
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-code-editor/theme.d.ts +9 -0
- package/dist/src/nile-code-editor/theme.js +10 -0
- package/dist/src/nile-code-editor/theme.js.map +1 -0
- 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 +13 -10
- package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.d.ts +1 -0
- package/dist/src/nile-switcher/nile-switcher.js +11 -7
- 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 +13 -7
- package/src/nile-code-editor/nile-code-editor.ts +100 -42
- package/src/nile-code-editor/theme.ts +9 -0
- 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 +13 -10
- package/src/nile-switcher/nile-switcher.ts +12 -7
package/package.json
CHANGED
@@ -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
|
-
|
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
|
-
|
27
|
-
width:
|
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
|
-
|
41
|
+
display: none;
|
37
42
|
}
|
38
|
-
|
39
|
-
|
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
|
43
|
-
@property({ type: String }) value
|
44
|
-
@property({ type: String }) customOptions: any;
|
45
|
-
@property({ type:
|
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
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
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
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
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,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-
|
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
|
-
|
84
|
-
|
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
|
-
|
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
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
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,
|