@dignite-ng/expand.dynamic-form 0.0.6 → 0.0.7
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/lib/components/dynamic/dynamic.component.mjs +17 -6
- package/esm2022/lib/components/from/ck-editor/ck-editor-control.component.mjs +1 -2
- package/esm2022/lib/components/from/date-edit/date-edit-config.mjs +1 -8
- package/esm2022/lib/components/from/file-explorer/file-explorer-config.mjs +1 -3
- package/esm2022/lib/components/from/form-control-group.mjs +1 -15
- package/esm2022/lib/components/from/numeric-edit/numberic-edit-config.mjs +1 -2
- package/esm2022/lib/components/from/select/select-config.mjs +1 -2
- package/esm2022/lib/components/from/switch/switch-config.mjs +1 -2
- package/esm2022/lib/components/from/switch/switch-control.component.mjs +5 -4
- package/esm2022/lib/components/from/text-edit/text-edit-config.mjs +2 -8
- package/esm2022/lib/components/from/text-edit/text-edit.component.mjs +2 -2
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs +22 -43
- package/fesm2022/dignite-ng-expand.dynamic-form.mjs.map +1 -1
- package/lib/components/dynamic/dynamic.component.d.ts +6 -3
- package/lib/components/from/date-edit/date-edit-config.d.ts +0 -1
- package/lib/components/from/switch/switch-control.component.d.ts +1 -1
- package/lib/components/from/text-edit/text-edit-config.d.ts +1 -0
- package/package.json +1 -1
|
@@ -34,13 +34,7 @@ import { CKEditorModule } from '@ckeditor/ckeditor5-angular';
|
|
|
34
34
|
import { pinyin } from 'pinyin-pro';
|
|
35
35
|
|
|
36
36
|
class TextEditConfig {
|
|
37
|
-
|
|
38
|
-
// // placeholder: any = new FormControl('', Validators.required);
|
|
39
|
-
// 'placeholder': any = ['', []];
|
|
40
|
-
// //字段类型,单行文本,多行文本
|
|
41
|
-
// textboxMode: any = ['simple', []];
|
|
42
|
-
// // 字数限制
|
|
43
|
-
// limit: any = ['265', []];
|
|
37
|
+
/**占位符 */
|
|
44
38
|
'TextEdit.Placeholder' = ['', []];
|
|
45
39
|
//字段类型,单行文本,多行文本
|
|
46
40
|
'TextEdit.Mode' = [0, []];
|
|
@@ -167,7 +161,7 @@ class TextEditComponent {
|
|
|
167
161
|
if (this._fields && this._entity && this._parentFiledName) {
|
|
168
162
|
this.extraProperties = this._entity.get(this._parentFiledName);
|
|
169
163
|
await this.AfterInit();
|
|
170
|
-
this.submitclick
|
|
164
|
+
this.submitclick?.nativeElement?.click();
|
|
171
165
|
}
|
|
172
166
|
}
|
|
173
167
|
AfterInit() {
|
|
@@ -210,7 +204,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
210
204
|
|
|
211
205
|
class SwitchConfig {
|
|
212
206
|
/**默认值 */
|
|
213
|
-
// placeholder: any = new FormControl('', Validators.required);
|
|
214
207
|
'Switch.Default' = [false, []];
|
|
215
208
|
constructor(data) {
|
|
216
209
|
if (data) {
|
|
@@ -307,10 +300,11 @@ class SwitchControlComponent {
|
|
|
307
300
|
this._parentFiledName = v;
|
|
308
301
|
this.dataLoaded();
|
|
309
302
|
}
|
|
310
|
-
|
|
303
|
+
/** */
|
|
311
304
|
_selected;
|
|
312
305
|
set selected(v) {
|
|
313
|
-
|
|
306
|
+
// ?v:false;
|
|
307
|
+
this._selected = v;
|
|
314
308
|
this.dataLoaded();
|
|
315
309
|
}
|
|
316
310
|
submitclick;
|
|
@@ -330,7 +324,7 @@ class SwitchControlComponent {
|
|
|
330
324
|
if (this._fields.required) {
|
|
331
325
|
ValidatorsArray.push(Validators.required);
|
|
332
326
|
}
|
|
333
|
-
let newControl = this.fb.control(this._selected ? this._selected : this._selected === false ? this._selected : this._fields.field.formConfiguration.
|
|
327
|
+
let newControl = this.fb.control(this._selected ? this._selected : this._selected === false ? this._selected : this._fields.field.formConfiguration['Switch.Default'], ValidatorsArray);
|
|
334
328
|
this.extraProperties.setControl(this._fields.field.name, newControl);
|
|
335
329
|
resolve(true);
|
|
336
330
|
});
|
|
@@ -358,7 +352,6 @@ class NumbericEditConfig {
|
|
|
358
352
|
/**占位符 */
|
|
359
353
|
'NumericEditField.Placeholder' = ['', []];
|
|
360
354
|
/**最小值 */
|
|
361
|
-
// placeholder: any = new FormControl('', Validators.required);
|
|
362
355
|
'NumericEditField.Min' = ['', []];
|
|
363
356
|
//最大值
|
|
364
357
|
'NumericEditField.Max' = ['', []];
|
|
@@ -707,7 +700,6 @@ class CkEditorControlComponent {
|
|
|
707
700
|
const currentCulture = this.config.getOne("localization")?.currentCulture?.name;
|
|
708
701
|
this.editorConfig = {
|
|
709
702
|
language: this.languagesMap[currentCulture],
|
|
710
|
-
// language: currentCulture||'en',
|
|
711
703
|
placeholder: '',
|
|
712
704
|
toolbar: {
|
|
713
705
|
removeItems: ['mediaEmbed'],
|
|
@@ -837,13 +829,6 @@ var DateEditInterfaces;
|
|
|
837
829
|
})(DateEditInterfaces || (DateEditInterfaces = {}));
|
|
838
830
|
|
|
839
831
|
class DateEditConfig {
|
|
840
|
-
/**占位符 */
|
|
841
|
-
// placeholder: any = new FormControl('', Validators.required);
|
|
842
|
-
// placeholder: any = ['', []];
|
|
843
|
-
// //字段类型,单行文本,多行文本
|
|
844
|
-
// textboxMode: any = ['simple', []];
|
|
845
|
-
// // 字数限制
|
|
846
|
-
// limit: any = ['265', []];
|
|
847
832
|
/**日期格式 */
|
|
848
833
|
'DateEdit.InputMode' = [DateEditInterfaces.Date, []];
|
|
849
834
|
/**最小值 */
|
|
@@ -1010,10 +995,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1010
995
|
|
|
1011
996
|
class FileExplorerConfig {
|
|
1012
997
|
/**文件容器名称 */
|
|
1013
|
-
// placeholder: any = new FormControl('', Validators.required);
|
|
1014
998
|
'FileExplorer.FileContainerName' = ['', []];
|
|
1015
999
|
/**多选 */
|
|
1016
|
-
// placeholder: any = new FormControl('', Validators.required);
|
|
1017
1000
|
'FileExplorer.UploadFileMultiple' = [false, []];
|
|
1018
1001
|
constructor(data) {
|
|
1019
1002
|
if (data) {
|
|
@@ -1182,7 +1165,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1182
1165
|
|
|
1183
1166
|
class SelectConfig {
|
|
1184
1167
|
/**空值文本 */
|
|
1185
|
-
// placeholder: any = new FormControl('', Validators.required);
|
|
1186
1168
|
'Select.NullText' = ['', []];
|
|
1187
1169
|
//多选
|
|
1188
1170
|
'Select.Multiple' = [false, []];
|
|
@@ -1488,20 +1470,6 @@ const FieldControlGroup = [
|
|
|
1488
1470
|
fieldComponent: DateEditControlComponent,
|
|
1489
1471
|
// fieldViewComponent:TextBoxViewComponent,
|
|
1490
1472
|
},
|
|
1491
|
-
// {
|
|
1492
|
-
// displayName: '表格',
|
|
1493
|
-
// name: 'Table',
|
|
1494
|
-
// fieldConfigComponent: TableConfigComponent,
|
|
1495
|
-
// fieldComponent: TableControlComponent,
|
|
1496
|
-
// // fieldViewComponent:TextBoxViewComponent,
|
|
1497
|
-
// },
|
|
1498
|
-
// {
|
|
1499
|
-
// displayName: '矩阵',
|
|
1500
|
-
// name: 'Matrix',
|
|
1501
|
-
// fieldConfigComponent: MatrixConfigComponent,
|
|
1502
|
-
// fieldComponent: MatrixControlComponent,
|
|
1503
|
-
// // fieldViewComponent:TextBoxViewComponent,
|
|
1504
|
-
// },
|
|
1505
1473
|
{
|
|
1506
1474
|
displayName: '文件管理',
|
|
1507
1475
|
name: 'FileExplorer',
|
|
@@ -1544,9 +1512,17 @@ class DynamicComponent {
|
|
|
1544
1512
|
/**表单实体 */
|
|
1545
1513
|
_entity;
|
|
1546
1514
|
set entity(v) {
|
|
1547
|
-
|
|
1548
|
-
|
|
1515
|
+
if (v) {
|
|
1516
|
+
this._entity = v;
|
|
1549
1517
|
this.dataLoaded(3);
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
/**语言 */
|
|
1521
|
+
_culture;
|
|
1522
|
+
set culture(v) {
|
|
1523
|
+
this._culture = v;
|
|
1524
|
+
if (v)
|
|
1525
|
+
this.dataLoaded(6);
|
|
1550
1526
|
}
|
|
1551
1527
|
/**父级字段名称,用于为表单设置控件赋值 */
|
|
1552
1528
|
_parentFiledName;
|
|
@@ -1562,9 +1538,9 @@ class DynamicComponent {
|
|
|
1562
1538
|
if (v)
|
|
1563
1539
|
this.dataLoaded(5);
|
|
1564
1540
|
}
|
|
1565
|
-
|
|
1541
|
+
/**表单控件模板-动态表单配置组件 */
|
|
1566
1542
|
FormControlRef;
|
|
1567
|
-
|
|
1543
|
+
/**表单控件模板-动态表单组件 */
|
|
1568
1544
|
FormComponentsRef;
|
|
1569
1545
|
/**表单控件组 */
|
|
1570
1546
|
_fieldControlGroup = FieldControlGroup;
|
|
@@ -1610,9 +1586,10 @@ class DynamicComponent {
|
|
|
1610
1586
|
instance.fields = this._fields;
|
|
1611
1587
|
instance.parentFiledName = this._parentFiledName;
|
|
1612
1588
|
instance.selected = this._selected;
|
|
1589
|
+
instance.culture = this._culture;
|
|
1613
1590
|
}
|
|
1614
1591
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1615
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DynamicComponent, selector: "df-dynamic", inputs: { selected: "selected", type: "type", entity: "entity", parentFiledName: "parentFiledName", fields: "fields" }, viewQueries: [{ propertyName: "FormControlRef", first: true, predicate: ["FormControlRef"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "FormComponentsRef", first: true, predicate: ["FormComponentsRef"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<template #FormControlRef></template>\n<template #FormComponentsRef></template>", styles: [""] });
|
|
1592
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DynamicComponent, selector: "df-dynamic", inputs: { selected: "selected", type: "type", entity: "entity", culture: "culture", parentFiledName: "parentFiledName", fields: "fields" }, viewQueries: [{ propertyName: "FormControlRef", first: true, predicate: ["FormControlRef"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "FormComponentsRef", first: true, predicate: ["FormComponentsRef"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<template #FormControlRef></template>\n<template #FormComponentsRef></template>", styles: [""] });
|
|
1616
1593
|
}
|
|
1617
1594
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DynamicComponent, decorators: [{
|
|
1618
1595
|
type: Component,
|
|
@@ -1623,6 +1600,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1623
1600
|
type: Input
|
|
1624
1601
|
}], entity: [{
|
|
1625
1602
|
type: Input
|
|
1603
|
+
}], culture: [{
|
|
1604
|
+
type: Input
|
|
1626
1605
|
}], parentFiledName: [{
|
|
1627
1606
|
type: Input
|
|
1628
1607
|
}], fields: [{
|