@m4l/components 0.0.39 → 0.0.40

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.
@@ -61,7 +61,7 @@ const ALL_FIELDS = {
61
61
  urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg",
62
62
  type: "string",
63
63
  multiple: true,
64
- fixed: false
64
+ presence: "optional"
65
65
  };
66
66
  const WrapperStringFilter$1 = styled("div")(({
67
67
  theme
@@ -788,7 +788,7 @@ const getInitialFilters = (fields, filters, getFieldByName, getLabel) => {
788
788
  add = false;
789
789
  }
790
790
  if (add) {
791
- if (field.fixed) {
791
+ if (field.presence === "fixed") {
792
792
  if (fixedFields.findIndex((f) => f === field.name) === -1) {
793
793
  filter.fixed = true;
794
794
  fixedFields.push(field.name);
@@ -804,9 +804,9 @@ const getInitialFilters = (fields, filters, getFieldByName, getLabel) => {
804
804
  }
805
805
  for (let index = 0; index < fields.length; index++) {
806
806
  const field = fields[index];
807
- if (field.fixed) {
807
+ if (field.presence === "initialized" || field.presence === "fixed") {
808
808
  if (!filters.find((f) => f.n === field.name)) {
809
- const newFilter = getDefaultFilterValues(field, true, getLabel);
809
+ const newFilter = getDefaultFilterValues(field, field.presence === "fixed", getLabel);
810
810
  newFilter.id = newFilters.length + 1;
811
811
  newFilters.push(newFilter);
812
812
  }
@@ -11,12 +11,13 @@ export declare type BooleanOperator = 'e' | 'ne';
11
11
  export declare const BOOLEAN_OPERATORS: Array<BooleanOperator>;
12
12
  export declare type DateTimeOperator = 'b' | 'e' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
13
13
  export declare const DATE_TIME_OPERATORS: Array<DateTimeOperator>;
14
+ export declare type FieldPresence = 'initialized' | 'fixed' | 'optional';
14
15
  export interface Field {
15
16
  name: string;
16
17
  label: string;
17
18
  type: FieldType;
18
19
  multiple?: boolean;
19
- fixed?: boolean;
20
+ presence?: FieldPresence;
20
21
  urlIcon: string;
21
22
  defaultOperand1?: Maybe<OperandType>;
22
23
  defaultOperand2?: Maybe<OperandType>;
@@ -206,14 +206,14 @@ function ObjectLogs(props) {
206
206
  label: getLabel("object_logs.date"),
207
207
  type: "datetime",
208
208
  multiple: false,
209
- fixed: true,
209
+ presence: "optional",
210
210
  urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
211
211
  }, {
212
212
  name: "user_logs.log_detail",
213
213
  label: getLabel("object_logs.log_detail"),
214
214
  type: "string",
215
215
  multiple: false,
216
- fixed: false,
216
+ presence: "optional",
217
217
  urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
218
218
  }],
219
219
  initialFilters: []
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
3
  "private": false,
4
- "version": "0.0.39",
4
+ "version": "0.0.40",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
7
7
  "dev": "vite",