@vuu-ui/vuu-data-test 0.8.20-debug → 0.8.21-debug

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/esm/index.js CHANGED
@@ -610,6 +610,65 @@ var require_isin_generator = __commonJS({
610
610
  }
611
611
  });
612
612
 
613
+ // src/ArrayProxy.ts
614
+ var _getItem;
615
+ var _ArrayProxy = class _ArrayProxy {
616
+ constructor(size, getRow) {
617
+ __privateAdd(this, _getItem, void 0);
618
+ this.length = 0;
619
+ this.map = (func) => {
620
+ return new _ArrayProxy(this.length, (i) => {
621
+ return func(__privateGet(this, _getItem).call(this, i), i);
622
+ });
623
+ };
624
+ this.slice = (from, to) => {
625
+ const out = [];
626
+ const end = Math.min(this.length, to);
627
+ for (let i = from; i < end; i++) {
628
+ out.push(__privateGet(this, _getItem).call(this, i));
629
+ }
630
+ return out;
631
+ };
632
+ __privateSet(this, _getItem, getRow);
633
+ this.length = size;
634
+ const handler = {
635
+ get: (target, prop) => {
636
+ var _a;
637
+ if (prop === "length") {
638
+ return target.length;
639
+ } else if (prop === "slice") {
640
+ return target.slice;
641
+ } else if (prop === "map") {
642
+ return target.map;
643
+ } else if (prop === "toString") {
644
+ return "[ArrayProxy]";
645
+ }
646
+ if (typeof prop === "string") {
647
+ const index = parseInt(prop, 10);
648
+ if (!isNaN(index)) {
649
+ if (index < this.length) {
650
+ return __privateGet(_a = target, _getItem).call(_a, index);
651
+ } else {
652
+ return void 0;
653
+ }
654
+ }
655
+ }
656
+ throw Error(`unsupported property ${String(prop)} on ArrayProxy`);
657
+ },
658
+ set: (target, prop, newVal) => {
659
+ if (prop === "length") {
660
+ target.length = newVal;
661
+ return true;
662
+ }
663
+ throw Error(`ArrayProxy is immutable except for length`);
664
+ }
665
+ };
666
+ return new Proxy(this, handler);
667
+ }
668
+ };
669
+ _getItem = new WeakMap();
670
+ var ArrayProxy = _ArrayProxy;
671
+
613
672
  // src/basket/basket-schemas.ts
614
673
  var schemas = {
615
674
  algoType: {
@@ -1985,6 +2044,7 @@ function createTradingBasket(basketId, basketName) {
1985
2044
  const constituents = basketConstituent.data.filter(
1986
2045
  (c) => c[key] === basketId
1987
2046
  );
2047
+ const { instanceId } = tableMaps.basketTrading;
1988
2048
  constituents.forEach(([, , description, , ric, , , quantity, weighting]) => {
1989
2049
  const algo = "";
1990
2050
  const algoParams = "";
@@ -1996,7 +2056,6 @@ function createTradingBasket(basketId, basketName) {
1996
2056
  const priceStrategyId = "";
1997
2057
  const side = "BUY";
1998
2058
  const venue = "venue";
1999
- const { instanceId } = tableMaps.basketTrading;
2000
2059
  const basketInstanceId = basketTradingRow[instanceId];
2001
2060
  const basketTradingConstituentRow = [
2002
2061
  algo,
@@ -2019,6 +2078,7 @@ function createTradingBasket(basketId, basketName) {
2019
2078
  ];
2020
2079
  basketTradingConstituent.insert(basketTradingConstituentRow);
2021
2080
  });
2081
+ return basketTradingRow[instanceId];
2022
2082
  }
2023
2083
  async function addConstituent(rpcRequest) {
2024
2084
  console.log(`RPC call erceived ${rpcRequest.rpcName}`);
@@ -2035,7 +2095,13 @@ async function createNewBasket(rpcRequest) {
2035
2095
  const {
2036
2096
  params: [basketId, basketName]
2037
2097
  } = rpcRequest;
2038
- createTradingBasket(basketId, basketName);
2098
+ const key = createTradingBasket(basketId, basketName);
2099
+ return {
2100
+ action: {
2101
+ type: "VP_CREATE_SUCCESS",
2102
+ key
2103
+ }
2104
+ };
2039
2105
  }
2040
2106
  var tables = {
2041
2107
  algoType: new Table(
@@ -2385,6 +2451,7 @@ var vuuModules = {
2385
2451
  };
2386
2452
  var vuuModule = (moduleName) => vuuModules[moduleName];
2387
2453
  export {
2454
+ ArrayProxy,
2388
2455
  DefaultColumnGenerator,
2389
2456
  DefaultRowGenerator,
2390
2457
  TickingArrayDataSource,