@gingkoo/pandora-metabase 0.0.28 → 0.0.29
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 +23 -21
- package/lib/es/index.js.map +1 -1
- package/package.json +1 -1
package/lib/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @gingkoo/pandora-metabase v0.0.
|
|
2
|
+
* @gingkoo/pandora-metabase v0.0.29
|
|
3
3
|
*/
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import * as React from 'react';
|
|
@@ -1105,7 +1105,8 @@ register('en', {
|
|
|
1105
1105
|
'filter.contain': 'contain',
|
|
1106
1106
|
'filter.notInclude': 'not include',
|
|
1107
1107
|
'filter.startWith': 'start with',
|
|
1108
|
-
'filter.within': '
|
|
1108
|
+
'filter.within': 'IN',
|
|
1109
|
+
'filter.withnotin': 'NOT IN',
|
|
1109
1110
|
'filter.endWith': 'end with',
|
|
1110
1111
|
'filter.earlierThan': 'earlier than',
|
|
1111
1112
|
'filter.laterThan': 'later than',
|
|
@@ -1234,7 +1235,8 @@ register('zh', {
|
|
|
1234
1235
|
'filter.contain': '包含',
|
|
1235
1236
|
'filter.notInclude': '不包含',
|
|
1236
1237
|
'filter.startWith': '以...开始',
|
|
1237
|
-
'filter.within': '
|
|
1238
|
+
'filter.within': 'IN',
|
|
1239
|
+
'filter.withnotin': 'NOT IN',
|
|
1238
1240
|
'filter.endWith': '以...结束',
|
|
1239
1241
|
'filter.earlierThan': '早于',
|
|
1240
1242
|
'filter.laterThan': '晚于',
|
|
@@ -4028,14 +4030,14 @@ const SelectJoinColumn = ({
|
|
|
4028
4030
|
});
|
|
4029
4031
|
};
|
|
4030
4032
|
|
|
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:
|
|
4033
|
+
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 flex: 1;\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: 25px;\n margin: 0 5px;\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 flex-grow: 1;\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 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";
|
|
4032
4034
|
styleInject(css_248z$4);
|
|
4033
4035
|
|
|
4034
4036
|
const {
|
|
4035
4037
|
RangePicker
|
|
4036
4038
|
} = DatePicker;
|
|
4037
|
-
const NUMBER_LIST = ['等于', '不等于', '大于', '小于', '介于之间', '大于或等于', '小于或等于', '为空', '不为空', 'In'];
|
|
4038
|
-
const STRING_LIST = ['等于', '不等于', '包含', '不包含', '为空', '不为空', '以...开始', '以...结束', 'In'];
|
|
4039
|
+
const NUMBER_LIST = ['等于', '不等于', '大于', '小于', '介于之间', '大于或等于', '小于或等于', '为空', '不为空', 'In', 'Not In'];
|
|
4040
|
+
const STRING_LIST = ['等于', '不等于', '包含', '不包含', '为空', '不为空', '以...开始', '以...结束', 'In', 'Not In'];
|
|
4039
4041
|
const DATE_LIST = [
|
|
4040
4042
|
// '前', '下一个', '当前',
|
|
4041
4043
|
'早于', '晚于',
|
|
@@ -4056,7 +4058,7 @@ const SelectFilterColumn = ({
|
|
|
4056
4058
|
let table2Selected = Boolean(curColumn.table2?.name);
|
|
4057
4059
|
const disabled = useMemo(() => {
|
|
4058
4060
|
if (!condition) return true;
|
|
4059
|
-
if (curColumn.table2?.id && ~['
|
|
4061
|
+
if (curColumn.table2?.id && ~['等于', '不等于'].indexOf(condition)) {
|
|
4060
4062
|
return false;
|
|
4061
4063
|
}
|
|
4062
4064
|
if (~['为空', '不为空', '是空的', '不是空的'].indexOf(condition)) {
|
|
@@ -4150,6 +4152,9 @@ const SelectFilterColumn = ({
|
|
|
4150
4152
|
} else if (condition === 'In') {
|
|
4151
4153
|
let cond = __('filter.within');
|
|
4152
4154
|
quotes = getQuotesName(curColumn.name) + ' ' + cond + ' ' + `(${firstVal})`;
|
|
4155
|
+
} else if (condition === 'Not In') {
|
|
4156
|
+
let cond = __('filter.withnotin');
|
|
4157
|
+
quotes = getQuotesName(curColumn.name) + ' ' + cond + ' ' + `(${firstVal})`;
|
|
4153
4158
|
} else {
|
|
4154
4159
|
let cond = __({
|
|
4155
4160
|
等于: 'filter.equal',
|
|
@@ -4161,8 +4166,6 @@ const SelectFilterColumn = ({
|
|
|
4161
4166
|
小于或等于: 'filter.lessThanOrEqualTo',
|
|
4162
4167
|
为空: 'filter.empty',
|
|
4163
4168
|
不为空: 'filter.notEmpty',
|
|
4164
|
-
是: 'filter.is',
|
|
4165
|
-
不是: 'filter.isNo',
|
|
4166
4169
|
包含: 'filter.contain',
|
|
4167
4170
|
不包含: 'filter.notInclude',
|
|
4168
4171
|
'以...开始': 'filter.startWith',
|
|
@@ -4388,7 +4391,7 @@ const SelectFilterColumn = ({
|
|
|
4388
4391
|
}
|
|
4389
4392
|
})
|
|
4390
4393
|
});
|
|
4391
|
-
} else if (~['In'].indexOf(conditionText)) {
|
|
4394
|
+
} else if (~['In', 'Not In'].indexOf(conditionText)) {
|
|
4392
4395
|
const options = firstVal?.split(',') || [];
|
|
4393
4396
|
return jsx("div", {
|
|
4394
4397
|
children: jsx(Select, {
|
|
@@ -4406,7 +4409,7 @@ const SelectFilterColumn = ({
|
|
|
4406
4409
|
}, option))
|
|
4407
4410
|
})
|
|
4408
4411
|
});
|
|
4409
|
-
} else if (~['等于', '不等于', '大于', '小于', '大于或等于', '小于或等于', '
|
|
4412
|
+
} else if (~['等于', '不等于', '大于', '小于', '大于或等于', '小于或等于', '包含', '不包含', '以...开始', '以...结束'].indexOf(conditionText)) {
|
|
4410
4413
|
return jsx("div", {
|
|
4411
4414
|
children: jsx(Input, {
|
|
4412
4415
|
className: 'input',
|
|
@@ -4472,8 +4475,6 @@ const SelectFilterColumn = ({
|
|
|
4472
4475
|
小于或等于: 'filter.lessThanOrEqualTo',
|
|
4473
4476
|
为空: 'filter.empty',
|
|
4474
4477
|
不为空: 'filter.notEmpty',
|
|
4475
|
-
是: 'filter.is',
|
|
4476
|
-
不是: 'filter.isNo',
|
|
4477
4478
|
包含: 'filter.contain',
|
|
4478
4479
|
不包含: 'filter.notInclude',
|
|
4479
4480
|
'以...开始': 'filter.startWith',
|
|
@@ -4481,7 +4482,8 @@ const SelectFilterColumn = ({
|
|
|
4481
4482
|
早于: 'filter.earlierThan',
|
|
4482
4483
|
晚于: 'filter.laterThan',
|
|
4483
4484
|
是空的: 'filter.isEmpty',
|
|
4484
|
-
In: 'filter.within'
|
|
4485
|
+
In: 'filter.within',
|
|
4486
|
+
'Not In': 'filter.withnotin'
|
|
4485
4487
|
}[v])
|
|
4486
4488
|
};
|
|
4487
4489
|
});
|
|
@@ -4533,11 +4535,11 @@ const SelectFilterColumn = ({
|
|
|
4533
4535
|
const getName = name => {
|
|
4534
4536
|
switch (formula.type) {
|
|
4535
4537
|
case 'SUBSTR':
|
|
4536
|
-
// let str = formula.params?.join(',');
|
|
4537
4538
|
return jsxs("div", {
|
|
4538
|
-
children: ["SUBSTR
|
|
4539
|
+
children: ["SUBSTR(", name, ",", jsx(InputNumber, {
|
|
4539
4540
|
className: 'left-info-formula-input',
|
|
4540
4541
|
hideControl: true,
|
|
4542
|
+
placeholder: '',
|
|
4541
4543
|
onClick: e => {
|
|
4542
4544
|
e.stopPropagation();
|
|
4543
4545
|
return false;
|
|
@@ -4551,6 +4553,7 @@ const SelectFilterColumn = ({
|
|
|
4551
4553
|
className: 'left-info-formula-input',
|
|
4552
4554
|
hideControl: true,
|
|
4553
4555
|
quickEdit: true,
|
|
4556
|
+
placeholder: '',
|
|
4554
4557
|
onClick: e => {
|
|
4555
4558
|
e.stopPropagation();
|
|
4556
4559
|
return false;
|
|
@@ -4612,8 +4615,6 @@ const SelectFilterColumn = ({
|
|
|
4612
4615
|
小于或等于: 'filter.lessThanOrEqualTo',
|
|
4613
4616
|
为空: 'filter.empty',
|
|
4614
4617
|
不为空: 'filter.notEmpty',
|
|
4615
|
-
是: 'filter.is',
|
|
4616
|
-
不是: 'filter.isNo',
|
|
4617
4618
|
包含: 'filter.contain',
|
|
4618
4619
|
不包含: 'filter.notInclude',
|
|
4619
4620
|
'以...开始': 'filter.startWith',
|
|
@@ -4621,7 +4622,8 @@ const SelectFilterColumn = ({
|
|
|
4621
4622
|
早于: 'filter.earlierThan',
|
|
4622
4623
|
晚于: 'filter.laterThan',
|
|
4623
4624
|
是空的: 'filter.isEmpty',
|
|
4624
|
-
In: 'filter.within'
|
|
4625
|
+
In: 'filter.within',
|
|
4626
|
+
'Not In': 'filter.withnotin'
|
|
4625
4627
|
}[condition]), jsx(DownOutlined, {})]
|
|
4626
4628
|
})
|
|
4627
4629
|
})
|
|
@@ -4637,7 +4639,7 @@ const SelectFilterColumn = ({
|
|
|
4637
4639
|
}) : jsx("div", {
|
|
4638
4640
|
className: 'content_l',
|
|
4639
4641
|
children: renderFilter(type, condition)
|
|
4640
|
-
}), ~['
|
|
4642
|
+
}), ~['等于', '不等于'].indexOf(condition) ? jsx(Tooltip, {
|
|
4641
4643
|
title: __('SqlQueryBuilder.switch'),
|
|
4642
4644
|
children: jsx(Button, {
|
|
4643
4645
|
primary: true,
|
|
@@ -6742,7 +6744,7 @@ const Filter = props => {
|
|
|
6742
6744
|
} else {
|
|
6743
6745
|
return v.quotes;
|
|
6744
6746
|
}
|
|
6745
|
-
})]
|
|
6747
|
+
}).join(' ')]
|
|
6746
6748
|
})]
|
|
6747
6749
|
})
|
|
6748
6750
|
}), jsx(NextDom, {
|