@kne/super-select 0.1.3 → 0.1.4

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/dist/index.css CHANGED
@@ -118,7 +118,6 @@
118
118
  transition: background 300ms;
119
119
  position: relative;
120
120
  border-bottom-color: transparent !important;
121
- align-items: flex-start;
122
121
  }
123
122
  ._KtOsz:not(._TQhBB):hover {
124
123
  background: var(--bg-color-grey-1);
@@ -1 +1 @@
1
- {"version":3,"sources":["style.module.scss"],"names":[],"mappings":"AAAA;EACE,mBAAmB;EACnB,sBAAsB;EACtB,mCAAmC;EACnC,0CAA0C;EAC1C,kBAAkB;EAClB,eAAe;EACf,WAAW;EACX,gBAAgB;EAChB,kBAAkB;EAClB,eAAe;EACf,uBAAuB;AACzB;AACA;EACE,kCAAkC;AACpC;AACA;EACE,kCAAkC;AACpC;AACA;EACE,kCAAkC;EAClC,+BAA+B;EAC/B,mBAAmB;AACrB;AACA;EACE,+BAA+B;AACjC;AACA;EACE,aAAa;AACf;AACA;EACE,eAAe;AACjB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,kBAAkB;EAClB,gBAAgB;EAChB,8BAA8B;AAChC;AACA;EACE,qBAAqB;AACvB;;AAEA;EACE,+BAA+B;EAC/B,eAAe;EACf,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,gBAAgB;EAChB,2BAA2B;AAC7B;;AAEA;EACE,UAAU;AACZ;AApEA;EACE,qBAAqB;AACvB;AACA;EACE,+BAA+B;AACjC;AALA;EACE,iBAAiB;AACnB;;AAEA;EACE,sBAAsB;AACxB;AACA;EACE,kCAAkC;AACpC;;AAEA;EACE,iBAAiB;EACjB,OAAO;AACT;;AAEA;EACE,mBAAmB;EACnB,sBAAsB;AACxB;AAnBA;EACE,iBAAiB;AACnB;AACA;EACE,iBAAiB;AACnB;;AAEA;EACE,kCAAkC;EAClC,mBAAmB;AACrB;AACA;EACE,+BAA+B;AACjC;AACA;EACE,oBAAoB;AACtB;;AAEA;EACE,4BAA4B;EAC5B,mBAAmB;EACnB,eAAe;EACf,4BAA4B;EAC5B,kBAAkB;EAClB,2CAA2C;EAC3C,uBAAuB;AACzB;AACA;EACE,kCAAkC;AACpC;AACA;EACE,kCAAkC;AACpC;AACA;;;EAGE,2BAA2B;AAC7B;AACA;EACE,+BAA+B;EAC/B,mBAAmB;AACrB;;AAEA;;EAEE,uBAAuB;AACzB;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,iBAAiB;AACnB;AACA;EACE,cAAc;AAChB;;AAEA;EACE,8CAA8C;AAChD;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,oBAAoB;AACtB;;AAEA;EACE,aAAa;AACf","file":"index.css","sourcesContent":[".list {\n max-height: 300px;\n}\n.list:not(.is-popup) {\n max-height: 400px;\n}\n\n.default-list.is-selected-all {\n background: var(--bg-color-grey-3);\n cursor: not-allowed;\n}\n.default-list.is-selected-all .item-label {\n color: var(--font-color-grey-2);\n}\n.default-list.is-selected-all .list-item {\n pointer-events: none;\n}\n\n.default-list-item {\n padding: 5px 12px !important;\n border-bottom: none;\n cursor: pointer;\n transition: background 300ms;\n position: relative;\n border-bottom-color: transparent !important;\n align-items: flex-start;\n}\n.default-list-item:not(.is-selected):hover {\n background: var(--bg-color-grey-1);\n}\n.default-list-item.is-selected {\n background: var(--primary-color-1);\n}\n.default-list-item.is-selected .default-item-label,\n.default-list-item.is-selected .default-item-des,\n.default-list-item.is-selected .single-checked {\n color: var(--primary-color);\n}\n.default-list-item.is-disabled {\n color: var(--font-color-grey-2);\n cursor: not-allowed;\n}\n\n.default-item-label,\n.default-item-description {\n transition: color 300ms;\n}\n\n.default-item-description {\n color: var(--font-color-grey-1);\n}\n\n.single-checked {\n flex-basis: 14px;\n}\n\n.selected-all:global(.is-popup) {\n padding: 5px 12px;\n}\n.selected-all:not(:global(.is-popup)) {\n padding: 5px 0;\n}\n\n.selected-tag {\n border-top: solid 1px var(--font-color-grey-4);\n}\n.selected-tag:global(.is-popup) {\n padding: 12px 0 12px 12px;\n}\n.selected-tag:not(:global(.is-popup)) {\n padding: 12px 0 12px;\n}\n\n.select-search:global(.is-popup) {\n padding: 12px;\n}"]}
1
+ {"version":3,"sources":["style.module.scss"],"names":[],"mappings":"AAAA;EACE,mBAAmB;EACnB,sBAAsB;EACtB,mCAAmC;EACnC,0CAA0C;EAC1C,kBAAkB;EAClB,eAAe;EACf,WAAW;EACX,gBAAgB;EAChB,kBAAkB;EAClB,eAAe;EACf,uBAAuB;AACzB;AACA;EACE,kCAAkC;AACpC;AACA;EACE,kCAAkC;AACpC;AACA;EACE,kCAAkC;EAClC,+BAA+B;EAC/B,mBAAmB;AACrB;AACA;EACE,+BAA+B;AACjC;AACA;EACE,aAAa;AACf;AACA;EACE,eAAe;AACjB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,kBAAkB;EAClB,gBAAgB;EAChB,8BAA8B;AAChC;AACA;EACE,qBAAqB;AACvB;;AAEA;EACE,+BAA+B;EAC/B,eAAe;EACf,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,gBAAgB;EAChB,2BAA2B;AAC7B;;AAEA;EACE,UAAU;AACZ;AApEA;EACE,qBAAqB;AACvB;AACA;EACE,+BAA+B;AACjC;AALA;EACE,iBAAiB;AACnB;;AAEA;EACE,sBAAsB;AACxB;AACA;EACE,kCAAkC;AACpC;;AAEA;EACE,iBAAiB;EACjB,OAAO;AACT;;AAEA;EACE,mBAAmB;EACnB,sBAAsB;AACxB;AAnBA;EACE,iBAAiB;AACnB;AACA;EACE,iBAAiB;AACnB;;AAEA;EACE,kCAAkC;EAClC,mBAAmB;AACrB;AACA;EACE,+BAA+B;AACjC;AACA;EACE,oBAAoB;AACtB;;AAEA;EACE,4BAA4B;EAC5B,mBAAmB;EACnB,eAAe;EACf,4BAA4B;EAC5B,kBAAkB;EAClB,2CAA2C;AAC7C;AACA;EACE,kCAAkC;AACpC;AACA;EACE,kCAAkC;AACpC;AACA;;;EAGE,2BAA2B;AAC7B;AACA;EACE,+BAA+B;EAC/B,mBAAmB;AACrB;;AAEA;;EAEE,uBAAuB;AACzB;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,iBAAiB;AACnB;AACA;EACE,cAAc;AAChB;;AAEA;EACE,8CAA8C;AAChD;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,oBAAoB;AACtB;;AAEA;EACE,aAAa;AACf","file":"index.css","sourcesContent":[".list {\n max-height: 300px;\n}\n.list:not(.is-popup) {\n max-height: 400px;\n}\n\n.default-list.is-selected-all {\n background: var(--bg-color-grey-3);\n cursor: not-allowed;\n}\n.default-list.is-selected-all .item-label {\n color: var(--font-color-grey-2);\n}\n.default-list.is-selected-all .list-item {\n pointer-events: none;\n}\n\n.default-list-item {\n padding: 5px 12px !important;\n border-bottom: none;\n cursor: pointer;\n transition: background 300ms;\n position: relative;\n border-bottom-color: transparent !important;\n}\n.default-list-item:not(.is-selected):hover {\n background: var(--bg-color-grey-1);\n}\n.default-list-item.is-selected {\n background: var(--primary-color-1);\n}\n.default-list-item.is-selected .default-item-label,\n.default-list-item.is-selected .default-item-des,\n.default-list-item.is-selected .single-checked {\n color: var(--primary-color);\n}\n.default-list-item.is-disabled {\n color: var(--font-color-grey-2);\n cursor: not-allowed;\n}\n\n.default-item-label,\n.default-item-description {\n transition: color 300ms;\n}\n\n.default-item-description {\n color: var(--font-color-grey-1);\n}\n\n.single-checked {\n flex-basis: 14px;\n}\n\n.selected-all:global(.is-popup) {\n padding: 5px 12px;\n}\n.selected-all:not(:global(.is-popup)) {\n padding: 5px 0;\n}\n\n.selected-tag {\n border-top: solid 1px var(--font-color-grey-4);\n}\n.selected-tag:global(.is-popup) {\n padding: 12px 0 12px 12px;\n}\n.selected-tag:not(:global(.is-popup)) {\n padding: 12px 0 12px;\n}\n\n.select-search:global(.is-popup) {\n padding: 12px;\n}"]}
package/dist/index.js CHANGED
@@ -2395,9 +2395,9 @@ const SelectInput = p => {
2395
2395
  };
2396
2396
  const onSelect = (item, currentSetValue) => {
2397
2397
  (currentSetValue || setValue)(value => {
2398
- const newValue = value.slice(0);
2399
- const index = value.findIndex(currentItem => currentItem.value === item.value);
2400
- if (index === -1 && !checkMaxLength(value, maxLength)) {
2398
+ const newValue = (value || []).slice(0);
2399
+ const index = newValue.findIndex(currentItem => currentItem.value === item.value);
2400
+ if (index === -1 && !checkMaxLength(newValue, maxLength)) {
2401
2401
  return value;
2402
2402
  }
2403
2403
  if (index === -1) {