@nebula.js/stardust 3.0.4 → 3.1.0-alpha.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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v3.0.4
2
+ * @nebula.js/stardust v3.1.0-alpha.0
3
3
  * Copyright (c) 2022 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -1580,6 +1580,24 @@
1580
1580
  "zh-TW": "不符計算條件"
1581
1581
  }
1582
1582
  };
1583
+ var Listbox_ScreenReaderInstructions = {
1584
+ id: "Listbox.ScreenReaderInstructions",
1585
+ locale: {
1586
+ "en-US": "Activating the elements below will cause content on the page to be updated"
1587
+ }
1588
+ };
1589
+ var Listbox_Search_ScreenReaderInstructions = {
1590
+ id: "Listbox.Search.ScreenReaderInstructions",
1591
+ locale: {
1592
+ "en-US": "The following search field filters results below as you type"
1593
+ }
1594
+ };
1595
+ var Listbox_ResultFilterLabel = {
1596
+ id: "Listbox.ResultFilterLabel",
1597
+ locale: {
1598
+ "en-US": "Search Results Filter"
1599
+ }
1600
+ };
1583
1601
  var all = {
1584
1602
  Cancel: Cancel$1,
1585
1603
  CurrentSelections_All: CurrentSelections_All,
@@ -1610,7 +1628,10 @@
1610
1628
  Visualization_Invalid_Dimension: Visualization_Invalid_Dimension,
1611
1629
  Visualization_Invalid_Measure: Visualization_Invalid_Measure,
1612
1630
  Visualization_LayoutError: Visualization_LayoutError,
1613
- Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition
1631
+ Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition,
1632
+ Listbox_ScreenReaderInstructions: Listbox_ScreenReaderInstructions,
1633
+ Listbox_Search_ScreenReaderInstructions: Listbox_Search_ScreenReaderInstructions,
1634
+ Listbox_ResultFilterLabel: Listbox_ResultFilterLabel
1614
1635
  };
1615
1636
 
1616
1637
  function appLocaleFn(language) {
@@ -1920,76 +1941,457 @@
1920
1941
  return ret;
1921
1942
  };
1922
1943
 
1923
- var hasOwn = Object.prototype.hasOwnProperty;
1924
- var toStr = Object.prototype.toString;
1925
- var defineProperty = Object.defineProperty;
1926
- var gOPD = Object.getOwnPropertyDescriptor;
1927
-
1928
- var isArray$1 = function isArray(arr) {
1929
- if (typeof Array.isArray === 'function') {
1930
- return Array.isArray(arr);
1931
- }
1932
-
1933
- return toStr.call(arr) === '[object Array]';
1934
- };
1944
+ function define(constructor, factory, prototype) {
1945
+ constructor.prototype = factory.prototype = prototype;
1946
+ prototype.constructor = constructor;
1947
+ }
1935
1948
 
1936
- var isPlainObject$1 = function isPlainObject(obj) {
1937
- if (!obj || toStr.call(obj) !== '[object Object]') {
1938
- return false;
1939
- }
1949
+ function extend$2(parent, definition) {
1950
+ var prototype = Object.create(parent.prototype);
1951
+ for (var key in definition) prototype[key] = definition[key];
1952
+ return prototype;
1953
+ }
1940
1954
 
1941
- var hasOwnConstructor = hasOwn.call(obj, 'constructor');
1942
- var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
1943
- // Not own constructor property must be Object
1944
- if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
1945
- return false;
1946
- }
1955
+ function Color() {}
1947
1956
 
1948
- // Own properties are enumerated firstly, so to speed up,
1949
- // if last one is own, then all properties are own.
1950
- var key;
1951
- for (key in obj) { /**/ }
1957
+ var darker = 0.7;
1958
+ var brighter = 1 / darker;
1952
1959
 
1953
- return typeof key === 'undefined' || hasOwn.call(obj, key);
1954
- };
1960
+ var reI = "\\s*([+-]?\\d+)\\s*",
1961
+ reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
1962
+ reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
1963
+ reHex = /^#([0-9a-f]{3,8})$/,
1964
+ reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"),
1965
+ reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"),
1966
+ reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"),
1967
+ reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"),
1968
+ reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"),
1969
+ reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
1955
1970
 
