@ui5/webcomponents-ngx 0.0.1-rc.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/README.md +3 -0
- package/esm2020/fiori/directives/bar.mjs +36 -0
- package/esm2020/fiori/directives/barcode-scanner-dialog.mjs +35 -0
- package/esm2020/fiori/directives/dynamic-side-content.mjs +80 -0
- package/esm2020/fiori/directives/filter-item-option.mjs +38 -0
- package/esm2020/fiori/directives/filter-item.mjs +33 -0
- package/esm2020/fiori/directives/flexible-column-layout.mjs +107 -0
- package/esm2020/fiori/directives/illustrated-message.mjs +68 -0
- package/esm2020/fiori/directives/media-gallery-item.mjs +49 -0
- package/esm2020/fiori/directives/media-gallery.mjs +72 -0
- package/esm2020/fiori/directives/notification-action.mjs +54 -0
- package/esm2020/fiori/directives/notification-list-group-item.mjs +104 -0
- package/esm2020/fiori/directives/notification-list-item-base.mjs +85 -0
- package/esm2020/fiori/directives/notification-list-item.mjs +99 -0
- package/esm2020/fiori/directives/page.mjs +60 -0
- package/esm2020/fiori/directives/product-switch-item.mjs +66 -0
- package/esm2020/fiori/directives/product-switch.mjs +22 -0
- package/esm2020/fiori/directives/shell-bar-item.mjs +50 -0
- package/esm2020/fiori/directives/shell-bar.mjs +171 -0
- package/esm2020/fiori/directives/side-navigation-item.mjs +62 -0
- package/esm2020/fiori/directives/side-navigation-sub-item.mjs +46 -0
- package/esm2020/fiori/directives/side-navigation.mjs +40 -0
- package/esm2020/fiori/directives/sort-item.mjs +38 -0
- package/esm2020/fiori/directives/timeline-item.mjs +66 -0
- package/esm2020/fiori/directives/timeline.mjs +38 -0
- package/esm2020/fiori/directives/upload-collection-item.mjs +124 -0
- package/esm2020/fiori/directives/upload-collection.mjs +75 -0
- package/esm2020/fiori/directives/view-settings-dialog.mjs +52 -0
- package/esm2020/fiori/directives/wizard-step.mjs +70 -0
- package/esm2020/fiori/directives/wizard.mjs +26 -0
- package/esm2020/fiori/ui5-fiori.module.mjs +134 -0
- package/esm2020/generic-cva.mjs +41 -0
- package/esm2020/index.mjs +114 -0
- package/esm2020/main/directives/avatar-group.mjs +56 -0
- package/esm2020/main/directives/avatar.mjs +81 -0
- package/esm2020/main/directives/badge.mjs +33 -0
- package/esm2020/main/directives/breadcrumbs-item.mjs +46 -0
- package/esm2020/main/directives/breadcrumbs.mjs +42 -0
- package/esm2020/main/directives/busy-indicator.mjs +54 -0
- package/esm2020/main/directives/button.mjs +98 -0
- package/esm2020/main/directives/calendar-date.mjs +30 -0
- package/esm2020/main/directives/calendar.mjs +88 -0
- package/esm2020/main/directives/card-header.mjs +64 -0
- package/esm2020/main/directives/card.mjs +41 -0
- package/esm2020/main/directives/carousel.mjs +85 -0
- package/esm2020/main/directives/check-box.mjs +154 -0
- package/esm2020/main/directives/color-palette-item.mjs +30 -0
- package/esm2020/main/directives/color-palette-popover.mjs +67 -0
- package/esm2020/main/directives/color-palette.mjs +26 -0
- package/esm2020/main/directives/color-picker.mjs +34 -0
- package/esm2020/main/directives/combo-box-group-item.mjs +30 -0
- package/esm2020/main/directives/combo-box-item.mjs +38 -0
- package/esm2020/main/directives/combo-box.mjs +158 -0
- package/esm2020/main/directives/custom-list-item.mjs +53 -0
- package/esm2020/main/directives/date-picker.mjs +242 -0
- package/esm2020/main/directives/date-range-picker.mjs +274 -0
- package/esm2020/main/directives/date-time-picker.mjs +242 -0
- package/esm2020/main/directives/day-picker.mjs +111 -0
- package/esm2020/main/directives/dialog.mjs +160 -0
- package/esm2020/main/directives/file-uploader.mjs +141 -0
- package/esm2020/main/directives/group-header-list-item.mjs +38 -0
- package/esm2020/main/directives/icon.mjs +62 -0
- package/esm2020/main/directives/input.mjs +210 -0
- package/esm2020/main/directives/label.mjs +54 -0
- package/esm2020/main/directives/link.mjs +98 -0
- package/esm2020/main/directives/list.mjs +146 -0
- package/esm2020/main/directives/menu-item.mjs +70 -0
- package/esm2020/main/directives/menu.mjs +40 -0
- package/esm2020/main/directives/message-strip.mjs +53 -0
- package/esm2020/main/directives/month-picker.mjs +95 -0
- package/esm2020/main/directives/multi-combo-box-group-item.mjs +30 -0
- package/esm2020/main/directives/multi-combo-box-item.mjs +46 -0
- package/esm2020/main/directives/multi-combo-box.mjs +177 -0
- package/esm2020/main/directives/multi-input.mjs +227 -0
- package/esm2020/main/directives/option.mjs +62 -0
- package/esm2020/main/directives/panel.mjs +85 -0
- package/esm2020/main/directives/popover.mjs +192 -0
- package/esm2020/main/directives/progress-indicator.mjs +62 -0
- package/esm2020/main/directives/radio-button.mjs +154 -0
- package/esm2020/main/directives/range-slider.mjs +195 -0
- package/esm2020/main/directives/rating-indicator.mjs +66 -0
- package/esm2020/main/directives/responsive-popover.mjs +192 -0
- package/esm2020/main/directives/segmented-button-item.mjs +106 -0
- package/esm2020/main/directives/segmented-button.mjs +42 -0
- package/esm2020/main/directives/select.mjs +85 -0
- package/esm2020/main/directives/slider-base.mjs +135 -0
- package/esm2020/main/directives/slider.mjs +183 -0
- package/esm2020/main/directives/split-button.mjs +69 -0
- package/esm2020/main/directives/standard-list-item.mjs +101 -0
- package/esm2020/main/directives/step-input.mjs +133 -0
- package/esm2020/main/directives/suggestion-group-item.mjs +30 -0
- package/esm2020/main/directives/suggestion-item.mjs +86 -0
- package/esm2020/main/directives/switch.mjs +130 -0
- package/esm2020/main/directives/tab-container.mjs +96 -0
- package/esm2020/main/directives/tab-separator.mjs +25 -0
- package/esm2020/main/directives/tab.mjs +76 -0
- package/esm2020/main/directives/table-cell.mjs +22 -0
- package/esm2020/main/directives/table-column.mjs +46 -0
- package/esm2020/main/directives/table-group-row.mjs +22 -0
- package/esm2020/main/directives/table-row.mjs +46 -0
- package/esm2020/main/directives/table.mjs +126 -0
- package/esm2020/main/directives/text-area.mjs +144 -0
- package/esm2020/main/directives/time-picker.mjs +143 -0
- package/esm2020/main/directives/title.mjs +38 -0
- package/esm2020/main/directives/toast.mjs +41 -0
- package/esm2020/main/directives/toggle-button.mjs +106 -0
- package/esm2020/main/directives/token.mjs +53 -0
- package/esm2020/main/directives/tree-item-custom.mjs +115 -0
- package/esm2020/main/directives/tree-item.mjs +120 -0
- package/esm2020/main/directives/tree.mjs +104 -0
- package/esm2020/main/directives/wheel-slider.mjs +62 -0
- package/esm2020/main/directives/year-picker.mjs +95 -0
- package/esm2020/main/ui5-main.module.mjs +376 -0
- package/esm2020/main/ui5-webcomponents-theming.module.mjs +21 -0
- package/esm2020/main/ui5-webcomponents-theming.service.mjs +34 -0
- package/esm2020/ui5-angular.module.mjs +22 -0
- package/esm2020/ui5-webcomponents-ngx.mjs +5 -0
- package/fesm2015/ui5-webcomponents-ngx.mjs +9375 -0
- package/fesm2015/ui5-webcomponents-ngx.mjs.map +1 -0
- package/fesm2020/ui5-webcomponents-ngx.mjs +9368 -0
- package/fesm2020/ui5-webcomponents-ngx.mjs.map +1 -0
- package/fiori/directives/bar.d.ts +20 -0
- package/fiori/directives/barcode-scanner-dialog.d.ts +33 -0
- package/fiori/directives/dynamic-side-content.d.ts +49 -0
- package/fiori/directives/filter-item-option.d.ts +19 -0
- package/fiori/directives/filter-item.d.ts +19 -0
- package/fiori/directives/flexible-column-layout.d.ts +63 -0
- package/fiori/directives/illustrated-message.d.ts +32 -0
- package/fiori/directives/media-gallery-item.d.ts +24 -0
- package/fiori/directives/media-gallery.d.ts +43 -0
- package/fiori/directives/notification-action.d.ts +25 -0
- package/fiori/directives/notification-list-group-item.d.ts +54 -0
- package/fiori/directives/notification-list-item-base.d.ts +46 -0
- package/fiori/directives/notification-list-item.d.ts +54 -0
- package/fiori/directives/page.d.ts +30 -0
- package/fiori/directives/product-switch-item.d.ts +37 -0
- package/fiori/directives/product-switch.d.ts +13 -0
- package/fiori/directives/shell-bar-item.d.ts +33 -0
- package/fiori/directives/shell-bar.d.ts +106 -0
- package/fiori/directives/side-navigation-item.d.ts +28 -0
- package/fiori/directives/side-navigation-sub-item.d.ts +22 -0
- package/fiori/directives/side-navigation.d.ts +32 -0
- package/fiori/directives/sort-item.d.ts +19 -0
- package/fiori/directives/timeline-item.d.ts +37 -0
- package/fiori/directives/timeline.d.ts +19 -0
- package/fiori/directives/upload-collection-item.d.ts +65 -0
- package/fiori/directives/upload-collection.d.ts +49 -0
- package/fiori/directives/view-settings-dialog.d.ts +51 -0
- package/fiori/directives/wizard-step.d.ts +31 -0
- package/fiori/directives/wizard.d.ts +26 -0
- package/fiori/ui5-fiori.module.d.ts +36 -0
- package/generic-cva.d.ts +27 -0
- package/index.d.ts +113 -0
- package/main/directives/avatar-group.d.ts +38 -0
- package/main/directives/avatar.d.ts +36 -0
- package/main/directives/badge.d.ts +19 -0
- package/main/directives/breadcrumbs-item.d.ts +22 -0
- package/main/directives/breadcrumbs.d.ts +34 -0
- package/main/directives/busy-indicator.d.ts +25 -0
- package/main/directives/button.d.ts +53 -0
- package/main/directives/calendar-date.d.ts +16 -0
- package/main/directives/calendar.d.ts +50 -0
- package/main/directives/card-header.d.ts +38 -0
- package/main/directives/card.d.ts +21 -0
- package/main/directives/carousel.d.ts +47 -0
- package/main/directives/check-box.d.ts +62 -0
- package/main/directives/color-palette-item.d.ts +16 -0
- package/main/directives/color-palette-popover.d.ts +42 -0
- package/main/directives/color-palette.d.ts +24 -0
- package/main/directives/color-picker.d.ts +25 -0
- package/main/directives/combo-box-group-item.d.ts +16 -0
- package/main/directives/combo-box-item.d.ts +19 -0
- package/main/directives/combo-box.d.ts +70 -0
- package/main/directives/custom-list-item.d.ts +34 -0
- package/main/directives/date-picker.d.ts +115 -0
- package/main/directives/date-range-picker.d.ts +127 -0
- package/main/directives/date-time-picker.d.ts +115 -0
- package/main/directives/day-picker.d.ts +60 -0
- package/main/directives/dialog.d.ts +90 -0
- package/main/directives/file-uploader.d.ts +60 -0
- package/main/directives/group-header-list-item.d.ts +19 -0
- package/main/directives/icon.d.ts +28 -0
- package/main/directives/input.d.ts +98 -0
- package/main/directives/label.d.ts +25 -0
- package/main/directives/link.d.ts +57 -0
- package/main/directives/list.d.ts +85 -0
- package/main/directives/menu-item.d.ts +31 -0
- package/main/directives/menu.d.ts +32 -0
- package/main/directives/message-strip.d.ts +34 -0
- package/main/directives/month-picker.d.ts +54 -0
- package/main/directives/multi-combo-box-group-item.d.ts +16 -0
- package/main/directives/multi-combo-box-item.d.ts +22 -0
- package/main/directives/multi-combo-box.d.ts +78 -0
- package/main/directives/multi-input.d.ts +110 -0
- package/main/directives/option.d.ts +28 -0
- package/main/directives/panel.d.ts +45 -0
- package/main/directives/popover.d.ts +102 -0
- package/main/directives/progress-indicator.d.ts +28 -0
- package/main/directives/radio-button.d.ts +62 -0
- package/main/directives/range-slider.d.ts +89 -0
- package/main/directives/rating-indicator.d.ts +37 -0
- package/main/directives/responsive-popover.d.ts +102 -0
- package/main/directives/segmented-button-item.d.ts +52 -0
- package/main/directives/segmented-button.d.ts +31 -0
- package/main/directives/select.d.ts +48 -0
- package/main/directives/slider-base.d.ts +76 -0
- package/main/directives/slider.d.ts +86 -0
- package/main/directives/split-button.d.ts +39 -0
- package/main/directives/standard-list-item.d.ts +52 -0
- package/main/directives/step-input.d.ts +63 -0
- package/main/directives/suggestion-group-item.d.ts +16 -0
- package/main/directives/suggestion-item.d.ts +37 -0
- package/main/directives/switch.d.ts +53 -0
- package/main/directives/tab-container.d.ts +56 -0
- package/main/directives/tab-separator.d.ts +15 -0
- package/main/directives/tab.d.ts +36 -0
- package/main/directives/table-cell.d.ts +13 -0
- package/main/directives/table-column.d.ts +22 -0
- package/main/directives/table-group-row.d.ts +13 -0
- package/main/directives/table-row.d.ts +22 -0
- package/main/directives/table.d.ts +71 -0
- package/main/directives/text-area.d.ts +68 -0
- package/main/directives/time-picker.d.ts +64 -0
- package/main/directives/title.d.ts +19 -0
- package/main/directives/toast.d.ts +21 -0
- package/main/directives/toggle-button.d.ts +52 -0
- package/main/directives/token.d.ts +34 -0
- package/main/directives/tree-item-custom.d.ts +59 -0
- package/main/directives/tree-item.d.ts +60 -0
- package/main/directives/tree.d.ts +74 -0
- package/main/directives/wheel-slider.d.ts +28 -0
- package/main/directives/year-picker.d.ts +54 -0
- package/main/ui5-main.module.d.ts +86 -0
- package/main/ui5-webcomponents-theming.module.d.ts +9 -0
- package/main/ui5-webcomponents-theming.service.d.ts +16 -0
- package/package.json +51 -0
- package/schematics/add-dependencies/index.d.ts +3 -0
- package/schematics/add-dependencies/index.js +31 -0
- package/schematics/add-dependencies/index.js.map +1 -0
- package/schematics/add-dependencies/index.ts +24 -0
- package/schematics/add-dependencies/schema.json +15 -0
- package/schematics/add-styles/index.d.ts +3 -0
- package/schematics/add-styles/index.js +38 -0
- package/schematics/add-styles/index.js.map +1 -0
- package/schematics/add-styles/index.ts +34 -0
- package/schematics/add-styles/schema.json +15 -0
- package/schematics/add-theming/index.d.ts +5 -0
- package/schematics/add-theming/index.js +91 -0
- package/schematics/add-theming/index.js.map +1 -0
- package/schematics/add-theming/index.ts +116 -0
- package/schematics/add-theming/schema.json +15 -0
- package/schematics/collection.json +34 -0
- package/schematics/ng-add/available-themes.d.ts +4 -0
- package/schematics/ng-add/available-themes.js +38 -0
- package/schematics/ng-add/available-themes.js.map +1 -0
- package/schematics/ng-add/available-themes.ts +34 -0
- package/schematics/ng-add/common-css-parts.d.ts +4 -0
- package/schematics/ng-add/common-css-parts.js +46 -0
- package/schematics/ng-add/common-css-parts.js.map +1 -0
- package/schematics/ng-add/common-css-parts.ts +42 -0
- package/schematics/ng-add/index.d.ts +4 -0
- package/schematics/ng-add/index.js +93 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/index.ts +92 -0
- package/schematics/ng-add/schema.json +16 -0
- package/schematics/schema.d.ts +6 -0
- package/schematics/schema.js +3 -0
- package/schematics/schema.js.map +1 -0
- package/schematics/schema.ts +6 -0
- package/schematics/types.d.ts +1 -0
- package/schematics/utils/package-config.d.ts +5 -0
- package/schematics/utils/package-config.js +45 -0
- package/schematics/utils/package-config.js.map +1 -0
- package/schematics/utils/package-config.ts +55 -0
- package/schematics/utils/promt.d.ts +1 -0
- package/schematics/utils/promt.js +22 -0
- package/schematics/utils/promt.js.map +1 -0
- package/schematics/utils/promt.ts +6 -0
- package/ui5-angular.module.d.ts +10 -0
- package/ui5-webcomponents-ngx-v0.0.1-rc.0.tgz +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.addStyles = void 0;
|
|
13
|
+
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
14
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
15
|
+
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
16
|
+
function addStyles(options) {
|
|
17
|
+
return (_, context) => (0, workspace_1.updateWorkspace)((workspace) => __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
var _a;
|
|
19
|
+
const currentWorkspace = workspace.projects.get(options.project);
|
|
20
|
+
if (!currentWorkspace) {
|
|
21
|
+
throw new schematics_1.SchematicsException('Project with such name not found.');
|
|
22
|
+
}
|
|
23
|
+
const buildTargetOptions = (_a = currentWorkspace.targets.get('build')) === null || _a === void 0 ? void 0 : _a.options;
|
|
24
|
+
if (!buildTargetOptions) {
|
|
25
|
+
throw new schematics_1.SchematicsException('Could not find build target options for defined project.');
|
|
26
|
+
}
|
|
27
|
+
let styles = buildTargetOptions['styles'];
|
|
28
|
+
styles = styles.filter(style => (typeof style === 'string' && !style.startsWith('node_modules/@fundamental-styles/common-css') ||
|
|
29
|
+
typeof style !== 'string' && !style.input.startsWith('node_modules/@fundamental-styles/common-css')));
|
|
30
|
+
options.commonCss.forEach((style) => {
|
|
31
|
+
styles.push(`node_modules/@fundamental-styles/common-css/dist/${style}.css`);
|
|
32
|
+
});
|
|
33
|
+
buildTargetOptions['styles'] = styles;
|
|
34
|
+
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
exports.addStyles = addStyles;
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui5-angular/schematics/add-styles/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qEAAwE;AACxE,2DAAuE;AACvE,4DAA0E;AAG1E,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,2BAAe,EAAC,CAAO,SAAS,EAAE,EAAE;;QAEzD,MAAM,gBAAgB,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAEjE,IAAI,CAAC,gBAAgB,EAAE;YACrB,MAAM,IAAI,gCAAmB,CAAC,mCAAmC,CAAC,CAAC;SACpE;QAED,MAAM,kBAAkB,GAAG,MAAA,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,0CAAE,OAAO,CAAC;QAE1E,IAAI,CAAC,kBAAkB,EAAE;YACvB,MAAM,IAAI,gCAAmB,CAAC,0DAA0D,CAAC,CAAC;SAC3F;QAED,IAAI,MAAM,GAAG,kBAAkB,CAAC,QAAQ,CAAmC,CAAC;QAE5E,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,6CAA6C,CAAC;YAC9H,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,6CAA6C,CAAC,CAAC,CAAC,CAAC;QAEtG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAClC,MAAM,CAAC,IAAI,CAAC,oDAAoD,KAAK,MAAM,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;QAEH,kBAAkB,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;QAEtC,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;IAChD,CAAC,CAAA,CAAC,CAAC;AACL,CAAC;AA5BD,8BA4BC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { updateWorkspace } from '@schematics/angular/utility/workspace';
|
|
2
|
+
import { Rule, SchematicsException } from '@angular-devkit/schematics';
|
|
3
|
+
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
|
|
4
|
+
import { Schema } from '../schema';
|
|
5
|
+
|
|
6
|
+
export function addStyles(options: Schema): Rule {
|
|
7
|
+
return (_, context) => updateWorkspace(async (workspace) => {
|
|
8
|
+
|
|
9
|
+
const currentWorkspace = workspace.projects.get(options.project);
|
|
10
|
+
|
|
11
|
+
if (!currentWorkspace) {
|
|
12
|
+
throw new SchematicsException('Project with such name not found.');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const buildTargetOptions = currentWorkspace.targets.get('build')?.options;
|
|
16
|
+
|
|
17
|
+
if (!buildTargetOptions) {
|
|
18
|
+
throw new SchematicsException('Could not find build target options for defined project.');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let styles = buildTargetOptions['styles'] as (string | { input: string })[];
|
|
22
|
+
|
|
23
|
+
styles = styles.filter(style => (typeof style === 'string' && !style.startsWith('node_modules/@fundamental-styles/common-css') ||
|
|
24
|
+
typeof style !== 'string' && !style.input.startsWith('node_modules/@fundamental-styles/common-css')));
|
|
25
|
+
|
|
26
|
+
options.commonCss.forEach((style) => {
|
|
27
|
+
styles.push(`node_modules/@fundamental-styles/common-css/dist/${style}.css`);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
buildTargetOptions['styles'] = styles;
|
|
31
|
+
|
|
32
|
+
context.addTask(new NodePackageInstallTask());
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "add-styles-schematic",
|
|
4
|
+
"title": "Adds styles",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"project": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the project.",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "projectName"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Rule, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import * as ts from 'typescript';
|
|
3
|
+
import { Schema } from '../schema';
|
|
4
|
+
export declare function addTheming(options: Schema): Rule;
|
|
5
|
+
export declare function getSourceFile(host: Tree, path: string): ts.SourceFile;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getSourceFile = exports.addTheming = void 0;
|
|
13
|
+
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
14
|
+
const ng_ast_utils_1 = require("@schematics/angular/utility/ng-ast-utils");
|
|
15
|
+
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
16
|
+
const change_1 = require("@schematics/angular/utility/change");
|
|
17
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
18
|
+
const ts = require("typescript");
|
|
19
|
+
function addTheming(options) {
|
|
20
|
+
return (tree, context) => (0, workspace_1.updateWorkspace)((workspace) => __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
var _a;
|
|
22
|
+
if (!options.theming) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const currentWorkspace = workspace.projects.get(options.project);
|
|
26
|
+
if (!currentWorkspace) {
|
|
27
|
+
throw new schematics_1.SchematicsException('Project with such name not found.');
|
|
28
|
+
}
|
|
29
|
+
const buildTargetOptions = (_a = currentWorkspace.targets.get('build')) === null || _a === void 0 ? void 0 : _a.options;
|
|
30
|
+
if (!buildTargetOptions) {
|
|
31
|
+
throw new schematics_1.SchematicsException('Could not find build target options for defined project.');
|
|
32
|
+
}
|
|
33
|
+
const rootModule = (0, ng_ast_utils_1.getAppModulePath)(tree, buildTargetOptions['main']);
|
|
34
|
+
if (!rootModule) {
|
|
35
|
+
throw new schematics_1.SchematicsException('Could not find root module for defined project.');
|
|
36
|
+
}
|
|
37
|
+
const appModuleSource = getSourceFile(tree, rootModule);
|
|
38
|
+
const themingModule = getModuleDeclaration(appModuleSource, 'Ui5ThemingModule');
|
|
39
|
+
if (themingModule) {
|
|
40
|
+
themingModule.getChildren(appModuleSource);
|
|
41
|
+
const themingModuleDecl = themingModule.getFullText();
|
|
42
|
+
const appModuleContent = tree.readText(rootModule).split(themingModuleDecl).join(`\nUi5ThemingModule.forRoot({defaultTheme: '${options.defaultTheme}'})`);
|
|
43
|
+
tree.overwrite(rootModule, appModuleContent);
|
|
44
|
+
context.logger.info('Found previous Ui5ThemingModule. Replaced with new one.');
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const changes = [];
|
|
48
|
+
changes.push(...(0, ast_utils_1.addImportToModule)(appModuleSource, rootModule, `Ui5ThemingModule.forRoot({defaultTheme: '${options.defaultTheme}'})`, '@ui5/theming-ngx'));
|
|
49
|
+
const exportRecorder = tree.beginUpdate(rootModule);
|
|
50
|
+
for (const change of changes) {
|
|
51
|
+
if (change instanceof change_1.InsertChange) {
|
|
52
|
+
exportRecorder.insertLeft(change.pos, change.toAdd);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
tree.commitUpdate(exportRecorder);
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
exports.addTheming = addTheming;
|
|
59
|
+
// Gets the ts source file from a path
|
|
60
|
+
function getSourceFile(host, path) {
|
|
61
|
+
const buffer = host.read(path);
|
|
62
|
+
if (!buffer) {
|
|
63
|
+
throw new schematics_1.SchematicsException(`Could not find file for path: ${path}`);
|
|
64
|
+
}
|
|
65
|
+
const text = buffer.toString('utf-8');
|
|
66
|
+
return ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true);
|
|
67
|
+
}
|
|
68
|
+
exports.getSourceFile = getSourceFile;
|
|
69
|
+
/**
|
|
70
|
+
* Returns the RouterModule declaration from NgModule metadata, if any.
|
|
71
|
+
*/
|
|
72
|
+
function getModuleDeclaration(source, module) {
|
|
73
|
+
const result = (0, ast_utils_1.getDecoratorMetadata)(source, 'NgModule', '@angular/core');
|
|
74
|
+
const node = result[0];
|
|
75
|
+
if (!node || !ts.isObjectLiteralExpression(node)) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
const matchingProperties = (0, ast_utils_1.getMetadataField)(node, 'imports');
|
|
79
|
+
if (!matchingProperties) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const assignment = matchingProperties[0];
|
|
83
|
+
if (assignment.initializer.kind !== ts.SyntaxKind.ArrayLiteralExpression) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const arrLiteral = assignment.initializer;
|
|
87
|
+
return arrLiteral.elements
|
|
88
|
+
.filter((el) => el.kind === ts.SyntaxKind.CallExpression)
|
|
89
|
+
.find((el) => el.getText().startsWith(module));
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui5-angular/schematics/add-theming/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { updateWorkspace } from '@schematics/angular/utility/workspace';
|
|
2
|
+
import { getAppModulePath } from '@schematics/angular/utility/ng-ast-utils';
|
|
3
|
+
import {
|
|
4
|
+
getDecoratorMetadata,
|
|
5
|
+
getMetadataField,
|
|
6
|
+
addImportToModule,
|
|
7
|
+
} from '@schematics/angular/utility/ast-utils';
|
|
8
|
+
import { Change, InsertChange } from '@schematics/angular/utility/change';
|
|
9
|
+
import { Rule, SchematicsException, Tree } from '@angular-devkit/schematics';
|
|
10
|
+
import * as ts from 'typescript';
|
|
11
|
+
// import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
|
|
12
|
+
import { Schema } from '../schema';
|
|
13
|
+
|
|
14
|
+
export function addTheming(options: Schema): Rule {
|
|
15
|
+
return (tree, context) =>
|
|
16
|
+
updateWorkspace(async (workspace) => {
|
|
17
|
+
if (!options.theming) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const currentWorkspace = workspace.projects.get(options.project);
|
|
22
|
+
|
|
23
|
+
if (!currentWorkspace) {
|
|
24
|
+
throw new SchematicsException('Project with such name not found.');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const buildTargetOptions = currentWorkspace.targets.get('build')?.options;
|
|
28
|
+
|
|
29
|
+
if (!buildTargetOptions) {
|
|
30
|
+
throw new SchematicsException(
|
|
31
|
+
'Could not find build target options for defined project.'
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const rootModule = getAppModulePath(
|
|
36
|
+
tree,
|
|
37
|
+
buildTargetOptions['main'] as string
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
if (!rootModule) {
|
|
41
|
+
throw new SchematicsException(
|
|
42
|
+
'Could not find root module for defined project.'
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const appModuleSource = getSourceFile(tree, rootModule);
|
|
47
|
+
|
|
48
|
+
const themingModule = getModuleDeclaration(
|
|
49
|
+
appModuleSource,
|
|
50
|
+
'Ui5ThemingModule'
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
if (themingModule) {
|
|
54
|
+
themingModule.getChildren(appModuleSource);
|
|
55
|
+
const themingModuleDecl = themingModule.getFullText();
|
|
56
|
+
const appModuleContent = tree.readText(rootModule).split(themingModuleDecl).join(`\nUi5ThemingModule.forRoot({defaultTheme: '${options.defaultTheme}'})`);
|
|
57
|
+
tree.overwrite(rootModule, appModuleContent);
|
|
58
|
+
context.logger.info('Found previous Ui5ThemingModule. Replaced with new one.');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const changes: Change[] = [];
|
|
63
|
+
changes.push(
|
|
64
|
+
...addImportToModule(
|
|
65
|
+
appModuleSource,
|
|
66
|
+
rootModule,
|
|
67
|
+
`Ui5ThemingModule.forRoot({defaultTheme: '${options.defaultTheme}'})`,
|
|
68
|
+
'@ui5/theming-ngx'
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
const exportRecorder = tree.beginUpdate(rootModule);
|
|
72
|
+
|
|
73
|
+
for (const change of changes) {
|
|
74
|
+
if (change instanceof InsertChange) {
|
|
75
|
+
exportRecorder.insertLeft(change.pos, change.toAdd);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
tree.commitUpdate(exportRecorder);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Gets the ts source file from a path
|
|
84
|
+
export function getSourceFile(host: Tree, path: string): ts.SourceFile {
|
|
85
|
+
const buffer = host.read(path);
|
|
86
|
+
if (!buffer) {
|
|
87
|
+
throw new SchematicsException(`Could not find file for path: ${path}`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const text = buffer.toString('utf-8');
|
|
91
|
+
|
|
92
|
+
return ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Returns the RouterModule declaration from NgModule metadata, if any.
|
|
97
|
+
*/
|
|
98
|
+
function getModuleDeclaration(source: ts.SourceFile, module: string): ts.Expression | undefined {
|
|
99
|
+
const result = getDecoratorMetadata(source, 'NgModule', '@angular/core');
|
|
100
|
+
const node = result[0];
|
|
101
|
+
if (!node || !ts.isObjectLiteralExpression(node)) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
const matchingProperties = getMetadataField(node, 'imports');
|
|
105
|
+
if (!matchingProperties) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const assignment = matchingProperties[0] as any;
|
|
109
|
+
if (assignment.initializer.kind !== ts.SyntaxKind.ArrayLiteralExpression) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const arrLiteral = assignment.initializer;
|
|
113
|
+
return arrLiteral.elements
|
|
114
|
+
.filter((el: any) => el.kind === ts.SyntaxKind.CallExpression)
|
|
115
|
+
.find((el: any) => el.getText().startsWith(module));
|
|
116
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "add-theming-schematic",
|
|
4
|
+
"title": "Adds theming",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"project": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the project.",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "projectName"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
+
"schematics": {
|
|
4
|
+
"ng-add": {
|
|
5
|
+
"description": "Adds @ui5/webcomponents-ngx to the project.",
|
|
6
|
+
"factory": "./ng-add/index#ngAdd",
|
|
7
|
+
"schema": "./ng-add/schema.json"
|
|
8
|
+
},
|
|
9
|
+
"proceed-with-schematics": {
|
|
10
|
+
"description": "Calls chain of schematics to update project configuration based on users preferences.",
|
|
11
|
+
"factory": "./ng-add/index#proceedWithSchematics",
|
|
12
|
+
"schema": "./ng-add/schema.json",
|
|
13
|
+
"private": true
|
|
14
|
+
},
|
|
15
|
+
"add-dependencies": {
|
|
16
|
+
"description": "Adds external libraries as a dependencies for styling and theming purposes.",
|
|
17
|
+
"factory": "./add-dependencies/index#addDependencies",
|
|
18
|
+
"schema": "./add-dependencies/schema.json",
|
|
19
|
+
"private": true
|
|
20
|
+
},
|
|
21
|
+
"add-styles": {
|
|
22
|
+
"description": "Adds @fundamental-styles/common-css packages to the angular application.",
|
|
23
|
+
"factory": "./add-styles/index#addStyles",
|
|
24
|
+
"schema": "./add-styles/schema.json",
|
|
25
|
+
"private": true
|
|
26
|
+
},
|
|
27
|
+
"add-theming": {
|
|
28
|
+
"description": "Adds theming capabilities to the angular application.",
|
|
29
|
+
"factory": "./add-theming/index#addTheming",
|
|
30
|
+
"schema": "./add-theming/schema.json",
|
|
31
|
+
"private": true
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AvailableThemes = void 0;
|
|
4
|
+
exports.AvailableThemes = [
|
|
5
|
+
{
|
|
6
|
+
value: 'sap_horizon',
|
|
7
|
+
name: 'Morning Horizon (Light)'
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
value: 'sap_horizon_dark',
|
|
11
|
+
name: 'Evening Horizon (Dark)'
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
value: 'sap_horizon_hcb',
|
|
15
|
+
name: 'Horizon High Contrast Black'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
value: 'sap_horizon_hcw',
|
|
19
|
+
name: 'Horizon High Contrast White'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: 'sap_fiori_3',
|
|
23
|
+
name: 'Quartz Light'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: 'sap_fiori_3_dark',
|
|
27
|
+
name: 'Quartz Dark'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: 'sap_fiori_3_hcb',
|
|
31
|
+
name: 'Quartz High Contrast Black'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: 'sap_fiori_3_hcw',
|
|
35
|
+
name: 'Quartz High Contrast White'
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
//# sourceMappingURL=available-themes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"available-themes.js","sourceRoot":"","sources":["../../../../../libs/ui5-angular/schematics/ng-add/available-themes.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;IAC7B;QACE,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,yBAAyB;KAChC;IACD;QACE,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,wBAAwB;KAC/B;IACD;QACE,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,6BAA6B;KACpC;IACD;QACE,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,6BAA6B;KACpC;IACD;QACE,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,cAAc;KACrB;IACD;QACE,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,aAAa;KACpB;IACD;QACE,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,4BAA4B;KACnC;IACD;QACE,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,4BAA4B;KACnC;CACF,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const AvailableThemes = [
|
|
2
|
+
{
|
|
3
|
+
value: 'sap_horizon',
|
|
4
|
+
name: 'Morning Horizon (Light)'
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
value: 'sap_horizon_dark',
|
|
8
|
+
name: 'Evening Horizon (Dark)'
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
value: 'sap_horizon_hcb',
|
|
12
|
+
name: 'Horizon High Contrast Black'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: 'sap_horizon_hcw',
|
|
16
|
+
name: 'Horizon High Contrast White'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: 'sap_fiori_3',
|
|
20
|
+
name: 'Quartz Light'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: 'sap_fiori_3_dark',
|
|
24
|
+
name: 'Quartz Dark'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: 'sap_fiori_3_hcb',
|
|
28
|
+
name: 'Quartz High Contrast Black'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: 'sap_fiori_3_hcw',
|
|
32
|
+
name: 'Quartz High Contrast White'
|
|
33
|
+
}
|
|
34
|
+
]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommonCssParts = void 0;
|
|
4
|
+
exports.CommonCssParts = [
|
|
5
|
+
{
|
|
6
|
+
value: 'sap-normalize',
|
|
7
|
+
name: 'Normalize CSS rules',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
value: 'sap-padding',
|
|
11
|
+
name: 'Padding presets',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
value: 'sap-typography',
|
|
15
|
+
name: 'General Typography styles',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
value: 'sap-elevation',
|
|
19
|
+
name: 'Varioious elevation presets',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: 'sap-shadow',
|
|
23
|
+
name: 'Varioous shadow presets',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: 'sap-display',
|
|
27
|
+
name: 'Various display presets',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: 'sap-margin',
|
|
31
|
+
name: 'Various margin presets',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: 'sap-flex',
|
|
35
|
+
name: 'Useful flex-related presets',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: 'sap-colors',
|
|
39
|
+
name: 'Various color presets',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: 'sap-border-radius',
|
|
43
|
+
name: 'Various border radius presets',
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
//# sourceMappingURL=common-css-parts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-css-parts.js","sourceRoot":"","sources":["../../../../../libs/ui5-angular/schematics/ng-add/common-css-parts.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B;QACE,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,qBAAqB;KAC5B;IACD;QACE,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,iBAAiB;KACxB;IACD;QACE,KAAK,EAAE,gBAAgB;QACvB,IAAI,EAAE,2BAA2B;KAClC;IACD;QACE,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,6BAA6B;KACpC;IACD;QACE,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,yBAAyB;KAChC;IACD;QACE,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,yBAAyB;KAChC;IACD;QACE,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,wBAAwB;KAC/B;IACD;QACE,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,6BAA6B;KACpC;IACD;QACE,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,uBAAuB;KAC9B;IACD;QACE,KAAK,EAAE,mBAAmB;QAC1B,IAAI,EAAE,+BAA+B;KACtC;CACF,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const CommonCssParts = [
|
|
2
|
+
{
|
|
3
|
+
value: 'sap-normalize',
|
|
4
|
+
name: 'Normalize CSS rules',
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
value: 'sap-padding',
|
|
8
|
+
name: 'Padding presets',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
value: 'sap-typography',
|
|
12
|
+
name: 'General Typography styles',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: 'sap-elevation',
|
|
16
|
+
name: 'Varioious elevation presets',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: 'sap-shadow',
|
|
20
|
+
name: 'Varioous shadow presets',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: 'sap-display',
|
|
24
|
+
name: 'Various display presets',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: 'sap-margin',
|
|
28
|
+
name: 'Various margin presets',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: 'sap-flex',
|
|
32
|
+
name: 'Useful flex-related presets',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: 'sap-colors',
|
|
36
|
+
name: 'Various color presets',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
value: 'sap-border-radius',
|
|
40
|
+
name: 'Various border radius presets',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.proceedWithSchematics = exports.ngAdd = void 0;
|
|
13
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
14
|
+
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
15
|
+
const promt_1 = require("../utils/promt");
|
|
16
|
+
const available_themes_1 = require("./available-themes");
|
|
17
|
+
const common_css_parts_1 = require("./common-css-parts");
|
|
18
|
+
function ngAdd(options) {
|
|
19
|
+
return (_, context) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const userConfig = yield collectConfig();
|
|
21
|
+
options = Object.assign(Object.assign({}, options), userConfig);
|
|
22
|
+
console.log(options);
|
|
23
|
+
// First, queue dependency installation task.
|
|
24
|
+
const dependenciesTaskId = context.addTask(new tasks_1.RunSchematicTask('add-dependencies', options));
|
|
25
|
+
// Wait for dependencies to be installed and proceed with main schematics.
|
|
26
|
+
context.addTask(new tasks_1.RunSchematicTask('proceed-with-schematics', options), [dependenciesTaskId]);
|
|
27
|
+
return (0, schematics_1.chain)([]);
|
|
28
|
+
// return tree;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
exports.ngAdd = ngAdd;
|
|
32
|
+
function collectConfig() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const schema = {
|
|
35
|
+
commonCss: [],
|
|
36
|
+
defaultTheme: 'sap_horizon'
|
|
37
|
+
};
|
|
38
|
+
const includeCommonCss = yield askCommonCssDependency();
|
|
39
|
+
if (includeCommonCss) {
|
|
40
|
+
schema.commonCss = yield askCommonCssParts();
|
|
41
|
+
}
|
|
42
|
+
schema.theming = yield askThemingDependency();
|
|
43
|
+
if (schema.theming) {
|
|
44
|
+
schema.defaultTheme = yield askDefaultTheme();
|
|
45
|
+
}
|
|
46
|
+
return schema;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function askCommonCssDependency() {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
return yield (0, promt_1.askQuestion)({
|
|
52
|
+
type: 'confirm',
|
|
53
|
+
message: 'Would you like to add Common CSS into your application?',
|
|
54
|
+
default: false,
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function askCommonCssParts() {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
return yield (0, promt_1.askQuestion)({
|
|
61
|
+
type: 'checkbox',
|
|
62
|
+
message: 'Please select desired Common CSS features',
|
|
63
|
+
choices: common_css_parts_1.CommonCssParts,
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function askThemingDependency() {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
return yield (0, promt_1.askQuestion)({
|
|
70
|
+
type: 'confirm',
|
|
71
|
+
message: 'Would you like to add Theming capabilities into your application?',
|
|
72
|
+
default: true,
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function askDefaultTheme() {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
return yield (0, promt_1.askQuestion)({
|
|
79
|
+
type: 'list',
|
|
80
|
+
message: 'Please select desired Common CSS features',
|
|
81
|
+
default: 'sap_horizon',
|
|
82
|
+
choices: available_themes_1.AvailableThemes,
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function proceedWithSchematics(options) {
|
|
87
|
+
return (0, schematics_1.chain)([
|
|
88
|
+
(0, schematics_1.schematic)('add-styles', options),
|
|
89
|
+
(0, schematics_1.schematic)('add-theming', options)
|
|
90
|
+
]);
|
|
91
|
+
}
|
|
92
|
+
exports.proceedWithSchematics = proceedWithSchematics;
|
|
93
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui5-angular/schematics/ng-add/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAMoC;AACpC,4DAAoE;AAEpE,0CAA6C;AAC7C,yDAAqD;AACrD,yDAAoD;AAEpD,SAAgB,KAAK,CAAC,OAAe;IACnC,OAAO,CAAO,CAAO,EAAE,OAAyB,EAAE,EAAE;QAClD,MAAM,UAAU,GAAG,MAAM,aAAa,EAAE,CAAC;QACzC,OAAO,mCAAQ,OAAO,GAAK,UAAU,CAAE,CAAC;QAExC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,6CAA6C;QAC7C,MAAM,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,wBAAgB,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC,CAAC;QAE9F,0EAA0E;QAC1E,OAAO,CAAC,OAAO,CAAC,IAAI,wBAAgB,CAAC,yBAAyB,EAAE,OAAO,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAEhG,OAAO,IAAA,kBAAK,EAAC,EAAE,CAAC,CAAC;QAEjB,eAAe;IACjB,CAAC,CAAA,CAAC;AACJ,CAAC;AAhBD,sBAgBC;AAED,SAAe,aAAa;;QAC1B,MAAM,MAAM,GAAoB;YAC9B,SAAS,EAAE,EAAE;YACb,YAAY,EAAE,aAAa;SAC5B,CAAC;QAEF,MAAM,gBAAgB,GAAG,MAAM,sBAAsB,EAAE,CAAC;QAExD,IAAI,gBAAgB,EAAE;YACpB,MAAM,CAAC,SAAS,GAAG,MAAM,iBAAiB,EAAE,CAAC;SAC9C;QAED,MAAM,CAAC,OAAO,GAAG,MAAM,oBAAoB,EAAE,CAAC;QAE9C,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,MAAM,CAAC,YAAY,GAAG,MAAM,eAAe,EAAE,CAAC;SAC/C;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AAED,SAAe,sBAAsB;;QACnC,OAAO,MAAM,IAAA,mBAAW,EAAC;YACvB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,yDAAyD;YAClE,OAAO,EAAE,KAAK;SACf,CAAC,CAAC;IACL,CAAC;CAAA;AAED,SAAe,iBAAiB;;QAC9B,OAAO,MAAM,IAAA,mBAAW,EAAC;YACvB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,2CAA2C;YACpD,OAAO,EAAE,iCAAc;SACxB,CAAC,CAAC;IACL,CAAC;CAAA;AAED,SAAe,oBAAoB;;QACjC,OAAO,MAAM,IAAA,mBAAW,EAAC;YACvB,IAAI,EAAE,SAAS;YACf,OAAO,EACL,mEAAmE;YACrE,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;IACL,CAAC;CAAA;AAED,SAAe,eAAe;;QAC5B,OAAO,MAAM,IAAA,mBAAW,EAAC;YACvB,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,2CAA2C;YACpD,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,kCAAe;SACzB,CAAC,CAAC;IACL,CAAC;CAAA;AAED,SAAgB,qBAAqB,CAAC,OAAe;IACjD,OAAO,IAAA,kBAAK,EAAC;QACT,IAAA,sBAAS,EAAC,YAAY,EAAE,OAAO,CAAC;QAChC,IAAA,sBAAS,EAAC,aAAa,EAAE,OAAO,CAAC;KACpC,CAAC,CAAC;AACP,CAAC;AALD,sDAKC"}
|