@vitrosoftware/common-ui-ts 1.0.9 → 1.0.10

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.
@@ -54,4 +54,11 @@
54
54
  :global(.vitro-tableview-progress-message.vitro-table-view-export-message) {
55
55
  background-color: #fff;
56
56
  border: 1px solid #ff5b2d !important;
57
+ }
58
+
59
+ :global(.table-view-custom-date-edit) {
60
+ width: 512px;
61
+ position: absolute;
62
+ top: 57px;
63
+ z-index: 10000;
57
64
  }
@@ -43,7 +43,13 @@
43
43
  }
44
44
 
45
45
  .TWDataRow td {
46
- padding: 1px 3px 0px 3px !important;
46
+ padding-top: 1px !important;
47
+ padding-right: 3px !important;
48
+ padding-bottom: 0px !important;
49
+ }
50
+
51
+ .TWLow .TWIconLeft {
52
+ padding-left: 24px !important;
47
53
  }
48
54
 
49
55
  .TWFillRow {
@@ -49,11 +49,23 @@ export interface TableViewContext {
49
49
  getFirst(row?: TableViewRow, type?: number): TableViewRow;
50
50
  endEdit(editResult: boolean): any;
51
51
  expandRow(row: TableViewRow): void;
52
- getCell(row: TableViewRow, col: TableViewCol | string): void;
52
+ getCell(row: TableViewRow, col: TableViewCol | string): any;
53
53
  getFRow(): TableViewRow;
54
54
  getFCol(): TableViewCol;
55
55
  startEdit(): void;
56
56
  export(): void;
57
57
  print(): void;
58
58
  isVisibleGantt(): boolean;
59
+ setAttribute(row: TableViewRow, col: string, attribute: string, value: any, refresh: boolean, undo?: boolean): void;
60
+ getRows(): {
61
+ [key: string]: TableViewRow;
62
+ };
63
+ getMainTag(): any;
64
+ focusCell(row: TableViewRow, col: string): void;
65
+ getType(row: TableViewRow, col: string): string;
66
+ setStringEdit(row: TableViewRow, col: string, value: string, timeout?: boolean): void;
67
+ getValue(row: TableViewRow, col: string): any;
68
+ getFocusedCols(): any[];
69
+ getFocusedRows(): any[];
70
+ getFilter(spec: boolean): any[];
59
71
  }
@@ -64,4 +64,16 @@ export declare class TreeGridTableViewContextImpl implements TableViewContext {
64
64
  export(): void;
65
65
  print(): void;
66
66
  isVisibleGantt(): boolean;
67
+ setAttribute(row: TableViewRow, col: string, attribute: string, value: any, refresh: boolean, undo?: boolean): void;
68
+ getRows(): {
69
+ [key: string]: TableViewRow;
70
+ };
71
+ getMainTag(): any;
72
+ focusCell(row: TableViewRow, col: string): void;
73
+ getType(row: TableViewRow, col: string): string;
74
+ setStringEdit(row: TableViewRow, col: string, value: string, timeout?: boolean): void;
75
+ getValue(row: TableViewRow, col: string): any;
76
+ getFocusedCols(): any[];
77
+ getFocusedRows(): any[];
78
+ getFilter(spec: boolean): any[];
67
79
  }
package/dist/index.css CHANGED
@@ -511,6 +511,13 @@
511
511
  .vitro-tableview-progress-message.vitro-table-view-export-message {
512
512
  background-color: #fff;
513
513
  border: 1px solid #ff5b2d !important;
514
+ }
515
+
516
+ .table-view-custom-date-edit {
517
+ width: 512px;
518
+ position: absolute;
519
+ top: 57px;
520
+ z-index: 10000;
514
521
  }
515
522
 
516
523
  ._uploader_vitro-uploader_1frFGu3 {
package/dist/index.js CHANGED
@@ -20219,6 +20219,36 @@ var TreeGridTableViewContextImpl = /*#__PURE__*/function () {
20219
20219
  _proto.isVisibleGantt = function isVisibleGantt() {
20220
20220
  return this.grid.Cols.gantt.Visible;
20221
20221
  };
20222
+ _proto.setAttribute = function setAttribute(row, col, attribute, value, refresh, undo) {
20223
+ this.grid.SetAttribute(row, col, attribute, value, refresh, undo);
20224
+ };
20225
+ _proto.getRows = function getRows() {
20226
+ return this.grid.Rows;
20227
+ };
20228
+ _proto.getMainTag = function getMainTag() {
20229
+ return this.grid.MainTag;
20230
+ };
20231
+ _proto.focusCell = function focusCell(row, col) {
20232
+ this.grid.Focus(row, col);
20233
+ };
20234
+ _proto.getType = function getType(row, col) {
20235
+ return this.grid.GetType(row, col);
20236
+ };
20237
+ _proto.setStringEdit = function setStringEdit(row, col, value, timeout) {
20238
+ this.grid.SetStringEdit(row, col, value, timeout);
20239
+ };
20240
+ _proto.getValue = function getValue(row, col) {
20241
+ return this.grid.GetValue(row, col);
20242
+ };
20243
+ _proto.getFocusedCols = function getFocusedCols() {
20244
+ return this.grid.GetFocusedCols();
20245
+ };
20246
+ _proto.getFocusedRows = function getFocusedRows() {
20247
+ return this.grid.GetFocusedRows();
20248
+ };
20249
+ _proto.getFilter = function getFilter(spec) {
20250
+ return this.grid.GetFilter(spec);
20251
+ };
20222
20252
  _createClass(TreeGridTableViewContextImpl, [{
20223
20253
  key: "columnList",
20224
20254
  get: function get() {
@@ -54643,17 +54673,7 @@ function effect(_ref2) {
54643
54673
  }
54644
54674
  }
54645
54675
 
54646
- if (process.env.NODE_ENV !== "production") {
54647
- if (!isHTMLElement(arrowElement)) {
54648
- console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));
54649
- }
54650
- }
54651
-
54652
54676
  if (!contains(state.elements.popper, arrowElement)) {
54653
- if (process.env.NODE_ENV !== "production") {
54654
- console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' '));
54655
- }
54656
-
54657
54677
  return;
54658
54678
  }
54659
54679
 
@@ -54795,17 +54815,6 @@ function computeStyles(_ref5) {
54795
54815
  adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
54796
54816
  _options$roundOffsets = options.roundOffsets,
54797
54817
  roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
54798
-
54799
- if (process.env.NODE_ENV !== "production") {
54800
- var transitionProperty = getComputedStyle$1(state.elements.popper).transitionProperty || '';
54801
-
54802
- if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {
54803
- return transitionProperty.indexOf(property) >= 0;
54804
- })) {
54805
- console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));
54806
- }
54807
- }
54808
-
54809
54818
  var commonStyles = {
54810
54819
  placement: getBasePlacement(state.placement),
54811
54820
  variation: getVariation(state.placement),
@@ -55246,10 +55255,6 @@ function computeAutoPlacement(state, options) {
55246
55255
 
55247
55256
  if (allowedPlacements.length === 0) {
55248
55257
  allowedPlacements = placements$1;
55249
-
55250
- if (process.env.NODE_ENV !== "production") {
55251
- console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' '));
55252
- }
55253
55258
  } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
