@aquera/nile-elements 0.0.72 → 0.0.74
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/README.md +11 -0
- package/dist/index.iife.js +62 -52
- package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.esm.js +8 -5
- package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.esm.js +5 -0
- package/dist/nile-checkbox/nile-checkbox.esm.js +47 -45
- package/dist/nile-input/nile-input.css.cjs.js +1 -1
- package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.css.esm.js +2 -2
- package/dist/src/nile-calendar/nile-calendar.d.ts +1 -0
- package/dist/src/nile-calendar/nile-calendar.js +11 -3
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.css.js +5 -0
- package/dist/src/nile-checkbox/nile-checkbox.css.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.d.ts +2 -0
- package/dist/src/nile-checkbox/nile-checkbox.js +52 -43
- package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
- package/dist/src/nile-input/nile-input.css.js +2 -2
- package/dist/src/nile-input/nile-input.css.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-calendar/nile-calendar.ts +12 -6
- package/src/nile-checkbox/nile-checkbox.css.ts +5 -0
- package/src/nile-checkbox/nile-checkbox.ts +57 -50
- package/src/nile-input/nile-input.css.ts +2 -2
package/package.json
CHANGED
@@ -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
|
-
|
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
|
-
}"
|
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
|
-
|
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="${
|
@@ -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
|
-
<
|
206
|
-
|
207
|
-
.
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
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>` : ``}
|
@@ -198,10 +198,10 @@ export const styles = css`
|
|
198
198
|
-webkit-appearance: none;
|
199
199
|
color: var(--nile-colors-dark-900);
|
200
200
|
font-family: var(--nile-font-family-sans-serif);
|
201
|
-
font-size:
|
201
|
+
font-size: 14px;
|
202
202
|
font-style: normal;
|
203
203
|
font-weight: 400;
|
204
|
-
line-height:
|
204
|
+
line-height: 16px;
|
205
205
|
letter-spacing: 0.2px;
|
206
206
|
}
|
207
207
|
|