@lion/ui 0.18.0 → 0.18.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.
Files changed (55) hide show
  1. package/components/form-core/src/choice-group/ChoiceInputMixin.js +1 -1
  2. package/components/switch/src/LionSwitch.js +1 -1
  3. package/components/switch/test/lion-switch.test.js +7 -0
  4. package/custom-elements.json +30 -30
  5. package/dist-types/tsconfig.tsbuildinfo +1 -1
  6. package/docs/components/checkbox-group/overview.md +2 -2
  7. package/docs/components/collapsible/overview.md +1 -1
  8. package/docs/components/combobox/overview.md +1 -1
  9. package/docs/components/combobox/use-cases.md +1 -1
  10. package/docs/components/dialog/overview.md +1 -1
  11. package/docs/components/fieldset/overview.md +5 -5
  12. package/docs/components/form/overview.md +3 -3
  13. package/docs/components/form/use-cases.md +2 -2
  14. package/docs/components/icon/use-cases.md +1 -1
  15. package/docs/components/input/overview.md +1 -1
  16. package/docs/components/input-amount/overview.md +3 -3
  17. package/docs/components/input-date/overview.md +3 -3
  18. package/docs/components/input-datepicker/overview.md +5 -5
  19. package/docs/components/input-email/overview.md +2 -2
  20. package/docs/components/input-file/overview.md +1 -1
  21. package/docs/components/input-iban/overview.md +2 -2
  22. package/docs/components/input-range/overview.md +2 -2
  23. package/docs/components/input-stepper/overview.md +1 -1
  24. package/docs/components/input-tel/overview.md +1 -1
  25. package/docs/components/input-tel/use-cases.md +6 -6
  26. package/docs/components/input-tel-dropdown/overview.md +1 -1
  27. package/docs/components/listbox/use-cases.md +1 -1
  28. package/docs/components/radio-group/overview.md +3 -3
  29. package/docs/components/select/use-cases.md +1 -1
  30. package/docs/components/select-rich/use-cases.md +2 -2
  31. package/docs/components/tabs/examples.md +1 -1
  32. package/docs/fundamentals/index.md +4 -4
  33. package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
  34. package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
  35. package/docs/fundamentals/rationales/accessibility.md +1 -1
  36. package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
  37. package/docs/fundamentals/systems/core/overview.md +1 -1
  38. package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
  39. package/docs/fundamentals/systems/form/model-value.md +1 -1
  40. package/docs/fundamentals/systems/form/overview.md +28 -28
  41. package/docs/fundamentals/systems/form/validate.md +2 -2
  42. package/docs/fundamentals/systems/localize/overview.md +4 -4
  43. package/docs/fundamentals/systems/overlays/configuration.md +2 -2
  44. package/docs/fundamentals/systems/overlays/overview.md +5 -5
  45. package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
  46. package/docs/fundamentals/tools/helpers/overview.md +1 -1
  47. package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
  48. package/docs/guides/how-to/create-a-custom-field.md +5 -5
  49. package/docs/guides/how-to/create-a-form.md +4 -4
  50. package/docs/guides/how-to/extend-a-native-input.md +2 -2
  51. package/docs/guides/how-to/index.md +1 -1
  52. package/docs/guides/index.md +8 -8
  53. package/docs/guides/principles/index.md +5 -5
  54. package/docs/guides/principles/styling.md +1 -1
  55. package/package.json +1 -1
@@ -238,7 +238,7 @@ const ChoiceInputMixinImplementation = superclass =>
238
238
  */
239
239
  // eslint-disable-next-line no-unused-vars
240
240
  _toggleChecked(ev) {
241
- if (this.disabled) {
241
+ if (this.disabled || this.readOnly) {
242
242
  return;
243
243
  }
244
244
  this._isHandlingUserInput = true;
@@ -148,7 +148,7 @@ export class LionSwitch extends ScopedElementsMixin(ChoiceInputMixin(LionField))
148
148
  * @protected
149
149
  */
150
150
  _onLabelClick() {
151
- if (this.disabled) {
151
+ if (this.disabled || this.readOnly) {
152
152
  return;
153
153
  }
154
154
  this._inputNode.focus();
@@ -72,6 +72,13 @@ describe('lion-switch', () => {
72
72
  expect(isActiveElement(_inputNode)).to.be.false;
73
73
  });
74
74
 
75
+ it('clicking the label should not toggle the checked state when readonly', async () => {
76
+ const el = await fixture(html`<lion-switch readonly label="Enable Setting"></lion-switch>`);
77
+ const { _labelNode } = getFormControlMembers(el);
78
+ _labelNode.click();
79
+ expect(el.checked).to.be.false;
80
+ });
81
+
75
82
  it('should sync its "disabled" state to child button', async () => {
76
83
  const el = await fixture(html`<lion-switch disabled></lion-switch>`);
77
84
  const { _inputNode } = getSwitchMembers(el);
@@ -2166,6 +2166,36 @@
2166
2166
  }
2167
2167
  ]
2168
2168
  },
2169
+ {
2170
+ "kind": "javascript-module",
2171
+ "path": "exports/define-helpers/sb-action-logger.js",
2172
+ "declarations": [],
2173
+ "exports": [
2174
+ {
2175
+ "kind": "custom-element-definition",
2176
+ "name": "sb-action-logger",
2177
+ "declaration": {
2178
+ "name": "SbActionLogger",
2179
+ "module": "/exports/helpers.js"
2180
+ }
2181
+ }
2182
+ ]
2183
+ },
2184
+ {
2185
+ "kind": "javascript-module",
2186
+ "path": "exports/define-helpers/sb-locale-switcher.js",
2187
+ "declarations": [],
2188
+ "exports": [
2189
+ {
2190
+ "kind": "custom-element-definition",
2191
+ "name": "sb-locale-switcher",
2192
+ "declaration": {
2193
+ "name": "SbLocaleSwitcher",
2194
+ "module": "/exports/helpers.js"
2195
+ }
2196
+ }
2197
+ ]
2198
+ },
2169
2199
  {
2170
2200
  "kind": "javascript-module",
2171
2201
  "path": "exports/define/lion-accordion.js",
@@ -2871,36 +2901,6 @@
2871
2901
  }
2872
2902
  ]
2873
2903
  },
2874
- {
2875
- "kind": "javascript-module",
2876
- "path": "exports/define-helpers/sb-action-logger.js",
2877
- "declarations": [],
2878
- "exports": [
2879
- {
2880
- "kind": "custom-element-definition",
2881
- "name": "sb-action-logger",
2882
- "declaration": {
2883
- "name": "SbActionLogger",
2884
- "module": "/exports/helpers.js"
2885
- }
2886
- }
2887
- ]
2888
- },
2889
- {
2890
- "kind": "javascript-module",
2891
- "path": "exports/define-helpers/sb-locale-switcher.js",
2892
- "declarations": [],
2893
- "exports": [
2894
- {
2895
- "kind": "custom-element-definition",
2896
- "name": "sb-locale-switcher",
2897
- "declaration": {
2898
- "name": "SbLocaleSwitcher",
2899
- "module": "/exports/helpers.js"
2900
- }
2901
- }
2902
- ]
2903
- },
2904
2904
  {
2905
2905
  "kind": "javascript-module",
2906
2906
  "path": "components/accordion/src/LionAccordion.js",