55254
55259
 
55255
55260
 
@@ -55801,108 +55806,6 @@ function debounce(fn) {
55801
55806
  };
55802
55807
  }
55803
55808
 
55804
- function format(str) {
55805
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
55806
- args[_key - 1] = arguments[_key];
55807
- }
55808
-
55809
- return [].concat(args).reduce(function (p, c) {
55810
- return p.replace(/%s/, c);
55811
- }, str);
55812
- }
55813
-
55814
- var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
55815
- var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
55816
- var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];
55817
- function validateModifiers(modifiers) {
55818
- modifiers.forEach(function (modifier) {
55819
- [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)`
55820
- .filter(function (value, index, self) {
55821
- return self.indexOf(value) === index;
55822
- }).forEach(function (key) {
55823
- switch (key) {
55824
- case 'name':
55825
- if (typeof modifier.name !== 'string') {
55826
- console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\""));
55827
- }
55828
-
55829
- break;
55830
-
55831
- case 'enabled':
55832
- if (typeof modifier.enabled !== 'boolean') {
55833
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\""));
55834
- }
55835
-
55836
- break;
55837
-
55838
- case 'phase':
55839
- if (modifierPhases.indexOf(modifier.phase) < 0) {
55840
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\""));
55841
- }
55842
-
55843
- break;
55844
-
55845
- case 'fn':
55846
- if (typeof modifier.fn !== 'function') {
55847
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\""));
55848
- }
55849
-
55850
- break;
55851
-
55852
- case 'effect':
55853
- if (modifier.effect != null && typeof modifier.effect !== 'function') {
55854
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\""));
55855
- }
55856
-
55857
- break;
55858
-
55859
- case 'requires':
55860
- if (modifier.requires != null && !Array.isArray(modifier.requires)) {
55861
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\""));
55862
- }
55863
-
55864
- break;
55865
-
55866
- case 'requiresIfExists':
55867
- if (!Array.isArray(modifier.requiresIfExists)) {
55868
- console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\""));
55869
- }
55870
-
55871
- break;
55872
-
55873
- case 'options':
55874
- case 'data':
55875
- break;
55876
-
55877
- default:
55878
- console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) {
55879
- return "\"" + s + "\"";
55880
- }).join(', ') + "; but \"" + key + "\" was provided.");
55881
- }
55882
-
55883
- modifier.requires && modifier.requires.forEach(function (requirement) {
55884
- if (modifiers.find(function (mod) {
55885
- return mod.name === requirement;
55886
- }) == null) {
55887
- console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
55888
- }
55889
- });
55890
- });
55891
- });
55892
- }
55893
-
55894
- function uniqueBy(arr, fn) {
55895
- var identifiers = new Set();
55896
- return arr.filter(function (item) {
55897
- var identifier = fn(item);
55898
-
55899
- if (!identifiers.has(identifier)) {
55900
- identifiers.add(identifier);
55901
- return true;
55902
- }
55903
- });
55904
- }
55905
-
55906
55809
  function mergeByName(modifiers) {
55907
55810
  var merged = modifiers.reduce(function (merged, current) {
55908
55811
  var existing = merged[current.name];
@@ -55918,8 +55821,6 @@ function mergeByName(modifiers) {
55918
55821
  });
55919
55822
  }
55920
55823
 
55921
- var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
55922
- var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';
55923
55824
  var DEFAULT_OPTIONS = {
55924
55825
  placement: 'bottom',
55925
55826
  modifiers: [],
@@ -55981,42 +55882,7 @@ function popperGenerator(generatorOptions) {
55981
55882
 
55982
55883
  state.orderedModifiers = orderedModifiers.filter(function (m) {
55983
55884
  return m.enabled;
55984
- }); // Validate the provided modifiers so that the consumer will get warned
55985
- // if one of the modifiers is invalid for any reason
55986
-
55987
- if (process.env.NODE_ENV !== "production") {
55988
- var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {
55989
- var name = _ref.name;
55990
- return name;
55991
- });
55992
- validateModifiers(modifiers);
55993
-
55994
- if (getBasePlacement(state.options.placement) === auto) {
55995
- var flipModifier = state.orderedModifiers.find(function (_ref2) {
55996
- var name = _ref2.name;
55997
- return name === 'flip';
55998
- });
55999
-
56000
- if (!flipModifier) {
56001
- console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' '));
56002
- }
56003
- }
56004
-
56005
- var _getComputedStyle = getComputedStyle$1(popper),
56006
- marginTop = _getComputedStyle.marginTop,
56007
- marginRight = _getComputedStyle.marginRight,
56008
- marginBottom = _getComputedStyle.marginBottom,
56009
- marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can
56010
- // cause bugs with positioning, so we'll warn the consumer
56011
-
56012
-
56013
- if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {
56014
- return parseFloat(margin);
56015
- })) {
56016
- console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));
56017
- }
56018
- }
56019
-
55885
+ });
56020
55886
  runModifierEffects();
56021
55887
  return instance.update();
56022
55888
  },
@@ -56036,10 +55902,6 @@ function popperGenerator(generatorOptions) {
56036
55902
  // anymore
56037
55903
 
56038
55904
  if (!areValidElements(reference, popper)) {
56039
- if (process.env.NODE_ENV !== "production") {
56040
- console.error(INVALID_ELEMENT_ERROR);
56041
- }
56042
-
56043
55905
  return;
56044
55906
  } // Store the reference and popper rects to be read by modifiers
56045
55907
 
@@ -56062,18 +55924,8 @@ function popperGenerator(generatorOptions) {
56062
55924
  state.orderedModifiers.forEach(function (modifier) {
56063
55925
  return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
56064
55926
  });
56065
- var __debug_loops__ = 0;
56066
55927
 
56067
55928
  for (var index = 0; index < state.orderedModifiers.length; index++) {
56068
- if (process.env.NODE_ENV !== "production") {
56069
- __debug_loops__ += 1;
56070
-
56071
- if (__debug_loops__ > 100) {
56072
- console.error(INFINITE_LOOP_ERROR);
56073
- break;
56074
- }
56075
- }
56076
-
56077
55929
  if (state.reset === true) {
56078
55930
  state.reset = false;
56079
55931
  index = -1;
@@ -56111,10 +55963,6 @@ function popperGenerator(generatorOptions) {
56111
55963
  };
56112
55964
 
56113
55965
  if (!areValidElements(reference, popper)) {
56114
- if (process.env.NODE_ENV !== "production") {
56115
- console.error(INVALID_ELEMENT_ERROR);
56116
- }
56117
-
56118
55966
  return instance;
56119
55967
  }
56120
55968
 
@@ -56129,11 +55977,11 @@ function popperGenerator(generatorOptions) {
56129
55977
  // one.
56130
55978
 
56131
55979
  function runModifierEffects() {
56132
- state.orderedModifiers.forEach(function (_ref3) {
56133
- var name = _ref3.name,
56134
- _ref3$options = _ref3.options,
56135
- options = _ref3$options === void 0 ? {} : _ref3$options,
56136
- effect = _ref3.effect;
55980
+ state.orderedModifiers.forEach(function (_ref) {
55981
+ var name = _ref.name,
55982
+ _ref$options = _ref.options,
55983
+ options = _ref$options === void 0 ? {} : _ref$options,
55984
+ effect = _ref.effect;
56137
55985
 
56138
55986
  if (typeof effect === 'function') {
56139
55987
  var cleanupFn = effect({
@@ -56445,12 +56293,16 @@ function useClickOutside(ref, onClickOutside = noop$1, {
56445
56293
  }
56446
56294
  });
56447
56295
  React.useEffect(() => {
56296
+ var _ownerWindow$event, _ownerWindow$parent;
56448
56297
  if (disabled || ref == null) return undefined;
56449
56298
  const doc = ownerDocument(getRefTarget(ref));
56299
+ const ownerWindow = doc.defaultView || window;
56450
56300
 
56451
56301
  // Store the current event to avoid triggering handlers immediately
56302
+ // For things rendered in an iframe, the event might originate on the parent window
56303
+ // so we should fall back to that global event if the local one doesn't exist
56452
56304
  // https://github.com/facebook/react/issues/20074
56453
- let currentEvent = (doc.defaultView || window).event;
56305
+ let currentEvent = (_ownerWindow$event = ownerWindow.event) != null ? _ownerWindow$event : (_ownerWindow$parent = ownerWindow.parent) == null ? void 0 : _ownerWindow$parent.event;
56454
56306
  let removeInitialTriggerListener = null;
56455
56307
  if (InitialTriggerEvents[clickTrigger]) {
56456
56308
  removeInitialTriggerListener = listen(doc, InitialTriggerEvents[clickTrigger], handleInitialMouse, true);