cps-ui-kit 0.97.0 → 0.99.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/esm2020/lib/base_components/base-tree-dropdown.component.mjs +21 -6
- package/fesm2015/cps-ui-kit.mjs +20 -5
- package/fesm2015/cps-ui-kit.mjs.map +1 -1
- package/fesm2020/cps-ui-kit.mjs +20 -5
- package/fesm2020/cps-ui-kit.mjs.map +1 -1
- package/lib/base_components/base-tree-dropdown.component.d.ts +4 -2
- package/package.json +1 -1
package/fesm2020/cps-ui-kit.mjs
CHANGED
|
@@ -1863,6 +1863,8 @@ class BaseTreeDropdownComponent {
|
|
|
1863
1863
|
this.infoTooltipMaxWidth = '100%';
|
|
1864
1864
|
this.infoTooltipPersistent = false;
|
|
1865
1865
|
this.infoTooltipPosition = 'top';
|
|
1866
|
+
this.initialExpandDirectories = false;
|
|
1867
|
+
this.initialExpandAll = false;
|
|
1866
1868
|
this._value = undefined;
|
|
1867
1869
|
this.valueChanged = new EventEmitter();
|
|
1868
1870
|
this._statusChangesSubscription = new Subscription();
|
|
@@ -1949,11 +1951,14 @@ class BaseTreeDropdownComponent {
|
|
|
1949
1951
|
registerOnTouched(fn) {
|
|
1950
1952
|
this.onTouched = fn;
|
|
1951
1953
|
}
|
|
1952
|
-
writeValue(value) {
|
|
1954
|
+
writeValue(value, internal = false) {
|
|
1953
1955
|
this.value = value;
|
|
1956
|
+
if (!internal && value !== null) {
|
|
1957
|
+
this.treeSelection = this._valueToTreeSelection(this.value);
|
|
1958
|
+
}
|
|
1954
1959
|
}
|
|
1955
1960
|
updateValue(value) {
|
|
1956
|
-
this.writeValue(value);
|
|
1961
|
+
this.writeValue(value, true);
|
|
1957
1962
|
this.onChange(value);
|
|
1958
1963
|
this.valueChanged.emit(value);
|
|
1959
1964
|
}
|
|
@@ -2139,7 +2144,7 @@ class BaseTreeDropdownComponent {
|
|
|
2139
2144
|
});
|
|
2140
2145
|
}
|
|
2141
2146
|
_toInnerOptions(_options) {
|
|
2142
|
-
|
|
2147
|
+
const mapOption = (o, optionLabel, optionInfo, key, originalOptionsMap) => {
|
|
2143
2148
|
const inner = {
|
|
2144
2149
|
inner: true,
|
|
2145
2150
|
label: o[optionLabel],
|
|
@@ -2147,10 +2152,16 @@ class BaseTreeDropdownComponent {
|
|
|
2147
2152
|
key,
|
|
2148
2153
|
styleClass: 'key-' + key
|
|
2149
2154
|
};
|
|
2155
|
+
if (this.initialExpandAll) {
|
|
2156
|
+
inner.expanded = true;
|
|
2157
|
+
}
|
|
2150
2158
|
if (o.isDirectory) {
|
|
2151
2159
|
inner.type = 'directory';
|
|
2152
2160
|
inner.selectable = false;
|
|
2153
2161
|
inner.styleClass += ' cps-tree-node-fully-expandable';
|
|
2162
|
+
if (this.initialExpandDirectories) {
|
|
2163
|
+
inner.expanded = true;
|
|
2164
|
+
}
|
|
2154
2165
|
}
|
|
2155
2166
|
if (o.children) {
|
|
2156
2167
|
inner.children = o.children.map((c, index) => {
|
|
@@ -2159,7 +2170,7 @@ class BaseTreeDropdownComponent {
|
|
|
2159
2170
|
}
|
|
2160
2171
|
originalOptionsMap.set(key, o);
|
|
2161
2172
|
return inner;
|
|
2162
|
-
}
|
|
2173
|
+
};
|
|
2163
2174
|
const res = _options.map((option, index) => {
|
|
2164
2175
|
return mapOption(option, this.optionLabel, this.optionInfo, '' + index, this.originalOptionsMap);
|
|
2165
2176
|
});
|
|
@@ -2220,7 +2231,7 @@ class BaseTreeDropdownComponent {
|
|
|
2220
2231
|
}
|
|
2221
2232
|
}
|
|
2222
2233
|
BaseTreeDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseTreeDropdownComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2223
|
-
BaseTreeDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: BaseTreeDropdownComponent, selector: "ng-component", inputs: { label: "label", placeholder: "placeholder", hint: "hint", multiple: "multiple", disabled: "disabled", width: "width", chips: "chips", closableChips: "closableChips", clearable: "clearable", openOnClear: "openOnClear", optionLabel: "optionLabel", optionInfo: "optionInfo", hideDetails: "hideDetails", persistentClear: "persistentClear", prefixIcon: "prefixIcon", prefixIconSize: "prefixIconSize", loading: "loading", virtualScroll: "virtualScroll", infoTooltip: "infoTooltip", infoTooltipClass: "infoTooltipClass", infoTooltipMaxWidth: "infoTooltipMaxWidth", infoTooltipPersistent: "infoTooltipPersistent", infoTooltipPosition: "infoTooltipPosition", options: "options", _value: ["value", "_value"] }, outputs: { valueChanged: "valueChanged" }, viewQueries: [{ propertyName: "componentContainer", first: true, predicate: ["componentContainer"], descendants: true }, { propertyName: "optionsMenu", first: true, predicate: ["optionsMenu"], descendants: true }, { propertyName: "treeList", first: true, predicate: ["treeList"], descendants: true }, { propertyName: "boxEl", first: true, predicate: ["boxEl"], descendants: true }], ngImport: i0, template: '', isInline: true });
|
|
2234
|
+
BaseTreeDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: BaseTreeDropdownComponent, selector: "ng-component", inputs: { label: "label", placeholder: "placeholder", hint: "hint", multiple: "multiple", disabled: "disabled", width: "width", chips: "chips", closableChips: "closableChips", clearable: "clearable", openOnClear: "openOnClear", optionLabel: "optionLabel", optionInfo: "optionInfo", hideDetails: "hideDetails", persistentClear: "persistentClear", prefixIcon: "prefixIcon", prefixIconSize: "prefixIconSize", loading: "loading", virtualScroll: "virtualScroll", infoTooltip: "infoTooltip", infoTooltipClass: "infoTooltipClass", infoTooltipMaxWidth: "infoTooltipMaxWidth", infoTooltipPersistent: "infoTooltipPersistent", infoTooltipPosition: "infoTooltipPosition", initialExpandDirectories: "initialExpandDirectories", initialExpandAll: "initialExpandAll", options: "options", _value: ["value", "_value"] }, outputs: { valueChanged: "valueChanged" }, viewQueries: [{ propertyName: "componentContainer", first: true, predicate: ["componentContainer"], descendants: true }, { propertyName: "optionsMenu", first: true, predicate: ["optionsMenu"], descendants: true }, { propertyName: "treeList", first: true, predicate: ["treeList"], descendants: true }, { propertyName: "boxEl", first: true, predicate: ["boxEl"], descendants: true }], ngImport: i0, template: '', isInline: true });
|
|
2224
2235
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseTreeDropdownComponent, decorators: [{
|
|
2225
2236
|
type: Component,
|
|
2226
2237
|
args: [{
|
|
@@ -2276,6 +2287,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2276
2287
|
type: Input
|
|
2277
2288
|
}], infoTooltipPosition: [{
|
|
2278
2289
|
type: Input
|
|
2290
|
+
}], initialExpandDirectories: [{
|
|
2291
|
+
type: Input
|
|
2292
|
+
}], initialExpandAll: [{
|
|
2293
|
+
type: Input
|
|
2279
2294
|
}], options: [{
|
|
2280
2295
|
type: Input
|
|
2281
2296
|
}], _value: [{
|