@vaadin/component-base 24.2.0-alpha14 → 24.2.0-alpha15

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/component-base",
3
- "version": "24.2.0-alpha14",
3
+ "version": "24.2.0-alpha15",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -42,5 +42,5 @@
42
42
  "@vaadin/testing-helpers": "^0.5.0",
43
43
  "sinon": "^13.0.2"
44
44
  },
45
- "gitHead": "203a2fda8d879db6ee8bccd7cf5b915de3e5008b"
45
+ "gitHead": "043dbb1c2513685a98354921876d35fa18bca7a2"
46
46
  }
@@ -45,7 +45,7 @@ const registered = new Set();
45
45
  export const ElementMixin = (superClass) =>
46
46
  class VaadinElementMixin extends DirMixin(superClass) {
47
47
  static get version() {
48
- return '24.2.0-alpha14';
48
+ return '24.2.0-alpha15';
49
49
  }
50
50
 
51
51
  /** @protected */
@@ -93,17 +93,6 @@ const PolylitMixinImplementation = (superclass) => {
93
93
 
94
94
  let result = defaultDescriptor;
95
95
 
96
- if ('value' in options) {
97
- // Set the default value
98
- this.addCheckedInitializer((instance) => {
99
- if (typeof options.value === 'function') {
100
- instance[name] = options.value.call(instance);
101
- } else {
102
- instance[name] = options.value;
103
- }
104
- });
105
- }
106
-
107
96
  if (options.sync) {
108
97
  result = {
109
98
  get: defaultDescriptor.get,
@@ -129,6 +118,10 @@ const PolylitMixinImplementation = (superclass) => {
129
118
  // This is run during construction of the element
130
119
  instance[`_set${upper(name)}`] = function (value) {
131
120
  setter.call(instance, value);
121
+
122
+ if (options.sync) {
123
+ this.performUpdate();
124
+ }
132
125
  };
133
126
  });
134
127
 
@@ -142,6 +135,19 @@ const PolylitMixinImplementation = (superclass) => {
142
135
  };
143
136
  }
144
137
 
138
+ if ('value' in options) {
139
+ // Set the default value
140
+ this.addCheckedInitializer((instance) => {
141
+ const value = typeof options.value === 'function' ? options.value.call(instance) : options.value;
142
+
143
+ if (options.readOnly) {
144
+ instance[`_set${upper(name)}`](value);
145
+ } else {
146
+ instance[name] = value;
147
+ }
148
+ });
149
+ }
150
+
145
151
  if (options.observer) {
146
152
  const method = options.observer;
147
153