@alfresco/adf-core 8.4.0-19425303160 → 8.4.0-19430228206
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/fesm2022/adf-core.mjs +54 -3
- package/fesm2022/adf-core.mjs.map +1 -1
- package/lib/form/components/widgets/core/form-field.model.d.ts +2 -8
- package/lib/form/components/widgets/core/handlers/form-field-rule.handler.d.ts +21 -0
- package/lib/form/components/widgets/core/repeatable-section.model.d.ts +25 -0
- package/package.json +3 -3
package/fesm2022/adf-core.mjs
CHANGED
|
@@ -20518,8 +20518,56 @@ class ContainerRowModel {
|
|
|
20518
20518
|
* See the License for the specific language governing permissions and
|
|
20519
20519
|
* limitations under the License.
|
|
20520
20520
|
*/
|
|
20521
|
-
/* eslint-disable @angular-eslint/component-selector */
|
|
20522
20521
|
const ROW_ID_PREFIX = '-Row';
|
|
20522
|
+
|
|
20523
|
+
/*!
|
|
20524
|
+
* @license
|
|
20525
|
+
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
20526
|
+
*
|
|
20527
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
20528
|
+
* you may not use this file except in compliance with the License.
|
|
20529
|
+
* You may obtain a copy of the License at
|
|
20530
|
+
*
|
|
20531
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
20532
|
+
*
|
|
20533
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20534
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20535
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20536
|
+
* See the License for the specific language governing permissions and
|
|
20537
|
+
* limitations under the License.
|
|
20538
|
+
*/
|
|
20539
|
+
const getRule = (id, rule, parent) => rule && parent
|
|
20540
|
+
? {
|
|
20541
|
+
...rule,
|
|
20542
|
+
ruleOn: getRepeatableSectionChildRuleOn(id, rule.ruleOn ?? '')
|
|
20543
|
+
}
|
|
20544
|
+
: rule;
|
|
20545
|
+
const getRepeatableSectionChildRuleOn = (id, ruleOn) => ruleOn + ROW_ID_PREFIX + getRowId(id);
|
|
20546
|
+
const getRowId = (id) => {
|
|
20547
|
+
const split = id.split(ROW_ID_PREFIX);
|
|
20548
|
+
return split.length > 1 ? split[1] : '';
|
|
20549
|
+
};
|
|
20550
|
+
const formFieldRuleHandler = {
|
|
20551
|
+
getRule
|
|
20552
|
+
};
|
|
20553
|
+
|
|
20554
|
+
/*!
|
|
20555
|
+
* @license
|
|
20556
|
+
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
20557
|
+
*
|
|
20558
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
20559
|
+
* you may not use this file except in compliance with the License.
|
|
20560
|
+
* You may obtain a copy of the License at
|
|
20561
|
+
*
|
|
20562
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
20563
|
+
*
|
|
20564
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20565
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20566
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20567
|
+
* See the License for the specific language governing permissions and
|
|
20568
|
+
* limitations under the License.
|
|
20569
|
+
*/
|
|
20570
|
+
/* eslint-disable @angular-eslint/component-selector */
|
|
20523
20571
|
// Maps to FormFieldRepresentation
|
|
20524
20572
|
class FormFieldModel extends FormWidgetModel {
|
|
20525
20573
|
get value() {
|
|
@@ -20613,7 +20661,7 @@ class FormFieldModel extends FormWidgetModel {
|
|
|
20613
20661
|
this.rows = [];
|
|
20614
20662
|
if (json) {
|
|
20615
20663
|
this.fieldType = json.fieldType;
|
|
20616
|
-
this.id =
|
|
20664
|
+
this.id = this.getId(json.id, parent);
|
|
20617
20665
|
this.name = json.name;
|
|
20618
20666
|
this.type = json.type;
|
|
20619
20667
|
this.roles = json.roles;
|
|
@@ -20651,7 +20699,7 @@ class FormFieldModel extends FormWidgetModel {
|
|
|
20651
20699
|
this.tooltip = json.tooltip || '';
|
|
20652
20700
|
this.selectionType = json.selectionType;
|
|
20653
20701
|
this.alignmentType = json.alignmentType;
|
|
20654
|
-
this.rule = json.rule;
|
|
20702
|
+
this.rule = formFieldRuleHandler.getRule(this.id, json.rule, parent);
|
|
20655
20703
|
this.selectLoggedUser = json.selectLoggedUser;
|
|
20656
20704
|
this.groupsRestriction = json.groupsRestriction?.groups;
|
|
20657
20705
|
this.variableConfig = json.variableConfig;
|
|
@@ -20697,6 +20745,9 @@ class FormFieldModel extends FormWidgetModel {
|
|
|
20697
20745
|
}
|
|
20698
20746
|
return originalType === FormFieldTypes.DATETIME ? this.defaultDateTimeFormat : this.defaultDateFormat;
|
|
20699
20747
|
}
|
|
20748
|
+
getId(id, parent) {
|
|
20749
|
+
return parent ? parent.uid : id;
|
|
20750
|
+
}
|
|
20700
20751
|
isTypeaheadFieldType(type) {
|
|
20701
20752
|
return type === 'typeahead';
|
|
20702
20753
|
}
|