@revolist/revogrid 3.6.10 → 3.6.11

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.
Files changed (41) hide show
  1. package/custom-element/_baseIteratee.js +1 -1
  2. package/custom-element/columnService.js +1 -1
  3. package/custom-element/consts.js +1 -1
  4. package/custom-element/data.store.js +1 -1
  5. package/custom-element/debounce.js +1 -1
  6. package/custom-element/dimension.helpers.js +1 -1
  7. package/custom-element/index.d.ts +12 -0
  8. package/custom-element/index.js +39 -1
  9. package/custom-element/index.js.map +1 -1
  10. package/custom-element/isSymbol.js +1 -1
  11. package/custom-element/keys.js +1 -1
  12. package/custom-element/revo-grid.js +60 -3
  13. package/custom-element/revo-grid.js.map +1 -1
  14. package/custom-element/revogr-clipboard.js +0 -1
  15. package/custom-element/revogr-clipboard.js.map +1 -1
  16. package/custom-element/revogr-data2.js +1 -2
  17. package/custom-element/revogr-data2.js.map +1 -1
  18. package/custom-element/revogr-edit2.js +1 -2
  19. package/custom-element/revogr-edit2.js.map +1 -1
  20. package/custom-element/revogr-filter-panel.js +0 -1
  21. package/custom-element/revogr-filter-panel.js.map +1 -1
  22. package/custom-element/revogr-focus2.js +0 -1
  23. package/custom-element/revogr-focus2.js.map +1 -1
  24. package/custom-element/revogr-header2.js +1 -2
  25. package/custom-element/revogr-header2.js.map +1 -1
  26. package/custom-element/revogr-order-editor2.js +1 -2
  27. package/custom-element/revogr-order-editor2.js.map +1 -1
  28. package/custom-element/revogr-overlay-selection2.js +1 -2
  29. package/custom-element/revogr-overlay-selection2.js.map +1 -1
  30. package/custom-element/revogr-row-headers2.js +0 -1
  31. package/custom-element/revogr-row-headers2.js.map +1 -1
  32. package/custom-element/revogr-scroll-virtual2.js +0 -1
  33. package/custom-element/revogr-scroll-virtual2.js.map +1 -1
  34. package/custom-element/revogr-temp-range2.js +1 -2
  35. package/custom-element/revogr-temp-range2.js.map +1 -1
  36. package/custom-element/revogr-viewport-scroll2.js +1 -2
  37. package/custom-element/revogr-viewport-scroll2.js.map +1 -1
  38. package/custom-element/toNumber.js +1 -1
  39. package/package.json +1 -1
  40. package/custom-element/themeService.js +0 -65
  41. package/custom-element/themeService.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
  * Built by Revolist
3
3
  */
4
4
  import { c as isFunction_1, a as isArray_1, k as keys_1, d as isBuffer_1, e as isTypedArray_1, f as isLength_1, b as _isIndex, g as isArguments_1 } from './keys.js';
5
- import { e as _root, a as isObject_1, f as _Symbol, _ as _baseGetTag, b as isObjectLike_1, i as isSymbol_1 } from './isSymbol.js';
5
+ import { e as _root, b as isObject_1, f as _Symbol, _ as _baseGetTag, i as isObjectLike_1, d as isSymbol_1 } from './isSymbol.js';
6
6
  import { _ as _arrayMap } from './consts.js';
7
7
  import { i as identity_1 } from './identity.js';
8
8
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { h } from '@stencil/core/internal/client';
5
5
  import { c as createStore, d as setStore, b as getVisibleSourceItem, g as getSourceItem, s as setSourceByVirtualIndex } from './data.store.js';
6
- import { G as GRID_INTERNALS, C as CELL_CLASS, D as DISABLED_CLASS } from './consts.js';
6
+ import { G as GRID_INTERNALS, h as CELL_CLASS, i as DISABLED_CLASS } from './consts.js';
7
7
 
8
8
  const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;
9
9
  const PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;
@@ -43,6 +43,6 @@ const EDIT_INPUT_WR = 'edit-input-wrapper';
43
43
  const DRAGG_TEXT = 'Draggable item';