1956
- // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
1957
- var setProperty = function setProperty(target, options) {
1958
- if (defineProperty && options.name === '__proto__') {
1959
- defineProperty(target, options.name, {
1960
- enumerable: true,
1961
- configurable: true,
1962
- value: options.newValue,
1963
- writable: true
1964
- });
1965
- } else {
1966
- target[options.name] = options.newValue;
1967
- }
1971
+ var named = {
1972
+ aliceblue: 0xf0f8ff,
1973
+ antiquewhite: 0xfaebd7,
1974
+ aqua: 0x00ffff,
1975
+ aquamarine: 0x7fffd4,
1976
+ azure: 0xf0ffff,
1977
+ beige: 0xf5f5dc,
1978
+ bisque: 0xffe4c4,
1979
+ black: 0x000000,
1980
+ blanchedalmond: 0xffebcd,
1981
+ blue: 0x0000ff,
1982
+ blueviolet: 0x8a2be2,
1983
+ brown: 0xa52a2a,
1984
+ burlywood: 0xdeb887,
1985
+ cadetblue: 0x5f9ea0,
1986
+ chartreuse: 0x7fff00,
1987
+ chocolate: 0xd2691e,
1988
+ coral: 0xff7f50,
1989
+ cornflowerblue: 0x6495ed,
1990
+ cornsilk: 0xfff8dc,
1991
+ crimson: 0xdc143c,
1992
+ cyan: 0x00ffff,
1993
+ darkblue: 0x00008b,
1994
+ darkcyan: 0x008b8b,
1995
+ darkgoldenrod: 0xb8860b,
1996
+ darkgray: 0xa9a9a9,
1997
+ darkgreen: 0x006400,
1998
+ darkgrey: 0xa9a9a9,
1999
+ darkkhaki: 0xbdb76b,
2000
+ darkmagenta: 0x8b008b,
2001
+ darkolivegreen: 0x556b2f,
2002
+ darkorange: 0xff8c00,
2003
+ darkorchid: 0x9932cc,
2004
+ darkred: 0x8b0000,
2005
+ darksalmon: 0xe9967a,
2006
+ darkseagreen: 0x8fbc8f,
2007
+ darkslateblue: 0x483d8b,
2008
+ darkslategray: 0x2f4f4f,
2009
+ darkslategrey: 0x2f4f4f,
2010
+ darkturquoise: 0x00ced1,
2011
+ darkviolet: 0x9400d3,
2012
+ deeppink: 0xff1493,
2013
+ deepskyblue: 0x00bfff,
2014
+ dimgray: 0x696969,
2015
+ dimgrey: 0x696969,
2016
+ dodgerblue: 0x1e90ff,
2017
+ firebrick: 0xb22222,
2018
+ floralwhite: 0xfffaf0,
2019
+ forestgreen: 0x228b22,
2020
+ fuchsia: 0xff00ff,
2021
+ gainsboro: 0xdcdcdc,
2022
+ ghostwhite: 0xf8f8ff,
2023
+ gold: 0xffd700,
2024
+ goldenrod: 0xdaa520,
2025
+ gray: 0x808080,
2026
+ green: 0x008000,
2027
+ greenyellow: 0xadff2f,
2028
+ grey: 0x808080,
2029
+ honeydew: 0xf0fff0,
2030
+ hotpink: 0xff69b4,
2031
+ indianred: 0xcd5c5c,
2032
+ indigo: 0x4b0082,
2033
+ ivory: 0xfffff0,
2034
+ khaki: 0xf0e68c,
2035
+ lavender: 0xe6e6fa,
2036
+ lavenderblush: 0xfff0f5,
2037
+ lawngreen: 0x7cfc00,
2038
+ lemonchiffon: 0xfffacd,
2039
+ lightblue: 0xadd8e6,
2040
+ lightcoral: 0xf08080,
2041
+ lightcyan: 0xe0ffff,
2042
+ lightgoldenrodyellow: 0xfafad2,
2043
+ lightgray: 0xd3d3d3,
2044
+ lightgreen: 0x90ee90,
2045
+ lightgrey: 0xd3d3d3,
2046
+ lightpink: 0xffb6c1,
2047
+ lightsalmon: 0xffa07a,
2048
+ lightseagreen: 0x20b2aa,
2049
+ lightskyblue: 0x87cefa,
2050
+ lightslategray: 0x778899,
2051
+ lightslategrey: 0x778899,
2052
+ lightsteelblue: 0xb0c4de,
2053
+ lightyellow: 0xffffe0,
2054
+ lime: 0x00ff00,
2055
+ limegreen: 0x32cd32,
2056
+ linen: 0xfaf0e6,
2057
+ magenta: 0xff00ff,
2058
+ maroon: 0x800000,
2059
+ mediumaquamarine: 0x66cdaa,
2060
+ mediumblue: 0x0000cd,
2061
+ mediumorchid: 0xba55d3,
2062
+ mediumpurple: 0x9370db,
2063
+ mediumseagreen: 0x3cb371,
2064
+ mediumslateblue: 0x7b68ee,
2065
+ mediumspringgreen: 0x00fa9a,
2066
+ mediumturquoise: 0x48d1cc,
2067
+ mediumvioletred: 0xc71585,
2068
+ midnightblue: 0x191970,
2069
+ mintcream: 0xf5fffa,
2070
+ mistyrose: 0xffe4e1,
2071
+ moccasin: 0xffe4b5,
2072
+ navajowhite: 0xffdead,
2073
+ navy: 0x000080,
2074
+ oldlace: 0xfdf5e6,
2075
+ olive: 0x808000,
2076
+ olivedrab: 0x6b8e23,
2077
+ orange: 0xffa500,
2078
+ orangered: 0xff4500,
2079
+ orchid: 0xda70d6,
2080
+ palegoldenrod: 0xeee8aa,
2081
+ palegreen: 0x98fb98,
2082
+ paleturquoise: 0xafeeee,
2083
+ palevioletred: 0xdb7093,
2084
+ papayawhip: 0xffefd5,
2085
+ peachpuff: 0xffdab9,
2086
+ peru: 0xcd853f,
2087
+ pink: 0xffc0cb,
2088
+ plum: 0xdda0dd,
2089
+ powderblue: 0xb0e0e6,
2090
+ purple: 0x800080,
2091
+ rebeccapurple: 0x663399,
2092
+ red: 0xff0000,
2093
+ rosybrown: 0xbc8f8f,
2094
+ royalblue: 0x4169e1,
2095
+ saddlebrown: 0x8b4513,
2096
+ salmon: 0xfa8072,
2097
+ sandybrown: 0xf4a460,
2098
+ seagreen: 0x2e8b57,
2099
+ seashell: 0xfff5ee,
2100
+ sienna: 0xa0522d,
2101
+ silver: 0xc0c0c0,
2102
+ skyblue: 0x87ceeb,
2103
+ slateblue: 0x6a5acd,
2104
+ slategray: 0x708090,
2105
+ slategrey: 0x708090,
2106
+ snow: 0xfffafa,
2107
+ springgreen: 0x00ff7f,
2108
+ steelblue: 0x4682b4,
2109
+ tan: 0xd2b48c,
2110
+ teal: 0x008080,
2111
+ thistle: 0xd8bfd8,
2112
+ tomato: 0xff6347,
2113
+ turquoise: 0x40e0d0,
2114
+ violet: 0xee82ee,
2115
+ wheat: 0xf5deb3,
2116
+ white: 0xffffff,
2117
+ whitesmoke: 0xf5f5f5,
2118
+ yellow: 0xffff00,
2119
+ yellowgreen: 0x9acd32
1968
2120
  };
1969
2121
 
1970
- // Return undefined instead of __proto__ if '__proto__' is not an own property
1971
- var getProperty = function getProperty(obj, name) {
1972
- if (name === '__proto__') {
1973
- if (!hasOwn.call(obj, name)) {
1974
- return void 0;
1975
- } else if (gOPD) {
1976
- // In early versions of node, obj['__proto__'] is buggy when obj has
1977
- // __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
1978
- return gOPD(obj, name).value;
1979
- }
1980
- }
2122
+ define(Color, color$3, {
2123
+ copy: function(channels) {
2124
+ return Object.assign(new this.constructor, this, channels);
2125
+ },
2126
+ displayable: function() {
2127
+ return this.rgb().displayable();
2128
+ },
2129
+ hex: color_formatHex, // Deprecated! Use color.formatHex.
2130
+ formatHex: color_formatHex,
2131
+ formatHsl: color_formatHsl,
2132
+ formatRgb: color_formatRgb,
2133
+ toString: color_formatRgb
2134
+ });
1981
2135
 
1982
- return obj[name];
1983
- };
2136
+ function color_formatHex() {
2137
+ return this.rgb().formatHex();
2138
+ }
1984
2139
 
1985
- var extend$2 = function extend() {
1986
- var options, name, src, copy, copyIsArray, clone;
1987
- var target = arguments[0];
1988
- var i = 1;
1989
- var length = arguments.length;
1990
- var deep = false;
2140
+ function color_formatHsl() {
2141
+ return hslConvert(this).formatHsl();
2142
+ }
1991
2143
 
1992
- // Handle a deep copy situation
2144
+ function color_formatRgb() {
2145
+ return this.rgb().formatRgb();
2146
+ }
2147
+
2148
+ function color$3(format) {
2149
+ var m, l;
2150
+ format = (format + "").trim().toLowerCase();
2151
+ return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
2152
+ : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
2153
+ : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
2154
+ : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
2155
+ : null) // invalid hex
2156
+ : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
2157
+ : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
2158
+ : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
2159
+ : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
2160
+ : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
2161
+ : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
2162
+ : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
2163
+ : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
2164
+ : null;
2165
+ }
2166
+
2167
+ function rgbn(n) {
2168
+ return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
2169
+ }
2170
+
2171
+ function rgba(r, g, b, a) {
2172
+ if (a <= 0) r = g = b = NaN;
2173
+ return new Rgb(r, g, b, a);
2174
+ }
2175
+
2176
+ function rgbConvert(o) {
2177
+ if (!(o instanceof Color)) o = color$3(o);
2178
+ if (!o) return new Rgb;
2179
+ o = o.rgb();
2180
+ return new Rgb(o.r, o.g, o.b, o.opacity);
2181
+ }
2182
+
2183
+ function rgb(r, g, b, opacity) {
2184
+ return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
2185
+ }
2186
+
2187
+ function Rgb(r, g, b, opacity) {
2188
+ this.r = +r;
2189
+ this.g = +g;
2190
+ this.b = +b;
2191
+ this.opacity = +opacity;
2192
+ }
2193
+
2194
+ define(Rgb, rgb, extend$2(Color, {
2195
+ brighter: function(k) {
2196
+ k = k == null ? brighter : Math.pow(brighter, k);
2197
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
2198
+ },
2199
+ darker: function(k) {
2200
+ k = k == null ? darker : Math.pow(darker, k);
2201
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
2202
+ },
2203
+ rgb: function() {
2204
+ return this;
2205
+ },
2206
+ displayable: function() {
2207
+ return (-0.5 <= this.r && this.r < 255.5)
2208
+ && (-0.5 <= this.g && this.g < 255.5)
2209
+ && (-0.5 <= this.b && this.b < 255.5)
2210
+ && (0 <= this.opacity && this.opacity <= 1);
2211
+ },
2212
+ hex: rgb_formatHex, // Deprecated! Use color.formatHex.
2213
+ formatHex: rgb_formatHex,
2214
+ formatRgb: rgb_formatRgb,
2215
+ toString: rgb_formatRgb
2216
+ }));
2217
+
2218
+ function rgb_formatHex() {
2219
+ return "#" + hex(this.r) + hex(this.g) + hex(this.b);
2220
+ }
2221
+
2222
+ function rgb_formatRgb() {
2223
+ var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
2224
+ return (a === 1 ? "rgb(" : "rgba(")
2225
+ + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", "
2226
+ + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", "
2227
+ + Math.max(0, Math.min(255, Math.round(this.b) || 0))
2228
+ + (a === 1 ? ")" : ", " + a + ")");
2229
+ }
2230
+
2231
+ function hex(value) {
2232
+ value = Math.max(0, Math.min(255, Math.round(value) || 0));
2233
+ return (value < 16 ? "0" : "") + value.toString(16);
2234
+ }
2235
+
2236
+ function hsla(h, s, l, a) {
2237
+ if (a <= 0) h = s = l = NaN;
2238
+ else if (l <= 0 || l >= 1) h = s = NaN;
2239
+ else if (s <= 0) h = NaN;
2240
+ return new Hsl(h, s, l, a);
2241
+ }
2242
+
2243
+ function hslConvert(o) {
2244
+ if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
2245
+ if (!(o instanceof Color)) o = color$3(o);
2246
+ if (!o) return new Hsl;
2247
+ if (o instanceof Hsl) return o;
2248
+ o = o.rgb();
2249
+ var r = o.r / 255,
2250
+ g = o.g / 255,
2251
+ b = o.b / 255,
2252
+ min = Math.min(r, g, b),
2253
+ max = Math.max(r, g, b),
2254
+ h = NaN,
2255
+ s = max - min,
2256
+ l = (max + min) / 2;
2257
+ if (s) {
2258
+ if (r === max) h = (g - b) / s + (g < b) * 6;
2259
+ else if (g === max) h = (b - r) / s + 2;
2260
+ else h = (r - g) / s + 4;
2261
+ s /= l < 0.5 ? max + min : 2 - max - min;
2262
+ h *= 60;
2263
+ } else {
2264
+ s = l > 0 && l < 1 ? 0 : h;
2265
+ }
2266
+ return new Hsl(h, s, l, o.opacity);
2267
+ }
2268
+
2269
+ function hsl(h, s, l, opacity) {
2270
+ return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
2271
+ }
2272
+
2273
+ function Hsl(h, s, l, opacity) {
2274
+ this.h = +h;
2275
+ this.s = +s;
2276
+ this.l = +l;
2277
+ this.opacity = +opacity;
2278
+ }
2279
+
2280
+ define(Hsl, hsl, extend$2(Color, {
2281
+ brighter: function(k) {
2282
+ k = k == null ? brighter : Math.pow(brighter, k);
2283
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
2284
+ },
2285
+ darker: function(k) {
2286
+ k = k == null ? darker : Math.pow(darker, k);
2287
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
2288
+ },
2289
+ rgb: function() {
2290
+ var h = this.h % 360 + (this.h < 0) * 360,
2291
+ s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
2292
+ l = this.l,
2293
+ m2 = l + (l < 0.5 ? l : 1 - l) * s,
2294
+ m1 = 2 * l - m2;
2295
+ return new Rgb(
2296
+ hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
2297
+ hsl2rgb(h, m1, m2),
2298
+ hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
2299
+ this.opacity
2300
+ );
2301
+ },
2302
+ displayable: function() {
2303
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s))
2304
+ && (0 <= this.l && this.l <= 1)
2305
+ && (0 <= this.opacity && this.opacity <= 1);
2306
+ },
2307
+ formatHsl: function() {
2308
+ var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
2309
+ return (a === 1 ? "hsl(" : "hsla(")
2310
+ + (this.h || 0) + ", "
2311
+ + (this.s || 0) * 100 + "%, "
2312
+ + (this.l || 0) * 100 + "%"
2313
+ + (a === 1 ? ")" : ", " + a + ")");
2314
+ }
2315
+ }));
2316
+
2317
+ /* From FvD 13.37, CSS Color Module Level 3 */
2318
+ function hsl2rgb(h, m1, m2) {
2319
+ return (h < 60 ? m1 + (m2 - m1) * h / 60
2320
+ : h < 180 ? m2
2321
+ : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
2322
+ : m1) * 255;
2323
+ }
2324
+
2325
+ var hasOwn = Object.prototype.hasOwnProperty;
2326
+ var toStr = Object.prototype.toString;
2327
+ var defineProperty = Object.defineProperty;
2328
+ var gOPD = Object.getOwnPropertyDescriptor;
2329
+
2330
+ var isArray$1 = function isArray(arr) {
2331
+ if (typeof Array.isArray === 'function') {
2332
+ return Array.isArray(arr);
2333
+ }
2334
+
2335
+ return toStr.call(arr) === '[object Array]';
2336
+ };
2337
+
2338
+ var isPlainObject$1 = function isPlainObject(obj) {
2339
+ if (!obj || toStr.call(obj) !== '[object Object]') {
2340
+ return false;
2341
+ }
2342
+
2343
+ var hasOwnConstructor = hasOwn.call(obj, 'constructor');
2344
+ var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
2345
+ // Not own constructor property must be Object
2346
+ if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
2347
+ return false;
2348
+ }
2349
+
2350
+ // Own properties are enumerated firstly, so to speed up,
2351
+ // if last one is own, then all properties are own.
2352
+ var key;
2353
+ for (key in obj) { /**/ }
2354
+
2355
+ return typeof key === 'undefined' || hasOwn.call(obj, key);
2356
+ };
2357
+
2358
+ // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
2359
+ var setProperty = function setProperty(target, options) {
2360
+ if (defineProperty && options.name === '__proto__') {
2361
+ defineProperty(target, options.name, {
2362
+ enumerable: true,
2363
+ configurable: true,
2364
+ value: options.newValue,
2365
+ writable: true
2366
+ });
2367
+ } else {
2368
+ target[options.name] = options.newValue;
2369
+ }
2370
+ };
2371
+
2372
+ // Return undefined instead of __proto__ if '__proto__' is not an own property
2373
+ var getProperty = function getProperty(obj, name) {
2374
+ if (name === '__proto__') {
2375
+ if (!hasOwn.call(obj, name)) {
2376
+ return void 0;
2377
+ } else if (gOPD) {
2378
+ // In early versions of node, obj['__proto__'] is buggy when obj has
2379
+ // __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
2380
+ return gOPD(obj, name).value;
2381
+ }
2382
+ }
2383
+
2384
+ return obj[name];
2385
+ };
2386
+
2387
+ var extend$1 = function extend() {
2388
+ var options, name, src, copy, copyIsArray, clone;
2389
+ var target = arguments[0];
2390
+ var i = 1;
2391
+ var length = arguments.length;
2392
+ var deep = false;
2393
+
2394
+ // Handle a deep copy situation
1993
2395
  if (typeof target === 'boolean') {
1994
2396
  deep = target;
1995
2397
  target = arguments[1] || {};
@@ -2253,11 +2655,11 @@
2253
2655
  "@H6": "10px"
2254
2656
  };
2255
2657
  var type$1 = "light";
2256
- var color$3 = "@B35";
2658
+ var color$2 = "@B35";
2257
2659
  var lightRawJSON = {
2258
2660
  _variables: _variables$1,
2259
2661
  type: type$1,
2260
- color: color$3
2662
+ color: color$2
2261
2663
  };
2262
2664
 
2263
2665
  var _variables = {
@@ -2278,18 +2680,18 @@
2278
2680
  "@H6": "10px"
2279
2681
  };
2280
2682
  var type = "dark";
2281
- var color$2 = "@B98";
2683
+ var color$1 = "@B98";
2282
2684
  var darkRawJSON = {
2283
2685
  _variables: _variables,
2284
2686
  type: type,
2285
- color: color$2
2687
+ color: color$1
2286
2688
  };
2287
2689
 
2288
2690
  function setTheme(t, resolve) {
2289
2691
  const colorRawJSON = t.type === 'dark' ? darkRawJSON : lightRawJSON;
2290
- const root = extend$2(true, {}, baseRawJSON, colorRawJSON); // avoid merging known array objects as it could cause issues if they are of different types (pyramid vs class) or length
2692
+ const root = extend$1(true, {}, baseRawJSON, colorRawJSON); // avoid merging known array objects as it could cause issues if they are of different types (pyramid vs class) or length
2291
2693
 
2292
- const rawThemeJSON = extend$2(true, {}, root, {
2694
+ const rawThemeJSON = extend$1(true, {}, root, {
2293
2695
  scales: null,
2294
2696
  palettes: {
2295
2697
  data: null,
@@ -2375,430 +2777,49 @@
2375
2777
  translation: s.translation,
2376
2778
  type: 'row',
2377
2779
  colors: s.colors
2378
- });
2379
- });
2380
- return pals;
2381
- },
2382
-
2383
- dataColors() {
2384
- /** @interface Theme~DataColorSpecials */
2385
- return (
2386
- /** @lends Theme~DataColorSpecials */
2387
- {
2388
- /** @type {string} */
2389
- primary: resolvedTheme.dataColors.primaryColor,
2390
-
2391
- /** @type {string} */
2392
- nil: resolvedTheme.dataColors.nullColor,
2393
-
2394
- /** @type {string} */
2395
- others: resolvedTheme.dataColors.othersColor
2396
- }
2397
- );
2398
- },
2399
-
2400
- uiColor(c) {
2401
- if (c.index < 0 || typeof c.index === 'undefined') {
2402
- return c.color;
2403
- }
2404
-
2405
- if (typeof uiPalette === 'undefined') {
2406
- uiPalette = this.uiPalettes()[0] || false;
2407
- }
2408
-
2409
- if (!uiPalette) {
2410
- return c.color;
2411
- }
2412
-
2413
- if (typeof uiPalette.colors[c.index] === 'undefined') {
2414
- return c.color;
2415
- }
2416
-
2417
- return uiPalette.colors[c.index];
2418
- }
2419
-
2420
- };
2421
- }
2422
-
2423
- function define(constructor, factory, prototype) {
2424
- constructor.prototype = factory.prototype = prototype;
2425
- prototype.constructor = constructor;
2426
- }
2427
-
2428
- function extend$1(parent, definition) {
2429
- var prototype = Object.create(parent.prototype);
2430
- for (var key in definition) prototype[key] = definition[key];
2431
- return prototype;
2432
- }
2433
-
2434
- function Color() {}
2435
-
2436
- var darker = 0.7;
2437
- var brighter = 1 / darker;
2438
-
2439
- var reI = "\\s*([+-]?\\d+)\\s*",
2440
- reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
2441
- reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
2442
- reHex = /^#([0-9a-f]{3,8})$/,
2443
- reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"),
2444
- reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"),
2445
- reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"),
2446
- reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"),
2447
- reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"),
2448
- reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
2449
-
2450
- var named = {
2451
- aliceblue: 0xf0f8ff,
2452
- antiquewhite: 0xfaebd7,
2453
- aqua: 0x00ffff,
2454
- aquamarine: 0x7fffd4,
2455
- azure: 0xf0ffff,
2456
- beige: 0xf5f5dc,
2457
- bisque: 0xffe4c4,
2458
- black: 0x000000,
2459
- blanchedalmond: 0xffebcd,
2460
- blue: 0x0000ff,
2461
- blueviolet: 0x8a2be2,
2462
- brown: 0xa52a2a,
2463
- burlywood: 0xdeb887,
2464
- cadetblue: 0x5f9ea0,
2465
- chartreuse: 0x7fff00,
2466
- chocolate: 0xd2691e,
2467
- coral: 0xff7f50,
2468
- cornflowerblue: 0x6495ed,
2469
- cornsilk: 0xfff8dc,
2470
- crimson: 0xdc143c,
2471
- cyan: 0x00ffff,
2472
- darkblue: 0x00008b,
2473
- darkcyan: 0x008b8b,
2474
- darkgoldenrod: 0xb8860b,
2475
- darkgray: 0xa9a9a9,
2476
- darkgreen: 0x006400,
2477
- darkgrey: 0xa9a9a9,
2478
- darkkhaki: 0xbdb76b,
2479
- darkmagenta: 0x8b008b,
2480
- darkolivegreen: 0x556b2f,
2481
- darkorange: 0xff8c00,
2482
- darkorchid: 0x9932cc,
2483
- darkred: 0x8b0000,
2484
- darksalmon: 0xe9967a,
2485
- darkseagreen: 0x8fbc8f,
2486
- darkslateblue: 0x483d8b,
2487
- darkslategray: 0x2f4f4f,
2488
- darkslategrey: 0x2f4f4f,
2489
- darkturquoise: 0x00ced1,
2490
- darkviolet: 0x9400d3,
2491
- deeppink: 0xff1493,
2492
- deepskyblue: 0x00bfff,
2493
- dimgray: 0x696969,
2494
- dimgrey: 0x696969,
2495
- dodgerblue: 0x1e90ff,
2496
- firebrick: 0xb22222,
2497
- floralwhite: 0xfffaf0,
2498
- forestgreen: 0x228b22,
2499
- fuchsia: 0xff00ff,
2500
- gainsboro: 0xdcdcdc,
2501
- ghostwhite: 0xf8f8ff,
2502
- gold: 0xffd700,
2503
- goldenrod: 0xdaa520,
2504
- gray: 0x808080,
2505
- green: 0x008000,
2506
- greenyellow: 0xadff2f,
2507
- grey: 0x808080,
2508
- honeydew: 0xf0fff0,
2509
- hotpink: 0xff69b4,
2510
- indianred: 0xcd5c5c,
2511
- indigo: 0x4b0082,
2512
- ivory: 0xfffff0,
2513
- khaki: 0xf0e68c,
2514
- lavender: 0xe6e6fa,
2515
- lavenderblush: 0xfff0f5,
2516
- lawngreen: 0x7cfc00,
2517
- lemonchiffon: 0xfffacd,
2518
- lightblue: 0xadd8e6,
2519
- lightcoral: 0xf08080,
2520
- lightcyan: 0xe0ffff,
2521
- lightgoldenrodyellow: 0xfafad2,
2522
- lightgray: 0xd3d3d3,
2523
- lightgreen: 0x90ee90,
2524
- lightgrey: 0xd3d3d3,
2525
- lightpink: 0xffb6c1,
2526
- lightsalmon: 0xffa07a,
2527
- lightseagreen: 0x20b2aa,
2528
- lightskyblue: 0x87cefa,
2529
- lightslategray: 0x778899,
2530
- lightslategrey: 0x778899,
2531
- lightsteelblue: 0xb0c4de,
2532
- lightyellow: 0xffffe0,
2533
- lime: 0x00ff00,
2534
- limegreen: 0x32cd32,
2535
- linen: 0xfaf0e6,
2536
- magenta: 0xff00ff,
2537
- maroon: 0x800000,
2538
- mediumaquamarine: 0x66cdaa,
2539
- mediumblue: 0x0000cd,
2540
- mediumorchid: 0xba55d3,
2541
- mediumpurple: 0x9370db,
2542
- mediumseagreen: 0x3cb371,
2543
- mediumslateblue: 0x7b68ee,
2544
- mediumspringgreen: 0x00fa9a,
2545
- mediumturquoise: 0x48d1cc,
2546
- mediumvioletred: 0xc71585,
2547
- midnightblue: 0x191970,
2548
- mintcream: 0xf5fffa,
2549
- mistyrose: 0xffe4e1,
2550
- moccasin: 0xffe4b5,
2551
- navajowhite: 0xffdead,
2552
- navy: 0x000080,
2553
- oldlace: 0xfdf5e6,
2554
- olive: 0x808000,
2555
- olivedrab: 0x6b8e23,
2556
- orange: 0xffa500,
2557
- orangered: 0xff4500,
2558
- orchid: 0xda70d6,
2559
- palegoldenrod: 0xeee8aa,
2560
- palegreen: 0x98fb98,
2561
- paleturquoise: 0xafeeee,
2562
- palevioletred: 0xdb7093,
2563
- papayawhip: 0xffefd5,
2564
- peachpuff: 0xffdab9,
2565
- peru: 0xcd853f,
2566
- pink: 0xffc0cb,
2567
- plum: 0xdda0dd,
2568
- powderblue: 0xb0e0e6,
2569
- purple: 0x800080,
2570
- rebeccapurple: 0x663399,
2571
- red: 0xff0000,
2572
- rosybrown: 0xbc8f8f,
2573
- royalblue: 0x4169e1,
2574
- saddlebrown: 0x8b4513,
2575
- salmon: 0xfa8072,
2576
- sandybrown: 0xf4a460,
2577
- seagreen: 0x2e8b57,
2578
- seashell: 0xfff5ee,
2579
- sienna: 0xa0522d,
2580
- silver: 0xc0c0c0,
2581
- skyblue: 0x87ceeb,
2582
- slateblue: 0x6a5acd,
2583
- slategray: 0x708090,
2584
- slategrey: 0x708090,
2585
- snow: 0xfffafa,
2586
- springgreen: 0x00ff7f,
2587
- steelblue: 0x4682b4,
2588
- tan: 0xd2b48c,
2589
- teal: 0x008080,
2590
- thistle: 0xd8bfd8,
2591
- tomato: 0xff6347,
2592
- turquoise: 0x40e0d0,
2593
- violet: 0xee82ee,
2594
- wheat: 0xf5deb3,
2595
- white: 0xffffff,
2596
- whitesmoke: 0xf5f5f5,
2597
- yellow: 0xffff00,
2598
- yellowgreen: 0x9acd32
2599
- };
2600
-
2601
- define(Color, color$1, {
2602
- copy: function(channels) {
2603
- return Object.assign(new this.constructor, this, channels);
2604
- },
2605
- displayable: function() {
2606
- return this.rgb().displayable();
2607
- },
2608
- hex: color_formatHex, // Deprecated! Use color.formatHex.
2609
- formatHex: color_formatHex,
2610
- formatHsl: color_formatHsl,
2611
- formatRgb: color_formatRgb,
2612
- toString: color_formatRgb
2613
- });
2614
-
2615
- function color_formatHex() {
2616
- return this.rgb().formatHex();
2617
- }
2618
-
2619
- function color_formatHsl() {
2620
- return hslConvert(this).formatHsl();
2621
- }
2622
-
2623
- function color_formatRgb() {
2624
- return this.rgb().formatRgb();
2625
- }
2626
-
2627
- function color$1(format) {
2628
- var m, l;
2629
- format = (format + "").trim().toLowerCase();
2630
- return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
2631
- : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
2632
- : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
2633
- : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
2634
- : null) // invalid hex
2635
- : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
2636
- : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
2637
- : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
2638
- : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
2639
- : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
2640
- : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
2641
- : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
2642
- : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
2643
- : null;
2644
- }
2645
-
2646
- function rgbn(n) {
2647
- return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
2648
- }
2649
-
2650
- function rgba(r, g, b, a) {
2651
- if (a <= 0) r = g = b = NaN;
2652
- return new Rgb(r, g, b, a);
2653
- }
2654
-
2655
- function rgbConvert(o) {
2656
- if (!(o instanceof Color)) o = color$1(o);
2657
- if (!o) return new Rgb;
2658
- o = o.rgb();
2659
- return new Rgb(o.r, o.g, o.b, o.opacity);
2660
- }
2661
-
2662
- function rgb(r, g, b, opacity) {
2663
- return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
2664
- }
2665
-
2666
- function Rgb(r, g, b, opacity) {
2667
- this.r = +r;
2668
- this.g = +g;
2669
- this.b = +b;
2670
- this.opacity = +opacity;
2671
- }
2672
-
2673
- define(Rgb, rgb, extend$1(Color, {
2674
- brighter: function(k) {
2675
- k = k == null ? brighter : Math.pow(brighter, k);
2676
- return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
2677
- },
2678
- darker: function(k) {
2679
- k = k == null ? darker : Math.pow(darker, k);
2680
- return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
2681
- },
2682
- rgb: function() {
2683
- return this;
2684
- },
2685
- displayable: function() {
2686
- return (-0.5 <= this.r && this.r < 255.5)
2687
- && (-0.5 <= this.g && this.g < 255.5)
2688
- && (-0.5 <= this.b && this.b < 255.5)
2689
- && (0 <= this.opacity && this.opacity <= 1);
2690
- },
2691
- hex: rgb_formatHex, // Deprecated! Use color.formatHex.
2692
- formatHex: rgb_formatHex,
2693
- formatRgb: rgb_formatRgb,
2694
- toString: rgb_formatRgb
2695
- }));
2780
+ });
2781
+ });
2782
+ return pals;
2783
+ },
2696
2784
 
