@progress/kendo-angular-dateinputs 21.2.0-develop.4 → 21.2.0-develop.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.
@@ -29,24 +29,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.default = default_1;
31
31
  const fs = __importStar(require("fs"));
32
- const index_1 = require("../template-transformer/index");
33
32
  const utils_1 = require("../utils");
34
33
  function default_1(fileInfo, api) {
35
34
  const filePath = fileInfo.path;
35
+ // Handle HTML files and inline templates
36
+ const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeNameUpdate)(templateContent, 'kendo-datepicker', 'title', 'adaptiveSubtitle'));
36
37
  if (filePath.endsWith('.html')) {
37
- if ((0, utils_1.hasKendoInTemplate)(fileInfo.source)) {
38
- let updatedContent = fileInfo.source;
39
- updatedContent = (0, utils_1.htmlAttributeTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-datepicker', 'subtitle', 'adaptiveSubtitle');
40
- // Only write to file once after all transformations
41
- fs.writeFileSync(filePath, updatedContent, 'utf-8');
38
+ if (htmlResult && htmlResult !== fileInfo.source) {
39
+ fs.writeFileSync(filePath, htmlResult, 'utf-8');
40
+ return htmlResult;
42
41
  }
43
- return;
42
+ return fileInfo.source; // Return original source if no changes
44
43
  }
44
+ // Handle TypeScript property transformations
45
45
  const j = api.jscodeshift;
46
- const rootSource = j(fileInfo.source);
47
- (0, index_1.templateTransformer)(rootSource, j, (root) => {
48
- (0, utils_1.templateAttributeTransformer)(root, 'kendo-datepicker', 'subtitle', 'adaptiveSubtitle');
49
- });
50
- (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, 'DatePickerComponent', 'subtitle', 'adaptiveSubtitle');
46
+ const rootSource = j(htmlResult || fileInfo.source);
47
+ (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-dateinputs', 'DatePickerComponent', 'title', 'adaptiveSubtitle');
51
48
  return rootSource.toSource();
52
49
  }
@@ -29,24 +29,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.default = default_1;
31
31
  const fs = __importStar(require("fs"));
32
- const index_1 = require("../template-transformer/index");
33
32
  const utils_1 = require("../utils");
34
33
  function default_1(fileInfo, api) {
35
34
  const filePath = fileInfo.path;
35
+ // Handle HTML files and inline templates
36
+ const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeNameUpdate)(templateContent, 'kendo-datepicker', 'title', 'adaptiveTitle'));
36
37
  if (filePath.endsWith('.html')) {
37
- if ((0, utils_1.hasKendoInTemplate)(fileInfo.source)) {
38
- let updatedContent = fileInfo.source;
39
- updatedContent = (0, utils_1.htmlAttributeTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-datepicker', 'title', 'adaptiveTitle');
40
- // Only write to file once after all transformations
41
- fs.writeFileSync(filePath, updatedContent, 'utf-8');
38
+ if (htmlResult && htmlResult !== fileInfo.source) {
39
+ fs.writeFileSync(filePath, htmlResult, 'utf-8');
40
+ return htmlResult;
42
41
  }
43
- return;
42
+ return fileInfo.source; // Return original source if no changes
44
43
  }
44
+ // Handle TypeScript property transformations
45
45
  const j = api.jscodeshift;
46
- const rootSource = j(fileInfo.source);
47
- (0, index_1.templateTransformer)(rootSource, j, (root) => {
48
- (0, utils_1.templateAttributeTransformer)(root, 'kendo-datepicker', 'title', 'adaptiveTitle');
49
- });
50
- (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, 'DatePickerComponent', 'title', 'adaptiveTitle');
46
+ const rootSource = j(htmlResult || fileInfo.source);
47
+ (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-dateinputs', 'DatePickerComponent', 'title', 'adaptiveTitle');
51
48
  return rootSource.toSource();
52
49
  }
@@ -29,24 +29,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.default = default_1;
31
31
  const fs = __importStar(require("fs"));
32
- const index_1 = require("../template-transformer/index");
33
32
  const utils_1 = require("../utils");
34
33
  function default_1(fileInfo, api) {
35
34
  const filePath = fileInfo.path;
35
+ // Handle HTML files and inline templates
36
+ const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeNameUpdate)(templateContent, 'kendo-daterange-popup', 'subtitle', 'adaptiveSubtitle'));
36
37
  if (filePath.endsWith('.html')) {
37
- if ((0, utils_1.hasKendoInTemplate)(fileInfo.source)) {
38
- let updatedContent = fileInfo.source;
39
- updatedContent = (0, utils_1.htmlAttributeTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-daterange-popup', 'subtitle', 'adaptiveSubtitle');
40
- // Only write to file once after all transformations
41
- fs.writeFileSync(filePath, updatedContent, 'utf-8');
38
+ if (htmlResult && htmlResult !== fileInfo.source) {
39
+ fs.writeFileSync(filePath, htmlResult, 'utf-8');
40
+ return htmlResult;
42
41
  }
43
- return;
42
+ return fileInfo.source; // Return original source if no changes
44
43
  }
44
+ // Handle TypeScript property transformations
45
45
  const j = api.jscodeshift;
46
- const rootSource = j(fileInfo.source);
47
- (0, index_1.templateTransformer)(rootSource, j, (root) => {
48
- (0, utils_1.templateAttributeTransformer)(root, 'kendo-daterange-popup', 'subtitle', 'adaptiveSubtitle');
49
- });
50
- (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, 'DateRangePopupComponent', 'subtitle', 'adaptiveSubtitle');
46
+ const rootSource = j(htmlResult || fileInfo.source);
47
+ (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-dateinputs', 'DateRangePopupComponent', 'subtitle', 'adaptiveSubtitle');
51
48
  return rootSource.toSource();
52
49
  }
@@ -29,24 +29,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.default = default_1;
31
31
  const fs = __importStar(require("fs"));
32
- const index_1 = require("../template-transformer/index");
33
32
  const utils_1 = require("../utils");
34
33
  function default_1(fileInfo, api) {
35
34
  const filePath = fileInfo.path;
35
+ // Handle HTML files and inline templates
36
+ const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeNameUpdate)(templateContent, 'kendo-daterange-popup', 'title', 'adaptiveTitle'));
36
37
  if (filePath.endsWith('.html')) {
37
- if ((0, utils_1.hasKendoInTemplate)(fileInfo.source)) {
38
- let updatedContent = fileInfo.source;
39
- updatedContent = (0, utils_1.htmlAttributeTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-daterange-popup', 'title', 'adaptiveTitle');
40
- // Only write to file once after all transformations
41
- fs.writeFileSync(filePath, updatedContent, 'utf-8');
38
+ if (htmlResult && htmlResult !== fileInfo.source) {
39
+ fs.writeFileSync(filePath, htmlResult, 'utf-8');
40
+ return htmlResult;
42
41
  }
43
- return;
42
+ return fileInfo.source; // Return original source if no changes
44
43
  }
44
+ // Handle TypeScript property transformations
45
45
  const j = api.jscodeshift;
46
- const rootSource = j(fileInfo.source);
47
- (0, index_1.templateTransformer)(rootSource, j, (root) => {
48
- (0, utils_1.templateAttributeTransformer)(root, 'kendo-daterange-popup', 'title', 'adaptiveTitle');
49
- });
50
- (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, 'DateRangePopupComponent', 'title', 'adaptiveTitle');
46
+ const rootSource = j(htmlResult || fileInfo.source);
47
+ (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-dateinputs', 'DateRangePopupComponent', 'title', 'adaptiveTitle');
51
48
  return rootSource.toSource();
52
49
  }
@@ -29,24 +29,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.default = default_1;
31
31
  const fs = __importStar(require("fs"));
32
- const index_1 = require("../template-transformer/index");
33
32
  const utils_1 = require("../utils");
34
33
  function default_1(fileInfo, api) {
35
34
  const filePath = fileInfo.path;
35
+ // Handle HTML files and inline templates
36
+ const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeNameUpdate)(templateContent, 'kendo-datetimepicker', 'subtitle', 'adaptiveSubtitle'));
36
37
  if (filePath.endsWith('.html')) {
37
- if ((0, utils_1.hasKendoInTemplate)(fileInfo.source)) {
38
- let updatedContent = fileInfo.source;
39
- updatedContent = (0, utils_1.htmlAttributeTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-datetimepicker', 'subtitle', 'adaptiveSubtitle');
40
- // Only write to file once after all transformations
41
- fs.writeFileSync(filePath, updatedContent, 'utf-8');
38
+ if (htmlResult && htmlResult !== fileInfo.source) {
39
+ fs.writeFileSync(filePath, htmlResult, 'utf-8');
40
+ return htmlResult;
42
41
  }
43
- return;
42
+ return fileInfo.source; // Return original source if no changes
44
43
  }
44
+ // Handle TypeScript property transformations
45
45
  const j = api.jscodeshift;
46
- const rootSource = j(fileInfo.source);
47
- (0, index_1.templateTransformer)(rootSource, j, (root) => {
48
- (0, utils_1.templateAttributeTransformer)(root, 'kendo-datetimepicker', 'subtitle', 'adaptiveSubtitle');
49
- });
50
- (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, 'DateTimePickerComponent', 'subtitle', 'adaptiveSubtitle');
46
+ const rootSource = j(htmlResult || fileInfo.source);
47
+ (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-dateinputs', 'DateTimePickerComponent', 'subtitle', 'adaptiveSubtitle');
51
48
  return rootSource.toSource();
52
49
  }
@@ -29,24 +29,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.default = default_1;
31
31
  const fs = __importStar(require("fs"));
32
- const index_1 = require("../template-transformer/index");
33
32
  const utils_1 = require("../utils");
34
33
  function default_1(fileInfo, api) {
35
34
  const filePath = fileInfo.path;
35
+ // Handle HTML files and inline templates
36
+ const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeNameUpdate)(templateContent, 'kendo-datetimepicker', 'title', 'adaptiveTitle'));
36
37
  if (filePath.endsWith('.html')) {
37
- if ((0, utils_1.hasKendoInTemplate)(fileInfo.source)) {
38
- let updatedContent = fileInfo.source;
39
- updatedContent = (0, utils_1.htmlAttributeTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-datetimepicker', 'title', 'adaptiveTitle');
40
- // Only write to file once after all transformations
41
- fs.writeFileSync(filePath, updatedContent, 'utf-8');
38
+ if (htmlResult && htmlResult !== fileInfo.source) {
39
+ fs.writeFileSync(filePath, htmlResult, 'utf-8');
40
+ return htmlResult;
42
41
  }
43
- return;
42
+ return fileInfo.source; // Return original source if no changes
44
43
  }
44
+ // Handle TypeScript property transformations
45
45
  const j = api.jscodeshift;
46
- const rootSource = j(fileInfo.source);
47
- (0, index_1.templateTransformer)(rootSource, j, (root) => {
48
- (0, utils_1.templateAttributeTransformer)(root, 'kendo-datetimepicker', 'title', 'adaptiveTitle');
49
- });
50
- (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, 'DateTimePickerComponent', 'title', 'adaptiveTitle');
46
+ const rootSource = j(htmlResult || fileInfo.source);
47
+ (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-dateinputs', 'DateTimePickerComponent', 'title', 'adaptiveTitle');
51
48
  return rootSource.toSource();
52
49
  }
@@ -29,24 +29,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.default = default_1;
31
31
  const fs = __importStar(require("fs"));
32
- const index_1 = require("../template-transformer/index");
33
32
  const utils_1 = require("../utils");
34
33
  function default_1(fileInfo, api) {
35
34
  const filePath = fileInfo.path;
35
+ // Handle HTML files and inline templates
36
+ const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeNameUpdate)(templateContent, 'kendo-timepicker', 'subtitle', 'adaptiveSubtitle'));
36
37
  if (filePath.endsWith('.html')) {
37
- if ((0, utils_1.hasKendoInTemplate)(fileInfo.source)) {
38
- let updatedContent = fileInfo.source;
39
- updatedContent = (0, utils_1.htmlAttributeTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-timepicker', 'subtitle', 'adaptiveSubtitle');
40
- // Only write to file once after all transformations
41
- fs.writeFileSync(filePath, updatedContent, 'utf-8');
38
+ if (htmlResult && htmlResult !== fileInfo.source) {
39
+ fs.writeFileSync(filePath, htmlResult, 'utf-8');
40
+ return htmlResult;
42
41
  }
43
- return;
42
+ return fileInfo.source; // Return original source if no changes
44
43
  }
44
+ // Handle TypeScript property transformations
45
45
  const j = api.jscodeshift;
46
- const rootSource = j(fileInfo.source);
47
- (0, index_1.templateTransformer)(rootSource, j, (root) => {
48
- (0, utils_1.templateAttributeTransformer)(root, 'kendo-timepicker', 'subtitle', 'adaptiveSubtitle');
49
- });
50
- (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, 'TimePickerComponent', 'subtitle', 'adaptiveSubtitle');
46
+ const rootSource = j(htmlResult || fileInfo.source);
47
+ (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-dateinputs', 'TimePickerComponent', 'subtitle', 'adaptiveSubtitle');
51
48
  return rootSource.toSource();
52
49
  }
@@ -29,24 +29,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.default = default_1;
31
31
  const fs = __importStar(require("fs"));
32
- const index_1 = require("../template-transformer/index");
33
32
  const utils_1 = require("../utils");
34
33
  function default_1(fileInfo, api) {
35
34
  const filePath = fileInfo.path;
35
+ // Handle HTML files and inline templates
36
+ const htmlResult = (0, utils_1.htmlTransformer)(fileInfo, api, (templateContent) => (0, utils_1.attributeNameUpdate)(templateContent, 'kendo-timepicker', 'title', 'adaptiveTitle'));
36
37
  if (filePath.endsWith('.html')) {
37
- if ((0, utils_1.hasKendoInTemplate)(fileInfo.source)) {
38
- let updatedContent = fileInfo.source;
39
- updatedContent = (0, utils_1.htmlAttributeTransformer)({ ...fileInfo, source: updatedContent }, 'kendo-timepicker', 'title', 'adaptiveTitle');
40
- // Only write to file once after all transformations
41
- fs.writeFileSync(filePath, updatedContent, 'utf-8');
38
+ if (htmlResult && htmlResult !== fileInfo.source) {
39
+ fs.writeFileSync(filePath, htmlResult, 'utf-8');
40
+ return htmlResult;
42
41
  }
43
- return;
42
+ return fileInfo.source; // Return original source if no changes
44
43
  }
44
+ // Handle TypeScript property transformations
45
45
  const j = api.jscodeshift;
46
- const rootSource = j(fileInfo.source);
47
- (0, index_1.templateTransformer)(rootSource, j, (root) => {
48
- (0, utils_1.templateAttributeTransformer)(root, 'kendo-timepicker', 'title', 'adaptiveTitle');
49
- });
50
- (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, 'TimePickerComponent', 'title', 'adaptiveTitle');
46
+ const rootSource = j(htmlResult || fileInfo.source);
47
+ (0, utils_1.tsPropertyTransformer)(fileInfo.source, rootSource, j, '@progress/kendo-angular-dateinputs', 'TimePickerComponent', 'title', 'adaptiveTitle');
51
48
  return rootSource.toSource();
52
49
  }
@@ -10,7 +10,7 @@ export const packageMetadata = {
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCode: 'KENDOUIANGULAR',
12
12
  productCodes: ['KENDOUIANGULAR'],
13
- publishDate: 1764059096,
14
- version: '21.2.0-develop.4',
13
+ publishDate: 1764320112,
14
+ version: '21.2.0-develop.6',
15
15
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
16
16
  };
@@ -36,8 +36,8 @@ const packageMetadata = {
36
36
  productName: 'Kendo UI for Angular',
37
37
  productCode: 'KENDOUIANGULAR',
38
38
  productCodes: ['KENDOUIANGULAR'],
39
- publishDate: 1764059096,
40
- version: '21.2.0-develop.4',
39
+ publishDate: 1764320112,
40
+ version: '21.2.0-develop.6',
41
41
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
42
42
  };
43
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-dateinputs",
3
- "version": "21.2.0-develop.4",
3
+ "version": "21.2.0-develop.6",
4
4
  "description": "Kendo UI for Angular Date Inputs Package - Everything you need to add date selection functionality to apps (DatePicker, TimePicker, DateInput, DateRangePicker, DateTimePicker, Calendar, and MultiViewCalendar).",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -79,7 +79,7 @@
79
79
  "package": {
80
80
  "productName": "Kendo UI for Angular",
81
81
  "productCode": "KENDOUIANGULAR",
82
- "publishDate": 1764059096,
82
+ "publishDate": 1764320112,
83
83
  "licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
84
84
  }
85
85
  },
@@ -90,23 +90,22 @@
90
90
  "@angular/forms": "18 - 21",
91
91
  "@angular/platform-browser": "18 - 21",
92
92
  "@progress/kendo-licensing": "^1.7.0",
93
- "@progress/kendo-angular-buttons": "21.2.0-develop.4",
94
- "@progress/kendo-angular-common": "21.2.0-develop.4",
95
- "@progress/kendo-angular-utils": "21.2.0-develop.4",
96
- "@progress/kendo-angular-intl": "21.2.0-develop.4",
97
- "@progress/kendo-angular-l10n": "21.2.0-develop.4",
98
- "@progress/kendo-angular-icons": "21.2.0-develop.4",
99
- "@progress/kendo-angular-popup": "21.2.0-develop.4",
100
- "@progress/kendo-angular-navigation": "21.2.0-develop.4",
93
+ "@progress/kendo-angular-buttons": "21.2.0-develop.6",
94
+ "@progress/kendo-angular-common": "21.2.0-develop.6",
95
+ "@progress/kendo-angular-utils": "21.2.0-develop.6",
96
+ "@progress/kendo-angular-intl": "21.2.0-develop.6",
97
+ "@progress/kendo-angular-l10n": "21.2.0-develop.6",
98
+ "@progress/kendo-angular-icons": "21.2.0-develop.6",
99
+ "@progress/kendo-angular-popup": "21.2.0-develop.6",
100
+ "@progress/kendo-angular-navigation": "21.2.0-develop.6",
101
101
  "rxjs": "^6.5.3 || ^7.0.0"
102
102
  },
103
103
  "dependencies": {
104
104
  "tslib": "^2.3.1",
105
- "@progress/kendo-angular-schematics": "21.2.0-develop.4",
105
+ "@progress/kendo-angular-schematics": "21.2.0-develop.6",
106
106
  "@progress/kendo-common": "^1.0.1",
107
107
  "@progress/kendo-date-math": "^1.1.0",
108
- "@progress/kendo-dateinputs-common": "^0.4.7",
109
- "node-html-parser": "^7.0.1"
108
+ "@progress/kendo-dateinputs-common": "^0.4.7"
110
109
  },
111
110
  "schematics": "./schematics/collection.json",
112
111
  "module": "fesm2022/progress-kendo-angular-dateinputs.mjs",
@@ -1,96 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2025 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.templateTransformer = templateTransformer;
8
- const node_html_parser_1 = require("node-html-parser");
9
- const utils_1 = require("../utils");
10
- function templateTransformer(root, j, ...processFns) {
11
- root
12
- .find(j.ClassDeclaration)
13
- .forEach(classPath => {
14
- // Skip if no decorators
15
- const classNode = classPath.node;
16
- if (!classNode.decorators || !classNode.decorators.length)
17
- return;
18
- // Find Component decorator
19
- const componentDecorator = classNode.decorators.find((decorator) => {
20
- if (decorator.expression && decorator.expression.type === 'CallExpression') {
21
- const callee = decorator.expression.callee;
22
- // Handle direct Component identifier
23
- if (callee.type === 'Identifier' && callee.name === 'Component') {
24
- return true;
25
- }
26
- // Handle angular.core.Component or similar
27
- if (callee.type === 'MemberExpression' &&
28
- callee.property &&
29
- callee.property.type === 'Identifier' &&
30
- callee.property.name === 'Component') {
31
- return true;
32
- }
33
- }
34
- return false;
35
- });
36
- if (!componentDecorator || !componentDecorator.expression)
37
- return;
38
- const expression = componentDecorator.expression;
39
- if (expression.type !== 'CallExpression' || !expression.arguments.length)
40
- return;
41
- const componentOptions = expression.arguments[0];
42
- if (componentOptions.type !== 'ObjectExpression')
43
- return;
44
- // Find template and templateUrl properties
45
- const props = componentOptions.properties || [];
46
- const templateProp = props.find((prop) => (prop.key.type === 'Identifier' && prop.key.name === 'template') ||
47
- (prop.key.type === 'StringLiteral' && prop.key.value === 'template'));
48
- // const templateUrlProp = props.find((prop: any) =>
49
- // (prop.key.type === 'Identifier' && prop.key.name === 'templateUrl') ||
50
- // (prop.key.type === 'StringLiteral' && prop.key.value === 'templateUrl')
51
- // );
52
- // Process inline template
53
- if (templateProp) {
54
- // Extract template based on node type
55
- let originalTemplate;
56
- if (templateProp.value.type === 'StringLiteral' || templateProp.value.type === 'Literal') {
57
- originalTemplate = templateProp.value.value;
58
- }
59
- else if (templateProp.value.type === 'TemplateLiteral') {
60
- // For template literals, join quasis
61
- if (templateProp.value.quasis && templateProp.value.quasis.length) {
62
- originalTemplate = templateProp.value.quasis
63
- .map((q) => q.value.cooked || q.value.raw)
64
- .join('');
65
- }
66
- else {
67
- console.warn('Could not process TemplateLiteral properly');
68
- return;
69
- }
70
- }
71
- else {
72
- console.warn(`Unsupported template type: ${templateProp.value.type}`);
73
- return;
74
- }
75
- if ((0, utils_1.hasKendoInTemplate)(originalTemplate)) {
76
- const root = (0, node_html_parser_1.parse)(originalTemplate, { comment: true, blockTextElements: utils_1.blockTextElements });
77
- processFns.forEach(fn => {
78
- fn(root);
79
- });
80
- // Transform template using Angular compiler
81
- const transformedTemplate = root.toString();
82
- if (transformedTemplate !== originalTemplate) {
83
- // Update template property
84
- if (templateProp.value.type === 'TemplateLiteral') {
85
- // For template literals, create a new template literal
86
- templateProp.value = j.templateLiteral([j.templateElement({ cooked: transformedTemplate, raw: transformedTemplate }, true)], []);
87
- }
88
- else {
89
- // For string literals, update the value
90
- templateProp.value.value = transformedTemplate;
91
- }
92
- }
93
- }
94
- }
95
- });
96
- }