rez-table-listing-mui 1.3.50 → 1.3.52

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez-table-listing-mui",
3
- "version": "1.3.50",
3
+ "version": "1.3.52",
4
4
  "type": "module",
5
5
  "description": "A rez table listing component built on TanStack Table",
6
6
  "main": "dist/index.js",
@@ -38,6 +38,7 @@ interface SavedFilterModalViewProps {
38
38
  columnsData: FilterFormComponentProps | undefined;
39
39
  hasSavedFilters?: boolean;
40
40
  forceShowSharingControls?: boolean;
41
+ disableShareFilter?: boolean;
41
42
  }
42
43
 
43
44
  const SavedFilterModalView = ({
@@ -47,7 +48,7 @@ const SavedFilterModalView = ({
47
48
  filterMaster,
48
49
  setFilterMaster,
49
50
  columnsData,
50
-
51
+ disableShareFilter = false,
51
52
  forceShowSharingControls = false,
52
53
  }: SavedFilterModalViewProps) => {
53
54
  const [shareWithTeam, setShareWithTeam] = useState<boolean>(false);
@@ -283,65 +284,73 @@ const SavedFilterModalView = ({
283
284
  "&.Mui-focused fieldset": { borderColor: primary },
284
285
  },
285
286
  }}
286
- onChange={(e) =>
287
+ onChange={(e) => {
288
+ const val = e.target.value;
289
+
290
+ // block more than 200 chars
291
+ if (val.length > 200) return;
292
+
287
293
  setFilterMaster((prev) => {
288
294
  if (!prev) return prev;
289
295
  return {
290
296
  ...prev,
291
297
  saved_filters: {
292
298
  ...(prev.saved_filters ?? {}),
293
- description: e.target.value,
299
+ description: val,
294
300
  },
295
301
  };
296
- })
297
- }
302
+ });
303
+ }}
298
304
  />
305
+
299
306
  <Typography sx={{ mb: 1, fontSize: 12, color: "#888" }}>
300
307
  (Max. 300 Characters)
301
308
  </Typography>
302
309
  {/* Sharing Controls */}
303
- {shouldShowSharingControls && (showCheckboxes || isshow) && (
304
- <Box
305
- sx={{
306
- display: "flex",
307
- flexDirection: "column",
308
- gap: 0.5,
309
- "& .MuiFormControlLabel-label": { fontSize: "14px" },
310
- }}
311
- >
312
- <FormControlLabel
313
- control={
314
- <Checkbox
315
- size="small"
316
- checked={shareWithTeam}
317
- onChange={handleShareToggle}
318
- sx={{
319
- color: "black",
320
- "&.Mui-checked": { color: "black" },
321
- }}
322
- />
323
- }
324
- label="Share with team member."
325
- />
326
-
327
- {shareWithTeam && (
310
+ {shouldShowSharingControls &&
311
+ (showCheckboxes || isshow) &&
312
+ !disableShareFilter && (
313
+ <Box
314
+ sx={{
315
+ display: "flex",
316
+ flexDirection: "column",
317
+ gap: 0.5,
318
+ "& .MuiFormControlLabel-label": { fontSize: "14px" },
319
+ }}
320
+ >
328
321
  <FormControlLabel
329
322
  control={
330
323
  <Checkbox
331
324
  size="small"
332
- checked={allowTeamEdit}
333
- onChange={handleAllowEditToggle}
325
+ checked={shareWithTeam}
326
+ onChange={handleShareToggle}
334
327
  sx={{
335
328
  color: "black",
336
329
  "&.Mui-checked": { color: "black" },
337
330
  }}
338
331
  />
339
332
  }
340
- label="Allow editing to Team member"
333
+ label="Share with team member."
341
334
  />
342
- )}
343
- </Box>
344
- )}
335
+
336
+ {shareWithTeam && (
337
+ <FormControlLabel
338
+ control={
339
+ <Checkbox
340
+ size="small"
341
+ checked={allowTeamEdit}
342
+ onChange={handleAllowEditToggle}
343
+ sx={{
344
+ color: "black",
345
+ "&.Mui-checked": { color: "black" },
346
+ }}
347
+ />
348
+ }
349
+ label="Allow editing to Team member"
350
+ />
351
+ )}
352
+ </Box>
353
+ )}
345
354
  {/* prefields */}
346
355
  {showPrefields && !isshow && (
347
356
  <Box
@@ -54,6 +54,7 @@ export function TableFilter({
54
54
  showTabs: true,
55
55
  tabOptions: {
56
56
  isSingleFilter: false,
57
+ disableShareFilter: false,
57
58
  isSingleEntity: false,
58
59
  showFilter: "main",
59
60
  mainFilter: {
@@ -644,6 +645,9 @@ export function TableFilter({
644
645
  setFilterMaster={tableStates.setFilterMaster}
645
646
  hasSavedFilters={hasSavedFilterRecords}
646
647
  columnsData={columnsData}
648
+ disableShareFilter={
649
+ filterComponentOptions?.tabOptions?.disableShareFilter
650
+ }
647
651
  />
648
652
  </Box>
649
653
  );
@@ -53,6 +53,12 @@ export function QuickFilterSettings({
53
53
  } = filterSettingStates;
54
54
 
55
55
  const hasAPIData = Boolean(Object.entries(columnsData).length);
56
+ let disbaledCondition =
57
+ quickTabStates?.show_list?.length === 0 ||
58
+ (columnTabState?.isDefault
59
+ ? columnTabState?.show_list?.length === 0
60
+ : columnTabState?.tabs?.find((tab) => tab?.show_list?.length === 0)
61
+ ?.show_list?.length === 0);
56
62
 
57
63
  const handleTabChange = (_: React.SyntheticEvent, newValue: number) => {
58
64
  setTabValue(newValue);
@@ -199,6 +205,7 @@ export function QuickFilterSettings({
199
205
  <CustomButton
200
206
  // disabled={saveButtonError?.hasError}
201
207
  // disabled={saveButtonError?.hasError}
208
+ disabled={disbaledCondition}
202
209
  onClick={handleSaveSetSettingsData}
203
210
  >
204
211
  {view === "listing" ? "Save Quick Filter" : "Save Kanban Layout"}
@@ -142,6 +142,7 @@ interface FilterComponentTabOptions {
142
142
  isSingleFilter?: boolean;
143
143
  isSingleEntity?: boolean;
144
144
  showFilter?: TabType;
145
+ disableShareFilter?: boolean;
145
146
  }
146
147
 
147
148
  export type FilterComponentOptions =
@@ -480,6 +480,7 @@ function ListingView() {
480
480
  showTabs: true,
481
481
  isRuleEngine: true,
482
482
  tabOptions: {
483
+ disableShareFilter: false,
483
484
  // isSingleEntity: true,
484
485
  mainFilter: {
485
486
  showSaveButton: true,