@revolist/revogrid
Advanced tools
Comparing version 1.0.21 to 1.0.22
import { r as registerInstance, h, g as getElement } from './index-30f1902f.js'; | ||
import { s as setViewport, a as setSettings } from './dimension.store-fe069592.js'; | ||
import { s as setData, a as setColumn, d as dataProvider } from './data.provider-2a7c4c5d.js'; | ||
import { s as setData, a as setColumn, d as dataProvider } from './data.provider-8e2b5590.js'; | ||
import { m as moduleRegister } from './moduleRegister-c343f223.js'; | ||
import { V as VIEWPORT_CLASS, U as UUID } from './consts-e08cac4b.js'; | ||
import { V as VIEWPORT_CLASS, U as UUID } from './consts-a3d9211d.js'; | ||
import { d as dimensionProvider } from './dimension.provider-d5107417.js'; | ||
class GridResize { | ||
class GridResizeService { | ||
constructor(el, viewport) { | ||
@@ -32,3 +32,3 @@ this.viewport = viewport; | ||
const revoGridCss = "revo-grid{display:block;height:100%;font-family:Helvetica, Arial, Sans-Serif, serif;font-size:14px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}revo-grid .header{position:relative;height:30px;line-height:30px;display:table-cell;box-shadow:0 1px 10px rgba(0, 0, 0, 0.2);font-weight:600}revo-grid .header-wrapper{height:0;display:table-row}revo-grid .viewport-wrapper{display:block;width:100%;height:100%}revo-grid .viewport{display:block;height:100%;max-width:100%;position:relative;float:left}revo-grid .viewport-layer{display:block;height:100%;width:100%;position:relative}revo-grid .data-cell{position:absolute;box-sizing:border-box;box-shadow:0 1px 0 0 #e0e0e0, 1px 0 0 0 #e0e0e0;height:100%;text-align:center;padding:5px 0}revo-grid .data-cell.active{background:blue}revo-grid .row{position:absolute;width:100%;left:0}revo-grid .data-header-cell{position:absolute;box-sizing:border-box;box-shadow:0 1px 0 0 #e0e0e0, 1px 0 0 0 #e0e0e0;height:100%;text-align:center}revo-grid .horizontal-wrapper{height:100%;overflow-x:auto;overflow-y:hidden}revo-grid .inner-content-table{display:table;height:100%;width:100%;position:relative;z-index:0}revo-grid .vertical-wrapper{display:table-row;position:relative}revo-grid .vertical-inner{overflow-y:auto;height:100%;position:relative;-ms-overflow-style:none;}revo-grid .vertical-inner::-webkit-scrollbar{display:none;-webkit-appearance:none}revo-grid .vertical-scroll{position:absolute;right:0;overflow-y:auto;overflow-x:visible;z-index:1;top:0;bottom:0}revo-grid .vertical-scroll>div{width:1px}revogr-overlay-selection{display:block}revogr-overlay-selection .selection-border-range,revogr-overlay-selection .selection-bg-range,revogr-overlay-selection .temp-bg-range,revogr-overlay-selection .focused-cell{position:absolute;pointer-events:none}revogr-overlay-selection .selection-border-range{box-shadow:-1px 0 0 #0d63e8 inset, 1px 0 0 #0d63e8 inset, 0 -1px 0 #0d63e8 inset, 0 1px 0 #0d63e8 inset;padding:1px 1px 0 0}revogr-overlay-selection .focused-cell{box-shadow:-2px 0 0 #0d63e8 inset, 2px 0 0 #0d63e8 inset, 0 -2px 0 #0d63e8 inset, 0 2px 0 #0d63e8 inset;padding:1px 1px 0 0}revogr-overlay-selection .selection-bg-range{background:rgba(13, 99, 232, 0.1);z-index:-1}revogr-overlay-selection .temp-bg-range{background-color:rgba(13, 99, 232, 0.1)}revogr-edit{display:block}revogr-edit .edit-input-wrapper{position:absolute;background-color:#fff}revogr-edit .edit-input-wrapper input{height:100%;width:100%;box-sizing:border-box}"; | ||
const revoGridCss = "revo-grid{display:block;height:100%;font-family:Helvetica, Arial, Sans-Serif, serif;font-size:14px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}revo-grid .header{position:relative;height:30px;line-height:30px;display:table-cell;box-shadow:0 1px 10px rgba(0, 0, 0, 0.2);font-weight:600;z-index:1}revo-grid .header-wrapper{height:0;display:table-row}revo-grid .viewport-wrapper{display:block;width:100%;height:100%}revo-grid .viewport{display:block;height:100%;max-width:100%;position:relative;float:left}revo-grid .viewport-layer{display:block;height:100%;width:100%;position:relative}revo-grid .data-cell{position:absolute;box-sizing:border-box;box-shadow:0 -1px 0 0 #e0e0e0 inset, -1px 0 0 0 #e0e0e0 inset;height:100%;text-align:center;padding:5px 0}revo-grid .data-cell.disabled{background-color:#f7f7f7}revo-grid .row{position:absolute;width:100%;left:0}revo-grid .data-header-cell{position:absolute;box-sizing:border-box;box-shadow:0 -1px 0 0 #e0e0e0 inset, -1px 0 0 0 #e0e0e0 inset;height:100%;text-align:center}revo-grid .horizontal-wrapper{height:100%;overflow-x:auto;overflow-y:hidden}revo-grid .inner-content-table{display:table;height:100%;width:100%;position:relative;z-index:0}revo-grid .vertical-wrapper{display:table-row;position:relative}revo-grid .vertical-inner{overflow-y:auto;height:100%;position:relative;-ms-overflow-style:none;}revo-grid .vertical-inner::-webkit-scrollbar{display:none;-webkit-appearance:none}revo-grid .vertical-scroll{position:absolute;right:0;overflow-y:auto;overflow-x:visible;z-index:1;top:0;bottom:0}revo-grid .vertical-scroll>div{width:1px}revogr-overlay-selection{display:block}revogr-overlay-selection .selection-border-range,revogr-overlay-selection .selection-bg-range,revogr-overlay-selection .temp-bg-range,revogr-overlay-selection .focused-cell{position:absolute;pointer-events:none}revogr-overlay-selection .selection-border-range{box-shadow:-1px 0 0 #0d63e8 inset, 1px 0 0 #0d63e8 inset, 0 -1px 0 #0d63e8 inset, 0 1px 0 #0d63e8 inset;padding:1px 1px 0 0}revogr-overlay-selection .focused-cell{box-shadow:-2px 0 0 #0d63e8 inset, 2px 0 0 #0d63e8 inset, 0 -2px 0 #0d63e8 inset, 0 2px 0 #0d63e8 inset;padding:1px 1px 0 0}revogr-overlay-selection .selection-bg-range{background:rgba(13, 99, 232, 0.1);z-index:-1}revogr-overlay-selection .temp-bg-range{background-color:rgba(13, 99, 232, 0.1)}revogr-edit{display:block}revogr-edit .edit-input-wrapper{position:absolute;background-color:#fff}revogr-edit .edit-input-wrapper input{height:100%;width:100%;box-sizing:border-box}"; | ||
@@ -41,3 +41,4 @@ const initialSettings = { | ||
readonly: false, | ||
range: false | ||
range: false, | ||
resize: false | ||
}; | ||
@@ -53,2 +54,3 @@ const RevoGrid = class { | ||
this.readonly = initialSettings.readonly; | ||
this.resize = initialSettings.resize; | ||
this.dimensions = {}; | ||
@@ -86,3 +88,3 @@ // data is array of objects | ||
async componentDidLoad() { | ||
moduleRegister.register('resize', new GridResize(this.element, this.viewport)); | ||
moduleRegister.register('resize', new GridResizeService(this.element, this.viewport)); | ||
} | ||
@@ -98,3 +100,3 @@ disconnectedCallback() { | ||
}; | ||
return h("revogr-viewport-scrollable", Object.assign({}, viewportProp), h("revogr-header", { slot: 'header', class: 'header' }), h("revogr-data", { slot: 'content', class: 'viewport-layer' }), !this.readonly || this.range ? h("revogr-overlay-selection", { slot: 'content', range: this.range }) : '', !this.readonly ? h("revogr-edit", { slot: 'content' }) : ''); | ||
return h("revogr-viewport-scrollable", Object.assign({}, viewportProp), h("revogr-header", { slot: 'header', class: 'header', resize: this.resize }), h("revogr-data", { slot: 'content', class: 'viewport-layer' }), !this.readonly || this.range ? h("revogr-overlay-selection", { slot: 'content', range: this.range }) : '', !this.readonly ? h("revogr-edit", { slot: 'content' }) : ''); | ||
} | ||
@@ -101,0 +103,0 @@ get element() { return getElement(this); } |
@@ -6,3 +6,3 @@ import { b as bootstrapLazy } from './index-30f1902f.js'; | ||
globalScripts(); | ||
return bootstrapLazy([["revogr-edit",[[0,"revogr-edit"]]],["revogr-data",[[0,"revogr-data"]]],["revogr-header",[[0,"revogr-header"]]],["revogr-overlay-selection",[[0,"revogr-overlay-selection",{"range":[4]}]]],["revogr-viewport-scrollable",[[4,"revogr-viewport-scrollable",{"scrollX":[64],"scrollY":[64]}]]],["revogr-text-editor",[[0,"revogr-text-editor",{"value":[1]}]]],["revo-grid",[[0,"revo-grid",{"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"dimensions":[16],"source":[16],"columns":[16]},[[0,"beforeEdit","beforeSave"]]]]]], options); | ||
return bootstrapLazy([["revogr-edit",[[0,"revogr-edit"]]],["revogr-data",[[0,"revogr-data"]]],["revogr-header",[[0,"revogr-header",{"resize":[4]}]]],["revogr-overlay-selection",[[0,"revogr-overlay-selection",{"range":[4]}]]],["revogr-viewport-scrollable",[[4,"revogr-viewport-scrollable",{"scrollX":[64],"scrollY":[64]}]]],["revogr-text-editor",[[0,"revogr-text-editor",{"value":[1]}]]],["revo-grid",[[0,"revo-grid",{"frameSize":[2,"frame-size"],"rowSize":[2,"row-size"],"colSize":[2,"col-size"],"range":[4],"readonly":[4],"resize":[4],"dimensions":[16],"source":[16],"columns":[16]},[[0,"beforeEdit","beforeSave"]]]]]], options); | ||
}); |
import { r as registerInstance, h, g as getElement } from './index-30f1902f.js'; | ||
import { r as rowsStore, m as colsStore } from './dimension.store-fe069592.js'; | ||
import { d as dataProvider } from './data.provider-2a7c4c5d.js'; | ||
import { D as DATA_COL, a as DATA_ROW, C as CELL_CLASS } from './consts-e08cac4b.js'; | ||
import { d as dataProvider } from './data.provider-8e2b5590.js'; | ||
import { D as DATA_COL, a as DATA_ROW, C as CELL_CLASS, b as DISABLED_CLASS } from './consts-a3d9211d.js'; | ||
@@ -18,3 +18,3 @@ const RevogrData = class { | ||
[DATA_ROW]: row.itemIndex, | ||
class: CELL_CLASS, | ||
class: `${CELL_CLASS} ${dataProvider.isReadOnly(row.itemIndex, col.itemIndex) ? DISABLED_CLASS : ''}`, | ||
style: { width: `${col.size}px`, transform: `translateX(${col.start}px)` } | ||
@@ -21,0 +21,0 @@ }; |
import { r as registerInstance, i as createEvent, h } from './index-30f1902f.js'; | ||
import { n as isSymbol_1, o as isObject_1, p as _arrayMap, q as keys_1, d as isArrayLike_1, t as getItemByIndex, u as colsStore, v as rowsStore } from './dimension.store-fe069592.js'; | ||
import { i as isString_1, d as dataProvider } from './data.provider-2a7c4c5d.js'; | ||
import { i as isString_1, d as dataProvider } from './data.provider-8e2b5590.js'; | ||
import { m as moduleRegister } from './moduleRegister-c343f223.js'; | ||
import { C as CELL_CLASS } from './consts-e08cac4b.js'; | ||
import { C as CELL_CLASS } from './consts-a3d9211d.js'; | ||
import { s as store, a as setEdit } from './selection.strore-c83ca11a.js'; | ||
@@ -395,3 +395,3 @@ import { i as interact_min } from './interact.min-aa0349a2.js'; | ||
class CellEdit { | ||
class CellEditService { | ||
constructor(target) { | ||
@@ -402,7 +402,4 @@ this.target = target; | ||
const focus = store.get('focus'); | ||
if (focus) { | ||
setEdit({ | ||
x: focus.x, | ||
y: focus.y | ||
}); | ||
if (focus && !dataProvider.isReadOnly(focus.y, focus.x)) { | ||
setEdit({ x: focus.x, y: focus.y }); | ||
} | ||
@@ -426,3 +423,3 @@ }); | ||
const focus = store.get('focus'); | ||
if (focus) { | ||
if (focus && !dataProvider.isReadOnly(focus.y, focus.x)) { | ||
setEdit({ | ||
@@ -466,3 +463,3 @@ x: focus.x, | ||
connectedCallback() { | ||
this.cellEditModule = new CellEdit(`${moduleRegister.baseClass} .${CELL_CLASS}`); | ||
this.cellEditModule = new CellEditService(`${moduleRegister.baseClass} .${CELL_CLASS}`); | ||
moduleRegister.register('cellEdit', this.cellEditModule); | ||
@@ -469,0 +466,0 @@ } |
import { r as registerInstance, h, g as getElement } from './index-30f1902f.js'; | ||
import { m as colsStore } from './dimension.store-fe069592.js'; | ||
import { d as dataProvider } from './data.provider-2a7c4c5d.js'; | ||
import { d as dataProvider } from './data.provider-8e2b5590.js'; | ||
import { m as moduleRegister } from './moduleRegister-c343f223.js'; | ||
import { D as DATA_COL, H as HEADER_CLASS } from './consts-e08cac4b.js'; | ||
import { D as DATA_COL, H as HEADER_CLASS } from './consts-a3d9211d.js'; | ||
import { d as dimensionProvider } from './dimension.provider-d5107417.js'; | ||
import { i as interact_min } from './interact.min-aa0349a2.js'; | ||
class HeaderResize { | ||
class HeaderResizeService { | ||
constructor(target) { | ||
@@ -25,3 +25,3 @@ this.target = target; | ||
const ViewportDataComponent = class { | ||
const RevogrHeaderComponent = class { | ||
constructor(hostRef) { | ||
@@ -31,3 +31,5 @@ registerInstance(this, hostRef); | ||
connectedCallback() { | ||
moduleRegister.register('headResize', new HeaderResize(`${moduleRegister.baseClass} .${HEADER_CLASS}`)); | ||
if (this.resize) { | ||
moduleRegister.register('headResize', new HeaderResizeService(`${moduleRegister.baseClass} .${HEADER_CLASS}`)); | ||
} | ||
} | ||
@@ -52,2 +54,2 @@ disconnectedCallback() { | ||
export { ViewportDataComponent as revogr_header }; | ||
export { RevogrHeaderComponent as revogr_header }; |
import { r as registerInstance, h } from './index-30f1902f.js'; | ||
import { m as colsStore, r as rowsStore, t as getItemByIndex, v as rowsStore$1, u as colsStore$1 } from './dimension.store-fe069592.js'; | ||
import { m as moduleRegister } from './moduleRegister-c343f223.js'; | ||
import { D as DATA_COL, a as DATA_ROW, C as CELL_CLASS, S as SELECTION_BORDER_CLASS, b as SELECTION_BG_CLASS, T as TMP_SELECTION_BG_CLASS, F as FOCUS_CLASS } from './consts-e08cac4b.js'; | ||
import { D as DATA_COL, a as DATA_ROW, C as CELL_CLASS, S as SELECTION_BORDER_CLASS, c as SELECTION_BG_CLASS, T as TMP_SELECTION_BG_CLASS, F as FOCUS_CLASS } from './consts-a3d9211d.js'; | ||
import { b as setFocus, c as setRange, d as setTempRange, s as store } from './selection.strore-c83ca11a.js'; | ||
@@ -16,3 +16,3 @@ import { i as interact_min } from './interact.min-aa0349a2.js'; | ||
class CellSelection { | ||
class CellSelectionService { | ||
constructor(target, range = false) { | ||
@@ -55,3 +55,3 @@ this.target = target; | ||
}); | ||
this.keyDownFunc = (e) => CellSelection.handleKeyDown(e, range); | ||
this.keyDownFunc = (e) => CellSelectionService.handleKeyDown(e, range); | ||
document.addEventListener('keydown', this.keyDownFunc); | ||
@@ -138,3 +138,3 @@ } | ||
connectedCallback() { | ||
moduleRegister.register('cellSelection', new CellSelection(`${moduleRegister.baseClass} .${CELL_CLASS}`, this.range)); | ||
moduleRegister.register('cellSelection', new CellSelectionService(`${moduleRegister.baseClass} .${CELL_CLASS}`, this.range)); | ||
} | ||
@@ -141,0 +141,0 @@ disconnectedCallback() { |
@@ -17,2 +17,3 @@ /* eslint-disable */ | ||
"readonly": boolean; | ||
"resize": boolean; | ||
"rowSize": number; | ||
@@ -26,2 +27,3 @@ "source": DataType[]; | ||
interface RevogrHeader { | ||
"resize": boolean; | ||
} | ||
@@ -100,2 +102,3 @@ interface RevogrOverlaySelection { | ||
"readonly"?: boolean; | ||
"resize"?: boolean; | ||
"rowSize"?: number; | ||
@@ -110,2 +113,3 @@ "source"?: DataType[]; | ||
interface RevogrHeader { | ||
"resize"?: boolean; | ||
} | ||
@@ -112,0 +116,0 @@ interface RevogrOverlaySelection { |
import { HTMLStencilElement } from '../../stencil-public-runtime'; | ||
export declare class ViewportDataComponent { | ||
export declare class RevogrHeaderComponent { | ||
element: HTMLStencilElement; | ||
resize: boolean; | ||
connectedCallback(): void; | ||
@@ -5,0 +6,0 @@ disconnectedCallback(): void; |
@@ -11,2 +11,3 @@ import { ColumnData, DataType, Edition, MultiDimensionAction } from '../../interfaces'; | ||
readonly: boolean; | ||
resize: boolean; | ||
dimensions: Partial<MultiDimensionAction>; | ||
@@ -13,0 +14,0 @@ source: DataType[]; |
@@ -11,5 +11,7 @@ export declare type DimensionType = 'col' | 'row'; | ||
}; | ||
export declare type ReadOnlyFormat = boolean | ((row: number, col: number) => boolean); | ||
export interface ColumnDataSchema { | ||
prop: ColumnProp; | ||
name?: DataFormat; | ||
readonly?: ReadOnlyFormat; | ||
cellTemplate?: Function; | ||
@@ -68,2 +70,3 @@ } | ||
range: boolean; | ||
resize: boolean; | ||
dimensions?: { | ||
@@ -70,0 +73,0 @@ col?: ViewSettingSizeProp; |
@@ -13,4 +13,5 @@ import { ObservableMap } from '@stencil/store'; | ||
header(c: number): string; | ||
isReadOnly(r: number, c: number): boolean; | ||
} | ||
declare const dataProvider: DataProvider; | ||
export default dataProvider; |
export declare const DATA_COL: string; | ||
export declare const DATA_ROW: string; | ||
export declare const UUID: string; | ||
export declare const DISABLED_CLASS: string; | ||
export declare const CELL_CLASS: string; | ||
@@ -5,0 +6,0 @@ export declare const HEADER_CLASS: string; |
{ | ||
"name": "@revolist/revogrid", | ||
"version": "1.0.21", | ||
"version": "1.0.22", | ||
"description": "Reactive grid component - Revo Grid.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
604224
67
11988
3