@yoobic/yobi 8.2.0-31 → 8.2.0-32

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.
@@ -31,12 +31,6 @@ const YooFormChoiceCardComponent = class {
31
31
  this.imgElements = [];
32
32
  this.choices = [];
33
33
  }
34
- onValuesChanged(newValues, oldValues) {
35
- formChoiceHelpers.updateValues(newValues, oldValues, this);
36
- }
37
- onValueChanged(newValue, oldValue) {
38
- formChoiceHelpers.updateValue(newValue, oldValue, this);
39
- }
40
34
  componentWillLoad() {
41
35
  var _a;
42
36
  formChoiceHelpers.prepareChoice(this);
@@ -78,7 +72,10 @@ const YooFormChoiceCardComponent = class {
78
72
  return index.h("yoo-icon", { name: "check" });
79
73
  }
80
74
  renderSelect(item, index$1) {
81
- const selected = formChoiceHelpers.isSelected(item.value || item.title, this.selection);
75
+ const selected = ((formChoiceHelpers.isSelected('true', this.selection) && index$1 === 0) ||
76
+ (formChoiceHelpers.isSelected('false', this.selection) && index$1 === 0) ||
77
+ formChoiceHelpers.isSelected(item.value || item.title, this.selection) ||
78
+ formChoiceHelpers.isSelected(item || item.title, this.selection));
82
79
  return (index.h("div", { class: { 'select': true, selected }, style: { ...(this.maxWidth > 0 && { maxWidth: `${this.maxWidth}px` }) }, onClick: () => formChoiceHelpers.onItemSelect(item.value || item.title, this) }, this.renderCardContent(item, selected, index$1), !item.image &&
83
80
  !item.lottie &&
84
81
  !item.hideCheckbox &&
@@ -100,10 +97,6 @@ const YooFormChoiceCardComponent = class {
100
97
  ]));
101
98
  }
102
99
  get host() { return index.getElement(this); }
103
- static get watchers() { return {
104
- "values": ["onValuesChanged"],
105
- "value": ["onValueChanged"]
106
- }; }
107
100
  };
108
101
  YooFormChoiceCardComponent.style = formChoiceCardCss;
109
102
 
@@ -1,7 +1,7 @@
1
1
  import { isChromatic, translate, translateMulti } from '@shared/utils';
2
- import { Component, Element, Event, h, Host, Prop, State, Watch } from '@stencil/core';
2
+ import { Component, Element, Event, h, Host, Prop, State } from '@stencil/core';
3
3
  import { setColorSVG } from '../../../../utils/helpers/common-helpers';
4
- import { hasWarnings, isSelected, onItemSelect, prepareChoice, updateValue, updateValues } from '../form-choice-helpers';
4
+ import { hasWarnings, isSelected, onItemSelect, prepareChoice } from '../form-choice-helpers';
5
5
  import { ReadonlyCard } from '../readonly-card/readonly-card';
6
6
  export class YooFormChoiceCardComponent {
7
7
  constructor() {
@@ -13,12 +13,6 @@ export class YooFormChoiceCardComponent {
13
13
  this.imgElements = [];
14
14
  this.choices = [];
15
15
  }
16
- onValuesChanged(newValues, oldValues) {
17
- updateValues(newValues, oldValues, this);
18
- }
19
- onValueChanged(newValue, oldValue) {
20
- updateValue(newValue, oldValue, this);
21
- }
22
16
  componentWillLoad() {
23
17
  var _a;
24
18
  prepareChoice(this);
@@ -60,7 +54,10 @@ export class YooFormChoiceCardComponent {
60
54
  return h("yoo-icon", { name: "check" });
61
55
  }
62
56
  renderSelect(item, index) {
63
- const selected = isSelected(item.value || item.title, this.selection);
57
+ const selected = ((isSelected('true', this.selection) && index === 0) ||
58
+ (isSelected('false', this.selection) && index === 0) ||
59
+ isSelected(item.value || item.title, this.selection) ||
60
+ isSelected(item || item.title, this.selection));
64
61
  return (h("div", { class: { 'select': true, selected }, style: { ...(this.maxWidth > 0 && { maxWidth: `${this.maxWidth}px` }) }, onClick: () => onItemSelect(item.value || item.title, this) },
65
62
  this.renderCardContent(item, selected, index),
66
63
  !item.image &&
@@ -424,11 +421,4 @@ export class YooFormChoiceCardComponent {
424
421
  }
425
422
  }]; }
426
423
  static get elementRef() { return "host"; }
427
- static get watchers() { return [{
428
- "propName": "values",
429
- "methodName": "onValuesChanged"
430
- }, {
431
- "propName": "value",
432
- "methodName": "onValueChanged"
433
- }]; }
434
424
  }
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, i as createEvent, h, e as Host, g as getElement } from './index-019c1b1a.js';
2
2
  import { i as isChromatic, t as translate, T as translateMulti } from './index-60d331ff.js';
3
3
  import { s as setColorSVG } from './common-helpers-7760f0f6.js';
4
- import { u as updateValues, a as updateValue, p as prepareChoice, h as hasWarnings, i as isSelected, o as onItemSelect } from './form-choice-helpers-b1f907b5.js';
4
+ import { p as prepareChoice, h as hasWarnings, i as isSelected, o as onItemSelect } from './form-choice-helpers-b1f907b5.js';
5
5
  import { R as ReadonlyCard } from './readonly-card-a23bca7c.js';
6
6
  import './lodash-b0ad17f3.js';
7
7
  import './_commonjsHelpers-f4d11124.js';
@@ -27,12 +27,6 @@ const YooFormChoiceCardComponent = class {
27
27
  this.imgElements = [];
28
28
  this.choices = [];
29
29
  }
30
- onValuesChanged(newValues, oldValues) {
31
- updateValues(newValues, oldValues, this);
32
- }
33
- onValueChanged(newValue, oldValue) {
34
- updateValue(newValue, oldValue, this);
35
- }
36
30
  componentWillLoad() {
37
31
  var _a;
38
32
  prepareChoice(this);
@@ -74,7 +68,10 @@ const YooFormChoiceCardComponent = class {
74
68
  return h("yoo-icon", { name: "check" });
75
69
  }
76
70
  renderSelect(item, index) {
77
- const selected = isSelected(item.value || item.title, this.selection);
71
+ const selected = ((isSelected('true', this.selection) && index === 0) ||
72
+ (isSelected('false', this.selection) && index === 0) ||
73
+ isSelected(item.value || item.title, this.selection) ||
74
+ isSelected(item || item.title, this.selection));
78
75
  return (h("div", { class: { 'select': true, selected }, style: { ...(this.maxWidth > 0 && { maxWidth: `${this.maxWidth}px` }) }, onClick: () => onItemSelect(item.value || item.title, this) }, this.renderCardContent(item, selected, index), !item.image &&
79
76
  !item.lottie &&
80
77
  !item.hideCheckbox &&
@@ -96,10 +93,6 @@ const YooFormChoiceCardComponent = class {
96
93
  ]));
97
94
  }
98
95
  get host() { return getElement(this); }
99
- static get watchers() { return {
100
- "values": ["onValuesChanged"],
101
- "value": ["onValueChanged"]
102
- }; }
103
96
  };
104
97
  YooFormChoiceCardComponent.style = formChoiceCardCss;
105
98
 
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, i as createEvent, h, e as Host, g as getElement } from './index-019c1b1a.js';
2
2
  import { i as isChromatic, t as translate, T as translateMulti } from './index-60d331ff.js';
