@tectra-ng/ui 0.1.8 → 0.2.0

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 (30) hide show
  1. package/README.md +2 -2
  2. package/avatar/README.md +19 -6
  3. package/color-picker/README.md +6 -5
  4. package/fesm2022/tectra-ng-ui-avatar.mjs +243 -63
  5. package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -1
  6. package/fesm2022/tectra-ng-ui-color-picker.mjs +100 -18
  7. package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
  8. package/fesm2022/tectra-ng-ui-list-input.mjs +693 -0
  9. package/fesm2022/tectra-ng-ui-list-input.mjs.map +1 -0
  10. package/fesm2022/tectra-ng-ui-mention-textarea.mjs +1 -0
  11. package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -1
  12. package/fesm2022/tectra-ng-ui-month-calendar.mjs +1 -0
  13. package/fesm2022/tectra-ng-ui-month-calendar.mjs.map +1 -1
  14. package/fesm2022/tectra-ng-ui-tooltip.mjs +10 -5
  15. package/fesm2022/tectra-ng-ui-tooltip.mjs.map +1 -1
  16. package/fesm2022/tectra-ng-ui-truncate-text.mjs +390 -0
  17. package/fesm2022/tectra-ng-ui-truncate-text.mjs.map +1 -0
  18. package/list-input/README.md +52 -0
  19. package/package.json +12 -4
  20. package/truncate-text/README.md +38 -0
  21. package/types/tectra-ng-ui-avatar.d.ts +85 -3
  22. package/types/tectra-ng-ui-avatar.d.ts.map +1 -1
  23. package/types/tectra-ng-ui-color-picker.d.ts +22 -1
  24. package/types/tectra-ng-ui-color-picker.d.ts.map +1 -1
  25. package/types/tectra-ng-ui-list-input.d.ts +231 -0
  26. package/types/tectra-ng-ui-list-input.d.ts.map +1 -0
  27. package/types/tectra-ng-ui-tooltip.d.ts +20 -17
  28. package/types/tectra-ng-ui-tooltip.d.ts.map +1 -1
  29. package/types/tectra-ng-ui-truncate-text.d.ts +123 -0
  30. package/types/tectra-ng-ui-truncate-text.d.ts.map +1 -0
