@taiga-ui/cdk 2.50.1 → 2.51.1

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 (87) hide show
  1. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js +7 -7
  2. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.js.map +1 -1
  3. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js +1 -1
  4. package/bundles/taiga-ui-cdk-directives-copy-processor.umd.min.js.map +1 -1
  5. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js +4 -1
  6. package/bundles/taiga-ui-cdk-directives-overscroll.umd.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js +1 -1
  8. package/bundles/taiga-ui-cdk-directives-overscroll.umd.min.js.map +1 -1
  9. package/bundles/taiga-ui-cdk-exceptions.umd.js +39 -0
  10. package/bundles/taiga-ui-cdk-exceptions.umd.js.map +1 -1
  11. package/bundles/taiga-ui-cdk-exceptions.umd.min.js +1 -1
  12. package/bundles/taiga-ui-cdk-exceptions.umd.min.js.map +1 -1
  13. package/bundles/taiga-ui-cdk-utils-dom.umd.js +18 -38
  14. package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
  15. package/bundles/taiga-ui-cdk-utils-dom.umd.min.js +1 -1
  16. package/bundles/taiga-ui-cdk-utils-dom.umd.min.js.map +1 -1
  17. package/directives/copy-processor/taiga-ui-cdk-directives-copy-processor.metadata.json +1 -1
  18. package/esm2015/directives/copy-processor/copy-processor.directive.js +5 -4
  19. package/esm2015/directives/overscroll/overscroll.directive.js +5 -2
  20. package/esm2015/exceptions/invalid-day.exception.js +8 -1
  21. package/esm2015/exceptions/invalid-month.exception.js +8 -1
  22. package/esm2015/exceptions/invalid-year.exception.js +8 -1
  23. package/esm2015/utils/dom/get-selected-text.js +16 -0
  24. package/esm2015/utils/dom/index.js +3 -3
  25. package/esm2015/utils/dom/is-form-field.js +8 -0
  26. package/esm5/directives/copy-processor/copy-processor.directive.js +5 -4
  27. package/esm5/directives/overscroll/overscroll.directive.js +5 -2
  28. package/esm5/exceptions/invalid-day.exception.js +14 -1
  29. package/esm5/exceptions/invalid-month.exception.js +14 -1
  30. package/esm5/exceptions/invalid-year.exception.js +14 -1
  31. package/esm5/utils/dom/get-selected-text.js +17 -0
  32. package/esm5/utils/dom/index.js +3 -3
  33. package/esm5/utils/dom/is-form-field.js +8 -0
  34. package/exceptions/invalid-day.exception.d.ts +6 -0
  35. package/exceptions/invalid-month.exception.d.ts +6 -0
  36. package/exceptions/invalid-year.exception.d.ts +6 -0
  37. package/exceptions/taiga-ui-cdk-exceptions.metadata.json +1 -1
  38. package/fesm2015/taiga-ui-cdk-directives-copy-processor.js +4 -3
  39. package/fesm2015/taiga-ui-cdk-directives-copy-processor.js.map +1 -1
  40. package/fesm2015/taiga-ui-cdk-directives-overscroll.js +4 -1
  41. package/fesm2015/taiga-ui-cdk-directives-overscroll.js.map +1 -1
  42. package/fesm2015/taiga-ui-cdk-exceptions.js +22 -1
  43. package/fesm2015/taiga-ui-cdk-exceptions.js.map +1 -1
  44. package/fesm2015/taiga-ui-cdk-utils-dom.js +16 -35
  45. package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
  46. package/fesm5/taiga-ui-cdk-directives-copy-processor.js +4 -3
  47. package/fesm5/taiga-ui-cdk-directives-copy-processor.js.map +1 -1
  48. package/fesm5/taiga-ui-cdk-directives-overscroll.js +4 -1
  49. package/fesm5/taiga-ui-cdk-directives-overscroll.js.map +1 -1
  50. package/fesm5/taiga-ui-cdk-exceptions.js +37 -1
  51. package/fesm5/taiga-ui-cdk-exceptions.js.map +1 -1
  52. package/fesm5/taiga-ui-cdk-utils-dom.js +17 -37
  53. package/fesm5/taiga-ui-cdk-utils-dom.js.map +1 -1
  54. package/package.json +1 -1
  55. package/schematics/ng-update/constants/consts.js +10 -0
  56. package/schematics/ng-update/constants/modules.js +1 -0
  57. package/schematics/ng-update/constants/services.js +9 -0
  58. package/schematics/ng-update/constants/templates.d.ts +17 -0
  59. package/schematics/ng-update/constants/templates.js +32 -0
  60. package/schematics/ng-update/constants/types.js +30 -0
  61. package/schematics/ng-update/index.js +35 -4
  62. package/schematics/ng-update/steps/migrate-progress.d.ts +3 -0
  63. package/schematics/ng-update/steps/migrate-progress.js +41 -0
  64. package/schematics/ng-update/steps/migrate-sliders/index.d.ts +2 -2
  65. package/schematics/ng-update/steps/migrate-sliders/index.js +4 -2
  66. package/schematics/ng-update/steps/migrate-sliders/migrate-input-range.d.ts +2 -0
  67. package/schematics/ng-update/steps/migrate-sliders/migrate-input-range.js +85 -0
  68. package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.d.ts +2 -2
  69. package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.js +30 -22
  70. package/schematics/ng-update/steps/migrate-templates.d.ts +2 -2
  71. package/schematics/ng-update/steps/migrate-templates.js +69 -30
  72. package/schematics/ng-update/steps/replace-services.js +4 -1
  73. package/schematics/ng-update/steps/show-warnings.js +1 -1
  74. package/schematics/utils/colored-log.d.ts +2 -0
  75. package/schematics/utils/colored-log.js +10 -0
  76. package/schematics/utils/templates/elements.js +2 -1
  77. package/schematics/utils/templates/ng-component-input-manipulations.js +2 -1
  78. package/utils/dom/get-selected-text.d.ts +9 -0
  79. package/utils/dom/index.d.ts +2 -2
  80. package/utils/dom/is-form-field.d.ts +1 -0
  81. package/utils/dom/taiga-ui-cdk-utils-dom.metadata.json +1 -1
  82. package/esm2015/utils/dom/get-viewport-height.js +0 -21
  83. package/esm2015/utils/dom/get-viewport-width.js +0 -21
  84. package/esm5/utils/dom/get-viewport-height.js +0 -22
  85. package/esm5/utils/dom/get-viewport-width.js +0 -22
  86. package/utils/dom/get-viewport-height.d.ts +0 -18
  87. package/utils/dom/get-viewport-width.d.ts +0 -18
