Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"builder": "@angular-builders/custom-webpack:ng-packagr",
"options": {
"project": "ng-package.json"
"project": "ng-package.json",
"customWebpackConfig": {
"path": "./webpack.config.js"
}
},
"configurations": {
"allowedNonPeerDependencies": {},
Expand Down Expand Up @@ -89,13 +92,16 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"preserveSymlinks": true,
"outputPath": "www",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": ["src/polyfills.ts", "zone.js", "zone.js/testing"],
"customWebpackConfig": {
"path": "./webpack.config.js"
},

"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
Expand Down
1,612 changes: 441 additions & 1,171 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"on-first-run": "npx update-scripts --boot",
"set-git-auth": "git config url.\"https://api:$(cat .token)@github.com/\".insteadOf \"https://github.com/\" && git config url.\"https://ssh:$(cat .token)@github.com/\".insteadOf \"ssh://git@github.com/\" && git config url.\"https://git:$(cat .token)@github.com/\".insteadOf \"git@github.com:\"",
"flash-forward": "npx npm-check-updates -u && npm run do-install",
"update-dependencies": "PREFIX=\"decaf-ts\"; npm ls | grep \"$PREFIX\" | awk -F/ '{print $NF}' | sed 's/@.*//' | xargs -I package npm update --force @\"$PREFIX\"/package && ng cache clean",
"update-dependencies": "NPM_TOKEN=$(cat .npmtoken) PREFIX=\"decaf-ts\"; npm ls | grep \"$PREFIX\" | awk -F/ '{print $NF}' | sed 's/@.*//' | xargs -I package npm update --force @\"$PREFIX\"/package && ng cache clean",
"update-decaf": "NPM_TOKEN=$(cat .npmtoken) PREFIX=\"decaf-ts\"; npm ls | grep \"$PREFIX\" | awk -F/ '{print $NF}' | sed 's/@.*//' | xargs -I package npm update @\"$PREFIX\"/package",
"reset": "rm -rf * && git checkout . && git pull && npm run do-install",
"build:prod": "npm run lint && ng build for-angular && ng build for-angular-app",
"build": "npx rimraf .angular && npm run lint && ng build for-angular --configuration development && ng build for-angular-app --configuration development && npm run build:cli",
Expand Down Expand Up @@ -81,6 +82,7 @@
"@types/jest": "^30.0.0",
"@types/node": "^22.15.24",
"angular-eslint": "^20.2.0",
"eslint": "^9.29.0",
"eslint-plugin-storybook": "9.1.5",
"eslint-plugin-unused-imports": "^4.4.1",
"ffmpeg-static": "5.2.0",
Expand All @@ -93,6 +95,7 @@
"typescript-eslint": "8.34.1"
},
"peerDependencies": {
"@angular-builders/custom-webpack": "^20.0.0",
"@angular/animations": "^20.3.16",
"@angular/common": "^20.3.16",
"@angular/compiler": "^20.3.16",
Expand Down Expand Up @@ -131,5 +134,9 @@
"minimatch": "^10.2.2",
"test-exclude": "7.0.1",
"ajv": "^8.17.2"
},
"browser": {
"worker_threads": false,
"node:worker_threads": false
}
}
15 changes: 1 addition & 14 deletions src/app/ew/fabric/Leaflet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
uilistmodel,
uimodel,
uionrender,
uitablecol
uitablecol,
} from '@decaf-ts/ui-decorators';
import { getDocumentTypes, getLeafletLanguages, getMarkets } from 'src/app/ew/utils/helpers';
import { Batch } from './Batch';
Expand Down Expand Up @@ -121,19 +121,6 @@ export class Leaflet extends Cacheable {
options: () => Batch,
})
@uionrender(() => LeafletHandler)
// @uionrender(
// () =>
// class _ extends DecafEventHandler {
// override async render(): Promise<void> {
// const instance = this as unknown as {
// headers: string[];
// operation: OperationKeys[];
// };
// if (instance.headers)
// instance.headers = instance.headers.map((header) => (header === 'batchNumber' ? 'batchCol' : header));
// }
// }
// )
@uitablecol(1, async (instance: DecafComponent<Model> & { type: string }, prop: string, value: string) => {
if (instance.operation && ['paginated', 'infinite'].includes(instance.type)) value = 'subinfo'; // fallback mapper to list item position
return value;
Expand Down
2 changes: 1 addition & 1 deletion src/app/ew/fabric/handlers/LeafletHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class LeafletHandler extends NgxEventHandler {
if (query?.length) {
operation = OperationKeys.UPDATE;
result = await LeafletHandler.parseFileContent(Object.assign(query[0], data), repository);
result = await repository.update(Object.assign(query[0], data));
result = await repository.update(result);
} else {
result = await LeafletHandler.parseFileContent(model as Model, repository);
result = await repository.create(model as Model);
Expand Down
82 changes: 66 additions & 16 deletions src/lib/components/crud-field/crud-field.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
@if (operation === OperationKeys.READ || operation === OperationKeys.DELETE || readonly) {
@if (
operation === OperationKeys.READ ||
operation === OperationKeys.DELETE ||
readonly
) {
@if (!hidden) {
<ng-container>
<div>
<ion-item
[class.dcf-item-readonly]="readonly && operation !== OperationKeys.READ"
[class.dcf-item-readonly]="
readonly && operation !== OperationKeys.READ
"
[class]="'dcf-input-item ' + operation"
#component
>
Expand All @@ -15,11 +21,18 @@
{{ label | translate }}
<br />
@if (type !== 'checkbox' && value) {
<ion-text [innerHTML]="type === 'password' ? '********' : value"></ion-text>
<ion-text
[innerHTML]="type === 'password' ? '********' : value"
></ion-text>
} @else {
@if (type === 'checkbox') {
<ion-badge mode="md" color="light">
<ion-text [color]="!value ? 'danger' : 'primary'">{{ value }}</ion-text>
<ion-badge
mode="md"
color="light"
>
<ion-text [color]="!value ? 'danger' : 'primary'">
{{ value }}
</ion-text>
</ion-badge>
} @else {
<ion-text [innerHTML]="value"></ion-text>
Expand Down Expand Up @@ -66,7 +79,10 @@
></ion-textarea>
} @else if (type === HTML5InputTypes.CHECKBOX) {
@if (!options?.length) {
<ion-item class="dcf-width-1-1" [hidden]="hidden">
<ion-item
class="dcf-width-1-1"
[hidden]="hidden"
>
<ion-checkbox
(ionInput)="handleModalChildChanges($event, formControl)"
(ionChange)="handleModalChildChanges($event, formControl)"
Expand All @@ -87,9 +103,17 @@
</ion-item>
} @else {
<div class="dcf-checkbox-group">
<label class="dcf-label" [for]="path">{{ label | translate }}</label>
<label
class="dcf-label"
[for]="path"
>
{{ label | translate }}
</label>
@for (option of options; track trackItemFn($index, option.text)) {
<ion-item class="dcf-width-1-1" [button]="true">
<ion-item
class="dcf-width-1-1"
[button]="true"
>
<ion-checkbox
(ionInput)="handleModalChildChanges($event, formControl)"
(ionChange)="handleModalChildChanges($event, formControl)"
Expand All @@ -103,11 +127,16 @@
(ionChange)="toggleOptionSelection(option.value, $event)"
#component
>
<span>{{ $index + 1 }}. {{ option?.text | translate }}</span>
<span>
{{ $index + 1 }}. {{ option?.text | translate }}
</span>
</ion-checkbox>
</ion-item>
}
<span class="dcf-error" [innerHTML]="getErrors(container)"></span>
<span
class="dcf-error"
[innerHTML]="getErrors(container)"
></span>
</div>
}
} @else if (type === HTML5InputTypes.RADIO && options?.length) {
Expand All @@ -117,14 +146,18 @@
[value]="value"
#component
>
<label class="dcf-radio-group-label" [for]="path">{{ label | translate }}</label>
<label
class="dcf-radio-group-label"
[for]="path"
>
{{ label | translate }}
</label>
@for (option of options; track $index) {
<ion-item>
<ion-radio
(ionInput)="handleModalChildChanges($event, formControl)"
(ionChange)="handleModalChildChanges($event, formControl)"
[id]="name"
[errorText]="getErrors(container)"
[mode]="'md'"
[hidden]="hidden"
[labelPlacement]="labelPlacement"
Expand All @@ -135,10 +168,17 @@
>
{{ option?.text | translate }}
</ion-radio>
<span
class="dcf-error"
[innerHTML]="getErrors(container)"
></span>
</ion-item>
}
</ion-radio-group>
<span class="dcf-error" [innerHTML]="getErrors(container)"></span>
<span
class="dcf-error"
[innerHTML]="getErrors(container)"
></span>
} @else if (type === HTML5InputTypes.SELECT) {
<div>
<ion-select
Expand All @@ -162,7 +202,10 @@
#component
>
@if (options?.length) {
@for (option of options; track trackItemFn($index, option.text)) {
@for (
option of options;
track trackItemFn($index, option.text)
) {
<ion-select-option
[value]="option.value"
[class.dcf-disabled]="option.disabled"
Expand All @@ -173,14 +216,21 @@
</ion-select-option>
}
}
@if ((value && !required) || (!required && value !== undefined && value !== '')) {
@if (
(value && !required) ||
(!required && value !== undefined && value !== '')
) {
<ion-button
fill="clear"
(click)="handleClearValue($event)"
slot="end"
aria-label="Show/hide password"
>
<ngx-decaf-icon size="small" slot="icon-only" [name]="'ti-input-x'" />
<ngx-decaf-icon
size="small"
slot="icon-only"
[name]="'ti-input-x'"
/>
</ion-button>
}
</ion-select>
Expand Down
Loading
Loading