sf-i-reporting 1.0.112 → 1.0.113
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 +1 -1
- package/sf-i-reporting.d.ts.map +1 -1
- package/sf-i-reporting.js +67 -1
- package/sf-i-reporting.js.map +1 -1
- package/src/sf-i-reporting.ts +62 -1
package/src/sf-i-reporting.ts
CHANGED
|
@@ -2665,7 +2665,68 @@ export class SfIReporting extends LitElement {
|
|
|
2665
2665
|
checkDependencies = async (id: string) => {
|
|
2666
2666
|
console.log('checking dependencies', id)
|
|
2667
2667
|
for (let element of this.dataModel) {
|
|
2668
|
-
if (element
|
|
2668
|
+
if (isAddButtonObject(element)) {
|
|
2669
|
+
let childrenArr = element.children
|
|
2670
|
+
for (let childElementsArr of childrenArr) {
|
|
2671
|
+
for (let childElement of childElementsArr) {
|
|
2672
|
+
if (childElement.dependencies != null && childElement.dependencies.indexOf(id) >= 0) {
|
|
2673
|
+
let dependantElement = (this._SfReportingContainer as HTMLDivElement).querySelector('#' + childElement.id)
|
|
2674
|
+
console.log('dependant element', dependantElement?.tagName, dependantElement?.id, id);
|
|
2675
|
+
if (dependantElement?.tagName.toLowerCase() == "sf-i-bricks") {
|
|
2676
|
+
let dependantBricks = dependantElement as SfIBricks
|
|
2677
|
+
let selectedDependedValues = []
|
|
2678
|
+
for (let dependency of childElement.dependencies) {
|
|
2679
|
+
let dependedBricks = (this._SfReportingContainer as HTMLDivElement).querySelector('#' + dependency) as SfIBricks
|
|
2680
|
+
selectedDependedValues.push(dependedBricks.selectedValueTexts()[0])
|
|
2681
|
+
}
|
|
2682
|
+
let values = this.getBricksValues(childElement, selectedDependedValues)
|
|
2683
|
+
console.log('bricks selecteddependantvalues', selectedDependedValues, childElement.value.length, values[1], childElement.id);
|
|
2684
|
+
dependantBricks.namesjson = JSON.stringify(values[0])
|
|
2685
|
+
dependantBricks.idsjson = JSON.stringify(values[1])
|
|
2686
|
+
if (childElement.value != '' && childElement.value.length > 0) {
|
|
2687
|
+
dependantBricks.prepopulateValJson = JSON.stringify(childElement.value)
|
|
2688
|
+
} else {
|
|
2689
|
+
dependantBricks.prepopulateValJson = JSON.stringify([])
|
|
2690
|
+
}
|
|
2691
|
+
dependantBricks.loadMode()
|
|
2692
|
+
await Util.delay(500)
|
|
2693
|
+
} else if (dependantElement?.tagName.toLowerCase() == "sf-i-form") {
|
|
2694
|
+
let dependantForm = dependantElement as SfIForm
|
|
2695
|
+
if (dependantForm.mode == "select") {
|
|
2696
|
+
this.updateShortlistedSearchPhrases(dependantForm.id);
|
|
2697
|
+
dependantForm.loadMode()
|
|
2698
|
+
}
|
|
2699
|
+
} else if (dependantElement?.tagName.toLowerCase() == "sf-i-form-select") {
|
|
2700
|
+
let dependantForm = dependantElement as SfIForm
|
|
2701
|
+
if (dependantForm.mode == "select") {
|
|
2702
|
+
this.updateShortlistedSearchPhrases(dependantForm.id);
|
|
2703
|
+
dependantForm.loadMode()
|
|
2704
|
+
}
|
|
2705
|
+
} else if (dependantElement?.tagName.toLowerCase() == "sf-i-sub-select") {
|
|
2706
|
+
let dependantSubSelect = dependantElement as SfISubSelect
|
|
2707
|
+
let oldSelectedValues = dependantSubSelect.selectedValues()
|
|
2708
|
+
if (oldSelectedValues.length == 0) {
|
|
2709
|
+
let subSelectId = dependantSubSelect.id;
|
|
2710
|
+
for (let subElement of this.dataModel) {
|
|
2711
|
+
if (subElement.id == subSelectId) {
|
|
2712
|
+
oldSelectedValues = subElement.value;
|
|
2713
|
+
break;
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
let dependedSelect = (this._SfReportingContainer as HTMLDivElement).querySelector('#' + id) as SfISelect
|
|
2718
|
+
dependantSubSelect.filterId = dependedSelect.selectedValues()[0]
|
|
2719
|
+
if (dependantSubSelect.filterId != null) {
|
|
2720
|
+
dependantSubSelect.selectedId = oldSelectedValues[0]
|
|
2721
|
+
// dependantSubSelect.populateList();
|
|
2722
|
+
dependantSubSelect.loadMode();
|
|
2723
|
+
}
|
|
2724
|
+
console.log('filterid', dependantSubSelect.filterId, dependantSubSelect.selectedId, oldSelectedValues)
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
}
|
|
2728
|
+
}
|
|
2729
|
+
} else if (element.dependencies != null && element.dependencies.indexOf(id) >= 0) {
|
|
2669
2730
|
let dependantElement = (this._SfReportingContainer as HTMLDivElement).querySelector('#' + element.id)
|
|
2670
2731
|
console.log('dependant element', dependantElement?.tagName, dependantElement?.id, id);
|
|
2671
2732
|
if (dependantElement?.tagName.toLowerCase() == "sf-i-bricks") {
|