@aquera/nile-elements 0.0.59 → 0.0.61

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.
@@ -9,15 +9,92 @@ let NileLoader = class NileLoader extends LitElement {
9
9
  this.width = '60';
10
10
  this.position = 'absolute';
11
11
  this.margin = '';
12
+ this.variant = 'v3';
12
13
  }
13
14
  render() {
15
+ switch (this.variant) {
16
+ case 'v1':
17
+ return this.renderV1();
18
+ case 'v2':
19
+ return this.renderV2();
20
+ case 'v3':
21
+ return this.renderV3();
22
+ default:
23
+ return this.renderV1();
24
+ }
25
+ }
26
+ renderV1() {
14
27
  return html `
15
28
  <div
16
- style="width: ${this.width}px; height: ${this.height}px; background-size: ${this.width}px; position: ${this.position}; margin: ${this.margin}"
17
- class="nile-loader"
29
+ style="width: ${this.width}px; height: ${this
30
+ .height}px; background-size: ${this.width}px; position: ${this
31
+ .position}; margin: ${this.margin}"
32
+ class="nile-loader__v1"
18
33
  ></div>
19
34
  `;
20
35
  }
36
+ renderV2() {
37
+ return html `
38
+ <svg
39
+ class="nile-loader__v2"
40
+ width="${this.width}"
41
+ height="${this.height}"
42
+ viewBox="0 0 32 32"
43
+ fill="none"
44
+ xmlns="http://www.w3.org/2000/svg"
45
+ >
46
+ <g id="Loading circle">
47
+ <path
48
+ id="Background"
49
+ d="M30 16C30 17.8385 29.6379 19.659 28.9343 21.3576C28.2308 23.0561 27.1995 24.5995 25.8995 25.8995C24.5995 27.1995 23.0561 28.2307 21.3576 28.9343C19.659 29.6379 17.8385 30 16 30C14.1615 30 12.341 29.6379 10.6424 28.9343C8.94387 28.2307 7.40052 27.1995 6.1005 25.8995C4.80048 24.5995 3.76925 23.0561 3.06569 21.3576C2.36212 19.659 2 17.8385 2 16C2 14.1615 2.36212 12.341 3.06569 10.6424C3.76926 8.94387 4.80049 7.40052 6.10051 6.1005C7.40053 4.80048 8.94388 3.76925 10.6424 3.06568C12.341 2.36212 14.1615 2 16 2C17.8385 2 19.659 2.36212 21.3576 3.06569C23.0561 3.76926 24.5995 4.80049 25.8995 6.10051C27.1995 7.40053 28.2308 8.94388 28.9343 10.6424C29.6379 12.341 30 14.1615 30 16Z"
50
+ stroke="#F2F4F7"
51
+ stroke-width="4"
52
+ stroke-linecap="round"
53
+ stroke-linejoin="round"
54
+ />
55
+ <path
56
+ id="Line"
57
+ d="M16 2C17.8385 2 19.659 2.36212 21.3576 3.06569C23.0561 3.76925 24.5995 4.80049 25.8995 6.10051C27.1995 7.40053 28.2308 8.94388 28.9343 10.6424C29.6379 12.341 30 14.1615 30 16"
58
+ stroke="#005EA6"
59
+ stroke-width="4"
60
+ stroke-linecap="round"
61
+ stroke-linejoin="round"
62
+ />
63
+ </g>
64
+ </svg>
65
+ `;
66
+ }
67
+ renderV3() {
68
+ return html `
69
+ <svg
70
+ class="nile-loader__v3"
71
+ width="${this.width}"
72
+ height="${this.height}"
73
+ viewBox="0 0 32 32"
74
+ fill="none"
75
+ xmlns="http://www.w3.org/2000/svg"
76
+ >
77
+ <g id="Loading circle">
78
+ <path
79
+ id="Background"
80
+ d="M30 16C30 17.8385 29.6379 19.659 28.9343 21.3576C28.2308 23.0561 27.1995 24.5995 25.8995 25.8995C24.5995 27.1995 23.0561 28.2307 21.3576 28.9343C19.659 29.6379 17.8385 30 16 30C14.1615 30 12.341 29.6379 10.6424 28.9343C8.94387 28.2307 7.40052 27.1995 6.1005 25.8995C4.80048 24.5995 3.76925 23.0561 3.06569 21.3576C2.36212 19.659 2 17.8385 2 16C2 14.1615 2.36212 12.341 3.06569 10.6424C3.76926 8.94387 4.80049 7.40052 6.10051 6.1005C7.40053 4.80048 8.94388 3.76925 10.6424 3.06568C12.341 2.36212 14.1615 2 16 2C17.8385 2 19.659 2.36212 21.3576 3.06569C23.0561 3.76926 24.5995 4.80049 25.8995 6.10051C27.1995 7.40053 28.2308 8.94388 28.9343 10.6424C29.6379 12.341 30 14.1615 30 16L30 16Z"
81
+ stroke="white"
82
+ stroke-width="4"
83
+ stroke-linecap="round"
84
+ stroke-linejoin="round"
85
+ />
86
+ <path
87
+ id="Line"
88
+ d="M6.10051 6.1005C7.66275 4.53826 9.57255 3.36793 11.6738 2.68521C13.775 2.00248 16.0079 1.82675 18.1901 2.17236C20.3722 2.51798 22.4416 3.37514 24.229 4.67376C26.0164 5.97238 27.4711 7.67559 28.4741 9.64414C29.4771 11.6127 30 13.7907 30 16C30 18.2093 29.4771 20.3873 28.4741 22.3559C27.4711 24.3244 26.0164 26.0276 24.229 27.3262C22.4416 28.6249 20.3722 29.482 18.1901 29.8276"
89
+ stroke="#005EA6"
90
+ stroke-width="4"
91
+ stroke-linecap="round"
92
+ stroke-linejoin="round"
93
+ />
94
+ </g>
95
+ </svg>
96
+ `;
97
+ }
21
98
  };
