@koobiq/components 20.1.0 → 20.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/_accordion-theme.scss +6 -2
- package/accordion/accordion-tokens.scss +3 -0
- package/accordion/{accordion-trigger.component.scss → accordion-trigger.scss} +10 -0
- package/accordion/accordion.scss +71 -0
- package/accordion/index.d.ts +264 -121
- package/actions-panel/index.d.ts +25 -13
- package/alert/_alert-theme.scss +14 -0
- package/alert/alert.component.scss +24 -13
- package/alert/index.d.ts +63 -29
- package/app-switcher/app-switcher-dropdown-app.scss +7 -5
- package/app-switcher/app-switcher-dropdown-site.scss +6 -4
- package/app-switcher/index.d.ts +41 -4
- package/app-switcher/kbq-app-switcher-list-item.scss +6 -8
- package/autocomplete/autocomplete.scss +2 -1
- package/autocomplete/index.d.ts +58 -37
- package/badge/index.d.ts +2 -3
- package/breadcrumbs/index.d.ts +1 -1
- package/button/index.d.ts +2 -2
- package/button-toggle/button-toggle-tokens.scss +2 -0
- package/button-toggle/button-toggle.scss +9 -0
- package/button-toggle/index.d.ts +5 -0
- package/checkbox/index.d.ts +33 -29
- package/clamped-text/index.d.ts +3 -2
- package/code-block/index.d.ts +24 -19
- package/content-panel/index.d.ts +1 -1
- package/core/index.d.ts +1217 -186
- package/core/option/_action-container-mixins.scss +28 -0
- package/core/option/_option-theme.scss +24 -0
- package/core/option/action.scss +7 -0
- package/core/styles/_core.scss +2 -0
- package/core/styles/_koobiq-theme.scss +2 -0
- package/core/styles/_tokens.scss +1 -0
- package/core/styles/common/_animation.scss +31 -24
- package/core/styles/common/_connected-overlay.scss +39 -0
- package/core/styles/common/_select.scss +19 -2
- package/core/styles/common/_tokens.scss +0 -9
- package/core/styles/theming/_index.scss +0 -1
- package/core/styles/theming/_theming.scss +34 -5
- package/datepicker/index.d.ts +46 -15
- package/dl/dl.scss +26 -0
- package/dl/index.d.ts +8 -1
- package/dropdown/_dropdown-theme.scss +28 -2
- package/dropdown/dropdown-item.scss +29 -0
- package/dropdown/dropdown-tokens.scss +2 -1
- package/dropdown/dropdown.scss +16 -1
- package/dropdown/index.d.ts +331 -17
- package/dynamic-translation/index.d.ts +1 -1
- package/fesm2022/koobiq-components-accordion.mjs +480 -317
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-actions-panel.mjs +57 -46
- package/fesm2022/koobiq-components-actions-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-alert.mjs +98 -58
- package/fesm2022/koobiq-components-alert.mjs.map +1 -1
- package/fesm2022/koobiq-components-app-switcher.mjs +233 -38
- package/fesm2022/koobiq-components-app-switcher.mjs.map +1 -1
- package/fesm2022/koobiq-components-autocomplete.mjs +89 -52
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +18 -17
- package/fesm2022/koobiq-components-badge.mjs.map +1 -1
- package/fesm2022/koobiq-components-breadcrumbs.mjs +25 -25
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +17 -12
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-button.mjs +25 -25
- package/fesm2022/koobiq-components-checkbox.mjs +69 -92
- package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
- package/fesm2022/koobiq-components-clamped-text.mjs +18 -13
- package/fesm2022/koobiq-components-clamped-text.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +56 -69
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-content-panel.mjs +29 -29
- package/fesm2022/koobiq-components-core.mjs +2485 -735
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +168 -126
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-divider.mjs +7 -7
- package/fesm2022/koobiq-components-dl.mjs +23 -15
- package/fesm2022/koobiq-components-dl.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +814 -136
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-dynamic-translation.mjs +13 -13
- package/fesm2022/koobiq-components-ellipsis-center.mjs +7 -7
- package/fesm2022/koobiq-components-empty-state.mjs +19 -19
- package/fesm2022/koobiq-components-file-upload.mjs +74 -42
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +783 -199
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-flag.mjs +7 -7
- package/fesm2022/koobiq-components-form-field.mjs +350 -162
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +52 -25
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +175 -28
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +41 -24
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-link.mjs +8 -8
- package/fesm2022/koobiq-components-list.mjs +657 -143
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-loader-overlay.mjs +16 -16
- package/fesm2022/koobiq-components-markdown.mjs +14 -11
- package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +59 -35
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +177 -67
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-notification-center.mjs +40 -24
- package/fesm2022/koobiq-components-notification-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-overflow-items.mjs +16 -17
- package/fesm2022/koobiq-components-overflow-items.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +31 -21
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-bar.mjs +13 -13
- package/fesm2022/koobiq-components-progress-spinner.mjs +13 -13
- package/fesm2022/koobiq-components-radio.mjs +10 -10
- package/fesm2022/koobiq-components-resizer.mjs +33 -14
- package/fesm2022/koobiq-components-resizer.mjs.map +1 -1
- package/fesm2022/koobiq-components-scrollbar.mjs +10 -10
- package/fesm2022/koobiq-components-search-expandable.mjs +49 -14
- package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +450 -146
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidebar.mjs +14 -14
- package/fesm2022/koobiq-components-sidepanel.mjs +26 -26
- package/fesm2022/koobiq-components-skeleton.mjs +10 -10
- package/fesm2022/koobiq-components-split-button.mjs +10 -17
- package/fesm2022/koobiq-components-split-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-splitter.mjs +17 -17
- package/fesm2022/koobiq-components-table.mjs +15 -13
- package/fesm2022/koobiq-components-table.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +80 -68
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +283 -122
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +13 -8
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-time-range.mjs +29 -24
- package/fesm2022/koobiq-components-time-range.mjs.map +1 -1
- package/fesm2022/koobiq-components-timepicker.mjs +61 -30
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +77 -42
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +7 -7
- package/fesm2022/koobiq-components-toast.mjs +51 -26
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +72 -64
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +219 -28
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-top-bar.mjs +13 -13
- package/fesm2022/koobiq-components-tree-select.mjs +222 -80
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +302 -81
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/fesm2022/koobiq-components-username.mjs +27 -27
- package/file-upload/index.d.ts +25 -6
- package/file-upload/multiple-file-upload.component.scss +14 -0
- package/filter-bar/_filter-bar-theme.scss +0 -10
- package/filter-bar/filter-bar-tokens.scss +3 -0
- package/filter-bar/filters.scss +3 -2
- package/filter-bar/index.d.ts +281 -9
- package/filter-bar/pipes/base-pipe.scss +0 -11
- package/filter-bar/pipes/pipe-input.scss +10 -0
- package/filter-bar/pipes/pipe-multi-tree-select.scss +0 -6
- package/filter-bar/pipes/pipe-multiselect.scss +0 -6
- package/filter-bar/pipes/pipe-tree-select.scss +0 -6
- package/form-field/_form-field-theme.scss +76 -20
- package/form-field/fieldset.scss +10 -0
- package/form-field/form-field-tokens.scss +15 -1
- package/form-field/form-field.scss +15 -19
- package/form-field/index.d.ts +147 -65
- package/icon/icon-button.scss +3 -1
- package/icon/index.d.ts +45 -7
- package/inline-edit/index.d.ts +57 -4
- package/inline-edit/inline-edit.scss +10 -0
- package/input/index.d.ts +17 -2
- package/list/_list-theme.scss +42 -10
- package/list/index.d.ts +326 -79
- package/list/list-tokens.scss +43 -8
- package/list/list.scss +186 -12
- package/markdown/index.d.ts +1 -1
- package/modal/index.d.ts +21 -4
- package/modal/modal-tokens.scss +1 -1
- package/navbar/_navbar-item_vertical.scss +7 -5
- package/navbar/index.d.ts +54 -5
- package/navbar/navbar-brand.scss +23 -7
- package/navbar/vertical-navbar.scss +6 -0
- package/notification-center/index.d.ts +2 -1
- package/notification-center/notification-item.scss +6 -0
- package/package.json +3 -6
- package/popover/index.d.ts +2 -2
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/prebuilt-themes/theme.css +1 -1
- package/resizer/index.d.ts +12 -0
- package/schematics/collection.json +10 -0
- package/schematics/migrations/alert-signals/README.md +64 -0
- package/schematics/migrations/alert-signals/data.js +70 -0
- package/schematics/migrations/alert-signals/index.js +350 -0
- package/schematics/migrations/alert-signals/schema.json +20 -0
- package/schematics/migrations/autocomplete-panel-width-auto/README.md +68 -0
- package/schematics/migrations/autocomplete-panel-width-auto/index.js +70 -0
- package/schematics/migrations/autocomplete-panel-width-auto/schema.json +15 -0
- package/schematics/migrations/deprecated-icons/README.md +29 -4
- package/schematics/migrations/deprecated-icons/data.js +7 -0
- package/schematics/migrations/deprecated-icons/index.js +62 -35
- package/schematics/migrations/filter-bar-signals/README.md +1 -1
- package/schematics/migrations/new-icons-pack/README.md +37 -2
- package/schematics/migrations/new-icons-pack/data.js +8 -0
- package/schematics/migrations/new-icons-pack/index.js +144 -53
- package/schematics/migrations.json +11 -1
- package/schematics/ng-add/index.js +3 -3
- package/schematics/utils/angular-parsing.js +41 -14
- package/schematics/utils/ast.js +31 -0
- package/schematics/utils/icon-migration.js +530 -0
- package/schematics/utils/typescript.js +44 -0
- package/scrollbar/index.d.ts +1 -1
- package/search-expandable/index.d.ts +3 -0
- package/select/index.d.ts +212 -40
- package/select/select-tokens.scss +0 -1
- package/select/select.scss +0 -2
- package/splitter/index.d.ts +1 -1
- package/table/_table-theme.scss +4 -0
- package/table/index.d.ts +2 -1
- package/table/table.scss +8 -0
- package/tabs/_tabs-common.scss +60 -31
- package/tabs/_tabs-theme.scss +12 -0
- package/tabs/index.d.ts +2 -2
- package/tabs/tab-header.scss +14 -0
- package/tabs/tab-nav-bar.scss +4 -0
- package/tabs/tabs-tokens.scss +1 -0
- package/tags/index.d.ts +128 -29
- package/textarea/index.d.ts +5 -0
- package/time-range/index.d.ts +1 -1
- package/timepicker/index.d.ts +4 -0
- package/timezone/index.d.ts +10 -8
- package/toast/index.d.ts +26 -3
- package/toggle/index.d.ts +34 -14
- package/tooltip/index.d.ts +119 -7
- package/tree/_tree-theme.scss +25 -5
- package/tree/index.d.ts +71 -3
- package/tree/tree-option.scss +2 -8
- package/tree-select/_tree-select-theme.scss +22 -0
- package/tree-select/index.d.ts +127 -36
- package/accordion/accordion.component.scss +0 -50
- package/core/styles/_tokens.kbq.import.scss +0 -4
- package/core/styles/theming/_components-theming.scss +0 -1927
- package/filter-bar/pipes/pipe-select.scss +0 -5
- package/overflow-items/overflow-items.scss +0 -20
|
@@ -10,23 +10,17 @@ var utils_typescript = require('./typescript.js');
|
|
|
10
10
|
* @param tree
|
|
11
11
|
* @param filePaths
|
|
12
12
|
* @param context
|
|
13
|
-
* @param
|
|
13
|
+
* @param transform
|
|
14
14
|
*/
|
|
15
|
-
async function
|
|
15
|
+
async function migrateTemplateWithTransform(tree, filePaths, context, transform) {
|
|
16
16
|
for (const templatePath of filePaths) {
|
|
17
17
|
const parsedFilePath = `.${templatePath}`;
|
|
18
|
-
let res = Promise.resolve({
|
|
19
|
-
fileContent: '',
|
|
20
|
-
changed: false,
|
|
21
|
-
errors: []
|
|
22
|
-
});
|
|
23
18
|
const template = tree.read(parsedFilePath)?.toString();
|
|
24
19
|
if (!template) {
|
|
25
20
|
context.logger.error(`Cannot read "${parsedFilePath}" because it does not exist.`);
|
|
26
21
|
continue;
|
|
27
22
|
}
|
|
28
|
-
|
|
29
|
-
const { fileContent, changed, errors } = await res;
|
|
23
|
+
const { fileContent, changed, errors } = await transform(template, parsedFilePath);
|
|
30
24
|
if (changed) {
|
|
31
25
|
tree.overwrite(templatePath, fileContent);
|
|
32
26
|
}
|
|
@@ -35,15 +29,25 @@ async function migrateTemplate(tree, filePaths, context, migrationData) {
|
|
|
35
29
|
}
|
|
36
30
|
}
|
|
37
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Update separate html file
|
|
34
|
+
* @param tree
|
|
35
|
+
* @param filePaths
|
|
36
|
+
* @param context
|
|
37
|
+
* @param migrationData
|
|
38
|
+
*/
|
|
39
|
+
async function migrateTemplate(tree, filePaths, context, migrationData) {
|
|
40
|
+
return migrateTemplateWithTransform(tree, filePaths, context, (template, fileName) => transformTemplateAttributes(template, fileName, migrationData));
|
|
41
|
+
}
|
|
38
42
|
/**
|
|
39
43
|
* Update typescript file if classes with @Component decorator and `template` property exists
|
|
40
44
|
* @param tree
|
|
41
45
|
* @param sourceFiles
|
|
42
46
|
* @param basePath
|
|
43
47
|
* @param context
|
|
44
|
-
* @param
|
|
48
|
+
* @param transform
|
|
45
49
|
*/
|
|
46
|
-
async function
|
|
50
|
+
async function migrateTsWithTransform(tree, sourceFiles, basePath, context, transform) {
|
|
47
51
|
// run and track changed components
|
|
48
52
|
const analysis = new Map();
|
|
49
53
|
for (const sourceFile of sourceFiles) {
|
|
@@ -61,7 +65,7 @@ async function migrateTs(tree, sourceFiles, basePath, context, migrationData) {
|
|
|
61
65
|
for (const { start, end } of ranges) {
|
|
62
66
|
const template = content.slice(start, end);
|
|
63
67
|
const length = (end ?? content.length) - start;
|
|
64
|
-
const { fileContent, changed, errors } = await
|
|
68
|
+
const { fileContent, changed, errors } = await transform(template, relativePath);
|
|
65
69
|
if (changed) {
|
|
66
70
|
update.remove(start, length);
|
|
67
71
|
update.insertLeft(start, fileContent);
|
|
@@ -73,6 +77,17 @@ async function migrateTs(tree, sourceFiles, basePath, context, migrationData) {
|
|
|
73
77
|
tree.commitUpdate(update);
|
|
74
78
|
}
|
|
75
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Update typescript file if classes with @Component decorator and `template` property exists
|
|
82
|
+
* @param tree
|
|
83
|
+
* @param sourceFiles
|
|
84
|
+
* @param basePath
|
|
85
|
+
* @param context
|
|
86
|
+
* @param migrationData
|
|
87
|
+
*/
|
|
88
|
+
async function migrateTs(tree, sourceFiles, basePath, context, migrationData) {
|
|
89
|
+
return migrateTsWithTransform(tree, sourceFiles, basePath, context, (template, fileName) => transformTemplateAttributes(template, fileName, migrationData));
|
|
90
|
+
}
|
|
76
91
|
/**
|
|
77
92
|
* Analyzes the decorators of a given class declaration to find and save
|
|
78
93
|
* inline `template` metadata within `@Component` decorators.
|
|
@@ -122,6 +137,7 @@ async function transformTemplateAttributes(template, fileName, migrationData) {
|
|
|
122
137
|
if (parsed.tree !== undefined) {
|
|
123
138
|
const visitor = new utils_typescript.ElementCollector(migrationData, fileName);
|
|
124
139
|
utils_ast.visitAll(visitor, parsed.tree.rootNodes);
|
|
140
|
+
let didReplace = false;
|
|
125
141
|
for (const el of visitor.elementsToMigrate) {
|
|
126
142
|
const migrationAttr = el.attrs.find((attr) => utils_ast.getSimpleAttributeName(attr.name) === migrationData.attrs.key.from);
|
|
127
143
|
let updatedAttrValue;
|
|
@@ -132,7 +148,14 @@ async function transformTemplateAttributes(template, fileName, migrationData) {
|
|
|
132
148
|
updatedAttrValue = replacement.to;
|
|
133
149
|
}
|
|
134
150
|
else {
|
|
135
|
-
|
|
151
|
+
// A bound attribute (`[panelWidth]="..."`) whose value isn't a quoted string
|
|
152
|
+
// literal is a genuine runtime expression and can't be resolved statically. A
|
|
153
|
+
// plain attribute, or a bound attribute holding a quoted literal, has a known
|
|
154
|
+
// value at migration time — it's just one the replacement table doesn't cover.
|
|
155
|
+
const isDynamicExpression = migrationAttr.name.startsWith('[') && !/^\s*['"].*['"]\s*$/.test(migrationAttr.value);
|
|
156
|
+
console.warn(isDynamicExpression
|
|
157
|
+
? `Element is using a dynamic value. Check the code and change value on your own.${(fileName && ' File: ' + fileName) || ''}`
|
|
158
|
+
: `Element has value "${cleanAttrValue}" with no matching replacement. Check the code and change value on your own.${(fileName && ' File: ' + fileName) || ''}`);
|
|
136
159
|
continue;
|
|
137
160
|
}
|
|
138
161
|
updatedTemplate =
|
|
@@ -141,13 +164,17 @@ async function transformTemplateAttributes(template, fileName, migrationData) {
|
|
|
141
164
|
updatedTemplate.slice(migrationAttr.valueSpan.end.offset + 1 - offset, updatedTemplate.length);
|
|
142
165
|
offset += migrationAttr.name.length - migrationData.attrs.key.to.length;
|
|
143
166
|
offset += migrationAttr.value.length - updatedAttrValue.length;
|
|
167
|
+
didReplace = true;
|
|
144
168
|
}
|
|
145
169
|
}
|
|
146
|
-
return { fileContent: updatedTemplate, changed:
|
|
170
|
+
return { fileContent: updatedTemplate, changed: didReplace, errors: parsed.errors };
|
|
147
171
|
}
|
|
148
172
|
return { fileContent: updatedTemplate, changed: undefined, errors: parsed.errors };
|
|
149
173
|
}
|
|
150
174
|
|
|
151
175
|
exports.analyzeDecorators = analyzeDecorators;
|
|
152
176
|
exports.migrateTemplate = migrateTemplate;
|
|
177
|
+
exports.migrateTemplateWithTransform = migrateTemplateWithTransform;
|
|
153
178
|
exports.migrateTs = migrateTs;
|
|
179
|
+
exports.migrateTsWithTransform = migrateTsWithTransform;
|
|
180
|
+
exports.transformTemplateAttributes = transformTemplateAttributes;
|
package/schematics/utils/ast.js
CHANGED
|
@@ -22,7 +22,38 @@ function getSimpleAttributeName(attrName) {
|
|
|
22
22
|
function getSimpleAttributeValue(attrValue) {
|
|
23
23
|
return attrValue.replace(/[{}']/g, '');
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Splits a whitespace-separated token list (an HTML `class` attribute value, or a bare
|
|
27
|
+
* `'custom-icons word-wrap_16'`-style string), replacing only tokens for which `lookup` returns a
|
|
28
|
+
* value. A `''`/`null` result drops the token; `undefined` leaves it untouched. Tokens are
|
|
29
|
+
* rejoined with single spaces. Returns `undefined` if no token was touched.
|
|
30
|
+
*/
|
|
31
|
+
function replaceTokenList(value, lookup) {
|
|
32
|
+
const tokens = value.split(/\s+/).filter(Boolean);
|
|
33
|
+
let changed = false;
|
|
34
|
+
const result = tokens
|
|
35
|
+
.map((token) => {
|
|
36
|
+
const replacement = lookup(token);
|
|
37
|
+
if (replacement === undefined) {
|
|
38
|
+
return token;
|
|
39
|
+
}
|
|
40
|
+
changed = true;
|
|
41
|
+
return replacement;
|
|
42
|
+
})
|
|
43
|
+
.filter((token) => !!token);
|
|
44
|
+
return changed ? result.join(' ') : undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* If `simpleAttrName` (already stripped of `[`/`]` binding brackets via `getSimpleAttributeName`)
|
|
48
|
+
* is a `class.<token>` binding, returns `<token>`; otherwise `undefined`.
|
|
49
|
+
*/
|
|
50
|
+
function getClassBindingToken(simpleAttrName) {
|
|
51
|
+
const match = /^class\.(.+)$/.exec(simpleAttrName);
|
|
52
|
+
return match ? match[1] : undefined;
|
|
53
|
+
}
|
|
25
54
|
|
|
55
|
+
exports.getClassBindingToken = getClassBindingToken;
|
|
26
56
|
exports.getSimpleAttributeName = getSimpleAttributeName;
|
|
27
57
|
exports.getSimpleAttributeValue = getSimpleAttributeValue;
|
|
58
|
+
exports.replaceTokenList = replaceTokenList;
|
|
28
59
|
exports.visitAll = visitAll;
|