44
44
  const GRID_INTERNALS = '__rvgr';
45
45
 
46
- export { CELL_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 _, DRAGGABLE_CLASS as a, DRAG_ICON_CLASS as b, DATA_COL as c, DATA_ROW as d, HEADER_SORTABLE_CLASS as e, HEADER_ROW_CLASS as f, HEADER_ACTUAL_ROW_CLASS as g, DRAGG_TEXT as h, CELL_HANDLER_CLASS as i };
46
+ export { CELL_HANDLER_CLASS as C, DRAGGABLE_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 _, DRAG_ICON_CLASS as a, DATA_COL as b, DATA_ROW as c, HEADER_SORTABLE_CLASS as d, HEADER_ROW_CLASS as e, HEADER_ACTUAL_ROW_CLASS as f, DRAGG_TEXT as g, CELL_CLASS as h, DISABLED_CLASS as i };
47
47
 
48
48
  //# sourceMappingURL=consts.js.map
@@ -5,7 +5,7 @@ import { getRenderingRef, forceUpdate } from '@stencil/core/internal/client';
5
5
  import { t as toInteger_1, _ as _baseFindIndex, a as toFinite_1 } from './toInteger.js';
6
6
  import { _ as _baseIteratee, e as eq_1 } from './_baseIteratee.js';
7
7
  import { i as isArrayLike_1, b as _isIndex } from './keys.js';
8
- import { a as isObject_1 } from './isSymbol.js';
8
+ import { b as isObject_1 } from './isSymbol.js';
9
9
 
10
10
  /* Built-in method references for those with the same name as other `lodash` methods. */
11
11
  var nativeMax$1 = Math.max;
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Built by Revolist
3
3
  */
4
- import { e as _root, a as isObject_1 } from './isSymbol.js';
4
+ import { e as _root, b as isObject_1 } from './isSymbol.js';
5
5
  import { t as toNumber_1 } from './toNumber.js';
6
6
 
7
7
  /**
@@ -2,7 +2,7 @@
2
2
  * Built by Revolist
3
3
  */
4
4
  import { _ as _baseEach, e as each } from './each.js';
5
- import { i as isSymbol_1 } from './isSymbol.js';
5
+ import { d as isSymbol_1 } from './isSymbol.js';
6
6
  import { i as identity_1 } from './identity.js';
7
7
  import { _ as _baseIteratee } from './_baseIteratee.js';
8
8
  import { a as isArray_1 } from './keys.js';
@@ -25,3 +25,15 @@ export interface SetPlatformOptions {
25
25
  rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
26
26
  }
27
27
  export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
28
+
29
+ /**
30
+ * Utility to define all custom elements within this package using the tag name provided in the component's source.
31
+ * When defining each custom element, it will also check it's safe to define by:
32
+ *
33
+ * 1. Ensuring the "customElements" registry is available in the global context (window).
34
+ * 2. Ensuring that the component tag name is not already defined.
35
+ *
36
+ * Use the standard [customElements.define()](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define)
37
+ * method instead to define custom elements individually, or to provide a different tag name.
38
+ */
39
+ export declare const defineCustomElements: (opts?: any) => void;
@@ -3,7 +3,19 @@
3
3
  */
4
4
  import { setMode } from '@stencil/core/internal/client';
5
5
  export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
6
- import { T as ThemeService } from './themeService.js';
6
+ import { T as ThemeService, RevoGrid } from './revo-grid.js';
7
+ import { RevogrClipboard } from './revogr-clipboard.js';
8
+ import { RevogrData } from './revogr-data.js';
9
+ import { RevogrEdit } from './revogr-edit.js';
10
+ import { RevogrFilterPanel } from './revogr-filter-panel.js';
11
+ import { RevogrFocus } from './revogr-focus.js';
12
+ import { RevogrHeader } from './revogr-header.js';
13
+ import { RevogrOrderEditor } from './revogr-order-editor.js';
14
+ import { RevogrOverlaySelection } from './revogr-overlay-selection.js';
15
+ import { RevogrRowHeaders } from './revogr-row-headers.js';
16
+ import { RevogrScrollVirtual } from './revogr-scroll-virtual.js';
17
+ import { RevogrTempRange } from './revogr-temp-range.js';
18
+ import { RevogrViewportScroll } from './revogr-viewport-scroll.js';
7
19
 
