@dartcom/ui-kit 10.3.8 → 10.3.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/components/list/list.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,iBAAS,UAAU,CAAC,CAAC,EAAE,EACrB,KAAK,EACL,YAAgB,EAChB,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,EAAE,EAEF,YAAmB,GACpB,EAAE,SAAS,CAAC,CAAC,CAAC,2CA+Fd;AAED,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/components/list/list.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,iBAAS,UAAU,CAAC,CAAC,EAAE,EACrB,KAAK,EACL,YAAgB,EAChB,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,EAAE,EAEF,YAAmB,GACpB,EAAE,SAAS,CAAC,CAAC,CAAC,2CA0Gd;AAED,eAAe,UAAU,CAAC"}
@@ -9,4 +9,5 @@ export declare const EmptyAndTitle: Story;
9
9
  export declare const EmptyNoShow: Story;
10
10
  export declare const WithTitle: Story;
11
11
  export declare const WithClear: Story;
12
+ export declare const EmptyWithClear: Story;
12
13
  //# sourceMappingURL=list.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.stories.d.ts","sourceRoot":"","sources":["../../../src/components/list/list.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAEzB,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CAQ3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAWnB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAY3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAYzB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAYvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAiBvB,CAAC"}
1
+ {"version":3,"file":"list.stories.d.ts","sourceRoot":"","sources":["../../../src/components/list/list.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAEzB,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CAQ3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAWnB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAY3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAYzB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAYvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAwBvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAwB5B,CAAC"}
package/dist/index.cjs CHANGED
@@ -32277,7 +32277,14 @@ const NoData = ({ text = 'Нет данных' }) => {
32277
32277
  };
32278
32278
 
32279
32279
  function CustomList({ items, columnsCount = 1, getContent, title, getKey, onClick, onClear, sx, isShowNoData = true, }) {
32280
- const isNoData = items.length === 0;
32280
+ const isData = React__namespace.useMemo(() => {
32281
+ const isData = items.length > 0;
32282
+ return isData;
32283
+ }, [items.length]);
32284
+ const isShowClear = React__namespace.useMemo(() => {
32285
+ const isShowClear = Boolean(onClear) && isData;
32286
+ return isShowClear;
32287
+ }, [onClear, isData]);
32281
32288
  return (jsxRuntime.jsxs(material.Box, { sx: ({ spacing, breakpoints }) => {
32282
32289
  return {
32283
32290
  display: 'grid',
@@ -32292,16 +32299,17 @@ function CustomList({ items, columnsCount = 1, getContent, title, getKey, onClic
32292
32299
  return {
32293
32300
  display: 'flex',
32294
32301
  alignItems: 'center',
32302
+ justifyContent: 'center',
32295
32303
  gap: spacing(1),
32296
32304
  };
32297
32305
  }, children: [title ? (jsxRuntime.jsx(material.Typography, { variant: "h6", noWrap: true, sx: {
32298
32306
  textAlign: 'center',
32299
32307
  fontWeight: 700,
32300
32308
  ...sx?.title,
32301
- }, children: title })) : null, onClear ? (jsxRuntime.jsx(IconButton, { iconProps: {
32309
+ }, children: title })) : null, isShowClear ? (jsxRuntime.jsx(IconButton, { iconProps: {
32302
32310
  name: 'clear',
32303
32311
  color: 'warning',
32304
- }, onClick: onClear })) : null] })) : null, isNoData ? (jsxRuntime.jsx(React__namespace.Fragment, { children: isShowNoData ? jsxRuntime.jsx(NoData, {}) : null })) : (jsxRuntime.jsx(material.List, { sx: ({ spacing, breakpoints }) => {
32312
+ }, onClick: onClear })) : null] })) : null, isData ? (jsxRuntime.jsx(material.List, { sx: ({ spacing, breakpoints }) => {
32305
32313
  return {
32306
32314
  display: 'grid',
32307
32315
  gridTemplateColumns: `repeat(${columnsCount}, 1fr)`,
@@ -32315,7 +32323,7 @@ function CustomList({ items, columnsCount = 1, getContent, title, getKey, onClic
32315
32323
  return {
32316
32324
  ...sx?.item,
32317
32325
  };
32318
- }, disablePadding: true, children: getContent(item, index) }, getKey(item, index)))) }))] }));
32326
+ }, disablePadding: true, children: getContent(item, index) }, getKey(item, index)))) })) : (jsxRuntime.jsx(React__namespace.Fragment, { children: isShowNoData ? jsxRuntime.jsx(NoData, {}) : null }))] }));
32319
32327
  }
32320
32328
 
32321
32329
  function useCombinedRefs() {