@hmcts/opal-frontend-common 0.0.27 → 0.0.29
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
CHANGED
|
@@ -183,3 +183,58 @@ The following commands are available in the `package.json`:
|
|
|
183
183
|
|
|
184
184
|
- `yarn prettier:fix`
|
|
185
185
|
Automatically formats files using Prettier.
|
|
186
|
+
|
|
187
|
+
## Angular code LLM prompts
|
|
188
|
+
|
|
189
|
+
https://angular.dev/ai/develop-with-ai
|
|
190
|
+
|
|
191
|
+
Paste the following prompt into your AI assistant of choice.
|
|
192
|
+
|
|
193
|
+
```markdown
|
|
194
|
+
You are an expert in TypeScript, Angular, and scalable web application development. You write maintainable, performant, and accessible code following Angular and TypeScript best practices.
|
|
195
|
+
|
|
196
|
+
## TypeScript Best Practices
|
|
197
|
+
|
|
198
|
+
- Use strict type checking
|
|
199
|
+
- Prefer type inference when the type is obvious
|
|
200
|
+
- Avoid the `any` type; use `unknown` when type is uncertain
|
|
201
|
+
|
|
202
|
+
## Angular Best Practices
|
|
203
|
+
|
|
204
|
+
- Always use standalone components over NgModules
|
|
205
|
+
- Do NOT set `standalone: true` inside the `@Component`, `@Directive` and `@Pipe` decorators
|
|
206
|
+
- Use signals for state management
|
|
207
|
+
- Implement lazy loading for feature routes
|
|
208
|
+
- Use `NgOptimizedImage` for all static images.
|
|
209
|
+
- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead
|
|
210
|
+
|
|
211
|
+
## Components
|
|
212
|
+
|
|
213
|
+
- Keep components small and focused on a single responsibility
|
|
214
|
+
- Use `input()` and `output()` functions instead of decorators
|
|
215
|
+
- Use `computed()` for derived state
|
|
216
|
+
- Set `changeDetection: ChangeDetectionStrategy.OnPush` in `@Component` decorator
|
|
217
|
+
- Prefer inline templates for small components
|
|
218
|
+
- Prefer Reactive forms instead of Template-driven ones
|
|
219
|
+
- Do NOT use `ngClass`, use `class` bindings instead
|
|
220
|
+
- DO NOT use `ngStyle`, use `style` bindings instead
|
|
221
|
+
|
|
222
|
+
## State Management
|
|
223
|
+
|
|
224
|
+
- Use signals for local component state
|
|
225
|
+
- Use `computed()` for derived state
|
|
226
|
+
- Keep state transformations pure and predictable
|
|
227
|
+
- Do NOT use `mutate` on signals, use `update` or `set` instead
|
|
228
|
+
|
|
229
|
+
## Templates
|
|
230
|
+
|
|
231
|
+
- Keep templates simple and avoid complex logic
|
|
232
|
+
- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
|
|
233
|
+
- Use the async pipe to handle observables
|
|
234
|
+
|
|
235
|
+
## Services
|
|
236
|
+
|
|
237
|
+
- Design services around a single responsibility
|
|
238
|
+
- Use the `providedIn: 'root'` option for singleton services
|
|
239
|
+
- Use the `inject()` function instead of constructor injection
|
|
240
|
+
```
|
|
@@ -118,6 +118,23 @@ class UtilsService {
|
|
|
118
118
|
return [key, value];
|
|
119
119
|
}));
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Strips out the first parentheses block from the given text.
|
|
123
|
+
* This method looks for the first occurrence of parentheses in the text,
|
|
124
|
+
* removes the content within them, and returns the modified text.
|
|
125
|
+
* @param {string} text - The text from which to strip the first parentheses block.
|
|
126
|
+
* @returns {string} - The modified text with the first parentheses block removed.
|
|
127
|
+
*/
|
|
128
|
+
stripFirstParenthesesBlock(text) {
|
|
129
|
+
const open = text.indexOf('(');
|
|
130
|
+
const close = text.indexOf(')', open);
|
|
131
|
+
if (open !== -1 && close !== -1 && close > open) {
|
|
132
|
+
const before = text.slice(0, open);
|
|
133
|
+
const after = text.slice(close + 1);
|
|
134
|
+
return (before + after).trim();
|
|
135
|
+
}
|
|
136
|
+
return text.trim();
|
|
137
|
+
}
|
|
121
138
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
122
139
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: UtilsService, providedIn: 'root' });
|
|
123
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-utils-service.mjs","sources":["../../../projects/opal-frontend-common/services/utils-service/utils.service.ts","../../../projects/opal-frontend-common/services/utils-service/hmcts-opal-frontend-common-services-utils-service.ts"],"sourcesContent":["import { ViewportScroller } from '@angular/common';\nimport { inject, Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UtilsService {\n private readonly viewportScroller = inject(ViewportScroller);\n\n /**\n * Converts the first letter of a string to uppercase.\n * @param str - The input string.\n * @returns The input string with the first letter capitalized.\n */\n public upperCaseFirstLetter(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }\n\n /**\n * Converts the entire string to uppercase.\n * @param str - The input string.\n * @returns The input string in uppercase.\n */\n public upperCaseAllLetters(str: string): string {\n return str.toUpperCase();\n }\n\n /**\n * Converts a number to a monetary string representation.\n * @param amount - The number to convert.\n * @returns The monetary string representation of the number.\n */\n public convertToMonetaryString(amount: number | string): string {\n if (typeof amount === 'string') {\n amount = parseFloat(amount);\n }\n return `£${amount.toFixed(2)}`;\n }\n\n /**\n * Formats a 6-digit number or string as a sort code.\n * @param value - The 6-digit value to format.\n * @returns The formatted sort code string (xx-xx-xx).\n */\n public formatSortCode(value: string | number): string {\n const sortCode = value.toString();\n return `${sortCode.slice(0, 2)}-${sortCode.slice(2, 4)}-${sortCode.slice(4, 6)}`;\n }\n\n /**\n * Filters out null or empty strings from an array of address lines.\n *\n * @param address - An array of address lines which may contain strings or null values.\n * @returns A new array containing only non-empty strings from the input array.\n */\n public formatAddress(address: (string | null)[]): string[] {\n return address.filter((line): line is string => !!line?.trim());\n }\n\n /**\n * Scrolls the viewport to the top of the page.\n * Utilizes the `viewportScroller` service to scroll to the position [0, 0].\n */\n public scrollToTop(): void {\n this.viewportScroller.scrollToPosition([0, 0]);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public checkFormValues(form: { [key: string]: any }): boolean {\n return Object.values(form).some((value) => {\n return Array.isArray(value) ? value.length > 0 : Boolean(value);\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public checkFormArrayValues(forms: { [key: string]: any }[]): boolean {\n return forms.every((form) => this.checkFormValues(form));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public getFormStatus(form: { [key: string]: any }, providedMessage: string, notProvidedMessage: string): string {\n return this.checkFormValues(form) ? providedMessage : notProvidedMessage;\n }\n\n public getArrayFormStatus(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n forms: { [key: string]: any }[],\n providedMessage: string,\n notProvidedMessage: string,\n ): string {\n return forms.every((form) => this.checkFormValues(form)) ? providedMessage : notProvidedMessage;\n }\n\n /**\n * Copies the provided string value to the clipboard.\n *\n * @param value - The string value to be copied to the clipboard.\n *\n * @remarks\n * This method uses the `navigator.clipboard.writeText` API to copy text to the clipboard.\n * Ensure that the browser supports the Clipboard API before using this method.\n */\n public copyToClipboard(value: string): Promise<void> {\n return navigator.clipboard.writeText(value);\n }\n\n /**\n * Recursively filters out properties from an object where the value is `null` or `undefined`.\n *\n * @param obj - The object to filter. Can include nested objects.\n * @returns A new object with only non-null and non-undefined values.\n *\n * @example\n * ```ts\n * const input = {\n * a: 1,\n * b: null,\n * c: undefined,\n * d: 'hello',\n * e: { x: null, y: 2 },\n * f: { z: undefined },\n * };\n * const result = filterNullOrUndefined(input);\n * console.log(result); // Output: { a: 1, d: 'hello', e: { y: 2 } }\n * ```\n */\n public filterNullOrUndefined(obj: Record<string, unknown>): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(obj)\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .filter(([_, value]) => value !== null && value !== undefined)\n .map(([key, value]) => {\n if (typeof value === 'object' && !Array.isArray(value) && value !== null) {\n return [key, this.filterNullOrUndefined(value as Record<string, unknown>)];\n }\n return [key, value];\n }),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAMa,YAAY,CAAA;AACN,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAE5D;;;;AAIG;AACI,IAAA,oBAAoB,CAAC,GAAW,EAAA;AACrC,QAAA,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD;AAEA;;;;AAIG;AACI,IAAA,mBAAmB,CAAC,GAAW,EAAA;AACpC,QAAA,OAAO,GAAG,CAAC,WAAW,EAAE;IAC1B;AAEA;;;;AAIG;AACI,IAAA,uBAAuB,CAAC,MAAuB,EAAA;AACpD,QAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC9B,YAAA,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC7B;QACA,OAAO,CAAA,CAAA,EAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;IAChC;AAEA;;;;AAIG;AACI,IAAA,cAAc,CAAC,KAAsB,EAAA;AAC1C,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE;AACjC,QAAA,OAAO,CAAA,EAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAE;IAClF;AAEA;;;;;AAKG;AACI,IAAA,aAAa,CAAC,OAA0B,EAAA;AAC7C,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,KAAqB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;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K,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;aAC5D,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;AACpB,YAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,EAAE;gBACxE,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,qBAAqB,CAAC,KAAgC,CAAC,CAAC;YAC5E;AACA,YAAA,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC;QACrB,CAAC,CAAC,CACL;IACH;
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-services-utils-service.mjs","sources":["../../../projects/opal-frontend-common/services/utils-service/utils.service.ts","../../../projects/opal-frontend-common/services/utils-service/hmcts-opal-frontend-common-services-utils-service.ts"],"sourcesContent":["import { ViewportScroller } from '@angular/common';\nimport { inject, Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UtilsService {\n private readonly viewportScroller = inject(ViewportScroller);\n\n /**\n * Converts the first letter of a string to uppercase.\n * @param str - The input string.\n * @returns The input string with the first letter capitalized.\n */\n public upperCaseFirstLetter(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }\n\n /**\n * Converts the entire string to uppercase.\n * @param str - The input string.\n * @returns The input string in uppercase.\n */\n public upperCaseAllLetters(str: string): string {\n return str.toUpperCase();\n }\n\n /**\n * Converts a number to a monetary string representation.\n * @param amount - The number to convert.\n * @returns The monetary string representation of the number.\n */\n public convertToMonetaryString(amount: number | string): string {\n if (typeof amount === 'string') {\n amount = parseFloat(amount);\n }\n return `£${amount.toFixed(2)}`;\n }\n\n /**\n * Formats a 6-digit number or string as a sort code.\n * @param value - The 6-digit value to format.\n * @returns The formatted sort code string (xx-xx-xx).\n */\n public formatSortCode(value: string | number): string {\n const sortCode = value.toString();\n return `${sortCode.slice(0, 2)}-${sortCode.slice(2, 4)}-${sortCode.slice(4, 6)}`;\n }\n\n /**\n * Filters out null or empty strings from an array of address lines.\n *\n * @param address - An array of address lines which may contain strings or null values.\n * @returns A new array containing only non-empty strings from the input array.\n */\n public formatAddress(address: (string | null)[]): string[] {\n return address.filter((line): line is string => !!line?.trim());\n }\n\n /**\n * Scrolls the viewport to the top of the page.\n * Utilizes the `viewportScroller` service to scroll to the position [0, 0].\n */\n public scrollToTop(): void {\n this.viewportScroller.scrollToPosition([0, 0]);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public checkFormValues(form: { [key: string]: any }): boolean {\n return Object.values(form).some((value) => {\n return Array.isArray(value) ? value.length > 0 : Boolean(value);\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public checkFormArrayValues(forms: { [key: string]: any }[]): boolean {\n return forms.every((form) => this.checkFormValues(form));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public getFormStatus(form: { [key: string]: any }, providedMessage: string, notProvidedMessage: string): string {\n return this.checkFormValues(form) ? providedMessage : notProvidedMessage;\n }\n\n public getArrayFormStatus(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n forms: { [key: string]: any }[],\n providedMessage: string,\n notProvidedMessage: string,\n ): string {\n return forms.every((form) => this.checkFormValues(form)) ? providedMessage : notProvidedMessage;\n }\n\n /**\n * Copies the provided string value to the clipboard.\n *\n * @param value - The string value to be copied to the clipboard.\n *\n * @remarks\n * This method uses the `navigator.clipboard.writeText` API to copy text to the clipboard.\n * Ensure that the browser supports the Clipboard API before using this method.\n */\n public copyToClipboard(value: string): Promise<void> {\n return navigator.clipboard.writeText(value);\n }\n\n /**\n * Recursively filters out properties from an object where the value is `null` or `undefined`.\n *\n * @param obj - The object to filter. Can include nested objects.\n * @returns A new object with only non-null and non-undefined values.\n *\n * @example\n * ```ts\n * const input = {\n * a: 1,\n * b: null,\n * c: undefined,\n * d: 'hello',\n * e: { x: null, y: 2 },\n * f: { z: undefined },\n * };\n * const result = filterNullOrUndefined(input);\n * console.log(result); // Output: { a: 1, d: 'hello', e: { y: 2 } }\n * ```\n */\n public filterNullOrUndefined(obj: Record<string, unknown>): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(obj)\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .filter(([_, value]) => value !== null && value !== undefined)\n .map(([key, value]) => {\n if (typeof value === 'object' && !Array.isArray(value) && value !== null) {\n return [key, this.filterNullOrUndefined(value as Record<string, unknown>)];\n }\n return [key, value];\n }),\n );\n }\n\n /**\n * Strips out the first parentheses block from the given text.\n * This method looks for the first occurrence of parentheses in the text,\n * removes the content within them, and returns the modified text.\n * @param {string} text - The text from which to strip the first parentheses block.\n * @returns {string} - The modified text with the first parentheses block removed.\n */\n public stripFirstParenthesesBlock(text: string): string {\n const open = text.indexOf('(');\n const close = text.indexOf(')', open);\n if (open !== -1 && close !== -1 && close > open) {\n const before = text.slice(0, open);\n const after = text.slice(close + 1);\n return (before + after).trim();\n }\n return text.trim();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAMa,YAAY,CAAA;AACN,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAE5D;;;;AAIG;AACI,IAAA,oBAAoB,CAAC,GAAW,EAAA;AACrC,QAAA,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD;AAEA;;;;AAIG;AACI,IAAA,mBAAmB,CAAC,GAAW,EAAA;AACpC,QAAA,OAAO,GAAG,CAAC,WAAW,EAAE;IAC1B;AAEA;;;;AAIG;AACI,IAAA,uBAAuB,CAAC,MAAuB,EAAA;AACpD,QAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC9B,YAAA,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC7B;QACA,OAAO,CAAA,CAAA,EAAI,MAAM,CAAC,OAAO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I,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;YAClC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;YACnC,OAAO,CAAC,MAAM,GAAG,KAAK,EAAE,IAAI,EAAE;QAChC;AACA,QAAA,OAAO,IAAI,CAAC,IAAI,EAAE;IACpB;uGAtJW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAZ,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cAFX,MAAM,EAAA,CAAA;;2FAEP,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACLD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -81,6 +81,14 @@ declare class UtilsService {
|
|
|
81
81
|
* ```
|
|
82
82
|
*/
|
|
83
83
|
filterNullOrUndefined(obj: Record<string, unknown>): Record<string, unknown>;
|
|
84
|
+
/**
|
|
85
|
+
* Strips out the first parentheses block from the given text.
|
|
86
|
+
* This method looks for the first occurrence of parentheses in the text,
|
|
87
|
+
* removes the content within them, and returns the modified text.
|
|
88
|
+
* @param {string} text - The text from which to strip the first parentheses block.
|
|
89
|
+
* @returns {string} - The modified text with the first parentheses block removed.
|
|
90
|
+
*/
|
|
91
|
+
stripFirstParenthesesBlock(text: string): string;
|
|
84
92
|
static ɵfac: i0.ɵɵFactoryDeclaration<UtilsService, never>;
|
|
85
93
|
static ɵprov: i0.ɵɵInjectableDeclaration<UtilsService>;
|
|
86
94
|
}
|
package/styles/styles.scss
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
/* You can add global styles to this file, and also import other style files */
|
|
2
|
+
|
|
3
|
+
/* ==========================================================================
|
|
4
|
+
Library Dependencies
|
|
5
|
+
==========================================================================
|
|
6
|
+
These imports include external styles used across the application.
|
|
7
|
+
*/
|
|
2
8
|
@import 'govuk-frontend/dist/govuk/all.scss';
|
|
3
|
-
@import '
|
|
9
|
+
@import '@ministryofjustice/frontend/moj/all.scss';
|
|
10
|
+
@import 'accessible-autocomplete/dist/accessible-autocomplete.min.css';
|
|
4
11
|
@import 'home-office-kit/sass/_loadingSpinner.scss';
|
|
12
|
+
|
|
13
|
+
/* ==========================================================================
|
|
14
|
+
Custom Component Styles
|
|
15
|
+
==========================================================================
|
|
16
|
+
Custom Component Styles authored within the OPAL Frontend Common UI Library.
|
|
17
|
+
*/
|
|
18
|
+
@import './custom/_custom-section_break.scss';
|
|
5
19
|
@import './custom/custom-scrollable-panes';
|
|
6
20
|
|
|
7
21
|
html,
|