8
20
  setMode(elm => {
9
21
  let theme = elm.theme || elm.getAttribute('theme');
@@ -17,4 +29,30 @@ setMode(elm => {
17
29
  return parsedTheme;
18
30
  });
19
31
 
32
+ const defineCustomElements = (opts) => {
33
+ if (typeof customElements !== 'undefined') {
34
+ [
35
+ RevoGrid,
36
+ RevogrClipboard,
37
+ RevogrData,
38
+ RevogrEdit,
39
+ RevogrFilterPanel,
40
+ RevogrFocus,
41
+ RevogrHeader,
42
+ RevogrOrderEditor,
43
+ RevogrOverlaySelection,
44
+ RevogrRowHeaders,
45
+ RevogrScrollVirtual,
46
+ RevogrTempRange,
47
+ RevogrViewportScroll,
48
+ ].forEach(cmp => {
49
+ if (!customElements.get(cmp.is)) {
50
+ customElements.define(cmp.is, cmp, opts);
51
+ }
52
+ });
53
+ }
54
+ };
55
+
56
+ export { defineCustomElements };
57
+
20
58
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"file":"index.js","mappings":";;;;;;;AAGA,OAAO,CAAC,GAAG;EACT,IAAI,KAAK,GAAwB,GAAW,CAAC,KAAK,IAAI,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;EAChF,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IAC7B,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;GACtB;EAED,MAAM,WAAW,GAAG,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;EACjD,IAAI,WAAW,KAAK,KAAK,EAAE;IACzB,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;GACxC;EACD,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC","names":[],"sources":["src/global/global.ts"],"sourcesContent":["import { setMode } from '@stencil/core';\nimport ThemeService from '../themeManager/themeService';\n\nsetMode(elm => {\n let theme: string | undefined = (elm as any).theme || elm.getAttribute('theme');\n if (typeof theme === 'string') {\n theme = theme.trim();\n }\n\n const parsedTheme = ThemeService.getTheme(theme);\n if (parsedTheme !== theme) {\n elm.setAttribute('theme', parsedTheme);\n }\n return parsedTheme;\n});\n"],"version":3}
1
+ {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;AAGA,OAAO,CAAC,GAAG;EACT,IAAI,KAAK,GAAwB,GAAW,CAAC,KAAK,IAAI,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;EAChF,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IAC7B,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;GACtB;EAED,MAAM,WAAW,GAAG,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;EACjD,IAAI,WAAW,KAAK,KAAK,EAAE;IACzB,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;GACxC;EACD,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/global/global.ts"],"sourcesContent":["import { setMode } from '@stencil/core';\nimport ThemeService from '../themeManager/themeService';\n\nsetMode(elm => {\n let theme: string | undefined = (elm as any).theme || elm.getAttribute('theme');\n if (typeof theme === 'string') {\n theme = theme.trim();\n }\n\n const parsedTheme = ThemeService.getTheme(theme);\n if (parsedTheme !== theme) {\n elm.setAttribute('theme', parsedTheme);\n }\n return parsedTheme;\n});\n"],"version":3}
@@ -217,6 +217,6 @@ function isSymbol(value) {
217
217
 
218
218
  var isSymbol_1 = isSymbol;
219
219
 
220
- export { _baseGetTag as _, isObject_1 as a, isObjectLike_1 as b, createCommonjsModule as c, commonjsGlobal as d, _root as e, _Symbol as f, _freeGlobal as g, isSymbol_1 as i };
220
+ export { _baseGetTag as _, commonjsGlobal as a, isObject_1 as b, createCommonjsModule as c, isSymbol_1 as d, _root as e, _Symbol as f, _freeGlobal as g, isObjectLike_1 as i };
221
221
 
222
222
  //# sourceMappingURL=isSymbol.js.map
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Built by Revolist
3
3
  */
4
- import { b as isObjectLike_1, _ as _baseGetTag, c as createCommonjsModule, e as _root, g as _freeGlobal, a as isObject_1 } from './isSymbol.js';
4
+ import { i as isObjectLike_1, _ as _baseGetTag, c as createCommonjsModule, e as _root, g as _freeGlobal, b as isObject_1 } from './isSymbol.js';
5
5
 
6
6
  /**
7
7
  * The base implementation of `_.times` without support for iteratee shorthands
@@ -9,7 +9,6 @@ import { i as isArrayLike_1, k as keys_1, a as isArray_1, _ as _baseKeys } from
9
9
  import { f as findIndex_1, g as getSourceItem, a as getSourceItemVirtualIndexByProp, s as setSourceByVirtualIndex, D as DataStore, b as getVisibleSourceItem, c as createStore, d as setStore, _ as _isIterateeCall, e as getPhysical, h as setItems } from './data.store.js';
10
10
  import { _ as _arrayMap, U as UUID } from './consts.js';
11
11
  import { V as ViewportStore, d as defineCustomElement$5 } from './revogr-row-headers2.js';
12
- import { T as ThemeService } from './themeService.js';
13
12
  import { t as timeout, g as getScrollbarWidth } from './utils.js';
14
13
  import { i as isFilterBtn, F as FILTER_PROP } from './filter.button.js';
15
14
  import { i as isString_1, d as defineCustomElement$a } from './revogr-edit2.js';
@@ -25,6 +24,65 @@ import { d as defineCustomElement$7 } from './revogr-order-editor2.js';
25
24
  import { d as defineCustomElement$6 } from './revogr-overlay-selection2.js';
26
25
  import { d as defineCustomElement$4 } from './revogr-scroll-virtual2.js';
27
26
 
27
+ class ThemeCompact {
28
+ constructor() {
29
+ this.defaultRowSize = 32;
30
+ }
31
+ }
32
+
33
+ class ThemeDefault {
34
+ constructor() {
35
+ this.defaultRowSize = 27;
36
+ }
37
+ }
38
+
39
+ class ThemeMaterial {
40
+ constructor() {
41
+ this.defaultRowSize = 42;
42
+ }
43
+ }
44
+
45
+ const DEFAULT_THEME = 'default';
46
+ const allowedThemes = [DEFAULT_THEME, 'material', 'compact', 'darkMaterial', 'darkCompact'];
47
+ class ThemeService {
48
+ get theme() {
49
+ return this.currentTheme;
50
+ }
51
+ get rowSize() {
52
+ return this.customRowSize || this.currentTheme.defaultRowSize;
53
+ }
54
+ set rowSize(size) {
55
+ this.customRowSize = size;
56
+ }
57
+ constructor(cfg) {
58
+ this.customRowSize = 0;
59
+ this.customRowSize = cfg.rowSize;
60
+ this.register('default');
61
+ }
62
+ register(theme) {
63
+ const parsedTheme = ThemeService.getTheme(theme);
64
+ switch (parsedTheme) {
65
+ case 'material':
66
+ case 'darkMaterial':
67
+ this.currentTheme = new ThemeMaterial();
68
+ break;
69
+ case 'compact':
70
+ case 'darkCompact':
71
+ this.currentTheme = new ThemeCompact();
72
+ break;
73
+ default:
74
+ this.currentTheme = new ThemeDefault();
75
+ break;
76
+ }
77
+ }
78
+ static getTheme(theme) {
79
+ if (allowedThemes.indexOf(theme) > -1) {
80
+ return theme;
81
+ }
82
+ return DEFAULT_THEME;
83
+ }
84
+ }
85
+
28
86
  /**
29
87
  * Creates a `_.find` or `_.findLast` function.
30
88
  *
@@ -3553,11 +3611,10 @@ function defineCustomElement$1() {
3553
3611
  break;
3554
3612
  } });
3555
3613
  }
3556
- defineCustomElement$1();
3557
3614
 
3558
3615
  const RevoGrid = RevoGridComponent;
3559
3616
  const defineCustomElement = defineCustomElement$1;
3560
3617
 
3561
- export { RevoGrid, defineCustomElement };
3618
+ export { RevoGrid, ThemeService as T, defineCustomElement };
3562
3619
 
3563
3620
  //# sourceMappingURL=revo-grid.js.map