2697
- function rgb_formatHex() {
2698
- return "#" + hex(this.r) + hex(this.g) + hex(this.b);
2699
- }
2785
+ dataColors() {
2786
+ /** @interface Theme~DataColorSpecials */
2787
+ return (
2788
+ /** @lends Theme~DataColorSpecials */
2789
+ {
2790
+ /** @type {string} */
2791
+ primary: resolvedTheme.dataColors.primaryColor,
2700
2792
 
2701
- function rgb_formatRgb() {
2702
- var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
2703
- return (a === 1 ? "rgb(" : "rgba(")
2704
- + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", "
2705
- + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", "
2706
- + Math.max(0, Math.min(255, Math.round(this.b) || 0))
2707
- + (a === 1 ? ")" : ", " + a + ")");
2708
- }
2793
+ /** @type {string} */
2794
+ nil: resolvedTheme.dataColors.nullColor,
2709
2795
 
2710
- function hex(value) {
2711
- value = Math.max(0, Math.min(255, Math.round(value) || 0));
2712
- return (value < 16 ? "0" : "") + value.toString(16);
2713
- }
2796
+ /** @type {string} */
2797
+ others: resolvedTheme.dataColors.othersColor
2798
+ }
2799
+ );
2800
+ },
2714
2801
 
2715
- function hsla(h, s, l, a) {
2716
- if (a <= 0) h = s = l = NaN;
2717
- else if (l <= 0 || l >= 1) h = s = NaN;
2718
- else if (s <= 0) h = NaN;
2719
- return new Hsl(h, s, l, a);
2720
- }
2802
+ uiColor(c) {
2803
+ if (c.index < 0 || typeof c.index === 'undefined') {
2804
+ return c.color;
2805
+ }
2721
2806
 
2722
- function hslConvert(o) {
2723
- if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
2724
- if (!(o instanceof Color)) o = color$1(o);
2725
- if (!o) return new Hsl;
2726
- if (o instanceof Hsl) return o;
2727
- o = o.rgb();
2728
- var r = o.r / 255,
2729
- g = o.g / 255,
2730
- b = o.b / 255,
2731
- min = Math.min(r, g, b),
2732
- max = Math.max(r, g, b),
2733
- h = NaN,
2734
- s = max - min,
2735
- l = (max + min) / 2;
2736
- if (s) {
2737
- if (r === max) h = (g - b) / s + (g < b) * 6;
2738
- else if (g === max) h = (b - r) / s + 2;
2739
- else h = (r - g) / s + 4;
2740
- s /= l < 0.5 ? max + min : 2 - max - min;
2741
- h *= 60;
2742
- } else {
2743
- s = l > 0 && l < 1 ? 0 : h;
2744
- }
2745
- return new Hsl(h, s, l, o.opacity);
2746
- }
2807
+ if (typeof uiPalette === 'undefined') {
2808
+ uiPalette = this.uiPalettes()[0] || false;
2809
+ }
2747
2810
 
2748
- function hsl(h, s, l, opacity) {
2749
- return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
2750
- }
2811
+ if (!uiPalette) {
2812
+ return c.color;
2813
+ }
2751
2814
 
2752
- function Hsl(h, s, l, opacity) {
2753
- this.h = +h;
2754
- this.s = +s;
2755
- this.l = +l;
2756
- this.opacity = +opacity;
2757
- }
2815
+ if (typeof uiPalette.colors[c.index] === 'undefined') {
2816
+ return c.color;
2817
+ }
2758
2818
 
2759
- define(Hsl, hsl, extend$1(Color, {
2760
- brighter: function(k) {
2761
- k = k == null ? brighter : Math.pow(brighter, k);
2762
- return new Hsl(this.h, this.s, this.l * k, this.opacity);
2763
- },
2764
- darker: function(k) {
2765
- k = k == null ? darker : Math.pow(darker, k);
2766
- return new Hsl(this.h, this.s, this.l * k, this.opacity);
2767
- },
2768
- rgb: function() {
2769
- var h = this.h % 360 + (this.h < 0) * 360,
2770
- s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
2771
- l = this.l,
2772
- m2 = l + (l < 0.5 ? l : 1 - l) * s,
2773
- m1 = 2 * l - m2;
2774
- return new Rgb(
2775
- hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
2776
- hsl2rgb(h, m1, m2),
2777
- hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
2778
- this.opacity
2779
- );
2780
- },
2781
- displayable: function() {
2782
- return (0 <= this.s && this.s <= 1 || isNaN(this.s))
2783
- && (0 <= this.l && this.l <= 1)
2784
- && (0 <= this.opacity && this.opacity <= 1);
2785
- },
2786
- formatHsl: function() {
2787
- var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
2788
- return (a === 1 ? "hsl(" : "hsla(")
2789
- + (this.h || 0) + ", "
2790
- + (this.s || 0) * 100 + "%, "
2791
- + (this.l || 0) * 100 + "%"
2792
- + (a === 1 ? ")" : ", " + a + ")");
2793
- }
2794
- }));
2819
+ return uiPalette.colors[c.index];
2820
+ }
2795
2821
 
