@unifylib/ui-lib 1.2.16 → 1.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/cli/client-app-component-guide.md +166 -166
  2. package/cli/generators/dashboard.js +147 -147
  3. package/cli/generators/form-screen.js +95 -95
  4. package/cli/generators/line-editor.js +110 -110
  5. package/cli/generators/permission-matrix.js +115 -115
  6. package/cli/generators/section-form.js +103 -103
  7. package/cli/generators/table-screen.js +181 -181
  8. package/cli/index.js +185 -185
  9. package/cli/utils.js +228 -228
  10. package/esm2022/iq-ui-lib.mjs +5 -0
  11. package/esm2022/lib/base-model/SearchStrConfig.mjs +1 -1
  12. package/esm2022/lib/base-model/api-response.mjs +1 -1
  13. package/esm2022/lib/base-model/audit-log-entry.mjs +1 -1
  14. package/esm2022/lib/base-model/button-action-settings.mjs +1 -1
  15. package/esm2022/lib/base-model/column-def.model.mjs +1 -1
  16. package/esm2022/lib/base-model/do-action-request.mjs +1 -1
  17. package/esm2022/lib/base-model/field-action.mjs +1 -1
  18. package/esm2022/lib/base-model/field-filter.model.mjs +1 -1
  19. package/esm2022/lib/base-model/field-info.mjs +1 -1
  20. package/esm2022/lib/base-model/field-predicate.model.mjs +1 -1
  21. package/esm2022/lib/base-model/filter-request.mjs +1 -1
  22. package/esm2022/lib/base-model/filter.model.mjs +1 -1
  23. package/esm2022/lib/base-model/get-items-list.mjs +1 -1
  24. package/esm2022/lib/base-model/index.mjs +1 -1
  25. package/esm2022/lib/base-model/items-total.model.mjs +1 -1
  26. package/esm2022/lib/base-model/line-item.model.mjs +1 -1
  27. package/esm2022/lib/base-model/lookupItem.mjs +1 -1
  28. package/esm2022/lib/base-model/page-info.mjs +1 -1
  29. package/esm2022/lib/base-model/permission-matrix.model.mjs +1 -1
  30. package/esm2022/lib/base-model/report-request.model.mjs +1 -1
  31. package/esm2022/lib/base-model/response-envelop.model.mjs +1 -1
  32. package/esm2022/lib/base-model/snack-message.model.mjs +1 -1
  33. package/esm2022/lib/base-model/table-column.interface.mjs +1 -1
  34. package/esm2022/lib/base-model/table-page-user-action.interface.mjs +1 -1
  35. package/esm2022/lib/base-model/workflow/workflow-steps.model.mjs +1 -1
  36. package/esm2022/lib/base-model/workflow/workflow.model.mjs +1 -1
  37. package/esm2022/lib/components/action-comment/action-comment.component.mjs +3 -3
  38. package/esm2022/lib/components/action-confirmation/action-confirmation.component.mjs +3 -3
  39. package/esm2022/lib/components/activity-report-form/activity-report-form.component.mjs +3 -3
  40. package/esm2022/lib/components/advanced-filter/field-filter/field-filter.component.mjs +3 -3
  41. package/esm2022/lib/components/advanced-filter/filter-builder/filter-builder.component.mjs +3 -3
  42. package/esm2022/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.mjs +3 -3
  43. package/esm2022/lib/components/auto-complete/auto-complete.component.mjs +3 -3
  44. package/esm2022/lib/components/base-form/base-form.component.mjs +3 -3
  45. package/esm2022/lib/components/base-form-canvas/MaxDigitsDirective.mjs +1 -1
  46. package/esm2022/lib/components/base-form-canvas/NumbersOnlyDirective.mjs +1 -1
  47. package/esm2022/lib/components/base-form-canvas/base-form-canvas.component.mjs +5 -5
  48. package/esm2022/lib/components/base-input-dialog/base-input-dialog.component.mjs +3 -3
  49. package/esm2022/lib/components/base-table/base-table.component.mjs +3 -3
  50. package/esm2022/lib/components/button-actions/button-actions.component.mjs +3 -3
  51. package/esm2022/lib/components/editable-base-table/editable-base-table.component.mjs +3 -3
  52. package/esm2022/lib/components/equation-builder/equation-builder.component.mjs +3 -3
  53. package/esm2022/lib/components/item-line-editor/item-line-editor.component.mjs +3 -3
  54. package/esm2022/lib/components/multi-auto-complete/multi-auto-complete.component.mjs +11 -10
  55. package/esm2022/lib/components/paginator/paginator.component.mjs +3 -3
  56. package/esm2022/lib/components/permission-matrix/permission-matrix.component.mjs +3 -3
  57. package/esm2022/lib/components/report-details-dialog/report-details-dialog.component.mjs +3 -3
  58. package/esm2022/lib/components/report-form/report-form.component.mjs +3 -3
  59. package/esm2022/lib/components/search-bar/search-bar.component.mjs +3 -3
  60. package/esm2022/lib/components/section-form-canvas/section-form-canvas.component.mjs +3 -3
  61. package/esm2022/lib/components/shared/action-button/action-button.component.mjs +3 -3
  62. package/esm2022/lib/components/shared/action-card/action-card.component.mjs +3 -3
  63. package/esm2022/lib/components/shared/attachment-uploader/attachment-uploader.component.mjs +3 -3
  64. package/esm2022/lib/components/shared-list/shared-list.component.mjs +3 -3
  65. package/esm2022/lib/components/snackbar-static/snackbar-static.component.mjs +3 -3
  66. package/esm2022/lib/components/title-bar/title-bar.component.mjs +3 -3
  67. package/esm2022/lib/directives/phone-number-only.directive.mjs +1 -1
  68. package/esm2022/lib/services/backend-service.mjs +1 -1
  69. package/esm2022/lib/services/index.mjs +1 -1
  70. package/esm2022/lib/services/top-panel.mjs +1 -1
  71. package/esm2022/lib/services/trigger-form.service.mjs +1 -1
  72. package/esm2022/lib/utils/base-utils.mjs +1 -1
  73. package/esm2022/lib/validators/date-range-validator.mjs +1 -1
  74. package/esm2022/lib/validators/index.mjs +1 -1
  75. package/esm2022/lib/validators/match-list.validator.mjs +1 -1
  76. package/esm2022/lib/validators/multi-email-validator.mjs +1 -1
  77. package/esm2022/public-api.mjs +1 -1
  78. package/fesm2022/iq-ui-lib.mjs +7060 -0
  79. package/fesm2022/iq-ui-lib.mjs.map +1 -0
  80. package/index.d.ts +1 -1
  81. package/package.json +14 -6
  82. package/esm2022/unifylib-ui-lib.mjs +0 -5
  83. package/fesm2022/unifylib-ui-lib.mjs +0 -7059
  84. package/fesm2022/unifylib-ui-lib.mjs.map +0 -1
