sprof 1.2.0 → 1.5.0

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.
@@ -2,6 +2,7 @@ import { default as ValueType } from '../../../core/classes/ValueType';
2
2
  import { default as AnswerVariant } from './AnswerVariant';
3
3
  import { default as FieldExample } from './FieldExample';
4
4
  import { default as FieldMeasure } from './FieldMeasure';
5
+ import { default as FieldRule } from './FieldRule';
5
6
  import { default as FieldVariant } from './FieldVariant';
6
7
  export default class Field {
7
8
  id?: string;
@@ -13,6 +14,7 @@ export default class Field {
13
14
  required: boolean;
14
15
  answerVariants: AnswerVariant[];
15
16
  answerVariantsForDelete: string[];
17
+ fieldRules: FieldRule[];
16
18
  fieldExamples: FieldExample[];
17
19
  fieldVariants: FieldVariant[];
18
20
  valueType: ValueType;
@@ -41,6 +43,8 @@ export default class Field {
41
43
  setType(item: ValueType): void;
42
44
  setName(item: string): void;
43
45
  addAnswerVariant(): AnswerVariant;
46
+ addFieldRule(): FieldRule;
47
+ removeFieldRule(index: number): void;
44
48
  addChild(): Field;
45
49
  addFieldVariant(): FieldVariant;
46
50
  copy(): Field;
@@ -0,0 +1,12 @@
1
+ export default class FieldRule {
2
+ id?: string;
3
+ fieldId?: string;
4
+ dependsOnFieldId?: string;
5
+ dependsOnFieldCode: string;
6
+ operator: string;
7
+ value: string;
8
+ order: number;
9
+ constructor(i?: FieldRule);
10
+ static Create(fieldId?: string): FieldRule;
11
+ static GetClassName(): string;
12
+ }
@@ -3,6 +3,7 @@ import { default as FormSection } from './FormSection';
3
3
  export default class Form {
4
4
  id?: string;
5
5
  name: string;
6
+ status: string;
6
7
  order: number;
7
8
  isLaboratory: boolean;
8
9
  formSections: FormSection[];
@@ -0,0 +1,12 @@
1
+ import { default as Field } from './Field';
2
+ import { default as FieldFill } from './FieldFill';
3
+ /**
4
+ * Значение ответа на вопрос в виде строки (для сравнения в правилах).
5
+ * radio — id выбранного варианта; set — id вариантов через "|"; иначе — строка/число.
6
+ */
7
+ export declare function fillValue(fill?: FieldFill): string;
8
+ /**
9
+ * Виден ли вопрос при текущих ответах («если, то»): все правила — AND,
10
+ * правило без вопроса-условия игнорируется. Без правил — всегда виден.
11
+ */
12
+ export declare function isFieldVisible(field: Field, fillsByFieldId: Record<string, FieldFill>): boolean;
@@ -5,6 +5,7 @@ export { default as FieldFill } from './FieldFill';
5
5
  export { default as FieldFillFile } from './FieldFillFile';
6
6
  export { default as FieldFilter } from './FieldFilter';
7
7
  export { default as FieldMeasure } from './FieldMeasure';
8
+ export { default as FieldRule } from './FieldRule';
8
9
  export { default as FieldVariant } from './FieldVariant';
9
10
  export { default as Form } from './Form';
10
11
  export { default as FormFill } from './FormFill';
@@ -7,12 +7,15 @@ type __VLS_PublicProps = {
7
7
  'form': Form;
8
8
  } & __VLS_Props;
9
9
  declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ change: (form: Form) => any;
10
11
  save: (form: Form) => any;
11
12
  "update:form": (value: Form) => any;
12
13
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
+ onChange?: ((form: Form) => any) | undefined;
13
15
  onSave?: ((form: Form) => any) | undefined;
14
16
  "onUpdate:form"?: ((value: Form) => any) | undefined;
15
17
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>, {
18
+ status?(_: {}): any;
16
19
  actions?(_: {}): any;
17
20
  }>;
18
21
  export default _default;
@@ -3,6 +3,7 @@ import { default as Field } from '../classes/Field';
3
3
  type __VLS_Props = {
4
4
  valueTypes: ValueType[];
5
5
  typeLabels?: Record<string, string>;
6
+ fields?: Field[];
6
7
  };
7
8
  type __VLS_PublicProps = {
8
9
  'field': Field & {
@@ -11,17 +12,20 @@ type __VLS_PublicProps = {
11
12
  } & __VLS_Props;
12
13
  declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
14
  remove: () => any;
15
+ change: () => any;
14
16
  move: (dir: number) => any;
15
17
  "update:field": (value: Field & {
16
18
  required?: boolean | undefined;
17
19
  }) => any;
18
20
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
19
21
  onRemove?: (() => any) | undefined;
22
+ onChange?: (() => any) | undefined;
20
23
  onMove?: ((dir: number) => any) | undefined;
21
24
  "onUpdate:field"?: ((value: Field & {
22
25
  required?: boolean | undefined;
23
26
  }) => any) | undefined;
24
27
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>, {
28
+ handle?(_: {}): any;
25
29
  controls?(_: {}): any;
26
30
  }>;
27
31
  export default _default;
@@ -1,20 +1,25 @@
1
1
  import { default as ValueType } from '../../../core/classes/ValueType';
2
+ import { default as Field } from '../classes/Field';
2
3
  import { default as FormSection } from '../classes/FormSection';
3
4
  type __VLS_Props = {
4
5
  valueTypes: ValueType[];
6
+ fields?: Field[];
5
7
  };
6
8
  type __VLS_PublicProps = {
7
9
  'section': FormSection;
8
10
  } & __VLS_Props;
9
11
  declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
12
  remove: () => any;
13
+ change: () => any;
11
14
  move: (dir: number) => any;
12
15
  "update:section": (value: FormSection) => any;
13
16
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
17
  onRemove?: (() => any) | undefined;
18
+ onChange?: (() => any) | undefined;
15
19
  onMove?: ((dir: number) => any) | undefined;
16
20
  "onUpdate:section"?: ((value: FormSection) => any) | undefined;
17
21
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
22
+ handle?(_: {}): any;
18
23
  controls?(_: {}): any;
19
24
  }>;
20
25
  export default _default;