@@ -0,0 +1,693 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, booleanAttribute, computed, forwardRef, inject, input, model, numberAttribute, output, viewChild } from "@angular/core";
3
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
4
+ import { uniqueId } from "@tectra-ng/core/a11y";
5
+ import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
6
+ import { TxFormControlBase, injectFieldInvalid } from "@tectra-ng/core/forms";
7
+ import { TxLocaleService } from "@tectra-ng/core/i18n";
8
+ import { optionalBoolean } from "@tectra-ng/core/utils";
9
+ import { toStyleObject } from "@tectra-ng/themes";
10
+ import { TxButton } from "@tectra-ng/ui/button";
11
+ import { TxPill } from "@tectra-ng/ui/pill";
12
+ import { TxTooltip } from "@tectra-ng/ui/tooltip";
13
+ const DOMAIN_PATTERN = /^(?=.{1,253}$)(?:(?!-)[\p{L}\p{N}-]{1,63}(?<!-)\.)+(?:\p{L}{2,63}|xn--[a-z\d-]{2,59})$/u;
14
+ const PROTOCOL = /^[a-z][a-z\d+.-]*:\/\//i;
15
+ const PATH_START = /[/?#]/;
16
+ const PORT = /:\d+$/;
17
+ const TRAILING_DOT = /\.$/;
18
+ const EMAIL_LOCAL = /^[^\s@<>()[\]\\,;:"]+$/;
19
+ const TX_LIST_INPUT_WORDS = /[\s,;]+/;
20
+ const TX_LIST_INPUT_LINES = /[\r\n,;]+/;
21
+ function txParseDomain(token) {
22
+ const host = token.toLowerCase().replace(PROTOCOL, "");
23
+ const pathIndex = host.search(PATH_START);
24
+ const domain = (pathIndex === -1 ? host : host.slice(0, pathIndex)).replace(PORT, "").replace(TRAILING_DOT, "");
25
+ return DOMAIN_PATTERN.test(domain) ? domain : null;
26
+ }
27
+ function txParseEmail(token) {
28
+ const email = token.replace(/^mailto:/i, "").replace(/^<(.*)>$/, "$1").toLowerCase();
29
+ const at = email.lastIndexOf("@");
30
+ if (at < 1) return null;
31
+ const local = email.slice(0, at);
32
+ const domain = email.slice(at + 1).replace(TRAILING_DOT, "");
33
+ return EMAIL_LOCAL.test(local) && DOMAIN_PATTERN.test(domain) ? `${local}@${domain}` : null;
34
+ }
35
+ function txParseUrl(token) {
36
+ let url;
37
+ try {
38
+ url = new URL(PROTOCOL.test(token) ? token : `https://${token}`);
39
+ } catch {
40
+ return null;
41
+ }
42
+ if (url.protocol !== "https:" && url.protocol !== "http:" || !DOMAIN_PATTERN.test(url.hostname.replace(TRAILING_DOT, ""))) return null;
43
+ return url.pathname === "/" && !url.search && !url.hash ? url.origin : url.href;
44
+ }
45
+ function txParseText(token) {
46
+ return token;
47
+ }
48
+ const TX_LIST_INPUT_PARSERS = {
49
+ domain: txParseDomain,
50
+ email: txParseEmail,
51
+ url: txParseUrl,
52
+ text: txParseText
53
+ };
54
+ function txParseList(text, parser, separator = TX_LIST_INPUT_WORDS) {
55
+ const items = /* @__PURE__ */ new Set();
56
+ const invalid = /* @__PURE__ */ new Set();
57
+ let duplicates = 0;
58
+ for (const raw of (text ?? "").split(separator)) {
59
+ const token = raw.trim();
60
+ if (!token) continue;
61
+ const item = parser(token);
62
+ if (item === null || item === "") invalid.add(token);
63
+ else if (items.has(item)) duplicates++;
64
+ else items.add(item);
65
+ }
66
+ return {
67
+ items: [...items],
68
+ invalid: [...invalid],
69
+ duplicates
70
+ };
71
+ }
72
+ const LINE_BREAK = "\n";
73
+ const TEXTS = {
74
+ domain: {
75
+ placeholder: "listInputPlaceholderDomain",
76
+ hint: "listInputHintDomain",
77
+ count: "listInputDomains",
78
+ icon: "globe"
79
+ },
80
+ email: {
81
+ placeholder: "listInputPlaceholderEmail",
82
+ hint: "listInputHintEmail",
83
+ count: "listInputEmails",
84
+ icon: "envelope"
85
+ },
86
+ url: {
87
+ placeholder: "listInputPlaceholderUrl",
88
+ hint: "listInputHintUrl",
89
+ count: "listInputUrls",
90
+ icon: "link"
91
+ },
92
+ text: {
93
+ placeholder: "listInputPlaceholder",
94
+ hint: "listInputHint",
95
+ count: "listInputItems",
96
+ icon: "list"
97
+ }
98
+ };
99
+ var TxListInput = class TxListInput extends TxFormControlBase {
100
+ locale = inject(TxLocaleService);
101
+ text = model("", ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
102
+ type = input("text", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
103
+ parser = input(void 0, ...ngDevMode ? [{ debugName: "parser" }] : /* istanbul ignore next */ []);
104
+ splitByLines = input(false, {
105
+ ...ngDevMode ? { debugName: "splitByLines" } : /* istanbul ignore next */ {},
106
+ transform: booleanAttribute
107
+ });
108
+ separator = input(void 0, ...ngDevMode ? [{ debugName: "separator" }] : /* istanbul ignore next */ []);
109
+ placeholder = input(void 0, ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
110
+ hint = input(void 0, ...ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []);
111
+ countLabel = input(void 0, ...ngDevMode ? [{ debugName: "countLabel" }] : /* istanbul ignore next */ []);
112
+ rows = input(8, {
113
+ ...ngDevMode ? { debugName: "rows" } : /* istanbul ignore next */ {},
114
+ transform: numberAttribute
115
+ });
116
+ invalidLimit = input(8, {
117
+ ...ngDevMode ? { debugName: "invalidLimit" } : /* istanbul ignore next */ {},
118
+ transform: numberAttribute
119
+ });
120
+ disabledInput = input(false, {
121
+ ...ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {},
122
+ alias: "disabled",
123
+ transform: booleanAttribute
124
+ });
125
+ readonly = input(false, {
126
+ ...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
127
+ transform: booleanAttribute
128
+ });
129
+ invalid = input(void 0, {
130
+ ...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
131
+ transform: optionalBoolean
132
+ });
133
+ inputId = input(void 0, ...ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []);
134
+ ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
135
+ ariaLabelledBy = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
136
+ dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
137
+ pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
138
+ ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
139
+ unstyled = input(void 0, {
140
+ ...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
141
+ transform: optionalBoolean
142
+ });
143
+ itemsChange = output();
144
+ parsedChange = output();
145
+ field = viewChild.required("field", ...ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []);
146
+ statusId = uniqueId("tx-list-input-status");
147
+ translations = this.locale.translations;
148
+ isInvalid = injectFieldInvalid(this.invalid);
149
+ isUnstyled = injectUnstyled(this.unstyled);
150
+ passThrough = injectPassThrough("listInput", this, this.pt, this.ptOptions);
151
+ isDisabled = computed(() => this.disabled() || this.disabledInput(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
152
+ texts = computed(() => TEXTS[this.type()], ...ngDevMode ? [{ debugName: "texts" }] : /* istanbul ignore next */ []);
153
+ parsed = computed(() => txParseList(this.text(), this.parser() ?? TX_LIST_INPUT_PARSERS[this.type()], this.separator() ?? (this.splitByLines() ? TX_LIST_INPUT_LINES : TX_LIST_INPUT_WORDS)), ...ngDevMode ? [{ debugName: "parsed" }] : /* istanbul ignore next */ []);
154
+ invalidPreview = computed(() => this.parsed().invalid.slice(0, Math.max(0, this.invalidLimit())), ...ngDevMode ? [{ debugName: "invalidPreview" }] : /* istanbul ignore next */ []);
155
+ invalidHidden = computed(() => this.parsed().invalid.length - this.invalidPreview().length, ...ngDevMode ? [{ debugName: "invalidHidden" }] : /* istanbul ignore next */ []);
156
+ isEmpty = computed(() => !this.parsed().items.length && !this.parsed().invalid.length, ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
157
+ canCleanUp = computed(() => !!this.parsed().items.length && this.text().trim() !== this.parsed().items.join(LINE_BREAK), ...ngDevMode ? [{ debugName: "canCleanUp" }] : /* istanbul ignore next */ []);
158
+ placeholderText = computed(() => this.placeholder() ?? this.translations()[this.texts().placeholder], ...ngDevMode ? [{ debugName: "placeholderText" }] : /* istanbul ignore next */ []);
159
+ hintText = computed(() => this.hint() ?? this.translations()[this.texts().hint], ...ngDevMode ? [{ debugName: "hintText" }] : /* istanbul ignore next */ []);
160
+ countText = computed(() => {
161
+ const count = this.parsed().items.length;
162
+ const custom = this.countLabel();
163
+ return custom !== void 0 ? this.locale.format(custom, { count }) : this.locale.translate(this.texts().count, { count });
164
+ }, ...ngDevMode ? [{ debugName: "countText" }] : /* istanbul ignore next */ []);
165
+ duplicatesText = computed(() => this.locale.translate("listInputDuplicates", { count: this.parsed().duplicates }), ...ngDevMode ? [{ debugName: "duplicatesText" }] : /* istanbul ignore next */ []);
166
+ invalidCountText = computed(() => this.locale.translate("listInputInvalidCount", { count: this.parsed().invalid.length }), ...ngDevMode ? [{ debugName: "invalidCountText" }] : /* istanbul ignore next */ []);
167
+ moreText = computed(() => this.locale.translate("listInputMore", { count: this.invalidHidden() }), ...ngDevMode ? [{ debugName: "moreText" }] : /* istanbul ignore next */ []);
168
+ hostStyle = computed(() => ({
169
+ ...toStyleObject(this.dt(), "--tx-list-input"),
170
+ ...this.passThrough().root?.style
171
+ }), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
172
+ writeValue(value) {
173
+ const items = Array.isArray(value) ? value : [];
174
+ super.writeValue(items);
175
+ if (!sameItems(items, this.parsed().items)) this.text.set(items.join(LINE_BREAK));
176
+ }
177
+ onInput(event) {
178
+ this.setText(event.target.value);
179
+ }
180
+ onBlur() {
181
+ this.markTouched();
182
+ }
183
+ cleanUp() {
184
+ this.setText(this.parsed().items.join(LINE_BREAK));
185
+ this.field().nativeElement.focus();
186
+ }
187
+ clear() {
188
+ this.setText("");
189
+ this.field().nativeElement.focus();
190
+ }
191
+ setText(text) {
192
+ this.text.set(text);
193
+ const parsed = this.parsed();
194
+ this.updateValue(parsed.items);
195
+ this.itemsChange.emit(parsed.items);
196
+ this.parsedChange.emit(parsed);
197
+ }
198
+ static ɵfac = i0.ɵɵngDeclareFactory({
199
+ minVersion: "12.0.0",
200
+ version: "22.2.3",
201
+ ngImport: i0,
202
+ type: TxListInput,
203
+ deps: null,
204
+ target: i0.ɵɵFactoryTarget.Component
205
+ });
206
+ static ɵcmp = i0.ɵɵngDeclareComponent({
207
+ minVersion: "17.0.0",
208
+ version: "22.2.3",
209
+ type: TxListInput,
210
+ isStandalone: true,
211
+ selector: "tx-list-input",
212
+ inputs: {
213
+ text: {
214
+ classPropertyName: "text",
215
+ publicName: "text",
216
+ isSignal: true,
217
+ isRequired: false,
218
+ transformFunction: null
219
+ },
220
+ type: {
221
+ classPropertyName: "type",
222
+ publicName: "type",
223
+ isSignal: true,
224
+ isRequired: false,
225
+ transformFunction: null
226
+ },
227
+ parser: {
228
+ classPropertyName: "parser",
229
+ publicName: "parser",
230
+ isSignal: true,
231
+ isRequired: false,
232
+ transformFunction: null
233
+ },
234
+ splitByLines: {
235
+ classPropertyName: "splitByLines",
236
+ publicName: "splitByLines",
237
+ isSignal: true,
238
+ isRequired: false,
239
+ transformFunction: null
240
+ },
241
+ separator: {
242
+ classPropertyName: "separator",
243
+ publicName: "separator",
244
+ isSignal: true,
245
+ isRequired: false,
246
+ transformFunction: null
247
+ },
248
+ placeholder: {
249
+ classPropertyName: "placeholder",
250
+ publicName: "placeholder",
251
+ isSignal: true,
252
+ isRequired: false,
253
+ transformFunction: null
254
+ },
255
+ hint: {
256
+ classPropertyName: "hint",
257
+ publicName: "hint",
258
+ isSignal: true,
259
+ isRequired: false,
260
+ transformFunction: null
261
+ },
262
+ countLabel: {
263
+ classPropertyName: "countLabel",
264
+ publicName: "countLabel",
265
+ isSignal: true,
266
+ isRequired: false,
267
+ transformFunction: null
268
+ },
269
+ rows: {
270
+ classPropertyName: "rows",
271
+ publicName: "rows",
272
+ isSignal: true,
273
+ isRequired: false,
274
+ transformFunction: null
275
+ },
276
+ invalidLimit: {
277
+ classPropertyName: "invalidLimit",
278
+ publicName: "invalidLimit",
279
+ isSignal: true,
280
+ isRequired: false,
281
+ transformFunction: null
282
+ },
283
+ disabledInput: {
284
+ classPropertyName: "disabledInput",
285
+ publicName: "disabled",
286
+ isSignal: true,
287
+ isRequired: false,
288
+ transformFunction: null
289
+ },
290
+ readonly: {
291
+ classPropertyName: "readonly",
292
+ publicName: "readonly",
293
+ isSignal: true,
294
+ isRequired: false,
295
+ transformFunction: null
296
+ },
297
+ invalid: {
298
+ classPropertyName: "invalid",
299
+ publicName: "invalid",
300
+ isSignal: true,
301
+ isRequired: false,
302
+ transformFunction: null
303
+ },
304
+ inputId: {
305
+ classPropertyName: "inputId",
306
+ publicName: "inputId",
307
+ isSignal: true,
308
+ isRequired: false,
309
+ transformFunction: null
310
+ },
311
+ ariaLabel: {
312
+ classPropertyName: "ariaLabel",
313
+ publicName: "ariaLabel",
314
+ isSignal: true,
315
+ isRequired: false,
316
+ transformFunction: null
317
+ },
318
+ ariaLabelledBy: {
319
+ classPropertyName: "ariaLabelledBy",
320
+ publicName: "ariaLabelledBy",
321
+ isSignal: true,
322
+ isRequired: false,
323
+ transformFunction: null
324
+ },
325
+ dt: {
326
+ classPropertyName: "dt",
327
+ publicName: "dt",
328
+ isSignal: true,
329
+ isRequired: false,
330
+ transformFunction: null
331
+ },
332
+ pt: {
333
+ classPropertyName: "pt",
334
+ publicName: "pt",
335
+ isSignal: true,
336
+ isRequired: false,
337
+ transformFunction: null
338
+ },
339
+ ptOptions: {
340
+ classPropertyName: "ptOptions",
341
+ publicName: "ptOptions",
342
+ isSignal: true,
343
+ isRequired: false,
344
+ transformFunction: null
345
+ },
346
+ unstyled: {
347
+ classPropertyName: "unstyled",
348
+ publicName: "unstyled",
349
+ isSignal: true,
350
+ isRequired: false,
351
+ transformFunction: null
352
+ }
353
+ },
354
+ outputs: {
355
+ text: "textChange",
356
+ itemsChange: "itemsChange",
357
+ parsedChange: "parsedChange"
358
+ },
359
+ host: {
360
+ properties: {
361
+ "class": "passThrough().root?.class",
362
+ "style": "hostStyle()",
363
+ "attr.data-styled": "!isUnstyled() || null",
364
+ "attr.data-type": "type()",
365
+ "class.tx-list-input--disabled": "isDisabled()",
366
+ "attr.role": "isDisabled() ? \"group\" : null",
367
+ "attr.aria-disabled": "isDisabled() || null",
368
+ "class.tx-list-input--readonly": "readonly()",
369
+ "class.tx-list-input--invalid": "isInvalid()",
370
+ "class.tx-list-input--filled": "!!text()"
371
+ },
372
+ classAttribute: "tx-list-input"
373
+ },
374
+ providers: [{
375
+ provide: NG_VALUE_ACCESSOR,
376
+ useExisting: forwardRef(() => TxListInput),
377
+ multi: true
378
+ }],
379
+ viewQueries: [{
380
+ propertyName: "field",
381
+ first: true,
382
+ predicate: ["field"],
383
+ descendants: true,
384
+ isSignal: true
385
+ }],
386
+ usesInheritance: true,
387
+ ngImport: i0,
388
+ template: "<textarea\n #field\n class=\"tx-list-input__field\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n [attr.id]=\"inputId() ?? null\"\n [rows]=\"rows()\"\n [placeholder]=\"placeholderText()\"\n [value]=\"text()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [class]=\"passThrough().field?.class\"\n [style]=\"passThrough().field?.style\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-describedby]=\"statusId\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n></textarea>\n\n<div class=\"tx-list-input__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\">\n <div class=\"tx-list-input__stats\" [id]=\"statusId\" [class]=\"passThrough().stats?.class\" [style]=\"passThrough().stats?.style\">\n @if (isEmpty()) {\n <span class=\"tx-list-input__hint\">{{ hintText() }}</span>\n } @else {\n <tx-pill tone=\"primary\" [icon]=\"texts().icon\" [value]=\"countText()\" [unstyled]=\"isUnstyled()\" />\n @if (parsed().duplicates) {\n <tx-pill tone=\"warn\" icon=\"clone\" [value]=\"duplicatesText()\" [unstyled]=\"isUnstyled()\" />\n }\n @if (parsed().invalid.length) {\n <tx-pill tone=\"danger\" icon=\"exclamation-circle\" [value]=\"invalidCountText()\" [unstyled]=\"isUnstyled()\" />\n }\n }\n </div>\n @if (!readonly()) {\n <div class=\"tx-list-input__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n @if (canCleanUp()) {\n <button\n type=\"button\"\n txButton\n icon=\"sparkles\"\n [text]=\"true\"\n [label]=\"translations().listInputCleanUp\"\n [disabled]=\"isDisabled()\"\n [txTooltip]=\"translations().listInputCleanUpHint\"\n [unstyled]=\"isUnstyled()\"\n (click)=\"cleanUp()\"\n ></button>\n }\n @if (text()) {\n <button\n type=\"button\"\n txButton\n icon=\"times\"\n severity=\"secondary\"\n [text]=\"true\"\n [label]=\"translations().clear\"\n [disabled]=\"isDisabled()\"\n [unstyled]=\"isUnstyled()\"\n (click)=\"clear()\"\n ></button>\n }\n </div>\n }\n</div>\n\n@if (parsed().invalid.length) {\n <div class=\"tx-list-input__invalid\" [class]=\"passThrough().invalid?.class\" [style]=\"passThrough().invalid?.style\">\n <span class=\"tx-list-input__invalid-title\">{{ translations().listInputInvalid }}</span>\n @for (item of invalidPreview(); track item) {\n <tx-pill tone=\"danger\" size=\"small\" [value]=\"item\" [unstyled]=\"isUnstyled()\" />\n }\n @if (invalidHidden()) {\n <span class=\"tx-list-input__hint\">{{ moreText() }}</span>\n }\n </div>\n}\n",
389
+ styles: [":host{display:flex;flex-direction:column}.tx-list-input__field{display:block;width:100%;box-sizing:border-box;resize:vertical}.tx-list-input__footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}.tx-list-input__stats{display:flex;flex-wrap:wrap;align-items:center;min-width:0}.tx-list-input__actions{display:flex;align-items:center;margin-inline-start:auto}.tx-list-input__invalid{display:flex;flex-wrap:wrap;align-items:center}:host([data-styled]){overflow:hidden;border:var(--tx-list-input-border-width) solid var(--tx-list-input-border-color);border-radius:var(--tx-list-input-border-radius);background:var(--tx-list-input-background);transition:border-color var(--tx-list-input-transition-duration) ease,box-shadow var(--tx-list-input-transition-duration) ease}:host([data-styled]):focus-within{border-color:var(--tx-list-input-focus-border-color);box-shadow:0 0 0 calc(var(--tx-list-input-focus-border-width) - var(--tx-list-input-border-width)) var(--tx-list-input-focus-border-color)}:host([data-styled]) .tx-list-input__field{min-height:var(--tx-list-input-field-min-height);margin:0;padding:var(--tx-list-input-field-padding);border:0;border-radius:0;outline:none;background:transparent;box-shadow:none;color:var(--tx-list-input-field-color);font-family:var(--tx-list-input-field-font-family);font-size:var(--tx-list-input-field-font-size);line-height:var(--tx-list-input-field-line-height)}:host([data-styled]) .tx-list-input__field::placeholder{color:var(--tx-list-input-field-placeholder-color)}:host([data-styled]) .tx-list-input__footer{gap:var(--tx-list-input-footer-gap);padding:var(--tx-list-input-footer-padding);border-top:1px solid var(--tx-list-input-footer-border-color);background:var(--tx-list-input-footer-background)}:host([data-styled]) .tx-list-input__stats{gap:var(--tx-list-input-footer-stats-gap);padding-inline-start:var(--tx-list-input-footer-stats-padding-start)}:host([data-styled]) .tx-list-input__actions{gap:var(--tx-list-input-footer-actions-gap)}:host([data-styled]) .tx-list-input__hint{color:var(--tx-list-input-hint-color);font-size:var(--tx-list-input-hint-font-size)}:host([data-styled]) .tx-list-input__invalid{gap:var(--tx-list-input-unrecognized-gap);padding:var(--tx-list-input-unrecognized-padding);border-top:1px solid var(--tx-list-input-unrecognized-border-color)}:host([data-styled]) .tx-list-input__invalid-title{margin-inline-end:var(--tx-list-input-unrecognized-title-gap);color:var(--tx-list-input-unrecognized-title-color);font-size:var(--tx-list-input-unrecognized-title-font-size);font-weight:var(--tx-list-input-unrecognized-title-font-weight)}:host([data-styled].tx-list-input--invalid){border-color:var(--tx-list-input-invalid-border-color)}:host([data-styled].tx-list-input--invalid:focus-within){box-shadow:0 0 0 calc(var(--tx-list-input-focus-border-width) - var(--tx-list-input-border-width)) var(--tx-list-input-invalid-border-color)}:host([data-styled].tx-list-input--disabled){opacity:var(--tx-list-input-disabled-opacity)}@media(prefers-reduced-motion:reduce){:host([data-styled]){transition:none}}\n"],
390
+ dependencies: [
391
+ {
392
+ kind: "component",
393
+ type: TxButton,
394
+ selector: "button[txButton], a[txButton]",
395
+ inputs: [
396
+ "label",
397
+ "severity",
398
+ "size",
399
+ "variant",
400
+ "outlined",
401
+ "text",
402
+ "link",
403
+ "rounded",
404
+ "raised",
405
+ "plain",
406
+ "fluid",
407
+ "disabled",
408
+ "tabindex",
409
+ "icon",
410
+ "iconPos",
411
+ "iconOnly",
412
+ "loading",
413
+ "loadingIcon",
414
+ "badge",
415
+ "badgeSeverity",
416
+ "dt",
417
+ "pt",
418
+ "ptOptions",
419
+ "unstyled"
420
+ ]
421
+ },
422
+ {
423
+ kind: "component",
424
+ type: TxPill,
425
+ selector: "tx-pill",
426
+ inputs: [
427
+ "value",
428
+ "tone",
429
+ "variant",
430
+ "size",
431
+ "icon",
432
+ "dot",
433
+ "removable",
434
+ "removeLabel",
435
+ "dt",
436
+ "pt",
437
+ "ptOptions",
438
+ "unstyled"
439
+ ],
440
+ outputs: ["removed"]
441
+ },
442
+ {
443
+ kind: "directive",
444
+ type: TxTooltip,
445
+ selector: "[txTooltip]",
446
+ inputs: [
447
+ "txTooltip",
448
+ "tooltipPlacement",
449
+ "tooltipEvent",
450
+ "tooltipShowDelay",
451
+ "tooltipHideDelay",
452
+ "tooltipLife",
453
+ "tooltipOffset",
454
+ "tooltipArrow",
455
+ "tooltipInteractive",
456
+ "tooltipDisabled",
457
+ "tooltipOverflowOnly",
458
+ "tooltipMultiline",
459
+ "tooltipContext",
460
+ "tooltipClass",
461
+ "tooltipDt",
462
+ "tooltipPt",
463
+ "tooltipPtOptions",
464
+ "tooltipUnstyled"
465
+ ],
466
+ outputs: ["tooltipShown", "tooltipHidden"],
467
+ exportAs: ["txTooltip"]
468
+ }
469
+ ],
470
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
471
+ });
472
+ };
473
+ i0.ɵɵngDeclareClassMetadata({
474
+ minVersion: "12.0.0",
475
+ version: "22.2.3",
476
+ ngImport: i0,
477
+ type: TxListInput,
478
+ decorators: [{
479
+ type: Component,
480
+ args: [{
481
+ selector: "tx-list-input",
482
+ imports: [
483
+ TxButton,
484
+ TxPill,
485
+ TxTooltip
486
+ ],
487
+ changeDetection: ChangeDetectionStrategy.OnPush,
488
+ providers: [{
489
+ provide: NG_VALUE_ACCESSOR,
490
+ useExisting: forwardRef(() => TxListInput),
491
+ multi: true
492
+ }],
493
+ host: {
494
+ class: "tx-list-input",
495
+ "[class]": "passThrough().root?.class",
496
+ "[style]": "hostStyle()",
497
+ "[attr.data-styled]": "!isUnstyled() || null",
498
+ "[attr.data-type]": "type()",
499
+ "[class.tx-list-input--disabled]": "isDisabled()",
500
+ "[attr.role]": "isDisabled() ? \"group\" : null",
501
+ "[attr.aria-disabled]": "isDisabled() || null",
502
+ "[class.tx-list-input--readonly]": "readonly()",
503
+ "[class.tx-list-input--invalid]": "isInvalid()",
504
+ "[class.tx-list-input--filled]": "!!text()"
505
+ },
506
+ template: "<textarea\n #field\n class=\"tx-list-input__field\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n [attr.id]=\"inputId() ?? null\"\n [rows]=\"rows()\"\n [placeholder]=\"placeholderText()\"\n [value]=\"text()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [class]=\"passThrough().field?.class\"\n [style]=\"passThrough().field?.style\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-describedby]=\"statusId\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n></textarea>\n\n<div class=\"tx-list-input__footer\" [class]=\"passThrough().footer?.class\" [style]=\"passThrough().footer?.style\">\n <div class=\"tx-list-input__stats\" [id]=\"statusId\" [class]=\"passThrough().stats?.class\" [style]=\"passThrough().stats?.style\">\n @if (isEmpty()) {\n <span class=\"tx-list-input__hint\">{{ hintText() }}</span>\n } @else {\n <tx-pill tone=\"primary\" [icon]=\"texts().icon\" [value]=\"countText()\" [unstyled]=\"isUnstyled()\" />\n @if (parsed().duplicates) {\n <tx-pill tone=\"warn\" icon=\"clone\" [value]=\"duplicatesText()\" [unstyled]=\"isUnstyled()\" />\n }\n @if (parsed().invalid.length) {\n <tx-pill tone=\"danger\" icon=\"exclamation-circle\" [value]=\"invalidCountText()\" [unstyled]=\"isUnstyled()\" />\n }\n }\n </div>\n @if (!readonly()) {\n <div class=\"tx-list-input__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n @if (canCleanUp()) {\n <button\n type=\"button\"\n txButton\n icon=\"sparkles\"\n [text]=\"true\"\n [label]=\"translations().listInputCleanUp\"\n [disabled]=\"isDisabled()\"\n [txTooltip]=\"translations().listInputCleanUpHint\"\n [unstyled]=\"isUnstyled()\"\n (click)=\"cleanUp()\"\n ></button>\n }\n @if (text()) {\n <button\n type=\"button\"\n txButton\n icon=\"times\"\n severity=\"secondary\"\n [text]=\"true\"\n [label]=\"translations().clear\"\n [disabled]=\"isDisabled()\"\n [unstyled]=\"isUnstyled()\"\n (click)=\"clear()\"\n ></button>\n }\n </div>\n }\n</div>\n\n@if (parsed().invalid.length) {\n <div class=\"tx-list-input__invalid\" [class]=\"passThrough().invalid?.class\" [style]=\"passThrough().invalid?.style\">\n <span class=\"tx-list-input__invalid-title\">{{ translations().listInputInvalid }}</span>\n @for (item of invalidPreview(); track item) {\n <tx-pill tone=\"danger\" size=\"small\" [value]=\"item\" [unstyled]=\"isUnstyled()\" />\n }\n @if (invalidHidden()) {\n <span class=\"tx-list-input__hint\">{{ moreText() }}</span>\n }\n </div>\n}\n",
507
+ styles: [":host{display:flex;flex-direction:column}.tx-list-input__field{display:block;width:100%;box-sizing:border-box;resize:vertical}.tx-list-input__footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}.tx-list-input__stats{display:flex;flex-wrap:wrap;align-items:center;min-width:0}.tx-list-input__actions{display:flex;align-items:center;margin-inline-start:auto}.tx-list-input__invalid{display:flex;flex-wrap:wrap;align-items:center}:host([data-styled]){overflow:hidden;border:var(--tx-list-input-border-width) solid var(--tx-list-input-border-color);border-radius:var(--tx-list-input-border-radius);background:var(--tx-list-input-background);transition:border-color var(--tx-list-input-transition-duration) ease,box-shadow var(--tx-list-input-transition-duration) ease}:host([data-styled]):focus-within{border-color:var(--tx-list-input-focus-border-color);box-shadow:0 0 0 calc(var(--tx-list-input-focus-border-width) - var(--tx-list-input-border-width)) var(--tx-list-input-focus-border-color)}:host([data-styled]) .tx-list-input__field{min-height:var(--tx-list-input-field-min-height);margin:0;padding:var(--tx-list-input-field-padding);border:0;border-radius:0;outline:none;background:transparent;box-shadow:none;color:var(--tx-list-input-field-color);font-family:var(--tx-list-input-field-font-family);font-size:var(--tx-list-input-field-font-size);line-height:var(--tx-list-input-field-line-height)}:host([data-styled]) .tx-list-input__field::placeholder{color:var(--tx-list-input-field-placeholder-color)}:host([data-styled]) .tx-list-input__footer{gap:var(--tx-list-input-footer-gap);padding:var(--tx-list-input-footer-padding);border-top:1px solid var(--tx-list-input-footer-border-color);background:var(--tx-list-input-footer-background)}:host([data-styled]) .tx-list-input__stats{gap:var(--tx-list-input-footer-stats-gap);padding-inline-start:var(--tx-list-input-footer-stats-padding-start)}:host([data-styled]) .tx-list-input__actions{gap:var(--tx-list-input-footer-actions-gap)}:host([data-styled]) .tx-list-input__hint{color:var(--tx-list-input-hint-color);font-size:var(--tx-list-input-hint-font-size)}:host([data-styled]) .tx-list-input__invalid{gap:var(--tx-list-input-unrecognized-gap);padding:var(--tx-list-input-unrecognized-padding);border-top:1px solid var(--tx-list-input-unrecognized-border-color)}:host([data-styled]) .tx-list-input__invalid-title{margin-inline-end:var(--tx-list-input-unrecognized-title-gap);color:var(--tx-list-input-unrecognized-title-color);font-size:var(--tx-list-input-unrecognized-title-font-size);font-weight:var(--tx-list-input-unrecognized-title-font-weight)}:host([data-styled].tx-list-input--invalid){border-color:var(--tx-list-input-invalid-border-color)}:host([data-styled].tx-list-input--invalid:focus-within){box-shadow:0 0 0 calc(var(--tx-list-input-focus-border-width) - var(--tx-list-input-border-width)) var(--tx-list-input-invalid-border-color)}:host([data-styled].tx-list-input--disabled){opacity:var(--tx-list-input-disabled-opacity)}@media(prefers-reduced-motion:reduce){:host([data-styled]){transition:none}}\n"]
508
+ }]
509
+ }],
510
+ propDecorators: {
511
+ text: [{
512
+ type: i0.Input,
513
+ args: [{
514
+ isSignal: true,
515
+ alias: "text",
516
+ required: false
517
+ }]
518
+ }, {
519
+ type: i0.Output,
520
+ args: ["textChange"]
521
+ }],
522
+ type: [{
523
+ type: i0.Input,
524
+ args: [{
525
+ isSignal: true,
526
+ alias: "type",
527
+ required: false
528
+ }]
529
+ }],
530
+ parser: [{
531
+ type: i0.Input,
532
+ args: [{
533
+ isSignal: true,
534
+ alias: "parser",
535
+ required: false
536
+ }]
537
+ }],
538
+ splitByLines: [{
539
+ type: i0.Input,
540
+ args: [{
541
+ isSignal: true,
542
+ alias: "splitByLines",
543
+ required: false
544
+ }]
545
+ }],
546
+ separator: [{
547
+ type: i0.Input,
548
+ args: [{
549
+ isSignal: true,
550
+ alias: "separator",
551
+ required: false
552
+ }]
553
+ }],
554
+ placeholder: [{
555
+ type: i0.Input,
556
+ args: [{
557
+ isSignal: true,
558
+ alias: "placeholder",
559
+ required: false
560
+ }]
561
+ }],
562
+ hint: [{
563
+ type: i0.Input,
564
+ args: [{
565
+ isSignal: true,
566
+ alias: "hint",
567
+ required: false
568
+ }]
569
+ }],
570
+ countLabel: [{
571
+ type: i0.Input,
572
+ args: [{
573
+ isSignal: true,
574
+ alias: "countLabel",
575
+ required: false
576
+ }]
577
+ }],
578
+ rows: [{
579
+ type: i0.Input,
580
+ args: [{
581
+ isSignal: true,
582
+ alias: "rows",
583
+ required: false
584
+ }]
585
+ }],
586
+ invalidLimit: [{
587
+ type: i0.Input,
588
+ args: [{
589
+ isSignal: true,
590
+ alias: "invalidLimit",
591
+ required: false
592
+ }]
593
+ }],
594
+ disabledInput: [{
595
+ type: i0.Input,
596
+ args: [{
597
+ isSignal: true,
598
+ alias: "disabled",
599
+ required: false
600
+ }]
601
+ }],
602
+ readonly: [{
603
+ type: i0.Input,
604
+ args: [{
605
+ isSignal: true,
606
+ alias: "readonly",
607
+ required: false
608
+ }]
609
+ }],
610
+ invalid: [{
611
+ type: i0.Input,
612
+ args: [{
613
+ isSignal: true,
614
+ alias: "invalid",
615
+ required: false
616
+ }]
617
+ }],
618
+ inputId: [{
619
+ type: i0.Input,
620
+ args: [{
621
+ isSignal: true,
622
+ alias: "inputId",
623
+ required: false
624
+ }]
625
+ }],
626
+ ariaLabel: [{
627
+ type: i0.Input,
628
+ args: [{
629
+ isSignal: true,
630
+ alias: "ariaLabel",
631
+ required: false
632
+ }]
633
+ }],
634
+ ariaLabelledBy: [{
635
+ type: i0.Input,
636
+ args: [{
637
+ isSignal: true,
638
+ alias: "ariaLabelledBy",
639
+ required: false
640
+ }]
641
+ }],
642
+ dt: [{
643
+ type: i0.Input,
644
+ args: [{
645
+ isSignal: true,
646
+ alias: "dt",
647
+ required: false
648
+ }]
649
+ }],
650
+ pt: [{
651
+ type: i0.Input,
652
+ args: [{
653
+ isSignal: true,
654
+ alias: "pt",
655
+ required: false
656
+ }]
657
+ }],
658
+ ptOptions: [{
659
+ type: i0.Input,
660
+ args: [{
661
+ isSignal: true,
662
+ alias: "ptOptions",
663
+ required: false
664
+ }]
665
+ }],
666
+ unstyled: [{
667
+ type: i0.Input,
668
+ args: [{
669
+ isSignal: true,
670
+ alias: "unstyled",
671
+ required: false
672
+ }]
673
+ }],
674
+ itemsChange: [{
675
+ type: i0.Output,
676
+ args: ["itemsChange"]
677
+ }],
678
+ parsedChange: [{
679
+ type: i0.Output,
680
+ args: ["parsedChange"]
681
+ }],
682
+ field: [{
683
+ type: i0.ViewChild,
684
+ args: ["field", { isSignal: true }]
685
+ }]
686
+ }
687
+ });
688
+ function sameItems(a, b) {
689
+ return a.length === b.length && a.every((item, index) => item === b[index]);
690
+ }
691
+ export { TX_LIST_INPUT_LINES, TX_LIST_INPUT_PARSERS, TX_LIST_INPUT_WORDS, TxListInput, txParseDomain, txParseEmail, txParseList, txParseText, txParseUrl };
692
+
693
+ //# sourceMappingURL=tectra-ng-ui-list-input.mjs.map