@revolist/revogrid 3.2.0 → 3.2.4
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/dist/revo-grid/_baseIteratee-af30b221.js +2070 -0
- package/dist/{collection/global/global.js → revo-grid/app-globals-7e6866ba.js} +11 -2
- package/dist/{collection/components/data/columnService.js → revo-grid/columnService-91e552ba.js} +11 -6
- package/dist/revo-grid/consts-ef824e6f.js +46 -0
- package/dist/revo-grid/css-shim-5387c708.js +7 -0
- package/dist/revo-grid/data.store-3263fff9.js +557 -0
- package/dist/revo-grid/debounce-aaa4b4da.js +217 -0
- package/dist/revo-grid/dimension.helpers-a7944fc4.js +340 -0
- package/dist/{collection/plugins/dispatcher.js → revo-grid/dispatcher-891af82e.js} +7 -2
- package/dist/{cjs/dom-c8b6d1a7.js → revo-grid/dom-21bd1807.js} +4 -3
- package/dist/revo-grid/each-0378e5a3.js +180 -0
- package/dist/{collection/plugins/filter/filter.button.js → revo-grid/filter.button-74c1cd9c.js} +16 -10
- package/dist/revo-grid/identity-c8c7d3d8.js +26 -0
- package/dist/revo-grid/index-8a604c17.js +3067 -0
- package/dist/revo-grid/index.esm.js +3 -0
- package/dist/revo-grid/isString-a51066b5.js +34 -0
- package/dist/revo-grid/isSymbol-e4b5dafe.js +247 -0
- package/dist/revo-grid/keyCodes.utils-bd06e3ba.js +299 -0
- package/dist/revo-grid/keys-70b7c240.js +561 -0
- package/dist/{collection/services/localScrollService.js → revo-grid/localScrollService-e9b73323.js} +8 -2
- package/dist/{esm/revo-grid_11.entry.js → revo-grid/lodash-a0ab4cdd.js} +13773 -24835
- package/dist/{cjs/resize-observer-8dc80084.js → revo-grid/resize-observer-00c48d78.js} +25 -14
- package/dist/revo-grid/revo-grid.entry.js +3484 -0
- package/dist/revo-grid/revo-grid.esm.js +133 -1
- package/dist/revo-grid/revogr-clipboard.entry.js +52 -1
- package/dist/revo-grid/revogr-data.entry.js +152 -0
- package/dist/revo-grid/revogr-edit.entry.js +105 -0
- package/dist/revo-grid/revogr-filter-panel.entry.js +277 -1
- package/dist/revo-grid/revogr-focus.entry.js +41 -0
- package/dist/revo-grid/revogr-header.entry.js +560 -0
- package/dist/revo-grid/revogr-order-editor.entry.js +175 -0
- package/dist/revo-grid/revogr-overlay-selection.entry.js +711 -0
- package/dist/revo-grid/revogr-row-headers.entry.js +73 -0
- package/dist/revo-grid/revogr-scroll-virtual.entry.js +114 -0
- package/dist/revo-grid/revogr-temp-range.entry.js +73 -0
- package/dist/revo-grid/revogr-viewport-scroll.entry.js +340 -0
- package/dist/revo-grid/selection.store.connector-2b613fd0.js +503 -0
- package/dist/{collection/components/overlay/selection.utils.js → revo-grid/selection.utils-a9932db6.js} +15 -9
- package/dist/revo-grid/shadow-css-602a09db.js +390 -0
- package/dist/{collection/themeManager/themeService.js → revo-grid/themeService-ddaaa364.js} +26 -6
- package/dist/revo-grid/toInteger-9e6cbfd2.js +107 -0
- package/dist/revo-grid/toNumber-913b0b72.js +105 -0
- package/dist/{collection/utils/utils.js → revo-grid/utils-2c3b3857.js} +13 -8
- package/dist/revo-grid/viewport.helpers-49d3f031.js +16 -0
- package/dist/{collection/store/viewPort/viewport.helpers.js → revo-grid/viewport.store-ffaaab6d.js} +135 -9
- package/dist/types/components.d.ts +100 -56
- package/dist/types/stencil-public-runtime.d.ts +189 -186
- package/package.json +22 -20
- package/custom-element/index.js +0 -29210
- package/custom-element/resize-observer.js +0 -489
- package/dist/cjs/css-shim-e33df79c.js +0 -6
- package/dist/cjs/debounce-e9b040d9.js +0 -575
- package/dist/cjs/index-d3f67f2e.js +0 -1729
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -35
- package/dist/cjs/revo-grid.cjs.js +0 -73
- package/dist/cjs/revo-grid_11.cjs.entry.js +0 -28294
- package/dist/cjs/revogr-clipboard.cjs.entry.js +0 -53
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +0 -275
- package/dist/collection/collection-manifest.json +0 -25
- package/dist/collection/components/button/button.js +0 -4
- package/dist/collection/components/clipboard/revogr-clipboard.js +0 -121
- package/dist/collection/components/data/cellRenderer.js +0 -24
- package/dist/collection/components/data/revogr-data-style.css +0 -135
- package/dist/collection/components/data/revogr-data.js +0 -322
- package/dist/collection/components/data/rowRenderer.js +0 -6
- package/dist/collection/components/header/headerCellRenderer.js +0 -26
- package/dist/collection/components/header/headerRenderer.js +0 -45
- package/dist/collection/components/header/revogr-header-style.css +0 -198
- package/dist/collection/components/header/revogr-header.js +0 -297
- package/dist/collection/components/order/orderRenderer.js +0 -50
- package/dist/collection/components/order/revogr-order-editor.js +0 -358
- package/dist/collection/components/order/rowOrderService.js +0 -68
- package/dist/collection/components/overlay/autofill.service.js +0 -182
- package/dist/collection/components/overlay/clipboard.service.js +0 -39
- package/dist/collection/components/overlay/editors/edit.utils.js +0 -5
- package/dist/collection/components/overlay/editors/text.js +0 -35
- package/dist/collection/components/overlay/keyboard.service.js +0 -128
- package/dist/collection/components/overlay/revogr-edit-style.css +0 -86
- package/dist/collection/components/overlay/revogr-edit.js +0 -159
- package/dist/collection/components/overlay/revogr-overlay-selection.js +0 -726
- package/dist/collection/components/overlay/revogr-overlay-style.css +0 -98
- package/dist/collection/components/revo-grid/revo-grid-style.css +0 -544
- package/dist/collection/components/revo-grid/revo-grid.js +0 -2224
- package/dist/collection/components/revo-grid/viewport.helpers.js +0 -11
- package/dist/collection/components/revo-grid/viewport.interfaces.js +0 -1
- package/dist/collection/components/revo-grid/viewport.js +0 -18
- package/dist/collection/components/revo-grid/viewport.resize.service.js +0 -21
- package/dist/collection/components/revo-grid/viewport.scrolling.service.js +0 -60
- package/dist/collection/components/revo-grid/viewport.section.js +0 -28
- package/dist/collection/components/revo-grid/viewport.service.js +0 -209
- package/dist/collection/components/rowHeaders/revogr-row-headers.js +0 -210
- package/dist/collection/components/rowHeaders/row-header-render.js +0 -1
- package/dist/collection/components/scroll/revogr-viewport-scroll-style.css +0 -137
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +0 -399
- package/dist/collection/components/scrollable/revogr-scroll-style.css +0 -104
- package/dist/collection/components/scrollable/revogr-scroll-virtual.js +0 -253
- package/dist/collection/components/selection-focus/revogr-focus-style.css +0 -77
- package/dist/collection/components/selection-focus/revogr-focus.js +0 -103
- package/dist/collection/components/selection-temp-range/revogr-temp-range-style.css +0 -98
- package/dist/collection/components/selection-temp-range/revogr-temp-range.js +0 -138
- package/dist/collection/index.js +0 -1
- package/dist/collection/plugins/autoSizeColumn.js +0 -230
- package/dist/collection/plugins/basePlugin.js +0 -27
- package/dist/collection/plugins/export/csv.js +0 -68
- package/dist/collection/plugins/export/export.plugin.js +0 -165
- package/dist/collection/plugins/export/types.js +0 -1
- package/dist/collection/plugins/filter/conditions/equal.js +0 -17
- package/dist/collection/plugins/filter/conditions/number/greaterThan.js +0 -10
- package/dist/collection/plugins/filter/conditions/number/greaterThanOrEqual.js +0 -7
- package/dist/collection/plugins/filter/conditions/number/lessThan.js +0 -12
- package/dist/collection/plugins/filter/conditions/number/lessThanOrEqual.js +0 -7
- package/dist/collection/plugins/filter/conditions/set.js +0 -3
- package/dist/collection/plugins/filter/conditions/string/beginswith.js +0 -17
- package/dist/collection/plugins/filter/conditions/string/contains.js +0 -18
- package/dist/collection/plugins/filter/filter.plugin.js +0 -256
- package/dist/collection/plugins/filter/filter.pop.js +0 -485
- package/dist/collection/plugins/filter/filter.service.js +0 -44
- package/dist/collection/plugins/filter/filter.style.css +0 -239
- package/dist/collection/plugins/filter/filter.types.js +0 -1
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +0 -30
- package/dist/collection/plugins/groupingColumn/grouping.col.plugin.js +0 -36
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js +0 -21
- package/dist/collection/plugins/groupingRow/grouping.const.js +0 -10
- package/dist/collection/plugins/groupingRow/grouping.row.expand.service.js +0 -76
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +0 -258
- package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +0 -29
- package/dist/collection/plugins/groupingRow/grouping.row.types.js +0 -1
- package/dist/collection/plugins/groupingRow/grouping.service.js +0 -155
- package/dist/collection/plugins/groupingRow/grouping.trimmed.service.js +0 -57
- package/dist/collection/plugins/moveColumn/columnDragPlugin.js +0 -145
- package/dist/collection/plugins/moveColumn/columnOrderHandler.js +0 -60
- package/dist/collection/plugins/sorting/sorting.plugin.js +0 -181
- package/dist/collection/plugins/sorting/sorting.sign.js +0 -6
- package/dist/collection/plugins/stretchPlugin.js +0 -68
- package/dist/collection/plugins/trimmed/trimmed.plugin.js +0 -32
- package/dist/collection/services/cell.helpers.js +0 -7
- package/dist/collection/services/column.data.provider.js +0 -188
- package/dist/collection/services/data.provider.js +0 -47
- package/dist/collection/services/dimension.provider.js +0 -78
- package/dist/collection/services/resizable.directive.js +0 -250
- package/dist/collection/services/selection.store.connector.js +0 -213
- package/dist/collection/services/viewport.provider.js +0 -14
- package/dist/collection/store/dataSource/data.proxy.js +0 -34
- package/dist/collection/store/dataSource/data.store.js +0 -127
- package/dist/collection/store/dimension/dimension.helpers.js +0 -107
- package/dist/collection/store/dimension/dimension.store.js +0 -59
- package/dist/collection/store/selection/selection.helpers.js +0 -53
- package/dist/collection/store/selection/selection.store.js +0 -68
- package/dist/collection/store/selection/selection.store.service.js +0 -35
- package/dist/collection/store/storeTypes.js +0 -5
- package/dist/collection/store/viewPort/viewport.store.js +0 -121
- package/dist/collection/themeManager/theme.compact.js +0 -5
- package/dist/collection/themeManager/theme.default.js +0 -5
- package/dist/collection/themeManager/theme.material.js +0 -5
- package/dist/collection/utils/closestPolifill.js +0 -18
- package/dist/collection/utils/consts.js +0 -19
- package/dist/collection/utils/generateAlphabetHeader.js +0 -20
- package/dist/collection/utils/keyCodes.js +0 -70
- package/dist/collection/utils/keyCodes.utils.js +0 -64
- package/dist/collection/utils/platform.js +0 -5
- package/dist/collection/utils/resizeObserver.js +0 -6
- package/dist/collection/utils/store.utils.js +0 -7
- package/dist/collection/utilsExternal/generate-data.js +0 -132
- package/dist/esm/css-shim-8d75038b.js +0 -4
- package/dist/esm/debounce-45985ae0.js +0 -558
- package/dist/esm/dom-1b195079.js +0 -73
- package/dist/esm/index-42c84e7c.js +0 -1694
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -31
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/resize-observer-56b7b34f.js +0 -489
- package/dist/esm/revo-grid.js +0 -71
- package/dist/esm/revogr-clipboard.entry.js +0 -49
- package/dist/esm/revogr-filter-panel.entry.js +0 -271
- package/dist/esm-es5/css-shim-8d75038b.js +0 -1
- package/dist/esm-es5/debounce-45985ae0.js +0 -1
- package/dist/esm-es5/dom-1b195079.js +0 -21
- package/dist/esm-es5/index-42c84e7c.js +0 -1
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/loader.js +0 -1
- package/dist/esm-es5/resize-observer-56b7b34f.js +0 -1
- package/dist/esm-es5/revo-grid.js +0 -1
- package/dist/esm-es5/revo-grid_11.entry.js +0 -1
- package/dist/esm-es5/revogr-clipboard.entry.js +0 -1
- package/dist/esm-es5/revogr-filter-panel.entry.js +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/revo-grid/css-shim-88bfb262.system.js +0 -1
- package/dist/revo-grid/css-shim-8d75038b.js +0 -1
- package/dist/revo-grid/debounce-6c911037.js +0 -1
- package/dist/revo-grid/debounce-a345f98e.system.js +0 -1
- package/dist/revo-grid/dom-1b195079.js +0 -19
- package/dist/revo-grid/dom-ee2dd1b3.system.js +0 -21
- package/dist/revo-grid/index-a15e7527.system.js +0 -1
- package/dist/revo-grid/index-a7f99799.js +0 -1
- package/dist/revo-grid/index.system.js +0 -1
- package/dist/revo-grid/resize-observer-56b7b34f.js +0 -1
- package/dist/revo-grid/resize-observer-7a7b9757.system.js +0 -1
- package/dist/revo-grid/revo-grid.js +0 -132
- package/dist/revo-grid/revo-grid.system.js +0 -1
- package/dist/revo-grid/revo-grid_11.entry.js +0 -1
- package/dist/revo-grid/revo-grid_11.system.entry.js +0 -1
- package/dist/revo-grid/revogr-clipboard.system.entry.js +0 -1
- package/dist/revo-grid/revogr-filter-panel.system.entry.js +0 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist
|
|
3
|
+
*/
|
|
4
|
+
import { s as setMode } from './index-8a604c17.js';
|
|
5
|
+
import { T as ThemeService } from './themeService-ddaaa364.js';
|
|
6
|
+
|
|
3
7
|
setMode(elm => {
|
|
4
8
|
let theme = elm.theme || elm.getAttribute('theme');
|
|
5
9
|
if (typeof theme === 'string') {
|
|
@@ -11,3 +15,8 @@ setMode(elm => {
|
|
|
11
15
|
}
|
|
12
16
|
return parsedTheme;
|
|
13
17
|
});
|
|
18
|
+
const globalFn = () => { };
|
|
19
|
+
|
|
20
|
+
const globalScripts = globalFn;
|
|
21
|
+
|
|
22
|
+
export { globalScripts as g };
|
package/dist/{collection/components/data/columnService.js → revo-grid/columnService-91e552ba.js}
RENAMED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist
|
|
3
|
+
*/
|
|
4
|
+
import { h } from './index-8a604c17.js';
|
|
5
|
+
import { b as getVisibleSourceItem, g as getSourceItem, s as setSourceByVirtualIndex } from './data.store-3263fff9.js';
|
|
6
|
+
import { a as CELL_CLASS, D as DISABLED_CLASS } from './consts-ef824e6f.js';
|
|
7
|
+
import { k as isGroupingColumn, l as getRange } from './selection.store.connector-2b613fd0.js';
|
|
8
|
+
|
|
9
|
+
class ColumnService {
|
|
7
10
|
constructor(dataStore, source) {
|
|
8
11
|
this.dataStore = dataStore;
|
|
9
12
|
this.source = source;
|
|
@@ -241,3 +244,5 @@ export default class ColumnService {
|
|
|
241
244
|
this.unsubscribe.forEach(f => f());
|
|
242
245
|
}
|
|
243
246
|
}
|
|
247
|
+
|
|
248
|
+
export { ColumnService as C };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* A specialized version of `_.map` for arrays without support for iteratee
|
|
6
|
+
* shorthands.
|
|
7
|
+
*
|
|
8
|
+
* @private
|
|
9
|
+
* @param {Array} [array] The array to iterate over.
|
|
10
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
11
|
+
* @returns {Array} Returns the new mapped array.
|
|
12
|
+
*/
|
|
13
|
+
function arrayMap(array, iteratee) {
|
|
14
|
+
var index = -1,
|
|
15
|
+
length = array == null ? 0 : array.length,
|
|
16
|
+
result = Array(length);
|
|
17
|
+
|
|
18
|
+
while (++index < length) {
|
|
19
|
+
result[index] = iteratee(array[index], index, array);
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var _arrayMap = arrayMap;
|
|
25
|
+
|
|
26
|
+
const MIN_COL_SIZE = 30;
|
|
27
|
+
const DATA_COL = 'data-rgCol';
|
|
28
|
+
const DATA_ROW = 'data-rgRow';
|
|
29
|
+
const UUID = 'grid-uuid';
|
|
30
|
+
const DISABLED_CLASS = 'disabled';
|
|
31
|
+
const CELL_CLASS = 'rgCell';
|
|
32
|
+
const HEADER_CLASS = 'rgHeaderCell';
|
|
33
|
+
const HEADER_SORTABLE_CLASS = 'sortable';
|
|
34
|
+
const HEADER_ROW_CLASS = 'header-rgRow';
|
|
35
|
+
const HEADER_ACTUAL_ROW_CLASS = 'actual-rgRow';
|
|
36
|
+
const DRAG_ICON_CLASS = 'revo-drag-icon';
|
|
37
|
+
const DRAGGABLE_CLASS = 'revo-draggable';
|
|
38
|
+
const FOCUS_CLASS = 'focused-cell';
|
|
39
|
+
const SELECTION_BORDER_CLASS = 'selection-border-range';
|
|
40
|
+
const TMP_SELECTION_BG_CLASS = 'temp-bg-range';
|
|
41
|
+
const CELL_HANDLER_CLASS = 'autofill-handle';
|
|
42
|
+
const EDIT_INPUT_WR = 'edit-input-wrapper';
|
|
43
|
+
const DRAGG_TEXT = 'Draggable item';
|
|
44
|
+
const GRID_INTERNALS = '__rvgr';
|
|
45
|
+
|
|
46
|
+
export { CELL_HANDLER_CLASS as C, DISABLED_CLASS as D, EDIT_INPUT_WR as E, FOCUS_CLASS as F, GRID_INTERNALS as G, HEADER_CLASS as H, MIN_COL_SIZE as M, SELECTION_BORDER_CLASS as S, TMP_SELECTION_BG_CLASS as T, UUID as U, _arrayMap as _, CELL_CLASS as a, DRAGGABLE_CLASS as b, DRAG_ICON_CLASS as c, DATA_COL as d, DATA_ROW as e, HEADER_SORTABLE_CLASS as f, HEADER_ROW_CLASS as g, HEADER_ACTUAL_ROW_CLASS as h, DRAGG_TEXT as i };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist
|
|
3
|
+
*/
|
|
4
|
+
/*
|
|
5
|
+
Stencil Client Patch Esm v2.17.3 | MIT Licensed | https://stenciljs.com
|
|
6
|
+
*/
|
|
7
|
+
var __assign=undefined&&undefined.__assign||function(){return (__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector="";};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r);}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE;}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return "\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@";function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return {start:s,end:s+n[0].length}}return null}var VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return {start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t);}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else {if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s);}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value;}));}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0);})),!t)return "break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return [];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t});})),t++;})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o});}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement;}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors);})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return ":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return {original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return !1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t));}));}function reScope(e,t){var r=e.template.map((function(r){return "string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t);}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t);})).observe(document.head,{childList:!0});}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove();}})).catch((function(e){console.error(e);}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1;}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}));}));})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal();}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal();},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e);},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n);}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes);},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document));}("undefined"!=typeof window&&window);
|
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist
|
|
3
|
+
*/
|
|
4
|
+
import { i as getRenderingRef, j as forceUpdate } from './index-8a604c17.js';
|
|
5
|
+
import { t as toInteger_1, _ as _baseFindIndex, a as toFinite_1 } from './toInteger-9e6cbfd2.js';
|
|
6
|
+
import { _ as _baseIteratee, e as eq_1 } from './_baseIteratee-af30b221.js';
|
|
7
|
+
import { i as isArrayLike_1, b as _isIndex } from './keys-70b7c240.js';
|
|
8
|
+
import { a as isObject_1 } from './isSymbol-e4b5dafe.js';
|
|
9
|
+
|
|
10
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
11
|
+
var nativeMax$1 = Math.max;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* This method is like `_.find` except that it returns the index of the first
|
|
15
|
+
* element `predicate` returns truthy for instead of the element itself.
|
|
16
|
+
*
|
|
17
|
+
* @static
|
|
18
|
+
* @memberOf _
|
|
19
|
+
* @since 1.1.0
|
|
20
|
+
* @category Array
|
|
21
|
+
* @param {Array} array The array to inspect.
|
|
22
|
+
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
|
23
|
+
* @param {number} [fromIndex=0] The index to search from.
|
|
24
|
+
* @returns {number} Returns the index of the found element, else `-1`.
|
|
25
|
+
* @example
|
|
26
|
+
*
|
|
27
|
+
* var users = [
|
|
28
|
+
* { 'user': 'barney', 'active': false },
|
|
29
|
+
* { 'user': 'fred', 'active': false },
|
|
30
|
+
* { 'user': 'pebbles', 'active': true }
|
|
31
|
+
* ];
|
|
32
|
+
*
|
|
33
|
+
* _.findIndex(users, function(o) { return o.user == 'barney'; });
|
|
34
|
+
* // => 0
|
|
35
|
+
*
|
|
36
|
+
* // The `_.matches` iteratee shorthand.
|
|
37
|
+
* _.findIndex(users, { 'user': 'fred', 'active': false });
|
|
38
|
+
* // => 1
|
|
39
|
+
*
|
|
40
|
+
* // The `_.matchesProperty` iteratee shorthand.
|
|
41
|
+
* _.findIndex(users, ['active', false]);
|
|
42
|
+
* // => 0
|
|
43
|
+
*
|
|
44
|
+
* // The `_.property` iteratee shorthand.
|
|
45
|
+
* _.findIndex(users, 'active');
|
|
46
|
+
* // => 2
|
|
47
|
+
*/
|
|
48
|
+
function findIndex(array, predicate, fromIndex) {
|
|
49
|
+
var length = array == null ? 0 : array.length;
|
|
50
|
+
if (!length) {
|
|
51
|
+
return -1;
|
|
52
|
+
}
|
|
53
|
+
var index = fromIndex == null ? 0 : toInteger_1(fromIndex);
|
|
54
|
+
if (index < 0) {
|
|
55
|
+
index = nativeMax$1(length + index, 0);
|
|
56
|
+
}
|
|
57
|
+
return _baseFindIndex(array, _baseIteratee(predicate, 3), index);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var findIndex_1 = findIndex;
|
|
61
|
+
|
|
62
|
+
const appendToMap = (map, propName, value) => {
|
|
63
|
+
const items = map.get(propName);
|
|
64
|
+
if (!items) {
|
|
65
|
+
map.set(propName, [value]);
|
|
66
|
+
}
|
|
67
|
+
else if (!items.includes(value)) {
|
|
68
|
+
items.push(value);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const debounce = (fn, ms) => {
|
|
72
|
+
let timeoutId;
|
|
73
|
+
return (...args) => {
|
|
74
|
+
if (timeoutId) {
|
|
75
|
+
clearTimeout(timeoutId);
|
|
76
|
+
}
|
|
77
|
+
timeoutId = setTimeout(() => {
|
|
78
|
+
timeoutId = 0;
|
|
79
|
+
fn(...args);
|
|
80
|
+
}, ms);
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Check if a possible element isConnected.
|
|
86
|
+
* The property might not be there, so we check for it.
|
|
87
|
+
*
|
|
88
|
+
* We want it to return true if isConnected is not a property,
|
|
89
|
+
* otherwise we would remove these elements and would not update.
|
|
90
|
+
*
|
|
91
|
+
* Better leak in Edge than to be useless.
|
|
92
|
+
*/
|
|
93
|
+
const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
|
94
|
+
const cleanupElements = debounce((map) => {
|
|
95
|
+
for (let key of map.keys()) {
|
|
96
|
+
map.set(key, map.get(key).filter(isConnected));
|
|
97
|
+
}
|
|
98
|
+
}, 2000);
|
|
99
|
+
const stencilSubscription = ({ on }) => {
|
|
100
|
+
const elmsToUpdate = new Map();
|
|
101
|
+
if (typeof getRenderingRef === 'function') {
|
|
102
|
+
// If we are not in a stencil project, we do nothing.
|
|
103
|
+
// This function is not really exported by @stencil/core.
|
|
104
|
+
on('dispose', () => {
|
|
105
|
+
elmsToUpdate.clear();
|
|
106
|
+
});
|
|
107
|
+
on('get', (propName) => {
|
|
108
|
+
const elm = getRenderingRef();
|
|
109
|
+
if (elm) {
|
|
110
|
+
appendToMap(elmsToUpdate, propName, elm);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
on('set', (propName) => {
|
|
114
|
+
const elements = elmsToUpdate.get(propName);
|
|
115
|
+
if (elements) {
|
|
116
|
+
elmsToUpdate.set(propName, elements.filter(forceUpdate));
|
|
117
|
+
}
|
|
118
|
+
cleanupElements(elmsToUpdate);
|
|
119
|
+
});
|
|
120
|
+
on('reset', () => {
|
|
121
|
+
elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
|
|
122
|
+
cleanupElements(elmsToUpdate);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
|
|
128
|
+
let states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
|
|
129
|
+
const handlers = {
|
|
130
|
+
dispose: [],
|
|
131
|
+
get: [],
|
|
132
|
+
set: [],
|
|
133
|
+
reset: [],
|
|
134
|
+
};
|
|
135
|
+
const reset = () => {
|
|
136
|
+
states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
|
|
137
|
+
handlers.reset.forEach((cb) => cb());
|
|
138
|
+
};
|
|
139
|
+
const dispose = () => {
|
|
140
|
+
// Call first dispose as resetting the state would
|
|
141
|
+
// cause less updates ;)
|
|
142
|
+
handlers.dispose.forEach((cb) => cb());
|
|
143
|
+
reset();
|
|
144
|
+
};
|
|
145
|
+
const get = (propName) => {
|
|
146
|
+
handlers.get.forEach((cb) => cb(propName));
|
|
147
|
+
return states.get(propName);
|
|
148
|
+
};
|
|
149
|
+
const set = (propName, value) => {
|
|
150
|
+
const oldValue = states.get(propName);
|
|
151
|
+
if (shouldUpdate(value, oldValue, propName)) {
|
|
152
|
+
states.set(propName, value);
|
|
153
|
+
handlers.set.forEach((cb) => cb(propName, value, oldValue));
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const state = (typeof Proxy === 'undefined'
|
|
157
|
+
? {}
|
|
158
|
+
: new Proxy(defaultState, {
|
|
159
|
+
get(_, propName) {
|
|
160
|
+
return get(propName);
|
|
161
|
+
},
|
|
162
|
+
ownKeys(_) {
|
|
163
|
+
return Array.from(states.keys());
|
|
164
|
+
},
|
|
165
|
+
getOwnPropertyDescriptor() {
|
|
166
|
+
return {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
configurable: true,
|
|
169
|
+
};
|
|
170
|
+
},
|
|
171
|
+
has(_, propName) {
|
|
172
|
+
return states.has(propName);
|
|
173
|
+
},
|
|
174
|
+
set(_, propName, value) {
|
|
175
|
+
set(propName, value);
|
|
176
|
+
return true;
|
|
177
|
+
},
|
|
178
|
+
}));
|
|
179
|
+
const on = (eventName, callback) => {
|
|
180
|
+
handlers[eventName].push(callback);
|
|
181
|
+
return () => {
|
|
182
|
+
removeFromArray(handlers[eventName], callback);
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
const onChange = (propName, cb) => {
|
|
186
|
+
const unSet = on('set', (key, newValue) => {
|
|
187
|
+
if (key === propName) {
|
|
188
|
+
cb(newValue);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
const unReset = on('reset', () => cb(defaultState[propName]));
|
|
192
|
+
return () => {
|
|
193
|
+
unSet();
|
|
194
|
+
unReset();
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
const use = (...subscriptions) => subscriptions.forEach((subscription) => {
|
|
198
|
+
if (subscription.set) {
|
|
199
|
+
on('set', subscription.set);
|
|
200
|
+
}
|
|
201
|
+
if (subscription.get) {
|
|
202
|
+
on('get', subscription.get);
|
|
203
|
+
}
|
|
204
|
+
if (subscription.reset) {
|
|
205
|
+
on('reset', subscription.reset);
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
return {
|
|
209
|
+
state,
|
|
210
|
+
get,
|
|
211
|
+
set,
|
|
212
|
+
on,
|
|
213
|
+
onChange,
|
|
214
|
+
use,
|
|
215
|
+
dispose,
|
|
216
|
+
reset,
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
const removeFromArray = (array, item) => {
|
|
220
|
+
const index = array.indexOf(item);
|
|
221
|
+
if (index >= 0) {
|
|
222
|
+
array[index] = array[array.length - 1];
|
|
223
|
+
array.length--;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const createStore = (defaultState, shouldUpdate) => {
|
|
228
|
+
const map = createObservableMap(defaultState, shouldUpdate);
|
|
229
|
+
stencilSubscription(map);
|
|
230
|
+
return map;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
234
|
+
var nativeCeil = Math.ceil,
|
|
235
|
+
nativeMax = Math.max;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* The base implementation of `_.range` and `_.rangeRight` which doesn't
|
|
239
|
+
* coerce arguments.
|
|
240
|
+
*
|
|
241
|
+
* @private
|
|
242
|
+
* @param {number} start The start of the range.
|
|
243
|
+
* @param {number} end The end of the range.
|
|
244
|
+
* @param {number} step The value to increment or decrement by.
|
|
245
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
246
|
+
* @returns {Array} Returns the range of numbers.
|
|
247
|
+
*/
|
|
248
|
+
function baseRange(start, end, step, fromRight) {
|
|
249
|
+
var index = -1,
|
|
250
|
+
length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
|
|
251
|
+
result = Array(length);
|
|
252
|
+
|
|
253
|
+
while (length--) {
|
|
254
|
+
result[fromRight ? length : ++index] = start;
|
|
255
|
+
start += step;
|
|
256
|
+
}
|
|
257
|
+
return result;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
var _baseRange = baseRange;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Checks if the given arguments are from an iteratee call.
|
|
264
|
+
*
|
|
265
|
+
* @private
|
|
266
|
+
* @param {*} value The potential iteratee value argument.
|
|
267
|
+
* @param {*} index The potential iteratee index or key argument.
|
|
268
|
+
* @param {*} object The potential iteratee object argument.
|
|
269
|
+
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
270
|
+
* else `false`.
|
|
271
|
+
*/
|
|
272
|
+
function isIterateeCall(value, index, object) {
|
|
273
|
+
if (!isObject_1(object)) {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
var type = typeof index;
|
|
277
|
+
if (type == 'number'
|
|
278
|
+
? (isArrayLike_1(object) && _isIndex(index, object.length))
|
|
279
|
+
: (type == 'string' && index in object)
|
|
280
|
+
) {
|
|
281
|
+
return eq_1(object[index], value);
|
|
282
|
+
}
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
var _isIterateeCall = isIterateeCall;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Creates a `_.range` or `_.rangeRight` function.
|
|
290
|
+
*
|
|
291
|
+
* @private
|
|
292
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
293
|
+
* @returns {Function} Returns the new range function.
|
|
294
|
+
*/
|
|
295
|
+
function createRange(fromRight) {
|
|
296
|
+
return function(start, end, step) {
|
|
297
|
+
if (step && typeof step != 'number' && _isIterateeCall(start, end, step)) {
|
|
298
|
+
end = step = undefined;
|
|
299
|
+
}
|
|
300
|
+
// Ensure the sign of `-0` is preserved.
|
|
301
|
+
start = toFinite_1(start);
|
|
302
|
+
if (end === undefined) {
|
|
303
|
+
end = start;
|
|
304
|
+
start = 0;
|
|
305
|
+
} else {
|
|
306
|
+
end = toFinite_1(end);
|
|
307
|
+
}
|
|
308
|
+
step = step === undefined ? (start < end ? 1 : -1) : toFinite_1(step);
|
|
309
|
+
return _baseRange(start, end, step, fromRight);
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
var _createRange = createRange;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Creates an array of numbers (positive and/or negative) progressing from
|
|
317
|
+
* `start` up to, but not including, `end`. A step of `-1` is used if a negative
|
|
318
|
+
* `start` is specified without an `end` or `step`. If `end` is not specified,
|
|
319
|
+
* it's set to `start` with `start` then set to `0`.
|
|
320
|
+
*
|
|
321
|
+
* **Note:** JavaScript follows the IEEE-754 standard for resolving
|
|
322
|
+
* floating-point values which can produce unexpected results.
|
|
323
|
+
*
|
|
324
|
+
* @static
|
|
325
|
+
* @since 0.1.0
|
|
326
|
+
* @memberOf _
|
|
327
|
+
* @category Util
|
|
328
|
+
* @param {number} [start=0] The start of the range.
|
|
329
|
+
* @param {number} end The end of the range.
|
|
330
|
+
* @param {number} [step=1] The value to increment or decrement by.
|
|
331
|
+
* @returns {Array} Returns the range of numbers.
|
|
332
|
+
* @see _.inRange, _.rangeRight
|
|
333
|
+
* @example
|
|
334
|
+
*
|
|
335
|
+
* _.range(4);
|
|
336
|
+
* // => [0, 1, 2, 3]
|
|
337
|
+
*
|
|
338
|
+
* _.range(-4);
|
|
339
|
+
* // => [0, -1, -2, -3]
|
|
340
|
+
*
|
|
341
|
+
* _.range(1, 5);
|
|
342
|
+
* // => [1, 2, 3, 4]
|
|
343
|
+
*
|
|
344
|
+
* _.range(0, 20, 5);
|
|
345
|
+
* // => [0, 5, 10, 15]
|
|
346
|
+
*
|
|
347
|
+
* _.range(0, -4, -1);
|
|
348
|
+
* // => [0, -1, -2, -3]
|
|
349
|
+
*
|
|
350
|
+
* _.range(1, 4, 0);
|
|
351
|
+
* // => [1, 1, 1]
|
|
352
|
+
*
|
|
353
|
+
* _.range(0);
|
|
354
|
+
* // => []
|
|
355
|
+
*/
|
|
356
|
+
var range = _createRange();
|
|
357
|
+
|
|
358
|
+
var range_1 = range;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Hide items from main collection
|
|
362
|
+
* But keep them in store
|
|
363
|
+
*/
|
|
364
|
+
const trimmedPlugin = (store) => ({
|
|
365
|
+
set(k, newVal) {
|
|
366
|
+
switch (k) {
|
|
367
|
+
case 'trimmed':
|
|
368
|
+
const proxy = store.get('proxyItems');
|
|
369
|
+
const trimmed = gatherTrimmedItems(newVal);
|
|
370
|
+
const newItems = proxy.reduce((result, v) => {
|
|
371
|
+
// check if present in new trimmed remove from items (filter)
|
|
372
|
+
if (!trimmed[v]) {
|
|
373
|
+
result.push(v);
|
|
374
|
+
}
|
|
375
|
+
return result;
|
|
376
|
+
}, []);
|
|
377
|
+
store.set('items', newItems);
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
});
|
|
382
|
+
function gatherTrimmedItems(trimmedItems) {
|
|
383
|
+
const trimmed = {};
|
|
384
|
+
for (let trimmedKey in trimmedItems) {
|
|
385
|
+
// trimmed overweight not trimmed
|
|
386
|
+
for (let t in trimmedItems[trimmedKey]) {
|
|
387
|
+
trimmed[t] = trimmed[t] || trimmedItems[trimmedKey][t];
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return trimmed;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/** Set stores data */
|
|
394
|
+
function setStore(store, data) {
|
|
395
|
+
for (let key in data) {
|
|
396
|
+
store.set(key, data[key]);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* All items
|
|
402
|
+
* Used as proxy for sorting
|
|
403
|
+
* Keep order but do not modify final source
|
|
404
|
+
*/
|
|
405
|
+
const proxyPlugin = (store) => ({
|
|
406
|
+
set(k, newVal) {
|
|
407
|
+
if (!isProxy(k)) {
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Getting existing collection of items
|
|
412
|
+
* Mark indexes as visible
|
|
413
|
+
*/
|
|
414
|
+
const oldItems = store.get('items').reduce((r, v) => {
|
|
415
|
+
r[v] = true;
|
|
416
|
+
return r;
|
|
417
|
+
}, {});
|
|
418
|
+
/**
|
|
419
|
+
* Check if new values where present in items
|
|
420
|
+
* Filter item collection according presense
|
|
421
|
+
*/
|
|
422
|
+
const newItems = newVal.reduce((r, i) => {
|
|
423
|
+
if (oldItems[i]) {
|
|
424
|
+
r.push(i);
|
|
425
|
+
}
|
|
426
|
+
return r;
|
|
427
|
+
}, []);
|
|
428
|
+
store.set('items', newItems);
|
|
429
|
+
},
|
|
430
|
+
});
|
|
431
|
+
function isProxy(k) {
|
|
432
|
+
return k === 'proxyItems';
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
class DataStore {
|
|
436
|
+
constructor(type) {
|
|
437
|
+
const store = (this.dataStore = createStore({
|
|
438
|
+
items: [],
|
|
439
|
+
proxyItems: [],
|
|
440
|
+
source: [],
|
|
441
|
+
groupingDepth: 0,
|
|
442
|
+
groups: {},
|
|
443
|
+
type,
|
|
444
|
+
trimmed: {},
|
|
445
|
+
}));
|
|
446
|
+
store.use(proxyPlugin(store));
|
|
447
|
+
store.use(trimmedPlugin(store));
|
|
448
|
+
}
|
|
449
|
+
get store() {
|
|
450
|
+
return this.dataStore;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* full data source update
|
|
454
|
+
* @param source - data column/rgRow source
|
|
455
|
+
* @param grouping - grouping information if present
|
|
456
|
+
*/
|
|
457
|
+
updateData(source, grouping, silent = false) {
|
|
458
|
+
// during full update we do drop trim
|
|
459
|
+
if (!silent) {
|
|
460
|
+
this.store.set('trimmed', {});
|
|
461
|
+
}
|
|
462
|
+
// clear items
|
|
463
|
+
this.store.set('items', []);
|
|
464
|
+
const items = range_1(0, (source === null || source === void 0 ? void 0 : source.length) || 0);
|
|
465
|
+
// set proxy first
|
|
466
|
+
setStore(this.store, {
|
|
467
|
+
source,
|
|
468
|
+
proxyItems: [...items],
|
|
469
|
+
});
|
|
470
|
+
// update data items
|
|
471
|
+
this.store.set('items', items);
|
|
472
|
+
// apply grooping if present
|
|
473
|
+
if (grouping) {
|
|
474
|
+
setStore(this.store, {
|
|
475
|
+
groupingDepth: grouping.depth,
|
|
476
|
+
groups: grouping.groups,
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
addTrimmed(some) {
|
|
481
|
+
let trimmed = this.store.get('trimmed');
|
|
482
|
+
trimmed = Object.assign(Object.assign({}, trimmed), some);
|
|
483
|
+
setStore(this.store, { trimmed });
|
|
484
|
+
}
|
|
485
|
+
// local data update
|
|
486
|
+
setData(input) {
|
|
487
|
+
const data = Object.assign({}, input);
|
|
488
|
+
setStore(this.store, data);
|
|
489
|
+
}
|
|
490
|
+
refresh() {
|
|
491
|
+
const source = this.store.get('source');
|
|
492
|
+
this.store.set('source', [...source]);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* get physical index by virtual
|
|
497
|
+
* @param store - store to process
|
|
498
|
+
*/
|
|
499
|
+
function getPhysical(store, virtualIndex) {
|
|
500
|
+
const items = store.get('items');
|
|
501
|
+
return items[virtualIndex];
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* get all visible items
|
|
505
|
+
* @param store - store to process
|
|
506
|
+
*/
|
|
507
|
+
function getVisibleSourceItem(store) {
|
|
508
|
+
const source = store.get('source');
|
|
509
|
+
return store.get('items').map(v => source[v]);
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* get mapped item from source
|
|
513
|
+
* @param store - store to process
|
|
514
|
+
* @param virtualIndex - virtual index to process
|
|
515
|
+
*/
|
|
516
|
+
function getSourceItem(store, virtualIndex) {
|
|
517
|
+
const items = store.get('items');
|
|
518
|
+
const source = store.get('source');
|
|
519
|
+
return source[items[virtualIndex]];
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* set item to source
|
|
523
|
+
* @param store - store to process
|
|
524
|
+
* @param modelByIndex - collection of rows with virtual indexes to setup
|
|
525
|
+
*/
|
|
526
|
+
function setSourceByVirtualIndex(store, modelByIndex) {
|
|
527
|
+
const items = store.get('items');
|
|
528
|
+
const source = store.get('source');
|
|
529
|
+
for (let virtualIndex in modelByIndex) {
|
|
530
|
+
const realIndex = items[virtualIndex];
|
|
531
|
+
source[realIndex] = modelByIndex[virtualIndex];
|
|
532
|
+
}
|
|
533
|
+
store.set('source', [...source]);
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* set item to source
|
|
537
|
+
* @param store - store to process
|
|
538
|
+
* @param modelByIndex - collection of rows with physical indexes to setup
|
|
539
|
+
*/
|
|
540
|
+
function setSourceByPhysicalIndex(store, modelByIndex) {
|
|
541
|
+
const source = store.get('source');
|
|
542
|
+
for (let index in modelByIndex) {
|
|
543
|
+
source[index] = modelByIndex[index];
|
|
544
|
+
}
|
|
545
|
+
store.set('source', [...source]);
|
|
546
|
+
}
|
|
547
|
+
function setItems(store, items) {
|
|
548
|
+
store.set('items', items);
|
|
549
|
+
}
|
|
550
|
+
function getSourceItemVirtualIndexByProp(store, prop) {
|
|
551
|
+
const items = store.get('items');
|
|
552
|
+
const source = store.get('source');
|
|
553
|
+
const physicalIndex = findIndex_1(source, { prop });
|
|
554
|
+
return items.indexOf(physicalIndex);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export { DataStore as D, _isIterateeCall as _, getSourceItemVirtualIndexByProp as a, getVisibleSourceItem as b, createStore as c, setStore as d, gatherTrimmedItems as e, findIndex_1 as f, getSourceItem as g, getPhysical as h, setItems as i, setSourceByVirtualIndex as s };
|