@oliasoft-open-source/react-ui-library 4.9.1 → 4.9.2

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.
Files changed (21) hide show
  1. package/dist/index.js +81 -142
  2. package/dist/index.js.map +1 -1
  3. package/dist/storybook/assets/{Color-KGDBMAHA-axz4WWNG.js → Color-KGDBMAHA-sr_lo8VN.js} +1 -1
  4. package/dist/storybook/assets/{DocsRenderer-PKQXORMH-8vMJAMRC.js → DocsRenderer-PKQXORMH-Dio4TQT6.js} +1 -1
  5. package/dist/storybook/assets/{buttons-and-links-D9Ymys-6.js → buttons-and-links-BOcv8xIU.js} +1 -1
  6. package/dist/storybook/assets/{chunk-HLWAVYOI-B9GSrWDj.js → chunk-HLWAVYOI-SLqzrZ8s.js} +1 -1
  7. package/dist/storybook/assets/{color-DVEAhaOo.js → color-D1FmkH7Y.js} +1 -1
  8. package/dist/storybook/assets/{iframe-D3yGwtAt.js → iframe-NUuxNiwO.js} +2 -2
  9. package/dist/storybook/assets/{index-CCnbujdI.js → index-Bhtru3gK.js} +4 -4
  10. package/dist/storybook/assets/{index-C_oYHsdg.js → index-DNcuiqfZ.js} +1 -1
  11. package/dist/storybook/assets/{input-validation-Cg7ksWOd.js → input-validation-FFJCXfNa.js} +1 -1
  12. package/dist/storybook/assets/{inputs-BHbCmuwf.js → inputs-D3ZjmDIl.js} +1 -1
  13. package/dist/storybook/assets/{layout-forms-B6ivWQ6v.js → layout-forms-DNUCHjRh.js} +1 -1
  14. package/dist/storybook/assets/{layout-general-CnbMiIGs.js → layout-general-CuxE1EOt.js} +1 -1
  15. package/dist/storybook/assets/{padding-and-spacing-DD6y6dZk.js → padding-and-spacing-B-LaxRb4.js} +1 -1
  16. package/dist/storybook/assets/{preview-B6iMbuKe.js → preview-ClcAw55r.js} +2 -2
  17. package/dist/storybook/assets/{preview-JlPFcAwW.js → preview-DQgT2zeu.js} +1 -1
  18. package/dist/storybook/assets/{unit-input.stories-D7vlYO8f.js → unit-input.stories-BHTxKnOU.js} +1 -1
  19. package/dist/storybook/iframe.html +1 -1
  20. package/dist/storybook/project.json +1 -1
  21. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -25685,7 +25685,7 @@ class DOMParser {
25685
25685
  */
25686
25686
  parse(dom, options = {}) {
25687
25687
  let context2 = new ParseContext(this, options, false);
25688
- context2.addAll(dom, options.from, options.to);
25688
+ context2.addAll(dom, Mark$1.none, options.from, options.to);
25689
25689
  return context2.finish();
25690
25690
  }
25691
25691
  /**
@@ -25698,7 +25698,7 @@ class DOMParser {
25698
25698
  */
25699
25699
  parseSlice(dom, options = {}) {
25700
25700
  let context2 = new ParseContext(this, options, true);
25701
- context2.addAll(dom, options.from, options.to);
25701
+ context2.addAll(dom, Mark$1.none, options.from, options.to);
25702
25702
  return Slice.maxOpen(context2.finish());
25703
25703
  }
25704
25704
  /**
@@ -25831,16 +25831,14 @@ function wsOptionsFor(type, preserveWhitespace, base2) {
25831
25831
  return type && type.whitespace == "pre" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base2 & ~OPT_OPEN_LEFT;
25832
25832
  }
25833
25833
  class NodeContext {
25834
- constructor(type, attrs, marks, pendingMarks, solid, match2, options) {
25834
+ constructor(type, attrs, marks, solid, match2, options) {
25835
25835
  this.type = type;
25836
25836
  this.attrs = attrs;
25837
25837
  this.marks = marks;
25838
- this.pendingMarks = pendingMarks;
25839
25838
  this.solid = solid;
25840
25839
  this.options = options;
25841
25840
  this.content = [];
25842
25841
  this.activeMarks = Mark$1.none;
25843
- this.stashMarks = [];
25844
25842
  this.match = match2 || (options & OPT_OPEN_LEFT ? null : type.contentMatch);
25845
25843
  }
25846
25844
  findWrapping(node2) {
@@ -25878,20 +25876,6 @@ class NodeContext {
25878
25876
  content2 = content2.append(this.match.fillBefore(Fragment.empty, true));
25879
25877
  return this.type ? this.type.create(this.attrs, content2, this.marks) : content2;
25880
25878
  }
25881
- popFromStashMark(mark) {
25882
- for (let i = this.stashMarks.length - 1; i >= 0; i--)
25883
- if (mark.eq(this.stashMarks[i]))
25884
- return this.stashMarks.splice(i, 1)[0];
25885
- }
25886
- applyPending(nextType) {
25887
- for (let i = 0, pending = this.pendingMarks; i < pending.length; i++) {
25888
- let mark = pending[i];
25889
- if ((this.type ? this.type.allowsMarkType(mark.type) : markMayApply(mark.type, nextType)) && !mark.isInSet(this.activeMarks)) {
25890
- this.activeMarks = mark.addToSet(this.activeMarks);
25891
- this.pendingMarks = mark.removeFromSet(this.pendingMarks);
25892
- }
25893
- }
25894
- }
25895
25879
  inlineContext(node2) {
25896
25880
  if (this.type)
25897
25881
  return this.type.inlineContent;
@@ -25909,11 +25893,11 @@ class ParseContext {
25909
25893
  let topNode = options.topNode, topContext;
25910
25894
  let topOptions = wsOptionsFor(null, options.preserveWhitespace, 0) | (isOpen2 ? OPT_OPEN_LEFT : 0);
25911
25895
  if (topNode)
25912
- topContext = new NodeContext(topNode.type, topNode.attrs, Mark$1.none, Mark$1.none, true, options.topMatch || topNode.type.contentMatch, topOptions);
25896
+ topContext = new NodeContext(topNode.type, topNode.attrs, Mark$1.none, true, options.topMatch || topNode.type.contentMatch, topOptions);
25913
25897
  else if (isOpen2)
25914
- topContext = new NodeContext(null, null, Mark$1.none, Mark$1.none, true, null, topOptions);
25898
+ topContext = new NodeContext(null, null, Mark$1.none, true, null, topOptions);
25915
25899
  else
25916
- topContext = new NodeContext(parser2.schema.topNodeType, null, Mark$1.none, Mark$1.none, true, null, topOptions);
25900
+ topContext = new NodeContext(parser2.schema.topNodeType, null, Mark$1.none, true, null, topOptions);
25917
25901
  this.nodes = [topContext];
25918
25902
  this.find = options.findPositions;
25919
25903
  this.needsBlock = false;
@@ -25924,31 +25908,13 @@ class ParseContext {
25924
25908
  // Add a DOM node to the content. Text is inserted as text node,
25925
25909
  // otherwise, the node is passed to `addElement` or, if it has a
25926
25910
  // `style` attribute, `addElementWithStyles`.
25927
- addDOM(dom) {
25911
+ addDOM(dom, marks) {
25928
25912
  if (dom.nodeType == 3)
25929
- this.addTextNode(dom);
25913
+ this.addTextNode(dom, marks);
25930
25914
  else if (dom.nodeType == 1)
25931
- this.addElement(dom);
25932
- }
25933
- withStyleRules(dom, f2) {
25934
- let style2 = dom.style;
25935
- if (!style2 || !style2.length)
25936
- return f2();
25937
- let marks = this.readStyles(dom.style);
25938
- if (!marks)
25939
- return;
25940
- let [addMarks, removeMarks] = marks, top2 = this.top;
25941
- for (let i = 0; i < removeMarks.length; i++)
25942
- this.removePendingMark(removeMarks[i], top2);
25943
- for (let i = 0; i < addMarks.length; i++)
25944
- this.addPendingMark(addMarks[i]);
25945
- f2();
25946
- for (let i = 0; i < addMarks.length; i++)
25947
- this.removePendingMark(addMarks[i], top2);
25948
- for (let i = 0; i < removeMarks.length; i++)
25949
- this.addPendingMark(removeMarks[i]);
25950
- }
25951
- addTextNode(dom) {
25915
+ this.addElement(dom, marks);
25916
+ }
25917
+ addTextNode(dom, marks) {
25952
25918
  let value = dom.nodeValue;
25953
25919
  let top2 = this.top;
25954
25920
  if (top2.options & OPT_PRESERVE_WS_FULL || top2.inlineContext(dom) || /[^ \t\r\n\u000c]/.test(value)) {
@@ -25966,7 +25932,7 @@ class ParseContext {
25966
25932
  value = value.replace(/\r\n?/g, "\n");
25967
25933
  }
25968
25934
  if (value)
25969
- this.insertNode(this.parser.schema.text(value));
25935
+ this.insertNode(this.parser.schema.text(value), marks);
25970
25936
  this.findInText(dom);
25971
25937
  } else {
25972
25938
  this.findInside(dom);
@@ -25974,14 +25940,14 @@ class ParseContext {
25974
25940
  }
25975
25941
  // Try to find a handler for the given tag and use that to parse. If
25976
25942
  // none is found, the element's content nodes are added directly.
25977
- addElement(dom, matchAfter) {
25943
+ addElement(dom, marks, matchAfter) {
25978
25944
  let name2 = dom.nodeName.toLowerCase(), ruleID;
25979
25945
  if (listTags.hasOwnProperty(name2) && this.parser.normalizeLists)
25980
25946
  normalizeList(dom);
25981
25947
  let rule = this.options.ruleFromNode && this.options.ruleFromNode(dom) || (ruleID = this.parser.matchTag(dom, this, matchAfter));
25982
25948
  if (rule ? rule.ignore : ignoreTags.hasOwnProperty(name2)) {
25983
25949
  this.findInside(dom);
25984
- this.ignoreFallback(dom);
25950
+ this.ignoreFallback(dom, marks);
25985
25951
  } else if (!rule || rule.skip || rule.closeParent) {
25986
25952
  if (rule && rule.closeParent)
25987
25953
  this.open = Math.max(0, this.open - 1);
@@ -25997,38 +25963,37 @@ class ParseContext {
25997
25963
  if (!top2.type)
25998
25964
  this.needsBlock = true;
25999
25965
  } else if (!dom.firstChild) {
26000
- this.leafFallback(dom);
25966
+ this.leafFallback(dom, marks);
26001
25967
  return;
26002
25968
  }
26003
- if (rule && rule.skip)
26004
- this.addAll(dom);
26005
- else
26006
- this.withStyleRules(dom, () => this.addAll(dom));
25969
+ let innerMarks = rule && rule.skip ? marks : this.readStyles(dom, marks);
25970
+ if (innerMarks)
25971
+ this.addAll(dom, innerMarks);
26007
25972
  if (sync2)
26008
25973
  this.sync(top2);
26009
25974
  this.needsBlock = oldNeedsBlock;
26010
25975
  } else {
26011
- this.withStyleRules(dom, () => {
26012
- this.addElementByRule(dom, rule, rule.consuming === false ? ruleID : void 0);
26013
- });
25976
+ let innerMarks = this.readStyles(dom, marks);
25977
+ if (innerMarks)
25978
+ this.addElementByRule(dom, rule, innerMarks, rule.consuming === false ? ruleID : void 0);
26014
25979
  }
26015
25980
  }
26016
25981
  // Called for leaf DOM nodes that would otherwise be ignored
26017
- leafFallback(dom) {
25982
+ leafFallback(dom, marks) {
26018
25983
  if (dom.nodeName == "BR" && this.top.type && this.top.type.inlineContent)
26019
- this.addTextNode(dom.ownerDocument.createTextNode("\n"));
25984
+ this.addTextNode(dom.ownerDocument.createTextNode("\n"), marks);
26020
25985
  }
26021
25986
  // Called for ignored nodes
26022
- ignoreFallback(dom) {
25987
+ ignoreFallback(dom, marks) {
26023
25988
  if (dom.nodeName == "BR" && (!this.top.type || !this.top.type.inlineContent))
26024
- this.findPlace(this.parser.schema.text("-"));
25989
+ this.findPlace(this.parser.schema.text("-"), marks);
26025
25990
  }
26026
25991
  // Run any style parser associated with the node's styles. Either
26027
- // return an array of marks, or null to indicate some of the styles
26028
- // had a rule with `ignore` set.
26029
- readStyles(styles2) {
26030
- let add3 = Mark$1.none, remove2 = Mark$1.none;
26031
- if (styles2.length)
25992
+ // return an updated array of marks, or null to indicate some of the
25993
+ // styles had a rule with `ignore` set.
25994
+ readStyles(dom, marks) {
25995
+ let styles2 = dom.style;
25996
+ if (styles2 && styles2.length)
26032
25997
  for (let i = 0; i < this.parser.matchedStyles.length; i++) {
26033
25998
  let name2 = this.parser.matchedStyles[i], value = styles2.getPropertyValue(name2);
26034
25999
  if (value)
@@ -26038,47 +26003,46 @@ class ParseContext {
26038
26003
  break;
26039
26004
  if (rule.ignore)
26040
26005
  return null;
26041
- if (rule.clearMark) {
26042
- this.top.pendingMarks.concat(this.top.activeMarks).forEach((m2) => {
26043
- if (rule.clearMark(m2))
26044
- remove2 = m2.addToSet(remove2);
26045
- });
26046
- } else {
26047
- add3 = this.parser.schema.marks[rule.mark].create(rule.attrs).addToSet(add3);
26048
- }
26006
+ if (rule.clearMark)
26007
+ marks = marks.filter((m2) => !rule.clearMark(m2));
26008
+ else
26009
+ marks = marks.concat(this.parser.schema.marks[rule.mark].create(rule.attrs));
26049
26010
  if (rule.consuming === false)
26050
26011
  after = rule;
26051
26012
  else
26052
26013
  break;
26053
26014
  }
26054
26015
  }
26055
- return [add3, remove2];
26016
+ return marks;
26056
26017
  }
26057
26018
  // Look up a handler for the given node. If none are found, return
26058
26019
  // false. Otherwise, apply it, use its return value to drive the way
26059
26020
  // the node's content is wrapped, and return true.
26060
- addElementByRule(dom, rule, continueAfter) {
26061
- let sync2, nodeType, mark;
26021
+ addElementByRule(dom, rule, marks, continueAfter) {
26022
+ let sync2, nodeType;
26062
26023
  if (rule.node) {
26063
26024
  nodeType = this.parser.schema.nodes[rule.node];
26064
26025
  if (!nodeType.isLeaf) {
26065
- sync2 = this.enter(nodeType, rule.attrs || null, rule.preserveWhitespace);
26066
- } else if (!this.insertNode(nodeType.create(rule.attrs))) {
26067
- this.leafFallback(dom);
26026
+ let inner2 = this.enter(nodeType, rule.attrs || null, marks, rule.preserveWhitespace);
26027
+ if (inner2) {
26028
+ sync2 = true;
26029
+ marks = inner2;
26030
+ }
26031
+ } else if (!this.insertNode(nodeType.create(rule.attrs), marks)) {
26032
+ this.leafFallback(dom, marks);
26068
26033
  }
26069
26034
  } else {
26070
26035
  let markType = this.parser.schema.marks[rule.mark];
26071
- mark = markType.create(rule.attrs);
26072
- this.addPendingMark(mark);
26036
+ marks = marks.concat(markType.create(rule.attrs));
26073
26037
  }
26074
26038
  let startIn = this.top;
26075
26039
  if (nodeType && nodeType.isLeaf) {
26076
26040
  this.findInside(dom);
26077
26041
  } else if (continueAfter) {
26078
- this.addElement(dom, continueAfter);
26042
+ this.addElement(dom, marks, continueAfter);
26079
26043
  } else if (rule.getContent) {
26080
26044
  this.findInside(dom);
26081
- rule.getContent(dom, this.parser.schema).forEach((node2) => this.insertNode(node2));
26045
+ rule.getContent(dom, this.parser.schema).forEach((node2) => this.insertNode(node2, marks));
26082
26046
  } else {
26083
26047
  let contentDOM = dom;
26084
26048
  if (typeof rule.contentElement == "string")
@@ -26088,28 +26052,26 @@ class ParseContext {
26088
26052
  else if (rule.contentElement)
26089
26053
  contentDOM = rule.contentElement;
26090
26054
  this.findAround(dom, contentDOM, true);
26091
- this.addAll(contentDOM);
26055
+ this.addAll(contentDOM, marks);
26092
26056
  }
26093
26057
  if (sync2 && this.sync(startIn))
26094
26058
  this.open--;
26095
- if (mark)
26096
- this.removePendingMark(mark, startIn);
26097
26059
  }
26098
26060
  // Add all child nodes between `startIndex` and `endIndex` (or the
26099
26061
  // whole node, if not given). If `sync` is passed, use it to
26100
26062
  // synchronize after every block element.
26101
- addAll(parent, startIndex, endIndex) {
26063
+ addAll(parent, marks, startIndex, endIndex) {
26102
26064
  let index2 = startIndex || 0;
26103
26065
  for (let dom = startIndex ? parent.childNodes[startIndex] : parent.firstChild, end2 = endIndex == null ? null : parent.childNodes[endIndex]; dom != end2; dom = dom.nextSibling, ++index2) {
26104
26066
  this.findAtPoint(parent, index2);
26105
- this.addDOM(dom);
26067
+ this.addDOM(dom, marks);
26106
26068
  }
26107
26069
  this.findAtPoint(parent, index2);
26108
26070
  }
26109
26071
  // Try to find a way to fit the given node type into the current
26110
26072
  // context. May add intermediate wrappers and/or leave non-solid
26111
26073
  // nodes that we're in.
26112
- findPlace(node2) {
26074
+ findPlace(node2, marks) {
26113
26075
  let route, sync2;
26114
26076
  for (let depth = this.open; depth >= 0; depth--) {
26115
26077
  let cx3 = this.nodes[depth];
@@ -26124,53 +26086,61 @@ class ParseContext {
26124
26086
  break;
26125
26087
  }
26126
26088
  if (!route)
26127
- return false;
26089
+ return null;
26128
26090
  this.sync(sync2);
26129
26091
  for (let i = 0; i < route.length; i++)
26130
- this.enterInner(route[i], null, false);
26131
- return true;
26092
+ marks = this.enterInner(route[i], null, marks, false);
26093
+ return marks;
26132
26094
  }
26133
26095
  // Try to insert the given node, adjusting the context when needed.
26134
- insertNode(node2) {
26096
+ insertNode(node2, marks) {
26135
26097
  if (node2.isInline && this.needsBlock && !this.top.type) {
26136
26098
  let block2 = this.textblockFromContext();
26137
26099
  if (block2)
26138
- this.enterInner(block2);
26100
+ marks = this.enterInner(block2, null, marks);
26139
26101
  }
26140
- if (this.findPlace(node2)) {
26102
+ let innerMarks = this.findPlace(node2, marks);
26103
+ if (innerMarks) {
26141
26104
  this.closeExtra();
26142
26105
  let top2 = this.top;
26143
- top2.applyPending(node2.type);
26144
26106
  if (top2.match)
26145
26107
  top2.match = top2.match.matchType(node2.type);
26146
- let marks = top2.activeMarks;
26147
- for (let i = 0; i < node2.marks.length; i++)
26148
- if (!top2.type || top2.type.allowsMarkType(node2.marks[i].type))
26149
- marks = node2.marks[i].addToSet(marks);
26150
- top2.content.push(node2.mark(marks));
26108
+ let nodeMarks = Mark$1.none;
26109
+ for (let m2 of innerMarks.concat(node2.marks))
26110
+ if (top2.type ? top2.type.allowsMarkType(m2.type) : markMayApply(m2.type, node2.type))
26111
+ nodeMarks = m2.addToSet(nodeMarks);
26112
+ top2.content.push(node2.mark(nodeMarks));
26151
26113
  return true;
26152
26114
  }
26153
26115
  return false;
26154
26116
  }
26155
26117
  // Try to start a node of the given type, adjusting the context when
26156
26118
  // necessary.
26157
- enter(type, attrs, preserveWS) {
26158
- let ok = this.findPlace(type.create(attrs));
26159
- if (ok)
26160
- this.enterInner(type, attrs, true, preserveWS);
26161
- return ok;
26119
+ enter(type, attrs, marks, preserveWS) {
26120
+ let innerMarks = this.findPlace(type.create(attrs), marks);
26121
+ if (innerMarks)
26122
+ innerMarks = this.enterInner(type, attrs, marks, true, preserveWS);
26123
+ return innerMarks;
26162
26124
  }
26163
26125
  // Open a node of the given type
26164
- enterInner(type, attrs = null, solid = false, preserveWS) {
26126
+ enterInner(type, attrs, marks, solid = false, preserveWS) {
26165
26127
  this.closeExtra();
26166
26128
  let top2 = this.top;
26167
- top2.applyPending(type);
26168
26129
  top2.match = top2.match && top2.match.matchType(type);
26169
26130
  let options = wsOptionsFor(type, preserveWS, top2.options);
26170
26131
  if (top2.options & OPT_OPEN_LEFT && top2.content.length == 0)
26171
26132
  options |= OPT_OPEN_LEFT;
26172
- this.nodes.push(new NodeContext(type, attrs, top2.activeMarks, top2.pendingMarks, solid, null, options));
26133
+ let applyMarks = Mark$1.none;
26134
+ marks = marks.filter((m2) => {
26135
+ if (top2.type ? top2.type.allowsMarkType(m2.type) : markMayApply(m2.type, type)) {
26136
+ applyMarks = m2.addToSet(applyMarks);
26137
+ return false;
26138
+ }
26139
+ return true;
26140
+ });
26141
+ this.nodes.push(new NodeContext(type, attrs, applyMarks, solid, null, options));
26173
26142
  this.open++;
26143
+ return marks;
26174
26144
  }
26175
26145
  // Make sure all nodes above this.open are finished and added to
26176
26146
  // their parents
@@ -26281,28 +26251,6 @@ class ParseContext {
26281
26251
  return type;
26282
26252
  }
26283
26253
  }
26284
- addPendingMark(mark) {
26285
- let found2 = findSameMarkInSet(mark, this.top.pendingMarks);
26286
- if (found2)
26287
- this.top.stashMarks.push(found2);
26288
- this.top.pendingMarks = mark.addToSet(this.top.pendingMarks);
26289
- }
26290
- removePendingMark(mark, upto) {
26291
- for (let depth = this.open; depth >= 0; depth--) {
26292
- let level = this.nodes[depth];
26293
- let found2 = level.pendingMarks.lastIndexOf(mark);
26294
- if (found2 > -1) {
26295
- level.pendingMarks = mark.removeFromSet(level.pendingMarks);
26296
- } else {
26297
- level.activeMarks = mark.removeFromSet(level.activeMarks);
26298
- let stashMark = level.popFromStashMark(mark);
26299
- if (stashMark && level.type && level.type.allowsMarkType(stashMark.type))
26300
- level.activeMarks = stashMark.addToSet(level.activeMarks);
26301
- }
26302
- if (level == upto)
26303
- break;
26304
- }
26305
- }
26306
26254
  }
26307
26255
  function normalizeList(dom) {
26308
26256
  for (let child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {
@@ -26346,12 +26294,6 @@ function markMayApply(markType, nodeType) {
26346
26294
  return true;
26347
26295
  }
26348
26296
  }
26349
- function findSameMarkInSet(mark, set2) {
26350
- for (let i = 0; i < set2.length; i++) {
26351
- if (mark.eq(set2[i]))
26352
- return set2[i];
26353
- }
26354
- }
26355
26297
  class DOMSerializer {
26356
26298
  /**
26357
26299
  Create a serializer. `nodes` should map node names to functions
@@ -70217,16 +70159,12 @@ const convertUnit = (stringValue = "", toUnit, defaultFromUnit = "", doNotConver
70217
70159
  } catch (e2) {
70218
70160
  }
70219
70161
  }
70220
- return stringValue;
70221
70162
  };
70222
70163
  const isValueWithUnknownUnit = (value) => {
70223
70164
  if (!value) return false;
70224
70165
  return Boolean(getUnit(value));
70225
70166
  };
70226
70167
  const safeConvertValue = (value = "", toUnit, defaultFromUnit, doNotConvertValue) => {
70227
- if (doNotConvertValue) {
70228
- return value;
70229
- }
70230
70168
  const isWithUnit = isValueWithUnknownUnit(value) || isValueWithUnit(value);
70231
70169
  const rawValue = getValue$1(value);
70232
70170
  const isInvalidInput = isWrongValue(rawValue);
@@ -70330,6 +70268,7 @@ const UnitInput = ({
70330
70268
  );
70331
70269
  const initDisplayLayer = convertedValue !== "" ? { value: convertedValue, unit: initDisplayUnit } : convertedAutoValue !== "" ? { value: convertedAutoValue, unit: initDisplayUnit } : { value: propValue, unit: propUnit };
70332
70270
  const [displayLayer, setDisplayLayer] = useState(initDisplayLayer);
70271
+ const derivedAllowEmpty = (displayLayer == null ? void 0 : displayLayer.value) === void 0;
70333
70272
  const [predefinedOptionsMenuState, setPredefinedOptionsMenuState] = useState(
70334
70273
  initialPredefinedOption ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM
70335
70274
  );
@@ -70527,7 +70466,7 @@ const UnitInput = ({
70527
70466
  error: error2 === null ? void 0 : error2,
70528
70467
  warning: warning2 === null ? void 0 : warning2,
70529
70468
  left: left2,
70530
- allowEmpty,
70469
+ allowEmpty: derivedAllowEmpty,
70531
70470
  validationCallback: (_name, error22) => validationCallback(stringName, error22),
70532
70471
  enableCosmeticRounding,
70533
70472
  enableDisplayRounding,