@@ -1,28 +1,38 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const ng_morph_1 = require("ng-morph");
4
- const devkit_file_system_1 = require("ng-morph/project/classes/devkit-file-system");
5
4
  const ng_component_input_manipulations_1 = require("../../../utils/templates/ng-component-input-manipulations");
6
5
  const ng_component_1 = require("../../../utils/angular/ng-component");
7
6
  const add_unique_import_1 = require("../../../utils/add-unique-import");
8
7
  const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
9
8
  const elements_1 = require("../../../utils/templates/elements");
10
- function migrateInputSlider(tree) {
11
- const fileSystem = new devkit_file_system_1.DevkitFileSystem(tree);
9
+ function migrateInputSlider(fileSystem) {
12
10
  const templateResources = get_component_templates_1.getComponentTemplates('**/**');
11
+ const COMPONENTS_WITH_MIN_MAX_LABELS = new Set();
13
12
  for (const templateResource of templateResources) {
14
- replaceMinMaxLabels(templateResource, fileSystem);
13
+ replaceMinMaxLabels(templateResource, fileSystem, COMPONENTS_WITH_MIN_MAX_LABELS);
14
+ }
15
+ /**
16
+ * We should update virtual file tree
17
+ * otherwise all following ng-morph commands will overwrite all previous template manipulations
18
+ * */
19
+ fileSystem.commitEdits();
20
+ ng_morph_1.saveActiveProject();
21
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, '/', '**/**'));
22
+ for (const componentPath of COMPONENTS_WITH_MIN_MAX_LABELS) {
23
+ addMinMaxLabelMethod(componentPath);
15
24
  }
16
25
  }
17
26
  exports.migrateInputSlider = migrateInputSlider;
