/*! Copyright © 2024 Open Text Corporation, All Rights Reserved. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ import { OcpdComponentRegister } from '../singletons/ocpd-component-register'; import { OcpdFormClientAPIService } from '../singletons/ocpd-form-client-api-service'; import { OcpdFormSchemaManager } from '../singletons/ocpd-form-schema-manager'; import { OcpdItemManagerHelper } from '../singletons/ocpd-item-manager-helper'; import { OcpdLocalizationService } from '../singletons/ocpd-localization-service'; import { Constraint } from '../singletons/ocpd-constraints-config'; interface OpenDialogOptions { linkedConstraints: Constraint[]; /** Stale properties as it has linked constraints. */ pathsWithLinkedConstraints?: string[]; /** Called when the user completes the primary action (e.g. Delete / Confirm) in the dialog. */ onActionComplete?: (itemId: string) => Promise; /** For type-change scenario: the new repeating value being applied. */ isRepeating?: boolean; } export declare class OcpdEditConstraints { private readonly _staleModelId; private readonly _typeChangeModelId; _popupContext: Record; /** Property-name segments for every element currently pending deletion (stale scenario). */ private _stalePropertyNames; /** For type-change scenario: the repeating value being converted to. */ _pendingRepeatingValue: boolean; private readonly _ocpdItemManagerHelper; private readonly _ocpdFormSchemaManager; private readonly _ocpdFormClientAPIService; private readonly _ocpdLocalizationService; private readonly _ocpdComponentRegister; private readonly _ocpdStringLocalizationHelper; private _localeDataGeneral; private _localeDataConstraintsEditor; constructor(ocpdItemManagerHelper: OcpdItemManagerHelper, ocpdFormSchemaManager: OcpdFormSchemaManager, ocpdFormClientAPIService: OcpdFormClientAPIService, ocpdLocalizationService: OcpdLocalizationService, ocpdComponentRegister: OcpdComponentRegister); get staleModelId(): string; get typeChangeModelId(): string; userInterfaceLocaleChanged(_locale?: string): Promise; getStalePropertyNames(): string[]; openDialog(itemId: string, options: OpenDialogOptions): Promise; openConstraintsDialog(options: { modelItemId: string; model: any; rootSchema: any; buttons: any[]; title: string; closeInterceptor?: (event: any, button: any) => void; dialogCompleteEventHandler?: (event: any) => void; }): Promise<{ root: HTMLElement; sendMessageToRuntime: (message: any) => void; }>; saveRow(itemId: string, rowId: string): void; revertRow(itemId: string, rowId: string): Promise; executeRowAction(action: string, rowId: string, itemId: string): Promise; loadErrors(itemId: string): Promise; loadRowError(constraint: Constraint, constraintIndex: number, problems: any[], itemId: string): void; private loadStaleRowError; private loadTypeChangeRowError; hasErrors(itemId: string): boolean; clearRowErrors(itemId: string, rowId: string): void; toggleDeleteButton(itemId: string): void; toggleRowSaveButton(rowId: string, itemId: string, problems: any[]): void; doesRowHaveError(itemId: string, rowId: string, problems: any[]): boolean; showConfirmationDialog(itemId: string, rowId: string): Promise; private createModel; private destroyModel; private deleteRow; private resolveRowContext; private createErrorForConstraint; private getDialogButtons; private getDialogTitle; private getDialogSubtitle; updateDialogStyles(itemId: string, count?: number, title?: string): void; private getConfirmationDialogTitle; private updateConfirmationDialogStyles; private getConfirmationDialogJson; getConstraintsDialogJson(modelId?: string): { id: string; controls: { width: string; height: string; type: string; id: string; rearrangeControlsForSmallScreens: boolean; title: { show: boolean; text: string; }; controls: { type: string; numberOfColumns: number; grid: { gap: number; gridTemplateRows: string; }; id: string; controls: ({ gridColumnStart: number; gridColumnEnd: number; gridRowStart: number; gridRowEnd: number; type: string; header: { show: boolean; }; id: string; title: { text: string; }; propertyPath: string; columns: ({ controlData: { dataType: string; id: string; isInGrid: boolean; label: { text: string; show: boolean; alignment?: undefined; }; propertyPath: string; type: string; disabled: boolean; customData: { allowUserInput: boolean; }; style: string; columns?: undefined; class?: undefined; backgroundColor?: undefined; backgroundImage?: undefined; border?: undefined; }; width?: undefined; } | { controlData: { id: string; isInGrid: boolean; label: { text: string; show: boolean; alignment?: undefined; }; columns: { controlData: { id: string; isInGrid: boolean; label: { text: string; show: boolean; }; propertyPath: string; type: string; customData: { allowFilters: boolean; }; }; width: string; }[]; propertyPath: string; type: string; dataType?: undefined; disabled?: undefined; customData?: undefined; style?: undefined; class?: undefined; backgroundColor?: undefined; backgroundImage?: undefined; border?: undefined; }; width: number; } | { controlData: { id: string; isInGrid: boolean; label: { text: string; show: boolean; alignment: string; }; class: string; type: string; backgroundColor: string; backgroundImage: string; border: string; propertyPath: string; style: string; dataType?: undefined; disabled?: undefined; customData?: undefined; columns?: undefined; }; width: number; } | { controlData: { id: string; isInGrid: boolean; label: { text: string; show: boolean; alignment: string; }; type: string; propertyPath: string; style: string; dataType?: undefined; disabled?: undefined; customData?: undefined; columns?: undefined; class?: undefined; backgroundColor?: undefined; backgroundImage?: undefined; border?: undefined; }; width?: undefined; })[]; allowAdd: boolean; retainRowSelection: boolean; showRowActions: boolean; label?: undefined; placeholder?: undefined; } | { label: { text: string; }; gridColumnStart: number; gridColumnEnd: number; gridRowStart: number; gridRowEnd: number; propertyPath: string; placeholder: string; type: string; id: string; header?: undefined; title?: undefined; columns?: undefined; allowAdd?: undefined; retainRowSelection?: undefined; showRowActions?: undefined; })[]; }[]; }[]; }; } export {};