@yomotech/view-toolkit 1.0.38 → 1.0.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yomotech/view-toolkit",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^21.0.0",
6
6
  "@angular/common": "^21.0.0",
@@ -651,8 +651,6 @@ declare class CardComponent {
651
651
  declare class FormComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {
652
652
  /** Marks for the app's test runner (#166): field key and button action. */
653
653
  readonly vlFieldKey: typeof testFieldKey;
654
- readonly vlAction: typeof testAction;
655
- readonly vlWrites: typeof testWrites;
656
654
  private readonly remoteLists;
657
655
  /** Loaded lists by field reference. */
658
656
  remoteData: Record<string, any[]>;
@@ -675,8 +673,6 @@ declare class FormComponent implements OnInit, OnChanges, AfterViewInit, OnDestr
675
673
  readonly picker: DateTimePickerService;
676
674
  private readonly host;
677
675
  ngOnDestroy(): void;
678
- /** Keep existing checkbox data objects usable; new objects use boolean. */
679
- renderFieldType(type: string | undefined, field?: any): string | undefined;
680
676
  customEmailPattern: string;
681
677
  showPassword: boolean;
682
678
  formCopy: any;
@@ -698,25 +694,12 @@ declare class FormComponent implements OnInit, OnChanges, AfterViewInit, OnDestr
698
694
  };
699
695
  getSectionBodyStyle(formSection: any): any;
700
696
  getFieldWrapperStyle(formField: any): any;
701
- getFieldInnerLayoutStyle(formField: any): Record<string, any>;
702
697
  getScope(scope: any): string;
703
698
  togglePasswordVisibility(): void;
704
699
  invokeFormBtnClick(option: any, propertySchema: any): void;
705
700
  setformData(): void;
706
701
  setErroMessage(formField: any, errorMessages: any, field: any): string;
707
702
  setValidations(): void;
708
- matchData: any;
709
- getLabel(formField: any): any;
710
- dateChangeEvent(formField: any, event: any): void;
711
- onDateTyping(event: any): void;
712
- onTimeTyping(event: any): void;
713
- timeChangeEvent(formField: any, event: any): void;
714
- autocompChangeEvent(event: any, formfield: any): void;
715
- autocompFocusOutEvent(event: any, formfield: any): void;
716
- private getMediaProperty;
717
- getMediaSource(field: any): string;
718
- getMediaLabel(field: any): string;
719
- getMediaKind(field: any): 'image' | 'video' | 'audio' | 'pdf' | 'file';
720
703
  /**
721
704
  * A field's message shows once the user typed in it and left it, or after a save attempt - not
722
705
  * when an empty field was only passed through (the message then pushed the row and its label out
@@ -724,13 +707,6 @@ declare class FormComponent implements OnInit, OnChanges, AfterViewInit, OnDestr
724
707
  */
725
708
  saveTried: boolean;
726
709
  showError(control: any): boolean;
727
- /**
728
- * The toolkit keyboard of a field - the same rule as the dialog: the field's keyboardType (or the
729
- * older keyboard; native/none = the device's own), else from its attribute type. #166 step 4.2
730
- */
731
- keyboardTypeFor(field: any, propertySchema: any): CustomKeyboardType | null;
732
- /** The message of a field's first error (layout's own, project text, English) - #166 step 4.6. */
733
- fieldMessage(field: any, control: any): string;
734
710
  static ɵfac: i0.ɵɵFactoryDeclaration<FormComponent, never>;
735
711
  static ɵcmp: i0.ɵɵComponentDeclaration<FormComponent, "vl-form", never, { "errorMessages": { "alias": "errorMessages"; "required": false; }; "creditCardError": { "alias": "creditCardError"; "required": false; }; "form": { "alias": "form"; "required": false; }; "selectedLanguageInfo": { "alias": "selectedLanguageInfo"; "required": false; }; }, { "formButtonClick": "formButtonClick"; "checkBoxChangeEvent": "checkBoxChangeEvent"; }, never, never, true, never>;
736
712
  }
