@cas-smartdesign/radio-button-group 4.0.1 → 4.0.3

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.
@@ -2,19 +2,19 @@ import { LitElement as b, css as g, unsafeCSS as v, html as f } from "lit";
2
2
  import { property as n } from "lit/decorators/property.js";
3
3
  import { ifDefined as x } from "lit/directives/if-defined.js";
4
4
  import { ValidationLevel as k } from "@cas-smartdesign/field-validation-message";
5
- const y = ":host{display:block}:host,.label,.checkbox{outline:none}:host([disabled]){pointer-events:none}:host([disabled]) .root{opacity:.6;cursor:default;filter:grayscale(100%)}:host(:not([disabled])[focused]) .highlight{display:block!important}:host([checked]) circle.inner{display:block!important}:host([checked]) circle.outer{stroke:var(--sd-radio-button-checked-color, #1467ba)!important}.root{display:inline-flex;align-items:center;vertical-align:middle;width:100%;padding-top:6px;padding-bottom:6px}.root .radio-button-container{position:relative;display:inline-block;width:28px;height:28px;box-sizing:border-box;cursor:pointer;margin-right:5px;flex-shrink:0}.root .radio-button-container input{position:absolute;top:0;left:0;opacity:0}.root .radio-button-container circle.highlight{stroke:var(--sd-radio-button-highlight-color, rgba(20, 103, 186, .3))}.root .radio-button-container circle.inner{fill:var(--sd-radio-button-checked-color, #1467ba)}.root .radio-button-container circle.outer{stroke:var(--sd-radio-button-unchecked-color, #767676)}.root .label{font-family:Segoe UI,Lucida Sans,Arial,sans-serif;text-overflow:ellipsis;overflow-x:hidden;-webkit-user-select:none;user-select:none;cursor:pointer;padding-top:2px;padding-bottom:2px}";
5
+ const y = ":host{display:block}:host,.label,.checkbox{outline:none}:host([disabled]){pointer-events:none}:host([disabled]) .root{opacity:.6;cursor:default;filter:grayscale(100%)}:host(:not([disabled])[focused]) .highlight{display:block!important}:host([checked]) circle.inner{display:block!important}:host([checked]) circle.outer{stroke:var(--sd-radio-button-checked-color, #1467ba)!important}:host([oneline]) .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.root{display:inline-flex;align-items:center;vertical-align:middle;width:100%;padding-top:6px;padding-bottom:6px}.root .radio-button-container{position:relative;display:inline-block;width:28px;height:28px;box-sizing:border-box;cursor:pointer;margin-right:5px;flex-shrink:0}.root .radio-button-container input{position:absolute;top:0;left:0;opacity:0}.root .radio-button-container circle.highlight{stroke:var(--sd-radio-button-highlight-color, rgba(20, 103, 186, .3))}.root .radio-button-container circle.inner{fill:var(--sd-radio-button-checked-color, #1467ba)}.root .radio-button-container circle.outer{stroke:var(--sd-radio-button-unchecked-color, #767676)}.root .label{font-family:Segoe UI,Lucida Sans,Arial,sans-serif;text-overflow:ellipsis;overflow-x:hidden;-webkit-user-select:none;user-select:none;cursor:pointer;padding-top:2px;padding-bottom:2px}";
6
6
  var I = Object.defineProperty, m = Object.getOwnPropertyDescriptor, p = (o, t, e, s) => {
7
7
  for (var i = s > 1 ? void 0 : s ? m(t, e) : t, c = o.length - 1, d; c >= 0; c--)
8
8
  (d = o[c]) && (i = (s ? d(t, e, i) : d(i)) || i);
9
9
  return s && i && I(t, e, i), i;
10
10
  };
11
11
  let w = 0;
