dtable-ui-component 0.1.84 → 0.1.85

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 (115) hide show
  1. package/lib/DTablePopover/index.js +115 -0
  2. package/lib/DTablePopover/utils.js +5 -0
  3. package/lib/DTableSelect/index.js +140 -0
  4. package/lib/DTableSwitch/index.js +27 -0
  5. package/lib/FormulaFormatter/index.js +7 -7
  6. package/lib/index.js +5 -1
  7. package/package.json +2 -1
  8. package/es/app.css +0 -20
  9. package/es/app.js +0 -91
  10. package/es/assets/images/avatar/default_avatar.png +0 -0
  11. package/es/assets/images/file/192/excel.png +0 -0
  12. package/es/assets/images/file/192/file.png +0 -0
  13. package/es/assets/images/file/192/music.png +0 -0
  14. package/es/assets/images/file/192/pdf.png +0 -0
  15. package/es/assets/images/file/192/pic.png +0 -0
  16. package/es/assets/images/file/192/ppt.png +0 -0
  17. package/es/assets/images/file/192/txt.png +0 -0
  18. package/es/assets/images/file/192/video.png +0 -0
  19. package/es/assets/images/file/192/word.png +0 -0
  20. package/es/assets/images/file/24/excel.png +0 -0
  21. package/es/assets/images/file/24/file.png +0 -0
  22. package/es/assets/images/file/24/music.png +0 -0
  23. package/es/assets/images/file/24/pdf.png +0 -0
  24. package/es/assets/images/file/24/pic.png +0 -0
  25. package/es/assets/images/file/24/ppt.png +0 -0
  26. package/es/assets/images/file/24/txt.png +0 -0
  27. package/es/assets/images/file/24/video.png +0 -0
  28. package/es/assets/images/file/24/word.png +0 -0
  29. package/es/assets/images/folder/folder-192.png +0 -0
  30. package/es/assets/images/folder/folder-24.png +0 -0
  31. package/es/components/cell-editor/checkbox-editor.js +0 -104
  32. package/es/components/cell-editor/collaborator-editor.js +0 -236
  33. package/es/components/cell-editor/date-editor.js +0 -151
  34. package/es/components/cell-editor/index.js +0 -9
  35. package/es/components/cell-editor/link-editor.js +0 -303
  36. package/es/components/cell-editor/multiple-select-editor.js +0 -237
  37. package/es/components/cell-editor/number-editor.js +0 -154
  38. package/es/components/cell-editor/single-select-editor.js +0 -202
  39. package/es/components/cell-editor/text-editor.js +0 -122
  40. package/es/components/cell-editor-dialog/pc-file-editor-dialog.js +0 -46
  41. package/es/components/cell-editor-dialog/pc-files-addition/index.js +0 -0
  42. package/es/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -0
  43. package/es/components/cell-editor-dialog/pc-files-preview/index.js +0 -0
  44. package/es/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -0
  45. package/es/components/cell-editor-popover/mb-collaborator-editor-popover.js +0 -177
  46. package/es/components/cell-editor-popover/mb-date-editor-popover.js +0 -245
  47. package/es/components/cell-editor-popover/mb-link-editor-popover.js +0 -170
  48. package/es/components/cell-editor-popover/mb-select-editor-popover.js +0 -230
  49. package/es/components/cell-editor-popover/pc-collaborator-editor-popover.js +0 -109
  50. package/es/components/cell-editor-popover/pc-date-editor-popover.js +0 -142
  51. package/es/components/cell-editor-popover/pc-link-editor-popover.js +0 -114
  52. package/es/components/cell-editor-popover/pc-select-editor-popover.js +0 -143
  53. package/es/components/cell-factory/cell-formatter-factory.js +0 -25
  54. package/es/components/cell-formatter/auto-number-formatter.js +0 -35
  55. package/es/components/cell-formatter/button-formatter.js +0 -55
  56. package/es/components/cell-formatter/checkbox-formatter.js +0 -44
  57. package/es/components/cell-formatter/collaborator-formatter.js +0 -91
  58. package/es/components/cell-formatter/creator-formatter.js +0 -87
  59. package/es/components/cell-formatter/ctime-formatter.js +0 -57
  60. package/es/components/cell-formatter/date-formatter.js +0 -59
  61. package/es/components/cell-formatter/duration-formatter.js +0 -37
  62. package/es/components/cell-formatter/email-formatter.js +0 -35
  63. package/es/components/cell-formatter/file-formatter.js +0 -63
  64. package/es/components/cell-formatter/formatter-config.js +0 -31
  65. package/es/components/cell-formatter/formula-formatter.js +0 -164
  66. package/es/components/cell-formatter/geolocation-formatter.js +0 -52
  67. package/es/components/cell-formatter/image-formatter.js +0 -153
  68. package/es/components/cell-formatter/index.js +0 -27
  69. package/es/components/cell-formatter/last-modifier-formatter.js +0 -87
  70. package/es/components/cell-formatter/link-formatter.js +0 -144
  71. package/es/components/cell-formatter/long-text-formatter.js +0 -106
  72. package/es/components/cell-formatter/mtime-formatter.js +0 -57
  73. package/es/components/cell-formatter/multiple-select-formatter.js +0 -69
  74. package/es/components/cell-formatter/number-formatter.js +0 -46
  75. package/es/components/cell-formatter/rate-formatter.js +0 -79
  76. package/es/components/cell-formatter/single-select-formatter.js +0 -69
  77. package/es/components/cell-formatter/text-formatter.js +0 -55
  78. package/es/components/cell-formatter/url-formatter.js +0 -35
  79. package/es/components/cell-formatter/widgets/file-item-formatter.js +0 -50
  80. package/es/components/cell-formatter/widgets/image-previewer-lightbox.js +0 -119
  81. package/es/components/common/collaborator-item.js +0 -63
  82. package/es/components/common/edit-editor-button.js +0 -56
  83. package/es/components/common/images-lazy-load.js +0 -150
  84. package/es/components/common/link-editor-option.js +0 -113
  85. package/es/components/common/mobile/mb-editor-header.js +0 -48
  86. package/es/components/common/modal-portal.js +0 -44
  87. package/es/components/common/select-editor-option.js +0 -106
  88. package/es/components/common/select-item.js +0 -58
  89. package/es/components/file-uploader/index.js +0 -53
  90. package/es/components/loading.js +0 -7
  91. package/es/components/toast/alert.js +0 -150
  92. package/es/components/toast/index.js +0 -3
  93. package/es/components/toast/toast.js +0 -179
  94. package/es/components/toast/toastManager.js +0 -170
  95. package/es/components/toast/toaster.js +0 -76
  96. package/es/constants/cell-types.js +0 -25
  97. package/es/constants/index.js +0 -48
  98. package/es/css/cell-editor.css +0 -614
  99. package/es/css/cell-formatter.css +0 -241
  100. package/es/css/custom-rc-calendar.css +0 -118
  101. package/es/css/image-previewer-ligntbox.css +0 -87
  102. package/es/css/loading.css +0 -54
  103. package/es/index.js +0 -6
  104. package/es/lang/index.js +0 -50
  105. package/es/locals/de.js +0 -2
  106. package/es/locals/en.js +0 -17
  107. package/es/locals/fr.js +0 -2
  108. package/es/locals/zh-CN.js +0 -17
  109. package/es/utils/cell-value-validator.js +0 -32
  110. package/es/utils/column-utils.js +0 -7
  111. package/es/utils/editor-utils.js +0 -71
  112. package/es/utils/normalize-long-text-value.js +0 -68
  113. package/es/utils/number-precision.js +0 -163
  114. package/es/utils/utils.js +0 -116
  115. package/es/utils/value-format-utils.js +0 -495
