@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.
package/core/esm/dev.js CHANGED
@@ -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
  */
@@ -1566,6 +1566,24 @@ var Visualization_UnfulfilledCalculationCondition = {
1566
1566
  "zh-TW": "不符計算條件"
1567
1567
  }
1568
1568
  };
1569
+ var Listbox_ScreenReaderInstructions = {
1570
+ id: "Listbox.ScreenReaderInstructions",
1571
+ locale: {
1572
+ "en-US": "Activating the elements below will cause content on the page to be updated"
1573
+ }
1574
+ };
1575
+ var Listbox_Search_ScreenReaderInstructions = {
1576
+ id: "Listbox.Search.ScreenReaderInstructions",
1577
+ locale: {
1578
+ "en-US": "The following search field filters results below as you type"
1579
+ }
1580
+ };
1581
+ var Listbox_ResultFilterLabel = {
1582
+ id: "Listbox.ResultFilterLabel",
1583
+ locale: {
1584
+ "en-US": "Search Results Filter"
1585
+ }
1586
+ };
1569
1587
  var all = {
1570
1588
  Cancel: Cancel$1,
1571
1589
  CurrentSelections_All: CurrentSelections_All,
@@ -1596,7 +1614,10 @@ var all = {
1596
1614
  Visualization_Invalid_Dimension: Visualization_Invalid_Dimension,
1597
1615
  Visualization_Invalid_Measure: Visualization_Invalid_Measure,
1598
1616
  Visualization_LayoutError: Visualization_LayoutError,
1599
- Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition
1617
+ Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition,
1618
+ Listbox_ScreenReaderInstructions: Listbox_ScreenReaderInstructions,
1619
+ Listbox_Search_ScreenReaderInstructions: Listbox_Search_ScreenReaderInstructions,
1620
+ Listbox_ResultFilterLabel: Listbox_ResultFilterLabel
1600
1621
  };
1601
1622
 
1602
1623
  function appLocaleFn(language) {
@@ -1906,76 +1927,457 @@ EventEmitter.listenerCount = function(emitter, type) {
1906
1927
  return ret;
1907
1928
  };
1908
1929
 
1909
- var hasOwn = Object.prototype.hasOwnProperty;
1910
- var toStr = Object.prototype.toString;
1911
- var defineProperty = Object.defineProperty;
1912
- var gOPD = Object.getOwnPropertyDescriptor;
1913
-
1914
- var isArray$1 = function isArray(arr) {
1915
- if (typeof Array.isArray === 'function') {
1916
- return Array.isArray(arr);
1917
- }
1918
-
1919
- return toStr.call(arr) === '[object Array]';
1920
- };
1930
+ function define(constructor, factory, prototype) {
1931
+ constructor.prototype = factory.prototype = prototype;
1932
+ prototype.constructor = constructor;
1933
+ }
1921
1934
 
1922
- var isPlainObject$1 = function isPlainObject(obj) {
1923
- if (!obj || toStr.call(obj) !== '[object Object]') {
1924
- return false;
1925
- }
1935
+ function extend$2(parent, definition) {
1936
+ var prototype = Object.create(parent.prototype);
1937
+ for (var key in definition) prototype[key] = definition[key];
1938
+ return prototype;
1939
+ }
1926
1940
 
1927
- var hasOwnConstructor = hasOwn.call(obj, 'constructor');
1928
- var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
1929
- // Not own constructor property must be Object
1930
- if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
1931
- return false;
1932
- }
1941
+ function Color() {}
1933
1942
 
1934
- // Own properties are enumerated firstly, so to speed up,
1935
- // if last one is own, then all properties are own.
1936
- var key;
1937
- for (key in obj) { /**/ }
1943
+ var darker = 0.7;
1944
+ var brighter = 1 / darker;
1938
1945
 
1939
- return typeof key === 'undefined' || hasOwn.call(obj, key);
1940
- };
1946
+ var reI = "\\s*([+-]?\\d+)\\s*",
1947
+ reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
1948
+ reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
1949
+ reHex = /^#([0-9a-f]{3,8})$/,
1950
+ reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"),
1951
+ reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"),
1952
+ reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"),
1953
+ reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"),
1954
+ reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"),
1955
+ reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
1941
1956
 
1942
- // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
1943
- var setProperty = function setProperty(target, options) {
1944
- if (defineProperty && options.name === '__proto__') {
1945
- defineProperty(target, options.name, {
1946
- enumerable: true,
1947
- configurable: true,
1948
- value: options.newValue,
1949
- writable: true
1950
- });
1951
- } else {
1952
- target[options.name] = options.newValue;
1953
- }
1957
+ var named = {
1958
+ aliceblue: 0xf0f8ff,
1959
+ antiquewhite: 0xfaebd7,
1960
+ aqua: 0x00ffff,
1961
+ aquamarine: 0x7fffd4,
1962
+ azure: 0xf0ffff,
1963
+ beige: 0xf5f5dc,
1964
+ bisque: 0xffe4c4,
1965
+ black: 0x000000,
1966
+ blanchedalmond: 0xffebcd,
1967
+ blue: 0x0000ff,
1968
+ blueviolet: 0x8a2be2,
1969
+ brown: 0xa52a2a,
1970
+ burlywood: 0xdeb887,
1971
+ cadetblue: 0x5f9ea0,
1972
+ chartreuse: 0x7fff00,
1973
+ chocolate: 0xd2691e,
1974
+ coral: 0xff7f50,
1975
+ cornflowerblue: 0x6495ed,
1976
+ cornsilk: 0xfff8dc,
1977
+ crimson: 0xdc143c,
1978
+ cyan: 0x00ffff,
1979
+ darkblue: 0x00008b,
1980
+ darkcyan: 0x008b8b,
1981
+ darkgoldenrod: 0xb8860b,
1982
+ darkgray: 0xa9a9a9,
1983
+ darkgreen: 0x006400,
1984
+ darkgrey: 0xa9a9a9,
1985
+ darkkhaki: 0xbdb76b,
1986
+ darkmagenta: 0x8b008b,
1987
+ darkolivegreen: 0x556b2f,
1988
+ darkorange: 0xff8c00,
1989
+ darkorchid: 0x9932cc,
1990
+ darkred: 0x8b0000,
1991
+ darksalmon: 0xe9967a,
1992
+ darkseagreen: 0x8fbc8f,
1993
+ darkslateblue: 0x483d8b,
1994
+ darkslategray: 0x2f4f4f,
1995
+ darkslategrey: 0x2f4f4f,
1996
+ darkturquoise: 0x00ced1,
1997
+ darkviolet: 0x9400d3,
1998
+ deeppink: 0xff1493,
1999
+ deepskyblue: 0x00bfff,
2000
+ dimgray: 0x696969,
2001
+ dimgrey: 0x696969,
2002
+ dodgerblue: 0x1e90ff,
2003
+ firebrick: 0xb22222,
2004
+ floralwhite: 0xfffaf0,
2005
+ forestgreen: 0x228b22,
2006
+ fuchsia: 0xff00ff,
2007
+ gainsboro: 0xdcdcdc,
2008
+ ghostwhite: 0xf8f8ff,
2009
+ gold: 0xffd700,
2010
+ goldenrod: 0xdaa520,
2011
+ gray: 0x808080,
2012
+ green: 0x008000,
2013
+ greenyellow: 0xadff2f,
2014
+ grey: 0x808080,
2015
+ honeydew: 0xf0fff0,
2016
+ hotpink: 0xff69b4,
2017
+ indianred: 0xcd5c5c,
2018
+ indigo: 0x4b0082,
2019
+ ivory: 0xfffff0,
2020
+ khaki: 0xf0e68c,
2021
+ lavender: 0xe6e6fa,
2022
+ lavenderblush: 0xfff0f5,
2023
+ lawngreen: 0x7cfc00,
2024
+ lemonchiffon: 0xfffacd,
2025
+ lightblue: 0xadd8e6,
2026
+ lightcoral: 0xf08080,
2027
+ lightcyan: 0xe0ffff,
2028
+ lightgoldenrodyellow: 0xfafad2,
2029
+ lightgray: 0xd3d3d3,
2030
+ lightgreen: 0x90ee90,
2031
+ lightgrey: 0xd3d3d3,
2032
+ lightpink: 0xffb6c1,
2033
+ lightsalmon: 0xffa07a,
2034
+ lightseagreen: 0x20b2aa,
2035
+ lightskyblue: 0x87cefa,
2036
+ lightslategray: 0x778899,
2037
+ lightslategrey: 0x778899,
2038
+ lightsteelblue: 0xb0c4de,
2039
+ lightyellow: 0xffffe0,
2040
+ lime: 0x00ff00,
2041
+ limegreen: 0x32cd32,
2042
+ linen: 0xfaf0e6,
2043
+ magenta: 0xff00ff,
2044
+ maroon: 0x800000,
2045
+ mediumaquamarine: 0x66cdaa,
2046
+ mediumblue: 0x0000cd,
2047
+ mediumorchid: 0xba55d3,
2048
+ mediumpurple: 0x9370db,
2049
+ mediumseagreen: 0x3cb371,
2050
+ mediumslateblue: 0x7b68ee,
2051
+ mediumspringgreen: 0x00fa9a,
2052
+ mediumturquoise: 0x48d1cc,
2053
+ mediumvioletred: 0xc71585,
2054
+ midnightblue: 0x191970,
2055
+ mintcream: 0xf5fffa,
2056
+ mistyrose: 0xffe4e1,
2057
+ moccasin: 0xffe4b5,
2058
+ navajowhite: 0xffdead,
2059
+ navy: 0x000080,
2060
+ oldlace: 0xfdf5e6,
2061
+ olive: 0x808000,
2062
+ olivedrab: 0x6b8e23,
2063
+ orange: 0xffa500,
2064
+ orangered: 0xff4500,
2065
+ orchid: 0xda70d6,
2066
+ palegoldenrod: 0xeee8aa,
2067
+ palegreen: 0x98fb98,
2068
+ paleturquoise: 0xafeeee,
2069
+ palevioletred: 0xdb7093,
2070
+ papayawhip: 0xffefd5,
2071
+ peachpuff: 0xffdab9,
2072
+ peru: 0xcd853f,
2073
+ pink: 0xffc0cb,
2074
+ plum: 0xdda0dd,
2075
+ powderblue: 0xb0e0e6,
2076
+ purple: 0x800080,
2077
+ rebeccapurple: 0x663399,
2078
+ red: 0xff0000,
2079
+ rosybrown: 0xbc8f8f,
2080
+ royalblue: 0x4169e1,
2081
+ saddlebrown: 0x8b4513,
2082
+ salmon: 0xfa8072,
2083
+ sandybrown: 0xf4a460,
2084
+ seagreen: 0x2e8b57,
2085
+ seashell: 0xfff5ee,
2086
+ sienna: 0xa0522d,
2087
+ silver: 0xc0c0c0,
2088
+ skyblue: 0x87ceeb,
2089
+ slateblue: 0x6a5acd,
2090
+ slategray: 0x708090,
2091
+ slategrey: 0x708090,
2092
+ snow: 0xfffafa,
2093
+ springgreen: 0x00ff7f,
2094
+ steelblue: 0x4682b4,
2095
+ tan: 0xd2b48c,
2096
+ teal: 0x008080,
2097
+ thistle: 0xd8bfd8,
2098
+ tomato: 0xff6347,
2099
+ turquoise: 0x40e0d0,
2100
+ violet: 0xee82ee,
2101
+ wheat: 0xf5deb3,
2102
+ white: 0xffffff,
2103
+ whitesmoke: 0xf5f5f5,
2104
+ yellow: 0xffff00,
2105
+ yellowgreen: 0x9acd32
1954
2106
  };
1955
2107
 
1956
- // Return undefined instead of __proto__ if '__proto__' is not an own property
1957
- var getProperty = function getProperty(obj, name) {
1958
- if (name === '__proto__') {
1959
- if (!hasOwn.call(obj, name)) {
1960
- return void 0;
1961
- } else if (gOPD) {
1962
- // In early versions of node, obj['__proto__'] is buggy when obj has
1963
- // __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
1964
- return gOPD(obj, name).value;
1965
- }
1966
- }
2108
+ define(Color, color$3, {
2109
+ copy: function(channels) {
2110
+ return Object.assign(new this.constructor, this, channels);
2111
+ },
2112
+ displayable: function() {
2113
+ return this.rgb().displayable();
2114
+ },
2115
+ hex: color_formatHex, // Deprecated! Use color.formatHex.
2116
+ formatHex: color_formatHex,
2117
+ formatHsl: color_formatHsl,
2118
+ formatRgb: color_formatRgb,
2119
+ toString: color_formatRgb
2120
+ });
1967
2121
 
1968
- return obj[name];
1969
- };
2122
+ function color_formatHex() {
2123
+ return this.rgb().formatHex();
2124
+ }
1970
2125
 
1971
- var extend$2 = function extend() {
1972
- var options, name, src, copy, copyIsArray, clone;
1973
- var target = arguments[0];
1974
- var i = 1;
1975
- var length = arguments.length;
1976
- var deep = false;
2126
+ function color_formatHsl() {
2127
+ return hslConvert(this).formatHsl();
2128
+ }
1977
2129
 
1978
- // Handle a deep copy situation
2130
+ function color_formatRgb() {
2131
+ return this.rgb().formatRgb();
2132
+ }
2133
+
2134
+ function color$3(format) {
2135
+ var m, l;
2136
+ format = (format + "").trim().toLowerCase();
2137
+ return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
2138
+ : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
2139
+ : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
2140
+ : 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
2141
+ : null) // invalid hex
2142
+ : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
2143
+ : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
2144
+ : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
2145
+ : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
2146
+ : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
2147
+ : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
2148
+ : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
2149
+ : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
2150
+ : null;
2151
+ }
2152
+
2153
+ function rgbn(n) {
2154
+ return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
2155
+ }
2156
+
2157
+ function rgba(r, g, b, a) {
2158
+ if (a <= 0) r = g = b = NaN;
2159
+ return new Rgb(r, g, b, a);
2160
+ }
2161
+
2162
+ function rgbConvert(o) {
2163
+ if (!(o instanceof Color)) o = color$3(o);
2164
+ if (!o) return new Rgb;
2165
+ o = o.rgb();
2166
+ return new Rgb(o.r, o.g, o.b, o.opacity);
2167
+ }
2168
+
2169
+ function rgb(r, g, b, opacity) {
2170
+ return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
2171
+ }
2172
+
2173
+ function Rgb(r, g, b, opacity) {
2174
+ this.r = +r;
2175
+ this.g = +g;
2176
+ this.b = +b;
2177
+ this.opacity = +opacity;
2178
+ }
2179
+
2180
+ define(Rgb, rgb, extend$2(Color, {
2181
+ brighter: function(k) {
2182
+ k = k == null ? brighter : Math.pow(brighter, k);
2183
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
2184
+ },
2185
+ darker: function(k) {
2186
+ k = k == null ? darker : Math.pow(darker, k);
2187
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
2188
+ },
2189
+ rgb: function() {
2190
+ return this;
2191
+ },
2192
+ displayable: function() {
2193
+ return (-0.5 <= this.r && this.r < 255.5)
2194
+ && (-0.5 <= this.g && this.g < 255.5)
2195
+ && (-0.5 <= this.b && this.b < 255.5)
2196
+ && (0 <= this.opacity && this.opacity <= 1);
2197
+ },
2198
+ hex: rgb_formatHex, // Deprecated! Use color.formatHex.
2199
+ formatHex: rgb_formatHex,
2200
+ formatRgb: rgb_formatRgb,
2201
+ toString: rgb_formatRgb
2202
+ }));
2203
+
2204
+ function rgb_formatHex() {
2205
+ return "#" + hex(this.r) + hex(this.g) + hex(this.b);
2206
+ }
2207
+
2208
+ function rgb_formatRgb() {
2209
+ var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
2210
+ return (a === 1 ? "rgb(" : "rgba(")
2211
+ + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", "
2212
+ + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", "
2213
+ + Math.max(0, Math.min(255, Math.round(this.b) || 0))
2214
+ + (a === 1 ? ")" : ", " + a + ")");
2215
+ }
2216
+
2217
+ function hex(value) {
2218
+ value = Math.max(0, Math.min(255, Math.round(value) || 0));
2219
+ return (value < 16 ? "0" : "") + value.toString(16);
2220
+ }
2221
+
2222
+ function hsla(h, s, l, a) {
2223
+ if (a <= 0) h = s = l = NaN;
2224
+ else if (l <= 0 || l >= 1) h = s = NaN;
2225
+ else if (s <= 0) h = NaN;
2226
+ return new Hsl(h, s, l, a);
2227
+ }
2228
+
2229
+ function hslConvert(o) {
2230
+ if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
2231
+ if (!(o instanceof Color)) o = color$3(o);
2232
+ if (!o) return new Hsl;
2233
+ if (o instanceof Hsl) return o;
2234
+ o = o.rgb();
2235
+ var r = o.r / 255,
2236
+ g = o.g / 255,
2237
+ b = o.b / 255,
2238
+ min = Math.min(r, g, b),
2239
+ max = Math.max(r, g, b),
2240
+ h = NaN,
2241
+ s = max - min,
2242
+ l = (max + min) / 2;
2243
+ if (s) {
2244
+ if (r === max) h = (g - b) / s + (g < b) * 6;
2245
+ else if (g === max) h = (b - r) / s + 2;
2246
+ else h = (r - g) / s + 4;
2247
+ s /= l < 0.5 ? max + min : 2 - max - min;
2248
+ h *= 60;
2249
+ } else {
2250
+ s = l > 0 && l < 1 ? 0 : h;
2251
+ }
2252
+ return new Hsl(h, s, l, o.opacity);
2253
+ }
2254
+
2255
+ function hsl(h, s, l, opacity) {
2256
+ return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
2257
+ }
2258
+
2259
+ function Hsl(h, s, l, opacity) {
2260
+ this.h = +h;
2261
+ this.s = +s;
2262
+ this.l = +l;
2263
+ this.opacity = +opacity;
2264
+ }
2265
+
2266
+ define(Hsl, hsl, extend$2(Color, {
2267
+ brighter: function(k) {
2268
+ k = k == null ? brighter : Math.pow(brighter, k);
2269
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
2270
+ },
2271
+ darker: function(k) {
2272
+ k = k == null ? darker : Math.pow(darker, k);
2273
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
2274
+ },
2275
+ rgb: function() {
2276
+ var h = this.h % 360 + (this.h < 0) * 360,
2277
+ s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
2278
+ l = this.l,
2279
+ m2 = l + (l < 0.5 ? l : 1 - l) * s,
2280
+ m1 = 2 * l - m2;
2281
+ return new Rgb(
2282
+ hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
2283
+ hsl2rgb(h, m1, m2),
2284
+ hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
2285
+ this.opacity
2286
+ );
2287
+ },
2288
+ displayable: function() {
2289
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s))
2290
+ && (0 <= this.l && this.l <= 1)
2291
+ && (0 <= this.opacity && this.opacity <= 1);
2292
+ },
2293
+ formatHsl: function() {
2294
+ var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
2295
+ return (a === 1 ? "hsl(" : "hsla(")
2296
+ + (this.h || 0) + ", "
2297
+ + (this.s || 0) * 100 + "%, "
2298
+ + (this.l || 0) * 100 + "%"
2299
+ + (a === 1 ? ")" : ", " + a + ")");
2300
+ }
2301
+ }));
2302
+
2303
+ /* From FvD 13.37, CSS Color Module Level 3 */
2304
+ function hsl2rgb(h, m1, m2) {
2305
+ return (h < 60 ? m1 + (m2 - m1) * h / 60
2306
+ : h < 180 ? m2
2307
+ : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
2308
+ : m1) * 255;
2309
+ }
2310
+
2311
+ var hasOwn = Object.prototype.hasOwnProperty;
2312
+ var toStr = Object.prototype.toString;
2313
+ var defineProperty = Object.defineProperty;
2314
+ var gOPD = Object.getOwnPropertyDescriptor;
2315
+
2316
+ var isArray$1 = function isArray(arr) {
2317
+ if (typeof Array.isArray === 'function') {
2318
+ return Array.isArray(arr);
2319
+ }
2320
+
2321
+ return toStr.call(arr) === '[object Array]';
2322
+ };
2323
+
2324
+ var isPlainObject$1 = function isPlainObject(obj) {
2325
+ if (!obj || toStr.call(obj) !== '[object Object]') {
2326
+ return false;
2327
+ }
2328
+
2329
+ var hasOwnConstructor = hasOwn.call(obj, 'constructor');
2330
+ var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
2331
+ // Not own constructor property must be Object
2332
+ if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
2333
+ return false;
2334
+ }
2335
+
2336
+ // Own properties are enumerated firstly, so to speed up,
2337
+ // if last one is own, then all properties are own.
2338
+ var key;
2339
+ for (key in obj) { /**/ }
2340
+
2341
+ return typeof key === 'undefined' || hasOwn.call(obj, key);
2342
+ };
2343
+
2344
+ // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
2345
+ var setProperty = function setProperty(target, options) {
2346
+ if (defineProperty && options.name === '__proto__') {
2347
+ defineProperty(target, options.name, {
2348
+ enumerable: true,
2349
+ configurable: true,
2350
+ value: options.newValue,
2351
+ writable: true
2352
+ });
2353
+ } else {
2354
+ target[options.name] = options.newValue;
2355
+ }
2356
+ };
2357
+
2358
+ // Return undefined instead of __proto__ if '__proto__' is not an own property
2359
+ var getProperty = function getProperty(obj, name) {
2360
+ if (name === '__proto__') {
2361
+ if (!hasOwn.call(obj, name)) {
2362
+ return void 0;
2363
+ } else if (gOPD) {
2364
+ // In early versions of node, obj['__proto__'] is buggy when obj has
2365
+ // __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
2366
+ return gOPD(obj, name).value;
2367
+ }
2368
+ }
2369
+
2370
+ return obj[name];
2371
+ };
2372
+
2373
+ var extend$1 = function extend() {
2374
+ var options, name, src, copy, copyIsArray, clone;
2375
+ var target = arguments[0];
2376
+ var i = 1;
2377
+ var length = arguments.length;
2378
+ var deep = false;
2379
+
2380
+ // Handle a deep copy situation
1979
2381
  if (typeof target === 'boolean') {
1980
2382
  deep = target;
1981
2383
  target = arguments[1] || {};
@@ -2239,11 +2641,11 @@ var _variables$1 = {
2239
2641
  "@H6": "10px"
2240
2642
  };
2241
2643
  var type$1 = "light";
2242
- var color$3 = "@B35";
2644
+ var color$2 = "@B35";
2243
2645
  var lightRawJSON = {
2244
2646
  _variables: _variables$1,
2245
2647
  type: type$1,
2246
- color: color$3
2648
+ color: color$2
2247
2649
  };
2248
2650
 
2249
2651
  var _variables = {
@@ -2264,18 +2666,18 @@ var _variables = {
2264
2666
  "@H6": "10px"
2265
2667
  };
2266
2668
  var type = "dark";
2267
- var color$2 = "@B98";
2669
+ var color$1 = "@B98";
2268
2670
  var darkRawJSON = {
2269
2671
  _variables: _variables,
2270
2672
  type: type,
2271
- color: color$2
2673
+ color: color$1
2272
2674
  };
2273
2675
 
2274
2676
  function setTheme(t, resolve) {
2275
2677
  const colorRawJSON = t.type === 'dark' ? darkRawJSON : lightRawJSON;
2276
- 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
2678
+ 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
2277
2679
 
2278
- const rawThemeJSON = extend$2(true, {}, root, {
2680
+ const rawThemeJSON = extend$1(true, {}, root, {
2279
2681
  scales: null,
2280
2682
  palettes: {
2281
2683
  data: null,
@@ -2361,430 +2763,49 @@ function theme$1(resolvedTheme) {
2361
2763
  translation: s.translation,
2362
2764
  type: 'row',
2363
2765
  colors: s.colors
2364
- });
2365
- });
2366
- return pals;
2367
- },
2368
-
2369
- dataColors() {
2370
- /** @interface Theme~DataColorSpecials */
2371
- return (
2372
- /** @lends Theme~DataColorSpecials */
2373
- {
2374
- /** @type {string} */
2375
- primary: resolvedTheme.dataColors.primaryColor,
2376
-
2377
- /** @type {string} */
2378
- nil: resolvedTheme.dataColors.nullColor,
2379
-
2380
- /** @type {string} */
2381
- others: resolvedTheme.dataColors.othersColor
2382
- }
2383
- );
2384
- },
2385
-
2386
- uiColor(c) {
2387
- if (c.index < 0 || typeof c.index === 'undefined') {
2388
- return c.color;
2389
- }
2390
-
2391
- if (typeof uiPalette === 'undefined') {
2392
- uiPalette = this.uiPalettes()[0] || false;
2393
- }
2394
-
2395
- if (!uiPalette) {
2396
- return c.color;
2397
- }
2398
-
2399
- if (typeof uiPalette.colors[c.index] === 'undefined') {
2400
- return c.color;
2401
- }
2402
-
2403
- return uiPalette.colors[c.index];
2404
- }
2405
-
2406
- };
2407
- }
2408
-
2409
- function define(constructor, factory, prototype) {
2410
- constructor.prototype = factory.prototype = prototype;
2411
- prototype.constructor = constructor;
2412
- }
2413
-
2414
- function extend$1(parent, definition) {
2415
- var prototype = Object.create(parent.prototype);
2416
- for (var key in definition) prototype[key] = definition[key];
2417
- return prototype;
2418
- }
2419
-
2420
- function Color() {}
2421
-
2422
- var darker = 0.7;
2423
- var brighter = 1 / darker;
2424
-
2425
- var reI = "\\s*([+-]?\\d+)\\s*",
2426
- reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
2427
- reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
2428
- reHex = /^#([0-9a-f]{3,8})$/,
2429
- reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"),
2430
- reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"),
2431
- reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"),
2432
- reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"),
2433
- reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"),
2434
- reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
2435
-
2436
- var named = {
2437
- aliceblue: 0xf0f8ff,
2438
- antiquewhite: 0xfaebd7,
2439
- aqua: 0x00ffff,
2440
- aquamarine: 0x7fffd4,
2441
- azure: 0xf0ffff,
2442
- beige: 0xf5f5dc,
2443
- bisque: 0xffe4c4,
2444
- black: 0x000000,
2445
- blanchedalmond: 0xffebcd,
2446
- blue: 0x0000ff,
2447
- blueviolet: 0x8a2be2,
2448
- brown: 0xa52a2a,
2449
- burlywood: 0xdeb887,
2450
- cadetblue: 0x5f9ea0,
2451
- chartreuse: 0x7fff00,
2452
- chocolate: 0xd2691e,
2453
- coral: 0xff7f50,
2454
- cornflowerblue: 0x6495ed,
2455
- cornsilk: 0xfff8dc,
2456
- crimson: 0xdc143c,
2457
- cyan: 0x00ffff,
2458
- darkblue: 0x00008b,
2459
- darkcyan: 0x008b8b,
2460
- darkgoldenrod: 0xb8860b,
2461
- darkgray: 0xa9a9a9,
2462
- darkgreen: 0x006400,
2463
- darkgrey: 0xa9a9a9,
2464
- darkkhaki: 0xbdb76b,
2465
- darkmagenta: 0x8b008b,
2466
- darkolivegreen: 0x556b2f,
2467
- darkorange: 0xff8c00,
2468
- darkorchid: 0x9932cc,
2469
- darkred: 0x8b0000,
2470
- darksalmon: 0xe9967a,
2471
- darkseagreen: 0x8fbc8f,
2472
- darkslateblue: 0x483d8b,
2473
- darkslategray: 0x2f4f4f,
2474
- darkslategrey: 0x2f4f4f,
2475
- darkturquoise: 0x00ced1,
2476
- darkviolet: 0x9400d3,
2477
- deeppink: 0xff1493,
2478
- deepskyblue: 0x00bfff,
2479
- dimgray: 0x696969,
2480
- dimgrey: 0x696969,
2481
- dodgerblue: 0x1e90ff,
2482
- firebrick: 0xb22222,
2483
- floralwhite: 0xfffaf0,
2484
- forestgreen: 0x228b22,
2485
- fuchsia: 0xff00ff,
2486
- gainsboro: 0xdcdcdc,
2487
- ghostwhite: 0xf8f8ff,
2488
- gold: 0xffd700,
2489
- goldenrod: 0xdaa520,
2490
- gray: 0x808080,
2491
- green: 0x008000,
2492
- greenyellow: 0xadff2f,
2493
- grey: 0x808080,
2494
- honeydew: 0xf0fff0,
2495
- hotpink: 0xff69b4,
2496
- indianred: 0xcd5c5c,
2497
- indigo: 0x4b0082,
2498
- ivory: 0xfffff0,
2499
- khaki: 0xf0e68c,
2500
- lavender: 0xe6e6fa,
2501
- lavenderblush: 0xfff0f5,
2502
- lawngreen: 0x7cfc00,
2503
- lemonchiffon: 0xfffacd,
2504
- lightblue: 0xadd8e6,
2505
- lightcoral: 0xf08080,
2506
- lightcyan: 0xe0ffff,
2507
- lightgoldenrodyellow: 0xfafad2,
2508
- lightgray: 0xd3d3d3,
2509
- lightgreen: 0x90ee90,
2510
- lightgrey: 0xd3d3d3,
2511
- lightpink: 0xffb6c1,
2512
- lightsalmon: 0xffa07a,
2513
- lightseagreen: 0x20b2aa,
2514
- lightskyblue: 0x87cefa,
2515
- lightslategray: 0x778899,
2516
- lightslategrey: 0x778899,
2517
- lightsteelblue: 0xb0c4de,
2518
- lightyellow: 0xffffe0,
2519
- lime: 0x00ff00,
2520
- limegreen: 0x32cd32,
2521
- linen: 0xfaf0e6,
2522
- magenta: 0xff00ff,
2523
- maroon: 0x800000,
2524
- mediumaquamarine: 0x66cdaa,
2525
- mediumblue: 0x0000cd,
2526
- mediumorchid: 0xba55d3,
2527
- mediumpurple: 0x9370db,
2528
- mediumseagreen: 0x3cb371,
2529
- mediumslateblue: 0x7b68ee,
2530
- mediumspringgreen: 0x00fa9a,
2531
- mediumturquoise: 0x48d1cc,
2532
- mediumvioletred: 0xc71585,
2533
- midnightblue: 0x191970,
2534
- mintcream: 0xf5fffa,
2535
- mistyrose: 0xffe4e1,
2536
- moccasin: 0xffe4b5,
2537
- navajowhite: 0xffdead,
2538
- navy: 0x000080,
2539
- oldlace: 0xfdf5e6,
2540
- olive: 0x808000,
2541
- olivedrab: 0x6b8e23,
2542
- orange: 0xffa500,
2543
- orangered: 0xff4500,
2544
- orchid: 0xda70d6,
2545
- palegoldenrod: 0xeee8aa,
2546
- palegreen: 0x98fb98,
2547
- paleturquoise: 0xafeeee,
2548
- palevioletred: 0xdb7093,
2549
- papayawhip: 0xffefd5,
2550
- peachpuff: 0xffdab9,
2551
- peru: 0xcd853f,
2552
- pink: 0xffc0cb,
2553
- plum: 0xdda0dd,
2554
- powderblue: 0xb0e0e6,
2555
- purple: 0x800080,
2556
- rebeccapurple: 0x663399,
2557
- red: 0xff0000,
2558
- rosybrown: 0xbc8f8f,
2559
- royalblue: 0x4169e1,
2560
- saddlebrown: 0x8b4513,
2561
- salmon: 0xfa8072,
2562
- sandybrown: 0xf4a460,
2563
- seagreen: 0x2e8b57,
2564
- seashell: 0xfff5ee,
2565
- sienna: 0xa0522d,
2566
- silver: 0xc0c0c0,
2567
- skyblue: 0x87ceeb,
2568
- slateblue: 0x6a5acd,
2569
- slategray: 0x708090,
2570
- slategrey: 0x708090,
2571
- snow: 0xfffafa,
2572
- springgreen: 0x00ff7f,
2573
- steelblue: 0x4682b4,
2574
- tan: 0xd2b48c,
2575
- teal: 0x008080,
2576
- thistle: 0xd8bfd8,
2577
- tomato: 0xff6347,
2578
- turquoise: 0x40e0d0,
2579
- violet: 0xee82ee,
2580
- wheat: 0xf5deb3,
2581
- white: 0xffffff,
2582
- whitesmoke: 0xf5f5f5,
2583
- yellow: 0xffff00,
2584
- yellowgreen: 0x9acd32
2585
- };
2586
-
2587
- define(Color, color$1, {
2588
- copy: function(channels) {
2589
- return Object.assign(new this.constructor, this, channels);
2590
- },
2591
- displayable: function() {
2592
- return this.rgb().displayable();
2593
- },
2594
- hex: color_formatHex, // Deprecated! Use color.formatHex.
2595
- formatHex: color_formatHex,
2596
- formatHsl: color_formatHsl,
2597
- formatRgb: color_formatRgb,
2598
- toString: color_formatRgb
2599
- });
2600
-
2601
- function color_formatHex() {
2602
- return this.rgb().formatHex();
2603
- }
2604
-
2605
- function color_formatHsl() {
2606
- return hslConvert(this).formatHsl();
2607
- }
2608
-
2609
- function color_formatRgb() {
2610
- return this.rgb().formatRgb();
2611
- }
2612
-
2613
- function color$1(format) {
2614
- var m, l;
2615
- format = (format + "").trim().toLowerCase();
2616
- return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
2617
- : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
2618
- : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
2619
- : 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
2620
- : null) // invalid hex
2621
- : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
2622
- : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
2623
- : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
2624
- : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
2625
- : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
2626
- : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
2627
- : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
2628
- : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
2629
- : null;
2630
- }
2631
-
2632
- function rgbn(n) {
2633
- return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
2634
- }
2635
-
2636
- function rgba(r, g, b, a) {
2637
- if (a <= 0) r = g = b = NaN;
2638
- return new Rgb(r, g, b, a);
2639
- }
2640
-
2641
- function rgbConvert(o) {
2642
- if (!(o instanceof Color)) o = color$1(o);
2643
- if (!o) return new Rgb;
2644
- o = o.rgb();
2645
- return new Rgb(o.r, o.g, o.b, o.opacity);
2646
- }
2647
-
2648
- function rgb(r, g, b, opacity) {
2649
- return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
2650
- }
2651
-
2652
- function Rgb(r, g, b, opacity) {
2653
- this.r = +r;
2654
- this.g = +g;
2655
- this.b = +b;
2656
- this.opacity = +opacity;
2657
- }
2658
-
2659
- define(Rgb, rgb, extend$1(Color, {
2660
- brighter: function(k) {
2661
- k = k == null ? brighter : Math.pow(brighter, k);
2662
- return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
2663
- },
2664
- darker: function(k) {
2665
- k = k == null ? darker : Math.pow(darker, k);
2666
- return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
2667
- },
2668
- rgb: function() {
2669
- return this;
2670
- },
2671
- displayable: function() {
2672
- return (-0.5 <= this.r && this.r < 255.5)
2673
- && (-0.5 <= this.g && this.g < 255.5)
2674
- && (-0.5 <= this.b && this.b < 255.5)
2675
- && (0 <= this.opacity && this.opacity <= 1);
2676
- },
2677
- hex: rgb_formatHex, // Deprecated! Use color.formatHex.
2678
- formatHex: rgb_formatHex,
2679
- formatRgb: rgb_formatRgb,
2680
- toString: rgb_formatRgb
2681
- }));
2766
+ });
2767
+ });
2768
+ return pals;
2769
+ },
2682
2770
 
