@nebula.js/stardust 5.1.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/esm/dev.js +1405 -1180
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +3 -3
- package/core/esm/index.js.map +1 -1
- package/core/package.json +2 -2
- package/dist/stardust.dev.js +1705 -1755
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +13 -13
- package/dist/stardust.js.map +1 -1
- package/package.json +12 -12
package/core/esm/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v5.
|
|
2
|
+
* @nebula.js/stardust v5.2.0
|
|
3
3
|
* Copyright (c) 2024 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -717,14 +717,14 @@ function _defineProperty(e, r, t) {
|
|
|
717
717
|
writable: !0
|
|
718
718
|
}) : e[r] = t, e;
|
|
719
719
|
}
|
|
720
|
-
function _extends$
|
|
721
|
-
return _extends$
|
|
720
|
+
function _extends$2() {
|
|
721
|
+
return _extends$2 = Object.assign ? Object.assign.bind() : function (n) {
|
|
722
722
|
for (var e = 1; e < arguments.length; e++) {
|
|
723
723
|
var t = arguments[e];
|
|
724
724
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
725
725
|
}
|
|
726
726
|
return n;
|
|
727
|
-
}, _extends$
|
|
727
|
+
}, _extends$2.apply(null, arguments);
|
|
728
728
|
}
|
|
729
729
|
function ownKeys(e, r) {
|
|
730
730
|
var t = Object.keys(e);
|
|
@@ -751,14 +751,14 @@ function _objectWithoutProperties(e, t) {
|
|
|
751
751
|
if (null == e) return {};
|
|
752
752
|
var o,
|
|
753
753
|
r,
|
|
754
|
-
i = _objectWithoutPropertiesLoose$
|
|
754
|
+
i = _objectWithoutPropertiesLoose$1(e, t);
|
|
755
755
|
if (Object.getOwnPropertySymbols) {
|
|
756
756
|
var n = Object.getOwnPropertySymbols(e);
|
|
757
757
|
for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
758
758
|
}
|
|
759
759
|
return i;
|
|
760
760
|
}
|
|
761
|
-
function _objectWithoutPropertiesLoose$
|
|
761
|
+
function _objectWithoutPropertiesLoose$1(r, e) {
|
|
762
762
|
if (null == r) return {};
|
|
763
763
|
var t = {};
|
|
764
764
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -1954,6 +1954,12 @@ var Visualization_UnfulfilledCalculationCondition = {
|
|
|
1954
1954
|
"zh-TW": "不符計算條件"
|
|
1955
1955
|
}
|
|
1956
1956
|
};
|
|
1957
|
+
var Listbox_Clear_Search = {
|
|
1958
|
+
id: "Listbox.Clear.Search",
|
|
1959
|
+
locale: {
|
|
1960
|
+
"en-US": "Clear search"
|
|
1961
|
+
}
|
|
1962
|
+
};
|
|
1957
1963
|
var all = {
|
|
1958
1964
|
Cancel: Cancel$1,
|
|
1959
1965
|
CurrentSelections_All: CurrentSelections_All,
|
|
@@ -2008,7 +2014,8 @@ var all = {
|
|
|
2008
2014
|
Visualization_Invalid_Dimension: Visualization_Invalid_Dimension,
|
|
2009
2015
|
Visualization_Invalid_Measure: Visualization_Invalid_Measure,
|
|
2010
2016
|
Visualization_LayoutError: Visualization_LayoutError,
|
|
2011
|
-
Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition
|
|
2017
|
+
Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition,
|
|
2018
|
+
Listbox_Clear_Search: Listbox_Clear_Search
|
|
2012
2019
|
};
|
|
2013
2020
|
|
|
2014
2021
|
function appLocaleFn(language) {
|
|
@@ -3916,32 +3923,24 @@ var formatMuiErrorMessage = /*#__PURE__*/Object.freeze({
|
|
|
3916
3923
|
|
|
3917
3924
|
var THEME_ID = '$$material';
|
|
3918
3925
|
|
|
3919
|
-
function _extends$
|
|
3920
|
-
_extends$
|
|
3921
|
-
for (var
|
|
3922
|
-
var
|
|
3923
|
-
for (var
|
|
3924
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
3925
|
-
target[key] = source[key];
|
|
3926
|
-
}
|
|
3927
|
-
}
|
|
3926
|
+
function _extends$1() {
|
|
3927
|
+
return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
|
|
3928
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
3929
|
+
var t = arguments[e];
|
|
3930
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
3928
3931
|
}
|
|
3929
|
-
return
|
|
3930
|
-
};
|
|
3931
|
-
return _extends$5.apply(this, arguments);
|
|
3932
|
+
return n;
|
|
3933
|
+
}, _extends$1.apply(null, arguments);
|
|
3932
3934
|
}
|
|
3933
3935
|
|
|
3934
|
-
function _objectWithoutPropertiesLoose
|
|
3935
|
-
if (
|
|
3936
|
-
var
|
|
3937
|
-
var
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
key = sourceKeys[i];
|
|
3941
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
3942
|
-
target[key] = source[key];
|
|
3936
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
3937
|
+
if (null == r) return {};
|
|
3938
|
+
var t = {};
|
|
3939
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
3940
|
+
if (e.indexOf(n) >= 0) continue;
|
|
3941
|
+
t[n] = r[n];
|
|
3943
3942
|
}
|
|
3944
|
-
return
|
|
3943
|
+
return t;
|
|
3945
3944
|
}
|
|
3946
3945
|
|
|
3947
3946
|
/*
|
|
@@ -5275,49 +5274,6 @@ var styledEngine = /*#__PURE__*/Object.freeze({
|
|
|
5275
5274
|
keyframes: keyframes
|
|
5276
5275
|
});
|
|
5277
5276
|
|
|
5278
|
-
function _extends$4() {
|
|
5279
|
-
_extends$4 = Object.assign ? Object.assign.bind() : function (target) {
|
|
5280
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
5281
|
-
var source = arguments[i];
|
|
5282
|
-
for (var key in source) {
|
|
5283
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
5284
|
-
target[key] = source[key];
|
|
5285
|
-
}
|
|
5286
|
-
}
|
|
5287
|
-
}
|
|
5288
|
-
return target;
|
|
5289
|
-
};
|
|
5290
|
-
return _extends$4.apply(this, arguments);
|
|
5291
|
-
}
|
|
5292
|
-
|
|
5293
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
5294
|
-
if (source == null) return {};
|
|
5295
|
-
var target = {};
|
|
5296
|
-
var sourceKeys = Object.keys(source);
|
|
5297
|
-
var key, i;
|
|
5298
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
5299
|
-
key = sourceKeys[i];
|
|
5300
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
5301
|
-
target[key] = source[key];
|
|
5302
|
-
}
|
|
5303
|
-
return target;
|
|
5304
|
-
}
|
|
5305
|
-
|
|
5306
|
-
function _extends$3() {
|
|
5307
|
-
_extends$3 = Object.assign ? Object.assign.bind() : function (target) {
|
|
5308
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
5309
|
-
var source = arguments[i];
|
|
5310
|
-
for (var key in source) {
|
|
5311
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
5312
|
-
target[key] = source[key];
|
|
5313
|
-
}
|
|
5314
|
-
}
|
|
5315
|
-
}
|
|
5316
|
-
return target;
|
|
5317
|
-
};
|
|
5318
|
-
return _extends$3.apply(this, arguments);
|
|
5319
|
-
}
|
|
5320
|
-
|
|
5321
5277
|
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
5322
5278
|
function isPlainObject(item) {
|
|
5323
5279
|
if (typeof item !== 'object' || item === null) {
|
|
@@ -5339,14 +5295,12 @@ function deepClone(source) {
|
|
|
5339
5295
|
function deepmerge$1(target, source, options = {
|
|
5340
5296
|
clone: true
|
|
5341
5297
|
}) {
|
|
5342
|
-
const output = options.clone ? _extends$
|
|
5298
|
+
const output = options.clone ? _extends$1({}, target) : target;
|
|
5343
5299
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
5344
5300
|
Object.keys(source).forEach(key => {
|
|
5301
|
+
if (isPlainObject(source[key]) &&
|
|
5345
5302
|
// Avoid prototype pollution
|
|
5346
|
-
|
|
5347
|
-
return;
|
|
5348
|
-
}
|
|
5349
|
-
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
|
|
5303
|
+
Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {
|
|
5350
5304
|
// Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
|
|
5351
5305
|
output[key] = deepmerge$1(target[key], source[key], options);
|
|
5352
5306
|
} else if (options.clone) {
|
|
@@ -5374,7 +5328,7 @@ const sortBreakpointsValues = values => {
|
|
|
5374
5328
|
// Sort in ascending order
|
|
5375
5329
|
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
5376
5330
|
return breakpointsAsArray.reduce((acc, obj) => {
|
|
5377
|
-
return _extends$
|
|
5331
|
+
return _extends$1({}, acc, {
|
|
5378
5332
|
[obj.key]: obj.val
|
|
5379
5333
|
});
|
|
5380
5334
|
}, {});
|
|
@@ -5431,7 +5385,7 @@ function createBreakpoints(breakpoints) {
|
|
|
5431
5385
|
}
|
|
5432
5386
|
return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
|
|
5433
5387
|
}
|
|
5434
|
-
return _extends$
|
|
5388
|
+
return _extends$1({
|
|
5435
5389
|
keys,
|
|
5436
5390
|
values: sortedValues,
|
|
5437
5391
|
up,
|
|
@@ -6478,15 +6432,15 @@ function createTheme$2(options = {}, ...args) {
|
|
|
6478
6432
|
direction: 'ltr',
|
|
6479
6433
|
components: {},
|
|
6480
6434
|
// Inject component definitions.
|
|
6481
|
-
palette: _extends$
|
|
6435
|
+
palette: _extends$1({
|
|
6482
6436
|
mode: 'light'
|
|
6483
6437
|
}, paletteInput),
|
|
6484
6438
|
spacing,
|
|
6485
|
-
shape: _extends$
|
|
6439
|
+
shape: _extends$1({}, shape, shapeInput)
|
|
6486
6440
|
}, other);
|
|
6487
6441
|
muiTheme.applyStyles = applyStyles;
|
|
6488
6442
|
muiTheme = args.reduce((acc, argument) => deepmerge$1(acc, argument), muiTheme);
|
|
6489
|
-
muiTheme.unstable_sxConfig = _extends$
|
|
6443
|
+
muiTheme.unstable_sxConfig = _extends$1({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);
|
|
6490
6444
|
muiTheme.unstable_sx = function sx(props) {
|
|
6491
6445
|
return styleFunctionSx$1({
|
|
6492
6446
|
sx: props,
|
|
@@ -6551,12 +6505,12 @@ function extendSxProp(props) {
|
|
|
6551
6505
|
if (!isPlainObject(result)) {
|
|
6552
6506
|
return systemProps;
|
|
6553
6507
|
}
|
|
6554
|
-
return _extends$
|
|
6508
|
+
return _extends$1({}, systemProps, result);
|
|
6555
6509
|
};
|
|
6556
6510
|
} else {
|
|
6557
|
-
finalSx = _extends$
|
|
6511
|
+
finalSx = _extends$1({}, systemProps, inSx);
|
|
6558
6512
|
}
|
|
6559
|
-
return _extends$
|
|
6513
|
+
return _extends$1({}, otherProps, {
|
|
6560
6514
|
sx: finalSx
|
|
6561
6515
|
});
|
|
6562
6516
|
}
|
|
@@ -6699,10 +6653,10 @@ var getDisplayName = /*#__PURE__*/Object.freeze({
|
|
|
6699
6653
|
* @returns {object} resolved props
|
|
6700
6654
|
*/
|
|
6701
6655
|
function resolveProps(defaultProps, props) {
|
|
6702
|
-
const output = _extends$
|
|
6656
|
+
const output = _extends$1({}, props);
|
|
6703
6657
|
Object.keys(defaultProps).forEach(propName => {
|
|
6704
6658
|
if (propName.toString().match(/^(components|slots)$/)) {
|
|
6705
|
-
output[propName] = _extends$
|
|
6659
|
+
output[propName] = _extends$1({}, defaultProps[propName], output[propName]);
|
|
6706
6660
|
} else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
|
|
6707
6661
|
const defaultSlotProps = defaultProps[propName] || {};
|
|
6708
6662
|
const slotProps = props[propName];
|
|
@@ -6714,7 +6668,7 @@ function resolveProps(defaultProps, props) {
|
|
|
6714
6668
|
// Reduce the iteration if the default slot props is empty
|
|
6715
6669
|
output[propName] = slotProps;
|
|
6716
6670
|
} else {
|
|
6717
|
-
output[propName] = _extends$
|
|
6671
|
+
output[propName] = _extends$1({}, slotProps);
|
|
6718
6672
|
Object.keys(defaultSlotProps).forEach(slotPropName => {
|
|
6719
6673
|
output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
|
|
6720
6674
|
});
|
|
@@ -6774,21 +6728,6 @@ var clamp = /*#__PURE__*/Object.freeze({
|
|
|
6774
6728
|
default: clamp$1
|
|
6775
6729
|
});
|
|
6776
6730
|
|
|
6777
|
-
function _extends$2() {
|
|
6778
|
-
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
6779
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
6780
|
-
var source = arguments[i];
|
|
6781
|
-
for (var key in source) {
|
|
6782
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
6783
|
-
target[key] = source[key];
|
|
6784
|
-
}
|
|
6785
|
-
}
|
|
6786
|
-
}
|
|
6787
|
-
return target;
|
|
6788
|
-
};
|
|
6789
|
-
return _extends$2.apply(this, arguments);
|
|
6790
|
-
}
|
|
6791
|
-
|
|
6792
6731
|
/**
|
|
6793
6732
|
* Safe chained function.
|
|
6794
6733
|
*
|
|
@@ -7186,7 +7125,7 @@ function mergeOuterLocalTheme(outerTheme, localTheme) {
|
|
|
7186
7125
|
const mergedTheme = localTheme(outerTheme);
|
|
7187
7126
|
return mergedTheme;
|
|
7188
7127
|
}
|
|
7189
|
-
return _extends$
|
|
7128
|
+
return _extends$1({}, outerTheme, localTheme);
|
|
7190
7129
|
}
|
|
7191
7130
|
|
|
7192
7131
|
/**
|
|
@@ -7220,7 +7159,7 @@ function RtlProvider(_ref) {
|
|
|
7220
7159
|
value
|
|
7221
7160
|
} = _ref,
|
|
7222
7161
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
7223
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(RtlContext.Provider, _extends$
|
|
7162
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(RtlContext.Provider, _extends$1({
|
|
7224
7163
|
value: value != null ? value : true
|
|
7225
7164
|
}, props));
|
|
7226
7165
|
}
|
|
@@ -7231,7 +7170,7 @@ function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
|
|
|
7231
7170
|
const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
|
|
7232
7171
|
if (typeof localTheme === 'function') {
|
|
7233
7172
|
const mergedTheme = localTheme(resolvedTheme);
|
|
7234
|
-
const result = themeId ? _extends$
|
|
7173
|
+
const result = themeId ? _extends$1({}, upperTheme, {
|
|
7235
7174
|
[themeId]: mergedTheme
|
|
7236
7175
|
}) : mergedTheme;
|
|
7237
7176
|
// must return a function for the private theme to NOT merge with the upper theme.
|
|
@@ -7241,9 +7180,9 @@ function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
|
|
|
7241
7180
|
}
|
|
7242
7181
|
return result;
|
|
7243
7182
|
}
|
|
7244
|
-
return themeId ? _extends$
|
|
7183
|
+
return themeId ? _extends$1({}, upperTheme, {
|
|
7245
7184
|
[themeId]: localTheme
|
|
7246
|
-
}) : _extends$
|
|
7185
|
+
}) : _extends$1({}, upperTheme, localTheme);
|
|
7247
7186
|
}, [themeId, upperTheme, localTheme, isPrivate]);
|
|
7248
7187
|
}
|
|
7249
7188
|
|
|
@@ -7288,8 +7227,8 @@ function adaptV4Theme(inputTheme) {
|
|
|
7288
7227
|
props = {},
|
|
7289
7228
|
styleOverrides = {}
|
|
7290
7229
|
} = inputTheme,
|
|
7291
|
-
other = _objectWithoutPropertiesLoose
|
|
7292
|
-
const theme = _extends$
|
|
7230
|
+
other = _objectWithoutPropertiesLoose(inputTheme, _excluded$d);
|
|
7231
|
+
const theme = _extends$1({}, other, {
|
|
7293
7232
|
components: {}
|
|
7294
7233
|
});
|
|
7295
7234
|
|
|
@@ -7323,13 +7262,13 @@ function adaptV4Theme(inputTheme) {
|
|
|
7323
7262
|
// theme.mixins.gutters
|
|
7324
7263
|
const breakpoints = createBreakpoints(inputTheme.breakpoints || {});
|
|
7325
7264
|
const spacing = theme.spacing;
|
|
7326
|
-
theme.mixins = _extends$
|
|
7265
|
+
theme.mixins = _extends$1({
|
|
7327
7266
|
gutters: (styles = {}) => {
|
|
7328
|
-
return _extends$
|
|
7267
|
+
return _extends$1({
|
|
7329
7268
|
paddingLeft: spacing(2),
|
|
7330
7269
|
paddingRight: spacing(2)
|
|
7331
7270
|
}, styles, {
|
|
7332
|
-
[breakpoints.up('sm')]: _extends$
|
|
7271
|
+
[breakpoints.up('sm')]: _extends$1({
|
|
7333
7272
|
paddingLeft: spacing(3),
|
|
7334
7273
|
paddingRight: spacing(3)
|
|
7335
7274
|
}, styles[breakpoints.up('sm')])
|
|
@@ -7340,9 +7279,9 @@ function adaptV4Theme(inputTheme) {
|
|
|
7340
7279
|
type: typeInput,
|
|
7341
7280
|
mode: modeInput
|
|
7342
7281
|
} = palette,
|
|
7343
|
-
paletteRest = _objectWithoutPropertiesLoose
|
|
7282
|
+
paletteRest = _objectWithoutPropertiesLoose(palette, _excluded2$2);
|
|
7344
7283
|
const finalMode = modeInput || typeInput || 'light';
|
|
7345
|
-
theme.palette = _extends$
|
|
7284
|
+
theme.palette = _extends$1({
|
|
7346
7285
|
// theme.palette.text.hint
|
|
7347
7286
|
text: {
|
|
7348
7287
|
hint: finalMode === 'dark' ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.38)'
|
|
@@ -7354,7 +7293,7 @@ function adaptV4Theme(inputTheme) {
|
|
|
7354
7293
|
}
|
|
7355
7294
|
|
|
7356
7295
|
function createMixins(breakpoints, mixins) {
|
|
7357
|
-
return _extends$
|
|
7296
|
+
return _extends$1({
|
|
7358
7297
|
toolbar: {
|
|
7359
7298
|
minHeight: 56,
|
|
7360
7299
|
[breakpoints.up('xs')]: {
|
|
@@ -7371,24 +7310,24 @@ function createMixins(breakpoints, mixins) {
|
|
|
7371
7310
|
|
|
7372
7311
|
var colorManipulator = {};
|
|
7373
7312
|
|
|
7374
|
-
var interopRequireDefault
|
|
7313
|
+
var interopRequireDefault = {exports: {}};
|
|
7375
7314
|
|
|
7376
7315
|
(function (module) {
|
|
7377
|
-
function _interopRequireDefault(
|
|
7378
|
-
return
|
|
7379
|
-
"default":
|
|
7316
|
+
function _interopRequireDefault(e) {
|
|
7317
|
+
return e && e.__esModule ? e : {
|
|
7318
|
+
"default": e
|
|
7380
7319
|
};
|
|
7381
7320
|
}
|
|
7382
7321
|
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
7383
|
-
} (interopRequireDefault
|
|
7322
|
+
} (interopRequireDefault));
|
|
7384
7323
|
|
|
7385
|
-
var interopRequireDefaultExports
|
|
7324
|
+
var interopRequireDefaultExports = interopRequireDefault.exports;
|
|
7386
7325
|
|
|
7387
7326
|
var require$$1 = /*@__PURE__*/getAugmentedNamespace(formatMuiErrorMessage);
|
|
7388
7327
|
|
|
7389
7328
|
var require$$2 = /*@__PURE__*/getAugmentedNamespace(clamp);
|
|
7390
7329
|
|
|
7391
|
-
var _interopRequireDefault$2 = interopRequireDefaultExports
|
|
7330
|
+
var _interopRequireDefault$2 = interopRequireDefaultExports;
|
|
7392
7331
|
Object.defineProperty(colorManipulator, "__esModule", {
|
|
7393
7332
|
value: true
|
|
7394
7333
|
});
|
|
@@ -8045,7 +7984,7 @@ function createPalette(palette) {
|
|
|
8045
7984
|
contrastThreshold = 3,
|
|
8046
7985
|
tonalOffset = 0.2
|
|
8047
7986
|
} = palette,
|
|
8048
|
-
other = _objectWithoutPropertiesLoose
|
|
7987
|
+
other = _objectWithoutPropertiesLoose(palette, _excluded$c);
|
|
8049
7988
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
8050
7989
|
const secondary = palette.secondary || getDefaultSecondary(mode);
|
|
8051
7990
|
const error = palette.error || getDefaultError(mode);
|
|
@@ -8067,7 +8006,7 @@ function createPalette(palette) {
|
|
|
8067
8006
|
lightShade = 300,
|
|
8068
8007
|
darkShade = 700
|
|
8069
8008
|
}) => {
|
|
8070
|
-
color = _extends$
|
|
8009
|
+
color = _extends$1({}, color);
|
|
8071
8010
|
if (!color.main && color[mainShade]) {
|
|
8072
8011
|
color.main = color[mainShade];
|
|
8073
8012
|
}
|
|
@@ -8088,9 +8027,9 @@ function createPalette(palette) {
|
|
|
8088
8027
|
dark: dark$1,
|
|
8089
8028
|
light: light$1
|
|
8090
8029
|
};
|
|
8091
|
-
const paletteOutput = deepmerge$1(_extends$
|
|
8030
|
+
const paletteOutput = deepmerge$1(_extends$1({
|
|
8092
8031
|
// A collection of common colors.
|
|
8093
|
-
common: _extends$
|
|
8032
|
+
common: _extends$1({}, common),
|
|
8094
8033
|
// prevent mutable object.
|
|
8095
8034
|
// The palette mode, can be light or dark.
|
|
8096
8035
|
mode,
|
|
@@ -8175,10 +8114,10 @@ function createTypography(palette, typography) {
|
|
|
8175
8114
|
allVariants,
|
|
8176
8115
|
pxToRem: pxToRem2
|
|
8177
8116
|
} = _ref,
|
|
8178
|
-
other = _objectWithoutPropertiesLoose
|
|
8117
|
+
other = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
8179
8118
|
const coef = fontSize / 14;
|
|
8180
8119
|
const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);
|
|
8181
|
-
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$
|
|
8120
|
+
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$1({
|
|
8182
8121
|
fontFamily,
|
|
8183
8122
|
fontWeight,
|
|
8184
8123
|
fontSize: pxToRem(size),
|
|
@@ -8210,7 +8149,7 @@ function createTypography(palette, typography) {
|
|
|
8210
8149
|
letterSpacing: 'inherit'
|
|
8211
8150
|
}
|
|
8212
8151
|
};
|
|
8213
|
-
return deepmerge$1(_extends$
|
|
8152
|
+
return deepmerge$1(_extends$1({
|
|
8214
8153
|
htmlFontSize,
|
|
8215
8154
|
pxToRem,
|
|
8216
8155
|
fontFamily,
|
|
@@ -8277,18 +8216,18 @@ function getAutoHeightDuration(height) {
|
|
|
8277
8216
|
return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
|
|
8278
8217
|
}
|
|
8279
8218
|
function createTransitions(inputTransitions) {
|
|
8280
|
-
const mergedEasing = _extends$
|
|
8281
|
-
const mergedDuration = _extends$
|
|
8219
|
+
const mergedEasing = _extends$1({}, easing, inputTransitions.easing);
|
|
8220
|
+
const mergedDuration = _extends$1({}, duration, inputTransitions.duration);
|
|
8282
8221
|
const create = (props = ['all'], options = {}) => {
|
|
8283
8222
|
const {
|
|
8284
8223
|
duration: durationOption = mergedDuration.standard,
|
|
8285
8224
|
easing: easingOption = mergedEasing.easeInOut,
|
|
8286
8225
|
delay = 0
|
|
8287
8226
|
} = options;
|
|
8288
|
-
_objectWithoutPropertiesLoose
|
|
8227
|
+
_objectWithoutPropertiesLoose(options, _excluded$a);
|
|
8289
8228
|
return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');
|
|
8290
8229
|
};
|
|
8291
|
-
return _extends$
|
|
8230
|
+
return _extends$1({
|
|
8292
8231
|
getAutoHeightDuration,
|
|
8293
8232
|
create
|
|
8294
8233
|
}, inputTransitions, {
|
|
@@ -8318,7 +8257,7 @@ function createTheme(options = {}, ...args) {
|
|
|
8318
8257
|
transitions: transitionsInput = {},
|
|
8319
8258
|
typography: typographyInput = {}
|
|
8320
8259
|
} = options,
|
|
8321
|
-
other = _objectWithoutPropertiesLoose
|
|
8260
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$9);
|
|
8322
8261
|
if (options.vars) {
|
|
8323
8262
|
throw new Error(formatMuiErrorMessage$1(18));
|
|
8324
8263
|
}
|
|
@@ -8331,11 +8270,11 @@ function createTheme(options = {}, ...args) {
|
|
|
8331
8270
|
shadows: shadows.slice(),
|
|
8332
8271
|
typography: createTypography(palette, typographyInput),
|
|
8333
8272
|
transitions: createTransitions(transitionsInput),
|
|
8334
|
-
zIndex: _extends$
|
|
8273
|
+
zIndex: _extends$1({}, zIndex)
|
|
8335
8274
|
});
|
|
8336
8275
|
muiTheme = deepmerge$1(muiTheme, other);
|
|
8337
8276
|
muiTheme = args.reduce((acc, argument) => deepmerge$1(acc, argument), muiTheme);
|
|
8338
|
-
muiTheme.unstable_sxConfig = _extends$
|
|
8277
|
+
muiTheme.unstable_sxConfig = _extends$1({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);
|
|
8339
8278
|
muiTheme.unstable_sx = function sx(props) {
|
|
8340
8279
|
return styleFunctionSx$1({
|
|
8341
8280
|
sx: props,
|
|
@@ -8366,31 +8305,26 @@ function useThemeProps({
|
|
|
8366
8305
|
|
|
8367
8306
|
var createStyled$1 = {};
|
|
8368
8307
|
|
|
8369
|
-
var _extends
|
|
8308
|
+
var _extends = {exports: {}};
|
|
8370
8309
|
|
|
8371
8310
|
var hasRequired_extends;
|
|
8372
8311
|
|
|
8373
8312
|
function require_extends () {
|
|
8374
|
-
if (hasRequired_extends) return _extends
|
|
8313
|
+
if (hasRequired_extends) return _extends.exports;
|
|
8375
8314
|
hasRequired_extends = 1;
|
|
8376
8315
|
(function (module) {
|
|
8377
8316
|
function _extends() {
|
|
8378
|
-
module.exports = _extends = Object.assign ? Object.assign.bind() : function (
|
|
8379
|
-
for (var
|
|
8380
|
-
var
|
|
8381
|
-
for (var
|
|
8382
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8383
|
-
target[key] = source[key];
|
|
8384
|
-
}
|
|
8385
|
-
}
|
|
8317
|
+
return (module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
8318
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
8319
|
+
var t = arguments[e];
|
|
8320
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
8386
8321
|
}
|
|
8387
|
-
return
|
|
8388
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
8389
|
-
return _extends.apply(this, arguments);
|
|
8322
|
+
return n;
|
|
8323
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _extends.apply(null, arguments);
|
|
8390
8324
|
}
|
|
8391
8325
|
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
8392
|
-
} (_extends
|
|
8393
|
-
return _extends
|
|
8326
|
+
} (_extends));
|
|
8327
|
+
return _extends.exports;
|
|
8394
8328
|
}
|
|
8395
8329
|
|
|
8396
8330
|
var objectWithoutPropertiesLoose = {exports: {}};
|
|
@@ -8401,17 +8335,14 @@ function requireObjectWithoutPropertiesLoose () {
|
|
|
8401
8335
|
if (hasRequiredObjectWithoutPropertiesLoose) return objectWithoutPropertiesLoose.exports;
|
|
8402
8336
|
hasRequiredObjectWithoutPropertiesLoose = 1;
|
|
8403
8337
|
(function (module) {
|
|
8404
|
-
function _objectWithoutPropertiesLoose(
|
|
8405
|
-
if (
|
|
8406
|
-
var
|
|
8407
|
-
var
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
key = sourceKeys[i];
|
|
8411
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
8412
|
-
target[key] = source[key];
|
|
8338
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
8339
|
+
if (null == r) return {};
|
|
8340
|
+
var t = {};
|
|
8341
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
8342
|
+
if (e.indexOf(n) >= 0) continue;
|
|
8343
|
+
t[n] = r[n];
|
|
8413
8344
|
}
|
|
8414
|
-
return
|
|
8345
|
+
return t;
|
|
8415
8346
|
}
|
|
8416
8347
|
module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
8417
8348
|
} (objectWithoutPropertiesLoose));
|
|
@@ -8430,7 +8361,7 @@ var require$$7 = /*@__PURE__*/getAugmentedNamespace(createTheme$1);
|
|
|
8430
8361
|
|
|
8431
8362
|
var require$$8 = /*@__PURE__*/getAugmentedNamespace(styleFunctionSx);
|
|
8432
8363
|
|
|
8433
|
-
var _interopRequireDefault$1 = interopRequireDefaultExports
|
|
8364
|
+
var _interopRequireDefault$1 = interopRequireDefaultExports;
|
|
8434
8365
|
Object.defineProperty(createStyled$1, "__esModule", {
|
|
8435
8366
|
value: true
|
|
8436
8367
|
});
|
|
@@ -8681,51 +8612,27 @@ function ThemeProvider(_ref) {
|
|
|
8681
8612
|
let {
|
|
8682
8613
|
theme: themeInput
|
|
8683
8614
|
} = _ref,
|
|
8684
|
-
props = _objectWithoutPropertiesLoose
|
|
8615
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
8685
8616
|
const scopedTheme = themeInput[THEME_ID];
|
|
8686
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends$
|
|
8617
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends$1({}, props, {
|
|
8687
8618
|
themeId: scopedTheme ? THEME_ID : undefined,
|
|
8688
8619
|
theme: scopedTheme || themeInput
|
|
8689
8620
|
}));
|
|
8690
8621
|
}
|
|
8691
8622
|
|
|
8692
|
-
function
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
for (var key in source) {
|
|
8698
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8699
|
-
target[key] = source[key];
|
|
8700
|
-
}
|
|
8701
|
-
}
|
|
8702
|
-
}
|
|
8703
|
-
|
|
8704
|
-
return target;
|
|
8705
|
-
};
|
|
8706
|
-
return _extends.apply(this, arguments);
|
|
8707
|
-
}
|
|
8708
|
-
|
|
8709
|
-
function _setPrototypeOf(o, p) {
|
|
8710
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
8711
|
-
o.__proto__ = p;
|
|
8712
|
-
return o;
|
|
8713
|
-
};
|
|
8714
|
-
return _setPrototypeOf(o, p);
|
|
8623
|
+
function _setPrototypeOf(t, e) {
|
|
8624
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
8625
|
+
return t.__proto__ = e, t;
|
|
8626
|
+
}, _setPrototypeOf(t, e);
|
|
8715
8627
|
}
|
|
8716
8628
|
|
|
8717
|
-
function _inheritsLoose(
|
|
8718
|
-
|
|
8719
|
-
subClass.prototype.constructor = subClass;
|
|
8720
|
-
_setPrototypeOf(subClass, superClass);
|
|
8629
|
+
function _inheritsLoose(t, o) {
|
|
8630
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
8721
8631
|
}
|
|
8722
8632
|
|
|
8723
|
-
function _assertThisInitialized(
|
|
8724
|
-
if (
|
|
8725
|
-
|
|
8726
|
-
}
|
|
8727
|
-
|
|
8728
|
-
return self;
|
|
8633
|
+
function _assertThisInitialized(e) {
|
|
8634
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
8635
|
+
return e;
|
|
8729
8636
|
}
|
|
8730
8637
|
|
|
8731
8638
|
const buttonClasses = generateUtilityClasses('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'textSuccess', 'textError', 'textInfo', 'textWarning', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'outlinedSuccess', 'outlinedError', 'outlinedInfo', 'outlinedWarning', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'containedSuccess', 'containedError', 'containedInfo', 'containedWarning', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorError', 'colorInfo', 'colorWarning', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'icon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
|
|
@@ -9067,7 +8974,7 @@ function create$3(definition) {
|
|
|
9067
8974
|
return cache[key];
|
|
9068
8975
|
}
|
|
9069
8976
|
|
|
9070
|
-
const NEBULA_VERSION_HASH = "
|
|
8977
|
+
const NEBULA_VERSION_HASH = "01bb" ;
|
|
9071
8978
|
ClassNameGenerator.configure(componentName => {
|
|
9072
8979
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
9073
8980
|
});
|
|
@@ -9299,7 +9206,7 @@ function boot(_ref2) {
|
|
|
9299
9206
|
const appRef = React__default.createRef();
|
|
9300
9207
|
const element = document.createElement('div');
|
|
9301
9208
|
element.style.display = 'none';
|
|
9302
|
-
element.setAttribute('data-nebulajs-version', "5.
|
|
9209
|
+
element.setAttribute('data-nebulajs-version', "5.2.0" );
|
|
9303
9210
|
element.setAttribute('data-app-id', app.id);
|
|
9304
9211
|
document.body.appendChild(element);
|
|
9305
9212
|
if (context) {
|
|
@@ -9683,7 +9590,7 @@ function SvgIcon$1(_ref) {
|
|
|
9683
9590
|
return (
|
|
9684
9591
|
/*#__PURE__*/
|
|
9685
9592
|
// eslint-disable-next-line react/no-array-index-key
|
|
9686
|
-
React__default.createElement(Type, _extends$
|
|
9593
|
+
React__default.createElement(Type, _extends$2({
|
|
9687
9594
|
key: ix
|
|
9688
9595
|
}, attrs))
|
|
9689
9596
|
);
|
|
@@ -11493,6 +11400,10 @@ function getRowsKeyboardNavigation(_ref) {
|
|
|
11493
11400
|
}
|
|
11494
11401
|
break;
|
|
11495
11402
|
case KEYS.ESCAPE:
|
|
11403
|
+
if (typeof isModal === 'undefined') {
|
|
11404
|
+
cancel();
|
|
11405
|
+
return;
|
|
11406
|
+
}
|
|
11496
11407
|
if (isModal()) {
|
|
11497
11408
|
cancel();
|
|
11498
11409
|
} else {
|
|
@@ -12441,7 +12352,7 @@ function createGridComponent(_ref2) {
|
|
|
12441
12352
|
className: className,
|
|
12442
12353
|
onScroll: this._onScroll,
|
|
12443
12354
|
ref: this._outerRefSetter,
|
|
12444
|
-
style: _extends({
|
|
12355
|
+
style: _extends$1({
|
|
12445
12356
|
position: 'relative',
|
|
12446
12357
|
height: height,
|
|
12447
12358
|
width: width,
|
|
@@ -12940,7 +12851,7 @@ function createListComponent(_ref) {
|
|
|
12940
12851
|
className: className,
|
|
12941
12852
|
onScroll: onScroll,
|
|
12942
12853
|
ref: this._outerRefSetter,
|
|
12943
|
-
style: _extends({
|
|
12854
|
+
style: _extends$1({
|
|
12944
12855
|
position: 'relative',
|
|
12945
12856
|
height: height,
|
|
12946
12857
|
width: width,
|
|
@@ -13495,7 +13406,7 @@ function getListBoxComponents(_ref) {
|
|
|
13495
13406
|
local.current.listRef = ref;
|
|
13496
13407
|
return /*#__PURE__*/React__default.createElement(StyledFixedSizeList
|
|
13497
13408
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
13498
|
-
, _extends$
|
|
13409
|
+
, _extends$2({}, commonComponentOptions, {
|
|
13499
13410
|
dataTestid: "fixed-size-list",
|
|
13500
13411
|
scrollDisabled: constraints === null || constraints === void 0 ? void 0 : constraints.active,
|
|
13501
13412
|
height: listHeight,
|
|
@@ -13572,7 +13483,7 @@ function getListBoxComponents(_ref) {
|
|
|
13572
13483
|
};
|
|
13573
13484
|
return /*#__PURE__*/React__default.createElement(StyledFixedSizeGrid
|
|
13574
13485
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
13575
|
-
, _extends$
|
|
13486
|
+
, _extends$2({}, commonComponentOptions, {
|
|
13576
13487
|
dataTestid: "fixed-size-grid",
|
|
13577
13488
|
scrollDisabled: constraints === null || constraints === void 0 ? void 0 : constraints.active,
|
|
13578
13489
|
height: gridHeight,
|
|
@@ -13994,20 +13905,7 @@ function ListBoxDisclaimer(_ref2) {
|
|
|
13994
13905
|
}, translatorDynamic.get(text)));
|
|
13995
13906
|
}
|
|
13996
13907
|
|
|
13997
|
-
var Close = {};
|
|
13998
|
-
|
|
13999
|
-
var interopRequireDefault = {exports: {}};
|
|
14000
|
-
|
|
14001
|
-
(function (module) {
|
|
14002
|
-
function _interopRequireDefault(obj) {
|
|
14003
|
-
return obj && obj.__esModule ? obj : {
|
|
14004
|
-
"default": obj
|
|
14005
|
-
};
|
|
14006
|
-
}
|
|
14007
|
-
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
14008
|
-
} (interopRequireDefault));
|
|
14009
|
-
|
|
14010
|
-
var interopRequireDefaultExports = interopRequireDefault.exports;
|
|
13908
|
+
var Close$1 = {};
|
|
14011
13909
|
|
|
14012
13910
|
var createSvgIcon$1 = {};
|
|
14013
13911
|
|
|
@@ -14084,9 +13982,9 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
14084
13982
|
titleAccess,
|
|
14085
13983
|
viewBox = '0 0 24 24'
|
|
14086
13984
|
} = props,
|
|
14087
|
-
other = _objectWithoutPropertiesLoose
|
|
13985
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$5);
|
|
14088
13986
|
const hasSvgAsChild = /*#__PURE__*/React.isValidElement(children) && children.type === 'svg';
|
|
14089
|
-
const ownerState = _extends$
|
|
13987
|
+
const ownerState = _extends$1({}, props, {
|
|
14090
13988
|
color,
|
|
14091
13989
|
component,
|
|
14092
13990
|
fontSize,
|
|
@@ -14100,7 +13998,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
14100
13998
|
more.viewBox = viewBox;
|
|
14101
13999
|
}
|
|
14102
14000
|
const classes = useUtilityClasses(ownerState);
|
|
14103
|
-
return /*#__PURE__*/jsxRuntimeExports.jsxs(SvgIconRoot, _extends$
|
|
14001
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs(SvgIconRoot, _extends$1({
|
|
14104
14002
|
as: component,
|
|
14105
14003
|
className: clsx(classes.root, className),
|
|
14106
14004
|
focusable: "false",
|
|
@@ -14119,7 +14017,7 @@ SvgIcon.muiName = 'SvgIcon';
|
|
|
14119
14017
|
|
|
14120
14018
|
function createSvgIcon(path, displayName) {
|
|
14121
14019
|
function Component(props, ref) {
|
|
14122
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon, _extends$
|
|
14020
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon, _extends$1({
|
|
14123
14021
|
"data-testid": `${displayName}Icon`,
|
|
14124
14022
|
ref: ref
|
|
14125
14023
|
}, props, {
|
|
@@ -14185,13 +14083,13 @@ function requireCreateSvgIcon () {
|
|
|
14185
14083
|
}
|
|
14186
14084
|
|
|
14187
14085
|
var _interopRequireDefault = interopRequireDefaultExports;
|
|
14188
|
-
Object.defineProperty(Close, "__esModule", {
|
|
14086
|
+
Object.defineProperty(Close$1, "__esModule", {
|
|
14189
14087
|
value: true
|
|
14190
14088
|
});
|
|
14191
|
-
var default_1 = Close.default = void 0;
|
|
14089
|
+
var default_1 = Close$1.default = void 0;
|
|
14192
14090
|
var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
|
|
14193
14091
|
var _jsxRuntime = jsxRuntimeExports;
|
|
14194
|
-
default_1 = Close.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
14092
|
+
default_1 = Close$1.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
14195
14093
|
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
14196
14094
|
}), 'Close');
|
|
14197
14095
|
|
|
@@ -14838,11 +14736,18 @@ var createListboxSelectionToolbar = (_ref => {
|
|
|
14838
14736
|
model,
|
|
14839
14737
|
translator,
|
|
14840
14738
|
selectionState,
|
|
14841
|
-
isDirectQuery = false
|
|
14739
|
+
isDirectQuery = false,
|
|
14740
|
+
selections
|
|
14842
14741
|
} = _ref;
|
|
14843
14742
|
if (layout.qListObject.qDimensionInfo.qIsOneAndOnlyOne) {
|
|
14844
14743
|
return [];
|
|
14845
14744
|
}
|
|
14745
|
+
const path = '/qListObjectDef';
|
|
14746
|
+
const activateSelection = () => {
|
|
14747
|
+
if (!selections.isActive()) {
|
|
14748
|
+
selections.begin(path);
|
|
14749
|
+
}
|
|
14750
|
+
};
|
|
14846
14751
|
const canSelectAll = () => ['qOption', 'qAlternative', 'qExcluded', 'qDeselected'].some(sc => layout.qListObject.qDimensionInfo.qStateCounts[sc] > 0);
|
|
14847
14752
|
const canSelectPossible = () => ['qOption'].some(sc => layout.qListObject.qDimensionInfo.qStateCounts[sc] > 0);
|
|
14848
14753
|
const canSelectAlternative = () => ['qAlternative'].some(sc => layout.qListObject.qDimensionInfo.qStateCounts[sc] > 0);
|
|
@@ -14854,8 +14759,9 @@ var createListboxSelectionToolbar = (_ref => {
|
|
|
14854
14759
|
getSvgIconShape: selectAll,
|
|
14855
14760
|
enabled: canSelectAll,
|
|
14856
14761
|
action: () => {
|
|
14762
|
+
activateSelection();
|
|
14857
14763
|
selectionState.clearItemStates(false);
|
|
14858
|
-
model.selectListObjectAll(
|
|
14764
|
+
model.selectListObjectAll(path);
|
|
14859
14765
|
}
|
|
14860
14766
|
}, {
|
|
14861
14767
|
key: 'selectPossible',
|
|
@@ -14864,8 +14770,9 @@ var createListboxSelectionToolbar = (_ref => {
|
|
|
14864
14770
|
getSvgIconShape: selectPossible,
|
|
14865
14771
|
enabled: canSelectPossible,
|
|
14866
14772
|
action: () => {
|
|
14773
|
+
activateSelection();
|
|
14867
14774
|
selectionState.clearItemStates(false);
|
|
14868
|
-
model.selectListObjectPossible(
|
|
14775
|
+
model.selectListObjectPossible(path);
|
|
14869
14776
|
}
|
|
14870
14777
|
}, isDirectQuery ? false : {
|
|
14871
14778
|
key: 'selectAlternative',
|
|
@@ -14874,8 +14781,9 @@ var createListboxSelectionToolbar = (_ref => {
|
|
|
14874
14781
|
getSvgIconShape: selectAlternative,
|
|
14875
14782
|
enabled: canSelectAlternative,
|
|
14876
14783
|
action: () => {
|
|
14784
|
+
activateSelection();
|
|
14877
14785
|
selectionState.clearItemStates(false);
|
|
14878
|
-
model.selectListObjectAlternative(
|
|
14786
|
+
model.selectListObjectAlternative(path);
|
|
14879
14787
|
}
|
|
14880
14788
|
}, isDirectQuery ? false : {
|
|
14881
14789
|
key: 'selectExcluded',
|
|
@@ -14884,8 +14792,9 @@ var createListboxSelectionToolbar = (_ref => {
|
|
|
14884
14792
|
getSvgIconShape: selectExcluded,
|
|
14885
14793
|
enabled: canSelectExcluded,
|
|
14886
14794
|
action: () => {
|
|
14795
|
+
activateSelection();
|
|
14887
14796
|
selectionState.clearItemStates(false);
|
|
14888
|
-
model.selectListObjectExcluded(
|
|
14797
|
+
model.selectListObjectExcluded(path);
|
|
14889
14798
|
}
|
|
14890
14799
|
}].filter(Boolean);
|
|
14891
14800
|
});
|
|
@@ -14975,6 +14884,7 @@ const close = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
14975
14884
|
}
|
|
14976
14885
|
}]
|
|
14977
14886
|
});
|
|
14887
|
+
var Close = (props => SvgIcon$1(close(props)));
|
|
14978
14888
|
|
|
14979
14889
|
const clearSelections = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
14980
14890
|
shapes: [{
|
|
@@ -15096,7 +15006,7 @@ const More$1 = React__default.forwardRef((_ref3, ref) => {
|
|
|
15096
15006
|
const autoFocusIndex = actions.findIndex(action => !action.disabled);
|
|
15097
15007
|
return showActions && /*#__PURE__*/React__default.createElement(StyledPopover$1
|
|
15098
15008
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
15099
|
-
, _extends$
|
|
15009
|
+
, _extends$2({}, popoverProps, {
|
|
15100
15010
|
onClose: onCloseOrActionClick,
|
|
15101
15011
|
ref: ref,
|
|
15102
15012
|
open: show,
|
|
@@ -15362,7 +15272,7 @@ function ActionsToolbar(_ref3) {
|
|
|
15362
15272
|
moreEnabled = true;
|
|
15363
15273
|
moreActions = [...newMoreActions, ...more$1.actions];
|
|
15364
15274
|
}
|
|
15365
|
-
if (!selections.show && newActions.length === 0) return null;
|
|
15275
|
+
if (!selections.show && newActions.length === 0 && !moreEnabled) return null;
|
|
15366
15276
|
const handleCloseShowMoreItems = () => {
|
|
15367
15277
|
setShowMoreItems(false);
|
|
15368
15278
|
};
|
|
@@ -15466,7 +15376,6 @@ const StyledOutlinedInput = styled(OutlinedInput, {
|
|
|
15466
15376
|
shouldForwardProp: p => !['styles', 'dense', 'isRtl'].includes(p)
|
|
15467
15377
|
})(_ref => {
|
|
15468
15378
|
let {
|
|
15469
|
-
theme,
|
|
15470
15379
|
styles,
|
|
15471
15380
|
dense,
|
|
15472
15381
|
isRtl
|
|
@@ -15475,10 +15384,11 @@ const StyledOutlinedInput = styled(OutlinedInput, {
|
|
|
15475
15384
|
if (dense) {
|
|
15476
15385
|
denseProps = {
|
|
15477
15386
|
fontSize: 12,
|
|
15478
|
-
paddingLeft: theme.spacing(1),
|
|
15479
15387
|
'& input': {
|
|
15480
15388
|
paddingTop: '5px',
|
|
15481
|
-
paddingBottom: '5px'
|
|
15389
|
+
paddingBottom: '5px',
|
|
15390
|
+
color: styles.search.color,
|
|
15391
|
+
textAlign: isRtl ? 'right' : 'left'
|
|
15482
15392
|
}
|
|
15483
15393
|
};
|
|
15484
15394
|
}
|
|
@@ -15489,7 +15399,8 @@ const StyledOutlinedInput = styled(OutlinedInput, {
|
|
|
15489
15399
|
borderRadius: 0,
|
|
15490
15400
|
backgroundColor: styles.search.backgroundColor,
|
|
15491
15401
|
backdropFilter: styles.background.backgroundImage ? styles.search.backdropFilter : undefined,
|
|
15492
|
-
paddingLeft:
|
|
15402
|
+
paddingLeft: 0,
|
|
15403
|
+
paddingRight: 0,
|
|
15493
15404
|
flexDirection: isRtl ? 'row-reverse' : 'row',
|
|
15494
15405
|
'& fieldset': {
|
|
15495
15406
|
borderColor: "".concat(styles.search.borderColor),
|
|
@@ -15509,8 +15420,22 @@ const StyledOutlinedInput = styled(OutlinedInput, {
|
|
|
15509
15420
|
}
|
|
15510
15421
|
}, denseProps);
|
|
15511
15422
|
});
|
|
15423
|
+
const StyledIconButton = styled(IconButton)(() => ({
|
|
15424
|
+
border: 0,
|
|
15425
|
+
padding: '8px',
|
|
15426
|
+
cursor: 'pointer',
|
|
15427
|
+
lineHeight: '12px',
|
|
15428
|
+
'&:hover': {
|
|
15429
|
+
backgroundColor: 'transparent'
|
|
15430
|
+
},
|
|
15431
|
+
':focus-visible': {
|
|
15432
|
+
borderRadius: '4px',
|
|
15433
|
+
boxShadow: 'inset 0 0 0 2px rgb(2, 117, 217)'
|
|
15434
|
+
}
|
|
15435
|
+
}));
|
|
15512
15436
|
function ListBoxSearch(_ref2) {
|
|
15513
15437
|
let {
|
|
15438
|
+
popoverOpen,
|
|
15514
15439
|
selections,
|
|
15515
15440
|
selectionState,
|
|
15516
15441
|
model,
|
|
@@ -15530,6 +15455,8 @@ function ListBoxSearch(_ref2) {
|
|
|
15530
15455
|
const [value, setValue] = useState$1('');
|
|
15531
15456
|
const [wildcardOn, setWildcardOn] = useState$1(false);
|
|
15532
15457
|
const inputRef = useRef();
|
|
15458
|
+
const clearSearchRef = useRef();
|
|
15459
|
+
const clearSearchText = translator.get('Listbox.Clear.Search');
|
|
15533
15460
|
const {
|
|
15534
15461
|
getStoreValue,
|
|
15535
15462
|
setStoreValue
|
|
@@ -15617,12 +15544,17 @@ function ListBoxSearch(_ref2) {
|
|
|
15617
15544
|
{
|
|
15618
15545
|
focusRow(container);
|
|
15619
15546
|
cancel();
|
|
15547
|
+
if (popoverOpen) {
|
|
15548
|
+
return undefined;
|
|
15549
|
+
}
|
|
15620
15550
|
break;
|
|
15621
15551
|
}
|
|
15622
15552
|
case 'Tab':
|
|
15623
15553
|
{
|
|
15624
15554
|
if (e.shiftKey) {
|
|
15625
15555
|
keyboard.focusSelection();
|
|
15556
|
+
} else if (clearSearchRef.current) {
|
|
15557
|
+
clearSearchRef.current.focus();
|
|
15626
15558
|
} else {
|
|
15627
15559
|
// Focus the row we last visited or the first one.
|
|
15628
15560
|
focusRow(container);
|
|
@@ -15653,6 +15585,42 @@ function ListBoxSearch(_ref2) {
|
|
|
15653
15585
|
e.stopPropagation();
|
|
15654
15586
|
return undefined;
|
|
15655
15587
|
};
|
|
15588
|
+
const focusOnInput = () => {
|
|
15589
|
+
var _inputRef$current;
|
|
15590
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
15591
|
+
};
|
|
15592
|
+
const onClearSearch = () => {
|
|
15593
|
+
abortSearch();
|
|
15594
|
+
focusOnInput();
|
|
15595
|
+
};
|
|
15596
|
+
const onKeyDownClearSearch = async e => {
|
|
15597
|
+
const container = e.currentTarget.closest('.listbox-container');
|
|
15598
|
+
switch (e.key) {
|
|
15599
|
+
case 'Enter':
|
|
15600
|
+
onClearSearch();
|
|
15601
|
+
break;
|
|
15602
|
+
case 'Tab':
|
|
15603
|
+
{
|
|
15604
|
+
if (e.shiftKey) {
|
|
15605
|
+
focusOnInput();
|
|
15606
|
+
} else {
|
|
15607
|
+
// Focus the row we last visited or the first one.
|
|
15608
|
+
focusRow(container);
|
|
15609
|
+
|
|
15610
|
+
// Clean up.
|
|
15611
|
+
container === null || container === void 0 || container.querySelectorAll('.last-focused').forEach(elm => {
|
|
15612
|
+
elm.classList.remove('last-focused');
|
|
15613
|
+
});
|
|
15614
|
+
}
|
|
15615
|
+
break;
|
|
15616
|
+
}
|
|
15617
|
+
default:
|
|
15618
|
+
return undefined;
|
|
15619
|
+
}
|
|
15620
|
+
e.preventDefault();
|
|
15621
|
+
e.stopPropagation();
|
|
15622
|
+
return undefined;
|
|
15623
|
+
};
|
|
15656
15624
|
if (!visible || searchEnabled === false) {
|
|
15657
15625
|
return null;
|
|
15658
15626
|
}
|
|
@@ -15661,10 +15629,28 @@ function ListBoxSearch(_ref2) {
|
|
|
15661
15629
|
dense: dense,
|
|
15662
15630
|
isRtl: isRtl,
|
|
15663
15631
|
startAdornment: /*#__PURE__*/React__default.createElement(InputAdornment, {
|
|
15664
|
-
position: "start"
|
|
15632
|
+
position: "start",
|
|
15633
|
+
sx: {
|
|
15634
|
+
marginLeft: dense ? '8px' : "".concat(CELL_PADDING_LEFT, "px")
|
|
15635
|
+
}
|
|
15665
15636
|
}, /*#__PURE__*/React__default.createElement(SearchIcon, {
|
|
15666
15637
|
size: dense ? 'small' : 'normal'
|
|
15667
15638
|
})),
|
|
15639
|
+
endAdornment: /*#__PURE__*/React__default.createElement(InputAdornment, {
|
|
15640
|
+
position: "end",
|
|
15641
|
+
sx: {
|
|
15642
|
+
marginLeft: 0
|
|
15643
|
+
}
|
|
15644
|
+
}, value !== '' && /*#__PURE__*/React__default.createElement(StyledIconButton, {
|
|
15645
|
+
tabIndex: 0,
|
|
15646
|
+
ref: clearSearchRef,
|
|
15647
|
+
title: clearSearchText,
|
|
15648
|
+
"aria-label": clearSearchText,
|
|
15649
|
+
onClick: onClearSearch,
|
|
15650
|
+
onKeyDown: onKeyDownClearSearch
|
|
15651
|
+
}, /*#__PURE__*/React__default.createElement(Close, {
|
|
15652
|
+
size: dense ? 'small' : 'normal'
|
|
15653
|
+
}))),
|
|
15668
15654
|
className: "search",
|
|
15669
15655
|
inputRef: inputRef,
|
|
15670
15656
|
size: "small",
|
|
@@ -18003,6 +17989,13 @@ const LIGHT = '#FFF';
|
|
|
18003
17989
|
const DARK = '#000';
|
|
18004
17990
|
const CONTRAST_THRESHOLD = 1.5;
|
|
18005
17991
|
const LIGHT_PREFERRED_THRESHOLD = 3;
|
|
17992
|
+
const DEFAULT_SELECTION_COLORS = {
|
|
17993
|
+
selected: '#009845',
|
|
17994
|
+
alternative: '#E4E4E4',
|
|
17995
|
+
excluded: '#A9A9A9',
|
|
17996
|
+
selectedExcluded: '#A9A9A9',
|
|
17997
|
+
possible: '#FFFFFF'
|
|
17998
|
+
};
|
|
18006
17999
|
const getContrast = (desired, background) => {
|
|
18007
18000
|
let contrast = false;
|
|
18008
18001
|
const des = new Color(desired);
|
|
@@ -18054,52 +18047,35 @@ function getOverridesAsObject() {
|
|
|
18054
18047
|
return overrides;
|
|
18055
18048
|
}
|
|
18056
18049
|
function getSelectionColors(_ref) {
|
|
18057
|
-
var _overrides$theme, _theme$palette, _overrides$theme$cont, _overrides$theme2, _overrides$selections
|
|
18050
|
+
var _overrides$theme, _theme$palette, _overrides$theme$cont, _overrides$theme2, _overrides$selections;
|
|
18058
18051
|
let {
|
|
18059
18052
|
getColorPickerColor,
|
|
18060
18053
|
theme,
|
|
18061
18054
|
getListboxStyle,
|
|
18062
18055
|
overrides,
|
|
18063
|
-
checkboxes
|
|
18056
|
+
checkboxes,
|
|
18057
|
+
themeSelectionColorsEnabled
|
|
18064
18058
|
} = _ref;
|
|
18065
18059
|
const componentContentTextColor = (_overrides$theme = overrides.theme) === null || _overrides$theme === void 0 || (_overrides$theme = _overrides$theme.content) === null || _overrides$theme === void 0 ? void 0 : _overrides$theme.fontColor;
|
|
18060
|
+
|
|
18061
|
+
// color priority: layout.component > theme content color > MUI theme
|
|
18066
18062
|
const desiredTextColor = getColorPickerColor(componentContentTextColor) || getListboxStyle('content', 'color') || ((_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.text.primary);
|
|
18067
18063
|
const useContrastTextColor = !checkboxes && ((_overrides$theme$cont = (_overrides$theme2 = overrides.theme) === null || _overrides$theme2 === void 0 || (_overrides$theme2 = _overrides$theme2.content) === null || _overrides$theme2 === void 0 ? void 0 : _overrides$theme2.useContrastColor) !== null && _overrides$theme$cont !== void 0 ? _overrides$theme$cont : true);
|
|
18068
|
-
|
|
18069
|
-
|
|
18070
|
-
const
|
|
18071
|
-
|
|
18072
|
-
|
|
18073
|
-
|
|
18074
|
-
|
|
18075
|
-
|
|
18076
|
-
|
|
18077
|
-
|
|
18078
|
-
|
|
18079
|
-
|
|
18080
|
-
|
|
18081
|
-
let selectedExcludedContrast = desiredTextColor || ((_theme$palette10 = theme.palette) === null || _theme$palette10 === void 0 ? void 0 : _theme$palette10.selected.selectedExcludedContrastText);
|
|
18082
|
-
let possibleContrast = desiredTextColor || ((_theme$palette11 = theme.palette) === null || _theme$palette11 === void 0 ? void 0 : _theme$palette11.selected.possibleContrastText);
|
|
18083
|
-
if (useContrastTextColor) {
|
|
18084
|
-
// Override preferred text color if it does not contrast enough with the background color.
|
|
18085
|
-
selectedContrast = getContrastingColor(selected, desiredTextColor);
|
|
18086
|
-
alternativeContrast = getContrastingColor(alternative, desiredTextColor);
|
|
18087
|
-
excludedContrast = getContrastingColor(excluded, desiredTextColor);
|
|
18088
|
-
selectedExcludedContrast = getContrastingColor(selectedExcluded, desiredTextColor);
|
|
18089
|
-
possibleContrast = getContrastingColor(possible, desiredTextColor);
|
|
18090
|
-
}
|
|
18091
|
-
return {
|
|
18092
|
-
selected,
|
|
18093
|
-
alternative,
|
|
18094
|
-
excluded,
|
|
18095
|
-
selectedExcluded,
|
|
18096
|
-
possible,
|
|
18097
|
-
selectedContrast,
|
|
18098
|
-
alternativeContrast,
|
|
18099
|
-
excludedContrast,
|
|
18100
|
-
selectedExcludedContrast,
|
|
18101
|
-
possibleContrast
|
|
18064
|
+
const getSelectionThemeColor = state => themeSelectionColorsEnabled ? getListboxStyle('', "dataColors.".concat(state)) : undefined;
|
|
18065
|
+
const componentSelectionColors = ((_overrides$selections = overrides.selections) === null || _overrides$selections === void 0 ? void 0 : _overrides$selections.colors) || {};
|
|
18066
|
+
const getSelectionStateColors = state => {
|
|
18067
|
+
var _theme$palette2, _theme$palette3;
|
|
18068
|
+
const paletteState = state === 'selected' ? 'main' : state;
|
|
18069
|
+
const contrastState = "".concat(state, "Contrast");
|
|
18070
|
+
// color priority: layout.component > theme dataColors > theme background (only for 'possible') > MUI theme > hardcoded default
|
|
18071
|
+
const color = getColorPickerColor(componentSelectionColors[state]) || getSelectionThemeColor(state) || state === 'possible' && getListboxStyle('', 'backgroundColor') || ((_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 ? void 0 : _theme$palette2.selected[paletteState]) || DEFAULT_SELECTION_COLORS[state];
|
|
18072
|
+
const contrastColor = useContrastTextColor ? getContrastingColor(color, desiredTextColor) : desiredTextColor || ((_theme$palette3 = theme.palette) === null || _theme$palette3 === void 0 ? void 0 : _theme$palette3.selected["".concat(contrastState, "Text}")]);
|
|
18073
|
+
return {
|
|
18074
|
+
[state]: color,
|
|
18075
|
+
[contrastState]: contrastColor
|
|
18076
|
+
};
|
|
18102
18077
|
};
|
|
18078
|
+
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, getSelectionStateColors('selected')), getSelectionStateColors('alternative')), getSelectionStateColors('excluded')), getSelectionStateColors('selectedExcluded')), getSelectionStateColors('possible'));
|
|
18103
18079
|
}
|
|
18104
18080
|
function getBackgroundColor(_ref2) {
|
|
18105
18081
|
let {
|
|
@@ -18137,7 +18113,8 @@ function getStyles(_ref3) {
|
|
|
18137
18113
|
themeApi,
|
|
18138
18114
|
theme,
|
|
18139
18115
|
components = [],
|
|
18140
|
-
checkboxes = false
|
|
18116
|
+
checkboxes = false,
|
|
18117
|
+
themeSelectionColorsEnabled = false
|
|
18141
18118
|
} = _ref3;
|
|
18142
18119
|
const overrides = getOverridesAsObject(components);
|
|
18143
18120
|
const getListboxStyle = (path, prop) => themeApi.getStyle('object.listBox', path, prop);
|
|
@@ -18147,7 +18124,8 @@ function getStyles(_ref3) {
|
|
|
18147
18124
|
theme,
|
|
18148
18125
|
getListboxStyle,
|
|
18149
18126
|
overrides,
|
|
18150
|
-
checkboxes
|
|
18127
|
+
checkboxes,
|
|
18128
|
+
themeSelectionColorsEnabled
|
|
18151
18129
|
});
|
|
18152
18130
|
const themeOverrides = overrides.theme || {};
|
|
18153
18131
|
const headerColor = getColorPickerColor((_themeOverrides$heade = themeOverrides.header) === null || _themeOverrides$heade === void 0 ? void 0 : _themeOverrides$heade.fontColor) || getListboxStyle('title.main', 'color');
|
|
@@ -18221,7 +18199,8 @@ function ListBoxPopover(_ref) {
|
|
|
18221
18199
|
autoFocus,
|
|
18222
18200
|
components,
|
|
18223
18201
|
checkboxes: checkboxesOption,
|
|
18224
|
-
selectDisabled = () => false
|
|
18202
|
+
selectDisabled = () => false,
|
|
18203
|
+
flags
|
|
18225
18204
|
} = _ref;
|
|
18226
18205
|
const isMasterDim = Boolean(fieldName === null || fieldName === void 0 ? void 0 : fieldName.qLibraryId);
|
|
18227
18206
|
const open = show && Boolean(alignTo.current);
|
|
@@ -18273,11 +18252,13 @@ function ListBoxPopover(_ref) {
|
|
|
18273
18252
|
const {
|
|
18274
18253
|
checkboxes = checkboxesOption
|
|
18275
18254
|
} = layout || {};
|
|
18255
|
+
const themeSelectionColorsEnabled = flags.isEnabled('PS_22149_THEME_SELECTION_COLORS');
|
|
18276
18256
|
const styles = getStyles({
|
|
18277
18257
|
themeApi,
|
|
18278
18258
|
theme,
|
|
18279
18259
|
components,
|
|
18280
|
-
checkboxes
|
|
18260
|
+
checkboxes,
|
|
18261
|
+
themeSelectionColorsEnabled
|
|
18281
18262
|
});
|
|
18282
18263
|
useEffect$1(() => {
|
|
18283
18264
|
if (selections && open) {
|
|
@@ -18379,6 +18360,7 @@ function ListBoxPopover(_ref) {
|
|
|
18379
18360
|
item: true,
|
|
18380
18361
|
ref: searchContainerRef
|
|
18381
18362
|
}, /*#__PURE__*/React__default.createElement(ListBoxSearch, {
|
|
18363
|
+
popoverOpen: open,
|
|
18382
18364
|
styles: styles,
|
|
18383
18365
|
visible: true,
|
|
18384
18366
|
model: model,
|
|
@@ -19865,7 +19847,8 @@ function getListboxActionProps(_ref) {
|
|
|
19865
19847
|
},
|
|
19866
19848
|
extraItems,
|
|
19867
19849
|
more: {
|
|
19868
|
-
enabled: !isLocked,
|
|
19850
|
+
enabled: !isLocked && (showToolbar || selections.isActive()),
|
|
19851
|
+
// show more button even when popover is not in selection mode
|
|
19869
19852
|
actions: listboxSelectionToolbarItems,
|
|
19870
19853
|
popoverProps: {
|
|
19871
19854
|
elevation: 0
|
|
@@ -19876,7 +19859,7 @@ function getListboxActionProps(_ref) {
|
|
|
19876
19859
|
}
|
|
19877
19860
|
},
|
|
19878
19861
|
selections: {
|
|
19879
|
-
show: showToolbar,
|
|
19862
|
+
show: showToolbar && selections.isActive(),
|
|
19880
19863
|
api: selections,
|
|
19881
19864
|
onConfirm: () => {
|
|
19882
19865
|
keyboard === null || keyboard === void 0 || keyboard.focus();
|
|
@@ -20155,8 +20138,7 @@ function ListBoxHeader(_ref2) {
|
|
|
20155
20138
|
selections,
|
|
20156
20139
|
keyboard,
|
|
20157
20140
|
autoConfirm,
|
|
20158
|
-
app
|
|
20159
|
-
isInSelection
|
|
20141
|
+
app
|
|
20160
20142
|
} = _ref2;
|
|
20161
20143
|
const [isToolbarDetached, setIsToolbarDetached] = useState$1(showDetachedToolbarOnly);
|
|
20162
20144
|
const [isLocked, setLocked] = useState$1(layout === null || layout === void 0 || (_layout$qListObject = layout.qListObject) === null || _layout$qListObject === void 0 || (_layout$qListObject = _layout$qListObject.qDimensionInfo) === null || _layout$qListObject === void 0 ? void 0 : _layout$qListObject.qLocked);
|
|
@@ -20194,7 +20176,8 @@ function ListBoxHeader(_ref2) {
|
|
|
20194
20176
|
model,
|
|
20195
20177
|
translator,
|
|
20196
20178
|
selectionState,
|
|
20197
|
-
isDirectQuery
|
|
20179
|
+
isDirectQuery,
|
|
20180
|
+
selections
|
|
20198
20181
|
});
|
|
20199
20182
|
const extraItems = isLocked || !showLock ? undefined : [{
|
|
20200
20183
|
key: 'lock',
|
|
@@ -20238,6 +20221,7 @@ function ListBoxHeader(_ref2) {
|
|
|
20238
20221
|
isDetached: isPopover ? false : isToolbarDetached,
|
|
20239
20222
|
showToolbar,
|
|
20240
20223
|
containerRef,
|
|
20224
|
+
isPopover,
|
|
20241
20225
|
isLocked,
|
|
20242
20226
|
extraItems,
|
|
20243
20227
|
listboxSelectionToolbarItems,
|
|
@@ -20245,7 +20229,7 @@ function ListBoxHeader(_ref2) {
|
|
|
20245
20229
|
keyboard,
|
|
20246
20230
|
autoConfirm
|
|
20247
20231
|
});
|
|
20248
|
-
const actionsToolbar = /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$
|
|
20232
|
+
const actionsToolbar = /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$2({
|
|
20249
20233
|
isRtl: isRtl,
|
|
20250
20234
|
layout: layout
|
|
20251
20235
|
}, toolbarProps));
|
|
@@ -20283,7 +20267,7 @@ function ListBoxHeader(_ref2) {
|
|
|
20283
20267
|
}, lockedIconComp || showSearchIcon && searchIconComp, /*#__PURE__*/React__default.createElement(DimensionIcon, {
|
|
20284
20268
|
iconData: iconData,
|
|
20285
20269
|
iconStyle: iconStyle,
|
|
20286
|
-
disabled:
|
|
20270
|
+
disabled: selections.isActive() && isPopover,
|
|
20287
20271
|
translator: translator
|
|
20288
20272
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
20289
20273
|
item: true,
|
|
@@ -20380,7 +20364,8 @@ function ListBoxInline(_ref3) {
|
|
|
20380
20364
|
isPopover = false,
|
|
20381
20365
|
showLock = false,
|
|
20382
20366
|
components,
|
|
20383
|
-
selectDisabled = () => false
|
|
20367
|
+
selectDisabled = () => false,
|
|
20368
|
+
flags
|
|
20384
20369
|
} = options;
|
|
20385
20370
|
|
|
20386
20371
|
// Hook that will trigger update when used in useEffects.
|
|
@@ -20404,12 +20389,14 @@ function ListBoxInline(_ref3) {
|
|
|
20404
20389
|
const {
|
|
20405
20390
|
checkboxes = checkboxesOption
|
|
20406
20391
|
} = layout || {};
|
|
20392
|
+
const themeSelectionColorsEnabled = flags.isEnabled('PS_22149_THEME_SELECTION_COLORS');
|
|
20407
20393
|
const styles = getStyles({
|
|
20408
20394
|
app,
|
|
20409
20395
|
themeApi,
|
|
20410
20396
|
theme,
|
|
20411
20397
|
components,
|
|
20412
|
-
checkboxes
|
|
20398
|
+
checkboxes,
|
|
20399
|
+
themeSelectionColorsEnabled
|
|
20413
20400
|
});
|
|
20414
20401
|
const isDirectQuery = isDirectQueryEnabled({
|
|
20415
20402
|
appLayout: app === null || app === void 0 ? void 0 : app.layout
|
|
@@ -20444,7 +20431,6 @@ function ListBoxInline(_ref3) {
|
|
|
20444
20431
|
}), [app, appSelections]);
|
|
20445
20432
|
const isInvalid = layout === null || layout === void 0 ? void 0 : layout.qListObject.qDimensionInfo.qError;
|
|
20446
20433
|
const errorText = isInvalid && constraints.active ? 'Visualization.Invalid.Dimension' : 'Visualization.Incomplete';
|
|
20447
|
-
const [isInSelection, setIsInSelection] = useState$1(false);
|
|
20448
20434
|
const {
|
|
20449
20435
|
handleKeyDown,
|
|
20450
20436
|
handleOnMouseEnter,
|
|
@@ -20473,11 +20459,9 @@ function ListBoxInline(_ref3) {
|
|
|
20473
20459
|
}
|
|
20474
20460
|
const show = () => {
|
|
20475
20461
|
setShowToolbar(true);
|
|
20476
|
-
setIsInSelection(true);
|
|
20477
20462
|
};
|
|
20478
20463
|
const hide = () => {
|
|
20479
20464
|
setShowToolbar(false);
|
|
20480
|
-
setIsInSelection(false);
|
|
20481
20465
|
if (search === 'toggle') {
|
|
20482
20466
|
setShowSearch(false);
|
|
20483
20467
|
}
|
|
@@ -20495,7 +20479,7 @@ function ListBoxInline(_ref3) {
|
|
|
20495
20479
|
selections.on('activated', show);
|
|
20496
20480
|
selections.on('deactivated', hide);
|
|
20497
20481
|
}
|
|
20498
|
-
setShowToolbar(selections.isActive());
|
|
20482
|
+
setShowToolbar(isPopover || selections.isActive());
|
|
20499
20483
|
}
|
|
20500
20484
|
return () => {
|
|
20501
20485
|
if (selections && selections.removeListener) {
|
|
@@ -20579,8 +20563,7 @@ function ListBoxInline(_ref3) {
|
|
|
20579
20563
|
model: model,
|
|
20580
20564
|
selectionState: selectionState$1,
|
|
20581
20565
|
selections: selections,
|
|
20582
|
-
keyboard: keyboard
|
|
20583
|
-
isInSelection: isInSelection
|
|
20566
|
+
keyboard: keyboard
|
|
20584
20567
|
});
|
|
20585
20568
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, showDetachedToolbarOnly && listBoxHeader, /*#__PURE__*/React__default.createElement(StyledGrid$3, {
|
|
20586
20569
|
className: "listbox-container",
|
|
@@ -21122,7 +21105,8 @@ function ListBoxWrapper(_ref) {
|
|
|
21122
21105
|
stateName,
|
|
21123
21106
|
element,
|
|
21124
21107
|
options,
|
|
21125
|
-
renderedCallback
|
|
21108
|
+
renderedCallback,
|
|
21109
|
+
flags
|
|
21126
21110
|
} = _ref;
|
|
21127
21111
|
const {
|
|
21128
21112
|
isExistingObject,
|
|
@@ -21159,7 +21143,8 @@ function ListBoxWrapper(_ref) {
|
|
|
21159
21143
|
selections,
|
|
21160
21144
|
model,
|
|
21161
21145
|
app,
|
|
21162
|
-
renderedCallback
|
|
21146
|
+
renderedCallback,
|
|
21147
|
+
flags
|
|
21163
21148
|
}), [options, selections, model, app]);
|
|
21164
21149
|
if (!selections || !model) {
|
|
21165
21150
|
return null;
|
|
@@ -21176,7 +21161,8 @@ function ListBoxPortal(_ref2) {
|
|
|
21176
21161
|
qId,
|
|
21177
21162
|
stateName = '$',
|
|
21178
21163
|
options = {},
|
|
21179
|
-
renderedCallback
|
|
21164
|
+
renderedCallback,
|
|
21165
|
+
flags
|
|
21180
21166
|
} = _ref2;
|
|
21181
21167
|
return ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(ListBoxWrapper, {
|
|
21182
21168
|
app: app,
|
|
@@ -21185,7 +21171,8 @@ function ListBoxPortal(_ref2) {
|
|
|
21185
21171
|
qId: qId,
|
|
21186
21172
|
stateName: stateName,
|
|
21187
21173
|
options: options,
|
|
21188
|
-
renderedCallback: renderedCallback
|
|
21174
|
+
renderedCallback: renderedCallback,
|
|
21175
|
+
flags: flags
|
|
21189
21176
|
}), element, uid());
|
|
21190
21177
|
}
|
|
21191
21178
|
|
|
@@ -21212,7 +21199,8 @@ function ListBoxPopoverWrapper(_ref) {
|
|
|
21212
21199
|
fieldIdentifier,
|
|
21213
21200
|
stateName,
|
|
21214
21201
|
element,
|
|
21215
|
-
options = {}
|
|
21202
|
+
options = {},
|
|
21203
|
+
flags
|
|
21216
21204
|
} = _ref;
|
|
21217
21205
|
const [showState, setShowstate] = useState$1(!!options.show);
|
|
21218
21206
|
const handleCloseShowState = () => {
|
|
@@ -21233,7 +21221,8 @@ function ListBoxPopoverWrapper(_ref) {
|
|
|
21233
21221
|
fieldName: fieldIdentifier,
|
|
21234
21222
|
stateName: stateName,
|
|
21235
21223
|
autoFocus: options.autoFocus,
|
|
21236
|
-
components: options.components
|
|
21224
|
+
components: options.components,
|
|
21225
|
+
flags: flags
|
|
21237
21226
|
});
|
|
21238
21227
|
}
|
|
21239
21228
|
|
|
@@ -22615,13 +22604,13 @@ function Progress(_ref2) {
|
|
|
22615
22604
|
const s = SIZES[size];
|
|
22616
22605
|
return /*#__PURE__*/React__default.createElement(Root, {
|
|
22617
22606
|
className: classes$3.root
|
|
22618
|
-
}, /*#__PURE__*/React__default.createElement(CircularProgress, _extends$
|
|
22607
|
+
}, /*#__PURE__*/React__default.createElement(CircularProgress, _extends$2({
|
|
22619
22608
|
variant: "determinate",
|
|
22620
22609
|
value: 100,
|
|
22621
22610
|
className: classes$3.back,
|
|
22622
22611
|
size: s,
|
|
22623
22612
|
thickness: 3
|
|
22624
|
-
}, props)), /*#__PURE__*/React__default.createElement(CircularProgress, _extends$
|
|
22613
|
+
}, props)), /*#__PURE__*/React__default.createElement(CircularProgress, _extends$2({
|
|
22625
22614
|
variant: "indeterminate",
|
|
22626
22615
|
disableShrink: true,
|
|
22627
22616
|
className: classes$3.front,
|
|
@@ -22671,7 +22660,7 @@ function Cancel(_ref) {
|
|
|
22671
22660
|
variant: "h6",
|
|
22672
22661
|
align: "center",
|
|
22673
22662
|
"data-tid": "update-active"
|
|
22674
|
-
}, translator.get('Object.Update.Active')))), /*#__PURE__*/React__default.createElement(Grid, _extends$
|
|
22663
|
+
}, translator.get('Object.Update.Active')))), /*#__PURE__*/React__default.createElement(Grid, _extends$2({
|
|
22675
22664
|
item: true
|
|
22676
22665
|
}, props), /*#__PURE__*/React__default.createElement(Button, {
|
|
22677
22666
|
variant: "contained",
|
|
@@ -22698,7 +22687,7 @@ function Retry(_ref2) {
|
|
|
22698
22687
|
"data-tid": "update-cancelled"
|
|
22699
22688
|
}, translator.get('Object.Update.Cancelled'))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
22700
22689
|
item: true
|
|
22701
|
-
}, /*#__PURE__*/React__default.createElement(Button, _extends$
|
|
22690
|
+
}, /*#__PURE__*/React__default.createElement(Button, _extends$2({
|
|
22702
22691
|
variant: "contained",
|
|
22703
22692
|
onClick: retry
|
|
22704
22693
|
}, props), translator.get('Retry'))));
|
|
@@ -24279,15 +24268,10 @@ function depsChanged(prevDeps, deps) {
|
|
|
24279
24268
|
}
|
|
24280
24269
|
return false;
|
|
24281
24270
|
}
|
|
24282
|
-
function logHook(message, component) {
|
|
24283
|
-
var _ref;
|
|
24284
|
-
console.log("ID: ".concat((_ref = component || currentComponent) === null || _ref === void 0 || (_ref = _ref.context) === null || _ref === void 0 || (_ref = _ref.model) === null || _ref === void 0 ? void 0 : _ref.id, " index: ").concat(currentIndex, ", ").concat(message));
|
|
24285
|
-
}
|
|
24286
24271
|
function initiate(component) {
|
|
24287
24272
|
let {
|
|
24288
24273
|
explicitResize = false
|
|
24289
24274
|
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
24290
|
-
logHook('initiate');
|
|
24291
24275
|
component.__hooks = {
|
|
24292
24276
|
obsolete: false,
|
|
24293
24277
|
error: false,
|
|
@@ -24522,7 +24506,6 @@ function useState(initial) {
|
|
|
24522
24506
|
const v = typeof s === 'function' ? s(h.value[0]) : s;
|
|
24523
24507
|
if (v !== h.value[0]) {
|
|
24524
24508
|
h.value[0] = v;
|
|
24525
|
-
logHook("setState: ".concat(v), h.component);
|
|
24526
24509
|
scheduleMicro(h.component);
|
|
24527
24510
|
}
|
|
24528
24511
|
};
|
|
@@ -24573,13 +24556,10 @@ function useEffect(cb, deps) {
|
|
|
24573
24556
|
}
|
|
24574
24557
|
const h = getHook(++currentIndex);
|
|
24575
24558
|
if (depsChanged(h.value ? h.value[1] : undefined, deps)) {
|
|
24576
|
-
logHook('useEffect: deps changed');
|
|
24577
24559
|
h.value = [cb, deps];
|
|
24578
24560
|
if (currentComponent.__hooks.pendingEffects.indexOf(h) === -1) {
|
|
24579
24561
|
currentComponent.__hooks.pendingEffects.push(h);
|
|
24580
24562
|
}
|
|
24581
|
-
} else {
|
|
24582
|
-
logHook('useEffect: no change');
|
|
24583
24563
|
}
|
|
24584
24564
|
}
|
|
24585
24565
|
|
|
@@ -24693,7 +24673,6 @@ function usePromise(p, deps) {
|
|
|
24693
24673
|
h.teardown && h.teardown();
|
|
24694
24674
|
};
|
|
24695
24675
|
}, deps);
|
|
24696
|
-
logHook("usePromise: ".concat(obj.state));
|
|
24697
24676
|
return [obj.resolved, obj.rejected];
|
|
24698
24677
|
}
|
|
24699
24678
|
|
|
@@ -27067,52 +27046,59 @@ function flagsFn () {
|
|
|
27067
27046
|
}
|
|
27068
27047
|
|
|
27069
27048
|
class LRUCache {
|
|
27070
|
-
constructor() {
|
|
27049
|
+
constructor () {
|
|
27071
27050
|
this.max = 1000;
|
|
27072
27051
|
this.map = new Map();
|
|
27073
27052
|
}
|
|
27074
|
-
|
|
27053
|
+
|
|
27054
|
+
get (key) {
|
|
27075
27055
|
const value = this.map.get(key);
|
|
27076
27056
|
if (value === undefined) {
|
|
27077
|
-
return undefined
|
|
27057
|
+
return undefined
|
|
27078
27058
|
} else {
|
|
27079
27059
|
// Remove the key from the map and add it to the end
|
|
27080
27060
|
this.map.delete(key);
|
|
27081
27061
|
this.map.set(key, value);
|
|
27082
|
-
return value
|
|
27062
|
+
return value
|
|
27083
27063
|
}
|
|
27084
27064
|
}
|
|
27085
|
-
|
|
27086
|
-
|
|
27065
|
+
|
|
27066
|
+
delete (key) {
|
|
27067
|
+
return this.map.delete(key)
|
|
27087
27068
|
}
|
|
27088
|
-
|
|
27069
|
+
|
|
27070
|
+
set (key, value) {
|
|
27089
27071
|
const deleted = this.delete(key);
|
|
27072
|
+
|
|
27090
27073
|
if (!deleted && value !== undefined) {
|
|
27091
27074
|
// If cache is full, delete the least recently used item
|
|
27092
27075
|
if (this.map.size >= this.max) {
|
|
27093
27076
|
const firstKey = this.map.keys().next().value;
|
|
27094
27077
|
this.delete(firstKey);
|
|
27095
27078
|
}
|
|
27079
|
+
|
|
27096
27080
|
this.map.set(key, value);
|
|
27097
27081
|
}
|
|
27098
|
-
|
|
27082
|
+
|
|
27083
|
+
return this
|
|
27099
27084
|
}
|
|
27100
27085
|
}
|
|
27086
|
+
|
|
27101
27087
|
var lrucache = LRUCache;
|
|
27102
27088
|
|
|
27103
27089
|
// parse out just the options we care about
|
|
27104
|
-
const looseOption = Object.freeze({
|
|
27105
|
-
|
|
27106
|
-
});
|
|
27107
|
-
const emptyOpts = Object.freeze({});
|
|
27090
|
+
const looseOption = Object.freeze({ loose: true });
|
|
27091
|
+
const emptyOpts = Object.freeze({ });
|
|
27108
27092
|
const parseOptions$1 = options => {
|
|
27109
27093
|
if (!options) {
|
|
27110
|
-
return emptyOpts
|
|
27094
|
+
return emptyOpts
|
|
27111
27095
|
}
|
|
27096
|
+
|
|
27112
27097
|
if (typeof options !== 'object') {
|
|
27113
|
-
return looseOption
|
|
27098
|
+
return looseOption
|
|
27114
27099
|
}
|
|
27115
|
-
|
|
27100
|
+
|
|
27101
|
+
return options
|
|
27116
27102
|
};
|
|
27117
27103
|
var parseOptions_1 = parseOptions$1;
|
|
27118
27104
|
|
|
@@ -27121,8 +27107,10 @@ var re$1 = {exports: {}};
|
|
|
27121
27107
|
// Note: this is the semver.org version of the spec that it implements
|
|
27122
27108
|
// Not necessarily the package version of this code.
|
|
27123
27109
|
const SEMVER_SPEC_VERSION = '2.0.0';
|
|
27110
|
+
|
|
27124
27111
|
const MAX_LENGTH$1 = 256;
|
|
27125
|
-
const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER ||
|
|
27112
|
+
const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER ||
|
|
27113
|
+
/* istanbul ignore next */ 9007199254740991;
|
|
27126
27114
|
|
|
27127
27115
|
// Max safe segment length for coercion.
|
|
27128
27116
|
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
@@ -27130,7 +27118,17 @@ const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
|
27130
27118
|
// Max safe length for a build identifier. The max length minus 6 characters for
|
|
27131
27119
|
// the shortest version with a build 0.0.0+BUILD.
|
|
27132
27120
|
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH$1 - 6;
|
|
27133
|
-
|
|
27121
|
+
|
|
27122
|
+
const RELEASE_TYPES = [
|
|
27123
|
+
'major',
|
|
27124
|
+
'premajor',
|
|
27125
|
+
'minor',
|
|
27126
|
+
'preminor',
|
|
27127
|
+
'patch',
|
|
27128
|
+
'prepatch',
|
|
27129
|
+
'prerelease',
|
|
27130
|
+
];
|
|
27131
|
+
|
|
27134
27132
|
var constants = {
|
|
27135
27133
|
MAX_LENGTH: MAX_LENGTH$1,
|
|
27136
27134
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
@@ -27139,352 +27137,443 @@ var constants = {
|
|
|
27139
27137
|
RELEASE_TYPES,
|
|
27140
27138
|
SEMVER_SPEC_VERSION,
|
|
27141
27139
|
FLAG_INCLUDE_PRERELEASE: 0b001,
|
|
27142
|
-
FLAG_LOOSE: 0b010
|
|
27140
|
+
FLAG_LOOSE: 0b010,
|
|
27143
27141
|
};
|
|
27144
27142
|
|
|
27145
|
-
const debug$1 =
|
|
27146
|
-
|
|
27147
|
-
|
|
27148
|
-
|
|
27149
|
-
|
|
27150
|
-
|
|
27143
|
+
const debug$1 = (
|
|
27144
|
+
typeof process === 'object' &&
|
|
27145
|
+
process.env &&
|
|
27146
|
+
process.env.NODE_DEBUG &&
|
|
27147
|
+
/\bsemver\b/i.test(process.env.NODE_DEBUG)
|
|
27148
|
+
) ? (...args) => console.error('SEMVER', ...args)
|
|
27149
|
+
: () => {};
|
|
27150
|
+
|
|
27151
27151
|
var debug_1 = debug$1;
|
|
27152
27152
|
|
|
27153
27153
|
(function (module, exports) {
|
|
27154
|
-
|
|
27155
|
-
|
|
27156
|
-
|
|
27157
|
-
|
|
27158
|
-
|
|
27159
|
-
|
|
27160
|
-
|
|
27161
|
-
|
|
27162
|
-
|
|
27163
|
-
|
|
27164
|
-
|
|
27165
|
-
|
|
27166
|
-
|
|
27167
|
-
|
|
27168
|
-
|
|
27169
|
-
|
|
27170
|
-
|
|
27171
|
-
|
|
27172
|
-
|
|
27173
|
-
|
|
27174
|
-
|
|
27175
|
-
|
|
27176
|
-
|
|
27177
|
-
|
|
27178
|
-
|
|
27179
|
-
|
|
27180
|
-
|
|
27181
|
-
|
|
27182
|
-
|
|
27183
|
-
|
|
27184
|
-
|
|
27185
|
-
|
|
27186
|
-
|
|
27187
|
-
|
|
27188
|
-
|
|
27189
|
-
|
|
27190
|
-
|
|
27191
|
-
|
|
27154
|
+
const {
|
|
27155
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
27156
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
27157
|
+
MAX_LENGTH,
|
|
27158
|
+
} = constants;
|
|
27159
|
+
const debug = debug_1;
|
|
27160
|
+
exports = module.exports = {};
|
|
27161
|
+
|
|
27162
|
+
// The actual regexps go on exports.re
|
|
27163
|
+
const re = exports.re = [];
|
|
27164
|
+
const safeRe = exports.safeRe = [];
|
|
27165
|
+
const src = exports.src = [];
|
|
27166
|
+
const t = exports.t = {};
|
|
27167
|
+
let R = 0;
|
|
27168
|
+
|
|
27169
|
+
const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
|
|
27170
|
+
|
|
27171
|
+
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
|
|
27172
|
+
// used internally via the safeRe object since all inputs in this library get
|
|
27173
|
+
// normalized first to trim and collapse all extra whitespace. The original
|
|
27174
|
+
// regexes are exported for userland consumption and lower level usage. A
|
|
27175
|
+
// future breaking change could export the safer regex only with a note that
|
|
27176
|
+
// all input should have extra whitespace removed.
|
|
27177
|
+
const safeRegexReplacements = [
|
|
27178
|
+
['\\s', 1],
|
|
27179
|
+
['\\d', MAX_LENGTH],
|
|
27180
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
|
|
27181
|
+
];
|
|
27182
|
+
|
|
27183
|
+
const makeSafeRegex = (value) => {
|
|
27184
|
+
for (const [token, max] of safeRegexReplacements) {
|
|
27185
|
+
value = value
|
|
27186
|
+
.split(`${token}*`).join(`${token}{0,${max}}`)
|
|
27187
|
+
.split(`${token}+`).join(`${token}{1,${max}}`);
|
|
27188
|
+
}
|
|
27189
|
+
return value
|
|
27190
|
+
};
|
|
27191
|
+
|
|
27192
|
+
const createToken = (name, value, isGlobal) => {
|
|
27193
|
+
const safe = makeSafeRegex(value);
|
|
27194
|
+
const index = R++;
|
|
27195
|
+
debug(name, index, value);
|
|
27196
|
+
t[name] = index;
|
|
27197
|
+
src[index] = value;
|
|
27198
|
+
re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
|
|
27199
|
+
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
|
|
27200
|
+
};
|
|
27201
|
+
|
|
27202
|
+
// The following Regular Expressions can be used for tokenizing,
|
|
27203
|
+
// validating, and parsing SemVer version strings.
|
|
27204
|
+
|
|
27205
|
+
// ## Numeric Identifier
|
|
27206
|
+
// A single `0`, or a non-zero digit followed by zero or more digits.
|
|
27207
|
+
|
|
27208
|
+
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
|
|
27209
|
+
createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
|
|
27210
|
+
|
|
27211
|
+
// ## Non-numeric Identifier
|
|
27212
|
+
// Zero or more digits, followed by a letter or hyphen, and then zero or
|
|
27213
|
+
// more letters, digits, or hyphens.
|
|
27214
|
+
|
|
27215
|
+
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
27216
|
+
|
|
27217
|
+
// ## Main Version
|
|
27218
|
+
// Three dot-separated numeric identifiers.
|
|
27219
|
+
|
|
27220
|
+
createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
|
|
27221
|
+
`(${src[t.NUMERICIDENTIFIER]})\\.` +
|
|
27222
|
+
`(${src[t.NUMERICIDENTIFIER]})`);
|
|
27223
|
+
|
|
27224
|
+
createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
|
|
27225
|
+
`(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
|
|
27226
|
+
`(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
27227
|
+
|
|
27228
|
+
// ## Pre-release Version Identifier
|
|
27229
|
+
// A numeric identifier, or a non-numeric identifier.
|
|
27230
|
+
|
|
27231
|
+
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
|
|
27232
|
+
}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
27233
|
+
|
|
27234
|
+
createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
|
|
27235
|
+
}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
27236
|
+
|
|
27237
|
+
// ## Pre-release Version
|
|
27238
|
+
// Hyphen, followed by one or more dot-separated pre-release version
|
|
27239
|
+
// identifiers.
|
|
27240
|
+
|
|
27241
|
+
createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
|
|
27242
|
+
}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
27243
|
+
|
|
27244
|
+
createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
|
|
27245
|
+
}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
27246
|
+
|
|
27247
|
+
// ## Build Metadata Identifier
|
|
27248
|
+
// Any combination of digits, letters, or hyphens.
|
|
27249
|
+
|
|
27250
|
+
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
|
|
27251
|
+
|
|
27252
|
+
// ## Build Metadata
|
|
27253
|
+
// Plus sign, followed by one or more period-separated build metadata
|
|
27254
|
+
// identifiers.
|
|
27255
|
+
|
|
27256
|
+
createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
|
|
27257
|
+
}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
27258
|
+
|
|
27259
|
+
// ## Full Version String
|
|
27260
|
+
// A main version, followed optionally by a pre-release version and
|
|
27261
|
+
// build metadata.
|
|
27262
|
+
|
|
27263
|
+
// Note that the only major, minor, patch, and pre-release sections of
|
|
27264
|
+
// the version string are capturing groups. The build metadata is not a
|
|
27265
|
+
// capturing group, because it should not ever be used in version
|
|
27266
|
+
// comparison.
|
|
27267
|
+
|
|
27268
|
+
createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
|
|
27269
|
+
}${src[t.PRERELEASE]}?${
|
|
27270
|
+
src[t.BUILD]}?`);
|
|
27271
|
+
|
|
27272
|
+
createToken('FULL', `^${src[t.FULLPLAIN]}$`);
|
|
27273
|
+
|
|
27274
|
+
// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
|
|
27275
|
+
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
|
|
27276
|
+
// common in the npm registry.
|
|
27277
|
+
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
|
|
27278
|
+
}${src[t.PRERELEASELOOSE]}?${
|
|
27279
|
+
src[t.BUILD]}?`);
|
|
27280
|
+
|
|
27281
|
+
createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
|
|
27282
|
+
|
|
27283
|
+
createToken('GTLT', '((?:<|>)?=?)');
|
|
27284
|
+
|
|
27285
|
+
// Something like "2.*" or "1.2.x".
|
|
27286
|
+
// Note that "x.x" is a valid xRange identifer, meaning "any version"
|
|
27287
|
+
// Only the first item is strictly required.
|
|
27288
|
+
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
27289
|
+
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
27290
|
+
|
|
27291
|
+
createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
|
|
27292
|
+
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
|
|
27293
|
+
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
|
|
27294
|
+
`(?:${src[t.PRERELEASE]})?${
|
|
27295
|
+
src[t.BUILD]}?` +
|
|
27296
|
+
`)?)?`);
|
|
27297
|
+
|
|
27298
|
+
createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
|
27299
|
+
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
|
27300
|
+
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
|
27301
|
+
`(?:${src[t.PRERELEASELOOSE]})?${
|
|
27302
|
+
src[t.BUILD]}?` +
|
|
27303
|
+
`)?)?`);
|
|
27304
|
+
|
|
27305
|
+
createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
27306
|
+
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
27307
|
+
|
|
27308
|
+
// Coercion.
|
|
27309
|
+
// Extract anything that could conceivably be a part of a valid semver
|
|
27310
|
+
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
|
|
27311
|
+
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
|
|
27312
|
+
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
|
|
27313
|
+
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
27314
|
+
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
27315
|
+
createToken('COERCEFULL', src[t.COERCEPLAIN] +
|
|
27316
|
+
`(?:${src[t.PRERELEASE]})?` +
|
|
27317
|
+
`(?:${src[t.BUILD]})?` +
|
|
27318
|
+
`(?:$|[^\\d])`);
|
|
27319
|
+
createToken('COERCERTL', src[t.COERCE], true);
|
|
27320
|
+
createToken('COERCERTLFULL', src[t.COERCEFULL], true);
|
|
27321
|
+
|
|
27322
|
+
// Tilde ranges.
|
|
27323
|
+
// Meaning is "reasonably at or greater than"
|
|
27324
|
+
createToken('LONETILDE', '(?:~>?)');
|
|
27325
|
+
|
|
27326
|
+
createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
27327
|
+
exports.tildeTrimReplace = '$1~';
|
|
27328
|
+
|
|
27329
|
+
createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
27330
|
+
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
27331
|
+
|
|
27332
|
+
// Caret ranges.
|
|
27333
|
+
// Meaning is "at least and backwards compatible with"
|
|
27334
|
+
createToken('LONECARET', '(?:\\^)');
|
|
27335
|
+
|
|
27336
|
+
createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
27337
|
+
exports.caretTrimReplace = '$1^';
|
|
27338
|
+
|
|
27339
|
+
createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
27340
|
+
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
27341
|
+
|
|
27342
|
+
// A simple gt/lt/eq thing, or just "" to indicate "any version"
|
|
27343
|
+
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
27344
|
+
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
27345
|
+
|
|
27346
|
+
// An expression to strip any whitespace between the gtlt and the thing
|
|
27347
|
+
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
|
|
27348
|
+
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
|
|
27349
|
+
}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
27350
|
+
exports.comparatorTrimReplace = '$1$2$3';
|
|
27351
|
+
|
|
27352
|
+
// Something like `1.2.3 - 1.2.4`
|
|
27353
|
+
// Note that these all use the loose form, because they'll be
|
|
27354
|
+
// checked against either the strict or loose comparator form
|
|
27355
|
+
// later.
|
|
27356
|
+
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
|
|
27357
|
+
`\\s+-\\s+` +
|
|
27358
|
+
`(${src[t.XRANGEPLAIN]})` +
|
|
27359
|
+
`\\s*$`);
|
|
27360
|
+
|
|
27361
|
+
createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
|
|
27362
|
+
`\\s+-\\s+` +
|
|
27363
|
+
`(${src[t.XRANGEPLAINLOOSE]})` +
|
|
27364
|
+
`\\s*$`);
|
|
27365
|
+
|
|
27366
|
+
// Star ranges basically just allow anything at all.
|
|
27367
|
+
createToken('STAR', '(<|>)?=?\\s*\\*');
|
|
27368
|
+
// >=0.0.0 is like a star
|
|
27369
|
+
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
|
|
27370
|
+
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
|
|
27371
|
+
} (re$1, re$1.exports));
|
|
27192
27372
|
|
|
27193
|
-
// The following Regular Expressions can be used for tokenizing,
|
|
27194
|
-
// validating, and parsing SemVer version strings.
|
|
27195
|
-
|
|
27196
|
-
// ## Numeric Identifier
|
|
27197
|
-
// A single `0`, or a non-zero digit followed by zero or more digits.
|
|
27198
|
-
|
|
27199
|
-
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
|
|
27200
|
-
createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
|
|
27201
|
-
|
|
27202
|
-
// ## Non-numeric Identifier
|
|
27203
|
-
// Zero or more digits, followed by a letter or hyphen, and then zero or
|
|
27204
|
-
// more letters, digits, or hyphens.
|
|
27205
|
-
|
|
27206
|
-
createToken('NONNUMERICIDENTIFIER', "\\d*[a-zA-Z-]".concat(LETTERDASHNUMBER, "*"));
|
|
27207
|
-
|
|
27208
|
-
// ## Main Version
|
|
27209
|
-
// Three dot-separated numeric identifiers.
|
|
27210
|
-
|
|
27211
|
-
createToken('MAINVERSION', "(".concat(src[t.NUMERICIDENTIFIER], ")\\.") + "(".concat(src[t.NUMERICIDENTIFIER], ")\\.") + "(".concat(src[t.NUMERICIDENTIFIER], ")"));
|
|
27212
|
-
createToken('MAINVERSIONLOOSE', "(".concat(src[t.NUMERICIDENTIFIERLOOSE], ")\\.") + "(".concat(src[t.NUMERICIDENTIFIERLOOSE], ")\\.") + "(".concat(src[t.NUMERICIDENTIFIERLOOSE], ")"));
|
|
27213
|
-
|
|
27214
|
-
// ## Pre-release Version Identifier
|
|
27215
|
-
// A numeric identifier, or a non-numeric identifier.
|
|
27216
|
-
|
|
27217
|
-
createToken('PRERELEASEIDENTIFIER', "(?:".concat(src[t.NUMERICIDENTIFIER], "|").concat(src[t.NONNUMERICIDENTIFIER], ")"));
|
|
27218
|
-
createToken('PRERELEASEIDENTIFIERLOOSE', "(?:".concat(src[t.NUMERICIDENTIFIERLOOSE], "|").concat(src[t.NONNUMERICIDENTIFIER], ")"));
|
|
27219
|
-
|
|
27220
|
-
// ## Pre-release Version
|
|
27221
|
-
// Hyphen, followed by one or more dot-separated pre-release version
|
|
27222
|
-
// identifiers.
|
|
27223
|
-
|
|
27224
|
-
createToken('PRERELEASE', "(?:-(".concat(src[t.PRERELEASEIDENTIFIER], "(?:\\.").concat(src[t.PRERELEASEIDENTIFIER], ")*))"));
|
|
27225
|
-
createToken('PRERELEASELOOSE', "(?:-?(".concat(src[t.PRERELEASEIDENTIFIERLOOSE], "(?:\\.").concat(src[t.PRERELEASEIDENTIFIERLOOSE], ")*))"));
|
|
27226
|
-
|
|
27227
|
-
// ## Build Metadata Identifier
|
|
27228
|
-
// Any combination of digits, letters, or hyphens.
|
|
27229
|
-
|
|
27230
|
-
createToken('BUILDIDENTIFIER', "".concat(LETTERDASHNUMBER, "+"));
|
|
27231
|
-
|
|
27232
|
-
// ## Build Metadata
|
|
27233
|
-
// Plus sign, followed by one or more period-separated build metadata
|
|
27234
|
-
// identifiers.
|
|
27235
|
-
|
|
27236
|
-
createToken('BUILD', "(?:\\+(".concat(src[t.BUILDIDENTIFIER], "(?:\\.").concat(src[t.BUILDIDENTIFIER], ")*))"));
|
|
27237
|
-
|
|
27238
|
-
// ## Full Version String
|
|
27239
|
-
// A main version, followed optionally by a pre-release version and
|
|
27240
|
-
// build metadata.
|
|
27241
|
-
|
|
27242
|
-
// Note that the only major, minor, patch, and pre-release sections of
|
|
27243
|
-
// the version string are capturing groups. The build metadata is not a
|
|
27244
|
-
// capturing group, because it should not ever be used in version
|
|
27245
|
-
// comparison.
|
|
27246
|
-
|
|
27247
|
-
createToken('FULLPLAIN', "v?".concat(src[t.MAINVERSION]).concat(src[t.PRERELEASE], "?").concat(src[t.BUILD], "?"));
|
|
27248
|
-
createToken('FULL', "^".concat(src[t.FULLPLAIN], "$"));
|
|
27249
|
-
|
|
27250
|
-
// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
|
|
27251
|
-
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
|
|
27252
|
-
// common in the npm registry.
|
|
27253
|
-
createToken('LOOSEPLAIN', "[v=\\s]*".concat(src[t.MAINVERSIONLOOSE]).concat(src[t.PRERELEASELOOSE], "?").concat(src[t.BUILD], "?"));
|
|
27254
|
-
createToken('LOOSE', "^".concat(src[t.LOOSEPLAIN], "$"));
|
|
27255
|
-
createToken('GTLT', '((?:<|>)?=?)');
|
|
27256
|
-
|
|
27257
|
-
// Something like "2.*" or "1.2.x".
|
|
27258
|
-
// Note that "x.x" is a valid xRange identifer, meaning "any version"
|
|
27259
|
-
// Only the first item is strictly required.
|
|
27260
|
-
createToken('XRANGEIDENTIFIERLOOSE', "".concat(src[t.NUMERICIDENTIFIERLOOSE], "|x|X|\\*"));
|
|
27261
|
-
createToken('XRANGEIDENTIFIER', "".concat(src[t.NUMERICIDENTIFIER], "|x|X|\\*"));
|
|
27262
|
-
createToken('XRANGEPLAIN', "[v=\\s]*(".concat(src[t.XRANGEIDENTIFIER], ")") + "(?:\\.(".concat(src[t.XRANGEIDENTIFIER], ")") + "(?:\\.(".concat(src[t.XRANGEIDENTIFIER], ")") + "(?:".concat(src[t.PRERELEASE], ")?").concat(src[t.BUILD], "?") + ")?)?");
|
|
27263
|
-
createToken('XRANGEPLAINLOOSE', "[v=\\s]*(".concat(src[t.XRANGEIDENTIFIERLOOSE], ")") + "(?:\\.(".concat(src[t.XRANGEIDENTIFIERLOOSE], ")") + "(?:\\.(".concat(src[t.XRANGEIDENTIFIERLOOSE], ")") + "(?:".concat(src[t.PRERELEASELOOSE], ")?").concat(src[t.BUILD], "?") + ")?)?");
|
|
27264
|
-
createToken('XRANGE', "^".concat(src[t.GTLT], "\\s*").concat(src[t.XRANGEPLAIN], "$"));
|
|
27265
|
-
createToken('XRANGELOOSE', "^".concat(src[t.GTLT], "\\s*").concat(src[t.XRANGEPLAINLOOSE], "$"));
|
|
27266
|
-
|
|
27267
|
-
// Coercion.
|
|
27268
|
-
// Extract anything that could conceivably be a part of a valid semver
|
|
27269
|
-
createToken('COERCEPLAIN', "".concat('(^|[^\\d])' + '(\\d{1,').concat(MAX_SAFE_COMPONENT_LENGTH, "})") + "(?:\\.(\\d{1,".concat(MAX_SAFE_COMPONENT_LENGTH, "}))?") + "(?:\\.(\\d{1,".concat(MAX_SAFE_COMPONENT_LENGTH, "}))?"));
|
|
27270
|
-
createToken('COERCE', "".concat(src[t.COERCEPLAIN], "(?:$|[^\\d])"));
|
|
27271
|
-
createToken('COERCEFULL', src[t.COERCEPLAIN] + "(?:".concat(src[t.PRERELEASE], ")?") + "(?:".concat(src[t.BUILD], ")?") + "(?:$|[^\\d])");
|
|
27272
|
-
createToken('COERCERTL', src[t.COERCE], true);
|
|
27273
|
-
createToken('COERCERTLFULL', src[t.COERCEFULL], true);
|
|
27274
|
-
|
|
27275
|
-
// Tilde ranges.
|
|
27276
|
-
// Meaning is "reasonably at or greater than"
|
|
27277
|
-
createToken('LONETILDE', '(?:~>?)');
|
|
27278
|
-
createToken('TILDETRIM', "(\\s*)".concat(src[t.LONETILDE], "\\s+"), true);
|
|
27279
|
-
exports.tildeTrimReplace = '$1~';
|
|
27280
|
-
createToken('TILDE', "^".concat(src[t.LONETILDE]).concat(src[t.XRANGEPLAIN], "$"));
|
|
27281
|
-
createToken('TILDELOOSE', "^".concat(src[t.LONETILDE]).concat(src[t.XRANGEPLAINLOOSE], "$"));
|
|
27282
|
-
|
|
27283
|
-
// Caret ranges.
|
|
27284
|
-
// Meaning is "at least and backwards compatible with"
|
|
27285
|
-
createToken('LONECARET', '(?:\\^)');
|
|
27286
|
-
createToken('CARETTRIM', "(\\s*)".concat(src[t.LONECARET], "\\s+"), true);
|
|
27287
|
-
exports.caretTrimReplace = '$1^';
|
|
27288
|
-
createToken('CARET', "^".concat(src[t.LONECARET]).concat(src[t.XRANGEPLAIN], "$"));
|
|
27289
|
-
createToken('CARETLOOSE', "^".concat(src[t.LONECARET]).concat(src[t.XRANGEPLAINLOOSE], "$"));
|
|
27290
|
-
|
|
27291
|
-
// A simple gt/lt/eq thing, or just "" to indicate "any version"
|
|
27292
|
-
createToken('COMPARATORLOOSE', "^".concat(src[t.GTLT], "\\s*(").concat(src[t.LOOSEPLAIN], ")$|^$"));
|
|
27293
|
-
createToken('COMPARATOR', "^".concat(src[t.GTLT], "\\s*(").concat(src[t.FULLPLAIN], ")$|^$"));
|
|
27294
|
-
|
|
27295
|
-
// An expression to strip any whitespace between the gtlt and the thing
|
|
27296
|
-
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
|
|
27297
|
-
createToken('COMPARATORTRIM', "(\\s*)".concat(src[t.GTLT], "\\s*(").concat(src[t.LOOSEPLAIN], "|").concat(src[t.XRANGEPLAIN], ")"), true);
|
|
27298
|
-
exports.comparatorTrimReplace = '$1$2$3';
|
|
27299
|
-
|
|
27300
|
-
// Something like `1.2.3 - 1.2.4`
|
|
27301
|
-
// Note that these all use the loose form, because they'll be
|
|
27302
|
-
// checked against either the strict or loose comparator form
|
|
27303
|
-
// later.
|
|
27304
|
-
createToken('HYPHENRANGE', "^\\s*(".concat(src[t.XRANGEPLAIN], ")") + "\\s+-\\s+" + "(".concat(src[t.XRANGEPLAIN], ")") + "\\s*$");
|
|
27305
|
-
createToken('HYPHENRANGELOOSE', "^\\s*(".concat(src[t.XRANGEPLAINLOOSE], ")") + "\\s+-\\s+" + "(".concat(src[t.XRANGEPLAINLOOSE], ")") + "\\s*$");
|
|
27306
|
-
|
|
27307
|
-
// Star ranges basically just allow anything at all.
|
|
27308
|
-
createToken('STAR', '(<|>)?=?\\s*\\*');
|
|
27309
|
-
// >=0.0.0 is like a star
|
|
27310
|
-
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
|
|
27311
|
-
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
|
|
27312
|
-
})(re$1, re$1.exports);
|
|
27313
27373
|
var reExports = re$1.exports;
|
|
27314
27374
|
|
|
27315
27375
|
const numeric = /^[0-9]+$/;
|
|
27316
27376
|
const compareIdentifiers$1 = (a, b) => {
|
|
27317
27377
|
const anum = numeric.test(a);
|
|
27318
27378
|
const bnum = numeric.test(b);
|
|
27379
|
+
|
|
27319
27380
|
if (anum && bnum) {
|
|
27320
27381
|
a = +a;
|
|
27321
27382
|
b = +b;
|
|
27322
27383
|
}
|
|
27323
|
-
|
|
27384
|
+
|
|
27385
|
+
return a === b ? 0
|
|
27386
|
+
: (anum && !bnum) ? -1
|
|
27387
|
+
: (bnum && !anum) ? 1
|
|
27388
|
+
: a < b ? -1
|
|
27389
|
+
: 1
|
|
27324
27390
|
};
|
|
27391
|
+
|
|
27325
27392
|
const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);
|
|
27393
|
+
|
|
27326
27394
|
var identifiers = {
|
|
27327
27395
|
compareIdentifiers: compareIdentifiers$1,
|
|
27328
|
-
rcompareIdentifiers
|
|
27396
|
+
rcompareIdentifiers,
|
|
27329
27397
|
};
|
|
27330
27398
|
|
|
27331
27399
|
const debug = debug_1;
|
|
27332
|
-
const {
|
|
27333
|
-
|
|
27334
|
-
|
|
27335
|
-
} = constants;
|
|
27336
|
-
const {
|
|
27337
|
-
safeRe: re,
|
|
27338
|
-
t
|
|
27339
|
-
} = reExports;
|
|
27400
|
+
const { MAX_LENGTH, MAX_SAFE_INTEGER } = constants;
|
|
27401
|
+
const { safeRe: re, t } = reExports;
|
|
27402
|
+
|
|
27340
27403
|
const parseOptions = parseOptions_1;
|
|
27341
|
-
const {
|
|
27342
|
-
compareIdentifiers
|
|
27343
|
-
} = identifiers;
|
|
27404
|
+
const { compareIdentifiers } = identifiers;
|
|
27344
27405
|
let SemVer$1 = class SemVer {
|
|
27345
|
-
constructor(version, options) {
|
|
27406
|
+
constructor (version, options) {
|
|
27346
27407
|
options = parseOptions(options);
|
|
27408
|
+
|
|
27347
27409
|
if (version instanceof SemVer) {
|
|
27348
|
-
if (version.loose === !!options.loose &&
|
|
27349
|
-
|
|
27410
|
+
if (version.loose === !!options.loose &&
|
|
27411
|
+
version.includePrerelease === !!options.includePrerelease) {
|
|
27412
|
+
return version
|
|
27350
27413
|
} else {
|
|
27351
27414
|
version = version.version;
|
|
27352
27415
|
}
|
|
27353
27416
|
} else if (typeof version !== 'string') {
|
|
27354
|
-
throw new TypeError(
|
|
27417
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
|
|
27355
27418
|
}
|
|
27419
|
+
|
|
27356
27420
|
if (version.length > MAX_LENGTH) {
|
|
27357
|
-
throw new TypeError(
|
|
27421
|
+
throw new TypeError(
|
|
27422
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
27423
|
+
)
|
|
27358
27424
|
}
|
|
27425
|
+
|
|
27359
27426
|
debug('SemVer', version, options);
|
|
27360
27427
|
this.options = options;
|
|
27361
27428
|
this.loose = !!options.loose;
|
|
27362
27429
|
// this isn't actually relevant for versions, but keep it so that we
|
|
27363
27430
|
// don't run into trouble passing this.options around.
|
|
27364
27431
|
this.includePrerelease = !!options.includePrerelease;
|
|
27432
|
+
|
|
27365
27433
|
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
27434
|
+
|
|
27366
27435
|
if (!m) {
|
|
27367
|
-
throw new TypeError(
|
|
27436
|
+
throw new TypeError(`Invalid Version: ${version}`)
|
|
27368
27437
|
}
|
|
27438
|
+
|
|
27369
27439
|
this.raw = version;
|
|
27370
27440
|
|
|
27371
27441
|
// these are actually numbers
|
|
27372
27442
|
this.major = +m[1];
|
|
27373
27443
|
this.minor = +m[2];
|
|
27374
27444
|
this.patch = +m[3];
|
|
27445
|
+
|
|
27375
27446
|
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
27376
|
-
throw new TypeError('Invalid major version')
|
|
27447
|
+
throw new TypeError('Invalid major version')
|
|
27377
27448
|
}
|
|
27449
|
+
|
|
27378
27450
|
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
27379
|
-
throw new TypeError('Invalid minor version')
|
|
27451
|
+
throw new TypeError('Invalid minor version')
|
|
27380
27452
|
}
|
|
27453
|
+
|
|
27381
27454
|
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
27382
|
-
throw new TypeError('Invalid patch version')
|
|
27455
|
+
throw new TypeError('Invalid patch version')
|
|
27383
27456
|
}
|
|
27384
27457
|
|
|
27385
27458
|
// numberify any prerelease numeric ids
|
|
27386
27459
|
if (!m[4]) {
|
|
27387
27460
|
this.prerelease = [];
|
|
27388
27461
|
} else {
|
|
27389
|
-
this.prerelease = m[4].split('.').map(id => {
|
|
27462
|
+
this.prerelease = m[4].split('.').map((id) => {
|
|
27390
27463
|
if (/^[0-9]+$/.test(id)) {
|
|
27391
27464
|
const num = +id;
|
|
27392
27465
|
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
27393
|
-
return num
|
|
27466
|
+
return num
|
|
27394
27467
|
}
|
|
27395
27468
|
}
|
|
27396
|
-
return id
|
|
27469
|
+
return id
|
|
27397
27470
|
});
|
|
27398
27471
|
}
|
|
27472
|
+
|
|
27399
27473
|
this.build = m[5] ? m[5].split('.') : [];
|
|
27400
27474
|
this.format();
|
|
27401
27475
|
}
|
|
27402
|
-
|
|
27403
|
-
|
|
27476
|
+
|
|
27477
|
+
format () {
|
|
27478
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
27404
27479
|
if (this.prerelease.length) {
|
|
27405
|
-
this.version +=
|
|
27480
|
+
this.version += `-${this.prerelease.join('.')}`;
|
|
27406
27481
|
}
|
|
27407
|
-
return this.version
|
|
27482
|
+
return this.version
|
|
27408
27483
|
}
|
|
27409
|
-
|
|
27410
|
-
|
|
27484
|
+
|
|
27485
|
+
toString () {
|
|
27486
|
+
return this.version
|
|
27411
27487
|
}
|
|
27412
|
-
|
|
27488
|
+
|
|
27489
|
+
compare (other) {
|
|
27413
27490
|
debug('SemVer.compare', this.version, this.options, other);
|
|
27414
27491
|
if (!(other instanceof SemVer)) {
|
|
27415
27492
|
if (typeof other === 'string' && other === this.version) {
|
|
27416
|
-
return 0
|
|
27493
|
+
return 0
|
|
27417
27494
|
}
|
|
27418
27495
|
other = new SemVer(other, this.options);
|
|
27419
27496
|
}
|
|
27497
|
+
|
|
27420
27498
|
if (other.version === this.version) {
|
|
27421
|
-
return 0
|
|
27499
|
+
return 0
|
|
27422
27500
|
}
|
|
27423
|
-
|
|
27501
|
+
|
|
27502
|
+
return this.compareMain(other) || this.comparePre(other)
|
|
27424
27503
|
}
|
|
27425
|
-
|
|
27504
|
+
|
|
27505
|
+
compareMain (other) {
|
|
27426
27506
|
if (!(other instanceof SemVer)) {
|
|
27427
27507
|
other = new SemVer(other, this.options);
|
|
27428
27508
|
}
|
|
27429
|
-
|
|
27509
|
+
|
|
27510
|
+
return (
|
|
27511
|
+
compareIdentifiers(this.major, other.major) ||
|
|
27512
|
+
compareIdentifiers(this.minor, other.minor) ||
|
|
27513
|
+
compareIdentifiers(this.patch, other.patch)
|
|
27514
|
+
)
|
|
27430
27515
|
}
|
|
27431
|
-
|
|
27516
|
+
|
|
27517
|
+
comparePre (other) {
|
|
27432
27518
|
if (!(other instanceof SemVer)) {
|
|
27433
27519
|
other = new SemVer(other, this.options);
|
|
27434
27520
|
}
|
|
27435
27521
|
|
|
27436
27522
|
// NOT having a prerelease is > having one
|
|
27437
27523
|
if (this.prerelease.length && !other.prerelease.length) {
|
|
27438
|
-
return -1
|
|
27524
|
+
return -1
|
|
27439
27525
|
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
27440
|
-
return 1
|
|
27526
|
+
return 1
|
|
27441
27527
|
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
27442
|
-
return 0
|
|
27528
|
+
return 0
|
|
27443
27529
|
}
|
|
27530
|
+
|
|
27444
27531
|
let i = 0;
|
|
27445
27532
|
do {
|
|
27446
27533
|
const a = this.prerelease[i];
|
|
27447
27534
|
const b = other.prerelease[i];
|
|
27448
27535
|
debug('prerelease compare', i, a, b);
|
|
27449
27536
|
if (a === undefined && b === undefined) {
|
|
27450
|
-
return 0
|
|
27537
|
+
return 0
|
|
27451
27538
|
} else if (b === undefined) {
|
|
27452
|
-
return 1
|
|
27539
|
+
return 1
|
|
27453
27540
|
} else if (a === undefined) {
|
|
27454
|
-
return -1
|
|
27541
|
+
return -1
|
|
27455
27542
|
} else if (a === b) {
|
|
27456
|
-
continue
|
|
27543
|
+
continue
|
|
27457
27544
|
} else {
|
|
27458
|
-
return compareIdentifiers(a, b)
|
|
27545
|
+
return compareIdentifiers(a, b)
|
|
27459
27546
|
}
|
|
27460
|
-
} while (++i)
|
|
27547
|
+
} while (++i)
|
|
27461
27548
|
}
|
|
27462
|
-
|
|
27549
|
+
|
|
27550
|
+
compareBuild (other) {
|
|
27463
27551
|
if (!(other instanceof SemVer)) {
|
|
27464
27552
|
other = new SemVer(other, this.options);
|
|
27465
27553
|
}
|
|
27554
|
+
|
|
27466
27555
|
let i = 0;
|
|
27467
27556
|
do {
|
|
27468
27557
|
const a = this.build[i];
|
|
27469
27558
|
const b = other.build[i];
|
|
27470
27559
|
debug('build compare', i, a, b);
|
|
27471
27560
|
if (a === undefined && b === undefined) {
|
|
27472
|
-
return 0
|
|
27561
|
+
return 0
|
|
27473
27562
|
} else if (b === undefined) {
|
|
27474
|
-
return 1
|
|
27563
|
+
return 1
|
|
27475
27564
|
} else if (a === undefined) {
|
|
27476
|
-
return -1
|
|
27565
|
+
return -1
|
|
27477
27566
|
} else if (a === b) {
|
|
27478
|
-
continue
|
|
27567
|
+
continue
|
|
27479
27568
|
} else {
|
|
27480
|
-
return compareIdentifiers(a, b)
|
|
27569
|
+
return compareIdentifiers(a, b)
|
|
27481
27570
|
}
|
|
27482
|
-
} while (++i)
|
|
27571
|
+
} while (++i)
|
|
27483
27572
|
}
|
|
27484
27573
|
|
|
27485
27574
|
// preminor will bump the version up to the next minor release, and immediately
|
|
27486
27575
|
// down to pre-release. premajor and prepatch work the same way.
|
|
27487
|
-
inc(release, identifier, identifierBase) {
|
|
27576
|
+
inc (release, identifier, identifierBase) {
|
|
27488
27577
|
switch (release) {
|
|
27489
27578
|
case 'premajor':
|
|
27490
27579
|
this.prerelease.length = 0;
|
|
@@ -27492,13 +27581,13 @@ let SemVer$1 = class SemVer {
|
|
|
27492
27581
|
this.minor = 0;
|
|
27493
27582
|
this.major++;
|
|
27494
27583
|
this.inc('pre', identifier, identifierBase);
|
|
27495
|
-
break
|
|
27584
|
+
break
|
|
27496
27585
|
case 'preminor':
|
|
27497
27586
|
this.prerelease.length = 0;
|
|
27498
27587
|
this.patch = 0;
|
|
27499
27588
|
this.minor++;
|
|
27500
27589
|
this.inc('pre', identifier, identifierBase);
|
|
27501
|
-
break
|
|
27590
|
+
break
|
|
27502
27591
|
case 'prepatch':
|
|
27503
27592
|
// If this is already a prerelease, it will bump to the next version
|
|
27504
27593
|
// drop any prereleases that might already exist, since they are not
|
|
@@ -27506,7 +27595,7 @@ let SemVer$1 = class SemVer {
|
|
|
27506
27595
|
this.prerelease.length = 0;
|
|
27507
27596
|
this.inc('patch', identifier, identifierBase);
|
|
27508
27597
|
this.inc('pre', identifier, identifierBase);
|
|
27509
|
-
break
|
|
27598
|
+
break
|
|
27510
27599
|
// If the input is a non-prerelease version, this acts the same as
|
|
27511
27600
|
// prepatch.
|
|
27512
27601
|
case 'prerelease':
|
|
@@ -27514,19 +27603,24 @@ let SemVer$1 = class SemVer {
|
|
|
27514
27603
|
this.inc('patch', identifier, identifierBase);
|
|
27515
27604
|
}
|
|
27516
27605
|
this.inc('pre', identifier, identifierBase);
|
|
27517
|
-
break
|
|
27606
|
+
break
|
|
27607
|
+
|
|
27518
27608
|
case 'major':
|
|
27519
27609
|
// If this is a pre-major version, bump up to the same major version.
|
|
27520
27610
|
// Otherwise increment major.
|
|
27521
27611
|
// 1.0.0-5 bumps to 1.0.0
|
|
27522
27612
|
// 1.1.0 bumps to 2.0.0
|
|
27523
|
-
if (
|
|
27613
|
+
if (
|
|
27614
|
+
this.minor !== 0 ||
|
|
27615
|
+
this.patch !== 0 ||
|
|
27616
|
+
this.prerelease.length === 0
|
|
27617
|
+
) {
|
|
27524
27618
|
this.major++;
|
|
27525
27619
|
}
|
|
27526
27620
|
this.minor = 0;
|
|
27527
27621
|
this.patch = 0;
|
|
27528
27622
|
this.prerelease = [];
|
|
27529
|
-
break
|
|
27623
|
+
break
|
|
27530
27624
|
case 'minor':
|
|
27531
27625
|
// If this is a pre-minor version, bump up to the same minor version.
|
|
27532
27626
|
// Otherwise increment minor.
|
|
@@ -27537,7 +27631,7 @@ let SemVer$1 = class SemVer {
|
|
|
27537
27631
|
}
|
|
27538
27632
|
this.patch = 0;
|
|
27539
27633
|
this.prerelease = [];
|
|
27540
|
-
break
|
|
27634
|
+
break
|
|
27541
27635
|
case 'patch':
|
|
27542
27636
|
// If this is not a pre-release version, it will increment the patch.
|
|
27543
27637
|
// If it is a pre-release it will bump up to the same patch version.
|
|
@@ -27547,64 +27641,68 @@ let SemVer$1 = class SemVer {
|
|
|
27547
27641
|
this.patch++;
|
|
27548
27642
|
}
|
|
27549
27643
|
this.prerelease = [];
|
|
27550
|
-
break
|
|
27644
|
+
break
|
|
27551
27645
|
// This probably shouldn't be used publicly.
|
|
27552
27646
|
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
27553
|
-
case 'pre':
|
|
27554
|
-
|
|
27555
|
-
|
|
27556
|
-
|
|
27557
|
-
|
|
27558
|
-
|
|
27559
|
-
|
|
27560
|
-
|
|
27561
|
-
|
|
27562
|
-
|
|
27563
|
-
|
|
27564
|
-
|
|
27565
|
-
|
|
27566
|
-
|
|
27567
|
-
|
|
27568
|
-
}
|
|
27569
|
-
if (i === -1) {
|
|
27570
|
-
// didn't increment anything
|
|
27571
|
-
if (identifier === this.prerelease.join('.') && identifierBase === false) {
|
|
27572
|
-
throw new Error('invalid increment argument: identifier already exists');
|
|
27573
|
-
}
|
|
27574
|
-
this.prerelease.push(base);
|
|
27647
|
+
case 'pre': {
|
|
27648
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
27649
|
+
|
|
27650
|
+
if (!identifier && identifierBase === false) {
|
|
27651
|
+
throw new Error('invalid increment argument: identifier is empty')
|
|
27652
|
+
}
|
|
27653
|
+
|
|
27654
|
+
if (this.prerelease.length === 0) {
|
|
27655
|
+
this.prerelease = [base];
|
|
27656
|
+
} else {
|
|
27657
|
+
let i = this.prerelease.length;
|
|
27658
|
+
while (--i >= 0) {
|
|
27659
|
+
if (typeof this.prerelease[i] === 'number') {
|
|
27660
|
+
this.prerelease[i]++;
|
|
27661
|
+
i = -2;
|
|
27575
27662
|
}
|
|
27576
27663
|
}
|
|
27577
|
-
if (
|
|
27578
|
-
//
|
|
27579
|
-
|
|
27580
|
-
|
|
27581
|
-
if (identifierBase === false) {
|
|
27582
|
-
prerelease = [identifier];
|
|
27664
|
+
if (i === -1) {
|
|
27665
|
+
// didn't increment anything
|
|
27666
|
+
if (identifier === this.prerelease.join('.') && identifierBase === false) {
|
|
27667
|
+
throw new Error('invalid increment argument: identifier already exists')
|
|
27583
27668
|
}
|
|
27584
|
-
|
|
27585
|
-
|
|
27586
|
-
|
|
27587
|
-
|
|
27588
|
-
|
|
27669
|
+
this.prerelease.push(base);
|
|
27670
|
+
}
|
|
27671
|
+
}
|
|
27672
|
+
if (identifier) {
|
|
27673
|
+
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
|
|
27674
|
+
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
|
|
27675
|
+
let prerelease = [identifier, base];
|
|
27676
|
+
if (identifierBase === false) {
|
|
27677
|
+
prerelease = [identifier];
|
|
27678
|
+
}
|
|
27679
|
+
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
27680
|
+
if (isNaN(this.prerelease[1])) {
|
|
27589
27681
|
this.prerelease = prerelease;
|
|
27590
27682
|
}
|
|
27683
|
+
} else {
|
|
27684
|
+
this.prerelease = prerelease;
|
|
27591
27685
|
}
|
|
27592
|
-
break;
|
|
27593
27686
|
}
|
|
27687
|
+
break
|
|
27688
|
+
}
|
|
27594
27689
|
default:
|
|
27595
|
-
throw new Error(
|
|
27690
|
+
throw new Error(`invalid increment argument: ${release}`)
|
|
27596
27691
|
}
|
|
27597
27692
|
this.raw = this.format();
|
|
27598
27693
|
if (this.build.length) {
|
|
27599
|
-
this.raw +=
|
|
27694
|
+
this.raw += `+${this.build.join('.')}`;
|
|
27600
27695
|
}
|
|
27601
|
-
return this
|
|
27696
|
+
return this
|
|
27602
27697
|
}
|
|
27603
27698
|
};
|
|
27699
|
+
|
|
27604
27700
|
var semver = SemVer$1;
|
|
27605
27701
|
|
|
27606
27702
|
const SemVer = semver;
|
|
27607
|
-
const compare$6 = (a, b, loose) =>
|
|
27703
|
+
const compare$6 = (a, b, loose) =>
|
|
27704
|
+
new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
27705
|
+
|
|
27608
27706
|
var compare_1 = compare$6;
|
|
27609
27707
|
|
|
27610
27708
|
const compare$5 = compare_1;
|
|
@@ -27637,6 +27735,7 @@ const gt = gt_1;
|
|
|
27637
27735
|
const gte = gte_1;
|
|
27638
27736
|
const lt = lt_1;
|
|
27639
27737
|
const lte = lte_1;
|
|
27738
|
+
|
|
27640
27739
|
const cmp = (a, op, b, loose) => {
|
|
27641
27740
|
switch (op) {
|
|
27642
27741
|
case '===':
|
|
@@ -27646,7 +27745,8 @@ const cmp = (a, op, b, loose) => {
|
|
|
27646
27745
|
if (typeof b === 'object') {
|
|
27647
27746
|
b = b.version;
|
|
27648
27747
|
}
|
|
27649
|
-
return a === b
|
|
27748
|
+
return a === b
|
|
27749
|
+
|
|
27650
27750
|
case '!==':
|
|
27651
27751
|
if (typeof a === 'object') {
|
|
27652
27752
|
a = a.version;
|
|
@@ -27654,609 +27754,731 @@ const cmp = (a, op, b, loose) => {
|
|
|
27654
27754
|
if (typeof b === 'object') {
|
|
27655
27755
|
b = b.version;
|
|
27656
27756
|
}
|
|
27657
|
-
return a !== b
|
|
27757
|
+
return a !== b
|
|
27758
|
+
|
|
27658
27759
|
case '':
|
|
27659
27760
|
case '=':
|
|
27660
27761
|
case '==':
|
|
27661
|
-
return eq(a, b, loose)
|
|
27762
|
+
return eq(a, b, loose)
|
|
27763
|
+
|
|
27662
27764
|
case '!=':
|
|
27663
|
-
return neq(a, b, loose)
|
|
27765
|
+
return neq(a, b, loose)
|
|
27766
|
+
|
|
27664
27767
|
case '>':
|
|
27665
|
-
return gt(a, b, loose)
|
|
27768
|
+
return gt(a, b, loose)
|
|
27769
|
+
|
|
27666
27770
|
case '>=':
|
|
27667
|
-
return gte(a, b, loose)
|
|
27771
|
+
return gte(a, b, loose)
|
|
27772
|
+
|
|
27668
27773
|
case '<':
|
|
27669
|
-
return lt(a, b, loose)
|
|
27774
|
+
return lt(a, b, loose)
|
|
27775
|
+
|
|
27670
27776
|
case '<=':
|
|
27671
|
-
return lte(a, b, loose)
|
|
27777
|
+
return lte(a, b, loose)
|
|
27778
|
+
|
|
27672
27779
|
default:
|
|
27673
|
-
throw new TypeError(
|
|
27780
|
+
throw new TypeError(`Invalid operator: ${op}`)
|
|
27674
27781
|
}
|
|
27675
27782
|
};
|
|
27676
27783
|
var cmp_1 = cmp;
|
|
27677
27784
|
|
|
27678
27785
|
var comparator;
|
|
27679
27786
|
var hasRequiredComparator;
|
|
27680
|
-
function requireComparator() {
|
|
27681
|
-
if (hasRequiredComparator) return comparator;
|
|
27682
|
-
hasRequiredComparator = 1;
|
|
27683
|
-
const ANY = Symbol('SemVer ANY');
|
|
27684
|
-
// hoisted class for cyclic dependency
|
|
27685
|
-
class Comparator {
|
|
27686
|
-
static get ANY() {
|
|
27687
|
-
return ANY;
|
|
27688
|
-
}
|
|
27689
|
-
constructor(comp, options) {
|
|
27690
|
-
options = parseOptions(options);
|
|
27691
|
-
if (comp instanceof Comparator) {
|
|
27692
|
-
if (comp.loose === !!options.loose) {
|
|
27693
|
-
return comp;
|
|
27694
|
-
} else {
|
|
27695
|
-
comp = comp.value;
|
|
27696
|
-
}
|
|
27697
|
-
}
|
|
27698
|
-
comp = comp.trim().split(/\s+/).join(' ');
|
|
27699
|
-
debug('comparator', comp, options);
|
|
27700
|
-
this.options = options;
|
|
27701
|
-
this.loose = !!options.loose;
|
|
27702
|
-
this.parse(comp);
|
|
27703
|
-
if (this.semver === ANY) {
|
|
27704
|
-
this.value = '';
|
|
27705
|
-
} else {
|
|
27706
|
-
this.value = this.operator + this.semver.version;
|
|
27707
|
-
}
|
|
27708
|
-
debug('comp', this);
|
|
27709
|
-
}
|
|
27710
|
-
parse(comp) {
|
|
27711
|
-
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
27712
|
-
const m = comp.match(r);
|
|
27713
|
-
if (!m) {
|
|
27714
|
-
throw new TypeError("Invalid comparator: ".concat(comp));
|
|
27715
|
-
}
|
|
27716
|
-
this.operator = m[1] !== undefined ? m[1] : '';
|
|
27717
|
-
if (this.operator === '=') {
|
|
27718
|
-
this.operator = '';
|
|
27719
|
-
}
|
|
27720
27787
|
|
|
27721
|
-
|
|
27722
|
-
|
|
27723
|
-
|
|
27724
|
-
|
|
27725
|
-
|
|
27726
|
-
|
|
27727
|
-
|
|
27728
|
-
|
|
27729
|
-
|
|
27730
|
-
|
|
27731
|
-
|
|
27732
|
-
|
|
27733
|
-
|
|
27734
|
-
|
|
27735
|
-
|
|
27736
|
-
|
|
27737
|
-
|
|
27738
|
-
|
|
27739
|
-
|
|
27740
|
-
|
|
27741
|
-
|
|
27742
|
-
|
|
27743
|
-
|
|
27744
|
-
|
|
27745
|
-
|
|
27746
|
-
|
|
27747
|
-
|
|
27748
|
-
|
|
27749
|
-
|
|
27750
|
-
|
|
27751
|
-
|
|
27752
|
-
|
|
27753
|
-
|
|
27754
|
-
|
|
27755
|
-
|
|
27756
|
-
|
|
27757
|
-
|
|
27758
|
-
|
|
27759
|
-
|
|
27760
|
-
|
|
27788
|
+
function requireComparator () {
|
|
27789
|
+
if (hasRequiredComparator) return comparator;
|
|
27790
|
+
hasRequiredComparator = 1;
|
|
27791
|
+
const ANY = Symbol('SemVer ANY');
|
|
27792
|
+
// hoisted class for cyclic dependency
|
|
27793
|
+
class Comparator {
|
|
27794
|
+
static get ANY () {
|
|
27795
|
+
return ANY
|
|
27796
|
+
}
|
|
27797
|
+
|
|
27798
|
+
constructor (comp, options) {
|
|
27799
|
+
options = parseOptions(options);
|
|
27800
|
+
|
|
27801
|
+
if (comp instanceof Comparator) {
|
|
27802
|
+
if (comp.loose === !!options.loose) {
|
|
27803
|
+
return comp
|
|
27804
|
+
} else {
|
|
27805
|
+
comp = comp.value;
|
|
27806
|
+
}
|
|
27807
|
+
}
|
|
27808
|
+
|
|
27809
|
+
comp = comp.trim().split(/\s+/).join(' ');
|
|
27810
|
+
debug('comparator', comp, options);
|
|
27811
|
+
this.options = options;
|
|
27812
|
+
this.loose = !!options.loose;
|
|
27813
|
+
this.parse(comp);
|
|
27814
|
+
|
|
27815
|
+
if (this.semver === ANY) {
|
|
27816
|
+
this.value = '';
|
|
27817
|
+
} else {
|
|
27818
|
+
this.value = this.operator + this.semver.version;
|
|
27819
|
+
}
|
|
27820
|
+
|
|
27821
|
+
debug('comp', this);
|
|
27822
|
+
}
|
|
27823
|
+
|
|
27824
|
+
parse (comp) {
|
|
27825
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
27826
|
+
const m = comp.match(r);
|
|
27827
|
+
|
|
27828
|
+
if (!m) {
|
|
27829
|
+
throw new TypeError(`Invalid comparator: ${comp}`)
|
|
27830
|
+
}
|
|
27831
|
+
|
|
27832
|
+
this.operator = m[1] !== undefined ? m[1] : '';
|
|
27833
|
+
if (this.operator === '=') {
|
|
27834
|
+
this.operator = '';
|
|
27835
|
+
}
|
|
27836
|
+
|
|
27837
|
+
// if it literally is just '>' or '' then allow anything.
|
|
27838
|
+
if (!m[2]) {
|
|
27839
|
+
this.semver = ANY;
|
|
27840
|
+
} else {
|
|
27841
|
+
this.semver = new SemVer(m[2], this.options.loose);
|
|
27842
|
+
}
|
|
27843
|
+
}
|
|
27844
|
+
|
|
27845
|
+
toString () {
|
|
27846
|
+
return this.value
|
|
27847
|
+
}
|
|
27848
|
+
|
|
27849
|
+
test (version) {
|
|
27850
|
+
debug('Comparator.test', version, this.options.loose);
|
|
27851
|
+
|
|
27852
|
+
if (this.semver === ANY || version === ANY) {
|
|
27853
|
+
return true
|
|
27854
|
+
}
|
|
27855
|
+
|
|
27856
|
+
if (typeof version === 'string') {
|
|
27857
|
+
try {
|
|
27858
|
+
version = new SemVer(version, this.options);
|
|
27859
|
+
} catch (er) {
|
|
27860
|
+
return false
|
|
27861
|
+
}
|
|
27862
|
+
}
|
|
27863
|
+
|
|
27864
|
+
return cmp(version, this.operator, this.semver, this.options)
|
|
27865
|
+
}
|
|
27866
|
+
|
|
27867
|
+
intersects (comp, options) {
|
|
27868
|
+
if (!(comp instanceof Comparator)) {
|
|
27869
|
+
throw new TypeError('a Comparator is required')
|
|
27870
|
+
}
|
|
27871
|
+
|
|
27872
|
+
if (this.operator === '') {
|
|
27873
|
+
if (this.value === '') {
|
|
27874
|
+
return true
|
|
27875
|
+
}
|
|
27876
|
+
return new Range(comp.value, options).test(this.value)
|
|
27877
|
+
} else if (comp.operator === '') {
|
|
27878
|
+
if (comp.value === '') {
|
|
27879
|
+
return true
|
|
27880
|
+
}
|
|
27881
|
+
return new Range(this.value, options).test(comp.semver)
|
|
27882
|
+
}
|
|
27883
|
+
|
|
27884
|
+
options = parseOptions(options);
|
|
27885
|
+
|
|
27886
|
+
// Special cases where nothing can possibly be lower
|
|
27887
|
+
if (options.includePrerelease &&
|
|
27888
|
+
(this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
|
|
27889
|
+
return false
|
|
27890
|
+
}
|
|
27891
|
+
if (!options.includePrerelease &&
|
|
27892
|
+
(this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
|
|
27893
|
+
return false
|
|
27894
|
+
}
|
|
27895
|
+
|
|
27896
|
+
// Same direction increasing (> or >=)
|
|
27897
|
+
if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
|
|
27898
|
+
return true
|
|
27899
|
+
}
|
|
27900
|
+
// Same direction decreasing (< or <=)
|
|
27901
|
+
if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
|
|
27902
|
+
return true
|
|
27903
|
+
}
|
|
27904
|
+
// same SemVer and both sides are inclusive (<= or >=)
|
|
27905
|
+
if (
|
|
27906
|
+
(this.semver.version === comp.semver.version) &&
|
|
27907
|
+
this.operator.includes('=') && comp.operator.includes('=')) {
|
|
27908
|
+
return true
|
|
27909
|
+
}
|
|
27910
|
+
// opposite directions less than
|
|
27911
|
+
if (cmp(this.semver, '<', comp.semver, options) &&
|
|
27912
|
+
this.operator.startsWith('>') && comp.operator.startsWith('<')) {
|
|
27913
|
+
return true
|
|
27914
|
+
}
|
|
27915
|
+
// opposite directions greater than
|
|
27916
|
+
if (cmp(this.semver, '>', comp.semver, options) &&
|
|
27917
|
+
this.operator.startsWith('<') && comp.operator.startsWith('>')) {
|
|
27918
|
+
return true
|
|
27919
|
+
}
|
|
27920
|
+
return false
|
|
27921
|
+
}
|
|
27922
|
+
}
|
|
27761
27923
|
|
|
27762
|
-
|
|
27763
|
-
if (options.includePrerelease && (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
|
|
27764
|
-
return false;
|
|
27765
|
-
}
|
|
27766
|
-
if (!options.includePrerelease && (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
|
|
27767
|
-
return false;
|
|
27768
|
-
}
|
|
27924
|
+
comparator = Comparator;
|
|
27769
27925
|
|
|
27770
|
-
|
|
27771
|
-
|
|
27772
|
-
|
|
27773
|
-
|
|
27774
|
-
|
|
27775
|
-
|
|
27776
|
-
|
|
27777
|
-
}
|
|
27778
|
-
// same SemVer and both sides are inclusive (<= or >=)
|
|
27779
|
-
if (this.semver.version === comp.semver.version && this.operator.includes('=') && comp.operator.includes('=')) {
|
|
27780
|
-
return true;
|
|
27781
|
-
}
|
|
27782
|
-
// opposite directions less than
|
|
27783
|
-
if (cmp(this.semver, '<', comp.semver, options) && this.operator.startsWith('>') && comp.operator.startsWith('<')) {
|
|
27784
|
-
return true;
|
|
27785
|
-
}
|
|
27786
|
-
// opposite directions greater than
|
|
27787
|
-
if (cmp(this.semver, '>', comp.semver, options) && this.operator.startsWith('<') && comp.operator.startsWith('>')) {
|
|
27788
|
-
return true;
|
|
27789
|
-
}
|
|
27790
|
-
return false;
|
|
27791
|
-
}
|
|
27792
|
-
}
|
|
27793
|
-
comparator = Comparator;
|
|
27794
|
-
const parseOptions = parseOptions_1;
|
|
27795
|
-
const {
|
|
27796
|
-
safeRe: re,
|
|
27797
|
-
t
|
|
27798
|
-
} = reExports;
|
|
27799
|
-
const cmp = cmp_1;
|
|
27800
|
-
const debug = debug_1;
|
|
27801
|
-
const SemVer = semver;
|
|
27802
|
-
const Range = requireRange();
|
|
27803
|
-
return comparator;
|
|
27926
|
+
const parseOptions = parseOptions_1;
|
|
27927
|
+
const { safeRe: re, t } = reExports;
|
|
27928
|
+
const cmp = cmp_1;
|
|
27929
|
+
const debug = debug_1;
|
|
27930
|
+
const SemVer = semver;
|
|
27931
|
+
const Range = requireRange();
|
|
27932
|
+
return comparator;
|
|
27804
27933
|
}
|
|
27805
27934
|
|
|
27806
27935
|
var range;
|
|
27807
27936
|
var hasRequiredRange;
|
|
27808
|
-
function requireRange() {
|
|
27809
|
-
if (hasRequiredRange) return range;
|
|
27810
|
-
hasRequiredRange = 1;
|
|
27811
|
-
// hoisted class for cyclic dependency
|
|
27812
|
-
class Range {
|
|
27813
|
-
constructor(range, options) {
|
|
27814
|
-
options = parseOptions(options);
|
|
27815
|
-
if (range instanceof Range) {
|
|
27816
|
-
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
27817
|
-
return range;
|
|
27818
|
-
} else {
|
|
27819
|
-
return new Range(range.raw, options);
|
|
27820
|
-
}
|
|
27821
|
-
}
|
|
27822
|
-
if (range instanceof Comparator) {
|
|
27823
|
-
// just put it in the set and return
|
|
27824
|
-
this.raw = range.value;
|
|
27825
|
-
this.set = [[range]];
|
|
27826
|
-
this.format();
|
|
27827
|
-
return this;
|
|
27828
|
-
}
|
|
27829
|
-
this.options = options;
|
|
27830
|
-
this.loose = !!options.loose;
|
|
27831
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
27832
|
-
|
|
27833
|
-
// First reduce all whitespace as much as possible so we do not have to rely
|
|
27834
|
-
// on potentially slow regexes like \s*. This is then stored and used for
|
|
27835
|
-
// future error messages as well.
|
|
27836
|
-
this.raw = range.trim().split(/\s+/).join(' ');
|
|
27837
|
-
|
|
27838
|
-
// First, split on ||
|
|
27839
|
-
this.set = this.raw.split('||')
|
|
27840
|
-
// map the range to a 2d array of comparators
|
|
27841
|
-
.map(r => this.parseRange(r.trim()))
|
|
27842
|
-
// throw out any comparator lists that are empty
|
|
27843
|
-
// this generally means that it was not a valid range, which is allowed
|
|
27844
|
-
// in loose mode, but will still throw if the WHOLE range is invalid.
|
|
27845
|
-
.filter(c => c.length);
|
|
27846
|
-
if (!this.set.length) {
|
|
27847
|
-
throw new TypeError("Invalid SemVer Range: ".concat(this.raw));
|
|
27848
|
-
}
|
|
27849
|
-
|
|
27850
|
-
// if we have any that are not the null set, throw out null sets.
|
|
27851
|
-
if (this.set.length > 1) {
|
|
27852
|
-
// keep the first one, in case they're all null sets
|
|
27853
|
-
const first = this.set[0];
|
|
27854
|
-
this.set = this.set.filter(c => !isNullSet(c[0]));
|
|
27855
|
-
if (this.set.length === 0) {
|
|
27856
|
-
this.set = [first];
|
|
27857
|
-
} else if (this.set.length > 1) {
|
|
27858
|
-
// if we have any that are *, then the range is just *
|
|
27859
|
-
for (const c of this.set) {
|
|
27860
|
-
if (c.length === 1 && isAny(c[0])) {
|
|
27861
|
-
this.set = [c];
|
|
27862
|
-
break;
|
|
27863
|
-
}
|
|
27864
|
-
}
|
|
27865
|
-
}
|
|
27866
|
-
}
|
|
27867
|
-
this.format();
|
|
27868
|
-
}
|
|
27869
|
-
format() {
|
|
27870
|
-
this.range = this.set.map(comps => comps.join(' ').trim()).join('||').trim();
|
|
27871
|
-
return this.range;
|
|
27872
|
-
}
|
|
27873
|
-
toString() {
|
|
27874
|
-
return this.range;
|
|
27875
|
-
}
|
|
27876
|
-
parseRange(range) {
|
|
27877
|
-
// memoize range parsing for performance.
|
|
27878
|
-
// this is a very hot path, and fully deterministic.
|
|
27879
|
-
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
27880
|
-
const memoKey = memoOpts + ':' + range;
|
|
27881
|
-
const cached = cache.get(memoKey);
|
|
27882
|
-
if (cached) {
|
|
27883
|
-
return cached;
|
|
27884
|
-
}
|
|
27885
|
-
const loose = this.options.loose;
|
|
27886
|
-
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
27887
|
-
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
27888
|
-
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
27889
|
-
debug('hyphen replace', range);
|
|
27890
|
-
|
|
27891
|
-
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
|
27892
|
-
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
27893
|
-
debug('comparator trim', range);
|
|
27894
|
-
|
|
27895
|
-
// `~ 1.2.3` => `~1.2.3`
|
|
27896
|
-
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
27897
|
-
debug('tilde trim', range);
|
|
27898
|
-
|
|
27899
|
-
// `^ 1.2.3` => `^1.2.3`
|
|
27900
|
-
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
27901
|
-
debug('caret trim', range);
|
|
27902
|
-
|
|
27903
|
-
// At this point, the range is completely trimmed and
|
|
27904
|
-
// ready to be split into comparators.
|
|
27905
|
-
|
|
27906
|
-
let rangeList = range.split(' ').map(comp => parseComparator(comp, this.options)).join(' ').split(/\s+/)
|
|
27907
|
-
// >=0.0.0 is equivalent to *
|
|
27908
|
-
.map(comp => replaceGTE0(comp, this.options));
|
|
27909
|
-
if (loose) {
|
|
27910
|
-
// in loose mode, throw out any that are not valid comparators
|
|
27911
|
-
rangeList = rangeList.filter(comp => {
|
|
27912
|
-
debug('loose invalid filter', comp, this.options);
|
|
27913
|
-
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
27914
|
-
});
|
|
27915
|
-
}
|
|
27916
|
-
debug('range list', rangeList);
|
|
27917
|
-
|
|
27918
|
-
// if any comparators are the null set, then replace with JUST null set
|
|
27919
|
-
// if more than one comparator, remove any * comparators
|
|
27920
|
-
// also, don't include the same comparator more than once
|
|
27921
|
-
const rangeMap = new Map();
|
|
27922
|
-
const comparators = rangeList.map(comp => new Comparator(comp, this.options));
|
|
27923
|
-
for (const comp of comparators) {
|
|
27924
|
-
if (isNullSet(comp)) {
|
|
27925
|
-
return [comp];
|
|
27926
|
-
}
|
|
27927
|
-
rangeMap.set(comp.value, comp);
|
|
27928
|
-
}
|
|
27929
|
-
if (rangeMap.size > 1 && rangeMap.has('')) {
|
|
27930
|
-
rangeMap.delete('');
|
|
27931
|
-
}
|
|
27932
|
-
const result = [...rangeMap.values()];
|
|
27933
|
-
cache.set(memoKey, result);
|
|
27934
|
-
return result;
|
|
27935
|
-
}
|
|
27936
|
-
intersects(range, options) {
|
|
27937
|
-
if (!(range instanceof Range)) {
|
|
27938
|
-
throw new TypeError('a Range is required');
|
|
27939
|
-
}
|
|
27940
|
-
return this.set.some(thisComparators => {
|
|
27941
|
-
return isSatisfiable(thisComparators, options) && range.set.some(rangeComparators => {
|
|
27942
|
-
return isSatisfiable(rangeComparators, options) && thisComparators.every(thisComparator => {
|
|
27943
|
-
return rangeComparators.every(rangeComparator => {
|
|
27944
|
-
return thisComparator.intersects(rangeComparator, options);
|
|
27945
|
-
});
|
|
27946
|
-
});
|
|
27947
|
-
});
|
|
27948
|
-
});
|
|
27949
|
-
}
|
|
27950
27937
|
|
|
27951
|
-
|
|
27952
|
-
|
|
27953
|
-
|
|
27954
|
-
|
|
27955
|
-
|
|
27956
|
-
|
|
27957
|
-
|
|
27958
|
-
|
|
27959
|
-
|
|
27960
|
-
|
|
27961
|
-
|
|
27962
|
-
|
|
27963
|
-
|
|
27964
|
-
|
|
27965
|
-
|
|
27966
|
-
|
|
27967
|
-
|
|
27968
|
-
|
|
27969
|
-
|
|
27970
|
-
|
|
27971
|
-
|
|
27972
|
-
|
|
27973
|
-
|
|
27974
|
-
|
|
27975
|
-
|
|
27976
|
-
|
|
27977
|
-
|
|
27978
|
-
|
|
27979
|
-
|
|
27980
|
-
|
|
27981
|
-
|
|
27982
|
-
|
|
27983
|
-
|
|
27984
|
-
|
|
27985
|
-
|
|
27986
|
-
|
|
27987
|
-
|
|
27988
|
-
|
|
27989
|
-
|
|
27990
|
-
|
|
27991
|
-
|
|
27992
|
-
|
|
27993
|
-
|
|
27994
|
-
|
|
27995
|
-
|
|
27996
|
-
|
|
27997
|
-
|
|
27998
|
-
|
|
27999
|
-
|
|
28000
|
-
|
|
28001
|
-
|
|
28002
|
-
|
|
28003
|
-
|
|
28004
|
-
|
|
28005
|
-
|
|
28006
|
-
|
|
28007
|
-
|
|
28008
|
-
|
|
28009
|
-
|
|
28010
|
-
|
|
28011
|
-
|
|
28012
|
-
|
|
28013
|
-
|
|
28014
|
-
|
|
28015
|
-
|
|
28016
|
-
|
|
28017
|
-
|
|
28018
|
-
|
|
28019
|
-
|
|
28020
|
-
|
|
28021
|
-
|
|
28022
|
-
|
|
28023
|
-
|
|
28024
|
-
|
|
28025
|
-
|
|
28026
|
-
|
|
28027
|
-
|
|
28028
|
-
|
|
28029
|
-
|
|
28030
|
-
|
|
28031
|
-
|
|
28032
|
-
|
|
28033
|
-
|
|
28034
|
-
|
|
28035
|
-
|
|
28036
|
-
|
|
28037
|
-
|
|
28038
|
-
|
|
28039
|
-
|
|
28040
|
-
|
|
28041
|
-
|
|
28042
|
-
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
|
|
28046
|
-
|
|
28047
|
-
|
|
28048
|
-
|
|
28049
|
-
|
|
28050
|
-
|
|
28051
|
-
|
|
28052
|
-
|
|
28053
|
-
|
|
28054
|
-
|
|
28055
|
-
|
|
28056
|
-
|
|
28057
|
-
|
|
28058
|
-
|
|
28059
|
-
|
|
28060
|
-
|
|
28061
|
-
|
|
28062
|
-
|
|
28063
|
-
|
|
28064
|
-
|
|
28065
|
-
|
|
28066
|
-
|
|
28067
|
-
|
|
28068
|
-
|
|
28069
|
-
|
|
28070
|
-
|
|
28071
|
-
|
|
28072
|
-
|
|
28073
|
-
|
|
28074
|
-
|
|
28075
|
-
|
|
28076
|
-
|
|
28077
|
-
|
|
28078
|
-
|
|
28079
|
-
|
|
28080
|
-
|
|
28081
|
-
|
|
28082
|
-
|
|
28083
|
-
|
|
28084
|
-
|
|
28085
|
-
|
|
28086
|
-
|
|
28087
|
-
|
|
28088
|
-
|
|
28089
|
-
|
|
28090
|
-
|
|
28091
|
-
|
|
28092
|
-
|
|
28093
|
-
|
|
28094
|
-
|
|
28095
|
-
|
|
28096
|
-
|
|
28097
|
-
|
|
28098
|
-
|
|
28099
|
-
|
|
28100
|
-
|
|
28101
|
-
|
|
28102
|
-
|
|
28103
|
-
|
|
28104
|
-
|
|
28105
|
-
|
|
28106
|
-
|
|
28107
|
-
|
|
28108
|
-
|
|
28109
|
-
|
|
28110
|
-
|
|
28111
|
-
|
|
28112
|
-
|
|
28113
|
-
|
|
28114
|
-
|
|
28115
|
-
|
|
28116
|
-
|
|
28117
|
-
|
|
28118
|
-
|
|
28119
|
-
|
|
28120
|
-
|
|
28121
|
-
|
|
28122
|
-
|
|
28123
|
-
|
|
28124
|
-
|
|
28125
|
-
|
|
28126
|
-
|
|
28127
|
-
|
|
28128
|
-
|
|
28129
|
-
|
|
28130
|
-
|
|
28131
|
-
|
|
28132
|
-
|
|
28133
|
-
|
|
28134
|
-
|
|
28135
|
-
|
|
28136
|
-
|
|
28137
|
-
|
|
28138
|
-
|
|
28139
|
-
|
|
28140
|
-
|
|
28141
|
-
|
|
28142
|
-
|
|
28143
|
-
|
|
28144
|
-
|
|
28145
|
-
|
|
28146
|
-
|
|
28147
|
-
|
|
28148
|
-
|
|
28149
|
-
|
|
28150
|
-
|
|
28151
|
-
gtlt = '>=';
|
|
28152
|
-
if (xm) {
|
|
28153
|
-
M = +M + 1;
|
|
28154
|
-
m = 0;
|
|
28155
|
-
p = 0;
|
|
28156
|
-
} else {
|
|
28157
|
-
m = +m + 1;
|
|
28158
|
-
p = 0;
|
|
28159
|
-
}
|
|
28160
|
-
} else if (gtlt === '<=') {
|
|
28161
|
-
// <=0.7.x is actually <0.8.0, since any 0.7.x should
|
|
28162
|
-
// pass. Similarly, <=7.x is actually <8.0.0, etc.
|
|
28163
|
-
gtlt = '<';
|
|
28164
|
-
if (xm) {
|
|
28165
|
-
M = +M + 1;
|
|
28166
|
-
} else {
|
|
28167
|
-
m = +m + 1;
|
|
28168
|
-
}
|
|
28169
|
-
}
|
|
28170
|
-
if (gtlt === '<') {
|
|
28171
|
-
pr = '-0';
|
|
28172
|
-
}
|
|
28173
|
-
ret = "".concat(gtlt + M, ".").concat(m, ".").concat(p).concat(pr);
|
|
28174
|
-
} else if (xm) {
|
|
28175
|
-
ret = ">=".concat(M, ".0.0").concat(pr, " <").concat(+M + 1, ".0.0-0");
|
|
28176
|
-
} else if (xp) {
|
|
28177
|
-
ret = ">=".concat(M, ".").concat(m, ".0").concat(pr, " <").concat(M, ".").concat(+m + 1, ".0-0");
|
|
28178
|
-
}
|
|
28179
|
-
debug('xRange return', ret);
|
|
28180
|
-
return ret;
|
|
28181
|
-
});
|
|
28182
|
-
};
|
|
28183
|
-
|
|
28184
|
-
// Because * is AND-ed with everything else in the comparator,
|
|
28185
|
-
// and '' means "any version", just remove the *s entirely.
|
|
28186
|
-
const replaceStars = (comp, options) => {
|
|
28187
|
-
debug('replaceStars', comp, options);
|
|
28188
|
-
// Looseness is ignored here. star is always as loose as it gets!
|
|
28189
|
-
return comp.trim().replace(re[t.STAR], '');
|
|
28190
|
-
};
|
|
28191
|
-
const replaceGTE0 = (comp, options) => {
|
|
28192
|
-
debug('replaceGTE0', comp, options);
|
|
28193
|
-
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '');
|
|
28194
|
-
};
|
|
28195
|
-
|
|
28196
|
-
// This function is passed to string.replace(re[t.HYPHENRANGE])
|
|
28197
|
-
// M, m, patch, prerelease, build
|
|
28198
|
-
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
|
28199
|
-
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
|
|
28200
|
-
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
|
|
28201
|
-
// TODO build?
|
|
28202
|
-
const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
28203
|
-
if (isX(fM)) {
|
|
28204
|
-
from = '';
|
|
28205
|
-
} else if (isX(fm)) {
|
|
28206
|
-
from = ">=".concat(fM, ".0.0").concat(incPr ? '-0' : '');
|
|
28207
|
-
} else if (isX(fp)) {
|
|
28208
|
-
from = ">=".concat(fM, ".").concat(fm, ".0").concat(incPr ? '-0' : '');
|
|
28209
|
-
} else if (fpr) {
|
|
28210
|
-
from = ">=".concat(from);
|
|
28211
|
-
} else {
|
|
28212
|
-
from = ">=".concat(from).concat(incPr ? '-0' : '');
|
|
28213
|
-
}
|
|
28214
|
-
if (isX(tM)) {
|
|
28215
|
-
to = '';
|
|
28216
|
-
} else if (isX(tm)) {
|
|
28217
|
-
to = "<".concat(+tM + 1, ".0.0-0");
|
|
28218
|
-
} else if (isX(tp)) {
|
|
28219
|
-
to = "<".concat(tM, ".").concat(+tm + 1, ".0-0");
|
|
28220
|
-
} else if (tpr) {
|
|
28221
|
-
to = "<=".concat(tM, ".").concat(tm, ".").concat(tp, "-").concat(tpr);
|
|
28222
|
-
} else if (incPr) {
|
|
28223
|
-
to = "<".concat(tM, ".").concat(tm, ".").concat(+tp + 1, "-0");
|
|
28224
|
-
} else {
|
|
28225
|
-
to = "<=".concat(to);
|
|
28226
|
-
}
|
|
28227
|
-
return "".concat(from, " ").concat(to).trim();
|
|
28228
|
-
};
|
|
28229
|
-
const testSet = (set, version, options) => {
|
|
28230
|
-
for (let i = 0; i < set.length; i++) {
|
|
28231
|
-
if (!set[i].test(version)) {
|
|
28232
|
-
return false;
|
|
28233
|
-
}
|
|
28234
|
-
}
|
|
28235
|
-
if (version.prerelease.length && !options.includePrerelease) {
|
|
28236
|
-
// Find the set of versions that are allowed to have prereleases
|
|
28237
|
-
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
|
|
28238
|
-
// That should allow `1.2.3-pr.2` to pass.
|
|
28239
|
-
// However, `1.2.4-alpha.notready` should NOT be allowed,
|
|
28240
|
-
// even though it's within the range set by the comparators.
|
|
28241
|
-
for (let i = 0; i < set.length; i++) {
|
|
28242
|
-
debug(set[i].semver);
|
|
28243
|
-
if (set[i].semver === Comparator.ANY) {
|
|
28244
|
-
continue;
|
|
28245
|
-
}
|
|
28246
|
-
if (set[i].semver.prerelease.length > 0) {
|
|
28247
|
-
const allowed = set[i].semver;
|
|
28248
|
-
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
|
28249
|
-
return true;
|
|
28250
|
-
}
|
|
28251
|
-
}
|
|
28252
|
-
}
|
|
27938
|
+
function requireRange () {
|
|
27939
|
+
if (hasRequiredRange) return range;
|
|
27940
|
+
hasRequiredRange = 1;
|
|
27941
|
+
// hoisted class for cyclic dependency
|
|
27942
|
+
class Range {
|
|
27943
|
+
constructor (range, options) {
|
|
27944
|
+
options = parseOptions(options);
|
|
27945
|
+
|
|
27946
|
+
if (range instanceof Range) {
|
|
27947
|
+
if (
|
|
27948
|
+
range.loose === !!options.loose &&
|
|
27949
|
+
range.includePrerelease === !!options.includePrerelease
|
|
27950
|
+
) {
|
|
27951
|
+
return range
|
|
27952
|
+
} else {
|
|
27953
|
+
return new Range(range.raw, options)
|
|
27954
|
+
}
|
|
27955
|
+
}
|
|
27956
|
+
|
|
27957
|
+
if (range instanceof Comparator) {
|
|
27958
|
+
// just put it in the set and return
|
|
27959
|
+
this.raw = range.value;
|
|
27960
|
+
this.set = [[range]];
|
|
27961
|
+
this.format();
|
|
27962
|
+
return this
|
|
27963
|
+
}
|
|
27964
|
+
|
|
27965
|
+
this.options = options;
|
|
27966
|
+
this.loose = !!options.loose;
|
|
27967
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
27968
|
+
|
|
27969
|
+
// First reduce all whitespace as much as possible so we do not have to rely
|
|
27970
|
+
// on potentially slow regexes like \s*. This is then stored and used for
|
|
27971
|
+
// future error messages as well.
|
|
27972
|
+
this.raw = range
|
|
27973
|
+
.trim()
|
|
27974
|
+
.split(/\s+/)
|
|
27975
|
+
.join(' ');
|
|
27976
|
+
|
|
27977
|
+
// First, split on ||
|
|
27978
|
+
this.set = this.raw
|
|
27979
|
+
.split('||')
|
|
27980
|
+
// map the range to a 2d array of comparators
|
|
27981
|
+
.map(r => this.parseRange(r.trim()))
|
|
27982
|
+
// throw out any comparator lists that are empty
|
|
27983
|
+
// this generally means that it was not a valid range, which is allowed
|
|
27984
|
+
// in loose mode, but will still throw if the WHOLE range is invalid.
|
|
27985
|
+
.filter(c => c.length);
|
|
27986
|
+
|
|
27987
|
+
if (!this.set.length) {
|
|
27988
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
|
|
27989
|
+
}
|
|
27990
|
+
|
|
27991
|
+
// if we have any that are not the null set, throw out null sets.
|
|
27992
|
+
if (this.set.length > 1) {
|
|
27993
|
+
// keep the first one, in case they're all null sets
|
|
27994
|
+
const first = this.set[0];
|
|
27995
|
+
this.set = this.set.filter(c => !isNullSet(c[0]));
|
|
27996
|
+
if (this.set.length === 0) {
|
|
27997
|
+
this.set = [first];
|
|
27998
|
+
} else if (this.set.length > 1) {
|
|
27999
|
+
// if we have any that are *, then the range is just *
|
|
28000
|
+
for (const c of this.set) {
|
|
28001
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
28002
|
+
this.set = [c];
|
|
28003
|
+
break
|
|
28004
|
+
}
|
|
28005
|
+
}
|
|
28006
|
+
}
|
|
28007
|
+
}
|
|
28008
|
+
|
|
28009
|
+
this.format();
|
|
28010
|
+
}
|
|
28011
|
+
|
|
28012
|
+
format () {
|
|
28013
|
+
this.range = this.set
|
|
28014
|
+
.map((comps) => comps.join(' ').trim())
|
|
28015
|
+
.join('||')
|
|
28016
|
+
.trim();
|
|
28017
|
+
return this.range
|
|
28018
|
+
}
|
|
28019
|
+
|
|
28020
|
+
toString () {
|
|
28021
|
+
return this.range
|
|
28022
|
+
}
|
|
28023
|
+
|
|
28024
|
+
parseRange (range) {
|
|
28025
|
+
// memoize range parsing for performance.
|
|
28026
|
+
// this is a very hot path, and fully deterministic.
|
|
28027
|
+
const memoOpts =
|
|
28028
|
+
(this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
|
|
28029
|
+
(this.options.loose && FLAG_LOOSE);
|
|
28030
|
+
const memoKey = memoOpts + ':' + range;
|
|
28031
|
+
const cached = cache.get(memoKey);
|
|
28032
|
+
if (cached) {
|
|
28033
|
+
return cached
|
|
28034
|
+
}
|
|
28035
|
+
|
|
28036
|
+
const loose = this.options.loose;
|
|
28037
|
+
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
28038
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
28039
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
28040
|
+
debug('hyphen replace', range);
|
|
28041
|
+
|
|
28042
|
+
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
|
28043
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
28044
|
+
debug('comparator trim', range);
|
|
28045
|
+
|
|
28046
|
+
// `~ 1.2.3` => `~1.2.3`
|
|
28047
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
28048
|
+
debug('tilde trim', range);
|
|
28049
|
+
|
|
28050
|
+
// `^ 1.2.3` => `^1.2.3`
|
|
28051
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
28052
|
+
debug('caret trim', range);
|
|
28053
|
+
|
|
28054
|
+
// At this point, the range is completely trimmed and
|
|
28055
|
+
// ready to be split into comparators.
|
|
28056
|
+
|
|
28057
|
+
let rangeList = range
|
|
28058
|
+
.split(' ')
|
|
28059
|
+
.map(comp => parseComparator(comp, this.options))
|
|
28060
|
+
.join(' ')
|
|
28061
|
+
.split(/\s+/)
|
|
28062
|
+
// >=0.0.0 is equivalent to *
|
|
28063
|
+
.map(comp => replaceGTE0(comp, this.options));
|
|
28064
|
+
|
|
28065
|
+
if (loose) {
|
|
28066
|
+
// in loose mode, throw out any that are not valid comparators
|
|
28067
|
+
rangeList = rangeList.filter(comp => {
|
|
28068
|
+
debug('loose invalid filter', comp, this.options);
|
|
28069
|
+
return !!comp.match(re[t.COMPARATORLOOSE])
|
|
28070
|
+
});
|
|
28071
|
+
}
|
|
28072
|
+
debug('range list', rangeList);
|
|
28073
|
+
|
|
28074
|
+
// if any comparators are the null set, then replace with JUST null set
|
|
28075
|
+
// if more than one comparator, remove any * comparators
|
|
28076
|
+
// also, don't include the same comparator more than once
|
|
28077
|
+
const rangeMap = new Map();
|
|
28078
|
+
const comparators = rangeList.map(comp => new Comparator(comp, this.options));
|
|
28079
|
+
for (const comp of comparators) {
|
|
28080
|
+
if (isNullSet(comp)) {
|
|
28081
|
+
return [comp]
|
|
28082
|
+
}
|
|
28083
|
+
rangeMap.set(comp.value, comp);
|
|
28084
|
+
}
|
|
28085
|
+
if (rangeMap.size > 1 && rangeMap.has('')) {
|
|
28086
|
+
rangeMap.delete('');
|
|
28087
|
+
}
|
|
28088
|
+
|
|
28089
|
+
const result = [...rangeMap.values()];
|
|
28090
|
+
cache.set(memoKey, result);
|
|
28091
|
+
return result
|
|
28092
|
+
}
|
|
28093
|
+
|
|
28094
|
+
intersects (range, options) {
|
|
28095
|
+
if (!(range instanceof Range)) {
|
|
28096
|
+
throw new TypeError('a Range is required')
|
|
28097
|
+
}
|
|
28098
|
+
|
|
28099
|
+
return this.set.some((thisComparators) => {
|
|
28100
|
+
return (
|
|
28101
|
+
isSatisfiable(thisComparators, options) &&
|
|
28102
|
+
range.set.some((rangeComparators) => {
|
|
28103
|
+
return (
|
|
28104
|
+
isSatisfiable(rangeComparators, options) &&
|
|
28105
|
+
thisComparators.every((thisComparator) => {
|
|
28106
|
+
return rangeComparators.every((rangeComparator) => {
|
|
28107
|
+
return thisComparator.intersects(rangeComparator, options)
|
|
28108
|
+
})
|
|
28109
|
+
})
|
|
28110
|
+
)
|
|
28111
|
+
})
|
|
28112
|
+
)
|
|
28113
|
+
})
|
|
28114
|
+
}
|
|
28115
|
+
|
|
28116
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
28117
|
+
test (version) {
|
|
28118
|
+
if (!version) {
|
|
28119
|
+
return false
|
|
28120
|
+
}
|
|
28121
|
+
|
|
28122
|
+
if (typeof version === 'string') {
|
|
28123
|
+
try {
|
|
28124
|
+
version = new SemVer(version, this.options);
|
|
28125
|
+
} catch (er) {
|
|
28126
|
+
return false
|
|
28127
|
+
}
|
|
28128
|
+
}
|
|
28129
|
+
|
|
28130
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
28131
|
+
if (testSet(this.set[i], version, this.options)) {
|
|
28132
|
+
return true
|
|
28133
|
+
}
|
|
28134
|
+
}
|
|
28135
|
+
return false
|
|
28136
|
+
}
|
|
28137
|
+
}
|
|
28253
28138
|
|
|
28254
|
-
|
|
28255
|
-
|
|
28256
|
-
|
|
28257
|
-
|
|
28258
|
-
|
|
28259
|
-
|
|
28139
|
+
range = Range;
|
|
28140
|
+
|
|
28141
|
+
const LRU = lrucache;
|
|
28142
|
+
const cache = new LRU();
|
|
28143
|
+
|
|
28144
|
+
const parseOptions = parseOptions_1;
|
|
28145
|
+
const Comparator = requireComparator();
|
|
28146
|
+
const debug = debug_1;
|
|
28147
|
+
const SemVer = semver;
|
|
28148
|
+
const {
|
|
28149
|
+
safeRe: re,
|
|
28150
|
+
t,
|
|
28151
|
+
comparatorTrimReplace,
|
|
28152
|
+
tildeTrimReplace,
|
|
28153
|
+
caretTrimReplace,
|
|
28154
|
+
} = reExports;
|
|
28155
|
+
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = constants;
|
|
28156
|
+
|
|
28157
|
+
const isNullSet = c => c.value === '<0.0.0-0';
|
|
28158
|
+
const isAny = c => c.value === '';
|
|
28159
|
+
|
|
28160
|
+
// take a set of comparators and determine whether there
|
|
28161
|
+
// exists a version which can satisfy it
|
|
28162
|
+
const isSatisfiable = (comparators, options) => {
|
|
28163
|
+
let result = true;
|
|
28164
|
+
const remainingComparators = comparators.slice();
|
|
28165
|
+
let testComparator = remainingComparators.pop();
|
|
28166
|
+
|
|
28167
|
+
while (result && remainingComparators.length) {
|
|
28168
|
+
result = remainingComparators.every((otherComparator) => {
|
|
28169
|
+
return testComparator.intersects(otherComparator, options)
|
|
28170
|
+
});
|
|
28171
|
+
|
|
28172
|
+
testComparator = remainingComparators.pop();
|
|
28173
|
+
}
|
|
28174
|
+
|
|
28175
|
+
return result
|
|
28176
|
+
};
|
|
28177
|
+
|
|
28178
|
+
// comprised of xranges, tildes, stars, and gtlt's at this point.
|
|
28179
|
+
// already replaced the hyphen ranges
|
|
28180
|
+
// turn into a set of JUST comparators.
|
|
28181
|
+
const parseComparator = (comp, options) => {
|
|
28182
|
+
debug('comp', comp, options);
|
|
28183
|
+
comp = replaceCarets(comp, options);
|
|
28184
|
+
debug('caret', comp);
|
|
28185
|
+
comp = replaceTildes(comp, options);
|
|
28186
|
+
debug('tildes', comp);
|
|
28187
|
+
comp = replaceXRanges(comp, options);
|
|
28188
|
+
debug('xrange', comp);
|
|
28189
|
+
comp = replaceStars(comp, options);
|
|
28190
|
+
debug('stars', comp);
|
|
28191
|
+
return comp
|
|
28192
|
+
};
|
|
28193
|
+
|
|
28194
|
+
const isX = id => !id || id.toLowerCase() === 'x' || id === '*';
|
|
28195
|
+
|
|
28196
|
+
// ~, ~> --> * (any, kinda silly)
|
|
28197
|
+
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
|
|
28198
|
+
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
|
|
28199
|
+
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
|
|
28200
|
+
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
|
|
28201
|
+
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
|
|
28202
|
+
// ~0.0.1 --> >=0.0.1 <0.1.0-0
|
|
28203
|
+
const replaceTildes = (comp, options) => {
|
|
28204
|
+
return comp
|
|
28205
|
+
.trim()
|
|
28206
|
+
.split(/\s+/)
|
|
28207
|
+
.map((c) => replaceTilde(c, options))
|
|
28208
|
+
.join(' ')
|
|
28209
|
+
};
|
|
28210
|
+
|
|
28211
|
+
const replaceTilde = (comp, options) => {
|
|
28212
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
28213
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
28214
|
+
debug('tilde', comp, _, M, m, p, pr);
|
|
28215
|
+
let ret;
|
|
28216
|
+
|
|
28217
|
+
if (isX(M)) {
|
|
28218
|
+
ret = '';
|
|
28219
|
+
} else if (isX(m)) {
|
|
28220
|
+
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
28221
|
+
} else if (isX(p)) {
|
|
28222
|
+
// ~1.2 == >=1.2.0 <1.3.0-0
|
|
28223
|
+
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
28224
|
+
} else if (pr) {
|
|
28225
|
+
debug('replaceTilde pr', pr);
|
|
28226
|
+
ret = `>=${M}.${m}.${p}-${pr
|
|
28227
|
+
} <${M}.${+m + 1}.0-0`;
|
|
28228
|
+
} else {
|
|
28229
|
+
// ~1.2.3 == >=1.2.3 <1.3.0-0
|
|
28230
|
+
ret = `>=${M}.${m}.${p
|
|
28231
|
+
} <${M}.${+m + 1}.0-0`;
|
|
28232
|
+
}
|
|
28233
|
+
|
|
28234
|
+
debug('tilde return', ret);
|
|
28235
|
+
return ret
|
|
28236
|
+
})
|
|
28237
|
+
};
|
|
28238
|
+
|
|
28239
|
+
// ^ --> * (any, kinda silly)
|
|
28240
|
+
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
|
|
28241
|
+
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
|
|
28242
|
+
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
|
|
28243
|
+
// ^1.2.3 --> >=1.2.3 <2.0.0-0
|
|
28244
|
+
// ^1.2.0 --> >=1.2.0 <2.0.0-0
|
|
28245
|
+
// ^0.0.1 --> >=0.0.1 <0.0.2-0
|
|
28246
|
+
// ^0.1.0 --> >=0.1.0 <0.2.0-0
|
|
28247
|
+
const replaceCarets = (comp, options) => {
|
|
28248
|
+
return comp
|
|
28249
|
+
.trim()
|
|
28250
|
+
.split(/\s+/)
|
|
28251
|
+
.map((c) => replaceCaret(c, options))
|
|
28252
|
+
.join(' ')
|
|
28253
|
+
};
|
|
28254
|
+
|
|
28255
|
+
const replaceCaret = (comp, options) => {
|
|
28256
|
+
debug('caret', comp, options);
|
|
28257
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
28258
|
+
const z = options.includePrerelease ? '-0' : '';
|
|
28259
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
28260
|
+
debug('caret', comp, _, M, m, p, pr);
|
|
28261
|
+
let ret;
|
|
28262
|
+
|
|
28263
|
+
if (isX(M)) {
|
|
28264
|
+
ret = '';
|
|
28265
|
+
} else if (isX(m)) {
|
|
28266
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
28267
|
+
} else if (isX(p)) {
|
|
28268
|
+
if (M === '0') {
|
|
28269
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
28270
|
+
} else {
|
|
28271
|
+
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
28272
|
+
}
|
|
28273
|
+
} else if (pr) {
|
|
28274
|
+
debug('replaceCaret pr', pr);
|
|
28275
|
+
if (M === '0') {
|
|
28276
|
+
if (m === '0') {
|
|
28277
|
+
ret = `>=${M}.${m}.${p}-${pr
|
|
28278
|
+
} <${M}.${m}.${+p + 1}-0`;
|
|
28279
|
+
} else {
|
|
28280
|
+
ret = `>=${M}.${m}.${p}-${pr
|
|
28281
|
+
} <${M}.${+m + 1}.0-0`;
|
|
28282
|
+
}
|
|
28283
|
+
} else {
|
|
28284
|
+
ret = `>=${M}.${m}.${p}-${pr
|
|
28285
|
+
} <${+M + 1}.0.0-0`;
|
|
28286
|
+
}
|
|
28287
|
+
} else {
|
|
28288
|
+
debug('no pr');
|
|
28289
|
+
if (M === '0') {
|
|
28290
|
+
if (m === '0') {
|
|
28291
|
+
ret = `>=${M}.${m}.${p
|
|
28292
|
+
}${z} <${M}.${m}.${+p + 1}-0`;
|
|
28293
|
+
} else {
|
|
28294
|
+
ret = `>=${M}.${m}.${p
|
|
28295
|
+
}${z} <${M}.${+m + 1}.0-0`;
|
|
28296
|
+
}
|
|
28297
|
+
} else {
|
|
28298
|
+
ret = `>=${M}.${m}.${p
|
|
28299
|
+
} <${+M + 1}.0.0-0`;
|
|
28300
|
+
}
|
|
28301
|
+
}
|
|
28302
|
+
|
|
28303
|
+
debug('caret return', ret);
|
|
28304
|
+
return ret
|
|
28305
|
+
})
|
|
28306
|
+
};
|
|
28307
|
+
|
|
28308
|
+
const replaceXRanges = (comp, options) => {
|
|
28309
|
+
debug('replaceXRanges', comp, options);
|
|
28310
|
+
return comp
|
|
28311
|
+
.split(/\s+/)
|
|
28312
|
+
.map((c) => replaceXRange(c, options))
|
|
28313
|
+
.join(' ')
|
|
28314
|
+
};
|
|
28315
|
+
|
|
28316
|
+
const replaceXRange = (comp, options) => {
|
|
28317
|
+
comp = comp.trim();
|
|
28318
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
28319
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
28320
|
+
debug('xRange', comp, ret, gtlt, M, m, p, pr);
|
|
28321
|
+
const xM = isX(M);
|
|
28322
|
+
const xm = xM || isX(m);
|
|
28323
|
+
const xp = xm || isX(p);
|
|
28324
|
+
const anyX = xp;
|
|
28325
|
+
|
|
28326
|
+
if (gtlt === '=' && anyX) {
|
|
28327
|
+
gtlt = '';
|
|
28328
|
+
}
|
|
28329
|
+
|
|
28330
|
+
// if we're including prereleases in the match, then we need
|
|
28331
|
+
// to fix this to -0, the lowest possible prerelease value
|
|
28332
|
+
pr = options.includePrerelease ? '-0' : '';
|
|
28333
|
+
|
|
28334
|
+
if (xM) {
|
|
28335
|
+
if (gtlt === '>' || gtlt === '<') {
|
|
28336
|
+
// nothing is allowed
|
|
28337
|
+
ret = '<0.0.0-0';
|
|
28338
|
+
} else {
|
|
28339
|
+
// nothing is forbidden
|
|
28340
|
+
ret = '*';
|
|
28341
|
+
}
|
|
28342
|
+
} else if (gtlt && anyX) {
|
|
28343
|
+
// we know patch is an x, because we have any x at all.
|
|
28344
|
+
// replace X with 0
|
|
28345
|
+
if (xm) {
|
|
28346
|
+
m = 0;
|
|
28347
|
+
}
|
|
28348
|
+
p = 0;
|
|
28349
|
+
|
|
28350
|
+
if (gtlt === '>') {
|
|
28351
|
+
// >1 => >=2.0.0
|
|
28352
|
+
// >1.2 => >=1.3.0
|
|
28353
|
+
gtlt = '>=';
|
|
28354
|
+
if (xm) {
|
|
28355
|
+
M = +M + 1;
|
|
28356
|
+
m = 0;
|
|
28357
|
+
p = 0;
|
|
28358
|
+
} else {
|
|
28359
|
+
m = +m + 1;
|
|
28360
|
+
p = 0;
|
|
28361
|
+
}
|
|
28362
|
+
} else if (gtlt === '<=') {
|
|
28363
|
+
// <=0.7.x is actually <0.8.0, since any 0.7.x should
|
|
28364
|
+
// pass. Similarly, <=7.x is actually <8.0.0, etc.
|
|
28365
|
+
gtlt = '<';
|
|
28366
|
+
if (xm) {
|
|
28367
|
+
M = +M + 1;
|
|
28368
|
+
} else {
|
|
28369
|
+
m = +m + 1;
|
|
28370
|
+
}
|
|
28371
|
+
}
|
|
28372
|
+
|
|
28373
|
+
if (gtlt === '<') {
|
|
28374
|
+
pr = '-0';
|
|
28375
|
+
}
|
|
28376
|
+
|
|
28377
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
28378
|
+
} else if (xm) {
|
|
28379
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
28380
|
+
} else if (xp) {
|
|
28381
|
+
ret = `>=${M}.${m}.0${pr
|
|
28382
|
+
} <${M}.${+m + 1}.0-0`;
|
|
28383
|
+
}
|
|
28384
|
+
|
|
28385
|
+
debug('xRange return', ret);
|
|
28386
|
+
|
|
28387
|
+
return ret
|
|
28388
|
+
})
|
|
28389
|
+
};
|
|
28390
|
+
|
|
28391
|
+
// Because * is AND-ed with everything else in the comparator,
|
|
28392
|
+
// and '' means "any version", just remove the *s entirely.
|
|
28393
|
+
const replaceStars = (comp, options) => {
|
|
28394
|
+
debug('replaceStars', comp, options);
|
|
28395
|
+
// Looseness is ignored here. star is always as loose as it gets!
|
|
28396
|
+
return comp
|
|
28397
|
+
.trim()
|
|
28398
|
+
.replace(re[t.STAR], '')
|
|
28399
|
+
};
|
|
28400
|
+
|
|
28401
|
+
const replaceGTE0 = (comp, options) => {
|
|
28402
|
+
debug('replaceGTE0', comp, options);
|
|
28403
|
+
return comp
|
|
28404
|
+
.trim()
|
|
28405
|
+
.replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
|
|
28406
|
+
};
|
|
28407
|
+
|
|
28408
|
+
// This function is passed to string.replace(re[t.HYPHENRANGE])
|
|
28409
|
+
// M, m, patch, prerelease, build
|
|
28410
|
+
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
|
28411
|
+
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
|
|
28412
|
+
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
|
|
28413
|
+
// TODO build?
|
|
28414
|
+
const hyphenReplace = incPr => ($0,
|
|
28415
|
+
from, fM, fm, fp, fpr, fb,
|
|
28416
|
+
to, tM, tm, tp, tpr) => {
|
|
28417
|
+
if (isX(fM)) {
|
|
28418
|
+
from = '';
|
|
28419
|
+
} else if (isX(fm)) {
|
|
28420
|
+
from = `>=${fM}.0.0${incPr ? '-0' : ''}`;
|
|
28421
|
+
} else if (isX(fp)) {
|
|
28422
|
+
from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`;
|
|
28423
|
+
} else if (fpr) {
|
|
28424
|
+
from = `>=${from}`;
|
|
28425
|
+
} else {
|
|
28426
|
+
from = `>=${from}${incPr ? '-0' : ''}`;
|
|
28427
|
+
}
|
|
28428
|
+
|
|
28429
|
+
if (isX(tM)) {
|
|
28430
|
+
to = '';
|
|
28431
|
+
} else if (isX(tm)) {
|
|
28432
|
+
to = `<${+tM + 1}.0.0-0`;
|
|
28433
|
+
} else if (isX(tp)) {
|
|
28434
|
+
to = `<${tM}.${+tm + 1}.0-0`;
|
|
28435
|
+
} else if (tpr) {
|
|
28436
|
+
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
28437
|
+
} else if (incPr) {
|
|
28438
|
+
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
28439
|
+
} else {
|
|
28440
|
+
to = `<=${to}`;
|
|
28441
|
+
}
|
|
28442
|
+
|
|
28443
|
+
return `${from} ${to}`.trim()
|
|
28444
|
+
};
|
|
28445
|
+
|
|
28446
|
+
const testSet = (set, version, options) => {
|
|
28447
|
+
for (let i = 0; i < set.length; i++) {
|
|
28448
|
+
if (!set[i].test(version)) {
|
|
28449
|
+
return false
|
|
28450
|
+
}
|
|
28451
|
+
}
|
|
28452
|
+
|
|
28453
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
28454
|
+
// Find the set of versions that are allowed to have prereleases
|
|
28455
|
+
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
|
|
28456
|
+
// That should allow `1.2.3-pr.2` to pass.
|
|
28457
|
+
// However, `1.2.4-alpha.notready` should NOT be allowed,
|
|
28458
|
+
// even though it's within the range set by the comparators.
|
|
28459
|
+
for (let i = 0; i < set.length; i++) {
|
|
28460
|
+
debug(set[i].semver);
|
|
28461
|
+
if (set[i].semver === Comparator.ANY) {
|
|
28462
|
+
continue
|
|
28463
|
+
}
|
|
28464
|
+
|
|
28465
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
28466
|
+
const allowed = set[i].semver;
|
|
28467
|
+
if (allowed.major === version.major &&
|
|
28468
|
+
allowed.minor === version.minor &&
|
|
28469
|
+
allowed.patch === version.patch) {
|
|
28470
|
+
return true
|
|
28471
|
+
}
|
|
28472
|
+
}
|
|
28473
|
+
}
|
|
28474
|
+
|
|
28475
|
+
// Version has a -pre, but it's not one of the ones we like.
|
|
28476
|
+
return false
|
|
28477
|
+
}
|
|
28478
|
+
|
|
28479
|
+
return true
|
|
28480
|
+
};
|
|
28481
|
+
return range;
|
|
28260
28482
|
}
|
|
28261
28483
|
|
|
28262
28484
|
const Range = requireRange();
|
|
@@ -28264,11 +28486,12 @@ const satisfies = (version, range, options) => {
|
|
|
28264
28486
|
try {
|
|
28265
28487
|
range = new Range(range, options);
|
|
28266
28488
|
} catch (er) {
|
|
28267
|
-
return false
|
|
28489
|
+
return false
|
|
28268
28490
|
}
|
|
28269
|
-
return range.test(version)
|
|
28491
|
+
return range.test(version)
|
|
28270
28492
|
};
|
|
28271
28493
|
var satisfies_1 = satisfies;
|
|
28494
|
+
|
|
28272
28495
|
var satisfies$1 = /*@__PURE__*/getDefaultExportFromCjs(satisfies_1);
|
|
28273
28496
|
|
|
28274
28497
|
const LOADED = {};
|
|
@@ -28983,7 +29206,8 @@ function nuked() {
|
|
|
28983
29206
|
onSelectionDeactivated
|
|
28984
29207
|
}, options)),
|
|
28985
29208
|
stateName: options.stateName || '$',
|
|
28986
|
-
renderedCallback: resolve
|
|
29209
|
+
renderedCallback: resolve,
|
|
29210
|
+
flags: halo.public.galaxy.flags
|
|
28987
29211
|
});
|
|
28988
29212
|
root.add(this._instance);
|
|
28989
29213
|
});
|
|
@@ -29037,7 +29261,8 @@ function nuked() {
|
|
|
29037
29261
|
app,
|
|
29038
29262
|
fieldIdentifier,
|
|
29039
29263
|
options: opts,
|
|
29040
|
-
stateName: options.stateName || '$'
|
|
29264
|
+
stateName: options.stateName || '$',
|
|
29265
|
+
flags: halo.public.galaxy.flags
|
|
29041
29266
|
});
|
|
29042
29267
|
root.add(api._popoverInstance);
|
|
29043
29268
|
}
|