@gingkoo/pandora-metabase 0.0.27 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  /**
2
- * @gingkoo/pandora-metabase v0.0.27
2
+ * @gingkoo/pandora-metabase v0.0.28
3
3
  */
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import * as React from 'react';
6
6
  import React__default, { useContext, createContext, useState, useRef, useMemo, forwardRef, useImperativeHandle, useEffect } from 'react';
7
7
  import cx from 'classnames';
8
- import { Button, Tooltip, Input, Modal2, Toast } from '@gingkoo/pandora';
9
- import { DatePicker, Dropdown, Tooltip as Tooltip$1, InputNumber, Button as Button$1 } from 'antd';
8
+ import { Button, Tooltip, InputNumber, Input, Select, Modal2, Toast } from '@gingkoo/pandora';
9
+ import { DatePicker, Dropdown, Tooltip as Tooltip$1, InputNumber as InputNumber$1, Button as Button$1 } from 'antd';
10
10
  import { DownOutlined, LoadingOutlined } from '@ant-design/icons';
11
11
  import Styled from 'styled-components';
12
12
  import _$2 from 'underscore';
13
13
  import ReactDOM from 'react-dom';
14
14
  import ReactDOMServer from 'react-dom/server';
15
15
  import cloneDeep from 'lodash/cloneDeep';
16
- import { Repeat, RelatedWork, FfPlus, FfLine } from '@gingkoo/pandora-icons';
16
+ import { Repeat, Function, RelatedWork, FfPlus, FfLine } from '@gingkoo/pandora-icons';
17
17
  import moment from 'dayjs';
18
18
  import isEqual from 'lodash/isEqual';
19
19
 
