@aquera/nile-elements 0.0.44 → 0.0.45

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 (22) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.d.ts +5 -5
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js +9 -5
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js.map +1 -1
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +17 -3
  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/tsconfig.tsbuildinfo +1 -1
  7. package/dist/index.iife.js +75 -65
  8. package/dist/nile-select/nile-select.cjs.js +1 -1
  9. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  10. package/dist/nile-select/nile-select.css.cjs.js +1 -1
  11. package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
  12. package/dist/nile-select/nile-select.css.esm.js +4 -0
  13. package/dist/nile-select/nile-select.esm.js +18 -12
  14. package/dist/src/nile-select/nile-select.css.d.ts +5 -5
  15. package/dist/src/nile-select/nile-select.css.js +9 -5
  16. package/dist/src/nile-select/nile-select.css.js.map +1 -1
  17. package/dist/src/nile-select/nile-select.js +17 -3
  18. package/dist/src/nile-select/nile-select.js.map +1 -1
  19. package/dist/tsconfig.tsbuildinfo +1 -1
  20. package/package.json +1 -1
  21. package/src/nile-select/nile-select.css.ts +9 -5
  22. package/src/nile-select/nile-select.ts +19 -6
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.44",
6
+ "version": "0.0.45",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Copyright Aquera Inc 2023
3
- *
4
- * This source code is licensed under the BSD-3-Clause license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
2
+ * Copyright Aquera Inc 2023
3
+ *
4
+ * This source code is licensed under the BSD-3-Clause license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
7
 
8
8
  import {css} from 'lit-element';
9
9
 
@@ -451,6 +451,10 @@ export const styles = css`
451
451
  .select__prefix--from-options {
452
452
  margin-inline-end: 12px;
453
453
  }
454
+
455
+ .select__hide-default{
456
+ display: none;
457
+ }
454
458
  `;
455
459
 
456
460
  export default [styles];
@@ -531,7 +531,7 @@ export class NileSelect extends NileElement implements NileFormControl {
531
531
  const target = event.target as HTMLElement;
532
532
  const option = target.closest('nile-option');
533
533
 
534
- if(this.blockValueChange && option){
534
+ if (this.blockValueChange && option) {
535
535
  this.emit('nile-block-change', { value: option?.value, name: this.name });
536
536
  this.hide();
537
537
  return;
@@ -951,8 +951,7 @@ export class NileSelect extends NileElement implements NileFormControl {
951
951
  }
952
952
 
953
953
  calculateTotalWidthOfTags() {
954
-
955
- if(this.maxOptionsVisible !== Infinity){
954
+ if (this.maxOptionsVisible !== Infinity) {
956
955
  this.oldMaxOptionsVisible = this.maxOptionsVisible;
957
956
  }
958
957
 
@@ -999,6 +998,7 @@ export class NileSelect extends NileElement implements NileFormControl {
999
998
  const hasLabelSlot = this.hasSlotController.test('label');
1000
999
  const hasHelpTextSlot = this.hasSlotController.test('help-text');
1001
1000
  const hasLabelSuffixSlot = this.hasSlotController.test('label-suffix');
1001
+ const hasCustomSelect = this.hasSlotController.test('custom-select');
1002
1002
  const hasLabel = this.label ? true : !!hasLabelSlot;
1003
1003
  const hasClearIcon =
1004
1004
  this.clearable && !this.disabled && this.value.length > 0;
@@ -1006,7 +1006,9 @@ export class NileSelect extends NileElement implements NileFormControl {
1006
1006
  const searchValue = this.searchValue || '';
1007
1007
  const hasHelpText = this.helpText ? true : false;
1008
1008
  const hasErrorMessage = this.errorMessage ? true : false;
1009
- const prefixContent = this.selectedOptions[0] ? this.getOptionPrefix(this.selectedOptions[0]) : '';
1009
+ const prefixContent = this.selectedOptions[0]
1010
+ ? this.getOptionPrefix(this.selectedOptions[0])
1011
+ : '';
1010
1012
 
1011
1013
  return html`
1012
1014
  <div
@@ -1062,14 +1064,25 @@ export class NileSelect extends NileElement implements NileFormControl {
1062
1064
  auto-size="vertical"
1063
1065
  auto-size-padding="10"
1064
1066
  >
1067
+ ${hasCustomSelect
1068
+ ? html`<slot
1069
+ slot="anchor"
1070
+ name="custom-select"
1071
+ class="custom-select"
1072
+ @keydown=${this.handleComboboxKeyDown}
1073
+ @mousedown=${this.handleComboboxMouseDown}
1074
+ ></slot>`
1075
+ : html``}
1065
1076
  <div
1066
1077
  part="combobox"
1067
- class="select__combobox"
1078
+ class=${classMap({
1079
+ select__combobox: true,
1080
+ 'select__hide-default': hasCustomSelect,
1081
+ })}
1068
1082
  slot="anchor"
1069
1083
  @keydown=${this.handleComboboxKeyDown}
1070
1084
  @mousedown=${this.handleComboboxMouseDown}
1071
1085
  >
1072
-
1073
1086
  ${prefixContent && !this.multiple
1074
1087
  ? html`<div class="select__prefix--from-options">
1075
1088
  ${unsafeHTML(prefixContent)}