awing-library 2.1.2-dev.64 → 2.1.2-dev.66

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.
@@ -94,6 +94,7 @@ export interface IPlaceQuery {
94
94
  total: number;
95
95
  }>;
96
96
  getPlacesByIds: (placeIds: string[]) => Promise<IPlace[]>;
97
+ isSelectedAll?: boolean;
97
98
  }
98
99
  export interface PlaceFilterProps extends IPlaceQuery {
99
100
  filterFields: IFilterField[];
package/dist/esm/index.js CHANGED
@@ -173871,6 +173871,7 @@ function LogicExpressionInput(props) {
173871
173871
  inputValue: inputValue,
173872
173872
  onInputChange: handleInputChange,
173873
173873
  options: suggestions,
173874
+ disabled: rest.disabled,
173874
173875
  renderInput: params => jsxRuntimeExports.jsx(TextField, Object.assign({}, params, {
173875
173876
  error: !isValid,
173876
173877
  helperText: isValid ? '' : t("LogicExpression.".concat(errorCode)),
@@ -175228,7 +175229,8 @@ const DataTable = props => {
175228
175229
  const check = useRef(null);
175229
175230
  const {
175230
175231
  getPlacesByFilter,
175231
- getPlacesByIds
175232
+ getPlacesByIds,
175233
+ isSelectedAll = false
175232
175234
  } = props;
175233
175235
  const [places, setPlaces] = useState([]);
175234
175236
  const [total, setTotal] = useState(0);
@@ -175603,6 +175605,12 @@ const DataTable = props => {
175603
175605
  const handlePageSizeChange = pageSize => {
175604
175606
  setPageSize(pageSize);
175605
175607
  };
175608
+ useEffect(() => {
175609
+ if (isSelectedAll) {
175610
+ handleSelectAll(isSelectedAll);
175611
+ }
175612
+ // eslint-disable-next-line react-hooks/exhaustive-deps
175613
+ }, [isSelectedAll]);
175606
175614
  return isError ? jsxRuntimeExports.jsx("div", {
175607
175615
  style: {
175608
175616
  padding: 2 * 8,
@@ -176024,7 +176032,8 @@ const PlaceFilterContainer = props => {
176024
176032
  getPlacesByFilter,
176025
176033
  getPlacesByIds,
176026
176034
  callbackFunction,
176027
- tags
176035
+ tags,
176036
+ isSelectedAll = false
176028
176037
  } = props;
176029
176038
  const [isInit, setIsInit] = useState(true);
176030
176039
  const [tagsAll, setTagsAll] = useAtom(tagsAllState);
@@ -176062,7 +176071,8 @@ const PlaceFilterContainer = props => {
176062
176071
  children: [jsxRuntimeExports.jsx(FieldInput, {}), jsxRuntimeExports.jsx(Tag, {}), jsxRuntimeExports.jsx(DataTable, {
176063
176072
  isInit: isInit,
176064
176073
  getPlacesByFilter: getPlacesByFilter,
176065
- getPlacesByIds: getPlacesByIds
176074
+ getPlacesByIds: getPlacesByIds,
176075
+ isSelectedAll: isSelectedAll
176066
176076
  })]
176067
176077
  });
176068
176078
  };
@@ -182423,18 +182433,14 @@ const CreateOrEdit$6 = () => {
182423
182433
  value: item.value.toString(),
182424
182434
  text: item.key
182425
182435
  })),
182426
- inputProps: {
182427
- readOnly: !!objectFilterId
182428
- }
182436
+ disabled: !!objectFilterId
182429
182437
  }, {
182430
182438
  fieldName: 'name',
182431
182439
  type: FIELD_TYPE.TEXT,
182432
182440
  label: t('Filter.Name'),
182433
182441
  required: true,
182434
182442
  length: 200,
182435
- inputProps: {
182436
- readOnly: !!objectFilterId && !fieldEditPermission.name
182437
- }
182443
+ disabled: !!objectFilterId && !fieldEditPermission.name
182438
182444
  }, {
182439
182445
  fieldName: 'logicalExpression',
182440
182446
  type: FIELD_TYPE.LOGIC_EXPRESSION,
@@ -182648,7 +182654,7 @@ const CreateOrEdit$5 = () => {
182648
182654
  // State nhận giá trị khi get API
182649
182655
  const [notificationFilter, setNotificationFilter] = useState(defaultObjectFilter);
182650
182656
  const [loadingNotificationFilter, setLoadingNotificationFilter] = useState(false);
182651
- const [_fieldEditPermission, setFieldEditPermission] = useState({
182657
+ const [fieldEditPermission, setFieldEditPermission] = useState({
182652
182658
  configType: false,
182653
182659
  name: false,
182654
182660
  logicalExpression: false
@@ -182812,7 +182818,8 @@ const CreateOrEdit$5 = () => {
182812
182818
  type: FIELD_TYPE.TEXT,
182813
182819
  label: t('Filter.Name'),
182814
182820
  required: true,
182815
- length: 200
182821
+ length: 200,
182822
+ disabled: !!notificationFilterId && !fieldEditPermission.name
182816
182823
  }, {
182817
182824
  fieldName: 'graphqlQueryId',
182818
182825
  type: FIELD_TYPE.SELECT,
@@ -182824,7 +182831,8 @@ const CreateOrEdit$5 = () => {
182824
182831
  value: (_b = (_a = item.id) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '',
182825
182832
  text: (_c = item.name) !== null && _c !== void 0 ? _c : ''
182826
182833
  };
182827
- })
182834
+ }),
182835
+ disabled: !!notificationFilterId
182828
182836
  }, {
182829
182837
  fieldName: 'logicalExpression',
182830
182838
  type: FIELD_TYPE.LOGIC_EXPRESSION,
@@ -182832,7 +182840,8 @@ const CreateOrEdit$5 = () => {
182832
182840
  label: t('Filter.LogicExpression'),
182833
182841
  functionStructures: (_a = logicExpressionsStructure === null || logicExpressionsStructure === void 0 ? void 0 : logicExpressionsStructure.functionStructures) !== null && _a !== void 0 ? _a : [],
182834
182842
  objectStructures: objectStructuresByObjectTypeCode !== null && objectStructuresByObjectTypeCode !== void 0 ? objectStructuresByObjectTypeCode : [],
182835
- defaultValue: notificationFilter.logicalExpression
182843
+ defaultValue: notificationFilter.logicalExpression,
182844
+ disabled: !!notificationFilterId && !fieldEditPermission.logicalExpression
182836
182845
  }],
182837
182846
  oldValue: notificationFilter,
182838
182847
  onUpdate: (obj, formValid, key) => {
@@ -183888,9 +183897,7 @@ graphqlQueries) => {
183888
183897
  text: (_c = (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : ''
183889
183898
  };
183890
183899
  }),
183891
- inputProps: {
183892
- readOnly: mode === FormMode.EDIT ? !fieldPermissions.objectType : false
183893
- }
183900
+ disabled: mode === FormMode.EDIT ? !fieldPermissions.objectType : false
183894
183901
  }, {
183895
183902
  fieldName: 'configType',
183896
183903
  type: FIELD_TYPE.SELECT,
@@ -183900,9 +183907,7 @@ graphqlQueries) => {
183900
183907
  value: value,
183901
183908
  text: t("ConfigTypeCode.".concat(value))
183902
183909
  })),
183903
- inputProps: {
183904
- readOnly: mode === FormMode.EDIT ? !fieldPermissions.configType : false
183905
- }
183910
+ disabled: mode === FormMode.EDIT ? !fieldPermissions.configType : false
183906
183911
  // defaultValue: mode === FormMode.EDIT ? templateData?.template?.configType : ConfigTypeCodeMap.OBJECT_AND_CHANGED,
183907
183912
  }, {
183908
183913
  fieldName: 'name',
@@ -183910,9 +183915,7 @@ graphqlQueries) => {
183910
183915
  label: t('Template.Label.Name'),
183911
183916
  required: true,
183912
183917
  length: 200,
183913
- inputProps: {
183914
- readOnly: mode === FormMode.EDIT ? !fieldPermissions.name : false
183915
- }
183918
+ disabled: mode === FormMode.EDIT ? !fieldPermissions.name : false
183916
183919
  }, {
183917
183920
  fieldName: 'channelType',
183918
183921
  type: FIELD_TYPE.SELECT,
@@ -183925,9 +183928,7 @@ graphqlQueries) => {
183925
183928
  text: value
183926
183929
  };
183927
183930
  }),
183928
- inputProps: {
183929
- readOnly: mode === FormMode.EDIT ? !fieldPermissions.channelType : false
183930
- }
183931
+ disabled: mode === FormMode.EDIT ? !fieldPermissions.channelType : false
183931
183932
  }, {
183932
183933
  fieldName: 'contentType',
183933
183934
  type: FIELD_TYPE.SELECT,
@@ -183940,9 +183941,7 @@ graphqlQueries) => {
183940
183941
  text: value
183941
183942
  };
183942
183943
  }),
183943
- inputProps: {
183944
- readOnly: mode === FormMode.EDIT ? !fieldPermissions.contentType : false
183945
- }
183944
+ disabled: mode === FormMode.EDIT ? !fieldPermissions.contentType : false
183946
183945
  }];
183947
183946
  const channelType = (templateInput === null || templateInput === void 0 ? void 0 : templateInput.channelType) || (templateData === null || templateData === void 0 ? void 0 : templateData.channelType);
183948
183947
  if (channelType === 'FILE') {
package/dist/index.d.ts CHANGED
@@ -1642,6 +1642,7 @@ interface IPlaceQuery {
1642
1642
  total: number;
1643
1643
  }>;
1644
1644
  getPlacesByIds: (placeIds: string[]) => Promise<IPlace[]>;
1645
+ isSelectedAll?: boolean;
1645
1646
  }
1646
1647
  interface PlaceFilterProps extends IPlaceQuery {
1647
1648
  filterFields: IFilterField[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.2-dev.64",
3
+ "version": "2.1.2-dev.66",
4
4
  "main": "dist/esm/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/index.d.ts",