feat(layout): enhance topbar with customizable templates and full-page support
- Updated app.layout.component.html to include start, center, and end templates for the topbar. - Modified app.layout.component.ts to manage new template references and added isFullPage getter. - Refactored app.topbar.component.html to utilize new templates and improved layout structure. - Enhanced app.topbar.component.ts to accept new input properties for templates. - Updated layout.service.ts to manage full-page state and new topbar slots. - Added new payment bridge services for POS functionality. - Introduced greater validator for form validation. - Improved dialog component to support mobile drawer and responsive design. - Updated styles for better mobile support and layout adjustments. - Added new main menu sidebar for POS with dynamic content.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { Maybe } from '../models';
|
||||
|
||||
interface INativeBridgeHost {
|
||||
pay?: (payload: string) => unknown;
|
||||
@@ -8,8 +9,7 @@ interface INativeBridgeHost {
|
||||
|
||||
export interface INativePayRequest {
|
||||
amount: number;
|
||||
totalAmount: number;
|
||||
invoiceDate: string;
|
||||
id: Maybe<string>;
|
||||
}
|
||||
|
||||
export interface INativePrintRequest {
|
||||
@@ -55,9 +55,9 @@ export class NativeBridgeService {
|
||||
}
|
||||
|
||||
private invoke(method: 'pay' | 'print', payload: object): INativeBridgeResult {
|
||||
if (!this.isEnabled()) {
|
||||
return { success: false, error: 'Native bridge is disabled for this tenant.' };
|
||||
}
|
||||
// if (!this.isEnabled()) {
|
||||
// return { success: false, error: 'Native bridge is disabled for this tenant.' };
|
||||
// }
|
||||
|
||||
const fn = this.host?.[method];
|
||||
if (typeof fn !== 'function') {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';
|
||||
|
||||
/**
|
||||
* Strictly checks numeric value is greater than `minValue` (not equal).
|
||||
* Empty values are treated as valid; combine with `Validators.required` when needed.
|
||||
*/
|
||||
export function greaterThanValidator(minValue: number): ValidatorFn {
|
||||
return (control: AbstractControl): ValidationErrors | null => {
|
||||
const v = control.value;
|
||||
if (v === null || v === undefined || v === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
const numericValue = typeof v === 'number' ? v : Number(v);
|
||||
if (Number.isNaN(numericValue)) {
|
||||
return { greaterThan: 'مقدار باید عددی باشد' };
|
||||
}
|
||||
|
||||
return numericValue > minValue
|
||||
? null
|
||||
: {
|
||||
greaterThan: `مقدار باید بیشتر از ${minValue} باشد`,
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
export * from './fiscal-code.validator';
|
||||
export * from './greater.validator';
|
||||
export * from './iban.validator';
|
||||
export * from './mobile.validator';
|
||||
export * from './must-match.validator';
|
||||
|
||||
Reference in New Issue
Block a user