@firecms/core 3.0.0-canary.120 → 3.0.0-canary.121

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.umd.js CHANGED
@@ -6325,9 +6325,7 @@
6325
6325
  }
6326
6326
  function VirtualTableSelect(props) {
6327
6327
  const {
6328
- name,
6329
6328
  enumValues,
6330
- error,
6331
6329
  internalValue,
6332
6330
  disabled,
6333
6331
  small,
@@ -6344,6 +6342,7 @@
6344
6342
  }
6345
6343
  }, [focused, ref]);
6346
6344
  const onChange = React.useCallback((updatedValue) => {
6345
+ console.trace("onChange");
6347
6346
  if (valueType === "number") {
6348
6347
  if (multiple) {
6349
6348
  const newValue = updatedValue.map((v) => parseFloat(v));
@@ -6360,41 +6359,28 @@
6360
6359
  throw Error("Missing mapping in TableSelect");
6361
6360
  }
6362
6361
  }, [multiple, updateValue, valueType]);
6363
- const renderValue = (enumKey, index) => {
6364
- if (multiple && Array.isArray(enumKey)) {
6365
- return /* @__PURE__ */ jsxRuntime.jsx(
6366
- ArrayEnumPreview,
6367
- {
6368
- value: enumKey,
6369
- name,
6370
- enumValues,
6371
- size: small ? "small" : "medium"
6372
- },
6373
- `${enumKey}-${index}`
6374
- );
6375
- } else {
6376
- return /* @__PURE__ */ jsxRuntime.jsx(
6377
- EnumValuesChip,
6378
- {
6379
- enumKey,
6380
- enumValues,
6381
- size: small ? "small" : "medium"
6382
- },
6383
- `${enumKey}-${index}`
6384
- );
6385
- }
6362
+ const renderValue = (enumKey) => {
6363
+ return /* @__PURE__ */ jsxRuntime.jsx(
6364
+ EnumValuesChip,
6365
+ {
6366
+ enumKey: String(enumKey),
6367
+ enumValues,
6368
+ size: small ? "small" : "medium"
6369
+ },
6370
+ `${enumKey}`
6371
+ );
6386
6372
  };
6387
6373
  return multiple ? /* @__PURE__ */ jsxRuntime.jsx(
6388
6374
  ui.MultiSelect,
6389
6375
  {
6390
6376
  inputRef: ref,
6391
- containerClassName: "w-full h-full",
6392
6377
  className: "w-full h-full p-0 bg-transparent",
6393
6378
  position: "item-aligned",
6394
6379
  disabled,
6380
+ includeClear: false,
6381
+ useChips: false,
6395
6382
  value: validValue ? internalValue.map((v) => v.toString()) : [],
6396
- onMultiValueChange: onChange,
6397
- renderValue,
6383
+ onValueChange: onChange,
6398
6384
  children: enumValues?.map((enumConfig) => /* @__PURE__ */ jsxRuntime.jsx(
6399
6385
  ui.MultiSelectItem,
6400
6386
  {
@@ -6418,12 +6404,9 @@
6418
6404
  className: "w-full h-full p-0 bg-transparent",
6419
6405
  position: "item-aligned",
6420
6406
  disabled,
6421
- multiple,
6422
6407
  padding: false,
6423
- includeFocusOutline: false,
6424
- value: validValue ? multiple ? internalValue.map((v) => v.toString()) : internalValue?.toString() : multiple ? [] : "",
6408
+ value: validValue ? internalValue?.toString() : "",
6425
6409
  onValueChange: onChange,
6426
- onMultiValueChange: onChange,
6427
6410
  renderValue,
6428
6411
  children: enumValues?.map((enumConfig) => /* @__PURE__ */ jsxRuntime.jsx(
6429
6412
  ui.SelectItem,
@@ -7738,8 +7721,9 @@
7738
7721
  }
7739
7722
  }, [ref, onSelect, selected, disabled]);
7740
7723
  const onFocus = React.useCallback((event) => {
7741
- onSelectCallback();
7742
7724
  event.stopPropagation();
7725
+ event.preventDefault();
7726
+ onSelectCallback();
7743
7727
  }, [onSelectCallback]);
7744
7728
  const isOverflowing = React.useMemo(() => {
7745
7729
  if (bounds) {
@@ -9622,6 +9606,7 @@
9622
9606
  }
9623
9607
  }
9624
9608
  const multiple = multipleSelectOperations$1.includes(operation);
9609
+ console.log("internalValue", { internalValue });
9625
9610
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-[440px]", children: [
9626
9611
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[80px]", children: /* @__PURE__ */ jsxRuntime.jsx(
9627
9612
  ui.Select,
@@ -9654,16 +9639,15 @@
9654
9639
  )
9655
9640
  }
9656
9641
  ),
9657
- enumValues && /* @__PURE__ */ jsxRuntime.jsx(
9642
+ enumValues && !multiple && /* @__PURE__ */ jsxRuntime.jsx(
9658
9643
  ui.Select,
9659
9644
  {
9660
9645
  position: "item-aligned",
9661
- value: internalValue !== void 0 ? Array.isArray(internalValue) ? internalValue.map((e) => String(e)) : String(internalValue) : isArray ? [] : "",
9646
+ value: typeof internalValue === "string" ? internalValue : "",
9662
9647
  onValueChange: (value2) => {
9663
9648
  if (value2 !== "")
9664
9649
  updateFilter(operation, dataType === "number" ? parseInt(value2) : value2);
9665
9650
  },
9666
- multiple,
9667
9651
  endAdornment: internalValue && /* @__PURE__ */ jsxRuntime.jsx(
9668
9652
  ui.IconButton,
9669
9653
  {
@@ -9675,6 +9659,8 @@
9675
9659
  renderValue: (enumKey) => {
9676
9660
  if (enumKey === null)
9677
9661
  return "Filter for null values";
9662
+ if (enumKey === void 0)
9663
+ return null;
9678
9664
  return /* @__PURE__ */ jsxRuntime.jsx(
9679
9665
  EnumValuesChip,
9680
9666
  {
@@ -9698,6 +9684,40 @@
9698
9684
  }
9699
9685
  )
9700
9686
  },
9687
+ `select_item_${name}_${enumConfig.id}`
9688
+ ))
9689
+ }
9690
+ ),
9691
+ enumValues && multiple && /* @__PURE__ */ jsxRuntime.jsx(
9692
+ ui.MultiSelect,
9693
+ {
9694
+ position: "item-aligned",
9695
+ value: Array.isArray(internalValue) ? internalValue.map((e) => String(e)) : [],
9696
+ onValueChange: (value2) => {
9697
+ updateFilter(operation, dataType === "number" ? value2.map((v) => parseInt(v)) : value2);
9698
+ },
9699
+ multiple,
9700
+ endAdornment: internalValue && /* @__PURE__ */ jsxRuntime.jsx(
9701
+ ui.IconButton,
9702
+ {
9703
+ className: "absolute right-2 top-3",
9704
+ onClick: (e) => updateFilter(operation, void 0),
9705
+ children: /* @__PURE__ */ jsxRuntime.jsx(ui.ClearIcon, {})
9706
+ }
9707
+ ),
9708
+ children: enumValues.map((enumConfig) => /* @__PURE__ */ jsxRuntime.jsx(
9709
+ ui.MultiSelectItem,
9710
+ {
9711
+ value: String(enumConfig.id),
9712
+ children: /* @__PURE__ */ jsxRuntime.jsx(
9713
+ EnumValuesChip,
9714
+ {
9715
+ enumKey: String(enumConfig.id),
9716
+ enumValues,
9717
+ size: "small"
9718
+ }
9719
+ )
9720
+ },
9701
9721
  `select_value_${name}_${enumConfig.id}`
9702
9722
  ))
9703
9723
  }
@@ -13981,7 +14001,7 @@
13981
14001
  )
13982
14002
  ] });
13983
14003
  }
13984
- function MultiSelectBinding({
14004
+ function MultiSelectFieldBinding({
13985
14005
  propertyKey,
13986
14006
  value,
13987
14007
  setValue,
@@ -14045,13 +14065,15 @@
14045
14065
  enumKey
14046
14066
  );
14047
14067
  }, [enumValues, setValue, value]);
14048
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-0.5 ml-0.5 mt-2", children: [
14068
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14049
14069
  /* @__PURE__ */ jsxRuntime.jsx(
14050
14070
  ui.MultiSelect,
14051
14071
  {
14072
+ className: "w-full mt-2",
14052
14073
  size: size === "medium" ? "medium" : "small",
14053
14074
  value: validValue ? value.map((v) => v.toString()) : [],
14054
14075
  disabled,
14076
+ modalPopover: true,
14055
14077
  label: /* @__PURE__ */ jsxRuntime.jsx(
14056
14078
  LabelWithIconAndTooltip,
14057
14079
  {
@@ -14062,8 +14084,7 @@
14062
14084
  className: "text-text-secondary dark:text-text-secondary-dark ml-3.5"
14063
14085
  }
14064
14086
  ),
14065
- renderValue: React.useCallback((v) => renderValue(v, false), [renderValue]),
14066
- onMultiValueChange: (updatedValue) => {
14087
+ onValueChange: (updatedValue) => {
14067
14088
  let newValue;
14068
14089
  if (of && of?.dataType === "number") {
14069
14090
  newValue = updatedValue ? updatedValue.map((e) => parseFloat(e)) : [];
@@ -16564,7 +16585,7 @@
16564
16585
  dataType: "string",
16565
16586
  enumValues: []
16566
16587
  },
16567
- Field: MultiSelectBinding
16588
+ Field: MultiSelectFieldBinding
16568
16589
  }
16569
16590
  },
16570
16591
  number_input: {
@@ -16602,7 +16623,7 @@
16602
16623
  dataType: "number",
16603
16624
  enumValues: []
16604
16625
  },
16605
- Field: MultiSelectBinding
16626
+ Field: MultiSelectFieldBinding
16606
16627
  }
16607
16628
  },
16608
16629
  file_upload: {
@@ -18883,14 +18904,6 @@
18883
18904
  }) => {
18884
18905
  const collection = collectionProp ?? navigationController.getCollection(path);
18885
18906
  const usedDelegate = collection?.overrides?.dataSourceDelegate ?? delegate;
18886
- console.log("useBuildDatasource save", {
18887
- path,
18888
- entityId,
18889
- values,
18890
- collectionProp,
18891
- collection,
18892
- status
18893
- });
18894
18907
  const resolvedCollection = collection ? resolveCollection({
18895
18908
  collection,
18896
18909
  path,
@@ -18935,7 +18948,10 @@
18935
18948
  collection
18936
18949
  }) => {
18937
18950
  const usedDelegate = collection?.overrides?.dataSourceDelegate ?? delegate;
18938
- return usedDelegate.deleteEntity({ entity, collection });
18951
+ return usedDelegate.deleteEntity({
18952
+ entity,
18953
+ collection
18954
+ });
18939
18955
  }, [delegate.deleteEntity]),
18940
18956
  /**
18941
18957
  * Check if the given property is unique in the given collection
@@ -19771,7 +19787,7 @@
19771
19787
  exports2.MarkdownEditorFieldBinding = MarkdownEditorFieldBinding;
19772
19788
  exports2.ModeControllerContext = ModeControllerContext;
19773
19789
  exports2.ModeControllerProvider = ModeControllerProvider;
19774
- exports2.MultiSelectBinding = MultiSelectBinding;
19790
+ exports2.MultiSelectFieldBinding = MultiSelectFieldBinding;
19775
19791
  exports2.NavigationCard = NavigationCard;
19776
19792
  exports2.NavigationCardBinding = NavigationCardBinding;
19777
19793
  exports2.NavigationGroup = NavigationGroup;