@taiga-ui/cdk 3.0.0-rc.5 → 3.0.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstract/dialog.service.d.ts +4 -4
- package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +1 -1
- package/bundles/taiga-ui-cdk-components-dialog-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-let.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives.umd.js +4 -10
- package/bundles/taiga-ui-cdk-directives.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-enums.umd.js +0 -56
- package/bundles/taiga-ui-cdk-enums.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-dom.umd.js +0 -1
- package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/directives/index.d.ts +0 -1
- package/directives/let/let.directive.d.ts +1 -1
- package/enums/index.d.ts +0 -1
- package/esm2015/abstract/dialog.service.js +1 -1
- package/esm2015/components/dialog-host/dialog-host.component.js +2 -2
- package/esm2015/constants/version.js +2 -2
- package/esm2015/directives/index.js +1 -2
- package/esm2015/directives/let/let.directive.js +1 -1
- package/esm2015/enums/index.js +1 -2
- package/esm2015/types/autocomplete.js +2 -0
- package/esm2015/types/index.js +3 -1
- package/esm2015/types/injection-token-type.js +2 -0
- package/esm2015/utils/dom/element-checks.js +1 -2
- package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components-dialog-host.js +1 -1
- package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-let.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives.js +0 -1
- package/fesm2015/taiga-ui-cdk-directives.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-enums.js +1 -57
- package/fesm2015/taiga-ui-cdk-enums.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-dom.js +0 -1
- package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +12 -0
- package/schematics/ng-update/constants/consts.js +50 -0
- package/schematics/ng-update/constants/enums.js +72 -0
- package/schematics/ng-update/constants/modules.js +1 -0
- package/schematics/ng-update/constants/templates.js +103 -0
- package/schematics/ng-update/constants/tui-interactive-selectors.js +1 -1
- package/schematics/ng-update/steps/migrate-templates.js +2 -0
- package/schematics/ng-update/steps/migrate-textfield-controller.d.ts +8 -0
- package/schematics/ng-update/steps/migrate-textfield-controller.js +98 -0
- package/schematics/utils/templates/elements.d.ts +1 -0
- package/schematics/utils/templates/elements.js +9 -1
- package/types/autocomplete.d.ts +1 -0
- package/types/index.d.ts +2 -0
- package/types/injection-token-type.d.ts +2 -0
- package/bundles/taiga-ui-cdk-directives-input-mode.umd.js +0 -102
- package/bundles/taiga-ui-cdk-directives-input-mode.umd.js.map +0 -1
- package/directives/input-mode/index.d.ts +0 -2
- package/directives/input-mode/input-mode.directive.d.ts +0 -14
- package/directives/input-mode/input-mode.module.d.ts +0 -7
- package/directives/input-mode/package.json +0 -10
- package/directives/input-mode/taiga-ui-cdk-directives-input-mode.d.ts +0 -5
- package/enums/autocomplete.d.ts +0 -48
- package/esm2015/directives/input-mode/index.js +0 -3
- package/esm2015/directives/input-mode/input-mode.directive.js +0 -45
- package/esm2015/directives/input-mode/input-mode.module.js +0 -16
- package/esm2015/directives/input-mode/taiga-ui-cdk-directives-input-mode.js +0 -5
- package/esm2015/enums/autocomplete.js +0 -56
- package/fesm2015/taiga-ui-cdk-directives-input-mode.js +0 -65
- package/fesm2015/taiga-ui-cdk-directives-input-mode.js.map +0 -1
|
@@ -63,6 +63,16 @@ exports.CONSTS_TO_REPLACE = [
|
|
|
63
63
|
moduleSpecifier: '@taiga-ui/core',
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
|
+
{
|
|
67
|
+
from: {
|
|
68
|
+
name: 'TuiHintControllerModule',
|
|
69
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
70
|
+
},
|
|
71
|
+
to: {
|
|
72
|
+
name: 'TuiHintModule',
|
|
73
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
66
76
|
{
|
|
67
77
|
from: {
|
|
68
78
|
name: 'TuiManualHintModule',
|
|
@@ -383,4 +393,44 @@ exports.CONSTS_TO_REPLACE = [
|
|
|
383
393
|
moduleSpecifier: '@taiga-ui/proprietary-banking',
|
|
384
394
|
},
|
|
385
395
|
},
|
|
396
|
+
{
|
|
397
|
+
from: {
|
|
398
|
+
name: 'TuiAutofillFieldNameT',
|
|
399
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
400
|
+
},
|
|
401
|
+
to: {
|
|
402
|
+
name: 'TuiAutofillFieldName',
|
|
403
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
from: {
|
|
408
|
+
name: 'TuiMarkerIconModeT',
|
|
409
|
+
moduleSpecifier: '@taiga-ui/kit',
|
|
410
|
+
},
|
|
411
|
+
to: {
|
|
412
|
+
name: 'TuiMarkerIconMode',
|
|
413
|
+
moduleSpecifier: '@taiga-ui/kit',
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
from: {
|
|
418
|
+
name: 'TuiStatusT',
|
|
419
|
+
moduleSpecifier: '@taiga-ui/kit',
|
|
420
|
+
},
|
|
421
|
+
to: {
|
|
422
|
+
name: 'TuiStatus',
|
|
423
|
+
moduleSpecifier: '@taiga-ui/kit',
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
from: {
|
|
428
|
+
name: 'TuiAbstractTextfieldHost',
|
|
429
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
430
|
+
},
|
|
431
|
+
to: {
|
|
432
|
+
name: 'AbstractTuiTextfieldHost',
|
|
433
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
434
|
+
},
|
|
435
|
+
},
|
|
386
436
|
];
|
|
@@ -100,6 +100,7 @@ exports.ENUMS_TO_REPLACE = [
|
|
|
100
100
|
Error: 'error',
|
|
101
101
|
Warning: 'warning',
|
|
102
102
|
},
|
|
103
|
+
keepAsType: true,
|
|
103
104
|
},
|
|
104
105
|
{
|
|
105
106
|
name: 'TuiMarkerIconMode',
|
|
@@ -113,6 +114,7 @@ exports.ENUMS_TO_REPLACE = [
|
|
|
113
114
|
Error: 'error',
|
|
114
115
|
OnDark: 'onDark',
|
|
115
116
|
},
|
|
117
|
+
keepAsType: true,
|
|
116
118
|
},
|
|
117
119
|
{
|
|
118
120
|
name: 'TuiDropdownPosition',
|
|
@@ -205,4 +207,74 @@ exports.ENUMS_TO_REPLACE = [
|
|
|
205
207
|
},
|
|
206
208
|
keepAsType: true,
|
|
207
209
|
},
|
|
210
|
+
{
|
|
211
|
+
name: 'TuiCreditCardAutofillName',
|
|
212
|
+
replaceValues: {
|
|
213
|
+
Off: `off`,
|
|
214
|
+
CcName: `cc-name`,
|
|
215
|
+
CcNumber: `cc-number`,
|
|
216
|
+
CcCsc: `cc-csc`,
|
|
217
|
+
CcExpMonth: `cc-exp-month`,
|
|
218
|
+
CcExpYear: `cc-exp-year`,
|
|
219
|
+
CcExp: `cc-exp`,
|
|
220
|
+
CcType: `cc-type`,
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: 'TuiNameAutofillName',
|
|
225
|
+
replaceValues: {
|
|
226
|
+
Off: `off`,
|
|
227
|
+
Name: `name`,
|
|
228
|
+
GivenName: `given-name`,
|
|
229
|
+
AdditionalName: `additional-name`,
|
|
230
|
+
FamilyName: `family-name`,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: 'TuiAccountAutofillName',
|
|
235
|
+
replaceValues: {
|
|
236
|
+
Off: `off`,
|
|
237
|
+
Username: `username`,
|
|
238
|
+
NewPassword: `new-password`,
|
|
239
|
+
CurrentPassword: `current-password`,
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: 'TuiEmailAutofillName',
|
|
244
|
+
replaceValues: {
|
|
245
|
+
Off: `off`,
|
|
246
|
+
Email: `email`,
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: 'TuiAddressAutofillName',
|
|
251
|
+
replaceValues: {
|
|
252
|
+
Off: `off`,
|
|
253
|
+
StreetAddress: `street-address`,
|
|
254
|
+
PostalCode: `postal-code`,
|
|
255
|
+
CountryName: `country-name`,
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: 'TuiPhoneAutofillName',
|
|
260
|
+
replaceValues: {
|
|
261
|
+
Off: `off`,
|
|
262
|
+
Tel: `tel`,
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: 'TuiDateAutofillName',
|
|
267
|
+
replaceValues: {
|
|
268
|
+
Off: `off`,
|
|
269
|
+
Bday: `bday`,
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: 'TuiTransactionAutofillName',
|
|
274
|
+
replaceValues: {
|
|
275
|
+
Off: `off`,
|
|
276
|
+
TransactionCurrency: `transaction-currency`,
|
|
277
|
+
TransactionAmount: `transaction-amount`,
|
|
278
|
+
},
|
|
279
|
+
},
|
|
208
280
|
];
|
|
@@ -5,4 +5,5 @@ exports.REMOVED_MODULES = [
|
|
|
5
5
|
{ name: 'TuiResizableColumnModule', moduleSpecifier: '@taiga-ui/addon-table' },
|
|
6
6
|
{ name: 'ScrollIntoViewModule', moduleSpecifier: '@taiga-ui/addon-doc' },
|
|
7
7
|
{ name: 'TuiPreviewModule', moduleSpecifier: '@taiga-ui/proprietary-banking' },
|
|
8
|
+
{ name: 'TuiDescribedByModule', moduleSpecifier: '@taiga-ui/core' },
|
|
8
9
|
];
|
|
@@ -114,6 +114,33 @@ exports.ATTRS_TO_REPLACE = [
|
|
|
114
114
|
attrName: '[pseudoFocus]',
|
|
115
115
|
},
|
|
116
116
|
},
|
|
117
|
+
{
|
|
118
|
+
from: {
|
|
119
|
+
attrName: '[pseudoHovered]',
|
|
120
|
+
withAttrsNames: ['tuiButton', 'tuiIconButton'],
|
|
121
|
+
},
|
|
122
|
+
to: {
|
|
123
|
+
attrName: '[pseudoHover]',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
from: {
|
|
128
|
+
attrName: '[pseudoFocused]',
|
|
129
|
+
withAttrsNames: ['tuiButton', 'tuiIconButton'],
|
|
130
|
+
},
|
|
131
|
+
to: {
|
|
132
|
+
attrName: '[pseudoFocus]',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
from: {
|
|
137
|
+
attrName: '[pseudoPressed]',
|
|
138
|
+
withAttrsNames: ['tuiButton', 'tuiIconButton'],
|
|
139
|
+
},
|
|
140
|
+
to: {
|
|
141
|
+
attrName: '[pseudoActive]',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
117
144
|
{
|
|
118
145
|
from: {
|
|
119
146
|
attrName: '(rangeChange)',
|
|
@@ -349,6 +376,78 @@ exports.ATTRS_TO_REPLACE = [
|
|
|
349
376
|
attrName: '[tuiDropdown]',
|
|
350
377
|
},
|
|
351
378
|
},
|
|
379
|
+
{
|
|
380
|
+
from: {
|
|
381
|
+
attrName: 'tuiTextfieldExampleText',
|
|
382
|
+
withTagNames: ['tui-input-tag', 'tui-multi-select'],
|
|
383
|
+
},
|
|
384
|
+
to: {
|
|
385
|
+
attrName: 'placeholder',
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
from: {
|
|
390
|
+
attrName: 'tuiTextfieldMaxLength',
|
|
391
|
+
withTagNames: ['tui-input-tag', 'tui-text-area'],
|
|
392
|
+
},
|
|
393
|
+
to: {
|
|
394
|
+
attrName: 'maxLength',
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
from: {
|
|
399
|
+
attrName: '[tuiTextfieldExampleText]',
|
|
400
|
+
withTagNames: ['tui-input-tag', 'tui-multi-select'],
|
|
401
|
+
},
|
|
402
|
+
to: {
|
|
403
|
+
attrName: '[placeholder]',
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
from: {
|
|
408
|
+
attrName: '[tuiTextfieldMaxLength]',
|
|
409
|
+
withTagNames: ['tui-input-tag', 'tui-text-area'],
|
|
410
|
+
},
|
|
411
|
+
to: {
|
|
412
|
+
attrName: '[maxLength]',
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
from: {
|
|
417
|
+
attrName: '[tuiHintId]',
|
|
418
|
+
withTagNames: ['*'],
|
|
419
|
+
},
|
|
420
|
+
to: {
|
|
421
|
+
attrName: '[tuiHintDescribe]',
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
from: {
|
|
426
|
+
attrName: 'tuiHintId',
|
|
427
|
+
withTagNames: ['*'],
|
|
428
|
+
},
|
|
429
|
+
to: {
|
|
430
|
+
attrName: 'tuiHintDescribe',
|
|
431
|
+
},
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
from: {
|
|
435
|
+
attrName: '[tuiDescribedBy]',
|
|
436
|
+
withTagNames: ['*'],
|
|
437
|
+
},
|
|
438
|
+
to: {
|
|
439
|
+
attrName: '[id]',
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
from: {
|
|
444
|
+
attrName: 'tuiDescribedBy',
|
|
445
|
+
withTagNames: ['*'],
|
|
446
|
+
},
|
|
447
|
+
to: {
|
|
448
|
+
attrName: 'id',
|
|
449
|
+
},
|
|
450
|
+
},
|
|
352
451
|
];
|
|
353
452
|
exports.INPUTS_TO_REMOVE = [
|
|
354
453
|
{
|
|
@@ -359,6 +458,10 @@ exports.INPUTS_TO_REMOVE = [
|
|
|
359
458
|
inputName: 'tuiLabel',
|
|
360
459
|
tags: ['label'],
|
|
361
460
|
},
|
|
461
|
+
{
|
|
462
|
+
inputName: 'tuiExpandContent',
|
|
463
|
+
tags: ['ng-template'],
|
|
464
|
+
},
|
|
362
465
|
];
|
|
363
466
|
exports.TAGS_TO_REPLACE = [
|
|
364
467
|
{
|
|
@@ -16,6 +16,7 @@ const progress_1 = require("../../utils/progress");
|
|
|
16
16
|
const migrate_polymorpheus_1 = require("./migrate-polymorpheus");
|
|
17
17
|
const add_import_to_closest_module_1 = require("../../utils/add-import-to-closest-module");
|
|
18
18
|
const insert_todo_1 = require("../../utils/insert-todo");
|
|
19
|
+
const migrate_textfield_controller_1 = require("./migrate-textfield-controller");
|
|
19
20
|
function migrateTemplates(fileSystem) {
|
|
20
21
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating templates...`);
|
|
21
22
|
const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
|
|
@@ -30,6 +31,7 @@ function migrateTemplates(fileSystem) {
|
|
|
30
31
|
migrateTuiHideSelectedPipe,
|
|
31
32
|
removeInputs,
|
|
32
33
|
migrate_polymorpheus_1.migratePolymorpheus,
|
|
34
|
+
migrate_textfield_controller_1.migrateTextfieldController,
|
|
33
35
|
replaceInputValues,
|
|
34
36
|
migrateBinaryAttributes,
|
|
35
37
|
addWarningForFormatNumberPipe,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TemplateResource } from '../interfaces/template-resourse';
|
|
2
|
+
import { UpdateRecorder } from '@angular-devkit/schematics';
|
|
3
|
+
import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
|
|
4
|
+
export declare function migrateTextfieldController({ resource, fileSystem, recorder, }: {
|
|
5
|
+
resource: TemplateResource;
|
|
6
|
+
recorder: UpdateRecorder;
|
|
7
|
+
fileSystem: DevkitFileSystem;
|
|
8
|
+
}): void;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrateTextfieldController = void 0;
|
|
4
|
+
const template_resource_1 = require("../../utils/templates/template-resource");
|
|
5
|
+
const elements_1 = require("../../utils/templates/elements");
|
|
6
|
+
const ng_component_input_manipulations_1 = require("../../utils/templates/ng-component-input-manipulations");
|
|
7
|
+
const ng_morph_1 = require("ng-morph");
|
|
8
|
+
const TEXTFIELDS = [
|
|
9
|
+
'tui-input',
|
|
10
|
+
'tui-primitive-textfield',
|
|
11
|
+
'tui-text-area',
|
|
12
|
+
'tui-combo-box',
|
|
13
|
+
'tui-input-copy',
|
|
14
|
+
'tui-input-date',
|
|
15
|
+
'tui-input-date-range',
|
|
16
|
+
'tui-input-date-time',
|
|
17
|
+
'tui-input-number',
|
|
18
|
+
'tui-input-password',
|
|
19
|
+
'tui-input-count',
|
|
20
|
+
'tui-input-number',
|
|
21
|
+
'tui-input-phone',
|
|
22
|
+
'tui-input-slider',
|
|
23
|
+
'tui-input-card',
|
|
24
|
+
];
|
|
25
|
+
const ATTRS_MAP = {
|
|
26
|
+
tuitextfieldautocomplete: 'autocomplete',
|
|
27
|
+
tuitextfieldinputMode: 'inputmode',
|
|
28
|
+
tuitextfieldmaxlength: 'maxlength',
|
|
29
|
+
tuitextfieldtype: 'type',
|
|
30
|
+
tuitextfieldexampletext: 'placeholder',
|
|
31
|
+
'[tuitextfieldautocomplete]': '[attr.autocomplete]',
|
|
32
|
+
'[tuitextfieldinputMode]': '[attr.inputmode]',
|
|
33
|
+
'[tuitextfieldmaxlength]': '[attr.maxlength]',
|
|
34
|
+
'[tuitextfieldtype]': '[attr.type]',
|
|
35
|
+
'[tuitextfieldexampletext]': '[attr.placeholder]',
|
|
36
|
+
};
|
|
37
|
+
const CONTROLLER_ITEMS = Object.keys(ATTRS_MAP).map(attr => attr.toLowerCase());
|
|
38
|
+
function migrateTextfieldController({ resource, fileSystem, recorder, }) {
|
|
39
|
+
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
|
40
|
+
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
|
41
|
+
const elements = elements_1.findElementsByTagNames(template, TEXTFIELDS);
|
|
42
|
+
elements.forEach(element => {
|
|
43
|
+
const attrs = element.attrs.filter(attr => CONTROLLER_ITEMS.includes(attr.name) && !exclusion(element, attr.name));
|
|
44
|
+
if (!attrs.length) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const existingInput = elements_1.findElementsByFn(element.childNodes, el => (el.tagName === 'input' || el.tagName === 'textarea') &&
|
|
48
|
+
elements_1.hasElementAttribute(el, 'tuiTextfield'))[0];
|
|
49
|
+
if (existingInput) {
|
|
50
|
+
addAttrToExistingInput({ existingInput, attrs, recorder, templateOffset });
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
insertTuiTextfieldInput({ element, attrs, recorder, templateOffset });
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
removeOldInputs(recorder, template, templateOffset);
|
|
57
|
+
}
|
|
58
|
+
exports.migrateTextfieldController = migrateTextfieldController;
|
|
59
|
+
function insertTuiTextfieldInput({ element, attrs, recorder, templateOffset, }) {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
const newAttrs = attrs
|
|
62
|
+
.map(attr => `${ATTRS_MAP[attr.name]}="${attr.value}"`)
|
|
63
|
+
.join(`\n`);
|
|
64
|
+
const content = element.tagName === 'tui-text-area'
|
|
65
|
+
? `<textarea tuiTextfield ${newAttrs}></textarea> `
|
|
66
|
+
: `<input tuiTextfield ${newAttrs}/> `;
|
|
67
|
+
const insertTo = (_b = (_a = element.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.endTag) === null || _b === void 0 ? void 0 : _b.startOffset;
|
|
68
|
+
if (insertTo) {
|
|
69
|
+
recorder.insertRight(insertTo + templateOffset, content);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function addAttrToExistingInput({ existingInput, attrs, recorder, templateOffset, }) {
|
|
73
|
+
attrs.forEach(attr => {
|
|
74
|
+
var _a, _b, _c;
|
|
75
|
+
const insertTo = (_c = (_b = (_a = existingInput.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b['tuitextfield']) === null || _c === void 0 ? void 0 : _c.endOffset;
|
|
76
|
+
if (insertTo) {
|
|
77
|
+
recorder.insertLeft(insertTo + templateOffset, ` ${ATTRS_MAP[attr.name]}="${attr.value}"`);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function removeOldInputs(recorder, template, templateOffset) {
|
|
82
|
+
const offsets = ng_morph_1.arrayFlat(CONTROLLER_ITEMS.map(item => ng_component_input_manipulations_1.getInputPropertyOffsets(template, item, getTagsToRemove(item))));
|
|
83
|
+
offsets.forEach(([start, end]) => {
|
|
84
|
+
recorder.remove(start + templateOffset, end - start);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function getTagsToRemove(attrName) {
|
|
88
|
+
return ['[tuitextfieldmaxlength]', 'tuitextfieldmaxlength'].includes(attrName)
|
|
89
|
+
? TEXTFIELDS.filter(tag => tag !== 'tui-text-area')
|
|
90
|
+
: TEXTFIELDS;
|
|
91
|
+
}
|
|
92
|
+
const excludedAttrs = {
|
|
93
|
+
'tui-text-area': ['[tuitextfieldmaxlength]', 'tuitextfieldmaxlength'],
|
|
94
|
+
};
|
|
95
|
+
function exclusion({ tagName }, attrName) {
|
|
96
|
+
var _a;
|
|
97
|
+
return (_a = excludedAttrs[tagName]) === null || _a === void 0 ? void 0 : _a.includes(attrName);
|
|
98
|
+
}
|
|
@@ -2,6 +2,7 @@ import { ChildNode, Element } from 'parse5';
|
|
|
2
2
|
export declare function findElementsByFn(nodes: ChildNode[], predicateFn: (el: Element) => boolean): Element[];
|
|
3
3
|
export declare function findElementsInTemplateByFn(html: string, predicateFn: (el: Element) => boolean): Element[];
|
|
4
4
|
export declare function findElementsByTagName(html: string, tagName: string): Element[];
|
|
5
|
+
export declare function findElementsByTagNames(html: string, tagNames: string[]): Element[];
|
|
5
6
|
/**
|
|
6
7
|
* Parses a HTML fragment and traverses all AST nodes in order find elements that
|
|
7
8
|
* include the specified attribute.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getStartOffsetOfAttribute = exports.hasElementAttribute = exports.findAttributeOnElementWithAttrs = exports.findAttributeOnElementWithTag = exports.findElementsWithAttribute = exports.findElementsByTagName = exports.findElementsInTemplateByFn = exports.findElementsByFn = void 0;
|
|
3
|
+
exports.getStartOffsetOfAttribute = exports.hasElementAttribute = exports.findAttributeOnElementWithAttrs = exports.findAttributeOnElementWithTag = exports.findElementsWithAttribute = exports.findElementsByTagNames = exports.findElementsByTagName = exports.findElementsInTemplateByFn = exports.findElementsByFn = void 0;
|
|
4
4
|
const parse5_1 = require("parse5");
|
|
5
5
|
const ALWAYS_TRUE_HANDLER = () => true;
|
|
6
6
|
function findElementsByFn(nodes, predicateFn) {
|
|
@@ -21,6 +21,10 @@ function findElementsByFn(nodes, predicateFn) {
|
|
|
21
21
|
}
|
|
22
22
|
exports.findElementsByFn = findElementsByFn;
|
|
23
23
|
function findElementsInTemplateByFn(html, predicateFn) {
|
|
24
|
+
// utf8 with BOM adds an extra character to the beginning of the string
|
|
25
|
+
if (html.charCodeAt(0) === 0xfeff) {
|
|
26
|
+
html = html.substr(1);
|
|
27
|
+
}
|
|
24
28
|
const document = parse5_1.parseFragment(html, { sourceCodeLocationInfo: true });
|
|
25
29
|
return findElementsByFn(document.childNodes, predicateFn);
|
|
26
30
|
}
|
|
@@ -29,6 +33,10 @@ function findElementsByTagName(html, tagName) {
|
|
|
29
33
|
return findElementsInTemplateByFn(html, el => el.tagName === tagName);
|
|
30
34
|
}
|
|
31
35
|
exports.findElementsByTagName = findElementsByTagName;
|
|
36
|
+
function findElementsByTagNames(html, tagNames) {
|
|
37
|
+
return findElementsInTemplateByFn(html, el => tagNames.includes(el.tagName));
|
|
38
|
+
}
|
|
39
|
+
exports.findElementsByTagNames = findElementsByTagNames;
|
|
32
40
|
/**
|
|
33
41
|
* Parses a HTML fragment and traverses all AST nodes in order find elements that
|
|
34
42
|
* include the specified attribute.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type TuiAutofillFieldName = 'off' | 'cc-name' | 'cc-number' | 'cc-csc' | 'cc-exp-month' | 'cc-exp-year' | 'cc-exp' | 'cc-type' | 'name' | 'given-name' | 'additional-name' | 'family-name' | 'username' | 'new-password' | 'current-password' | 'email' | 'street-address' | 'postal-code' | 'country-name' | 'tel' | 'bday' | 'transaction-currency' | 'transaction-amount';
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
export * from './autocomplete';
|
|
1
2
|
export * from './date-mode';
|
|
2
3
|
export * from './dialog';
|
|
3
4
|
export * from './event-with';
|
|
4
5
|
export * from './handler';
|
|
6
|
+
export * from './injection-token-type';
|
|
5
7
|
export * from './input-mode';
|
|
6
8
|
export * from './input-type';
|
|
7
9
|
export * from './mapper';
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@taiga-ui/cdk/tokens')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@taiga-ui/cdk/directives/input-mode', ['exports', '@angular/core', '@taiga-ui/cdk/tokens'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"].cdk = global["taiga-ui"].cdk || {}, global["taiga-ui"].cdk.directives = global["taiga-ui"].cdk.directives || {}, global["taiga-ui"].cdk.directives["input-mode"] = {}), global.ng.core, global["taiga-ui"].cdk.tokens));
|
|
5
|
-
})(this, (function (exports, i0, tokens) { 'use strict';
|
|
6
|
-
|
|
7
|
-
function _interopNamespace(e) {
|
|
8
|
-
if (e && e.__esModule) return e;
|
|
9
|
-
var n = Object.create(null);
|
|
10
|
-
if (e) {
|
|
11
|
-
Object.keys(e).forEach(function (k) {
|
|
12
|
-
if (k !== 'default') {
|
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () { return e[k]; }
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
n["default"] = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Abstraction over `inputMode` attribute
|
|
29
|
-
*/
|
|
30
|
-
var TuiInputModeDirective = /** @class */ (function () {
|
|
31
|
-
function TuiInputModeDirective(pattern, isIOS) {
|
|
32
|
-
this.pattern = pattern;
|
|
33
|
-
this.isIOS = isIOS;
|
|
34
|
-
this.mode = "text";
|
|
35
|
-
}
|
|
36
|
-
Object.defineProperty(TuiInputModeDirective.prototype, "patternAttribute", {
|
|
37
|
-
get: function () {
|
|
38
|
-
return this.mode === "numeric" && this.isIOS && !this.pattern
|
|
39
|
-
? "[0-9]*"
|
|
40
|
-
: this.pattern;
|
|
41
|
-
},
|
|
42
|
-
enumerable: false,
|
|
43
|
-
configurable: true
|
|
44
|
-
});
|
|
45
|
-
return TuiInputModeDirective;
|
|
46
|
-
}());
|
|
47
|
-
TuiInputModeDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiInputModeDirective, deps: [{ token: "pattern", attribute: true }, { token: tokens.TUI_IS_IOS }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
48
|
-
TuiInputModeDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiInputModeDirective, selector: "input[tuiInputMode]", inputs: { mode: ["tuiInputMode", "mode"] }, host: { properties: { "attr.inputmode": "this.mode", "attr.x-inputmode": "this.mode", "attr.pattern": "this.patternAttribute" } }, ngImport: i0__namespace });
|
|
49
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiInputModeDirective, decorators: [{
|
|
50
|
-
type: i0.Directive,
|
|
51
|
-
args: [{
|
|
52
|
-
selector: "input[tuiInputMode]",
|
|
53
|
-
}]
|
|
54
|
-
}], ctorParameters: function () {
|
|
55
|
-
return [{ type: undefined, decorators: [{
|
|
56
|
-
type: i0.Attribute,
|
|
57
|
-
args: ["pattern"]
|
|
58
|
-
}] }, { type: undefined, decorators: [{
|
|
59
|
-
type: i0.Inject,
|
|
60
|
-
args: [tokens.TUI_IS_IOS]
|
|
61
|
-
}] }];
|
|
62
|
-
}, propDecorators: { mode: [{
|
|
63
|
-
type: i0.Input,
|
|
64
|
-
args: ["tuiInputMode"]
|
|
65
|
-
}, {
|
|
66
|
-
type: i0.HostBinding,
|
|
67
|
-
args: ["attr.inputmode"]
|
|
68
|
-
}, {
|
|
69
|
-
type: i0.HostBinding,
|
|
70
|
-
args: ["attr.x-inputmode"]
|
|
71
|
-
}], patternAttribute: [{
|
|
72
|
-
type: i0.HostBinding,
|
|
73
|
-
args: ["attr.pattern"]
|
|
74
|
-
}] } });
|
|
75
|
-
|
|
76
|
-
var TuiInputModeModule = /** @class */ (function () {
|
|
77
|
-
function TuiInputModeModule() {
|
|
78
|
-
}
|
|
79
|
-
return TuiInputModeModule;
|
|
80
|
-
}());
|
|
81
|
-
TuiInputModeModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiInputModeModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
82
|
-
TuiInputModeModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiInputModeModule, declarations: [TuiInputModeDirective], exports: [TuiInputModeDirective] });
|
|
83
|
-
TuiInputModeModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiInputModeModule });
|
|
84
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiInputModeModule, decorators: [{
|
|
85
|
-
type: i0.NgModule,
|
|
86
|
-
args: [{
|
|
87
|
-
declarations: [TuiInputModeDirective],
|
|
88
|
-
exports: [TuiInputModeDirective],
|
|
89
|
-
}]
|
|
90
|
-
}] });
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Generated bundle index. Do not edit.
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
|
-
exports.TuiInputModeDirective = TuiInputModeDirective;
|
|
97
|
-
exports.TuiInputModeModule = TuiInputModeModule;
|
|
98
|
-
|
|
99
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
100
|
-
|
|
101
|
-
}));
|
|
102
|
-
//# sourceMappingURL=taiga-ui-cdk-directives-input-mode.umd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-input-mode.umd.js","sources":["../../../projects/cdk/directives/input-mode/input-mode.directive.ts","../../../projects/cdk/directives/input-mode/input-mode.module.ts","../../../projects/cdk/directives/input-mode/taiga-ui-cdk-directives-input-mode.ts"],"sourcesContent":["import {Attribute, Directive, HostBinding, Inject, Input} from '@angular/core';\nimport {TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {TuiInputMode} from '@taiga-ui/cdk/types';\n\n/**\n * Abstraction over `inputMode` attribute\n */\n@Directive({\n selector: `input[tuiInputMode]`,\n})\nexport class TuiInputModeDirective {\n @Input(`tuiInputMode`)\n @HostBinding(`attr.inputmode`)\n @HostBinding(`attr.x-inputmode`)\n mode: TuiInputMode = `text`;\n\n constructor(\n @Attribute(`pattern`) private readonly pattern: string | null,\n @Inject(TUI_IS_IOS) private readonly isIOS: boolean,\n ) {}\n\n @HostBinding(`attr.pattern`)\n get patternAttribute(): string | null {\n return this.mode === `numeric` && this.isIOS && !this.pattern\n ? `[0-9]*`\n : this.pattern;\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiInputModeDirective} from './input-mode.directive';\n\n@NgModule({\n declarations: [TuiInputModeDirective],\n exports: [TuiInputModeDirective],\n})\nexport class TuiInputModeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["TUI_IS_IOS","i0","Directive","Attribute","Inject","Input","HostBinding","NgModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IAIA;;IAEG;AAIH,QAAA,qBAAA,kBAAA,YAAA;QAMI,SAC2C,qBAAA,CAAA,OAAsB,EACxB,KAAc,EAAA;IADZ,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAe;IACxB,QAAA,IAAK,CAAA,KAAA,GAAL,KAAK,CAAS;IAJvD,QAAA,IAAI,CAAA,IAAA,GAAiB,MAAM,CAAC;SAKxB;IAEJ,IAAA,MAAA,CAAA,cAAA,CACI,qBAAgB,CAAA,SAAA,EAAA,kBAAA,EAAA;IADpB,QAAA,GAAA,EAAA,YAAA;IAEI,YAAA,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO;IACzD,kBAAE,QAAQ;IACV,kBAAE,IAAI,CAAC,OAAO,CAAC;aACtB;;;IAAA,KAAA,CAAA,CAAA;;;6IAhBQ,qBAAqB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAOf,SAAS,EAAA,SAAA,EAAA,IAAA,EAAA,EAAA,EAAA,KAAA,EACZA,iBAAU,EAAA,CAAA,EAAA,MAAA,EAAAC,aAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;sHARb,qBAAqB,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,CAAA,cAAA,EAAA,MAAA,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,gBAAA,EAAA,WAAA,EAAA,kBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,uBAAA,EAAA,EAAA,EAAA,QAAA,EAAAA,aAAA,EAAA,CAAA,CAAA;sHAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;sBAHjCC,YAAS;IAAC,YAAA,IAAA,EAAA,CAAA;IACP,oBAAA,QAAQ,EAAE,qBAAqB;qBAClC,CAAA;;;kCAQQC,YAAS;mCAAC,SAAS,CAAA;;kCACnBC,SAAM;mCAACJ,iBAAU,CAAA;;6BAJtB,IAAI,EAAA,CAAA;0BAHHK,QAAK;2BAAC,cAAc,CAAA;;0BACpBC,cAAW;2BAAC,gBAAgB,CAAA;;0BAC5BA,cAAW;2BAAC,kBAAkB,CAAA;oBAS3B,gBAAgB,EAAA,CAAA;0BADnBA,cAAW;2BAAC,cAAc,CAAA;;;ACb/B,QAAA,kBAAA,kBAAA,YAAA;IAAA,IAAA,SAAA,kBAAA,GAAA;;;;0IAAa,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAAL,aAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;2IAAlB,kBAAkB,EAAA,YAAA,EAAA,CAHZ,qBAAqB,CAAA,EAAA,OAAA,EAAA,CAC1B,qBAAqB,CAAA,EAAA,CAAA,CAAA;2IAEtB,kBAAkB,EAAA,CAAA,CAAA;sHAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;sBAJ9BM,WAAQ;IAAC,YAAA,IAAA,EAAA,CAAA;wBACN,YAAY,EAAE,CAAC,qBAAqB,CAAC;wBACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;qBACnC,CAAA;;;ICPD;;IAEG;;;;;;;;;;;"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { TuiInputMode } from '@taiga-ui/cdk/types';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* Abstraction over `inputMode` attribute
|
|
5
|
-
*/
|
|
6
|
-
export declare class TuiInputModeDirective {
|
|
7
|
-
private readonly pattern;
|
|
8
|
-
private readonly isIOS;
|
|
9
|
-
mode: TuiInputMode;
|
|
10
|
-
constructor(pattern: string | null, isIOS: boolean);
|
|
11
|
-
get patternAttribute(): string | null;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiInputModeDirective, [{ attribute: "pattern"; }, null]>;
|
|
13
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiInputModeDirective, "input[tuiInputMode]", never, { "mode": "tuiInputMode"; }, {}, never>;
|
|
14
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./input-mode.directive";
|
|
3
|
-
export declare class TuiInputModeModule {
|
|
4
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiInputModeModule, never>;
|
|
5
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<TuiInputModeModule, [typeof i1.TuiInputModeDirective], never, [typeof i1.TuiInputModeDirective]>;
|
|
6
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<TuiInputModeModule>;
|
|
7
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "../../bundles/taiga-ui-cdk-directives-input-mode.umd.js",
|
|
3
|
-
"module": "../../fesm2015/taiga-ui-cdk-directives-input-mode.js",
|
|
4
|
-
"es2015": "../../fesm2015/taiga-ui-cdk-directives-input-mode.js",
|
|
5
|
-
"esm2015": "../../esm2015/directives/input-mode/taiga-ui-cdk-directives-input-mode.js",
|
|
6
|
-
"fesm2015": "../../fesm2015/taiga-ui-cdk-directives-input-mode.js",
|
|
7
|
-
"typings": "taiga-ui-cdk-directives-input-mode.d.ts",
|
|
8
|
-
"sideEffects": false,
|
|
9
|
-
"name": "@taiga-ui/cdk/directives/input-mode"
|
|
10
|
-
}
|