@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.
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.d.ts +5 -5
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js +9 -5
- 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 +17 -3
- 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/tsconfig.tsbuildinfo +1 -1
- package/dist/index.iife.js +75 -65
- 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 +4 -0
- package/dist/nile-select/nile-select.esm.js +18 -12
- package/dist/src/nile-select/nile-select.css.d.ts +5 -5
- package/dist/src/nile-select/nile-select.css.js +9 -5
- package/dist/src/nile-select/nile-select.css.js.map +1 -1
- package/dist/src/nile-select/nile-select.js +17 -3
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-select/nile-select.css.ts +9 -5
- package/src/nile-select/nile-select.ts +19 -6
package/package.json
CHANGED
@@ -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]
|
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
|
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)}
|