package/cli/index.js CHANGED
@@ -1,185 +1,185 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- const path = require("path");
5
- const {
6
- kebabCase,
7
- pascalCase,
8
- upperSnakeFromKebab,
9
- lastPathSegment,
10
- writeFiles,
11
- upsertI18nEntries,
12
- } = require("./utils");
13
-
14
- const GENERATORS = {
15
- "form-screen": require("./generators/form-screen.js"),
16
- "table-screen": require("./generators/table-screen.js"),
17
- "section-form": require("./generators/section-form.js"),
18
- "line-editor": require("./generators/line-editor.js"),
19
- dashboard: require("./generators/dashboard.js"),
20
- "permission-matrix": require("./generators/permission-matrix.js"),
21
- };
22
-
23
- function printHelp() {
24
- console.log(`
25
- iq-ui — scaffold Angular screens that use @unifylib/ui-lib
26
-
27
- Usage:
28
- iq-ui -g <type> <destination> [options]
29
-
30
- Types:
31
- form-screen app-base-form-canvas + settings
32
- table-screen app-base-table + settings
33
- section-form lib-section-form-canvas + settings
34
- line-editor app-item-line-editor + settings
35
- dashboard lib-action-card grid (no settings file)
36
- permission-matrix lib-permission-matrix + settings
37
-
38
- Options:
39
- --name <n> File/class base name (default: last segment of destination)
40
- --labels-section <s> i18n labelsSection (default: UPPER_SNAKE from name)
41
- --api-uri <u> API path for PageInfo.apiUri (default: /<name>)
42
- --fields-count <n> Placeholder fields (default: 6; form-screen, section-form, line-editor)
43
- --import-path <p> Library import (default: @iq/ui-lib)
44
- --i18n-path <p> Optional translation file/folder (example: src/assets/en.json or src/assets)
45
- --dry-run Print files that would be written
46
- -h, --help Show this help
47
-
48
- Examples (after npm install @unifylib/ui-lib, use the package binary; do not run \`npx iq-ui\`, which looks up a wrong package on npm):
49
- npx -p @unifylib/ui-lib iq-ui -g form-screen src/app/registration --i18n-path src/assets/en.json
50
- npx -p @unifylib/ui-lib iq-ui -g table-screen src/app/devices --labels-section DEVICE --api-uri /devices/list
51
- npx -p @unifylib/ui-lib iq-ui -g dashboard src/app/home --import-path @unifylib/ui-lib
52
-
53
- Local dev / linked build:
54
- node node_modules/@unifylib/ui-lib/cli/index.js -g form-screen src/app/registration
55
- `);
56
- }
57
-
58
- /**
59
- * @returns {{
60
- * type?: string,
61
- * destination?: string,
62
- * name?: string,
63
- * labelsSection?: string,
64
- * apiUri?: string,
65
- * fieldsCount: number,
66
- * importPath: string,
67
- * i18nPath?: string,
68
- * dryRun: boolean,
69
- * help: boolean,
70
- * }}
71
- */
72
- function parseArgs(argv) {
73
- const out = {
74
- fieldsCount: 6,
75
- importPath: "@iq/ui-lib",
76
- dryRun: false,
77
- help: false,
78
- };
79
-
80
- for (let i = 2; i < argv.length; i++) {
81
- const a = argv[i];
82
- if (a === "-h" || a === "--help") {
83
- out.help = true;
84
- continue;
85
- }
86
- if (a === "--dry-run") {
87
- out.dryRun = true;
88
- continue;
89
- }
90
- if (a === "-g" || a === "--generate") {
91
- out.type = argv[++i];
92
- continue;
93
- }
94
- if (a === "--name") {
95
- out.name = argv[++i];
96
- continue;
97
- }
98
- if (a === "--labels-section") {
99
- out.labelsSection = argv[++i];
100
- continue;
101
- }
102
- if (a === "--api-uri") {
103
- out.apiUri = argv[++i];
104
- continue;
105
- }
106
- if (a === "--fields-count") {
107
- out.fieldsCount = parseInt(argv[++i], 10) || 6;
108
- continue;
109
- }
110
- if (a === "--import-path") {
111
- out.importPath = argv[++i];
112
- continue;
113
- }
114
- if (a === "--i18n-path") {
115
- out.i18nPath = argv[++i];
116
- continue;
117
- }
118
- if (a.startsWith("-")) {
119
- console.error("Unknown option:", a);
120
- process.exitCode = 1;
121
- out.help = true;
122
- return out;
123
- }
124
- if (!out.destination) {
125
- out.destination = a;
126
- } else {
127
- console.error("Unexpected argument:", a);
128
- process.exitCode = 1;
129
- out.help = true;
130
- return out;
131
- }
132
- }
133
- return out;
134
- }
135
-
136
- function main() {
137
- const args = parseArgs(process.argv);
138
- if (args.help) {
139
- printHelp();
140
- process.exit(process.exitCode || 0);
141
- }
142
- if (!args.type || !args.destination) {
143
- console.error("Missing required: -g <type> and <destination>\n");
144
- printHelp();
145
- process.exit(1);
146
- }
147
-
148
- const gen = GENERATORS[args.type];
149
- if (!gen || typeof gen.generate !== "function") {
150
- console.error("Unknown generator type:", args.type);
151
- printHelp();
152
- process.exit(1);
153
- }
154
-
155
- const rawName = args.name || lastPathSegment(args.destination);
156
- const kebab = kebabCase(rawName);
157
- const pascal = pascalCase(rawName);
158
- const labelsSection = args.labelsSection || upperSnakeFromKebab(kebab);
159
- const apiUri = args.apiUri != null ? args.apiUri : `/${kebab}`;
160
-
161
- const destDir = path.isAbsolute(args.destination)
162
- ? args.destination
163
- : path.join(process.cwd(), args.destination);
164
-
165
- const ctx = {
166
- kebab,
167
- pascal,
168
- labelsSection,
169
- apiUri,
170
- importPath: args.importPath,
171
- fieldsCount: args.fieldsCount,
172
- };
173
-
174
- const files = gen.generate(ctx);
175
- writeFiles({ destDir, dryRun: args.dryRun }, files);
176
-
177
- if (args.i18nPath && typeof gen.getTranslations === "function") {
178
- const translations = gen.getTranslations(ctx);
179
- if (translations && Object.keys(translations).length > 0) {
180
- upsertI18nEntries(args.i18nPath, translations, args.dryRun);
181
- }
182
- }
183
- }
184
-
185
- main();
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const path = require("path");
5
+ const {
6
+ kebabCase,
7
+ pascalCase,
8
+ upperSnakeFromKebab,
9
+ lastPathSegment,
10
+ writeFiles,
11
+ upsertI18nEntries,
12
+ } = require("./utils");
13
+
14
+ const GENERATORS = {
15
+ "form-screen": require("./generators/form-screen.js"),
16
+ "table-screen": require("./generators/table-screen.js"),
17
+ "section-form": require("./generators/section-form.js"),
18
+ "line-editor": require("./generators/line-editor.js"),
19
+ dashboard: require("./generators/dashboard.js"),
20
+ "permission-matrix": require("./generators/permission-matrix.js"),
21
+ };
22
+
23
+ function printHelp() {
24
+ console.log(`
25
+ iq-ui — scaffold Angular screens that use @unifylib/ui-lib
26
+
27
+ Usage:
28
+ iq-ui -g <type> <destination> [options]
29
+
30
+ Types:
31
+ form-screen app-base-form-canvas + settings
32
+ table-screen app-base-table + settings
33
+ section-form lib-section-form-canvas + settings
34
+ line-editor app-item-line-editor + settings
35
+ dashboard lib-action-card grid (no settings file)
36
+ permission-matrix lib-permission-matrix + settings
37
+
38
+ Options:
39
+ --name <n> File/class base name (default: last segment of destination)
40
+ --labels-section <s> i18n labelsSection (default: UPPER_SNAKE from name)
41
+ --api-uri <u> API path for PageInfo.apiUri (default: /<name>)
42
+ --fields-count <n> Placeholder fields (default: 6; form-screen, section-form, line-editor)
43
+ --import-path <p> Library import (default: @iq/ui-lib)
44
+ --i18n-path <p> Optional translation file/folder (example: src/assets/en.json or src/assets)
45
+ --dry-run Print files that would be written
46
+ -h, --help Show this help
47
+
48
+ Examples (after npm install @unifylib/ui-lib, use the package binary; do not run \`npx iq-ui\`, which looks up a wrong package on npm):
49
+ npx -p @unifylib/ui-lib iq-ui -g form-screen src/app/registration --i18n-path src/assets/en.json
50
+ npx -p @unifylib/ui-lib iq-ui -g table-screen src/app/devices --labels-section DEVICE --api-uri /devices/list
51
+ npx -p @unifylib/ui-lib iq-ui -g dashboard src/app/home --import-path @unifylib/ui-lib
52
+
53
+ Local dev / linked build:
54
+ node node_modules/@unifylib/ui-lib/cli/index.js -g form-screen src/app/registration
55
+ `);
56
+ }
57
+
58
+ /**
59
+ * @returns {{
60
+ * type?: string,
61
+ * destination?: string,
62
+ * name?: string,
63
+ * labelsSection?: string,
64
+ * apiUri?: string,
65
+ * fieldsCount: number,
66
+ * importPath: string,
67
+ * i18nPath?: string,
68
+ * dryRun: boolean,
69
+ * help: boolean,
70
+ * }}
71
+ */
72
+ function parseArgs(argv) {
73
+ const out = {
74
+ fieldsCount: 6,
75
+ importPath: "@iq/ui-lib",
76
+ dryRun: false,
77
+ help: false,
78
+ };
79
+
80
+ for (let i = 2; i < argv.length; i++) {
81
+ const a = argv[i];
82
+ if (a === "-h" || a === "--help") {
83
+ out.help = true;
84
+ continue;
85
+ }
86
+ if (a === "--dry-run") {
87
+ out.dryRun = true;
88
+ continue;
89
+ }
90
+ if (a === "-g" || a === "--generate") {
91
+ out.type = argv[++i];
92
+ continue;
93
+ }
94
+ if (a === "--name") {
95
+ out.name = argv[++i];
96
+ continue;
97
+ }
98
+ if (a === "--labels-section") {
99
+ out.labelsSection = argv[++i];
100
+ continue;
101
+ }
102
+ if (a === "--api-uri") {
103
+ out.apiUri = argv[++i];
104
+ continue;
105
+ }
106
+ if (a === "--fields-count") {
107
+ out.fieldsCount = parseInt(argv[++i], 10) || 6;
108
+ continue;
109
+ }
110
+ if (a === "--import-path") {
111
+ out.importPath = argv[++i];
112
+ continue;
113
+ }
114
+ if (a === "--i18n-path") {
115
+ out.i18nPath = argv[++i];
116
+ continue;
117
+ }
118
+ if (a.startsWith("-")) {
119
+ console.error("Unknown option:", a);
120
+ process.exitCode = 1;
121
+ out.help = true;
122
+ return out;
123
+ }
124
+ if (!out.destination) {
125
+ out.destination = a;
126
+ } else {
127
+ console.error("Unexpected argument:", a);
128
+ process.exitCode = 1;
129
+ out.help = true;
130
+ return out;
131
+ }
132
+ }
133
+ return out;
134
+ }
135
+
136
+ function main() {
137
+ const args = parseArgs(process.argv);
138
+ if (args.help) {
139
+ printHelp();
140
+ process.exit(process.exitCode || 0);
141
+ }
142
+ if (!args.type || !args.destination) {
143
+ console.error("Missing required: -g <type> and <destination>\n");
144
+ printHelp();
145
+ process.exit(1);
146
+ }
147
+
148
+ const gen = GENERATORS[args.type];
149
+ if (!gen || typeof gen.generate !== "function") {
150
+ console.error("Unknown generator type:", args.type);
151
+ printHelp();
152
+ process.exit(1);
153
+ }
154
+
155
+ const rawName = args.name || lastPathSegment(args.destination);
156
+ const kebab = kebabCase(rawName);
157
+ const pascal = pascalCase(rawName);
158
+ const labelsSection = args.labelsSection || upperSnakeFromKebab(kebab);
159
+ const apiUri = args.apiUri != null ? args.apiUri : `/${kebab}`;
160
+
161
+ const destDir = path.isAbsolute(args.destination)
162
+ ? args.destination
163
+ : path.join(process.cwd(), args.destination);
164
+
165
+ const ctx = {
166
+ kebab,
167
+ pascal,
168
+ labelsSection,
169
+ apiUri,
170
+ importPath: args.importPath,
171
+ fieldsCount: args.fieldsCount,
172
+ };
173
+
174
+ const files = gen.generate(ctx);
175
+ writeFiles({ destDir, dryRun: args.dryRun }, files);
176
+
177
+ if (args.i18nPath && typeof gen.getTranslations === "function") {
178
+ const translations = gen.getTranslations(ctx);
179
+ if (translations && Object.keys(translations).length > 0) {
180
+ upsertI18nEntries(args.i18nPath, translations, args.dryRun);
181
+ }
182
+ }
183
+ }
184
+
185
+ main();