@mediusinc/mng-commons 5.2.0-rc.1 → 5.2.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/esm2022/model/descriptors/enum.descriptor.mjs +1 -1
- package/esm2022/table/api/descriptors/column.descriptor.mjs +8 -19
- package/esm2022/table/api/descriptors/table.descriptor.mjs +13 -9
- package/esm2022/table/api/helpers/table-descriptor-helpers.mjs +3 -2
- package/esm2022/tableview/api/editor/descriptors/editor.descriptor.mjs +5 -4
- package/esm2022/tableview/api/editor/descriptors/field-lookup.descriptor.mjs +2 -3
- package/esm2022/tableview/api/editor/descriptors/field.descriptor.mjs +14 -7
- package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs +21 -27
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +18 -10
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/model/descriptors/enum.descriptor.d.ts +1 -1
- package/package.json +7 -7
- package/table/api/descriptors/column.descriptor.d.ts +4 -10
- package/table/api/descriptors/table.descriptor.d.ts +2 -1
- package/tableview/api/editor/descriptors/field.descriptor.d.ts +12 -7
- package/tableview/api/tableview/helpers/tableview-default-actions.d.ts +5 -5
- package/version-info.json +6 -6
|
@@ -1872,7 +1872,7 @@ class FieldLookupEnumDescriptor extends FieldLookupDescriptor {
|
|
|
1872
1872
|
this._optionEnumValues = Array.isArray(options)
|
|
1873
1873
|
? fromEnumValuesAsValueArray(this._enumModel.type, options, this._enumModel.nameAsValue, this._enumModel.i18nBaseKey ?? undefined)
|
|
1874
1874
|
: fromEnumConstantsAsValueArray(this._enumModel.type, this._enumModel.nameAsValue, this._enumModel.i18nBaseKey ?? undefined);
|
|
1875
|
-
this.withLookup(() =>
|
|
1875
|
+
this.withLookup(() => this._optionEnumValues);
|
|
1876
1876
|
this.withOptionsLabelProperty('title', this._enumModel.i18nBaseKey !== null);
|
|
1877
1877
|
this.withOptionsDisabledProperty('disabled');
|
|
1878
1878
|
}
|
|
@@ -2297,12 +2297,8 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
2297
2297
|
}
|
|
2298
2298
|
asDatePicker(opts) {
|
|
2299
2299
|
this._fieldType = FieldInputTypeEnum.Datepicker;
|
|
2300
|
-
this.
|
|
2301
|
-
this.
|
|
2302
|
-
this._datePickerMax = opts?.max;
|
|
2303
|
-
this._datePickerShowTime = opts?.showTime;
|
|
2304
|
-
this._datePickerShowSeconds = opts?.showSeconds;
|
|
2305
|
-
this._datePickerValueAsDateObj = opts?.asDateObj;
|
|
2300
|
+
this.withDateValidation(opts);
|
|
2301
|
+
this.withDatePickerDisplay(opts);
|
|
2306
2302
|
this.withDateValue({
|
|
2307
2303
|
asDateObj: opts?.asDateObj,
|
|
2308
2304
|
utc: opts?.utc,
|
|
@@ -2369,6 +2365,17 @@ class FieldInputDescriptor extends AFieldDescriptor {
|
|
|
2369
2365
|
this._pattern = opts?.pattern;
|
|
2370
2366
|
return this;
|
|
2371
2367
|
}
|
|
2368
|
+
withDatePickerDisplay(opts) {
|
|
2369
|
+
this._datePickerFormat = opts?.format;
|
|
2370
|
+
this._datePickerShowTime = opts?.showTime;
|
|
2371
|
+
this._datePickerShowSeconds = opts?.showSeconds;
|
|
2372
|
+
return this;
|
|
2373
|
+
}
|
|
2374
|
+
withDateValidation(opts) {
|
|
2375
|
+
this._datePickerMin = opts?.min;
|
|
2376
|
+
this._datePickerMax = opts?.max;
|
|
2377
|
+
return this;
|
|
2378
|
+
}
|
|
2372
2379
|
withInputTrim(trimOption = 'both') {
|
|
2373
2380
|
this._inputTrim = trimOption;
|
|
2374
2381
|
return this;
|
|
@@ -2567,6 +2574,9 @@ class EditorDescriptorInst {
|
|
|
2567
2574
|
* @param field Field descriptor.
|
|
2568
2575
|
*/
|
|
2569
2576
|
addFieldDescriptor(field) {
|
|
2577
|
+
if (this._fields.some(f => f.property === field.property)) {
|
|
2578
|
+
throw new CommonsInternalError(`Field '${field.property}' already exists.`);
|
|
2579
|
+
}
|
|
2570
2580
|
this.createDefaultGroup();
|
|
2571
2581
|
this._fields.push(field);
|
|
2572
2582
|
this._currentGroup?.addField(field);
|
|
@@ -2577,9 +2587,7 @@ class EditorDescriptorInst {
|
|
|
2577
2587
|
* @param property Model property name.
|
|
2578
2588
|
*/
|
|
2579
2589
|
addField(property) {
|
|
2580
|
-
|
|
2581
|
-
this.addFieldDescriptor(field);
|
|
2582
|
-
return field;
|
|
2590
|
+
return this.addFieldUnsafe(property);
|
|
2583
2591
|
}
|
|
2584
2592
|
/**
|
|
2585
2593
|
* Adds field by the model property name (UNSAFE). Property is not checked on editor model.
|