onekijs-ui 0.19.4 → 0.19.5

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.js CHANGED
@@ -1673,7 +1673,7 @@ const FormCardDisplayer = styled(FormCardDisplayerComponent) `
1673
1673
  ${formCardDisplayerStyle}
1674
1674
  `;
1675
1675
 
1676
- const FormCard = ({ name, disabled, visible, ...cardProps }) => {
1676
+ const FormCard = ({ name, ...cardProps }) => {
1677
1677
  const decorator = onekijsFramework.useFormDecorator(name, {
1678
1678
  Displayer: (displayerProps) => {
1679
1679
  return React.createElement(FormCardDisplayer, { ...displayerProps, name: typeof cardProps.title === 'string' ? cardProps.title : titlelize(name) });
@@ -1686,8 +1686,10 @@ const FormCard = ({ name, disabled, visible, ...cardProps }) => {
1686
1686
  });
1687
1687
  const { hide, show, disable, enable } = fieldContainer;
1688
1688
  React.useEffect(() => {
1689
- if (!metadata.visible) {
1690
- if (metadata.disabled) {
1689
+ const visible = metadata.visible ?? true;
1690
+ const disabled = metadata.disabled ?? false;
1691
+ if (!visible) {
1692
+ if (disabled) {
1691
1693
  disable();
1692
1694
  }
1693
1695
  else {
@@ -1697,7 +1699,7 @@ const FormCard = ({ name, disabled, visible, ...cardProps }) => {
1697
1699
  }
1698
1700
  else {
1699
1701
  show();
1700
- if (metadata.disabled) {
1702
+ if (disabled) {
1701
1703
  disable();
1702
1704
  }
1703
1705
  else {
@@ -2273,7 +2275,7 @@ const extractFieldLayoutProps = (props) => {
2273
2275
  ];
2274
2276
  const fieldOptionsKeys = [
2275
2277
  'defaultValue',
2276
- 'touchedOn',
2278
+ 'touchOn',
2277
2279
  'disabled',
2278
2280
  'visible',
2279
2281
  'editable',
@@ -6348,18 +6350,17 @@ SelectTokenComponent.displayName = 'SelectTokenComponent';
6348
6350
  var SelectTokenComponent$1 = React.memo(SelectTokenComponent);
6349
6351
 
6350
6352
  const SelectTokensComponent = ({ tokens, onRemove, maxDisplayTokens, }) => {
6351
- const widthRef = React.useRef();
6352
6353
  const onExiting = (node) => {
6353
6354
  node.style.width = '0';
6354
6355
  node.style.opacity = '0';
6355
6356
  };
6356
6357
  const onEntering = (node) => {
6357
- widthRef.current = node.getBoundingClientRect().width;
6358
+ const width = node.getBoundingClientRect().width;
6358
6359
  node.style.width = '0px';
6359
6360
  node.style.opacity = '0';
6360
6361
  node.style.transition = 'all 150ms';
6361
6362
  setTimeout(() => {
6362
- node.style.width = `${widthRef.current}px`;
6363
+ node.style.width = `${width}px`;
6363
6364
  node.style.opacity = '1';
6364
6365
  }, 0);
6365
6366
  };
@@ -10366,9 +10367,6 @@ const DefaultFormCellDisplayer = (props) => {
10366
10367
  if (props.column) {
10367
10368
  const name = props.column.id ? `${props.rowName}.${props.column.id}` : `${props.rowName}`;
10368
10369
  const field = form.fields[name];
10369
- if (props.column.id === 'value') {
10370
- console.log(field);
10371
- }
10372
10370
  if (field && field.Displayer) {
10373
10371
  const Component = field.Displayer;
10374
10372
  return React.createElement(Component, { name: name, label: props.column.id ? props.column.title : '', Displayer: field.Displayer, children: {}, index: 0, first: true, last: true, format: props.format });
@@ -11292,7 +11290,7 @@ const Step = ({ title, active = false, disabled = false, visible = true, closabl
11292
11290
  children)));
11293
11291
  };
11294
11292
 
11295
- const FormStep = ({ name, disabled, visible, ...stepProps }) => {
11293
+ const FormStep = ({ name, disabled = false, visible = true, ...stepProps }) => {
11296
11294
  const decorator = onekijsFramework.useFormDecorator(name, {
11297
11295
  Displayer: (displayerProps) => {
11298
11296
  const total = Object.values(displayerProps.children ?? {}).length;