12
- var a;
13
- const u = (a = class extends b {
12
+ var l;
13
+ const u = (l = class extends b {
14
14
  constructor() {
15
15
  super(), this.checked = !1, this.value = "", this.disabled = !1, this.label = "", this.handleClick = (t) => {
16
16
  t.preventDefault();
17
- }, this.a11yID = a.ID + "_" + w++;
17
+ }, this.a11yID = l.ID + "_" + w++;
18
18
  }
19
19
  static get styles() {
20
20
  return [
@@ -51,9 +51,9 @@ const u = (a = class extends b {
51
51
  </div>
52
52
  `;
53
53
  }
54
- }, a.ID = "sd-radio-button", a.ensureDefined = () => {
55
- customElements.get(a.ID) || customElements.define(a.ID, a);
56
- }, a);
54
+ }, l.ID = "sd-radio-button", l.ensureDefined = () => {
55
+ customElements.get(l.ID) || customElements.define(l.ID, l);
56
+ }, l);
57
57
  p([
58
58
  n({ type: Boolean, reflect: !0, attribute: !0 })
59
59
  ], u.prototype, "checked", 2);
@@ -72,8 +72,8 @@ var C = Object.defineProperty, D = Object.getOwnPropertyDescriptor, h = (o, t, e
72
72
  for (var i = s > 1 ? void 0 : s ? D(t, e) : t, c = o.length - 1, d; c >= 0; c--)
73
73
  (d = o[c]) && (i = (s ? d(t, e, i) : d(i)) || i);
74
74
  return s && i && C(t, e, i), i;
75
- }, l;
76
- const r = (l = class extends b {
75
+ }, a;
76
+ const r = (a = class extends b {
77
77
  constructor() {
78
78
  super(...arguments), this.layout = "horizontal", this.value = "", this.uncheckAllowed = !1, this.disabled = !1, this._focusIndex = -1, this._checkedButton = null, this.handleSlotChange = () => {
79
79
  this._buttons = this.buttonsSlot.assignedElements(), this._buttons.forEach((t) => {
@@ -233,9 +233,9 @@ const r = (l = class extends b {
233
233
  get selectedIndex() {
234
234
  return this._buttons.indexOf(this._checkedButton);
235
235
  }
236
- }, l.ID = "sd-radio-button-group", l.ensureDefined = () => {
237
- B.ensureDefined(), customElements.get(l.ID) || customElements.define(l.ID, l);
238
- }, l);
236
+ }, a.ID = "sd-radio-button-group", a.ensureDefined = () => {
237
+ B.ensureDefined(), customElements.get(a.ID) || customElements.define(a.ID, a);
238
+ }, a);
239
239
  h([
240
240
  n({ type: String, reflect: !0, attribute: !0 })
241
241
  ], r.prototype, "layout", 2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cas-smartdesign/radio-button-group",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "Radio button and radio button group elements with SmartDesign look & feel",
5
5
  "main": "dist/radio-button-group-with-externals.js",
6
6
  "module": "dist/radio-button-group.mjs",
@@ -8,8 +8,8 @@
8
8
  "types": "dist/radio-button-group.d.ts",
9
9
  "dependencies": {
10
10
  "lit": "^2.8.0",
11
- "@cas-smartdesign/field-validation-message": "^5.0.1",
12
- "@cas-smartdesign/styles": "^3.6.1"
11
+ "@cas-smartdesign/field-validation-message": "^5.0.2",
12
+ "@cas-smartdesign/styles": "^3.6.2"
13
13
  },
14
14
  "files": [
15
15
  "dist",
@@ -20,9 +20,9 @@
20
20
  "access": "public"
21
21
  },
22
22
  "devDependencies": {
23
- "@cas-smartdesign/button": "^5.0.1",
24
- "@cas-smartdesign/element-preview": "^0.2.1",
25
- "@cas-smartdesign/license-generator": "^1.6.1"
23
+ "@cas-smartdesign/button": "^5.0.2",
24
+ "@cas-smartdesign/element-preview": "^0.2.2",
25
+ "@cas-smartdesign/license-generator": "^1.6.3"
26
26
  },
27
27
  "scripts": {
28
28
  "version": "pnpm version",
package/readme.md CHANGED
@@ -48,10 +48,12 @@ The element could show validation messages via an `sd-field-validation-message`
48
48
  - Defines whether if the interaction with the button is disabled
49
49
  - `label`
50
50
  - Defines the text of the label
51
+ - `oneline`: boolean
52
+ - The label of the button may wrap into multiple lines without this option.
51
53
 
52
54
  ### Properties
53
55
 
54
- - `checked`, `value`, `focused`, `disabled`, `label`
56
+ - `checked`, `value`, `focused`, `disabled`, `label`, `oneline`
55
57
  - Reflects the corresponding attribute
56
58
 
57
59
  ### CSS Custom Properties
@@ -62,5 +64,3 @@ The element could show validation messages via an `sd-field-validation-message`
62
64
  - Defines the color of the circle which is only visible when the button is focused
63
65
  - `--sd-radio-button-unchecked-color`
64
66
  - Defines the color of the outer circle and the inner circle when the button is unchecked
65
-
66
- ## Examples