mdt-client 31.3.44 → 31.3.45

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": "mdt-client",
3
- "version": "31.3.44",
3
+ "version": "31.3.45",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,4 +1,5 @@
1
1
  import IMask from "imask";
2
+ import { DurationFormatOptions, DurationUnit } from "mdtHelpers/utils/duration/durationFormatTypes";
2
3
  export interface FieldSettings {
3
4
  /**
4
5
  * Маска отображает значение в заданном формате в списке и на форме. Например, число можно отобразить как "1 234,56" или "1234.56".
@@ -14,4 +15,18 @@ export interface FieldSettings {
14
15
  */
15
16
  visibleItemsLimit?: number;
16
17
  };
18
+ /**
19
+ * Настройки для полей типа duration
20
+ */
21
+ durationOptions?: {
22
+ /**
23
+ * Единица хранимого значения.
24
+ * @default "milliseconds"
25
+ */
26
+ unit?: DurationUnit;
27
+ /**
28
+ * Настройки формата отображения длительности.
29
+ */
30
+ formatOptions?: DurationFormatOptions;
31
+ };
17
32
  }
@@ -1,3 +1,4 @@
1
+ import { Valued, ViewElement } from "mdtScripts/helpers/types";
1
2
  export interface TabsFormExtenderPublicOptions {
2
3
  tabs: FormTab[];
3
4
  }
@@ -9,4 +10,5 @@ export interface FormTab {
9
10
  order?: number;
10
11
  visible?: () => boolean;
11
12
  onShow?: (init: boolean) => void;
13
+ rightZone?: Valued<ViewElement>;
12
14
  }