22
99
  NileLoader.styles = styles;
23
100
  __decorate([
@@ -32,6 +109,9 @@ __decorate([
32
109
  __decorate([
33
110
  property({ type: String })
34
111
  ], NileLoader.prototype, "margin", void 0);
112
+ __decorate([
113
+ property({ type: String })
114
+ ], NileLoader.prototype, "variant", void 0);
35
115
  NileLoader = __decorate([
36
116
  customElement('nile-loader')
37
117
  ], NileLoader);
@@ -1 +1 @@
1
- {"version":3,"file":"nile-loader.js","sourceRoot":"","sources":["../../../src/nile-loader/nile-loader.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGhC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QAEuB,WAAM,GAAG,IAAI,CAAC;QACd,UAAK,GAAG,IAAI,CAAC;QACb,aAAQ,GAAG,UAAU,CAAC;QACtB,WAAM,GAAG,EAAE,CAAC;IAY1C,CAAC;IARU,MAAM;QACb,OAAO,IAAI,CAAA;;wBAES,IAAI,CAAC,KAAK,eAAe,IAAI,CAAC,MAAM,wBAAwB,IAAI,CAAC,KAAK,iBAAiB,IAAI,CAAC,QAAQ,aAAa,IAAI,CAAC,MAAM;;;KAG/I,CAAC;IACJ,CAAC;;AATe,iBAAM,GAAmB,MAAM,CAAC;AALpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAuB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAa;AAL7B,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAiBtB;SAjBY,UAAU","sourcesContent":["import { CSSResultGroup, css } from 'lit';\nimport { LitElement, html } from 'lit-element';\nimport { customElement, property } from 'lit/decorators.js';\nimport styles from './nile-loader.css';\n\n@customElement('nile-loader')\nexport class NileLoader extends LitElement {\n\n @property({ type: String }) height = '60';\n @property({ type: String }) width = '60';\n @property({ type: String }) position = 'absolute';\n @property({ type: String }) margin = '';\n\n static override styles: CSSResultGroup = styles;\n\n override render() {\n return html`\n <div\n style=\"width: ${this.width}px; height: ${this.height}px; background-size: ${this.width}px; position: ${this.position}; margin: ${this.margin}\"\n class=\"nile-loader\"\n ></div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-loader.js","sourceRoot":"","sources":["../../../src/nile-loader/nile-loader.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGhC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QACuB,WAAM,GAAG,IAAI,CAAC;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IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAgB;AALhC,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA+FtB;SA/FY,UAAU","sourcesContent":["import { CSSResultGroup, css } from 'lit';\nimport { LitElement, html, TemplateResult } from 'lit-element';\nimport { customElement, property } from 'lit/decorators.js';\nimport styles from './nile-loader.css';\n\n@customElement('nile-loader')\nexport class NileLoader extends LitElement {\n @property({ type: String }) height = '60';\n @property({ type: String }) width = '60';\n @property({ type: String }) position = 'absolute';\n @property({ type: String }) margin = '';\n @property({ type: String }) variant = 'v3';\n\n static override styles: CSSResultGroup = styles;\n\n override render(): TemplateResult {\n switch (this.variant) {\n case 'v1':\n return this.renderV1();\n case 'v2':\n return this.renderV2();\n case 'v3':\n return this.renderV3();\n default:\n return this.renderV1();\n } }\n\n private renderV1(): TemplateResult {\n return html`\n <div\n style=\"width: ${this.width}px; height: ${this\n .height}px; background-size: ${this.width}px; position: ${this\n .position}; margin: ${this.margin}\"\n class=\"nile-loader__v1\"\n ></div>\n `;\n }\n\n private renderV2(): TemplateResult {\n return html`\n <svg\n class=\"nile-loader__v2\"\n width=\"${this.width}\"\n height=\"${this.height}\"\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g id=\"Loading circle\">\n <path\n id=\"Background\"\n d=\"M30 16C30 17.8385 29.6379 19.659 28.9343 21.3576C28.2308 23.0561 27.1995 24.5995 25.8995 25.8995C24.5995 27.1995 23.0561 28.2307 21.3576 28.9343C19.659 29.6379 17.8385 30 16 30C14.1615 30 12.341 29.6379 10.6424 28.9343C8.94387 28.2307 7.40052 27.1995 6.1005 25.8995C4.80048 24.5995 3.76925 23.0561 3.06569 21.3576C2.36212 19.659 2 17.8385 2 16C2 14.1615 2.36212 12.341 3.06569 10.6424C3.76926 8.94387 4.80049 7.40052 6.10051 6.1005C7.40053 4.80048 8.94388 3.76925 10.6424 3.06568C12.341 2.36212 14.1615 2 16 2C17.8385 2 19.659 2.36212 21.3576 3.06569C23.0561 3.76926 24.5995 4.80049 25.8995 6.10051C27.1995 7.40053 28.2308 8.94388 28.9343 10.6424C29.6379 12.341 30 14.1615 30 16Z\"\n stroke=\"#F2F4F7\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n id=\"Line\"\n d=\"M16 2C17.8385 2 19.659 2.36212 21.3576 3.06569C23.0561 3.76925 24.5995 4.80049 25.8995 6.10051C27.1995 7.40053 28.2308 8.94388 28.9343 10.6424C29.6379 12.341 30 14.1615 30 16\"\n stroke=\"#005EA6\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </g>\n </svg>\n `;\n }\n\n private renderV3(): TemplateResult {\n return html`\n <svg\n class=\"nile-loader__v3\"\n width=\"${this.width}\"\n height=\"${this.height}\"\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g id=\"Loading circle\">\n <path\n id=\"Background\"\n d=\"M30 16C30 17.8385 29.6379 19.659 28.9343 21.3576C28.2308 23.0561 27.1995 24.5995 25.8995 25.8995C24.5995 27.1995 23.0561 28.2307 21.3576 28.9343C19.659 29.6379 17.8385 30 16 30C14.1615 30 12.341 29.6379 10.6424 28.9343C8.94387 28.2307 7.40052 27.1995 6.1005 25.8995C4.80048 24.5995 3.76925 23.0561 3.06569 21.3576C2.36212 19.659 2 17.8385 2 16C2 14.1615 2.36212 12.341 3.06569 10.6424C3.76926 8.94387 4.80049 7.40052 6.10051 6.1005C7.40053 4.80048 8.94388 3.76925 10.6424 3.06568C12.341 2.36212 14.1615 2 16 2C17.8385 2 19.659 2.36212 21.3576 3.06569C23.0561 3.76926 24.5995 4.80049 25.8995 6.10051C27.1995 7.40053 28.2308 8.94388 28.9343 10.6424C29.6379 12.341 30 14.1615 30 16L30 16Z\"\n stroke=\"white\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n id=\"Line\"\n d=\"M6.10051 6.1005C7.66275 4.53826 9.57255 3.36793 11.6738 2.68521C13.775 2.00248 16.0079 1.82675 18.1901 2.17236C20.3722 2.51798 22.4416 3.37514 24.229 4.67376C26.0164 5.97238 27.4711 7.67559 28.4741 9.64414C29.4771 11.6127 30 13.7907 30 16C30 18.2093 29.4771 20.3873 28.4741 22.3559C27.4711 24.3244 26.0164 26.0276 24.229 27.3262C22.4416 28.6249 20.3722 29.482 18.1901 29.8276\"\n stroke=\"#005EA6\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </g>\n </svg>\n `;\n }\n}\n"]}
@@ -306,9 +306,8 @@ let NileTextarea = class NileTextarea extends NileElement {
306
306
  @blur=${this.handleBlur}
307
307
  ></textarea>
308
308
  </div>
309
- </div>
310
309
 
311
- ${hasHelpText
310
+ ${hasHelpText
312
311
  ? html `
313
312
  <nile-form-help-text>${this.helpText}</nile-form-help-text>
314
313
  `
@@ -320,6 +319,8 @@ let NileTextarea = class NileTextarea extends NileElement {
320
319
  >
321
320
  `
322
321
  : ``}
322
+
323
+ </div>
323
324
  <div class="input__non-printable">
324
325
  Non-printable character detected.
325
326
  <nile-badge
@@ -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,EAA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,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"]}
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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\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 /** 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\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\n </div>\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"]}