survery-lib 0.0.5 → 0.0.8

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.
Files changed (35) hide show
  1. package/esm2022/lib/components/question-boolean-template/question-boolean-template.component.mjs +11 -3
  2. package/esm2022/lib/components/question-check-box-template/question-check-box-template.component.mjs +13 -5
  3. package/esm2022/lib/components/question-dropdown-template/question-dropdown-template.component.mjs +11 -3
  4. package/esm2022/lib/components/question-matrix-template/question-matrix-template.component.mjs +15 -5
  5. package/esm2022/lib/components/question-radio-button-template/question-radio-button-template.component.mjs +11 -3
  6. package/esm2022/lib/components/question-text-template/question-text-template.component.mjs +22 -3
  7. package/esm2022/lib/pipes/filter-question.pipe.mjs +16 -0
  8. package/esm2022/lib/survery-lib.component.mjs +121 -27
  9. package/esm2022/lib/survery-lib.module.mjs +6 -3
  10. package/esm2022/lib/usecases/base/use-case.mjs +2 -0
  11. package/esm2022/lib/usecases/check-rule-exps.usecase.mjs +154 -0
  12. package/esm2022/shared/dtos/rule-exp.dto.mjs +1 -1
  13. package/esm2022/shared/enums/Logic-Property.enum.mjs +14 -0
  14. package/esm2022/shared/enums/logic-action.enum.mjs +9 -0
  15. package/esm2022/shared/enums/operator.enum.mjs +6 -0
  16. package/esm2022/shared/form-interfaces/survery-lib.form-interface.mjs +1 -1
  17. package/fesm2022/survery-lib.mjs +391 -45
  18. package/fesm2022/survery-lib.mjs.map +1 -1
  19. package/lib/components/question-boolean-template/question-boolean-template.component.d.ts +3 -1
  20. package/lib/components/question-check-box-template/question-check-box-template.component.d.ts +3 -1
  21. package/lib/components/question-dropdown-template/question-dropdown-template.component.d.ts +3 -1
  22. package/lib/components/question-matrix-template/question-matrix-template.component.d.ts +3 -1
  23. package/lib/components/question-radio-button-template/question-radio-button-template.component.d.ts +3 -1
  24. package/lib/components/question-text-template/question-text-template.component.d.ts +4 -1
  25. package/lib/pipes/filter-question.pipe.d.ts +9 -0
  26. package/lib/survery-lib.component.d.ts +6 -4
  27. package/lib/survery-lib.module.d.ts +6 -5
  28. package/lib/usecases/base/use-case.d.ts +7 -0
  29. package/lib/usecases/check-rule-exps.usecase.d.ts +21 -0
  30. package/package.json +1 -1
  31. package/shared/dtos/rule-exp.dto.d.ts +4 -2
  32. package/shared/enums/Logic-Property.enum.d.ts +12 -0
  33. package/shared/enums/logic-action.enum.d.ts +7 -0
  34. package/shared/enums/operator.enum.d.ts +4 -0
  35. package/shared/form-interfaces/survery-lib.form-interface.d.ts +17 -4
@@ -0,0 +1,21 @@
1
+ import { Observable } from "rxjs";
2
+ import { UseCase } from "./base/use-case";
3
+ import { QuestionChildOfSurveryLibFormInterface } from "../../shared/form-interfaces/survery-lib.form-interface";
4
+ import { RuleExpDto } from "../../shared/dtos/rule-exp.dto";
5
+ import * as i0 from "@angular/core";
6
+ export declare class CheckRuleExpsUsecase implements UseCase<CheckRulesUsecaseModel, CheckRulesUsecaseResult> {
7
+ constructor();
8
+ execute(params: CheckRulesUsecaseModel): Observable<CheckRulesUsecaseResult>;
9
+ private checkRuleExpForAnswerId;
10
+ private checkRuleExpForAnswerIdArr;
11
+ private checkRuleExpForAnswerText;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<CheckRuleExpsUsecase, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<CheckRuleExpsUsecase>;
14
+ }
15
+ export declare class CheckRulesUsecaseModel {
16
+ ruleExps: RuleExpDto[];
17
+ questions: QuestionChildOfSurveryLibFormInterface[];
18
+ }
19
+ export declare class CheckRulesUsecaseResult {
20
+ exprestionResultArr: boolean[];
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survery-lib",
3
- "version": "0.0.5",
3
+ "version": "0.0.8",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0"
@@ -1,11 +1,13 @@
1
+ import { LogicPropertyEnum } from "../enums/Logic-Property.enum";
2
+ import { OperatorEnum } from "../enums/operator.enum";
1
3
  import { RuleExpAnswerDto } from "./rule-exp-answer.dto";
2
4
  export interface RuleExpDto {
3
5
  ruleExpId: number;
4
6
  questionId: number;
5
- logicPropertyId: number;
7
+ logicPropertyId: LogicPropertyEnum;
6
8
  questionTitle: string;
7
9
  questionTypeId: number;
8
- opporator: number;
10
+ opporator: OperatorEnum;
9
11
  isComplete: boolean;
10
12
  ruleExpAnswers: RuleExpAnswerDto[];
11
13
  }
@@ -0,0 +1,12 @@
1
+ export declare enum LogicPropertyEnum {
2
+ GreaterThan = 1,
3
+ GreaterThanOrEqual = 2,
4
+ LessThan = 3,
5
+ LessThanOrEqual = 4,
6
+ Equal = 5,
7
+ NotEqual = 6,
8
+ IsEmpty = 9,
9
+ IsNotEmpty = 10,
10
+ AnyOf = 11,
11
+ Then = 12
12
+ }
@@ -0,0 +1,7 @@
1
+ export declare enum LogicActionEnum {
2
+ Show = 1,
3
+ Hide = 2,
4
+ Enable = 3,
5
+ Disable = 4,
6
+ SetAnswer = 5
7
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum OperatorEnum {
2
+ Or = 7,
3
+ And = 8
4
+ }
@@ -1,11 +1,24 @@
1
+ import { QuestionTypeEnum } from "../enums/question-type.enum";
1
2
  export interface SurveryLibFormInterface {
2
3
  currentPageIndex: number;
3
4
  questionArray: QuestionChildOfSurveryLibFormInterface[];
5
+ ruleQuestionArray: RuleQuestionChildOfSurveryLibFormInterface[];
4
6
  }
5
7
  export interface QuestionChildOfSurveryLibFormInterface {
6
- surveyPageIndex: any;
8
+ surveyPageIndex: number;
9
+ questionId: any;
10
+ questionType: QuestionTypeEnum;
11
+ isMatrixGroup: boolean;
12
+ answerId: any;
13
+ answerIdArr: any;
14
+ answerText: any;
15
+ isRequired: boolean;
16
+ isValid: boolean;
17
+ isDisabled: boolean;
18
+ isShow: boolean;
19
+ isDisabled_default: boolean;
20
+ isShow_default: boolean;
21
+ }
22
+ export interface RuleQuestionChildOfSurveryLibFormInterface {
7
23
  questionId: any;
8
- answer: any;
9
- isRequired: any;
10
- isValid: any;
11
24
  }