@tylertech/forge 3.9.0-dev.4 → 3.9.1

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.
@@ -4462,81 +4462,6 @@
4462
4462
  "description": "The spacing between the list items.",
4463
4463
  "values": []
4464
4464
  },
4465
- {
4466
- "name": "--forge-meter-background",
4467
- "description": "The background color of the meter.",
4468
- "values": []
4469
- },
4470
- {
4471
- "name": "--forge-meter-color",
4472
- "description": "The color of the meter's bar.",
4473
- "values": []
4474
- },
4475
- {
4476
- "name": "--forge-meter-height",
4477
- "description": "The block size of the meter.",
4478
- "values": []
4479
- },
4480
- {
4481
- "name": "--forge-meter-shape",
4482
- "description": "The border radius of the meter.",
4483
- "values": []
4484
- },
4485
- {
4486
- "name": "--forge-meter-bar-inner-shape",
4487
- "description": "The border radius of the meter's bar.",
4488
- "values": []
4489
- },
4490
- {
4491
- "name": "--forge-meter-tickmarks",
4492
- "description": "The number of tickmarks to display.",
4493
- "values": []
4494
- },
4495
- {
4496
- "name": "--forge-meter-tickmark-opacity",
4497
- "description": "The opacity of the tickmarks.",
4498
- "values": []
4499
- },
4500
- {
4501
- "name": "--forge-meter-transition-duration",
4502
- "description": "The duration of transitions.",
4503
- "values": []
4504
- },
4505
- {
4506
- "name": "--forge-meter-transition-timing",
4507
- "description": "The timing function of transitions.",
4508
- "values": []
4509
- },
4510
- {
4511
- "name": "--forge-theme-success",
4512
- "description": "The color of the bar when the value is optimal.",
4513
- "values": []
4514
- },
4515
- {
4516
- "name": "--forge-theme-success-container-low",
4517
- "description": "The color of the track when the value is optimal.",
4518
- "values": []
4519
- },
4520
- {
4521
- "name": "--forge-theme-warning",
4522
- "description": "The color of the bar when the value is suboptimal.",
4523
- "values": []
4524
- },
4525
- {
4526
- "name": "--forge-theme-warning-container-low",
4527
- "description": "The color of the track when the value is suboptimal.",
4528
- "values": []
4529
- },
4530
- {
4531
- "name": "--forge-theme-error",
4532
- "description": "The color of the bar when the value is least optimal.",
4533
- "values": []
4534
- },
4535
- {
4536
- "name": "--forge-theme-error-container-low",
4537
- "description": "The color of the track when the value is least optimal.",
4538
- "values": []
4539
- },
4540
4465
  {
4541
4466
  "name": "--forge-list-item-background",
4542
4467
  "description": "The background color.",
@@ -4687,6 +4612,81 @@
4687
4612
  "description": "The gap between the slotted content when in the dense state.",
4688
4613
  "values": []
4689
4614
  },
4615
+ {
4616
+ "name": "--forge-meter-background",
4617
+ "description": "The background color of the meter.",
4618
+ "values": []
4619
+ },
4620
+ {
4621
+ "name": "--forge-meter-color",
4622
+ "description": "The color of the meter's bar.",
4623
+ "values": []
4624
+ },
4625
+ {
4626
+ "name": "--forge-meter-height",
4627
+ "description": "The block size of the meter.",
4628
+ "values": []
4629
+ },
4630
+ {
4631
+ "name": "--forge-meter-shape",
4632
+ "description": "The border radius of the meter.",
4633
+ "values": []
4634
+ },
4635
+ {
4636
+ "name": "--forge-meter-bar-inner-shape",
4637
+ "description": "The border radius of the meter's bar.",
4638
+ "values": []
4639
+ },
4640
+ {
4641
+ "name": "--forge-meter-tickmarks",
4642
+ "description": "The number of tickmarks to display.",
4643
+ "values": []
4644
+ },
4645
+ {
4646
+ "name": "--forge-meter-tickmark-opacity",
4647
+ "description": "The opacity of the tickmarks.",
4648
+ "values": []
4649
+ },
4650
+ {
4651
+ "name": "--forge-meter-transition-duration",
4652
+ "description": "The duration of transitions.",
4653
+ "values": []
4654
+ },
4655
+ {
4656
+ "name": "--forge-meter-transition-timing",
4657
+ "description": "The timing function of transitions.",
4658
+ "values": []
4659
+ },
4660
+ {
4661
+ "name": "--forge-theme-success",
4662
+ "description": "The color of the bar when the value is optimal.",
4663
+ "values": []
4664
+ },
4665
+ {
4666
+ "name": "--forge-theme-success-container-low",
4667
+ "description": "The color of the track when the value is optimal.",
4668
+ "values": []
4669
+ },
4670
+ {
4671
+ "name": "--forge-theme-warning",
4672
+ "description": "The color of the bar when the value is suboptimal.",
4673
+ "values": []
4674
+ },
4675
+ {
4676
+ "name": "--forge-theme-warning-container-low",
4677
+ "description": "The color of the track when the value is suboptimal.",
4678
+ "values": []
4679
+ },
4680
+ {
4681
+ "name": "--forge-theme-error",
4682
+ "description": "The color of the bar when the value is least optimal.",
4683
+ "values": []
4684
+ },
4685
+ {
4686
+ "name": "--forge-theme-error-container-low",
4687
+ "description": "The color of the track when the value is least optimal.",
4688
+ "values": []
4689
+ },
4690
4690
  {
4691
4691
  "name": "--forge-meter-group-background",
4692
4692
  "description": "The background color of the meter group.",
@@ -5926,12 +5926,6 @@
5926
5926
  "description": "The component's root container element."
5927
5927
  },