@@ -3,11 +3,11 @@ import { DropdownMenuItemBaseOptions, DropdownMenuItemOptions, DropdownMenuItemW
3
3
  export interface DropdownItemBaseOptions {
4
4
  className?: string;
5
5
  idx?: number;
6
+ role?: string;
6
7
  }
7
8
  export interface DropdownItemOptions<T extends DropdownMenuItemBaseOptions = DropdownMenuItemBaseOptions> extends DropdownItemBaseOptions {
8
9
  focused?: boolean;
9
10
  actionItemOptions: T;
10
- role?: string;
11
11
  }
12
12
  export type DropdownBaseItemOptions = DropdownItemOptions<DropdownMenuItemOptions>;
13
13
  export type DropdownItemWithMoreOptions = DropdownItemOptions<DropdownMenuItemWithChildrenOptions>;
@@ -1,5 +1,6 @@
1
1
  import { MaskOptions } from "mdtScripts/components/baseFormControls/maskedInput/MaskFormatter.types";
2
2
  import { PeriodBoundaryIcon } from "mdtScripts/data/periods/helpers/types";
3
+ import { DurationFormatOptions, DurationUnit } from "mdtHelpers/utils/duration/durationFormatTypes";
3
4
  export interface FormatOptions {
4
5
  type?: string;
5
6
  title?: string;
@@ -13,4 +14,11 @@ export interface FormatOptions {
13
14
  */
14
15
  maskOptions?: MaskOptions;
15
16
  dateRangeIcon?: PeriodBoundaryIcon;
17
+ /**
18
+ * Настройки форматирования длительности (для типа duration)
19
+ */
20
+ durationOptions?: {
21
+ unit?: DurationUnit;
22
+ formatOptions?: DurationFormatOptions;
23
+ };
16
24
  }
@@ -9,7 +9,7 @@ export declare class Pipeline<D = any> {
9
9
  execute(args: D, onComplete: (args: D) => void, onError?: (e: AnyError) => void): void;
10
10
  executePromise(args: D): Promise<D>;
11
11
  }
12
- type MiddlewareSync<D> = (args: D) => D | undefined;
12
+ export type MiddlewareSync<D> = (args: D) => D | undefined;
13
13
  export declare class PipelineSync<D = any> {
14
14
  private middlewaresStorage;
15
15
  constructor(middlewares?: MiddlewareSync<D>[]);
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Единица хранимого значения длительности.
3
+ * Определяет, в каких единицах хранится числовое значение поля.
4
+ */
5
+ export type DurationUnit = "milliseconds" | "seconds" | "minutes" | "hours";
6
+ /**
7
+ * Сериализуемые настройки формата длительности (подмножество Intl.DurationFormatOptions).
8
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat
9
+ */
10
+ export type DurationFormatOptions = {
11
+ /** Локаль форматирования (BCP 47, default: текущая локаль). Допустимы как "ru", так и "ru-RU" */
12
+ locale?: string;
13
+ /**
14
+ * Стиль отображения:
15
+ * - "long" (1 час 30 минут 5 секунд)
16
+ * - "short" (1 ч. 30 мин. 5 сек.)
17
+ * - "narrow" (1ч 30м 5с)
18
+ * - "digital" (1:30:05)
19
+ */
20
+ style?: "long" | "short" | "narrow" | "digital";
21
+ };
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Removes keys with `undefined` values from an object before passing it to Mithril as vnode attrs.
3
+ * Mithril (v1) renders `undefined` and `null` values as literal strings in the DOM (e.g. `id="undefined"`),
4
+ * because it sets attributes unconditionally without checking for nullish values.
5
+ */
6
+ export declare function omitNullish<T extends Record<string, unknown>>(obj: T): Partial<T>;
1
7
  export declare function hasOwnProperty(object: Record<never, unknown>, name: string): boolean;
2
8
  export declare function shallowCopy<T>(obj: T): T;
3
9
  export declare function copyWithIgnore<T, K extends keyof T = null>(obj: T, ignore: K[]): Omit<T, K>;
@@ -92,6 +92,7 @@ export interface ILegacyFacade {
92
92
  HierarchyListExtender: any;
93
93
  LabelStyleHelper: any;
94
94
  LabelStyleCellView: any;
95
+ labelStyleView: any;
95
96
  };
96
97
  CenteredMessageCtrl: any;
97
98
  PageHeaderControls: any;
@@ -3,7 +3,7 @@ import { IObjectFacade } from "./IObjectFacade";
3
3
  import { BaseBuilderTypes } from "./fieldBuilder/fieldBuilder/IFieldBuilder";
4
4
  import { IFieldFkBuilder } from "./fieldBuilder/fieldFkBuilder/IFieldFkBuilder";
5
5
  declare const allFieldPhysicalTypes: readonly ["bigint", "binary", "bit", "char", "date", "datetime", "datetime2", "datetimeoffset", "decimal", "float", "geography", "geometry", "hierarchyid", "image", "int", "money", "nchar", "ntext", "numeric", "nvarchar", "real", "smalldatetime", "smallint", "smallmoney", "sql_variant", "sysname", "text", "time", "timestamp", "tinyint", "uniqueidentifier", "varbinary", "varchar", "xml"];
6
- export declare const allFieldLogicalTypes: readonly ["number", "money", "long", "string", "date", "time", "datetime", "boolean", "image", "icon", "secret", "identifier", "url", "xml", "markdown", "query", "etl", "json"];
6
+ export declare const allFieldLogicalTypes: readonly ["number", "money", "long", "string", "date", "time", "datetime", "boolean", "image", "icon", "secret", "identifier", "url", "xml", "markdown", "query", "etl", "json", "duration"];
7
7
  export type FieldPhysicalType = typeof allFieldPhysicalTypes[number];
8
8
  export type FieldLogicalType = typeof allFieldLogicalTypes[number];
9
9
  export type FieldType = FieldPhysicalType | FieldLogicalType;
@@ -1,3 +1,4 @@
1
+ import { UiType } from "mdtScripts/helpers/IUi";
1
2
  import { AnyObject, URLString, Valued } from "mdtScripts/helpers/types";
2
3
  export interface CustomPageCtrl {
3
4
  new (node: ICustomNodeNavigationFacade): any;
@@ -81,7 +82,7 @@ interface CustomNavNodeValue {
81
82
  /** Значение узла навигации. Отображается рядом с заголовком */
82
83
  value?: string;
83
84
  /** Стиль значения узла */
84
- style?: string;
85
+ style?: UiType;
85
86
  /** Иконка значения узла */
86
87
  icon?: string;
87
88
  /** Текст появляющийся при наведении на счетчик. Поддерживается markdown */