@deephaven/iris-grid 0.24.1-hierarchical-table.0 → 0.25.1-beta.0

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.
Files changed (106) hide show
  1. package/dist/ColumnHeaderGroup.d.ts +10 -3
  2. package/dist/ColumnHeaderGroup.d.ts.map +1 -1
  3. package/dist/ColumnHeaderGroup.js +20 -1
  4. package/dist/ColumnHeaderGroup.js.map +1 -1
  5. package/dist/IrisGrid.css.map +1 -1
  6. package/dist/IrisGrid.d.ts +6 -3
  7. package/dist/IrisGrid.d.ts.map +1 -1
  8. package/dist/IrisGrid.js +42 -25
  9. package/dist/IrisGrid.js.map +1 -1
  10. package/dist/IrisGridModel.d.ts +9 -2
  11. package/dist/IrisGridModel.d.ts.map +1 -1
  12. package/dist/IrisGridModel.js +0 -13
  13. package/dist/IrisGridModel.js.map +1 -1
  14. package/dist/IrisGridModelUpdater.d.ts +3 -1
  15. package/dist/IrisGridModelUpdater.d.ts.map +1 -1
  16. package/dist/IrisGridModelUpdater.js +5 -1
  17. package/dist/IrisGridModelUpdater.js.map +1 -1
  18. package/dist/IrisGridProxyModel.d.ts +7 -2
  19. package/dist/IrisGridProxyModel.d.ts.map +1 -1
  20. package/dist/IrisGridProxyModel.js +16 -4
  21. package/dist/IrisGridProxyModel.js.map +1 -1
  22. package/dist/IrisGridTableModel.d.ts +1 -1
  23. package/dist/IrisGridTableModel.d.ts.map +1 -1
  24. package/dist/IrisGridTableModel.js.map +1 -1
  25. package/dist/IrisGridTableModelTemplate.d.ts +18 -9
  26. package/dist/IrisGridTableModelTemplate.d.ts.map +1 -1
  27. package/dist/IrisGridTableModelTemplate.js +143 -165
  28. package/dist/IrisGridTableModelTemplate.js.map +1 -1
  29. package/dist/IrisGridTestUtils.d.ts +8 -2
  30. package/dist/IrisGridTestUtils.d.ts.map +1 -1
  31. package/dist/IrisGridTestUtils.js +9 -4
  32. package/dist/IrisGridTestUtils.js.map +1 -1
  33. package/dist/IrisGridTheme.module.css.map +1 -1
  34. package/dist/IrisGridUtils.d.ts +16 -2
  35. package/dist/IrisGridUtils.d.ts.map +1 -1
  36. package/dist/IrisGridUtils.js +151 -48
  37. package/dist/IrisGridUtils.js.map +1 -1
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +1 -0
  41. package/dist/index.js.map +1 -1
  42. package/dist/sidebar/index.d.ts +1 -1
  43. package/dist/sidebar/index.d.ts.map +1 -1
  44. package/dist/sidebar/index.js +1 -1
  45. package/dist/sidebar/index.js.map +1 -1
  46. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.css +68 -0
  47. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.css.map +1 -0
  48. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.d.ts +156 -0
  49. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.d.ts.map +1 -0
  50. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.js +962 -0
  51. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.js.map +1 -0
  52. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilderUtils.d.ts +26 -0
  53. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilderUtils.d.ts.map +1 -0
  54. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilderUtils.js +130 -0
  55. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilderUtils.js.map +1 -0
  56. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.css +29 -0
  57. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.css.map +1 -0
  58. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.d.ts +13 -0
  59. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.d.ts.map +1 -0
  60. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.js +160 -0
  61. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.js.map +1 -0
  62. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingItem.d.ts +19 -0
  63. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingItem.d.ts.map +1 -0
  64. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingItem.js +81 -0
  65. package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingItem.js.map +1 -0
  66. package/dist/sidebar/visibility-ordering-builder/sortable-tree/PointerSensorWithInteraction.d.ts +13 -0
  67. package/dist/sidebar/visibility-ordering-builder/sortable-tree/PointerSensorWithInteraction.d.ts.map +1 -0
  68. package/dist/sidebar/visibility-ordering-builder/sortable-tree/PointerSensorWithInteraction.js +28 -0
  69. package/dist/sidebar/visibility-ordering-builder/sortable-tree/PointerSensorWithInteraction.js.map +1 -0
  70. package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTree.d.ts +18 -0
  71. package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTree.d.ts.map +1 -0
  72. package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTree.js +156 -0
  73. package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTree.js.map +1 -0
  74. package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeInner.d.ts +19 -0
  75. package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeInner.d.ts.map +1 -0
  76. package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeInner.js +144 -0
  77. package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeInner.js.map +1 -0
  78. package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeItem.d.ts +7 -0
  79. package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeItem.d.ts.map +1 -0
  80. package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeItem.js +57 -0
  81. package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeItem.js.map +1 -0
  82. package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.css +139 -0
  83. package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.css.map +1 -0
  84. package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.d.ts +36 -0
  85. package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.d.ts.map +1 -0
  86. package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.js +44 -0
  87. package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.js.map +1 -0
  88. package/dist/sidebar/visibility-ordering-builder/sortable-tree/keyboardCoordinates.d.ts +4 -0
  89. package/dist/sidebar/visibility-ordering-builder/sortable-tree/keyboardCoordinates.d.ts.map +1 -0
  90. package/dist/sidebar/visibility-ordering-builder/sortable-tree/keyboardCoordinates.js +127 -0
  91. package/dist/sidebar/visibility-ordering-builder/sortable-tree/keyboardCoordinates.js.map +1 -0
  92. package/dist/sidebar/visibility-ordering-builder/sortable-tree/types.d.ts +20 -0
  93. package/dist/sidebar/visibility-ordering-builder/sortable-tree/types.d.ts.map +1 -0
  94. package/dist/sidebar/visibility-ordering-builder/sortable-tree/types.js +4 -0
  95. package/dist/sidebar/visibility-ordering-builder/sortable-tree/types.js.map +1 -0
  96. package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.d.ts +55 -0
  97. package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.d.ts.map +1 -0
  98. package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.js +265 -0
  99. package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.js.map +1 -0
  100. package/package.json +20 -16
  101. package/dist/sidebar/VisibilityOrderingBuilder.css +0 -156
  102. package/dist/sidebar/VisibilityOrderingBuilder.css.map +0 -1
  103. package/dist/sidebar/VisibilityOrderingBuilder.d.ts +0 -79
  104. package/dist/sidebar/VisibilityOrderingBuilder.d.ts.map +0 -1
  105. package/dist/sidebar/VisibilityOrderingBuilder.js +0 -753
  106. package/dist/sidebar/VisibilityOrderingBuilder.js.map +0 -1