2683
- function rgb_formatHex() {
2684
- return "#" + hex(this.r) + hex(this.g) + hex(this.b);
2685
- }
2771
+ dataColors() {
2772
+ /** @interface Theme~DataColorSpecials */
2773
+ return (
2774
+ /** @lends Theme~DataColorSpecials */
2775
+ {
2776
+ /** @type {string} */
2777
+ primary: resolvedTheme.dataColors.primaryColor,
2686
2778
 
2687
- function rgb_formatRgb() {
2688
- var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
2689
- return (a === 1 ? "rgb(" : "rgba(")
2690
- + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", "
2691
- + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", "
2692
- + Math.max(0, Math.min(255, Math.round(this.b) || 0))
2693
- + (a === 1 ? ")" : ", " + a + ")");
2694
- }
2779
+ /** @type {string} */
2780
+ nil: resolvedTheme.dataColors.nullColor,
2695
2781
 
2696
- function hex(value) {
2697
- value = Math.max(0, Math.min(255, Math.round(value) || 0));
2698
- return (value < 16 ? "0" : "") + value.toString(16);
2699
- }
2782
+ /** @type {string} */
2783
+ others: resolvedTheme.dataColors.othersColor
2784
+ }
2785
+ );
2786
+ },
2700
2787
 
2701
- function hsla(h, s, l, a) {
2702
- if (a <= 0) h = s = l = NaN;
2703
- else if (l <= 0 || l >= 1) h = s = NaN;
2704
- else if (s <= 0) h = NaN;
2705
- return new Hsl(h, s, l, a);
2706
- }
2788
+ uiColor(c) {
2789
+ if (c.index < 0 || typeof c.index === 'undefined') {
2790
+ return c.color;
2791
+ }
2707
2792
 
2708
- function hslConvert(o) {
2709
- if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
2710
- if (!(o instanceof Color)) o = color$1(o);
2711
- if (!o) return new Hsl;
2712
- if (o instanceof Hsl) return o;
2713
- o = o.rgb();
2714
- var r = o.r / 255,
2715
- g = o.g / 255,
2716
- b = o.b / 255,
2717
- min = Math.min(r, g, b),
2718
- max = Math.max(r, g, b),
2719
- h = NaN,
2720
- s = max - min,
2721
- l = (max + min) / 2;
2722
- if (s) {
2723
- if (r === max) h = (g - b) / s + (g < b) * 6;
2724
- else if (g === max) h = (b - r) / s + 2;
2725
- else h = (r - g) / s + 4;
2726
- s /= l < 0.5 ? max + min : 2 - max - min;
2727
- h *= 60;
2728
- } else {
2729
- s = l > 0 && l < 1 ? 0 : h;
2730
- }
2731
- return new Hsl(h, s, l, o.opacity);
2732
- }
2793
+ if (typeof uiPalette === 'undefined') {
2794
+ uiPalette = this.uiPalettes()[0] || false;
2795
+ }
2733
2796
 
2734
- function hsl(h, s, l, opacity) {
2735
- return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
2736
- }
2797
+ if (!uiPalette) {
2798
+ return c.color;
2799
+ }
2737
2800
 
2738
- function Hsl(h, s, l, opacity) {
2739
- this.h = +h;
2740
- this.s = +s;
2741
- this.l = +l;
2742
- this.opacity = +opacity;
2743
- }
2801
+ if (typeof uiPalette.colors[c.index] === 'undefined') {
2802
+ return c.color;
2803
+ }
2744
2804
 
2745
- define(Hsl, hsl, extend$1(Color, {
2746
- brighter: function(k) {
2747
- k = k == null ? brighter : Math.pow(brighter, k);
2748
- return new Hsl(this.h, this.s, this.l * k, this.opacity);
2749
- },
2750
- darker: function(k) {
2751
- k = k == null ? darker : Math.pow(darker, k);
2752
- return new Hsl(this.h, this.s, this.l * k, this.opacity);
2753
- },
2754
- rgb: function() {
2755
- var h = this.h % 360 + (this.h < 0) * 360,
2756
- s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
2757
- l = this.l,
2758
- m2 = l + (l < 0.5 ? l : 1 - l) * s,
2759
- m1 = 2 * l - m2;
2760
- return new Rgb(
2761
- hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
2762
- hsl2rgb(h, m1, m2),
2763
- hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
2764
- this.opacity
2765
- );
2766
- },
2767
- displayable: function() {
2768
- return (0 <= this.s && this.s <= 1 || isNaN(this.s))
2769
- && (0 <= this.l && this.l <= 1)
2770
- && (0 <= this.opacity && this.opacity <= 1);
2771
- },
2772
- formatHsl: function() {
2773
- var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
2774
- return (a === 1 ? "hsl(" : "hsla(")
2775
- + (this.h || 0) + ", "
2776
- + (this.s || 0) * 100 + "%, "
2777
- + (this.l || 0) * 100 + "%"
2778
- + (a === 1 ? ")" : ", " + a + ")");
2779
- }
2780
- }));
2805
+ return uiPalette.colors[c.index];
2806
+ }
2781
2807
 
