@pisell/materials 1.0.1024 → 1.0.1025
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +15 -15
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +23 -18
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +32 -27
- package/es/components/dataSourceComponents/fields/Input.Password/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Url/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Switch/index.d.ts +2 -2
- package/es/components/page/index.js +5 -12
- package/es/components/pisellModal/index.d.ts +6 -6
- package/es/components/productCard/components/Time/components/SelectHolder/index.js +2 -1
- package/es/components/radio/index.d.ts +2 -2
- package/es/components/section-footers/index.d.ts +2 -2
- package/es/components/skeleton/index.d.ts +2 -2
- package/es/components/time-picker/index.d.ts +2 -2
- package/es/components/upload/index.d.ts +2 -2
- package/es/components/virtualInput/BaseVirtualInput/index.less +2 -2
- package/es/components/virtualInput/index.d.ts +5 -0
- package/es/components/virtualInput/index.js +6 -3
- package/es/hooks/useThemeTokens.js +19 -0
- package/lib/components/page/index.js +4 -11
- package/lib/components/productCard/components/Time/components/SelectHolder/index.js +2 -1
- package/lib/components/time-picker/index.d.ts +2 -2
- package/lib/components/upload/index.d.ts +2 -2
- package/lib/components/virtualInput/BaseVirtualInput/index.less +2 -2
- package/lib/components/virtualInput/index.d.ts +5 -0
- package/lib/components/virtualInput/index.js +6 -3
- package/lib/hooks/useThemeTokens.js +20 -0
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd21 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import * as antd_es_input3 from "antd/es/input";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Input.Password/index.d.ts
|
|
7
|
-
declare const Password: React.FC<antd_es_input3.PasswordProps & React.RefAttributes<
|
|
7
|
+
declare const Password: React.FC<antd_es_input3.PasswordProps & React.RefAttributes<antd21.InputRef> & WithModeProps & WithFormItemProps>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Password };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd22 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts
|
|
6
|
-
declare const Subdomain: React.FC<
|
|
6
|
+
declare const Subdomain: React.FC<antd22.InputProps & {
|
|
7
7
|
onChange: (value: string) => void;
|
|
8
8
|
onBlur?: ((e: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
9
9
|
rootDomain: "custom" | "saas" | "xzero";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd18 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/dataSourceComponents/fields/Input.Url/index.d.ts
|
|
6
|
-
declare const Url: React.FC<
|
|
6
|
+
declare const Url: React.FC<antd18.InputProps & React.RefAttributes<antd18.InputRef> & WithModeProps & WithFormItemProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { Url };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd15 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import * as antd_es_select0 from "antd/es/select";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Select/index.d.ts
|
|
7
|
-
declare const SelectWithDataSource: (props:
|
|
7
|
+
declare const SelectWithDataSource: (props: antd15.SelectProps<any, antd_es_select0.DefaultOptionType> & WithModeProps & WithFormItemProps & {
|
|
8
8
|
options?: any;
|
|
9
9
|
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
10
10
|
labelField: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd14 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/dataSourceComponents/fields/Switch/index.d.ts
|
|
6
|
-
declare const Switch$1: React.FC<
|
|
6
|
+
declare const Switch$1: React.FC<antd14.SwitchProps & React.RefAttributes<HTMLElement> & WithModeProps & WithFormItemProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { Switch$1 as Switch };
|
|
@@ -5,7 +5,7 @@ import config_provider_default from "../config-provider/index.js";
|
|
|
5
5
|
import VariablesProvider_default from "../dataSourceComponents/provider/variables/VariablesProvider.js";
|
|
6
6
|
import pisell_config_provider_default from "../pisell-config-provider/index.js";
|
|
7
7
|
import { getThemeConfig } from "../../theme/tokens.js";
|
|
8
|
-
import { App
|
|
8
|
+
import { App } from "antd";
|
|
9
9
|
import React, { useMemo } from "react";
|
|
10
10
|
import { LocaleProvider, LocalizationProvider, ThemeProvider, createTheme } from "@pisell/date-picker";
|
|
11
11
|
import zhCN from "antd/es/locale/zh_CN";
|
|
@@ -38,19 +38,15 @@ const localeDateMap = {
|
|
|
38
38
|
"zh-CN": { adapterLocale: "zh-cn" }
|
|
39
39
|
};
|
|
40
40
|
const Page = (props) => {
|
|
41
|
-
var _context$appHelper, _context$engine,
|
|
41
|
+
var _context$appHelper, _context$engine, _localeDateMap, _context$engine2;
|
|
42
42
|
const { children, style, className, locale: propsLocale, variablesConfig, isRenderPisellConfigProvider = true } = props, others = _objectWithoutProperties(props, _excluded);
|
|
43
43
|
const context = useEngineContext_default();
|
|
44
44
|
const { platform, themeColor } = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.constants) || {};
|
|
45
45
|
const locale = propsLocale || (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || "en";
|
|
46
|
-
const baseColorPrimary = (props === null || props === void 0 || (_props$theme = props.theme) === null || _props$theme === void 0 || (_props$theme = _props$theme.token) === null || _props$theme === void 0 ? void 0 : _props$theme.colorPrimary) || themeColor || "#5D3F9F";
|
|
47
|
-
const computedAntToken = useMemo(() => {
|
|
48
|
-
return theme.getDesignToken({ token: { colorPrimary: baseColorPrimary } });
|
|
49
|
-
}, [baseColorPrimary]);
|
|
50
46
|
const theme$1 = useMemo(() => {
|
|
51
47
|
if (props === null || props === void 0 ? void 0 : props.theme) {
|
|
52
|
-
var _props$
|
|
53
|
-
return _objectSpread2(_objectSpread2({}, props.theme), {}, { token: _objectSpread2(_objectSpread2({}, props.theme.token), {}, { colorPrimary: (props === null || props === void 0 || (_props$
|
|
48
|
+
var _props$theme;
|
|
49
|
+
return _objectSpread2(_objectSpread2({}, props.theme), {}, { token: _objectSpread2(_objectSpread2({}, props.theme.token), {}, { colorPrimary: (props === null || props === void 0 || (_props$theme = props.theme) === null || _props$theme === void 0 || (_props$theme = _props$theme.token) === null || _props$theme === void 0 ? void 0 : _props$theme.colorPrimary) || themeColor || "#5D3F9F" }) });
|
|
54
50
|
}
|
|
55
51
|
return getThemeConfig(themeColor);
|
|
56
52
|
}, [themeColor, props === null || props === void 0 ? void 0 : props.theme]);
|
|
@@ -73,10 +69,7 @@ const Page = (props) => {
|
|
|
73
69
|
variables: ((_context$engine2 = context.engine) === null || _context$engine2 === void 0 || (_context$engine2 = _context$engine2.props) === null || _context$engine2 === void 0 ? void 0 : _context$engine2.variables) || {},
|
|
74
70
|
config: variablesConfig
|
|
75
71
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
76
|
-
style: _objectSpread2(_objectSpread2({}, style), {}, {
|
|
77
|
-
"--theme-color": themeColor || "#5D3F9F",
|
|
78
|
-
"--color-primary-bg": computedAntToken.colorPrimaryBg || "#eee5ff"
|
|
79
|
-
}),
|
|
72
|
+
style: _objectSpread2(_objectSpread2({}, style), {}, { "--theme-color": themeColor || "#5D3F9F" }),
|
|
80
73
|
className
|
|
81
74
|
}, children))))))));
|
|
82
75
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PisellContextType } from "../pisell-config-provider/context.js";
|
|
2
2
|
import { PisellModalFuncProps } from "./components/functions/index.js";
|
|
3
3
|
import { InformationProps } from "./components/Information/index.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as antd0 from "antd";
|
|
5
5
|
import { ButtonProps, ModalProps } from "antd";
|
|
6
6
|
import React from "react";
|
|
7
7
|
|
|
@@ -39,24 +39,24 @@ declare const PisellModal: {
|
|
|
39
39
|
(props: PisellModalProps): React.JSX.Element;
|
|
40
40
|
confirm: (props: PisellModalFuncProps) => {
|
|
41
41
|
destroy: () => void;
|
|
42
|
-
update: (configUpdate:
|
|
42
|
+
update: (configUpdate: antd0.ModalFuncProps | ((prevConfig: antd0.ModalFuncProps) => antd0.ModalFuncProps)) => void;
|
|
43
43
|
};
|
|
44
44
|
info: (props: PisellModalFuncProps) => {
|
|
45
45
|
destroy: () => void;
|
|
46
|
-
update: (configUpdate:
|
|
46
|
+
update: (configUpdate: antd0.ModalFuncProps | ((prevConfig: antd0.ModalFuncProps) => antd0.ModalFuncProps)) => void;
|
|
47
47
|
};
|
|
48
48
|
error: (props: PisellModalFuncProps) => {
|
|
49
49
|
destroy: () => void;
|
|
50
|
-
update: (configUpdate:
|
|
50
|
+
update: (configUpdate: antd0.ModalFuncProps | ((prevConfig: antd0.ModalFuncProps) => antd0.ModalFuncProps)) => void;
|
|
51
51
|
};
|
|
52
52
|
warn: (props: PisellModalFuncProps) => any;
|
|
53
53
|
warning: (props: PisellModalFuncProps) => {
|
|
54
54
|
destroy: () => void;
|
|
55
|
-
update: (configUpdate:
|
|
55
|
+
update: (configUpdate: antd0.ModalFuncProps | ((prevConfig: antd0.ModalFuncProps) => antd0.ModalFuncProps)) => void;
|
|
56
56
|
};
|
|
57
57
|
success: (props: PisellModalFuncProps) => {
|
|
58
58
|
destroy: () => void;
|
|
59
|
-
update: (configUpdate:
|
|
59
|
+
update: (configUpdate: antd0.ModalFuncProps | ((prevConfig: antd0.ModalFuncProps) => antd0.ModalFuncProps)) => void;
|
|
60
60
|
};
|
|
61
61
|
Information: (props: InformationProps) => React.JSX.Element;
|
|
62
62
|
};
|
|
@@ -5,7 +5,8 @@ import { isArr, locales } from "@pisell/utils";
|
|
|
5
5
|
import "./index.less";
|
|
6
6
|
|
|
7
7
|
//#region src/components/productCard/components/Time/components/SelectHolder/index.tsx
|
|
8
|
-
const
|
|
8
|
+
const defaultArr = [];
|
|
9
|
+
const SelectHolder = ({ lists = defaultArr, value, onChange, holderMode, isShowAddHolderButton, onAddHolder, addHolderButtonText, onClearHolder, isErrorHolder, allowClear = false, holderMaxCount }) => {
|
|
9
10
|
const [selectedValue, setSelectedValue] = useState();
|
|
10
11
|
const [open, setOpen] = useState(false);
|
|
11
12
|
useEffect(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react20 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/radio/index.d.ts
|
|
5
|
-
declare const Radio: (props: any) =>
|
|
5
|
+
declare const Radio: (props: any) => react20.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Radio };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react19 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/section-footers/index.d.ts
|
|
5
5
|
interface SectionFooterProps {
|
|
@@ -8,6 +8,6 @@ interface SectionFooterProps {
|
|
|
8
8
|
right?: React.ReactNode;
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
|
-
declare const SectionFooters: (props: SectionFooterProps) =>
|
|
11
|
+
declare const SectionFooters: (props: SectionFooterProps) => react19.JSX.Element;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { SectionFooters };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react18 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/skeleton/index.d.ts
|
|
5
|
-
declare const Skeleton: (props: any) =>
|
|
5
|
+
declare const Skeleton: (props: any) => react18.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Skeleton };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react21 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/time-picker/index.d.ts
|
|
5
|
-
declare const TimePicker: (props: any) =>
|
|
5
|
+
declare const TimePicker: (props: any) => react21.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { TimePicker };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react17 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/upload/index.d.ts
|
|
5
|
-
declare const Upload: (props: any) =>
|
|
5
|
+
declare const Upload: (props: any) => react17.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Upload };
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
.pisell-base-virtual-input-caret {
|
|
77
77
|
width: 2px;
|
|
78
78
|
height: var(--virtual-input-caret-height);
|
|
79
|
-
background-color: var(--
|
|
79
|
+
background-color: var(--color-primary, #5d3f9f);
|
|
80
80
|
border-radius: 1px;
|
|
81
81
|
animation: pisell-base-virtual-input-caret-blink 1s infinite;
|
|
82
82
|
}
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
right: -1px;
|
|
108
108
|
transform: translateY(-50%);
|
|
109
109
|
height: 1.2em;
|
|
110
|
-
background-color: var(--
|
|
110
|
+
background-color: var(--color-primary, #5d3f9f);
|
|
111
111
|
pointer-events: none;
|
|
112
112
|
z-index: -1;
|
|
113
113
|
}
|
|
@@ -18,6 +18,11 @@ interface VirtualInputProps extends BaseVirtualInputProps {
|
|
|
18
18
|
onClear?: () => void;
|
|
19
19
|
/** 自定义清除按钮的样式 */
|
|
20
20
|
clearButtonStyle?: React.CSSProperties;
|
|
21
|
+
theme?: {
|
|
22
|
+
token?: {
|
|
23
|
+
colorPrimary?: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
21
26
|
}
|
|
22
27
|
interface VirtualInputRef extends BaseVirtualInputRef {}
|
|
23
28
|
declare const VirtualInput: React.ForwardRefExoticComponent<VirtualInputProps & React.RefAttributes<VirtualInputRef>>;
|
|
@@ -2,6 +2,7 @@ import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.108.0/hel
|
|
|
2
2
|
import { _objectWithoutProperties } from "../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectWithoutProperties.js";
|
|
3
3
|
import icon_default from "../icon/index.js";
|
|
4
4
|
import BaseVirtualInput_default from "./BaseVirtualInput/index.js";
|
|
5
|
+
import useThemeTokens_default from "../../hooks/useThemeTokens.js";
|
|
5
6
|
import classNames from "classnames";
|
|
6
7
|
import React, { forwardRef, useImperativeHandle, useRef } from "react";
|
|
7
8
|
import "./index.less";
|
|
@@ -15,11 +16,13 @@ const _excluded = [
|
|
|
15
16
|
"allowClear",
|
|
16
17
|
"onClear",
|
|
17
18
|
"value",
|
|
18
|
-
"clearButtonStyle"
|
|
19
|
+
"clearButtonStyle",
|
|
20
|
+
"theme"
|
|
19
21
|
];
|
|
20
22
|
const VirtualInput = forwardRef((_ref, ref) => {
|
|
21
|
-
let { topContent, bottomContent, wrapperStyle, wrapperClassName, allowClear = false, onClear, value, clearButtonStyle = {} } = _ref, virtualInputProps = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
let { topContent, bottomContent, wrapperStyle, wrapperClassName, allowClear = false, onClear, value, clearButtonStyle = {}, theme } = _ref, virtualInputProps = _objectWithoutProperties(_ref, _excluded);
|
|
22
24
|
const baseInputRef = useRef(null);
|
|
25
|
+
const { colorPrimary } = useThemeTokens_default(theme);
|
|
23
26
|
const handleClear = () => {
|
|
24
27
|
onClear === null || onClear === void 0 || onClear();
|
|
25
28
|
};
|
|
@@ -35,7 +38,7 @@ const VirtualInput = forwardRef((_ref, ref) => {
|
|
|
35
38
|
}));
|
|
36
39
|
return /* @__PURE__ */ React.createElement("div", {
|
|
37
40
|
className: classNames("pisell-virtual-input-wrapper", wrapperClassName),
|
|
38
|
-
style: wrapperStyle
|
|
41
|
+
style: _objectSpread2(_objectSpread2({}, wrapperStyle || {}), {}, { ["--color-primary"]: colorPrimary })
|
|
39
42
|
}, topContent, /* @__PURE__ */ React.createElement("div", { className: "pisell-virtual-input-container" }, allowClear && /* @__PURE__ */ React.createElement("div", {
|
|
40
43
|
className: "pisell-virtual-input-clear-button",
|
|
41
44
|
style: _objectSpread2(_objectSpread2({}, clearButtonStyle), {}, { visibility: "hidden" })
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { theme } from "antd";
|
|
2
|
+
|
|
3
|
+
//#region src/hooks/useThemeTokens.ts
|
|
4
|
+
const themeTokenCache = /* @__PURE__ */ new Map();
|
|
5
|
+
const useThemeTokens = (themeInput) => {
|
|
6
|
+
var _themeInput$token;
|
|
7
|
+
const { useToken, getDesignToken } = theme;
|
|
8
|
+
const { token: antdToken } = useToken();
|
|
9
|
+
const overrideColorPrimary = (themeInput === null || themeInput === void 0 || (_themeInput$token = themeInput.token) === null || _themeInput$token === void 0 ? void 0 : _themeInput$token.colorPrimary) || antdToken.colorPrimary;
|
|
10
|
+
const cached = themeTokenCache.get(overrideColorPrimary);
|
|
11
|
+
if (cached) return cached;
|
|
12
|
+
const computed = getDesignToken({ token: { colorPrimary: overrideColorPrimary } });
|
|
13
|
+
themeTokenCache.set(overrideColorPrimary, computed);
|
|
14
|
+
return computed;
|
|
15
|
+
};
|
|
16
|
+
var useThemeTokens_default = useThemeTokens;
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { useThemeTokens_default as default };
|
|
@@ -44,19 +44,15 @@ const localeDateMap = {
|
|
|
44
44
|
"zh-CN": { adapterLocale: "zh-cn" }
|
|
45
45
|
};
|
|
46
46
|
const Page = (props) => {
|
|
47
|
-
var _context$appHelper, _context$engine,
|
|
47
|
+
var _context$appHelper, _context$engine, _localeDateMap, _context$engine2;
|
|
48
48
|
const { children, style, className, locale: propsLocale, variablesConfig, isRenderPisellConfigProvider = true } = props, others = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
|
|
49
49
|
const context = require_useEngineContext.default();
|
|
50
50
|
const { platform, themeColor } = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.constants) || {};
|
|
51
51
|
const locale = propsLocale || (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || "en";
|
|
52
|
-
const baseColorPrimary = (props === null || props === void 0 || (_props$theme = props.theme) === null || _props$theme === void 0 || (_props$theme = _props$theme.token) === null || _props$theme === void 0 ? void 0 : _props$theme.colorPrimary) || themeColor || "#5D3F9F";
|
|
53
|
-
const computedAntToken = (0, react.useMemo)(() => {
|
|
54
|
-
return antd.theme.getDesignToken({ token: { colorPrimary: baseColorPrimary } });
|
|
55
|
-
}, [baseColorPrimary]);
|
|
56
52
|
const theme = (0, react.useMemo)(() => {
|
|
57
53
|
if (props === null || props === void 0 ? void 0 : props.theme) {
|
|
58
|
-
var _props$
|
|
59
|
-
return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, props.theme), {}, { token: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, props.theme.token), {}, { colorPrimary: (props === null || props === void 0 || (_props$
|
|
54
|
+
var _props$theme;
|
|
55
|
+
return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, props.theme), {}, { token: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, props.theme.token), {}, { colorPrimary: (props === null || props === void 0 || (_props$theme = props.theme) === null || _props$theme === void 0 || (_props$theme = _props$theme.token) === null || _props$theme === void 0 ? void 0 : _props$theme.colorPrimary) || themeColor || "#5D3F9F" }) });
|
|
60
56
|
}
|
|
61
57
|
return require_tokens.getThemeConfig(themeColor);
|
|
62
58
|
}, [themeColor, props === null || props === void 0 ? void 0 : props.theme]);
|
|
@@ -79,10 +75,7 @@ const Page = (props) => {
|
|
|
79
75
|
variables: ((_context$engine2 = context.engine) === null || _context$engine2 === void 0 || (_context$engine2 = _context$engine2.props) === null || _context$engine2 === void 0 ? void 0 : _context$engine2.variables) || {},
|
|
80
76
|
config: variablesConfig
|
|
81
77
|
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
82
|
-
style: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, style), {}, {
|
|
83
|
-
"--theme-color": themeColor || "#5D3F9F",
|
|
84
|
-
"--color-primary-bg": computedAntToken.colorPrimaryBg || "#eee5ff"
|
|
85
|
-
}),
|
|
78
|
+
style: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, style), {}, { "--theme-color": themeColor || "#5D3F9F" }),
|
|
86
79
|
className
|
|
87
80
|
}, children))))))));
|
|
88
81
|
};
|
|
@@ -7,7 +7,8 @@ let _pisell_utils = require("@pisell/utils");
|
|
|
7
7
|
require("./index.less");
|
|
8
8
|
|
|
9
9
|
//#region src/components/productCard/components/Time/components/SelectHolder/index.tsx
|
|
10
|
-
const
|
|
10
|
+
const defaultArr = [];
|
|
11
|
+
const SelectHolder = ({ lists = defaultArr, value, onChange, holderMode, isShowAddHolderButton, onAddHolder, addHolderButtonText, onClearHolder, isErrorHolder, allowClear = false, holderMaxCount }) => {
|
|
11
12
|
const [selectedValue, setSelectedValue] = (0, react.useState)();
|
|
12
13
|
const [open, setOpen] = (0, react.useState)(false);
|
|
13
14
|
(0, react.useEffect)(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react21 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/time-picker/index.d.ts
|
|
5
|
-
declare const TimePicker: (props: any) =>
|
|
5
|
+
declare const TimePicker: (props: any) => react21.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { TimePicker };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react20 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/upload/index.d.ts
|
|
5
|
-
declare const Upload: (props: any) =>
|
|
5
|
+
declare const Upload: (props: any) => react20.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Upload };
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
.pisell-base-virtual-input-caret {
|
|
77
77
|
width: 2px;
|
|
78
78
|
height: var(--virtual-input-caret-height);
|
|
79
|
-
background-color: var(--
|
|
79
|
+
background-color: var(--color-primary, #5d3f9f);
|
|
80
80
|
border-radius: 1px;
|
|
81
81
|
animation: pisell-base-virtual-input-caret-blink 1s infinite;
|
|
82
82
|
}
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
right: -1px;
|
|
108
108
|
transform: translateY(-50%);
|
|
109
109
|
height: 1.2em;
|
|
110
|
-
background-color: var(--
|
|
110
|
+
background-color: var(--color-primary, #5d3f9f);
|
|
111
111
|
pointer-events: none;
|
|
112
112
|
z-index: -1;
|
|
113
113
|
}
|
|
@@ -18,6 +18,11 @@ interface VirtualInputProps extends BaseVirtualInputProps {
|
|
|
18
18
|
onClear?: () => void;
|
|
19
19
|
/** 自定义清除按钮的样式 */
|
|
20
20
|
clearButtonStyle?: React.CSSProperties;
|
|
21
|
+
theme?: {
|
|
22
|
+
token?: {
|
|
23
|
+
colorPrimary?: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
21
26
|
}
|
|
22
27
|
interface VirtualInputRef extends BaseVirtualInputRef {}
|
|
23
28
|
declare const VirtualInput: React.ForwardRefExoticComponent<VirtualInputProps & React.RefAttributes<VirtualInputRef>>;
|
|
@@ -3,6 +3,7 @@ const require_objectSpread2 = require('../../_virtual/_@oxc-project_runtime@0.10
|
|
|
3
3
|
const require_objectWithoutProperties = require('../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectWithoutProperties.js');
|
|
4
4
|
const require_index = require('../icon/index.js');
|
|
5
5
|
const require_index$1 = require('./BaseVirtualInput/index.js');
|
|
6
|
+
const require_useThemeTokens = require('../../hooks/useThemeTokens.js');
|
|
6
7
|
let classnames = require("classnames");
|
|
7
8
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
8
9
|
let react = require("react");
|
|
@@ -18,11 +19,13 @@ const _excluded = [
|
|
|
18
19
|
"allowClear",
|
|
19
20
|
"onClear",
|
|
20
21
|
"value",
|
|
21
|
-
"clearButtonStyle"
|
|
22
|
+
"clearButtonStyle",
|
|
23
|
+
"theme"
|
|
22
24
|
];
|
|
23
25
|
const VirtualInput = (0, react.forwardRef)((_ref, ref) => {
|
|
24
|
-
let { topContent, bottomContent, wrapperStyle, wrapperClassName, allowClear = false, onClear, value, clearButtonStyle = {} } = _ref, virtualInputProps = require_objectWithoutProperties._objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
let { topContent, bottomContent, wrapperStyle, wrapperClassName, allowClear = false, onClear, value, clearButtonStyle = {}, theme } = _ref, virtualInputProps = require_objectWithoutProperties._objectWithoutProperties(_ref, _excluded);
|
|
25
27
|
const baseInputRef = (0, react.useRef)(null);
|
|
28
|
+
const { colorPrimary } = require_useThemeTokens.default(theme);
|
|
26
29
|
const handleClear = () => {
|
|
27
30
|
onClear === null || onClear === void 0 || onClear();
|
|
28
31
|
};
|
|
@@ -38,7 +41,7 @@ const VirtualInput = (0, react.forwardRef)((_ref, ref) => {
|
|
|
38
41
|
}));
|
|
39
42
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
40
43
|
className: (0, classnames.default)("pisell-virtual-input-wrapper", wrapperClassName),
|
|
41
|
-
style: wrapperStyle
|
|
44
|
+
style: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, wrapperStyle || {}), {}, { ["--color-primary"]: colorPrimary })
|
|
42
45
|
}, topContent, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-virtual-input-container" }, allowClear && /* @__PURE__ */ react.default.createElement("div", {
|
|
43
46
|
className: "pisell-virtual-input-clear-button",
|
|
44
47
|
style: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, clearButtonStyle), {}, { visibility: "hidden" })
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
|
+
let antd = require("antd");
|
|
3
|
+
|
|
4
|
+
//#region src/hooks/useThemeTokens.ts
|
|
5
|
+
const themeTokenCache = /* @__PURE__ */ new Map();
|
|
6
|
+
const useThemeTokens = (themeInput) => {
|
|
7
|
+
var _themeInput$token;
|
|
8
|
+
const { useToken, getDesignToken } = antd.theme;
|
|
9
|
+
const { token: antdToken } = useToken();
|
|
10
|
+
const overrideColorPrimary = (themeInput === null || themeInput === void 0 || (_themeInput$token = themeInput.token) === null || _themeInput$token === void 0 ? void 0 : _themeInput$token.colorPrimary) || antdToken.colorPrimary;
|
|
11
|
+
const cached = themeTokenCache.get(overrideColorPrimary);
|
|
12
|
+
if (cached) return cached;
|
|
13
|
+
const computed = getDesignToken({ token: { colorPrimary: overrideColorPrimary } });
|
|
14
|
+
themeTokenCache.set(overrideColorPrimary, computed);
|
|
15
|
+
return computed;
|
|
16
|
+
};
|
|
17
|
+
var useThemeTokens_default = useThemeTokens;
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.default = useThemeTokens_default;
|