@fctc/edu-logic-lib 1.0.9 → 1.1.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.
Files changed (61) hide show
  1. package/dist/config.js +257 -6
  2. package/dist/config.mjs +256 -2
  3. package/dist/constants.js +152 -53
  4. package/dist/constants.mjs +141 -2
  5. package/dist/environment.js +840 -16
  6. package/dist/environment.mjs +841 -4
  7. package/dist/hooks.d.mts +1 -1
  8. package/dist/hooks.d.ts +1 -1
  9. package/dist/hooks.js +4851 -180
  10. package/dist/hooks.mjs +4814 -9
  11. package/dist/index.d.mts +2 -2
  12. package/dist/index.d.ts +2 -2
  13. package/dist/index.js +5320 -626
  14. package/dist/index.mjs +5165 -12
  15. package/dist/models.js +3217 -18
  16. package/dist/models.mjs +3217 -9
  17. package/dist/provider.js +3224 -17
  18. package/dist/provider.mjs +3224 -8
  19. package/dist/services.d.mts +1 -1
  20. package/dist/services.d.ts +1 -1
  21. package/dist/services.js +4032 -31
  22. package/dist/services.mjs +4032 -7
  23. package/dist/store-tC7LKtbY.d.mts +505 -0
  24. package/dist/store-tC7LKtbY.d.ts +505 -0
  25. package/dist/store.d.mts +6 -505
  26. package/dist/store.d.ts +6 -505
  27. package/dist/store.js +576 -248
  28. package/dist/store.mjs +519 -1
  29. package/dist/types.d.mts +1 -1
  30. package/dist/types.d.ts +1 -1
  31. package/dist/types.js +0 -2
  32. package/dist/types.mjs +1 -1
  33. package/dist/utils.js +2355 -61
  34. package/dist/utils.mjs +2344 -1
  35. package/dist/{view-type-BTzRpkT7.d.mts → view-type-DCixhUzb.d.mts} +1 -1
  36. package/dist/{view-type-BTzRpkT7.d.ts → view-type-DCixhUzb.d.ts} +1 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-4K3QAEZ6.js +0 -90
  39. package/dist/chunk-6BLY7NZ6.mjs +0 -120
  40. package/dist/chunk-6QXB3XX7.mjs +0 -256
  41. package/dist/chunk-7JD5GMIZ.js +0 -2
  42. package/dist/chunk-AYUH66EE.mjs +0 -62
  43. package/dist/chunk-CZHZLKNA.mjs +0 -585
  44. package/dist/chunk-EK43MEN4.js +0 -635
  45. package/dist/chunk-ELARQVCE.mjs +0 -2344
  46. package/dist/chunk-FVGPSTJ7.js +0 -122
  47. package/dist/chunk-GGOFXFSX.js +0 -2362
  48. package/dist/chunk-IXDDYGKE.js +0 -61
  49. package/dist/chunk-MLJQPO4Q.mjs +0 -57
  50. package/dist/chunk-OADBRQ4A.js +0 -32
  51. package/dist/chunk-OBR6UTC5.mjs +0 -1
  52. package/dist/chunk-OFUXC2LA.mjs +0 -86
  53. package/dist/chunk-P2IGWJDZ.js +0 -1068
  54. package/dist/chunk-QLUONJPQ.mjs +0 -519
  55. package/dist/chunk-RWRHCIQI.mjs +0 -1059
  56. package/dist/chunk-RZBHZYXG.js +0 -582
  57. package/dist/chunk-S7B3VKMJ.mjs +0 -85
  58. package/dist/chunk-S7YF2I23.js +0 -95
  59. package/dist/chunk-UY6GNZNB.js +0 -262
  60. package/dist/chunk-XYVK476U.mjs +0 -29
  61. package/dist/chunk-YOV6KAT2.js +0 -66