2782
- /* From FvD 13.37, CSS Color Module Level 3 */
2783
- function hsl2rgb(h, m1, m2) {
2784
- return (h < 60 ? m1 + (m2 - m1) * h / 60
2785
- : h < 180 ? m2
2786
- : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
2787
- : m1) * 255;
2808
+ };
2788
2809
  }
2789
2810
 
2790
2811
  /**
@@ -2825,7 +2846,7 @@ class ColorScale {
2825
2846
  this.startLevel = 0;
2826
2847
  this.max = 1;
2827
2848
  this.min = 0;
2828
- this.nanColor = color$1(nanColor);
2849
+ this.nanColor = color$3(nanColor);
2829
2850
  }
2830
2851
  /**
2831
2852
  * 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.
@@ -2845,7 +2866,7 @@ class ColorScale {
2845
2866
  this.colorParts[level] = [];
2846
2867
  }
2847
2868
 
2848
- this.colorParts[level].push([color$1(color1), color$1(color2)]);
2869
+ this.colorParts[level].push([color$3(color1), color$3(color2)]);
2849
2870
  }
2850
2871
  /**
2851
2872
  * Gets the color which represents the input value
@@ -2951,7 +2972,7 @@ function generateLevel(scale, current, size) {
2951
2972
  }
2952
2973
  }
2953
2974
 
2954
- level.push(color$1(c).formatHex());
2975
+ level.push(color$3(c).formatHex());
2955
2976
  }
2956
2977
 
2957
2978
  return level;
@@ -3141,7 +3162,7 @@ function resolveVariables(objTree, variables) {
3141
3162
 
3142
3163
  styleResolver.resolveRawTheme = raw => {
3143
3164
  // TODO - validate format
3144
- const c = extend$2(true, {}, raw);
3165
+ const c = extend$1(true, {}, raw);
3145
3166
  resolveVariables(c, c._variables); // eslint-disable-line
3146
3167
  // generate class-pyramid
3147
3168
 
@@ -3153,7 +3174,7 @@ styleResolver.resolveRawTheme = raw => {
3153
3174
  };
3154
3175
 
3155
3176
  function luminance(colStr) {
3156
- const c = color$1(colStr).rgb();
3177
+ const c = color$3(colStr).rgb();
3157
3178
  const {
3158
3179
  r,
3159
3180
  g,
@@ -3294,6 +3315,23 @@ function theme() {
3294
3315
  }
3295
3316
 
3296
3317
  return styleResolverInstanceCache[basePath].getStyle(path, attribute);
3318
+ },
3319
+
3320
+ /**
3321
+ * Validates a color string using d3-color.
3322
+ * See https://www.npmjs.com/package/d3-color
3323
+ * @param {string} specifier
3324
+ * @returns {string|undefined} The resolved color or undefined
3325
+ * @ignore
3326
+ *
3327
+ * @example
3328
+ * theme.validateColor("red"); // returns "rgba(255,0,0,1)"
3329
+ * theme.validateColor("#00ff00"); // returns "rgba(0,255,0,1)"
3330
+ * theme.validateColor("FOO"); // returns undefined
3331
+ */
3332
+ validateColor() {
3333
+ const c = color$3(...arguments);
3334
+ return c ? c.toString() : undefined;
3297
3335
  }
