@vuu-ui/vuu-ui-controls 4.0.0-alpha.22 → 4.0.0-alpha.23

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.0.0-alpha.22",
2
+ "version": "4.0.0-alpha.23",
3
3
  "description": "VUU UI Controls",
4
4
  "main": "./src/index.js",
5
5
  "author": "heswell",
@@ -10,17 +10,17 @@
10
10
  "type-defs": "node ../../scripts/build-type-defs.mjs"
11
11
  },
12
12
  "devDependencies": {
13
- "@vuu-ui/vuu-data-types": "4.0.0-alpha.22",
14
- "@vuu-ui/vuu-protocol-types": "4.0.0-alpha.22",
15
- "@vuu-ui/vuu-table-types": "4.0.0-alpha.22"
13
+ "@vuu-ui/vuu-data-types": "4.0.0-alpha.23",
14
+ "@vuu-ui/vuu-protocol-types": "4.0.0-alpha.23",
15
+ "@vuu-ui/vuu-table-types": "4.0.0-alpha.23"
16
16
  },
17
17
  "dependencies": {
18
- "@vuu-ui/vuu-context-menu": "4.0.0-alpha.22",
19
- "@vuu-ui/vuu-data-react": "4.0.0-alpha.22",
20
- "@vuu-ui/vuu-layout": "4.0.0-alpha.22",
21
- "@vuu-ui/vuu-popups": "4.0.0-alpha.22",
22
- "@vuu-ui/vuu-table": "4.0.0-alpha.22",
23
- "@vuu-ui/vuu-utils": "4.0.0-alpha.22",
18
+ "@vuu-ui/vuu-context-menu": "4.0.0-alpha.23",
19
+ "@vuu-ui/vuu-data-react": "4.0.0-alpha.23",
20
+ "@vuu-ui/vuu-layout": "4.0.0-alpha.23",
21
+ "@vuu-ui/vuu-popups": "4.0.0-alpha.23",
22
+ "@vuu-ui/vuu-table": "4.0.0-alpha.23",
23
+ "@vuu-ui/vuu-utils": "4.0.0-alpha.23",
24
24
  "@salt-ds/core": "1.72.0",
25
25
  "@salt-ds/icons": "1.18.3",
26
26
  "@salt-ds/styles": "0.4.1",
@@ -292,6 +292,7 @@ const useDragDrop = ({ allowDragDrop, containerRef, draggableClassName, getDragP
292
292
  scrollableContainerRef.current = scrollableContainer;
293
293
  const containerRect = scrollableContainer.getBoundingClientRect();
294
294
  const draggableRect = dragElement.getBoundingClientRect();
295
+ const dragElementStyle = getComputedStyle(dragElement);
295
296
  const dragDropState = dragDropStateRef.current = new DragDropState(mousePosition, dragElement);
296
297
  setDragBoundaries(containerRect, draggableRect);
297
298
  beginDrag(dragElement);
@@ -303,7 +304,12 @@ const useDragDrop = ({ allowDragDrop, containerRef, draggableClassName, getDragP
303
304
  onDropped: terminateDrag,
304
305
  onTransitionEnd: terminateDrag,
305
306
  ref: dragDropState.setDraggable,
306
- style: constrainRect(draggableRect, containerRect),
307
+ style: {
308
+ ...constrainRect(draggableRect, containerRect),
309
+ backgroundColor: dragElementStyle.backgroundColor,
310
+ color: dragElementStyle.color,
311
+ font: dragElementStyle.font
312
+ },
307
313
  wrapperClassName: draggableClassName
308
314
  }),
309
315
  draggedItemIndex: parseInt(index)
@@ -7,6 +7,7 @@ const css = `
7
7
  }
8
8
 
9
9
  .vuuTablePicker-floating-table {
10
+ background: var(--salt-container-primary-background);
10
11
  border: solid 1px var(--salt-container-secondary-borderColor);
11
12
  padding: var(--salt-spacing-100) 0;
12
13
  z-index: var(--salt-zIndex-popout);
@@ -1,5 +1,6 @@
1
1
  const css = `
2
2
  .vuuPrompt {
3
+ max-width: var(--vuuPrompt-maxWidth);
3
4
  min-height: var(--vuuPrompt-minHeight, 257px);
4
5
  min-width: var(--vuuPrompt-minWidth, 380px);
5
6
 
@@ -3,8 +3,10 @@ const css = `
3
3
  --vuu-icon-left: 0;
4
4
  --vuu-icon-size: 16px;
5
5
  --vuu-icon-top: -1px;
6
- color: var(--background-cell-color);
7
- z-index: -1;
6
+ color: inherit;
7
+ cursor: grab;
8
+ -webkit-user-select: none;
9
+ user-select: none;
8
10
  align-items: center;
9
11
  padding: 0 8px;
10
12
  display: flex;
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useComponentCssInjection } from "@salt-ds/styles";
3
3
  import { useWindow } from "@salt-ds/window";
4
4
  import { applyHighlighting } from "@vuu-ui/vuu-table";
5
+ import { Icon } from "../icon-button/index.js";
5
6
  import SearchCell from "./SearchCell.css";
6
7
  const classBase = "vuuSearchCell";
7
8
  const SearchCell_SearchCell = ({ column, dataRow, searchPattern = "" })=>{
@@ -16,8 +17,8 @@ const SearchCell_SearchCell = ({ column, dataRow, searchPattern = "" })=>{
16
17
  className: classBase,
17
18
  tabIndex: -1,
18
19
  children: [
19
- /*#__PURE__*/ jsx("span", {
20
- "data-icon": "draggable"
20
+ /*#__PURE__*/ jsx(Icon, {
21
+ name: "draggable"
21
22
  }),
22
23
  valueWithHighlighting
23
24
  ]
@@ -1,6 +1,10 @@
1
1
  const css = `
2
2
  .vuuTableSearch {
3
+ box-sizing: border-box;
4
+ width: 100%;
5
+ min-width: 0;
3
6
  height: 100%;
7
+ min-height: 0;
4
8
  padding: var(--vuuTableSearch-padding, 12px);
5
9
  flex-direction: column;
6
10
  display: flex;
@@ -16,7 +16,7 @@ const defaultConfig = {
16
16
  const searchIcon = /*#__PURE__*/ jsx("span", {
17
17
  "data-icon": "search"
18
18
  });
19
- const TableSearch_TableSearch = ({ TableProps: { dataSource: dataSourceProp, ...TableProps }, autoFocus = false, className, placeHolder, searchColumns, ...htmlAttributes })=>{
19
+ const TableSearch_TableSearch = ({ TableProps: { dataSource: dataSourceProp, ...TableProps }, autoFocus = false, baseFilter, className, placeHolder, searchColumns, ...htmlAttributes })=>{
20
20
  const targetWindow = useWindow();
21
21
  useComponentCssInjection({
22
22
  testId: "vuu-table-search",
@@ -30,6 +30,7 @@ const TableSearch_TableSearch = ({ TableProps: { dataSource: dataSourceProp, ...
30
30
  TableProps?.config
31
31
  ]);
32
32
  const { dataSource, onChange, searchState } = useTableSearch({
33
+ baseFilter,
33
34
  dataSource: dataSourceProp,
34
35
  searchColumns
35
36
  });
@@ -46,6 +47,7 @@ const TableSearch_TableSearch = ({ TableProps: { dataSource: dataSourceProp, ...
46
47
  /*#__PURE__*/ jsx("div", {
47
48
  className: `${classBase}-inputField`,
48
49
  children: /*#__PURE__*/ jsx(Input, {
50
+ bordered: true,
49
51
  inputProps: {
50
52
  onKeyDown
51
53
  },
@@ -1,5 +1,5 @@
1
- import { useCallback, useMemo, useState } from "react";
2
- const useTableSearch = ({ dataSource, searchColumns })=>{
1
+ import { useCallback, useEffect, useMemo, useState } from "react";
2
+ const useTableSearch = ({ baseFilter = "", dataSource, searchColumns })=>{
3
3
  const [searchState, setSearchState] = useState({
4
4
  searchText: "",
5
5
  filter: ""
@@ -14,12 +14,20 @@ const useTableSearch = ({ dataSource, searchColumns })=>{
14
14
  searchText: value,
15
15
  filter
16
16
  });
17
- if (dataSource) dataSource.filter = {
18
- filter
17
+ }, [
18
+ baseFilterPattern
19
+ ]);
20
+ useEffect(()=>{
21
+ dataSource.filter = {
22
+ filter: [
23
+ baseFilter,
24
+ searchState.filter
25
+ ].filter(Boolean).map((filter)=>`(${filter})`).join(" and ")
19
26
  };
20
27
  }, [
21
- baseFilterPattern,
22
- dataSource
28
+ baseFilter,
29
+ dataSource,
30
+ searchState.filter
23
31
  ]);
24
32
  return {
25
33
  dataSource,
@@ -1,5 +1,5 @@
1
- import { DialogHeaderProps, DialogProps } from "@salt-ds/core";
2
- import { HTMLAttributes, ReactNode, RefObject } from "react";
1
+ import { type DialogHeaderProps, type DialogProps } from "@salt-ds/core";
2
+ import { type HTMLAttributes, type ReactNode, type RefObject } from "react";
3
3
  /**
4
4
  * Allow fine grained configuration of Prompt buttons
5
5
  * The ref is provided to facilitate programmatic focus.
@@ -3,7 +3,8 @@ import { HTMLAttributes } from "react";
3
3
  export interface TableSearchProps extends HTMLAttributes<HTMLDivElement> {
4
4
  TableProps: TableProps;
5
5
  autoFocus?: boolean;
6
+ baseFilter?: string;
6
7
  placeHolder?: string;
7
8
  searchColumns: string[];
8
9
  }
9
- export declare const TableSearch: ({ TableProps: { dataSource: dataSourceProp, ...TableProps }, autoFocus, className, placeHolder, searchColumns, ...htmlAttributes }: TableSearchProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const TableSearch: ({ TableProps: { dataSource: dataSourceProp, ...TableProps }, autoFocus, baseFilter, className, placeHolder, searchColumns, ...htmlAttributes }: TableSearchProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import { FormEventHandler } from "react";
2
2
  import { TableSearchProps } from "./TableSearch";
3
3
  import { DataSource } from "@vuu-ui/vuu-data-types";
4
- export interface TableSearchHookProps extends Pick<TableSearchProps, "searchColumns"> {
4
+ export interface TableSearchHookProps extends Pick<TableSearchProps, "searchColumns" | "baseFilter"> {
5
5
  dataSource: DataSource;
6
6
  label?: string;
7
7
  }
8
- export declare const useTableSearch: ({ dataSource, searchColumns, }: TableSearchHookProps) => {
8
+ export declare const useTableSearch: ({ baseFilter, dataSource, searchColumns, }: TableSearchHookProps) => {
9
9
  dataSource: DataSource;
10
10
  onChange: FormEventHandler;
11
11
  searchState: {