@aquera/nile-elements 0.0.6-7 → 0.0.6-8

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 (36) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js +3 -0
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js.map +1 -1
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.js +3 -0
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +3 -0
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +9 -22
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  10. package/dist/index.iife.js +34 -25
  11. package/dist/nile-input/nile-input.cjs.js +1 -1
  12. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  13. package/dist/nile-input/nile-input.esm.js +7 -5
  14. package/dist/nile-radio-group/nile-radio-group.cjs.js +1 -1
  15. package/dist/nile-radio-group/nile-radio-group.cjs.js.map +1 -1
  16. package/dist/nile-radio-group/nile-radio-group.esm.js +9 -7
  17. package/dist/nile-select/nile-select.cjs.js +1 -1
  18. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  19. package/dist/nile-select/nile-select.esm.js +10 -8
  20. package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
  21. package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
  22. package/dist/nile-switcher/nile-switcher.esm.js +8 -5
  23. package/dist/src/nile-input/nile-input.js +3 -0
  24. package/dist/src/nile-input/nile-input.js.map +1 -1
  25. package/dist/src/nile-radio-group/nile-radio-group.js +3 -0
  26. package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
  27. package/dist/src/nile-select/nile-select.js +3 -0
  28. package/dist/src/nile-select/nile-select.js.map +1 -1
  29. package/dist/src/nile-switcher/nile-switcher.js +9 -22
  30. package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +1 -1
  33. package/src/nile-input/nile-input.ts +3 -0
  34. package/src/nile-radio-group/nile-radio-group.ts +3 -0
  35. package/src/nile-select/nile-select.ts +3 -0
  36. package/src/nile-switcher/nile-switcher.ts +10 -21
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.6-7",
6
+ "version": "0.0.6-8",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -445,6 +445,7 @@ export class NileInput extends NileElement implements NileFormControl {
445
445
  const hasLabelSlot = this.hasSlotController.test('label');
446
446
  const hasHelpTextSlot = this.hasSlotController.test('help-text');
447
447
  const hasLabel = this.label ? true : !!hasLabelSlot;
448
+ const hasLabelSuffixSlot = this.hasSlotController.test('label-suffix');
448
449
  const hasHelpText = this.helpText ? true : false;
449
450
  const hasErrorMessage = this.errorMessage ? true : false;
450
451
  const hasClearIcon =
@@ -474,6 +475,8 @@ export class NileInput extends NileElement implements NileFormControl {
474
475
  <slot name="label">${this.label}</slot>
475
476
  </label>
476
477
 
478
+ ${hasLabelSuffixSlot ? html` <slot name="label-suffix"></slot> ` : ``}
479
+
477
480
  <div part="form-control-input" class="form-control-input">
478
481
  <div
479
482
  part="base"
@@ -209,6 +209,7 @@ export class NileRadioGroup extends NileElement {
209
209
  render() {
210
210
  const hasLabelSlot = this.hasSlotController.test('label');
211
211
  const hasHelpTextSlot = this.hasSlotController.test('help-text');
212
+ const hasLabelSuffixSlot = this.hasSlotController.test('label-suffix');
212
213
  const hasLabel = this.label ? true : !!hasLabelSlot;
213
214
  const hasHelpText = this.helpText ? true : false;
214
215
  const hasErrorMessage = this.errorMessage ? true : false;
@@ -247,6 +248,8 @@ export class NileRadioGroup extends NileElement {
247
248
  <slot name="label">${this.label}</slot>
248
249
  </label>
249
250
 
251
+ ${hasLabelSuffixSlot ? html` <slot name="label-suffix"></slot> ` : ``}
252
+
250
253
  <div part="form-control-input" class="form-control-input">
251
254
  <div class="visually-hidden">
252
255
  <label class="radio-group__validation">
@@ -873,6 +873,7 @@ export class NileSelect extends NileElement implements NileFormControl {
873
873
  render() {
874
874
  const hasLabelSlot = this.hasSlotController.test('label');
875
875
  const hasHelpTextSlot = this.hasSlotController.test('help-text');
876
+ const hasLabelSuffixSlot = this.hasSlotController.test('label-suffix');
876
877
  const hasLabel = this.label ? true : !!hasLabelSlot;
877
878
  const hasClearIcon =
878
879
  this.clearable && !this.disabled && this.value.length > 0;
@@ -903,6 +904,8 @@ export class NileSelect extends NileElement implements NileFormControl {
903
904
  <slot name="label">${this.label}</slot>
904
905
  </label>
905
906
 
907
+ ${hasLabelSuffixSlot ? html` <slot name="label-suffix"></slot> ` : ``}
908
+
906
909
  <div part="form-control-input" class="form-control-input">
907
910
  <nile-popup
908
911
  class=${classMap({
@@ -56,18 +56,7 @@ export class NileSwitcher extends NileElement {
56
56
  * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
57
57
  */
58
58
  static styles: CSSResultGroup = styles;
59
- @property({ type: Object }) nileSwitchConfig: switchconfig = {
60
- toggleSwitch: false,
61
- defaultInput: {
62
- inputType: 'radio',
63
- value: 'True',
64
- options: ['True', 'False'],
65
- },
66
- switchInput: {
67
- inputType: 'text-area',
68
- value: 'test',
69
- },
70
- };
59
+ @property({ type: Object }) nileSwitchConfig: switchconfig;
71
60
 
72
61
  connectedCallback() {
73
62
  super.connectedCallback();
@@ -93,19 +82,18 @@ export class NileSwitcher extends NileElement {
93
82
  }
94
83
 
95
84
  renderDropdown(Input: switchInputType, inputType: string) {
96
- const { options, multiple, placeholder } = Input;
85
+ const { options, multiple, placeholder, disabled } = Input;
97
86
  return html`<nile-select
98
87
  .placeholder=${placeholder}
88
+ .disabled="${disabled}"
99
89
  .multiple="${multiple}"
100
90
  @nile-change=${(e: CustomEvent) => {
101
91
  this.handleChange(e, inputType);
102
92
  }}
103
- ${
104
- options &&
105
- options.map((option: any) => {
106
- return html`<nile-option .value="${option}">${option} </nile-option>`;
107
- })
108
- }
93
+ >
94
+ ${options?.map((option: any) => {
95
+ return html`<nile-option .value="${option}">${option} </nile-option>`;
96
+ })}
109
97
  </nile-select>`;
110
98
  }
111
99
 
@@ -134,10 +122,11 @@ export class NileSwitcher extends NileElement {
134
122
  }
135
123
 
136
124
  renderNileRadio(Input: switchInputType, inputType: string) {
137
- const { options, value } = Input;
125
+ const { options, value, disabled } = Input;
138
126
 
139
127
  return html`<nile-radio-group
140
128
  .value=${value}
129
+ .disabled=${disabled}
141
130
  @change=${(e: CustomEvent) => {
142
131
  this.handleChange(e, inputType);
143
132
  }}
@@ -155,7 +144,7 @@ export class NileSwitcher extends NileElement {
155
144
  } else {
156
145
  this.nileSwitchConfig.switchInput.value = event.detail.value;
157
146
  }
158
- console.log(this.nileSwitchConfig);
147
+ event.stopPropagation();
159
148
  this.emit('nile-change', { config: this.nileSwitchConfig });
160
149
  }
161
150