@aquera/nile-elements 0.0.52 → 0.0.54

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 (65) hide show
  1. package/demo/variables.css +5 -0
  2. package/demo/variables_v2.css +5 -0
  3. package/dist/index.iife.js +289 -220
  4. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  5. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  6. package/dist/nile-input/nile-input.css.esm.js +3 -0
  7. package/dist/nile-table-body/nile-table-body.css.cjs.js +1 -1
  8. package/dist/nile-table-body/nile-table-body.css.cjs.js.map +1 -1
  9. package/dist/nile-table-body/nile-table-body.css.esm.js +10 -0
  10. package/dist/nile-table-cell-item/nile-table-cell-item.cjs.js +1 -1
  11. package/dist/nile-table-cell-item/nile-table-cell-item.cjs.js.map +1 -1
  12. package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js +1 -1
  13. package/dist/nile-table-cell-item/nile-table-cell-item.css.cjs.js.map +1 -1
  14. package/dist/nile-table-cell-item/nile-table-cell-item.css.esm.js +3 -0
  15. package/dist/nile-table-cell-item/nile-table-cell-item.esm.js +2 -2
  16. package/dist/nile-table-header-item/index.cjs.js +1 -1
  17. package/dist/nile-table-header-item/index.esm.js +1 -1
  18. package/dist/nile-table-header-item/nile-table-header-item.cjs.js +1 -1
  19. package/dist/nile-table-header-item/nile-table-header-item.cjs.js.map +1 -1
  20. package/dist/nile-table-header-item/nile-table-header-item.esm.js +3 -8
  21. package/dist/nile-table-row/nile-table-row.cjs.js +1 -1
  22. package/dist/nile-table-row/nile-table-row.cjs.js.map +1 -1
  23. package/dist/nile-table-row/nile-table-row.css.cjs.js +1 -1
  24. package/dist/nile-table-row/nile-table-row.css.cjs.js.map +1 -1
  25. package/dist/nile-table-row/nile-table-row.css.esm.js +7 -2
  26. package/dist/nile-table-row/nile-table-row.esm.js +1 -1
  27. package/dist/nile-textarea/index.cjs.js +1 -1
  28. package/dist/nile-textarea/index.esm.js +1 -1
  29. package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
  30. package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
  31. package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
  32. package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
  33. package/dist/nile-textarea/nile-textarea.css.esm.js +43 -8
  34. package/dist/nile-textarea/nile-textarea.esm.js +58 -40
  35. package/dist/src/nile-input/nile-input.css.js +3 -0
  36. package/dist/src/nile-input/nile-input.css.js.map +1 -1
  37. package/dist/src/nile-table-body/nile-table-body.css.js +10 -0
  38. package/dist/src/nile-table-body/nile-table-body.css.js.map +1 -1
  39. package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js +3 -0
  40. package/dist/src/nile-table-cell-item/nile-table-cell-item.css.js.map +1 -1
  41. package/dist/src/nile-table-cell-item/nile-table-cell-item.js +1 -1
  42. package/dist/src/nile-table-cell-item/nile-table-cell-item.js.map +1 -1
  43. package/dist/src/nile-table-header-item/nile-table-header-item.d.ts +4 -0
  44. package/dist/src/nile-table-header-item/nile-table-header-item.js +17 -7
  45. package/dist/src/nile-table-header-item/nile-table-header-item.js.map +1 -1
  46. package/dist/src/nile-table-row/nile-table-row.css.js +5 -0
  47. package/dist/src/nile-table-row/nile-table-row.css.js.map +1 -1
  48. package/dist/src/nile-table-row/nile-table-row.js +1 -1
  49. package/dist/src/nile-table-row/nile-table-row.js.map +1 -1
  50. package/dist/src/nile-textarea/nile-textarea.css.js +43 -8
  51. package/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
  52. package/dist/src/nile-textarea/nile-textarea.d.ts +7 -2
  53. package/dist/src/nile-textarea/nile-textarea.js +107 -45
  54. package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  55. package/dist/tsconfig.tsbuildinfo +1 -1
  56. package/package.json +1 -1
  57. package/src/nile-input/nile-input.css.ts +3 -0
  58. package/src/nile-table-body/nile-table-body.css.ts +10 -0
  59. package/src/nile-table-cell-item/nile-table-cell-item.css.ts +3 -0
  60. package/src/nile-table-cell-item/nile-table-cell-item.ts +1 -1
  61. package/src/nile-table-header-item/nile-table-header-item.ts +13 -6
  62. package/src/nile-table-row/nile-table-row.css.ts +5 -0
  63. package/src/nile-table-row/nile-table-row.ts +1 -1
  64. package/src/nile-textarea/nile-textarea.css.ts +43 -8
  65. package/src/nile-textarea/nile-textarea.ts +127 -62