2796
- /* From FvD 13.37, CSS Color Module Level 3 */
2797
- function hsl2rgb(h, m1, m2) {
2798
- return (h < 60 ? m1 + (m2 - m1) * h / 60
2799
- : h < 180 ? m2
2800
- : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
2801
- : m1) * 255;
2822
+ };
2802
2823
  }
2803
2824
 
2804
2825
  /**
@@ -2839,7 +2860,7 @@
2839
2860
  this.startLevel = 0;
2840
2861
  this.max = 1;
2841
2862
  this.min = 0;
2842
- this.nanColor = color$1(nanColor);
2863
+ this.nanColor = color$3(nanColor);
2843
2864
  }
2844
2865
  /**
2845
2866
  * Adds a part to this color scale. The input colors span one part of the gradient, colors between them are interpolated. Input two equal colors for a solid scale part.
@@ -2859,7 +2880,7 @@
2859
2880
  this.colorParts[level] = [];
2860
2881
  }
2861
2882
 
2862
- this.colorParts[level].push([color$1(color1), color$1(color2)]);
2883
+ this.colorParts[level].push([color$3(color1), color$3(color2)]);
2863
2884
  }
2864
2885
  /**
2865
2886
  * Gets the color which represents the input value
@@ -2965,7 +2986,7 @@
2965
2986
  }
2966
2987
  }
2967
2988
 
2968
- level.push(color$1(c).formatHex());
2989
+ level.push(color$3(c).formatHex());
2969
2990
  }
2970
2991
 
2971
2992
  return level;
@@ -3155,7 +3176,7 @@
3155
3176
 
3156
3177
  styleResolver.resolveRawTheme = raw => {
3157
3178
  // TODO - validate format
3158
- const c = extend$2(true, {}, raw);
3179
+ const c = extend$1(true, {}, raw);
3159
3180
  resolveVariables(c, c._variables); // eslint-disable-line
3160
3181
  // generate class-pyramid
3161
3182
 
@@ -3167,7 +3188,7 @@
3167
3188
  };
3168
3189
 
3169
3190
  function luminance(colStr) {
3170
- const c = color$1(colStr).rgb();
3191
+ const c = color$3(colStr).rgb();
3171
3192
  const {
3172
3193
  r,
3173
3194
  g,
@@ -3308,6 +3329,23 @@
3308
3329
  }
3309
3330
 
3310
3331
  return styleResolverInstanceCache[basePath].getStyle(path, attribute);
3332
+ },
3333
+
3334
+ /**
3335
+ * Validates a color string using d3-color.
3336
+ * See https://www.npmjs.com/package/d3-color
3337
+ * @param {string} specifier
3338
+ * @returns {string|undefined} The resolved color or undefined
3339
+ * @ignore
3340
+ *
3341
+ * @example
3342
+ * theme.validateColor("red"); // returns "rgba(255,0,0,1)"
3343
+ * theme.validateColor("#00ff00"); // returns "rgba(0,255,0,1)"
3344
+ * theme.validateColor("FOO"); // returns undefined
3345
+ */
3346
+ validateColor() {
3347
+ const c = color$3(...arguments);
3348
+ return c ? c.toString() : undefined;
3311
3349
  }