3298
3336
 
3299
3337
  };
@@ -7473,7 +7511,7 @@ function create$3(definition) {
7473
7511
  return cache[key];
7474
7512
  }
7475
7513
 
7476
- const NEBULA_VERSION_HASH = "85ad" ;
7514
+ const NEBULA_VERSION_HASH = "1c8e" ;
7477
7515
  ClassNameGenerator$1.configure(componentName => {
7478
7516
 
7479
7517
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
@@ -8046,7 +8084,7 @@ function boot(_ref2) {
8046
8084
  const appRef = React__default.createRef();
8047
8085
  const element = document.createElement('div');
8048
8086
  element.style.display = 'none';
8049
- element.setAttribute('data-nebulajs-version', "3.0.4" );
8087
+ element.setAttribute('data-nebulajs-version', "3.1.0-alpha.0" );
8050
8088
  element.setAttribute('data-app-id', app.id);
8051
8089
  document.body.appendChild(element);
8052
8090
  ReactDOM.render( /*#__PURE__*/React__default.createElement(NebulaApp, {
@@ -9809,7 +9847,7 @@ function getListboxInlineKeyboardNavigation(_ref2) {
9809
9847
  } = _ref2;
9810
9848
 
9811
9849
  const focusInsideListbox = element => {
9812
- const fieldElement = element.querySelector('.search input, .value.selector, .value');
9850
+ const fieldElement = element.querySelector('.search input, .value.selector, .value, .ActionsToolbar-* button');
9813
9851
  setKeyboardActive(true);
9814
9852
 
9815
9853
  if (fieldElement) {
@@ -9966,11 +10004,11 @@ const Root$1 = styled$1('div')(_ref2 => {
9966
10004
  width: '100%',
9967
10005
  height: '100%',
9968
10006
  // The checkbox's span
9969
- '& > span:nth-child(1)': {
10007
+ '& > span:nth-of-type(1)': {
9970
10008
  paddingRight: '8px'
9971
10009
  },
9972
10010
  // The checkbox's label container.
9973
- '& > span:nth-child(2)': _objectSpread2(_objectSpread2({}, ellipsis), {}, {
10011
+ '& > span:nth-of-type(2)': _objectSpread2(_objectSpread2({}, ellipsis), {}, {
9974
10012
  display: 'flex',
9975
10013
  alignItems: 'center',
9976
10014
  paddingLeft: 0
@@ -10363,7 +10401,6 @@ function ListBox(_ref2) {
10363
10401
  keyboard = {},
10364
10402
  showGray = true,
10365
10403
  scrollState,
10366
- sortByState,
10367
10404
  selectDisabled = () => false,
10368
10405
  setCount
10369
10406
  } = _ref2;
@@ -10454,9 +10491,9 @@ function ListBox(_ref2) {
10454
10491
  local.current.validPages = false;
10455
10492
 
10456
10493
  if (loaderRef.current) {
10457
- loaderRef.current.resetloadMoreItemsCache(true); // Skip scrollToItem if we are in selections, or if we dont sort by state.
10494
+ loaderRef.current.resetloadMoreItemsCache(true); // Skip scrollToItem if we are in selections.
10458
10495
 
10459
- if (layout && layout.qSelectionInfo.qInSelections || sortByState === 0) {
10496
+ if (layout && layout.qSelectionInfo.qInSelections) {
10460
10497
  return;
10461
10498
  }
10462
10499
 
@@ -10707,6 +10744,7 @@ const ActionElement = {
10707
10744
  };
10708
10745
  const Item = React__default.forwardRef((_ref, ref) => {
10709
10746
  let {
10747
+ ariaExpanded = false,
10710
10748
  item,
10711
10749
  addAnchor = false
10712
10750
  } = _ref;
@@ -10727,7 +10765,9 @@ const Item = React__default.forwardRef((_ref, ref) => {
10727
10765
  disabled: disabled,
10728
10766
  style: style,
10729
10767
  className: ActionElement.className,
10730
- size: "large"
10768
+ size: "large",
10769
+ "aria-expanded": ariaExpanded,
10770
+ "aria-controls": "moreMenuList"
10731
10771
  }, hasSvgIconShape && SvgIcon(item.getSvgIconShape()), addAnchor && /*#__PURE__*/React__default.createElement("div", {
10732
10772
  ref: ref,
10733
10773
  style: {
@@ -10844,7 +10884,8 @@ function MoreItem(_ref2) {
10844
10884
  return !hidden ? /*#__PURE__*/React__default.createElement(MenuItem, {
10845
10885
  title: item.label,
10846
10886
  onClick: handleClick,
10847
- disabled: disabled
10887
+ disabled: disabled,
10888
+ tabindex: "0"
10848
10889
  }, hasSvgIconShape && /*#__PURE__*/React__default.createElement(ListItemIcon, {
10849
10890
  className: classes$8.icon
10850
10891
  }, SvgIcon(item.getSvgIconShape())), /*#__PURE__*/React__default.createElement(Typography, {
@@ -10890,7 +10931,9 @@ const More$1 = React__default.forwardRef((_ref3, ref) => {
10890
10931
  maxWidth: '250px'
10891
10932
  }, popoverPaperStyle)
10892
10933
  }
10893
- }), /*#__PURE__*/React__default.createElement(MenuList, null, actions.map((item, ix) =>
10934
+ }), /*#__PURE__*/React__default.createElement(MenuList, {
10935
+ id: "moreMenuList"
10936
+ }, actions.map((item, ix) =>
10894
10937
  /*#__PURE__*/
10895
10938
  // eslint-disable-next-line react/no-array-index-key
10896
10939
  React__default.createElement(MoreItem, {
@@ -10934,6 +10977,7 @@ const ActionToolbarElement = {
10934
10977
  };
10935
10978
  const ActionsGroup = React__default.forwardRef((_ref2, ref) => {
10936
10979
  let {
10980
+ ariaExpanded = false,
10937
10981
  actions = [],
10938
10982
  first = false,
10939
10983
  last = false,
@@ -10966,6 +11010,7 @@ const ActionsGroup = React__default.forwardRef((_ref2, ref) => {
10966
11010
  key: e.key,
10967
11011
  className: cls.join(' ').trim()
10968
11012
  }, /*#__PURE__*/React__default.createElement(Item, {
11013
+ ariaExpanded: ariaExpanded,
10969
11014
  key: e.key,
10970
11015
  item: e,
10971
11016
  ref: ix === 0 ? ref : null,
@@ -11104,6 +11149,7 @@ function ActionsToolbar(_ref3) {
11104
11149
  last: !showMore && !selections.show
11105
11150
  }), showMore && /*#__PURE__*/React__default.createElement(ActionsGroup, {
11106
11151
  ref: moreRef,
11152
+ ariaExpanded: showMoreItems,
11107
11153
  actions: [moreItem],
11108
11154
  first: !showActions,
11109
11155
  last: !selections.show,
@@ -12929,146 +12975,59 @@ function useConfirmUnfocus(ref, selections, shouldConfirmOnBlur) {
12929
12975
 
12930
12976
  const PREFIX$4 = 'ListBoxInline';
12931
12977
  const classes$4 = {
12932
- listBoxHeader: "".concat(PREFIX$4, "-listBoxHeader")
12978
+ listBoxHeader: "".concat(PREFIX$4, "-listBoxHeader"),
12979
+ screenReaderOnly: "".concat(PREFIX$4, "-screenReaderOnly")
12933
12980
  };
12934
12981
  const StyledGrid$3 = styled$1(Grid)(() => ({
12935
12982
  ["& .".concat(classes$4.listBoxHeader)]: {
12936
12983
  alignSelf: 'center',
12937
- display: 'inline-flex'
12938
- }
12939
- }));
12940
- function ListBoxInline(_ref) {
12941
- let {
12942
- app,
12943
- fieldIdentifier,
12944
- stateName = '$',
12945
- options = {},
12946
- fieldDef
12947
- } = _ref;
12948
- const {
12949
- title,
12950
- direction,
12951
- listLayout,
12952
- search = true,
12953
- focusSearch = false,
12954
- toolbar = true,
12955
- rangeSelect = true,
12956
- checkboxes = false,
12957
- properties = {},
12958
- sessionModel = undefined,
12959
- selectionsApi = undefined,
12960
- update = undefined,
12961
- fetchStart = undefined,
12962
- dense = false,
12963
- selectDisabled = () => false,
12964
- postProcessPages = undefined,
12965
- calculatePagesHeight,
12966
- showGray = true,
12967
- scrollState = undefined,
12968
- setCount = undefined,
12969
- shouldConfirmOnBlur = undefined
12970
- } = options;
12971
- let {
12972
- frequencyMode,
12973
- histogram = false
12974
- } = options;
12975
-
12976
- if (fieldDef && fieldDef.failedToFetchFieldDef) {
12977
- histogram = false;
12978
- frequencyMode = 'N';
12979
- }
12980
-
12981
- switch (true) {
12982
- case ['none', 'N', 'NX_FREQUENCY_NONE'].includes(frequencyMode):
12983
- frequencyMode = 'N';
12984
- break;
12985
-
12986
- case ['value', 'V', 'NX_FREQUENCY_VALUE', 'default'].includes(frequencyMode):
12987
- frequencyMode = 'V';
12988
- break;
12989
-
12990
- case ['percent', 'P', 'NX_FREQUENCY_PERCENT'].includes(frequencyMode):
12991
- frequencyMode = 'P';
12992
- break;
12993
-
12994
- case ['relative', 'R', 'NX_FREQUENCY_RELATIVE'].includes(frequencyMode):
12995
- frequencyMode = 'R';
12996
- break;
12997
-
12998
- default:
12999
- frequencyMode = 'N';
13000
- break;
13001
- }
13002
-
13003
- const getListdefFrequencyMode = () => histogram && frequencyMode === 'N' ? 'V' : frequencyMode; // Hook that will trigger update when used in useEffects.
13004
- // Modified from: https://medium.com/@teh_builder/ref-objects-inside-useeffect-hooks-eb7c15198780
13005
-
13006
-
13007
- const useRefWithCallback = () => {
13008
- const [ref, setInternalRef] = useState$1({});
13009
- const setRef = useCallback(node => {
13010
- setInternalRef({
13011
- current: node
13012
- });
13013
- }, [setInternalRef]);
13014
- return [ref, setRef];
13015
- };
13016
-
13017
- const listdef = {
13018
- qInfo: {
13019
- qType: 'njsListbox'
13020
- },
13021
- qListObjectDef: {
13022
- qStateName: stateName,
13023
- qShowAlternatives: true,
13024
- qFrequencyMode: getListdefFrequencyMode(),
13025
- qInitialDataFetch: [{
13026
- qTop: 0,
13027
- qLeft: 0,
13028
- qWidth: 0,
13029
- qHeight: 0
13030
- }],
13031
- qDef: {
13032
- qSortCriterias: [{
13033
- qSortByState: 1,
13034
- qSortByAscii: 1,
13035
- qSortByNumeric: 1,
13036
- qSortByLoadOrder: 1
13037
- }]
13038
- }
13039
- },
13040
- title
13041
- };
13042
- extend$2(true, listdef, properties); // Something something lib dimension
13043
-
13044
- let fieldName;
13045
-
13046
- if (fieldIdentifier.qLibraryId) {
13047
- listdef.qListObjectDef.qLibraryId = fieldIdentifier.qLibraryId;
13048
- fieldName = fieldIdentifier.qLibraryId;
13049
- } else {
13050
- listdef.qListObjectDef.qDef.qFieldDefs = [fieldIdentifier];
13051
- fieldName = fieldIdentifier;
13052
- }
13053
-
13054
- if (frequencyMode !== 'N' || histogram) {
13055
- const field = fieldIdentifier.qLibraryId ? fieldDef : fieldName;
13056
- listdef.frequencyMax = {
13057
- qValueExpression: "Max(AGGR(Count([".concat(field, "]), [").concat(field, "]))")
13058
- };
13059
- }
13060
-
13061
- let [model] = useSessionModel(listdef, sessionModel ? null : app, fieldName, stateName);
13062
-
13063
- if (sessionModel) {
13064
- model = sessionModel;
12984
+ display: 'inline-flex'
12985
+ },
12986
+ ["& .".concat(classes$4.screenReaderOnly)]: {
12987
+ position: 'absolute',
12988
+ height: 0,
12989
+ width: 0,
12990
+ overflow: 'hidden'
13065
12991
  }
12992
+ }));
12993
+ function ListBoxInline(_ref) {
12994
+ let {
12995
+ options = {}
12996
+ } = _ref;
12997
+ const {
12998
+ direction,
12999
+ frequencyMode,
13000
+ histogram = false,
13001
+ listLayout,
13002
+ search = true,
13003
+ focusSearch = false,
13004
+ toolbar = true,
13005
+ rangeSelect = true,
13006
+ checkboxes = false,
13007
+ model,
13008
+ selections,
13009
+ update = undefined,
13010
+ fetchStart = undefined,
13011
+ dense = false,
13012
+ selectDisabled = () => false,
13013
+ postProcessPages = undefined,
13014
+ calculatePagesHeight,
13015
+ showGray = true,
13016
+ scrollState = undefined,
13017
+ setCount = undefined,
13018
+ shouldConfirmOnBlur = undefined
13019
+ } = options; // Hook that will trigger update when used in useEffects.
13020
+ // Modified from: https://medium.com/@teh_builder/ref-objects-inside-useeffect-hooks-eb7c15198780
13066
13021
 
13067
- let selections = useObjectSelections(selectionsApi ? {} : app, model)[0];
13068
-
13069
- if (selectionsApi) {
13070
- selections = selectionsApi;
13071
- }
13022
+ const useRefWithCallback = () => {
13023
+ const [ref, setInternalRef] = useState$1({});
13024
+ const setRef = useCallback(node => {
13025
+ setInternalRef({
13026
+ current: node
13027
+ });
13028
+ }, [setInternalRef]);
13029
+ return [ref, setRef];
13030
+ };
13072
13031
 
13073
13032
  const theme = useTheme$1();
13074
13033
  const lock = useCallback(() => {
@@ -13119,7 +13078,7 @@ function ListBoxInline(_ref) {
13119
13078
  }
13120
13079
 
13121
13080
  return () => {
13122
- if (selections) {
13081
+ if (selections && selections.removeListener) {
13123
13082
  selections.removeListener('deactivated', show);
13124
13083
  selections.removeListener('activated', hide);
13125
13084
  }
@@ -13181,7 +13140,8 @@ function ListBoxInline(_ref) {
13181
13140
  gap: 0,
13182
13141
  style: {
13183
13142
  height: '100%',
13184
- minHeight: "".concat(minHeight, "px")
13143
+ minHeight: "".concat(minHeight, "px"),
13144
+ flexFlow: 'column nowrap'
13185
13145
  },
13186
13146
  onKeyDown: handleKeyDown,
13187
13147
  ref: listBoxRef
@@ -13231,9 +13191,21 @@ function ListBoxInline(_ref) {
13231
13191
  onCancel: () => {}
13232
13192
  }
13233
13193
  }))), /*#__PURE__*/React__default.createElement(Grid, {
13194
+ item: true,
13195
+ container: true,
13196
+ direction: "column",
13197
+ style: {
13198
+ height: '100%',
13199
+ minHeight: "".concat(minHeight, "px")
13200
+ },
13201
+ role: "region",
13202
+ "aria-label": translator.get('Listbox.ResultFilterLabel')
13203
+ }, /*#__PURE__*/React__default.createElement(Grid, {
13234
13204
  item: true,
13235
13205
  ref: searchContainerRef
13236
- }, /*#__PURE__*/React__default.createElement(ListBoxSearch, {
13206
+ }, /*#__PURE__*/React__default.createElement("div", {
13207
+ className: classes$4.screenReaderOnly
13208
+ }, translator.get('Listbox.Search.ScreenReaderInstructions')), /*#__PURE__*/React__default.createElement(ListBoxSearch, {
13237
13209
  selections: selections,
13238
13210
  model: model,
13239
13211
  dense: dense,
@@ -13245,7 +13217,9 @@ function ListBoxInline(_ref) {
13245
13217
  xs: true
13246
13218
  }, /*#__PURE__*/React__default.createElement("div", {
13247
13219
  ref: moreAlignTo
13248
- }), /*#__PURE__*/React__default.createElement(AutoSizer, null, _ref2 => {
13220
+ }), /*#__PURE__*/React__default.createElement("div", {
13221
+ className: classes$4.screenReaderOnly
13222
+ }, translator.get('Listbox.ScreenReaderInstructions')), /*#__PURE__*/React__default.createElement(AutoSizer, null, _ref2 => {
13249
13223
  let {
13250
13224
  height,
13251
13225
  width
@@ -13270,32 +13244,63 @@ function ListBoxInline(_ref) {
13270
13244
  keyboard: keyboard,
13271
13245
  showGray: showGray,
13272
13246
  scrollState: scrollState,
13273
- sortByState: listdef.qListObjectDef.qDef.qSortCriterias[0].qSortByState,
13274
13247
  setCount: setCount
13275
13248
  });
13276
- })));
13249
+ }))));
13250
+ }
13251
+
13252
+ function useExistingModel(_ref) {
13253
+ let {
13254
+ app,
13255
+ qId,
13256
+ options = {}
13257
+ } = _ref;
13258
+ const [model, setModel] = useState$1();
13259
+ const [modelStore] = useModelStore();
13260
+ const {
13261
+ sessionModel
13262
+ } = options;
13263
+ useEffect$1(() => {
13264
+ async function fetchObject() {
13265
+ const modelFromStore = modelStore.get(qId);
13266
+
13267
+ if (modelFromStore) {
13268
+ setModel(modelFromStore);
13269
+ } else {
13270
+ const m = await app.getObject(qId);
13271
+ modelStore.set(m.id, m);
13272
+ setModel(m);
13273
+ }
13274
+ }
13275
+
13276
+ if (sessionModel) {
13277
+ setModel(sessionModel);
13278
+ } else {
13279
+ fetchObject();
13280
+ }
13281
+ }, []);
13282
+ return model;
13277
13283
  }
13278
13284
 
13279
- function ListBoxFetchMasterItem(_ref) {
13285
+ function useOnTheFlyModel(_ref) {
13280
13286
  let {
13281
13287
  app,
13282
13288
  fieldIdentifier,
13283
- stateName = '$',
13289
+ stateName,
13284
13290
  options = {}
13285
13291
  } = _ref;
13286
13292
  const [fieldDef, setFieldDef] = useState$1('');
13287
- const [isFetchingData, setIsFetchingData] = useState$1(false);
13293
+ const [isFetching, setIsFetching] = useState$1(true);
13294
+ const [model, setModel] = useState$1();
13288
13295
  useEffect$1(() => {
13289
- async function fetchData() {
13290
- setIsFetchingData(true);
13291
-
13296
+ async function fetchMasterItem() {
13292
13297
  try {
13293
13298
  const dim = await app.getDimension(fieldIdentifier.qLibraryId);
13294
13299
  const dimLayout = await dim.getLayout();
13295
13300
  setFieldDef(dimLayout.qDim.qFieldDefs ? dimLayout.qDim.qFieldDefs[0] : '');
13296
- setIsFetchingData(false);
13301
+ setIsFetching(false);
13297
13302
  } catch (e) {
13298
- setIsFetchingData(false);
13303
+ setIsFetching(false);
13299
13304
  setFieldDef({
13300
13305
  failedToFetchFieldDef: true
13301
13306
  });
@@ -13303,36 +13308,193 @@ function ListBoxFetchMasterItem(_ref) {
13303
13308
  }
13304
13309
  }
13305
13310
 
13306
- fetchData();
13311
+ const isFrequencyMaxNeeded = options.histogram || options.frequencyMode !== 'N';
13312
+ const shouldFetchMasterItem = fieldIdentifier.qLibraryId && isFrequencyMaxNeeded;
13313
+
13314
+ if (shouldFetchMasterItem) {
13315
+ fetchMasterItem();
13316
+ } else {
13317
+ setIsFetching(false);
13318
+ }
13307
13319
  }, []);
13320
+ const {
13321
+ title,
13322
+ properties = {}
13323
+ } = options;
13324
+ let {
13325
+ frequencyMode,
13326
+ histogram = false
13327
+ } = options;
13308
13328
 
13309
- if (isFetchingData) {
13310
- return null;
13329
+ if (fieldDef && fieldDef.failedToFetchFieldDef) {
13330
+ histogram = false;
13331
+ frequencyMode = 'N';
13311
13332
  }
13312
13333
 
13313
- return /*#__PURE__*/React__default.createElement(ListBoxInline, {
13314
- app: app,
13315
- fieldIdentifier: fieldIdentifier,
13316
- stateName: stateName,
13317
- options: options,
13318
- fieldDef: fieldDef
13319
- });
13334
+ switch (true) {
13335
+ case ['none', 'N', 'NX_FREQUENCY_NONE'].includes(frequencyMode):
13336
+ frequencyMode = 'N';
13337
+ break;
13338
+
13339
+ case ['value', 'V', 'NX_FREQUENCY_VALUE', 'default'].includes(frequencyMode):
13340
+ frequencyMode = 'V';
13341
+ break;
13342
+
13343
+ case ['percent', 'P', 'NX_FREQUENCY_PERCENT'].includes(frequencyMode):
13344
+ frequencyMode = 'P';
13345
+ break;
13346
+
13347
+ case ['relative', 'R', 'NX_FREQUENCY_RELATIVE'].includes(frequencyMode):
13348
+ frequencyMode = 'R';
13349
+ break;
13350
+
13351
+ default:
13352
+ frequencyMode = 'N';
13353
+ break;
13354
+ }
13355
+
13356
+ const getListdefFrequencyMode = () => histogram && frequencyMode === 'N' ? 'V' : frequencyMode;
13357
+
13358
+ const listdef = {
13359
+ qInfo: {
13360
+ qType: 'njsListbox'
13361
+ },
13362
+ qListObjectDef: {
13363
+ qStateName: stateName,
13364
+ qShowAlternatives: true,
13365
+ qFrequencyMode: getListdefFrequencyMode(),
13366
+ qInitialDataFetch: [{
13367
+ qTop: 0,
13368
+ qLeft: 0,
13369
+ qWidth: 0,
13370
+ qHeight: 0
13371
+ }],
13372
+ qDef: {
13373
+ qSortCriterias: [{
13374
+ qSortByState: 1,
13375
+ qSortByAscii: 1,
13376
+ qSortByNumeric: 1,
13377
+ qSortByLoadOrder: 1
13378
+ }]
13379
+ }
13380
+ },
13381
+ title
13382
+ };
13383
+ extend$1(true, listdef, properties); // Something something lib dimension
13384
+
13385
+ let fieldName;
13386
+
13387
+ if (fieldIdentifier.qLibraryId) {
13388
+ listdef.qListObjectDef.qLibraryId = fieldIdentifier.qLibraryId;
13389
+ fieldName = fieldIdentifier.qLibraryId;
13390
+ } else {
13391
+ listdef.qListObjectDef.qDef.qFieldDefs = [fieldIdentifier];
13392
+ fieldName = fieldIdentifier;
13393
+ }
13394
+
13395
+ if (frequencyMode !== 'N' || histogram) {
13396
+ const field = fieldIdentifier.qLibraryId ? fieldDef : fieldName;
13397
+ listdef.frequencyMax = {
13398
+ qValueExpression: "Max(AGGR(Count([".concat(field, "]), [").concat(field, "]))")
13399
+ };
13400
+ }
13401
+
13402
+ const [sessionModel] = useSessionModel(listdef, isFetching ? null : app, fieldName, stateName);
13403
+ useEffect$1(() => {
13404
+ if (!sessionModel) {
13405
+ return;
13406
+ }
13407
+
13408
+ setModel(sessionModel);
13409
+ }, [sessionModel]);
13410
+ return model;
13411
+ }
13412
+
13413
+ const OBJECT_SOURCE = {
13414
+ ON_THE_FLY: 'ON_THE_FLY',
13415
+ EXISTING: 'EXISTING'
13416
+ };
13417
+ const SELECTIONS_API = {
13418
+ INTERNAL: 'INTERNAL',
13419
+ EXTERNAL: 'EXTERNAL'
13420
+ };
13421
+
13422
+ function identify(_ref) {
13423
+ let {
13424
+ qId,
13425
+ options
13426
+ } = _ref;
13427
+ const variant = {}; // Existing or on the fly
13428
+
13429
+ variant.objectSource = qId || options.sessionModel ? OBJECT_SOURCE.EXISTING : OBJECT_SOURCE.ON_THE_FLY; // Use internal or external selectionsApi
13430
+
13431
+ variant.selectionsApi = options.selectionsApi ? SELECTIONS_API.EXTERNAL : SELECTIONS_API.INTERNAL;
13432
+ return variant;
13320
13433
  }
13321
- function ListBoxPortal(_ref2) {
13434
+
13435
+ function ListBoxWrapper(_ref2) {
13322
13436
  let {
13323
13437
  app,
13324
13438
  fieldIdentifier,
13439
+ qId,
13325
13440
  stateName,
13326
- element,
13327
13441
  options
13328
13442
  } = _ref2;
13329
- const isFrequencyMaxNeeded = options.histogram || options.frequencyMode !== 'N';
13330
- const TheComponent = fieldIdentifier.qLibraryId && isFrequencyMaxNeeded ? ListBoxFetchMasterItem : ListBoxInline;
13331
- return ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(TheComponent, {
13443
+ const {
13444
+ objectSource,
13445
+ selectionsApi
13446
+ } = identify({
13447
+ qId,
13448
+ options
13449
+ });
13450
+ const [changeCount, setChangeCount] = useState$1(0);
13451
+ useEffect$1(() => {
13452
+ if (changeCount) {
13453
+ throw new Error('Source or selection Api can not change after a listbox has been mounted');
13454
+ }
13455
+
13456
+ setChangeCount(changeCount + 1);
13457
+ }, [objectSource, selectionsApi]);
13458
+ const model = objectSource === OBJECT_SOURCE.EXISTING ? useExistingModel({
13459
+ app,
13460
+ qId,
13461
+ options
13462
+ }) : useOnTheFlyModel({
13463
+ app,
13464
+ fieldIdentifier,
13465
+ stateName,
13466
+ options
13467
+ });
13468
+ const selections = selectionsApi === SELECTIONS_API.EXTERNAL ? options.selectionsApi : useObjectSelections(app, model)[0];
13469
+
13470
+ if (!selections || !model) {
13471
+ return null;
13472
+ }
13473
+
13474
+ const opts = _objectSpread2(_objectSpread2({}, options), {}, {
13475
+ selections,
13476
+ model
13477
+ });
13478
+
13479
+ return /*#__PURE__*/React__default.createElement(ListBoxInline, {
13480
+ options: opts
13481
+ });
13482
+ }
13483
+
13484
+ function ListBoxPortal(_ref3) {
13485
+ let {
13486
+ element,
13487
+ app,
13488
+ fieldIdentifier,
13489
+ qId,
13490
+ stateName = '$',
13491
+ options = {}
13492
+ } = _ref3;
13493
+ return ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(ListBoxWrapper, {
13332
13494
  app: app,
13333
13495
  fieldIdentifier: fieldIdentifier,
13496
+ qId: qId,
13334
13497
  stateName: stateName,
13335
- element: element,
13336
13498
  options: options
13337
13499
  }), element);
13338
13500
  }
@@ -13434,12 +13596,15 @@ function hcHandler(_ref) {
13434
13596
  hc.qLayoutExclude.qHyperCubeDef.qMeasures = hc.qLayoutExclude.qHyperCubeDef.qMeasures || [];
13435
13597
  hc.qLayoutExclude.qHyperCubeDef.qDimensions.push(dimension);
13436
13598
  }
13599
+
13600
+ return dimension;
13437
13601
  },
13438
13602
 
13439
13603
  removeDimension(idx) {
13440
13604
  const dimension = hc.qDimensions.splice(idx, 1)[0];
13441
13605
  removeIndex(hc.qInterColumnSortOrder, idx);
13442
13606
  def.dimensions.removed(dimension, objectProperties, idx);
13607
+ return dimension;
13443
13608
  },
13444
13609
 
13445
13610
  addMeasure(m) {
@@ -13829,7 +13994,7 @@ function getOthersLabel() {
13829
13994
  }
13830
13995
 
13831
13996
  function createDefaultDimension(dimensionDef, dimensionProperties) {
13832
- const def = extend$2(true, {}, dimensionProperties, dimensionDef);
13997
+ const def = extend$1(true, {}, dimensionProperties, dimensionDef);
13833
13998
 
13834
13999
  if (!utils.getValue(def, 'qOtherTotalSpec.qOtherCounted')) {
13835
14000
  utils.setValue(def, 'qOtherTotalSpec.qOtherCounted', {
@@ -13851,7 +14016,7 @@ function createDefaultDimension(dimensionDef, dimensionProperties) {
13851
14016
  }
13852
14017
 
13853
14018
  function createDefaultMeasure(measureDef, measureProperties) {
13854
- return extend$2(true, {}, measureProperties, measureDef);
14019
+ return extend$1(true, {}, measureProperties, measureDef);
13855
14020
  }
13856
14021
 
13857
14022
  function resolveValue$1(data, input, defaultValue) {
@@ -13947,7 +14112,7 @@ function createNewProperties(_ref2) {
13947
14112
  Object.keys(exportFormat.properties).forEach(key => {
13948
14113
  if (key === 'qLayoutExclude') {
13949
14114
  if (exportFormat.properties[key].quarantine) {
13950
- newProperties.qLayoutExclude.quarantine = extend$2(true, {}, exportFormat.properties[key].quarantine);
14115
+ newProperties.qLayoutExclude.quarantine = extend$1(true, {}, exportFormat.properties[key].quarantine);
13951
14116
  }
13952
14117
  } else if (key === 'qHyperCubeDef' && hypercubePath) {
13953
14118
  utils.setValue(newProperties, "".concat(hypercubePath, ".qHyperCubeDef"), exportFormat.properties.qHyperCubeDef);
@@ -13958,7 +14123,7 @@ function createNewProperties(_ref2) {
13958
14123
  newProperties.qLayoutExclude.disabled[key] = exportFormat.properties[key];
13959
14124
  }
13960
14125
  });
13961
- newProperties = extend$2(true, {}, initialProperties, newProperties);
14126
+ newProperties = extend$1(true, {}, initialProperties, newProperties);
13962
14127
 
13963
14128
  if (newProperties.components === null) {
13964
14129
  newProperties.components = [];
@@ -15182,6 +15347,115 @@ function Supernova(_ref) {
15182
15347
  }));
15183
15348
  }
15184
15349
 
15350
+ const imageSizingToCssProperty = {
15351
+ originalSize: 'auto auto',
15352
+ alwaysFit: 'contain',
15353
+ fitWidth: '100% auto',
15354
+ fitHeight: 'auto 100%',
15355
+ stretchFit: '100% 100%',
15356
+ alwaysFill: 'cover'
15357
+ };
15358
+ const positionToCss = {
15359
+ 'top-left': 'top left',
15360
+ 'top-center': 'top center',
15361
+ 'top-right': 'top right',
15362
+ 'center-left': 'center left',
15363
+ 'center-center': 'center center',
15364
+ 'center-right': 'center right',
15365
+ 'bottom-left': 'bottom left',
15366
+ 'bottom-center': 'bottom center',
15367
+ 'bottom-right': 'bottom right'
15368
+ }; // TODO: this needs some proper verification
15369
+
15370
+ function getSenseServerUrl(app) {
15371
+ var _app$session;
15372
+
15373
+ let config;
15374
+ let wsUrl;
15375
+ let protocol;
15376
+ let isSecure;
15377
+
15378
+ if (app !== null && app !== void 0 && (_app$session = app.session) !== null && _app$session !== void 0 && _app$session.config) {
15379
+ config = app.session.config;
15380
+ wsUrl = new URL(config.url);
15381
+ isSecure = wsUrl.protocol === 'wss:';
15382
+ protocol = isSecure ? 'https://' : 'http://';
15383
+ return protocol + wsUrl.host;
15384
+ }
15385
+
15386
+ return undefined;
15387
+ }
15388
+
15389
+ function getBackgroundPosition(bgComp) {
15390
+ var _bgComp$bgImage;
15391
+
15392
+ let bkgImagePosition = 'center center';
15393
+
15394
+ if (bgComp !== null && bgComp !== void 0 && (_bgComp$bgImage = bgComp.bgImage) !== null && _bgComp$bgImage !== void 0 && _bgComp$bgImage.position) {
15395
+ bkgImagePosition = positionToCss[bgComp.bgImage.position];
15396
+ }
15397
+
15398
+ return bkgImagePosition;
15399
+ }
15400
+
15401
+ function getBackgroundSize(bgComp) {
15402
+ var _bgComp$bgImage2;
15403
+
15404
+ let bkgImageSize = imageSizingToCssProperty.originalSize;
15405
+
15406
+ if (bgComp !== null && bgComp !== void 0 && (_bgComp$bgImage2 = bgComp.bgImage) !== null && _bgComp$bgImage2 !== void 0 && _bgComp$bgImage2.sizing) {
15407
+ bkgImageSize = imageSizingToCssProperty[bgComp.bgImage.sizing];
15408
+ }
15409
+
15410
+ return bkgImageSize;
15411
+ }
15412
+
15413
+ function resolveImageUrl(app, relativeUrl) {
15414
+ return relativeUrl ? getSenseServerUrl(app) + relativeUrl : undefined;
15415
+ }
15416
+
15417
+ const resolveBgImage = (bgComp, app) => {
15418
+ const bgImageDef = bgComp === null || bgComp === void 0 ? void 0 : bgComp.bgImage;
15419
+
15420
+ if (bgImageDef) {
15421
+ let url = '';
15422
+
15423
+ if (bgImageDef.mode === 'media') {
15424
+ var _bgImageDef$mediaUrl, _bgImageDef$mediaUrl$;
15425
+
15426
+ 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;
15427
+ url = resolveImageUrl(app, url);
15428
+ }
15429
+
15430
+ if (bgImageDef.mode === 'expression') {
15431
+ url = bgImageDef.expressionUrl ? decodeURIComponent(bgImageDef.expressionUrl) : undefined;
15432
+ }
15433
+
15434
+ const pos = getBackgroundPosition(bgComp);
15435
+ const size = getBackgroundSize(bgComp);
15436
+ return url ? {
15437
+ url,
15438
+ pos,
15439
+ size
15440
+ } : undefined;
15441
+ }
15442
+
15443
+ return undefined;
15444
+ };
15445
+ const resolveBgColor = (bgComp, theme) => {
15446
+ const bgColor = bgComp === null || bgComp === void 0 ? void 0 : bgComp.bgColor;
15447
+
15448
+ if (bgColor && theme) {
15449
+ if (bgColor.useColorExpression) {
15450
+ return theme.validateColor(bgColor.colorExpression);
15451
+ }
15452
+
15453
+ return bgColor.color && bgColor.color.color !== 'none' ? theme.getColorPickerColor(bgColor.color) : undefined;
15454
+ }
15455
+
15456
+ return undefined;
15457
+ };
15458
+
15185
15459
  /**
15186
15460
  * @interface
15187
15461
  * @extends HTMLElement
@@ -15522,6 +15796,9 @@ const Cell = forwardRef((_ref6, ref) => {
15522
15796
  enter: null,
15523
15797
  leave: null
15524
15798
  });
15799
+ const [bgColor, setBgColor] = useState$1(undefined);
15800
+ const [bgImage, setBgImage] = useState$1(undefined); // {url: "", size: "", pos: ""}
15801
+
15525
15802
  const focusHandler = useRef({
15526
15803
  focusToolbarButton(last) {
15527
15804
  // eslint-disable-next-line react/no-this-in-sfc
@@ -15532,6 +15809,11 @@ const Cell = forwardRef((_ref6, ref) => {
15532
15809
  useEffect$1(() => {
15533
15810
  eventmixin(focusHandler.current);
15534
15811
  }, []);
15812
+ useEffect$1(() => {
15813
+ const bgComp = layout !== null && layout !== void 0 && layout.components ? layout.components.find(comp => comp.key === 'general') : null;
15814
+ setBgColor(resolveBgColor(bgComp, halo.public.theme));
15815
+ setBgImage(resolveBgImage(bgComp, halo.app));
15816
+ }, [layout, halo.public.theme, halo.app]);
15535
15817
 
15536
15818
  focusHandler.current.blurCallback = resetFocus => {
15537
15819
  halo.root.toggleFocusOfCells();
@@ -15746,7 +16028,12 @@ const Cell = forwardRef((_ref6, ref) => {
15746
16028
  position: 'relative',
15747
16029
  width: '100%',
15748
16030
  height: '100%',
15749
- overflow: 'hidden'
16031
+ overflow: 'hidden',
16032
+ backgroundColor: bgColor,
16033
+ backgroundImage: bgImage && bgImage.url ? "url(".concat(bgImage.url, ")") : undefined,
16034
+ backgroundRepeat: 'no-repeat',
16035
+ backgroundSize: bgImage && bgImage.size,
16036
+ backgroundPosition: bgImage && bgImage.pos
15750
16037
  },
15751
16038
  elevation: 0,
15752
16039
  square: true,
@@ -16243,7 +16530,7 @@ function flagsFn () {
16243
16530
  }
16244
16531
 
16245
16532
  /* eslint no-param-reassign: 0, no-restricted-globals: 0 */
16246
- const extend = extend$2.bind(null, true);
16533
+ const extend = extend$1.bind(null, true);
16247
16534
  const JSONPatch = {};
16248
16535
  const {
16249
16536
  isArray
@@ -20725,7 +21012,7 @@ function nuked() {
20725
21012
 
20726
21013
  /**
20727
21014
  * Gets the listbox instance of the specified field
20728
- * @param {string|LibraryField} fieldIdentifier Fieldname as a string or a Library dimension
21015
+ * @param {string|LibraryField|QInfo} fieldIdentifier Fieldname as a string, a Library dimension or an object id
20729
21016
  * @returns {Promise<FieldInstance>}
20730
21017
  * @since 1.1.0
20731
21018
  * @example
@@ -20733,10 +21020,13 @@ function nuked() {
20733
21020
  * fieldInstance.mount(element, { title: "Hello Field"});
20734
21021
  */
20735
21022
  field: async fieldIdentifier => {
21023
+ let qId;
20736
21024
  const fieldName = typeof fieldIdentifier === 'string' ? fieldIdentifier : fieldIdentifier.qLibraryId;
20737
21025
 
20738
- if (!fieldName) {
20739
- throw new Error("Field identifier must be provided");
21026
+ if (fieldIdentifier.qId) {
21027
+ qId = fieldIdentifier.qId;
21028
+ } else if (!fieldName) {
21029
+ throw new Error("Field identifier or object id must be provided");
20740
21030
  }
20741
21031
  /**
20742
21032
  * @typedef { 'ltr' | 'rtl' } Direction
@@ -20789,17 +21079,18 @@ function nuked() {
20789
21079
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
20790
21080
 
20791
21081
  if (!element) {
20792
- throw new Error("Element for ".concat(fieldName, " not provided"));
21082
+ throw new Error("Element for ".concat(fieldName || qId, " not provided"));
20793
21083
  }
20794
21084
 
20795
21085
  if (this._instance) {
20796
- throw new Error("Field ".concat(fieldName, " already mounted"));
21086
+ throw new Error("Field or object ".concat(fieldName || qId, " already mounted"));
20797
21087
  }
20798
21088
 
20799
21089
  this._instance = ListBoxPortal({
20800
21090
  element,
20801
21091
  app,
20802
21092
  fieldIdentifier,
21093
+ qId,
20803
21094
  options: getOptions(options),
20804
21095
  stateName: options.stateName || '$'
20805
21096
  });
@@ -20894,6 +21185,11 @@ function nuked() {
20894
21185
  * @property {function(): Promise<ThemeJSON>} load A function that should return a Promise that resolves to a raw JSON theme.
20895
21186
  */
20896
21187
 
21188
+ /**
21189
+ * @interface QInfo
21190
+ * @property {string} qId Generic object id
21191
+ */
21192
+
20897
21193
 
20898
21194
  var index$1 = nuked(DEFAULT_CONFIG);
20899
21195
 
@@ -20902,7 +21198,7 @@ var enigmaMocker = {exports: {}};
20902
21198
  var enigmaMocker_dev = {exports: {}};
20903
21199
 
20904
21200
  /*
20905
- * @nebula.js/enigma-mocker v3.0.3
21201
+ * @nebula.js/enigma-mocker v3.0.4
20906
21202
  * Copyright (c) 2022 QlikTech International AB
20907
21203
  * Released under the MIT license.
20908
21204
  */