5928
5928
  { "name": "::part(root)", "description": "The root container element." },
5929
- {
5930
- "name": "::part(track)",
5931
- "description": "The element comprising the meter's background."
5932
- },
5933
- { "name": "::part(bar)", "description": "The bar representing the value." },
5934
- { "name": "::part(root)", "description": "The root container element." },
5935
5929
  {
5936
5930
  "name": "::part(text-container)",
5937
5931
  "description": "The container for the text content."
@@ -5945,6 +5939,12 @@
5945
5939
  "description": "The forwarded state layer's internal surface element."
5946
5940
  },
5947
5941
  { "name": "::part(root)", "description": "The root container element." },
5942
+ {
5943
+ "name": "::part(track)",
5944
+ "description": "The element comprising the meter's background."
5945
+ },
5946
+ { "name": "::part(bar)", "description": "The bar representing the value." },
5947
+ { "name": "::part(root)", "description": "The root container element." },
5948
5948
  {
5949
5949
  "name": "::part(track)",
5950
5950
  "description": "The element comprising the meter group's background."
@@ -3049,6 +3049,63 @@
3049
3049
  ],
3050
3050
  "references": []
3051
3051
  },
3052
+ {
3053
+ "name": "forge-list-item",
3054
+ "description": "List items are individual rows of content inside of a list.\n---\n\n\n### **Events:**\n - **forge-list-item-select** - Fires when the list item is selected.\n\n### **Slots:**\n - _default_ - The primary text.\n- **secondary-text** - The secondary text.\n- **tertiary-text** - The tertiary text.\n- **start** - The start content.\n- **end** - The end element.\n\n### **CSS Properties:**\n - **--forge-list-item-background** - The background color. _(default: undefined)_\n- **--forge-list-item-shape** - The shape of the list item. _(default: undefined)_\n- **--forge-list-item-padding** - The padding inside of the container element. _(default: undefined)_\n- **--forge-list-item-wrap-padding** - The padding inside of the container element when `wrap` is enabled. _(default: undefined)_\n- **--forge-list-item-margin** - The margin around the host element. _(default: undefined)_\n- **--forge-list-item-height** - The height of the container. _(default: undefined)_\n- **--forge-list-item-indent** - The margin inline state when in the indented state. _(default: undefined)_\n- **--forge-list-item-cursor** - The cursor when interactive. _(default: undefined)_\n- **--forge-list-item-gap** - The gap between the slotted content. _(default: undefined)_\n- **--forge-list-item-text-color** - The text color of the text. _(default: undefined)_\n- **--forge-list-item-text-font-size** - The font size of the text. _(default: undefined)_\n- **--forge-list-item-text-font-weight** - The font weight of the text. _(default: undefined)_\n- **--forge-list-item-text-line-height** - The line height of the text. _(default: undefined)_\n- **--forge-list-item-selected-color** - The foreground color when in the selected state. _(default: undefined)_\n- **--forge-list-item-selected-background** - The background color when in the selected state. _(default: undefined)_\n- **--forge-list-item-selected-opacity** - The opacity of the background color when in the selected state. _(default: undefined)_\n- **--forge-list-item-start-selected-color** - The color of the start content when in the selected state. _(default: undefined)_\n- **--forge-list-item-end-selected-color** - The color of the end content when in the selected state. _(default: undefined)_\n- **--forge-list-item-selected-text-color** - The color of the text when in the selected state. _(default: undefined)_\n- **--forge-list-item-disabled-opacity** - The opacity of the element when in the disabled state. _(default: undefined)_\n- **--forge-list-item-disabled-cursor** - The cursor when in the disabled state. _(default: undefined)_\n- **--forge-list-item-one-line-height** - The line height when in the one/single line state. _(default: undefined)_\n- **--forge-list-item-two-line-height** - The line height when in the two line state. _(default: undefined)_\n- **--forge-list-item-three-line-height** - The line height when in the three line state. _(default: undefined)_\n- **--forge-list-item-dense-one-line-height** - The line height when in the dense one/single line state. _(default: undefined)_\n- **--forge-list-item-dense-two-line-height** - The line height when in the dense two line state. _(default: undefined)_\n- **--forge-list-item-dense-three-line-height** - The line height when in the dense three line state. _(default: undefined)_\n- **--forge-list-item-dense-font-size** - The font size when in the dense state. _(default: undefined)_\n- **--forge-list-item-dense-indent** - The margin inline state when in the dense indented state. _(default: undefined)_\n- **--forge-list-item-dense-gap** - The gap between the slotted content when in the dense state. _(default: undefined)_\n\n### **CSS Parts:**\n - **root** - The root container element.\n- **text-container** - The container for the text content.\n- **focus-indicator** - The forwarded focus indicator's internal indicator element.\n- **state-layer** - The forwarded state layer's internal surface element.",
3055
+ "attributes": [
3056
+ {
3057
+ "name": "selected",
3058
+ "description": "Applies the selected state to the list item.",
3059
+ "values": []
3060
+ },
3061
+ {
3062
+ "name": "active",
3063
+ "description": "Applies the active state to the list item by emulating its focused state.",
3064
+ "values": []
3065
+ },
3066
+ {
3067
+ "name": "value",
3068
+ "description": "The unique value of the list item.",
3069
+ "values": []
3070
+ },
3071
+ {
3072
+ "name": "dense",
3073
+ "description": "Applies the dense state to the list item.",
3074
+ "values": []
3075
+ },
3076
+ {
3077
+ "name": "indented",
3078
+ "description": "Applies the indented state by adding margin to the start of the list item.",
3079
+ "values": []
3080
+ },
3081
+ {
3082
+ "name": "two-line",
3083
+ "description": "Sets the list item height to support at least two lines of text.",
3084
+ "values": []
3085
+ },
3086
+ {
3087
+ "name": "three-line",
3088
+ "description": "Sets the list item height to support at least three lines of text.",
3089
+ "values": []
3090
+ },
3091
+ {
3092
+ "name": "wrap",
3093
+ "description": "Sets the list item to wrap its text content.",
3094
+ "values": []
3095
+ },
3096
+ {
3097
+ "name": "noninteractive",
3098
+ "description": "Controls whether the list item will automatically attach itself to interactive slotted elements or not.",
3099
+ "values": []
3100
+ },
3101
+ {
3102
+ "name": "focus-propagation",
3103
+ "description": "Controls whether the interactive element will receive focus if a non-interactive element is clicked within the list item.",
3104
+ "values": []
3105
+ }
3106
+ ],
3107
+ "references": []
3108
+ },
3052
3109
  {
3053
3110
  "name": "forge-meter",
3054
3111
  "description": "Meters display a scalar value within a defined range.\n---\n\n\n### **Slots:**\n - _default_ - The default slot for the meter's label.\n- **value** - A textual representation of the meter's value.\n\n### **CSS Properties:**\n - **--forge-meter-background** - The background color of the meter. _(default: undefined)_\n- **--forge-meter-color** - The color of the meter's bar. _(default: undefined)_\n- **--forge-meter-height** - The block size of the meter. _(default: undefined)_\n- **--forge-meter-shape** - The border radius of the meter. _(default: undefined)_\n- **--forge-meter-bar-inner-shape** - The border radius of the meter's bar. _(default: undefined)_\n- **--forge-meter-tickmarks** - The number of tickmarks to display. _(default: undefined)_\n- **--forge-meter-tickmark-opacity** - The opacity of the tickmarks. _(default: undefined)_\n- **--forge-meter-transition-duration** - The duration of transitions. _(default: undefined)_\n- **--forge-meter-transition-timing** - The timing function of transitions. _(default: undefined)_\n- **--forge-theme-success** - The color of the bar when the value is optimal. _(default: undefined)_\n- **--forge-theme-success-container-low** - The color of the track when the value is optimal. _(default: undefined)_\n- **--forge-theme-warning** - The color of the bar when the value is suboptimal. _(default: undefined)_\n- **--forge-theme-warning-container-low** - The color of the track when the value is suboptimal. _(default: undefined)_\n- **--forge-theme-error** - The color of the bar when the value is least optimal. _(default: undefined)_\n- **--forge-theme-error-container-low** - The color of the track when the value is least optimal. _(default: undefined)_\n\n### **CSS Parts:**\n - **root** - The root container element.\n- **track** - The element comprising the meter's background.\n- **bar** - The bar representing the value.",
@@ -3131,63 +3188,6 @@
3131
3188
  ],