@@ -863,6 +839,15 @@ declare class GridComponent implements AfterViewInit, OnDestroy {
863
839
  cellControl(col: any): string;
864
840
  /** The DTO type of a column ("boolean" or a text flag for the switch). */
865
841
  propertyType(col: any): string;
842
+ /** The DTO type of a column as the data object declares it ("string", "quantity" ...). */
843
+ cellType(col: any): string;
844
+ /**
845
+ * An unlocked text or number cell is typed in; the action column saves the row. A column with a
846
+ * shared control (password, text area, switch, combobox, radio) is shown, not typed in.
847
+ */
848
+ inlineEditable(col: any): boolean;
849
+ /** An unlocked Boolean column without switch or radio ticks the row's value. */
850
+ checkboxEditable(col: any): boolean;
866
851
  static ɵfac: i0.ɵɵFactoryDeclaration<GridComponent, never>;
867
852
  static ɵcmp: i0.ɵɵComponentDeclaration<GridComponent, "vl-grid", never, { "errorMessages": { "alias": "errorMessages"; "required": false; }; "environment": { "alias": "environment"; "required": false; }; "selectedLanguageInfo": { "alias": "selectedLanguageInfo"; "required": false; }; "tableitemInfo": { "alias": "tableitemInfo"; "required": false; }; "form": { "alias": "form"; "required": false; }; "isTableDataLoad": { "alias": "isTableDataLoad"; "required": false; }; "currenTableOptions": { "alias": "currenTableOptions"; "required": false; }; "projectSeleted": { "alias": "projectSeleted"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "currentPage": { "alias": "currentPage"; "required": false; }; "pages": { "alias": "pages"; "required": false; }; "userInfo": { "alias": "userInfo"; "required": false; }; }, { "onPageChange": "onPageChange"; "onPageSizeChange": "onPageSizeChange"; "onGridScroll": "onGridScroll"; "showGridLink": "showGridLink"; "gridButtonClick": "gridButtonClick"; "gridIncreamentClick": "gridIncreamentClick"; "gridDecreamentClick": "gridDecreamentClick"; "gridImgClick": "gridImgClick"; }, never, never, true, never>;
868
853
  }
@@ -930,16 +915,10 @@ declare class ModelComponent implements OnChanges, OnDestroy {
930
915
  private utilityService;
931
916
  /** Marks for the app's test runner (#166): field key and button action. */
932
917
  readonly vlFieldKey: typeof testFieldKey;
933
- readonly vlAction: typeof testAction;
934
- readonly vlWrites: typeof testWrites;
935
918
  private readonly remoteLists;
936
- /** Keep existing checkbox data objects usable; new objects use boolean. */
937
- renderFieldType(type: string | undefined, field?: any): string | undefined;
938
919
  /** Date and time picker behaviour shared by all containers. */
939
920
  readonly picker: DateTimePickerService;
940
921
  private readonly host;
941
- /** The toolkit keyboard for a field, from option.keyboardType or the attribute type. */
942
- keyboardTypeFor(formField: any): CustomKeyboardType | null;
943
922
  matchData: any[];
944
923
  date2: Date | undefined;
945
924
  errorMessages: any;
@@ -957,8 +936,6 @@ declare class ModelComponent implements OnChanges, OnDestroy {
957
936
  private initializeDialogContent;
958
937
  private updateDialogHeader;
959
938
  updateLayoutLanguage<T>(schema: T, translations: Record<string, string>): T;
960
- getLabel(formField: any): any;
961
- getButtonCaption(formField: any): any;
962
939
  mapDataToPropertySchema(data: any, modalItemInfo: any): void;
963
940
  setAutoCompleteData(): Promise<void>;
964
941
  /** The field's backend list (RemoteListService - shared by every container). */
@@ -979,18 +956,15 @@ declare class ModelComponent implements OnChanges, OnDestroy {
979
956
  autocompFocusOutEvent(event: any, formField: any): void;
980
957
  autocompSelectEvent(obj: any, formField?: any): void;
981
958
  setErroMessage(formField: any, errorMessages: any, errorType: any): string;
982
- getStyleWithoutClasses(styleObject: any): {
983
- classes: any;
984
- style: any;
959
+ /** A style object of the layout: its classes (all of them) and its CSS. */
960
+ styleOf(styleObject: any): {
961
+ classes: string;
962
+ style: Record<string, any>;
985
963
  };
986
964
  getSectionBodyStyle(formSection: any): Record<string, any>;
987
965
  getFieldWrapperStyle(formField: any): Record<string, any>;
988
966
  onTimePanelShow(formField: any): void;
989
- getControlStyle(formField: any): Record<string, any>;
990
- getFieldInnerLayoutStyle(formField: any): Record<string, any>;
991
967
  dateChangeEvent(formField: any, value: any): void;
992
- onDateTyping(event: any): void;
993
- onTimeTyping(event: any): void;
994
968
  timeChangeEvent(formField: any, value: any): void;
995
969
  handleRules(formField: any, value: any): void;
996
970
  resetRule(rule: any, formField: any): void;
@@ -1000,10 +974,6 @@ declare class ModelComponent implements OnChanges, OnDestroy {
1000
974
  invokeFormBtnClick(option: any, propertySchema: any, form: NgForm): void;
1001
975
  checkValidty(form: NgForm): boolean;
1002
976
  onCancel(): void;
1003
- private getMediaProperty;
1004
- getMediaSource(field: any): string;
1005
- getMediaLabel(field: any): string;
1006
- getMediaKind(field: any): 'image' | 'video' | 'audio' | 'pdf' | 'file';
1007
977
  /**
1008
978
  * A field's message shows once the user typed in it and left it, or after a save attempt - not
1009
979
  * when an empty field was only passed through (the message then pushed the row and its label out
@@ -1250,6 +1220,7 @@ declare class SideMenuComponent implements AfterViewInit, OnChanges, OnDestroy {
1250
1220
  }
1251
1221
 
1252
1222
  declare class Autocomplete implements OnChanges {
1223
+ private host;
1253
1224
  /** the field of the layout (scope, option, label) */
1254
1225
  field: any;
1255
1226
  /** editing: the object whose value is the choice (the property in the property schema) */
@@ -1276,6 +1247,7 @@ declare class Autocomplete implements OnChanges {
1276
1247
  private autocomplete?;
1277
1248
  suggestions: any[];
1278
1249
  private lastQuery;
1250
+ constructor(host: ElementRef<HTMLElement>);
1279
1251
  /** the name of the field in the entries (the property's name, "workOrderNo") */
1280
1252
  get key(): string;
1281
1253
  get optionLabel(): string;
@@ -1285,9 +1257,18 @@ declare class Autocomplete implements OnChanges {
1285
1257
  complete(event: {
1286
1258
  query?: string;
1287
1259
  }): void;
1260
+ /** The entries changed while the list is open: its height and so its place change too. */
1261
+ private refit;
1288
1262
  /** the list arrived while open: show it for what was typed meanwhile */
1289
1263
  ngOnChanges(changes: SimpleChanges): void;
1290
1264
  private filter;
1265
+ /**
1266
+ * (onShow): the list stays inside the page frame - the dialog, else the window - and above a
1267
+ * keyboard docked below. It opens to the side with more room and gets shorter (scrolls) when the
1268
+ * room is small. Before, the list flipped upwards over the dialog's top edge up to the status bar
1269
+ * (phone in landscape, keyboard beside the dialog - test F15).
1270
+ */
1271
+ fitList(): void;
1291
1272
  changed(value: any): void;
1292
1273
  placeholder(): string;
1293
1274
  showError(): boolean;
@@ -1990,5 +1971,131 @@ declare class MediaControl {
1990
1971
  static ɵcmp: i0.ɵɵComponentDeclaration<MediaControl, "vl-media", never, { "field": { "alias": "field"; "required": false; }; "value": { "alias": "value"; "required": false; }; "property": { "alias": "property"; "required": false; }; "compact": { "alias": "compact"; "required": false; }; "mediaStyle": { "alias": "mediaStyle"; "required": false; }; "mediaClass": { "alias": "mediaClass"; "required": false; }; }, { "clicked": "clicked"; }, never, never, true, never>;
1991
1972
  }
1992
1973
 
1993
- export { AppVersionResetService, Autocomplete, BACKEND_PROXY_PREFIX, CardComponent, CheckboxControl, ConfigService, Couchdb, CustomKeyboardComponent, CustomKeyboardDirective, CustomKeyboardService, DateFormatPipe, DateHintPipe, DateRangeControl, DateTextPipe, DateTimeControl, DropdownControl, FormComponent, GridComponent, HeaderMenuComponent, LogsComponent, MediaControl, MediaSourcePipe, MobileKeycloakService, MobileOidcService, MobileOktaService, ModelComponent, NetworkLogService, NotificationService, NumberControl, PaginationComponent, PasswordControl, PlaceholderPipe, READ_ATTEMPT_TIMEOUT, REQUEST_STAGES, RETRY_PAUSES, RETRY_STATUSES, RadioControl, RemoteListService, RequestService, RequestTimeoutError, RequestTimeoutService, RulesPipe, SIDE_DOCK_CLASS, SideMenuComponent, SwitchControl, TextareaControl, Textbox, UtilityService, ViewToolkitModule, VisiblePipe, backendUrl, currencyDigits, currentDateLanguage, dateDigitCount, dateInputPattern, displayDateValue, displayNumber, fieldInnerLayoutStyle, fieldModel, fieldRules, fixedTimeText, inputFormatHint, isNativeMobile, isNativePhone, languageDatePattern, layoutPlaceholder, mediaKind, normalizeCustomKeyboardType, numberShape, numberStep, numberSuffix, primeDatePattern, resolveCustomKeyboardType, resolvePlaceholder, ruleMessage, setDateLanguage, setInputHintLanguage, setToolkitKeyboardOnWeb, shapeDateDigits, shapeTimeText, sideDockWidth, splitReference, stagedRead, stagedRequest, storedToTyped, testAction, testFieldKey, testWrites, timeHourFormat, toggleMeridiem, toolkitKeyboardActive, typedToStored, usesTwelveHours, visibleFields, whenOnline };
1994
- export type { CustomKeyboardTarget, CustomKeyboardType, FieldKind, FieldModel, FieldRules, MediaKind, MobileAuthTokens, MobileOktaRefresh, MobileOktaTokens, NumberShape, OidcProvider, OidcRefresh, OidcTokens, RequestTimeoutMessages, StagedReadOptions };
1974
+ /** The building blocks <vl-control> draws a field with. */
1975
+ type ControlKind = 'button' | 'media' | 'creditCard' | 'text' | 'password' | 'textarea' | 'autocomplete' | 'combobox' | 'dropdown' | 'radio' | 'checkbox' | 'switch' | 'number' | 'date' | 'time' | 'datetime' | 'daterange';
1976
+ /** The property a field is bound to (scope.reference) in the page's property schema, or undefined. */
1977
+ declare function controlProperty(field: any, propertySchema: any): any;
1978
+ /**
1979
+ * The building block of a field:
1980
+ * - no scope.reference: a button (layout field without a property)
1981
+ * - the property type decides media, credit card and the period (dateRange)
1982
+ * - otherwise the control (option.control, or the field catalog's choice for the type)
1983
+ */
1984
+ declare function controlKind(field: any, property: any): ControlKind;
1985
+ /**
1986
+ * A style object of the layout split into its classes and its CSS: { classes: ['a', 'b'], color }
1987
+ * -> { classes: 'a b', style: { color } }. Every class counts, not only the first.
1988
+ */
1989
+ declare function styleParts(styleObject: any): {
1990
+ classes: string;
1991
+ style: Record<string, any>;
1992
+ };
1993
+
1994
+ declare class ControlComponent implements OnChanges {
1995
+ /** the field of the layout (formField) */
1996
+ field: any;
1997
+ /** the page's property schema: { workOrder: { fromDate: { type, value, ... } } } */
1998
+ propertySchema: any;
1999
+ /** the project's language: selectedLanguage (translations), errorMessages */
2000
+ selectedLanguageInfo: any;
2001
+ /** the container's own error texts, when the project has none */
2002
+ errorMessages: any;
2003
+ /** set by the container after a save attempt: messages show then even for untouched fields */
2004
+ saveTried: boolean;
2005
+ /** the label rule of the container: 'dialog' (the layout's layoutStyle) or 'form' */
2006
+ container: 'dialog' | 'form';
2007
+ /** the button's type: 'submit' lets Enter in a field press it (form) */
2008
+ buttonType: 'button' | 'submit';
2009
+ /** 'edit': the field to type in (dialog, form); 'display': a record's value shown (card, grid) */
2010
+ mode: 'edit' | 'display';
2011
+ /** display mode: the record whose value is shown (record[name]) */
2012
+ record: any;
2013
+ /** no label (a grid cell: the column's heading is the label) */
2014
+ hideLabel: boolean;
2015
+ /** display mode: scope.style styles the value; false when the container styles it (grid cell) */
2016
+ styleValue: boolean;
2017
+ /** display mode: the small form of text area and media (grid cell) */
2018
+ compact: boolean;
2019
+ /** a selection list the container loaded itself; without it the field's own (field.data) */
2020
+ list: any[] | null | undefined;
2021
+ /** the container's list is still loading; without it the field's own (field.loading) */
2022
+ listLoading: boolean | null | undefined;
2023
+ /** the payment element's error (textContent) of the container, for the credit card */
2024
+ creditCardError: any;
2025
+ /** an entry of an autocomplete or combobox list was chosen */
2026
+ picked: EventEmitter<any>;
2027
+ /** a date, time or period was set */
2028
+ changed: EventEmitter<any>;
2029
+ /** a time picker opened */
2030
+ opened: EventEmitter<void>;
2031
+ /** a check box, switch or radio button changed */
2032
+ toggled: EventEmitter<any>;
2033
+ /** display mode: the value of a field with option.link was clicked; its option */
2034
+ linkClicked: EventEmitter<any>;
2035
+ /** display mode: a media value was clicked; its option */
2036
+ mediaClicked: EventEmitter<any>;
2037
+ /** a button was clicked; its option (innerAction, action ...) */
2038
+ buttonClick: EventEmitter<any>;
2039
+ kind: ControlKind;
2040
+ property: any;
2041
+ /** the property's object ({ fromDate: {...}, toDate: {...} }), for amounts with a currency field */
2042
+ row: any;
2043
+ keyboard: CustomKeyboardType | null;
2044
+ /** vl-textbox reads the property schema from a container info */
2045
+ textboxInfo: any;
2046
+ readonly vlAction: typeof testAction;
2047
+ readonly vlWrites: typeof testWrites;
2048
+ /** the property's name in a record ("fromDate") */
2049
+ name: string;
2050
+ ngOnChanges(): void;
2051
+ get display(): boolean;
2052
+ /** protected in the layout, or a list: the value is shown, not typed in */
2053
+ get readonly(): boolean;
2054
+ /** the value shown: the record's in a list (else the property's default), the property's otherwise */
2055
+ get value(): any;
2056
+ /** the row a number reads its currency field from: the record in a list */
2057
+ get numberRow(): any;
2058
+ /** a date or time of a list as text; the --- of an empty value is shown by the template */
2059
+ get dateText(): string;
2060
+ /** an older layout's own date pattern (Angular date pipe: option.dateFormat / timeFormat) */
2061
+ get legacyDateFormat(): string;
2062
+ get isLink(): boolean;
2063
+ openLink(): void;
2064
+ /** the property the control writes into ({} so a control never writes into undefined) */
2065
+ get target(): any;
2066
+ get translations(): Record<string, string> | null;
2067
+ get selectionList(): any[];
2068
+ get selectionLoading(): boolean;
2069
+ get messages(): any;
2070
+ /** label.value, the layout's label.caption, then the data object's caption - translated */
2071
+ get label(): string;
2072
+ /** a check box carries its own caption; every other control gets the label above or beside it */
2073
+ get showLabel(): boolean;
2074
+ /** text flag (string "Y"/"N" ...) or Boolean, for check box, switch and radio buttons */
2075
+ get toggleType(): string;
2076
+ innerStyle(): Record<string, any>;
2077
+ labelStyle(): {
2078
+ classes: string;
2079
+ style: Record<string, any>;
2080
+ };
2081
+ /** scope.style: the input's own style in the layout (the Designer's "input" style) */
2082
+ inputStyle(): {
2083
+ classes: string;
2084
+ style: Record<string, any>;
2085
+ };
2086
+ /** display mode: the value's style (scope.style), unless the container styles it */
2087
+ valueStyle(): {
2088
+ classes: string;
2089
+ style: Record<string, any>;
2090
+ };
2091
+ /** a button has no input; the field's style is the button's */
2092
+ buttonStyle(): {
2093
+ classes: string;
2094
+ style: Record<string, any>;
2095
+ };
2096
+ static ɵfac: i0.ɵɵFactoryDeclaration<ControlComponent, never>;
2097
+ static ɵcmp: i0.ɵɵComponentDeclaration<ControlComponent, "vl-control", never, { "field": { "alias": "field"; "required": false; }; "propertySchema": { "alias": "propertySchema"; "required": false; }; "selectedLanguageInfo": { "alias": "selectedLanguageInfo"; "required": false; }; "errorMessages": { "alias": "errorMessages"; "required": false; }; "saveTried": { "alias": "saveTried"; "required": false; }; "container": { "alias": "container"; "required": false; }; "buttonType": { "alias": "buttonType"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "record": { "alias": "record"; "required": false; }; "hideLabel": { "alias": "hideLabel"; "required": false; }; "styleValue": { "alias": "styleValue"; "required": false; }; "compact": { "alias": "compact"; "required": false; }; "list": { "alias": "list"; "required": false; }; "listLoading": { "alias": "listLoading"; "required": false; }; "creditCardError": { "alias": "creditCardError"; "required": false; }; }, { "picked": "picked"; "changed": "changed"; "opened": "opened"; "toggled": "toggled"; "linkClicked": "linkClicked"; "mediaClicked": "mediaClicked"; "buttonClick": "buttonClick"; }, never, never, true, never>;
2098
+ }
2099
+
2100
+ export { AppVersionResetService, Autocomplete, BACKEND_PROXY_PREFIX, CardComponent, CheckboxControl, ConfigService, ControlComponent, Couchdb, CustomKeyboardComponent, CustomKeyboardDirective, CustomKeyboardService, DateFormatPipe, DateHintPipe, DateRangeControl, DateTextPipe, DateTimeControl, DropdownControl, FormComponent, GridComponent, HeaderMenuComponent, LogsComponent, MediaControl, MediaSourcePipe, MobileKeycloakService, MobileOidcService, MobileOktaService, ModelComponent, NetworkLogService, NotificationService, NumberControl, PaginationComponent, PasswordControl, PlaceholderPipe, READ_ATTEMPT_TIMEOUT, REQUEST_STAGES, RETRY_PAUSES, RETRY_STATUSES, RadioControl, RemoteListService, RequestService, RequestTimeoutError, RequestTimeoutService, RulesPipe, SIDE_DOCK_CLASS, SideMenuComponent, SwitchControl, TextareaControl, Textbox, UtilityService, ViewToolkitModule, VisiblePipe, backendUrl, controlKind, controlProperty, currencyDigits, currentDateLanguage, dateDigitCount, dateInputPattern, displayDateValue, displayNumber, fieldInnerLayoutStyle, fieldModel, fieldRules, fixedTimeText, inputFormatHint, isNativeMobile, isNativePhone, languageDatePattern, layoutPlaceholder, mediaKind, normalizeCustomKeyboardType, numberShape, numberStep, numberSuffix, primeDatePattern, resolveCustomKeyboardType, resolvePlaceholder, ruleMessage, setDateLanguage, setInputHintLanguage, setToolkitKeyboardOnWeb, shapeDateDigits, shapeTimeText, sideDockWidth, splitReference, stagedRead, stagedRequest, storedToTyped, styleParts, testAction, testFieldKey, testWrites, timeHourFormat, toggleMeridiem, toolkitKeyboardActive, typedToStored, usesTwelveHours, visibleFields, whenOnline };
2101
+ export type { ControlKind, CustomKeyboardTarget, CustomKeyboardType, FieldKind, FieldModel, FieldRules, MediaKind, MobileAuthTokens, MobileOktaRefresh, MobileOktaTokens, NumberShape, OidcProvider, OidcRefresh, OidcTokens, RequestTimeoutMessages, StagedReadOptions };