@vonage/vivid 4.28.0 → 4.30.0

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 (92) hide show
  1. package/custom-elements.json +707 -86
  2. package/lib/accordion-item/accordion-item.d.ts +3 -1
  3. package/lib/audio-player/audio-player.d.ts +4 -3
  4. package/lib/data-grid/data-grid.d.ts +2 -0
  5. package/lib/data-grid/locale.d.ts +1 -0
  6. package/lib/date-picker/date-picker.d.ts +4 -2
  7. package/lib/date-time-picker/date-time-picker.d.ts +6 -3
  8. package/lib/divider/definition.d.ts +1 -0
  9. package/lib/divider/divider.d.ts +5 -1
  10. package/lib/option/option.d.ts +4 -7
  11. package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +2 -1
  12. package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +2 -2
  13. package/lib/rich-text-editor/image-placeholder/definition.d.ts +2 -0
  14. package/lib/rich-text-editor/image-placeholder/image-placeholder.d.ts +7 -0
  15. package/lib/rich-text-editor/image-placeholder/image-placeholder.template.d.ts +4 -0
  16. package/lib/rich-text-editor/menubar/consts.d.ts +2 -2
  17. package/lib/rich-text-editor/menubar/definition.d.ts +2 -2
  18. package/lib/rich-text-editor/menubar/menubar.d.ts +2 -2
  19. package/lib/rich-text-editor/menubar/menubar.template.d.ts +2 -2
  20. package/lib/rich-text-editor/rich-text-editor.d.ts +1 -0
  21. package/lib/selectable-box/selectable-box.d.ts +2 -0
  22. package/lib/split-button/split-button.d.ts +1 -1
  23. package/lib/tag/tag.d.ts +1 -1
  24. package/lib/time-picker/time-picker.d.ts +4 -2
  25. package/locales/de-DE.cjs +2 -1
  26. package/locales/de-DE.js +2 -1
  27. package/locales/en-GB.cjs +2 -1
  28. package/locales/en-GB.js +2 -1
  29. package/locales/en-US.cjs +2 -1
  30. package/locales/en-US.js +2 -1
  31. package/locales/ja-JP.cjs +2 -1
  32. package/locales/ja-JP.js +2 -1
  33. package/locales/zh-CN.cjs +2 -1
  34. package/locales/zh-CN.js +2 -1
  35. package/package.json +2 -1
  36. package/shared/calendar-picker.template.cjs +6 -5
  37. package/shared/calendar-picker.template.js +6 -5
  38. package/shared/definition.cjs +11 -2
  39. package/shared/definition.js +11 -2
  40. package/shared/definition16.cjs +33 -30
  41. package/shared/definition16.js +33 -30
  42. package/shared/definition17.cjs +137 -1
  43. package/shared/definition17.js +138 -2
  44. package/shared/definition23.cjs +12 -7
  45. package/shared/definition23.js +12 -7
  46. package/shared/definition28.cjs +1 -2
  47. package/shared/definition28.js +2 -2
  48. package/shared/definition36.cjs +1 -1
  49. package/shared/definition36.js +1 -1
  50. package/shared/definition44.cjs +194 -77
  51. package/shared/definition44.js +194 -77
  52. package/shared/definition45.cjs +12 -5
  53. package/shared/definition45.js +12 -5
  54. package/shared/definition47.cjs +11 -5
  55. package/shared/definition47.js +11 -5
  56. package/shared/definition5.cjs +86 -30
  57. package/shared/definition5.js +86 -30
  58. package/shared/definition50.cjs +1 -1
  59. package/shared/definition50.js +1 -1
  60. package/shared/definition56.cjs +1 -1
  61. package/shared/definition56.js +1 -1
  62. package/shared/definition58.cjs +10 -29
  63. package/shared/definition58.js +12 -31
  64. package/shared/definition61.cjs +11 -0
  65. package/shared/definition61.js +11 -0
  66. package/shared/definition64.cjs +1 -1
  67. package/shared/definition64.js +1 -1
  68. package/shared/definition67.cjs +27 -16
  69. package/shared/definition67.js +27 -16
  70. package/shared/divider.cjs +7 -2
  71. package/shared/divider.js +7 -2
  72. package/shared/option.cjs +36 -38
  73. package/shared/option.js +37 -39
  74. package/shared/picker-field/mixins/single-date-picker.d.ts +4 -2
  75. package/shared/picker-field/mixins/single-value-picker.d.ts +2 -1
  76. package/shared/picker-field/mixins/time-selection-picker.d.ts +4 -2
  77. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +4 -2
  78. package/shared/single-value-picker.cjs +40 -6
  79. package/shared/single-value-picker.js +40 -6
  80. package/shared/text-field.cjs +1 -1
  81. package/shared/text-field.js +1 -1
  82. package/shared/time-selection-picker.template.cjs +2 -2
  83. package/shared/time-selection-picker.template.js +2 -2
  84. package/shared/vivid-element.cjs +2 -1
  85. package/shared/vivid-element.js +2 -2
  86. package/styles/core/all.css +1 -1
  87. package/styles/core/theme.css +1 -1
  88. package/styles/core/typography.css +1 -1
  89. package/styles/tokens/theme-dark.css +4 -4
  90. package/styles/tokens/theme-light.css +4 -4
  91. package/styles/tokens/vivid-2-compat.css +1 -1
  92. package/vivid.api.json +294 -129
