@1771technologies/lytenyte-pro 1.0.14 → 1.0.16
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/__play__/cell-selections/cell-selection.play.d.ts +5 -0
- package/dist/__play__/{grid-navigation/normal-layout.play.js → cell-selections/cell-selection.play.js} +32 -24
- package/dist/__play__/filter-select/filter-select.play.d.ts +4 -0
- package/dist/__play__/filter-select/filter-select.play.js +76 -0
- package/dist/__play__/test-utils/row-handler.js +6 -7
- package/dist/cell-selection/bound-selection-rect.js +1 -1
- package/dist/cell-selection/cell-selection-driver.js +12 -8
- package/dist/column-manager/branch.d.ts +1 -1
- package/dist/column-manager/branch.js +1 -1
- package/dist/column-manager/label.d.ts +1 -1
- package/dist/column-manager/label.js +1 -1
- package/dist/column-manager/leaf.js +1 -1
- package/dist/column-manager/move-handle.d.ts +1 -1
- package/dist/column-manager/move-handle.js +1 -2
- package/dist/column-manager/visibility-checkbox.d.ts +1 -1
- package/dist/column-manager/visibility-checkbox.js +1 -1
- package/dist/context.d.ts +2 -1
- package/dist/context.js +5 -4
- package/dist/filter-selects/apply.d.ts +7 -0
- package/dist/filter-selects/apply.js +22 -0
- package/dist/filter-selects/context.d.ts +12 -0
- package/dist/filter-selects/context.js +3 -0
- package/dist/filter-selects/filter-combinator.d.ts +10 -0
- package/dist/filter-selects/filter-combinator.js +19 -0
- package/dist/filter-selects/filter-row-context.d.ts +30 -0
- package/dist/filter-selects/filter-row-context.js +3 -0
- package/dist/filter-selects/filter-row.d.ts +13 -0
- package/dist/filter-selects/filter-row.js +118 -0
- package/dist/filter-selects/index.d.ts +20 -0
- package/dist/filter-selects/index.js +18 -0
- package/dist/filter-selects/is-complete-filter.d.ts +2 -0
- package/dist/filter-selects/is-complete-filter.js +5 -0
- package/dist/filter-selects/operator-select.d.ts +14 -0
- package/dist/filter-selects/operator-select.js +25 -0
- package/dist/filter-selects/options.d.ts +9 -0
- package/dist/filter-selects/options.js +100 -0
- package/dist/filter-selects/reset.d.ts +7 -0
- package/dist/filter-selects/reset.js +22 -0
- package/dist/filter-selects/root.d.ts +13 -0
- package/dist/filter-selects/root.js +5 -0
- package/dist/filter-selects/to-filter-item.d.ts +3 -0
- package/dist/filter-selects/to-filter-item.js +7 -0
- package/dist/filter-selects/use-filter-select.d.ts +37 -0
- package/dist/filter-selects/use-filter-select.js +158 -0
- package/dist/filter-selects/value-input.d.ts +12 -0
- package/dist/filter-selects/value-input.js +27 -0
- package/dist/filter-tree/branch.d.ts +1 -1
- package/dist/filter-tree/branch.js +1 -1
- package/dist/filter-tree/hooks/use-filter-tree.js +1 -1
- package/dist/filter-tree/inclusion-checkbox.d.ts +1 -1
- package/dist/filter-tree/inclusion-checkbox.js +1 -1
- package/dist/filter-tree/label.d.ts +1 -1
- package/dist/filter-tree/label.js +1 -1
- package/dist/filter-tree/root.d.ts +1 -1
- package/dist/filter-tree/root.js +1 -1
- package/dist/grid/cell.d.ts +6 -0
- package/dist/grid/cell.js +3 -0
- package/dist/grid/header-cell.d.ts +10 -0
- package/dist/grid/header-cell.js +3 -0
- package/dist/grid/header-group-cell.d.ts +6 -0
- package/dist/grid/header-group-cell.js +3 -0
- package/dist/grid/header-row.d.ts +5 -0
- package/dist/grid/header-row.js +2 -0
- package/dist/grid/header.d.ts +1 -0
- package/dist/grid/header.js +2 -0
- package/dist/{root → grid}/root.d.ts +1 -1
- package/dist/grid/root.js +37 -0
- package/dist/grid/row-full-width.d.ts +9 -0
- package/dist/grid/row-full-width.js +3 -0
- package/dist/grid/row.d.ts +8 -0
- package/dist/grid/row.js +3 -0
- package/dist/grid/rows-container.d.ts +1 -0
- package/dist/grid/rows-container.js +2 -0
- package/dist/grid/rows-sections.js +13 -0
- package/dist/grid/viewport.js +9 -0
- package/dist/grid-box/item.d.ts +1 -1
- package/dist/grid-box/item.js +1 -2
- package/dist/grid-box/panel.js +1 -1
- package/dist/grid-box/use-aggregation-box-items.js +1 -1
- package/dist/grid-box/use-column-box-items.js +1 -1
- package/dist/grid-box/use-row-group-box-items.js +1 -1
- package/dist/grid.d.ts +9 -9
- package/dist/grid.js +11 -11
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/license/index.d.ts +1 -0
- package/dist/license/index.js +1 -0
- package/dist/license/license.d.ts +3 -0
- package/dist/license/license.js +215 -0
- package/dist/license/md5-hash.d.ts +9 -0
- package/dist/license/md5-hash.js +167 -0
- package/dist/license.js +1 -1
- package/dist/listbox/item.js +1 -1
- package/dist/listbox/panel.js +2 -2
- package/dist/row-data-source-client/filter/compute-filtered-rows.js +1 -1
- package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.js +1 -1
- package/dist/row-data-source-client/use-client-data-source-paginated.js +3 -2
- package/dist/row-data-source-client/use-client-data-source.js +3 -2
- package/dist/row-data-source-client/use-client-tree-data-source.js +3 -2
- package/dist/row-data-source-server/server-data.js +1 -1
- package/dist/row-data-source-server/use-server-data-source.js +2 -2
- package/dist/sort-manager/hooks/use-sort-manager.js +2 -2
- package/dist/sort-manager/hooks/use-sort-row-item.js +1 -1
- package/dist/sort-manager/sort-add.d.ts +1 -1
- package/dist/sort-manager/sort-add.js +1 -1
- package/dist/sort-manager/sort-apply.d.ts +1 -1
- package/dist/sort-manager/sort-apply.js +2 -2
- package/dist/sort-manager/sort-cancel.d.ts +1 -1
- package/dist/sort-manager/sort-cancel.js +2 -2
- package/dist/sort-manager/sort-clear.d.ts +1 -1
- package/dist/sort-manager/sort-clear.js +1 -1
- package/dist/sort-manager/sort-column-select.d.ts +1 -1
- package/dist/sort-manager/sort-column-select.js +1 -1
- package/dist/sort-manager/sort-direction-select.d.ts +1 -1
- package/dist/sort-manager/sort-direction-select.js +1 -1
- package/dist/sort-manager/sort-remove.d.ts +1 -1
- package/dist/sort-manager/sort-remove.js +1 -1
- package/dist/sort-manager/sort-value-select.d.ts +1 -1
- package/dist/sort-manager/sort-value-select.js +1 -1
- package/dist/state/+types.d.ts +2 -1
- package/dist/state/api/column-field.js +1 -1
- package/dist/state/api/edit-begin.js +1 -1
- package/dist/state/api/focus-cell.js +1 -1
- package/dist/state/api/position-from-element.d.ts +5 -2
- package/dist/state/api/position-from-element.js +3 -3
- package/dist/state/api/row-handle-select.js +1 -1
- package/dist/state/api/use-row-drag.js +3 -2
- package/dist/state/helpers/column-add-row-group.js +1 -1
- package/dist/state/helpers/column-marker.js +1 -1
- package/dist/state/use-lytenyte.js +18 -3
- package/dist/tree-view/branch/branch.d.ts +1 -1
- package/dist/tree-view/branch/branch.js +1 -1
- package/dist/tree-view/branch/use-branch-keys.js +2 -2
- package/dist/tree-view/leaf.js +1 -1
- package/dist/tree-view/panel/make-handle-navigation.js +1 -1
- package/dist/tree-view/panel/make-handle-selection.js +1 -1
- package/dist/tree-view/panel/panel.js +2 -2
- package/dist/tree-view/panel/use-tree-navigation.js +1 -1
- package/dist/tree-view/root.js +1 -1
- package/dist/tree-view/utils/get-focusable-nodes.js +1 -1
- package/dist/tree-view/utils/get-focused-node.js +1 -1
- package/dist/tree-view/utils/get-sibling-branches.js +1 -1
- package/dist/tree-view/virtualized/use-row-start-and-end.d.ts +1 -1
- package/dist/tree-view/virtualized/use-row-start-and-end.js +1 -1
- package/dist/tree-view/virtualized/use-virtualized-tree.js +1 -1
- package/dist/types/types.d.ts +6 -6
- package/package.json +3 -7
- package/dist/__play__/grid-navigation/cell-spans-large.play.d.ts +0 -3
- package/dist/__play__/grid-navigation/cell-spans-large.play.js +0 -26
- package/dist/__play__/grid-navigation/cell-spans-with-pins.play.d.ts +0 -3
- package/dist/__play__/grid-navigation/cell-spans-with-pins.play.js +0 -27
- package/dist/__play__/grid-navigation/cell-spans.play.d.ts +0 -3
- package/dist/__play__/grid-navigation/cell-spans.play.js +0 -52
- package/dist/__play__/grid-navigation/cell-with-tabbables.play.d.ts +0 -3
- package/dist/__play__/grid-navigation/cell-with-tabbables.play.js +0 -47
- package/dist/__play__/grid-navigation/column-groups.play.d.ts +0 -3
- package/dist/__play__/grid-navigation/column-groups.play.js +0 -24
- package/dist/__play__/grid-navigation/full-width-rows.play.d.ts +0 -6
- package/dist/__play__/grid-navigation/full-width-rows.play.js +0 -67
- package/dist/__play__/grid-navigation/horizontal-navigation.pt.d.ts +0 -1
- package/dist/__play__/grid-navigation/horizontal-navigation.pt.js +0 -877
- package/dist/__play__/grid-navigation/normal-layout.play.d.ts +0 -10
- package/dist/__play__/grid-navigation/pinned-gap-layout.play.d.ts +0 -3
- package/dist/__play__/grid-navigation/pinned-gap-layout.play.js +0 -11
- package/dist/__play__/grid-navigation/row-detail-with-spans.play.d.ts +0 -6
- package/dist/__play__/grid-navigation/row-detail-with-spans.play.js +0 -79
- package/dist/__play__/grid-navigation/row-detail.play.d.ts +0 -6
- package/dist/__play__/grid-navigation/row-detail.play.js +0 -78
- package/dist/__play__/grid-navigation/row-detail.pt.d.ts +0 -1
- package/dist/__play__/grid-navigation/row-detail.pt.js +0 -68
- package/dist/__play__/grid-navigation/vertical-navigation.pt.d.ts +0 -1
- package/dist/__play__/grid-navigation/vertical-navigation.pt.js +0 -176
- package/dist/cells/+types.cell.d.ts +0 -13
- package/dist/cells/+types.cell.js +0 -1
- package/dist/cells/cell-default.d.ts +0 -2
- package/dist/cells/cell-default.js +0 -8
- package/dist/cells/cell-editor.d.ts +0 -6
- package/dist/cells/cell-editor.js +0 -110
- package/dist/cells/cell-spacer.d.ts +0 -9
- package/dist/cells/cell-spacer.js +0 -39
- package/dist/cells/cell.d.ts +0 -5
- package/dist/cells/cell.js +0 -44
- package/dist/cells/use-cell-style.d.ts +0 -3
- package/dist/cells/use-cell-style.js +0 -51
- package/dist/header/header-cell.d.ts +0 -10
- package/dist/header/header-cell.js +0 -22
- package/dist/header/header-group-cell.d.ts +0 -5
- package/dist/header/header-group-cell.js +0 -16
- package/dist/header/header-row.d.ts +0 -4
- package/dist/header/header-row.js +0 -10
- package/dist/header/header.d.ts +0 -1
- package/dist/header/header.js +0 -12
- package/dist/header/resize-handler.d.ts +0 -12
- package/dist/header/resize-handler.js +0 -136
- package/dist/header/use-drag-move.d.ts +0 -14
- package/dist/header/use-drag-move.js +0 -97
- package/dist/header/use-header-cell-renderer.d.ts +0 -4
- package/dist/header/use-header-cell-renderer.js +0 -37
- package/dist/root/root.js +0 -108
- package/dist/rows/row/context.d.ts +0 -15
- package/dist/rows/row/context.js +0 -14
- package/dist/rows/row/row.d.ts +0 -7
- package/dist/rows/row/row.js +0 -25
- package/dist/rows/row/use-row-context-value.d.ts +0 -6
- package/dist/rows/row/use-row-context-value.js +0 -45
- package/dist/rows/row-detail-row.d.ts +0 -4
- package/dist/rows/row-detail-row.js +0 -47
- package/dist/rows/row-full-width.d.ts +0 -8
- package/dist/rows/row-full-width.js +0 -19
- package/dist/rows/rows-container.d.ts +0 -1
- package/dist/rows/rows-container.js +0 -9
- package/dist/rows/rows-sections.js +0 -27
- package/dist/rows/scrollers/native-scroller.d.ts +0 -2
- package/dist/rows/scrollers/native-scroller.js +0 -4
- package/dist/utils/cycle-sorts.d.ts +0 -2
- package/dist/utils/cycle-sorts.js +0 -16
- package/dist/viewport/begin-editing.d.ts +0 -5
- package/dist/viewport/begin-editing.js +0 -15
- package/dist/viewport/viewport.js +0 -85
- /package/dist/{root → grid}/dialog-driver.d.ts +0 -0
- /package/dist/{root → grid}/dialog-driver.js +0 -0
- /package/dist/{root → grid}/popover-driver.d.ts +0 -0
- /package/dist/{root → grid}/popover-driver.js +0 -0
- /package/dist/{rows → grid}/rows-sections.d.ts +0 -0
- /package/dist/{viewport → grid}/viewport.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useSlot } from "@1771technologies/lytenyte-react-hooks";
|
|
3
2
|
import { forwardRef } from "react";
|
|
4
3
|
import { useTreeItemContext } from "./context.js";
|
|
4
|
+
import { useSlot } from "@1771technologies/lytenyte-core/yinternal";
|
|
5
5
|
export const InclusionCheckbox = forwardRef(function InclusionCheckbox({ as, ...props }, forwarded) {
|
|
6
6
|
const { isChecked, onCheckChange, isIndeterminate } = useTreeItemContext();
|
|
7
7
|
const rendered = useSlot({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useSlot } from "@1771technologies/lytenyte-react-hooks";
|
|
3
2
|
import { forwardRef, useMemo } from "react";
|
|
4
3
|
import { useTreeItemContext } from "./context.js";
|
|
4
|
+
import { useSlot } from "@1771technologies/lytenyte-core/yinternal";
|
|
5
5
|
export const Label = forwardRef(function Label({ as, ...props }, forwarded) {
|
|
6
6
|
const { item } = useTreeItemContext();
|
|
7
7
|
const label = useMemo(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PropsWithChildren } from "react";
|
|
2
2
|
import type { Grid } from "../+types";
|
|
3
3
|
import type { UseTreeFilterReturn } from "./hooks/use-filter-tree";
|
|
4
|
-
import { type SlotComponent } from "@1771technologies/lytenyte-
|
|
4
|
+
import { type SlotComponent } from "@1771technologies/lytenyte-core/yinternal";
|
|
5
5
|
export type FilterTreeRootProps<T> = UseTreeFilterReturn<T>["rootProps"] & {
|
|
6
6
|
readonly grid: Grid<T>;
|
|
7
7
|
readonly loadingAs?: SlotComponent;
|
package/dist/filter-tree/root.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useMemo } from "react";
|
|
|
3
3
|
import { GridProvider } from "../grid-provider/provider.js";
|
|
4
4
|
import { TreeRoot } from "../tree-view/root.js";
|
|
5
5
|
import { FilterTreeContext } from "./context.js";
|
|
6
|
-
import { useSlot } from "@1771technologies/lytenyte-
|
|
6
|
+
import { useSlot } from "@1771technologies/lytenyte-core/yinternal";
|
|
7
7
|
export function Root({ grid, treeRef, filterIn, pivotMode, columnId, children, error, loading, errorAs, loadingAs, fetchItems, items, applyChangesImmediately, filterInChange, ...rootProps }) {
|
|
8
8
|
const value = useMemo(() => {
|
|
9
9
|
return {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from "react";
|
|
2
|
+
import type { RowCellLayout } from "../+types";
|
|
3
|
+
export interface CellProps {
|
|
4
|
+
readonly cell: RowCellLayout<any>;
|
|
5
|
+
}
|
|
6
|
+
export declare const Cell: (props: Omit<JSX.IntrinsicElements["div"], "children"> & CellProps) => ReactNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CSSProperties, type JSX, type ReactNode } from "react";
|
|
2
|
+
import type { HeaderCellFloating, HeaderCellLayout } from "../+types";
|
|
3
|
+
import { type SlotComponent } from "@1771technologies/lytenyte-core/yinternal";
|
|
4
|
+
export interface HeaderCellProps<T> {
|
|
5
|
+
readonly cell: HeaderCellLayout<T> | HeaderCellFloating<T>;
|
|
6
|
+
readonly resizerAs?: SlotComponent;
|
|
7
|
+
readonly resizerClassName?: string;
|
|
8
|
+
readonly resizerStyle?: CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
export declare const HeaderCell: (props: JSX.IntrinsicElements["div"] & HeaderCellProps<any>) => ReactNode;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from "react";
|
|
2
|
+
import type { HeaderGroupCellLayout } from "../+types";
|
|
3
|
+
export interface HeaderGroupCellProps {
|
|
4
|
+
readonly cell: HeaderGroupCellLayout;
|
|
5
|
+
}
|
|
6
|
+
export declare const HeaderGroupCell: (props: JSX.IntrinsicElements["div"] & HeaderGroupCellProps) => ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Header: import("react").NamedExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -5,4 +5,4 @@ export type RootProps<T> = {
|
|
|
5
5
|
} & {
|
|
6
6
|
[k in keyof GridEvents<T> as `on${Capitalize<k>}`]: GridEvents<T>[k];
|
|
7
7
|
};
|
|
8
|
-
export declare function Root<T = any>({
|
|
8
|
+
export declare function Root<T = any>({ children, grid, ...props }: PropsWithChildren<RootProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { DialogDriver } from "./dialog-driver.js";
|
|
4
|
+
import { PopoverDriver } from "./popover-driver.js";
|
|
5
|
+
import { CellSelectionDriver } from "../cell-selection/cell-selection-driver.js";
|
|
6
|
+
import { hasAValidLicense, licenseState } from "../license.js";
|
|
7
|
+
import { Root as RootCore } from "@1771technologies/lytenyte-core/yinternal";
|
|
8
|
+
export function Root({ children, grid, ...props }) {
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (hasAValidLicense)
|
|
11
|
+
return;
|
|
12
|
+
const existing = document.getElementById("lng1771-watermark");
|
|
13
|
+
if (existing)
|
|
14
|
+
return;
|
|
15
|
+
const invalidLicenseWatermark = document.createElement("div");
|
|
16
|
+
invalidLicenseWatermark.style.position = "fixed";
|
|
17
|
+
invalidLicenseWatermark.style.bottom = "0px";
|
|
18
|
+
invalidLicenseWatermark.style.insetInlineEnd = "0px";
|
|
19
|
+
invalidLicenseWatermark.style.background = "rgb(255, 167, 167)";
|
|
20
|
+
invalidLicenseWatermark.style.color = "black";
|
|
21
|
+
invalidLicenseWatermark.style.fontSize = "1.2rem";
|
|
22
|
+
invalidLicenseWatermark.style.fontWeight = "bold";
|
|
23
|
+
invalidLicenseWatermark.style.border = "1px solid black";
|
|
24
|
+
invalidLicenseWatermark.style.padding = "16px";
|
|
25
|
+
if (licenseState === "expired")
|
|
26
|
+
invalidLicenseWatermark.innerHTML = `LyteNyte Grid: License key expired. Your license covers earlier versions only.`;
|
|
27
|
+
else if (licenseState === "invalid")
|
|
28
|
+
invalidLicenseWatermark.innerHTML = `LyteNyte Grid: Invalid license key. Please verify the key and try again.`;
|
|
29
|
+
else
|
|
30
|
+
invalidLicenseWatermark.innerHTML = `LyteNyte Grid PRO is being used for evaluation.
|
|
31
|
+
<a href="https://1771Technologies.com/pricing">Click here</a> to secure your license.`;
|
|
32
|
+
document.body.appendChild(invalidLicenseWatermark);
|
|
33
|
+
return () => invalidLicenseWatermark.remove();
|
|
34
|
+
}, []);
|
|
35
|
+
const cellSelectionMode = grid.state.cellSelectionMode.useValue();
|
|
36
|
+
return (_jsxs(RootCore, { ...props, grid: grid, children: [_jsx(DialogDriver, {}), _jsx(PopoverDriver, {}), cellSelectionMode !== "none" && _jsx(CellSelectionDriver, {}), children] }));
|
|
37
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from "react";
|
|
2
|
+
import type { RowFullWidthRowLayout } from "../+types";
|
|
3
|
+
import { type DropWrapProps } from "@1771technologies/lytenyte-core/yinternal";
|
|
4
|
+
export interface RowFullWidthProps extends Omit<DropWrapProps, "accepted"> {
|
|
5
|
+
readonly row: RowFullWidthRowLayout<any>;
|
|
6
|
+
readonly space?: "viewport" | "scroll-width";
|
|
7
|
+
readonly accepted?: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare const RowFullWidth: (props: JSX.IntrinsicElements["div"] & RowFullWidthProps) => ReactNode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from "react";
|
|
2
|
+
import type { RowNormalRowLayout } from "../+types";
|
|
3
|
+
import { type DropWrapProps } from "@1771technologies/lytenyte-core/yinternal";
|
|
4
|
+
export interface RowProps extends Omit<DropWrapProps, "accepted"> {
|
|
5
|
+
readonly row: RowNormalRowLayout<any>;
|
|
6
|
+
readonly accepted?: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare const Row: (props: Omit<JSX.IntrinsicElements["div"], "onDrag"> & RowProps) => ReactNode;
|
package/dist/grid/row.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RowsContainer: import("react").NamedExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { RowsTop as RowsTopCore, RowsBottom as RowsBottomCore, RowsCenter as RowsCenterCore, NativeScroller, } from "@1771technologies/lytenyte-core/yinternal";
|
|
4
|
+
import { CellSelectionBottom, CellSelectionCenter, CellSelectionTop, } from "../cell-selection/cell-selection-containers.js";
|
|
5
|
+
export const RowsTop = forwardRef(function RowsTop(props, forwarded) {
|
|
6
|
+
return (_jsxs(RowsTopCore, { ...props, ref: forwarded, children: [props.children, _jsx(CellSelectionTop, {})] }));
|
|
7
|
+
});
|
|
8
|
+
export const RowsCenter = forwardRef(function RowsCenter({ children, ...props }, forwarded) {
|
|
9
|
+
return (_jsx(RowsCenterCore, { ...props, ref: forwarded, children: _jsxs(NativeScroller, { children: [_jsx(CellSelectionCenter, {}), children] }) }));
|
|
10
|
+
});
|
|
11
|
+
export const RowsBottom = forwardRef(function RowsBottom(props, forwarded) {
|
|
12
|
+
return (_jsxs(RowsBottomCore, { ...props, ref: forwarded, children: [_jsx(CellSelectionBottom, {}), props.children] }));
|
|
13
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useGridRoot } from "../context.js";
|
|
4
|
+
import { Viewport as Core } from "@1771technologies/lytenyte-core/yinternal";
|
|
5
|
+
export const Viewport = forwardRef(function Viewport(props, forwarded) {
|
|
6
|
+
const ctx = useGridRoot();
|
|
7
|
+
const cellSelectionMode = ctx.grid.state.cellSelectionMode.useValue();
|
|
8
|
+
return (_jsx(Core, { ...props, "data-ln-has-cell-selection": cellSelectionMode !== "none", ref: forwarded }));
|
|
9
|
+
});
|
package/dist/grid-box/item.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties } from "react";
|
|
2
2
|
import type { GridBoxItem } from "./+types";
|
|
3
|
-
import { type SlotComponent } from "@1771technologies/lytenyte-
|
|
3
|
+
import { type SlotComponent } from "@1771technologies/lytenyte-core/yinternal";
|
|
4
4
|
export interface GridBoxItemProps {
|
|
5
5
|
readonly item: GridBoxItem;
|
|
6
6
|
readonly itemAs?: SlotComponent;
|
package/dist/grid-box/item.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { Item } from "../listbox/item.js";
|
|
4
|
-
import { dragState, DropWrap, useDraggable } from "@1771technologies/lytenyte-dragon";
|
|
5
|
-
import { useCombinedRefs, useSlot, } from "@1771technologies/lytenyte-react-hooks";
|
|
6
4
|
import { useGridBoxContext } from "./context.js";
|
|
5
|
+
import { dragState, DropWrap, useCombinedRefs, useDraggable, useSlot, } from "@1771technologies/lytenyte-core/yinternal";
|
|
7
6
|
export const BoxItem = forwardRef(function BoxItem({ item, itemAs, itemClassName, itemStyle, children, ...props }, forwarded) {
|
|
8
7
|
const { accepted } = useGridBoxContext();
|
|
9
8
|
const { dragProps } = useDraggable({
|
package/dist/grid-box/panel.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { Panel } from "../listbox/panel.js";
|
|
4
|
-
import { DropWrap } from "@1771technologies/lytenyte-dragon";
|
|
5
4
|
import { useGridBoxContext } from "./context.js";
|
|
5
|
+
import { DropWrap } from "@1771technologies/lytenyte-core/yinternal";
|
|
6
6
|
export const GridBoxPanel = forwardRef(function GridBoxPanel(props, forwarded) {
|
|
7
7
|
const ctx = useGridBoxContext();
|
|
8
8
|
return (_jsx(DropWrap, { ...props, accepted: ctx.accepted, "data-ln-orientation": ctx.orientation, onDrop: ctx.onRootDrop, ref: forwarded, as: _jsx(Panel, {}) }));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
-
import { useEvent } from "@1771technologies/lytenyte-
|
|
2
|
+
import { useEvent } from "@1771technologies/lytenyte-core/yinternal";
|
|
3
3
|
export function useAggregationBoxItems({ grid, orientation }) {
|
|
4
4
|
const model = grid.state.aggModel.useValue();
|
|
5
5
|
const gridId = grid.state.gridId.useValue();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
-
import { useEvent } from "@1771technologies/lytenyte-
|
|
2
|
+
import { useEvent } from "@1771technologies/lytenyte-core/yinternal";
|
|
3
3
|
export function useColumnBoxItems({ grid, onRootDrop, onDrop, onDelete, onAction, orientation, draggable = true, itemFilter, placeholder, }) {
|
|
4
4
|
const columns = grid.state.columns.useValue();
|
|
5
5
|
const base = grid.state.columnBase.useValue();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
-
import { useEvent } from "@1771technologies/lytenyte-
|
|
2
|
+
import { useEvent } from "@1771technologies/lytenyte-core/yinternal";
|
|
3
3
|
export function useRowGroupBoxItems({ grid, orientation, hideColumnOnGroup = true, includeGroupables = false, placeholder, }) {
|
|
4
4
|
const rowGroupModel = grid.state.rowGroupModel.useValue();
|
|
5
5
|
const gridId = grid.state.gridId.useValue();
|
package/dist/grid.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Root } from "./
|
|
1
|
+
import { Root } from "./grid/root.js";
|
|
2
2
|
import { useLyteNyte } from "./state/use-lytenyte.js";
|
|
3
3
|
export declare const Grid: {
|
|
4
4
|
Root: typeof Root;
|
|
5
|
-
Header: import("react").
|
|
6
|
-
HeaderGroupCell:
|
|
7
|
-
HeaderRow:
|
|
8
|
-
HeaderCell:
|
|
9
|
-
Cell:
|
|
10
|
-
RowFullWidth:
|
|
11
|
-
RowsContainer: import("react").
|
|
5
|
+
Header: import("react").NamedExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
HeaderGroupCell: (props: import("react").JSX.IntrinsicElements["div"] & import("./grid/header-group-cell.js").HeaderGroupCellProps) => import("react").ReactNode;
|
|
7
|
+
HeaderRow: (props: import("react").JSX.IntrinsicElements["div"] & import("./grid/header-row.js").HeaderRowProps) => import("react").ReactNode;
|
|
8
|
+
HeaderCell: (props: import("react").JSX.IntrinsicElements["div"] & import("./grid/header-cell.js").HeaderCellProps<any>) => import("react").ReactNode;
|
|
9
|
+
Cell: (props: Omit<import("react").JSX.IntrinsicElements["div"], "children"> & import("./grid/cell.js").CellProps) => import("react").ReactNode;
|
|
10
|
+
RowFullWidth: (props: import("react").JSX.IntrinsicElements["div"] & import("./grid/row-full-width.js").RowFullWidthProps) => import("react").ReactNode;
|
|
11
|
+
RowsContainer: import("react").NamedExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
12
|
RowsBottom: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
13
|
RowsTop: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
-
Row:
|
|
14
|
+
Row: (props: Omit<import("react").JSX.IntrinsicElements["div"], "onDrag"> & import("./grid/row.js").RowProps) => import("react").ReactNode;
|
|
15
15
|
RowsCenter: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
16
|
Viewport: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
17
|
useLyteNyte: typeof useLyteNyte;
|
package/dist/grid.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Cell } from "./
|
|
2
|
-
import { Header } from "./
|
|
3
|
-
import { HeaderCell } from "./
|
|
4
|
-
import { HeaderGroupCell } from "./
|
|
5
|
-
import { HeaderRow } from "./
|
|
6
|
-
import { Root } from "./
|
|
7
|
-
import { RowFullWidth } from "./
|
|
8
|
-
import { Row } from "./
|
|
9
|
-
import { RowsContainer } from "./
|
|
10
|
-
import { RowsBottom, RowsCenter, RowsTop } from "./
|
|
1
|
+
import { Cell } from "./grid/cell.js";
|
|
2
|
+
import { Header } from "./grid/header.js";
|
|
3
|
+
import { HeaderCell } from "./grid/header-cell.js";
|
|
4
|
+
import { HeaderGroupCell } from "./grid/header-group-cell.js";
|
|
5
|
+
import { HeaderRow } from "./grid/header-row.js";
|
|
6
|
+
import { Root } from "./grid/root.js";
|
|
7
|
+
import { RowFullWidth } from "./grid/row-full-width.js";
|
|
8
|
+
import { Row } from "./grid/row.js";
|
|
9
|
+
import { RowsContainer } from "./grid/rows-container.js";
|
|
10
|
+
import { RowsBottom, RowsCenter, RowsTop } from "./grid/rows-sections.js";
|
|
11
11
|
import { useLyteNyte } from "./state/use-lytenyte.js";
|
|
12
|
-
import { Viewport } from "./
|
|
12
|
+
import { Viewport } from "./grid/viewport.js";
|
|
13
13
|
export const Grid = {
|
|
14
14
|
Root,
|
|
15
15
|
Header,
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export { SortManager } from "./sort-manager/sort-manager.js";
|
|
|
4
4
|
export { FilterTree } from "./filter-tree/filter-tree.js";
|
|
5
5
|
export { ColumnManager } from "./column-manager/column-manager.js";
|
|
6
6
|
export { GridBox } from "./grid-box/grid-box.js";
|
|
7
|
-
export { DropWrap } from "@1771technologies/lytenyte-
|
|
7
|
+
export { DropWrap } from "@1771technologies/lytenyte-core/yinternal";
|
|
8
|
+
export { FilterSelect } from "./filter-selects/index.js";
|
|
8
9
|
export { activateLicense } from "./license.js";
|
|
9
10
|
export { measureText } from "@1771technologies/lytenyte-shared";
|
|
10
11
|
export { makeClientDataSource, useClientRowDataSource, } from "./row-data-source-client/use-client-data-source.js";
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,8 @@ export { SortManager } from "./sort-manager/sort-manager.js";
|
|
|
4
4
|
export { FilterTree } from "./filter-tree/filter-tree.js";
|
|
5
5
|
export { ColumnManager } from "./column-manager/column-manager.js";
|
|
6
6
|
export { GridBox } from "./grid-box/grid-box.js";
|
|
7
|
-
export { DropWrap } from "@1771technologies/lytenyte-
|
|
7
|
+
export { DropWrap } from "@1771technologies/lytenyte-core/yinternal";
|
|
8
|
+
export { FilterSelect } from "./filter-selects/index.js";
|
|
8
9
|
export { activateLicense } from "./license.js";
|
|
9
10
|
export { measureText } from "@1771technologies/lytenyte-shared";
|
|
10
11
|
export { makeClientDataSource, useClientRowDataSource, } from "./row-data-source-client/use-client-data-source.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { activateLicense, hasAValidLicense } from "./license.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { activateLicense, hasAValidLicense } from "./license.js";
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
const hashSalt = "faec0f3c45281b1fe12d87e64a6c3271";
|
|
2
|
+
// @ts-expect-error will be replaced by build script
|
|
3
|
+
const issueDate = globalThis.ISSUE_DATE ?? new Date("2023-03-01");
|
|
4
|
+
function getHostname() {
|
|
5
|
+
const win = globalThis?.document?.defaultView || (typeof window !== "undefined" ? window : null);
|
|
6
|
+
const loc = win?.location;
|
|
7
|
+
const { hostname = "" } = loc ?? {};
|
|
8
|
+
return hostname;
|
|
9
|
+
}
|
|
10
|
+
function isWebsiteUrl() {
|
|
11
|
+
const hostname = getHostname();
|
|
12
|
+
return hostname.match(/^((?:\w+\.)?1771technologies\.com)$/) !== null;
|
|
13
|
+
}
|
|
14
|
+
function isLocalhost() {
|
|
15
|
+
const hostname = getHostname();
|
|
16
|
+
return hostname.match(/^(?:127\.0\.0\.1|localhost)$/) !== null;
|
|
17
|
+
}
|
|
18
|
+
export let hasAValidLicense = isWebsiteUrl() || isLocalhost();
|
|
19
|
+
export let licenseState = null;
|
|
20
|
+
export function activateLicense(license) {
|
|
21
|
+
const parts = license.split("|");
|
|
22
|
+
const details = parts[0];
|
|
23
|
+
const hash = parts[1];
|
|
24
|
+
const detailHash = new MD5().md5(details + hashSalt);
|
|
25
|
+
if (detailHash !== hash) {
|
|
26
|
+
console.error(`
|
|
27
|
+
********************************************************************************
|
|
28
|
+
LyteNyte Grid PRO
|
|
29
|
+
|
|
30
|
+
Invalid license key. Please verify the key and try again.
|
|
31
|
+
|
|
32
|
+
Visit https://1771technolgies.com for more information.
|
|
33
|
+
********************************************************************************
|
|
34
|
+
`);
|
|
35
|
+
licenseState = "invalid";
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
const detailParts = details.split(" ");
|
|
39
|
+
const endDate = new Date(detailParts[1]);
|
|
40
|
+
if (issueDate > endDate) {
|
|
41
|
+
console.error(`
|
|
42
|
+
********************************************************************************
|
|
43
|
+
LyteNyte Grid PRO
|
|
44
|
+
|
|
45
|
+
License key expired. Your license covers earlier versions only.
|
|
46
|
+
|
|
47
|
+
Visit https://1771technolgies.com for more information.
|
|
48
|
+
********************************************************************************
|
|
49
|
+
`);
|
|
50
|
+
licenseState = "expired";
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
hasAValidLicense = true;
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
// see: https://www.myersdaily.org/joseph/javascript/md5-text.html
|
|
57
|
+
// https://stackoverflow.com/a/1655795
|
|
58
|
+
class MD5 {
|
|
59
|
+
md5cycle(x, k) {
|
|
60
|
+
let a = x[0];
|
|
61
|
+
let b = x[1];
|
|
62
|
+
let c = x[2];
|
|
63
|
+
let d = x[3];
|
|
64
|
+
a = this.ff(a, b, c, d, k[0], 7, -680876936);
|
|
65
|
+
d = this.ff(d, a, b, c, k[1], 12, -389564586);
|
|
66
|
+
c = this.ff(c, d, a, b, k[2], 17, 606105819);
|
|
67
|
+
b = this.ff(b, c, d, a, k[3], 22, -1044525330);
|
|
68
|
+
a = this.ff(a, b, c, d, k[4], 7, -176418897);
|
|
69
|
+
d = this.ff(d, a, b, c, k[5], 12, 1200080426);
|
|
70
|
+
c = this.ff(c, d, a, b, k[6], 17, -1473231341);
|
|
71
|
+
b = this.ff(b, c, d, a, k[7], 22, -45705983);
|
|
72
|
+
a = this.ff(a, b, c, d, k[8], 7, 1770035416);
|
|
73
|
+
d = this.ff(d, a, b, c, k[9], 12, -1958414417);
|
|
74
|
+
c = this.ff(c, d, a, b, k[10], 17, -42063);
|
|
75
|
+
b = this.ff(b, c, d, a, k[11], 22, -1990404162);
|
|
76
|
+
a = this.ff(a, b, c, d, k[12], 7, 1804603682);
|
|
77
|
+
d = this.ff(d, a, b, c, k[13], 12, -40341101);
|
|
78
|
+
c = this.ff(c, d, a, b, k[14], 17, -1502002290);
|
|
79
|
+
b = this.ff(b, c, d, a, k[15], 22, 1236535329);
|
|
80
|
+
a = this.gg(a, b, c, d, k[1], 5, -165796510);
|
|
81
|
+
d = this.gg(d, a, b, c, k[6], 9, -1069501632);
|
|
82
|
+
c = this.gg(c, d, a, b, k[11], 14, 643717713);
|
|
83
|
+
b = this.gg(b, c, d, a, k[0], 20, -373897302);
|
|
84
|
+
a = this.gg(a, b, c, d, k[5], 5, -701558691);
|
|
85
|
+
d = this.gg(d, a, b, c, k[10], 9, 38016083);
|
|
86
|
+
c = this.gg(c, d, a, b, k[15], 14, -660478335);
|
|
87
|
+
b = this.gg(b, c, d, a, k[4], 20, -405537848);
|
|
88
|
+
a = this.gg(a, b, c, d, k[9], 5, 568446438);
|
|
89
|
+
d = this.gg(d, a, b, c, k[14], 9, -1019803690);
|
|
90
|
+
c = this.gg(c, d, a, b, k[3], 14, -187363961);
|
|
91
|
+
b = this.gg(b, c, d, a, k[8], 20, 1163531501);
|
|
92
|
+
a = this.gg(a, b, c, d, k[13], 5, -1444681467);
|
|
93
|
+
d = this.gg(d, a, b, c, k[2], 9, -51403784);
|
|
94
|
+
c = this.gg(c, d, a, b, k[7], 14, 1735328473);
|
|
95
|
+
b = this.gg(b, c, d, a, k[12], 20, -1926607734);
|
|
96
|
+
a = this.hh(a, b, c, d, k[5], 4, -378558);
|
|
97
|
+
d = this.hh(d, a, b, c, k[8], 11, -2022574463);
|
|
98
|
+
c = this.hh(c, d, a, b, k[11], 16, 1839030562);
|
|
99
|
+
b = this.hh(b, c, d, a, k[14], 23, -35309556);
|
|
100
|
+
a = this.hh(a, b, c, d, k[1], 4, -1530992060);
|
|
101
|
+
d = this.hh(d, a, b, c, k[4], 11, 1272893353);
|
|
102
|
+
c = this.hh(c, d, a, b, k[7], 16, -155497632);
|
|
103
|
+
b = this.hh(b, c, d, a, k[10], 23, -1094730640);
|
|
104
|
+
a = this.hh(a, b, c, d, k[13], 4, 681279174);
|
|
105
|
+
d = this.hh(d, a, b, c, k[0], 11, -358537222);
|
|
106
|
+
c = this.hh(c, d, a, b, k[3], 16, -722521979);
|
|
107
|
+
b = this.hh(b, c, d, a, k[6], 23, 76029189);
|
|
108
|
+
a = this.hh(a, b, c, d, k[9], 4, -640364487);
|
|
109
|
+
d = this.hh(d, a, b, c, k[12], 11, -421815835);
|
|
110
|
+
c = this.hh(c, d, a, b, k[15], 16, 530742520);
|
|
111
|
+
b = this.hh(b, c, d, a, k[2], 23, -995338651);
|
|
112
|
+
a = this.ii(a, b, c, d, k[0], 6, -198630844);
|
|
113
|
+
d = this.ii(d, a, b, c, k[7], 10, 1126891415);
|
|
114
|
+
c = this.ii(c, d, a, b, k[14], 15, -1416354905);
|
|
115
|
+
b = this.ii(b, c, d, a, k[5], 21, -57434055);
|
|
116
|
+
a = this.ii(a, b, c, d, k[12], 6, 1700485571);
|
|
117
|
+
d = this.ii(d, a, b, c, k[3], 10, -1894986606);
|
|
118
|
+
c = this.ii(c, d, a, b, k[10], 15, -1051523);
|
|
119
|
+
b = this.ii(b, c, d, a, k[1], 21, -2054922799);
|
|
120
|
+
a = this.ii(a, b, c, d, k[8], 6, 1873313359);
|
|
121
|
+
d = this.ii(d, a, b, c, k[15], 10, -30611744);
|
|
122
|
+
c = this.ii(c, d, a, b, k[6], 15, -1560198380);
|
|
123
|
+
b = this.ii(b, c, d, a, k[13], 21, 1309151649);
|
|
124
|
+
a = this.ii(a, b, c, d, k[4], 6, -145523070);
|
|
125
|
+
d = this.ii(d, a, b, c, k[11], 10, -1120210379);
|
|
126
|
+
c = this.ii(c, d, a, b, k[2], 15, 718787259);
|
|
127
|
+
b = this.ii(b, c, d, a, k[9], 21, -343485551);
|
|
128
|
+
x[0] = this.add32(a, x[0]);
|
|
129
|
+
x[1] = this.add32(b, x[1]);
|
|
130
|
+
x[2] = this.add32(c, x[2]);
|
|
131
|
+
x[3] = this.add32(d, x[3]);
|
|
132
|
+
}
|
|
133
|
+
cmn(q, a, b, x, s, t) {
|
|
134
|
+
a = this.add32(this.add32(a, q), this.add32(x, t));
|
|
135
|
+
return this.add32((a << s) | (a >>> (32 - s)), b);
|
|
136
|
+
}
|
|
137
|
+
ff(a, b, c, d, x, s, t) {
|
|
138
|
+
return this.cmn((b & c) | (~b & d), a, b, x, s, t);
|
|
139
|
+
}
|
|
140
|
+
gg(a, b, c, d, x, s, t) {
|
|
141
|
+
return this.cmn((b & d) | (c & ~d), a, b, x, s, t);
|
|
142
|
+
}
|
|
143
|
+
hh(a, b, c, d, x, s, t) {
|
|
144
|
+
return this.cmn(b ^ c ^ d, a, b, x, s, t);
|
|
145
|
+
}
|
|
146
|
+
ii(a, b, c, d, x, s, t) {
|
|
147
|
+
return this.cmn(c ^ (b | ~d), a, b, x, s, t);
|
|
148
|
+
}
|
|
149
|
+
md51(s) {
|
|
150
|
+
const n = s.length;
|
|
151
|
+
const state = [1732584193, -271733879, -1732584194, 271733878];
|
|
152
|
+
let i;
|
|
153
|
+
for (i = 64; i <= s.length; i += 64) {
|
|
154
|
+
this.md5cycle(state, this.md5blk(s.substring(i - 64, i)));
|
|
155
|
+
}
|
|
156
|
+
s = s.substring(i - 64);
|
|
157
|
+
const tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
158
|
+
for (i = 0; i < s.length; i++) {
|
|
159
|
+
tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);
|
|
160
|
+
}
|
|
161
|
+
tail[i >> 2] |= 0x80 << (i % 4 << 3);
|
|
162
|
+
if (i > 55) {
|
|
163
|
+
this.md5cycle(state, tail);
|
|
164
|
+
for (i = 0; i < 16; i++) {
|
|
165
|
+
tail[i] = 0;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
tail[14] = n * 8;
|
|
169
|
+
this.md5cycle(state, tail);
|
|
170
|
+
return state;
|
|
171
|
+
}
|
|
172
|
+
/* there needs to be support for Unicode here, * unless we pretend that we can redefine the MD-5
|
|
173
|
+
* algorithm for multi-byte characters (perhaps by adding every four 16-bit characters and
|
|
174
|
+
* shortening the sum to 32 bits). Otherwise I suthis.ggest performing MD-5 as if every character
|
|
175
|
+
* was two bytes--e.g., 0040 0025 = @%--but then how will an ordinary MD-5 sum be matched?
|
|
176
|
+
* There is no way to standardize text to something like UTF-8 before transformation; speed cost is
|
|
177
|
+
* utterly prohibitive. The JavaScript standard itself needs to look at this: it should start
|
|
178
|
+
* providing access to strings as preformed UTF-8 8-bit unsigned value arrays.
|
|
179
|
+
*/
|
|
180
|
+
md5blk(s) {
|
|
181
|
+
const md5blks = [];
|
|
182
|
+
for (let i = 0; i < 64; i += 4) {
|
|
183
|
+
md5blks[i >> 2] =
|
|
184
|
+
s.charCodeAt(i) +
|
|
185
|
+
(s.charCodeAt(i + 1) << 8) +
|
|
186
|
+
(s.charCodeAt(i + 2) << 16) +
|
|
187
|
+
(s.charCodeAt(i + 3) << 24);
|
|
188
|
+
}
|
|
189
|
+
return md5blks;
|
|
190
|
+
}
|
|
191
|
+
rhex(n) {
|
|
192
|
+
const hex_chr = "0123456789abcdef".split("");
|
|
193
|
+
let s = "";
|
|
194
|
+
let j = 0;
|
|
195
|
+
for (; j < 4; j++) {
|
|
196
|
+
s += hex_chr[(n >> (j * 8 + 4)) & 0x0f] + hex_chr[(n >> (j * 8)) & 0x0f];
|
|
197
|
+
}
|
|
198
|
+
return s;
|
|
199
|
+
}
|
|
200
|
+
hex(x) {
|
|
201
|
+
for (let i = 0; i < x.length; i++) {
|
|
202
|
+
x[i] = this.rhex(x[i]);
|
|
203
|
+
}
|
|
204
|
+
return x.join("");
|
|
205
|
+
}
|
|
206
|
+
md5(s) {
|
|
207
|
+
return this.hex(this.md51(s));
|
|
208
|
+
}
|
|
209
|
+
add32(a, b) {
|
|
210
|
+
return this.add32Std(a, b);
|
|
211
|
+
}
|
|
212
|
+
add32Std(a, b) {
|
|
213
|
+
return (a + b) & 0xffffffff;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface GetHashArguments {
|
|
2
|
+
companyName: string;
|
|
3
|
+
startDate: string;
|
|
4
|
+
endDate: string;
|
|
5
|
+
randomString: string;
|
|
6
|
+
licenseType: "seated" | "company-wide";
|
|
7
|
+
}
|
|
8
|
+
export declare function getHash({ companyName, startDate, endDate, licenseType, randomString, }: GetHashArguments): string;
|
|
9
|
+
export {};
|