3312
3350
 
3313
3351
  };
@@ -12781,7 +12819,7 @@
12781
12819
  return cache[key];
12782
12820
  }
12783
12821
 
12784
- const NEBULA_VERSION_HASH = "85ad" ;
12822
+ const NEBULA_VERSION_HASH = "1c8e" ;
12785
12823
  ClassNameGenerator$1.configure(componentName => {
12786
12824
 
12787
12825
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
@@ -13354,7 +13392,7 @@
13354
13392
  const appRef = React.createRef();
13355
13393
  const element = document.createElement('div');
13356
13394
  element.style.display = 'none';
13357
- element.setAttribute('data-nebulajs-version', "3.0.4" );
13395
+ element.setAttribute('data-nebulajs-version', "3.1.0-alpha.0" );
13358
13396
  element.setAttribute('data-app-id', app.id);
13359
13397
  document.body.appendChild(element);
13360
13398
  ReactDOM.render( /*#__PURE__*/React.createElement(NebulaApp, {
@@ -19990,7 +20028,7 @@
19990
20028
  } = _ref2;
19991
20029
 
19992
20030
  const focusInsideListbox = element => {
19993
- const fieldElement = element.querySelector('.search input, .value.selector, .value');
20031
+ const fieldElement = element.querySelector('.search input, .value.selector, .value, .ActionsToolbar-* button');
19994
20032
  setKeyboardActive(true);
19995
20033
 
19996
20034
  if (fieldElement) {
@@ -20147,11 +20185,11 @@
20147
20185
  width: '100%',
20148
20186
  height: '100%',
20149
20187
  // The checkbox's span
20150
- '& > span:nth-child(1)': {
20188
+ '& > span:nth-of-type(1)': {
20151
20189
  paddingRight: '8px'
20152
20190
  },
20153
20191
  // The checkbox's label container.
20154
- '& > span:nth-child(2)': _objectSpread2(_objectSpread2({}, ellipsis), {}, {
20192
+ '& > span:nth-of-type(2)': _objectSpread2(_objectSpread2({}, ellipsis), {}, {
20155
20193
  display: 'flex',
20156
20194
  alignItems: 'center',
20157
20195
  paddingLeft: 0
@@ -20544,7 +20582,6 @@
20544
20582
  keyboard = {},
20545
20583
  showGray = true,
20546
20584
  scrollState,
20547
- sortByState,
20548
20585
  selectDisabled = () => false,
20549
20586
  setCount
20550
20587
  } = _ref2;
@@ -20635,9 +20672,9 @@
20635
20672
  local.current.validPages = false;
20636
20673
 
20637
20674
  if (loaderRef.current) {
20638
- loaderRef.current.resetloadMoreItemsCache(true); // Skip scrollToItem if we are in selections, or if we dont sort by state.
20675
+ loaderRef.current.resetloadMoreItemsCache(true); // Skip scrollToItem if we are in selections.
20639
20676
 
20640
- if (layout && layout.qSelectionInfo.qInSelections || sortByState === 0) {
20677
+ if (layout && layout.qSelectionInfo.qInSelections) {
20641
20678
  return;
20642
20679
  }
20643
20680
 
@@ -20888,6 +20925,7 @@
20888
20925
  };
20889
20926
  const Item = React.forwardRef((_ref, ref) => {
20890
20927
  let {
20928
+ ariaExpanded = false,
20891
20929
  item,
20892
20930
  addAnchor = false
20893
20931
  } = _ref;
@@ -20908,7 +20946,9 @@
20908
20946
  disabled: disabled,
20909
20947
  style: style,
20910
20948
  className: ActionElement.className,
20911
- size: "large"
20949
+ size: "large",
20950
+ "aria-expanded": ariaExpanded,
20951
+ "aria-controls": "moreMenuList"
20912
20952
  }, hasSvgIconShape && SvgIcon(item.getSvgIconShape()), addAnchor && /*#__PURE__*/React.createElement("div", {
20913
20953
  ref: ref,
20914
20954
  style: {
@@ -21025,7 +21065,8 @@
21025
21065
  return !hidden ? /*#__PURE__*/React.createElement(MenuItem$1, {
21026
21066
  title: item.label,
21027
21067
  onClick: handleClick,
21028
- disabled: disabled
21068
+ disabled: disabled,
21069
+ tabindex: "0"
21029
21070
  }, hasSvgIconShape && /*#__PURE__*/React.createElement(ListItemIcon$1, {
21030
21071
  className: classes$8.icon
21031
21072
  }, SvgIcon(item.getSvgIconShape())), /*#__PURE__*/React.createElement(Typography$1, {
@@ -21071,7 +21112,9 @@
21071
21112
  maxWidth: '250px'
21072
21113
  }, popoverPaperStyle)
21073
21114
  }
21074
- }), /*#__PURE__*/React.createElement(MenuList$1, null, actions.map((item, ix) =>
21115
+ }), /*#__PURE__*/React.createElement(MenuList$1, {
21116
+ id: "moreMenuList"
21117
+ }, actions.map((item, ix) =>
21075
21118
  /*#__PURE__*/
21076
21119
  // eslint-disable-next-line react/no-array-index-key
21077
21120
  React.createElement(MoreItem, {
@@ -21115,6 +21158,7 @@
21115
21158
  };
21116
21159
  const ActionsGroup = React.forwardRef((_ref2, ref) => {
21117
21160
  let {
21161
+ ariaExpanded = false,
21118
21162
  actions = [],
21119
21163
  first = false,
21120
21164
  last = false,
@@ -21147,6 +21191,7 @@
21147
21191
  key: e.key,
21148
21192
  className: cls.join(' ').trim()
21149
21193
  }, /*#__PURE__*/React.createElement(Item, {
21194
+ ariaExpanded: ariaExpanded,
21150
21195
  key: e.key,
21151
21196
  item: e,
21152
21197
  ref: ix === 0 ? ref : null,
@@ -21285,6 +21330,7 @@
21285
21330
  last: !showMore && !selections.show
21286
21331
  }), showMore && /*#__PURE__*/React.createElement(ActionsGroup, {
21287
21332
  ref: moreRef,
21333
+ ariaExpanded: showMoreItems,
21288
21334
  actions: [moreItem],
21289
21335
  first: !showActions,
21290
21336
  last: !selections.show,
@@ -23110,146 +23156,59 @@
23110
23156
 
23111
23157
  const PREFIX$4 = 'ListBoxInline';
23112
23158
  const classes$4 = {
23113
- listBoxHeader: "".concat(PREFIX$4, "-listBoxHeader")
23159
+ listBoxHeader: "".concat(PREFIX$4, "-listBoxHeader"),
23160
+ screenReaderOnly: "".concat(PREFIX$4, "-screenReaderOnly")
23114
23161
  };
23115
23162
  const StyledGrid$3 = styled$1(Grid$1)(() => ({
23116
23163
  ["& .".concat(classes$4.listBoxHeader)]: {
23117
23164
  alignSelf: 'center',
23118
23165
  display: 'inline-flex'
23166
+ },
23167
+ ["& .".concat(classes$4.screenReaderOnly)]: {
23168
+ position: 'absolute',
23169
+ height: 0,
23170
+ width: 0,
23171
+ overflow: 'hidden'
23119
23172
  }
23120
- }));
23121
- function ListBoxInline(_ref) {
23122
- let {
23123
- app,
23124
- fieldIdentifier,
23125
- stateName = '$',
23126
- options = {},
23127
- fieldDef
23128
- } = _ref;
23129
- const {
23130
- title,
23131
- direction,
23132
- listLayout,
23133
- search = true,
23134
- focusSearch = false,
23135
- toolbar = true,
23136
- rangeSelect = true,
23137
- checkboxes = false,
23138
- properties = {},
23139
- sessionModel = undefined,
23140
- selectionsApi = undefined,
23141
- update = undefined,
23142
- fetchStart = undefined,
23143
- dense = false,
23144
- selectDisabled = () => false,
23145
- postProcessPages = undefined,
23146
- calculatePagesHeight,
23147
- showGray = true,
23148
- scrollState = undefined,
23149
- setCount = undefined,
23150
- shouldConfirmOnBlur = undefined
23151
- } = options;
23152
- let {
23153
- frequencyMode,
23154
- histogram = false
23155
- } = options;
23156
-
23157
- if (fieldDef && fieldDef.failedToFetchFieldDef) {
23158
- histogram = false;
23159
- frequencyMode = 'N';
23160
- }
23161
-
23162
- switch (true) {
23163
- case ['none', 'N', 'NX_FREQUENCY_NONE'].includes(frequencyMode):
23164
- frequencyMode = 'N';
23165
- break;
23166
-
23167
- case ['value', 'V', 'NX_FREQUENCY_VALUE', 'default'].includes(frequencyMode):
23168
- frequencyMode = 'V';
23169
- break;
23170
-
23171
- case ['percent', 'P', 'NX_FREQUENCY_PERCENT'].includes(frequencyMode):
23172
- frequencyMode = 'P';
23173
- break;
23174
-
23175
- case ['relative', 'R', 'NX_FREQUENCY_RELATIVE'].includes(frequencyMode):
23176
- frequencyMode = 'R';
23177
- break;
23178
-
23179
- default:
23180
- frequencyMode = 'N';
23181
- break;
23182
- }
23183
-
23184
- const getListdefFrequencyMode = () => histogram && frequencyMode === 'N' ? 'V' : frequencyMode; // Hook that will trigger update when used in useEffects.
23185
- // Modified from: https://medium.com/@teh_builder/ref-objects-inside-useeffect-hooks-eb7c15198780
23186
-
23187
-
23188
- const useRefWithCallback = () => {
23189
- const [ref, setInternalRef] = react.exports.useState({});
23190
- const setRef = react.exports.useCallback(node => {
23191
- setInternalRef({
23192
- current: node
23193
- });
23194
- }, [setInternalRef]);
23195
- return [ref, setRef];
23196
- };
23197
-
23198
- const listdef = {
23199
- qInfo: {
23200
- qType: 'njsListbox'
23201
- },
23202
- qListObjectDef: {
23203
- qStateName: stateName,
23204
- qShowAlternatives: true,
23205
- qFrequencyMode: getListdefFrequencyMode(),
23206
- qInitialDataFetch: [{
23207
- qTop: 0,
23208
- qLeft: 0,
23209
- qWidth: 0,
23210
- qHeight: 0
23211
- }],
23212
- qDef: {
23213
- qSortCriterias: [{
23214
- qSortByState: 1,
23215
- qSortByAscii: 1,
23216
- qSortByNumeric: 1,
23217
- qSortByLoadOrder: 1
23218
- }]
23219
- }
23220
- },
23221
- title
23222
- };
23223
- extend$2(true, listdef, properties); // Something something lib dimension
23224
-
23225
- let fieldName;
23226
-
23227
- if (fieldIdentifier.qLibraryId) {
23228
- listdef.qListObjectDef.qLibraryId = fieldIdentifier.qLibraryId;
23229
- fieldName = fieldIdentifier.qLibraryId;
23230
- } else {
23231
- listdef.qListObjectDef.qDef.qFieldDefs = [fieldIdentifier];
23232
- fieldName = fieldIdentifier;
23233
- }
23234
-
23235
- if (frequencyMode !== 'N' || histogram) {
23236
- const field = fieldIdentifier.qLibraryId ? fieldDef : fieldName;
23237
- listdef.frequencyMax = {
23238
- qValueExpression: "Max(AGGR(Count([".concat(field, "]), [").concat(field, "]))")
23239
- };
23240
- }
23241
-
23242
- let [model] = useSessionModel(listdef, sessionModel ? null : app, fieldName, stateName);
23243
-
23244
- if (sessionModel) {
23245
- model = sessionModel;
23246
- }
23247
-
23248
- let selections = useObjectSelections(selectionsApi ? {} : app, model)[0];
23173
+ }));
23174
+ function ListBoxInline(_ref) {
23175
+ let {
23176
+ options = {}
23177
+ } = _ref;
23178
+ const {
23179
+ direction,
23180
+ frequencyMode,
23181
+ histogram = false,
23182
+ listLayout,
23183
+ search = true,
23184
+ focusSearch = false,
23185
+ toolbar = true,
23186
+ rangeSelect = true,
23187
+ checkboxes = false,
23188
+ model,
23189
+ selections,
23190
+ update = undefined,
23191
+ fetchStart = undefined,
23192
+ dense = false,
23193
+ selectDisabled = () => false,
23194
+ postProcessPages = undefined,
23195
+ calculatePagesHeight,
23196
+ showGray = true,
23197
+ scrollState = undefined,
23198
+ setCount = undefined,
23199
+ shouldConfirmOnBlur = undefined
23200
+ } = options; // Hook that will trigger update when used in useEffects.
23201
+ // Modified from: https://medium.com/@teh_builder/ref-objects-inside-useeffect-hooks-eb7c15198780
23249
23202
 
23250
- if (selectionsApi) {
23251
- selections = selectionsApi;
23252
- }
23203
+ const useRefWithCallback = () => {
23204
+ const [ref, setInternalRef] = react.exports.useState({});
23205
+ const setRef = react.exports.useCallback(node => {
23206
+ setInternalRef({
23207
+ current: node
23208
+ });
23209
+ }, [setInternalRef]);
23210
+ return [ref, setRef];
23211
+ };
23253
23212
 
23254
23213
  const theme = useTheme$1();
23255
23214
  const lock = react.exports.useCallback(() => {
@@ -23300,7 +23259,7 @@
23300
23259
  }
23301
23260
 
23302
23261
  return () => {
23303
- if (selections) {
23262
+ if (selections && selections.removeListener) {
23304
23263
  selections.removeListener('deactivated', show);
23305
23264
  selections.removeListener('activated', hide);
23306
23265
  }
@@ -23362,7 +23321,8 @@
23362
23321
  gap: 0,
23363
23322
  style: {
23364
23323
  height: '100%',
23365
- minHeight: "".concat(minHeight, "px")
23324
+ minHeight: "".concat(minHeight, "px"),
23325
+ flexFlow: 'column nowrap'
23366
23326
  },
23367
23327
  onKeyDown: handleKeyDown,
23368
23328
  ref: listBoxRef
@@ -23412,9 +23372,21 @@
23412
23372
  onCancel: () => {}
23413
23373
  }
23414
23374
  }))), /*#__PURE__*/React.createElement(Grid$1, {
23375
+ item: true,
23376
+ container: true,
23377
+ direction: "column",
23378
+ style: {
23379
+ height: '100%',
23380
+ minHeight: "".concat(minHeight, "px")
23381
+ },
23382
+ role: "region",
23383
+ "aria-label": translator.get('Listbox.ResultFilterLabel')
23384
+ }, /*#__PURE__*/React.createElement(Grid$1, {
23415
23385
  item: true,
23416
23386
  ref: searchContainerRef
23417
- }, /*#__PURE__*/React.createElement(ListBoxSearch, {
23387
+ }, /*#__PURE__*/React.createElement("div", {
23388
+ className: classes$4.screenReaderOnly
23389
+ }, translator.get('Listbox.Search.ScreenReaderInstructions')), /*#__PURE__*/React.createElement(ListBoxSearch, {
23418
23390
  selections: selections,
23419
23391
  model: model,
23420
23392
  dense: dense,
@@ -23426,7 +23398,9 @@
23426
23398
  xs: true
23427
23399
  }, /*#__PURE__*/React.createElement("div", {
23428
23400
  ref: moreAlignTo
23429
- }), /*#__PURE__*/React.createElement(AutoSizer, null, _ref2 => {
23401
+ }), /*#__PURE__*/React.createElement("div", {
23402
+ className: classes$4.screenReaderOnly
23403
+ }, translator.get('Listbox.ScreenReaderInstructions')), /*#__PURE__*/React.createElement(AutoSizer, null, _ref2 => {
23430
23404
  let {
23431
23405
  height,
23432
23406
  width
@@ -23451,32 +23425,63 @@
23451
23425
  keyboard: keyboard,
23452
23426
  showGray: showGray,
23453
23427
  scrollState: scrollState,
23454
- sortByState: listdef.qListObjectDef.qDef.qSortCriterias[0].qSortByState,
23455
23428
  setCount: setCount
23456
23429
  });
23457
- })));
23430
+ }))));
23431
+ }
23432
+
23433
+ function useExistingModel(_ref) {
23434
+ let {
23435
+ app,
23436
+ qId,
23437
+ options = {}
23438
+ } = _ref;
23439
+ const [model, setModel] = react.exports.useState();
23440
+ const [modelStore] = useModelStore();
23441
+ const {
23442
+ sessionModel
23443
+ } = options;
23444
+ react.exports.useEffect(() => {
23445
+ async function fetchObject() {
23446
+ const modelFromStore = modelStore.get(qId);
23447
+
23448
+ if (modelFromStore) {
23449
+ setModel(modelFromStore);
23450
+ } else {
23451
+ const m = await app.getObject(qId);
23452
+ modelStore.set(m.id, m);
23453
+ setModel(m);
23454
+ }
23455
+ }
23456
+
23457
+ if (sessionModel) {
23458
+ setModel(sessionModel);
23459
+ } else {
23460
+ fetchObject();
23461
+ }
23462
+ }, []);
23463
+ return model;
23458
23464
  }
23459
23465
 
23460
- function ListBoxFetchMasterItem(_ref) {
23466
+ function useOnTheFlyModel(_ref) {
23461
23467
  let {
23462
23468
  app,
23463
23469
  fieldIdentifier,
23464
- stateName = '$',
23470
+ stateName,
23465
23471
  options = {}
23466
23472
  } = _ref;
23467
23473
  const [fieldDef, setFieldDef] = react.exports.useState('');
23468
- const [isFetchingData, setIsFetchingData] = react.exports.useState(false);
23474
+ const [isFetching, setIsFetching] = react.exports.useState(true);
23475
+ const [model, setModel] = react.exports.useState();
23469
23476
  react.exports.useEffect(() => {
23470
- async function fetchData() {
23471
- setIsFetchingData(true);
23472
-
23477
+ async function fetchMasterItem() {
23473
23478
  try {
23474
23479
  const dim = await app.getDimension(fieldIdentifier.qLibraryId);
23475
23480
  const dimLayout = await dim.getLayout();
23476
23481
  setFieldDef(dimLayout.qDim.qFieldDefs ? dimLayout.qDim.qFieldDefs[0] : '');
23477
- setIsFetchingData(false);
23482
+ setIsFetching(false);
23478
23483
  } catch (e) {
23479
- setIsFetchingData(false);
23484
+ setIsFetching(false);
23480
23485
  setFieldDef({
23481
23486
  failedToFetchFieldDef: true
23482
23487
  });
@@ -23484,36 +23489,193 @@
23484
23489
  }
23485
23490
  }
23486
23491
 
23487
- fetchData();
23492
+ const isFrequencyMaxNeeded = options.histogram || options.frequencyMode !== 'N';
23493
+ const shouldFetchMasterItem = fieldIdentifier.qLibraryId && isFrequencyMaxNeeded;
23494
+
23495
+ if (shouldFetchMasterItem) {
23496
+ fetchMasterItem();
23497
+ } else {
23498
+ setIsFetching(false);
23499
+ }
23488
23500
  }, []);
23501
+ const {
23502
+ title,
23503
+ properties = {}
23504
+ } = options;
23505
+ let {
23506
+ frequencyMode,
23507
+ histogram = false
23508
+ } = options;
23489
23509
 
23490
- if (isFetchingData) {
23491
- return null;
23510
+ if (fieldDef && fieldDef.failedToFetchFieldDef) {
23511
+ histogram = false;
23512
+ frequencyMode = 'N';
23492
23513
  }
23493
23514
 
23494
- return /*#__PURE__*/React.createElement(ListBoxInline, {
23495
- app: app,
23496
- fieldIdentifier: fieldIdentifier,
23497
- stateName: stateName,
23498
- options: options,
23499
- fieldDef: fieldDef
23500
- });
23515
+ switch (true) {
23516
+ case ['none', 'N', 'NX_FREQUENCY_NONE'].includes(frequencyMode):
23517
+ frequencyMode = 'N';
23518
+ break;
23519
+
23520
+ case ['value', 'V', 'NX_FREQUENCY_VALUE', 'default'].includes(frequencyMode):
23521
+ frequencyMode = 'V';
23522
+ break;
23523
+
23524
+ case ['percent', 'P', 'NX_FREQUENCY_PERCENT'].includes(frequencyMode):
23525
+ frequencyMode = 'P';
23526
+ break;
23527
+
23528
+ case ['relative', 'R', 'NX_FREQUENCY_RELATIVE'].includes(frequencyMode):
23529
+ frequencyMode = 'R';
23530
+ break;
23531
+
23532
+ default:
23533
+ frequencyMode = 'N';
23534
+ break;
23535
+ }
23536
+
23537
+ const getListdefFrequencyMode = () => histogram && frequencyMode === 'N' ? 'V' : frequencyMode;
23538
+
23539
+ const listdef = {
23540
+ qInfo: {
23541
+ qType: 'njsListbox'
23542
+ },
23543
+ qListObjectDef: {
23544
+ qStateName: stateName,
23545
+ qShowAlternatives: true,
23546
+ qFrequencyMode: getListdefFrequencyMode(),
23547
+ qInitialDataFetch: [{
23548
+ qTop: 0,
23549
+ qLeft: 0,
23550
+ qWidth: 0,
23551
+ qHeight: 0
23552
+ }],
23553
+ qDef: {
23554
+ qSortCriterias: [{
23555
+ qSortByState: 1,
23556
+ qSortByAscii: 1,
23557
+ qSortByNumeric: 1,
23558
+ qSortByLoadOrder: 1
23559
+ }]
23560
+ }
23561
+ },
23562
+ title
23563
+ };
23564
+ extend$1(true, listdef, properties); // Something something lib dimension
23565
+
23566
+ let fieldName;
23567
+
23568
+ if (fieldIdentifier.qLibraryId) {
23569
+ listdef.qListObjectDef.qLibraryId = fieldIdentifier.qLibraryId;
23570
+ fieldName = fieldIdentifier.qLibraryId;
23571
+ } else {
23572
+ listdef.qListObjectDef.qDef.qFieldDefs = [fieldIdentifier];
23573
+ fieldName = fieldIdentifier;
23574
+ }
23575
+
23576
+ if (frequencyMode !== 'N' || histogram) {
23577
+ const field = fieldIdentifier.qLibraryId ? fieldDef : fieldName;
23578
+ listdef.frequencyMax = {
23579
+ qValueExpression: "Max(AGGR(Count([".concat(field, "]), [").concat(field, "]))")
23580
+ };
23581
+ }
23582
+
23583
+ const [sessionModel] = useSessionModel(listdef, isFetching ? null : app, fieldName, stateName);
23584
+ react.exports.useEffect(() => {
23585
+ if (!sessionModel) {
23586
+ return;
23587
+ }
23588
+
23589
+ setModel(sessionModel);
23590
+ }, [sessionModel]);
23591
+ return model;
23592
+ }
23593
+
23594
+ const OBJECT_SOURCE = {
23595
+ ON_THE_FLY: 'ON_THE_FLY',
23596
+ EXISTING: 'EXISTING'
23597
+ };
23598
+ const SELECTIONS_API = {
23599
+ INTERNAL: 'INTERNAL',
23600
+ EXTERNAL: 'EXTERNAL'
23601
+ };
23602
+
23603
+ function identify(_ref) {
23604
+ let {
23605
+ qId,
23606
+ options
23607
+ } = _ref;
23608
+ const variant = {}; // Existing or on the fly
23609
+
23610
+ variant.objectSource = qId || options.sessionModel ? OBJECT_SOURCE.EXISTING : OBJECT_SOURCE.ON_THE_FLY; // Use internal or external selectionsApi
23611
+
23612
+ variant.selectionsApi = options.selectionsApi ? SELECTIONS_API.EXTERNAL : SELECTIONS_API.INTERNAL;
23613
+ return variant;
23501
23614
  }
23502
- function ListBoxPortal(_ref2) {
23615
+
23616
+ function ListBoxWrapper(_ref2) {
23503
23617
  let {
23504
23618
  app,
23505
23619
  fieldIdentifier,
23620
+ qId,
23506
23621
  stateName,
23507
- element,
23508
23622
  options
23509
23623
  } = _ref2;
23510
- const isFrequencyMaxNeeded = options.histogram || options.frequencyMode !== 'N';
23511
- const TheComponent = fieldIdentifier.qLibraryId && isFrequencyMaxNeeded ? ListBoxFetchMasterItem : ListBoxInline;
23512
- return ReactDOM.createPortal( /*#__PURE__*/React.createElement(TheComponent, {
23624
+ const {
23625
+ objectSource,
23626
+ selectionsApi
23627
+ } = identify({
23628
+ qId,
23629
+ options
23630
+ });
23631
+ const [changeCount, setChangeCount] = react.exports.useState(0);
23632
+ react.exports.useEffect(() => {
23633
+ if (changeCount) {
23634
+ throw new Error('Source or selection Api can not change after a listbox has been mounted');
23635
+ }
23636
+
23637
+ setChangeCount(changeCount + 1);
23638
+ }, [objectSource, selectionsApi]);
23639
+ const model = objectSource === OBJECT_SOURCE.EXISTING ? useExistingModel({
23640
+ app,
23641
+ qId,
23642
+ options
23643
+ }) : useOnTheFlyModel({
23644
+ app,
23645
+ fieldIdentifier,
23646
+ stateName,
23647
+ options
23648
+ });
23649
+ const selections = selectionsApi === SELECTIONS_API.EXTERNAL ? options.selectionsApi : useObjectSelections(app, model)[0];
23650
+
23651
+ if (!selections || !model) {
23652
+ return null;
23653
+ }
23654
+
23655
+ const opts = _objectSpread2(_objectSpread2({}, options), {}, {
23656
+ selections,
23657
+ model
23658
+ });
23659
+
23660
+ return /*#__PURE__*/React.createElement(ListBoxInline, {
23661
+ options: opts
23662
+ });
23663
+ }
23664
+
23665
+ function ListBoxPortal(_ref3) {
23666
+ let {
23667
+ element,
23668
+ app,
23669
+ fieldIdentifier,
23670
+ qId,
23671
+ stateName = '$',
23672
+ options = {}
23673
+ } = _ref3;
23674
+ return ReactDOM.createPortal( /*#__PURE__*/React.createElement(ListBoxWrapper, {
23513
23675
  app: app,
23514
23676
  fieldIdentifier: fieldIdentifier,
23677
+ qId: qId,
23515
23678
  stateName: stateName,
23516
- element: element,
23517
23679
  options: options
23518
23680
  }), element);
23519
23681
  }
@@ -23615,12 +23777,15 @@
23615
23777
  hc.qLayoutExclude.qHyperCubeDef.qMeasures = hc.qLayoutExclude.qHyperCubeDef.qMeasures || [];
23616
23778
  hc.qLayoutExclude.qHyperCubeDef.qDimensions.push(dimension);
23617
23779
  }
23780
+
23781
+ return dimension;
23618
23782
  },
23619
23783
 
23620
23784
  removeDimension(idx) {
23621
23785
  const dimension = hc.qDimensions.splice(idx, 1)[0];
23622
23786
  removeIndex(hc.qInterColumnSortOrder, idx);
23623
23787
  def.dimensions.removed(dimension, objectProperties, idx);
23788
+ return dimension;
23624
23789
  },
23625
23790
 
23626
23791
  addMeasure(m) {
@@ -24010,7 +24175,7 @@
24010
24175
  }
24011
24176
 
24012
24177
  function createDefaultDimension(dimensionDef, dimensionProperties) {
24013
- const def = extend$2(true, {}, dimensionProperties, dimensionDef);
24178
+ const def = extend$1(true, {}, dimensionProperties, dimensionDef);
24014
24179
 
24015
24180
  if (!utils.getValue(def, 'qOtherTotalSpec.qOtherCounted')) {
24016
24181
  utils.setValue(def, 'qOtherTotalSpec.qOtherCounted', {
@@ -24032,7 +24197,7 @@
24032
24197
  }
24033
24198
 
24034
24199
  function createDefaultMeasure(measureDef, measureProperties) {
24035
- return extend$2(true, {}, measureProperties, measureDef);
24200
+ return extend$1(true, {}, measureProperties, measureDef);
24036
24201
  }
24037
24202
 
24038
24203
  function resolveValue$1(data, input, defaultValue) {
@@ -24128,7 +24293,7 @@
24128
24293
  Object.keys(exportFormat.properties).forEach(key => {
24129
24294
  if (key === 'qLayoutExclude') {
24130
24295
  if (exportFormat.properties[key].quarantine) {
24131
- newProperties.qLayoutExclude.quarantine = extend$2(true, {}, exportFormat.properties[key].quarantine);
24296
+ newProperties.qLayoutExclude.quarantine = extend$1(true, {}, exportFormat.properties[key].quarantine);
24132
24297
  }
24133
24298
  } else if (key === 'qHyperCubeDef' && hypercubePath) {
24134
24299
  utils.setValue(newProperties, "".concat(hypercubePath, ".qHyperCubeDef"), exportFormat.properties.qHyperCubeDef);
@@ -24139,7 +24304,7 @@
24139
24304
  newProperties.qLayoutExclude.disabled[key] = exportFormat.properties[key];
24140
24305
  }
24141
24306
  });
24142
- newProperties = extend$2(true, {}, initialProperties, newProperties);
24307
+ newProperties = extend$1(true, {}, initialProperties, newProperties);
24143
24308
 
24144
24309
  if (newProperties.components === null) {
24145
24310
  newProperties.components = [];
@@ -25363,6 +25528,115 @@
25363
25528
  }));
25364
25529
  }
25365
25530
 
25531
+ const imageSizingToCssProperty = {
25532
+ originalSize: 'auto auto',
25533
+ alwaysFit: 'contain',
25534
+ fitWidth: '100% auto',
25535
+ fitHeight: 'auto 100%',
25536
+ stretchFit: '100% 100%',
25537
+ alwaysFill: 'cover'
25538
+ };
25539
+ const positionToCss = {
25540
+ 'top-left': 'top left',
25541
+ 'top-center': 'top center',
25542
+ 'top-right': 'top right',
25543
+ 'center-left': 'center left',
25544
+ 'center-center': 'center center',
25545
+ 'center-right': 'center right',
25546
+ 'bottom-left': 'bottom left',
25547
+ 'bottom-center': 'bottom center',
25548
+ 'bottom-right': 'bottom right'
25549
+ }; // TODO: this needs some proper verification
25550
+
25551
+ function getSenseServerUrl(app) {
25552
+ var _app$session;
25553
+
25554
+ let config;
25555
+ let wsUrl;
25556
+ let protocol;
25557
+ let isSecure;
25558
+
25559
+ if (app !== null && app !== void 0 && (_app$session = app.session) !== null && _app$session !== void 0 && _app$session.config) {
25560
+ config = app.session.config;
25561
+ wsUrl = new URL(config.url);
25562
+ isSecure = wsUrl.protocol === 'wss:';
25563
+ protocol = isSecure ? 'https://' : 'http://';
25564
+ return protocol + wsUrl.host;
25565
+ }
25566
+
25567
+ return undefined;
25568
+ }
25569
+
25570
+ function getBackgroundPosition(bgComp) {
25571
+ var _bgComp$bgImage;
25572
+
25573
+ let bkgImagePosition = 'center center';
25574
+
25575
+ if (bgComp !== null && bgComp !== void 0 && (_bgComp$bgImage = bgComp.bgImage) !== null && _bgComp$bgImage !== void 0 && _bgComp$bgImage.position) {
25576
+ bkgImagePosition = positionToCss[bgComp.bgImage.position];
25577
+ }
25578
+
25579
+ return bkgImagePosition;
25580
+ }
25581
+
25582
+ function getBackgroundSize(bgComp) {
25583
+ var _bgComp$bgImage2;
25584
+
25585
+ let bkgImageSize = imageSizingToCssProperty.originalSize;
25586
+
25587
+ if (bgComp !== null && bgComp !== void 0 && (_bgComp$bgImage2 = bgComp.bgImage) !== null && _bgComp$bgImage2 !== void 0 && _bgComp$bgImage2.sizing) {
25588
+ bkgImageSize = imageSizingToCssProperty[bgComp.bgImage.sizing];
25589
+ }
25590
+
25591
+ return bkgImageSize;
25592
+ }
25593
+
25594
+ function resolveImageUrl(app, relativeUrl) {
25595
+ return relativeUrl ? getSenseServerUrl(app) + relativeUrl : undefined;
25596
+ }
25597
+
25598
+ const resolveBgImage = (bgComp, app) => {
25599
+ const bgImageDef = bgComp === null || bgComp === void 0 ? void 0 : bgComp.bgImage;
25600
+
25601
+ if (bgImageDef) {
25602
+ let url = '';
25603
+
25604
+ if (bgImageDef.mode === 'media') {
25605
+ var _bgImageDef$mediaUrl, _bgImageDef$mediaUrl$;
25606
+
25607
+ url = bgImageDef !== null && bgImageDef !== void 0 && (_bgImageDef$mediaUrl = bgImageDef.mediaUrl) !== null && _bgImageDef$mediaUrl !== void 0 && (_bgImageDef$mediaUrl$ = _bgImageDef$mediaUrl.qStaticContentUrl) !== null && _bgImageDef$mediaUrl$ !== void 0 && _bgImageDef$mediaUrl$.qUrl ? decodeURIComponent(bgImageDef.mediaUrl.qStaticContentUrl.qUrl) : undefined;
25608
+ url = resolveImageUrl(app, url);
25609
+ }
25610
+
25611
+ if (bgImageDef.mode === 'expression') {
25612
+ url = bgImageDef.expressionUrl ? decodeURIComponent(bgImageDef.expressionUrl) : undefined;
25613
+ }
25614
+
25615
+ const pos = getBackgroundPosition(bgComp);
25616
+ const size = getBackgroundSize(bgComp);
25617
+ return url ? {
25618
+ url,
25619
+ pos,
25620
+ size
25621
+ } : undefined;
25622
+ }
25623
+
25624
+ return undefined;
25625
+ };
25626
+ const resolveBgColor = (bgComp, theme) => {
25627
+ const bgColor = bgComp === null || bgComp === void 0 ? void 0 : bgComp.bgColor;
25628
+
25629
+ if (bgColor && theme) {
25630
+ if (bgColor.useColorExpression) {
25631
+ return theme.validateColor(bgColor.colorExpression);
25632
+ }
25633
+
25634
+ return bgColor.color && bgColor.color.color !== 'none' ? theme.getColorPickerColor(bgColor.color) : undefined;
25635
+ }
25636
+
25637
+ return undefined;
25638
+ };
25639
+
25366
25640
  /**
25367
25641
  * @interface
25368
25642
  * @extends HTMLElement
@@ -25703,6 +25977,9 @@
25703
25977
  enter: null,
25704
25978
  leave: null
25705
25979
  });
25980
+ const [bgColor, setBgColor] = react.exports.useState(undefined);
25981
+ const [bgImage, setBgImage] = react.exports.useState(undefined); // {url: "", size: "", pos: ""}
25982
+
25706
25983
  const focusHandler = react.exports.useRef({
25707
25984
  focusToolbarButton(last) {
25708
25985
  // eslint-disable-next-line react/no-this-in-sfc
@@ -25713,6 +25990,11 @@
25713
25990
  react.exports.useEffect(() => {
25714
25991
  eventmixin(focusHandler.current);
25715
25992
  }, []);
25993
+ react.exports.useEffect(() => {
25994
+ const bgComp = layout !== null && layout !== void 0 && layout.components ? layout.components.find(comp => comp.key === 'general') : null;
25995
+ setBgColor(resolveBgColor(bgComp, halo.public.theme));
25996
+ setBgImage(resolveBgImage(bgComp, halo.app));
25997
+ }, [layout, halo.public.theme, halo.app]);
25716
25998
 
25717
25999
  focusHandler.current.blurCallback = resetFocus => {
25718
26000
  halo.root.toggleFocusOfCells();
@@ -25927,7 +26209,12 @@
25927
26209
  position: 'relative',
25928
26210
  width: '100%',
25929
26211
  height: '100%',
25930
- overflow: 'hidden'
26212
+ overflow: 'hidden',
26213
+ backgroundColor: bgColor,
26214
+ backgroundImage: bgImage && bgImage.url ? "url(".concat(bgImage.url, ")") : undefined,
26215
+ backgroundRepeat: 'no-repeat',
26216
+ backgroundSize: bgImage && bgImage.size,
26217
+ backgroundPosition: bgImage && bgImage.pos
25931
26218
  },
25932
26219
  elevation: 0,
25933
26220
  square: true,
@@ -26424,7 +26711,7 @@
26424
26711
  }
26425
26712
 
26426
26713
  /* eslint no-param-reassign: 0, no-restricted-globals: 0 */
26427
- const extend = extend$2.bind(null, true);
26714
+ const extend = extend$1.bind(null, true);
26428
26715
  const JSONPatch = {};
26429
26716
  const {
26430
26717
  isArray
@@ -30906,7 +31193,7 @@
30906
31193
 
30907
31194
  /**
30908
31195
  * Gets the listbox instance of the specified field
30909
- * @param {string|LibraryField} fieldIdentifier Fieldname as a string or a Library dimension
31196
+ * @param {string|LibraryField|QInfo} fieldIdentifier Fieldname as a string, a Library dimension or an object id
30910
31197
  * @returns {Promise<FieldInstance>}
30911
31198
  * @since 1.1.0
30912
31199
  * @example
@@ -30914,10 +31201,13 @@
30914
31201
  * fieldInstance.mount(element, { title: "Hello Field"});
30915
31202
  */
30916
31203
  field: async fieldIdentifier => {
31204
+ let qId;
30917
31205
  const fieldName = typeof fieldIdentifier === 'string' ? fieldIdentifier : fieldIdentifier.qLibraryId;
30918
31206
 
30919
- if (!fieldName) {
30920
- throw new Error("Field identifier must be provided");
31207
+ if (fieldIdentifier.qId) {
31208
+ qId = fieldIdentifier.qId;
31209
+ } else if (!fieldName) {
31210
+ throw new Error("Field identifier or object id must be provided");
30921
31211
  }
30922
31212
  /**
30923
31213
  * @typedef { 'ltr' | 'rtl' } Direction
@@ -30970,17 +31260,18 @@
30970
31260
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
30971
31261
 
30972
31262
  if (!element) {
30973
- throw new Error("Element for ".concat(fieldName, " not provided"));
31263
+ throw new Error("Element for ".concat(fieldName || qId, " not provided"));
30974
31264
  }
30975
31265
 
30976
31266
  if (this._instance) {
30977
- throw new Error("Field ".concat(fieldName, " already mounted"));
31267
+ throw new Error("Field or object ".concat(fieldName || qId, " already mounted"));
30978
31268
  }
30979
31269
 
30980
31270
  this._instance = ListBoxPortal({
30981
31271
  element,
30982
31272
  app,
30983
31273
  fieldIdentifier,
31274
+ qId,
30984
31275
  options: getOptions(options),
30985
31276
  stateName: options.stateName || '$'
30986
31277
  });
@@ -31075,6 +31366,11 @@
31075
31366
  * @property {function(): Promise<ThemeJSON>} load A function that should return a Promise that resolves to a raw JSON theme.
31076
31367
  */
31077
31368
 
31369
+ /**
31370
+ * @interface QInfo
31371
+ * @property {string} qId Generic object id
31372
+ */
31373
+
31078
31374
 
31079
31375
  var index$1 = nuked(DEFAULT_CONFIG);
31080
31376
 
@@ -31083,7 +31379,7 @@
31083
31379
  var enigmaMocker_dev = {exports: {}};
31084
31380
 
31085
31381
  /*
31086
- * @nebula.js/enigma-mocker v3.0.3
31382
+ * @nebula.js/enigma-mocker v3.0.4
31087
31383
  * Copyright (c) 2022 QlikTech International AB
31088
31384
  * Released under the MIT license.
31089
31385
  */