@@ -1,170 +0,0 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
4
- import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
5
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
6
- import _createClass from "@babel/runtime/helpers/esm/createClass";
7
- import _inherits from "@babel/runtime/helpers/esm/inherits";
8
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
9
- var _excluded = ["id", "description"];
10
- import React from 'react';
11
- import { css } from 'glamor';
12
- import Toast from './toast';
13
- var wrapperClass = css({
14
- maxWidth: 560,
15
- margin: '0 auto',
16
- top: 0,
17
- left: 0,
18
- right: 0,
19
- position: 'fixed',
20
- zIndex: 999999
21
- });
22
-
23
- var hasCustomId = function hasCustomId(settings) {
24
- return Object.hasOwnProperty.call(settings, 'id');
25
- };
26
-
27
- var ToastManager = /*#__PURE__*/function (_React$PureComponent) {
28
- _inherits(ToastManager, _React$PureComponent);
29
-
30
- var _super = _createSuper(ToastManager);
31
-
32
- function ToastManager(props, context) {
33
- var _this;
34
-
35
- _classCallCheck(this, ToastManager);
36
-
37
- _this = _super.call(this, props, context);
38
-
39
- _this.getToasts = function () {
40
- return _this.state.toasts;
41
- };
42
-
43
- _this.closeAll = function () {
44
- _this.getToasts().forEach(function (toast) {
45
- return toast.close();
46
- });
47
- };
48
-
49
- _this.notify = function (title, settings) {
50
- // If there's a custom toast ID passed, close existing toasts with the same custom ID
51
- if (hasCustomId(settings)) {
52
- var _iterator = _createForOfIteratorHelper(_this.state.toasts),
53
- _step;
54
-
55
- try {
56
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
57
- var toast = _step.value;
58
-
59
- // Since unique ID is still appended to a custom ID, skip the unique ID and check only prefix
60
- if (String(toast.id).startsWith(settings.id)) {
61
- _this.closeToast(toast.id);
62
- }
63
- }
64
- } catch (err) {
65
- _iterator.e(err);
66
- } finally {
67
- _iterator.f();
68
- }
69
- }
70
-
71
- var instance = _this.createToastInstance(title, settings);
72
-
73
- _this.setState(function (previousState) {
74
- return {
75
- toasts: [instance].concat(_toConsumableArray(previousState.toasts))
76
- };
77
- });
78
-
79
- return instance;
80
- };
81
-
82
- _this.createToastInstance = function (title, settings) {
83
- var uniqueId = ++ToastManager.idCounter;
84
- var id = hasCustomId(settings) ? "".concat(settings.id, "-").concat(uniqueId) : uniqueId;
85
- var hasCloseButton = settings.hasCloseButton || true;
86
- var duration = settings.duration || 2;
87
-
88
- if (settings.hasCloseButton !== undefined) {
89
- hasCloseButton = settings.hasCloseButton;
90
- }
91
-
92
- if (settings.duration !== undefined) {
93
- duration = settings.duration;
94
- }
95
-
96
- return {
97
- id: id,
98
- title: title,
99
- description: settings.description,
100
- hasCloseButton: hasCloseButton,
101
- duration: duration,
102
- close: function close() {
103
- return _this.closeToast(id);
104
- },
105
- intent: settings.intent
106
- };
107
- };
108
-
109
- _this.closeToast = function (id) {
110
- _this.setState(function (previousState) {
111
- return {
112
- toasts: previousState.toasts.map(function (toast) {
113
- if (toast.id === id) {
114
- return _objectSpread(_objectSpread({}, toast), {}, {
115
- isShown: false
116
- });
117
- }
118
-
119
- return toast;
120
- })
121
- };
122
- });
123
- };
124
-
125
- _this.removeToast = function (id) {
126
- _this.setState(function (previousState) {
127
- return {
128
- toasts: previousState.toasts.filter(function (toast) {
129
- return toast.id !== id;
130
- })
131
- };
132
- });
133
- };
134
-
135
- props.bindNotify(_this.notify);
136
- props.bindGetToasts(_this.getToasts);
137
- props.bindCloseAll(_this.closeAll);
138
- _this.state = {
139
- toasts: []
140
- };
141
- return _this;
142
- }
143
-
144
- _createClass(ToastManager, [{
145
- key: "render",
146
- value: function render() {
147
- var _this2 = this;
148
-
149
- return /*#__PURE__*/React.createElement("span", {
150
- className: wrapperClass
151
- }, this.state.toasts.map(function (_ref) {
152
- var id = _ref.id,
153
- description = _ref.description,
154
- props = _objectWithoutProperties(_ref, _excluded);
155
-
156
- return /*#__PURE__*/React.createElement(Toast, Object.assign({
157
- key: id,
158
- onRemove: function onRemove() {
159
- return _this2.removeToast(id);
160
- }
161
- }, props), description);
162
- }));
163
- }
164
- }]);
165
-
166
- return ToastManager;
167
- }(React.PureComponent);
168
-
169
- ToastManager.idCounter = 0;
170
- export { ToastManager as default };
@@ -1,76 +0,0 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
- import React from 'react';
4
- import ReactDOM from 'react-dom';
5
- import ToastManager from './toastManager';
6
- var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
7
- /**
8
- * The Toaster manages the interactionsb between
9
- * the ToasterManger and the toast API.
10
- */
11
-
12
- var Toaster = function Toaster() {
13
- var _this = this;
14
-
15
- _classCallCheck(this, Toaster);
16
-
17
- this._bindNotify = function (handler) {
18
- _this.notifyHandler = handler;
19
- };
20
-
21
- this._bindGetToasts = function (handler) {
22
- _this.getToastsHandler = handler;
23
- };
24
-
25
- this._bindCloseAll = function (handler) {
26
- _this.closeAllHandler = handler;
27
- };
28
-
29
- this.getToasts = function () {
30
- return _this.getToastsHandler();
31
- };
32
-
33
- this.closeAll = function () {
34
- return _this.closeAllHandler();
35
- };
36
-
37
- this.notify = function (title) {
38
- var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
39
- return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
40
- intent: 'none'
41
- }));
42
- };
43
-
44
- this.success = function (title) {
45
- var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46
- return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
47
- intent: 'success'
48
- }));
49
- };
50
-
51
- this.warning = function (title) {
52
- var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
53
- return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
54
- intent: 'warning'
55
- }));
56
- };
57
-
58
- this.danger = function (title) {
59
- var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
60
- return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
61
- intent: 'danger'
62
- }));
63
- };
64
-
65
- if (!isBrowser) return;
66
- var container = document.createElement('div');
67
- container.setAttribute('data-evergreen-toaster-container', '');
68
- document.body.appendChild(container);
69
- ReactDOM.render( /*#__PURE__*/React.createElement(ToastManager, {
70
- bindNotify: this._bindNotify,
71
- bindGetToasts: this._bindGetToasts,
72
- bindCloseAll: this._bindCloseAll
73
- }), container);
74
- };
75
-
76
- export { Toaster as default };
@@ -1,25 +0,0 @@
1
- export var DEFAULT = 'default';
2
- export var NUMBER = 'number';
3
- export var TEXT = 'text';
4
- export var CHECKBOX = 'checkbox';
5
- export var DATE = 'date';
6
- export var SINGLE_SELECT = 'single-select';
7
- export var LONG_TEXT = 'long-text';
8
- export var IMAGE = 'image';
9
- export var FILE = 'file';
10
- export var MULTIPLE_SELECT = 'multiple-select';
11
- export var COLLABORATOR = 'collaborator';
12
- export var LINK = 'link';
13
- export var FORMULA = 'formula';
14
- export var LINK_FORMULA = 'link-formula';
15
- export var CREATOR = 'creator';
16
- export var CTIME = 'ctime';
17
- export var LAST_MODIFIER = 'last-modifier';
18
- export var MTIME = 'mtime';
19
- export var GEOLOCATION = 'geolocation';
20
- export var AUTO_NUMBER = 'auto-number';
21
- export var URL = 'url';
22
- export var EMAIL = 'email';
23
- export var DURATION = 'duration';
24
- export var RATE = 'rate';
25
- export var BUTTON = 'button';
@@ -1,48 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
-
3
- var _DURATION_ZERO_DISPLA, _DURATION_DECIMAL_DIG;
4
-
5
- import * as CellType from './cell-types';
6
- export var NUMBER_TYPES = {
7
- 'NUMBER': 'number',
8
- 'NUMBER_WITH_COMMAS': 'number-with-commas',
9
- 'PERCENT': 'percent',
10
- 'YUAN': 'yuan',
11
- 'EURO': 'euro',
12
- 'DOLLAR': 'dollar'
13
- };
14
- export var DATE_TYPES = {
15
- 'D/M/YYYY': 'D/M/YYYY',
16
- 'D/M/YYYY HH:mm': 'D/M/YYYY HH:mm',
17
- 'M/D/YYYY': 'M/D/YY',
18
- 'M/D/YYYY HH:mm': 'M/D/YYYY HH:mm',
19
- 'YYYY-MM-DD': 'YYYY-MM-DD',
20
- 'YYYY-MM-DD HH:mm': 'YYYY-MM-DD HH:mm'
21
- };
22
- export var FORMULA_RESULT_TYPE = {
23
- NUMBER: 'number',
24
- STRING: 'string',
25
- DATE: 'date',
26
- BOOL: 'bool',
27
- ARRAY: 'array'
28
- };
29
- export var SIMPLE_CELL_COLUMNS = [CellType.TEXT, CellType.NUMBER, CellType.DATE, CellType.CTIME, CellType.MTIME, CellType.GEOLOCATION, CellType.AUTO_NUMBER, CellType.URL, CellType.EMAIL, CellType.DURATION, CellType.CHECKBOX, CellType.RATE];
30
- export var ARRAY_FORMAL_COLUMNS = [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR];
31
- export var SIMPLE_CELL_FORMULA_RESULTS = [FORMULA_RESULT_TYPE.NUMBER, FORMULA_RESULT_TYPE.STRING, FORMULA_RESULT_TYPE.DATE, FORMULA_RESULT_TYPE.BOOL];
32
- export var COLLABORATOR_COLUMN_TYPES = [CellType.COLLABORATOR, CellType.CREATOR, CellType.LAST_MODIFIER];
33
- export var ARRAY_FORMAL_COLUMNS_TYPES = [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR];
34
- export var DEFAULT_NUMBER_FORMAT = 'number';
35
- export var DEFAULT_DATE_FORMAT = 'YYYY-MM-DD';
36
- export var DURATION_FORMATS_MAP = {
37
- H_MM: 'h:mm',
38
- H_MM_SS: 'h:mm:ss'
39
- };
40
- export var DURATION_FORMATS = [{
41
- name: DURATION_FORMATS_MAP.H_MM,
42
- type: DURATION_FORMATS_MAP.H_MM
43
- }, {
44
- name: DURATION_FORMATS_MAP.H_MM_SS,
45
- type: DURATION_FORMATS_MAP.H_MM_SS
46
- }];
47
- export var DURATION_ZERO_DISPLAY = (_DURATION_ZERO_DISPLA = {}, _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM, '0:00'), _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM_SS, '0:00'), _DURATION_ZERO_DISPLA);
48
- export var DURATION_DECIMAL_DIGITS = (_DURATION_DECIMAL_DIG = {}, _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM, 0), _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM_SS, 0), _DURATION_DECIMAL_DIG);