@nokecy/qc-ui 0.2.2 → 0.2.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.
- package/dist/cjs/ag-grid-plus/utils.js +10 -6
- package/dist/cjs/array-table/preview.js +7 -3
- package/dist/cjs/array-table/utils.js +1 -1
- package/dist/esm/ag-grid-plus/utils.js +10 -6
- package/dist/esm/array-table/preview.js +7 -3
- package/dist/esm/array-table/utils.js +1 -1
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +1 -1
|
@@ -29,17 +29,21 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
29
29
|
|
|
30
30
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
31
31
|
|
|
32
|
+
var esc = function esc(v) {
|
|
33
|
+
return v.replace(/([(),|]|\/i)/g, '\\$1');
|
|
34
|
+
};
|
|
35
|
+
|
|
32
36
|
var getFilter = function getFilter(objectKey, value) {
|
|
33
37
|
if (typeof value === 'string') {
|
|
34
|
-
return value && value != "" ? "".concat(objectKey, " ^ ").concat(value) : "";
|
|
38
|
+
return value && value != "" ? "".concat(objectKey, " ^ ").concat(esc(value)) : "";
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
if (typeof value === 'number') {
|
|
38
|
-
return "".concat(objectKey, " = ").concat(value);
|
|
42
|
+
return "".concat(objectKey, " = ").concat(esc(value));
|
|
39
43
|
}
|
|
40
44
|
|
|
41
45
|
if (typeof value === 'boolean') {
|
|
42
|
-
return "".concat(objectKey, " = ").concat(value);
|
|
46
|
+
return "".concat(objectKey, " = ").concat(esc(value));
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
if (value instanceof Array) {
|
|
@@ -57,15 +61,15 @@ var getObjectFilter = function getObjectFilter(obj, objKey, items) {
|
|
|
57
61
|
var objectKey = "".concat(objKey, ".").concat(key);
|
|
58
62
|
|
|
59
63
|
if (typeof value === 'number') {
|
|
60
|
-
items.push("".concat(objectKey, " = ").concat(value));
|
|
64
|
+
items.push("".concat(objectKey, " = ").concat(esc(value)));
|
|
61
65
|
}
|
|
62
66
|
|
|
63
67
|
if (typeof value === 'string') {
|
|
64
|
-
value && value != "" && items.push("".concat(objectKey, " ^ ").concat(value));
|
|
68
|
+
value && value != "" && items.push("".concat(objectKey, " ^ ").concat(esc(value)));
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
if (typeof value === 'boolean') {
|
|
68
|
-
items.push("".concat(objectKey, " = ").concat(value));
|
|
72
|
+
items.push("".concat(objectKey, " = ").concat(esc(value)));
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
if (value instanceof Array) {
|
|
@@ -23,12 +23,16 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
23
23
|
var ArrayTable = function ArrayTable(props) {
|
|
24
24
|
var height = props.height;
|
|
25
25
|
var apiRef = (0, _react.useRef)();
|
|
26
|
-
var ref = (0, _react.useRef)();
|
|
27
26
|
var field = (0, _react2.useField)();
|
|
28
27
|
var dataSource = Array.isArray(field.value) ? field.value.slice() : [];
|
|
29
28
|
var sources = (0, _utils.useArrayTableSources)();
|
|
30
29
|
var columns = (0, _utils.useArrayTableColumns)(dataSource, field, sources);
|
|
31
|
-
|
|
30
|
+
console.log("columns", sources);
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
+
style: {
|
|
33
|
+
height: height ? height : 400
|
|
34
|
+
}
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement(_agGridReact.AgGridReact, {
|
|
32
36
|
onGridReady: function onGridReady(params) {
|
|
33
37
|
apiRef.current = params.api;
|
|
34
38
|
},
|
|
@@ -50,7 +54,7 @@ var ArrayTable = function ArrayTable(props) {
|
|
|
50
54
|
pagination: false,
|
|
51
55
|
columnDefs: columns,
|
|
52
56
|
rowData: dataSource
|
|
53
|
-
});
|
|
57
|
+
}));
|
|
54
58
|
};
|
|
55
59
|
|
|
56
60
|
var _default = ArrayTable;
|
|
@@ -128,7 +128,7 @@ var useArrayTableColumns = function useArrayTableColumns(dataSource, field, sour
|
|
|
128
128
|
columnProps = _ref2.columnProps,
|
|
129
129
|
schema = _ref2.schema,
|
|
130
130
|
display = _ref2.display;
|
|
131
|
-
if (display !== 'visible') return buf;
|
|
131
|
+
if (display && display !== 'visible') return buf;
|
|
132
132
|
if (!isColumnComponent(schema)) return buf;
|
|
133
133
|
return buf.concat(_objectSpread(_objectSpread({}, columnProps), {}, {
|
|
134
134
|
//@ts-ignore
|
|
@@ -20,17 +20,21 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
20
20
|
|
|
21
21
|
import dayjs from 'dayjs';
|
|
22
22
|
|
|
23
|
+
var esc = function esc(v) {
|
|
24
|
+
return v.replace(/([(),|]|\/i)/g, '\\$1');
|
|
25
|
+
};
|
|
26
|
+
|
|
23
27
|
var getFilter = function getFilter(objectKey, value) {
|
|
24
28
|
if (typeof value === 'string') {
|
|
25
|
-
return value && value != "" ? "".concat(objectKey, " ^ ").concat(value) : "";
|
|
29
|
+
return value && value != "" ? "".concat(objectKey, " ^ ").concat(esc(value)) : "";
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
if (typeof value === 'number') {
|
|
29
|
-
return "".concat(objectKey, " = ").concat(value);
|
|
33
|
+
return "".concat(objectKey, " = ").concat(esc(value));
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
if (typeof value === 'boolean') {
|
|
33
|
-
return "".concat(objectKey, " = ").concat(value);
|
|
37
|
+
return "".concat(objectKey, " = ").concat(esc(value));
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
if (value instanceof Array) {
|
|
@@ -48,15 +52,15 @@ var getObjectFilter = function getObjectFilter(obj, objKey, items) {
|
|
|
48
52
|
var objectKey = "".concat(objKey, ".").concat(key);
|
|
49
53
|
|
|
50
54
|
if (typeof value === 'number') {
|
|
51
|
-
items.push("".concat(objectKey, " = ").concat(value));
|
|
55
|
+
items.push("".concat(objectKey, " = ").concat(esc(value)));
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
if (typeof value === 'string') {
|
|
55
|
-
value && value != "" && items.push("".concat(objectKey, " ^ ").concat(value));
|
|
59
|
+
value && value != "" && items.push("".concat(objectKey, " ^ ").concat(esc(value)));
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
if (typeof value === 'boolean') {
|
|
59
|
-
items.push("".concat(objectKey, " = ").concat(value));
|
|
63
|
+
items.push("".concat(objectKey, " = ").concat(esc(value)));
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
if (value instanceof Array) {
|
|
@@ -6,12 +6,16 @@ import { useArrayTableColumns, useArrayTableSources } from "./utils"; //@ts-igno
|
|
|
6
6
|
var ArrayTable = function ArrayTable(props) {
|
|
7
7
|
var height = props.height;
|
|
8
8
|
var apiRef = useRef();
|
|
9
|
-
var ref = useRef();
|
|
10
9
|
var field = useField();
|
|
11
10
|
var dataSource = Array.isArray(field.value) ? field.value.slice() : [];
|
|
12
11
|
var sources = useArrayTableSources();
|
|
13
12
|
var columns = useArrayTableColumns(dataSource, field, sources);
|
|
14
|
-
|
|
13
|
+
console.log("columns", sources);
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
style: {
|
|
16
|
+
height: height ? height : 400
|
|
17
|
+
}
|
|
18
|
+
}, /*#__PURE__*/React.createElement(AgGridReact, {
|
|
15
19
|
onGridReady: function onGridReady(params) {
|
|
16
20
|
apiRef.current = params.api;
|
|
17
21
|
},
|
|
@@ -33,7 +37,7 @@ var ArrayTable = function ArrayTable(props) {
|
|
|
33
37
|
pagination: false,
|
|
34
38
|
columnDefs: columns,
|
|
35
39
|
rowData: dataSource
|
|
36
|
-
});
|
|
40
|
+
}));
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
export default ArrayTable;
|
|
@@ -105,7 +105,7 @@ var useArrayTableColumns = function useArrayTableColumns(dataSource, field, sour
|
|
|
105
105
|
columnProps = _ref2.columnProps,
|
|
106
106
|
schema = _ref2.schema,
|
|
107
107
|
display = _ref2.display;
|
|
108
|
-
if (display !== 'visible') return buf;
|
|
108
|
+
if (display && display !== 'visible') return buf;
|
|
109
109
|
if (!isColumnComponent(schema)) return buf;
|
|
110
110
|
return buf.concat(_objectSpread(_objectSpread({}, columnProps), {}, {
|
|
111
111
|
//@ts-ignore
|