@aquera/nile-elements 0.0.18 → 0.0.20
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-content-editor/nile-content-editor.css.js +4 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.js +25 -10
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +9 -6
- 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 +9 -3
- 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/dist/index.iife.js +26 -14
- package/dist/nile-content-editor/nile-content-editor.cjs.js +1 -1
- package/dist/nile-content-editor/nile-content-editor.cjs.js.map +1 -1
- package/dist/nile-content-editor/nile-content-editor.css.cjs.js +1 -1
- package/dist/nile-content-editor/nile-content-editor.css.cjs.js.map +1 -1
- package/dist/nile-content-editor/nile-content-editor.css.esm.js +4 -0
- package/dist/nile-content-editor/nile-content-editor.esm.js +7 -7
- package/dist/nile-radio-group/nile-radio-group.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.cjs.js.map +1 -1
- package/dist/nile-radio-group/nile-radio-group.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 +11 -8
- package/dist/nile-switcher/nile-switcher.esm.js +26 -21
- package/dist/src/nile-content-editor/nile-content-editor.css.js +4 -0
- package/dist/src/nile-content-editor/nile-content-editor.css.js.map +1 -1
- package/dist/src/nile-content-editor/nile-content-editor.d.ts +1 -0
- package/dist/src/nile-content-editor/nile-content-editor.js +25 -10
- package/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.js +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.css.js +9 -6
- 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 +9 -3
- 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-content-editor/nile-content-editor.css.ts +4 -0
- package/src/nile-content-editor/nile-content-editor.ts +24 -10
- package/src/nile-radio-group/nile-radio-group.ts +1 -1
- package/src/nile-switcher/nile-switcher.css.ts +9 -6
- package/src/nile-switcher/nile-switcher.ts +10 -2
package/package.json
CHANGED
@@ -61,6 +61,7 @@ export class NileContentEditor extends NileElement {
|
|
61
61
|
@property({ attribute: 'error-message' }) errorMessage = '';
|
62
62
|
|
63
63
|
@property({ attribute: 'error' }) error = false;
|
64
|
+
@property({ attribute: 'noborder' }) noborder = false;
|
64
65
|
|
65
66
|
static styles: CSSResultGroup = styles;
|
66
67
|
|
@@ -83,17 +84,17 @@ export class NileContentEditor extends NileElement {
|
|
83
84
|
}
|
84
85
|
|
85
86
|
addOpenListeners() {
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
87
|
+
this.addEventListener('click', this.handleOutsideClick);
|
88
|
+
this.addEventListener('cut', this.handleClipboardEvent);
|
89
|
+
this.addEventListener('copy', this.handleClipboardEvent);
|
90
|
+
this.addEventListener('paste', this.handleClipboardEvent);
|
90
91
|
}
|
91
92
|
|
92
93
|
removeOpenListeners() {
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
94
|
+
this.removeEventListener('click', this.handleOutsideClick);
|
95
|
+
this.removeEventListener('cut', this.handleClipboardEvent);
|
96
|
+
this.removeEventListener('copy', this.handleClipboardEvent);
|
97
|
+
this.removeEventListener('paste', this.handleClipboardEvent);
|
97
98
|
}
|
98
99
|
|
99
100
|
async handleClipboardEvent(event: Event) {
|
@@ -106,7 +107,8 @@ export class NileContentEditor extends NileElement {
|
|
106
107
|
break;
|
107
108
|
case 'paste':
|
108
109
|
event.preventDefault();
|
109
|
-
let pastedText =
|
110
|
+
let pastedText = '';
|
111
|
+
pastedText = await navigator.clipboard.readText();
|
110
112
|
pastedText = pastedText
|
111
113
|
.replace(/<(|\/)(html|body|meta|span)[^>]*?>/gi, '')
|
112
114
|
.trim();
|
@@ -130,7 +132,7 @@ export class NileContentEditor extends NileElement {
|
|
130
132
|
}
|
131
133
|
}
|
132
134
|
|
133
|
-
@watch('type', { waitUntilFirstUpdate: true })
|
135
|
+
@watch(['type'], { waitUntilFirstUpdate: true })
|
134
136
|
handleTypeChange() {
|
135
137
|
this.contentEditor.innerHTML = this.generateHTMLTagsWithValues(this.value);
|
136
138
|
}
|
@@ -152,6 +154,15 @@ export class NileContentEditor extends NileElement {
|
|
152
154
|
) {
|
153
155
|
return;
|
154
156
|
}
|
157
|
+
|
158
|
+
if (event.code === KeyCode.ARROW_RIGHT) {
|
159
|
+
this.contentEditor.focus();
|
160
|
+
// select all the content in the element
|
161
|
+
document.execCommand('selectAll', false, undefined);
|
162
|
+
// collapse selection to the end
|
163
|
+
|
164
|
+
document?.getSelection()?.collapseToEnd();
|
165
|
+
}
|
155
166
|
if (event.code === KeyCode.ESCAPE) {
|
156
167
|
event.preventDefault();
|
157
168
|
this.toggleDropdown(false);
|
@@ -172,6 +183,7 @@ export class NileContentEditor extends NileElement {
|
|
172
183
|
|
173
184
|
filterOptions() {
|
174
185
|
this.filteredOptions = this.options;
|
186
|
+
this.filteredValue = this.filteredValue.trim();
|
175
187
|
if (!!this.options.length && !!this.filteredValue) {
|
176
188
|
this.filteredOptions = this.options.filter(item =>
|
177
189
|
item.includes(this.filteredValue)
|
@@ -292,6 +304,7 @@ export class NileContentEditor extends NileElement {
|
|
292
304
|
const hasError = !!this.error;
|
293
305
|
const hasErrorMessage = !!this.errorMessage;
|
294
306
|
const readonly = !!this.readonly;
|
307
|
+
const noborder = !!this.noborder;
|
295
308
|
const type = this.type;
|
296
309
|
return html`
|
297
310
|
<nile-popup
|
@@ -319,6 +332,7 @@ export class NileContentEditor extends NileElement {
|
|
319
332
|
'content-editable-input': true,
|
320
333
|
error: hasError || hasErrorMessage,
|
321
334
|
'read-only': readonly,
|
335
|
+
'no-border': noborder,
|
322
336
|
'text-area': type === 'text-area' ? true : false,
|
323
337
|
})}
|
324
338
|
@keydown=${this.handlekeyDown}
|
@@ -268,7 +268,7 @@ export class NileRadioGroup extends NileElement {
|
|
268
268
|
${defaultSlot}
|
269
269
|
`
|
270
270
|
: html`
|
271
|
-
<div class="${this.labelInline ? `form-control--inline-radio`:``}"> ${defaultSlot}</div> `}
|
271
|
+
<div part="options-base" class="${this.labelInline ? `form-control--inline-radio`:``}"> ${defaultSlot}</div> `}
|
272
272
|
</div>
|
273
273
|
|
274
274
|
${
|
@@ -22,15 +22,18 @@ export const styles = css`
|
|
22
22
|
}
|
23
23
|
.input-container {
|
24
24
|
display: flex;
|
25
|
+
gap: 0.5rem;
|
25
26
|
}
|
26
27
|
|
27
|
-
.
|
28
|
-
|
29
|
-
|
28
|
+
.tooltip-container {
|
29
|
+
display: flex;
|
30
|
+
flex-grow: 1;
|
31
|
+
flex-shrink: 0;
|
30
32
|
}
|
31
|
-
|
32
|
-
|
33
|
-
|
33
|
+
|
34
|
+
.input-container > :first-child {
|
35
|
+
flex-grow: 1;
|
36
|
+
flex-shrink: 0;
|
34
37
|
}
|
35
38
|
|
36
39
|
nile-radio {
|
@@ -57,6 +57,7 @@ export interface switchInputType {
|
|
57
57
|
options?: Array<any>;
|
58
58
|
helperText?: string;
|
59
59
|
multiple?: boolean;
|
60
|
+
noborder?: boolean;
|
60
61
|
}
|
61
62
|
|
62
63
|
export enum INPUT_TYPE {
|
@@ -199,12 +200,14 @@ export class NileSwitcher extends NileElement {
|
|
199
200
|
errorMessage,
|
200
201
|
type,
|
201
202
|
readonly,
|
203
|
+
noborder,
|
202
204
|
} = Input;
|
203
205
|
return html`<nile-content-editor
|
204
206
|
.value=${value}
|
205
207
|
.options=${options}
|
206
208
|
.type=${type}
|
207
209
|
.readonly=${readonly}
|
210
|
+
.noborder=${noborder}
|
208
211
|
.errorMessage=${errorMessage}
|
209
212
|
@nile-change=${(e: CustomEvent) => {
|
210
213
|
this.handleChange(e, inputType, inputTypeName);
|
@@ -241,12 +244,17 @@ export class NileSwitcher extends NileElement {
|
|
241
244
|
? defaultHelperText
|
242
245
|
: `switch to ${defaultInput.inputType}`;
|
243
246
|
|
244
|
-
return html` <nile-tooltip
|
247
|
+
return html` <nile-tooltip
|
248
|
+
class=${classMap({
|
249
|
+
'tooltip-container': true,
|
250
|
+
})}
|
251
|
+
content=${helperText}
|
252
|
+
placement="bottom"
|
253
|
+
>
|
245
254
|
<nile-icon
|
246
255
|
size="14"
|
247
256
|
class=${classMap({
|
248
257
|
'pointer-cursor': true,
|
249
|
-
'flex-start': true,
|
250
258
|
})}
|
251
259
|
.name=${icon}
|
252
260
|
color="#005EA6"
|