authscape 1.0.426 → 1.0.430

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/index.js CHANGED
@@ -2283,11 +2283,10 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
2283
2283
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2284
2284
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
2285
2285
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
2286
+ /// use in testing
2286
2287
  // import { Handle } from './Handle';
2287
2288
  // import { Remove } from './Remove';
2288
2289
 
2289
- // import styles from './dist/Container.module.css';
2290
-
2291
2290
  var Container = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
2292
2291
  var children = _ref.children,
2293
2292
  _ref$columns = _ref.columns,
@@ -2359,8 +2358,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
2359
2358
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
2360
2359
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
2361
2360
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2361
+ /// use in testing
2362
2362
  // import {Action} from './Action';
2363
-
2364
2363
  var dragIcon = function dragIcon() {
2365
2364
  return /*#__PURE__*/_react["default"].createElement(_DragIndicatorRounded["default"], null);
2366
2365
  };
@@ -2383,7 +2382,8 @@ exports.Item = void 0;
2383
2382
  var _react = _interopRequireWildcard(require("react"));
2384
2383
  var _classnames = _interopRequireDefault(require("classnames"));
2385
2384
  var _material = require("@mui/material");
2386
- var _excluded = ["color", "dragOverlay", "dragging", "disabled", "fadeIn", "name", "handle", "handleProps", "height", "itemStyles", "cardDetail", "CardTemplate", "index", "listeners", "onRemove", "onCardClicked", "renderItem", "sorting", "style", "transition", "transform", "value", "handleMoreClick", "handleMoreClose", "wrapperStyle"]; // import { Handle } from './Handle';
2385
+ var _excluded = ["color", "dragOverlay", "dragging", "disabled", "fadeIn", "name", "handle", "handleProps", "height", "itemStyles", "cardDetail", "CardTemplate", "index", "listeners", "onRemove", "onCardClicked", "renderItem", "sorting", "style", "transition", "transform", "value", "handleMoreClick", "handleMoreClose", "wrapperStyle"]; /// use in testing
2386
+ // import { Handle } from './Handle';
2387
2387
  // import { Remove } from './Remove';
2388
2388
  // import styles from './dist/Item.module.css';
2389
2389
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -2518,7 +2518,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
2518
2518
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2519
2519
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2520
2520
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
2521
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // import {coordinateGetter as multipleContainersCoordinateGetter} from './multipleContainersKeyboardCoordinates';
2521
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /// use in testing
2522
+ // import {coordinateGetter as multipleContainersCoordinateGetter} from './multipleContainersKeyboardCoordinates';
2522
2523
  // import { apiService } from 'authscape';
2523
2524
  // import { Item } from './item';
2524
2525
  // import { Container } from './container';
@@ -2599,6 +2600,8 @@ function Kanban(_ref2) {
2599
2600
  initialItems = _ref2.items,
2600
2601
  containerStyles = _ref2.containerStyles,
2601
2602
  itemStyles = _ref2.itemStyles,
2603
+ _ref2$filterBy = _ref2.filterBy,
2604
+ filterBy = _ref2$filterBy === void 0 ? null : _ref2$filterBy,
2602
2605
  containerStyle = _ref2.containerStyle,
2603
2606
  _ref2$coordinateGette = _ref2.coordinateGetter,
2604
2607
  coordinateGetter = _ref2$coordinateGette === void 0 ? multipleContainersCoordinateGetter : _ref2$coordinateGette,
@@ -2621,6 +2624,8 @@ function Kanban(_ref2) {
2621
2624
  _ref2$vertical = _ref2.vertical,
2622
2625
  vertical = _ref2$vertical === void 0 ? false : _ref2$vertical,
2623
2626
  onCardClicked = _ref2.onCardClicked,
2627
+ _ref2$onCardChangedSt = _ref2.onCardChangedState,
2628
+ onCardChangedState = _ref2$onCardChangedSt === void 0 ? null : _ref2$onCardChangedSt,
2624
2629
  scrollable = _ref2.scrollable;
2625
2630
  var _useState = (0, _react.useState)(null),
2626
2631
  _useState2 = _slicedToArray(_useState, 2),
@@ -2646,10 +2651,23 @@ function Kanban(_ref2) {
2646
2651
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2647
2652
  while (1) switch (_context.prev = _context.next) {
2648
2653
  case 0:
2649
- _context.next = 2;
2654
+ response = null;
2655
+ if (!(filterBy == null)) {
2656
+ _context.next = 7;
2657
+ break;
2658
+ }
2659
+ _context.next = 4;
2650
2660
  return apiService().get("/Kanban/GetKanban");
2651
- case 2:
2661
+ case 4:
2652
2662
  response = _context.sent;
2663
+ _context.next = 10;
2664
+ break;
2665
+ case 7:
2666
+ _context.next = 9;
2667
+ return apiService().get("/Kanban/GetKanban?filterBy=" + filterBy);
2668
+ case 9:
2669
+ response = _context.sent;
2670
+ case 10:
2653
2671
  if (response != null && response.status == 200) {
2654
2672
  _containers = [];
2655
2673
  _initItems = response.data;
@@ -2669,7 +2687,7 @@ function Kanban(_ref2) {
2669
2687
  setItems(container);
2670
2688
  setContainers(_containers);
2671
2689
  }
2672
- case 4:
2690
+ case 11:
2673
2691
  case "end":
2674
2692
  return _context.stop();
2675
2693
  }
@@ -2905,6 +2923,10 @@ function Kanban(_ref2) {
2905
2923
  apiService().put("/Kanban/SetColumnOrder", {
2906
2924
  columnsIds: array
2907
2925
  });
2926
+
2927
+ // is this correct?
2928
+ // onCardChangedState(over.id, active.id);
2929
+
2908
2930
  return array;
2909
2931
  });
2910
2932
  }
@@ -2970,6 +2992,9 @@ function Kanban(_ref2) {
2970
2992
  columnId: overContainer,
2971
2993
  cards: newArray
2972
2994
  });
2995
+ if (onCardChangedState != null) {
2996
+ onCardChangedState(overContainer, active.id);
2997
+ }
2973
2998
  } else {
2974
2999
  // assign the order of the cards
2975
3000
  apiService().put("/Kanban/AssignColumnForCard", {
@@ -2977,6 +3002,9 @@ function Kanban(_ref2) {
2977
3002
  cardId: active.id,
2978
3003
  orderId: 0
2979
3004
  });
3005
+ if (onCardChangedState != null) {
3006
+ onCardChangedState(overContainer, active.id);
3007
+ }
2980
3008
  }
2981
3009
  }
