@izara_frontend/shared-complex-filter 1.0.3 → 1.0.4

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.
@@ -8,21 +8,14 @@ import {
8
8
  } from "@izaraFrontends/styles";
9
9
 
10
10
  import { useDispatch } from "react-redux";
11
- //test---------------------------------
12
- // import { successTraversalConfig } from "./function/createActionLibCreateLinkStepAndComplexFilter";
13
- // import { ConditionsAndMultipleIdentifersComponent } from "./conditionsAndMultipleIdentifersComponent";
14
11
 
15
12
  function createObjTypeConcat(objType) {
16
- console.log("objType:dfcvcbcxb ", objType);
17
-
18
13
  return `${objType.serviceTag}_${objType.objectType}`;
19
14
  }
20
15
  function createRelTypeConcat(relType) {
21
- console.log("objType:sdsadwsd ", relType);
22
16
  return `${relType?.serviceTag}_${relType?.relationshipTag}`;
23
17
  }
24
18
  function objTypeFromObjTypeConcat(objTypeConcat) {
25
- console.log("objTypeConcat:aeaeaeww ", objTypeConcat);
26
19
  let result = objTypeConcat.split("_");
27
20
 
28
21
  if (result.length !== 2) {
@@ -36,31 +29,24 @@ function objTypeFromObjTypeConcat(objTypeConcat) {
36
29
  }
37
30
 
38
31
  export const ModalLinkStepsComponent = ({
39
- titleModal, //string
40
- statusModalFunc, //func
41
- objConfigUseCase, //store
32
+ titleModal,
33
+ statusModalFunc,
34
+ objConfigUseCase,
42
35
  objTypeMain,
43
36
  nameReducer,
44
37
  parentOutputId,
45
- successFunc, //func
38
+ successFunc,
46
39
  collectObjectLinksWithRequestProperties,
47
40
  collectObjectSchemaWithHierarchy,
48
41
 
49
- //useCase props
50
42
  nameObjectLinkStepEdit,
51
43
  userTag,
52
- keyElement, //**** */
44
+ keyElement,
53
45
  ComponentUseCase,
54
46
  LastStepsComponentUseCase,
55
47
  valueUserTags,
56
48
  successFuncUseCase,
57
49
  }) => {
58
- // InitialSchemaLib.initSchemaFn(
59
- // getObjSchemaS3WithHierarchyShared,
60
- // getObjectLinksShared
61
- // );
62
-
63
- console.log("valueUserTags:ModalLinkStepsComponent ", valueUserTags);
64
50
  let arrObjRequiredData = [{}];
65
51
 
66
52
  arrObjRequiredData = [];
@@ -82,37 +68,28 @@ export const ModalLinkStepsComponent = ({
82
68
  }
83
69
  }
84
70
 
85
- console.log("arrObjRequiredData: xxxxaaawwweee", arrObjRequiredData);
86
71
  if (!objTypeMain) {
87
72
  objTypeMain = objConfigUseCase.objType;
88
73
  }
89
74
 
90
75
  console.time("renderTimeInModalRequiredData");
91
76
 
92
- //--------------------------------------------------------------
93
-
94
77
  const [allObjTypesLinkConfigs, collectRequireLinksFn, collectLinksOpt] =
95
- collectObjectLinksWithRequestProperties(); // allObjTypesLinkConfigs
78
+ collectObjectLinksWithRequestProperties();
96
79
 
97
80
  const [resultFieldName, getObjSchemaHieFn, collectLinksOpt2] =
98
81
  collectObjectSchemaWithHierarchy();
99
82
 
100
- //--------------------------------------------------------------
101
-
102
83
  const [linkSteps, setLinkSteps] = useImmer(arrObjRequiredData);
103
84
 
104
85
  const [nameLinkSteps, setNameLinkSteps] = useState(nameObjectLinkStepEdit);
105
86
  const [linkStepsOutput, setLinkStepsOutput] = useImmer({
106
- status: null, //link or lastStep
87
+ status: null,
107
88
  active: 0,
108
89
  });
109
90
 
110
91
  const dispatch = useDispatch();
111
92
 
112
- console.log("linkSteps:linkStepsLog ", linkSteps);
113
- console.log("collectLinks: ", allObjTypesLinkConfigs, collectLinksOpt);
114
- console.log("allObjTypesLinkConfigs: ", allObjTypesLinkConfigs);
115
-
116
93
  useEffect(() => {
117
94
  collectRequireLinksFn(objTypeMain, {
118
95
  returnLinkTypeId: false,
@@ -133,12 +110,6 @@ export const ModalLinkStepsComponent = ({
133
110
  returnPathLinkTypeId: true,
134
111
  });
135
112
  getObjSchemaHieFn(linkStep.pathLinkType.objType);
136
-
137
- // if (keyLinkStep === arrObjRequiredData.length - 1) {
138
- // setLinkStepsOutput((linkStepsOutput) => {
139
- // linkStepsOutput.status = true;
140
- // });
141
- // }
142
113
  } else {
143
114
  getObjSchemaHieFn(
144
115
  keyLinkStep === 0
@@ -146,14 +117,12 @@ export const ModalLinkStepsComponent = ({
146
117
  : arrObjRequiredData[keyLinkStep - 1].pathLinkType.objType,
147
118
  );
148
119
  }
149
- console.log("linkStep: sddfdfdfgcvb", linkStep);
150
120
  }
151
121
  }
152
122
  }, []);
153
- //-----------------------Shared function-----------------------------------
154
123
 
155
124
  function checkObjTypeLinkStep(activeIndex) {
156
- let objTypeConcat; // objTypeConcat
125
+ let objTypeConcat;
157
126
  objTypeConcat = createObjTypeConcat(objTypeMain);
158
127
  if (activeIndex !== 0) {
159
128
  objTypeConcat = createObjTypeConcat(
@@ -163,8 +132,6 @@ export const ModalLinkStepsComponent = ({
163
132
  return objTypeConcat;
164
133
  }
165
134
 
166
- //-----------------------End Shared function-----------------------------------
167
-
168
135
  function hadelSelectType(e) {
169
136
  let type = e.target.value;
170
137
 
@@ -201,7 +168,6 @@ export const ModalLinkStepsComponent = ({
201
168
  let relType = e.target.value;
202
169
  let index = e.target.selectedIndex - 1;
203
170
 
204
- console.log("index:handelSelectRelTypeAndDirection ", index, typeof index);
205
171
  let objTypeConcat = checkObjTypeLinkStep(linkStepsOutput.active);
206
172
 
207
173
  collectRequireLinksFn(
@@ -220,10 +186,6 @@ export const ModalLinkStepsComponent = ({
220
186
  direction: allObjTypesLinkConfigs[objTypeConcat][index].base.direction,
221
187
  };
222
188
 
223
- // linkSteps[
224
- // linkStepsOutput.active
225
- // ].allObjTypesLinkConfigIndex = index;
226
-
227
189
  if (allObjTypesLinkConfigs[objTypeConcat][index]?.requestProperties) {
228
190
  let requestProperties = {};
229
191
  for (const key in allObjTypesLinkConfigs[objTypeConcat][index]
@@ -257,21 +219,17 @@ export const ModalLinkStepsComponent = ({
257
219
  }
258
220
 
259
221
  function handleNextStep() {
260
- // funcUseCase.testA();
261
222
  let validateResult = true;
262
- // validateAggregateCompare() &&
263
- // validateComparison() &&
264
- // validateRequestProperties();
265
223
 
266
224
  if (validateResult) {
267
225
  setLinkStepsOutput((linkStepsOutput) => {
268
226
  linkStepsOutput.active++;
269
- }); //
227
+ });
270
228
 
271
229
  if (linkSteps.length === linkStepsOutput.active + 1) {
272
230
  setLinkSteps((linkSteps) => {
273
231
  linkSteps[linkStepsOutput.active + 1] = {};
274
- }); //
232
+ });
275
233
  }
276
234
  }
277
235
  }
@@ -287,12 +245,8 @@ export const ModalLinkStepsComponent = ({
287
245
  }
288
246
 
289
247
  function submitLinkSteps() {
290
- console.log("nameObjectLinkStepEdit:xczxczxsd ", nameObjectLinkStepEdit);
291
- console.log("nameLinkSteps:xczxczxsd ", nameLinkSteps);
292
-
293
248
  if (nameObjectLinkStepEdit !== undefined) {
294
249
  if (nameLinkSteps) {
295
- console.log("xczxczxsd");
296
250
  if (successFunc) {
297
251
  dispatch(
298
252
  successFunc({
@@ -304,7 +258,6 @@ export const ModalLinkStepsComponent = ({
304
258
  }),
305
259
  );
306
260
  } else {
307
- //sortFields in requiredData
308
261
  successFuncUseCase(
309
262
  parentOutputId,
310
263
  linkSteps,
@@ -319,25 +272,13 @@ export const ModalLinkStepsComponent = ({
319
272
  }
320
273
  } else {
321
274
  if (successFuncUseCase) {
322
- console.log("dofigusoigdjigfdg");
323
275
  const resultStaus = successFuncUseCase(parentOutputId, linkSteps);
324
276
 
325
277
  statusModalFunc(resultStaus);
326
278
  }
327
-
328
- // dispatch(
329
- // successTraversalConfig({
330
- // parentOutputId: parentOutputId,
331
- // traversalLinkStepsObj: linkSteps,
332
- // }),
333
- // );
334
- // statusModalFunc(false);
335
279
  }
336
-
337
- // }
338
280
  }
339
281
 
340
- console.log("nameObjectLinkStepEdit: ", nameObjectLinkStepEdit);
341
282
  console.timeEnd("renderTimeInModalRequiredData");
342
283
  return (
343
284
  <IzaraDivStyle
@@ -349,7 +290,6 @@ export const ModalLinkStepsComponent = ({
349
290
  <IzaraDivStyle
350
291
  styletags={createStyleDefualtTags("modal", "", "gridTemplate")}
351
292
  >
352
- {/* --------------------------header-------------------- */}
353
293
  <IzaraDivStyle
354
294
  styletags={createStyleDefualtTags("modal", "", "headerTemplate")}
355
295
  >
@@ -370,7 +310,6 @@ export const ModalLinkStepsComponent = ({
370
310
  <button onClick={(e) => submitLinkSteps()}>save</button>
371
311
  <button onClick={(e) => statusModalFunc(false)}>cancel</button>
372
312
  </IzaraDivStyle>
373
- {/* --------------------------data-------------------- */}
374
313
  <div>
375
314
  <IzaraDivStyle
376
315
  styletags={createStyleDefualtTags("pagination", "", "template")}
@@ -415,9 +354,7 @@ export const ModalLinkStepsComponent = ({
415
354
  )}
416
355
  </>
417
356
  </IzaraDivStyle>
418
- <IzaraDivStyle
419
- // styletags={createStyleDefualtTags("background", "scroll", "div")}
420
- >
357
+ <IzaraDivStyle>
421
358
  <p>type:</p>
422
359
 
423
360
  <select
@@ -432,17 +369,7 @@ export const ModalLinkStepsComponent = ({
432
369
  hadelSelectType(e);
433
370
  }}
434
371
  >
435
- <option
436
- // value=""
437
- // selected={
438
- // Object.keys(linkSteps[linkStepsOutput.active]).length === 0
439
- // }
440
- // disabled={
441
- // Object.keys(linkSteps[linkStepsOutput.active]).length !== 0
442
- // }
443
- >
444
- -- choose type --
445
- </option>
372
+ <option>-- choose type --</option>
446
373
  <option value="link">link</option>
447
374
  <option value="lastStep">lastStep</option>
448
375
  </select>
@@ -471,13 +398,7 @@ export const ModalLinkStepsComponent = ({
471
398
  ></IzaraDivStyle>
472
399
  ) : (
473
400
  <>
474
- <IzaraDivStyle
475
- // styletags={createStyleDefualtTags(
476
- // "background",
477
- // "scroll ",
478
- // "div"
479
- // )}
480
- >
401
+ <IzaraDivStyle>
481
402
  <p> relationship type:</p>
482
403
  <select
483
404
  value={JSON.stringify(
@@ -557,7 +478,6 @@ export const ModalLinkStepsComponent = ({
557
478
  LastStepsComponentUseCase={
558
479
  LastStepsComponentUseCase
559
480
  }
560
- // funcUseCase={funcUseCase}
561
481
  />
562
482
  )}
563
483
  </>
@@ -593,7 +513,6 @@ export const ModalLinkStepsComponent = ({
593
513
  )}
594
514
  </div>
595
515
 
596
- {/* --------------------------footer-------------------- */}
597
516
  <IzaraDivStyle
598
517
  styletags={createStyleDefualtTags("gridColumn", "", "11")}
599
518
  >
@@ -619,5 +538,3 @@ export const ModalLinkStepsComponent = ({
619
538
  </IzaraDivStyle>
620
539
  );
621
540
  };
622
-
623
- //----------------------------- use Lib -----------------------------------------------
@@ -10,16 +10,12 @@ import {
10
10
  var hash = require("object-hash");
11
11
 
12
12
  function createObjTypeConcat(objType) {
13
- console.log("objType:dfcvcbcxb ", objType);
14
-
15
13
  return `${objType.serviceTag}_${objType.objectType}`;
16
14
  }
17
15
  function createRelTypeConcat(relType) {
18
- console.log("objType:sdsadwsd ", relType);
19
16
  return `${relType?.serviceTag}_${relType?.relationshipTag}`;
20
17
  }
21
18
  function objTypeFromObjTypeConcat(objTypeConcat) {
22
- console.log("objTypeConcat:aeaeaeww ", objTypeConcat);
23
19
  let result = objTypeConcat.split("_");
24
20
 
25
21
  if (result.length !== 2) {
@@ -109,5 +105,3 @@ export const FieldNameComponent = ({
109
105
  </>
110
106
  );
111
107
  };
112
-
113
- //----------------------------- use Lib -----------------------------------------------
@@ -2,7 +2,6 @@ import React from "react";
2
2
  import { useImmer } from "use-immer";
3
3
  import { useDispatch, useSelector } from "react-redux";
4
4
 
5
- //----------------------------Lib-Test------------------------------
6
5
  import { valueUserTagCreateConfig } from "../function/createActionLibCreateLinkStepAndComplexFilter";
7
6
 
8
7
  export const UserTagsSelectAndCreateComponent = ({
package/webpack.config.js CHANGED
@@ -5,12 +5,23 @@ const webpack = require("webpack");
5
5
  // export default {
6
6
  module.exports = {
7
7
  mode: "development",
8
+ devtool: "source-map",
9
+ experiments: {
10
+ outputModule: true,
11
+ },
8
12
  entry: "./src/index.js",
9
13
 
10
14
  output: {
11
15
  path: resolve("dist"),
12
16
  filename: "complexFilter.js",
13
- libraryTarget: "commonjs2",
17
+ library: {
18
+ type: "module",
19
+ },
20
+ module: true,
21
+ environment: {
22
+ module: true,
23
+ dynamicImport: true,
24
+ },
14
25
  },
15
26
 
16
27
  plugins: [
@@ -58,96 +69,28 @@ module.exports = {
58
69
  ],
59
70
  },
60
71
  resolve: {
61
- // fallback: {
62
- // buffer: require.resolve("buffer/"),
63
- // process: require.resolve("process/browser"),
64
- // },
65
- // fallback: {
66
- // process: false,
67
- // buffer: false,
68
- // crypto: false,
69
- // stream: false,
70
- // },
72
+ fallback: {
73
+ crypto: false,
74
+ },
71
75
 
72
76
  alias: {
73
77
  react: resolve("./node_modules/react"),
74
78
  "react-dom": resolve("./node_modules/react-dom"),
75
79
  },
76
80
  extensions: [".js", ".jsx"],
77
-
78
- // fallback: {
79
- // fs: false,
80
- // },
81
- // importsFields: ['@izaraFrontends/styles', '@izaraFrontends/authentication$'],
82
- // descriptionFiles: []
83
81
  },
84
82
 
85
83
  externals: {
86
- react: {
87
- commonjs: "react",
88
- commonjs2: "react",
89
- amd: "React",
90
- root: "React",
91
- },
92
- "react-dom": {
93
- commonjs: "react-dom",
94
- commonjs2: "react-dom",
95
- amd: "ReactDOM",
96
- root: "ReactDOM",
97
- },
98
- "react-redux": {
99
- commonjs: "react-redux",
100
- commonjs2: "react-redux",
101
- amd: "react-redux",
102
- root: "react-redux",
103
- },
104
- "@reduxjs/toolkit": {
105
- commonjs: "@reduxjs/toolkit",
106
- commonjs2: "@reduxjs/toolkit",
107
- amd: "@reduxjs/toolkit",
108
- root: "@reduxjs/toolkit",
109
- },
110
- "use-immer": {
111
- commonjs: "use-immer",
112
- commonjs2: "use-immer",
113
- amd: "use-immer",
114
- root: "use-immer",
115
- },
116
- nanoid: {
117
- commonjs: "nanoid",
118
- commonjs2: "nanoid",
119
- amd: "nanoid",
120
- root: "nanoid",
121
- },
122
- "object-hash": {
123
- commonjs: "object-hash",
124
- commonjs2: "object-hash",
125
- amd: "object-hash",
126
- root: "object-hash",
127
- },
128
- "@izaraFrontends/styles": {
129
- commonjs: "@izaraFrontends/styles",
130
- commonjs2: "@izaraFrontends/styles",
131
- amd: "@izaraFrontends/styles",
132
- root: "@izaraFrontends/styles",
133
- },
134
- "@izaraFrontends/store": {
135
- commonjs: "@izaraFrontends/store",
136
- commonjs2: "@izaraFrontends/store",
137
- amd: "@izaraFrontends/store",
138
- root: "@izaraFrontends/store",
139
- },
140
- "@izara_project/izara-shared-search-and-sort": {
141
- commonjs: "@izara_project/izara-shared-search-and-sort",
142
- commonjs2: "@izara_project/izara-shared-search-and-sort",
143
- amd: "@izara_project/izara-shared-search-and-sort",
144
- root: "@izara_project/izara-shared-search-and-sort",
145
- },
146
- "@izara_project/izara-shared-service-schemas": {
147
- commonjs: "@izara_project/izara-shared-service-schemas",
148
- commonjs2: "@izara_project/izara-shared-service-schemas",
149
- amd: "@izara_project/izara-shared-service-schemas",
150
- root: "@izara_project/izara-shared-service-schemas",
151
- },
84
+ react: "react",
85
+ "react-dom": "react-dom",
86
+ "react-redux": "react-redux",
87
+ "@reduxjs/toolkit": "@reduxjs/toolkit",
88
+ "use-immer": "use-immer",
89
+ nanoid: "nanoid",
90
+ "object-hash": "object-hash",
91
+ "@izaraFrontends/styles": "@izaraFrontends/styles",
92
+ "@izaraFrontends/store": "@izaraFrontends/store",
93
+ "@izara_project/izara-shared-search-and-sort": "@izara_project/izara-shared-search-and-sort",
94
+ "@izara_project/izara-shared-service-schemas": "@izara_project/izara-shared-service-schemas",
152
95
  },
153
96
  };