@@ -0,0 +1,57 @@
1
+ var _excluded = ["id", "depth"];
2
+ 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); }
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ 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; }
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ 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; }
7
+ 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; }
8
+ /* eslint-disable import/prefer-default-export */
9
+ import React, { useMemo } from 'react';
10
+ import { useSortable } from '@dnd-kit/sortable';
11
+ import { CSS } from '@dnd-kit/utilities';
12
+ import { TreeItem } from "./TreeItem.js";
13
+ var animateLayoutChanges = _ref => {
14
+ var {
15
+ isSorting,
16
+ wasDragging
17
+ } = _ref;
18
+ return !(isSorting || wasDragging);
19
+ };
20
+ export function SortableTreeItem(_ref2) {
21
+ var {
22
+ id,
23
+ depth
24
+ } = _ref2,
25
+ props = _objectWithoutProperties(_ref2, _excluded);
26
+ var {
27
+ attributes,
28
+ isDragging,
29
+ isSorting,
30
+ listeners,
31
+ setDraggableNodeRef,
32
+ setDroppableNodeRef,
33
+ transform,
34
+ transition
35
+ } = useSortable({
36
+ id,
37
+ animateLayoutChanges
38
+ });
39
+ var transformString = CSS.Translate.toString(transform);
40
+ var style = useMemo(() => ({
41
+ transform: transformString,
42
+ transition
43
+ }), [transformString, transition]);
44
+ var handleProps = useMemo(() => _objectSpread(_objectSpread(_objectSpread({}, attributes), listeners), {}, {
45
+ style
46
+ }), [attributes, listeners, style]);
47
+ return /*#__PURE__*/React.createElement(TreeItem, _extends({
48
+ dragRef: setDraggableNodeRef,
49
+ wrapperRef: setDroppableNodeRef,
50
+ depth: depth,
51
+ ghost: isDragging,
52
+ disableInteraction: isSorting,
53
+ handleProps: handleProps
54
+ // eslint-disable-next-line react/jsx-props-no-spreading
55
+ }, props));
56
+ }
57
+ //# sourceMappingURL=SortableTreeItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SortableTreeItem.js","names":["React","useMemo","useSortable","CSS","TreeItem","animateLayoutChanges","isSorting","wasDragging","SortableTreeItem","id","depth","props","attributes","isDragging","listeners","setDraggableNodeRef","setDroppableNodeRef","transform","transition","transformString","Translate","toString","style","handleProps"],"sources":["../../../../src/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeItem.tsx"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\nimport React, { CSSProperties, useMemo } from 'react';\nimport { AnimateLayoutChanges, useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { TreeItem, Props as TreeItemProps } from './TreeItem';\n\nexport interface Props<T> extends Omit<TreeItemProps<T>, 'style'> {\n id: string;\n}\n\nconst animateLayoutChanges: AnimateLayoutChanges = ({\n isSorting,\n wasDragging,\n}) => !(isSorting || wasDragging);\n\nexport function SortableTreeItem<T>({\n id,\n depth,\n ...props\n}: Props<T>): JSX.Element {\n const {\n attributes,\n isDragging,\n isSorting,\n listeners,\n setDraggableNodeRef,\n setDroppableNodeRef,\n transform,\n transition,\n } = useSortable({\n id,\n animateLayoutChanges,\n });\n\n const transformString = CSS.Translate.toString(transform);\n\n const style: CSSProperties = useMemo(\n () => ({\n transform: transformString,\n transition,\n }),\n [transformString, transition]\n );\n\n const handleProps = useMemo(\n () => ({\n ...attributes,\n ...listeners,\n style,\n }),\n [attributes, listeners, style]\n );\n\n return (\n <TreeItem\n dragRef={setDraggableNodeRef}\n wrapperRef={setDroppableNodeRef}\n depth={depth}\n ghost={isDragging}\n disableInteraction={isSorting}\n handleProps={handleProps}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;AAAA;AACA,OAAOA,KAAK,IAAmBC,OAAO,QAAQ,OAAO;AACrD,SAA+BC,WAAW,QAAQ,mBAAmB;AACrE,SAASC,GAAG,QAAQ,oBAAoB;AAAC,SAChCC,QAAQ;AAMjB,IAAMC,oBAA0C,GAAG;EAAA,IAAC;IAClDC,SAAS;IACTC;EACF,CAAC;EAAA,OAAK,EAAED,SAAS,IAAIC,WAAW,CAAC;AAAA;AAEjC,OAAO,SAASC,gBAAgB,QAIN;EAAA,IAJU;MAClCC,EAAE;MACFC;IAEQ,CAAC;IADNC,KAAK;EAER,IAAM;IACJC,UAAU;IACVC,UAAU;IACVP,SAAS;IACTQ,SAAS;IACTC,mBAAmB;IACnBC,mBAAmB;IACnBC,SAAS;IACTC;EACF,CAAC,GAAGhB,WAAW,CAAC;IACdO,EAAE;IACFJ;EACF,CAAC,CAAC;EAEF,IAAMc,eAAe,GAAGhB,GAAG,CAACiB,SAAS,CAACC,QAAQ,CAACJ,SAAS,CAAC;EAEzD,IAAMK,KAAoB,GAAGrB,OAAO,CAClC,OAAO;IACLgB,SAAS,EAAEE,eAAe;IAC1BD;EACF,CAAC,CAAC,EACF,CAACC,eAAe,EAAED,UAAU,CAAC,CAC9B;EAED,IAAMK,WAAW,GAAGtB,OAAO,CACzB,oDACKW,UAAU,GACVE,SAAS;IACZQ;EAAK,EACL,EACF,CAACV,UAAU,EAAEE,SAAS,EAAEQ,KAAK,CAAC,CAC/B;EAED,oBACE,oBAAC,QAAQ;IACP,OAAO,EAAEP,mBAAoB;IAC7B,UAAU,EAAEC,mBAAoB;IAChC,KAAK,EAAEN,KAAM;IACb,KAAK,EAAEG,UAAW;IAClB,kBAAkB,EAAEP,SAAU;IAC9B,WAAW,EAAEiB;IACb;EAAA,GACIZ,KAAK,EACT;AAEN"}
@@ -0,0 +1,139 @@
1
+ /* stylelint-disable scss/at-import-no-partial-leading-underscore */
2
+ .visibility-ordering-list .tree-item {
3
+ position: relative;
4
+ display: flex;
5
+ gap: 0.25rem;
6
+ flex-direction: row;
7
+ flex-wrap: nowrap;
8
+ justify-content: flex-start;
9
+ align-items: center;
10
+ flex-grow: 1;
11
+ min-width: 0;
12
+ border: 1px solid transparent;
13
+ user-select: none;
14
+ border-radius: 4px;
15
+ padding: 0 0.25rem;
16
+ }
17
+ .visibility-ordering-list .tree-item svg:not(.color-swatch) {
18
+ color: #929192;
19
+ }
20
+ .visibility-ordering-list .tree-item:hover {
21
+ background: #5b5a5c;
22
+ cursor: grab;
23
+ }
24
+ .visibility-ordering-list .tree-item.isSelected {
25
+ background-color: rgba(72, 120, 234, 0.4);
26
+ }
27
+ .visibility-ordering-list .tree-item.isSelected:hover {
28
+ background-color: #4878ea;
29
+ }
30
+ .visibility-ordering-list .tree-item.isSelected:hover svg:not(.color-swatch) {
31
+ color: #f0f0ee;
32
+ }
33
+ .visibility-ordering-list .tree-item:focus {
34
+ outline: 0;
35
+ border: 1px solid rgba(72, 120, 234, 0.85);
36
+ box-shadow: 0 0 0 0.2rem rgba(72, 120, 234, 0.35);
37
+ }
38
+ .visibility-ordering-list .tree-item .column-name {
39
+ flex-grow: 1;
40
+ flex-shrink: 1;
41
+ overflow-x: hidden;
42
+ text-overflow: ellipsis;
43
+ }
44
+ .visibility-ordering-list .tree-item .item-count {
45
+ padding: 0 0.5rem;
46
+ border-radius: 1rem;
47
+ background-color: rgba(240, 240, 238, 0.25);
48
+ margin-right: 0.25rem;
49
+ }
50
+ .visibility-ordering-list .marching-ants {
51
+ background-image: linear-gradient(to right, #1a171a 50%, #f0f0ee 50%), linear-gradient(to right, #1a171a 50%, #f0f0ee 50%), linear-gradient(to bottom, #1a171a 50%, #f0f0ee 50%), linear-gradient(to bottom, #1a171a 50%, #f0f0ee 50%);
52
+ background-size: 8px 1px, 8px 1px, 1px 8px, 1px 8px;
53
+ background-position: 0 top, 0 bottom, left 0, right 0;
54
+ background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
55
+ animation: march 0.5s;
56
+ animation-timing-function: linear;
57
+ animation-iteration-count: infinite;
58
+ }
59
+ .visibility-ordering-list .item-wrapper {
60
+ list-style: none;
61
+ box-sizing: border-box;
62
+ margin-bottom: -1px;
63
+ width: 100%;
64
+ display: flex;
65
+ flex-direction: row;
66
+ flex-wrap: nowrap;
67
+ }
68
+ .visibility-ordering-list .item-wrapper.clone {
69
+ pointer-events: none;
70
+ padding: 0;
71
+ }
72
+ .visibility-ordering-list .item-wrapper.clone .tree-item {
73
+ opacity: 1;
74
+ background-color: #4878ea;
75
+ box-shadow: 0 0.1rem 1rem rgba(26, 23, 26, 0.45);
76
+ }
77
+ .visibility-ordering-list .item-wrapper.clone .tree-item svg:not(.color-swatch) {
78
+ color: #f0f0ee;
79
+ }
80
+ .visibility-ordering-list .item-wrapper.clone .tree-item.two-dragged::before {
81
+ content: " ";
82
+ background: #4878ea;
83
+ box-shadow: 0 0.1rem 1rem rgba(26, 23, 26, 0.45);
84
+ border-radius: 4px;
85
+ position: absolute;
86
+ height: 100%;
87
+ width: 100%;
88
+ top: 4px;
89
+ left: 2px;
90
+ opacity: 0.8;
91
+ z-index: -1;
92
+ }
93
+ .visibility-ordering-list .item-wrapper.clone .tree-item.multiple-dragged::before {
94
+ content: " ";
95
+ background: #4878ea;
96
+ box-shadow: 0 0.1rem 1rem rgba(26, 23, 26, 0.45);
97
+ border-radius: 4px;
98
+ position: absolute;
99
+ height: 100%;
100
+ width: 100%;
101
+ top: 4px;
102
+ left: 2px;
103
+ opacity: 0.8;
104
+ z-index: -1;
105
+ }
106
+ .visibility-ordering-list .item-wrapper.clone .tree-item.multiple-dragged::after {
107
+ content: " ";
108
+ background: #4878ea;
109
+ box-shadow: 0 0.1rem 1rem rgba(26, 23, 26, 0.45);
110
+ border-radius: 4px;
111
+ position: absolute;
112
+ height: 100%;
113
+ width: 100%;
114
+ top: 8px;
115
+ left: 4px;
116
+ opacity: 0.6;
117
+ z-index: -2;
118
+ }
119
+ .visibility-ordering-list .item-wrapper.ghost {
120
+ opacity: 0.5;
121
+ }
122
+ .visibility-ordering-list .item-wrapper.ghost .tree-item > * {
123
+ box-shadow: none;
124
+ background-color: transparent;
125
+ }
126
+ .visibility-ordering-list .item-wrapper.disableInteraction {
127
+ pointer-events: none;
128
+ }
129
+ .visibility-ordering-list .item-wrapper.disableInteraction:not(.ghost) .tree-item.isSelected {
130
+ opacity: 0.3;
131
+ }
132
+ .visibility-ordering-list .item-wrapper .depth-line {
133
+ margin-left: calc(0.5rem + 8px + 0.5px);
134
+ margin-right: 0.25rem;
135
+ padding-bottom: 2px;
136
+ border-left: 1px solid #555356;
137
+ }
138
+
139
+ /*# sourceMappingURL=TreeItem.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../../../../../../node_modules/@deephaven/components/scss/custom.scss","../../../../src/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.scss","../../../../../../node_modules/@deephaven/components/scss/new_variables.scss","../../../../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss"],"names":[],"mappings":"AAAA;ACQE;EACE;EACA;EACA,KCTO;EDUP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,eEqGY;EFpGZ;;AAEA;EACE,OEHK;;AFMP;EACE,YENK;EFOL;;AAGF;EACE;;AAEA;EACE,kBExBQ;;AF0BR;EACE,OE1BO;;AF+Bb;EACE;EACA;EACA,YE+FuB;;AF5FzB;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA,cC3DK;;AD+DT;EC/CA;EAIA;EAEA;EACA;EACA;EACA;EACA;;ADyCA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEA;EACE;EACA,kBExEQ;EFyER,YEqCK;;AFnCL;EACE,OE3EO;;ADmBf;EACE;EACA,YCtBY;EDuBZ,YCuFS;EDtFT,eCqFY;EDpFZ;EACA;EACA;EDsDQ;EACA;EACA;EACA;;AChEV;EACE;EACA,YCtBY;EDuBZ,YCuFS;EDtFT,eCqFY;EDpFZ;EACA;EACA;ED+DQ;EACA;EACA;EACA;;ACzEV;EACE;EACA,YCtBY;EDuBZ,YCuFS;EDtFT,eCqFY;EDpFZ;EACA;EACA;EDqEQ;EACA;EACA;EACA;;AAMR;EACE;;AAEA;EACE;EACA;;AAIJ;EACE;;AAEA;EACE;;AAIJ;EACE,aApIS;EAqIT,cCtIK;EDuIL;EACA","file":"TreeItem.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n","@import '@deephaven/components/scss/custom.scss';\n\n$depth-line-color: $gray-600;\n$depth-margin: calc(\n 0.5rem + 8px + 0.5px\n); // Tree item 0.25rem padding, Icon button 0.25rem, half of icon size, and half pixel to offset 1px border\n\n.visibility-ordering-list {\n .tree-item {\n position: relative;\n display: flex;\n gap: $spacer-1;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n flex-grow: 1;\n min-width: 0; // Needed so column names don't grow past the edge\n border: $input-border-width solid transparent;\n user-select: none;\n border-radius: $border-radius;\n padding: 0 $spacer-1; // space for focus border\n\n svg:not(.color-swatch) {\n color: $text-muted;\n }\n\n &:hover {\n background: $gray-500;\n cursor: grab;\n }\n\n &.isSelected {\n background-color: rgba($primary, 0.4);\n\n &:hover {\n background-color: $primary;\n\n svg:not(.color-swatch) {\n color: $foreground;\n }\n }\n }\n\n &:focus {\n outline: 0;\n border: $input-border-width solid $input-focus-border-color;\n box-shadow: $input-focus-box-shadow;\n }\n\n .column-name {\n flex-grow: 1;\n flex-shrink: 1;\n overflow-x: hidden;\n text-overflow: ellipsis;\n }\n\n .item-count {\n padding: 0 $spacer-2;\n border-radius: 1rem;\n background-color: rgba($foreground, 0.25);\n margin-right: $spacer-1;\n }\n }\n\n .marching-ants {\n @include ants-base($foreground, $background);\n }\n\n .item-wrapper {\n list-style: none;\n box-sizing: border-box;\n margin-bottom: -1px;\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n\n &.clone {\n pointer-events: none;\n padding: 0;\n\n .tree-item {\n opacity: 1;\n background-color: $primary;\n box-shadow: $box-shadow;\n\n svg:not(.color-swatch) {\n color: $foreground;\n }\n\n &.two-dragged {\n @include drag-stack(before) {\n top: 4px;\n left: 2px;\n opacity: 0.8;\n z-index: -1;\n }\n }\n\n &.multiple-dragged {\n @include drag-stack(before) {\n top: 4px;\n left: 2px;\n opacity: 0.8;\n z-index: -1;\n }\n @include drag-stack(after) {\n top: 8px;\n left: 4px;\n opacity: 0.6;\n z-index: -2;\n }\n }\n }\n }\n\n &.ghost {\n opacity: 0.5;\n\n .tree-item > * {\n box-shadow: none;\n background-color: transparent;\n }\n }\n\n &.disableInteraction {\n pointer-events: none;\n\n &:not(.ghost) .tree-item.isSelected {\n opacity: 0.3;\n }\n }\n\n .depth-line {\n margin-left: $depth-margin;\n margin-right: $spacer-1; // Gives breathing room to the item boxes\n padding-bottom: 2px;\n border-left: 1px solid $depth-line-color;\n }\n }\n}\n","//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size: $ant-size $ant-thickness, $ant-size $ant-thickness,\n $ant-thickness $ant-size, $ant-thickness $ant-size;\n background-position: 0 top, 0 bottom, left 0, right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n$focus-bg-transparency: 0.12;\n$hover-bg-transparency: 0.14;\n$active-bg-transparency: 0.28;\n$exception-transparency: 0.13;\n","// Styling overrides for bootstrap\n\n// Override / set color variables\n$red: #f95d84;\n$orange: #f37e3f;\n$yellow: #fcd65b;\n$green: #9edc6f;\n$blue: #76d9e4;\n$purple: #aa9af4;\n\n//Define some UI colors\n$interfacegray: #2d2a2e;\n$interfaceblue: #4878ea;\n$interfacewhite: #f0f0ee; //same as gray-200\n$interfaceblack: #1a171a;\n\n//Define our Gray scale\n$white: $interfacewhite;\n$gray-100: #fcfcfa;\n$gray-200: $interfacewhite;\n$gray-300: #c0bfbf;\n$gray-400: #929192;\n$gray-500: #5b5a5c;\n$gray-600: #555356;\n$gray-700: #403e41;\n$gray-800: #373438;\n$gray-850: #322f33;\n$gray-900: #211f22;\n$black: $interfaceblack;\n$content-bg: $interfacegray;\n$background: $interfaceblack;\n$foreground: $interfacewhite;\n\n//Load colors into map\n$colors: ();\n$colors: map-merge(\n (\n 'red': $red,\n 'orange': $orange,\n 'yellow': $yellow,\n 'green': $green,\n 'blue': $blue,\n 'purple': $purple,\n 'white': $white,\n 'black': $black,\n ),\n $colors\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: $interfaceblue;\n$primary-hover: darken($primary, 8%);\n$primary-dark: mix($primary, $content-bg, 25%);\n$primary-light: scale-color($primary, $lightness: -25%);\n$secondary: $gray-500;\n$secondary-hover: darken($secondary, 8%);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: $red;\n$danger-hover: darken($danger, 8%);\n$light: $gray-100;\n$mid: $gray-400; //Added a mid color, useful for input styling\n$dark: $gray-800;\n$green-dark: scale-color($green, $lightness: -45%, $saturation: -10%);\n\n$theme-colors: () !default;\n$theme-colors: map-merge(\n (\n 'primary': $primary,\n 'primary-hover': $primary-hover,\n 'primary-light': $primary-light,\n 'primary-dark': $primary-dark,\n 'secondary': $secondary,\n 'success': $success,\n 'info': $info,\n 'warning': $warning,\n 'danger': $danger,\n 'light': $light,\n 'dark': $dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n ),\n $theme-colors\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif: 'Fira Sans', -apple-system, blinkmacsystemfont,\n 'Segoe UI', 'Roboto', 'Helvetica Neue', arial, sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n//so browsers add alpha to your color by default, ignoring opacity 1\n//by setting rgba with 0.99 it tricks browser into thinking there is alpha applied\n$text-select-color: $primary-hover;\n$text-select-color-editor: lighten(\n $gray-700,\n 15%\n); //we lighten it abit to account for that 0.01 loss, and because it needs some anyways.\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem rgba($black, 45%); //because our UI is so dark, we need darker default shadows\n$box-shadow-900: 0 0.1rem 1rem rgba(0, 0, 0, 45%); //darkest shadow for $black popups over $black UI\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition: color 0.12s ease-in-out, background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out, box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n\n//Override Inputs\n$input-bg: $gray-600;\n$input-disabled-bg: $gray-800;\n$input-color: $foreground;\n$input-border-color: $gray-400;\n$input-placeholder-color: $gray-400;\n$input-focus-border-color: rgba($primary, 85%);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: rgba($component-active-bg, 35%);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n\n//checkbox\n$custom-control-indicator-bg: $gray-600;\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: $gray-800;\n$custom-control-indicator-checked-disabled-bg: $gray-800;\n$custom-control-label-disabled-color: $gray-400;\n\n//Custom Select\n$custom-select-indicator-color: $gray-400;\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: darken($gray-400, 5%);\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $gray-200;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n\n// Toast notification\n$toast-bg: $primary-dark;\n$toast-color: $foreground;\n$toast-error-bg: mix($danger, $content-bg, 15%);\n$toast-error-color: $foreground;\n\n//tooltips\n$tooltip-bg: $gray-700;\n$tooltip-color: $foreground;\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem rgba($black, 80%);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: $primary;\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: $gray-600;\n$contextmenu-color: $foreground;\n$contextmenu-disabled-color: $text-muted;\n$contextmenu-keyboard-selected-bg: rgba($primary, 50%);\n$contextmenu-selected-bg: $primary;\n$contextmenu-selected-color: $foreground;\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: theme-color('danger');\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n"]}
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import type { FlattenedItem, TreeItem as TreeItemType } from './types';
3
+ import './TreeItem.scss';
4
+ export interface Props<T> {
5
+ childCount?: number;
6
+ clone?: boolean;
7
+ depth: number;
8
+ disableInteraction?: boolean;
9
+ ghost?: boolean;
10
+ handleProps?: unknown;
11
+ value: string;
12
+ item: FlattenedItem<T>;
13
+ dragRef?: React.Ref<HTMLDivElement> | null;
14
+ wrapperRef?: React.Ref<HTMLLIElement> | null;
15
+ renderItem(props: {
16
+ ref: React.Ref<HTMLDivElement> | null;
17
+ clone: boolean;
18
+ childCount?: number;
19
+ value: string;
20
+ item: FlattenedItem<T>;
21
+ handleProps: unknown;
22
+ }): JSX.Element;
23
+ }
24
+ export type TreeItemRenderFn<T> = (props: {
25
+ ref: React.Ref<HTMLDivElement> | null;
26
+ clone: boolean;
27
+ childCount?: number;
28
+ value: string;
29
+ item: T extends TreeItemType<infer D> ? FlattenedItem<D> : FlattenedItem<T>;
30
+ handleProps: Record<string, unknown>;
31
+ }) => JSX.Element;
32
+ export declare function TreeItem<T>(props: Props<T>): JSX.Element;
33
+ export declare namespace TreeItem {
34
+ var displayName: string;
35
+ }
36
+ //# sourceMappingURL=TreeItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeItem.d.ts","sourceRoot":"","sources":["../../../../src/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,iBAAiB,CAAC;AAEzB,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACvB,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IAC3C,UAAU,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;IAC7C,UAAU,CAAC,KAAK,EAAE;QAChB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;QACtC,KAAK,EAAE,OAAO,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACvB,WAAW,EAAE,OAAO,CAAC;KACtB,GAAG,GAAG,CAAC,OAAO,CAAC;CACjB;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE;IACxC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,CAAC,SAAS,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5E,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC,KAAK,GAAG,CAAC,OAAO,CAAC;AAElB,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,eAkD1C;yBAlDe,QAAQ"}
@@ -0,0 +1,44 @@
1
+ /* eslint-disable react/jsx-props-no-spreading */
2
+ import React, { useMemo } from 'react';
3
+ import classNames from 'classnames';
4
+ import "./TreeItem.css";
5
+ export function TreeItem(props) {
6
+ var {
7
+ clone = false,
8
+ depth,
9
+ disableInteraction = false,
10
+ ghost = false,
11
+ handleProps,
12
+ value,
13
+ dragRef = null,
14
+ wrapperRef = null,
15
+ renderItem,
16
+ item,
17
+ childCount
18
+ } = props;
19
+ var depthMarkers = useMemo(() => Array(depth).fill(0)
20
+ // eslint-disable-next-line react/no-array-index-key
21
+ .map((_, i) => /*#__PURE__*/React.createElement("span", {
22
+ key: "depth-line-".concat(i),
23
+ className: "depth-line"
24
+ })), [depth]);
25
+ var renderItemProps = useMemo(() => ({
26
+ ref: dragRef,
27
+ clone,
28
+ value,
29
+ item,
30
+ childCount,
31
+ handleProps
32
+ }), [dragRef, clone, value, item, childCount, handleProps]);
33
+ return /*#__PURE__*/React.createElement("li", {
34
+ key: value,
35
+ className: classNames('item-wrapper', {
36
+ clone,
37
+ ghost,
38
+ disableInteraction
39
+ }),
40
+ ref: wrapperRef
41
+ }, !clone && depthMarkers, renderItem(renderItemProps));
42
+ }
43
+ TreeItem.displayName = 'TreeItem';
44
+ //# sourceMappingURL=TreeItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeItem.js","names":["React","useMemo","classNames","TreeItem","props","clone","depth","disableInteraction","ghost","handleProps","value","dragRef","wrapperRef","renderItem","item","childCount","depthMarkers","Array","fill","map","_","i","renderItemProps","ref","displayName"],"sources":["../../../../src/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport React, { useMemo } from 'react';\nimport classNames from 'classnames';\nimport type { FlattenedItem, TreeItem as TreeItemType } from './types';\nimport './TreeItem.scss';\n\nexport interface Props<T> {\n childCount?: number;\n clone?: boolean;\n depth: number;\n disableInteraction?: boolean;\n ghost?: boolean;\n handleProps?: unknown;\n value: string;\n item: FlattenedItem<T>;\n dragRef?: React.Ref<HTMLDivElement> | null;\n wrapperRef?: React.Ref<HTMLLIElement> | null;\n renderItem(props: {\n ref: React.Ref<HTMLDivElement> | null;\n clone: boolean;\n childCount?: number;\n value: string;\n item: FlattenedItem<T>;\n handleProps: unknown;\n }): JSX.Element;\n}\n\nexport type TreeItemRenderFn<T> = (props: {\n ref: React.Ref<HTMLDivElement> | null;\n clone: boolean;\n childCount?: number;\n value: string;\n item: T extends TreeItemType<infer D> ? FlattenedItem<D> : FlattenedItem<T>;\n handleProps: Record<string, unknown>;\n}) => JSX.Element;\n\nexport function TreeItem<T>(props: Props<T>) {\n const {\n clone = false,\n depth,\n disableInteraction = false,\n ghost = false,\n handleProps,\n value,\n dragRef = null,\n wrapperRef = null,\n renderItem,\n item,\n childCount,\n } = props;\n\n const depthMarkers = useMemo(\n () =>\n Array(depth)\n .fill(0)\n // eslint-disable-next-line react/no-array-index-key\n .map((_, i) => <span key={`depth-line-${i}`} className=\"depth-line\" />),\n [depth]\n );\n\n const renderItemProps = useMemo(\n () => ({\n ref: dragRef,\n clone,\n value,\n item,\n childCount,\n handleProps,\n }),\n [dragRef, clone, value, item, childCount, handleProps]\n );\n\n return (\n <li\n key={value}\n className={classNames('item-wrapper', {\n clone,\n ghost,\n disableInteraction,\n })}\n ref={wrapperRef}\n >\n {!clone && depthMarkers}\n {renderItem(renderItemProps)}\n </li>\n );\n}\n\nTreeItem.displayName = 'TreeItem';\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,OAAOC,UAAU,MAAM,YAAY;AAAC;AAkCpC,OAAO,SAASC,QAAQ,CAAIC,KAAe,EAAE;EAC3C,IAAM;IACJC,KAAK,GAAG,KAAK;IACbC,KAAK;IACLC,kBAAkB,GAAG,KAAK;IAC1BC,KAAK,GAAG,KAAK;IACbC,WAAW;IACXC,KAAK;IACLC,OAAO,GAAG,IAAI;IACdC,UAAU,GAAG,IAAI;IACjBC,UAAU;IACVC,IAAI;IACJC;EACF,CAAC,GAAGX,KAAK;EAET,IAAMY,YAAY,GAAGf,OAAO,CAC1B,MACEgB,KAAK,CAACX,KAAK,CAAC,CACTY,IAAI,CAAC,CAAC;EACP;EAAA,CACCC,GAAG,CAAC,CAACC,CAAC,EAAEC,CAAC,kBAAK;IAAM,GAAG,uBAAgBA,CAAC,CAAG;IAAC,SAAS,EAAC;EAAY,EAAG,CAAC,EAC3E,CAACf,KAAK,CAAC,CACR;EAED,IAAMgB,eAAe,GAAGrB,OAAO,CAC7B,OAAO;IACLsB,GAAG,EAAEZ,OAAO;IACZN,KAAK;IACLK,KAAK;IACLI,IAAI;IACJC,UAAU;IACVN;EACF,CAAC,CAAC,EACF,CAACE,OAAO,EAAEN,KAAK,EAAEK,KAAK,EAAEI,IAAI,EAAEC,UAAU,EAAEN,WAAW,CAAC,CACvD;EAED,oBACE;IACE,GAAG,EAAEC,KAAM;IACX,SAAS,EAAER,UAAU,CAAC,cAAc,EAAE;MACpCG,KAAK;MACLG,KAAK;MACLD;IACF,CAAC,CAAE;IACH,GAAG,EAAEK;EAAW,GAEf,CAACP,KAAK,IAAIW,YAAY,EACtBH,UAAU,CAACS,eAAe,CAAC,CACzB;AAET;AAEAnB,QAAQ,CAACqB,WAAW,GAAG,UAAU"}
@@ -0,0 +1,4 @@
1
+ import { KeyboardCoordinateGetter } from '@dnd-kit/core';
2
+ import type { SensorContext } from './types';
3
+ export declare function sortableTreeKeyboardCoordinates(context: SensorContext, indicator: boolean, indentationWidth: number): KeyboardCoordinateGetter;
4
+ //# sourceMappingURL=keyboardCoordinates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboardCoordinates.d.ts","sourceRoot":"","sources":["../../../../src/sidebar/visibility-ordering-builder/sortable-tree/keyboardCoordinates.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,wBAAwB,EAEzB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAY7C,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,OAAO,EAClB,gBAAgB,EAAE,MAAM,GACvB,wBAAwB,CAsI1B"}
@@ -0,0 +1,127 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+ 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; }
3
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ /* eslint-disable import/prefer-default-export */
5
+ import { closestCorners, getFirstCollision, KeyboardCode } from '@dnd-kit/core';
6
+ import { getProjection } from "./utilities.js";
7
+ var DIRECTIONS = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];
8
+ var HORIZONTAL = [KeyboardCode.Left, KeyboardCode.Right];
9
+ export function sortableTreeKeyboardCoordinates(context, indicator, indentationWidth) {
10
+ return (event, _ref) => {
11
+ var {
12
+ currentCoordinates,
13
+ context: {
14
+ active,
15
+ over,
16
+ collisionRect,
17
+ droppableRects,
18
+ droppableContainers
19
+ }
20
+ } = _ref;
21
+ if (DIRECTIONS.includes(event.code)) {
22
+ if (!active || !collisionRect) {
23
+ return;
24
+ }
25
+ event.preventDefault();
26
+ var {
27
+ current: {
28
+ items,
29
+ offset
30
+ }
31
+ } = context;
32
+ if (HORIZONTAL.includes(event.code) && (over === null || over === void 0 ? void 0 : over.id) != null) {
33
+ var {
34
+ depth,
35
+ maxDepth,
36
+ minDepth
37
+ } = getProjection(items, active.id, over.id, offset, indentationWidth);
38
+ switch (event.code) {
39
+ case KeyboardCode.Left:
40
+ if (depth > minDepth) {
41
+ return _objectSpread(_objectSpread({}, currentCoordinates), {}, {
42
+ x: currentCoordinates.x - indentationWidth
43
+ });
44
+ }
45
+ break;
46
+ case KeyboardCode.Right:
47
+ if (depth < maxDepth) {
48
+ return _objectSpread(_objectSpread({}, currentCoordinates), {}, {
49
+ x: currentCoordinates.x + indentationWidth
50
+ });
51
+ }
52
+ break;
53
+ }
54
+ return undefined;
55
+ }
56
+ var containers = [];
57
+ droppableContainers.forEach(container => {
58
+ if (container !== null && container !== void 0 && container.disabled || container.id === (over === null || over === void 0 ? void 0 : over.id)) {
59
+ return;
60
+ }
61
+ var rect = droppableRects.get(container.id);
62
+ if (!rect) {
63
+ return;
64
+ }
65
+ switch (event.code) {
66
+ case KeyboardCode.Down:
67
+ if (collisionRect.top < rect.top) {
68
+ containers.push(container);
69
+ }
70
+ break;
71
+ case KeyboardCode.Up:
72
+ if (collisionRect.top > rect.top) {
73
+ containers.push(container);
74
+ }
75
+ break;
76
+ }
77
+ });
78
+ var collisions = closestCorners({
79
+ active,
80
+ collisionRect,
81
+ pointerCoordinates: null,
82
+ droppableRects,
83
+ droppableContainers: containers
84
+ });
85
+ var closestId = getFirstCollision(collisions, 'id');
86
+ if (closestId === (over === null || over === void 0 ? void 0 : over.id) && collisions.length > 1) {
87
+ closestId = collisions[1].id;
88
+ }
89
+ if (closestId != null && (over === null || over === void 0 ? void 0 : over.id) != null) {
90
+ var activeRect = droppableRects.get(active.id);
91
+ var newRect = droppableRects.get(closestId);
92
+ var newDroppable = droppableContainers.get(closestId);
93
+ if (activeRect && newRect && newDroppable) {
94
+ var newIndex = items.findIndex(_ref2 => {
95
+ var {
96
+ id
97
+ } = _ref2;
98
+ return id === closestId;
99
+ });
100
+ var newItem = items[newIndex];
101
+ var activeIndex = items.findIndex(_ref3 => {
102
+ var {
103
+ id
104
+ } = _ref3;
105
+ return id === active.id;
106
+ });
107
+ var activeItem = items[activeIndex];
108
+ if (newItem != null && activeItem != null) {
109
+ var {
110
+ depth: _depth
111
+ } = getProjection(items, active.id, closestId, (newItem.depth - activeItem.depth) * indentationWidth, indentationWidth);
112
+ var isBelow = newIndex > activeIndex;
113
+ var modifier = isBelow ? 1 : -1;
114
+ var nextOffset = indicator ? (collisionRect.height - activeRect.height) / 2 : 0;
115
+ var newCoordinates = {
116
+ x: newRect.left + _depth * indentationWidth,
117
+ y: newRect.top + modifier * nextOffset
118
+ };
119
+ return newCoordinates;
120
+ }
121
+ }
122
+ }
123
+ }
124
+ return undefined;
125
+ };
126
+ }
127
+ //# sourceMappingURL=keyboardCoordinates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboardCoordinates.js","names":["closestCorners","getFirstCollision","KeyboardCode","getProjection","DIRECTIONS","Down","Right","Up","Left","HORIZONTAL","sortableTreeKeyboardCoordinates","context","indicator","indentationWidth","event","currentCoordinates","active","over","collisionRect","droppableRects","droppableContainers","includes","code","preventDefault","current","items","offset","id","depth","maxDepth","minDepth","x","undefined","containers","forEach","container","disabled","rect","get","top","push","collisions","pointerCoordinates","closestId","length","activeRect","newRect","newDroppable","newIndex","findIndex","newItem","activeIndex","activeItem","isBelow","modifier","nextOffset","height","newCoordinates","left","y"],"sources":["../../../../src/sidebar/visibility-ordering-builder/sortable-tree/keyboardCoordinates.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\nimport {\n closestCorners,\n getFirstCollision,\n KeyboardCode,\n KeyboardCoordinateGetter,\n DroppableContainer,\n} from '@dnd-kit/core';\nimport type { SensorContext } from './types';\nimport { getProjection } from './utilities';\n\nconst DIRECTIONS: string[] = [\n KeyboardCode.Down,\n KeyboardCode.Right,\n KeyboardCode.Up,\n KeyboardCode.Left,\n];\n\nconst HORIZONTAL: string[] = [KeyboardCode.Left, KeyboardCode.Right];\n\nexport function sortableTreeKeyboardCoordinates(\n context: SensorContext,\n indicator: boolean,\n indentationWidth: number\n): KeyboardCoordinateGetter {\n return (\n event,\n {\n currentCoordinates,\n context: {\n active,\n over,\n collisionRect,\n droppableRects,\n droppableContainers,\n },\n }\n ) => {\n if (DIRECTIONS.includes(event.code)) {\n if (!active || !collisionRect) {\n return;\n }\n\n event.preventDefault();\n\n const {\n current: { items, offset },\n } = context;\n\n if (HORIZONTAL.includes(event.code) && over?.id != null) {\n const { depth, maxDepth, minDepth } = getProjection(\n items,\n active.id as string,\n over.id as string,\n offset,\n indentationWidth\n );\n\n switch (event.code) {\n case KeyboardCode.Left:\n if (depth > minDepth) {\n return {\n ...currentCoordinates,\n x: currentCoordinates.x - indentationWidth,\n };\n }\n break;\n case KeyboardCode.Right:\n if (depth < maxDepth) {\n return {\n ...currentCoordinates,\n x: currentCoordinates.x + indentationWidth,\n };\n }\n break;\n }\n\n return undefined;\n }\n\n const containers: DroppableContainer[] = [];\n\n droppableContainers.forEach(container => {\n if (container?.disabled || container.id === over?.id) {\n return;\n }\n\n const rect = droppableRects.get(container.id);\n\n if (!rect) {\n return;\n }\n\n switch (event.code) {\n case KeyboardCode.Down:\n if (collisionRect.top < rect.top) {\n containers.push(container);\n }\n break;\n case KeyboardCode.Up:\n if (collisionRect.top > rect.top) {\n containers.push(container);\n }\n break;\n }\n });\n\n const collisions = closestCorners({\n active,\n collisionRect,\n pointerCoordinates: null,\n droppableRects,\n droppableContainers: containers,\n });\n let closestId = getFirstCollision(collisions, 'id');\n\n if (closestId === over?.id && collisions.length > 1) {\n closestId = collisions[1].id;\n }\n\n if (closestId != null && over?.id != null) {\n const activeRect = droppableRects.get(active.id);\n const newRect = droppableRects.get(closestId);\n const newDroppable = droppableContainers.get(closestId);\n\n if (activeRect && newRect && newDroppable) {\n const newIndex = items.findIndex(({ id }) => id === closestId);\n const newItem = items[newIndex];\n const activeIndex = items.findIndex(({ id }) => id === active.id);\n const activeItem = items[activeIndex];\n\n if (newItem != null && activeItem != null) {\n const { depth } = getProjection(\n items,\n active.id as string,\n closestId as string,\n (newItem.depth - activeItem.depth) * indentationWidth,\n indentationWidth\n );\n const isBelow = newIndex > activeIndex;\n const modifier = isBelow ? 1 : -1;\n const nextOffset = indicator\n ? (collisionRect.height - activeRect.height) / 2\n : 0;\n\n const newCoordinates = {\n x: newRect.left + depth * indentationWidth,\n y: newRect.top + modifier * nextOffset,\n };\n\n return newCoordinates;\n }\n }\n }\n }\n\n return undefined;\n };\n}\n"],"mappings":"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"}
@@ -0,0 +1,20 @@
1
+ import type { MutableRefObject } from 'react';
2
+ export type TreeItem<T = undefined> = {
3
+ id: string;
4
+ children: TreeItem<T>[];
5
+ selected: boolean;
6
+ } & (T extends undefined ? {} : {
7
+ data: T;
8
+ });
9
+ export type TreeItems<T = undefined> = TreeItem<T>[];
10
+ export type FlattenedItem<T = undefined> = TreeItem<T> & {
11
+ parentId: string | null;
12
+ depth: number;
13
+ index: number;
14
+ };
15
+ export declare function isFlattenedTreeItem<T>(item: TreeItem<T>): item is FlattenedItem<T>;
16
+ export type SensorContext = MutableRefObject<{
17
+ items: FlattenedItem[];
18
+ offset: number;
19
+ }>;
20
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/sidebar/visibility-ordering-builder/sortable-tree/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAE9C,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,SAAS,IAAI;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,CAAC,CAAC,SAAS,SAAS,GAEpB,EAAE,GACF;IACE,IAAI,EAAE,CAAC,CAAC;CACT,CAAC,CAAC;AAEP,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;AAErD,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG;IACvD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAChB,IAAI,IAAI,aAAa,CAAC,CAAC,CAAC,CAE1B;AAED,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC;IAC3C,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export function isFlattenedTreeItem(item) {
2
+ return item.parentId !== undefined;
3
+ }
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":["isFlattenedTreeItem","item","parentId","undefined"],"sources":["../../../../src/sidebar/visibility-ordering-builder/sortable-tree/types.ts"],"sourcesContent":["import type { MutableRefObject } from 'react';\n\nexport type TreeItem<T = undefined> = {\n id: string;\n children: TreeItem<T>[];\n selected: boolean;\n} & (T extends undefined\n ? // eslint-disable-next-line @typescript-eslint/ban-types\n {}\n : {\n data: T;\n });\n\nexport type TreeItems<T = undefined> = TreeItem<T>[];\n\nexport type FlattenedItem<T = undefined> = TreeItem<T> & {\n parentId: string | null;\n depth: number;\n index: number;\n};\n\nexport function isFlattenedTreeItem<T>(\n item: TreeItem<T>\n): item is FlattenedItem<T> {\n return (item as FlattenedItem<T>).parentId !== undefined;\n}\n\nexport type SensorContext = MutableRefObject<{\n items: FlattenedItem[];\n offset: number;\n}>;\n"],"mappings":"AAqBA,OAAO,SAASA,mBAAmB,CACjCC,IAAiB,EACS;EAC1B,OAAQA,IAAI,CAAsBC,QAAQ,KAAKC,SAAS;AAC1D"}
@@ -0,0 +1,55 @@
1
+ import type { Column } from '@deephaven/jsapi-shim';
2
+ import { ModelSizeMap, MoveOperation } from '@deephaven/grid';
3
+ import type ColumnHeaderGroup from '../../../ColumnHeaderGroup';
4
+ import type { FlattenedItem, TreeItem, TreeItems } from './types';
5
+ interface IrisGridTreeItemData {
6
+ modelIndex: number | number[];
7
+ visibleIndex: number | [number, number];
8
+ isVisible: boolean;
9
+ group?: ColumnHeaderGroup;
10
+ }
11
+ export type IrisGridTreeItem = TreeItem<IrisGridTreeItemData>;
12
+ export type FlattenedIrisGridTreeItem = FlattenedItem<IrisGridTreeItemData>;
13
+ export declare function getTreeItems(columns: Column[], movedColumns: MoveOperation[], columnHeaderGroups: ColumnHeaderGroup[], userColumnWidths: ModelSizeMap, selectedItems: string[]): IrisGridTreeItem[];
14
+ /**
15
+ * Gets the projected drop position and depth of the dragged item
16
+ *
17
+ * @param items List of flattened items
18
+ * @param activeId ID of the actively dragged item
19
+ * @param overId ID of the item currently being dragged over
20
+ * @param dragOffset The x-axis offset of the dragged item
21
+ * @param indentationWidth The width for each level of the tree
22
+ * @returns The projected position and depth if the item were to be dropped
23
+ */
24
+ export declare function getProjection(items: FlattenedItem[], activeId: string, overId: string, dragOffset: number, indentationWidth: number): {
25
+ depth: number;
26
+ maxDepth: number;
27
+ minDepth: number;
28
+ parentId: string | null;
29
+ };
30
+ /**
31
+ * Flattens a tree into a 1D array given the items
32
+ * @param items The tree items to flatten
33
+ * @returns The flattened tree items list
34
+ */
35
+ export declare function flattenTree<T>(items: TreeItems<T>): FlattenedItem<T>[];
36
+ /**
37
+ * Recursively checks for the item in a list of items.
38
+ * The list does not have to be flattened prior to searching.
39
+ *
40
+ * @param items Items to search
41
+ * @param itemId Item to find
42
+ * @returns The item if found
43
+ */
44
+ export declare function findItemDeep(items: TreeItems, itemId: string): TreeItem | undefined;
45
+ export declare function getChildCount(items: TreeItems, id: string): number;
46
+ /**
47
+ * Removes the children of the list of parents from the list of flattened items
48
+ *
49
+ * @param items The flattened items to remove from
50
+ * @param ids The parents we want to remove the children of
51
+ * @returns The flattened items without the children of the parents
52
+ */
53
+ export declare function removeChildrenOf<T>(items: FlattenedItem<T>[], ids: string[]): FlattenedItem<T>[];
54
+ export {};
55
+ //# sourceMappingURL=utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../../src/sidebar/visibility-ordering-builder/sortable-tree/utilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAa,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,iBAAiB,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAalE,UAAU,oBAAoB;IAC5B,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,YAAY,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B;AAED,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;AAE9D,MAAM,MAAM,yBAAyB,GAAG,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAoE5E,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,aAAa,EAAE,EAC7B,kBAAkB,EAAE,iBAAiB,EAAE,EACvC,gBAAgB,EAAE,YAAY,EAC9B,aAAa,EAAE,MAAM,EAAE,GACtB,gBAAgB,EAAE,CAsCpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,aAAa,EAAE,EACtB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,MAAM;;;;;EA6CzB;AA2CD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,CAMtE;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,GACb,QAAQ,GAAG,SAAS,CAmBtB;AAYD,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAIlE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,EACzB,GAAG,EAAE,MAAM,EAAE,GACZ,aAAa,CAAC,CAAC,CAAC,EAAE,CAapB"}