datastake-daf 0.6.706 → 0.6.708

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.
@@ -8,7 +8,6 @@ var g2plot = require('@antv/g2plot');
8
8
  require('country-city-location');
9
9
  var L = require('leaflet');
10
10
  var axios = require('axios');
11
- require('react/jsx-runtime');
12
11
  require('antd');
13
12
  var lodash = require('lodash');
14
13
  var PropTypes = require('prop-types');
@@ -3,8 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var axios = require('axios');
6
- require('react');
7
- require('react/jsx-runtime');
8
6
  require('antd');
9
7
 
10
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -14089,6 +14089,40 @@ const getRedirectLink = (link, APP) => {
14089
14089
  return link;
14090
14090
  };
14091
14091
 
14092
+ function getSourceString(author, item) {
14093
+ return item.children ? /*#__PURE__*/jsxRuntime.jsxs("span", {
14094
+ className: "ant-btn-link",
14095
+ style: {
14096
+ cursor: "pointer"
14097
+ },
14098
+ onClick: () => {
14099
+ const iconOne = document.querySelector(`.show-row-${item.id}`);
14100
+ const iconTwo = document.querySelector(`.hide-row-${item.id}`);
14101
+ if (iconOne) {
14102
+ iconOne.click();
14103
+ } else if (iconTwo) {
14104
+ iconTwo.click();
14105
+ }
14106
+ },
14107
+ children: [" ", `${item.sourcesLen} Source${item.sourcesLen > 1 ? "(s)" : ""}`, " "]
14108
+ }) : author;
14109
+ }
14110
+ const getDivergenceOrEqual = (data, keys) => {
14111
+ if (data.children && Array.isArray(data.children) && data.children.length) {
14112
+ keys.forEach(key => {
14113
+ const firstValue = data[key];
14114
+ const areSameData = data.children.every(i => i[key] === firstValue);
14115
+ if (!areSameData) {
14116
+ data[key] = /*#__PURE__*/jsxRuntime.jsx("span", {
14117
+ className: "ant-typography ant-typography-danger",
14118
+ children: "Divergence"
14119
+ });
14120
+ }
14121
+ });
14122
+ }
14123
+ return data;
14124
+ };
14125
+
14092
14126
  exports.ErrorFormat = ErrorFormat;
14093
14127
  exports.MessageTypes = MessageTypes;
14094
14128
  exports.StorageManager = StorageManager;
@@ -14122,6 +14156,7 @@ exports.filterString = filterString;
14122
14156
  exports.findOptions = findOptions;
14123
14157
  exports.formatErrors = formatErrors;
14124
14158
  exports.getDefaultActiveFilters = getDefaultActiveFilters;
14159
+ exports.getDivergenceOrEqual = getDivergenceOrEqual;
14125
14160
  exports.getImageUploadViewValue = getImageUploadViewValue;
14126
14161
  exports.getInterface = getInterface;
14127
14162
  exports.getNkey = getNkey;
@@ -14131,6 +14166,7 @@ exports.getOptionLabel = getOptionLabel;
14131
14166
  exports.getRangeOfTicks = getRangeOfTicks;
14132
14167
  exports.getRedirectLink = getRedirectLink;
14133
14168
  exports.getRedirectPath = getRedirectPath;
14169
+ exports.getSourceString = getSourceString;
14134
14170
  exports.getTagColor = getTagColor;
14135
14171
  exports.getToken = getToken;
14136
14172
  exports.groupSubsections = groupSubsections;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.706",
3
+ "version": "0.6.708",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -1,5 +1,3 @@
1
- import React from 'react';
2
-
3
1
  export const capitalize = string =>
4
2
  string && string.charAt(0).toUpperCase() + string.slice(1);
5
3
 
@@ -55,35 +53,6 @@ export const getOptionAsObject = (value, options) => {
55
53
  export const isEmptyOrSpaces = (str) => typeof str === 'string' ?
56
54
  str === null || str.match(/^ *$/) !== null : true;
57
55
 
58
- export function getSourceString(author, item) {
59
- return item.children ?
60
- <span
61
- className="ant-btn-link"
62
- style={{ cursor: "pointer" }}
63
- onClick={() => {
64
- const iconOne = document.querySelector(`.show-row-${item.id}`);
65
- const iconTwo = document.querySelector(`.hide-row-${item.id}`);
66
- if (iconOne) {
67
- iconOne.click();
68
- } else if (iconTwo) {
69
- iconTwo.click();
70
- }
71
- }}> {`${item.sourcesLen} Source${item.sourcesLen > 1 ? "(s)" : ""}`} </span> : author;
72
- }
73
-
74
- export const getDivergenceOrEqual = (data, keys) => {
75
- if (data.children && Array.isArray(data.children) && data.children.length) {
76
- keys.forEach(key => {
77
- const firstValue = data[key];
78
- const areSameData = data.children.every(i => i[key] === firstValue);
79
- if (!areSameData) {
80
- data[key] = <span className="ant-typography ant-typography-danger">Divergence</span>;
81
- }
82
- });
83
- }
84
- return data
85
- }
86
-
87
56
  export const selectFilterSearch = (input = '', option = {}) => {
88
57
  if (option) {
89
58
  const { children } = option;
@@ -0,0 +1,28 @@
1
+ export function getSourceString(author, item) {
2
+ return item.children ?
3
+ <span
4
+ className="ant-btn-link"
5
+ style={{ cursor: "pointer" }}
6
+ onClick={() => {
7
+ const iconOne = document.querySelector(`.show-row-${item.id}`);
8
+ const iconTwo = document.querySelector(`.hide-row-${item.id}`);
9
+ if (iconOne) {
10
+ iconOne.click();
11
+ } else if (iconTwo) {
12
+ iconTwo.click();
13
+ }
14
+ }}> {`${item.sourcesLen} Source${item.sourcesLen > 1 ? "(s)" : ""}`} </span> : author;
15
+ }
16
+
17
+ export const getDivergenceOrEqual = (data, keys) => {
18
+ if (data.children && Array.isArray(data.children) && data.children.length) {
19
+ keys.forEach(key => {
20
+ const firstValue = data[key];
21
+ const areSameData = data.children.every(i => i[key] === firstValue);
22
+ if (!areSameData) {
23
+ data[key] = <span className="ant-typography ant-typography-danger">Divergence</span>;
24
+ }
25
+ });
26
+ }
27
+ return data
28
+ }
package/src/utils.js CHANGED
@@ -50,4 +50,6 @@ export { createErrorHandler, handleError, handleSuccess, handleWarning, handleIn
50
50
 
51
51
  export { createTheme, createAdminTheme } from './helpers/theme.js';
52
52
 
53
- export { getRedirectLink } from "./@daf/hooks/useIsDatastake.js"
53
+ export { getRedirectLink } from "./@daf/hooks/useIsDatastake.js"
54
+
55
+ export { getSourceString, getDivergenceOrEqual } from './helpers/stringHelper.jsx'