3
3
  import { s as setColorSVG } from './common-helpers-7760f0f6.js';
4
- import { u as updateValues, a as updateValue, p as prepareChoice, h as hasWarnings, i as isSelected, o as onItemSelect } from './form-choice-helpers-b1f907b5.js';
4
+ import { p as prepareChoice, h as hasWarnings, i as isSelected, o as onItemSelect } from './form-choice-helpers-b1f907b5.js';
5
5
  import { R as ReadonlyCard } from './readonly-card-a23bca7c.js';
6
6
  import './lodash-b0ad17f3.js';
7
7
  import './_commonjsHelpers-f4d11124.js';
@@ -27,12 +27,6 @@ const YooFormChoiceCardComponent = class {
27
27
  this.imgElements = [];
28
28
  this.choices = [];
29
29
  }
30
- onValuesChanged(newValues, oldValues) {
31
- updateValues(newValues, oldValues, this);
32
- }
33
- onValueChanged(newValue, oldValue) {
34
- updateValue(newValue, oldValue, this);
35
- }
36
30
  componentWillLoad() {
37
31
  var _a;
38
32
  prepareChoice(this);
@@ -74,7 +68,10 @@ const YooFormChoiceCardComponent = class {
74
68
  return h("yoo-icon", { name: "check" });
75
69
  }
76
70
  renderSelect(item, index) {
77
- const selected = isSelected(item.value || item.title, this.selection);
71
+ const selected = ((isSelected('true', this.selection) && index === 0) ||
72
+ (isSelected('false', this.selection) && index === 0) ||
73
+ isSelected(item.value || item.title, this.selection) ||
74
+ isSelected(item || item.title, this.selection));
78
75
  return (h("div", { class: { 'select': true, selected }, style: { ...(this.maxWidth > 0 && { maxWidth: `${this.maxWidth}px` }) }, onClick: () => onItemSelect(item.value || item.title, this) }, this.renderCardContent(item, selected, index), !item.image &&
79
76
  !item.lottie &&
80
77
  !item.hideCheckbox &&
@@ -96,10 +93,6 @@ const YooFormChoiceCardComponent = class {
96
93
  ]));
97
94
  }
98
95
  get host() { return getElement(this); }
99
- static get watchers() { return {
100
- "values": ["onValuesChanged"],
101
- "value": ["onValueChanged"]
102
- }; }
103
96
  };
104
97
  YooFormChoiceCardComponent.style = formChoiceCardCss;
105
98
 
@@ -18,9 +18,7 @@ export declare class YooFormChoiceCardComponent implements IFormSelect {
18
18
  selected: boolean;
19
19
  customEvent: boolean;
20
20
  values: IFormChoiceValue[];
21
- onValuesChanged(newValues: any, oldValues: any): void;
22
21
  value: string[] | string;
23
- onValueChanged(newValue: any, oldValue: any): void;
24
22
  host: HTMLElement;
25
23
  validityChanged: EventEmitter<boolean>;
26
24
  inputBlurred: EventEmitter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoobic/yobi",
3
- "version": "8.2.0-31",
3
+ "version": "8.2.0-32",
4
4
  "description": "Yobi - Yoobic Design System",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.cjs.js",