@aquera/nile-elements 0.0.24 → 0.0.26

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 (30) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js +4 -0
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js.map +1 -1
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.d.ts +1 -0
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +32 -19
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tooltip/nile-tooltip.css.js +1 -0
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  9. package/dist/index.iife.js +11 -5
  10. package/dist/nile-select/nile-select.cjs.js +1 -1
  11. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  12. package/dist/nile-select/nile-select.css.cjs.js +1 -1
  13. package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
  14. package/dist/nile-select/nile-select.css.esm.js +4 -0
  15. package/dist/nile-select/nile-select.esm.js +6 -5
  16. package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
  17. package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
  18. package/dist/nile-tooltip/nile-tooltip.css.esm.js +1 -0
  19. package/dist/src/nile-select/nile-select.css.js +4 -0
  20. package/dist/src/nile-select/nile-select.css.js.map +1 -1
  21. package/dist/src/nile-select/nile-select.d.ts +1 -0
  22. package/dist/src/nile-select/nile-select.js +32 -19
  23. package/dist/src/nile-select/nile-select.js.map +1 -1
  24. package/dist/src/nile-tooltip/nile-tooltip.css.js +1 -0
  25. package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
  26. package/dist/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +1 -1
  28. package/src/nile-select/nile-select.css.ts +4 -0
  29. package/src/nile-select/nile-select.ts +31 -20
  30. package/src/nile-tooltip/nile-tooltip.css.ts +1 -0
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.24",
6
+ "version": "0.0.26",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -445,6 +445,10 @@ export const styles = css`
445
445
  transform: rotate(360deg);
446
446
  }
447
447
  }
448
+
449
+ .select__invisible{
450
+ opacity: 0;
451
+ }
448
452
  `;
449
453
 
450
454
  export default [styles];
@@ -218,6 +218,8 @@ export class NileSelect extends NileElement implements NileFormControl {
218
218
 
219
219
  @property({ type: Boolean }) showSelected = false;
220
220
 
221
+ @state() oldMaxOptionsVisible: number = 1;
222
+
221
223
  @property({ type: Boolean }) showNoResults: boolean = false;
222
224
 
223
225
  @property({ type: String }) noResultsMessage: string = 'No results found';
@@ -611,27 +613,29 @@ export class NileSelect extends NileElement implements NileFormControl {
611
613
  // Get all options as an array
612
614
  const options = [...this.querySelectorAll<NileOption>('nile-option')];
613
615
 
614
- // Sort the options based on the order of values in this.oldValue
615
- options.sort((a, b) => {
616
- let indexA = this.oldValue.indexOf(a.value);
617
- let indexB = this.oldValue.indexOf(b.value);
616
+ // Sort the options based on the order of values selected
617
+ if (this.multiple && this.oldValue?.length > 0) {
618
+ options.sort((a, b) => {
619
+ let indexA = this.oldValue.indexOf(a.value);
620
+ let indexB = this.oldValue.indexOf(b.value);
618
621
 
619
- // Handle cases where a __value is not found in this.oldValue
620
- if (indexA === -1) {
621
- indexA = Infinity; // Place at the end if not found
622
- }
623
- if (indexB === -1) {
624
- indexB = Infinity; // Place at the end if not found
625
- }
622
+ // Handle cases where a __value is not found
623
+ if (indexA === -1) {
624
+ indexA = Infinity; // Place at the end if not found
625
+ }
626
+ if (indexB === -1) {
627
+ indexB = Infinity; // Place at the end if not found
628
+ }
626
629
 
627
- if (indexA < indexB) {
628
- return -1;
629
- }
630
- if (indexA > indexB) {
631
- return 1;
632
- }
633
- return 0;
634
- });
630
+ if (indexA < indexB) {
631
+ return -1;
632
+ }
633
+ if (indexA > indexB) {
634
+ return 1;
635
+ }
636
+ return 0;
637
+ });
638
+ }
635
639
 
636
640
  return options;
637
641
  }
@@ -935,8 +939,12 @@ export class NileSelect extends NileElement implements NileFormControl {
935
939
  }
936
940
 
937
941
  calculateTotalWidthOfTags() {
938
- this.maxOptionsVisible = Infinity;
939
942
 
943
+ if(this.maxOptionsVisible !== Infinity){
944
+ this.oldMaxOptionsVisible = this.maxOptionsVisible;
945
+ }
946
+
947
+ this.maxOptionsVisible = Infinity;
940
948
  setTimeout(() => {
941
949
  let widths: number[] = [];
942
950
  if (this.shadowRoot) {
@@ -1088,8 +1096,11 @@ export class NileSelect extends NileElement implements NileFormControl {
1088
1096
  index < this.maxOptionsVisible ||
1089
1097
  this.maxOptionsVisible <= 0
1090
1098
  ) {
1099
+ const classes = {
1100
+ 'select__invisible': index + 1 > this.oldMaxOptionsVisible && this.maxOptionsVisible === Infinity };
1091
1101
  return html`
1092
1102
  <nile-tag
1103
+ class=${classMap(classes)}
1093
1104
  part="tag"
1094
1105
  exportparts="
1095
1106
  base:tag__base,
@@ -58,6 +58,7 @@ export const styles = css`
58
58
  color: hsl(0, 0%, 100%);
59
59
  padding: 0.25rem 0.5rem;
60
60
  pointer-events: none;
61
+ word-break: break-all;
61
62
  }
62
63
  `;
63
64