@@ -16,6 +16,7 @@ import { ifDefined } from 'lit/directives/if-defined.js';
16
16
  import { live } from 'lit/directives/live.js';
17
17
  import { watch } from '../internal/watch';
18
18
  import NileElement from '../internal/nile-element';
19
+ import { unsafeHTML } from 'lit/directives/unsafe-html.js';
19
20
  /**
20
21
  * @summary Textareas collect data from the user and allow multiple lines of text.
21
22
  * @tag nile-text-area
@@ -80,13 +81,13 @@ let NileTextarea = class NileTextarea extends NileElement {
80
81
  this.error = false;
81
82
  /** Sets the input to a success state, changing its visual appearance. */
82
83
  this.success = false;
83
- /** Sets the input to a destructive state, changing its visual appearance. */
84
- this.destructive = false;
85
84
  /** Enables spell checking on the textarea. */
86
85
  this.spellcheck = true;
87
86
  /** The default value of the form control. Primarily used for resetting the form control. */
88
87
  this.defaultValue = '';
89
88
  this.fullHeight = false;
89
+ this.checkNonPrintableChar = false;
90
+ this.hasPrintableCharacters = false;
90
91
  }
91
92
  connectedCallback() {
92
93
  super.connectedCallback();
@@ -148,6 +149,43 @@ let NileTextarea = class NileTextarea extends NileElement {
148
149
  async handleValueChange() {
149
150
  await this.updateComplete;
150
151
  this.setTextareaHeight();
152
+ if (this.checkNonPrintableChar) {
153
+ this.markNonPrintableCharacters();
154
+ }
155
+ }
156
+ /** checks non printable characters in the value. */
157
+ markNonPrintableCharacters() {
158
+ let markedValue = '';
159
+ this.hasPrintableCharacters = false;
160
+ if (this.value) {
161
+ for (let i = 0, n = this.value.length; i < n; i++) {
162
+ const charCode = this.value.charCodeAt(i);
163
+ if ((charCode > 255 && charCode !== 9109) || [129, 143, 144, 157, 160].includes(charCode)) {
164
+ markedValue += `<span class="input__srtiked-text">${this.value.charAt(i)}</span>`;
165
+ this.hasPrintableCharacters = true;
166
+ }
167
+ else {
168
+ markedValue += this.value.charAt(i);
169
+ }
170
+ }
171
+ }
172
+ this.markedValue = markedValue;
173
+ this.emit('nile-value-marked', { value: this.markedValue, hasNonPrintableCharacters: this.hasPrintableCharacters });
174
+ }
175
+ /** Removes all non printable characters from the value. */
176
+ removeAllNonPrintableCharacters() {
177
+ let cleanedValue = '';
178
+ if (this.value) {
179
+ for (let i = 0, n = this.value.length; i < n; i++) {
180
+ const charCode = this.value.charCodeAt(i);
181
+ // Consider a character printable if it's not in the specified non-printable ranges
182
+ if (!(charCode > 255 && charCode !== 9109) && ![129, 143, 144, 157, 160].includes(charCode)) {
183
+ cleanedValue += this.value.charAt(i);
184
+ }
185
+ }
186
+ }
187
+ this.value = cleanedValue;
188
+ this.emit('nile-npchar-removed', { value: this.value });
151
189
  }
152
190
  /** Sets focus on the textarea. */
153
191
  focus(options) {
@@ -204,7 +242,7 @@ let NileTextarea = class NileTextarea extends NileElement {
204
242
  'form-control': true,
205
243
  'form-control--medium': this.size === 'medium',
206
244
  'form-control--has-label': hasLabel,
207
- 'form-control--has-help-text': hasHelpText
245
+ 'form-control--has-help-text': hasHelpText,
208
246
  })}
209
247
  >
210
248
  <label
@@ -216,69 +254,87 @@ let NileTextarea = class NileTextarea extends NileElement {
216
254
  <slot name="label">${this.label}</slot>
217
255
  </label>
218
256
 
219
- <div part="form-control-input" class="form-control-input">
220
- <div
221
- part="base"
222
- class=${classMap({
257
+ <nile-popup
258
+ ?active=${this.hasPrintableCharacters}
259
+ placement="bottom-start"
260
+ distance="5"
261
+ strategy="fixed"
262
+ >
263
+ <div part="form-control-input" class="form-control-input" slot="anchor">
264
+ <div
265
+ part="base"
266
+ class=${classMap({
223
267
  textarea: true,
224
268
  'textarea--medium': this.size === 'medium',
225
269
  'textarea--warning': this.warning,
226
270
  'textarea--error': this.error,
227
271
  'textarea--success': this.success,
228
- 'textarea--destructive': this.destructive,
229
272
  'textarea--standard': !this.filled,
230
273
  'textarea--disabled': this.disabled,
231
274
  'textarea--focused': this.hasFocus,
232
275
  'textarea--empty': !this.value,
233
276
  'textarea--resize-none': this.resize === 'none',
234
277
  'textarea--resize-vertical': this.resize === 'vertical',
235
- 'textarea--resize-auto': this.resize === 'auto'
278
+ 'textarea--resize-auto': this.resize === 'auto',
236
279
  })}
237
- >
238
- <textarea
239
- part="textarea"
240
- id="input"
241
- class="textarea__control"
242
- title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}
243
- name=${ifDefined(this.name)}
244
- .value=${live(this.value)}
245
- ?disabled=${this.disabled}
246
- ?readonly=${this.readonly}
247
- ?required=${this.required}
248
- placeholder=${ifDefined(this.placeholder)}
249
- rows=${ifDefined(this.rows)}
250
- minlength=${ifDefined(this.minlength)}
251
- maxlength=${ifDefined(this.maxlength)}
252
- autocapitalize=${ifDefined(this.autocapitalize)}
253
- autocorrect=${ifDefined(this.autocorrect)}
254
- ?autofocus=${this.autofocus}
255
- spellcheck=${ifDefined(this.spellcheck)}
256
- enterkeyhint=${ifDefined(this.enterkeyhint)}
257
- inputmode=${ifDefined(this.inputmode)}
258
- aria-describedby="help-text"
259
- @change=${this.handleChange}
260
- @input=${this.handleInput}
261
- @focus=${this.handleFocus}
262
- @blur=${this.handleBlur}
263
-
264
-
265
- ></textarea>
280
+ >
281
+ <textarea
282
+ part="textarea"
283
+ id="input"
284
+ class="textarea__control"
285
+ title=${this
286
+ .title /* An empty title prevents browser validation tooltips from appearing on hover */}
287
+ name=${ifDefined(this.name)}
288
+ .value=${live(this.value)}
289
+ ?disabled=${this.disabled}
290
+ ?readonly=${this.readonly}
291
+ ?required=${this.required}
292
+ placeholder=${ifDefined(this.placeholder)}
293
+ rows=${ifDefined(this.rows)}
294
+ minlength=${ifDefined(this.minlength)}
295
+ maxlength=${ifDefined(this.maxlength)}
296
+ autocapitalize=${ifDefined(this.autocapitalize)}
297
+ autocorrect=${ifDefined(this.autocorrect)}
298
+ ?autofocus=${this.autofocus}
299
+ spellcheck=${ifDefined(this.spellcheck)}
300
+ enterkeyhint=${ifDefined(this.enterkeyhint)}
301
+ inputmode=${ifDefined(this.inputmode)}
302
+ aria-describedby="help-text"
303
+ @change=${this.handleChange}
304
+ @input=${this.handleInput}
305
+ @focus=${this.handleFocus}
306
+ @blur=${this.handleBlur}
307
+ ></textarea>
308
+ </div>
266
309
  </div>
267
- </div>
268
310
 
269
- ${hasHelpText
311
+ ${hasHelpText
270
312
  ? html `
271
313
  <nile-form-help-text>${this.helpText}</nile-form-help-text>
272
314
  `
273
315
  : ``}
274
-
275
- ${hasErrorMessage
316
+ ${hasErrorMessage
276
317
  ? html `
277
318
  <nile-form-error-message
278
319
  >${this.errorMessage}</nile-form-error-message
279
320
  >
280
321
  `
281
322
  : ``}
323
+ <div class="input__non-printable">
324
+ Non-printable character detected.
325
+ <nile-badge
326
+ variant="error"
327
+ @click=${this.removeAllNonPrintableCharacters}
328
+ class="input__remove-non-printable"
329
+ >
330
+ Remove All
331
+ </nile-badge>
332
+
333
+ <div class="input__srtiked-text-container">
334
+ ${unsafeHTML(this.markedValue)}
335
+ </div>
336
+ </div>
337
+ </nile-popup>
282
338
  </div>
283
339
  `;
284
340
  }
@@ -350,9 +406,6 @@ __decorate([
350
406
  __decorate([
351
407
  property({ type: Boolean })
352
408
  ], NileTextarea.prototype, "success", void 0);
353
- __decorate([
354
- property({ type: Boolean })
355
- ], NileTextarea.prototype, "destructive", void 0);
356
409
  __decorate([
357
410
  property()
358
411
  ], NileTextarea.prototype, "autocapitalize", void 0);
@@ -387,6 +440,15 @@ __decorate([
387
440
  __decorate([
388
441
  property({ type: Boolean, reflect: true })
389
442
  ], NileTextarea.prototype, "fullHeight", void 0);
443
+ __decorate([
444
+ property({ type: Boolean })
445
+ ], NileTextarea.prototype, "checkNonPrintableChar", void 0);
446
+ __decorate([
447
+ state()
448
+ ], NileTextarea.prototype, "hasPrintableCharacters", void 0);
449
+ __decorate([
450
+ state()
451
+ ], NileTextarea.prototype, "markedValue", void 0);
390
452
  __decorate([
391
453
  watch('rows', { waitUntilFirstUpdate: true })
392
454
  ], NileTextarea.prototype, "handleRowsChange", null);
@@ -1 +1 @@
1
- {"version":3,"file":"nile-textarea.js","sourceRoot":"","sources":["../../../src/nile-textarea/nile-textarea.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;GAmBG;AAGI,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,WAAW;IAAtC;;QAGY,sBAAiB,GAAG,IAAI,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QAKtE,aAAQ,GAAG,KAAK,CAAC;QACtB,UAAK,GAAG,EAAE,CAAC,CAAC,gCAAgC;QAExD,+EAA+E;QACnE,SAAI,GAAG,EAAE,CAAC;QAEtB,wFAAwF;QAC5E,UAAK,GAAG,EAAE,CAAC;QAEvB,2BAA2B;QACE,SAAI,GAAG,QAAQ,C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GpC;IAAX,QAAQ,EAAE;kDAAiF;AAW5F;IARC,QAAQ,CAAC;QACR,IAAI,EAAE,OAAO;QACb,SAAS,EAAE;YACT,oEAAoE;YACpE,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;YACpE,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;SACjD;KACF,CAAC;gDACgB;AAMN;IAAX,QAAQ,EAAE;+CAAyF;AAGpF;IAAf,YAAY,EAAE;kDAAmB;AAEU;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAoB;AAmE/D;IADC,KAAK,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;oDAG7C;AAGK;IADL,KAAK,CAAC,OAAO,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;qDAI9C;AA1LU,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAuVxB;SAvVY,YAAY;AAyVzB,eAAe,YAAY,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-textarea.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query, state } from 'lit/decorators.js';\nimport { defaultValue } from '../internal/default-value';\nimport { FormControlController } from '../internal/form';\nimport { HasSlotController } from '../internal/slot';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Textareas collect data from the user and allow multiple lines of text.\n * @tag nile-text-area\n\n *\n * @slot label - The textarea's label. Alternatively, you can use the `label` attribute.\n * @slot help-text - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute.\n *\n * @event nile-blur - Emitted when the control loses focus.\n * @event nile-change - Emitted when an alteration to the control's value is committed by the user.\n * @event nile-focus - Emitted when the control gains focus.\n * @event nile-input - Emitted when the control receives input.\n *\n * @csspart form-control - The form control that wraps the label, input, and help text.\n * @csspart form-control-label - The label's wrapper.\n * @csspart form-control-input - The input's wrapper.\n * @csspart form-control-help-text - The help text's wrapper.\n * @csspart base - The component's base wrapper.\n * @csspart textarea - The internal `<textarea>` control.\n */\n\n@customElement('nile-textarea')\nexport class NileTextarea extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');\n private resizeObserver: ResizeObserver;\n\n @query('.textarea__control') input: HTMLTextAreaElement;\n\n @state() private hasFocus = false;\n @property() title = ''; // make reactive to pass through\n\n /** The name of the textarea, submitted as a name/value pair with form data. */\n @property() name = '';\n\n /** The current value of the textarea, submitted as a name/value pair with form data. */\n @property() value = '';\n\n /** The textarea's size. */\n @property({ reflect: true }) size = 'medium';\n\n /** Draws a filled textarea. */\n @property({ type: Boolean, reflect: true }) filled = false;\n\n /** The textarea's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** The textarea's help text. If you need to display HTML, use the `help-text` slot instead. */\n @property({ attribute: 'help-text' }) helpText = '';\n\n /** The input's error message. If you need to display HTML, use the `error-message` slot instead. */\n @property({ attribute: 'error-message' }) errorMessage = '';\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = '';\n\n /** The number of rows to display by default. */\n @property({ type: Number }) rows = 4;\n\n /** Controls how the textarea can be resized. */\n @property() resize: 'none' | 'vertical' | 'auto' = 'vertical';\n\n /** Disables the textarea. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Makes the textarea readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Makes the textarea a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n @property({ type: Number }) minlength: number;\n\n @property({ type: Number }) maxlength: number;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** Sets the input to a destructive state, changing its visual appearance. */\n @property({ type: Boolean }) destructive = false;\n\n /** Controls whether and how text input is automatically capitalized as it is entered by the user. */\n @property() autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';\n\n /** Indicates whether the browser's autocorrect feature is on or off. */\n @property() autocorrect: string;\n\n /**\n * Specifies what permission the browser has to provide assistance in filling out form field values. Refer to\n * [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.\n */\n @property() autocomplete: string;\n\n /** Indicates that the input should receive focus on page load. */\n @property({ type: Boolean }) autofocus: boolean;\n\n /** Used to customize the label or icon of the Enter key on virtual keyboards. */\n @property() enterkeyhint: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /** Enables spell checking on the textarea. */\n @property({\n type: Boolean,\n converter: {\n // Allow \"true|false\" attribute values but keep the property boolean\n fromAttribute: value => (!value || value === 'false' ? false : true),\n toAttribute: value => (value ? 'true' : 'false')\n }\n })\n spellcheck = true;\n\n /**\n * Tells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual\n * keyboard on supportive devices.\n */\n @property() inputmode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** The default value of the form control. Primarily used for resetting the form control. */\n @defaultValue() defaultValue = '';\n\n @property({ type: Boolean, reflect: true }) fullHeight = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.resizeObserver = new ResizeObserver(() => this.setTextareaHeight());\n\n this.updateComplete.then(() => {\n this.setTextareaHeight();\n this.resizeObserver.observe(this.input);\n });\n\n\n if(this.fullHeight){\n requestAnimationFrame(() => {\n let parentHeight = this.parentElement?.getBoundingClientRect().height;\n if (parentHeight) {\n parentHeight = parentHeight - 65;\n if (parentHeight<12) {\n parentHeight=12;\n }\n this.shadowRoot?.querySelector('textarea')?.style.setProperty('height', `${parentHeight}px`);\n }\n });\n }\n\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n if(this.input) {\n this.resizeObserver.unobserve(this.input);\n }\n this.emit('nile-destroy');\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur', { value: this.value });\n }\n\n private handleChange() {\n this.value = this.input.value;\n this.setTextareaHeight();\n this.emit('nile-change', { value: this.value });\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus', { value: this.value });\n }\n\n private handleInput() {\n this.value = this.input.value;\n this.emit('nile-input', { value: this.value });\n }\n\n private setTextareaHeight() {\n if (this.resize === 'auto') {\n this.input.style.height = 'auto';\n this.input.style.height = `${this.input.scrollHeight}px`;\n } else {\n (this.input.style.height as string | undefined) = undefined;\n }\n }\n\n @watch('rows', { waitUntilFirstUpdate: true })\n handleRowsChange() {\n this.setTextareaHeight();\n }\n\n @watch('value', { waitUntilFirstUpdate: true })\n async handleValueChange() {\n await this.updateComplete;\n this.setTextareaHeight();\n }\n\n /** Sets focus on the textarea. */\n focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the textarea. */\n blur() {\n this.input.blur();\n }\n\n /** Selects all the text in the textarea. */\n select() {\n this.input.select();\n }\n\n /** Gets or sets the textarea's scroll position. */\n scrollPosition(position?: { top?: number; left?: number }): { top: number; left: number } | undefined {\n if (position) {\n if (typeof position.top === 'number') this.input.scrollTop = position.top;\n if (typeof position.left === 'number') this.input.scrollLeft = position.left;\n return undefined;\n }\n\n return {\n top: this.input.scrollTop,\n left: this.input.scrollTop\n };\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n this.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: 'select' | 'start' | 'end' | 'preserve'\n ) {\n // @ts-expect-error - start, end, and selectMode are optional\n this.input.setRangeText(replacement, start, end, selectMode);\n\n if (this.value !== this.input.value) {\n this.value = this.input.value;\n }\n\n if (this.value !== this.input.value) {\n this.value = this.input.value;\n this.setTextareaHeight();\n }\n }\n\n render() {\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n const hasLabel = this.label ? true : !!hasLabelSlot;\n\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': this.size === 'medium',\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div\n part=\"base\"\n class=${classMap({\n textarea: true,\n 'textarea--medium': this.size === 'medium',\n 'textarea--warning': this.warning,\n 'textarea--error': this.error,\n 'textarea--success': this.success,\n 'textarea--destructive': this.destructive,\n 'textarea--standard': !this.filled,\n 'textarea--disabled': this.disabled,\n 'textarea--focused': this.hasFocus,\n 'textarea--empty': !this.value,\n 'textarea--resize-none': this.resize === 'none',\n 'textarea--resize-vertical': this.resize === 'vertical',\n 'textarea--resize-auto': this.resize === 'auto'\n })}\n >\n <textarea\n part=\"textarea\"\n id=\"input\"\n class=\"textarea__control\"\n title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}\n name=${ifDefined(this.name)}\n .value=${live(this.value)}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n placeholder=${ifDefined(this.placeholder)}\n rows=${ifDefined(this.rows)}\n minlength=${ifDefined(this.minlength)}\n maxlength=${ifDefined(this.maxlength)}\n autocapitalize=${ifDefined(this.autocapitalize)}\n autocorrect=${ifDefined(this.autocorrect)}\n ?autofocus=${this.autofocus}\n spellcheck=${ifDefined(this.spellcheck)}\n enterkeyhint=${ifDefined(this.enterkeyhint)}\n inputmode=${ifDefined(this.inputmode)}\n aria-describedby=\"help-text\"\n @change=${this.handleChange}\n @input=${this.handleInput}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n\n \n ></textarea>\n </div>\n </div>\n\n ${\n hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``\n }\n\n ${\n hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``\n }\n </div>\n `;\n }\n}\n\nexport default NileTextarea;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-textarea': NileTextarea;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-textarea.js","sourceRoot":"","sources":["../../../src/nile-textarea/nile-textarea.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAa,IAAI,EAAE,QAAQ,EAAiC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE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AAQ,EAAE;oDAA8E;AAG7E;IAAX,QAAQ,EAAE;iDAAqB;AAMpB;IAAX,QAAQ,EAAE;kDAAsB;AAGJ;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CAAoB;AAGpC;IAAX,QAAQ,EAAE;kDAAiF;AAW5F;IARC,QAAQ,CAAC;QACR,IAAI,EAAE,OAAO;QACb,SAAS,EAAE;YACT,oEAAoE;YACpE,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;YACpE,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;SACjD;KACF,CAAC;gDACgB;AAMN;IAAX,QAAQ,EAAE;+CAAyF;AAGpF;IAAf,YAAY,EAAE;kDAAmB;AAEU;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAoB;AAEpC;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;2DAAwC;AAEzD;IAAR,KAAK,EAAE;4DAAyC;AAExC;IAAR,KAAK,EAAE;iDAAqB;AAmE7B;IADC,KAAK,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;oDAG7C;AAGK;IADL,KAAK,CAAC,OAAO,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;qDAQ9C;AAjMU,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAwZxB;SAxZY,YAAY;AA0ZzB,eAAe,YAAY,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-textarea.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query, state } from 'lit/decorators.js';\nimport { defaultValue } from '../internal/default-value';\nimport { HasSlotController } from '../internal/slot';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\n/**\n * @summary Textareas collect data from the user and allow multiple lines of text.\n * @tag nile-text-area\n\n *\n * @slot label - The textarea's label. Alternatively, you can use the `label` attribute.\n * @slot help-text - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute.\n *\n * @event nile-blur - Emitted when the control loses focus.\n * @event nile-change - Emitted when an alteration to the control's value is committed by the user.\n * @event nile-focus - Emitted when the control gains focus.\n * @event nile-input - Emitted when the control receives input.\n *\n * @csspart form-control - The form control that wraps the label, input, and help text.\n * @csspart form-control-label - The label's wrapper.\n * @csspart form-control-input - The input's wrapper.\n * @csspart form-control-help-text - The help text's wrapper.\n * @csspart base - The component's base wrapper.\n * @csspart textarea - The internal `<textarea>` control.\n */\n\n@customElement('nile-textarea')\nexport class NileTextarea extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');\n private resizeObserver: ResizeObserver;\n\n @query('.textarea__control') input: HTMLTextAreaElement;\n\n @state() private hasFocus = false;\n @property() title = ''; // make reactive to pass through\n\n /** The name of the textarea, submitted as a name/value pair with form data. */\n @property() name = '';\n\n /** The current value of the textarea, submitted as a name/value pair with form data. */\n @property() value = '';\n\n /** The textarea's size. */\n @property({ reflect: true }) size = 'medium';\n\n /** Draws a filled textarea. */\n @property({ type: Boolean, reflect: true }) filled = false;\n\n /** The textarea's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** The textarea's help text. If you need to display HTML, use the `help-text` slot instead. */\n @property({ attribute: 'help-text' }) helpText = '';\n\n /** The input's error message. If you need to display HTML, use the `error-message` slot instead. */\n @property({ attribute: 'error-message' }) errorMessage = '';\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = '';\n\n /** The number of rows to display by default. */\n @property({ type: Number }) rows = 4;\n\n /** Controls how the textarea can be resized. */\n @property() resize: 'none' | 'vertical' | 'auto' = 'vertical';\n\n /** Disables the textarea. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Makes the textarea readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Makes the textarea a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n @property({ type: Number }) minlength: number;\n\n @property({ type: Number }) maxlength: number;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** Controls whether and how text input is automatically capitalized as it is entered by the user. */\n @property() autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';\n\n /** Indicates whether the browser's autocorrect feature is on or off. */\n @property() autocorrect: string;\n\n /**\n * Specifies what permission the browser has to provide assistance in filling out form field values. Refer to\n * [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.\n */\n @property() autocomplete: string;\n\n /** Indicates that the input should receive focus on page load. */\n @property({ type: Boolean }) autofocus: boolean;\n\n /** Used to customize the label or icon of the Enter key on virtual keyboards. */\n @property() enterkeyhint: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /** Enables spell checking on the textarea. */\n @property({\n type: Boolean,\n converter: {\n // Allow \"true|false\" attribute values but keep the property boolean\n fromAttribute: value => (!value || value === 'false' ? false : true),\n toAttribute: value => (value ? 'true' : 'false')\n }\n })\n spellcheck = true;\n\n /**\n * Tells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual\n * keyboard on supportive devices.\n */\n @property() inputmode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** The default value of the form control. Primarily used for resetting the form control. */\n @defaultValue() defaultValue = '';\n\n @property({ type: Boolean, reflect: true }) fullHeight = false;\n\n @property({type: Boolean}) checkNonPrintableChar: boolean = false;\n\n @state() hasPrintableCharacters: boolean = false;\n\n @state() markedValue: string;\n\n connectedCallback() {\n super.connectedCallback();\n this.resizeObserver = new ResizeObserver(() => this.setTextareaHeight());\n\n this.updateComplete.then(() => {\n this.setTextareaHeight();\n this.resizeObserver.observe(this.input);\n });\n\n\n if(this.fullHeight){\n requestAnimationFrame(() => {\n let parentHeight = this.parentElement?.getBoundingClientRect().height;\n if (parentHeight) {\n parentHeight = parentHeight - 65;\n if (parentHeight<12) {\n parentHeight=12;\n }\n this.shadowRoot?.querySelector('textarea')?.style.setProperty('height', `${parentHeight}px`);\n }\n });\n }\n\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n if(this.input) {\n this.resizeObserver.unobserve(this.input);\n }\n this.emit('nile-destroy');\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur', { value: this.value });\n }\n\n private handleChange() {\n this.value = this.input.value;\n this.setTextareaHeight();\n this.emit('nile-change', { value: this.value });\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus', { value: this.value });\n }\n\n private handleInput() {\n this.value = this.input.value;\n this.emit('nile-input', { value: this.value });\n }\n\n private setTextareaHeight() {\n if (this.resize === 'auto') {\n this.input.style.height = 'auto';\n this.input.style.height = `${this.input.scrollHeight}px`;\n } else {\n (this.input.style.height as string | undefined) = undefined;\n }\n }\n\n @watch('rows', { waitUntilFirstUpdate: true })\n handleRowsChange() {\n this.setTextareaHeight();\n }\n\n @watch('value', { waitUntilFirstUpdate: true })\n async handleValueChange() {\n await this.updateComplete;\n this.setTextareaHeight();\n\n if(this.checkNonPrintableChar){\n this.markNonPrintableCharacters();\n }\n }\n\n /** checks non printable characters in the value. */\n markNonPrintableCharacters() {\n let markedValue = '';\n this.hasPrintableCharacters = false;\n if (this.value) {\n for (let i = 0, n = this.value.length; i < n; i++) {\n const charCode = this.value.charCodeAt(i);\n\n if ((charCode > 255 && charCode !== 9109) || [129, 143, 144, 157, 160].includes(charCode)) {\n markedValue += `<span class=\"input__srtiked-text\">${this.value.charAt(i)}</span>`;\n this.hasPrintableCharacters = true;\n } else {\n markedValue += this.value.charAt(i);\n }\n }\n }\n\n this.markedValue = markedValue;\n this.emit('nile-value-marked', { value: this.markedValue, hasNonPrintableCharacters: this.hasPrintableCharacters });\n }\n\n\n /** Removes all non printable characters from the value. */\n removeAllNonPrintableCharacters() {\n let cleanedValue = '';\n\n if (this.value) {\n for (let i = 0, n = this.value.length; i < n; i++) {\n const charCode = this.value.charCodeAt(i);\n\n // Consider a character printable if it's not in the specified non-printable ranges\n if (!(charCode > 255 && charCode !== 9109) && ![129, 143, 144, 157, 160].includes(charCode)) {\n cleanedValue += this.value.charAt(i);\n }\n }\n }\n\n this.value = cleanedValue;\n this.emit('nile-npchar-removed', { value: this.value });\n\n }\n\n /** Sets focus on the textarea. */\n focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the textarea. */\n blur() {\n this.input.blur();\n }\n\n /** Selects all the text in the textarea. */\n select() {\n this.input.select();\n }\n\n /** Gets or sets the textarea's scroll position. */\n scrollPosition(position?: { top?: number; left?: number }): { top: number; left: number } | undefined {\n if (position) {\n if (typeof position.top === 'number') this.input.scrollTop = position.top;\n if (typeof position.left === 'number') this.input.scrollLeft = position.left;\n return undefined;\n }\n\n return {\n top: this.input.scrollTop,\n left: this.input.scrollTop\n };\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n this.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: 'select' | 'start' | 'end' | 'preserve'\n ) {\n // @ts-expect-error - start, end, and selectMode are optional\n this.input.setRangeText(replacement, start, end, selectMode);\n\n if (this.value !== this.input.value) {\n this.value = this.input.value;\n }\n\n if (this.value !== this.input.value) {\n this.value = this.input.value;\n this.setTextareaHeight();\n }\n }\n\n render() {\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n const hasLabel = this.label ? true : !!hasLabelSlot;\n\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': this.size === 'medium',\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <nile-popup\n ?active=${this.hasPrintableCharacters}\n placement=\"bottom-start\"\n distance=\"5\"\n strategy=\"fixed\"\n >\n <div part=\"form-control-input\" class=\"form-control-input\" slot=\"anchor\">\n <div\n part=\"base\"\n class=${classMap({\n textarea: true,\n 'textarea--medium': this.size === 'medium',\n 'textarea--warning': this.warning,\n 'textarea--error': this.error,\n 'textarea--success': this.success,\n 'textarea--standard': !this.filled,\n 'textarea--disabled': this.disabled,\n 'textarea--focused': this.hasFocus,\n 'textarea--empty': !this.value,\n 'textarea--resize-none': this.resize === 'none',\n 'textarea--resize-vertical': this.resize === 'vertical',\n 'textarea--resize-auto': this.resize === 'auto',\n })}\n >\n <textarea\n part=\"textarea\"\n id=\"input\"\n class=\"textarea__control\"\n title=${\n this\n .title /* An empty title prevents browser validation tooltips from appearing on hover */\n }\n name=${ifDefined(this.name)}\n .value=${live(this.value)}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n placeholder=${ifDefined(this.placeholder)}\n rows=${ifDefined(this.rows)}\n minlength=${ifDefined(this.minlength)}\n maxlength=${ifDefined(this.maxlength)}\n autocapitalize=${ifDefined(this.autocapitalize)}\n autocorrect=${ifDefined(this.autocorrect)}\n ?autofocus=${this.autofocus}\n spellcheck=${ifDefined(this.spellcheck)}\n enterkeyhint=${ifDefined(this.enterkeyhint)}\n inputmode=${ifDefined(this.inputmode)}\n aria-describedby=\"help-text\"\n @change=${this.handleChange}\n @input=${this.handleInput}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n ></textarea>\n </div>\n </div>\n\n ${hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``}\n ${hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``}\n <div class=\"input__non-printable\">\n Non-printable character detected.\n <nile-badge\n variant=\"error\"\n @click=${this.removeAllNonPrintableCharacters}\n class=\"input__remove-non-printable\"\n >\n Remove All\n </nile-badge>\n\n <div class=\"input__srtiked-text-container\">\n ${unsafeHTML(this.markedValue)}\n </div>\n </div>\n </nile-popup>\n </div>\n `;\n }\n}\n\nexport default NileTextarea;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-textarea': NileTextarea;\n }\n}\n"]}