@aquera/nile-elements 0.0.13 → 0.0.15
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-calendar/nile-calendar.css.js +12 -10
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js +3 -3
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.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 +32 -22
- 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-error-message/nile-error-message.css.js +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js +15 -8
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.css.js +10 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.d.ts +8 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.js +56 -6
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/array-loop.d.ts +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/array-loop.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/array-loop.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-icon/icons/svg/integer.d.ts +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/integer.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/integer.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-option/nile-option.js +7 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-option/nile-option.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js +11 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +10 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +2 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +31 -18
- 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 +112 -64
- 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-calendar/nile-calendar.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.esm.js +14 -12
- package/dist/nile-calendar/nile-calendar.esm.js +3 -3
- 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.esm.js +3 -3
- 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-error-message/nile-error-message.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
- package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
- package/dist/nile-error-message/nile-error-message.css.esm.js +1 -0
- package/dist/nile-error-message/nile-error-message.esm.js +13 -10
- package/dist/nile-form-help-text/index.cjs.js +1 -1
- package/dist/nile-form-help-text/index.esm.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.cjs.js.map +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js.map +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.css.esm.js +10 -0
- package/dist/nile-form-help-text/nile-form-help-text.esm.js +16 -5
- package/dist/nile-icon/icons/svg/array-loop.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/array-loop.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/array-loop.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/icons/svg/integer.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/integer.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/integer.esm.js +1 -0
- 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 +2 -2
- 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.css.cjs.js +1 -1
- package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.css.esm.js +11 -0
- package/dist/nile-select/nile-select.esm.js +8 -2
- 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.esm.js +42 -38
- 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/src/nile-calendar/nile-calendar.css.js +12 -10
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.js +3 -3
- package/dist/src/nile-calendar/nile-calendar.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 +32 -22
- package/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.css.js +1 -0
- package/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.d.ts +1 -0
- package/dist/src/nile-error-message/nile-error-message.js +15 -8
- package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
- package/dist/src/nile-form-help-text/nile-form-help-text.css.js +10 -0
- package/dist/src/nile-form-help-text/nile-form-help-text.css.js.map +1 -1
- package/dist/src/nile-form-help-text/nile-form-help-text.d.ts +8 -0
- package/dist/src/nile-form-help-text/nile-form-help-text.js +56 -6
- package/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/array-loop.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/array-loop.js +5 -0
- package/dist/src/nile-icon/icons/svg/array-loop.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-icon/icons/svg/integer.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/integer.js +5 -0
- package/dist/src/nile-icon/icons/svg/integer.js.map +1 -0
- package/dist/src/nile-option/nile-option.js +7 -0
- package/dist/src/nile-option/nile-option.js.map +1 -1
- package/dist/src/nile-select/nile-select.css.js +11 -0
- package/dist/src/nile-select/nile-select.css.js.map +1 -1
- package/dist/src/nile-select/nile-select.js +10 -1
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.d.ts +2 -1
- package/dist/src/nile-switcher/nile-switcher.js +31 -18
- 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-calendar/nile-calendar.css.ts +12 -10
- package/src/nile-calendar/nile-calendar.ts +3 -3
- package/src/nile-content-editor/nile-content-editor.ts +37 -23
- package/src/nile-error-message/nile-error-message.css.ts +1 -0
- package/src/nile-error-message/nile-error-message.ts +17 -9
- package/src/nile-form-help-text/nile-form-help-text.css.ts +10 -0
- package/src/nile-form-help-text/nile-form-help-text.ts +73 -26
- package/src/nile-icon/icons/svg/array-loop.ts +5 -0
- package/src/nile-icon/icons/svg/index.ts +2 -0
- package/src/nile-icon/icons/svg/integer.ts +5 -0
- package/src/nile-option/nile-option.ts +9 -0
- package/src/nile-select/nile-select.css.ts +11 -0
- package/src/nile-select/nile-select.ts +10 -1
- package/src/nile-switcher/nile-switcher.ts +48 -23
package/package.json
CHANGED
@@ -53,7 +53,6 @@ export const styles = css`
|
|
53
53
|
line-height: 14px;
|
54
54
|
letter-spacing: 0.2px;
|
55
55
|
height: 50px;
|
56
|
-
margin-top: 10px;
|
57
56
|
}
|
58
57
|
|
59
58
|
.day-names,
|
@@ -98,7 +97,8 @@ export const styles = css`
|
|
98
97
|
background: white;
|
99
98
|
display: flex;
|
100
99
|
justify-content: space-between;
|
101
|
-
width:
|
100
|
+
width: 365px;
|
101
|
+
box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
|
102
102
|
}
|
103
103
|
|
104
104
|
.selected-date,
|
@@ -147,24 +147,24 @@ export const styles = css`
|
|
147
147
|
.base {
|
148
148
|
background-color: white;
|
149
149
|
border-radius: 4px;
|
150
|
-
padding-bottom: 20px;
|
151
150
|
width: 365px;
|
152
151
|
}
|
153
152
|
|
154
153
|
.base__range {
|
155
|
-
|
154
|
+
padding: 24px;
|
156
155
|
}
|
157
156
|
|
158
157
|
.calender-input {
|
159
|
-
|
158
|
+
margin-top: 6px;
|
160
159
|
padding-bottom: 0px;
|
161
|
-
|
160
|
+
width: 365px;
|
162
161
|
}
|
163
162
|
|
164
163
|
.from {
|
165
164
|
display: flex;
|
166
165
|
justify-content: space-between;
|
167
|
-
gap:
|
166
|
+
gap: 8px;
|
167
|
+
margin-top: 12px;
|
168
168
|
}
|
169
169
|
|
170
170
|
.manual-input {
|
@@ -172,16 +172,18 @@ export const styles = css`
|
|
172
172
|
}
|
173
173
|
|
174
174
|
.manual-input-label {
|
175
|
+
color: #7f7f7f;
|
176
|
+
font-family: Colfax-regular;
|
175
177
|
font-size: 12px;
|
176
|
-
font-style: normal;
|
177
178
|
font-weight: 500;
|
178
|
-
|
179
|
+
line-height: 12px;
|
180
|
+
letter-spacing: 0.2px;
|
179
181
|
}
|
180
182
|
|
181
183
|
.button-contaner {
|
182
184
|
width: 100%;
|
183
185
|
text-align: right;
|
184
|
-
padding:
|
186
|
+
padding: 12px 0 0 0;
|
185
187
|
}
|
186
188
|
`;
|
187
189
|
|
@@ -512,7 +512,7 @@ private handleEndTimeInput(event: CustomEvent): void {
|
|
512
512
|
|
513
513
|
return html`
|
514
514
|
|
515
|
-
<div class="base${this.range ? '
|
515
|
+
<div class="base ${this.range ? 'base__range' : ''}">
|
516
516
|
<div class="calendar-wrapper" >
|
517
517
|
<div class="calendar-container ${this.range ? 'with-margin' : ''}">
|
518
518
|
${this.renderMonth(
|
@@ -521,7 +521,7 @@ private handleEndTimeInput(event: CustomEvent): void {
|
|
521
521
|
this.getDaysArray(this.currentYear, this.currentMonth)
|
522
522
|
)}
|
523
523
|
</div>
|
524
|
-
${this.range
|
524
|
+
<!-- ${this.range
|
525
525
|
? html`
|
526
526
|
<div class="calendar-container">
|
527
527
|
${this.renderMonth(
|
@@ -534,7 +534,7 @@ private handleEndTimeInput(event: CustomEvent): void {
|
|
534
534
|
)}
|
535
535
|
</div>
|
536
536
|
`
|
537
|
-
: ''}
|
537
|
+
: ''} -->
|
538
538
|
|
539
539
|
</div>
|
540
540
|
${this.range
|
@@ -98,20 +98,22 @@ export class NileContentEditor extends NileElement {
|
|
98
98
|
|
99
99
|
async handleClipboardEvent(event: Event) {
|
100
100
|
const selectedText = window?.getSelection()?.toString();
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
101
|
+
switch (event.type) {
|
102
|
+
case 'cut':
|
103
|
+
case 'copy':
|
104
|
+
if (!!selectedText) await navigator.clipboard.writeText(selectedText);
|
105
|
+
document.execCommand(event.type);
|
106
|
+
break;
|
107
|
+
case 'paste':
|
108
|
+
event.preventDefault();
|
109
|
+
let pastedText = await navigator.clipboard.readText();
|
110
|
+
pastedText = pastedText
|
111
|
+
.replace(/<(|\/)(html|body|meta|span)[^>]*?>/gi, '')
|
112
|
+
.trim();
|
113
|
+
document.execCommand('insertText', false, pastedText);
|
114
|
+
break;
|
115
|
+
default:
|
116
|
+
break;
|
115
117
|
}
|
116
118
|
setTimeout(() => {
|
117
119
|
this.emitInputChange();
|
@@ -144,7 +146,10 @@ export class NileContentEditor extends NileElement {
|
|
144
146
|
event.preventDefault();
|
145
147
|
return;
|
146
148
|
}
|
147
|
-
if (
|
149
|
+
if (
|
150
|
+
[KeyCode.CUT, KeyCode.COPY, KeyCode.PASTE].includes(event.code) &&
|
151
|
+
(event.ctrlKey || event.metaKey)
|
152
|
+
) {
|
148
153
|
return;
|
149
154
|
}
|
150
155
|
if (event.code === KeyCode.ESCAPE) {
|
@@ -162,14 +167,14 @@ export class NileContentEditor extends NileElement {
|
|
162
167
|
} else {
|
163
168
|
this.toggleDropdown(false);
|
164
169
|
}
|
165
|
-
});
|
170
|
+
}, 10);
|
166
171
|
}
|
167
172
|
|
168
173
|
filterOptions() {
|
169
174
|
this.filteredOptions = this.options;
|
170
175
|
if (!!this.options.length && !!this.filteredValue) {
|
171
176
|
this.filteredOptions = this.options.filter(item =>
|
172
|
-
item.
|
177
|
+
item.includes(this.filteredValue)
|
173
178
|
);
|
174
179
|
} else {
|
175
180
|
this.filteredOptions = this.options;
|
@@ -190,13 +195,20 @@ export class NileContentEditor extends NileElement {
|
|
190
195
|
var result = string.replace(pattern, (match: any, option: any) => {
|
191
196
|
return this.options.includes(option)
|
192
197
|
? '<span class="chips" contenteditable="false">' + option + '</span>'
|
193
|
-
:
|
194
|
-
option +
|
195
|
-
'</span>';
|
198
|
+
: this.setError(option);
|
196
199
|
});
|
197
200
|
return result;
|
198
201
|
}
|
199
202
|
|
203
|
+
setError(option: any) {
|
204
|
+
this.error = true;
|
205
|
+
return (
|
206
|
+
'<span class="chips chip-error" contenteditable="false">' +
|
207
|
+
option +
|
208
|
+
'</span>'
|
209
|
+
);
|
210
|
+
}
|
211
|
+
|
200
212
|
emitInputChange(): void {
|
201
213
|
if (this.contentEditor) {
|
202
214
|
let fieldValue = this.contentEditor.innerHTML;
|
@@ -204,7 +216,7 @@ export class NileContentEditor extends NileElement {
|
|
204
216
|
fieldValue = this.generateValuesFromHTMLTags(fieldValue);
|
205
217
|
}
|
206
218
|
fieldValue = fieldValue.replace(/ /g, ' ');
|
207
|
-
fieldValue = fieldValue
|
219
|
+
fieldValue = fieldValue.replace('<br>', '');
|
208
220
|
this.emit('nile-change', {
|
209
221
|
value: this.generateValuesFromHTMLTags(fieldValue),
|
210
222
|
});
|
@@ -302,6 +314,7 @@ export class NileContentEditor extends NileElement {
|
|
302
314
|
: ''}
|
303
315
|
<div
|
304
316
|
contenteditable="${!readonly}"
|
317
|
+
spellcheck="false"
|
305
318
|
class=${classMap({
|
306
319
|
'content-editable-input': true,
|
307
320
|
error: hasError || hasErrorMessage,
|
@@ -323,8 +336,9 @@ export class NileContentEditor extends NileElement {
|
|
323
336
|
`
|
324
337
|
: ``}
|
325
338
|
</div>
|
326
|
-
|
327
|
-
|
339
|
+
${this.filteredOptions && !!this.filteredOptions.length
|
340
|
+
? this.renderAutoOptions()
|
341
|
+
: null}
|
328
342
|
</nile-popup>
|
329
343
|
`;
|
330
344
|
}
|
@@ -26,6 +26,10 @@ export class NileErrorMessage extends LitElement {
|
|
26
26
|
@property({ type: String })
|
27
27
|
errorResponse: string;
|
28
28
|
|
29
|
+
// Extended error information
|
30
|
+
@property({ type: String })
|
31
|
+
errorResponseLong: string;
|
32
|
+
|
29
33
|
@property({ type: Boolean })
|
30
34
|
isExpanded: boolean = false;
|
31
35
|
|
@@ -64,22 +68,26 @@ export class NileErrorMessage extends LitElement {
|
|
64
68
|
|
65
69
|
|
66
70
|
${this.errorResponse
|
67
|
-
|
68
|
-
|
69
|
-
|
71
|
+
? html`
|
72
|
+
<div class="nile-error-message__response">
|
73
|
+
${this.errorResponse}
|
74
|
+
${this.errorResponseLong
|
75
|
+
? html`
|
70
76
|
<span
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
77
|
+
class="nile-error-message__more-button"
|
78
|
+
@click=${this.toggleExpanded}
|
79
|
+
>${this.isExpanded ? 'View Less' : 'View More'}</span
|
80
|
+
>`:``}
|
81
|
+
</div>
|
82
|
+
`
|
83
|
+
: ``}
|
76
84
|
|
77
85
|
<div
|
78
86
|
class="nile-error-message__response-expanded ${this.isExpanded
|
79
87
|
? 'expanded'
|
80
88
|
: 'collapsed'}"
|
81
89
|
>
|
82
|
-
${this.
|
90
|
+
${this.errorResponseLong}
|
83
91
|
</div>
|
84
92
|
</div>
|
85
93
|
`;
|
@@ -26,8 +26,18 @@ export const styles = css`
|
|
26
26
|
line-height: 12px;
|
27
27
|
letter-spacing: 0.2px;
|
28
28
|
margin-top: 6px;
|
29
|
+
margin-right: 4px;
|
30
|
+
width: auto;
|
29
31
|
}
|
30
32
|
|
33
|
+
.nile-form-help-text__more-button {
|
34
|
+
display: inline-flex;
|
35
|
+
gap: 4px;
|
36
|
+
color: var(--nile-colors-primary-600);
|
37
|
+
cursor: pointer;
|
38
|
+
white-space: nowrap;
|
39
|
+
align-items: center
|
40
|
+
}
|
31
41
|
`;
|
32
42
|
|
33
43
|
export default [styles];
|
@@ -6,7 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
import {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';
|
9
|
-
import { customElement } from 'lit/decorators.js';
|
9
|
+
import { customElement, query } from 'lit/decorators.js';
|
10
10
|
import {styles} from './nile-form-help-text.css';
|
11
11
|
|
12
12
|
/**
|
@@ -17,32 +17,79 @@ import {styles} from './nile-form-help-text.css';
|
|
17
17
|
*/
|
18
18
|
@customElement('nile-form-help-text')
|
19
19
|
export class NileFormHelpText extends LitElement {
|
20
|
+
/**
|
21
|
+
* The styles for FormHelpText
|
22
|
+
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
23
|
+
*/
|
24
|
+
public static get styles(): CSSResultArray {
|
25
|
+
return [styles];
|
26
|
+
}
|
27
|
+
|
28
|
+
|
29
|
+
@property({ type: Boolean })
|
30
|
+
isExpanded: boolean = false;
|
31
|
+
|
32
|
+
@property({ type: String })
|
33
|
+
fullText: string = '';
|
34
|
+
|
35
|
+
@property({ type: String })
|
36
|
+
displayedText: string = '';
|
37
|
+
|
38
|
+
@query('slot')
|
39
|
+
slotElement!: HTMLSlotElement;
|
40
|
+
|
41
|
+
connectedCallback() {
|
42
|
+
super.connectedCallback();
|
43
|
+
requestAnimationFrame(() => {
|
44
|
+
this.slotElement?.addEventListener('slotchange', this.handleSlotChange.bind(this));
|
45
|
+
});
|
46
|
+
}
|
47
|
+
|
48
|
+
firstUpdated() {
|
49
|
+
this.handleSlotChange();
|
50
|
+
}
|
51
|
+
|
52
|
+
handleSlotChange() {
|
53
|
+
const nodes = this.slotElement.assignedNodes({flatten: true});
|
54
|
+
const textContent = nodes.map(node => node.textContent).join('');
|
55
|
+
this.fullText = textContent;
|
56
|
+
this.displayedText = textContent.length > 50 ? `${textContent.substring(0, 47)}...` : textContent;
|
57
|
+
}
|
58
|
+
|
59
|
+
toggleExpanded() {
|
60
|
+
this.isExpanded = !this.isExpanded;
|
61
|
+
this.displayedText = this.isExpanded ? this.fullText : `${this.fullText.substring(0, 47)}...`;
|
62
|
+
}
|
20
63
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
64
|
+
/* #endregion */
|
65
|
+
|
66
|
+
/* #region Methods */
|
67
|
+
|
68
|
+
/**
|
69
|
+
* Render method
|
70
|
+
* @slot This is a slot test
|
71
|
+
*/
|
72
|
+
public render(): TemplateResult {
|
73
|
+
const showMoreButton = this.fullText.length > 50;
|
74
|
+
const iconName = this.isExpanded ? 'arrowup' : 'arrowdown';
|
75
|
+
|
76
|
+
return html`
|
77
|
+
<div class="nile-form-help-text" part="container">
|
78
|
+
<slot hidden></slot>
|
79
|
+
<div part="text">${this.displayedText}
|
80
|
+
${showMoreButton ? html`
|
81
|
+
<span
|
82
|
+
class="nile-form-help-text__more-button"
|
83
|
+
part="toggle-button"
|
84
|
+
@click=${this.toggleExpanded}
|
85
|
+
>${this.isExpanded ? 'View Less' : 'View More'}
|
86
|
+
<nile-icon color="#005EA6" part="icon" size="14" name="${iconName}"></nile-icon>
|
87
|
+
</span>
|
88
|
+
` : ''}
|
89
|
+
</div>
|
90
|
+
</div>
|
91
|
+
`;
|
92
|
+
}
|
46
93
|
}
|
47
94
|
|
48
95
|
export default NileFormHelpText;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/**
|
2
|
+
* Do not edit directly
|
3
|
+
*/
|
4
|
+
|
5
|
+
export default "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxMi4zNCI+PHBhdGggZD0ibTEwLjM4LDYuNTloLjM4di0uODRoLS4zOGMtLjg2LDAtMS4zMi0uNS0xLjMyLTEuMzZ2LTIuMzdjMC0uNDctLjEtLjg3LS4zLTEuMTloMHMwLS4wMi0uMDEtLjAyaDBjLS4zMy0uNTEtLjkzLS44MS0xLjgtLjgxaC0uOTJ2Ljg0aC43NWMuOTMsMCwxLjI1LjQ0LDEuMjUsMS4yM3YyLjQxYzAsLjk0LjQyLDEuNTUsMS4zMSwxLjctLjg5LjE1LTEuMzEuNzUtMS4zMSwxLjd2Mi40MWMwLC43OC0uMzIsMS4yMy0xLjI1LDEuMjNoLS43NXYuODRoLjkyYy44NywwLDEuNDctLjMsMS44LS44MmgwczAtLjAxLjAxLS4wMmgwYy4yLS4zMi4zLS43Mi4zLTEuMTl2LTIuMzdjMC0uODYuNDYtMS4zNiwxLjMyLTEuMzZaIi8+PHBhdGggZD0ibTE1LjYyLDUuNzVjLS44NiwwLTEuMzItLjUtMS4zMi0xLjM2di0yLjM3YzAtMS4yNC0uNy0yLjAyLTIuMTItMi4wMmgtLjJjLjI1LjI2LjQzLjU3LjU0Ljg5LjU0LjE0Ljc1LjU1Ljc1LDEuMTd2Mi40MWMwLC45NC40MiwxLjU1LDEuMzEsMS43LS44OS4xNS0xLjMxLjc1LTEuMzEsMS43djIuNDFjMCwuNjItLjIsMS4wMy0uNzUsMS4xNy0uMTIuMzMtLjI5LjYzLS41NC44OWguMmMxLjQxLDAsMi4xMi0uNzgsMi4xMi0yLjAydi0yLjM3YzAtLjg2LjQ2LTEuMzYsMS4zMi0xLjM2aC4zOHYtLjg0aC0uMzhaIi8+PHBhdGggZD0ibTEzLjEsNi41OWguMzh2LS44NGgtLjM4Yy0uODYsMC0xLjMyLS41LTEuMzItMS4zNnYtMi4zN2MwLTEuMjQtLjctMi4wMi0yLjEyLTIuMDJoLS40OWMuMjQuMjUuNDEuNTMuNTIuODQuNzguMDYsMS4wNS41LDEuMDUsMS4yMnYyLjQxYzAsLjk0LjQyLDEuNTUsMS4zMSwxLjctLjg5LjE1LTEuMzEuNzUtMS4zMSwxLjd2Mi40MWMwLC43Mi0uMjgsMS4xNi0xLjA1LDEuMjItLjEyLjMxLS4yOS41OS0uNTIuODRoLjQ5YzEuNDEsMCwyLjEyLS43OCwyLjEyLTIuMDJ2LTIuMzdjMC0uODYuNDYtMS4zNiwxLjMyLTEuMzZaIi8+PHBhdGggZD0ibTEuNywyLjAydjIuMzdjMCwuODYtLjQ2LDEuMzYtMS4zMiwxLjM2aC0uMzh2Ljg0aC4zOGMuODYsMCwxLjMyLjUsMS4zMiwxLjM2djIuMzdjMCwxLjI0LjcsMi4wMiwyLjEyLDIuMDJoLjkydi0uODRoLS43NWMtLjkzLDAtMS4yNS0uNDQtMS4yNS0xLjIzdi0yLjQxYzAtLjk0LS40Mi0xLjU1LTEuMzEtMS43Ljg5LS4xNSwxLjMxLS43NSwxLjMxLTEuN3YtMi40MWMwLS43OC4zMi0xLjIzLDEuMjUtMS4yM2guNzV2LS44NGgtLjkyQzIuNCwwLDEuNy43OCwxLjcsMi4wMloiLz48L3N2Zz4=";
|
@@ -15,6 +15,7 @@ export { default as applyfilter } from './apply-filter';
|
|
15
15
|
export { default as approve } from './approve';
|
16
16
|
export { default as aquera } from './aquera';
|
17
17
|
export { default as aquerasupport } from './aquerasupport';
|
18
|
+
export { default as arrayloop } from './array-loop';
|
18
19
|
export { default as array } from './array';
|
19
20
|
export { default as arrayofobject } from './arrayofobject';
|
20
21
|
export { default as arrow } from './arrow';
|
@@ -192,6 +193,7 @@ export { default as infoicon1 } from './info-icon1';
|
|
192
193
|
export { default as info } from './info';
|
193
194
|
export { default as info2 } from './info2';
|
194
195
|
export { default as inprogress } from './inprogress';
|
196
|
+
export { default as integer } from './integer';
|
195
197
|
export { default as itemplaceholder } from './itemplaceholder';
|
196
198
|
export { default as js } from './js';
|
197
199
|
export { default as kill } from './kill';
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/**
|
2
|
+
* Do not edit directly
|
3
|
+
*/
|
4
|
+
|
5
|
+
export default "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PGRlZnM+PHN0eWxlPi5ie3N0cm9rZS13aWR0aDowcHg7fTwvc3R5bGU+PC9kZWZzPjxwb2x5Z29uIGNsYXNzPSJiIiBwb2ludHM9IjMgNS43MyAzIDYuNzYgNC4yNSA2LjI5IDQuMjUgMTEgNS40MSAxMSA1LjQxIDUuMTIgNC40NSA1LjEyIDMgNS43MyIvPjxwYXRoIGNsYXNzPSJiIiBkPSJtMTEuNTcsOC42NWMuNTUtLjUsMS4xNS0xLjA2LDEuMTUtMS45MiwwLTEuMDUtLjgyLTEuNzMtMi4wMy0xLjczcy0xLjk3LjYzLTEuOTcsMS44di4xN2gxLjF2LS4xMmMwLS41Ni4zLS45Ljg3LS45LjUsMCwuODYuMjkuODYuNzksMCwuNDEtLjIzLjcxLS41NSwxLjAzbC0yLjM5LDIuMzV2Ljg4aDQuMDd2LS45NWgtMi42NWwxLjUzLTEuNFoiLz48L3N2Zz4=";
|
@@ -141,6 +141,15 @@ export class NileOption extends NileElement {
|
|
141
141
|
|
142
142
|
/** Returns a plain text label based on the option's content. */
|
143
143
|
getTextLabel() {
|
144
|
+
// Search for a label element inside the component
|
145
|
+
const labelElement = this.querySelector('label');
|
146
|
+
|
147
|
+
// If a label element is found, return its text content
|
148
|
+
if (labelElement) {
|
149
|
+
return labelElement.textContent?.trim() ?? '';
|
150
|
+
}
|
151
|
+
|
152
|
+
// If no label element is found, return the existing behavior
|
144
153
|
return (this.textContent ?? '').trim();
|
145
154
|
}
|
146
155
|
|
@@ -304,6 +304,13 @@ export const styles = css`
|
|
304
304
|
color: #aaaaaa;
|
305
305
|
}
|
306
306
|
|
307
|
+
.select__suffix {
|
308
|
+
flex: 0;
|
309
|
+
display: inline-flex;
|
310
|
+
align-items: center;
|
311
|
+
color: #aaaaaa;
|
312
|
+
}
|
313
|
+
|
307
314
|
/* Clear button */
|
308
315
|
.select__clear {
|
309
316
|
display: inline-flex;
|
@@ -426,6 +433,10 @@ export const styles = css`
|
|
426
433
|
animation: spin 0.6s linear infinite;
|
427
434
|
}
|
428
435
|
|
436
|
+
.select__no-results {
|
437
|
+
padding: 10px;
|
438
|
+
}
|
439
|
+
|
429
440
|
@keyframes spin {
|
430
441
|
0% {
|
431
442
|
transform: rotate(0deg);
|
@@ -218,7 +218,8 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
218
218
|
|
219
219
|
@property({ type: Boolean }) showSelected = false;
|
220
220
|
|
221
|
-
|
221
|
+
|
222
|
+
@property({ type: Boolean }) showNoResults: boolean = false;
|
222
223
|
|
223
224
|
@property({ type: String }) noResultsMessage: string = "No results found";
|
224
225
|
|
@@ -1054,6 +1055,14 @@ export class NileSelect extends NileElement implements NileFormControl {
|
|
1054
1055
|
`
|
1055
1056
|
: ''}
|
1056
1057
|
|
1058
|
+
<slot
|
1059
|
+
part="suffix"
|
1060
|
+
name="suffix"
|
1061
|
+
class=${classMap({
|
1062
|
+
select__suffix: true,
|
1063
|
+
})}
|
1064
|
+
></slot>
|
1065
|
+
|
1057
1066
|
<slot
|
1058
1067
|
name="expand-icon"
|
1059
1068
|
part="expand-icon"
|
@@ -55,6 +55,7 @@ export interface switchInputType {
|
|
55
55
|
error?: boolean;
|
56
56
|
errorMessage?: string;
|
57
57
|
options?: Array<any>;
|
58
|
+
helperText?: string;
|
58
59
|
multiple?: boolean;
|
59
60
|
}
|
60
61
|
|
@@ -139,11 +140,21 @@ export class NileSwitcher extends NileElement {
|
|
139
140
|
}
|
140
141
|
|
141
142
|
renderNileTextArea(Input: switchInputType, inputType: string) {
|
142
|
-
const {
|
143
|
+
const {
|
144
|
+
value,
|
145
|
+
disabled,
|
146
|
+
readonly,
|
147
|
+
errorMessage,
|
148
|
+
error,
|
149
|
+
inputType: inputTypeName,
|
150
|
+
} = Input;
|
151
|
+
|
143
152
|
return html`<nile-textarea
|
144
153
|
.value=${value}
|
145
154
|
.disabled=${disabled}
|
146
155
|
?readonly=${readonly}
|
156
|
+
.error=${error}
|
157
|
+
.errorMessage=${errorMessage}
|
147
158
|
@nile-input=${(e: CustomEvent) => {
|
148
159
|
this.handleChange(e, inputType, inputTypeName);
|
149
160
|
}}
|
@@ -190,16 +201,16 @@ export class NileSwitcher extends NileElement {
|
|
190
201
|
readonly,
|
191
202
|
} = Input;
|
192
203
|
return html`<nile-content-editor
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
204
|
+
.value=${value}
|
205
|
+
.options=${options}
|
206
|
+
.type=${type}
|
207
|
+
.readonly=${readonly}
|
208
|
+
.errorMessage=${errorMessage}
|
209
|
+
@nile-change=${(e: CustomEvent) => {
|
210
|
+
this.handleChange(e, inputType, inputTypeName);
|
211
|
+
}}
|
212
|
+
>
|
213
|
+
</nile-content-editor>`;
|
203
214
|
}
|
204
215
|
|
205
216
|
handleChange(event: CustomEvent, inputType: string, inputTypeName: string) {
|
@@ -214,20 +225,34 @@ export class NileSwitcher extends NileElement {
|
|
214
225
|
this.emit('nile-change', { config: this.nileSwitchConfig });
|
215
226
|
}
|
216
227
|
|
217
|
-
renderIcon() {
|
228
|
+
renderIcon(defaultInput: switchInputType, switchInput: switchInputType) {
|
229
|
+
const defaultHelperText = defaultInput.helperText;
|
230
|
+
const switchHelperText = switchInput.helperText;
|
231
|
+
|
218
232
|
const icon = !this.nileSwitchConfig.toggleSwitch
|
219
233
|
? 'header-functions'
|
220
234
|
: 'stringinput';
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
235
|
+
|
236
|
+
const helperText = !this.nileSwitchConfig.toggleSwitch
|
237
|
+
? !!switchHelperText
|
238
|
+
? switchHelperText
|
239
|
+
: `switch to ${switchInput.inputType}`
|
240
|
+
: !!defaultHelperText
|
241
|
+
? defaultHelperText
|
242
|
+
: `switch to ${defaultInput.inputType}`;
|
243
|
+
|
244
|
+
return html` <nile-tooltip content=${helperText} placement="bottom">
|
245
|
+
<nile-icon
|
246
|
+
size="14"
|
247
|
+
class=${classMap({
|
248
|
+
'pointer-cursor': true,
|
249
|
+
'flex-start': true,
|
250
|
+
})}
|
251
|
+
.name=${icon}
|
252
|
+
color="#005EA6"
|
253
|
+
@click=${this.toggleField}
|
254
|
+
></nile-icon>
|
255
|
+
</nile-tooltip>`;
|
231
256
|
}
|
232
257
|
|
233
258
|
toggleField() {
|
@@ -307,7 +332,7 @@ export class NileSwitcher extends NileElement {
|
|
307
332
|
|
308
333
|
() => this.renderNileTextArea(switchInput, INPUT_TYPE.SWITCH)
|
309
334
|
)}
|
310
|
-
${!disable ? this.renderIcon() : ''}
|
335
|
+
${!disable ? this.renderIcon(defaultInput, switchInput) : ''}
|
311
336
|
`;
|
312
337
|
}
|
313
338
|
public render(): TemplateResult {
|