@aquera/nile-elements 0.0.72 → 0.0.73

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/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.72",
6
+ "version": "0.0.73",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -107,11 +107,12 @@ export class NileCalendar extends NileElement {
107
107
  }
108
108
 
109
109
  @watch('allowedDates')
110
- checkValidAllowedDate() {
110
+ checkValidAllowedDate() {
111
111
  if (Object.keys(this.allowedDates).length ==0) {
112
112
  this.validAllowedDates = false;
113
113
  return;
114
114
  }
115
+ this.hideInput=true;
115
116
  const startDate = new Date(
116
117
  Date.UTC(
117
118
  this.allowedDates?.startDate?.slice(0, 4),
@@ -137,6 +138,8 @@ export class NileCalendar extends NileElement {
137
138
  }
138
139
  }
139
140
 
141
+ @state() hideInput: Boolean = false;
142
+
140
143
  @property({ type: Boolean,attribute:'hide-time-input' }) hideTimeInput: Boolean = false;
141
144
 
142
145
  @property({ type: Array, attribute: 'hide-duration-fields' })
@@ -871,12 +874,14 @@ export class NileCalendar extends NileElement {
871
874
  <div class="calender-input">
872
875
  <div>
873
876
  <span class="manual-input-label">From </span>
874
- <div class="from">
875
- <nile-input class="manual-input" value="${this.formatDate(
877
+ <div class="from">
878
+ ${!this.hideInput ? html`<nile-input class="manual-input" value="${this.formatDate(
876
879
  this.startDate
877
880
  )}" placeholder="DD/MM/YYYY" @nile-change="${
878
881
  this.handleStartDateInput
879
- }"></nile-input>
882
+ }">
883
+ </nile-input>`:html`` }
884
+
880
885
  <nile-input class="manual-input ${this.hideTimeInput ? 'hidden':''}" value="${this.formatTime(
881
886
  this.startDate
882
887
  )}" placeholder="HH:MM:SS" @nile-change="${
@@ -888,11 +893,12 @@ export class NileCalendar extends NileElement {
888
893
  <div>
889
894
  <span class="manual-input-label">To </span>
890
895
  <div class="from">
891
- <nile-input class="manual-input" value="${this.formatDate(
896
+ ${!this.hideInput ? html`<nile-input class="manual-input" value="${this.formatDate(
892
897
  this.endDate
893
898
  )}" placeholder="DD/MM/YYYY" @nile-change="${
894
899
  this.handleEndDateInput
895
- }"></nile-input>
900
+ }"></nile-input>`:html``}
901
+
896
902
  <nile-input class="manual-input ${this.hideTimeInput ? 'hidden':''} " value="${this.formatTime(
897
903
  this.endDate
898
904
  )}" placeholder="HH:MM:SS" @nile-change="${
@@ -123,6 +123,11 @@ export const styles = css`
123
123
  box-sizing: border-box;
124
124
  }
125
125
 
126
+ .checkbox__icon__container{
127
+ display:flex;
128
+ align-items:center;
129
+ }
130
+
126
131
  .checkbox__label__text {
127
132
  display: block;
128
133
  font-size: 14px;
@@ -112,6 +112,10 @@ export class NileCheckbox extends NileElement {
112
112
  /** Makes the checkbox a required field. */
113
113
  @property({ type: Boolean, reflect: true }) required = false;
114
114
 
115
+ @query('.checkbox__label__text') labelContainer:HTMLElement;
116
+
117
+ @query('div.checkbox__icon__container') checkboxIconContainer:HTMLElement;
118
+
115
119
  private handleClick() {
116
120
  this.checked = !this.checked;
117
121
  this.indeterminate = false;
@@ -177,6 +181,7 @@ export class NileCheckbox extends NileElement {
177
181
  if (changedProperties.has('helpText')) {
178
182
  this.updateHostClass();
179
183
  }
184
+ this.checkboxIconContainer.style.height=this.labelContainer.scrollHeight+'px';
180
185
  }
181
186
 
182
187
  private updateHostClass() {
@@ -200,57 +205,59 @@ export class NileCheckbox extends NileElement {
200
205
  'checkbox--disabled': this.disabled,
201
206
  'checkbox--focused': this.hasFocus,
202
207
  'checkbox--indeterminate': this.indeterminate
203
- })}
208
+ })}
204
209
  >
205
- <span
206
- part="control${this.checked ? ' control--checked' : ''}${this
207
- .indeterminate
208
- ? ' control--indeterminate'
209
- : ''}"
210
- class="checkbox__control"
211
- >
212
- <!-- An empty title prevents browser validation tooltips from appearing on hover -->
213
- <input
214
- class="checkbox__input"
215
- type="checkbox"
216
- title=${ this.title }
217
- name=${this.name}
218
- value=${ifDefined(this.value)}
219
- .indeterminate=${live(this.indeterminate)}
220
- .checked=${live(this.checked)}
221
- .disabled=${this.disabled}
222
- .required=${this.required}
223
- aria-checked=${this.checked ? 'true' : 'false'}
224
- @click=${this.handleClick}
225
- @input=${this.handleInput}
226
- @blur=${this.handleBlur}
227
- @focus=${this.handleFocus}
228
- />
229
- ${this.checked
230
- ? html`
231
- <nile-icon
232
- part="checked-icon"
233
- class="checkbox__checked-icon"
234
- color="white"
235
- library="system"
236
- name="tick"
237
- size="12"
238
- ></nile-icon>
239
- `
240
- : ''}
241
- ${!this.checked && this.indeterminate
242
- ? html`
243
- <nile-icon
244
- part="indeterminate-icon"
245
- class="checkbox__indeterminate-icon"
246
- library="system"
247
- color="white"
248
- name="minus"
249
- size="12"
250
- ></nile-icon>
251
- `
252
- : ''}
253
- </span>
210
+ <div class="checkbox__icon__container">
211
+ <span
212
+ part="control${this.checked ? ' control--checked' : ''}${this
213
+ .indeterminate
214
+ ? ' control--indeterminate'
215
+ : ''}"
216
+ class="checkbox__control"
217
+ >
218
+ <!-- An empty title prevents browser validation tooltips from appearing on hover -->
219
+ <input
220
+ class="checkbox__input"
221
+ type="checkbox"
222
+ title=${ this.title }
223
+ name=${this.name}
224
+ value=${ifDefined(this.value)}
225
+ .indeterminate=${live(this.indeterminate)}
226
+ .checked=${live(this.checked)}
227
+ .disabled=${this.disabled}
228
+ .required=${this.required}
229
+ aria-checked=${this.checked ? 'true' : 'false'}
230
+ @click=${this.handleClick}
231
+ @input=${this.handleInput}
232
+ @blur=${this.handleBlur}
233
+ @focus=${this.handleFocus}
234
+ />
235
+ ${this.checked
236
+ ? html`
237
+ <nile-icon
238
+ part="checked-icon"
239
+ class="checkbox__checked-icon"
240
+ color="white"
241
+ library="system"
242
+ name="tick"
243
+ size="12"
244
+ ></nile-icon>
245
+ `
246
+ : ''}
247
+ ${!this.checked && this.indeterminate
248
+ ? html`
249
+ <nile-icon
250
+ part="indeterminate-icon"
251
+ class="checkbox__indeterminate-icon"
252
+ library="system"
253
+ color="white"
254
+ name="minus"
255
+ size="12"
256
+ ></nile-icon>
257
+ `
258
+ : ''}
259
+ </span>
260
+ </div>
254
261
 
255
262
  <div part="label" class="checkbox__label" style="${!this.label && !this.subLabel?'margin-left:0;':''}">
256
263
  ${this.label ? html`<span class="checkbox__label__text">${this.label}</span>` : ``}