@quadrel-enterprise-ui/framework 21.8.1 → 21.9.0-beta.337.1
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/quadrel-enterprise-ui-framework.mjs +1096 -747
- package/fesm2022/quadrel-enterprise-ui-framework.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assets/i18n/de.json +2 -0
- package/src/assets/i18n/en.json +2 -0
- package/src/assets/i18n/fr.json +2 -0
- package/src/assets/i18n/it.json +5 -3
- package/types/quadrel-enterprise-ui-framework.d.ts +71 -9
|
@@ -7902,106 +7902,541 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
7902
7902
|
type: Input
|
|
7903
7903
|
}] } });
|
|
7904
7904
|
|
|
7905
|
-
const MAX_TOOLTIP_CHARACTER = 512;
|
|
7906
|
-
const TOOLTIP_POSITIONS = [
|
|
7907
|
-
{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom' },
|
|
7908
|
-
{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top' },
|
|
7909
|
-
{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center' },
|
|
7910
|
-
{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center' }
|
|
7911
|
-
];
|
|
7912
7905
|
/**
|
|
7913
|
-
*
|
|
7914
|
-
* element and renders {@link QdTooltipContent}.
|
|
7906
|
+
* Compares two values by their content instead of by reference.
|
|
7915
7907
|
*
|
|
7916
|
-
*
|
|
7917
|
-
*
|
|
7908
|
+
* This is the one place in the framework that answers "did this change?" for the
|
|
7909
|
+
* value shapes it deals with: component configurations, form values and lists of
|
|
7910
|
+
* options. A wrong answer here is silent, so the helper errs on the side of
|
|
7911
|
+
* reporting a change.
|
|
7912
|
+
*
|
|
7913
|
+
* #### Features:
|
|
7914
|
+
*
|
|
7915
|
+
* - Walks arrays, plain objects, `Map`, `Set`, `Date`, `RegExp`, errors, typed
|
|
7916
|
+
* arrays, buffers and boxed primitives.
|
|
7917
|
+
* - Treats `NaN` as equal to `NaN` and `0` as equal to `-0`, so two invalid dates
|
|
7918
|
+
* count as equal.
|
|
7919
|
+
* - Reads types and values through internal slots, so an object cannot disguise
|
|
7920
|
+
* itself with `Symbol.toStringTag` or a custom `valueOf`.
|
|
7921
|
+
* - Requires the same prototype on both sides, which keeps instances of different
|
|
7922
|
+
* classes apart even when their fields match.
|
|
7923
|
+
* - Compares own enumerable properties on every value, including the extra ones
|
|
7924
|
+
* attached to a `Date`, a `Map` or an array.
|
|
7925
|
+
* - Matches `Map` and `Set` members independently of insertion order, and never
|
|
7926
|
+
* reports a difference that only a matching order would explain.
|
|
7927
|
+
* - Survives cyclic and shared structures, and tells cycles of different lengths
|
|
7928
|
+
* apart.
|
|
7929
|
+
*
|
|
7930
|
+
* #### Notes & Best Practices:
|
|
7931
|
+
*
|
|
7932
|
+
* - A missing key and a key holding `undefined` count as different, as do an
|
|
7933
|
+
* array hole and an explicit `undefined`.
|
|
7934
|
+
* - Non-enumerable properties and getters on the prototype chain are ignored, so
|
|
7935
|
+
* two errors with the same name and message stay equal despite different stacks.
|
|
7936
|
+
* - `WeakMap` and `WeakSet` have no readable content and are only equal to
|
|
7937
|
+
* themselves.
|
|
7938
|
+
* - Structures deeper than 1200 levels report a difference instead of exhausting
|
|
7939
|
+
* the call stack.
|
|
7918
7940
|
*/
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7941
|
+
const qdIsDeepEqual = (left, right) => compare(left, right, {
|
|
7942
|
+
positions: new Map(),
|
|
7943
|
+
partners: new Map(),
|
|
7944
|
+
results: new Map(),
|
|
7945
|
+
assumptions: 0,
|
|
7946
|
+
depth: 0,
|
|
7947
|
+
nextPosition: 0
|
|
7948
|
+
});
|
|
7949
|
+
const MAX_DEPTH = 1200;
|
|
7950
|
+
const getterOf = (target, key) => Object.getOwnPropertyDescriptor(target, key)?.get;
|
|
7951
|
+
const TYPED_ARRAY_PROTOTYPE = Object.getPrototypeOf(Int8Array.prototype);
|
|
7952
|
+
const readMapSize = getterOf(Map.prototype, 'size');
|
|
7953
|
+
const readSetSize = getterOf(Set.prototype, 'size');
|
|
7954
|
+
const readRegExpSource = getterOf(RegExp.prototype, 'source');
|
|
7955
|
+
const readBufferLength = getterOf(ArrayBuffer.prototype, 'byteLength');
|
|
7956
|
+
const readSharedLength = getterOf(typeof SharedArrayBuffer === 'undefined' ? ArrayBuffer.prototype : SharedArrayBuffer.prototype, 'byteLength');
|
|
7957
|
+
const readViewLength = getterOf(DataView.prototype, 'byteLength');
|
|
7958
|
+
const readViewOffset = getterOf(DataView.prototype, 'byteOffset');
|
|
7959
|
+
const readTypedLength = getterOf(TYPED_ARRAY_PROTOTYPE, 'length');
|
|
7960
|
+
const REGEXP_FLAG_GETTERS = ['dotAll', 'global', 'hasIndices', 'ignoreCase', 'multiline', 'sticky', 'unicode', 'unicodeSets']
|
|
7961
|
+
.filter(flag => flag in RegExp.prototype)
|
|
7962
|
+
.map(flag => getterOf(RegExp.prototype, flag));
|
|
7963
|
+
const readNumberValue = Number.prototype.valueOf;
|
|
7964
|
+
const readStringValue = String.prototype.valueOf;
|
|
7965
|
+
const readBooleanValue = Boolean.prototype.valueOf;
|
|
7966
|
+
const readSymbolValue = Symbol.prototype.valueOf;
|
|
7967
|
+
const readBigIntValue = BigInt.prototype.valueOf;
|
|
7968
|
+
const readDateValue = Date.prototype.getTime;
|
|
7969
|
+
const survives = (probe) => {
|
|
7970
|
+
try {
|
|
7971
|
+
probe();
|
|
7972
|
+
return true;
|
|
7938
7973
|
}
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
*/
|
|
7942
|
-
show() {
|
|
7943
|
-
const positionStrategy = this.overlay
|
|
7944
|
-
.position()
|
|
7945
|
-
.flexibleConnectedTo(this.elementRef)
|
|
7946
|
-
.withFlexibleDimensions(false)
|
|
7947
|
-
.withPush(false)
|
|
7948
|
-
.withPositions(TOOLTIP_POSITIONS);
|
|
7949
|
-
this._overlayRef = this.overlay.create({
|
|
7950
|
-
positionStrategy,
|
|
7951
|
-
scrollStrategy: this.overlay.scrollStrategies.reposition()
|
|
7952
|
-
});
|
|
7953
|
-
const tooltipRef = this._overlayRef.attach(new ComponentPortal(QdTooltipComponent));
|
|
7954
|
-
tooltipRef.instance.content = this.getContent();
|
|
7974
|
+
catch {
|
|
7975
|
+
return false;
|
|
7955
7976
|
}
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7977
|
+
};
|
|
7978
|
+
const callable = (reader, value) => survives(() => reader.call(value));
|
|
7979
|
+
const isSameValueZero = (left, right) => left === right || (left !== left && right !== right);
|
|
7980
|
+
const hasErrorAncestor = (value) => {
|
|
7981
|
+
let current = Object.getPrototypeOf(value);
|
|
7982
|
+
while (current !== null) {
|
|
7983
|
+
if (current === Error.prototype)
|
|
7984
|
+
return true;
|
|
7985
|
+
current = Object.getPrototypeOf(current);
|
|
7964
7986
|
}
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7987
|
+
return false;
|
|
7988
|
+
};
|
|
7989
|
+
const probedKind = (value) => {
|
|
7990
|
+
if (callable(readMapSize, value))
|
|
7991
|
+
return 'map';
|
|
7992
|
+
if (callable(readSetSize, value))
|
|
7993
|
+
return 'set';
|
|
7994
|
+
if (survives(() => readDateValue.call(value)))
|
|
7995
|
+
return 'date';
|
|
7996
|
+
if (callable(readRegExpSource, value))
|
|
7997
|
+
return 'regExp';
|
|
7998
|
+
if (callable(readBufferLength, value) || callable(readSharedLength, value))
|
|
7999
|
+
return 'arrayBuffer';
|
|
8000
|
+
if (survives(() => readNumberValue.call(value)))
|
|
8001
|
+
return 'boxedNumber';
|
|
8002
|
+
if (survives(() => readStringValue.call(value)))
|
|
8003
|
+
return 'boxedString';
|
|
8004
|
+
if (survives(() => readBooleanValue.call(value)))
|
|
8005
|
+
return 'boxedBoolean';
|
|
8006
|
+
if (survives(() => readSymbolValue.call(value)))
|
|
8007
|
+
return 'boxedSymbol';
|
|
8008
|
+
if (survives(() => readBigIntValue.call(value)))
|
|
8009
|
+
return 'boxedBigInt';
|
|
8010
|
+
return undefined;
|
|
8011
|
+
};
|
|
8012
|
+
const isWeakCollection = (value) => survives(() => WeakMap.prototype.has.call(value, Object.prototype)) ||
|
|
8013
|
+
survives(() => WeakSet.prototype.has.call(value, Object.prototype));
|
|
8014
|
+
const readUrlHref = getterOf(URL.prototype, 'href');
|
|
8015
|
+
const prototypeOfMaybe = (holder) => {
|
|
8016
|
+
if (typeof holder !== 'function')
|
|
8017
|
+
return undefined;
|
|
8018
|
+
const prototype = holder.prototype;
|
|
8019
|
+
return typeof prototype === 'object' && prototype !== null ? prototype : undefined;
|
|
8020
|
+
};
|
|
8021
|
+
const OPAQUE_PROTOTYPES = [
|
|
8022
|
+
typeof Promise === 'undefined' ? undefined : Promise,
|
|
8023
|
+
typeof WeakRef === 'undefined' ? undefined : WeakRef,
|
|
8024
|
+
typeof URLSearchParams === 'undefined' ? undefined : URLSearchParams,
|
|
8025
|
+
typeof Intl === 'undefined' ? undefined : Intl.NumberFormat,
|
|
8026
|
+
typeof Intl === 'undefined' ? undefined : Intl.DateTimeFormat,
|
|
8027
|
+
typeof Intl === 'undefined' ? undefined : Intl.Collator
|
|
8028
|
+
]
|
|
8029
|
+
.map(prototypeOfMaybe)
|
|
8030
|
+
.filter((prototype) => prototype !== undefined);
|
|
8031
|
+
const inheritsFromAny = (value, prototypes) => {
|
|
8032
|
+
let current = Object.getPrototypeOf(value);
|
|
8033
|
+
while (current !== null) {
|
|
8034
|
+
if (prototypes.includes(current))
|
|
8035
|
+
return true;
|
|
8036
|
+
current = Object.getPrototypeOf(current);
|
|
7990
8037
|
}
|
|
7991
|
-
|
|
7992
|
-
|
|
8038
|
+
return false;
|
|
8039
|
+
};
|
|
8040
|
+
const hidesStateBehindSlots = (value) => {
|
|
8041
|
+
if (inheritsFromAny(value, OPAQUE_PROTOTYPES))
|
|
8042
|
+
return true;
|
|
8043
|
+
const prototype = Object.getPrototypeOf(value);
|
|
8044
|
+
if (prototype === null || prototype === Object.prototype)
|
|
8045
|
+
return false;
|
|
8046
|
+
if (!(Symbol.toStringTag in prototype))
|
|
8047
|
+
return false;
|
|
8048
|
+
return ownEnumerableKeys(value).length === 0;
|
|
8049
|
+
};
|
|
8050
|
+
const kindOf = (value) => {
|
|
8051
|
+
if (Array.isArray(value))
|
|
8052
|
+
return 'array';
|
|
8053
|
+
if (ArrayBuffer.isView(value))
|
|
8054
|
+
return callable(readViewLength, value) ? 'dataView' : 'typedArray';
|
|
8055
|
+
const probed = probedKind(value);
|
|
8056
|
+
if (probed !== undefined)
|
|
8057
|
+
return probed;
|
|
8058
|
+
if (callable(readUrlHref, value))
|
|
8059
|
+
return 'url';
|
|
8060
|
+
if (isWeakCollection(value))
|
|
8061
|
+
return 'opaque';
|
|
8062
|
+
if (hasErrorAncestor(value))
|
|
8063
|
+
return 'error';
|
|
8064
|
+
if (hidesStateBehindSlots(value))
|
|
8065
|
+
return 'opaque';
|
|
8066
|
+
return 'plain';
|
|
8067
|
+
};
|
|
8068
|
+
const ownEnumerableKeys = (value) => [
|
|
8069
|
+
...Object.keys(value),
|
|
8070
|
+
...Object.getOwnPropertySymbols(value).filter(symbol => Object.prototype.propertyIsEnumerable.call(value, symbol))
|
|
8071
|
+
];
|
|
8072
|
+
const readKey = (value, key) => value[key];
|
|
8073
|
+
const compareOwnKeys = (left, right, state, skipIndices) => {
|
|
8074
|
+
const isIndex = (key) => typeof key === 'string' && /^(0|[1-9]\d*)$/.test(key);
|
|
8075
|
+
const leftKeys = ownEnumerableKeys(left).filter(key => !skipIndices || !isIndex(key));
|
|
8076
|
+
const rightKeys = ownEnumerableKeys(right).filter(key => !skipIndices || !isIndex(key));
|
|
8077
|
+
if (leftKeys.length !== rightKeys.length)
|
|
8078
|
+
return false;
|
|
8079
|
+
for (const key of leftKeys) {
|
|
8080
|
+
if (!Object.prototype.propertyIsEnumerable.call(right, key))
|
|
8081
|
+
return false;
|
|
8082
|
+
if (!compare(readKey(left, key), readKey(right, key), state))
|
|
8083
|
+
return false;
|
|
7993
8084
|
}
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8085
|
+
return true;
|
|
8086
|
+
};
|
|
8087
|
+
const compareDates = (left, right) => {
|
|
8088
|
+
const leftTime = Date.prototype.getTime.call(left);
|
|
8089
|
+
const rightTime = Date.prototype.getTime.call(right);
|
|
8090
|
+
return isSameValueZero(leftTime, rightTime);
|
|
8091
|
+
};
|
|
8092
|
+
const compareRegExps = (left, right) => {
|
|
8093
|
+
if (readRegExpSource.call(left) !== readRegExpSource.call(right))
|
|
8094
|
+
return false;
|
|
8095
|
+
return REGEXP_FLAG_GETTERS.every(reader => reader.call(left) === reader.call(right));
|
|
8096
|
+
};
|
|
8097
|
+
const byteLengthOf = (value) => {
|
|
8098
|
+
if (callable(readBufferLength, value))
|
|
8099
|
+
return readBufferLength.call(value);
|
|
8100
|
+
if (callable(readSharedLength, value))
|
|
8101
|
+
return readSharedLength.call(value);
|
|
8102
|
+
return -1;
|
|
8103
|
+
};
|
|
8104
|
+
const bytesOf = (buffer, offset, length) => {
|
|
8105
|
+
try {
|
|
8106
|
+
return new Uint8Array(buffer, offset, length);
|
|
8107
|
+
}
|
|
8108
|
+
catch {
|
|
8109
|
+
return undefined;
|
|
8110
|
+
}
|
|
8111
|
+
};
|
|
8112
|
+
const sameBytes = (left, right) => {
|
|
8113
|
+
if (left === undefined || right === undefined)
|
|
8114
|
+
return left === right;
|
|
8115
|
+
return left.every((byte, index) => byte === right[index]);
|
|
8116
|
+
};
|
|
8117
|
+
const compareArrayBuffers = (left, right) => {
|
|
8118
|
+
const leftLength = byteLengthOf(left);
|
|
8119
|
+
const rightLength = byteLengthOf(right);
|
|
8120
|
+
if (leftLength !== rightLength)
|
|
8121
|
+
return false;
|
|
8122
|
+
return sameBytes(bytesOf(left, 0, leftLength), bytesOf(right, 0, rightLength));
|
|
8123
|
+
};
|
|
8124
|
+
const compareDataViews = (left, right) => {
|
|
8125
|
+
const leftLength = readViewLength.call(left);
|
|
8126
|
+
if (leftLength !== readViewLength.call(right))
|
|
8127
|
+
return false;
|
|
8128
|
+
const leftView = left;
|
|
8129
|
+
const rightView = right;
|
|
8130
|
+
return sameBytes(bytesOf(leftView.buffer, readViewOffset.call(left), leftLength), bytesOf(rightView.buffer, readViewOffset.call(right), leftLength));
|
|
8131
|
+
};
|
|
8132
|
+
const compareTypedArrays = (left, right) => {
|
|
8133
|
+
const length = readTypedLength.call(left);
|
|
8134
|
+
if (length !== readTypedLength.call(right))
|
|
8135
|
+
return false;
|
|
8136
|
+
const leftView = left;
|
|
8137
|
+
const rightView = right;
|
|
8138
|
+
return Array.prototype.every.call(leftView, (entry, index) => isSameValueZero(entry, rightView[index]));
|
|
8139
|
+
};
|
|
8140
|
+
const compareErrors = (left, right, state) => {
|
|
8141
|
+
const leftError = left;
|
|
8142
|
+
const rightError = right;
|
|
8143
|
+
if (leftError.name !== rightError.name)
|
|
8144
|
+
return false;
|
|
8145
|
+
if (leftError.message !== rightError.message)
|
|
8146
|
+
return false;
|
|
8147
|
+
return compare(leftError.cause, rightError.cause, state);
|
|
8148
|
+
};
|
|
8149
|
+
const compareArrays = (left, right, state) => {
|
|
8150
|
+
const leftArray = left;
|
|
8151
|
+
const rightArray = right;
|
|
8152
|
+
if (leftArray.length !== rightArray.length)
|
|
8153
|
+
return false;
|
|
8154
|
+
for (let index = 0; index !== leftArray.length; index++) {
|
|
8155
|
+
const inLeft = Object.prototype.hasOwnProperty.call(leftArray, index);
|
|
8156
|
+
if (inLeft !== Object.prototype.hasOwnProperty.call(rightArray, index))
|
|
8157
|
+
return false;
|
|
8158
|
+
if (inLeft && !compare(leftArray[index], rightArray[index], state))
|
|
8159
|
+
return false;
|
|
8160
|
+
}
|
|
8161
|
+
return true;
|
|
8162
|
+
};
|
|
8163
|
+
const matchesAll = (leftItems, rightItems, isPair) => {
|
|
8164
|
+
const assigned = new Array(rightItems.length).fill(-1);
|
|
8165
|
+
const augment = (leftIndex, visited) => {
|
|
8166
|
+
for (let rightIndex = 0; rightIndex !== rightItems.length; rightIndex++) {
|
|
8167
|
+
if (visited[rightIndex] || !isPair(leftIndex, rightIndex))
|
|
8168
|
+
continue;
|
|
8169
|
+
visited[rightIndex] = true;
|
|
8170
|
+
if (assigned[rightIndex] === -1 || augment(assigned[rightIndex], visited)) {
|
|
8171
|
+
assigned[rightIndex] = leftIndex;
|
|
8172
|
+
return true;
|
|
8173
|
+
}
|
|
8174
|
+
}
|
|
8175
|
+
return false;
|
|
8176
|
+
};
|
|
8177
|
+
return leftItems.every((_, leftIndex) => augment(leftIndex, new Array(rightItems.length).fill(false)));
|
|
8178
|
+
};
|
|
8179
|
+
const pairMatcher = (leftItems, rightItems, state, matches) => {
|
|
8180
|
+
const cache = new Map();
|
|
8181
|
+
return matchesAll(leftItems, rightItems, (leftIndex, rightIndex) => {
|
|
8182
|
+
const slot = `${leftIndex}:${rightIndex}`;
|
|
8183
|
+
const known = cache.get(slot);
|
|
8184
|
+
if (known !== undefined)
|
|
8185
|
+
return known;
|
|
8186
|
+
const verdict = matches(leftItems[leftIndex], rightItems[rightIndex]);
|
|
8187
|
+
cache.set(slot, verdict);
|
|
8188
|
+
return verdict;
|
|
8189
|
+
});
|
|
8190
|
+
};
|
|
8191
|
+
const setEntriesOf = (value) => {
|
|
8192
|
+
const entries = [];
|
|
8193
|
+
Set.prototype.forEach.call(value, entry => entries.push(entry));
|
|
8194
|
+
return entries;
|
|
8195
|
+
};
|
|
8196
|
+
const mapEntriesOf = (value) => {
|
|
8197
|
+
const entries = [];
|
|
8198
|
+
Map.prototype.forEach.call(value, (entryValue, entryKey) => entries.push([entryKey, entryValue]));
|
|
8199
|
+
return entries;
|
|
8200
|
+
};
|
|
8201
|
+
const compareSets = (left, right, state) => {
|
|
8202
|
+
if (readSetSize.call(left) !== readSetSize.call(right))
|
|
8203
|
+
return false;
|
|
8204
|
+
const rightHas = (entry) => Set.prototype.has.call(right, entry);
|
|
8205
|
+
const leftRest = [];
|
|
8206
|
+
const matchedInRight = new Set();
|
|
8207
|
+
for (const entry of setEntriesOf(left)) {
|
|
8208
|
+
if (rightHas(entry)) {
|
|
8209
|
+
matchedInRight.add(entry);
|
|
8210
|
+
continue;
|
|
8211
|
+
}
|
|
8212
|
+
leftRest.push(entry);
|
|
8213
|
+
}
|
|
8214
|
+
if (leftRest.length === 0)
|
|
8215
|
+
return true;
|
|
8216
|
+
const rightRest = setEntriesOf(right).filter(entry => !matchedInRight.has(entry));
|
|
8217
|
+
return pairMatcher(leftRest, rightRest, state, (leftEntry, rightEntry) => compare(leftEntry, rightEntry, state));
|
|
8218
|
+
};
|
|
8219
|
+
const splitMapEntries = (left, rightMap, state) => {
|
|
8220
|
+
const rest = [];
|
|
8221
|
+
const matched = new Set();
|
|
8222
|
+
for (const entry of mapEntriesOf(left)) {
|
|
8223
|
+
const [key, value] = entry;
|
|
8224
|
+
const foundByIdentity = Map.prototype.has.call(rightMap, key) && compare(value, Map.prototype.get.call(rightMap, key), state);
|
|
8225
|
+
if (foundByIdentity) {
|
|
8226
|
+
matched.add(key);
|
|
8227
|
+
continue;
|
|
8228
|
+
}
|
|
8229
|
+
rest.push(entry);
|
|
8230
|
+
}
|
|
8231
|
+
return { rest, matched };
|
|
8232
|
+
};
|
|
8233
|
+
const compareMaps = (left, right, state) => {
|
|
8234
|
+
if (readMapSize.call(left) !== readMapSize.call(right))
|
|
8235
|
+
return false;
|
|
8236
|
+
const rightMap = right;
|
|
8237
|
+
const { rest: leftRest, matched: matchedKeys } = splitMapEntries(left, rightMap, state);
|
|
8238
|
+
if (leftRest.length === 0)
|
|
8239
|
+
return true;
|
|
8240
|
+
const rightRest = mapEntriesOf(right).filter(([key]) => !matchedKeys.has(key));
|
|
8241
|
+
return pairMatcher(leftRest, rightRest, state, (leftEntry, rightEntry) => compare(leftEntry[0], rightEntry[0], state) &&
|
|
8242
|
+
compare(leftEntry[1], rightEntry[1], state));
|
|
8243
|
+
};
|
|
8244
|
+
const compareUrls = (left, right) => {
|
|
8245
|
+
return readUrlHref.call(left) === readUrlHref.call(right);
|
|
8246
|
+
};
|
|
8247
|
+
const CONTENT_COMPARATORS = {
|
|
8248
|
+
array: compareArrays,
|
|
8249
|
+
arrayBuffer: compareArrayBuffers,
|
|
8250
|
+
boxedBigInt: (left, right) => readBigIntValue.call(left) === readBigIntValue.call(right),
|
|
8251
|
+
boxedBoolean: (left, right) => readBooleanValue.call(left) === readBooleanValue.call(right),
|
|
8252
|
+
boxedNumber: (left, right) => isSameValueZero(readNumberValue.call(left), readNumberValue.call(right)),
|
|
8253
|
+
boxedString: (left, right) => readStringValue.call(left) === readStringValue.call(right),
|
|
8254
|
+
boxedSymbol: (left, right) => readSymbolValue.call(left) === readSymbolValue.call(right),
|
|
8255
|
+
dataView: compareDataViews,
|
|
8256
|
+
date: compareDates,
|
|
8257
|
+
error: compareErrors,
|
|
8258
|
+
map: compareMaps,
|
|
8259
|
+
opaque: () => false,
|
|
8260
|
+
plain: () => true,
|
|
8261
|
+
regExp: compareRegExps,
|
|
8262
|
+
set: compareSets,
|
|
8263
|
+
typedArray: compareTypedArrays,
|
|
8264
|
+
url: compareUrls
|
|
8265
|
+
};
|
|
8266
|
+
const KINDS_INDEXED_BY_KEY = new Set(['array', 'typedArray', 'boxedString']);
|
|
8267
|
+
const compareByKind = (kind, left, right, state) => {
|
|
8268
|
+
if (!CONTENT_COMPARATORS[kind](left, right, state))
|
|
8269
|
+
return false;
|
|
8270
|
+
return compareOwnKeys(left, right, state, KINDS_INDEXED_BY_KEY.has(kind));
|
|
8271
|
+
};
|
|
8272
|
+
const rememberResult = (left, right, state, verdict) => {
|
|
8273
|
+
const known = state.results.get(left);
|
|
8274
|
+
if (known === undefined) {
|
|
8275
|
+
state.results.set(left, new Map([[right, verdict]]));
|
|
8276
|
+
return;
|
|
8277
|
+
}
|
|
8278
|
+
known.set(right, verdict);
|
|
8279
|
+
};
|
|
8280
|
+
const compareObjects = (left, right, state) => {
|
|
8281
|
+
if (Object.getPrototypeOf(left) !== Object.getPrototypeOf(right))
|
|
8282
|
+
return false;
|
|
8283
|
+
const kind = kindOf(left);
|
|
8284
|
+
if (kind !== kindOf(right))
|
|
8285
|
+
return false;
|
|
8286
|
+
const knownPosition = state.positions.get(left);
|
|
8287
|
+
if (knownPosition !== undefined) {
|
|
8288
|
+
const partnerPosition = state.partners.get(right);
|
|
8289
|
+
if (partnerPosition !== undefined) {
|
|
8290
|
+
state.assumptions += 1;
|
|
8291
|
+
return knownPosition === partnerPosition;
|
|
8292
|
+
}
|
|
8293
|
+
}
|
|
8294
|
+
const memo = state.results.get(left)?.get(right);
|
|
8295
|
+
if (memo !== undefined)
|
|
8296
|
+
return memo;
|
|
8297
|
+
if (state.depth >= MAX_DEPTH)
|
|
8298
|
+
return false;
|
|
8299
|
+
state.nextPosition += 1;
|
|
8300
|
+
const position = state.nextPosition;
|
|
8301
|
+
state.positions.set(left, position);
|
|
8302
|
+
state.partners.set(right, position);
|
|
8303
|
+
state.depth += 1;
|
|
8304
|
+
const assumptionsBefore = state.assumptions;
|
|
8305
|
+
const verdict = compareByKind(kind, left, right, state);
|
|
8306
|
+
state.depth -= 1;
|
|
8307
|
+
state.positions.delete(left);
|
|
8308
|
+
state.partners.delete(right);
|
|
8309
|
+
if (state.assumptions === assumptionsBefore)
|
|
8310
|
+
rememberResult(left, right, state, verdict);
|
|
8311
|
+
return verdict;
|
|
8312
|
+
};
|
|
8313
|
+
const compare = (left, right, state) => {
|
|
8314
|
+
if (isSameValueZero(left, right))
|
|
8315
|
+
return true;
|
|
8316
|
+
if (left === null || right === null)
|
|
8317
|
+
return false;
|
|
8318
|
+
if (typeof left !== 'object' || typeof right !== 'object')
|
|
8319
|
+
return false;
|
|
8320
|
+
return compareObjects(left, right, state);
|
|
8321
|
+
};
|
|
8322
|
+
|
|
8323
|
+
/**
|
|
8324
|
+
* The maximum number of characters a tooltip shows, headline and paragraphs together.
|
|
8325
|
+
*/
|
|
8326
|
+
const MAX_TOOLTIP_CHARACTER = 512;
|
|
8327
|
+
const TOOLTIP_POSITIONS = [
|
|
8328
|
+
{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom' },
|
|
8329
|
+
{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top' },
|
|
8330
|
+
{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center' },
|
|
8331
|
+
{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center' }
|
|
8332
|
+
];
|
|
8333
|
+
/**
|
|
8334
|
+
* **QdTooltipOnClickDirective** attaches a click-toggled tooltip overlay to the host
|
|
8335
|
+
* element and renders {@link QdTooltipContent}.
|
|
8336
|
+
*
|
|
8337
|
+
* Content is capped at 512 characters across headline and paragraphs combined;
|
|
8338
|
+
* an ellipsis is appended only to a paragraph that is actually cut.
|
|
8339
|
+
*
|
|
8340
|
+
* An open tooltip follows changes of its content. Equal content in a new object changes nothing.
|
|
8341
|
+
*/
|
|
8342
|
+
class QdTooltipOnClickDirective {
|
|
8343
|
+
/**
|
|
8344
|
+
* Tooltip content displayed on click — optional headline plus paragraphs.
|
|
8345
|
+
*/
|
|
8346
|
+
qdTooltipContent;
|
|
8347
|
+
onClickToggle(event) {
|
|
8348
|
+
event.stopPropagation();
|
|
8349
|
+
this._overlayRef ? this.close() : this.show();
|
|
8350
|
+
}
|
|
8351
|
+
onOutsideClickClose(target) {
|
|
8352
|
+
if (!this.elementRef.nativeElement.contains(target))
|
|
8353
|
+
this.close();
|
|
8354
|
+
}
|
|
8355
|
+
overlay = inject(Overlay);
|
|
8356
|
+
elementRef = inject(ElementRef);
|
|
8357
|
+
translateService = inject(TranslateService);
|
|
8358
|
+
_overlayRef;
|
|
8359
|
+
_tooltipRef;
|
|
8360
|
+
ngOnChanges(changes) {
|
|
8361
|
+
if (this._overlayRef)
|
|
8362
|
+
this.updateOpenTooltip(this._overlayRef, changes['qdTooltipContent']);
|
|
8363
|
+
}
|
|
8364
|
+
ngOnDestroy() {
|
|
8365
|
+
this.close();
|
|
8366
|
+
}
|
|
8367
|
+
/**
|
|
8368
|
+
* Opens the tooltip overlay positioned relative to the host element.
|
|
8369
|
+
*/
|
|
8370
|
+
show() {
|
|
8371
|
+
const positionStrategy = this.overlay
|
|
8372
|
+
.position()
|
|
8373
|
+
.flexibleConnectedTo(this.elementRef)
|
|
8374
|
+
.withFlexibleDimensions(false)
|
|
8375
|
+
.withPush(false)
|
|
8376
|
+
.withPositions(TOOLTIP_POSITIONS);
|
|
8377
|
+
this._overlayRef = this.overlay.create({
|
|
8378
|
+
positionStrategy,
|
|
8379
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition()
|
|
8380
|
+
});
|
|
8381
|
+
this._tooltipRef = this._overlayRef.attach(new ComponentPortal(QdTooltipComponent));
|
|
8382
|
+
this._tooltipRef.instance.content = this.getContent();
|
|
8383
|
+
}
|
|
8384
|
+
/**
|
|
8385
|
+
* Closes and disposes the tooltip overlay if one is attached.
|
|
8386
|
+
*/
|
|
8387
|
+
close() {
|
|
8388
|
+
if (this._overlayRef) {
|
|
8389
|
+
this._overlayRef.dispose();
|
|
8390
|
+
this._overlayRef = null;
|
|
8391
|
+
}
|
|
8392
|
+
}
|
|
8393
|
+
updateOpenTooltip(overlayRef, contentChange) {
|
|
8394
|
+
if (qdIsDeepEqual(contentChange.previousValue, contentChange.currentValue))
|
|
8395
|
+
return;
|
|
8396
|
+
this._tooltipRef.setInput('content', this.getContent());
|
|
8397
|
+
this._tooltipRef.changeDetectorRef.detectChanges();
|
|
8398
|
+
overlayRef.updatePosition();
|
|
8399
|
+
}
|
|
8400
|
+
getContent() {
|
|
8401
|
+
const headlineText = this.qdTooltipContent?.headline;
|
|
8402
|
+
const headline = headlineText?.i18n ? this.translate(headlineText.i18n, headlineText.params) : undefined;
|
|
8403
|
+
const paragraphs = (this.qdTooltipContent?.paragraphs ?? []).map(p => this.translate(p.i18n, p.params));
|
|
8404
|
+
let remaining = MAX_TOOLTIP_CHARACTER - (headline?.length ?? 0);
|
|
8405
|
+
let exceeded = false;
|
|
8406
|
+
const rendered = [];
|
|
8407
|
+
for (const paragraph of paragraphs) {
|
|
8408
|
+
if (remaining <= 0) {
|
|
8409
|
+
exceeded = true;
|
|
8410
|
+
break;
|
|
8411
|
+
}
|
|
8412
|
+
if (paragraph.length <= remaining) {
|
|
8413
|
+
rendered.push(paragraph);
|
|
8414
|
+
remaining -= paragraph.length;
|
|
8415
|
+
continue;
|
|
8416
|
+
}
|
|
8417
|
+
rendered.push(`${paragraph.substring(0, remaining).trim()}...`);
|
|
8418
|
+
exceeded = true;
|
|
8419
|
+
break;
|
|
8420
|
+
}
|
|
8421
|
+
if (exceeded) {
|
|
8422
|
+
console.warn(`Quadrel Framework | QdTooltip - Tooltip content exceeds ${MAX_TOOLTIP_CHARACTER} characters. It will be truncated.`);
|
|
8423
|
+
}
|
|
8424
|
+
return { headline, paragraphs: rendered };
|
|
8425
|
+
}
|
|
8426
|
+
translate(key, params) {
|
|
8427
|
+
return this.translateService.instant(key, params);
|
|
8428
|
+
}
|
|
8429
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdTooltipOnClickDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
8430
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: QdTooltipOnClickDirective, isStandalone: false, selector: "[qdTooltipOnClick]", inputs: { qdTooltipContent: "qdTooltipContent" }, host: { listeners: { "click": "onClickToggle($event)", "document:click": "onOutsideClickClose($event.target)" } }, usesOnChanges: true, ngImport: i0 });
|
|
8431
|
+
}
|
|
8432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdTooltipOnClickDirective, decorators: [{
|
|
8433
|
+
type: Directive,
|
|
8434
|
+
args: [{
|
|
8435
|
+
selector: '[qdTooltipOnClick]',
|
|
8436
|
+
standalone: false
|
|
8437
|
+
}]
|
|
8438
|
+
}], propDecorators: { qdTooltipContent: [{
|
|
8439
|
+
type: Input
|
|
8005
8440
|
}], onClickToggle: [{
|
|
8006
8441
|
type: HostListener,
|
|
8007
8442
|
args: ['click', ['$event']]
|
|
@@ -8111,6 +8546,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
8111
8546
|
type: Injectable
|
|
8112
8547
|
}] });
|
|
8113
8548
|
|
|
8549
|
+
/**
|
|
8550
|
+
* Measures the size an element would take without any width or height limit.
|
|
8551
|
+
*
|
|
8552
|
+
* A hidden clone is placed into `parent`, read and removed again. The clone keeps the parent's styles,
|
|
8553
|
+
* so the result matches what the element needs in its real place. The element itself is not touched.
|
|
8554
|
+
* The clone is as wide as its content without any line break, and it sits completely left of the parent.
|
|
8555
|
+
* Content left of the page never adds a scrollbar, so the measuring cannot change the layout around it.
|
|
8556
|
+
* `width` and `height` are the content size. `outerWidth` also counts border and fractions of a pixel.
|
|
8557
|
+
*
|
|
8558
|
+
* @see https://stackoverflow.com/questions/1841124/find-the-potential-width-of-a-hidden-element
|
|
8559
|
+
*/
|
|
8560
|
+
function qdMeasureNaturalSize(element, parent = document.body) {
|
|
8561
|
+
const clone = element.cloneNode(true);
|
|
8562
|
+
clone.style.visibility = 'hidden';
|
|
8563
|
+
clone.style.position = 'absolute';
|
|
8564
|
+
clone.style.pointerEvents = 'none';
|
|
8565
|
+
clone.style.width = 'max-content';
|
|
8566
|
+
clone.style.minWidth = 'auto';
|
|
8567
|
+
clone.style.maxWidth = 'none';
|
|
8568
|
+
clone.style.height = 'auto';
|
|
8569
|
+
clone.style.minHeight = 'auto';
|
|
8570
|
+
clone.style.maxHeight = 'none';
|
|
8571
|
+
clone.style.right = '100%';
|
|
8572
|
+
clone.style.top = '0';
|
|
8573
|
+
parent.appendChild(clone);
|
|
8574
|
+
const size = {
|
|
8575
|
+
width: clone.scrollWidth,
|
|
8576
|
+
height: clone.scrollHeight,
|
|
8577
|
+
outerWidth: clone.getBoundingClientRect().width
|
|
8578
|
+
};
|
|
8579
|
+
parent.removeChild(clone);
|
|
8580
|
+
return size;
|
|
8581
|
+
}
|
|
8582
|
+
|
|
8114
8583
|
const convertPxToRem = (pixel) => `${parseFloat((pixel / globalVars.base.fontsize).toFixed(3))}rem`;
|
|
8115
8584
|
|
|
8116
8585
|
/**
|
|
@@ -8131,7 +8600,8 @@ const convertPxToRem = (pixel) => `${parseFloat((pixel / globalVars.base.fontsiz
|
|
|
8131
8600
|
* - Exposes latest measured content size for debugging or analytics.
|
|
8132
8601
|
*
|
|
8133
8602
|
* #### Notes & Best Practices
|
|
8134
|
-
* -
|
|
8603
|
+
* - The content is measured with `qdMeasureNaturalSize`: a hidden clone is added, read and removed again.
|
|
8604
|
+
* `QdOverflowFitService` uses the same function, so both measure in the same way.
|
|
8135
8605
|
* - Use the `contentWidth` and `contentHeight` getters for debugging or if you need to react to the last measured content size.
|
|
8136
8606
|
* - The service will automatically hide the overlay until sizing is complete, preventing layout flicker.
|
|
8137
8607
|
* - The returned Observable emits `true` once initial sizing is applied and overlay is visible.
|
|
@@ -8148,9 +8618,6 @@ const convertPxToRem = (pixel) => `${parseFloat((pixel / globalVars.base.fontsiz
|
|
|
8148
8618
|
* - An open popover follows a window resize, so it keeps fitting the screen while the user rotates the device or
|
|
8149
8619
|
* drags the window. Several resize events in the same frame are collapsed into one sizing pass, and the listener
|
|
8150
8620
|
* only exists while a popover is open.
|
|
8151
|
-
*
|
|
8152
|
-
* #### For the hidden-content measuring
|
|
8153
|
-
* @see https://stackoverflow.com/questions/1841124/find-the-potential-width-of-a-hidden-element
|
|
8154
8621
|
*/
|
|
8155
8622
|
class QdPopoverSizingService {
|
|
8156
8623
|
_resizeObserver;
|
|
@@ -8276,22 +8743,9 @@ class QdPopoverSizingService {
|
|
|
8276
8743
|
this._overlayRef.updatePosition();
|
|
8277
8744
|
}
|
|
8278
8745
|
measureContentSize(element) {
|
|
8279
|
-
const
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
clone.style.pointerEvents = 'none';
|
|
8283
|
-
clone.style.width = 'auto';
|
|
8284
|
-
clone.style.minWidth = 'auto';
|
|
8285
|
-
clone.style.maxWidth = 'none';
|
|
8286
|
-
clone.style.height = 'auto';
|
|
8287
|
-
clone.style.minHeight = 'auto';
|
|
8288
|
-
clone.style.maxHeight = 'none';
|
|
8289
|
-
clone.style.left = '-10000px';
|
|
8290
|
-
clone.style.top = '-10000px';
|
|
8291
|
-
document.body.appendChild(clone);
|
|
8292
|
-
this._contentWidth = clone.scrollWidth;
|
|
8293
|
-
this._contentHeight = clone.scrollHeight;
|
|
8294
|
-
document.body.removeChild(clone);
|
|
8746
|
+
const { width, height } = qdMeasureNaturalSize(element);
|
|
8747
|
+
this._contentWidth = width;
|
|
8748
|
+
this._contentHeight = height;
|
|
8295
8749
|
}
|
|
8296
8750
|
disconnect() {
|
|
8297
8751
|
if (this._viewportResizeListener)
|
|
@@ -8951,650 +9405,232 @@ class QdTooltipModule {
|
|
|
8951
9405
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.17", ngImport: i0, type: QdTooltipModule, declarations: [QdTooltipComponent, QdTooltipOnClickDirective, QdTooltipIconComponent], imports: [CommonModule, TranslateModule, QdIconModule], exports: [QdTooltipOnClickDirective, QdTooltipIconComponent] });
|
|
8952
9406
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdTooltipModule, imports: [CommonModule, TranslateModule, QdIconModule] });
|
|
8953
9407
|
}
|
|
8954
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdTooltipModule, decorators: [{
|
|
8955
|
-
type: NgModule,
|
|
8956
|
-
args: [{
|
|
8957
|
-
imports: [CommonModule, TranslateModule, QdIconModule],
|
|
8958
|
-
declarations: [QdTooltipComponent, QdTooltipOnClickDirective, QdTooltipIconComponent],
|
|
8959
|
-
exports: [QdTooltipOnClickDirective, QdTooltipIconComponent]
|
|
8960
|
-
}]
|
|
8961
|
-
}] });
|
|
8962
|
-
|
|
8963
|
-
// @ts-strict-ignore
|
|
8964
|
-
class QdFormControl extends UntypedFormControl {
|
|
8965
|
-
maxLength;
|
|
8966
|
-
revalidationPartners = [];
|
|
8967
|
-
validatorList;
|
|
8968
|
-
constructor(formState, validatorOrOpts, asyncValidator) {
|
|
8969
|
-
super(formState, validatorOrOpts, asyncValidator);
|
|
8970
|
-
this.validatorList = this.getValidatorList(validatorOrOpts);
|
|
8971
|
-
this.setPropsFromValidatorList();
|
|
8972
|
-
}
|
|
8973
|
-
getValidatorList(validatorOrOpts) {
|
|
8974
|
-
const validator = isOptionsObj$1(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts;
|
|
8975
|
-
if (!validator)
|
|
8976
|
-
return [];
|
|
8977
|
-
return Array.isArray(validator) ? validator : [validator];
|
|
8978
|
-
}
|
|
8979
|
-
setPropsFromValidatorList() {
|
|
8980
|
-
let maxLength;
|
|
8981
|
-
const revalidationPartners = [];
|
|
8982
|
-
this.validatorList.forEach((validatorFn) => {
|
|
8983
|
-
if (validatorFn.maxLength)
|
|
8984
|
-
maxLength = validatorFn.maxLength;
|
|
8985
|
-
if (validatorFn.qdRevalidates)
|
|
8986
|
-
revalidationPartners.push(validatorFn.qdRevalidates);
|
|
8987
|
-
});
|
|
8988
|
-
this.maxLength = maxLength;
|
|
8989
|
-
this.revalidationPartners = revalidationPartners;
|
|
8990
|
-
}
|
|
8991
|
-
setValidators(validators) {
|
|
8992
|
-
this.validatorList = this.getValidatorList(validators);
|
|
8993
|
-
this.setPropsFromValidatorList();
|
|
8994
|
-
super.setValidators(validators);
|
|
8995
|
-
}
|
|
8996
|
-
addValidators(validators) {
|
|
8997
|
-
this.validatorList.push(...this.getValidatorList(validators));
|
|
8998
|
-
this.setPropsFromValidatorList();
|
|
8999
|
-
super.addValidators(validators);
|
|
9000
|
-
}
|
|
9001
|
-
removeValidators(validators) {
|
|
9002
|
-
const validatorsToRemove = this.getValidatorList(validators);
|
|
9003
|
-
validatorsToRemove.forEach(validatorToRemove => {
|
|
9004
|
-
const index = this.validatorList.indexOf(validatorToRemove);
|
|
9005
|
-
if (index > -1)
|
|
9006
|
-
this.validatorList.splice(index, 1);
|
|
9007
|
-
});
|
|
9008
|
-
this.setPropsFromValidatorList();
|
|
9009
|
-
super.removeValidators(validators);
|
|
9010
|
-
}
|
|
9011
|
-
clearValidators() {
|
|
9012
|
-
this.validatorList = [];
|
|
9013
|
-
this.setPropsFromValidatorList();
|
|
9014
|
-
super.clearValidators();
|
|
9015
|
-
}
|
|
9016
|
-
hasMaxLength() {
|
|
9017
|
-
return this.maxLength !== undefined;
|
|
9018
|
-
}
|
|
9019
|
-
getMaxLengthOrUndefined() {
|
|
9020
|
-
return this.maxLength;
|
|
9021
|
-
}
|
|
9022
|
-
getRevalidationPartners() {
|
|
9023
|
-
return this.revalidationPartners;
|
|
9024
|
-
}
|
|
9025
|
-
}
|
|
9026
|
-
function isOptionsObj$1(validatorOrOpts) {
|
|
9027
|
-
return validatorOrOpts != null && !Array.isArray(validatorOrOpts) && typeof validatorOrOpts === 'object';
|
|
9028
|
-
}
|
|
9029
|
-
|
|
9030
|
-
function get(object, path, defaultValue) {
|
|
9031
|
-
const value = path.split('.').reduce((current, key) => current?.[key], object);
|
|
9032
|
-
return value === null || value === undefined || Number.isNaN(value) ? defaultValue : value;
|
|
9033
|
-
}
|
|
9034
|
-
/**
|
|
9035
|
-
* Base form properties
|
|
9036
|
-
*
|
|
9037
|
-
* * @param config: QdFormConfiguration
|
|
9038
|
-
*/
|
|
9039
|
-
const getLabel = (config) => get(config, 'label.i18n', '');
|
|
9040
|
-
const getIsLabelDisabled = (config) => !!get(config, 'label', { disabled: true }).disabled;
|
|
9041
|
-
const getHint = (config) => get(config, 'hint.i18n', '');
|
|
9042
|
-
const getIsHintDisabled = (config) => !!get(config, 'hint', { disabled: true }).disabled;
|
|
9043
|
-
const getDisabled = (config) => get(config, 'disabled', false);
|
|
9044
|
-
const getReadonly = (config, defaultValue) => get(config, 'readonly', defaultValue === true);
|
|
9045
|
-
const getViewonly = (config, defaultValue) => get(config, 'viewonly', defaultValue === true);
|
|
9046
|
-
const getHintAction = (config) => get(config, 'hintAction', false);
|
|
9047
|
-
const getReadonlyAction = (config) => get(config, 'readonlyAction', false);
|
|
9048
|
-
const getViewonlyAction = (config) => get(config, 'viewonlyAction', false);
|
|
9049
|
-
/**
|
|
9050
|
-
* Input form properties
|
|
9051
|
-
*
|
|
9052
|
-
* * @param config: QdFormInputConfiguration
|
|
9053
|
-
*/
|
|
9054
|
-
const getInputType = (config) => get(config, 'inputType', 'text');
|
|
9055
|
-
const getInputMode = (config) => get(config, 'inputMode', null);
|
|
9056
|
-
const getClearable = (config) => get(config, 'clearable', false);
|
|
9057
|
-
const getValue = (config) => get(config, 'value', '');
|
|
9058
|
-
const getPlaceholder = (config) => get(config, 'placeholder.i18n', '');
|
|
9059
|
-
const getHasAutofocus = (config) => get(config, 'hasAutofocus', false);
|
|
9060
|
-
/**
|
|
9061
|
-
* Textarea form properties
|
|
9062
|
-
*
|
|
9063
|
-
* * @param config: QdFormTextAreaConfiguration
|
|
9064
|
-
*/
|
|
9065
|
-
const getRows = (config) => get(config, 'rows', 4);
|
|
9066
|
-
/**
|
|
9067
|
-
* Checkboxes form properties
|
|
9068
|
-
*
|
|
9069
|
-
* * @param config: QdFormCheckboxesConfiguration
|
|
9070
|
-
*/
|
|
9071
|
-
const getCheckboxesOptions = (config) => get(config, 'options', []);
|
|
9072
|
-
const getCheckboxesFilter = (config) => get(config, 'filter', false);
|
|
9073
|
-
const getCheckboxesAlign = (config) => get(config, 'align', 'horizontal');
|
|
9074
|
-
/**
|
|
9075
|
-
* Dropdown form properties
|
|
9076
|
-
*
|
|
9077
|
-
* * @param config: QdFormDropdownConfiguration
|
|
9078
|
-
*/
|
|
9079
|
-
const getDropdownFilter = (config) => get(config, 'filter', false);
|
|
9080
|
-
const getDropdownOptions = (config) => get(config, 'options', []);
|
|
9081
|
-
/**
|
|
9082
|
-
* MultiInput form properties
|
|
9083
|
-
*
|
|
9084
|
-
* * @param config: QdFormMultiInputConfiguration
|
|
9085
|
-
*/
|
|
9086
|
-
const getMultiInputOptions = (config) => get(config, 'options', []);
|
|
9087
|
-
/**
|
|
9088
|
-
* Pincode form properties
|
|
9089
|
-
*
|
|
9090
|
-
* * @param config: QdFormPinCodeConfiguration
|
|
9091
|
-
*/
|
|
9092
|
-
const getDigitsOnly = (config) => get(config, 'digitsOnly', false);
|
|
9093
|
-
const getCodeLength = (config) => get(config, 'codeLength', 6);
|
|
9094
|
-
const getFocusOnInit = (config) => get(config, 'focusOnInit', false);
|
|
9095
|
-
const getCodeHidden = (config) => get(config, 'codeHidden', false);
|
|
9096
|
-
const getPinCodeInputType = (config) => get(config, 'inputType', 'tel');
|
|
9097
|
-
/**
|
|
9098
|
-
* Common Checkboxes & Radiobuttons form properties
|
|
9099
|
-
*
|
|
9100
|
-
* * @param config: QdFormCheckboxesConfiguration | QdFormRadioButtonsConfiguration
|
|
9101
|
-
*/
|
|
9102
|
-
const getAlign = (config) => get(config, 'align', 'horizontal');
|
|
9103
|
-
/**
|
|
9104
|
-
* Common Checkboxes, Dropdown & Radiobuttons form properties
|
|
9105
|
-
*
|
|
9106
|
-
* * @param config: QdFormCheckboxesConfiguration | QdFormDropdownConfiguration | QdFormRadioButtonsConfiguration
|
|
9107
|
-
*/
|
|
9108
|
-
const getFilter$1 = (config) => get(config, 'filter', false);
|
|
9109
|
-
/**
|
|
9110
|
-
* Common Checkboxes, CheckboxChips, Dropdown & Radiobuttons form properties
|
|
9111
|
-
*
|
|
9112
|
-
* * @param config: QdFormCheckboxesConfiguration | QdFormCheckboxChipsConfiguration | QdFormDropdownConfiguration | QdFormRadioButtonsConfiguration
|
|
9113
|
-
*/
|
|
9114
|
-
const getOptions = (config) => get(config, 'options', []);
|
|
9115
|
-
|
|
9116
|
-
class QdFormsActionEmitterService {
|
|
9117
|
-
hintEventEmitterSubject = new Subject();
|
|
9118
|
-
readonlyEventEmitterSubject = new Subject();
|
|
9119
|
-
viewonlyEventEmitterSubject = new Subject();
|
|
9120
|
-
hintEventEmitter$ = this.hintEventEmitterSubject.asObservable();
|
|
9121
|
-
readonlyEventEmitter$ = this.readonlyEventEmitterSubject.asObservable();
|
|
9122
|
-
viewonlyEventEmitter$ = this.viewonlyEventEmitterSubject.asObservable();
|
|
9123
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdFormsActionEmitterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9124
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdFormsActionEmitterService });
|
|
9125
|
-
}
|
|
9126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdFormsActionEmitterService, decorators: [{
|
|
9127
|
-
type: Injectable
|
|
9408
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdTooltipModule, decorators: [{
|
|
9409
|
+
type: NgModule,
|
|
9410
|
+
args: [{
|
|
9411
|
+
imports: [CommonModule, TranslateModule, QdIconModule],
|
|
9412
|
+
declarations: [QdTooltipComponent, QdTooltipOnClickDirective, QdTooltipIconComponent],
|
|
9413
|
+
exports: [QdTooltipOnClickDirective, QdTooltipIconComponent]
|
|
9414
|
+
}]
|
|
9128
9415
|
}] });
|
|
9129
9416
|
|
|
9130
|
-
const setOptionsByValue = (options, value) => options.map(option => {
|
|
9131
|
-
if (option.value === value)
|
|
9132
|
-
return { ...option, ...{ active: true } };
|
|
9133
|
-
return { ...option, ...{ active: false } };
|
|
9134
|
-
});
|
|
9135
|
-
const setOptionsByValues = (options, values) => options.map(option => {
|
|
9136
|
-
if (values.indexOf(option.value) !== -1)
|
|
9137
|
-
return { ...option, ...{ active: true } };
|
|
9138
|
-
return { ...option, ...{ active: false } };
|
|
9139
|
-
});
|
|
9140
|
-
const setMultiSelectOptions = (options, optionIndex) => options.map((option, index) => {
|
|
9141
|
-
if (index !== optionIndex)
|
|
9142
|
-
return { ...option, ...{ active: option.active || false } };
|
|
9143
|
-
return { ...option, ...{ active: !option.active } };
|
|
9144
|
-
});
|
|
9145
|
-
const setSingleSelectOptions = (options, optionIndex) => options.map((option, index) => {
|
|
9146
|
-
if (index === optionIndex)
|
|
9147
|
-
return { ...option, ...{ active: true } };
|
|
9148
|
-
return { ...option, ...{ active: false } };
|
|
9149
|
-
});
|
|
9150
|
-
|
|
9151
9417
|
// @ts-strict-ignore
|
|
9152
|
-
class
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9418
|
+
class QdFormControl extends UntypedFormControl {
|
|
9419
|
+
maxLength;
|
|
9420
|
+
revalidationPartners = [];
|
|
9421
|
+
validatorList;
|
|
9422
|
+
constructor(formState, validatorOrOpts, asyncValidator) {
|
|
9423
|
+
super(formState, validatorOrOpts, asyncValidator);
|
|
9424
|
+
this.validatorList = this.getValidatorList(validatorOrOpts);
|
|
9425
|
+
this.setPropsFromValidatorList();
|
|
9158
9426
|
}
|
|
9159
|
-
|
|
9160
|
-
|
|
9427
|
+
getValidatorList(validatorOrOpts) {
|
|
9428
|
+
const validator = isOptionsObj$1(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts;
|
|
9429
|
+
if (!validator)
|
|
9161
9430
|
return [];
|
|
9162
|
-
return
|
|
9431
|
+
return Array.isArray(validator) ? validator : [validator];
|
|
9163
9432
|
}
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9433
|
+
setPropsFromValidatorList() {
|
|
9434
|
+
let maxLength;
|
|
9435
|
+
const revalidationPartners = [];
|
|
9436
|
+
this.validatorList.forEach((validatorFn) => {
|
|
9437
|
+
if (validatorFn.maxLength)
|
|
9438
|
+
maxLength = validatorFn.maxLength;
|
|
9439
|
+
if (validatorFn.qdRevalidates)
|
|
9440
|
+
revalidationPartners.push(validatorFn.qdRevalidates);
|
|
9171
9441
|
});
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdCheckboxChipsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9175
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdCheckboxChipsService });
|
|
9176
|
-
}
|
|
9177
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdCheckboxChipsService, decorators: [{
|
|
9178
|
-
type: Injectable
|
|
9179
|
-
}] });
|
|
9180
|
-
|
|
9181
|
-
/**
|
|
9182
|
-
* Compares two values by their content instead of by reference.
|
|
9183
|
-
*
|
|
9184
|
-
* This is the one place in the framework that answers "did this change?" for the
|
|
9185
|
-
* value shapes it deals with: component configurations, form values and lists of
|
|
9186
|
-
* options. A wrong answer here is silent, so the helper errs on the side of
|
|
9187
|
-
* reporting a change.
|
|
9188
|
-
*
|
|
9189
|
-
* #### Features:
|
|
9190
|
-
*
|
|
9191
|
-
* - Walks arrays, plain objects, `Map`, `Set`, `Date`, `RegExp`, errors, typed
|
|
9192
|
-
* arrays, buffers and boxed primitives.
|
|
9193
|
-
* - Treats `NaN` as equal to `NaN` and `0` as equal to `-0`, so two invalid dates
|
|
9194
|
-
* count as equal.
|
|
9195
|
-
* - Reads types and values through internal slots, so an object cannot disguise
|
|
9196
|
-
* itself with `Symbol.toStringTag` or a custom `valueOf`.
|
|
9197
|
-
* - Requires the same prototype on both sides, which keeps instances of different
|
|
9198
|
-
* classes apart even when their fields match.
|
|
9199
|
-
* - Compares own enumerable properties on every value, including the extra ones
|
|
9200
|
-
* attached to a `Date`, a `Map` or an array.
|
|
9201
|
-
* - Matches `Map` and `Set` members independently of insertion order, and never
|
|
9202
|
-
* reports a difference that only a matching order would explain.
|
|
9203
|
-
* - Survives cyclic and shared structures, and tells cycles of different lengths
|
|
9204
|
-
* apart.
|
|
9205
|
-
*
|
|
9206
|
-
* #### Notes & Best Practices:
|
|
9207
|
-
*
|
|
9208
|
-
* - A missing key and a key holding `undefined` count as different, as do an
|
|
9209
|
-
* array hole and an explicit `undefined`.
|
|
9210
|
-
* - Non-enumerable properties and getters on the prototype chain are ignored, so
|
|
9211
|
-
* two errors with the same name and message stay equal despite different stacks.
|
|
9212
|
-
* - `WeakMap` and `WeakSet` have no readable content and are only equal to
|
|
9213
|
-
* themselves.
|
|
9214
|
-
* - Structures deeper than 1200 levels report a difference instead of exhausting
|
|
9215
|
-
* the call stack.
|
|
9216
|
-
*/
|
|
9217
|
-
const qdIsDeepEqual = (left, right) => compare(left, right, {
|
|
9218
|
-
positions: new Map(),
|
|
9219
|
-
partners: new Map(),
|
|
9220
|
-
results: new Map(),
|
|
9221
|
-
assumptions: 0,
|
|
9222
|
-
depth: 0,
|
|
9223
|
-
nextPosition: 0
|
|
9224
|
-
});
|
|
9225
|
-
const MAX_DEPTH = 1200;
|
|
9226
|
-
const getterOf = (target, key) => Object.getOwnPropertyDescriptor(target, key)?.get;
|
|
9227
|
-
const TYPED_ARRAY_PROTOTYPE = Object.getPrototypeOf(Int8Array.prototype);
|
|
9228
|
-
const readMapSize = getterOf(Map.prototype, 'size');
|
|
9229
|
-
const readSetSize = getterOf(Set.prototype, 'size');
|
|
9230
|
-
const readRegExpSource = getterOf(RegExp.prototype, 'source');
|
|
9231
|
-
const readBufferLength = getterOf(ArrayBuffer.prototype, 'byteLength');
|
|
9232
|
-
const readSharedLength = getterOf(typeof SharedArrayBuffer === 'undefined' ? ArrayBuffer.prototype : SharedArrayBuffer.prototype, 'byteLength');
|
|
9233
|
-
const readViewLength = getterOf(DataView.prototype, 'byteLength');
|
|
9234
|
-
const readViewOffset = getterOf(DataView.prototype, 'byteOffset');
|
|
9235
|
-
const readTypedLength = getterOf(TYPED_ARRAY_PROTOTYPE, 'length');
|
|
9236
|
-
const REGEXP_FLAG_GETTERS = ['dotAll', 'global', 'hasIndices', 'ignoreCase', 'multiline', 'sticky', 'unicode', 'unicodeSets']
|
|
9237
|
-
.filter(flag => flag in RegExp.prototype)
|
|
9238
|
-
.map(flag => getterOf(RegExp.prototype, flag));
|
|
9239
|
-
const readNumberValue = Number.prototype.valueOf;
|
|
9240
|
-
const readStringValue = String.prototype.valueOf;
|
|
9241
|
-
const readBooleanValue = Boolean.prototype.valueOf;
|
|
9242
|
-
const readSymbolValue = Symbol.prototype.valueOf;
|
|
9243
|
-
const readBigIntValue = BigInt.prototype.valueOf;
|
|
9244
|
-
const readDateValue = Date.prototype.getTime;
|
|
9245
|
-
const survives = (probe) => {
|
|
9246
|
-
try {
|
|
9247
|
-
probe();
|
|
9248
|
-
return true;
|
|
9249
|
-
}
|
|
9250
|
-
catch {
|
|
9251
|
-
return false;
|
|
9252
|
-
}
|
|
9253
|
-
};
|
|
9254
|
-
const callable = (reader, value) => survives(() => reader.call(value));
|
|
9255
|
-
const isSameValueZero = (left, right) => left === right || (left !== left && right !== right);
|
|
9256
|
-
const hasErrorAncestor = (value) => {
|
|
9257
|
-
let current = Object.getPrototypeOf(value);
|
|
9258
|
-
while (current !== null) {
|
|
9259
|
-
if (current === Error.prototype)
|
|
9260
|
-
return true;
|
|
9261
|
-
current = Object.getPrototypeOf(current);
|
|
9262
|
-
}
|
|
9263
|
-
return false;
|
|
9264
|
-
};
|
|
9265
|
-
const probedKind = (value) => {
|
|
9266
|
-
if (callable(readMapSize, value))
|
|
9267
|
-
return 'map';
|
|
9268
|
-
if (callable(readSetSize, value))
|
|
9269
|
-
return 'set';
|
|
9270
|
-
if (survives(() => readDateValue.call(value)))
|
|
9271
|
-
return 'date';
|
|
9272
|
-
if (callable(readRegExpSource, value))
|
|
9273
|
-
return 'regExp';
|
|
9274
|
-
if (callable(readBufferLength, value) || callable(readSharedLength, value))
|
|
9275
|
-
return 'arrayBuffer';
|
|
9276
|
-
if (survives(() => readNumberValue.call(value)))
|
|
9277
|
-
return 'boxedNumber';
|
|
9278
|
-
if (survives(() => readStringValue.call(value)))
|
|
9279
|
-
return 'boxedString';
|
|
9280
|
-
if (survives(() => readBooleanValue.call(value)))
|
|
9281
|
-
return 'boxedBoolean';
|
|
9282
|
-
if (survives(() => readSymbolValue.call(value)))
|
|
9283
|
-
return 'boxedSymbol';
|
|
9284
|
-
if (survives(() => readBigIntValue.call(value)))
|
|
9285
|
-
return 'boxedBigInt';
|
|
9286
|
-
return undefined;
|
|
9287
|
-
};
|
|
9288
|
-
const isWeakCollection = (value) => survives(() => WeakMap.prototype.has.call(value, Object.prototype)) ||
|
|
9289
|
-
survives(() => WeakSet.prototype.has.call(value, Object.prototype));
|
|
9290
|
-
const readUrlHref = getterOf(URL.prototype, 'href');
|
|
9291
|
-
const prototypeOfMaybe = (holder) => {
|
|
9292
|
-
if (typeof holder !== 'function')
|
|
9293
|
-
return undefined;
|
|
9294
|
-
const prototype = holder.prototype;
|
|
9295
|
-
return typeof prototype === 'object' && prototype !== null ? prototype : undefined;
|
|
9296
|
-
};
|
|
9297
|
-
const OPAQUE_PROTOTYPES = [
|
|
9298
|
-
typeof Promise === 'undefined' ? undefined : Promise,
|
|
9299
|
-
typeof WeakRef === 'undefined' ? undefined : WeakRef,
|
|
9300
|
-
typeof URLSearchParams === 'undefined' ? undefined : URLSearchParams,
|
|
9301
|
-
typeof Intl === 'undefined' ? undefined : Intl.NumberFormat,
|
|
9302
|
-
typeof Intl === 'undefined' ? undefined : Intl.DateTimeFormat,
|
|
9303
|
-
typeof Intl === 'undefined' ? undefined : Intl.Collator
|
|
9304
|
-
]
|
|
9305
|
-
.map(prototypeOfMaybe)
|
|
9306
|
-
.filter((prototype) => prototype !== undefined);
|
|
9307
|
-
const inheritsFromAny = (value, prototypes) => {
|
|
9308
|
-
let current = Object.getPrototypeOf(value);
|
|
9309
|
-
while (current !== null) {
|
|
9310
|
-
if (prototypes.includes(current))
|
|
9311
|
-
return true;
|
|
9312
|
-
current = Object.getPrototypeOf(current);
|
|
9313
|
-
}
|
|
9314
|
-
return false;
|
|
9315
|
-
};
|
|
9316
|
-
const hidesStateBehindSlots = (value) => {
|
|
9317
|
-
if (inheritsFromAny(value, OPAQUE_PROTOTYPES))
|
|
9318
|
-
return true;
|
|
9319
|
-
const prototype = Object.getPrototypeOf(value);
|
|
9320
|
-
if (prototype === null || prototype === Object.prototype)
|
|
9321
|
-
return false;
|
|
9322
|
-
if (!(Symbol.toStringTag in prototype))
|
|
9323
|
-
return false;
|
|
9324
|
-
return ownEnumerableKeys(value).length === 0;
|
|
9325
|
-
};
|
|
9326
|
-
const kindOf = (value) => {
|
|
9327
|
-
if (Array.isArray(value))
|
|
9328
|
-
return 'array';
|
|
9329
|
-
if (ArrayBuffer.isView(value))
|
|
9330
|
-
return callable(readViewLength, value) ? 'dataView' : 'typedArray';
|
|
9331
|
-
const probed = probedKind(value);
|
|
9332
|
-
if (probed !== undefined)
|
|
9333
|
-
return probed;
|
|
9334
|
-
if (callable(readUrlHref, value))
|
|
9335
|
-
return 'url';
|
|
9336
|
-
if (isWeakCollection(value))
|
|
9337
|
-
return 'opaque';
|
|
9338
|
-
if (hasErrorAncestor(value))
|
|
9339
|
-
return 'error';
|
|
9340
|
-
if (hidesStateBehindSlots(value))
|
|
9341
|
-
return 'opaque';
|
|
9342
|
-
return 'plain';
|
|
9343
|
-
};
|
|
9344
|
-
const ownEnumerableKeys = (value) => [
|
|
9345
|
-
...Object.keys(value),
|
|
9346
|
-
...Object.getOwnPropertySymbols(value).filter(symbol => Object.prototype.propertyIsEnumerable.call(value, symbol))
|
|
9347
|
-
];
|
|
9348
|
-
const readKey = (value, key) => value[key];
|
|
9349
|
-
const compareOwnKeys = (left, right, state, skipIndices) => {
|
|
9350
|
-
const isIndex = (key) => typeof key === 'string' && /^(0|[1-9]\d*)$/.test(key);
|
|
9351
|
-
const leftKeys = ownEnumerableKeys(left).filter(key => !skipIndices || !isIndex(key));
|
|
9352
|
-
const rightKeys = ownEnumerableKeys(right).filter(key => !skipIndices || !isIndex(key));
|
|
9353
|
-
if (leftKeys.length !== rightKeys.length)
|
|
9354
|
-
return false;
|
|
9355
|
-
for (const key of leftKeys) {
|
|
9356
|
-
if (!Object.prototype.propertyIsEnumerable.call(right, key))
|
|
9357
|
-
return false;
|
|
9358
|
-
if (!compare(readKey(left, key), readKey(right, key), state))
|
|
9359
|
-
return false;
|
|
9442
|
+
this.maxLength = maxLength;
|
|
9443
|
+
this.revalidationPartners = revalidationPartners;
|
|
9360
9444
|
}
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
const rightTime = Date.prototype.getTime.call(right);
|
|
9366
|
-
return isSameValueZero(leftTime, rightTime);
|
|
9367
|
-
};
|
|
9368
|
-
const compareRegExps = (left, right) => {
|
|
9369
|
-
if (readRegExpSource.call(left) !== readRegExpSource.call(right))
|
|
9370
|
-
return false;
|
|
9371
|
-
return REGEXP_FLAG_GETTERS.every(reader => reader.call(left) === reader.call(right));
|
|
9372
|
-
};
|
|
9373
|
-
const byteLengthOf = (value) => {
|
|
9374
|
-
if (callable(readBufferLength, value))
|
|
9375
|
-
return readBufferLength.call(value);
|
|
9376
|
-
if (callable(readSharedLength, value))
|
|
9377
|
-
return readSharedLength.call(value);
|
|
9378
|
-
return -1;
|
|
9379
|
-
};
|
|
9380
|
-
const bytesOf = (buffer, offset, length) => {
|
|
9381
|
-
try {
|
|
9382
|
-
return new Uint8Array(buffer, offset, length);
|
|
9445
|
+
setValidators(validators) {
|
|
9446
|
+
this.validatorList = this.getValidatorList(validators);
|
|
9447
|
+
this.setPropsFromValidatorList();
|
|
9448
|
+
super.setValidators(validators);
|
|
9383
9449
|
}
|
|
9384
|
-
|
|
9385
|
-
|
|
9450
|
+
addValidators(validators) {
|
|
9451
|
+
this.validatorList.push(...this.getValidatorList(validators));
|
|
9452
|
+
this.setPropsFromValidatorList();
|
|
9453
|
+
super.addValidators(validators);
|
|
9386
9454
|
}
|
|
9387
|
-
|
|
9388
|
-
const
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
if (leftLength !== rightLength)
|
|
9397
|
-
return false;
|
|
9398
|
-
return sameBytes(bytesOf(left, 0, leftLength), bytesOf(right, 0, rightLength));
|
|
9399
|
-
};
|
|
9400
|
-
const compareDataViews = (left, right) => {
|
|
9401
|
-
const leftLength = readViewLength.call(left);
|
|
9402
|
-
if (leftLength !== readViewLength.call(right))
|
|
9403
|
-
return false;
|
|
9404
|
-
const leftView = left;
|
|
9405
|
-
const rightView = right;
|
|
9406
|
-
return sameBytes(bytesOf(leftView.buffer, readViewOffset.call(left), leftLength), bytesOf(rightView.buffer, readViewOffset.call(right), leftLength));
|
|
9407
|
-
};
|
|
9408
|
-
const compareTypedArrays = (left, right) => {
|
|
9409
|
-
const length = readTypedLength.call(left);
|
|
9410
|
-
if (length !== readTypedLength.call(right))
|
|
9411
|
-
return false;
|
|
9412
|
-
const leftView = left;
|
|
9413
|
-
const rightView = right;
|
|
9414
|
-
return Array.prototype.every.call(leftView, (entry, index) => isSameValueZero(entry, rightView[index]));
|
|
9415
|
-
};
|
|
9416
|
-
const compareErrors = (left, right, state) => {
|
|
9417
|
-
const leftError = left;
|
|
9418
|
-
const rightError = right;
|
|
9419
|
-
if (leftError.name !== rightError.name)
|
|
9420
|
-
return false;
|
|
9421
|
-
if (leftError.message !== rightError.message)
|
|
9422
|
-
return false;
|
|
9423
|
-
return compare(leftError.cause, rightError.cause, state);
|
|
9424
|
-
};
|
|
9425
|
-
const compareArrays = (left, right, state) => {
|
|
9426
|
-
const leftArray = left;
|
|
9427
|
-
const rightArray = right;
|
|
9428
|
-
if (leftArray.length !== rightArray.length)
|
|
9429
|
-
return false;
|
|
9430
|
-
for (let index = 0; index !== leftArray.length; index++) {
|
|
9431
|
-
const inLeft = Object.prototype.hasOwnProperty.call(leftArray, index);
|
|
9432
|
-
if (inLeft !== Object.prototype.hasOwnProperty.call(rightArray, index))
|
|
9433
|
-
return false;
|
|
9434
|
-
if (inLeft && !compare(leftArray[index], rightArray[index], state))
|
|
9435
|
-
return false;
|
|
9455
|
+
removeValidators(validators) {
|
|
9456
|
+
const validatorsToRemove = this.getValidatorList(validators);
|
|
9457
|
+
validatorsToRemove.forEach(validatorToRemove => {
|
|
9458
|
+
const index = this.validatorList.indexOf(validatorToRemove);
|
|
9459
|
+
if (index > -1)
|
|
9460
|
+
this.validatorList.splice(index, 1);
|
|
9461
|
+
});
|
|
9462
|
+
this.setPropsFromValidatorList();
|
|
9463
|
+
super.removeValidators(validators);
|
|
9436
9464
|
}
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
return
|
|
9454
|
-
}
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
};
|
|
9467
|
-
const
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
const
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9465
|
+
clearValidators() {
|
|
9466
|
+
this.validatorList = [];
|
|
9467
|
+
this.setPropsFromValidatorList();
|
|
9468
|
+
super.clearValidators();
|
|
9469
|
+
}
|
|
9470
|
+
hasMaxLength() {
|
|
9471
|
+
return this.maxLength !== undefined;
|
|
9472
|
+
}
|
|
9473
|
+
getMaxLengthOrUndefined() {
|
|
9474
|
+
return this.maxLength;
|
|
9475
|
+
}
|
|
9476
|
+
getRevalidationPartners() {
|
|
9477
|
+
return this.revalidationPartners;
|
|
9478
|
+
}
|
|
9479
|
+
}
|
|
9480
|
+
function isOptionsObj$1(validatorOrOpts) {
|
|
9481
|
+
return validatorOrOpts != null && !Array.isArray(validatorOrOpts) && typeof validatorOrOpts === 'object';
|
|
9482
|
+
}
|
|
9483
|
+
|
|
9484
|
+
function get(object, path, defaultValue) {
|
|
9485
|
+
const value = path.split('.').reduce((current, key) => current?.[key], object);
|
|
9486
|
+
return value === null || value === undefined || Number.isNaN(value) ? defaultValue : value;
|
|
9487
|
+
}
|
|
9488
|
+
/**
|
|
9489
|
+
* Base form properties
|
|
9490
|
+
*
|
|
9491
|
+
* * @param config: QdFormConfiguration
|
|
9492
|
+
*/
|
|
9493
|
+
const getLabel = (config) => get(config, 'label.i18n', '');
|
|
9494
|
+
const getIsLabelDisabled = (config) => !!get(config, 'label', { disabled: true }).disabled;
|
|
9495
|
+
const getHint = (config) => get(config, 'hint.i18n', '');
|
|
9496
|
+
const getIsHintDisabled = (config) => !!get(config, 'hint', { disabled: true }).disabled;
|
|
9497
|
+
const getDisabled = (config) => get(config, 'disabled', false);
|
|
9498
|
+
const getReadonly = (config, defaultValue) => get(config, 'readonly', defaultValue === true);
|
|
9499
|
+
const getViewonly = (config, defaultValue) => get(config, 'viewonly', defaultValue === true);
|
|
9500
|
+
const getHintAction = (config) => get(config, 'hintAction', false);
|
|
9501
|
+
const getReadonlyAction = (config) => get(config, 'readonlyAction', false);
|
|
9502
|
+
const getViewonlyAction = (config) => get(config, 'viewonlyAction', false);
|
|
9503
|
+
/**
|
|
9504
|
+
* Input form properties
|
|
9505
|
+
*
|
|
9506
|
+
* * @param config: QdFormInputConfiguration
|
|
9507
|
+
*/
|
|
9508
|
+
const getInputType = (config) => get(config, 'inputType', 'text');
|
|
9509
|
+
const getInputMode = (config) => get(config, 'inputMode', null);
|
|
9510
|
+
const getClearable = (config) => get(config, 'clearable', false);
|
|
9511
|
+
const getValue = (config) => get(config, 'value', '');
|
|
9512
|
+
const getPlaceholder = (config) => get(config, 'placeholder.i18n', '');
|
|
9513
|
+
const getHasAutofocus = (config) => get(config, 'hasAutofocus', false);
|
|
9514
|
+
/**
|
|
9515
|
+
* Textarea form properties
|
|
9516
|
+
*
|
|
9517
|
+
* * @param config: QdFormTextAreaConfiguration
|
|
9518
|
+
*/
|
|
9519
|
+
const getRows = (config) => get(config, 'rows', 4);
|
|
9520
|
+
/**
|
|
9521
|
+
* Checkboxes form properties
|
|
9522
|
+
*
|
|
9523
|
+
* * @param config: QdFormCheckboxesConfiguration
|
|
9524
|
+
*/
|
|
9525
|
+
const getCheckboxesOptions = (config) => get(config, 'options', []);
|
|
9526
|
+
const getCheckboxesFilter = (config) => get(config, 'filter', false);
|
|
9527
|
+
const getCheckboxesAlign = (config) => get(config, 'align', 'horizontal');
|
|
9528
|
+
/**
|
|
9529
|
+
* Dropdown form properties
|
|
9530
|
+
*
|
|
9531
|
+
* * @param config: QdFormDropdownConfiguration
|
|
9532
|
+
*/
|
|
9533
|
+
const getDropdownFilter = (config) => get(config, 'filter', false);
|
|
9534
|
+
const getDropdownOptions = (config) => get(config, 'options', []);
|
|
9535
|
+
/**
|
|
9536
|
+
* MultiInput form properties
|
|
9537
|
+
*
|
|
9538
|
+
* * @param config: QdFormMultiInputConfiguration
|
|
9539
|
+
*/
|
|
9540
|
+
const getMultiInputOptions = (config) => get(config, 'options', []);
|
|
9541
|
+
/**
|
|
9542
|
+
* Pincode form properties
|
|
9543
|
+
*
|
|
9544
|
+
* * @param config: QdFormPinCodeConfiguration
|
|
9545
|
+
*/
|
|
9546
|
+
const getDigitsOnly = (config) => get(config, 'digitsOnly', false);
|
|
9547
|
+
const getCodeLength = (config) => get(config, 'codeLength', 6);
|
|
9548
|
+
const getFocusOnInit = (config) => get(config, 'focusOnInit', false);
|
|
9549
|
+
const getCodeHidden = (config) => get(config, 'codeHidden', false);
|
|
9550
|
+
const getPinCodeInputType = (config) => get(config, 'inputType', 'tel');
|
|
9551
|
+
/**
|
|
9552
|
+
* Common Checkboxes & Radiobuttons form properties
|
|
9553
|
+
*
|
|
9554
|
+
* * @param config: QdFormCheckboxesConfiguration | QdFormRadioButtonsConfiguration
|
|
9555
|
+
*/
|
|
9556
|
+
const getAlign = (config) => get(config, 'align', 'horizontal');
|
|
9557
|
+
/**
|
|
9558
|
+
* Common Checkboxes, Dropdown & Radiobuttons form properties
|
|
9559
|
+
*
|
|
9560
|
+
* * @param config: QdFormCheckboxesConfiguration | QdFormDropdownConfiguration | QdFormRadioButtonsConfiguration
|
|
9561
|
+
*/
|
|
9562
|
+
const getFilter$1 = (config) => get(config, 'filter', false);
|
|
9563
|
+
/**
|
|
9564
|
+
* Common Checkboxes, CheckboxChips, Dropdown & Radiobuttons form properties
|
|
9565
|
+
*
|
|
9566
|
+
* * @param config: QdFormCheckboxesConfiguration | QdFormCheckboxChipsConfiguration | QdFormDropdownConfiguration | QdFormRadioButtonsConfiguration
|
|
9567
|
+
*/
|
|
9568
|
+
const getOptions = (config) => get(config, 'options', []);
|
|
9569
|
+
|
|
9570
|
+
class QdFormsActionEmitterService {
|
|
9571
|
+
hintEventEmitterSubject = new Subject();
|
|
9572
|
+
readonlyEventEmitterSubject = new Subject();
|
|
9573
|
+
viewonlyEventEmitterSubject = new Subject();
|
|
9574
|
+
hintEventEmitter$ = this.hintEventEmitterSubject.asObservable();
|
|
9575
|
+
readonlyEventEmitter$ = this.readonlyEventEmitterSubject.asObservable();
|
|
9576
|
+
viewonlyEventEmitter$ = this.viewonlyEventEmitterSubject.asObservable();
|
|
9577
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdFormsActionEmitterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9578
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdFormsActionEmitterService });
|
|
9579
|
+
}
|
|
9580
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdFormsActionEmitterService, decorators: [{
|
|
9581
|
+
type: Injectable
|
|
9582
|
+
}] });
|
|
9583
|
+
|
|
9584
|
+
const setOptionsByValue = (options, value) => options.map(option => {
|
|
9585
|
+
if (option.value === value)
|
|
9586
|
+
return { ...option, ...{ active: true } };
|
|
9587
|
+
return { ...option, ...{ active: false } };
|
|
9588
|
+
});
|
|
9589
|
+
const setOptionsByValues = (options, values) => options.map(option => {
|
|
9590
|
+
if (values.indexOf(option.value) !== -1)
|
|
9591
|
+
return { ...option, ...{ active: true } };
|
|
9592
|
+
return { ...option, ...{ active: false } };
|
|
9593
|
+
});
|
|
9594
|
+
const setMultiSelectOptions = (options, optionIndex) => options.map((option, index) => {
|
|
9595
|
+
if (index !== optionIndex)
|
|
9596
|
+
return { ...option, ...{ active: option.active || false } };
|
|
9597
|
+
return { ...option, ...{ active: !option.active } };
|
|
9598
|
+
});
|
|
9599
|
+
const setSingleSelectOptions = (options, optionIndex) => options.map((option, index) => {
|
|
9600
|
+
if (index === optionIndex)
|
|
9601
|
+
return { ...option, ...{ active: true } };
|
|
9602
|
+
return { ...option, ...{ active: false } };
|
|
9603
|
+
});
|
|
9604
|
+
|
|
9605
|
+
// @ts-strict-ignore
|
|
9606
|
+
class QdCheckboxChipsService {
|
|
9607
|
+
setOptionsByValues(options, values) {
|
|
9608
|
+
return setOptionsByValues(options, values);
|
|
9489
9609
|
}
|
|
9490
|
-
|
|
9491
|
-
return
|
|
9492
|
-
const rightRest = setEntriesOf(right).filter(entry => !matchedInRight.has(entry));
|
|
9493
|
-
return pairMatcher(leftRest, rightRest, state, (leftEntry, rightEntry) => compare(leftEntry, rightEntry, state));
|
|
9494
|
-
};
|
|
9495
|
-
const splitMapEntries = (left, rightMap, state) => {
|
|
9496
|
-
const rest = [];
|
|
9497
|
-
const matched = new Set();
|
|
9498
|
-
for (const entry of mapEntriesOf(left)) {
|
|
9499
|
-
const [key, value] = entry;
|
|
9500
|
-
const foundByIdentity = Map.prototype.has.call(rightMap, key) && compare(value, Map.prototype.get.call(rightMap, key), state);
|
|
9501
|
-
if (foundByIdentity) {
|
|
9502
|
-
matched.add(key);
|
|
9503
|
-
continue;
|
|
9504
|
-
}
|
|
9505
|
-
rest.push(entry);
|
|
9610
|
+
updateOptions(options, optionIndex) {
|
|
9611
|
+
return setMultiSelectOptions(options, optionIndex);
|
|
9506
9612
|
}
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
return false;
|
|
9512
|
-
const rightMap = right;
|
|
9513
|
-
const { rest: leftRest, matched: matchedKeys } = splitMapEntries(left, rightMap, state);
|
|
9514
|
-
if (leftRest.length === 0)
|
|
9515
|
-
return true;
|
|
9516
|
-
const rightRest = mapEntriesOf(right).filter(([key]) => !matchedKeys.has(key));
|
|
9517
|
-
return pairMatcher(leftRest, rightRest, state, (leftEntry, rightEntry) => compare(leftEntry[0], rightEntry[0], state) &&
|
|
9518
|
-
compare(leftEntry[1], rightEntry[1], state));
|
|
9519
|
-
};
|
|
9520
|
-
const compareUrls = (left, right) => {
|
|
9521
|
-
return readUrlHref.call(left) === readUrlHref.call(right);
|
|
9522
|
-
};
|
|
9523
|
-
const CONTENT_COMPARATORS = {
|
|
9524
|
-
array: compareArrays,
|
|
9525
|
-
arrayBuffer: compareArrayBuffers,
|
|
9526
|
-
boxedBigInt: (left, right) => readBigIntValue.call(left) === readBigIntValue.call(right),
|
|
9527
|
-
boxedBoolean: (left, right) => readBooleanValue.call(left) === readBooleanValue.call(right),
|
|
9528
|
-
boxedNumber: (left, right) => isSameValueZero(readNumberValue.call(left), readNumberValue.call(right)),
|
|
9529
|
-
boxedString: (left, right) => readStringValue.call(left) === readStringValue.call(right),
|
|
9530
|
-
boxedSymbol: (left, right) => readSymbolValue.call(left) === readSymbolValue.call(right),
|
|
9531
|
-
dataView: compareDataViews,
|
|
9532
|
-
date: compareDates,
|
|
9533
|
-
error: compareErrors,
|
|
9534
|
-
map: compareMaps,
|
|
9535
|
-
opaque: () => false,
|
|
9536
|
-
plain: () => true,
|
|
9537
|
-
regExp: compareRegExps,
|
|
9538
|
-
set: compareSets,
|
|
9539
|
-
typedArray: compareTypedArrays,
|
|
9540
|
-
url: compareUrls
|
|
9541
|
-
};
|
|
9542
|
-
const KINDS_INDEXED_BY_KEY = new Set(['array', 'typedArray', 'boxedString']);
|
|
9543
|
-
const compareByKind = (kind, left, right, state) => {
|
|
9544
|
-
if (!CONTENT_COMPARATORS[kind](left, right, state))
|
|
9545
|
-
return false;
|
|
9546
|
-
return compareOwnKeys(left, right, state, KINDS_INDEXED_BY_KEY.has(kind));
|
|
9547
|
-
};
|
|
9548
|
-
const rememberResult = (left, right, state, verdict) => {
|
|
9549
|
-
const known = state.results.get(left);
|
|
9550
|
-
if (known === undefined) {
|
|
9551
|
-
state.results.set(left, new Map([[right, verdict]]));
|
|
9552
|
-
return;
|
|
9613
|
+
getValues(options) {
|
|
9614
|
+
if (!options || options.length === 0)
|
|
9615
|
+
return [];
|
|
9616
|
+
return options.map(option => (option.active ? option.value : null));
|
|
9553
9617
|
}
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
if (knownPosition !== undefined) {
|
|
9564
|
-
const partnerPosition = state.partners.get(right);
|
|
9565
|
-
if (partnerPosition !== undefined) {
|
|
9566
|
-
state.assumptions += 1;
|
|
9567
|
-
return knownPosition === partnerPosition;
|
|
9568
|
-
}
|
|
9618
|
+
getSelectedTranslations(options) {
|
|
9619
|
+
if (!options || options.length === 0)
|
|
9620
|
+
return [];
|
|
9621
|
+
const selectedTranslations = [];
|
|
9622
|
+
options.forEach(option => {
|
|
9623
|
+
if (option.active)
|
|
9624
|
+
selectedTranslations.push(option.i18n);
|
|
9625
|
+
});
|
|
9626
|
+
return selectedTranslations;
|
|
9569
9627
|
}
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
const position = state.nextPosition;
|
|
9577
|
-
state.positions.set(left, position);
|
|
9578
|
-
state.partners.set(right, position);
|
|
9579
|
-
state.depth += 1;
|
|
9580
|
-
const assumptionsBefore = state.assumptions;
|
|
9581
|
-
const verdict = compareByKind(kind, left, right, state);
|
|
9582
|
-
state.depth -= 1;
|
|
9583
|
-
state.positions.delete(left);
|
|
9584
|
-
state.partners.delete(right);
|
|
9585
|
-
if (state.assumptions === assumptionsBefore)
|
|
9586
|
-
rememberResult(left, right, state, verdict);
|
|
9587
|
-
return verdict;
|
|
9588
|
-
};
|
|
9589
|
-
const compare = (left, right, state) => {
|
|
9590
|
-
if (isSameValueZero(left, right))
|
|
9591
|
-
return true;
|
|
9592
|
-
if (left === null || right === null)
|
|
9593
|
-
return false;
|
|
9594
|
-
if (typeof left !== 'object' || typeof right !== 'object')
|
|
9595
|
-
return false;
|
|
9596
|
-
return compareObjects(left, right, state);
|
|
9597
|
-
};
|
|
9628
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdCheckboxChipsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9629
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdCheckboxChipsService });
|
|
9630
|
+
}
|
|
9631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdCheckboxChipsService, decorators: [{
|
|
9632
|
+
type: Injectable
|
|
9633
|
+
}] });
|
|
9598
9634
|
|
|
9599
9635
|
/**
|
|
9600
9636
|
* Inspired by Kafka's message broker architecture, the QdEventBrokerService provides a lightweight, event-driven
|
|
@@ -25348,6 +25384,260 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
25348
25384
|
}]
|
|
25349
25385
|
}] });
|
|
25350
25386
|
|
|
25387
|
+
/**
|
|
25388
|
+
* Counts how many items fit side by side into the available width.
|
|
25389
|
+
*
|
|
25390
|
+
* If not all items fit, the space for the overflow indicator is always reserved.
|
|
25391
|
+
* At least one item stays visible, even if it is too wide. It is then shortened by the layout.
|
|
25392
|
+
*/
|
|
25393
|
+
function qdCountFittingItems(itemWidths, gap, availableWidth, indicatorWidth) {
|
|
25394
|
+
if (sumWithGaps(itemWidths, gap) <= availableWidth)
|
|
25395
|
+
return itemWidths.length;
|
|
25396
|
+
return Math.max(countWithinWidth(itemWidths, gap, availableWidth - indicatorWidth), 1);
|
|
25397
|
+
}
|
|
25398
|
+
function countWithinWidth(itemWidths, gap, width) {
|
|
25399
|
+
let used = 0;
|
|
25400
|
+
let count = 0;
|
|
25401
|
+
while (used + itemWidths[count] + gap <= width) {
|
|
25402
|
+
used += itemWidths[count] + gap;
|
|
25403
|
+
count++;
|
|
25404
|
+
}
|
|
25405
|
+
return count;
|
|
25406
|
+
}
|
|
25407
|
+
/**
|
|
25408
|
+
* Adds up the widths and one gap between each two of them.
|
|
25409
|
+
*/
|
|
25410
|
+
function sumWithGaps(widths, gap) {
|
|
25411
|
+
if (widths.length === 0)
|
|
25412
|
+
return 0;
|
|
25413
|
+
return widths.reduce((sum, width) => sum + width, 0) + gap * (widths.length - 1);
|
|
25414
|
+
}
|
|
25415
|
+
|
|
25416
|
+
/**
|
|
25417
|
+
* **QdOverflowFitService**
|
|
25418
|
+
*
|
|
25419
|
+
* Finds out how many items of a row fit into the available width. The rest can be shown as "+n".
|
|
25420
|
+
*
|
|
25421
|
+
* #### Features:
|
|
25422
|
+
* - Measures the natural width of every item with a hidden clone, before anything is cut.
|
|
25423
|
+
* - Reserves the space for the "+n" indicator, so the indicator always fits as well.
|
|
25424
|
+
* - Keeps the row invisible until the first result is ready. The user never sees the row jump.
|
|
25425
|
+
* - Follows width changes of the row, for example window resize or device rotation.
|
|
25426
|
+
* - Measures again when the items change, for example new values or another language.
|
|
25427
|
+
*
|
|
25428
|
+
* #### Notes & Best Practices
|
|
25429
|
+
* - Provide the service per component. Every row needs its own instance.
|
|
25430
|
+
* - To find the available space, the row briefly gets its natural width, rounded up to a whole pixel. The layout
|
|
25431
|
+
* stores widths in fractions of a pixel, so without rounding a row that fits would lose its last item.
|
|
25432
|
+
* Limit the row in CSS with `max-width: 100%`.
|
|
25433
|
+
* Afterwards the row is exactly as wide as the visible items plus "+n". No gap is left at the end.
|
|
25434
|
+
* - Width changes are noticed on the row, on all its ancestors below the body and on window resize.
|
|
25435
|
+
* So the row also grows back when, for example, a side navigation collapses.
|
|
25436
|
+
* - Items that do not fit must stay in the DOM, but out of the flow (`position: absolute; visibility: hidden`).
|
|
25437
|
+
* - A width change only recalculates. Only a content change measures again.
|
|
25438
|
+
* - When web fonts finish loading, the items are measured again. Text gets another width with the real font.
|
|
25439
|
+
* - While the row is not rendered yet (for example hidden), nothing is measured and nothing is shown.
|
|
25440
|
+
* The next change of size, text or class measures again.
|
|
25441
|
+
* - An item without width (for example an empty text) takes no space. It never keeps the row hidden.
|
|
25442
|
+
* - Several changes in the same frame are collapsed into one pass. A value is emitted only when it changes.
|
|
25443
|
+
* - All observers run outside Angular. Unsubscribing removes them and all inline styles.
|
|
25444
|
+
*/
|
|
25445
|
+
class QdOverflowFitService {
|
|
25446
|
+
zone = inject(NgZone);
|
|
25447
|
+
observe(elements) {
|
|
25448
|
+
return new Observable(subscriber => {
|
|
25449
|
+
const run = this.zone.runOutsideAngular(() => {
|
|
25450
|
+
const overflowFitRun = new OverflowFitRun(elements, count => this.zone.run(() => subscriber.next(count)));
|
|
25451
|
+
overflowFitRun.start();
|
|
25452
|
+
return overflowFitRun;
|
|
25453
|
+
});
|
|
25454
|
+
return () => run.stop();
|
|
25455
|
+
});
|
|
25456
|
+
}
|
|
25457
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdOverflowFitService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
25458
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdOverflowFitService });
|
|
25459
|
+
}
|
|
25460
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdOverflowFitService, decorators: [{
|
|
25461
|
+
type: Injectable
|
|
25462
|
+
}] });
|
|
25463
|
+
class OverflowFitRun {
|
|
25464
|
+
_elements;
|
|
25465
|
+
_emit;
|
|
25466
|
+
_resizeObserver = new ResizeObserver(() => this.schedule(false));
|
|
25467
|
+
_mutationObserver = new MutationObserver(() => this.schedule(true));
|
|
25468
|
+
_onWindowResize = () => this.schedule(false);
|
|
25469
|
+
_onFontsLoaded = () => this.schedule(true);
|
|
25470
|
+
_itemWidths = [];
|
|
25471
|
+
_indicatorWidth = 0;
|
|
25472
|
+
_gap = 0;
|
|
25473
|
+
_lastCount = null;
|
|
25474
|
+
_needsMeasure = true;
|
|
25475
|
+
_frame = null;
|
|
25476
|
+
_revealFrame = null;
|
|
25477
|
+
get container() {
|
|
25478
|
+
return this._elements.container;
|
|
25479
|
+
}
|
|
25480
|
+
constructor(_elements, _emit) {
|
|
25481
|
+
this._elements = _elements;
|
|
25482
|
+
this._emit = _emit;
|
|
25483
|
+
}
|
|
25484
|
+
start() {
|
|
25485
|
+
this.container.style.opacity = '0';
|
|
25486
|
+
this.observeSizeOfRowAndAncestors();
|
|
25487
|
+
window.addEventListener('resize', this._onWindowResize);
|
|
25488
|
+
document.fonts?.addEventListener('loadingdone', this._onFontsLoaded);
|
|
25489
|
+
this._mutationObserver.observe(this.container, {
|
|
25490
|
+
childList: true,
|
|
25491
|
+
characterData: true,
|
|
25492
|
+
subtree: true,
|
|
25493
|
+
attributeFilter: ['class']
|
|
25494
|
+
});
|
|
25495
|
+
this.schedule(true);
|
|
25496
|
+
}
|
|
25497
|
+
stop() {
|
|
25498
|
+
this._resizeObserver.disconnect();
|
|
25499
|
+
window.removeEventListener('resize', this._onWindowResize);
|
|
25500
|
+
document.fonts?.removeEventListener('loadingdone', this._onFontsLoaded);
|
|
25501
|
+
this._mutationObserver.disconnect();
|
|
25502
|
+
cancelFrame(this._frame);
|
|
25503
|
+
cancelFrame(this._revealFrame);
|
|
25504
|
+
this.container.style.opacity = '';
|
|
25505
|
+
this.container.style.width = '';
|
|
25506
|
+
}
|
|
25507
|
+
observeSizeOfRowAndAncestors() {
|
|
25508
|
+
selfAndAncestors(this.container)
|
|
25509
|
+
.filter(element => ![document.body, document.documentElement].includes(element))
|
|
25510
|
+
.forEach(element => this._resizeObserver.observe(element));
|
|
25511
|
+
}
|
|
25512
|
+
schedule(remeasure) {
|
|
25513
|
+
if (remeasure)
|
|
25514
|
+
this._needsMeasure = true;
|
|
25515
|
+
this.requestFit();
|
|
25516
|
+
}
|
|
25517
|
+
requestFit() {
|
|
25518
|
+
if (this._frame === null)
|
|
25519
|
+
this._frame = requestAnimationFrame(() => this.fit());
|
|
25520
|
+
}
|
|
25521
|
+
fit() {
|
|
25522
|
+
this._frame = null;
|
|
25523
|
+
const parent = this.renderedParent();
|
|
25524
|
+
if (!parent) {
|
|
25525
|
+
this._needsMeasure = true;
|
|
25526
|
+
return;
|
|
25527
|
+
}
|
|
25528
|
+
this.fitInto(parent);
|
|
25529
|
+
}
|
|
25530
|
+
fitInto(parent) {
|
|
25531
|
+
if (this._needsMeasure)
|
|
25532
|
+
this.measure(parent);
|
|
25533
|
+
this.emitIfChanged(this.countAndResize());
|
|
25534
|
+
this.reveal();
|
|
25535
|
+
}
|
|
25536
|
+
renderedParent() {
|
|
25537
|
+
return this.container.getClientRects().length > 0 ? this.container.parentElement : null;
|
|
25538
|
+
}
|
|
25539
|
+
measure(parent) {
|
|
25540
|
+
this._itemWidths = this._elements.items().map(item => qdMeasureNaturalSize(item, parent).outerWidth);
|
|
25541
|
+
this._indicatorWidth = qdMeasureNaturalSize(this._elements.indicator, parent).outerWidth;
|
|
25542
|
+
this._gap = this.columnGap();
|
|
25543
|
+
this._needsMeasure = false;
|
|
25544
|
+
}
|
|
25545
|
+
columnGap() {
|
|
25546
|
+
return parseFloat(getComputedStyle(this.container).columnGap) || 0;
|
|
25547
|
+
}
|
|
25548
|
+
countAndResize() {
|
|
25549
|
+
const naturalWidth = Math.ceil(sumWithGaps(this._itemWidths, this._gap));
|
|
25550
|
+
this.container.style.width = `${naturalWidth}px`;
|
|
25551
|
+
const availableWidth = this.container.getBoundingClientRect().width;
|
|
25552
|
+
const count = qdCountFittingItems(this._itemWidths, this._gap, availableWidth, this._indicatorWidth);
|
|
25553
|
+
const usedWidth = count === this._itemWidths.length
|
|
25554
|
+
? naturalWidth
|
|
25555
|
+
: Math.min(sumWithGaps(this._itemWidths.slice(0, count), this._gap) + this._gap + this._indicatorWidth, availableWidth);
|
|
25556
|
+
this.container.style.width = `${Math.ceil(usedWidth)}px`;
|
|
25557
|
+
return count;
|
|
25558
|
+
}
|
|
25559
|
+
emitIfChanged(count) {
|
|
25560
|
+
if (count === this._lastCount)
|
|
25561
|
+
return;
|
|
25562
|
+
this._lastCount = count;
|
|
25563
|
+
this._emit(count);
|
|
25564
|
+
}
|
|
25565
|
+
reveal() {
|
|
25566
|
+
if (this._revealFrame !== null)
|
|
25567
|
+
return;
|
|
25568
|
+
this._revealFrame = requestAnimationFrame(() => (this.container.style.opacity = ''));
|
|
25569
|
+
}
|
|
25570
|
+
}
|
|
25571
|
+
function cancelFrame(frame) {
|
|
25572
|
+
if (frame !== null)
|
|
25573
|
+
cancelAnimationFrame(frame);
|
|
25574
|
+
}
|
|
25575
|
+
function selfAndAncestors(element) {
|
|
25576
|
+
return element ? [element, ...selfAndAncestors(element.parentElement)] : [];
|
|
25577
|
+
}
|
|
25578
|
+
|
|
25579
|
+
/**
|
|
25580
|
+
* Shows only as many children of a row as fit into the available width.
|
|
25581
|
+
*
|
|
25582
|
+
* #### Features:
|
|
25583
|
+
* - Children marked with `data-fit-item` are counted. `visibleCount` says how many of them fit.
|
|
25584
|
+
* - The child marked with `data-fit-measure` is the "+n" template. Its width is reserved.
|
|
25585
|
+
* - The row stays invisible until the first result is ready.
|
|
25586
|
+
*
|
|
25587
|
+
* #### Notes & Best Practices
|
|
25588
|
+
* - Mark children that do not fit with `data-fit-hidden` (see `isHidden`). They must stay in the DOM.
|
|
25589
|
+
* - Style hidden children and the "+n" template with `position: absolute; visibility: hidden`.
|
|
25590
|
+
* - Items and the "+n" template are measured as copies next to the row, not inside it.
|
|
25591
|
+
* So their styles must not depend on the row, for example `.row .item { … }` does not apply to the copy.
|
|
25592
|
+
* Put such styles directly on the item or its attribute, like `[data-fit-measure] { … }`.
|
|
25593
|
+
*/
|
|
25594
|
+
class QdOverflowFitDirective {
|
|
25595
|
+
visibleCount = Number.MAX_SAFE_INTEGER;
|
|
25596
|
+
host = inject(ElementRef);
|
|
25597
|
+
overflowFit = inject(QdOverflowFitService);
|
|
25598
|
+
changeDetectorRef = inject(ChangeDetectorRef);
|
|
25599
|
+
_subscription;
|
|
25600
|
+
ngAfterViewInit() {
|
|
25601
|
+
const indicator = this.host.nativeElement.querySelector(':scope > [data-fit-measure]');
|
|
25602
|
+
if (!indicator)
|
|
25603
|
+
return;
|
|
25604
|
+
this._subscription = this.overflowFit
|
|
25605
|
+
.observe(this.rowElements(indicator))
|
|
25606
|
+
.subscribe(count => this.applyCount(count));
|
|
25607
|
+
}
|
|
25608
|
+
ngOnDestroy() {
|
|
25609
|
+
this._subscription?.unsubscribe();
|
|
25610
|
+
}
|
|
25611
|
+
isHidden(index) {
|
|
25612
|
+
return index >= this.visibleCount;
|
|
25613
|
+
}
|
|
25614
|
+
hiddenCount(total) {
|
|
25615
|
+
return Math.max(total - this.visibleCount, 0);
|
|
25616
|
+
}
|
|
25617
|
+
rowElements(indicator) {
|
|
25618
|
+
const container = this.host.nativeElement;
|
|
25619
|
+
return {
|
|
25620
|
+
container,
|
|
25621
|
+
items: () => Array.from(container.querySelectorAll(':scope > [data-fit-item]')),
|
|
25622
|
+
indicator
|
|
25623
|
+
};
|
|
25624
|
+
}
|
|
25625
|
+
applyCount(count) {
|
|
25626
|
+
this.visibleCount = count;
|
|
25627
|
+
this.changeDetectorRef.markForCheck();
|
|
25628
|
+
}
|
|
25629
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdOverflowFitDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
25630
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: QdOverflowFitDirective, isStandalone: true, selector: "[qdOverflowFit]", providers: [QdOverflowFitService], exportAs: ["qdOverflowFit"], ngImport: i0 });
|
|
25631
|
+
}
|
|
25632
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdOverflowFitDirective, decorators: [{
|
|
25633
|
+
type: Directive,
|
|
25634
|
+
args: [{
|
|
25635
|
+
selector: '[qdOverflowFit]',
|
|
25636
|
+
exportAs: 'qdOverflowFit',
|
|
25637
|
+
providers: [QdOverflowFitService]
|
|
25638
|
+
}]
|
|
25639
|
+
}] });
|
|
25640
|
+
|
|
25351
25641
|
const updateStateWithNewSearch = (state, searchId, newSearch) => ({
|
|
25352
25642
|
...state,
|
|
25353
25643
|
[searchId]: newSearch
|
|
@@ -31376,6 +31666,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
31376
31666
|
args: [{ selector: 'qd-context-select-dialog', providers: [QdSearchService], standalone: false, template: "<qd-dialog>\n @if (data.config.hasSearch) {\n <div class=\"search\">\n <qd-search [configData]=\"searchConfig\"></qd-search>\n </div>\n }\n <qd-table\n [data]=\"tableData\"\n [config]=\"tableConfig\"\n (selectedRowsOutput)=\"select($event)\"\n data-test-id=\"context-select-dialog-table\"\n ></qd-table>\n <qd-dialog-action>\n <button qdButton qdButtonGhost color=\"secondary\" (click)=\"cancel()\">\n {{ \"i18n.qd.context.dialog.cancelButtonLabel\" | translate }}\n </button>\n <button qdButton (click)=\"confirm()\" data-test-id=\"context-select-dialog-submit\">\n {{ \"i18n.qd.context.dialog.confirmButtonLabel\" | translate }}\n </button>\n </qd-dialog-action>\n</qd-dialog>\n", styles: [".search{display:flex;justify-content:end;padding-bottom:.9375rem}\n"] }]
|
|
31377
31667
|
}] });
|
|
31378
31668
|
|
|
31669
|
+
/**
|
|
31670
|
+
* @description Shows the selection of a context as one chip.
|
|
31671
|
+
*
|
|
31672
|
+
* * Note: The values are listed with commas. Values that do not fit are counted as "+n".
|
|
31673
|
+
* * Note: A click on "+n" lists the hidden values in a tooltip. Values that exceed the tooltip length limit
|
|
31674
|
+
* are counted as "and n more". At least one value is always listed.
|
|
31675
|
+
*/
|
|
31676
|
+
class QdContextSelectionChipComponent {
|
|
31677
|
+
selection = [];
|
|
31678
|
+
removable = false;
|
|
31679
|
+
testId;
|
|
31680
|
+
selectionCleared = new EventEmitter();
|
|
31681
|
+
translateService = inject(TranslateService);
|
|
31682
|
+
/**
|
|
31683
|
+
* Lists the values that do not fit into the chip, as one line for the tooltip.
|
|
31684
|
+
*/
|
|
31685
|
+
hiddenValuesTooltip(visibleCount) {
|
|
31686
|
+
const labels = this.selection.slice(visibleCount).map(value => this.translateService.instant(value.label.i18n));
|
|
31687
|
+
let shownCount = labels.length;
|
|
31688
|
+
while (this.isTooLong(labels, shownCount))
|
|
31689
|
+
shownCount--;
|
|
31690
|
+
return { paragraphs: [hiddenValuesParagraph(labels, shownCount)] };
|
|
31691
|
+
}
|
|
31692
|
+
isTooLong(labels, shownCount) {
|
|
31693
|
+
const paragraph = hiddenValuesParagraph(labels, shownCount);
|
|
31694
|
+
return (shownCount > 1 && this.translateService.instant(paragraph.i18n, paragraph.params).length > MAX_TOOLTIP_CHARACTER);
|
|
31695
|
+
}
|
|
31696
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdContextSelectionChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
31697
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: QdContextSelectionChipComponent, isStandalone: false, selector: "qd-context-selection-chip", inputs: { selection: "selection", removable: "removable", testId: "testId" }, outputs: { selectionCleared: "selectionCleared" }, host: { properties: { "attr.data-test-id": "testId" } }, ngImport: i0, template: "<qd-chip state=\"neutral\" [close]=\"removable\" (closeClickEmitter)=\"selectionCleared.emit(selection)\">\n <span class=\"qd-context-values\" qdOverflowFit #fit=\"qdOverflowFit\" aria-hidden=\"true\">\n @for (val of selection; track val; let index = $index; let last = $last) {\n <span data-fit-item [attr.data-fit-hidden]=\"fit.isHidden(index) || null\"\n >{{ val.label.i18n | translate }}@if (!last) {<span class=\"qd-context-comma\">,</span>}</span\n >\n }\n <span data-fit-measure>+{{ selection.length }}</span>\n @if (fit.hiddenCount(selection.length) > 0) {\n <span\n class=\"qd-context-values-more\"\n qdTooltipOnClick\n [qdTooltipContent]=\"hiddenValuesTooltip(fit.visibleCount)\"\n [attr.data-test-id]=\"testId + '-more'\"\n >+{{ fit.hiddenCount(selection.length) }}</span\n >\n }\n </span>\n <span class=\"qd-visually-hidden\" [attr.data-test-id]=\"testId + '-all'\"\n >@for (val of selection; track val; let last = $last) {{{ val.label.i18n | translate }}@if (!last) {, }}</span\n >\n</qd-chip>\n", styles: [":host{display:flex;min-width:0;max-width:100%}qd-chip{min-width:0;max-width:100%}qd-chip ::ng-deep .qd-chip__label{overflow:hidden;min-width:0}.qd-context-values{position:relative;display:flex;max-width:100%;align-items:center;gap:.25rem}.qd-context-values [data-fit-item]{flex:0 0 auto;white-space:nowrap}.qd-context-values [data-fit-item]:first-child{overflow:hidden;min-width:0;flex:0 1 auto;text-overflow:ellipsis}.qd-context-values [data-fit-item]:has(+[data-fit-hidden]) .qd-context-comma{display:none}.qd-context-values [data-fit-hidden],.qd-context-values [data-fit-measure]{position:absolute;top:0;left:0;pointer-events:none;visibility:hidden}.qd-context-values-more,[data-fit-measure]{flex:0 0 auto;padding:0 .375rem;border-radius:.5625rem;background:#d5d5d5;line-height:1.125rem}.qd-context-values-more{cursor:pointer}\n"], dependencies: [{ kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "directive", type: QdOverflowFitDirective, selector: "[qdOverflowFit]", exportAs: ["qdOverflowFit"] }, { kind: "directive", type: QdTooltipOnClickDirective, selector: "[qdTooltipOnClick]", inputs: ["qdTooltipContent"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
31698
|
+
}
|
|
31699
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdContextSelectionChipComponent, decorators: [{
|
|
31700
|
+
type: Component,
|
|
31701
|
+
args: [{ selector: 'qd-context-selection-chip', host: { '[attr.data-test-id]': 'testId' }, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<qd-chip state=\"neutral\" [close]=\"removable\" (closeClickEmitter)=\"selectionCleared.emit(selection)\">\n <span class=\"qd-context-values\" qdOverflowFit #fit=\"qdOverflowFit\" aria-hidden=\"true\">\n @for (val of selection; track val; let index = $index; let last = $last) {\n <span data-fit-item [attr.data-fit-hidden]=\"fit.isHidden(index) || null\"\n >{{ val.label.i18n | translate }}@if (!last) {<span class=\"qd-context-comma\">,</span>}</span\n >\n }\n <span data-fit-measure>+{{ selection.length }}</span>\n @if (fit.hiddenCount(selection.length) > 0) {\n <span\n class=\"qd-context-values-more\"\n qdTooltipOnClick\n [qdTooltipContent]=\"hiddenValuesTooltip(fit.visibleCount)\"\n [attr.data-test-id]=\"testId + '-more'\"\n >+{{ fit.hiddenCount(selection.length) }}</span\n >\n }\n </span>\n <span class=\"qd-visually-hidden\" [attr.data-test-id]=\"testId + '-all'\"\n >@for (val of selection; track val; let last = $last) {{{ val.label.i18n | translate }}@if (!last) {, }}</span\n >\n</qd-chip>\n", styles: [":host{display:flex;min-width:0;max-width:100%}qd-chip{min-width:0;max-width:100%}qd-chip ::ng-deep .qd-chip__label{overflow:hidden;min-width:0}.qd-context-values{position:relative;display:flex;max-width:100%;align-items:center;gap:.25rem}.qd-context-values [data-fit-item]{flex:0 0 auto;white-space:nowrap}.qd-context-values [data-fit-item]:first-child{overflow:hidden;min-width:0;flex:0 1 auto;text-overflow:ellipsis}.qd-context-values [data-fit-item]:has(+[data-fit-hidden]) .qd-context-comma{display:none}.qd-context-values [data-fit-hidden],.qd-context-values [data-fit-measure]{position:absolute;top:0;left:0;pointer-events:none;visibility:hidden}.qd-context-values-more,[data-fit-measure]{flex:0 0 auto;padding:0 .375rem;border-radius:.5625rem;background:#d5d5d5;line-height:1.125rem}.qd-context-values-more{cursor:pointer}\n"] }]
|
|
31702
|
+
}], propDecorators: { selection: [{
|
|
31703
|
+
type: Input
|
|
31704
|
+
}], removable: [{
|
|
31705
|
+
type: Input
|
|
31706
|
+
}], testId: [{
|
|
31707
|
+
type: Input
|
|
31708
|
+
}], selectionCleared: [{
|
|
31709
|
+
type: Output
|
|
31710
|
+
}] } });
|
|
31711
|
+
function hiddenValuesParagraph(labels, shownCount) {
|
|
31712
|
+
const values = labels.slice(0, shownCount).join(', ');
|
|
31713
|
+
const count = labels.length - shownCount;
|
|
31714
|
+
return count > 0
|
|
31715
|
+
? { i18n: 'i18n.qd.page.context.hiddenValuesAndMore', params: { values, count } }
|
|
31716
|
+
: { i18n: 'i18n.qd.page.context.hiddenValues', params: { values } };
|
|
31717
|
+
}
|
|
31718
|
+
|
|
31379
31719
|
class QdCriticalityFacetComponent {
|
|
31380
31720
|
facet;
|
|
31381
31721
|
data;
|
|
@@ -32644,11 +32984,11 @@ class QdPageObjectHeaderComponent {
|
|
|
32644
32984
|
});
|
|
32645
32985
|
}
|
|
32646
32986
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdPageObjectHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32647
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: QdPageObjectHeaderComponent, isStandalone: false, selector: "qd-page-object-header", inputs: { config: "config", hasNavigation: "hasNavigation", testId: ["data-test-id", "testId"] }, host: { listeners: { "click": "toggleFacets()" }, properties: { "style.borderBottom": "borderBottomStyle", "class.in-dialog": "this.isInDialog" } }, usesOnChanges: true, ngImport: i0, template: "@if (isLoading$ | async) {\n<div class=\"loading-overlay\"><qd-spinner></qd-spinner></div>\n}\n\n<div class=\"object-header-top\">\n <header class=\"object-header-title\">{{ config.title.i18n | translate }}</header>\n <div class=\"object-header-toolbar\">\n <ng-content></ng-content>\n\n <button class=\"button-icon\" data-test-id=\"archive-button\">\n @if (showArchive$ | async) {\n <qd-icon (click)=\"archiveButton?.handler()\" class=\"header-action-icon\" [icon]=\"'resultNew'\"></qd-icon>\n }\n </button>\n\n <button class=\"button-icon\" data-test-id=\"delete-button\">\n @if (showDelete$ | async) {\n <qd-icon class=\"header-action-icon\" (click)=\"deleteButton?.handler()\" [icon]=\"'trash'\"></qd-icon>\n }\n </button>\n\n @if (showEdit$ | async) {\n <button qdButton (click)=\"edit()\" data-test-id=\"edit-button\">\n {{ editButton?.label?.i18n || \"i18n.qd.page.header.edit\" | translate }}\n </button>\n } @if (showCancel$ | async) {\n <button qdButton qdButtonGhost (click)=\"cancel()\" data-test-id=\"cancel-button\">\n {{ cancelButton.label?.i18n || \"i18n.qd.page.header.cancel\" | translate }}\n </button>\n } @if (showSave$ | async) {\n <button qdButton (click)=\"save()\" data-test-id=\"save-button\" [disabled]=\"($canSave | async) === false\">\n {{ saveButton.label?.i18n || \"i18n.qd.page.header.save\" | translate }}\n </button>\n } @if (customActions$ | async; as customActions) { @if (!adaptiveMode) { @if (customActions.actions.length > 1) {\n <button [qdMenuButton]=\"customActions\" [autoSize]=\"false\" [data-test-id]=\"'page-'\" data-test-id=\"custom-button\">\n {{ config?.customActionsLabel?.i18n || \"i18n.qd.page.header.actions\" | translate }}\n </button>\n } @else { @if ((customActions$ | async).actions[0]; as singleAction) { @if (singleAction.handler &&\n !singleAction.isHidden) {\n <button qdButton [disabled]=\"singleAction.isDisabled\" (click)=\"singleAction.handler()\" data-test-id=\"custom-button\">\n {{ singleAction.label?.i18n | translate }}\n </button>\n } } } } @else { @if ((customActions$ | async)?.actions.length >= 1) {\n <button\n type=\"button\"\n class=\"adaptive-menu-button\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverMinWidth]=\"160\"\n >\n <qd-icon icon=\"overflowMenuVertical\"></qd-icon>\n </button>\n }\n <ng-template #menu>\n @for (action of customActions.actions; track action; let i = $index) {\n <button class=\"adaptive-menu-entry\" type=\"button\" [disabled]=\"action.isDisabled\" (click)=\"action.handler()\">\n {{ action.label.i18n | translate }}\n </button>\n }\n </ng-template>\n } }\n </div>\n</div>\n\n<div class=\"object-header-facets\" [ngClass]=\"{ amongThemselves: adaptiveMode && !facetsCollapsed }\">\n @if (pageObjectData$ | async; as data) { @for (facet of headerFacets | slice : 0 : (adaptiveMode && facetsCollapsed ?\n 2 : headerFacets?.length ?? 0); track facet) {\n <div class=\"object-header-facet\" [attr.data-test-id]=\"testId + '-facet-' + facet.name\">\n <div class=\"facet-label\">{{ facet.label.i18n | translate }}</div>\n <qd-dynamic-facet\n class=\"dynamic-facet\"\n [facet]=\"facet\"\n [data]=\"data\"\n [testId]=\"testId + '-facet-' + facet.name\"\n ></qd-dynamic-facet>\n </div>\n } } @if (!config.hideContexts && contexts$ | async; as contexts) { @for ( context of contexts | slice : 0 :\n (adaptiveMode && facetsCollapsed ? 2 - (headerFacets?.length ?? 0) : contexts?.length); track context; let index =\n $index; let first = $first) {\n <div\n class=\"object-header-facet\"\n [ngClass]=\"{ hasDivider: headerFacets && first, adaptiveFirst: headerFacets && adaptiveMode && first }\"\n [attr.data-test-id]=\"testId + '-context-facet-' + context.context.id\"\n >\n <div class=\"facet-label\">{{ context.label | translate }}</div>\n @if (context.value.length === 0) {\n <span class=\"no-selected-context\">{{ \"i18n.qd.page.context.noSelectionPlaceholder\" | translate }}</span>\n } @if (context.value.length !== 0) {\n <span>\n <qd-chip state=\"neutral\" [close]=\"isContextSelectable\" (closeClickEmitter)=\"clearContext(context.context)\">\n @for (val of context.value; track val; let last = $last) {\n {{ val.label.i18n | translate }}@if (!last) {\n <span>, </span>\n } }\n </qd-chip>\n </span>\n } @if (isContextSelectable && (!facetsCollapsed || !adaptiveMode)) {\n <span class=\"select-button\">\n <button\n qdButton\n qdButtonLink\n type=\"button\"\n (click)=\"changeContext(context.context, context.selection, $event)\"\n [data-test-id]=\"'object-header-select-context-' + context.context.id\"\n >\n {{\n context.value.length !== 0\n ? (\"i18n.qd.page.context.button.change\" | translate)\n : (\"i18n.qd.page.context.button.select\" | translate)\n }}\n </button>\n </span>\n }\n </div>\n } } @if (contexts$ | async; as togglerContexts) { @if (adaptiveMode && headerFacets?.length + togglerContexts.length >\n 2) {\n <span class=\"facets-toggler\" [attr.data-test-id]=\"testId + '-facets-toggler'\">\n @if (facetsCollapsed) {\n <span [attr.data-test-id]=\"testId + '-facets-toggler-count'\"\n >+{{ headerFacets.length + togglerContexts.length - 2 }}</span\n >\n }\n <button qdIconButton [data-test-id]=\"'toggle-button'\">\n <qd-icon [icon]=\"facetsCollapsed ? 'ctrlDown' : 'ctrlTop'\"></qd-icon>\n </button>\n </span>\n } }\n</div>\n", styles: [":host{display:flex;flex-direction:column;justify-content:space-between;padding:1.25rem;border-bottom:.125rem solid rgb(213,213,213);background:#fff;gap:1.25rem}@media(max-width:599.98px){:host{padding:1.25rem .9375rem}}:host .object-header-top{display:flex;align-items:flex-start;justify-content:space-between}:host .object-header-top .object-header-title{padding:2px;color:#171717;font-size:1.3125rem;font-weight:500}:host .object-header-top .object-header-toolbar{display:flex;align-items:center;column-gap:.5rem}:host .object-header-top .object-header-toolbar .button-icon{background:none}:host .object-header-top .object-header-toolbar .button-icon+.button-icon{margin-left:-.5rem}:host .object-header-top .object-header-toolbar .header-action-icon{color:#14516f;cursor:pointer;font-size:1.5rem}:host.in-dialog .object-header-toolbar{padding-right:2.5rem}:host .object-header-facets{position:relative;display:flex;flex-wrap:wrap;font-size:1.125rem;gap:1.25rem}:host .object-header-facets .object-header-facet{display:flex;min-width:3.75rem;flex-direction:column}:host .object-header-facets .object-header-facet.hasDivider{padding-left:1.25rem;border-left:.0625rem solid rgb(117,117,117)}:host .object-header-facets .object-header-facet.adaptiveFirst{padding-top:1.25rem}:host .object-header-facets .object-header-facet .facet-label{display:block;margin-bottom:0;color:#757575;font-size:.875rem;padding-bottom:.375rem;font-weight:500}:host .object-header-facets .facets-toggler{position:absolute;top:0;right:0;display:flex;align-items:center;padding-right:.3125rem;font-size:.625rem;line-height:.625rem}:host .object-header-facets.amongThemselves{display:grid}:host .object-header-facets.amongThemselves .object-header-facet.hasDivider{padding-left:0;border-top:.0625rem solid rgb(117,117,117);border-left:none}.loading-overlay{position:absolute;z-index:10000;inset:0;display:flex;align-items:center;justify-content:center;background-color:#0003}.no-selected-context{height:1.625rem;color:#979797;font-size:.875rem;line-height:1.625rem}.select-button{margin-top:.25rem}.adaptive-menu-button{display:flex;background:unset;color:#454545;font-size:2rem}.adaptive-menu-button:hover,.adaptive-menu-button:focus{color:#000}.adaptive-menu-entry{display:block;overflow:hidden;width:100%;min-height:2.25rem;padding:0 1rem;background:#fff0;text-align:left;text-overflow:ellipsis;white-space:nowrap}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: QdButtonComponent, selector: "button[qdButton], a[qdButton]", inputs: ["disabled", "color", "icon", "data-test-id", "additionalInfo"] }, { kind: "directive", type: QdButtonGhostDirective, selector: "button[qdButtonGhost], a[qdButtonGhost]" }, { kind: "directive", type: QdButtonLinkDirective, selector: "button[qdButtonLink], a[qdButtonLink]" }, { kind: "component", type: QdIconButtonComponent, selector: "button[qdIconButton], a[qdIconButton]", inputs: ["color", "data-test-id"] }, { kind: "component", type: QdMenuButtonComponent, selector: "button[qdMenuButton], a[qdMenuButton]", inputs: ["qdMenuButton", "data-test-id", "autoSize"] }, { kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "component", type: QdSpinnerComponent, selector: "qd-spinner" }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "qdPopoverPlacement", "qdPopoverOffsetX", "qdPopoverOffsetY", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl", "qdPopoverRestoreFocus", "qdPopoverFlipIntoViewport"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "component", type: QdDynamicFacetComponent, selector: "qd-dynamic-facet", inputs: ["facet", "data", "testId"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.SlicePipe, name: "slice" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
32987
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: QdPageObjectHeaderComponent, isStandalone: false, selector: "qd-page-object-header", inputs: { config: "config", hasNavigation: "hasNavigation", testId: ["data-test-id", "testId"] }, host: { listeners: { "click": "toggleFacets()" }, properties: { "style.borderBottom": "borderBottomStyle", "class.in-dialog": "this.isInDialog" } }, usesOnChanges: true, ngImport: i0, template: "@if (isLoading$ | async) {\n<div class=\"loading-overlay\"><qd-spinner></qd-spinner></div>\n}\n\n<div class=\"object-header-top\">\n <header class=\"object-header-title\">{{ config.title.i18n | translate }}</header>\n <div class=\"object-header-toolbar\">\n <ng-content></ng-content>\n\n <button class=\"button-icon\" data-test-id=\"archive-button\">\n @if (showArchive$ | async) {\n <qd-icon (click)=\"archiveButton?.handler()\" class=\"header-action-icon\" [icon]=\"'resultNew'\"></qd-icon>\n }\n </button>\n\n <button class=\"button-icon\" data-test-id=\"delete-button\">\n @if (showDelete$ | async) {\n <qd-icon class=\"header-action-icon\" (click)=\"deleteButton?.handler()\" [icon]=\"'trash'\"></qd-icon>\n }\n </button>\n\n @if (showEdit$ | async) {\n <button qdButton (click)=\"edit()\" data-test-id=\"edit-button\">\n {{ editButton?.label?.i18n || \"i18n.qd.page.header.edit\" | translate }}\n </button>\n } @if (showCancel$ | async) {\n <button qdButton qdButtonGhost (click)=\"cancel()\" data-test-id=\"cancel-button\">\n {{ cancelButton.label?.i18n || \"i18n.qd.page.header.cancel\" | translate }}\n </button>\n } @if (showSave$ | async) {\n <button qdButton (click)=\"save()\" data-test-id=\"save-button\" [disabled]=\"($canSave | async) === false\">\n {{ saveButton.label?.i18n || \"i18n.qd.page.header.save\" | translate }}\n </button>\n } @if (customActions$ | async; as customActions) { @if (!adaptiveMode) { @if (customActions.actions.length > 1) {\n <button [qdMenuButton]=\"customActions\" [autoSize]=\"false\" [data-test-id]=\"'page-'\" data-test-id=\"custom-button\">\n {{ config?.customActionsLabel?.i18n || \"i18n.qd.page.header.actions\" | translate }}\n </button>\n } @else { @if ((customActions$ | async).actions[0]; as singleAction) { @if (singleAction.handler &&\n !singleAction.isHidden) {\n <button qdButton [disabled]=\"singleAction.isDisabled\" (click)=\"singleAction.handler()\" data-test-id=\"custom-button\">\n {{ singleAction.label?.i18n | translate }}\n </button>\n } } } } @else { @if ((customActions$ | async)?.actions.length >= 1) {\n <button\n type=\"button\"\n class=\"adaptive-menu-button\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverMinWidth]=\"160\"\n >\n <qd-icon icon=\"overflowMenuVertical\"></qd-icon>\n </button>\n }\n <ng-template #menu>\n @for (action of customActions.actions; track action; let i = $index) {\n <button class=\"adaptive-menu-entry\" type=\"button\" [disabled]=\"action.isDisabled\" (click)=\"action.handler()\">\n {{ action.label.i18n | translate }}\n </button>\n }\n </ng-template>\n } }\n </div>\n</div>\n\n<div class=\"object-header-facets\" [ngClass]=\"{ amongThemselves: adaptiveMode && !facetsCollapsed }\">\n @if (pageObjectData$ | async; as data) { @for (facet of headerFacets | slice : 0 : (adaptiveMode && facetsCollapsed ?\n 2 : headerFacets?.length ?? 0); track facet) {\n <div class=\"object-header-facet\" [attr.data-test-id]=\"testId + '-facet-' + facet.name\">\n <div class=\"facet-label\">{{ facet.label.i18n | translate }}</div>\n <qd-dynamic-facet\n class=\"dynamic-facet\"\n [facet]=\"facet\"\n [data]=\"data\"\n [testId]=\"testId + '-facet-' + facet.name\"\n ></qd-dynamic-facet>\n </div>\n } } @if (!config.hideContexts && contexts$ | async; as contexts) { @for ( context of contexts | slice : 0 :\n (adaptiveMode && facetsCollapsed ? 2 - (headerFacets?.length ?? 0) : contexts?.length); track context; let index =\n $index; let first = $first) {\n <div\n class=\"object-header-facet qd-context-facet\"\n [ngClass]=\"{ hasDivider: headerFacets && first, adaptiveFirst: headerFacets && adaptiveMode && first }\"\n [attr.data-test-id]=\"testId + '-context-facet-' + context.context.id\"\n >\n <div class=\"facet-label\">{{ context.label | translate }}</div>\n @if (context.value.length === 0) {\n <span class=\"no-selected-context\">{{ \"i18n.qd.page.context.noSelectionPlaceholder\" | translate }}</span>\n } @if (context.value.length !== 0) {\n <qd-context-selection-chip\n [selection]=\"context.value\"\n [removable]=\"isContextSelectable\"\n [testId]=\"testId + '-context-selection-' + context.context.id\"\n (selectionCleared)=\"clearContext(context.context)\"\n ></qd-context-selection-chip>\n } @if (isContextSelectable && (!facetsCollapsed || !adaptiveMode)) {\n <span class=\"select-button\">\n <button\n qdButton\n qdButtonLink\n type=\"button\"\n (click)=\"changeContext(context.context, context.selection, $event)\"\n [data-test-id]=\"'object-header-select-context-' + context.context.id\"\n >\n {{\n context.value.length !== 0\n ? (\"i18n.qd.page.context.button.change\" | translate)\n : (\"i18n.qd.page.context.button.select\" | translate)\n }}\n </button>\n </span>\n }\n </div>\n } } @if (contexts$ | async; as togglerContexts) { @if (adaptiveMode && headerFacets?.length + togglerContexts.length >\n 2) {\n <span class=\"facets-toggler\" [attr.data-test-id]=\"testId + '-facets-toggler'\">\n @if (facetsCollapsed) {\n <span [attr.data-test-id]=\"testId + '-facets-toggler-count'\"\n >+{{ headerFacets.length + togglerContexts.length - 2 }}</span\n >\n }\n <button qdIconButton [data-test-id]=\"'toggle-button'\">\n <qd-icon [icon]=\"facetsCollapsed ? 'ctrlDown' : 'ctrlTop'\"></qd-icon>\n </button>\n </span>\n } }\n</div>\n", styles: [":host{display:flex;flex-direction:column;justify-content:space-between;padding:1.25rem;border-bottom:.125rem solid rgb(213,213,213);background:#fff;gap:1.25rem}@media(max-width:599.98px){:host{padding:1.25rem .9375rem}}:host .object-header-top{display:flex;align-items:flex-start;justify-content:space-between}:host .object-header-top .object-header-title{padding:2px;color:#171717;font-size:1.3125rem;font-weight:500}:host .object-header-top .object-header-toolbar{display:flex;align-items:center;column-gap:.5rem}:host .object-header-top .object-header-toolbar .button-icon{background:none}:host .object-header-top .object-header-toolbar .button-icon+.button-icon{margin-left:-.5rem}:host .object-header-top .object-header-toolbar .header-action-icon{color:#14516f;cursor:pointer;font-size:1.5rem}:host.in-dialog .object-header-toolbar{padding-right:2.5rem}:host .object-header-facets{position:relative;display:flex;flex-wrap:wrap;font-size:1.125rem;gap:1.25rem}:host .object-header-facets .object-header-facet{display:flex;min-width:3.75rem;flex-direction:column}:host .object-header-facets .object-header-facet.hasDivider{padding-left:1.25rem;border-left:.0625rem solid rgb(117,117,117)}:host .object-header-facets .object-header-facet.adaptiveFirst{padding-top:1.25rem}:host .object-header-facets .object-header-facet .facet-label{display:block;margin-bottom:0;color:#757575;font-size:.875rem;padding-bottom:.375rem;font-weight:500}:host .object-header-facets .facets-toggler{position:absolute;top:0;right:0;display:flex;align-items:center;padding-right:.3125rem;font-size:.625rem;line-height:.625rem}:host .object-header-facets.amongThemselves{display:grid}:host .object-header-facets.amongThemselves .object-header-facet.hasDivider{padding-left:0;border-top:.0625rem solid rgb(117,117,117);border-left:none}.loading-overlay{position:absolute;z-index:10000;inset:0;display:flex;align-items:center;justify-content:center;background-color:#0003}.no-selected-context{height:1.625rem;color:#979797;font-size:.875rem;line-height:1.625rem}.select-button{margin-top:.25rem}.adaptive-menu-button{display:flex;background:unset;color:#454545;font-size:2rem}.adaptive-menu-button:hover,.adaptive-menu-button:focus{color:#000}.adaptive-menu-entry{display:block;overflow:hidden;width:100%;min-height:2.25rem;padding:0 1rem;background:#fff0;text-align:left;text-overflow:ellipsis;white-space:nowrap}.object-header-facets .object-header-facet{max-width:100%}@media(min-width:600px){.object-header-facets:not(.amongThemselves) .object-header-facet.qd-context-facet{max-width:max-content;flex:1 1 0}}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: QdButtonComponent, selector: "button[qdButton], a[qdButton]", inputs: ["disabled", "color", "icon", "data-test-id", "additionalInfo"] }, { kind: "directive", type: QdButtonGhostDirective, selector: "button[qdButtonGhost], a[qdButtonGhost]" }, { kind: "directive", type: QdButtonLinkDirective, selector: "button[qdButtonLink], a[qdButtonLink]" }, { kind: "component", type: QdIconButtonComponent, selector: "button[qdIconButton], a[qdIconButton]", inputs: ["color", "data-test-id"] }, { kind: "component", type: QdMenuButtonComponent, selector: "button[qdMenuButton], a[qdMenuButton]", inputs: ["qdMenuButton", "data-test-id", "autoSize"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "component", type: QdSpinnerComponent, selector: "qd-spinner" }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "qdPopoverPlacement", "qdPopoverOffsetX", "qdPopoverOffsetY", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl", "qdPopoverRestoreFocus", "qdPopoverFlipIntoViewport"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "component", type: QdDynamicFacetComponent, selector: "qd-dynamic-facet", inputs: ["facet", "data", "testId"] }, { kind: "component", type: QdContextSelectionChipComponent, selector: "qd-context-selection-chip", inputs: ["selection", "removable", "testId"], outputs: ["selectionCleared"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.SlicePipe, name: "slice" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
32648
32988
|
}
|
|
32649
32989
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdPageObjectHeaderComponent, decorators: [{
|
|
32650
32990
|
type: Component,
|
|
32651
|
-
args: [{ selector: 'qd-page-object-header', changeDetection: ChangeDetectionStrategy.OnPush, host: { '[style.borderBottom]': 'borderBottomStyle' }, standalone: false, template: "@if (isLoading$ | async) {\n<div class=\"loading-overlay\"><qd-spinner></qd-spinner></div>\n}\n\n<div class=\"object-header-top\">\n <header class=\"object-header-title\">{{ config.title.i18n | translate }}</header>\n <div class=\"object-header-toolbar\">\n <ng-content></ng-content>\n\n <button class=\"button-icon\" data-test-id=\"archive-button\">\n @if (showArchive$ | async) {\n <qd-icon (click)=\"archiveButton?.handler()\" class=\"header-action-icon\" [icon]=\"'resultNew'\"></qd-icon>\n }\n </button>\n\n <button class=\"button-icon\" data-test-id=\"delete-button\">\n @if (showDelete$ | async) {\n <qd-icon class=\"header-action-icon\" (click)=\"deleteButton?.handler()\" [icon]=\"'trash'\"></qd-icon>\n }\n </button>\n\n @if (showEdit$ | async) {\n <button qdButton (click)=\"edit()\" data-test-id=\"edit-button\">\n {{ editButton?.label?.i18n || \"i18n.qd.page.header.edit\" | translate }}\n </button>\n } @if (showCancel$ | async) {\n <button qdButton qdButtonGhost (click)=\"cancel()\" data-test-id=\"cancel-button\">\n {{ cancelButton.label?.i18n || \"i18n.qd.page.header.cancel\" | translate }}\n </button>\n } @if (showSave$ | async) {\n <button qdButton (click)=\"save()\" data-test-id=\"save-button\" [disabled]=\"($canSave | async) === false\">\n {{ saveButton.label?.i18n || \"i18n.qd.page.header.save\" | translate }}\n </button>\n } @if (customActions$ | async; as customActions) { @if (!adaptiveMode) { @if (customActions.actions.length > 1) {\n <button [qdMenuButton]=\"customActions\" [autoSize]=\"false\" [data-test-id]=\"'page-'\" data-test-id=\"custom-button\">\n {{ config?.customActionsLabel?.i18n || \"i18n.qd.page.header.actions\" | translate }}\n </button>\n } @else { @if ((customActions$ | async).actions[0]; as singleAction) { @if (singleAction.handler &&\n !singleAction.isHidden) {\n <button qdButton [disabled]=\"singleAction.isDisabled\" (click)=\"singleAction.handler()\" data-test-id=\"custom-button\">\n {{ singleAction.label?.i18n | translate }}\n </button>\n } } } } @else { @if ((customActions$ | async)?.actions.length >= 1) {\n <button\n type=\"button\"\n class=\"adaptive-menu-button\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverMinWidth]=\"160\"\n >\n <qd-icon icon=\"overflowMenuVertical\"></qd-icon>\n </button>\n }\n <ng-template #menu>\n @for (action of customActions.actions; track action; let i = $index) {\n <button class=\"adaptive-menu-entry\" type=\"button\" [disabled]=\"action.isDisabled\" (click)=\"action.handler()\">\n {{ action.label.i18n | translate }}\n </button>\n }\n </ng-template>\n } }\n </div>\n</div>\n\n<div class=\"object-header-facets\" [ngClass]=\"{ amongThemselves: adaptiveMode && !facetsCollapsed }\">\n @if (pageObjectData$ | async; as data) { @for (facet of headerFacets | slice : 0 : (adaptiveMode && facetsCollapsed ?\n 2 : headerFacets?.length ?? 0); track facet) {\n <div class=\"object-header-facet\" [attr.data-test-id]=\"testId + '-facet-' + facet.name\">\n <div class=\"facet-label\">{{ facet.label.i18n | translate }}</div>\n <qd-dynamic-facet\n class=\"dynamic-facet\"\n [facet]=\"facet\"\n [data]=\"data\"\n [testId]=\"testId + '-facet-' + facet.name\"\n ></qd-dynamic-facet>\n </div>\n } } @if (!config.hideContexts && contexts$ | async; as contexts) { @for ( context of contexts | slice : 0 :\n (adaptiveMode && facetsCollapsed ? 2 - (headerFacets?.length ?? 0) : contexts?.length); track context; let index =\n $index; let first = $first) {\n <div\n class=\"object-header-facet\"\n [ngClass]=\"{ hasDivider: headerFacets && first, adaptiveFirst: headerFacets && adaptiveMode && first }\"\n [attr.data-test-id]=\"testId + '-context-facet-' + context.context.id\"\n >\n <div class=\"facet-label\">{{ context.label | translate }}</div>\n @if (context.value.length === 0) {\n <span class=\"no-selected-context\">{{ \"i18n.qd.page.context.noSelectionPlaceholder\" | translate }}</span>\n } @if (context.value.length !== 0) {\n <
|
|
32991
|
+
args: [{ selector: 'qd-page-object-header', changeDetection: ChangeDetectionStrategy.OnPush, host: { '[style.borderBottom]': 'borderBottomStyle' }, standalone: false, template: "@if (isLoading$ | async) {\n<div class=\"loading-overlay\"><qd-spinner></qd-spinner></div>\n}\n\n<div class=\"object-header-top\">\n <header class=\"object-header-title\">{{ config.title.i18n | translate }}</header>\n <div class=\"object-header-toolbar\">\n <ng-content></ng-content>\n\n <button class=\"button-icon\" data-test-id=\"archive-button\">\n @if (showArchive$ | async) {\n <qd-icon (click)=\"archiveButton?.handler()\" class=\"header-action-icon\" [icon]=\"'resultNew'\"></qd-icon>\n }\n </button>\n\n <button class=\"button-icon\" data-test-id=\"delete-button\">\n @if (showDelete$ | async) {\n <qd-icon class=\"header-action-icon\" (click)=\"deleteButton?.handler()\" [icon]=\"'trash'\"></qd-icon>\n }\n </button>\n\n @if (showEdit$ | async) {\n <button qdButton (click)=\"edit()\" data-test-id=\"edit-button\">\n {{ editButton?.label?.i18n || \"i18n.qd.page.header.edit\" | translate }}\n </button>\n } @if (showCancel$ | async) {\n <button qdButton qdButtonGhost (click)=\"cancel()\" data-test-id=\"cancel-button\">\n {{ cancelButton.label?.i18n || \"i18n.qd.page.header.cancel\" | translate }}\n </button>\n } @if (showSave$ | async) {\n <button qdButton (click)=\"save()\" data-test-id=\"save-button\" [disabled]=\"($canSave | async) === false\">\n {{ saveButton.label?.i18n || \"i18n.qd.page.header.save\" | translate }}\n </button>\n } @if (customActions$ | async; as customActions) { @if (!adaptiveMode) { @if (customActions.actions.length > 1) {\n <button [qdMenuButton]=\"customActions\" [autoSize]=\"false\" [data-test-id]=\"'page-'\" data-test-id=\"custom-button\">\n {{ config?.customActionsLabel?.i18n || \"i18n.qd.page.header.actions\" | translate }}\n </button>\n } @else { @if ((customActions$ | async).actions[0]; as singleAction) { @if (singleAction.handler &&\n !singleAction.isHidden) {\n <button qdButton [disabled]=\"singleAction.isDisabled\" (click)=\"singleAction.handler()\" data-test-id=\"custom-button\">\n {{ singleAction.label?.i18n | translate }}\n </button>\n } } } } @else { @if ((customActions$ | async)?.actions.length >= 1) {\n <button\n type=\"button\"\n class=\"adaptive-menu-button\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverMinWidth]=\"160\"\n >\n <qd-icon icon=\"overflowMenuVertical\"></qd-icon>\n </button>\n }\n <ng-template #menu>\n @for (action of customActions.actions; track action; let i = $index) {\n <button class=\"adaptive-menu-entry\" type=\"button\" [disabled]=\"action.isDisabled\" (click)=\"action.handler()\">\n {{ action.label.i18n | translate }}\n </button>\n }\n </ng-template>\n } }\n </div>\n</div>\n\n<div class=\"object-header-facets\" [ngClass]=\"{ amongThemselves: adaptiveMode && !facetsCollapsed }\">\n @if (pageObjectData$ | async; as data) { @for (facet of headerFacets | slice : 0 : (adaptiveMode && facetsCollapsed ?\n 2 : headerFacets?.length ?? 0); track facet) {\n <div class=\"object-header-facet\" [attr.data-test-id]=\"testId + '-facet-' + facet.name\">\n <div class=\"facet-label\">{{ facet.label.i18n | translate }}</div>\n <qd-dynamic-facet\n class=\"dynamic-facet\"\n [facet]=\"facet\"\n [data]=\"data\"\n [testId]=\"testId + '-facet-' + facet.name\"\n ></qd-dynamic-facet>\n </div>\n } } @if (!config.hideContexts && contexts$ | async; as contexts) { @for ( context of contexts | slice : 0 :\n (adaptiveMode && facetsCollapsed ? 2 - (headerFacets?.length ?? 0) : contexts?.length); track context; let index =\n $index; let first = $first) {\n <div\n class=\"object-header-facet qd-context-facet\"\n [ngClass]=\"{ hasDivider: headerFacets && first, adaptiveFirst: headerFacets && adaptiveMode && first }\"\n [attr.data-test-id]=\"testId + '-context-facet-' + context.context.id\"\n >\n <div class=\"facet-label\">{{ context.label | translate }}</div>\n @if (context.value.length === 0) {\n <span class=\"no-selected-context\">{{ \"i18n.qd.page.context.noSelectionPlaceholder\" | translate }}</span>\n } @if (context.value.length !== 0) {\n <qd-context-selection-chip\n [selection]=\"context.value\"\n [removable]=\"isContextSelectable\"\n [testId]=\"testId + '-context-selection-' + context.context.id\"\n (selectionCleared)=\"clearContext(context.context)\"\n ></qd-context-selection-chip>\n } @if (isContextSelectable && (!facetsCollapsed || !adaptiveMode)) {\n <span class=\"select-button\">\n <button\n qdButton\n qdButtonLink\n type=\"button\"\n (click)=\"changeContext(context.context, context.selection, $event)\"\n [data-test-id]=\"'object-header-select-context-' + context.context.id\"\n >\n {{\n context.value.length !== 0\n ? (\"i18n.qd.page.context.button.change\" | translate)\n : (\"i18n.qd.page.context.button.select\" | translate)\n }}\n </button>\n </span>\n }\n </div>\n } } @if (contexts$ | async; as togglerContexts) { @if (adaptiveMode && headerFacets?.length + togglerContexts.length >\n 2) {\n <span class=\"facets-toggler\" [attr.data-test-id]=\"testId + '-facets-toggler'\">\n @if (facetsCollapsed) {\n <span [attr.data-test-id]=\"testId + '-facets-toggler-count'\"\n >+{{ headerFacets.length + togglerContexts.length - 2 }}</span\n >\n }\n <button qdIconButton [data-test-id]=\"'toggle-button'\">\n <qd-icon [icon]=\"facetsCollapsed ? 'ctrlDown' : 'ctrlTop'\"></qd-icon>\n </button>\n </span>\n } }\n</div>\n", styles: [":host{display:flex;flex-direction:column;justify-content:space-between;padding:1.25rem;border-bottom:.125rem solid rgb(213,213,213);background:#fff;gap:1.25rem}@media(max-width:599.98px){:host{padding:1.25rem .9375rem}}:host .object-header-top{display:flex;align-items:flex-start;justify-content:space-between}:host .object-header-top .object-header-title{padding:2px;color:#171717;font-size:1.3125rem;font-weight:500}:host .object-header-top .object-header-toolbar{display:flex;align-items:center;column-gap:.5rem}:host .object-header-top .object-header-toolbar .button-icon{background:none}:host .object-header-top .object-header-toolbar .button-icon+.button-icon{margin-left:-.5rem}:host .object-header-top .object-header-toolbar .header-action-icon{color:#14516f;cursor:pointer;font-size:1.5rem}:host.in-dialog .object-header-toolbar{padding-right:2.5rem}:host .object-header-facets{position:relative;display:flex;flex-wrap:wrap;font-size:1.125rem;gap:1.25rem}:host .object-header-facets .object-header-facet{display:flex;min-width:3.75rem;flex-direction:column}:host .object-header-facets .object-header-facet.hasDivider{padding-left:1.25rem;border-left:.0625rem solid rgb(117,117,117)}:host .object-header-facets .object-header-facet.adaptiveFirst{padding-top:1.25rem}:host .object-header-facets .object-header-facet .facet-label{display:block;margin-bottom:0;color:#757575;font-size:.875rem;padding-bottom:.375rem;font-weight:500}:host .object-header-facets .facets-toggler{position:absolute;top:0;right:0;display:flex;align-items:center;padding-right:.3125rem;font-size:.625rem;line-height:.625rem}:host .object-header-facets.amongThemselves{display:grid}:host .object-header-facets.amongThemselves .object-header-facet.hasDivider{padding-left:0;border-top:.0625rem solid rgb(117,117,117);border-left:none}.loading-overlay{position:absolute;z-index:10000;inset:0;display:flex;align-items:center;justify-content:center;background-color:#0003}.no-selected-context{height:1.625rem;color:#979797;font-size:.875rem;line-height:1.625rem}.select-button{margin-top:.25rem}.adaptive-menu-button{display:flex;background:unset;color:#454545;font-size:2rem}.adaptive-menu-button:hover,.adaptive-menu-button:focus{color:#000}.adaptive-menu-entry{display:block;overflow:hidden;width:100%;min-height:2.25rem;padding:0 1rem;background:#fff0;text-align:left;text-overflow:ellipsis;white-space:nowrap}.object-header-facets .object-header-facet{max-width:100%}@media(min-width:600px){.object-header-facets:not(.amongThemselves) .object-header-facet.qd-context-facet{max-width:max-content;flex:1 1 0}}\n"] }]
|
|
32652
32992
|
}], propDecorators: { config: [{
|
|
32653
32993
|
type: Input,
|
|
32654
32994
|
args: [{ required: true }]
|
|
@@ -33837,6 +34177,7 @@ class QdPageSubmitActionService {
|
|
|
33837
34177
|
footerService = inject(QdPageFooterService);
|
|
33838
34178
|
formGroupManagerService = inject(QdFormGroupManagerService);
|
|
33839
34179
|
navigationInterceptor = inject(QdPageNavigationInterceptorService);
|
|
34180
|
+
injector = inject(Injector);
|
|
33840
34181
|
_labelI18n = 'i18n.qd.page.footer.submit';
|
|
33841
34182
|
_submitAction;
|
|
33842
34183
|
_isVisible = true;
|
|
@@ -33880,7 +34221,8 @@ class QdPageSubmitActionService {
|
|
|
33880
34221
|
QdPageCommitActionExecutor.execute(action, values, {
|
|
33881
34222
|
formGroupManager: this.formGroupManagerService,
|
|
33882
34223
|
navigationInterceptor: this.navigationInterceptor,
|
|
33883
|
-
destroyed$: this._destroyed
|
|
34224
|
+
destroyed$: this._destroyed$,
|
|
34225
|
+
scheduleFrameworkRebuildStop: () => afterNextRender(() => this.formGroupManagerService.stopAdoptingFrameworkRebuild(), { injector: this.injector })
|
|
33884
34226
|
});
|
|
33885
34227
|
}
|
|
33886
34228
|
trackFormValidity() {
|
|
@@ -34790,6 +35132,7 @@ class QdPageModule {
|
|
|
34790
35132
|
QdPageFooterCustomContentDirective,
|
|
34791
35133
|
QdPageHeaderExtensionDirective,
|
|
34792
35134
|
QdContextSelectDialogComponent,
|
|
35135
|
+
QdContextSelectionChipComponent,
|
|
34793
35136
|
QdPageInfoBannerComponent], imports: [CommonModule,
|
|
34794
35137
|
ScrollingModule,
|
|
34795
35138
|
TranslateModule,
|
|
@@ -34806,7 +35149,9 @@ class QdPageModule {
|
|
|
34806
35149
|
QdTableModule,
|
|
34807
35150
|
QdTextSectionModule,
|
|
34808
35151
|
QdSearchModule,
|
|
34809
|
-
QdPopoverModule
|
|
35152
|
+
QdPopoverModule,
|
|
35153
|
+
QdOverflowFitDirective,
|
|
35154
|
+
QdTooltipModule], exports: [QdPageComponent,
|
|
34810
35155
|
QdPageFooterComponent,
|
|
34811
35156
|
QdConnectFormStateToPageDirective,
|
|
34812
35157
|
QdPageControlPanelComponent,
|
|
@@ -34836,7 +35181,8 @@ class QdPageModule {
|
|
|
34836
35181
|
QdTableModule,
|
|
34837
35182
|
QdTextSectionModule,
|
|
34838
35183
|
QdSearchModule,
|
|
34839
|
-
QdPopoverModule
|
|
35184
|
+
QdPopoverModule,
|
|
35185
|
+
QdTooltipModule] });
|
|
34840
35186
|
}
|
|
34841
35187
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdPageModule, decorators: [{
|
|
34842
35188
|
type: NgModule,
|
|
@@ -34858,7 +35204,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
34858
35204
|
QdTableModule,
|
|
34859
35205
|
QdTextSectionModule,
|
|
34860
35206
|
QdSearchModule,
|
|
34861
|
-
QdPopoverModule
|
|
35207
|
+
QdPopoverModule,
|
|
35208
|
+
QdOverflowFitDirective,
|
|
35209
|
+
QdTooltipModule
|
|
34862
35210
|
],
|
|
34863
35211
|
declarations: [
|
|
34864
35212
|
QdPageComponent,
|
|
@@ -34880,6 +35228,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
34880
35228
|
QdPageFooterCustomContentDirective,
|
|
34881
35229
|
QdPageHeaderExtensionDirective,
|
|
34882
35230
|
QdContextSelectDialogComponent,
|
|
35231
|
+
QdContextSelectionChipComponent,
|
|
34883
35232
|
QdPageInfoBannerComponent
|
|
34884
35233
|
],
|
|
34885
35234
|
exports: [
|