Skip to content

Commit

Permalink
Merge pull request #598 from lowcoder-org/dev
Browse files Browse the repository at this point in the history
Dev -> Main - Bugfixes
  • Loading branch information
FalkWolsky authored Dec 21, 2023
2 parents 848d786 + cb48221 commit e3d1e44
Show file tree
Hide file tree
Showing 40 changed files with 665 additions and 418 deletions.
2 changes: 1 addition & 1 deletion client/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.1
dev
226 changes: 113 additions & 113 deletions client/packages/lowcoder-core/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,118 +1,118 @@
import _ from 'lodash';
import { serialize, compile, middleware, prefixer, stringify } from 'stylis';

/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol */

var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};

function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};

function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}

function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}

function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}

function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}

function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}

typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};

function isEqualArgs(args, cacheArgs, equals) {
Expand Down Expand Up @@ -11400,7 +11400,7 @@ var IntlMessageFormat$1 = /** @class */ (function () {
this.ast = message;
}
if (!Array.isArray(this.ast)) {
throw new TypeError('A message must be provided as a String or AST.');
throw new TypeError('A message must be provided as a String or AST. ' + this.ast);
}
// Creates a new object with the specified `formats` merged with the default
// formats.
Expand Down
25 changes: 16 additions & 9 deletions client/packages/lowcoder-design/src/components/CustomModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function CustomModalRender(props: CustomModalProps & ModalFuncProps) {
/>
</ModalHeaderWrapper>

<div style={{ padding: "0 16px", ...props.bodyStyle }}>{props.children}</div>
<div style={{ padding: "0 16px", ...props.styles?.body }}>{props.children}</div>

{props.footer === null || props.footer ? (
props.footer
Expand Down Expand Up @@ -280,13 +280,15 @@ CustomModal.confirm = (props: {
...DEFAULT_PROPS,
okText: trans("ok"),
cancelText: trans("cancel"),
bodyStyle: {
fontSize: "14px",
color: "#333333",
lineHeight: "22px",
minHeight: "72px",
marginTop: "24px",
},
styles: {
body: {
fontSize: "14px",
color: "#333333",
lineHeight: "22px",
minHeight: "72px",
marginTop: "24px",
}
}
};
// create model
const model = modalInstance.confirm({
Expand Down Expand Up @@ -321,7 +323,12 @@ CustomModal.confirm = (props: {
title={title}
okButtonType={props.confirmBtnType}
okText={props.okText}
bodyStyle={{ ...defaultConfirmProps.bodyStyle, ...props.bodyStyle }}
styles={{
body: {
...defaultConfirmProps.styles?.body,
...props.bodyStyle,
}
}}
footer={props.footer}
width={props.width}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function Modal(props: ModalProps) {
resizeHandles,
width: modalWidth,
height: modalHeight,
bodyStyle,
styles,
children,
...otherProps
} = props;
Expand All @@ -53,7 +53,12 @@ export function Modal(props: ModalProps) {
return (
<AntdModal
width={width ?? modalWidth}
bodyStyle={{ height: height ?? modalHeight, ...bodyStyle }}
styles={{
body: {
height: height ?? modalHeight,
...styles?.body,
}
}}
{...otherProps}
>
<Resizable
Expand Down
1 change: 0 additions & 1 deletion client/packages/lowcoder-design/src/components/toolTip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ function ToolTipLabel(
placement="top"
defaultOpen={false}
trigger="hover"
popupVisible={!!title}
style={tooltipStyle}
{...restProps}
>
Expand Down
2 changes: 2 additions & 0 deletions client/packages/lowcoder-design/src/i18n/design/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const zh = {
validation: "验证",
layout: "布局",
style: "样式",
meetings: "会议",
data: "数据",
},
passwordInput: {
label: "密码:",
Expand Down
2 changes: 1 addition & 1 deletion client/packages/lowcoder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"agora-rtc-sdk-ng": "^4.19.0",
"agora-rtm-sdk": "^1.5.1",
"ali-oss": "^6.17.1",
"antd": "5.7.2",
"antd": "^5.12.2",
"antd-img-crop": "^4.12.2",
"axios": "^0.21.1",
"buffer": "^6.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export function resolveParsedValue(files: UploadFile[]) {
.then((a) => {
const ext = mime.getExtension(f.originFileObj?.type ?? "");
if (ext === "xlsx" || ext === "csv") {
const workbook = XLSX.read(a, { raw: true });
const workbook = XLSX.read(a, { raw: true, codepage: 65001 });
return XLSX.utils.sheet_to_json(workbook.Sheets[workbook.SheetNames[0]], {
raw: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ export const CreateForm = (props: { onCreate: CreateHandler }) => {
onCancel={() => setVisible(false)}
width="600px"
children={<CreateFormBody {...props} />}
bodyStyle={{ padding: 0 }}
styles={{ body: {padding: 0} }}
/>
</div>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,11 @@ let MTComp = (function () {
: {}
}
contentWrapperStyle={{ maxHeight: "100%", maxWidth: "100%" }}
bodyStyle={{
padding: 0,
backgroundColor: props.style.background,
styles={{
body: {
padding: 0,
backgroundColor: props.style.background,
}
}}
closable={false}
placement={props.placement}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ export const LabelControl = (function () {
}}
placement="top"
color="#2c2c2c"
popupVisible={!!props.tooltip}
getPopupContainer={(node: any) => node.closest(".react-grid-item")}
>
<Label border={!!props.tooltip}>{props.text}</Label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function ModalConfigView(props: {
onCancel={onCancel}
getContainer={() => document.querySelector(`#${CanvasContainerID}`) || document.body}
footer={null}
bodyStyle={{ padding: "0" }}
styles={{ body: {padding: "0"} }}
zIndex={Layers.modal}
modalRender={(node) => (
<ModalStyled $background={background} onClick={() => {}}>
Expand Down
Loading

0 comments on commit e3d1e44

Please sign in to comment.