@constructor-io/constructorio-ui-autocomplete 1.3.2 → 1.3.3

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.
@@ -6,11 +6,13 @@ const SectionItem_1 = tslib_1.__importDefault(require("../SectionItem/SectionIte
6
6
  const utils_1 = require("../../../utils");
7
7
  // eslint-disable-next-line func-names
8
8
  const DefaultRenderSectionItemsList = function ({ section }) {
9
- var _a;
9
+ var _a, _b;
10
10
  const sectionName = (section === null || section === void 0 ? void 0 : section.displayName) || (section === null || section === void 0 ? void 0 : section.identifier);
11
+ if (!((_a = section === null || section === void 0 ? void 0 : section.data) === null || _a === void 0 ? void 0 : _a.length))
12
+ return null;
11
13
  return (react_1.default.createElement("li", { className: `${sectionName} cio-section`, role: 'none' },
12
14
  react_1.default.createElement("h5", { className: 'cio-sectionName', "aria-hidden": true }, (0, utils_1.camelToStartCase)(sectionName)),
13
- react_1.default.createElement("ul", { className: 'cio-section-items', role: 'none' }, (_a = section === null || section === void 0 ? void 0 : section.data) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
15
+ react_1.default.createElement("ul", { className: 'cio-section-items', role: 'none' }, (_b = section === null || section === void 0 ? void 0 : section.data) === null || _b === void 0 ? void 0 : _b.map((item, index) => {
14
16
  var _a;
15
17
  return (react_1.default.createElement(SectionItem_1.default, { item: item, index: index, sectionIdentifier: section === null || section === void 0 ? void 0 : section.identifier, key: `${section === null || section === void 0 ? void 0 : section.identifier}_${(_a = item === null || item === void 0 ? void 0 : item.data) === null || _a === void 0 ? void 0 : _a.id}` }));
16
18
  }))));
@@ -1 +1 @@
1
- {"version":3,"file":"SectionItemsList.js","sourceRoot":"","sources":["../../../../../src/components/Autocomplete/SectionItemsList/SectionItemsList.tsx"],"names":[],"mappings":";;;AAAA,0DAA4C;AAE5C,qFAAqD;AACrD,0CAAkD;AAYlD,sCAAsC;AACtC,MAAM,6BAA6B,GAA2B,UAAU,EAAE,OAAO,EAAE;;IACjF,MAAM,WAAW,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,MAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,CAAA,CAAC;IAEhE,OAAO,CACL,sCAAI,SAAS,EAAE,GAAG,WAAW,cAAc,EAAE,IAAI,EAAC,MAAM;QACtD,sCAAI,SAAS,EAAC,iBAAiB,yBAC5B,IAAA,wBAAgB,EAAC,WAAW,CAAC,CAC3B;QACL,sCAAI,SAAS,EAAC,mBAAmB,EAAC,IAAI,EAAC,MAAM,IAC1C,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;;YAAC,OAAA,CACnC,8BAAC,qBAAW,IACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,iBAAiB,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,EACtC,GAAG,EAAE,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,IAAI,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,0CAAE,EAAE,EAAE,GAC/C,CACH,CAAA;SAAA,CAAC,CACC,CACF,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,SAAwB,gBAAgB,CAAC,KAA4B;IACnE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,6BAA6B,EAAE,GAAG,KAAK,CAAC;IAEpE,OAAO,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAC/B,CAAC;AAJD,mCAIC"}
1
+ {"version":3,"file":"SectionItemsList.js","sourceRoot":"","sources":["../../../../../src/components/Autocomplete/SectionItemsList/SectionItemsList.tsx"],"names":[],"mappings":";;;AAAA,0DAA4C;AAE5C,qFAAqD;AACrD,0CAAkD;AAYlD,sCAAsC;AACtC,MAAM,6BAA6B,GAA2B,UAAU,EAAE,OAAO,EAAE;;IACjF,MAAM,WAAW,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,MAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,CAAA,CAAC;IAEhE,IAAI,CAAC,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,MAAM,CAAA;QAAE,OAAO,IAAI,CAAC;IAExC,OAAO,CACL,sCAAI,SAAS,EAAE,GAAG,WAAW,cAAc,EAAE,IAAI,EAAC,MAAM;QACtD,sCAAI,SAAS,EAAC,iBAAiB,yBAC5B,IAAA,wBAAgB,EAAC,WAAW,CAAC,CAC3B;QACL,sCAAI,SAAS,EAAC,mBAAmB,EAAC,IAAI,EAAC,MAAM,IAC1C,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;;YAAC,OAAA,CACnC,8BAAC,qBAAW,IACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,iBAAiB,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,EACtC,GAAG,EAAE,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,IAAI,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,0CAAE,EAAE,EAAE,GAC/C,CACH,CAAA;SAAA,CAAC,CACC,CACF,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,SAAwB,gBAAgB,CAAC,KAA4B;IACnE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,6BAA6B,EAAE,GAAG,KAAK,CAAC;IAEpE,OAAO,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAC/B,CAAC;AAJD,mCAIC"}
@@ -4,6 +4,8 @@ import { camelToStartCase } from '../../../utils';
4
4
  // eslint-disable-next-line func-names
5
5
  const DefaultRenderSectionItemsList = function ({ section }) {
6
6
  const sectionName = section?.displayName || section?.identifier;
7
+ if (!section?.data?.length)
8
+ return null;
7
9
  return (React.createElement("li", { className: `${sectionName} cio-section`, role: 'none' },
8
10
  React.createElement("h5", { className: 'cio-sectionName', "aria-hidden": true }, camelToStartCase(sectionName)),
9
11
  React.createElement("ul", { className: 'cio-section-items', role: 'none' }, section?.data?.map((item, index) => (React.createElement(SectionItem, { item: item, index: index, sectionIdentifier: section?.identifier, key: `${section?.identifier}_${item?.data?.id}` }))))));
@@ -1 +1 @@
1
- {"version":3,"file":"SectionItemsList.js","sourceRoot":"","sources":["../../../../../src/components/Autocomplete/SectionItemsList/SectionItemsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAE5C,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAYlD,sCAAsC;AACtC,MAAM,6BAA6B,GAA2B,UAAU,EAAE,OAAO,EAAE;IACjF,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,UAAU,CAAC;IAEhE,OAAO,CACL,4BAAI,SAAS,EAAE,GAAG,WAAW,cAAc,EAAE,IAAI,EAAC,MAAM;QACtD,4BAAI,SAAS,EAAC,iBAAiB,yBAC5B,gBAAgB,CAAC,WAAW,CAAC,CAC3B;QACL,4BAAI,SAAS,EAAC,mBAAmB,EAAC,IAAI,EAAC,MAAM,IAC1C,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACnC,oBAAC,WAAW,IACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,iBAAiB,EAAE,OAAO,EAAE,UAAU,EACtC,GAAG,EAAE,GAAG,OAAO,EAAE,UAAU,IAAI,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,GAC/C,CACH,CAAC,CACC,CACF,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAA4B;IACnE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,6BAA6B,EAAE,GAAG,KAAK,CAAC;IAEpE,OAAO,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAC/B,CAAC"}
1
+ {"version":3,"file":"SectionItemsList.js","sourceRoot":"","sources":["../../../../../src/components/Autocomplete/SectionItemsList/SectionItemsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAE5C,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAYlD,sCAAsC;AACtC,MAAM,6BAA6B,GAA2B,UAAU,EAAE,OAAO,EAAE;IACjF,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,UAAU,CAAC;IAEhE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM;QAAE,OAAO,IAAI,CAAC;IAExC,OAAO,CACL,4BAAI,SAAS,EAAE,GAAG,WAAW,cAAc,EAAE,IAAI,EAAC,MAAM;QACtD,4BAAI,SAAS,EAAC,iBAAiB,yBAC5B,gBAAgB,CAAC,WAAW,CAAC,CAC3B;QACL,4BAAI,SAAS,EAAC,mBAAmB,EAAC,IAAI,EAAC,MAAM,IAC1C,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACnC,oBAAC,WAAW,IACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,iBAAiB,EAAE,OAAO,EAAE,UAAU,EACtC,GAAG,EAAE,GAAG,OAAO,EAAE,UAAU,IAAI,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,GAC/C,CACH,CAAC,CACC,CACF,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAA4B;IACnE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,6BAA6B,EAAE,GAAG,KAAK,CAAC;IAEpE,OAAO,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AAC/B,CAAC"}
package/lib/styles.css CHANGED
@@ -90,10 +90,15 @@
90
90
  border-radius: 4px;
91
91
  }
92
92
 
93
+ .cio-autocomplete .Products {
94
+ padding: 0 5px;
95
+ }
96
+
93
97
  .cio-autocomplete .Products .cio-item {
94
98
  display: inline-flex;
95
99
  align-items: center;
96
100
  width: 25%;
101
+ min-width: 130px;
97
102
  height: 140px;
98
103
  padding: 5px 0;
99
104
  }
@@ -2,11 +2,11 @@ import React, { ReactElement } from 'react';
2
2
  import { SectionConfiguration } from '../../../types';
3
3
  export type RenderSectionItemsList = (renderResultsArguments: {
4
4
  section: SectionConfiguration;
5
- }) => ReactElement;
5
+ }) => ReactElement | null;
6
6
  type SectionItemsListProps = {
7
7
  section: SectionConfiguration;
8
8
  children?: RenderSectionItemsList;
9
9
  key?: string;
10
10
  };
11
- export default function SectionItemsList(props: SectionItemsListProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
11
+ export default function SectionItemsList(props: SectionItemsListProps): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
12
12
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-ui-autocomplete",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Constructor.io Autocomplete UI library for web applications",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",