@@ -1105,6 +1105,7 @@ register('en', {
1105
1105
  'filter.contain': 'contain',
1106
1106
  'filter.notInclude': 'not include',
1107
1107
  'filter.startWith': 'start with',
1108
+ 'filter.within': 'In',
1108
1109
  'filter.endWith': 'end with',
1109
1110
  'filter.earlierThan': 'earlier than',
1110
1111
  'filter.laterThan': 'later than',
@@ -1233,6 +1234,7 @@ register('zh', {
1233
1234
  'filter.contain': '包含',
1234
1235
  'filter.notInclude': '不包含',
1235
1236
  'filter.startWith': '以...开始',
1237
+ 'filter.within': 'In',
1236
1238
  'filter.endWith': '以...结束',
1237
1239
  'filter.earlierThan': '早于',
1238
1240
  'filter.laterThan': '晚于',
@@ -1334,7 +1336,7 @@ const Loading = ({
1334
1336
  });
1335
1337
  };
1336
1338
 
1337
- var css_248z$b = ".mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.m-2 {\n margin: 0.5rem;\n}\n.mx-2 {\n margin-left: 0.5rem;\n margin-right: 0.5rem;\n}\n.ml-2 {\n margin-left: 0.5rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.ml-4 {\n margin-left: 1rem;\n}\n.mr-4 {\n margin-right: 1rem;\n}\n.mr-2 {\n margin-right: 0.5rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.block {\n display: block;\n}\n.w-full {\n width: 100%;\n}\n.font-bold {\n font-weight: 700;\n}\n.uppercase {\n text-transform: uppercase;\n}\n.tracking-wider {\n letter-spacing: 0.05em;\n}\n.relative {\n position: relative;\n}\n.absolute {\n position: absolute;\n}\n.top-0 {\n top: 0px;\n}\n.left-0 {\n left: 0;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.text-gray-500 {\n color: #6b7280;\n}\n.flex {\n display: flex;\n}\n.items-center {\n align-items: center;\n}\n.justify-center {\n justify-content: center;\n}\n.visual-box {\n position: relative;\n width: 100%;\n height: 100%;\n overflow-y: scroll;\n overflow-x: hidden;\n transition: all 0.3s;\n z-index: 3;\n background-color: #fff;\n}\n.Sqb {\n padding: 0 20px 50px;\n}\n.Sqb-list {\n padding-top: 1.5rem;\n}\n.Sqb-hover-parent {\n margin-bottom: 16px;\n padding-bottom: 16px;\n}\n.Sqb-item {\n font-size: 14px;\n}\n.Sqb-item--text {\n color: #509ee3;\n width: 66.6667%;\n box-sizing: border-box;\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n font-weight: 600;\n}\n.Sqb-item--text.purple-text {\n color: #7172ad;\n}\n.Sqb-item--text.gray-text {\n color: #93a1ab;\n}\n.Sqb-item--text.green-text {\n color: #88bf4d;\n}\n.Sqb-item-close {\n width: 16px;\n height: 16px;\n color: #b8bbc3;\n margin-left: auto;\n visibility: hidden;\n cursor: pointer;\n}\n.Sqb-item--content {\n width: 66.6667%;\n box-sizing: border-box;\n}\n.Sqb-item--content .Sqb-NotebookCell {\n box-sizing: border-box;\n padding: 16px 16px 8px;\n color: #509ee3;\n display: flex;\n flex-wrap: wrap;\n -webkit-box-align: center;\n align-items: center;\n border-radius: 8px;\n background-color: rgba(80, 158, 227, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell.gray-bg {\n background-color: rgba(147, 161, 171, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell.green-bg {\n background-color: rgba(136, 191, 77, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName {\n border: 2px solid transparent;\n border-radius: 6px;\n color: white;\n background-color: #509ee3;\n transition: background 300ms linear 0s,\n border 300ms linear 0s;\n box-sizing: border-box;\n margin-bottom: 8px;\n margin-right: 8px;\n padding: 8px;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n cursor: pointer;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName-input {\n margin-bottom: 9px;\n margin-right: 8px;\n padding: 9px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName::selection {\n color: #ffffff;\n background-color: #d489ac;\n text-shadow: none;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName:hover {\n background-color: rgba(80, 158, 227, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.noClick {\n cursor: default;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.noClick:hover {\n background-color: #509ee3;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.notSelected {\n border: 2px solid rgba(80, 158, 227, 0.25);\n color: #509ee3;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.notSelected:hover {\n border-color: rgba(80, 158, 227, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name {\n color: white;\n background-color: #7172ad;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name:hover {\n background-color: rgba(113, 114, 173, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name.notSelected {\n border: 2px solid rgba(113, 114, 173, 0.25);\n color: #7172ad;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name.notSelected:hover {\n border-color: rgba(113, 114, 173, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name {\n color: white;\n background-color: #93a1ab;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name:hover {\n background-color: rgba(147, 161, 171, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name svg.sort-arrow {\n margin-right: 0.5rem;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name {\n color: white;\n background-color: #88bf4d;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name:hover {\n background-color: rgba(136, 191, 77, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name.notSelected {\n border: 2px solid rgba(136, 191, 77, 0.25);\n color: #88bf4d;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name.notSelected:hover {\n border-color: rgba(136, 191, 77, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .ant-input-number {\n margin-bottom: 0.5rem;\n}\n.Sqb-item--content .Sqb-NotebookCell .ant-input-number .ant-input-number-input {\n height: 32px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-where {\n box-sizing: border-box;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-where.block {\n width: 100%;\n}\n.Sqb-item--content .Sqb-NotebookCell .operator-icon,\n.Sqb-item--content .Sqb-NotebookCell .operator-icon button {\n font-size: 18px !important;\n border: none !important;\n}\n.Sqb-item--content .Sqb-NotebookCell .subquery-icon {\n color: #93a1ab;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableColumns {\n font-weight: 600;\n margin-bottom: 0.5rem;\n margin-left: auto;\n cursor: pointer;\n}\n.Sqb-item--content .flex-row {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n flex-direction: row;\n}\n.Sqb-item--content .flex-row .Sqb-NotebookCell {\n width: 50%;\n}\n.Sqb-item--content .flex-row .pass {\n color: #88bf4d;\n margin: 4px 16px;\n font-size: 600;\n}\n.Sqb-item--func {\n box-sizing: border-box;\n margin-top: 8px;\n}\n.Sqb-item--func .Sqb-button {\n display: inline-block;\n box-sizing: border-box;\n text-decoration: none;\n cursor: pointer;\n font-weight: bold;\n padding: 12px 16px;\n border-radius: 6px;\n margin-right: 16px;\n margin-top: 16px;\n border: none;\n transition: background 300ms ease 0s;\n flex-shrink: 0;\n color: #93a1ab;\n background-color: #ffffff;\n}\n.Sqb-item--func .Sqb-button:hover {\n color: #7e8f9b;\n background-color: #eceff0;\n}\n.Sqb-item--func .Sqb-button > div {\n min-width: 60px;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n display: flex;\n}\n.Sqb-item--func .Sqb-button > div svg {\n flex-shrink: 0;\n}\n.Sqb-item--func .Sqb-button > div div {\n margin-top: 0.5rem;\n}\n.Sqb-item--func .Sqb-button.filter {\n color: #7172ad;\n background-color: #e0e0ed;\n}\n.Sqb-item--func .Sqb-button.filter:hover {\n color: #5d5ea0;\n background-color: #cccce1;\n}\n.Sqb-item--func .Sqb-button.summarize {\n color: #88bf4d;\n background-color: #d8eac5;\n}\n.Sqb-item--func .Sqb-button.summarize:hover {\n color: #79ae3f;\n background-color: #cae2af;\n}\n.Sqb-item--func .Sqb-button.joinData {\n color: #509ee3;\n background-color: #f1f7fd;\n}\n.Sqb-item--func .Sqb-button.joinData:hover {\n color: #328dde;\n background-color: #d4e7f8;\n}\n.Sqb-item--func .Sqb-button.small {\n margin-right: 8px;\n margin-top: 0;\n padding: 0.5rem;\n}\n.Sqb-item--func .Sqb-button.small > div {\n min-width: 0;\n}\n.Sqb-item--func .Sqb-button.small > div svg {\n width: 14px;\n height: 14px;\n}\n.Sqb-item--func .Sqb-button.small > div div {\n display: none;\n}\n.Sqb-item:hover .Sqb-item-close {\n visibility: visible;\n}\n.Sqb > .Sqb-btn {\n min-width: 220px;\n height: 36px;\n border-radius: 6px;\n color: #ffffff;\n background: #509ee3;\n border: 1px solid #509ee3;\n}\n.Sqb > .Sqb-btn:hover {\n background-color: rgba(80, 158, 227, 0.8) !important;\n}\n";
1339
+ var css_248z$b = ".mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.m-2 {\n margin: 0.5rem;\n}\n.mx-2 {\n margin-left: 0.5rem;\n margin-right: 0.5rem;\n}\n.ml-2 {\n margin-left: 0.5rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.ml-4 {\n margin-left: 1rem;\n}\n.mr-4 {\n margin-right: 1rem;\n}\n.mr-2 {\n margin-right: 0.5rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.block {\n display: block;\n}\n.w-full {\n width: 100%;\n}\n.font-bold {\n font-weight: 700;\n}\n.uppercase {\n text-transform: uppercase;\n}\n.tracking-wider {\n letter-spacing: 0.05em;\n}\n.relative {\n position: relative;\n}\n.absolute {\n position: absolute;\n}\n.top-0 {\n top: 0px;\n}\n.left-0 {\n left: 0;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.text-gray-500 {\n color: #6b7280;\n}\n.flex {\n display: flex;\n}\n.items-center {\n align-items: center;\n}\n.justify-center {\n justify-content: center;\n}\n.visual-box {\n position: relative;\n width: 100%;\n height: 100%;\n overflow-y: scroll;\n overflow-x: hidden;\n transition: all 0.3s;\n z-index: 3;\n background-color: #fff;\n}\n.Sqb {\n padding: 0 20px 50px;\n}\n.Sqb-list {\n padding-top: 1.5rem;\n}\n.Sqb-hover-parent {\n margin-bottom: 16px;\n padding-bottom: 16px;\n}\n.Sqb-item {\n font-size: 14px;\n}\n.Sqb-item--text {\n color: #509ee3;\n width: 66.6667%;\n box-sizing: border-box;\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n font-weight: 600;\n}\n.Sqb-item--text.purple-text {\n color: #7172ad;\n}\n.Sqb-item--text.gray-text {\n color: #93a1ab;\n}\n.Sqb-item--text.green-text {\n color: #88bf4d;\n}\n.Sqb-item-close {\n width: 16px;\n height: 16px;\n color: #b8bbc3;\n margin-left: auto;\n visibility: hidden;\n cursor: pointer;\n}\n.Sqb-item--content {\n width: 66.6667%;\n box-sizing: border-box;\n}\n.Sqb-item--content .Sqb-Filter-item {\n position: relative;\n margin: 0 10px;\n}\n.Sqb-item--content .Sqb-Filter-item .right-arrow,\n.Sqb-item--content .Sqb-Filter-item .left-arrow {\n position: absolute;\n top: 0;\n height: 40px;\n width: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0.4;\n cursor: pointer;\n transform: scale(0);\n transition: all 0.3s;\n}\n.Sqb-item--content .Sqb-Filter-item .right-arrow img,\n.Sqb-item--content .Sqb-Filter-item .left-arrow img {\n transform: scale(0.8);\n}\n.Sqb-item--content .Sqb-Filter-item .right-arrow:hover,\n.Sqb-item--content .Sqb-Filter-item .left-arrow:hover {\n opacity: 1;\n}\n.Sqb-item--content .Sqb-Filter-item .left-arrow {\n transform: rotate(180deg) scale(0);\n transform-origin: 50% 50%;\n left: -30px;\n}\n.Sqb-item--content .Sqb-Filter-item .right-arrow {\n right: -20px;\n}\n.Sqb-item--content .Sqb-Filter-item.hover .left-arrow {\n transform: rotate(180deg) scale(1);\n}\n.Sqb-item--content .Sqb-Filter-item.hover .right-arrow {\n transform: scale(1);\n}\n.Sqb-item--content .Sqb-NotebookCell {\n box-sizing: border-box;\n padding: 16px 16px 8px;\n color: #509ee3;\n display: flex;\n flex-wrap: wrap;\n -webkit-box-align: center;\n align-items: center;\n border-radius: 8px;\n background-color: rgba(80, 158, 227, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell-preview {\n flex-shrink: 0;\n width: 100%;\n}\n.Sqb-item--content .Sqb-NotebookCell.gray-bg {\n background-color: rgba(147, 161, 171, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell.green-bg {\n background-color: rgba(136, 191, 77, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName {\n border: 2px solid transparent;\n border-radius: 6px;\n color: white;\n background-color: #509ee3;\n transition: background 300ms linear 0s,\n border 300ms linear 0s;\n box-sizing: border-box;\n margin-bottom: 8px;\n margin-right: 8px;\n padding: 8px;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n cursor: pointer;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName-input {\n margin-bottom: 9px;\n margin-right: 8px;\n padding: 9px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName::selection {\n color: #ffffff;\n background-color: #d489ac;\n text-shadow: none;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName:hover {\n background-color: rgba(80, 158, 227, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.noClick {\n cursor: default;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.noClick:hover {\n background-color: #509ee3;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.notSelected {\n border: 2px solid rgba(80, 158, 227, 0.25);\n color: #509ee3;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.notSelected:hover {\n border-color: rgba(80, 158, 227, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name {\n color: white;\n background-color: #7172ad;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name:hover {\n background-color: rgba(113, 114, 173, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name.notSelected {\n border: 2px solid rgba(113, 114, 173, 0.25);\n color: #7172ad;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name.notSelected:hover {\n border-color: rgba(113, 114, 173, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name {\n color: white;\n background-color: #93a1ab;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name:hover {\n background-color: rgba(147, 161, 171, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name svg.sort-arrow {\n margin-right: 0.5rem;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name {\n color: white;\n background-color: #88bf4d;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name:hover {\n background-color: rgba(136, 191, 77, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name.notSelected {\n border: 2px solid rgba(136, 191, 77, 0.25);\n color: #88bf4d;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name.notSelected:hover {\n border-color: rgba(136, 191, 77, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .ant-input-number {\n margin-bottom: 0.5rem;\n}\n.Sqb-item--content .Sqb-NotebookCell .ant-input-number .ant-input-number-input {\n height: 32px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-where {\n box-sizing: border-box;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-where.block {\n width: 100%;\n}\n.Sqb-item--content .Sqb-NotebookCell .operator-icon,\n.Sqb-item--content .Sqb-NotebookCell .operator-icon button {\n font-size: 18px !important;\n border: none !important;\n}\n.Sqb-item--content .Sqb-NotebookCell .subquery-icon {\n color: #93a1ab;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableColumns {\n font-weight: 600;\n margin-bottom: 0.5rem;\n margin-left: auto;\n cursor: pointer;\n}\n.Sqb-item--content .flex-row {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n flex-direction: row;\n}\n.Sqb-item--content .flex-row .Sqb-NotebookCell {\n width: 50%;\n}\n.Sqb-item--content .flex-row .pass {\n color: #88bf4d;\n margin: 4px 16px;\n font-size: 600;\n}\n.Sqb-item--func {\n box-sizing: border-box;\n margin-top: 8px;\n}\n.Sqb-item--func .Sqb-button {\n display: inline-block;\n box-sizing: border-box;\n text-decoration: none;\n cursor: pointer;\n font-weight: bold;\n padding: 12px 16px;\n border-radius: 6px;\n margin-right: 16px;\n margin-top: 16px;\n border: none;\n transition: background 300ms ease 0s;\n flex-shrink: 0;\n color: #93a1ab;\n background-color: #ffffff;\n}\n.Sqb-item--func .Sqb-button:hover {\n color: #7e8f9b;\n background-color: #eceff0;\n}\n.Sqb-item--func .Sqb-button > div {\n min-width: 60px;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n display: flex;\n}\n.Sqb-item--func .Sqb-button > div svg {\n flex-shrink: 0;\n}\n.Sqb-item--func .Sqb-button > div div {\n margin-top: 0.5rem;\n}\n.Sqb-item--func .Sqb-button.filter {\n color: #7172ad;\n background-color: #e0e0ed;\n}\n.Sqb-item--func .Sqb-button.filter:hover {\n color: #5d5ea0;\n background-color: #cccce1;\n}\n.Sqb-item--func .Sqb-button.summarize {\n color: #88bf4d;\n background-color: #d8eac5;\n}\n.Sqb-item--func .Sqb-button.summarize:hover {\n color: #79ae3f;\n background-color: #cae2af;\n}\n.Sqb-item--func .Sqb-button.joinData {\n color: #509ee3;\n background-color: #f1f7fd;\n}\n.Sqb-item--func .Sqb-button.joinData:hover {\n color: #328dde;\n background-color: #d4e7f8;\n}\n.Sqb-item--func .Sqb-button.small {\n margin-right: 8px;\n margin-top: 0;\n padding: 0.5rem;\n}\n.Sqb-item--func .Sqb-button.small > div {\n min-width: 0;\n}\n.Sqb-item--func .Sqb-button.small > div svg {\n width: 14px;\n height: 14px;\n}\n.Sqb-item--func .Sqb-button.small > div div {\n display: none;\n}\n.Sqb-item:hover .Sqb-item-close {\n visibility: visible;\n}\n.Sqb > .Sqb-btn {\n min-width: 220px;\n height: 36px;\n border-radius: 6px;\n color: #ffffff;\n background: #509ee3;\n border: 1px solid #509ee3;\n}\n.Sqb > .Sqb-btn:hover {\n background-color: rgba(80, 158, 227, 0.8) !important;\n}\n";
1338
1340
  styleInject(css_248z$b);
1339
1341
 
1340
1342
  var css_248z$a = ".Sqb-CustomColumn--box {\n box-sizing: border-box;\n min-width: 1em;\n max-width: 500px;\n background-color: #ffffff;\n overflow: hidden;\n}\n.Sqb-CustomColumn--box .input {\n color: #4c5773;\n font-size: 1.12em;\n padding: 0.75rem 0.75rem;\n border: 1px solid #f0f0f0;\n border-radius: 4px;\n transition: border 0.3s linear;\n font-family: Monaco, monospace;\n font-weight: 700;\n -webkit-font-smoothing: antialiased;\n}\n.Sqb-CustomColumn--box .input:focus {\n outline: none;\n border: 1px solid #509ee3;\n transition: border 0.3s linear;\n color: #4c5773;\n}\n.Sqb-CustomColumn--box .input::-webkit-input-placeholder {\n color: #949aab;\n}\n.Sqb-CustomColumn--box .input::-ms-input-placeholder {\n color: #949aab;\n}\n.Sqb-CustomColumn--box .input.border-error {\n border-color: #ed6e6e !important;\n}\n.Sqb-CustomColumn--box .text-error {\n color: #ed6e6e;\n}\n.Sqb-CustomColumn--box .btns {\n flex-direction: row;\n align-items: center;\n display: flex;\n border-top: 1px solid #f0f0f0;\n}\n.Sqb-CustomColumn--box .btns .btn {\n padding: 0.75rem 1rem;\n display: inline-block;\n box-sizing: border-box;\n background: transparent;\n border: 1px solid #e4e4e4;\n color: #4c5773;\n cursor: pointer;\n text-decoration: none;\n font-weight: bold;\n font-family: 'Lato', sans-serif;\n border-radius: 6px;\n outline: none;\n}\n.Sqb-CustomColumn--box .btns .btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.Sqb-CustomColumn--box .btns .btn:not(:disabled):hover {\n color: #509ee3;\n border-color: #d6d6d6;\n background: #f9fbfc;\n transition: all 200ms linear;\n}\n.Sqb-CustomColumn--box .btns .btn.usable {\n color: #ffffff;\n background: #509ee3;\n border: 1px solid #509ee3;\n}\n.Sqb-CustomColumn--box .btns .btn.usable:hover {\n color: #ffffff;\n border-color: #509ee3;\n background-color: rgba(80, 158, 227, 0.88);\n}\n";
@@ -4026,14 +4028,14 @@ const SelectJoinColumn = ({
4026
4028
  });
4027
4029
  };
4028
4030
 
4029
- var css_248z$4 = ".filter-page {\n min-width: 300px;\n}\n.filter-page .header {\n margin-bottom: 0.5rem;\n padding: 0.5rem;\n display: flex;\n align-items: center;\n color: #949aab;\n border-bottom: 1px solid #f0f0f0;\n}\n.filter-page .header .left-info {\n padding: 0.5rem 0.5rem 0.5rem 0;\n display: flex;\n align-items: center;\n}\n.filter-page .header .left-info span {\n font-weight: 900;\n font-size: 16px;\n color: #4c5773;\n display: flex;\n align-items: center;\n cursor: pointer;\n font-family: 'Lato', sans-serif;\n}\n.filter-page .header .left-info span svg {\n margin-right: 0.5rem;\n}\n.filter-page .header .left-info span:hover {\n color: #509ee3;\n}\n.filter-page .header .right-info {\n margin-left: auto;\n display: flex;\n align-items: center;\n}\n.filter-page .content {\n padding: 0.5rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.filter-page .content_l {\n flex: 1;\n}\n.filter-page .content .operator-icon {\n font-size: 18px !important;\n}\n.filter-page .content .Sqb-TableName {\n border: 2px solid transparent;\n border-radius: 6px;\n color: white;\n background-color: #509ee3;\n transition: background 300ms linear 0s;\n box-sizing: border-box;\n padding: 8px;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n cursor: pointer;\n}\n.filter-page .content .Sqb-TableName-input {\n margin-bottom: 9px;\n margin-right: 8px;\n padding: 9px;\n}\n.filter-page .content .Sqb-TableName::selection {\n color: #ffffff;\n background-color: #d489ac;\n text-shadow: none;\n}\n.filter-page .content .Sqb-TableName:hover {\n background-color: rgba(80, 158, 227, 0.8);\n}\n.filter-page .content .Sqb-TableName.noClick {\n cursor: default;\n}\n.filter-page .content .Sqb-TableName.noClick:hover {\n background-color: #509ee3;\n}\n.filter-page .content .Sqb-TableName.notSelected {\n border: 2px solid rgba(80, 158, 227, 0.25);\n color: #509ee3;\n background-color: transparent;\n}\n.filter-page .content .Sqb-TableName.notSelected:hover {\n border-color: rgba(80, 158, 227, 0.8);\n}\n.filter-page .content .Sqb-TableName.purple-name {\n color: white;\n background-color: #7172ad;\n}\n.filter-page .content .Sqb-TableName.purple-name:hover {\n background-color: rgba(113, 114, 173, 0.8);\n}\n.filter-page .content .Sqb-TableName.purple-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.filter-page .content .Sqb-TableName.purple-name.notSelected {\n border: 2px solid rgba(113, 114, 173, 0.25);\n color: #7172ad;\n background-color: transparent;\n}\n.filter-page .content .Sqb-TableName.purple-name.notSelected:hover {\n border-color: rgba(113, 114, 173, 0.8);\n}\n.filter-page .content .Sqb-TableName.gray-name {\n color: white;\n background-color: #93a1ab;\n}\n.filter-page .content .Sqb-TableName.gray-name:hover {\n background-color: rgba(147, 161, 171, 0.8);\n}\n.filter-page .content .Sqb-TableName.gray-name svg.sort-arrow {\n margin-right: 0.5rem;\n}\n.filter-page .content .Sqb-TableName.gray-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.filter-page .content .Sqb-TableName.green-name {\n color: white;\n background-color: #88bf4d;\n}\n.filter-page .content .Sqb-TableName.green-name:hover {\n background-color: rgba(136, 191, 77, 0.8);\n}\n.filter-page .content .Sqb-TableName.green-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.filter-page .content .Sqb-TableName.green-name.notSelected {\n border: 2px solid rgba(136, 191, 77, 0.25);\n color: #88bf4d;\n background-color: transparent;\n}\n.filter-page .content .Sqb-TableName.green-name.notSelected:hover {\n border-color: rgba(136, 191, 77, 0.8);\n}\n.filter-page .content .w_300 {\n width: 300px;\n}\n.filter-page .content .input {\n border: 1px solid #f0f0f0;\n font-size: 16px;\n color: #4c5773;\n border-radius: 4px;\n transition: border 0.3s linear;\n padding: 9px 20px;\n height: 40px;\n outline: none;\n}\n.filter-page .content .input::placeholder {\n color: #ccc;\n}\n.filter-page .content .input + .input {\n margin-top: 10px;\n}\n.filter-page .content .input.inline {\n display: inline-block;\n flex: 1;\n margin-right: 15px;\n padding: 5px 20px;\n}\n.filter-page .footer {\n padding: 0 0.5rem 0.5rem;\n display: flex;\n align-items: center;\n}\n.filter-page .footer .button--purple {\n margin-left: auto;\n flex-shrink: 0;\n color: white;\n background-color: #7172ad;\n border: 1px solid #7172ad;\n padding: 6px 14px;\n font-size: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n cursor: pointer;\n}\n.filter-page .footer .button--purple.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.filter-page .footer .button--purple:hover {\n color: white;\n background-color: rgba(113, 114, 173, 0.88);\n border-color: rgba(113, 114, 173, 0.88);\n}\n.operator-btn {\n height: 38px !important;\n padding: 8px !important;\n text-align: left !important;\n display: flex !important;\n align-items: center !important;\n}\n.operator-btn > .anticon {\n margin-left: auto !important;\n}\n";
4031
+ var css_248z$4 = ".filter-page {\n min-width: 300px;\n}\n.filter-page .header {\n margin-bottom: 0.5rem;\n padding: 0.5rem;\n display: flex;\n align-items: center;\n color: #949aab;\n border-bottom: 1px solid #f0f0f0;\n}\n.filter-page .header .left-info {\n padding: 0.5rem 0.5rem 0.5rem 0;\n display: flex;\n align-items: center;\n}\n.filter-page .header .left-info-formula {\n display: flex;\n margin: 0 5px;\n gap: 5px;\n}\n.filter-page .header .left-info-formula .operator-icon {\n font-size: 18px !important;\n}\n.filter-page .header .left-info-formula-input {\n width: 30px;\n}\n.filter-page .header .left-info-formula-input .pd-Input-inner-wrapper {\n border-top: 0;\n border-left: 0;\n border-right: 0;\n border-radius: 0;\n padding: 0 3px;\n}\n.filter-page .header .left-info-formula-input .pd-Input-inner-wrapper input {\n text-align: center;\n}\n.filter-page .header .left-info .span-name {\n font-weight: 900;\n font-size: 16px;\n color: #4c5773;\n display: flex;\n align-items: center;\n cursor: pointer;\n font-family: 'Lato', sans-serif;\n}\n.filter-page .header .left-info .span-name svg {\n margin-right: 0.5rem;\n}\n.filter-page .header .left-info .span-name:hover {\n color: #509ee3;\n}\n.filter-page .header .right-info {\n margin-left: auto;\n display: flex;\n align-items: center;\n}\n.filter-page .content {\n padding: 0.5rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.filter-page .content_l {\n flex: 1;\n}\n.filter-page .content .operator-icon {\n font-size: 18px !important;\n}\n.filter-page .content .Sqb-TableName {\n border: 2px solid transparent;\n border-radius: 6px;\n color: white;\n background-color: #509ee3;\n transition: background 300ms linear 0s;\n box-sizing: border-box;\n padding: 8px;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n cursor: pointer;\n}\n.filter-page .content .Sqb-TableName-input {\n margin-bottom: 9px;\n margin-right: 8px;\n padding: 9px;\n}\n.filter-page .content .Sqb-TableName::selection {\n color: #ffffff;\n background-color: #d489ac;\n text-shadow: none;\n}\n.filter-page .content .Sqb-TableName:hover {\n background-color: rgba(80, 158, 227, 0.8);\n}\n.filter-page .content .Sqb-TableName.noClick {\n cursor: default;\n}\n.filter-page .content .Sqb-TableName.noClick:hover {\n background-color: #509ee3;\n}\n.filter-page .content .Sqb-TableName.notSelected {\n border: 2px solid rgba(80, 158, 227, 0.25);\n color: #509ee3;\n background-color: transparent;\n}\n.filter-page .content .Sqb-TableName.notSelected:hover {\n border-color: rgba(80, 158, 227, 0.8);\n}\n.filter-page .content .Sqb-TableName.purple-name {\n color: white;\n background-color: #7172ad;\n}\n.filter-page .content .Sqb-TableName.purple-name:hover {\n background-color: rgba(113, 114, 173, 0.8);\n}\n.filter-page .content .Sqb-TableName.purple-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.filter-page .content .Sqb-TableName.purple-name.notSelected {\n border: 2px solid rgba(113, 114, 173, 0.25);\n color: #7172ad;\n background-color: transparent;\n}\n.filter-page .content .Sqb-TableName.purple-name.notSelected:hover {\n border-color: rgba(113, 114, 173, 0.8);\n}\n.filter-page .content .Sqb-TableName.gray-name {\n color: white;\n background-color: #93a1ab;\n}\n.filter-page .content .Sqb-TableName.gray-name:hover {\n background-color: rgba(147, 161, 171, 0.8);\n}\n.filter-page .content .Sqb-TableName.gray-name svg.sort-arrow {\n margin-right: 0.5rem;\n}\n.filter-page .content .Sqb-TableName.gray-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.filter-page .content .Sqb-TableName.green-name {\n color: white;\n background-color: #88bf4d;\n}\n.filter-page .content .Sqb-TableName.green-name:hover {\n background-color: rgba(136, 191, 77, 0.8);\n}\n.filter-page .content .Sqb-TableName.green-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.filter-page .content .Sqb-TableName.green-name.notSelected {\n border: 2px solid rgba(136, 191, 77, 0.25);\n color: #88bf4d;\n background-color: transparent;\n}\n.filter-page .content .Sqb-TableName.green-name.notSelected:hover {\n border-color: rgba(136, 191, 77, 0.8);\n}\n.filter-page .content .w_300 {\n width: 300px;\n}\n.filter-page .content .input {\n border: 1px solid #f0f0f0;\n font-size: 16px;\n color: #4c5773;\n border-radius: 4px;\n transition: border 0.3s linear;\n padding: 9px 20px;\n height: 40px;\n outline: none;\n}\n.filter-page .content .input::placeholder {\n color: #ccc;\n}\n.filter-page .content .input + .input {\n margin-top: 10px;\n}\n.filter-page .content .input.inline {\n display: inline-block;\n flex: 1;\n margin-right: 15px;\n padding: 5px 20px;\n}\n.filter-page .footer {\n padding: 0 0.5rem 0.5rem;\n display: flex;\n align-items: center;\n}\n.filter-page .footer .button--purple {\n margin-left: auto;\n flex-shrink: 0;\n color: white;\n background-color: #7172ad;\n border: 1px solid #7172ad;\n padding: 6px 14px;\n font-size: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n cursor: pointer;\n}\n.filter-page .footer .button--purple.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.filter-page .footer .button--purple:hover {\n color: white;\n background-color: rgba(113, 114, 173, 0.88);\n border-color: rgba(113, 114, 173, 0.88);\n}\n.operator-btn {\n height: 38px !important;\n padding: 8px !important;\n text-align: left !important;\n display: flex !important;\n align-items: center !important;\n}\n.operator-btn > .anticon {\n margin-left: auto !important;\n}\n";
4030
4032
  styleInject(css_248z$4);
4031
4033
 
4032
4034
  const {
4033
4035
  RangePicker
4034
4036
  } = DatePicker;
4035
- const NUMBER_LIST = ['等于', '不等于', '大于', '小于', '介于之间', '大于或等于', '小于或等于', '为空', '不为空'];
4036
- const STRING_LIST = ['', '不是', '包含', '不包含', '为空', '不为空', '以...开始', '以...结束'];
4037
+ const NUMBER_LIST = ['等于', '不等于', '大于', '小于', '介于之间', '大于或等于', '小于或等于', '为空', '不为空', 'In'];
4038
+ const STRING_LIST = ['等于', '不等于', '包含', '不包含', '为空', '不为空', '以...开始', '以...结束', 'In'];
4037
4039
  const DATE_LIST = [
4038
4040
  // '前', '下一个', '当前',
4039
4041
  '早于', '晚于',
@@ -4049,6 +4051,7 @@ const SelectFilterColumn = ({
4049
4051
  const [condition, setCondition] = useState(value.condition);
4050
4052
  const [isField, setIsField] = useState(value.isField || false);
4051
4053
  const [curVal, setVal] = useState(value.val);
4054
+ const [formula, setFormula] = useState(value.formula || {});
4052
4055
  const store = useStore$1();
4053
4056
  let table2Selected = Boolean(curColumn.table2?.name);
4054
4057
  const disabled = useMemo(() => {
@@ -4070,71 +4073,83 @@ const SelectFilterColumn = ({
4070
4073
  useEffect(() => {
4071
4074
  didUpdate?.();
4072
4075
  }, [condition]);
4076
+ const getQuotesName = name => {
4077
+ switch (formula.type) {
4078
+ case 'SUBSTR':
4079
+ // let str = formula.params?.join(',');
4080
+ return `SUBSTR(${name},${formula?.params?.[1]},${formula?.params?.[2]})`;
4081
+ default:
4082
+ return name;
4083
+ }
4084
+ };
4073
4085
  function generateQuotes(val, curColumn) {
4074
4086
  let [firstVal = '', secondVal = ''] = val;
4075
4087
  let quotes = '';
4076
4088
  if (condition === '以...开始') {
4077
4089
  if (isEn) {
4078
- quotes = curColumn.name + ' ' + `startWith ${firstVal}`;
4090
+ quotes = getQuotesName(curColumn.name) + ' ' + `startWith ${firstVal}`;
4079
4091
  } else {
4080
- quotes = curColumn.name + ' ' + `以 ${firstVal} 开始`;
4092
+ quotes = getQuotesName(curColumn.name) + ' ' + `以 ${firstVal} 开始`;
4081
4093
  }
4082
4094
  } else if (condition === '以...结束') {
4083
4095
  if (isEn) {
4084
- quotes = curColumn.name + ' ' + `endWith ${firstVal}`;
4096
+ quotes = getQuotesName(curColumn.name) + ' ' + `endWith ${firstVal}`;
4085
4097
  } else {
4086
- quotes = curColumn.name + ' ' + `以 ${firstVal} 结束`;
4098
+ quotes = getQuotesName(curColumn.name) + ' ' + `以 ${firstVal} 结束`;
4087
4099
  }
4088
4100
  } else if (condition === '介于之间') {
4089
4101
  if (isEn) {
4090
- quotes = curColumn.name + ' ' + `Between ${firstVal} and ${secondVal}`;
4102
+ quotes = getQuotesName(curColumn.name) + ' ' + `Between ${firstVal} and ${secondVal}`;
4091
4103
  } else {
4092
- quotes = curColumn.name + ' ' + `介于${firstVal}和${secondVal}之间`;
4104
+ quotes = getQuotesName(curColumn.name) + ' ' + `介于${firstVal}和${secondVal}之间`;
4093
4105
  }
4094
4106
  } else if (condition === '前') {
4095
4107
  if (isEn) {
4096
- quotes = curColumn.name + ' ' + `previous ${firstVal}${secondVal}`;
4108
+ quotes = getQuotesName(curColumn.name) + ' ' + `previous ${firstVal}${secondVal}`;
4097
4109
  } else {
4098
- quotes = curColumn.name + ' ' + `上一个${firstVal}${secondVal}`;
4110
+ quotes = getQuotesName(curColumn.name) + ' ' + `上一个${firstVal}${secondVal}`;
4099
4111
  }
4100
4112
  } else if (condition === '下一个') {
4101
4113
  if (isEn) {
4102
- quotes = curColumn.name + ' ' + `next ${firstVal}${secondVal}`;
4114
+ quotes = getQuotesName(curColumn.name) + ' ' + `next ${firstVal}${secondVal}`;
4103
4115
  } else {
4104
- quotes = curColumn.name + ' ' + `下一个${firstVal}${secondVal}`;
4116
+ quotes = getQuotesName(curColumn.name) + ' ' + `下一个${firstVal}${secondVal}`;
4105
4117
  }
4106
4118
  } else if (condition === '在') {
4107
4119
  if (isEn) {
4108
- quotes = curColumn.name + ' is ' + firstVal;
4120
+ quotes = getQuotesName(curColumn.name) + ' is ' + firstVal;
4109
4121
  } else {
4110
- quotes = curColumn.name + ' 是 ' + firstVal;
4122
+ quotes = getQuotesName(curColumn.name) + ' 是 ' + firstVal;
4111
4123
  }
4112
4124
  } else if (condition === '是空的') {
4113
4125
  if (isEn) {
4114
- quotes = curColumn.name + ' is empty';
4126
+ quotes = getQuotesName(curColumn.name) + ' is empty';
4115
4127
  } else {
4116
- quotes = curColumn.name + ' 为空';
4128
+ quotes = getQuotesName(curColumn.name) + ' 为空';
4117
4129
  }
4118
4130
  } else if (condition === '不是空的') {
4119
4131
  if (isEn) {
4120
- quotes = curColumn.name + ' not empty';
4132
+ quotes = getQuotesName(curColumn.name) + ' not empty';
4121
4133
  } else {
4122
- quotes = curColumn.name + ' 不为空';
4134
+ quotes = getQuotesName(curColumn.name) + ' 不为空';
4123
4135
  }
4124
4136
  } else if (condition === '当前') {
4125
4137
  if (firstVal === '天') {
4126
4138
  if (isEn) {
4127
- quotes = curColumn.name + ' ' + `today`;
4139
+ quotes = getQuotesName(curColumn.name) + ' ' + `today`;
4128
4140
  } else {
4129
- quotes = curColumn.name + ' ' + `今天`;
4141
+ quotes = getQuotesName(curColumn.name) + ' ' + `今天`;
4130
4142
  }
4131
4143
  } else {
4132
4144
  if (isEn) {
4133
- quotes = curColumn.name + ' ' + `this is ${firstVal}`;
4145
+ quotes = getQuotesName(curColumn.name) + ' ' + `this is ${firstVal}`;
4134
4146
  } else {
4135
- quotes = curColumn.name + ' ' + `这个${firstVal}`;
4147
+ quotes = getQuotesName(curColumn.name) + ' ' + `这个${firstVal}`;
4136
4148
  }
4137
4149
  }
4150
+ } else if (condition === 'In') {
4151
+ let cond = __('filter.within');
4152
+ quotes = getQuotesName(curColumn.name) + ' ' + cond + ' ' + `(${firstVal})`;
4138
4153
  } else {
4139
4154
  let cond = __({
4140
4155
  等于: 'filter.equal',
@@ -4157,9 +4172,9 @@ const SelectFilterColumn = ({
4157
4172
  是空的: 'filter.isEmpty'
4158
4173
  }[condition]);
4159
4174
  if (curColumn.table2?.id) {
4160
- quotes = curColumn.name + ' ' + cond + ' ' + curColumn.table2.name;
4175
+ quotes = getQuotesName(curColumn.name) + ' ' + cond + ' ' + curColumn.table2.name;
4161
4176
  } else {
4162
- quotes = curColumn.name + ' ' + cond + ' ' + firstVal;
4177
+ quotes = getQuotesName(curColumn.name) + ' ' + cond + ' ' + firstVal;
4163
4178
  }
4164
4179
  }
4165
4180
  return quotes;
@@ -4169,6 +4184,7 @@ const SelectFilterColumn = ({
4169
4184
  let quotes = generateQuotes(curVal, curColumn);
4170
4185
  typeof onChange === 'function' && onChange({
4171
4186
  ...curColumn,
4187
+ formula: formula,
4172
4188
  val: curVal,
4173
4189
  // 选择结果 如果有两个 长度就为2
4174
4190
  isField: isField,
@@ -4198,6 +4214,7 @@ const SelectFilterColumn = ({
4198
4214
  database_type: '' // 字段类型
4199
4215
  });
4200
4216
  setCondition('');
4217
+ setFormula({});
4201
4218
  setVal([]);
4202
4219
  }
4203
4220
  function getData(data) {
@@ -4371,6 +4388,24 @@ const SelectFilterColumn = ({
4371
4388
  }
4372
4389
  })
4373
4390
  });
4391
+ } else if (~['In'].indexOf(conditionText)) {
4392
+ const options = firstVal?.split(',') || [];
4393
+ return jsx("div", {
4394
+ children: jsx(Select, {
4395
+ size: 'large',
4396
+ placeholder: '\u53EF\u8F93\u5165\u56DE\u8F66\u65B0\u589E\u4E0B\u62C9\u9009\u9879',
4397
+ allowCreate: true,
4398
+ multiple: true,
4399
+ value: options,
4400
+ onChange: val => {
4401
+ setVal([val.join(',')]);
4402
+ },
4403
+ children: options.map(option => jsx(Select.Option, {
4404
+ value: option,
4405
+ children: option
4406
+ }, option))
4407
+ })
4408
+ });
4374
4409
  } else if (~['等于', '不等于', '大于', '小于', '大于或等于', '小于或等于', '是', '不是', '包含', '不包含', '以...开始', '以...结束'].indexOf(conditionText)) {
4375
4410
  return jsx("div", {
4376
4411
  children: jsx(Input, {
@@ -4445,20 +4480,103 @@ const SelectFilterColumn = ({
4445
4480
  '以...结束': 'filter.endWith',
4446
4481
  早于: 'filter.earlierThan',
4447
4482
  晚于: 'filter.laterThan',
4448
- 是空的: 'filter.isEmpty'
4483
+ 是空的: 'filter.isEmpty',
4484
+ In: 'filter.within'
4449
4485
  }[v])
4450
4486
  };
4451
4487
  });
4488
+ const changeFormula = val => {
4489
+ let params = [];
4490
+ if (val === 'SUBSTR') {
4491
+ params[0] = curColumn.name;
4492
+ }
4493
+ setFormula({
4494
+ type: val,
4495
+ params: params
4496
+ });
4497
+ };
4498
+ const changeParams = (val, i) => {
4499
+ const _formula = {
4500
+ ...formula
4501
+ };
4502
+ if (_formula.params) {
4503
+ _formula.params[i] = val;
4504
+ setFormula({
4505
+ ..._formula
4506
+ });
4507
+ }
4508
+ };
4509
+ let formulas = [{
4510
+ key: 'SUBSTR',
4511
+ label: 'SUBSTR'
4512
+ }];
4513
+ const leftFormula = () => {
4514
+ return jsx("div", {
4515
+ className: 'left-info-formula',
4516
+ children: jsx(Dropdown, {
4517
+ menu: {
4518
+ items: formulas,
4519
+ onClick: ({
4520
+ key
4521
+ }) => {
4522
+ changeFormula(key);
4523
+ }
4524
+ },
4525
+ trigger: ['click'],
4526
+ children: jsx(Button, {
4527
+ className: 'operator-icon',
4528
+ icon: jsx(Function, {})
4529
+ })
4530
+ })
4531
+ });
4532
+ };
4533
+ const getName = name => {
4534
+ switch (formula.type) {
4535
+ case 'SUBSTR':
4536
+ // let str = formula.params?.join(',');
4537
+ return jsxs("div", {
4538
+ children: ["SUBSTR (", name, ",", jsx(InputNumber, {
4539
+ className: 'left-info-formula-input',
4540
+ hideControl: true,
4541
+ onClick: e => {
4542
+ e.stopPropagation();
4543
+ return false;
4544
+ },
4545
+ size: 'small',
4546
+ value: formula?.params?.[1],
4547
+ onChange: val => {
4548
+ changeParams(val, 1);
4549
+ }
4550
+ }), ",", jsx(InputNumber, {
4551
+ className: 'left-info-formula-input',
4552
+ hideControl: true,
4553
+ quickEdit: true,
4554
+ onClick: e => {
4555
+ e.stopPropagation();
4556
+ return false;
4557
+ },
4558
+ size: 'small',
4559
+ value: formula?.params?.[2],
4560
+ onChange: val => {
4561
+ changeParams(val, 2);
4562
+ }
4563
+ }), ")"]
4564
+ });
4565
+ default:
4566
+ return name;
4567
+ }
4568
+ };
4452
4569
  return jsxs("div", {
4453
4570
  className: 'filter-page',
4454
4571
  children: [jsxs("div", {
4455
4572
  className: 'header',
4456
- children: [jsx("div", {
4573
+ children: [jsxs("div", {
4457
4574
  className: 'left-info',
4458
- children: jsxs("span", {
4575
+ children: [jsxs("span", {
4576
+ className: 'span-name',
4459
4577
  onClick: goPrevPage,
4460
- children: [jsx(LeftArrowIcon, {}), curColumn.name]
4461
- })
4578
+ children: [jsx(LeftArrowIcon, {}), getName(curColumn.name)]
4579
+ }), leftFormula()]
4462
4580
  }), jsx("div", {
4463
4581
  className: 'right-info',
4464
4582
  children: jsx(Dropdown, {
@@ -4502,7 +4620,8 @@ const SelectFilterColumn = ({
4502
4620
  '以...结束': 'filter.endWith',
4503
4621
  早于: 'filter.earlierThan',
4504
4622
  晚于: 'filter.laterThan',
4505
- 是空的: 'filter.isEmpty'
4623
+ 是空的: 'filter.isEmpty',
4624
+ In: 'filter.within'
4506
4625
  }[condition]), jsx(DownOutlined, {})]
4507
4626
  })
4508
4627
  })
@@ -6317,6 +6436,8 @@ const CustomColumn = props => {
6317
6436
  });
6318
6437
  };
6319
6438
 
6439
+ var img = "data:image/svg+xml,%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='26px' height='18px' version='1.1'%3e%3cpath d='m 1 6 L 14 6 L 14 1 L 26 9 L 14 18 L 14 12 L 1 12 z' stroke='white' fill='%2329b6f2'/%3e%3c/svg%3e";
6440
+
6320
6441
  const Filter = props => {
6321
6442
  const {
6322
6443
  meta
@@ -6327,6 +6448,7 @@ const Filter = props => {
6327
6448
  } = meta;
6328
6449
  let index = findIndex(store.metaList, meta);
6329
6450
  let notSelected = !meta.filter.length;
6451
+ const [ind, setInd] = useState(-1);
6330
6452
  function getColumns() {
6331
6453
  let {
6332
6454
  ExistAboveGroupBy,
@@ -6439,8 +6561,11 @@ const Filter = props => {
6439
6561
  });
6440
6562
  }
6441
6563
  function handleAdd(e) {
6564
+ let node = e.currentTarget;
6442
6565
  let newMeta = store.metaList.slice();
6443
6566
  let data = getColumns();
6567
+ let _index = node.getAttribute('v-index');
6568
+ let _type = node.getAttribute('v-type');
6444
6569
  let value = {
6445
6570
  table: '',
6446
6571
  // 表名
@@ -6470,7 +6595,15 @@ const Filter = props => {
6470
6595
  data: data,
6471
6596
  value: value,
6472
6597
  onChange: data => {
6473
- newMeta[index].filter.push(data);
6598
+ if (_type) {
6599
+ if (_type === 'before') {
6600
+ newMeta[index].filter.splice(_index, 0, data);
6601
+ } else {
6602
+ newMeta[index].filter.splice(_index + 1, 0, data);
6603
+ }
6604
+ } else {
6605
+ newMeta[index].filter.push(data);
6606
+ }
6474
6607
  store.setMeta(newMeta);
6475
6608
  closePopup();
6476
6609
  }
@@ -6490,6 +6623,18 @@ const Filter = props => {
6490
6623
  visible: false
6491
6624
  });
6492
6625
  }
6626
+ const options = ['(', ')', 'AND', 'OR'];
6627
+ const addOperator = (val, i, type) => {
6628
+ let newMeta = store.metaList.slice();
6629
+ let _filter = filter.slice();
6630
+ if (type === 'before') {
6631
+ _filter.splice(i, 0, val);
6632
+ } else {
6633
+ _filter.splice(i + 1, 0, val);
6634
+ }
6635
+ newMeta[index].filter = [..._filter];
6636
+ setInd(-1);
6637
+ };
6493
6638
  return jsx(Wrapper, {
6494
6639
  className: `Sqb-item`,
6495
6640
  children: jsxs("div", {
@@ -6507,14 +6652,80 @@ const Filter = props => {
6507
6652
  className: `Sqb-NotebookCell gray-bg`,
6508
6653
  children: [filter.map((v, i) => {
6509
6654
  return jsxs("div", {
6510
- className: `Sqb-TableName purple-name`,
6511
- onClick: e => handleUpdate(e, i),
6512
- children: [v.quotes, jsx("span", {
6513
- style: {
6514
- fontSize: 0
6655
+ className: cx('Sqb-Filter-item', {
6656
+ hover: ind === i
6657
+ }),
6658
+ onMouseEnter: e => {
6659
+ setInd(i);
6660
+ },
6661
+ onMouseLeave: () => {
6662
+ setInd(-1);
6663
+ },
6664
+ children: [jsx(Select, {
6665
+ trigger: 'hover',
6666
+ triggerProps: {
6667
+ clickToClose: true
6515
6668
  },
6516
- onClick: e => handleDel(e, i),
6517
- children: jsx(CloseIcon, {})
6669
+ triggerElement: () => {
6670
+ return jsx("div", {
6671
+ className: 'left-arrow',
6672
+ onClick: handleAdd,
6673
+ "v-index": i,
6674
+ "v-type": 'before',
6675
+ children: jsx("img", {
6676
+ src: img
6677
+ })
6678
+ });
6679
+ },
6680
+ onChange: val => {
6681
+ addOperator(val, i, 'before');
6682
+ },
6683
+ children: options.map(option => jsx(Select.Option, {
6684
+ value: option,
6685
+ children: option
6686
+ }, option))
6687
+ }), typeof v === 'string' ? jsxs("div", {
6688
+ className: `Sqb-TableName purple-name`,
6689
+ children: [v, jsx("span", {
6690
+ style: {
6691
+ fontSize: 0
6692
+ },
6693
+ onClick: e => handleDel(e, i),
6694
+ children: jsx(CloseIcon, {})
6695
+ })]
6696
+ }, i) : jsxs("div", {
6697
+ className: `Sqb-TableName purple-name`,
6698
+ onClick: e => handleUpdate(e, i),
6699
+ children: [v.quotes, jsx("span", {
6700
+ style: {
6701
+ fontSize: 0
6702
+ },
6703
+ onClick: e => handleDel(e, i),
6704
+ children: jsx(CloseIcon, {})
6705
+ })]
6706
+ }, i), jsx(Select, {
6707
+ trigger: 'hover',
6708
+ triggerProps: {
6709
+ clickToClose: true
6710
+ },
6711
+ triggerElement: value => {
6712
+ return jsx("div", {
6713
+ className: 'right-arrow',
6714
+ onClick: handleAdd,
6715
+ "v-index": i,
6716
+ "v-type": 'after',
6717
+ children: jsx("img", {
6718
+ src: img
6719
+ })
6720
+ });
6721
+ },
6722
+ onChange: val => {
6723
+ addOperator(val, i, 'after');
6724
+ },
6725
+ children: options.map(option => jsx(Select.Option, {
6726
+ value: option,
6727
+ children: option
6728
+ }, option))
6518
6729
  })]
6519
6730
  }, i);
6520
6731
  }), jsx("div", {
@@ -6523,6 +6734,15 @@ const Filter = props => {
6523
6734
  }),
6524
6735
  onClick: handleAdd,
6525
6736
  children: notSelected ? __('filter.addFiltersToNarrowDownYourAnswers') : jsx(AddIcon, {})
6737
+ }), Array.from(filter).length > 0 && jsxs("p", {
6738
+ className: 'Sqb-NotebookCell-preview',
6739
+ children: ["\u9884\u89C8\uFF1A", filter.map((v, i) => {
6740
+ if (typeof v === 'string') {
6741
+ return v;
6742
+ } else {
6743
+ return v.quotes;
6744
+ }
6745
+ })]
6526
6746
  })]
6527
6747
  })
6528
6748
  }), jsx(NextDom, {
@@ -7229,7 +7449,7 @@ const RowLimit = props => {
7229
7449
  className: cx(`Sqb-item--content`),
7230
7450
  children: jsx("div", {
7231
7451
  className: cx(`Sqb-NotebookCell gray-bg`),
7232
- children: jsx(InputNumber, {
7452
+ children: jsx(InputNumber$1, {
7233
7453
  value: meta.limit,
7234
7454
  min: 1,
7235
7455
  style: {