@livinglogic/livingapi 1.24.0 → 1.26.0

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": "@livinglogic/livingapi",
3
- "version": "1.24.0",
3
+ "version": "1.26.0",
4
4
  "description": "Javascript version of the LivingAPI classes of LivingApps",
5
5
  "repository": {
6
6
  "type": "git",
package/src/livingapi.js CHANGED
@@ -2104,11 +2104,31 @@ let stringfieldtype = new StringFieldType("la", "StringField", "Holds the value
2104
2104
 
2105
2105
  export class StringField extends Field
2106
2106
  {
2107
+ constructor(control, record, value)
2108
+ {
2109
+ super(control, record, value);
2110
+ this._placeholder = null;
2111
+ }
2112
+
2107
2113
  [ul4.symbols.type]()
2108
2114
  {
2109
2115
  return stringfieldtype;
2110
2116
  }
2111
2117
 
2118
+ get placeholder()
2119
+ {
2120
+ if (this._placeholder !== null)
2121
+ return this._placeholder;
2122
+ return this.control.placeholder;
2123
+ }
2124
+
2125
+ set placeholder(value)
2126
+ {
2127
+ this._placeholder = value;
2128
+ if (this._in_form())
2129
+ this._dom_control.placeholder = this.placeholder ?? "";
2130
+ }
2131
+
2112
2132
  _validate(change)
2113
2133
  {
2114
2134
  if (change.value === null || change.value === "")
@@ -2155,6 +2175,9 @@ export class StringField extends Field
2155
2175
  }
2156
2176
  };
2157
2177
 
2178
+ StringField.prototype._ul4onattrs = [...Field.prototype._ul4onattrs, "_placeholder"];
2179
+ StringField.prototype._ul4attrs = new Set([...Field.prototype._ul4attrs, "placeholder"]);
2180
+
2158
2181
 
2159
2182
  class PasswordFieldType extends StringFieldType
2160
2183
  {
@@ -4139,37 +4162,7 @@ IntControl.prototype.type = "int";
4139
4162
  IntControl.prototype.fieldtype = IntField;
4140
4163
 
4141
4164
 
4142
- class PlaceholderControlType extends ControlType
4143
- {
4144
- instancecheck(obj)
4145
- {
4146
- return obj instanceof PlaceholderControld;
4147
- }
4148
- };
4149
-
4150
- let placeholdercontroltype = new PlaceholderControlType("la", "PlaceholderControl", "A LivingApps field that has a placeholder");
4151
-
4152
-
4153
- class PlaceholderControl extends Control
4154
- {
4155
- [ul4.symbols.type]()
4156
- {
4157
- return placeholdercontroltype;
4158
- }
4159
-
4160
- get placeholder()
4161
- {
4162
- let view_control = this._view_control();
4163
- if (view_control === null)
4164
- return null;
4165
- return view_control.placeholder;
4166
- }
4167
- };
4168
-
4169
- PlaceholderControl.prototype._ul4attrs = new Set([...Control.prototype._ul4attrs, "placeholder"]);
4170
-
4171
-
4172
- class NumberControlType extends PlaceholderControlType
4165
+ class NumberControlType extends ControlType
4173
4166
  {
4174
4167
  instancecheck(obj)
4175
4168
  {
@@ -4180,7 +4173,7 @@ class NumberControlType extends PlaceholderControlType
4180
4173
  let numbercontroltype = new NumberControlType("la", "NumberControl", "A LivingApps number field (type 'number')");
4181
4174
 
4182
4175
 
4183
- export class NumberControl extends PlaceholderControl
4176
+ export class NumberControl extends Control
4184
4177
  {
4185
4178
  [ul4.symbols.type]()
4186
4179
  {
@@ -4210,7 +4203,7 @@ NumberControl.prototype._ul4onattrs = [...Control.prototype._ul4onattrs, "precis
4210
4203
  NumberControl.prototype._ul4attrs = new Set([...Control.prototype._ul4attrs, "precision", "minimum", "maximum"]);
4211
4204
 
4212
4205
 
4213
- class StringControlType extends PlaceholderControlType
4206
+ class StringControlType extends ControlType
4214
4207
  {
4215
4208
  instancecheck(obj)
4216
4209
  {
@@ -4221,13 +4214,21 @@ class StringControlType extends PlaceholderControlType
4221
4214
  let stringcontroltype = new StringControlType("la", "StringControl", "A LivingApps number field (type 'string')");
4222
4215
 
4223
4216
 
4224
- export class StringControl extends PlaceholderControl
4217
+ export class StringControl extends Control
4225
4218
  {
4226
4219
  [ul4.symbols.type]()
4227
4220
  {
4228
4221
  return stringcontroltype;
4229
4222
  }
4230
4223
 
4224
+ get placeholder()
4225
+ {
4226
+ let view_control = this._view_control();
4227
+ if (view_control !== null)
4228
+ return view_control.placeholder;
4229
+ return this._placeholder;
4230
+ }
4231
+
4231
4232
  _user_placeholder(user, placeholder)
4232
4233
  {
4233
4234
  if (placeholder === null)
@@ -4336,6 +4337,7 @@ export class StringControl extends PlaceholderControl
4336
4337
  };
4337
4338
 
4338
4339
  StringControl.prototype.type = "string";
4340
+ StringControl.prototype._ul4attrs = new Set([...Control.prototype._ul4attrs, "minlength", "maxlength", "placeholder"]);
4339
4341
 
4340
4342
 
4341
4343
  class TextControlType extends StringControlType
@@ -4517,7 +4519,7 @@ HTMLControl.prototype.subtype = "html";
4517
4519
  HTMLControl.prototype.fieldtype = HTMLField;
4518
4520
 
4519
4521
 
4520
- class DateControlType extends PlaceholderControlType
4522
+ class DateControlType extends ControlType
4521
4523
  {
4522
4524
  instancecheck(obj)
4523
4525
  {
@@ -4528,7 +4530,7 @@ class DateControlType extends PlaceholderControlType
4528
4530
  let datecontroltype = new DateControlType("la", "DateControl", "A LivingApps date field (type 'date/date')");
4529
4531
 
4530
4532
 
4531
- export class DateControl extends PlaceholderControl
4533
+ export class DateControl extends Control
4532
4534
  {
4533
4535
  [ul4.symbols.type]()
4534
4536
  {