@flowgram.ai/form-materials 0.2.31 → 0.2.32

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/esm/index.js CHANGED
@@ -1872,7 +1872,7 @@ function useRule(left) {
1872
1872
  import React12, { useMemo as useMemo8 } from "react";
1873
1873
  import { Button as Button2, Select as Select2 } from "@douyinfe/semi-ui";
1874
1874
  import { IconChevronDownStroked as IconChevronDownStroked2 } from "@douyinfe/semi-icons";
1875
- function useOp({ rule, op, onChange }) {
1875
+ function useOp({ rule, op, onChange, readonly }) {
1876
1876
  const options2 = useMemo8(
1877
1877
  () => Object.keys(rule || {}).map((_op) => ({
1878
1878
  ...opConfigs[_op] || {},
@@ -1885,6 +1885,7 @@ function useOp({ rule, op, onChange }) {
1885
1885
  Select2,
1886
1886
  {
1887
1887
  style: { height: 22 },
1888
+ disabled: readonly,
1888
1889
  size: "small",
1889
1890
  value: op,
1890
1891
  optionList: options2,
@@ -1904,7 +1905,8 @@ function ConditionRow({ style, value, onChange, readonly }) {
1904
1905
  const { renderOpSelect, opConfig } = useOp({
1905
1906
  rule,
1906
1907
  op: operator,
1907
- onChange: (v) => onChange({ ...value, operator: v })
1908
+ onChange: (v) => onChange({ ...value, operator: v }),
1909
+ readonly
1908
1910
  });
1909
1911
  const targetSchema = useMemo9(() => {
1910
1912
  const targetType = rule?.[operator] || null;