@cloudbase/weda-ui 3.12.2 → 3.13.0
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/dist/configs/components/listView.js +13 -26
- package/dist/configs/components/wd-ad.d.ts +3 -0
- package/dist/configs/components/wd-ad.js +3 -3
- package/dist/configs/components/wd-select-multiple.d.ts +2 -0
- package/dist/configs/components/wd-select-multiple.js +9 -7
- package/dist/configs/components/wd-select.d.ts +2 -0
- package/dist/configs/components/wd-select.js +9 -7
- package/dist/configs/components/wd-side-tab.js +16 -1
- package/dist/configs/components/wd-store-home.d.ts +36 -0
- package/dist/configs/components/wd-store-home.js +38 -0
- package/dist/configs/components/wd-store-product.d.ts +106 -0
- package/dist/configs/components/wd-store-product.js +102 -0
- package/dist/configs/components/wd-table.js +1 -1
- package/dist/configs/index.d.ts +214 -0
- package/dist/configs/index.js +4 -0
- package/dist/style/weda-ui.min.css +52 -2
- package/dist/web/components/flow/process/constants.d.ts +3 -3
- package/dist/web/components/form/uploaderFile/index.css +23 -71
- package/dist/web/components/index.d.ts +2 -0
- package/dist/web/components/index.js +2 -0
- package/dist/web/components/wd-ad/style/view.css +1 -1
- package/dist/web/components/wd-icon/wd-icon.d.ts +1 -0
- package/dist/web/components/wd-icon/wd-icon.js +4 -9
- package/dist/web/components/wd-select/relationSelect/relationSelect.js +14 -10
- package/dist/web/components/wd-select/select/selectUI.js +11 -12
- package/dist/web/components/wd-select/wd-select.js +3 -3
- package/dist/web/components/wd-select-multiple/wd-select-multiple.js +3 -3
- package/dist/web/components/wd-store-home/index.css +81 -0
- package/dist/web/components/wd-store-home/index.d.ts +8 -0
- package/dist/web/components/wd-store-home/index.js +6 -0
- package/dist/web/components/wd-store-home/style.d.ts +2 -0
- package/dist/web/components/wd-store-home/style.js +2 -0
- package/dist/web/components/wd-store-product/index.d.ts +8 -0
- package/dist/web/components/wd-store-product/index.js +7 -0
- package/dist/web/components/wd-store-product/style.d.ts +2 -0
- package/dist/web/components/wd-store-product/style.js +2 -0
- package/dist/web/components/wd-table/hooks/useChooseList.d.ts +1 -1
- package/dist/web/components/wd-table/hooks/useChooseList.js +5 -4
- package/dist/web/components/wd-tabs/util.js +2 -4
- package/dist/web/utils/loadIconCss.d.ts +2 -1
- package/dist/web/utils/loadIconCss.js +33 -0
- package/package.json +3 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CommonPropsType } from '../../types';
|
|
3
|
+
import type { DataType } from '../../../configs/components/wd-store-product';
|
|
4
|
+
import './style';
|
|
5
|
+
export type PropsType = CommonPropsType;
|
|
6
|
+
export default function WdStoreProduct(): JSX.Element;
|
|
7
|
+
export interface WdStoreProductProps extends CommonPropsType, DataType {
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ConfigProvider, Bubble } from 'tea-component';
|
|
3
|
+
import './style';
|
|
4
|
+
import WdButton from '../wd-button';
|
|
5
|
+
export default function WdStoreProduct() {
|
|
6
|
+
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsx(Bubble, { placement: "auto", openDelay: 300, content: _jsxs(_Fragment, { children: ["\u8BE5\u7EC4\u4EF6\u5FC5\u987B\u5728\u5C0F\u7A0B\u5E8F\u771F\u5B9E\u73AF\u5883\u4F7F\u7528\u624D\u80FD\u591F\u770B\u5230\u5B9E\u9645\u6548\u679C\u3002", _jsx("br", {}), _jsx("a", { href: "https://developers.weixin.qq.com/miniprogram/dev/component/store-product.html", target: "_blank", rel: "noreferrer", children: "\u67E5\u770B\u8BF4\u660E" })] }), children: _jsxs("div", { className: "wd-store-product__wrap", children: [_jsxs("div", { className: "wd-store-home__content", children: [_jsx("img", { className: "wd-store-product__img", src: "https://qcloudimg.tencent-cloud.cn/raw/4a29d51b504f12b4933ce4490110b4dc.svg", alt: "" }), _jsxs("div", { className: "wd-store-product__text", children: [_jsxs("div", { children: [_jsx("p", { className: "wd-store-home__title", children: "\u5546\u54C1\u540D\u79F0" }), _jsx("span", { className: "wd-store-home__label", children: "\u5546\u54C1\u6807\u7B7E" })] }), _jsxs("div", { className: "wd-store-product__text__footer", children: [_jsx("p", { className: "price", children: "\u00A5\u4EF7\u683C \u8D77" }), " ", _jsx(WdButton, { text: "\u8D2D\u4E70" })] })] })] }), _jsxs("div", { className: "wd-store-home__footer", children: [_jsx("i", { className: "wd-store-home__icon" }), "\u5C0F\u5E97\u540D\u79F0"] })] }) }) }));
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const getDataBaseInfo: (fields: any, format: any, childDbName: any) => any;
|
|
2
2
|
export declare const mapResult: (records: any, primaryColumn: any) => any;
|
|
3
|
-
export declare const useChooseList: ({ dataSourceAPI, queryParams, childDbName, primaryColumn, value
|
|
3
|
+
export declare const useChooseList: ({ dataSourceAPI, queryParams, childDbName, primaryColumn, value }: {
|
|
4
4
|
dataSourceAPI: any;
|
|
5
5
|
queryParams: any;
|
|
6
6
|
childDbName: any;
|
|
@@ -35,20 +35,21 @@ export const getDataBaseInfo = (fields, format, childDbName) => {
|
|
|
35
35
|
};
|
|
36
36
|
export const mapResult = (records, primaryColumn) => {
|
|
37
37
|
return records === null || records === void 0 ? void 0 : records.map((childItem) => ({
|
|
38
|
+
_id: childItem._id,
|
|
38
39
|
value: childItem._id,
|
|
39
40
|
text: childItem[primaryColumn] ? childItem[primaryColumn] : childItem._id,
|
|
40
41
|
label: childItem[primaryColumn] ? childItem[primaryColumn] : childItem._id,
|
|
41
42
|
extra: childItem,
|
|
42
43
|
}));
|
|
43
44
|
};
|
|
44
|
-
export const useChooseList = ({ dataSourceAPI, queryParams, childDbName, primaryColumn, value
|
|
45
|
+
export const useChooseList = ({ dataSourceAPI, queryParams, childDbName, primaryColumn, value }) => {
|
|
45
46
|
const [option, setOption] = useState([]);
|
|
46
47
|
const [total, setTotal] = useState(0);
|
|
47
48
|
const [loading, setLoading] = useState(true);
|
|
48
|
-
const unshiftVal = (transformedRecords, itemResult) => {
|
|
49
|
+
const unshiftVal = (transformedRecords, itemResult, originOption) => {
|
|
49
50
|
if (itemResult &&
|
|
50
51
|
transformedRecords.findIndex((item) => item._id === itemResult._id) < 0 &&
|
|
51
|
-
|
|
52
|
+
originOption.findIndex((item) => item._id === itemResult._id) < 0) {
|
|
52
53
|
return [itemResult, ...transformedRecords];
|
|
53
54
|
}
|
|
54
55
|
return transformedRecords;
|
|
@@ -83,7 +84,7 @@ export const useChooseList = ({ dataSourceAPI, queryParams, childDbName, primary
|
|
|
83
84
|
// 若下拉列表中无选中值,则将选中值插到数组头部
|
|
84
85
|
if ((isMultiple && (value === null || value === void 0 ? void 0 : value.length)) || value) {
|
|
85
86
|
itemResult.forEach((i) => {
|
|
86
|
-
transformedRecords = unshiftVal(transformedRecords, i);
|
|
87
|
+
transformedRecords = unshiftVal(transformedRecords, i, option);
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
let optionRes = mapResult(transformedRecords, primaryColumn);
|
|
@@ -10,12 +10,10 @@ export const renderSlot = (props) => {
|
|
|
10
10
|
const { tabsDatas, selectedTab, isMultipleSlot } = props;
|
|
11
11
|
if (props.isSlotAuto) {
|
|
12
12
|
const slot = getSlots(props);
|
|
13
|
-
const slotKey = (
|
|
13
|
+
const slotKey = isMultipleSlot ? (_a = tabsDatas[selectedTab]) === null || _a === void 0 ? void 0 : _a.slotKey : '1';
|
|
14
14
|
return slot[`${TAB_SLOT_PREFIX}_${slotKey}`];
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
|
-
return isMultipleSlot
|
|
18
|
-
? props[`panel${selectedTab + Number('1')}`]
|
|
19
|
-
: props[`panel1`];
|
|
17
|
+
return isMultipleSlot ? props[`panel${selectedTab + Number('1')}`] : props[`panel1`];
|
|
20
18
|
}
|
|
21
19
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function getShadowRoot(): any;
|
|
2
|
+
export function loadIconShadowRoot(url: any, className: any): Promise<any>;
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import cfg from '../../iconConfig.json';
|
|
2
2
|
import { getUrlPath } from './tool';
|
|
3
3
|
import { errorHandler } from './error';
|
|
4
|
+
let shadowRootCache = null;
|
|
5
|
+
const WEDA_PORTAL_ID = 'weda-module-portal';
|
|
6
|
+
export function getShadowRoot() {
|
|
7
|
+
var _a;
|
|
8
|
+
if (!shadowRootCache) {
|
|
9
|
+
shadowRootCache = (_a = document.getElementById(WEDA_PORTAL_ID)) === null || _a === void 0 ? void 0 : _a.shadowRoot;
|
|
10
|
+
}
|
|
11
|
+
return shadowRootCache;
|
|
12
|
+
}
|
|
13
|
+
// 影子dom加载图标库
|
|
14
|
+
export function loadIconShadowRoot(url, className) {
|
|
15
|
+
const shadowRoot = getShadowRoot();
|
|
16
|
+
if (!shadowRoot) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
if (!url || typeof url !== 'string') {
|
|
21
|
+
reject();
|
|
22
|
+
}
|
|
23
|
+
else if (shadowRoot.querySelectorAll('.'.concat(className, '[href="').concat(url, '"]')).length > 0) {
|
|
24
|
+
resolve(true);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const l = document.createElement('link');
|
|
28
|
+
l.setAttribute('class', className);
|
|
29
|
+
l.setAttribute('href', url);
|
|
30
|
+
l.setAttribute('rel', 'stylesheet');
|
|
31
|
+
shadowRoot.head.appendChild(l);
|
|
32
|
+
l.addEventListener('load', () => resolve(true));
|
|
33
|
+
l.addEventListener('error', () => reject());
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
4
37
|
// 加载样式,失败抛出错误
|
|
5
38
|
function loadLink(url, className) {
|
|
6
39
|
return new Promise((resolve, reject) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index",
|
|
6
6
|
"miniprogram": "mpdist",
|
|
@@ -148,8 +148,8 @@
|
|
|
148
148
|
"@babel/preset-react": "^7.22.15",
|
|
149
149
|
"@babel/preset-typescript": "^7.22.15",
|
|
150
150
|
"@cloudbase/cals": "^1.2.5",
|
|
151
|
-
"@cloudbase/lowcode-cli": "^0.
|
|
152
|
-
"@cloudbase/weda-cloud-sdk": "^1.0.
|
|
151
|
+
"@cloudbase/lowcode-cli": "^0.22.0",
|
|
152
|
+
"@cloudbase/weda-cloud-sdk": "^1.0.94",
|
|
153
153
|
"@commitlint/cli": "^16.0.2",
|
|
154
154
|
"@commitlint/config-conventional": "^17.7.0",
|
|
155
155
|
"@craco/craco": "^7.1.0",
|