@aquera/nile-elements 0.0.50 → 0.0.52
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/demo/variables.css +1 -0
- package/demo/variables_v2.css +5 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +507 -231
- 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.css.cjs.js +1 -1
- package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.css.esm.js +340 -100
- package/dist/nile-button/nile-button.esm.js +11 -4
- 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 +15 -9
- package/dist/nile-calendar/nile-calendar.esm.js +4 -4
- package/dist/nile-card/nile-card.css.cjs.js +1 -1
- package/dist/nile-card/nile-card.css.cjs.js.map +1 -1
- package/dist/nile-card/nile-card.css.esm.js +2 -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.css.cjs.js +1 -1
- package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.css.esm.js +22 -6
- package/dist/nile-input/nile-input.esm.js +9 -3
- package/dist/src/nile-button/nile-button.css.js +338 -98
- package/dist/src/nile-button/nile-button.css.js.map +1 -1
- package/dist/src/nile-button/nile-button.d.ts +2 -1
- package/dist/src/nile-button/nile-button.js +22 -4
- package/dist/src/nile-button/nile-button.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.css.js +15 -9
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.js +6 -3
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-card/nile-card.css.js +2 -1
- package/dist/src/nile-card/nile-card.css.js.map +1 -1
- package/dist/src/nile-input/nile-input.css.js +22 -6
- package/dist/src/nile-input/nile-input.css.js.map +1 -1
- package/dist/src/nile-input/nile-input.d.ts +2 -1
- package/dist/src/nile-input/nile-input.js +20 -6
- package/dist/src/nile-input/nile-input.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-button/nile-button.css.ts +338 -98
- package/src/nile-button/nile-button.ts +52 -11
- package/src/nile-calendar/nile-calendar.css.ts +15 -9
- package/src/nile-calendar/nile-calendar.ts +10 -5
- package/src/nile-card/nile-card.css.ts +2 -1
- package/src/nile-input/nile-input.css.ts +22 -6
- package/src/nile-input/nile-input.ts +23 -9
@@ -15,7 +15,7 @@ export const styles = css`
|
|
15
15
|
}
|
16
16
|
|
17
17
|
.calendar-container {
|
18
|
-
font-family:var(--nile-font-family-serif);
|
18
|
+
font-family: var(--nile-font-family-serif);
|
19
19
|
width: 290px;
|
20
20
|
height: auto;
|
21
21
|
text-align: center;
|
@@ -125,6 +125,12 @@ export const styles = css`
|
|
125
125
|
color: white;
|
126
126
|
}
|
127
127
|
|
128
|
+
.selected-date:hover,
|
129
|
+
.range-start:hover,
|
130
|
+
.range-end:hover {
|
131
|
+
background: #a5d3f3;
|
132
|
+
}
|
133
|
+
|
128
134
|
.range-start {
|
129
135
|
background: #a5d3f3;
|
130
136
|
border-radius: 4px 0 0 4px;
|
@@ -174,9 +180,9 @@ export const styles = css`
|
|
174
180
|
margin-top: 6px;
|
175
181
|
padding: 0 16px;
|
176
182
|
width: 290px;
|
177
|
-
display:flex;
|
178
|
-
flex-wrap:wrap;
|
179
|
-
gap:8px;
|
183
|
+
display: flex;
|
184
|
+
flex-wrap: wrap;
|
185
|
+
gap: 8px;
|
180
186
|
}
|
181
187
|
|
182
188
|
.calender-input--relative {
|
@@ -189,11 +195,11 @@ export const styles = css`
|
|
189
195
|
justify-content: space-between;
|
190
196
|
gap: 8px;
|
191
197
|
margin-top: 12px;
|
192
|
-
width:auto;
|
198
|
+
width: auto;
|
193
199
|
}
|
194
200
|
|
195
201
|
.manual-input {
|
196
|
-
width:125px;
|
202
|
+
width: 125px;
|
197
203
|
}
|
198
204
|
|
199
205
|
.manual-input-label {
|
@@ -239,7 +245,7 @@ export const styles = css`
|
|
239
245
|
display: flex;
|
240
246
|
flex-direction: column;
|
241
247
|
width: 352px;
|
242
|
-
gap:10px;
|
248
|
+
gap: 10px;
|
243
249
|
padding: 24px 24px 0 24px;
|
244
250
|
}
|
245
251
|
|
@@ -247,7 +253,7 @@ export const styles = css`
|
|
247
253
|
display: flex;
|
248
254
|
flex-direction: column;
|
249
255
|
align-items: start;
|
250
|
-
justify-content:center;
|
256
|
+
justify-content: center;
|
251
257
|
gap: 12px;
|
252
258
|
}
|
253
259
|
|
@@ -347,7 +353,7 @@ export const styles = css`
|
|
347
353
|
|
348
354
|
.not-allowed {
|
349
355
|
pointer-events: none;
|
350
|
-
color:var(--nile-colors-dark-500);
|
356
|
+
color: var(--nile-colors-dark-500);
|
351
357
|
}
|
352
358
|
`;
|
353
359
|
|
@@ -92,7 +92,7 @@ export class NileCalendar extends NileElement {
|
|
92
92
|
|
93
93
|
firstUpdated() {
|
94
94
|
const allowedDatesAttribute = this.getAttribute('allowed-dates');
|
95
|
-
|
95
|
+
|
96
96
|
if (allowedDatesAttribute !== null ) {
|
97
97
|
try {
|
98
98
|
this.allowedDates = JSON.parse(allowedDatesAttribute);
|
@@ -145,6 +145,11 @@ export class NileCalendar extends NileElement {
|
|
145
145
|
|
146
146
|
@watch('value')
|
147
147
|
valueChanged() {
|
148
|
+
|
149
|
+
if (typeof this.value === 'object' && this.value !== null) {
|
150
|
+
this.value = JSON.stringify(this.value);
|
151
|
+
}
|
152
|
+
|
148
153
|
if (this.range && this.value) {
|
149
154
|
this.rangeValue = this.value;
|
150
155
|
this.value = null;
|
@@ -879,8 +884,8 @@ export class NileCalendar extends NileElement {
|
|
879
884
|
}"> </nile-input>
|
880
885
|
</div>
|
881
886
|
</div>
|
882
|
-
|
883
|
-
<div>
|
887
|
+
|
888
|
+
<div>
|
884
889
|
<span class="manual-input-label">To </span>
|
885
890
|
<div class="from">
|
886
891
|
<nile-input class="manual-input" value="${this.formatDate(
|
@@ -895,7 +900,7 @@ export class NileCalendar extends NileElement {
|
|
895
900
|
}"> </nile-input>
|
896
901
|
</div>
|
897
902
|
</div>
|
898
|
-
|
903
|
+
|
899
904
|
</div>
|
900
905
|
<div class="button-container">
|
901
906
|
<nile-button class="apply-button" ?disabled="${
|
@@ -916,4 +921,4 @@ declare global {
|
|
916
921
|
interface HTMLElementTagNameMap {
|
917
922
|
'nile-calendar': NileCalendar;
|
918
923
|
}
|
919
|
-
}
|
924
|
+
}
|
@@ -58,8 +58,9 @@ export const styles = css`
|
|
58
58
|
border-top: solid var(--border-width) var(--border-color);
|
59
59
|
padding: var(--footer-padding);
|
60
60
|
border:1px solid var(--nile-card-footer-border-color);
|
61
|
-
|
61
|
+
border-width: var(--nile-card-footer-border-width);
|
62
62
|
border-radius:var(--nile-card-footer-border-radius);
|
63
|
+
background-color:var(--nile-card-footer-background-color);
|
63
64
|
}
|
64
65
|
|
65
66
|
.card:not(.card--has-footer) .card__footer {
|
@@ -477,19 +477,35 @@ export const styles = css`
|
|
477
477
|
}
|
478
478
|
|
479
479
|
.input__non-printable {
|
480
|
-
width: 280px;
|
481
|
-
height: 12px;
|
482
480
|
border-radius: 4px;
|
483
|
-
|
484
|
-
|
485
|
-
|
481
|
+
max-width: 400px;
|
482
|
+
background-color: var(--nile-colors-white-base);
|
483
|
+
border: 1px solid var(--nile-colors-red-500);
|
484
|
+
color: var(--nile-colors-red-500);
|
486
485
|
padding: 10px;
|
487
486
|
font-size: 12px;
|
487
|
+
max-height: 300px;
|
488
|
+
overflow-y: scroll;
|
488
489
|
}
|
489
490
|
|
490
491
|
.input__remove-non-printable {
|
491
|
-
color:
|
492
|
+
color: var(--nile-colors-red-500);
|
492
493
|
margin-left: 10px;
|
494
|
+
font-size: 14px;
|
495
|
+
color: var(--nile-colors-dark-900);
|
496
|
+
}
|
497
|
+
|
498
|
+
.input__srtiked-text-container {
|
499
|
+
margin-top: 4px;
|
500
|
+
color: var(--nile-colors-dark-900);
|
501
|
+
word-wrap: break-all;
|
502
|
+
}
|
503
|
+
|
504
|
+
.input__srtiked-text {
|
505
|
+
text-decoration: line-through;
|
506
|
+
text-decoration-color: var(--nile-colors-white-base);
|
507
|
+
color: var(--nile-colors-white-base);
|
508
|
+
background-color: var(--nile-colors-red-500);
|
493
509
|
}
|
494
510
|
`;
|
495
511
|
|
@@ -25,6 +25,7 @@ import { live } from 'lit/directives/live.js';
|
|
25
25
|
import { watch } from '../internal/watch';
|
26
26
|
import type { CSSResultGroup } from 'lit';
|
27
27
|
import NileElement, { NileFormControl } from '../internal/nile-element';
|
28
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
28
29
|
|
29
30
|
/**
|
30
31
|
* Nile icon component.
|
@@ -227,6 +228,8 @@ export class NileInput extends NileElement implements NileFormControl {
|
|
227
228
|
|
228
229
|
@state() hasPrintableCharacters: boolean = false;
|
229
230
|
|
231
|
+
@state() markedValue: string;
|
232
|
+
|
230
233
|
connectedCallback() {
|
231
234
|
super.connectedCallback();
|
232
235
|
this.emit('nile-init');
|
@@ -360,29 +363,32 @@ export class NileInput extends NileElement implements NileFormControl {
|
|
360
363
|
await this.updateComplete;
|
361
364
|
|
362
365
|
if(this.checkNonPrintableChar){
|
363
|
-
this.
|
366
|
+
this.markNonPrintableCharacters();
|
364
367
|
}
|
365
368
|
}
|
366
369
|
|
367
|
-
|
368
370
|
/** checks non printable characters in the value. */
|
369
|
-
|
371
|
+
markNonPrintableCharacters() {
|
372
|
+
let markedValue = '';
|
370
373
|
this.hasPrintableCharacters = false;
|
371
|
-
|
372
374
|
if (this.value) {
|
373
375
|
for (let i = 0, n = this.value.length; i < n; i++) {
|
374
376
|
const charCode = this.value.charCodeAt(i);
|
375
377
|
|
376
|
-
// Check if the character is non-printable
|
377
378
|
if ((charCode > 255 && charCode !== 9109) || [129, 143, 144, 157, 160].includes(charCode)) {
|
379
|
+
markedValue += `<span class="input__srtiked-text">${this.value.charAt(i)}</span>`;
|
378
380
|
this.hasPrintableCharacters = true;
|
379
|
-
|
380
|
-
|
381
|
+
} else {
|
382
|
+
markedValue += this.value.charAt(i);
|
381
383
|
}
|
382
384
|
}
|
383
385
|
}
|
386
|
+
|
387
|
+
this.markedValue = markedValue;
|
388
|
+
this.emit('nile-value-marked', { value: this.markedValue, hasNonPrintableCharacters: this.hasPrintableCharacters });
|
384
389
|
}
|
385
390
|
|
391
|
+
|
386
392
|
/** Removes all non printable characters from the value. */
|
387
393
|
removeAllNonPrintableCharacters() {
|
388
394
|
let cleanedValue = '';
|
@@ -657,9 +663,17 @@ export class NileInput extends NileElement implements NileFormControl {
|
|
657
663
|
</div>
|
658
664
|
|
659
665
|
<div class="input__non-printable">
|
660
|
-
Non-printable character detected
|
666
|
+
Non-printable character detected.
|
667
|
+
<nile-badge variant="error" @click=${
|
661
668
|
this.removeAllNonPrintableCharacters
|
662
|
-
}>
|
669
|
+
} class="input__remove-non-printable" >
|
670
|
+
Remove All
|
671
|
+
</nile-badge>
|
672
|
+
|
673
|
+
<div class="input__srtiked-text-container"> ${unsafeHTML(
|
674
|
+
this.markedValue
|
675
|
+
)} </div>
|
676
|
+
|
663
677
|
</div>
|
664
678
|
</nile-popup>
|
665
679
|
</div>
|