@stsdti/funky-ui-kit 1.4.3 → 1.4.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.
@@ -82669,6 +82669,10 @@ const _sfc_main = {
82669
82669
  __name: "AppBoard",
82670
82670
  props: /* @__PURE__ */ mergeModels({
82671
82671
  list: {},
82672
+ isMultiSelect: {
82673
+ type: Boolean,
82674
+ default: false
82675
+ },
82672
82676
  cellWidth: {
82673
82677
  default: 150
82674
82678
  }
@@ -82678,20 +82682,25 @@ const _sfc_main = {
82678
82682
  }),
82679
82683
  emits: ["update:modelValue"],
82680
82684
  setup(__props) {
82681
- const selectedCells = useModel(__props, "modelValue");
82682
82685
  const props2 = __props;
82686
+ const modelValue = useModel(__props, "modelValue", {
82687
+ get: (value) => {
82688
+ return makeArray(value);
82689
+ },
82690
+ set: (value) => {
82691
+ return props2.isMultiSelect ? value : lodashExports.head(value);
82692
+ }
82693
+ });
82683
82694
  const isSelected = (item) => {
82684
- return selectedCells.value.some((selectedItem) => lodashExports.isEqual(selectedItem, item));
82695
+ return modelValue.value.some((selectedItem) => lodashExports.isEqual(selectedItem, item));
82685
82696
  };
82686
82697
  const selectCell = (item) => {
82687
- if (isSelected(item)) {
82688
- selectedCells.value = selectedCells.value.filter((selectedItem) => !lodashExports.isEqual(selectedItem, item));
82689
- return;
82690
- }
82691
- selectedCells.value = [...selectedCells.value, item];
82698
+ let newValue;
82699
+ newValue = isSelected(item) ? modelValue.value.filter((selectedItem) => !lodashExports.isEqual(selectedItem, item)) : [...modelValue.value, item];
82700
+ newValue = props2.isMultiSelect ? newValue : lodashExports.tail(newValue);
82701
+ modelValue.value = newValue;
82692
82702
  };
82693
82703
  const boardStyle = computed(() => ({
82694
- "app-board": true,
82695
82704
  gridTemplateColumns: `repeat(auto-fill, ${props2.cellWidth}px)`
82696
82705
  }));
82697
82706
  const getCellClass = (item) => {