2982
3010
  setActiveId(null);
@@ -3373,8 +3401,8 @@ var _react = _interopRequireDefault(require("react"));
3373
3401
  var _DeleteRounded = _interopRequireDefault(require("@mui/icons-material/DeleteRounded"));
3374
3402
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3375
3403
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3404
+ /// use in testing
3376
3405
  // import {Action} from './Action';
3377
-
3378
3406
  var removeIcon = function removeIcon() {
3379
3407
  return /*#__PURE__*/_react["default"].createElement(_DeleteRounded["default"], null);
3380
3408
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.426",
3
+ "version": "1.0.430",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,10 +1,10 @@
1
1
  import React, {forwardRef} from 'react';
2
2
  import classNames from 'classnames';
3
3
 
4
+ /// use in testing
4
5
  // import { Handle } from './Handle';
5
6
  // import { Remove } from './Remove';
6
7
 
7
- // import styles from './dist/Container.module.css';
8
8
 
9
9
  export const Container = forwardRef(
10
10
  (
@@ -1,5 +1,7 @@
1
1
  import React, {forwardRef} from 'react';
2
2
  import DragIndicatorRoundedIcon from '@mui/icons-material/DragIndicatorRounded';
3
+
4
+ /// use in testing
3
5
  // import {Action} from './Action';
4
6
 
5
7
  const dragIcon = () => {
@@ -1,6 +1,7 @@
1
1
  import React, {useEffect} from 'react';
2
2
  import classNames from 'classnames';
3
3
 
4
+ /// use in testing
4
5
  // import { Handle } from './Handle';
5
6
  // import { Remove } from './Remove';
6
7
 
@@ -33,12 +33,14 @@ import {
33
33
  horizontalListSortingStrategy,
34
34
  } from '@dnd-kit/sortable';
35
35
  import {CSS} from '@dnd-kit/utilities';
36
- // import {coordinateGetter as multipleContainersCoordinateGetter} from './multipleContainersKeyboardCoordinates';
37
36
 
38
- // import { apiService } from 'authscape';
39
37
 
38
+ /// use in testing
39
+ // import {coordinateGetter as multipleContainersCoordinateGetter} from './multipleContainersKeyboardCoordinates';
40
+ // import { apiService } from 'authscape';
40
41
  // import { Item } from './item';
41
42
  // import { Container } from './container';
43
+
42
44
  import { Box } from '@mui/material';
43
45
 
44
46
  const animateLayoutChanges = (args) =>
@@ -125,6 +127,7 @@ export function Kanban({
125
127
  items: initialItems,
126
128
  containerStyles,
127
129
  itemStyles,
130
+ filterBy = null,
128
131
  containerStyle,
129
132
  coordinateGetter = multipleContainersCoordinateGetter,
130
133
  getItemStyles = () => ({}),
@@ -136,6 +139,7 @@ export function Kanban({
136
139
  trashable = false,
137
140
  vertical = false,
138
141
  onCardClicked,
142
+ onCardChangedState = null,
139
143
  scrollable,
140
144
  }) {
141
145
 
@@ -150,7 +154,16 @@ export function Kanban({
150
154
  {
151
155
  const fetchData = async () => {
152
156
 
153
- let response = await apiService().get("/Kanban/GetKanban");
157
+ let response = null;
158
+ if (filterBy == null)
159
+ {
160
+ response = await apiService().get("/Kanban/GetKanban");
161
+ }
162
+ else
163
+ {
164
+ response = await apiService().get("/Kanban/GetKanban?filterBy=" + filterBy);
165
+ }
166
+
154
167
  if (response != null && response.status == 200)
155
168
  {
156
169
  let containers = [];
@@ -450,6 +463,9 @@ export function Kanban({
450
463
  columnsIds: array
451
464
  });
452
465
 
466
+ // is this correct?
467
+ // onCardChangedState(over.id, active.id);
468
+
453
469
  return array;
454
470
  });
455
471
  }
@@ -535,6 +551,10 @@ export function Kanban({
535
551
  cards: newArray
536
552
  });
537
553
 
554
+ if (onCardChangedState != null)
555
+ {
556
+ onCardChangedState(overContainer, active.id);
557
+ }
538
558
  }
539
559
  else
540
560
  {
@@ -544,6 +564,11 @@ export function Kanban({
544
564
  cardId: active.id,
545
565
  orderId: 0
546
566
  });
567
+
568
+ if (onCardChangedState != null)
569
+ {
570
+ onCardChangedState(overContainer, active.id);
571
+ }
547
572
  }
548
573
  }
549
574
 
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import DeleteRoundedIcon from '@mui/icons-material/DeleteRounded';
3
+
4
+ /// use in testing
3
5
  // import {Action} from './Action';
4
6
 
5
7
  const removeIcon = () => {