@spartan-ng/cli 1.2.0-beta.1 → 1.2.0-beta.3
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 +1 -0
- package/generators.json +10 -0
- package/package.json +1 -1
- package/src/generators/healthcheck/generator.js +2 -0
- package/src/generators/healthcheck/generator.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/hlm-date-picker-min-max.d.ts +2 -0
- package/src/generators/healthcheck/healthchecks/hlm-date-picker-min-max.js +37 -0
- package/src/generators/healthcheck/healthchecks/hlm-date-picker-min-max.js.map +1 -0
- package/src/generators/migrate-date-picker-min-max/compat.d.ts +5 -0
- package/src/generators/migrate-date-picker-min-max/compat.js +7 -0
- package/src/generators/migrate-date-picker-min-max/compat.js.map +1 -0
- package/src/generators/migrate-date-picker-min-max/generator.d.ts +4 -0
- package/src/generators/migrate-date-picker-min-max/generator.js +52 -0
- package/src/generators/migrate-date-picker-min-max/generator.js.map +1 -0
- package/src/generators/migrate-date-picker-min-max/schema.d.ts +4 -0
- package/src/generators/migrate-date-picker-min-max/schema.json +18 -0
- package/src/generators/migrate-helm-libraries/generator.js +31 -24
- package/src/generators/migrate-helm-libraries/generator.js.map +1 -1
- package/src/generators/migrate-helm-libraries/schema.d.ts +2 -0
- package/src/generators/migrate-helm-libraries/schema.json +7 -0
- package/src/generators/ui/libs/attachment/files/index.ts.template +31 -0
- package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-action.ts.template +15 -0
- package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-actions.ts.template +15 -0
- package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-content.ts.template +12 -0
- package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-description.ts.template +15 -0
- package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-group.ts.template +15 -0
- package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-media.ts.template +35 -0
- package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-title.ts.template +15 -0
- package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-trigger.ts.template +23 -0
- package/src/generators/ui/libs/attachment/files/lib/hlm-attachment.ts.template +47 -0
- package/src/generators/ui/libs/attachment/generator.d.ts +3 -0
- package/src/generators/ui/libs/attachment/generator.js +9 -0
- package/src/generators/ui/libs/attachment/generator.js.map +1 -0
- package/src/generators/ui/libs/bubble/files/index.ts.template +11 -0
- package/src/generators/ui/libs/bubble/files/lib/hlm-bubble-content.ts.template +15 -0
- package/src/generators/ui/libs/bubble/files/lib/hlm-bubble-group.ts.template +12 -0
- package/src/generators/ui/libs/bubble/files/lib/hlm-bubble-reactions.ts.template +43 -0
- package/src/generators/ui/libs/bubble/files/lib/hlm-bubble.ts.template +46 -0
- package/src/generators/ui/libs/bubble/generator.d.ts +3 -0
- package/src/generators/ui/libs/bubble/generator.js +9 -0
- package/src/generators/ui/libs/bubble/generator.js.map +1 -0
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-multi-input.ts.template +15 -1
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-picker-input.ts.template +15 -1
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-picker-multi.ts.template +4 -4
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-picker.ts.template +5 -5
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-range-input.ts.template +15 -1
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-range-picker.ts.template +4 -4
- package/src/generators/ui/libs/date-picker/files/lib/hlm-month-year-input.ts.template +15 -1
- package/src/generators/ui/libs/date-picker/files/lib/hlm-month-year-picker.ts.template +4 -4
- package/src/generators/ui/libs/marker/files/index.ts.template +9 -0
- package/src/generators/ui/libs/marker/files/lib/hlm-marker-content.ts.template +15 -0
- package/src/generators/ui/libs/marker/files/lib/hlm-marker-icon.ts.template +15 -0
- package/src/generators/ui/libs/marker/files/lib/hlm-marker.ts.template +36 -0
- package/src/generators/ui/libs/marker/generator.d.ts +3 -0
- package/src/generators/ui/libs/marker/generator.js +9 -0
- package/src/generators/ui/libs/marker/generator.js.map +1 -0
- package/src/generators/ui/libs/message/files/index.ts.template +22 -0
- package/src/generators/ui/libs/message/files/lib/hlm-message-avatar.ts.template +15 -0
- package/src/generators/ui/libs/message/files/lib/hlm-message-content.ts.template +15 -0
- package/src/generators/ui/libs/message/files/lib/hlm-message-footer.ts.template +15 -0
- package/src/generators/ui/libs/message/files/lib/hlm-message-group.ts.template +12 -0
- package/src/generators/ui/libs/message/files/lib/hlm-message-header.ts.template +14 -0
- package/src/generators/ui/libs/message/files/lib/hlm-message.ts.template +21 -0
- package/src/generators/ui/libs/message/generator.d.ts +3 -0
- package/src/generators/ui/libs/message/generator.js +9 -0
- package/src/generators/ui/libs/message/generator.js.map +1 -0
- package/src/generators/ui/libs/spinner/files/lib/hlm-spinner.ts.template +1 -0
- package/src/generators/ui/primitive-deps.js +4 -0
- package/src/generators/ui/primitive-deps.js.map +1 -1
- package/src/generators/ui/primitives.d.ts +1 -1
- package/src/generators/ui/style-luma.css +152 -0
- package/src/generators/ui/style-lyra.css +152 -0
- package/src/generators/ui/style-maia.css +152 -0
- package/src/generators/ui/style-mira.css +152 -0
- package/src/generators/ui/style-nova.css +152 -0
- package/src/generators/ui/style-vega.css +152 -0
- package/src/generators/ui/supported-ui-libraries.json +68 -41
package/README.md
CHANGED
|
@@ -66,6 +66,7 @@ The CLI ships with a suite of generators that automate breaking changes between
|
|
|
66
66
|
| `migrate-brn-switch-changed-event` | Rename `changed` to `checkedChange` on `brn-switch`. |
|
|
67
67
|
| `migrate-core` | Migrate the legacy `core` library to the `@spartan-ng/brain/core` entry point. |
|
|
68
68
|
| `migrate-date-picker` | Rename `changed` to `dateChange` on `hlm-date-picker`. |
|
|
69
|
+
| `migrate-date-picker-min-max` | Rename `min`/`max` inputs to `minDate`/`maxDate` on helm date pickers. |
|
|
69
70
|
| `migrate-helm-imports` | Move helm imports to the new entry-point structure. |
|
|
70
71
|
| `migrate-helm-libraries` | Update helm libraries to their latest versions. |
|
|
71
72
|
| `migrate-hlm` | Move `hlm` from `@spartan-ng/brain` to `@spartan-ng/helm/utils`. |
|
package/generators.json
CHANGED
|
@@ -50,6 +50,11 @@
|
|
|
50
50
|
"schema": "./src/generators/migrate-date-picker/schema.json",
|
|
51
51
|
"description": "Migrate hlm-date-picker changed event to dateChange"
|
|
52
52
|
},
|
|
53
|
+
"migrate-date-picker-min-max": {
|
|
54
|
+
"factory": "./src/generators/migrate-date-picker-min-max/generator",
|
|
55
|
+
"schema": "./src/generators/migrate-date-picker-min-max/schema.json",
|
|
56
|
+
"description": "Migrate hlm-date-picker min/max inputs to minDate/maxDate"
|
|
57
|
+
},
|
|
53
58
|
"migrate-helm-imports": {
|
|
54
59
|
"factory": "./src/generators/migrate-helm-imports/generator",
|
|
55
60
|
"schema": "./src/generators/migrate-helm-imports/schema.json",
|
|
@@ -177,6 +182,11 @@
|
|
|
177
182
|
"schema": "./src/generators/migrate-date-picker/schema.json",
|
|
178
183
|
"description": "Migrate hlm-date-picker changed event to dateChange"
|
|
179
184
|
},
|
|
185
|
+
"migrate-date-picker-min-max": {
|
|
186
|
+
"factory": "./src/generators/migrate-date-picker-min-max/compat",
|
|
187
|
+
"schema": "./src/generators/migrate-date-picker-min-max/schema.json",
|
|
188
|
+
"description": "Migrate hlm-date-picker min/max inputs to minDate/maxDate"
|
|
189
|
+
},
|
|
180
190
|
"migrate-helm-imports": {
|
|
181
191
|
"factory": "./src/generators/migrate-helm-imports/compat",
|
|
182
192
|
"schema": "./src/generators/migrate-helm-imports/schema.json",
|
package/package.json
CHANGED
|
@@ -21,6 +21,7 @@ const core_imports_1 = require("./healthchecks/core-imports");
|
|
|
21
21
|
const helm_imports_1 = require("./healthchecks/helm-imports");
|
|
22
22
|
const hlm_1 = require("./healthchecks/hlm");
|
|
23
23
|
const hlm_date_picker_1 = require("./healthchecks/hlm-date-picker");
|
|
24
|
+
const hlm_date_picker_min_max_1 = require("./healthchecks/hlm-date-picker-min-max");
|
|
24
25
|
const hlm_dialog_1 = require("./healthchecks/hlm-dialog");
|
|
25
26
|
const hlm_dialog_portal_1 = require("./healthchecks/hlm-dialog-portal");
|
|
26
27
|
const hlm_form_field_1 = require("./healthchecks/hlm-form-field");
|
|
@@ -51,6 +52,7 @@ async function healthcheckGenerator(tree, options) {
|
|
|
51
52
|
helm_imports_1.helmImportsHealthcheck,
|
|
52
53
|
naming_conventions_1.namingConventionHealthcheck,
|
|
53
54
|
hlm_date_picker_1.datePickerHealthcheck,
|
|
55
|
+
hlm_date_picker_min_max_1.datePickerMinMaxHealthcheck,
|
|
54
56
|
hlm_input_id_1.hlmInputIdHealthcheck,
|
|
55
57
|
hlm_progress_1.progressHealthcheck,
|
|
56
58
|
hlm_1.hlmImportHealthcheck,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/generators/healthcheck/generator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/generators/healthcheck/generator.ts"],"names":[],"mappings":";;AAuCA,oDAuEC;AA9GD,uCAA4D;AAC5D,uCAAkC;AAClC,+CAAoD;AACpD,iDAAmH;AACnH,gEAAuE;AACvE,gFAAwF;AACxF,wGAAiG;AACjG,oEAA6E;AAC7E,oGAA4F;AAC5F,wDAAiE;AACjE,0DAAiE;AACjE,gEAAyE;AACzE,oGAA6F;AAC7F,0DAAmE;AACnE,sEAA8E;AAC9E,0EAAiF;AACjF,8DAAqE;AACrE,8DAAqE;AACrE,4CAA0D;AAC1D,oEAAuE;AACvE,oFAAqF;AACrF,0DAAkE;AAClE,wEAA+E;AAC/E,kEAAyE;AACzE,sDAA8D;AAC9D,8DAAoE;AACpE,sDAA8D;AAC9D,8DAAkE;AAClE,oEAAuE;AACvE,0DAA8D;AAC9D,kEAAyE;AACzE,0EAAgF;AAChF,0EAAiF;AACjF,kDAA0D;AAC1D,oDAA4D;AAE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AAM,GAAG,GACR,OAAO,CAAC,OAAO;gBACf,CACC,MAAM,IAAA,iBAAM,EAAyB;oBACpC,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,WAAW;oBACjB,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM;iBAClC,CAAC,CACF,CAAC,SAAS,CAAC;YAEb,IAAI,GAAG,EAAE,CAAC;gBACT,MAAM,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,WAAW,EAAE,CAAC,CAAC;YACrF,CAAC;QACF,CAAC;IACF,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACzB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IACzB,CAAC;AACF,CAAC;AAED,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.datePickerMinMaxHealthcheck = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const generator_1 = tslib_1.__importDefault(require("../../migrate-date-picker-min-max/generator"));
|
|
7
|
+
const healthchecks_1 = require("../healthchecks");
|
|
8
|
+
const datePickerSelectors = [
|
|
9
|
+
'hlm-date-picker-multi',
|
|
10
|
+
'hlm-date-range-picker',
|
|
11
|
+
'hlm-month-year-picker',
|
|
12
|
+
'hlm-date-picker',
|
|
13
|
+
];
|
|
14
|
+
const legacyMinMaxPattern = new RegExp(`<(?:${datePickerSelectors.join('|')})(?=[\\s/>])[^>]*(\\s\\[min\\]\\s*=|\\s\\[max\\]\\s*=|\\smin\\s*=|\\smax\\s*=)`);
|
|
15
|
+
exports.datePickerMinMaxHealthcheck = {
|
|
16
|
+
name: 'Helm DatePicker min/max rename',
|
|
17
|
+
async detect(tree, failure) {
|
|
18
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, '/', (file) => {
|
|
19
|
+
if (!file.endsWith('.ts') && !file.endsWith('.html')) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const contents = tree.read(file, 'utf-8');
|
|
23
|
+
if (!contents) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (legacyMinMaxPattern.test(contents)) {
|
|
27
|
+
failure('DatePicker is using renamed min/max inputs. They have been renamed to minDate/maxDate.', healthchecks_1.HealthcheckSeverity.Error, true);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
fix: async (tree, { angularCli }) => {
|
|
32
|
+
await (0, generator_1.default)(tree, { skipFormat: true, angularCli });
|
|
33
|
+
return true;
|
|
34
|
+
},
|
|
35
|
+
prompt: 'Would you like to migrate renamed date picker min/max inputs?',
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=hlm-date-picker-min-max.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hlm-date-picker-min-max.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/generators/healthcheck/healthchecks/hlm-date-picker-min-max.ts"],"names":[],"mappings":";;;;AAAA,uCAAkD;AAClD,oGAA2F;AAC3F,kDAAwE;AAExE,MAAM,mBAAmB,GAAG;IAC3B,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,iBAAiB;CACjB,CAAC;AAEF,MAAM,mBAAmB,GAAG,IAAI,MAAM,CACrC,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,gFAAgF,CACpH,CAAC;AAEW,QAAA,2BAA2B,GAAgB;IACvD,IAAI,EAAE,gCAAgC;IACtC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO;QACzB,IAAA,6BAAoB,EAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;YACxC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBACtD,OAAO;YACR,CAAC;YAED,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAE1C,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACf,OAAO;YACR,CAAC;YAED,IAAI,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACxC,OAAO,CACN,wFAAwF,EACxF,kCAAmB,CAAC,KAAK,EACzB,IAAI,CACJ,CAAC;YACH,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IACD,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;QACnC,MAAM,IAAA,mBAAgC,EAAC,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC;IACb,CAAC;IACD,MAAM,EAAE,+DAA+D;CACvE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("./generator"));
|
|
6
|
+
exports.default = (0, devkit_1.convertNxGenerator)((tree, schema) => (0, generator_1.default)(tree, { ...schema, angularCli: true }));
|
|
7
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/generators/migrate-date-picker-min-max/compat.ts"],"names":[],"mappings":";;;AAAA,uCAAgD;AAChD,oEAA2D;AAG3D,kBAAe,IAAA,2BAAkB,EAChC,CAAC,IAAS,EAAE,MAAyE,EAAE,EAAE,CACxF,IAAA,mBAAgC,EAAC,IAAI,EAAE,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CACxE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
2
|
+
import type { MigrateDatePickerMinMaxGeneratorSchema } from './schema';
|
|
3
|
+
export declare function migrateDatePickerMinMaxGenerator(tree: Tree, { skipFormat, angularCli }: MigrateDatePickerMinMaxGeneratorSchema): Promise<void>;
|
|
4
|
+
export default migrateDatePickerMinMaxGenerator;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrateDatePickerMinMaxGenerator = migrateDatePickerMinMaxGenerator;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const config_1 = require("../../utils/config");
|
|
6
|
+
const visit_files_1 = require("../../utils/visit-files");
|
|
7
|
+
const generator_1 = require("../migrate-helm-libraries/generator");
|
|
8
|
+
const datePickerSelectors = [
|
|
9
|
+
'hlm-date-picker-multi',
|
|
10
|
+
'hlm-date-range-picker',
|
|
11
|
+
'hlm-month-year-picker',
|
|
12
|
+
'hlm-date-picker',
|
|
13
|
+
];
|
|
14
|
+
const datePickerTagPattern = new RegExp(`<(?:${datePickerSelectors.join('|')})(?=[\\s/>])[^>]*>`, 'g');
|
|
15
|
+
async function migrateDatePickerMinMaxGenerator(tree, { skipFormat, angularCli }) {
|
|
16
|
+
replaceLegacyMinMaxInputs(tree);
|
|
17
|
+
const config = await (0, config_1.loadOrInitConfig)(tree, { angularCli: angularCli ?? false });
|
|
18
|
+
await (0, generator_1.migrateHelmLibrariesGenerator)(tree, {
|
|
19
|
+
libraries: ['date-picker'],
|
|
20
|
+
angularCli: angularCli ?? false,
|
|
21
|
+
generateAs: config.generateAs ?? 'library',
|
|
22
|
+
buildable: config.buildable ?? true,
|
|
23
|
+
importAlias: config.importAlias,
|
|
24
|
+
style: config.style,
|
|
25
|
+
});
|
|
26
|
+
if (!skipFormat) {
|
|
27
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function replaceLegacyMinMaxInputs(tree) {
|
|
31
|
+
(0, visit_files_1.visitFiles)(tree, '.', (path) => {
|
|
32
|
+
if (!path.endsWith('.html') && !path.endsWith('.ts')) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
let content = tree.read(path, 'utf-8');
|
|
36
|
+
if (!content) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
datePickerTagPattern.lastIndex = 0;
|
|
40
|
+
content = content.replace(datePickerTagPattern, (tag) => renameLegacyMinMaxInputs(tag));
|
|
41
|
+
tree.write(path, content);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function renameLegacyMinMaxInputs(tag) {
|
|
45
|
+
return tag
|
|
46
|
+
.replace(/(\s)\[min\](\s*=)/g, '$1[minDate]$2')
|
|
47
|
+
.replace(/(\s)\[max\](\s*=)/g, '$1[maxDate]$2')
|
|
48
|
+
.replace(/(\s)min(\s*=)/g, '$1minDate$2')
|
|
49
|
+
.replace(/(\s)max(\s*=)/g, '$1maxDate$2');
|
|
50
|
+
}
|
|
51
|
+
exports.default = migrateDatePickerMinMaxGenerator;
|
|
52
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/generators/migrate-date-picker-min-max/generator.ts"],"names":[],"mappings":";;AAeA,4EAoBC;AAnCD,uCAAoD;AACpD,+CAAsD;AACtD,yDAAqD;AACrD,mEAAoF;AAGpF,MAAM,mBAAmB,GAAG;IAC3B,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,iBAAiB;CACjB,CAAC;AAEF,MAAM,oBAAoB,GAAG,IAAI,MAAM,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,GA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AAC,CAAC;QAExF,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAAC,GAAW;IAC5C,OAAO,GAAG;SACR,OAAO,CAAC,oBAAoB,EAAE,eAAe,CAAC;SAC9C,OAAO,CAAC,oBAAoB,EAAE,eAAe,CAAC;SAC9C,OAAO,CAAC,gBAAgB,EAAE,aAAa,CAAC;SACxC,OAAO,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;AAC5C,CAAC;AAED,kBAAe,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "MigrateDatePickerMinMax",
|
|
4
|
+
"title": "",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"skipFormat": {
|
|
8
|
+
"type": "boolean",
|
|
9
|
+
"default": false,
|
|
10
|
+
"description": "Skip formatting files"
|
|
11
|
+
},
|
|
12
|
+
"angularCli": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"description": "When true, uses Angular CLI conventions"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": []
|
|
18
|
+
}
|
|
@@ -74,31 +74,38 @@ async function migrateHelmLibrariesGenerator(tree, options) {
|
|
|
74
74
|
devkit_1.logger.info('No libraries to migrate');
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
message: 'The following libraries are installed. Select the ones you want to replace with the latest version:',
|
|
82
|
-
choices: ['all', ...existingLibraries],
|
|
83
|
-
});
|
|
84
|
-
// prompt the user to confirm their actions as this will overwrite the existing libraries and remove any customizations
|
|
85
|
-
const confirmation = (await (0, enquirer_1.prompt)({
|
|
86
|
-
type: 'confirm',
|
|
87
|
-
name: 'confirm',
|
|
88
|
-
message: 'Are you sure you want to update the selected libraries? This will overwrite the existing libraries and remove any customizations.',
|
|
89
|
-
}));
|
|
90
|
-
if (!confirmation.confirm) {
|
|
91
|
-
devkit_1.logger.info('Aborting migration.');
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
let { libraries } = selectedLibraries;
|
|
95
|
-
if (libraries.length === 0) {
|
|
96
|
-
devkit_1.logger.info('No libraries will be updated.');
|
|
97
|
-
return;
|
|
77
|
+
let libraries;
|
|
78
|
+
if (options.libraries && options.libraries.length > 0) {
|
|
79
|
+
// When libraries are provided programmatically, skip interactive prompts
|
|
80
|
+
libraries = options.libraries;
|
|
98
81
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
82
|
+
else {
|
|
83
|
+
// allow the user to select which libraries to migrate
|
|
84
|
+
const selectedLibraries = await (0, enquirer_1.prompt)({
|
|
85
|
+
type: 'multiselect',
|
|
86
|
+
name: 'libraries',
|
|
87
|
+
message: 'The following libraries are installed. Select the ones you want to replace with the latest version:',
|
|
88
|
+
choices: ['all', ...existingLibraries],
|
|
89
|
+
});
|
|
90
|
+
// prompt the user to confirm their actions as this will overwrite the existing libraries and remove any customizations
|
|
91
|
+
const confirmation = (await (0, enquirer_1.prompt)({
|
|
92
|
+
type: 'confirm',
|
|
93
|
+
name: 'confirm',
|
|
94
|
+
message: 'Are you sure you want to update the selected libraries? This will overwrite the existing libraries and remove any customizations.',
|
|
95
|
+
}));
|
|
96
|
+
if (!confirmation.confirm) {
|
|
97
|
+
devkit_1.logger.info('Aborting migration.');
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
({ libraries } = selectedLibraries);
|
|
101
|
+
if (libraries.length === 0) {
|
|
102
|
+
devkit_1.logger.info('No libraries will be updated.');
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
// if the user selected all libraries then we will update all libraries
|
|
106
|
+
if (libraries.includes('all')) {
|
|
107
|
+
libraries = existingLibraries;
|
|
108
|
+
}
|
|
102
109
|
}
|
|
103
110
|
await removeExistingLibraries(tree, { ...options, generateAs: config.generateAs, importAlias: config.importAlias }, libraries);
|
|
104
111
|
await regenerateLibraries(tree, { ...options, generateAs: config.generateAs, buildable: config.buildable }, libraries);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/generators/migrate-helm-libraries/generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/generators/migrate-helm-libraries/generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,sEAgEC;AA5GD,uCAAkF;AAClF,+BAAmD;AACnD,uCAAkC;AAClC,qCAAqC;AACrC,+BAAqC;AACrC,+CAAsD;AACtD,mDAAiE;AACjE,yDAAsD;AAEtD,+CAA2D;AAS3D,oGAAoG;AACpG,mGAAmG;AACnG,iGAAiG;AACjG,qGAAqG;AACrG,oGAAoG;AACpG,sGAAsG;AACtG,8FAA8F;AAC9F,SAAS,mBAAmB;IAC3B,MAAM,aAAa,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG;QAClB,IAAA,WAAI,EAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,SAAS;QAClF,IAAA,WAAI,EAAC,aAAa,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,WAAW;KAC5E,CAAC;IACF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACpC,IAAI,IAAA,oBAAU,EAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,gGAAgG;YAChG,mGAAmG;YACnG,0DAA0D;YAC1D,OAAQ,O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GAA+G;YAC/G,wBAAwB;YACxB,MAAM,SAAS,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAEtD,gDAAgD;YAChD,IAAA,yBAAW,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YAE7B,oCAAoC;YACpC,IAAA,mBAAU,EAAC,IAAI,EAAE,IAAA,8BAAyB,EAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE;gBAC1D,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;gBAC9C,OAAO,IAAI,CAAC;YACb,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;AACF,CAAC;AAED,KAAK,UAAU,mBAAmB,CAAC,IAAU,EAAE,OAA4C,EAAE,SAAsB;IAClH,MAAM,kBAAkB,GAAG,CAAC,MAAM,kDAAO,mCAAmC,IAAE,IAAI,CACjF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAChB,CAAuB,CAAC;IACzB,MAAM,MAAM,GAAG,MAAM,IAAA,yBAAgB,EAAC,IAAI,EAAE,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAEhF,MAAM,IAAA,oCAAwB,EAC7B;QACC,UAAU,EAAE,SAAS;KACrB,EACD,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAgB,EAC9C,kBAAkB,EAClB,IAAI,EACJ,EAAE,GAAG,OAAO,EAAE,uBAAuB,EAAE,KAAK,EAAE,EAC9C,MAAM,CACN,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Style } from '../../utils/supported-styles';
|
|
2
2
|
import { type GenerateAs } from '../base/lib/generate-as';
|
|
3
|
+
import type { Primitive } from '../ui/primitives';
|
|
3
4
|
|
|
4
5
|
export interface MigrateHelmLibrariesGeneratorSchema {
|
|
5
6
|
directory?: string;
|
|
@@ -10,4 +11,5 @@ export interface MigrateHelmLibrariesGeneratorSchema {
|
|
|
10
11
|
buildable: boolean;
|
|
11
12
|
importAlias: string;
|
|
12
13
|
style: Style;
|
|
14
|
+
libraries?: Primitive[];
|
|
13
15
|
}
|
|
@@ -11,6 +11,13 @@
|
|
|
11
11
|
"tags": {
|
|
12
12
|
"type": "string",
|
|
13
13
|
"description": "Add tags to the library (used for linting)."
|
|
14
|
+
},
|
|
15
|
+
"libraries": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"description": "An array of library names to migrate. When provided, the migration will run non-interactively."
|
|
14
21
|
}
|
|
15
22
|
},
|
|
16
23
|
"required": []
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HlmAttachment } from './lib/hlm-attachment';
|
|
2
|
+
import { HlmAttachmentAction } from './lib/hlm-attachment-action';
|
|
3
|
+
import { HlmAttachmentActions } from './lib/hlm-attachment-actions';
|
|
4
|
+
import { HlmAttachmentContent } from './lib/hlm-attachment-content';
|
|
5
|
+
import { HlmAttachmentDescription } from './lib/hlm-attachment-description';
|
|
6
|
+
import { HlmAttachmentGroup } from './lib/hlm-attachment-group';
|
|
7
|
+
import { HlmAttachmentMedia } from './lib/hlm-attachment-media';
|
|
8
|
+
import { HlmAttachmentTitle } from './lib/hlm-attachment-title';
|
|
9
|
+
import { HlmAttachmentTrigger } from './lib/hlm-attachment-trigger';
|
|
10
|
+
|
|
11
|
+
export * from './lib/hlm-attachment';
|
|
12
|
+
export * from './lib/hlm-attachment-action';
|
|
13
|
+
export * from './lib/hlm-attachment-actions';
|
|
14
|
+
export * from './lib/hlm-attachment-content';
|
|
15
|
+
export * from './lib/hlm-attachment-description';
|
|
16
|
+
export * from './lib/hlm-attachment-group';
|
|
17
|
+
export * from './lib/hlm-attachment-media';
|
|
18
|
+
export * from './lib/hlm-attachment-title';
|
|
19
|
+
export * from './lib/hlm-attachment-trigger';
|
|
20
|
+
|
|
21
|
+
export const HlmAttachmentImports = [
|
|
22
|
+
HlmAttachment,
|
|
23
|
+
HlmAttachmentAction,
|
|
24
|
+
HlmAttachmentActions,
|
|
25
|
+
HlmAttachmentContent,
|
|
26
|
+
HlmAttachmentDescription,
|
|
27
|
+
HlmAttachmentGroup,
|
|
28
|
+
HlmAttachmentMedia,
|
|
29
|
+
HlmAttachmentTitle,
|
|
30
|
+
HlmAttachmentTrigger,
|
|
31
|
+
] as const;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Directive, input } from '@angular/core';
|
|
2
|
+
import { HlmButton, provideBrnButtonConfig } from '<%- importAlias %>/button';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: 'button[hlmAttachmentAction]',
|
|
6
|
+
providers: [provideBrnButtonConfig({ variant: 'ghost', size: 'icon-xs' })],
|
|
7
|
+
hostDirectives: [{ directive: HlmButton, inputs: ['variant', 'size'] }],
|
|
8
|
+
host: {
|
|
9
|
+
'data-slot': 'attachment-action',
|
|
10
|
+
'[type]': 'type()',
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
export class HlmAttachmentAction {
|
|
14
|
+
public readonly type = input<'button' | 'submit' | 'reset'>('button');
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmAttachmentActions],hlm-attachment-actions',
|
|
6
|
+
host: { 'data-slot': 'attachment-actions' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmAttachmentActions {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(
|
|
11
|
+
() =>
|
|
12
|
+
'spartan-attachment-actions relative z-20 flex group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:end-3 group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:gap-1',
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmAttachmentContent],hlm-attachment-content',
|
|
6
|
+
host: { 'data-slot': 'attachment-content' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmAttachmentContent {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(() => 'spartan-attachment-content max-w-full group-data-[orientation=vertical]/attachment:px-1');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmAttachmentDescription],hlm-attachment-description',
|
|
6
|
+
host: { 'data-slot': 'attachment-description' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmAttachmentDescription {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(
|
|
11
|
+
() =>
|
|
12
|
+
'spartan-attachment-description group-data-[state=error]/attachment:text-destructive/80 block max-w-full min-w-0',
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmAttachmentGroup],hlm-attachment-group',
|
|
6
|
+
host: { 'data-slot': 'attachment-group' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmAttachmentGroup {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(
|
|
11
|
+
() =>
|
|
12
|
+
'spartan-attachment-group scroll-fade-x no-scrollbar flex min-w-0 snap-x snap-mandatory scroll-px-1 gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start',
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Directive, input } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
const attachmentMediaVariants = cva(
|
|
6
|
+
"spartan-attachment-media group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive relative flex aspect-square shrink-0 items-center justify-center overflow-hidden group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 [&_ng-icon]:pointer-events-none [&_ng-icon:not([class*='text-'])]:text-[length:--spacing(4)] group-data-[orientation=vertical]/attachment:[&_ng-icon:not([class*='text-'])]:text-[length:--spacing(6)] group-data-[size=xs]/attachment:[&_ng-icon:not([class*='text-'])]:text-[length:--spacing(3.5)]",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
icon: 'spartan-attachment-media-variant-icon',
|
|
11
|
+
image: 'spartan-attachment-media-variant-image *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
variant: 'icon',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export type AttachmentMediaVariants = VariantProps<typeof attachmentMediaVariants>;
|
|
21
|
+
|
|
22
|
+
@Directive({
|
|
23
|
+
selector: '[hlmAttachmentMedia],hlm-attachment-media',
|
|
24
|
+
host: {
|
|
25
|
+
'data-slot': 'attachment-media',
|
|
26
|
+
'[attr.data-variant]': 'variant()',
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
export class HlmAttachmentMedia {
|
|
30
|
+
public readonly variant = input<AttachmentMediaVariants['variant']>('icon');
|
|
31
|
+
|
|
32
|
+
constructor() {
|
|
33
|
+
classes(() => attachmentMediaVariants({ variant: this.variant() }));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmAttachmentTitle],hlm-attachment-title',
|
|
6
|
+
host: { 'data-slot': 'attachment-title' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmAttachmentTitle {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(
|
|
11
|
+
() =>
|
|
12
|
+
'spartan-attachment-title group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer block max-w-full min-w-0',
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { computed, Directive, ElementRef, inject, input } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: 'button[hlmAttachmentTrigger],a[hlmAttachmentTrigger]',
|
|
6
|
+
host: {
|
|
7
|
+
'data-slot': 'attachment-trigger',
|
|
8
|
+
'[attr.type]': '_hostType()',
|
|
9
|
+
},
|
|
10
|
+
})
|
|
11
|
+
export class HlmAttachmentTrigger {
|
|
12
|
+
private readonly _elementRef = inject(ElementRef<HTMLElement>);
|
|
13
|
+
|
|
14
|
+
public readonly type = input<'button' | 'submit' | 'reset' | null>('button');
|
|
15
|
+
|
|
16
|
+
protected readonly _hostType = computed(() =>
|
|
17
|
+
this._elementRef.nativeElement.localName === 'button' ? this.type() : null,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
constructor() {
|
|
21
|
+
classes(() => 'spartan-attachment-trigger');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Directive, input } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
const attachmentVariants = cva(
|
|
6
|
+
'spartan-attachment group/attachment focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap transition-colors focus-within:ring-1 data-[state=idle]:border-dashed',
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
default:
|
|
11
|
+
'spartan-attachment-size-default gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2',
|
|
12
|
+
sm: 'spartan-attachment-size-sm gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5',
|
|
13
|
+
xs: 'spartan-attachment-size-xs gap-1.5 text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1',
|
|
14
|
+
},
|
|
15
|
+
orientation: {
|
|
16
|
+
horizontal: 'spartan-attachment-orientation-horizontal min-w-40 items-center',
|
|
17
|
+
vertical: 'spartan-attachment-orientation-vertical w-24 flex-col has-data-[slot=attachment-content]:w-30',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
size: 'default',
|
|
22
|
+
orientation: 'horizontal',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export type AttachmentVariants = VariantProps<typeof attachmentVariants>;
|
|
28
|
+
export type AttachmentState = 'idle' | 'uploading' | 'processing' | 'error' | 'done';
|
|
29
|
+
|
|
30
|
+
@Directive({
|
|
31
|
+
selector: '[hlmAttachment],hlm-attachment',
|
|
32
|
+
host: {
|
|
33
|
+
'data-slot': 'attachment',
|
|
34
|
+
'[attr.data-state]': 'state()',
|
|
35
|
+
'[attr.data-size]': 'size()',
|
|
36
|
+
'[attr.data-orientation]': 'orientation()',
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
export class HlmAttachment {
|
|
40
|
+
public readonly state = input<AttachmentState>('done');
|
|
41
|
+
public readonly size = input<AttachmentVariants['size']>('default');
|
|
42
|
+
public readonly orientation = input<AttachmentVariants['orientation']>('horizontal');
|
|
43
|
+
|
|
44
|
+
constructor() {
|
|
45
|
+
classes(() => attachmentVariants({ size: this.size(), orientation: this.orientation() }));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generator = generator;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
|
|
6
|
+
async function generator(tree, options) {
|
|
7
|
+
return await (0, generator_1.default)(tree, { ...options, name: 'attachment' });
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/attachment/generator.ts"],"names":[],"mappings":";;AAIA,8BAEC;;AALD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HlmBubble } from './lib/hlm-bubble';
|
|
2
|
+
import { HlmBubbleContent } from './lib/hlm-bubble-content';
|
|
3
|
+
import { HlmBubbleGroup } from './lib/hlm-bubble-group';
|
|
4
|
+
import { HlmBubbleReactions } from './lib/hlm-bubble-reactions';
|
|
5
|
+
|
|
6
|
+
export * from './lib/hlm-bubble';
|
|
7
|
+
export * from './lib/hlm-bubble-content';
|
|
8
|
+
export * from './lib/hlm-bubble-group';
|
|
9
|
+
export * from './lib/hlm-bubble-reactions';
|
|
10
|
+
|
|
11
|
+
export const HlmBubbleImports = [HlmBubble, HlmBubbleContent, HlmBubbleGroup, HlmBubbleReactions] as const;
|