18
- function replaceMinMaxLabels(templateResource, fileSystem) {
27
+ const MIN_MAX_LABELS_MIGRATION_METHOD_NAME = 'tuiMigrationMinMaxLabel';
28
+ function replaceMinMaxLabels(templateResource, fileSystem, modifiedComponentStorage) {
19
29
  const wasMaxLabelModified = ng_component_input_manipulations_1.replaceInputProperty({
20
30
  templateResource,
21
31
  fileSystem,
22
32
  componentSelector: 'tui-input-slider',
23
33
  from: 'maxLabel',
24
34
  to: '[valueContent]',
25
- newValue: 'tuiMigrationMinMaxLabel',
35
+ newValue: MIN_MAX_LABELS_MIGRATION_METHOD_NAME,
26
36
  });
27
37
  const wasMinLabelModified = ng_component_input_manipulations_1.replaceInputProperty({
28
38
  templateResource,
@@ -30,7 +40,7 @@ function replaceMinMaxLabels(templateResource, fileSystem) {
30
40
  componentSelector: 'tui-input-slider',
31
41
  from: 'minLabel',
32
42
  to: '[valueContent]',
33
- newValue: 'tuiMigrationMinMaxLabel',
43
+ newValue: MIN_MAX_LABELS_MIGRATION_METHOD_NAME,
34
44
  filterFn: element => !elements_1.hasElementAttribute(element, 'maxLabel'),
35
45
  });
36
46
  ng_component_input_manipulations_1.removeInputProperty({
@@ -40,26 +50,24 @@ function replaceMinMaxLabels(templateResource, fileSystem) {
40
50
  inputProperty: 'minLabel',
41
51
  filterFn: element => elements_1.hasElementAttribute(element, 'maxLabel'),
42
52
  });
43
- /**
44
- * We should update virtual file tree
45
- * otherwise all following ng-morph commands will overwrite all previous template manipulations
46
- * */
47
- fileSystem.commitEdits();
48
- ng_morph_1.saveActiveProject();
49
- ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, '/', '**/**'));
50
- const [ngComponent] = ng_component_1.getNgComponents(templateResource.componentPath);
51
- if ((wasMaxLabelModified || wasMinLabelModified) && ngComponent) {
52
- add_unique_import_1.addUniqueImport(templateResource.componentPath, 'TuiContextWithImplicit', '@taiga-ui/cdk');
53
+ if (wasMaxLabelModified || wasMinLabelModified) {
54
+ modifiedComponentStorage.add(templateResource.componentPath);
55
+ }
56
+ }
57
+ function addMinMaxLabelMethod(componentPath) {
58
+ const [ngComponent] = ng_component_1.getNgComponents(componentPath);
59
+ if (ngComponent) {
60
+ add_unique_import_1.addUniqueImport(componentPath, 'TuiContextWithImplicit', '@taiga-ui/cdk');
53
61
  ng_morph_1.addMethods(ngComponent, {
54
- name: 'tuiMigrationMinMaxLabel',
62
+ name: MIN_MAX_LABELS_MIGRATION_METHOD_NAME,
55
63
  returnType: 'string',
56
64
  parameters: [{ name: 'context', type: 'TuiContextWithImplicit<number>' }],
57
65
  statements: [
58
66
  'const currentValue = context.$implicit;',
59
- 'const maxValue = 100; // TODO replace with the MAX value of the input',
60
- 'const maxLabelText = "Max"; // TODO replace with the required label',
61
- 'const minValue = 0; // TODO replace with the MIN value of the input',
62
- 'const minLabelText = "Min"; // TODO replace with the required label',
67
+ 'const maxValue = 100; // TODO: (Taiga UI migration) replace with the MAX value of the input',
68
+ 'const maxLabelText = "Max"; // TODO: (Taiga UI migration) replace with the required label',
69
+ 'const minValue = 0; // TODO: (Taiga UI migration) replace with the MIN value of the input',
70
+ 'const minLabelText = "Min"; // TODO: (Taiga UI migration) replace with the required label',
63
71
  'if (currentValue === maxValue) return maxLabelText;',
64
72
  'if (currentValue === minValue) return minLabelText;',
65
73
  'return String(currentValue);',
@@ -1,2 +1,2 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- export declare function migrateTemplates(tree: Tree): void;
1
+ import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
2
+ export declare function migrateTemplates(fileSystem: DevkitFileSystem): void;
@@ -3,42 +3,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const get_component_templates_1 = require("../../utils/templates/get-component-templates");
4
4
  const templates_1 = require("../constants/templates");
5
5
  const elements_1 = require("../../utils/templates/elements");
6
- const devkit_file_system_1 = require("ng-morph/project/classes/devkit-file-system");
7
6
  const ng_component_input_manipulations_1 = require("../../utils/templates/ng-component-input-manipulations");
8
7
  const template_resource_1 = require("../../utils/templates/template-resource");
9
8
  const ng_morph_1 = require("ng-morph");
9
+ const ng_component_1 = require("../../utils/angular/ng-component");
10
+ const add_unique_import_1 = require("../../utils/add-unique-import");
10
11
  const START_TAG_OFFSET = 1;
11
12
  const END_TAG_OFFSET = 2;
12
- function migrateTemplates(tree) {
13
- const fileSystem = new devkit_file_system_1.DevkitFileSystem(tree);
14
- const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates('**/**').map(({ componentPath }) => componentPath);
13
+ function migrateTemplates(fileSystem) {
14
+ const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates('**/**');
15
15
  const actions = [
16
16
  replaceTags,
17
17
  replaceAttrs,
18
18
  replaceAttrsByDirective,
19
19
  replaceBreadcrumbs,
20
+ replaceFieldError,
21
+ addHTMLCommentTags,
22
+ addEditorProviders,
20
23
  ];
21
- actions.forEach(action => {
22
- componentWithTemplatesPaths.forEach(componentPath => {
23
- // get updated version of template after the previous action
24
- const [resource] = get_component_templates_1.getComponentTemplates(componentPath);
25
- const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
26
- const recorder = fileSystem.edit(path);
24
+ componentWithTemplatesPaths.forEach(resource => {
25
+ const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
26
+ const recorder = fileSystem.edit(path);
27
+ actions.forEach(action => {
27
28
  action({ resource, fileSystem, recorder });
28
29
  });
29
- save(fileSystem);
30
30
  });
31
31
  }
32
32
  exports.migrateTemplates = migrateTemplates;
33
- /**
34
- * We should update virtual file tree
35
- * otherwise all following ng-morph commands will overwrite all previous template manipulations
36
- * */
37
- function save(fileSystem) {
38
- fileSystem.commitEdits();
39
- ng_morph_1.saveActiveProject();
40
- ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, '/', '**/**'));
41
- }
42
33
  function replaceAttrsByDirective({ resource, fileSystem, }) {
43
34
  templates_1.ATTR_TO_DIRECTIVE.forEach(({ componentSelector, directiveModule, directive, inputProperty }) => {
44
35
  ng_component_input_manipulations_1.replaceInputPropertyByDirective({
@@ -60,7 +51,7 @@ function replaceAttrs({ resource, recorder, fileSystem, }) {
60
51
  ...elements_1.findAttributeOnElementWithAttrs(template, from.attrName, from.withAttrsNames || []),
61
52
  ];
62
53
  offsets.forEach(offset => {
63
- recorder.remove(offset + templateOffset, from.attrName.length + (to.attrName.length ? 0 : 1));
54
+ recorder.remove(offset + templateOffset, from.attrName.length);
64
55
  recorder.insertRight(offset + templateOffset, to.attrName);
65
56
  });
66
57
  });
@@ -71,20 +62,27 @@ function replaceTags({ resource, recorder, fileSystem, }) {
71
62
  templates_1.TAGS_TO_REPLACE.forEach(({ from, to, addAttributes }) => {
72
63
  const elements = elements_1.findElementsByTagName(template, from);
73
64
  elements.forEach(({ sourceCodeLocation }) => {
74
- var _a;
75
65
  if (sourceCodeLocation) {
76
- const startTagOffset = sourceCodeLocation.startTag.startOffset;
77
- const endTagOffset = (_a = sourceCodeLocation.endTag) === null || _a === void 0 ? void 0 : _a.startOffset;
78
- if (endTagOffset) {
79
- recorder.remove(endTagOffset + templateOffset + END_TAG_OFFSET, from.length);
80
- recorder.insertRight(endTagOffset + templateOffset + END_TAG_OFFSET, to);
81
- }
82
- recorder.remove(startTagOffset + templateOffset + START_TAG_OFFSET, from.length);
83
- recorder.insertRight(startTagOffset + templateOffset + START_TAG_OFFSET, `${to} ${addAttributes.join(' ')}`);
66
+ replaceTag(recorder, sourceCodeLocation, from, to, templateOffset, addAttributes);
84
67
  }
85
68
  });
86
69
  });
87
70
  }
71
+ function addHTMLCommentTags({ resource, recorder, fileSystem, }) {
72
+ const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
73
+ const templateOffset = template_resource_1.getTemplateOffset(resource);
74
+ templates_1.TEMPLATE_COMMENTS.forEach(({ comment, tag, withAttr }) => {
75
+ const elementStartOffsets = [
76
+ ...elements_1.findElementsWithAttribute(template, withAttr),
77
+ ...elements_1.findElementsWithAttribute(template, `[${withAttr}]`),
78
+ ]
79
+ .filter(el => el.tagName === tag)
80
+ .map(el => { var _a; return (((_a = el.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.startOffset) || 0) + templateOffset; });
81
+ elementStartOffsets.forEach(offset => {
82
+ recorder.insertRight(offset, `<!-- TODO: (Taiga UI migration) ${comment} -->\n`);
83
+ });
84
+ });
85
+ }
88
86
  function replaceBreadcrumbs({ resource, recorder, fileSystem, }) {
89
87
  const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
90
88
  const templateOffset = template_resource_1.getTemplateOffset(resource);
@@ -111,3 +109,44 @@ function replaceBreadcrumbs({ resource, recorder, fileSystem, }) {
111
109
  recorder.remove(templateOffset + startOffset - 1, endOffset - startOffset + 1);
112
110
  });
113
111
  }
112
+ function replaceFieldError({ resource, recorder, fileSystem, }) {
113
+ const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
114
+ const templateOffset = template_resource_1.getTemplateOffset(resource);
115
+ const elements = elements_1.findElementsByTagName(template, 'tui-field-error');
116
+ elements.forEach(element => {
117
+ var _a, _b;
118
+ const orderAttr = element.attrs.find(attr => attr.name === '[order]');
119
+ const orderVal = orderAttr === null || orderAttr === void 0 ? void 0 : orderAttr.value;
120
+ if (orderAttr) {
121
+ const { startOffset = 0, endOffset = 0 } = ((_b = (_a = element.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b['[order]']) || {};
122
+ recorder.remove(templateOffset + startOffset - 1, endOffset - startOffset + 1);
123
+ }
124
+ const input = `[error]="${orderVal !== null && orderVal !== void 0 ? orderVal : '[]'} | tuiFieldError | async"`;
125
+ replaceTag(recorder, element.sourceCodeLocation, 'tui-field-error', 'tui-error', templateOffset, [input]);
126
+ });
127
+ }
128
+ function replaceTag(recorder, sourceCodeLocation, from, to, templateOffset = 0, addAttributes = []) {
129
+ var _a;
130
+ const startTagOffset = sourceCodeLocation.startTag.startOffset;
131
+ const endTagOffset = (_a = sourceCodeLocation.endTag) === null || _a === void 0 ? void 0 : _a.startOffset;
132
+ if (endTagOffset) {
133
+ recorder.remove(endTagOffset + templateOffset + END_TAG_OFFSET, from.length);
134
+ recorder.insertRight(endTagOffset + templateOffset + END_TAG_OFFSET, to);
135
+ }
136
+ recorder.remove(startTagOffset + templateOffset + START_TAG_OFFSET, from.length);
137
+ recorder.insertRight(startTagOffset + templateOffset + START_TAG_OFFSET, `${to} ${addAttributes.join(' ')}`);
138
+ }
139
+ function addEditorProviders({ resource, fileSystem, }) {
140
+ const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
141
+ const elements = elements_1.findElementsByTagName(template, 'tui-editor').filter(element => !elements_1.hasElementAttribute(element, 'new'));
142
+ if (elements.length) {
143
+ const componentPath = resource.componentPath;
144
+ const componentClass = ng_component_1.getNgComponents(componentPath);
145
+ ng_morph_1.addProviderToComponent(componentClass[0], `{
146
+ provide: TUI_EDITOR_EXTENSIONS,
147
+ useValue: defaultEditorExtensions
148
+ }`, { unique: true });
149
+ add_unique_import_1.addUniqueImport(componentPath, 'TUI_EDITOR_EXTENSIONS', '@taiga-ui/addon-editor');
150
+ add_unique_import_1.addUniqueImport(componentPath, 'defaultEditorExtensions', '@taiga-ui/addon-editor');
151
+ }
152
+ }
@@ -6,7 +6,10 @@ const ng_morph_1 = require("ng-morph");
6
6
  const import_manipulations_1 = require("../../utils/import-manipulations");
7
7
  const add_unique_import_1 = require("../../utils/add-unique-import");
8
8
  function replaceServices() {
9
- services_1.SERVICES_TO_REPLACE.forEach(service => replaceService(service));
9
+ services_1.SERVICES_TO_REPLACE.forEach(service => {
10
+ console.info('\x1b[34m', `replacing ${service.from.name}`);
11
+ replaceService(service);
12
+ });
10
13
  }
11
14
  exports.replaceServices = replaceServices;
12
15
  function replaceService({ from, to, replaceMethods }) {
@@ -30,6 +30,6 @@ function showWarning({ name, message, moduleSpecifier = '**/**' }, { logger }) {
30
30
  */
31
31
  referencesMeta.forEach(({ sourceFile, filePath, startLinePos }) => {
32
32
  logger.warn(`[WARNING] in ${filePath}: ${message}`);
33
- sourceFile.insertText(startLinePos, `// TODO: ${message}\n`);
33
+ sourceFile.insertText(startLinePos, `// TODO: (Taiga UI migration) ${message}\n`);
34
34
  });
35
35
  }
@@ -0,0 +1,2 @@
1
+ export declare function successLog(message: string): void;
2
+ export declare function infoLog(message: string): void;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function successLog(message) {
4
+ console.info('\x1B[32m%s\x1B[0m', message, '\u2713');
5
+ }
6
+ exports.successLog = successLog;
7
+ function infoLog(message) {
8
+ console.info('\x1B[34m%s\x1B[0m', message);
9
+ }
10
+ exports.infoLog = infoLog;
@@ -49,7 +49,8 @@ exports.findElementsWithAttribute = findElementsWithAttribute;
49
49
  */
50
50
  function findAttributeOnElementWithTag(html, name, tagNames, filterFn = ALWAYS_TRUE_HANDLER) {
51
51
  return findElementsWithAttribute(html, name)
52
- .filter(element => tagNames.includes(element.tagName) && filterFn(element))
52
+ .filter(element => (tagNames.includes(element.tagName) || tagNames.includes('*')) &&
53
+ filterFn(element))
53
54
  .map(element => getStartOffsetOfAttribute(element, name));
54
55
  }
55
56
  exports.findAttributeOnElementWithTag = findAttributeOnElementWithTag;
@@ -80,7 +80,8 @@ exports.replaceInputProperty = replaceInputProperty;
80
80
  */
81
81
  function getInputPropertyOffsets(html, attrName, tags, filterFn = () => true) {
82
82
  return elements_1.findElementsWithAttribute(html, attrName)
83
- .filter(element => tags.includes(element.tagName) && filterFn(element))
83
+ .filter(element => (tags.includes(element.tagName) || tags.includes('*')) &&
84
+ filterFn(element))
84
85
  .map((element) => {
85
86
  var _a, _b;
86
87
  const { startOffset = 0, endOffset = 0 } = ((_b = (_a = element.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b[attrName.toLowerCase()]) || {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @description:
3
+ * cross browser way to get selected text
4
+ *
5
+ * History:
6
+ * BUG - window.getSelection() fails when text selected in a form field
7
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=85686
8
+ */
9
+ export declare function tuiGetSelectedText({ getSelection, document }: Window): string | null;
@@ -8,8 +8,8 @@ export * from './get-document-or-shadow-root';
8
8
  export * from './get-element-obscurers';
9
9
  export * from './get-element-offset';
10
10
  export * from './get-scroll-parent';
11
- export * from './get-viewport-height';
12
- export * from './get-viewport-width';
11
+ export * from './get-selected-text';
13
12
  export * from './is-current-target';
13
+ export * from './is-form-field';
14
14
  export * from './is-inside-iframe';
15
15
  export * from './is-node-in';
@@ -0,0 +1 @@
1
+ export declare function tuiIsFormFieldElement(element: unknown | null): element is HTMLInputElement | HTMLTextAreaElement;
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"canScroll":{"__symbolic":"function","parameters":["element","rootElement","vertical","scrollEnd"],"value":{"__symbolic":"if","condition":{"__symbolic":"reference","name":"vertical"},"thenExpression":{"__symbolic":"error","message":"Reference to a non-exported function","line":11,"character":9,"context":{"name":"canScrollVertical"},"module":"./can-scroll"},"elseExpression":{"__symbolic":"error","message":"Reference to a non-exported function","line":38,"character":9,"context":{"name":"canScrollHorizontal"},"module":"./can-scroll"}}},"containsOrAfter":{"__symbolic":"function","parameters":["current","node"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"current"},"member":"contains"},"arguments":[{"__symbolic":"reference","name":"node"}]},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"binop","operator":"&","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"compareDocumentPosition"},"arguments":[{"__symbolic":"reference","name":"current"}]},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Node"},"member":"DOCUMENT_POSITION_PRECEDING"}}}}}},"tuiCustomEvent":{"__symbolic":"function"},"getActualTarget":{"__symbolic":"function"},"getClipboardDataText":{"__symbolic":"function","parameters":["event","format"],"defaults":[null,"text/plain"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"in","left":"clipboardData","right":{"__symbolic":"reference","name":"event"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"event"},"member":"clipboardData"},"right":null}},"thenExpression":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"event"},"member":"clipboardData"},"member":"getData"},"arguments":[{"__symbolic":"reference","name":"format"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"event"},"member":"clipboardData"},"member":"getData"},"arguments":["text/plain"]}},"elseExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"event"},"member":"target"},"member":"ownerDocument"},"member":"defaultView"},"member":"clipboardData"},"member":"getData"},"arguments":["text"]}}},"getClosestElement":{"__symbolic":"function"},"getDocumentOrShadowRoot":{"__symbolic":"function","parameters":["node"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"in","left":"getRootNode","right":{"__symbolic":"reference","name":"node"}},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"isConnected"}},"thenExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"getRootNode"}},"elseExpression":{"__symbolic":"error","message":"Expression form not supported","line":3,"character":10,"module":"./get-document-or-shadow-root"}}},"getElementObscurers":{"__symbolic":"function"},"getElementOffset":{"__symbolic":"function"},"getScrollParent":{"__symbolic":"function"},"tuiGetViewportHeight":{"__symbolic":"function","parameters":["document","innerHeight"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Math"},"member":"max"},"arguments":[{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"document"},"member":"documentElement"},"member":"clientHeight"},"right":0},{"__symbolic":"binop","operator":"||","left":{"__symbolic":"reference","name":"innerHeight"},"right":0}]}},"tuiGetViewportWidth":{"__symbolic":"function","parameters":["document","innerWidth"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Math"},"member":"max"},"arguments":[{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"document"},"member":"documentElement"},"member":"clientWidth"},"right":0},{"__symbolic":"binop","operator":"||","left":{"__symbolic":"reference","name":"innerWidth"},"right":0}]}},"isCurrentTarget":{"__symbolic":"function","parameters":["target","currentTarget"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"target"},"right":{"__symbolic":"reference","name":"currentTarget"}}},"isInsideIframe":{"__symbolic":"function","parameters":["windowRef"],"value":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"windowRef"},"member":"parent"},"right":{"__symbolic":"reference","name":"windowRef"}}},"isNodeIn":{"__symbolic":"function","parameters":["node","selector"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"nodeType"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Node"},"member":"TEXT_NODE"}},"thenExpression":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"parentElement"}}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"getClosestElement"},"arguments":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"parentElement"},{"__symbolic":"reference","name":"selector"}]}}}},"elseExpression":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"nodeType"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Node"},"member":"ELEMENT_NODE"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"getClosestElement"},"arguments":[{"__symbolic":"reference","name":"node"},{"__symbolic":"reference","name":"selector"}]}}}}}}},"origins":{"canScroll":"./can-scroll","containsOrAfter":"./contains-or-after","tuiCustomEvent":"./custom-event","getActualTarget":"./get-actual-target","getClipboardDataText":"./get-clipboard-data-text","getClosestElement":"./get-closest-element","getDocumentOrShadowRoot":"./get-document-or-shadow-root","getElementObscurers":"./get-element-obscurers","getElementOffset":"./get-element-offset","getScrollParent":"./get-scroll-parent","tuiGetViewportHeight":"./get-viewport-height","tuiGetViewportWidth":"./get-viewport-width","isCurrentTarget":"./is-current-target","isInsideIframe":"./is-inside-iframe","isNodeIn":"./is-node-in"},"importAs":"@taiga-ui/cdk/utils/dom"}
1
+ {"__symbolic":"module","version":4,"metadata":{"canScroll":{"__symbolic":"function","parameters":["element","rootElement","vertical","scrollEnd"],"value":{"__symbolic":"if","condition":{"__symbolic":"reference","name":"vertical"},"thenExpression":{"__symbolic":"error","message":"Reference to a non-exported function","line":11,"character":9,"context":{"name":"canScrollVertical"},"module":"./can-scroll"},"elseExpression":{"__symbolic":"error","message":"Reference to a non-exported function","line":38,"character":9,"context":{"name":"canScrollHorizontal"},"module":"./can-scroll"}}},"containsOrAfter":{"__symbolic":"function","parameters":["current","node"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"current"},"member":"contains"},"arguments":[{"__symbolic":"reference","name":"node"}]},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"binop","operator":"&","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"compareDocumentPosition"},"arguments":[{"__symbolic":"reference","name":"current"}]},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Node"},"member":"DOCUMENT_POSITION_PRECEDING"}}}}}},"tuiCustomEvent":{"__symbolic":"function"},"getActualTarget":{"__symbolic":"function"},"getClipboardDataText":{"__symbolic":"function","parameters":["event","format"],"defaults":[null,"text/plain"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"in","left":"clipboardData","right":{"__symbolic":"reference","name":"event"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"event"},"member":"clipboardData"},"right":null}},"thenExpression":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"event"},"member":"clipboardData"},"member":"getData"},"arguments":[{"__symbolic":"reference","name":"format"}]},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"event"},"member":"clipboardData"},"member":"getData"},"arguments":["text/plain"]}},"elseExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"event"},"member":"target"},"member":"ownerDocument"},"member":"defaultView"},"member":"clipboardData"},"member":"getData"},"arguments":["text"]}}},"getClosestElement":{"__symbolic":"function"},"getDocumentOrShadowRoot":{"__symbolic":"function","parameters":["node"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"in","left":"getRootNode","right":{"__symbolic":"reference","name":"node"}},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"isConnected"}},"thenExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"getRootNode"}},"elseExpression":{"__symbolic":"error","message":"Expression form not supported","line":3,"character":10,"module":"./get-document-or-shadow-root"}}},"getElementObscurers":{"__symbolic":"function"},"getElementOffset":{"__symbolic":"function"},"getScrollParent":{"__symbolic":"function"},"tuiGetSelectedText":{"__symbolic":"function","parameters":["getSelection","document"],"value":{"__symbolic":"if","condition":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"tuiIsFormFieldElement"},"arguments":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"document"},"member":"activeElement"}]},"thenExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"document"},"member":"activeElement"},"member":"value"},"member":"slice"},"arguments":[{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"document"},"member":"activeElement"},"member":"selectionStart"},"right":0},{"__symbolic":"binop","operator":"||","left":{"__symbolic":"select","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"document"},"member":"activeElement"},"member":"selectionEnd"},"right":0}]},"elseExpression":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"getSelection"}},"member":"toString"}},"right":null}}},"isCurrentTarget":{"__symbolic":"function","parameters":["target","currentTarget"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"target"},"right":{"__symbolic":"reference","name":"currentTarget"}}},"tuiIsFormFieldElement":{"__symbolic":"function"},"isInsideIframe":{"__symbolic":"function","parameters":["windowRef"],"value":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"windowRef"},"member":"parent"},"right":{"__symbolic":"reference","name":"windowRef"}}},"isNodeIn":{"__symbolic":"function","parameters":["node","selector"],"value":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"nodeType"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Node"},"member":"TEXT_NODE"}},"thenExpression":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"parentElement"}}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"getClosestElement"},"arguments":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"parentElement"},{"__symbolic":"reference","name":"selector"}]}}}},"elseExpression":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"node"},"member":"nodeType"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Node"},"member":"ELEMENT_NODE"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"getClosestElement"},"arguments":[{"__symbolic":"reference","name":"node"},{"__symbolic":"reference","name":"selector"}]}}}}}}},"origins":{"canScroll":"./can-scroll","containsOrAfter":"./contains-or-after","tuiCustomEvent":"./custom-event","getActualTarget":"./get-actual-target","getClipboardDataText":"./get-clipboard-data-text","getClosestElement":"./get-closest-element","getDocumentOrShadowRoot":"./get-document-or-shadow-root","getElementObscurers":"./get-element-obscurers","getElementOffset":"./get-element-offset","getScrollParent":"./get-scroll-parent","tuiGetSelectedText":"./get-selected-text","isCurrentTarget":"./is-current-target","tuiIsFormFieldElement":"./is-form-field","isInsideIframe":"./is-inside-iframe","isNodeIn":"./is-node-in"},"importAs":"@taiga-ui/cdk/utils/dom"}
@@ -1,21 +0,0 @@
1
- /**
2
- * @description:
3
- * Cross-browser @media (height)
4
- *
5
- * 1. window.innerWidth
6
- * 1.1. gets CSS viewport @media (height) which include scrollbars
7
- * 1.2. initial-scale and zoom variations may cause mobile values to
8
- * wrongly scale down to what PPK calls the visual
9
- * viewport and be smaller than the @media values
10
- * 1.3. zoom may cause values to be 1px off due to native rounding
11
- *
12
- * 2. document.documentElement.clientHeight
13
- * 2.1. equals CSS viewport width minus scrollbar width
14
- * 2.2. matches @media (height) when there is no scrollbar
15
- * 2.3. available cross-browser
16
- * 2.4. inaccurate if doctype is missing
17
- */
18
- export function tuiGetViewportHeight({ document, innerHeight }) {
19
- return Math.max(document.documentElement.clientHeight || 0, innerHeight || 0);
20
- }
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LXZpZXdwb3J0LWhlaWdodC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YWlnYS11aS9jZGsvdXRpbHMvZG9tLyIsInNvdXJjZXMiOlsiZ2V0LXZpZXdwb3J0LWhlaWdodC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7OztHQWdCRztBQUNILE1BQU0sVUFBVSxvQkFBb0IsQ0FBQyxFQUFDLFFBQVEsRUFBRSxXQUFXLEVBQVM7SUFDaEUsT0FBTyxJQUFJLENBQUMsR0FBRyxDQUFDLFFBQVEsQ0FBQyxlQUFlLENBQUMsWUFBWSxJQUFJLENBQUMsRUFBRSxXQUFXLElBQUksQ0FBQyxDQUFDLENBQUM7QUFDbEYsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGRlc2NyaXB0aW9uOlxuICogQ3Jvc3MtYnJvd3NlciBAbWVkaWEgKGhlaWdodClcbiAqXG4gKiAxLiB3aW5kb3cuaW5uZXJXaWR0aFxuICogMS4xLiBnZXRzIENTUyB2aWV3cG9ydCBAbWVkaWEgKGhlaWdodCkgd2hpY2ggaW5jbHVkZSBzY3JvbGxiYXJzXG4gKiAxLjIuIGluaXRpYWwtc2NhbGUgYW5kIHpvb20gdmFyaWF0aW9ucyBtYXkgY2F1c2UgbW9iaWxlIHZhbHVlcyB0b1xuICogICAgICB3cm9uZ2x5IHNjYWxlIGRvd24gdG8gd2hhdCBQUEsgY2FsbHMgdGhlIHZpc3VhbFxuICogICAgICB2aWV3cG9ydCBhbmQgYmUgc21hbGxlciB0aGFuIHRoZSBAbWVkaWEgdmFsdWVzXG4gKiAgMS4zLiB6b29tIG1heSBjYXVzZSB2YWx1ZXMgdG8gYmUgMXB4IG9mZiBkdWUgdG8gbmF0aXZlIHJvdW5kaW5nXG4gKlxuICogIDIuIGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5jbGllbnRIZWlnaHRcbiAqICAyLjEuIGVxdWFscyBDU1Mgdmlld3BvcnQgd2lkdGggbWludXMgc2Nyb2xsYmFyIHdpZHRoXG4gKiAgMi4yLiBtYXRjaGVzIEBtZWRpYSAoaGVpZ2h0KSB3aGVuIHRoZXJlIGlzIG5vIHNjcm9sbGJhclxuICogIDIuMy4gYXZhaWxhYmxlIGNyb3NzLWJyb3dzZXJcbiAqICAyLjQuIGluYWNjdXJhdGUgaWYgZG9jdHlwZSBpcyBtaXNzaW5nXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiB0dWlHZXRWaWV3cG9ydEhlaWdodCh7ZG9jdW1lbnQsIGlubmVySGVpZ2h0fTogV2luZG93KTogbnVtYmVyIHtcbiAgICByZXR1cm4gTWF0aC5tYXgoZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LmNsaWVudEhlaWdodCB8fCAwLCBpbm5lckhlaWdodCB8fCAwKTtcbn1cbiJdfQ==
@@ -1,21 +0,0 @@
1
- /**
2
- * @description:
3
- * Cross-browser @media (width)
4
- *
5
- * 1. window.innerWidth
6
- * 1.1. gets CSS viewport @media (width) which include scrollbars
7
- * 1.2. initial-scale and zoom variations may cause mobile values to
8
- * wrongly scale down to what PPK calls the visual
9
- * viewport and be smaller than the @media values
10
- * 1.3. zoom may cause values to be 1px off due to native rounding
11
- *
12
- * 2. document.documentElement.clientWidth
13
- * 2.1. equals CSS viewport width minus scrollbar width
14
- * 2.2. matches @media (width) when there is no scrollbar
15
- * 2.3. available cross-browser
16
- * 2.4. inaccurate if doctype is missing
17
- */
18
- export function tuiGetViewportWidth({ document, innerWidth }) {
19
- return Math.max(document.documentElement.clientWidth || 0, innerWidth || 0);
20
- }
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWx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i4xLiBlcXVhbHMgQ1NTIHZpZXdwb3J0IHdpZHRoIG1pbnVzIHNjcm9sbGJhciB3aWR0aFxuICogIDIuMi4gbWF0Y2hlcyBAbWVkaWEgKHdpZHRoKSB3aGVuIHRoZXJlIGlzIG5vIHNjcm9sbGJhclxuICogIDIuMy4gYXZhaWxhYmxlIGNyb3NzLWJyb3dzZXJcbiAqICAyLjQuIGluYWNjdXJhdGUgaWYgZG9jdHlwZSBpcyBtaXNzaW5nXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiB0dWlHZXRWaWV3cG9ydFdpZHRoKHtkb2N1bWVudCwgaW5uZXJXaWR0aH06IFdpbmRvdyk6IG51bWJlciB7XG4gICAgcmV0dXJuIE1hdGgubWF4KGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5jbGllbnRXaWR0aCB8fCAwLCBpbm5lcldpZHRoIHx8IDApO1xufVxuIl19
@@ -1,22 +0,0 @@
1
- /**
2
- * @description:
3
- * Cross-browser @media (height)
4
- *
5
- * 1. window.innerWidth
6
- * 1.1. gets CSS viewport @media (height) which include scrollbars
7
- * 1.2. initial-scale and zoom variations may cause mobile values to
8
- * wrongly scale down to what PPK calls the visual
9
- * viewport and be smaller than the @media values
10
- * 1.3. zoom may cause values to be 1px off due to native rounding
11
- *
12
- * 2. document.documentElement.clientHeight
13
- * 2.1. equals CSS viewport width minus scrollbar width
14
- * 2.2. matches @media (height) when there is no scrollbar
15
- * 2.3. available cross-browser
16
- * 2.4. inaccurate if doctype is missing
17
- */
18
- export function tuiGetViewportHeight(_a) {
19
- var document = _a.document, innerHeight = _a.innerHeight;
20
- return Math.max(document.documentElement.clientHeight || 0, innerHeight || 0);
21
- }
22
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LXZpZXdwb3J0LWhlaWdodC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YWlnYS11aS9jZGsvdXRpbHMvZG9tLyIsInNvdXJjZXMiOlsi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VkaWEgKGhlaWdodCkgd2hlbiB0aGVyZSBpcyBubyBzY3JvbGxiYXJcbiAqICAyLjMuIGF2YWlsYWJsZSBjcm9zcy1icm93c2VyXG4gKiAgMi40LiBpbmFjY3VyYXRlIGlmIGRvY3R5cGUgaXMgbWlzc2luZ1xuICovXG5leHBvcnQgZnVuY3Rpb24gdHVpR2V0Vmlld3BvcnRIZWlnaHQoe2RvY3VtZW50LCBpbm5lckhlaWdodH06IFdpbmRvdyk6IG51bWJlciB7XG4gICAgcmV0dXJuIE1hdGgubWF4KGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5jbGllbnRIZWlnaHQgfHwgMCwgaW5uZXJIZWlnaHQgfHwgMCk7XG59XG4iXX0=
@@ -1,22 +0,0 @@
1
- /**
2
- * @description:
3
- * Cross-browser @media (width)
4
- *
5
- * 1. window.innerWidth
6
- * 1.1. gets CSS viewport @media (width) which include scrollbars
7
- * 1.2. initial-scale and zoom variations may cause mobile values to
8
- * wrongly scale down to what PPK calls the visual
9
- * viewport and be smaller than the @media values
10
- * 1.3. zoom may cause values to be 1px off due to native rounding
11
- *
12
- * 2. document.documentElement.clientWidth
13
- * 2.1. equals CSS viewport width minus scrollbar width
14
- * 2.2. matches @media (width) when there is no scrollbar
15
- * 2.3. available cross-browser
16
- * 2.4. inaccurate if doctype is missing
17
- */
18
- export function tuiGetViewportWidth(_a) {
19
- var document = _a.document, innerWidth = _a.innerWidth;
20
- return Math.max(document.documentElement.clientWidth || 0, innerWidth || 0);
21
- }
22
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LXZpZXdwb3J0LXdpZHRoLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHRhaWdhLXVpL2Nkay91dGlscy9kb20vIiwic291cmNlcyI6WyJnZXQtdmlld3BvcnQtd2lkdGgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7R0FnQk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VyYXRlIGlmIGRvY3R5cGUgaXMgbWlzc2luZ1xuICovXG5leHBvcnQgZnVuY3Rpb24gdHVpR2V0Vmlld3BvcnRXaWR0aCh7ZG9jdW1lbnQsIGlubmVyV2lkdGh9OiBXaW5kb3cpOiBudW1iZXIge1xuICAgIHJldHVybiBNYXRoLm1heChkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuY2xpZW50V2lkdGggfHwgMCwgaW5uZXJXaWR0aCB8fCAwKTtcbn1cbiJdfQ==
@@ -1,18 +0,0 @@
1
- /**
2
- * @description:
3
- * Cross-browser @media (height)
4
- *
5
- * 1. window.innerWidth
6
- * 1.1. gets CSS viewport @media (height) which include scrollbars
7
- * 1.2. initial-scale and zoom variations may cause mobile values to
8
- * wrongly scale down to what PPK calls the visual
9
- * viewport and be smaller than the @media values
10
- * 1.3. zoom may cause values to be 1px off due to native rounding
11
- *
12
- * 2. document.documentElement.clientHeight
13
- * 2.1. equals CSS viewport width minus scrollbar width
14
- * 2.2. matches @media (height) when there is no scrollbar
15
- * 2.3. available cross-browser
16
- * 2.4. inaccurate if doctype is missing
17
- */
18
- export declare function tuiGetViewportHeight({ document, innerHeight }: Window): number;
@@ -1,18 +0,0 @@
1
- /**
2
- * @description:
3
- * Cross-browser @media (width)
4
- *
5
- * 1. window.innerWidth
6
- * 1.1. gets CSS viewport @media (width) which include scrollbars
7
- * 1.2. initial-scale and zoom variations may cause mobile values to
8
- * wrongly scale down to what PPK calls the visual
9
- * viewport and be smaller than the @media values
10
- * 1.3. zoom may cause values to be 1px off due to native rounding
11
- *
12
- * 2. document.documentElement.clientWidth
13
- * 2.1. equals CSS viewport width minus scrollbar width
14
- * 2.2. matches @media (width) when there is no scrollbar
15
- * 2.3. available cross-browser
16
- * 2.4. inaccurate if doctype is missing
17
- */
18
- export declare function tuiGetViewportWidth({ document, innerWidth }: Window): number;