@@ -51,8 +51,9 @@ function getOppositeAxis(axis) {
51
51
  function getAxisLength(axis) {
52
52
  return axis === 'y' ? 'height' : 'width';
53
53
  }
54
+ const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
54
55
  function getSideAxis(placement) {
55
- return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
56
+ return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
56
57
  }
57
58
  function getAlignmentAxis(placement) {
58
59
  return getOppositeAxis(getSideAxis(placement));
@@ -77,19 +78,19 @@ function getExpandedPlacements(placement) {
77
78
  function getOppositeAlignmentPlacement(placement) {
78
79
  return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
79
80
  }
81
+ const lrPlacement = ['left', 'right'];
82
+ const rlPlacement = ['right', 'left'];
83
+ const tbPlacement = ['top', 'bottom'];
84
+ const btPlacement = ['bottom', 'top'];
80
85
  function getSideList(side, isStart, rtl) {
81
- const lr = ['left', 'right'];
82
- const rl = ['right', 'left'];
83
- const tb = ['top', 'bottom'];
84
- const bt = ['bottom', 'top'];
85
86
  switch (side) {
86
87
  case 'top':
87
88
  case 'bottom':
88
- if (rtl) return isStart ? rl : lr;
89
- return isStart ? lr : rl;
89
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
90
+ return isStart ? lrPlacement : rlPlacement;
90
91
  case 'left':
91
92
  case 'right':
92
- return isStart ? tb : bt;
93
+ return isStart ? tbPlacement : btPlacement;
93
94
  default:
94
95
  return [];
95
96
  }
@@ -873,6 +874,8 @@ const inline$1 = function (options) {
873
874
  };
874
875
  };
875
876
 
877
+ const originSides = /*#__PURE__*/new Set(['left', 'top']);
878
+
876
879
  // For type backwards-compatibility, the `OffsetOptions` type was also
877
880
  // Derivable.
878
881
 
@@ -886,7 +889,7 @@ async function convertValueToCoords(state, options) {
886
889
  const side = getSide(placement);
887
890
  const alignment = getAlignment(placement);
888
891
  const isVertical = getSideAxis(placement) === 'y';
889
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
892
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
890
893
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
891
894
  const rawValue = evaluate(options, state);
892
895
 
@@ -1085,6 +1088,7 @@ function isShadowRoot(value) {
1085
1088
  }
1086
1089
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1087
1090
  }
1091
+ const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
1088
1092
  function isOverflowElement(element) {
1089
1093
  const {
1090
1094
  overflow,
@@ -1092,27 +1096,32 @@ function isOverflowElement(element) {
1092
1096
  overflowY,
1093
1097
  display
1094
1098
  } = getComputedStyle(element);
1095
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
1099
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
1096
1100
  }
1101
+ const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
1097
1102
  function isTableElement(element) {
1098
- return ['table', 'td', 'th'].includes(getNodeName(element));
1103
+ return tableElements.has(getNodeName(element));
1099
1104
  }
1105
+ const topLayerSelectors = [':popover-open', ':modal'];
1100
1106
  function isTopLayer(element) {
1101
- return [':popover-open', ':modal'].some(selector => {
1107
+ return topLayerSelectors.some(selector => {
1102
1108
  try {
1103
1109
  return element.matches(selector);
1104
- } catch (e) {
1110
+ } catch (_e) {
1105
1111
  return false;
1106
1112
  }
1107
1113
  });
1108
1114
  }
1115
+ const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
1116
+ const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
1117
+ const containValues = ['paint', 'layout', 'strict', 'content'];
1109
1118
  function isContainingBlock(elementOrCss) {
1110
1119
  const webkit = isWebKit();
1111
1120
  const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
1112
1121
 
1113
1122
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1114
1123
  // https://drafts.csswg.org/css-transforms-2/#individual-transforms
1115
- return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
1124
+ return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
1116
1125
  }
1117
1126
  function getContainingBlock(element) {
1118
1127
  let currentNode = getParentNode(element);
@@ -1130,8 +1139,9 @@ function isWebKit() {
1130
1139
  if (typeof CSS === 'undefined' || !CSS.supports) return false;
1131
1140
  return CSS.supports('-webkit-backdrop-filter', 'none');
1132
1141
  }
1142
+ const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
1133
1143
  function isLastTraversableNode(node) {
1134
- return ['html', 'body', '#document'].includes(getNodeName(node));
1144
+ return lastTraversableNodeNames.has(getNodeName(node));
1135
1145
  }
1136
1146
  function getComputedStyle(element) {
1137
1147
  return getWindow(element).getComputedStyle(element);
@@ -1436,6 +1446,7 @@ function getViewportRect(element, strategy) {
1436
1446
  };
1437
1447
  }
1438
1448
 
1449
+ const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
1439
1450
  // Returns the inner client rect, subtracting scrollbars if present.
1440
1451
  function getInnerBoundingClientRect(element, strategy) {
1441
1452
  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
@@ -1500,7 +1511,7 @@ function getClippingElementAncestors(element, cache) {
1500
1511
  if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
1501
1512
  currentContainingBlockComputedStyle = null;
1502
1513
  }
1503
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1514
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1504
1515
  if (shouldDropCurrentNode) {
1505
1516
  // Drop non-containing blocks.
1506
1517
  result = result.filter(ancestor => ancestor !== currentNode);
@@ -49,8 +49,9 @@ function getOppositeAxis(axis) {
49
49
  function getAxisLength(axis) {
50
50
  return axis === 'y' ? 'height' : 'width';
51
51
  }
52
+ const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']);
52
53
  function getSideAxis(placement) {
53
- return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
54
+ return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
54
55
  }
55
56
  function getAlignmentAxis(placement) {
56
57
  return getOppositeAxis(getSideAxis(placement));
@@ -75,19 +76,19 @@ function getExpandedPlacements(placement) {
75
76
  function getOppositeAlignmentPlacement(placement) {
76
77
  return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
77
78
  }
79
+ const lrPlacement = ['left', 'right'];
80
+ const rlPlacement = ['right', 'left'];
81
+ const tbPlacement = ['top', 'bottom'];
82
+ const btPlacement = ['bottom', 'top'];
78
83
  function getSideList(side, isStart, rtl) {
79
- const lr = ['left', 'right'];
80
- const rl = ['right', 'left'];
81
- const tb = ['top', 'bottom'];
82
- const bt = ['bottom', 'top'];
83
84
  switch (side) {
84
85
  case 'top':
85
86
  case 'bottom':
86
- if (rtl) return isStart ? rl : lr;
87
- return isStart ? lr : rl;
87
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
88
+ return isStart ? lrPlacement : rlPlacement;
88
89
  case 'left':
89
90
  case 'right':
90
- return isStart ? tb : bt;
91
+ return isStart ? tbPlacement : btPlacement;
91
92
  default:
92
93
  return [];
93
94
  }
@@ -871,6 +872,8 @@ const inline$1 = function (options) {
871
872
  };
872
873
  };
873
874
 
875
+ const originSides = /*#__PURE__*/new Set(['left', 'top']);
876
+
874
877
  // For type backwards-compatibility, the `OffsetOptions` type was also
875
878
  // Derivable.
876
879
 
@@ -884,7 +887,7 @@ async function convertValueToCoords(state, options) {
884
887
  const side = getSide(placement);
885
888
  const alignment = getAlignment(placement);
886
889
  const isVertical = getSideAxis(placement) === 'y';
887
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
890
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
888
891
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
889
892
  const rawValue = evaluate(options, state);
890
893
 
@@ -1083,6 +1086,7 @@ function isShadowRoot(value) {
1083
1086
  }
1084
1087
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1085
1088
  }
1089
+ const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']);
1086
1090
  function isOverflowElement(element) {
1087
1091
  const {
1088
1092
  overflow,
@@ -1090,27 +1094,32 @@ function isOverflowElement(element) {
1090
1094
  overflowY,
1091
1095
  display
1092
1096
  } = getComputedStyle(element);
1093
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
1097
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
1094
1098
  }
1099
+ const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']);
1095
1100
  function isTableElement(element) {
1096
- return ['table', 'td', 'th'].includes(getNodeName(element));
1101
+ return tableElements.has(getNodeName(element));
1097
1102
  }
1103
+ const topLayerSelectors = [':popover-open', ':modal'];
1098
1104
  function isTopLayer(element) {
1099
- return [':popover-open', ':modal'].some(selector => {
1105
+ return topLayerSelectors.some(selector => {
1100
1106
  try {
1101
1107
  return element.matches(selector);
1102
- } catch (e) {
1108
+ } catch (_e) {
1103
1109
  return false;
1104
1110
  }
1105
1111
  });
1106
1112
  }
1113
+ const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
1114
+ const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
1115
+ const containValues = ['paint', 'layout', 'strict', 'content'];
1107
1116
  function isContainingBlock(elementOrCss) {
1108
1117
  const webkit = isWebKit();
1109
1118
  const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
1110
1119
 
1111
1120
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1112
1121
  // https://drafts.csswg.org/css-transforms-2/#individual-transforms
1113
- return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
1122
+ return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value));
1114
1123
  }
1115
1124
  function getContainingBlock(element) {
1116
1125
  let currentNode = getParentNode(element);
@@ -1128,8 +1137,9 @@ function isWebKit() {
1128
1137
  if (typeof CSS === 'undefined' || !CSS.supports) return false;
1129
1138
  return CSS.supports('-webkit-backdrop-filter', 'none');
1130
1139
  }
1140
+ const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']);
1131
1141
  function isLastTraversableNode(node) {
1132
- return ['html', 'body', '#document'].includes(getNodeName(node));
1142
+ return lastTraversableNodeNames.has(getNodeName(node));
1133
1143
  }
1134
1144
  function getComputedStyle(element) {
1135
1145
  return getWindow(element).getComputedStyle(element);
@@ -1434,6 +1444,7 @@ function getViewportRect(element, strategy) {
1434
1444
  };
1435
1445
  }
1436
1446
 
1447
+ const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']);
1437
1448
  // Returns the inner client rect, subtracting scrollbars if present.
1438
1449
  function getInnerBoundingClientRect(element, strategy) {
1439
1450
  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
@@ -1498,7 +1509,7 @@ function getClippingElementAncestors(element, cache) {
1498
1509
  if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
1499
1510
  currentContainingBlockComputedStyle = null;
1500
1511
  }
1501
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1512
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1502
1513
  if (shouldDropCurrentNode) {
1503
1514
  // Drop non-containing blocks.
1504
1515
  result = result.filter(ancestor => ancestor !== currentNode);
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ const enums = require('./enums.cjs');
3
4
  const vividElement = require('./vivid-element.cjs');
4
- const delegatesAria = require('./delegates-aria.cjs');
5
+ const hostSemantics = require('./host-semantics.cjs');
5
6
  const aria = require('./aria.cjs');
6
7
 
7
8
  var __defProp = Object.defineProperty;
@@ -23,11 +24,12 @@ const DividerRole = {
23
24
  */
24
25
  presentation: "presentation"
25
26
  };
26
- class Divider extends delegatesAria.DelegatesAria(vividElement.VividElement) {
27
+ class Divider extends hostSemantics.HostSemantics(vividElement.VividElement) {
27
28
  constructor() {
28
29
  super(...arguments);
29
30
  this.role = DividerRole.separator;
30
31
  this.orientation = aria.Orientation.horizontal;
32
+ this.appearance = enums.Appearance.Ghost;
31
33
  }
32
34
  }
33
35
  __decorateClass([
@@ -36,6 +38,9 @@ __decorateClass([
36
38
  __decorateClass([
37
39
  vividElement.attr
38
40
  ], Divider.prototype, "orientation");
41
+ __decorateClass([
42
+ vividElement.attr
43
+ ], Divider.prototype, "appearance");
39
44
 
40
45
  exports.Divider = Divider;
41
46
  exports.DividerRole = DividerRole;
package/shared/divider.js CHANGED
@@ -1,5 +1,6 @@
1
+ import { A as Appearance } from './enums.js';
1
2
  import { V as VividElement, a as attr } from './vivid-element.js';
2
- import { D as DelegatesAria } from './delegates-aria.js';
3
+ import { H as HostSemantics } from './host-semantics.js';
3
4
  import { O as Orientation } from './aria.js';
4
5
 
5
6
  var __defProp = Object.defineProperty;
@@ -21,11 +22,12 @@ const DividerRole = {
21
22
  */
22
23
  presentation: "presentation"
23
24
  };
24
- class Divider extends DelegatesAria(VividElement) {
25
+ class Divider extends HostSemantics(VividElement) {
25
26
  constructor() {
26
27
  super(...arguments);
27
28
  this.role = DividerRole.separator;
28
29
  this.orientation = Orientation.horizontal;
30
+ this.appearance = Appearance.Ghost;
29
31
  }
30
32
  }
31
33
  __decorateClass([
@@ -34,5 +36,8 @@ __decorateClass([
34
36
  __decorateClass([
35
37
  attr
36
38
  ], Divider.prototype, "orientation");
39
+ __decorateClass([
40
+ attr
41
+ ], Divider.prototype, "appearance");
37
42
 
38
43
  export { Divider as D, DividerRole as a };
package/shared/option.cjs CHANGED
@@ -29,11 +29,8 @@ class ListboxOption extends hostSemantics.HostSemantics(
29
29
  * @internal
30
30
  */
31
31
  this.dirtySelected = false;
32
- this.selected = this.defaultSelected;
33
- /**
34
- * Track whether the value has been changed from the initial value
35
- */
36
- this.dirtyValue = false;
32
+ // eslint-disable-next-line @repo/repo/no-attribute-default-value
33
+ this.value = "";
37
34
  this._highlighted = false;
38
35
  this._displayCheckmark = false;
39
36
  this._vvdSearchText = "";
@@ -42,7 +39,7 @@ class ListboxOption extends hostSemantics.HostSemantics(
42
39
  this.text = text;
43
40
  }
44
41
  if (value) {
45
- this.initialValue = value;
42
+ this.value = value;
46
43
  }
47
44
  if (defaultSelected) {
48
45
  this.defaultSelected = defaultSelected;
@@ -52,8 +49,7 @@ class ListboxOption extends hostSemantics.HostSemantics(
52
49
  }
53
50
  this.proxy = new Option(
54
51
  this.text,
55
- // @ts-expect-error Propery is used before it is assigned
56
- this.initialValue,
52
+ this.value,
57
53
  this.defaultSelected,
58
54
  this.selected
59
55
  );
@@ -66,17 +62,23 @@ class ListboxOption extends hostSemantics.HostSemantics(
66
62
  this.proxy.selected = this.defaultSelected;
67
63
  }
68
64
  }
65
+ if (this.proxy instanceof HTMLOptionElement) {
66
+ this.proxy.defaultSelected = this.defaultSelected;
67
+ }
69
68
  }
70
69
  disabledChanged() {
71
70
  if (this.proxy instanceof HTMLOptionElement) {
72
71
  this.proxy.disabled = this.disabled;
73
72
  }
74
73
  }
75
- selectedAttributeChanged() {
76
- this.defaultSelected = this.selectedAttribute;
77
- if (this.proxy instanceof HTMLOptionElement) {
78
- this.proxy.defaultSelected = this.defaultSelected;
79
- }
74
+ /**
75
+ * @deprecated Use `defaultSelected` instead.
76
+ */
77
+ get selectedAttribute() {
78
+ return this.defaultSelected;
79
+ }
80
+ set selectedAttribute(value) {
81
+ this.defaultSelected = value;
80
82
  }
81
83
  selectedChanged() {
82
84
  if (!this.dirtySelected) {
@@ -86,10 +88,13 @@ class ListboxOption extends hostSemantics.HostSemantics(
86
88
  this.proxy.selected = this.selected;
87
89
  }
88
90
  }
89
- initialValueChanged() {
90
- if (!this.dirtyValue) {
91
- this.value = this.initialValue;
92
- this.dirtyValue = false;
91
+ valueChanged() {
92
+ if (typeof this.value !== "string") {
93
+ this.value = "";
94
+ return;
95
+ }
96
+ if (this.proxy instanceof HTMLOptionElement) {
97
+ this.proxy.value = this.value;
93
98
  }
94
99
  }
95
100
  get label() {
@@ -104,19 +109,6 @@ class ListboxOption extends hostSemantics.HostSemantics(
104
109
  get text() {
105
110
  return this._text ?? "";
106
111
  }
107
- set value(next) {
108
- const newValue = `${next ?? ""}`;
109
- this._value = newValue;
110
- this.dirtyValue = true;
111
- if (this.proxy instanceof HTMLOptionElement) {
112
- this.proxy.value = newValue;
113
- }
114
- vividElement.Observable.notify(this, "value");
115
- }
116
- get value() {
117
- vividElement.Observable.track(this, "value");
118
- return this._value ?? this.text;
119
- }
120
112
  get form() {
121
113
  return null;
122
114
  }
@@ -134,27 +126,33 @@ class ListboxOption extends hostSemantics.HostSemantics(
134
126
  }
135
127
  return { from: 0, to: 0 };
136
128
  }
129
+ /**
130
+ * @internal
131
+ */
132
+ connectedCallback() {
133
+ super.connectedCallback();
134
+ if (!this.dirtySelected) {
135
+ this.selected = this.defaultSelected;
136
+ this.dirtySelected = false;
137
+ }
138
+ }
137
139
  }
138
140
  __decorateClass([
139
141
  vividElement.observable
140
142
  ], ListboxOption.prototype, "checked", 2);
141
143
  __decorateClass([
142
- vividElement.observable
144
+ vividElement.attr({ attribute: "selected", mode: "boolean" })
143
145
  ], ListboxOption.prototype, "defaultSelected", 2);
144
146
  // @ts-expect-error Type is incorrectly non-optional
145
147
  __decorateClass([
146
148
  vividElement.attr({ mode: "boolean" })
147
149
  ], ListboxOption.prototype, "disabled", 2);
148
- // @ts-expect-error Type is incorrectly non-optional
149
150
  __decorateClass([
150
- vividElement.attr({ attribute: "selected", mode: "boolean" })
151
- ], ListboxOption.prototype, "selectedAttribute", 2);
152
- __decorateClass([
153
- vividElement.observable
151
+ vividElement.attr({ attribute: "current-selected", mode: "boolean" })
154
152
  ], ListboxOption.prototype, "selected", 2);
155
153
  __decorateClass([
156
- vividElement.attr({ attribute: "value", mode: "fromView" })
157
- ], ListboxOption.prototype, "initialValue", 2);
154
+ vividElement.attr({ attribute: "value" })
155
+ ], ListboxOption.prototype, "value", 2);
158
156
  __decorateClass([
159
157
  vividElement.attr({
160
158
  attribute: "label"
package/shared/option.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { A as AffixIconWithTrailing } from './affix.js';
2
- import { O as Observable, V as VividElement, o as observable, a as attr, v as volatile } from './vivid-element.js';
2
+ import { V as VividElement, o as observable, a as attr, v as volatile } from './vivid-element.js';
3
3
  import { H as HostSemantics } from './host-semantics.js';
4
4
  import { i as isHTMLElement } from './dom.js';
5
5
 
@@ -27,11 +27,8 @@ class ListboxOption extends HostSemantics(
27
27
  * @internal
28
28
  */
29
29
  this.dirtySelected = false;
30
- this.selected = this.defaultSelected;
31
- /**
32
- * Track whether the value has been changed from the initial value
33
- */
34
- this.dirtyValue = false;
30
+ // eslint-disable-next-line @repo/repo/no-attribute-default-value
31
+ this.value = "";
35
32
  this._highlighted = false;
36
33
  this._displayCheckmark = false;
37
34
  this._vvdSearchText = "";
@@ -40,7 +37,7 @@ class ListboxOption extends HostSemantics(
40
37
  this.text = text;
41
38
  }
42
39
  if (value) {
43
- this.initialValue = value;
40
+ this.value = value;
44
41
  }
45
42
  if (defaultSelected) {
46
43
  this.defaultSelected = defaultSelected;
@@ -50,8 +47,7 @@ class ListboxOption extends HostSemantics(
50
47
  }
51
48
  this.proxy = new Option(
52
49
  this.text,
53
- // @ts-expect-error Propery is used before it is assigned
54
- this.initialValue,
50
+ this.value,
55
51
  this.defaultSelected,
56
52
  this.selected
57
53
  );
@@ -64,17 +60,23 @@ class ListboxOption extends HostSemantics(
64
60
  this.proxy.selected = this.defaultSelected;
65
61
  }
66
62
  }
63
+ if (this.proxy instanceof HTMLOptionElement) {
64
+ this.proxy.defaultSelected = this.defaultSelected;
65
+ }
67
66
  }
68
67
  disabledChanged() {
69
68
  if (this.proxy instanceof HTMLOptionElement) {
70
69
  this.proxy.disabled = this.disabled;
71
70
  }
72
71
  }
73
- selectedAttributeChanged() {
74
- this.defaultSelected = this.selectedAttribute;
75
- if (this.proxy instanceof HTMLOptionElement) {
76
- this.proxy.defaultSelected = this.defaultSelected;
77
- }
72
+ /**
73
+ * @deprecated Use `defaultSelected` instead.
74
+ */
75
+ get selectedAttribute() {
76
+ return this.defaultSelected;
77
+ }
78
+ set selectedAttribute(value) {
79
+ this.defaultSelected = value;
78
80
  }
79
81
  selectedChanged() {
80
82
  if (!this.dirtySelected) {
@@ -84,10 +86,13 @@ class ListboxOption extends HostSemantics(
84
86
  this.proxy.selected = this.selected;
85
87
  }
86
88
  }
87
- initialValueChanged() {
88
- if (!this.dirtyValue) {
89
- this.value = this.initialValue;
90
- this.dirtyValue = false;
89
+ valueChanged() {
90
+ if (typeof this.value !== "string") {
91
+ this.value = "";
92
+ return;
93
+ }
94
+ if (this.proxy instanceof HTMLOptionElement) {
95
+ this.proxy.value = this.value;
91
96
  }
92
97
  }
93
98
  get label() {
@@ -102,19 +107,6 @@ class ListboxOption extends HostSemantics(
102
107
  get text() {
103
108
  return this._text ?? "";
104
109
  }
105
- set value(next) {
106
- const newValue = `${next ?? ""}`;
107
- this._value = newValue;
108
- this.dirtyValue = true;
109
- if (this.proxy instanceof HTMLOptionElement) {
110
- this.proxy.value = newValue;
111
- }
112
- Observable.notify(this, "value");
113
- }
114
- get value() {
115
- Observable.track(this, "value");
116
- return this._value ?? this.text;
117
- }
118
110
  get form() {
119
111
  return null;
120
112
  }
@@ -132,27 +124,33 @@ class ListboxOption extends HostSemantics(
132
124
  }
133
125
  return { from: 0, to: 0 };
134
126
  }
127
+ /**
128
+ * @internal
129
+ */
130
+ connectedCallback() {
131
+ super.connectedCallback();
132
+ if (!this.dirtySelected) {
133
+ this.selected = this.defaultSelected;
134
+ this.dirtySelected = false;
135
+ }
136
+ }
135
137
  }
136
138
  __decorateClass([
137
139
  observable
138
140
  ], ListboxOption.prototype, "checked", 2);
139
141
  __decorateClass([
140
- observable
142
+ attr({ attribute: "selected", mode: "boolean" })
141
143
  ], ListboxOption.prototype, "defaultSelected", 2);
142
144
  // @ts-expect-error Type is incorrectly non-optional
143
145
  __decorateClass([
144
146
  attr({ mode: "boolean" })
145
147
  ], ListboxOption.prototype, "disabled", 2);
146
- // @ts-expect-error Type is incorrectly non-optional
147
148
  __decorateClass([
148
- attr({ attribute: "selected", mode: "boolean" })
149
- ], ListboxOption.prototype, "selectedAttribute", 2);
150
- __decorateClass([
151
- observable
149
+ attr({ attribute: "current-selected", mode: "boolean" })
152
150
  ], ListboxOption.prototype, "selected", 2);
153
151
  __decorateClass([
154
- attr({ attribute: "value", mode: "fromView" })
155
- ], ListboxOption.prototype, "initialValue", 2);
152
+ attr({ attribute: "value" })
153
+ ], ListboxOption.prototype, "value", 2);
156
154
  __decorateClass([
157
155
  attr({
158
156
  attribute: "label"
@@ -811,10 +811,12 @@ export declare const SingleDatePickerMixin: <T_6 extends AbstractConstructor<{
811
811
  _isValidValue(value: string): boolean;
812
812
  _toPresentationValue(value: string): string;
813
813
  _parsePresentationValue(presentationValue: string): string;
814
+ _isInternalValueUpdate: boolean;
814
815
  valueChanged(previous: string, next: string): void;
815
816
  _updatePresentationValue(): void;
816
817
  _updateValueDueToUserInteraction(newValue: string): void;
817
818
  _onTextFieldChange(): void;
819
+ _onTextFieldInput(event: Event): void;
818
820
  _isPresentationValueInvalid(): boolean;
819
821
  _onClearClick(): void;
820
822
  readOnly: boolean;
@@ -846,7 +848,6 @@ export declare const SingleDatePickerMixin: <T_6 extends AbstractConstructor<{
846
848
  _presentationValueChanged(): void;
847
849
  readonly _textFieldPlaceholder: string;
848
850
  _textFieldSize?: string | undefined;
849
- _onTextFieldInput(event: Event): void;
850
851
  readonly _pickerButtonLabel: string;
851
852
  readonly _pickerButtonIcon: string;
852
853
  _onPickerButtonClick(): void;
@@ -1654,7 +1655,7 @@ export declare const SingleDatePickerMixin: <T_6 extends AbstractConstructor<{
1654
1655
  _updatePresentationValue: (() => void) & (() => void);
1655
1656
  readonly _textFieldPlaceholder: string;
1656
1657
  _textFieldSize?: string | undefined;
1657
- _onTextFieldInput(event: Event): void;
1658
+ _onTextFieldInput: ((event: Event) => void) & ((event: Event) => void);
1658
1659
  _onTextFieldChange: (() => void) & (() => void);
1659
1660
  readonly _pickerButtonLabel: string;
1660
1661
  readonly _pickerButtonIcon: string;
@@ -2389,6 +2390,7 @@ export declare const SingleDatePickerMixin: <T_6 extends AbstractConstructor<{
2389
2390
  _isValidValue(value: string): boolean;
2390
2391
  _toPresentationValue(value: string): string;
2391
2392
  _parsePresentationValue(presentationValue: string): string;
2393
+ _isInternalValueUpdate: boolean;
2392
2394
  _updateValueDueToUserInteraction(newValue: string): void;
2393
2395
  _isPresentationValueInvalid(): boolean;
2394
2396
  }) & T_6;
@@ -4,10 +4,12 @@ export declare const SingleValuePicker: <T extends AbstractConstructor<PickerFie
4
4
  _isValidValue(value: string): boolean;
5
5
  _toPresentationValue(value: string): string;
6
6
  _parsePresentationValue(presentationValue: string): string;
7
+ _isInternalValueUpdate: boolean;
7
8
  valueChanged(previous: string, next: string): void;
8
9
  _updatePresentationValue(): void;
9
10
  _updateValueDueToUserInteraction(newValue: string): void;
10
11
  _onTextFieldChange(): void;
12
+ _onTextFieldInput(event: Event): void;
11
13
  _isPresentationValueInvalid(): boolean;
12
14
  _onClearClick(): void;
13
15
  readOnly: boolean;
@@ -39,7 +41,6 @@ export declare const SingleValuePicker: <T extends AbstractConstructor<PickerFie
39
41
  _presentationValueChanged(): void;
40
42
  readonly _textFieldPlaceholder: string;
41
43
  _textFieldSize?: string | undefined;
42
- _onTextFieldInput(event: Event): void;
43
44
  readonly _pickerButtonLabel: string;
44
45
  readonly _pickerButtonIcon: string;
45
46
  _onPickerButtonClick(): void;