@aquera/nile-elements 0.0.120 → 0.0.121

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.
Files changed (31) hide show
  1. package/README.md +5 -0
  2. package/dist/nile-button/nile-button.css.cjs.js +1 -1
  3. package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
  4. package/dist/nile-button/nile-button.css.esm.js +24 -28
  5. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  6. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  7. package/dist/nile-calendar/nile-calendar.esm.js +3 -3
  8. package/dist/nile-input/nile-input.test.cjs.js +1 -1
  9. package/dist/nile-input/nile-input.test.cjs.js.map +1 -1
  10. package/dist/nile-input/nile-input.test.esm.js +1 -1
  11. package/dist/nile-popover/nile-popover.cjs.js +1 -1
  12. package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
  13. package/dist/nile-popover/nile-popover.esm.js +2 -2
  14. package/dist/src/nile-button/nile-button.css.js +24 -28
  15. package/dist/src/nile-button/nile-button.css.js.map +1 -1
  16. package/dist/src/nile-calendar/nile-calendar.d.ts +0 -2
  17. package/dist/src/nile-calendar/nile-calendar.js +11 -25
  18. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  19. package/dist/src/nile-input/nile-input.test.js +5 -1
  20. package/dist/src/nile-input/nile-input.test.js.map +1 -1
  21. package/dist/src/nile-popover/nile-popover.d.ts +1 -0
  22. package/dist/src/nile-popover/nile-popover.js +5 -1
  23. package/dist/src/nile-popover/nile-popover.js.map +1 -1
  24. package/dist/tsconfig.tsbuildinfo +1 -1
  25. package/package.json +1 -1
  26. package/rollup.config.js +1 -0
  27. package/src/nile-button/nile-button.css.ts +24 -28
  28. package/src/nile-calendar/nile-calendar.ts +12 -27
  29. package/src/nile-input/nile-input.test.ts +7 -1
  30. package/src/nile-popover/nile-popover.ts +3 -1
  31. package/web-test-runner.config.mjs +6 -1
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent nile-elements following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "nile-elements",
6
- "version": "0.0.120",
6
+ "version": "0.0.121",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
package/rollup.config.js CHANGED
@@ -71,6 +71,7 @@ export default [
71
71
  replace({
72
72
  'Reflect.decorate': 'undefined',
73
73
  'process.env.NODE_ENV': JSON.stringify('production'),
74
+ 'process.env.LIT_DEV_MODE': JSON.stringify('false'),
74
75
  }),
75
76
  resolve(),
76
77
  terser({
@@ -69,10 +69,6 @@ export const styles = css`
69
69
  pointer-events: none;
70
70
  }
71
71
 
72
- .button__label::slotted(nile-icon) {
73
- /* vertical-align: -2px; */
74
- }
75
-
76
72
  /* Primary */
77
73
  .button--standard.button--primary {
78
74
  background-color: var(--nile-colors-button-primary);
@@ -350,92 +346,92 @@ export const styles = css`
350
346
  }
351
347
 
352
348
  /* Primary Variant - Nile Icon Fill */
353
- .button--standard.button--primary ::slotted(nile-icon) {
349
+ .button--standard.button--primary ::slotted(nile-icon:not([color])) {
354
350
  --nile-svg-fill: var(--nile-colors-button-primary-text) !important;
355
351
  }
356
352
  .button--standard.button--primary:hover:not(.button--disabled)
357
- ::slotted(nile-icon),
353
+ ::slotted(nile-icon:not([color])),
358
354
  .button--standard.button--primary:active:not(.button--disabled)
359
- ::slotted(nile-icon) {
355
+ ::slotted(nile-icon:not([color])) {
360
356
  --nile-svg-fill: var(--nile-colors-button-primary-text) !important;
361
357
  }
362
- .button--standard.button--primary.button--disabled ::slotted(nile-icon) {
358
+ .button--standard.button--primary.button--disabled ::slotted(nile-icon:not([color])) {
363
359
  --nile-svg-fill: var(--nile-colors-button-primary-disabled-text) !important;
364
360
  }
365
361
 
366
362
  /* Secondary Variant */
367
- .button--standard.button--secondary ::slotted(nile-icon) {
363
+ .button--standard.button--secondary ::slotted(nile-icon:not([color])) {
368
364
  --nile-svg-fill: var(--nile-colors-button-secondary-text) !important;
369
365
  }
370
366
  .button--standard.button--secondary:hover:not(.button--disabled)
371
- ::slotted(nile-icon),
367
+ ::slotted(nile-icon:not([color])),
372
368
  .button--standard.button--secondary:active:not(.button--disabled)
373
- ::slotted(nile-icon) {
369
+ ::slotted(nile-icon:not([color])) {
374
370
  --nile-svg-fill: var(--nile-colors-button-secondary-text) !important;
375
371
  }
376
- .button--standard.button--secondary.button--disabled ::slotted(nile-icon) {
372
+ .button--standard.button--secondary.button--disabled ::slotted(nile-icon:not([color])) {
377
373
  --nile-svg-fill: var(
378
374
  --nile-colors-button-secondary-disabled-text
379
375
  ) !important;
380
376
  }
381
377
 
382
378
  /* Tertiary Variant */
383
- .button--standard.button--tertiary ::slotted(nile-icon) {
379
+ .button--standard.button--tertiary ::slotted(nile-icon:not([color])) {
384
380
  --nile-svg-fill: var(--nile-colors-button-tertiary-text) !important;
385
381
  }
386
382
  .button--standard.button--tertiary:hover:not(.button--disabled)
387
- ::slotted(nile-icon),
383
+ ::slotted(nile-icon:not([color])),
388
384
  .button--standard.button--tertiary:active:not(.button--disabled)
389
- ::slotted(nile-icon) {
385
+ ::slotted(nile-icon:not([color])) {
390
386
  --nile-svg-fill: var(--nile-colors-button-tertiary-text) !important;
391
387
  }
392
- .button--standard.button--tertiary.button--disabled ::slotted(nile-icon) {
388
+ .button--standard.button--tertiary.button--disabled ::slotted(nile-icon:not([color])) {
393
389
  --nile-svg-fill: var(
394
390
  --nile-colors-button-tertiary-disabled-text
395
391
  ) !important;
396
392
  }
397
393
 
398
394
  /* Ghost Variant */
399
- .button--standard.button--ghost ::slotted(nile-icon) {
395
+ .button--standard.button--ghost ::slotted(nile-icon:not([color])) {
400
396
  --nile-svg-fill: var(--nile-colors-button-tertiary-text) !important;
401
397
  }
402
398
  .button--standard.button--ghost:hover:not(.button--disabled)
403
- ::slotted(nile-icon),
399
+ ::slotted(nile-icon:not([color])),
404
400
  .button--standard.button--ghost:active:not(.button--disabled)
405
- ::slotted(nile-icon) {
401
+ ::slotted(nile-icon:not([color])) {
406
402
  --nile-svg-fill: var(--nile-colors-button-tertiary-text) !important;
407
403
  }
408
- .button--standard.button--ghost ::slotted(nile-icon) {
404
+ .button--standard.button--ghost ::slotted(nile-icon:not([color])) {
409
405
  --nile-svg-fill: var(
410
406
  --nile-colors-button-tertiary-disabled-text
411
407
  ) !important;
412
408
  }
413
409
 
414
410
  /* Caution Variant */
415
- .button--standard.button--caution ::slotted(nile-icon) {
411
+ .button--standard.button--caution ::slotted(nile-icon:not([color])) {
416
412
  --nile-svg-fill: var(--nile-colors-button-caution-text) !important;
417
413
  }
418
414
  .button--standard.button--caution:hover:not(.button--disabled)
419
- ::slotted(nile-icon),
415
+ ::slotted(nile-icon:not([color])),
420
416
  .button--standard.button--caution:active:not(.button--disabled)
421
- ::slotted(nile-icon) {
417
+ ::slotted(nile-icon:not([color])) {
422
418
  --nile-svg-fill: var(--nile-colors-button-caution-text) !important;
423
419
  }
424
- .button--standard.button--caution.button--disabled ::slotted(nile-icon) {
420
+ .button--standard.button--caution.button--disabled ::slotted(nile-icon:not([color])) {
425
421
  --nile-svg-fill: var(--nile-colors-button-caution-disabled-text) !important;
426
422
  }
427
423
 
428
424
  /* destructive */
429
- .button--standard.button--destructive ::slotted(nile-icon) {
425
+ .button--standard.button--destructive ::slotted(nile-icon:not([color])) {
430
426
  --nile-svg-fill: #fff !important;
431
427
  }
432
428
  .button--standard.button--destructive:hover:not(.button--disabled)
433
- ::slotted(nile-icon),
429
+ ::slotted(nile-icon:not([color])),
434
430
  .button--standard.button--caution:active:not(.button--disabled)
435
- ::slotted(nile-icon) {
431
+ ::slotted(nile-icon:not([color])) {
436
432
  --nile-svg-fill: #fff !important;
437
433
  }
438
- .button--standard.button--destructive.button--disabled ::slotted(nile-icon) {
434
+ .button--standard.button--destructive.button--disabled ::slotted(nile-icon:not([color])) {
439
435
  --nile-svg-fill: #fff !important;
440
436
  }
441
437
 
@@ -91,8 +91,13 @@ export class NileCalendar extends NileElement {
91
91
 
92
92
  protected updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {
93
93
  super.updated(changedProperties);
94
-
95
94
  if (changedProperties.has('valueAttribute')) {
95
+ if(!this.valueAttribute){
96
+ this.value=null;
97
+ this.startDate=null;
98
+ this.endDate=null;
99
+ this.isSelectingStart=true;
100
+ }
96
101
  const date = new Date(this.valueAttribute || '');
97
102
  if (!isNaN(date.getTime())) {
98
103
  const offset = date.getTimezoneOffset();
@@ -100,15 +105,8 @@ export class NileCalendar extends NileElement {
100
105
  this.currentMonth = this.value.getMonth();
101
106
  this.currentYear = this.value.getFullYear();
102
107
  }
103
- }
104
- }
105
-
106
- attributeChangedCallback(name: string, _old: string | null, newValue: string | null): void {
107
- if (name === 'value') {
108
- this.valueAttribute = newValue;
109
108
  this.initializeValue();
110
- }
111
- super.attributeChangedCallback(name, _old, newValue);
109
+ }
112
110
  }
113
111
 
114
112
  @watch('allowedDates')
@@ -136,21 +134,6 @@ export class NileCalendar extends NileElement {
136
134
  }
137
135
  }
138
136
 
139
- @watch('value')
140
- valueChanged() {
141
- if (this.range && this.value) {
142
- this.value = null;
143
- return;
144
- }
145
-
146
- if (this.value && !isNaN(this.value.getTime())) {
147
- const offset = this.value.getTimezoneOffset();
148
- const localDate = new Date(this.value.getTime() - offset * 60 * 1000);
149
- if (!isNaN(localDate.getTime())) {
150
- this.valueAttribute = localDate.toISOString().split('T')[0];
151
- }
152
- }
153
- }
154
137
 
155
138
  /**
156
139
  * Render method
@@ -291,7 +274,7 @@ export class NileCalendar extends NileElement {
291
274
  inputmode="numeric"
292
275
  type="number"
293
276
  value="${this.selectedValue}"
294
- @nile-input="${this.handleDurationChange}"
277
+ @nile-change="${this.handleDurationChange}"
295
278
  placeholder="Enter Value"
296
279
  ></nile-input>
297
280
 
@@ -497,11 +480,9 @@ export class NileCalendar extends NileElement {
497
480
  this.valueAttribute='';
498
481
  this.startDate=null;
499
482
  this.endDate=null;
500
- this.emitChangedData(null)
501
483
  }
502
484
  else{
503
485
  this.value=null;
504
- this.emitChangedData({value:null})
505
486
  }
506
487
  this.emit('nile-clear')
507
488
  }
@@ -587,6 +568,7 @@ export class NileCalendar extends NileElement {
587
568
  * Function to handle relative date selection
588
569
  */
589
570
  handleDurationChange(event: CustomEvent) {
571
+ event.stopPropagation()
590
572
  event.detail.value = event.detail.value.replace(/e/gi, "");
591
573
  const duration=Number(event.detail.value);
592
574
  if(!duration) {
@@ -599,6 +581,7 @@ export class NileCalendar extends NileElement {
599
581
  }
600
582
 
601
583
  handleUnitChange(event: any) {
584
+ event.stopPropagation()
602
585
  this.selectedUnit = event.detail.value;
603
586
  if (this.selectedUnit && this.selectedValue) {
604
587
  this.handleTimeValueClick(this.selectedUnit, this.selectedValue, event);
@@ -646,6 +629,7 @@ export class NileCalendar extends NileElement {
646
629
  * Function to handle start time selecion
647
630
  */
648
631
  private handleStartTimeInput(event: CustomEvent): void {
632
+ event.stopPropagation()
649
633
  if (!this.startDate) {
650
634
  this.startDate = null;
651
635
  return;
@@ -663,6 +647,7 @@ export class NileCalendar extends NileElement {
663
647
  * Function to handle end time selecion
664
648
  */
665
649
  private handleEndTimeInput(event: CustomEvent): void {
650
+ event.stopPropagation()
666
651
  if (!this.endDate) {
667
652
  this.endDate = null;
668
653
  return;
@@ -71,8 +71,14 @@ describe('nile-input', () => {
71
71
  el.value = '123';
72
72
  el.reportValidity();
73
73
  await el.updateComplete;
74
- expect(el.validationMessage).to.equal('Please match the format requested.');
74
+
75
+ const validMessages = [
76
+ 'Please match the requested format.',
77
+ 'Please match the format requested.'
78
+ ];
79
+ expect(validMessages).to.include(el.validationMessage);
75
80
  });
81
+
76
82
 
77
83
  it('should emit events on blur', async () => {
78
84
  const el = await fixture<NileInput>(html`<nile-input></nile-input>`);
@@ -57,6 +57,8 @@ export class NilePopover extends NileElement {
57
57
  /** The distance in pixels from which to offset the popover away from its target. */
58
58
  @property({ type: Number }) distance = 18;
59
59
 
60
+ @property({ type: Boolean, reflect: true }) preventOverlayClose = false;
61
+
60
62
  @property({ type: Boolean, attribute: 'arrow' }) arrow = true;
61
63
 
62
64
  /** Gives the title to the popover */
@@ -155,7 +157,7 @@ export class NilePopover extends NileElement {
155
157
  };
156
158
 
157
159
  private handleDocumentClick = () => {
158
- if (this.isShow) {
160
+ if (this.isShow && !this.preventOverlayClose) {
159
161
  this.isShow = false;
160
162
  }
161
163
  };
@@ -29,7 +29,12 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
29
29
 
30
30
  /** Browsers to run tests on */
31
31
  browsers: [
32
- puppeteerLauncher({ launchOptions: { headless: true } }),
32
+ puppeteerLauncher({
33
+ launchOptions: {
34
+ headless: true,
35
+ args: ['--no-sandbox', '--disable-setuid-sandbox'],
36
+ },
37
+ }),
33
38
  ],
34
39
 
35
40
  /** Test framework configuration */