3132
3189
  "references": []
3133
3190
  },
3134
- {
3135
- "name": "forge-list-item",
3136
- "description": "List items are individual rows of content inside of a list.\n---\n\n\n### **Events:**\n - **forge-list-item-select** - Fires when the list item is selected.\n\n### **Slots:**\n - _default_ - The primary text.\n- **secondary-text** - The secondary text.\n- **tertiary-text** - The tertiary text.\n- **start** - The start content.\n- **end** - The end element.\n\n### **CSS Properties:**\n - **--forge-list-item-background** - The background color. _(default: undefined)_\n- **--forge-list-item-shape** - The shape of the list item. _(default: undefined)_\n- **--forge-list-item-padding** - The padding inside of the container element. _(default: undefined)_\n- **--forge-list-item-wrap-padding** - The padding inside of the container element when `wrap` is enabled. _(default: undefined)_\n- **--forge-list-item-margin** - The margin around the host element. _(default: undefined)_\n- **--forge-list-item-height** - The height of the container. _(default: undefined)_\n- **--forge-list-item-indent** - The margin inline state when in the indented state. _(default: undefined)_\n- **--forge-list-item-cursor** - The cursor when interactive. _(default: undefined)_\n- **--forge-list-item-gap** - The gap between the slotted content. _(default: undefined)_\n- **--forge-list-item-text-color** - The text color of the text. _(default: undefined)_\n- **--forge-list-item-text-font-size** - The font size of the text. _(default: undefined)_\n- **--forge-list-item-text-font-weight** - The font weight of the text. _(default: undefined)_\n- **--forge-list-item-text-line-height** - The line height of the text. _(default: undefined)_\n- **--forge-list-item-selected-color** - The foreground color when in the selected state. _(default: undefined)_\n- **--forge-list-item-selected-background** - The background color when in the selected state. _(default: undefined)_\n- **--forge-list-item-selected-opacity** - The opacity of the background color when in the selected state. _(default: undefined)_\n- **--forge-list-item-start-selected-color** - The color of the start content when in the selected state. _(default: undefined)_\n- **--forge-list-item-end-selected-color** - The color of the end content when in the selected state. _(default: undefined)_\n- **--forge-list-item-selected-text-color** - The color of the text when in the selected state. _(default: undefined)_\n- **--forge-list-item-disabled-opacity** - The opacity of the element when in the disabled state. _(default: undefined)_\n- **--forge-list-item-disabled-cursor** - The cursor when in the disabled state. _(default: undefined)_\n- **--forge-list-item-one-line-height** - The line height when in the one/single line state. _(default: undefined)_\n- **--forge-list-item-two-line-height** - The line height when in the two line state. _(default: undefined)_\n- **--forge-list-item-three-line-height** - The line height when in the three line state. _(default: undefined)_\n- **--forge-list-item-dense-one-line-height** - The line height when in the dense one/single line state. _(default: undefined)_\n- **--forge-list-item-dense-two-line-height** - The line height when in the dense two line state. _(default: undefined)_\n- **--forge-list-item-dense-three-line-height** - The line height when in the dense three line state. _(default: undefined)_\n- **--forge-list-item-dense-font-size** - The font size when in the dense state. _(default: undefined)_\n- **--forge-list-item-dense-indent** - The margin inline state when in the dense indented state. _(default: undefined)_\n- **--forge-list-item-dense-gap** - The gap between the slotted content when in the dense state. _(default: undefined)_\n\n### **CSS Parts:**\n - **root** - The root container element.\n- **text-container** - The container for the text content.\n- **focus-indicator** - The forwarded focus indicator's internal indicator element.\n- **state-layer** - The forwarded state layer's internal surface element.",
3137
- "attributes": [
3138
- {
3139
- "name": "selected",
3140
- "description": "Applies the selected state to the list item.",
3141
- "values": []
3142
- },
3143
- {
3144
- "name": "active",
3145
- "description": "Applies the active state to the list item by emulating its focused state.",
3146
- "values": []
3147
- },
3148
- {
3149
- "name": "value",
3150
- "description": "The unique value of the list item.",
3151
- "values": []
3152
- },
3153
- {
3154
- "name": "dense",
3155
- "description": "Applies the dense state to the list item.",
3156
- "values": []
3157
- },
3158
- {
3159
- "name": "indented",
3160
- "description": "Applies the indented state by adding margin to the start of the list item.",
3161
- "values": []
3162
- },
3163
- {
3164
- "name": "two-line",
3165
- "description": "Sets the list item height to support at least two lines of text.",
3166
- "values": []
3167
- },
3168
- {
3169
- "name": "three-line",
3170
- "description": "Sets the list item height to support at least three lines of text.",
3171
- "values": []
3172
- },
3173
- {
3174
- "name": "wrap",
3175
- "description": "Sets the list item to wrap its text content.",
3176
- "values": []
3177
- },
3178
- {
3179
- "name": "noninteractive",
3180
- "description": "Controls whether the list item will automatically attach itself to interactive slotted elements or not.",
3181
- "values": []
3182
- },
3183
- {
3184
- "name": "focus-propagation",
3185
- "description": "Controls whether the interactive element will receive focus if a non-interactive element is clicked within the list item.",
3186
- "values": []
3187
- }
3188
- ],
3189
- "references": []
3190
- },
3191
3191
  {
3192
3192
  "name": "forge-meter-group",
3193
3193
  "description": "Meter groups display several meters together on one track.\n---\n\n\n### **Slots:**\n - _default_ - The default slot for grouped `<forge-meter>` elements.\n- **label** - Positions a label above the meter group.\n- **value** - A textual representation of the meter's value.\n\n### **CSS Properties:**\n - **--forge-meter-group-background** - The background color of the meter group. _(default: undefined)_\n- **--forge-meter-group-height** - The block size of the meter group. _(default: undefined)_\n- **--forge-meter-group-shape** - The border radius of the meter group. _(default: undefined)_\n- **--forge-meter-group-tickmarks** - The number of tickmarks to display. _(default: undefined)_\n- **--forge-meter-group-tickmark-color** - The color of the tickmarks. _(default: undefined)_\n- **--forge-meter-group-tickmark-opacity** - The opacity of the tickmarks. _(default: undefined)_\n\n### **CSS Parts:**\n - **root** - The root container element.\n- **track** - The element comprising the meter group's background.",
@@ -142,7 +142,7 @@ export class ColorPickerCore {
142
142
  _render() {
143
143
  this._setGradientColor();
144
144
  this._adapter.setPreviewColor(formatRgba(this._rgba));
145
- this._adapter.setHexInputValue(`#${this._hex}`);
145
+ this._adapter.setHexInputValue(formatHex(this._hex, this._allowOpacity));
146
146
  this._adapter.setRgbaInputValue(this._rgba);
147
147
  this._adapter.setHsvaInputValue(this._hsva);
148
148
  this._adapter.updateA11y(this._hsva.h, Math.round(this._hsva.a * 100));
@@ -165,11 +165,12 @@ export class ColorPickerCore {
165
165
  }
166
166
  set value(value) {
167
167
  if (this._value !== value) {
168
- this._value = value || DEFAULT_COLOR;
168
+ this._value = value ?? DEFAULT_COLOR;
169
169
  if (!isValidHex(this._value)) {
170
170
  throw new Error('Invalid hex value provided.');
171
171
  }
172
- this._hex = this._value.replace(/^#/, '');
172
+ this._value = this._value.replace(/^#/, ''); // Normalize hex value by removing leading hash
173
+ this._hex = this._value;
173
174
  this._setColorFromHex();
174
175
  this._adapter.setHostAttribute(COLOR_PICKER_CONSTANTS.attributes.VALUE, this._value);
175
176
  }
@@ -13,7 +13,7 @@ export declare class ColorPickerGradientSlider {
13
13
  private _downListener;
14
14
  private _moveListener;
15
15
  private _upListener;
16
- constructor(_rootElement: HTMLElement, _changeListener: (x: number, y: number) => void);
16
+ constructor(_rootElement: HTMLElement, _changeListener: (saturation: number, value: number) => void);
17
17
  destroy(): void;
18
18
  setValue(saturation: number, value: number): void;
19
19
  private _initialize;
@@ -9,6 +9,8 @@ export class ColorPickerGradientSlider {
9
9
  constructor(_rootElement, _changeListener) {
10
10
  this._rootElement = _rootElement;
11
11
  this._changeListener = _changeListener;
12
+ this._xPercent = 0;
13
+ this._yPercent = 0;
12
14
  this._keydownListener = evt => this._onKeydown(evt);
13
15
  this._downListener = evt => this._onDown(evt);
14
16
  this._moveListener = evt => this._onMove(evt);
@@ -19,12 +21,9 @@ export class ColorPickerGradientSlider {
19
21
  this._unlisten();
20
22
  }
21
23
  setValue(saturation, value) {
22
- window.requestAnimationFrame(() => {
23
- const bounds = this._rootElement.getBoundingClientRect();
24
- this._xPercent = Math.round(bounds.width * (saturation / 100));
25
- this._yPercent = bounds.height - Math.round(bounds.height * (value / 100));
26
- this._setThumbPosition(this._xPercent, this._yPercent);
27
- });
24
+ this._xPercent = Math.max(0, Math.min(100, saturation));
25
+ this._yPercent = Math.max(0, Math.min(100, 100 - value));
26
+ this._setThumbPosition(this._xPercent, this._yPercent);
28
27
  }
29
28
  _initialize() {
30
29
  this._thumbElement = this._rootElement.querySelector(COLOR_PICKER_CONSTANTS.selectors.GRADIENT_THUMB);
@@ -51,42 +50,30 @@ export class ColorPickerGradientSlider {
51
50
  const isArrowUpKey = evt.key === 'ArrowUp' || evt.keyCode === 38;
52
51
  const isArrowRightKey = evt.key === 'ArrowRight' || evt.keyCode === 39;
53
52
  const isArrowDownKey = evt.key === 'ArrowDown' || evt.keyCode === 40;
54
- const bounds = this._rootElement.getBoundingClientRect();
53
+ const stepSize = 1; // 1% steps
55
54
  if (isArrowDownKey) {
56
55
  evt.preventDefault();
57
- this._yPercent++;
56
+ this._yPercent = Math.min(100, this._yPercent + stepSize);
58
57
  }
59
58
  else if (isArrowUpKey) {
60
59
  evt.preventDefault();
61
- this._yPercent--;
60
+ this._yPercent = Math.max(0, this._yPercent - stepSize);
62
61
  }
63
62
  else if (isArrowLeftKey) {
64
63
  evt.preventDefault();
65
- this._xPercent--;
64
+ this._xPercent = Math.max(0, this._xPercent - stepSize);
66
65
  }
67
66
  else if (isArrowRightKey) {
68
67
  evt.preventDefault();
69
- this._xPercent++;
68
+ this._xPercent = Math.min(100, this._xPercent + stepSize);
70
69
  }
71
70
  else if (isEnterKey) {
72
71
  evt.preventDefault();
73
- // TODO(kieran.nichols): Select the current color
72
+ // TODO: Select the current color
74
73
  }
75
74
  else {
76
75
  return;
77
76
  }
78
- if (this._xPercent > bounds.width) {
79
- this._xPercent = bounds.width;
80
- }
81
- else if (this._xPercent < 0) {
82
- this._xPercent = 0;
83
- }
84
- if (this._yPercent > bounds.height) {
85
- this._yPercent = bounds.height;
86
- }
87
- else if (this._yPercent < 0) {
88
- this._yPercent = 0;
89
- }
90
77
  this._setThumbPosition(this._xPercent, this._yPercent);
91
78
  this._notify();
92
79
  }
@@ -115,21 +102,23 @@ export class ColorPickerGradientSlider {
115
102
  const x = isMouseEvent ? evt.clientX : evt.changedTouches[0].clientX;
116
103
  const y = isMouseEvent ? evt.clientY : evt.changedTouches[0].clientY;
117
104
  const coords = this._calculateSliderPercent(x, y);
118
- this._setThumbPosition(coords.x, coords.y);
119
- this._xPercent = parseInt(((coords.x / coords.width) * 100).toString(), 10);
120
- this._yPercent = Math.abs(parseInt(((coords.y / coords.height) * 100).toString(), 10) - 100);
105
+ this._xPercent = Math.max(0, Math.min(100, (coords.x / coords.width) * 100));
106
+ this._yPercent = Math.max(0, Math.min(100, (coords.y / coords.height) * 100));
107
+ this._setThumbPosition(this._xPercent, this._yPercent);
121
108
  this._notify();
122
109
  }
123
110
  _calculateSliderPercent(absX, absY) {
124
111
  return relativeCoords(absX, absY, this._rootElement);
125
112
  }
126
113
  _setThumbPosition(xPercent, yPercent) {
127
- this._thumbElement.style.left = `${xPercent}px`;
128
- this._thumbElement.style.top = `${yPercent}px`;
114
+ this._thumbElement.style.left = `${xPercent}%`;
115
+ this._thumbElement.style.top = `${yPercent}%`;
129
116
  }
130
117
  _notify() {
131
118
  if (typeof this._changeListener === 'function') {
132
- this._changeListener(this._xPercent, this._yPercent);
119
+ const saturation = this._xPercent;
120
+ const value = 100 - this._yPercent;
121
+ this._changeListener(saturation, value);
133
122
  }
134
123
  }
135
124
  }
@@ -285,7 +285,7 @@ export function createListItems(config, listElement, options, startIndex = 0, re
285
285
  if (!option.disabled && typeof config.cascadingElementFactory === 'function' && Array.isArray(option.options) && option.options.length) {
286
286
  // Create the trailing indicator icon to show that a child menu exists for this option.
287
287
  const optionIconElement = document.createElement('forge-icon');
288
- optionIconElement.name = 'arrow_right';
288
+ optionIconElement.name = 'arrow_right_alt';
289
289
  optionIconElement.slot = 'trailing';
290
290
  listItemElement.appendChild(optionIconElement);
291
291
  const nonDividerOptions = flatOptions.filter(o => !o.divider);
package/esm/menu/menu.js CHANGED
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { __decorate } from "tslib";
7
7
  import { attachShadowTemplate, coerceBoolean, customElement, ensureChild, coreProperty, isDefined } from '@tylertech/forge-core';
8
- import { tylIconArrowRight } from '@tylertech/tyler-icons';
8
+ import { tylIconArrowRightAlt } from '@tylertech/tyler-icons';
9
9
  import { IconRegistry } from '../icon';
10
10
  import { ListComponent } from '../list';
11
11
  import { ListDropdownAware } from '../list-dropdown/list-dropdown-aware';
@@ -43,7 +43,7 @@ let MenuComponent = class MenuComponent extends ListDropdownAware {
43
43
  }
44
44
  constructor() {
45
45
  super();
46
- IconRegistry.define(tylIconArrowRight);
46
+ IconRegistry.define(tylIconArrowRightAlt);
47
47
  this._core = new MenuCore(new MenuAdapter(this));
48
48
  attachShadowTemplate(this, template, styles);
49
49
  }
@@ -14,7 +14,7 @@ import { IconComponent, IconRegistry } from '../../icon';
14
14
  import { StateLayerComponent } from '../../state-layer';
15
15
  import { FocusIndicatorComponent } from '../../focus-indicator';
16
16
  const template = '<template><div class=\"forge-split-view-panel\" id=\"root\" part=\"root\"><div class=\"forge-split-view-panel__handle\" id=\"handle\" part=\"handle\" role=\"separator\" aria-controls=\"content\" aria-grabbed=\"false\" tabindex=\"0\"><forge-icon class=\"forge-split-view-panel__icon\" id=\"icon\" part=\"icon\"></forge-icon><forge-state-layer target=\"handle\" id=\"state-layer\" exportparts=\"surface:state-layer\"></forge-state-layer><forge-focus-indicator inward target=\"handle\" part=\"focus-indicator\"></forge-focus-indicator></div><div class=\"forge-split-view-panel__content\" id=\"content\" part=\"content\" role=\"group\"><slot></slot></div></div></template>';
17
- const styles = '.forge-split-view-panel{display:flex;width:100%;height:100%;overflow:hidden}.forge-split-view-panel__handle{color:var(--forge-theme-text-medium,rgba(0,0,0,.6));background-color:var(--forge-theme-outline,#e0e0e0);position:relative;display:flex;flex-shrink:0;justify-content:center;align-items:center;outline:0}.forge-split-view-panel__content{flex:1;overflow:hidden}.forge-split-view-panel--closed{display:none}.forge-split-view-panel--disabled #handle{pointer-events:none}.forge-split-view-panel--disabled .forge-split-view-panel__icon{display:none}.forge-split-view-panel[orientation=horizontal]{min-width:var(--forge-split-view-handle-width,8px);width:calc(var(--forge-split-view-panel-size,unset) + var(--forge-split-view-handle-width,8px));flex-direction:row}.forge-split-view-panel[orientation=horizontal] .forge-split-view-panel__handle{width:var(--forge-split-view-handle-width,8px);cursor:var(--forge-split-view-panel-cursor)}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--closing[resizable=end]{position:absolute;top:0;left:0;animation-name:u5ckttb;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes u5ckttb{from{transform:none}to{transform:translateX(-100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--closing[resizable=start]{position:absolute;top:0;right:0;animation-name:u5cktu7;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes u5cktu7{from{transform:none}to{transform:translateX(100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=end]{position:absolute;top:0;left:0;animation-name:u5cktv2;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1));animation-direction:reverse}@keyframes u5cktv2{from{transform:none}to{transform:translateX(-100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=start]{position:absolute;top:0;right:0;animation-name:u5cktvo;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1));animation-direction:reverse}@keyframes u5cktvo{from{transform:none}to{transform:translateX(100%)}}.forge-split-view-panel[orientation=vertical]{min-height:var(--forge-split-view-handle-width,8px);height:calc(var(--forge-split-view-panel-size,unset) + var(--forge-split-view-handle-width,8px));flex-direction:column}.forge-split-view-panel[orientation=vertical] .forge-split-view-panel__handle{height:var(--forge-split-view-handle-width,8px);cursor:var(--forge-split-view-panel-cursor)}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--closing[resizable=end]{position:absolute;top:0;left:0;animation-name:u5cktwc;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes u5cktwc{from{transform:none}to{transform:translateY(-100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--closing[resizable=start]{position:absolute;bottom:0;left:0;animation-name:u5cktwv;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes u5cktwv{from{transform:none}to{transform:translateY(100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=end]{position:absolute;top:0;left:0;animation-name:u5cktwx;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1));animation-direction:reverse}@keyframes u5cktwx{from{transform:none}to{transform:translateY(-100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=start]{position:absolute;bottom:0;left:0;animation-name:u5cktx2;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1));animation-direction:reverse}@keyframes u5cktx2{from{transform:none}to{transform:translateY(100%)}}:host{z-index:var(--forge-split-view-animating-layer)!important;display:block;position:relative;height:100%;width:100%;flex:0}:host([hidden]){display:none}:host(:not([resizable=start],[resizable=end])){flex:1}:host(:not([resizable=start],[resizable=end])) .forge-split-view-panel{width:100%;height:100%;min-width:0;min-height:0}:host(:not([resizable=start],[resizable=end])) .forge-split-view-panel__handle{display:none}forge-focus-indicator{--forge-focus-indicator-active-width:2px}';
17
+ const styles = '.forge-split-view-panel{display:flex;width:100%;height:100%;overflow:hidden}.forge-split-view-panel__handle{color:var(--forge-theme-text-medium,rgba(0,0,0,.6));background-color:var(--forge-theme-outline,#e0e0e0);position:relative;display:flex;flex-shrink:0;justify-content:center;align-items:center;outline:0}.forge-split-view-panel__content{flex:1;overflow:hidden}.forge-split-view-panel--closed{display:none}.forge-split-view-panel--disabled #handle{pointer-events:none}.forge-split-view-panel--disabled .forge-split-view-panel__icon{display:none}.forge-split-view-panel[orientation=horizontal]{min-width:var(--forge-split-view-handle-width,8px);width:calc(var(--forge-split-view-panel-size,unset) + var(--forge-split-view-handle-width,8px));flex-direction:row}.forge-split-view-panel[orientation=horizontal] .forge-split-view-panel__handle{width:var(--forge-split-view-handle-width,8px);cursor:var(--forge-split-view-panel-cursor)}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--closing[resizable=end]{position:absolute;top:0;left:0;animation-name:ujzdjfx;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ujzdjfx{from{transform:none}to{transform:translateX(-100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--closing[resizable=start]{position:absolute;top:0;right:0;animation-name:ujzdjg1;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ujzdjg1{from{transform:none}to{transform:translateX(100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=end]{position:absolute;top:0;left:0;animation-name:ujzdjgi;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1));animation-direction:reverse}@keyframes ujzdjgi{from{transform:none}to{transform:translateX(-100%)}}.forge-split-view-panel[orientation=horizontal].forge-split-view-panel--opening[resizable=start]{position:absolute;top:0;right:0;animation-name:ujzdjgn;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1));animation-direction:reverse}@keyframes ujzdjgn{from{transform:none}to{transform:translateX(100%)}}.forge-split-view-panel[orientation=vertical]{min-height:var(--forge-split-view-handle-width,8px);height:calc(var(--forge-split-view-panel-size,unset) + var(--forge-split-view-handle-width,8px));flex-direction:column}.forge-split-view-panel[orientation=vertical] .forge-split-view-panel__handle{height:var(--forge-split-view-handle-width,8px);cursor:var(--forge-split-view-panel-cursor)}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--closing[resizable=end]{position:absolute;top:0;left:0;animation-name:ujzdjhj;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ujzdjhj{from{transform:none}to{transform:translateY(-100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--closing[resizable=start]{position:absolute;bottom:0;left:0;animation-name:ujzdjhm;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1))}@keyframes ujzdjhm{from{transform:none}to{transform:translateY(100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=end]{position:absolute;top:0;left:0;animation-name:ujzdjhx;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1));animation-direction:reverse}@keyframes ujzdjhx{from{transform:none}to{transform:translateY(-100%)}}.forge-split-view-panel[orientation=vertical].forge-split-view-panel--opening[resizable=start]{position:absolute;bottom:0;left:0;animation-name:ujzdjir;animation-duration:var(--forge-animation-duration-medium2, 300ms);animation-timing-function:var(--forge-animation-easing-standard,cubic-bezier(0.2,0,0,1));animation-direction:reverse}@keyframes ujzdjir{from{transform:none}to{transform:translateY(100%)}}:host{z-index:var(--forge-split-view-animating-layer)!important;display:block;position:relative;height:100%;width:100%;flex:0}:host([hidden]){display:none}:host(:not([resizable=start],[resizable=end])){flex:1}:host(:not([resizable=start],[resizable=end])) .forge-split-view-panel{width:100%;height:100%;min-width:0;min-height:0}:host(:not([resizable=start],[resizable=end])) .forge-split-view-panel__handle{display:none}forge-focus-indicator{--forge-focus-indicator-active-width:2px}';
18
18
  /**
19
19
  * @tag forge-split-view-panel
20
20
  *
@@ -8,6 +8,7 @@ import { ITooltipComponent } from './tooltip';
8
8
  export interface ITooltipAdapter extends IBaseAdapter<ITooltipComponent> {
9
9
  readonly hostElement: ITooltipComponent;
10
10
  readonly anchorElement: HTMLElement | null;
11
+ readonly hasContent: boolean;
11
12
  syncAria(): void;
12
13
  detachAria(): void;
13
14
  setAnchorElement(element: HTMLElement | null): void;
@@ -22,10 +23,16 @@ export interface ITooltipAdapter extends IBaseAdapter<ITooltipComponent> {
22
23
  export declare class TooltipAdapter extends BaseAdapter<ITooltipComponent> implements ITooltipAdapter {
23
24
  private _contentElement;
24
25
  private _arrowElement;
26
+ private _defaultSlotElement;
25
27
  private _anchorElement;
26
28
  private _overlayElement;
27
29
  constructor(component: ITooltipComponent);
28
30
  get anchorElement(): HTMLElement | null;
31
+ /**
32
+ * Tooltips are considered to have content if the default slot has assigned nodes that
33
+ * are either elements, or text nodes with non-whitespace content.
34
+ */
35
+ get hasContent(): boolean;
29
36
  syncAria(): void;
30
37
  detachAria(): void;
31
38
  setAnchorElement(element: HTMLElement | null): void;
@@ -16,10 +16,20 @@ export class TooltipAdapter extends BaseAdapter {
16
16
  this._overlayElement = null;
17
17
  this._contentElement = getShadowElement(this._component, TOOLTIP_CONSTANTS.selectors.CONTENT);
18
18
  this._arrowElement = getShadowElement(this._component, TOOLTIP_CONSTANTS.selectors.ARROW);
19
+ this._defaultSlotElement = getShadowElement(this._component, TOOLTIP_CONSTANTS.selectors.DEFAULT_SLOT);
19
20
  }
20
21
  get anchorElement() {
21
22
  return this._anchorElement;
22
23
  }
24
+ /**
25
+ * Tooltips are considered to have content if the default slot has assigned nodes that
26
+ * are either elements, or text nodes with non-whitespace content.
27
+ */
28
+ get hasContent() {
29
+ return this._defaultSlotElement
30
+ .assignedNodes({ flatten: true })
31
+ .some(node => node.nodeType === Node.ELEMENT_NODE || (node.nodeType === Node.TEXT_NODE && node.textContent?.trim()));
32
+ }
23
33
  syncAria() {
24
34
  const role = this._component.type === 'description' ? 'tooltip' : null;
25
35
  this._component[setDefaultAria]({ role });
@@ -51,6 +51,7 @@ export declare const TOOLTIP_CONSTANTS: {
51
51
  selectors: {
52
52
  readonly CONTENT: ".forge-tooltip";
53
53
  readonly ARROW: ".arrow";
54
+ readonly DEFAULT_SLOT: "slot:not([name])";
54
55
  };
55
56
  };
56
57
  export type TooltipType = 'presentation' | 'label' | 'description';
@@ -36,7 +36,8 @@ const defaults = {
36
36
  };
37
37
  const selectors = {
38
38
  CONTENT: '.forge-tooltip',
39
- ARROW: '.arrow'
39
+ ARROW: '.arrow',
40
+ DEFAULT_SLOT: 'slot:not([name])'
40
41
  };
41
42
  export const TOOLTIP_CONSTANTS = {
42
43
  elementName,
@@ -96,6 +96,9 @@ export class TooltipCore extends WithLongpressListener(Object) {
96
96
  triggerTypes.forEach(triggerType => triggerRemovers[triggerType]());
97
97
  }
98
98
  _show() {
99
+ if (!this._adapter.hasContent) {
100
+ return;
101
+ }
99
102
  this._open = true;
100
103
  this._adapter.show();
101
104
  DismissibleStack.instance.add(this._adapter.hostElement);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tylertech/forge",
3
3
  "description": "Tyler Forge™ Web Components library",
4
- "version": "3.9.0-dev.4",
4
+ "version": "3.9.1",
5
5
  "author": "Tyler Technologies, Inc.",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -13,12 +13,12 @@
13
13
  "typings": "esm/index.d.ts",
14
14
  "sideEffects": false,
15
15
  "dependencies": {
16
- "@floating-ui/dom": "^1.7.0",
17
- "@tylertech/forge-core": "^3.2.0",
16
+ "@floating-ui/dom": "^1.7.1",
17
+ "@tylertech/forge-core": "^3.2.1",
18
18
  "@tylertech/tyler-icons": "^2.0.3",
19
19
  "imask": "^7.6.1",
20
20
  "lit": "^3.3.0",
21
21
  "tslib": "^2.8.1"
22
22
  },
23
23
  "customElements": "custom-elements.json"
24
- }
24
+ }