@@ -1,122 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkS7YF2I23_js = require('./chunk-S7YF2I23.js');
4
-
5
- // src/models/base-model/index.ts
6
- var BaseModel = class {
7
- name;
8
- view;
9
- actContext;
10
- fields;
11
- constructor(init) {
12
- this.name = init.name;
13
- this.view = init.view;
14
- this.actContext = init.actContext;
15
- this.fields = init.fields;
16
- }
17
- getSpecificationByFields({
18
- fields = [],
19
- specification = {},
20
- modelsData,
21
- model,
22
- modelRoot
23
- }) {
24
- if (Array.isArray(fields)) {
25
- let spec = { ...specification };
26
- fields.forEach((field) => {
27
- if (!field?.type_co || field?.name && field?.type_co === "field" /* FIELD */) {
28
- if (modelsData?.[model]?.[field?.name]) {
29
- if (modelsData?.[model]?.[field?.name]?.type === "one2many" /* ONE2MANY */ || modelsData?.[model]?.[field?.name]?.type === "many2many" /* MANY2MANY */) {
30
- const relation = modelsData?.[model]?.[field?.name]?.relation;
31
- const modelRelation = modelsData?.[relation];
32
- if (modelRelation) {
33
- spec[field?.name] = {
34
- fields: {}
35
- };
36
- if (modelRoot && modelRoot === relation) {
37
- spec[field?.name].fields = { id: {} };
38
- } else {
39
- spec[field?.name].fields = this.getSpecificationByFields({
40
- fields: Object.values(modelRelation),
41
- specification: {},
42
- modelsData,
43
- model: relation,
44
- modelRoot: model
45
- });
46
- }
47
- } else {
48
- spec[field?.name] = {
49
- fields: {
50
- id: {},
51
- display_name: {}
52
- }
53
- };
54
- }
55
- } else if (modelsData?.[model]?.[field?.name]?.type === "many2one" /* MANY2ONE */) {
56
- spec[field?.name] = {
57
- fields: {
58
- id: {},
59
- display_name: {},
60
- ...chunkS7YF2I23_js.WIDGETAVATAR[field?.widget] ? { image_256: {} } : {},
61
- ...field?.name === "currency_id" && fields?.find((item) => item?.widget === "monetary") ? { symbol: {} } : {},
62
- ...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
63
- }
64
- };
65
- } else {
66
- spec[field?.name] = {};
67
- }
68
- }
69
- } else if (field?.type_co === "group" /* GROUP */ || field?.type_co === "div" /* DIV */ || field?.type_co === "span" /* SPAN */) {
70
- const specGroup = this.getSpecificationByFields({
71
- fields: field?.fields,
72
- specification: spec,
73
- modelsData,
74
- model
75
- });
76
- spec = { ...spec, ...specGroup };
77
- } else if (field?.type_co === "tree" /* TREE */ || field?.type_co === "list" /* LIST */) {
78
- const relation = modelsData?.[model]?.[field?.name]?.relation;
79
- const specTreee = this.getSpecificationByFields({
80
- fields: field?.fields,
81
- specification: {},
82
- modelsData,
83
- model: relation,
84
- modelRoot: model
85
- });
86
- spec = {
87
- ...spec,
88
- [field?.name]: {
89
- fields: { ...spec?.[field?.name]?.fields, ...specTreee }
90
- }
91
- };
92
- }
93
- });
94
- return spec;
95
- } else {
96
- console.warn("fields is not array");
97
- }
98
- }
99
- getTreeProps() {
100
- const props = this.view?.views?.list || {};
101
- return props;
102
- }
103
- getTreeFields() {
104
- const fields = this.view?.views?.list?.fields || [];
105
- return fields;
106
- }
107
- getSpecification() {
108
- const specInit = {};
109
- const modelData = this.view?.models || {};
110
- const specification = this.getSpecificationByFields({
111
- fields: this.fields,
112
- specification: specInit,
113
- modelsData: modelData,
114
- model: this.name,
115
- modelRoot: ""
116
- });
117
- return specification;
118
- }
119
- };
120
- var base_model_default = BaseModel;
121
-
122
- exports.base_model_default = base_model_default;