@kwiz/fluentui 1.0.24 → 1.0.25

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- import { iDraggedItemType, iDraggableProps } from "./use-draggable";
1
+ import { iDraggableProps, iDraggedItemType } from "./use-draggable";
2
2
  import { iDroppableProps } from "./use-droppable";
3
3
  interface one<DragItemType extends iDraggedItemType<string>> {
4
4
  dragInfo: iDraggableProps<DragItemType>;
@@ -6,7 +6,7 @@ interface one<DragItemType extends iDraggedItemType<string>> {
6
6
  interface other<DropInfoTypes extends string = never, DropInfoItemTypes extends iDraggedItemType<DropInfoTypes> = never> {
7
7
  dropInfo: iDroppableProps<DropInfoTypes, DropInfoItemTypes>;
8
8
  }
9
- type iDragDropProps<DragItemType extends iDraggedItemType<string>, DropInfoTypes extends string = never, DropInfoItemTypes extends iDraggedItemType<DropInfoTypes> = never> = one<DragItemType> | other<DropInfoTypes, DropInfoItemTypes> | (one<DragItemType> & other<DropInfoTypes, DropInfoItemTypes>);
9
+ type iDragDropProps<DragItemType extends iDraggedItemType<string>, DropInfoTypes extends string = never, DropInfoItemTypes extends iDraggedItemType<DropInfoTypes> = never> = one<DragItemType> & Partial<other<DropInfoTypes, DropInfoItemTypes>> | Partial<one<DragItemType>> & other<DropInfoTypes, DropInfoItemTypes> | (one<DragItemType> & other<DropInfoTypes, DropInfoItemTypes>);
10
10
  type iProps<DragItemType extends iDraggedItemType<string>, DropInfoTypes extends string, DropInfoItemTypes extends iDraggedItemType<DropInfoTypes>> = Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
11
11
  onDraggingClassName?: string;
12
12
  onDragOverClassName?: string;
@@ -8,6 +8,11 @@ export function DragDropContainer(props) {
8
8
  classNames.push(props.onDraggingClassName);
9
9
  if (drop.isOver && props.onDragOverClassName)
10
10
  classNames.push(props.onDragOverClassName);
11
- return _jsx("div", Object.assign({}, (props || {}), { ref: dragDropRef, className: classNames.join(' '), children: props.children }));
11
+ const propsWithoutExtras = Object.assign({}, props);
12
+ delete propsWithoutExtras.dragInfo;
13
+ delete propsWithoutExtras.dropInfo;
14
+ delete propsWithoutExtras.onDraggingClassName;
15
+ delete propsWithoutExtras.onDragOverClassName;
16
+ return _jsx("div", Object.assign({}, propsWithoutExtras, { ref: dragDropRef, className: classNames.join(' '), children: props.children }));
12
17
  }
13
18
  //# sourceMappingURL=drag-drop-container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drag-drop-container.js","sourceRoot":"","sources":["../../../src/helpers/drag-drop/drag-drop-container.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAgCzD,MAAM,UAAU,iBAAiB,CAI/B,KAAsF;IAEpF,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAE9D,MAAM,UAAU,GAAa,mBAAmB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpG,IAAI,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,mBAAmB;QAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC7F,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,mBAAmB;QAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAEzF,OAAO,8BAAS,CAAC,KAAK,IAAI,EAAE,CAAC,IAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,YAAG,KAAK,CAAC,QAAQ,IAAO,CAAC;AAC7G,CAAC"}
1
+ {"version":3,"file":"drag-drop-container.js","sourceRoot":"","sources":["../../../src/helpers/drag-drop/drag-drop-container.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAgCzD,MAAM,UAAU,iBAAiB,CAI/B,KAAsF;IAEpF,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAE9D,MAAM,UAAU,GAAa,mBAAmB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpG,IAAI,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,mBAAmB;QAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC7F,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,mBAAmB;QAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAEzF,MAAM,kBAAkB,qBACjB,KAAK,CACX,CAAC;IACF,OAAO,kBAAkB,CAAC,QAAQ,CAAC;IACnC,OAAO,kBAAkB,CAAC,QAAQ,CAAC;IACnC,OAAO,kBAAkB,CAAC,mBAAmB,CAAC;IAC9C,OAAO,kBAAkB,CAAC,mBAAmB,CAAC;IAE9C,OAAO,8BAAS,kBAAkB,IAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,YAAG,KAAK,CAAC,QAAQ,IAAO,CAAC;AAClH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwiz/fluentui",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "KWIZ common controls for FluentUI",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +1,6 @@
1
1
  import { isNullOrEmptyString } from "@kwiz/common";
2
2
  import { useDragDropContext } from "./drag-drop-context";
3
- import { iDraggedItemType, iDraggableProps } from "./use-draggable";
3
+ import { iDraggableProps, iDraggedItemType } from "./use-draggable";
4
4
  import { iDroppableProps } from "./use-droppable";
5
5
 
6
6
  interface one<DragItemType extends iDraggedItemType<string>> {
@@ -16,8 +16,8 @@ type iDragDropProps<
16
16
  DragItemType extends iDraggedItemType<string>,
17
17
  DropInfoTypes extends string = never,
18
18
  DropInfoItemTypes extends iDraggedItemType<DropInfoTypes> = never,
19
- > = one<DragItemType>
20
- | other<DropInfoTypes, DropInfoItemTypes>
19
+ > = one<DragItemType> & Partial<other<DropInfoTypes, DropInfoItemTypes>>
20
+ | Partial<one<DragItemType>> & other<DropInfoTypes, DropInfoItemTypes>
21
21
  | (one<DragItemType> & other<DropInfoTypes, DropInfoItemTypes>);
22
22
 
23
23
  type iProps<DragItemType extends iDraggedItemType<string>, DropInfoTypes extends string, DropInfoItemTypes extends iDraggedItemType<DropInfoTypes>> =
@@ -43,5 +43,13 @@ export function DragDropContainer<
43
43
  if (drag.isDragging && props.onDraggingClassName) classNames.push(props.onDraggingClassName);
44
44
  if (drop.isOver && props.onDragOverClassName) classNames.push(props.onDragOverClassName);
45
45
 
46
- return <div {...(props || {})} ref={dragDropRef} className={classNames.join(' ')}>{props.children}</div>;
46
+ const propsWithoutExtras = {
47
+ ...props
48
+ };
49
+ delete propsWithoutExtras.dragInfo;
50
+ delete propsWithoutExtras.dropInfo;
51
+ delete propsWithoutExtras.onDraggingClassName;
52
+ delete propsWithoutExtras.onDragOverClassName;
53
+
54
+ return <div {...propsWithoutExtras} ref={dragDropRef} className={classNames.join(' ')}>{props.children}</div>;
47
55
  }