@digitalc/dxp-ui 0.0.6-alpha.5 → 0.0.6-alpha.9

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.
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const BaseSpin: (props: {
4
+ [x: string]: any;
5
+ children: any;
6
+ className: any;
7
+ }) => React.JSX.Element;
8
+ export default BaseSpin;
@@ -0,0 +1,44 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import "antd/es/spin/style";
3
+ import _Spin from "antd/es/spin";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
+ var _excluded = ["children", "className"];
6
+ import React from 'react';
7
+ import { getToken } from "../../utils/tokenHelper";
8
+ import "./index.less";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ var Loading = function Loading() {
11
+ return /*#__PURE__*/_jsx("div", {
12
+ className: "loadingWrap",
13
+ children: /*#__PURE__*/_jsx("div", {
14
+ className: "loadingContainer",
15
+ children: /*#__PURE__*/_jsxs("span", {
16
+ className: "ant-spin-dot ant-spin-dot-spin",
17
+ children: [/*#__PURE__*/_jsx("i", {
18
+ className: "ant-spin-dot-item"
19
+ }), /*#__PURE__*/_jsx("i", {
20
+ className: "ant-spin-dot-item"
21
+ }), /*#__PURE__*/_jsx("i", {
22
+ className: "ant-spin-dot-item"
23
+ }), /*#__PURE__*/_jsx("i", {
24
+ className: "ant-spin-dot-item"
25
+ })]
26
+ })
27
+ })
28
+ });
29
+ };
30
+ var BaseSpin = function BaseSpin(props) {
31
+ var children = props.children,
32
+ className = props.className,
33
+ otherProps = _objectWithoutProperties(props, _excluded);
34
+ return /*#__PURE__*/_jsx(_Spin, _objectSpread(_objectSpread({
35
+ style: {
36
+ color: getToken('colorButtonBackgroundPrimary')
37
+ },
38
+ wrapperClassName: "loading ".concat(className),
39
+ indicator: /*#__PURE__*/_jsx(Loading, {})
40
+ }, otherProps), {}, {
41
+ children: children
42
+ }));
43
+ };
44
+ export default BaseSpin;
@@ -0,0 +1,32 @@
1
+ .loadingWrap {
2
+ display: flex;
3
+ justify-content: center;
4
+ align-items: center;
5
+ left: 0;
6
+ top: 0;
7
+ position: fixed;
8
+ width: 100vw;
9
+ height: 100vh;
10
+ // background: rgba(255,255,255,0.5);
11
+ z-index: 1;
12
+
13
+ .loading {
14
+ // color: @primary-color;
15
+ font-size: 48px;
16
+ font-weight: 900;
17
+ }
18
+
19
+ .loadingContainer {
20
+ border-radius: 16px;
21
+ width: 100px;
22
+ height: 100px;
23
+ display: flex;
24
+ justify-content: center;
25
+ align-items: center;
26
+ background: none;
27
+ img {
28
+ width: 60px;
29
+ height: 60px;
30
+ }
31
+ }
32
+ }
@@ -20,6 +20,7 @@ export interface INavigationProps {
20
20
  hidegoback?: boolean;
21
21
  rightLink?: RightLinkConfig;
22
22
  titleIconBadge?: TitleIconBadgeConfig;
23
+ titleStyle?: React.CSSProperties;
23
24
  title?: string;
24
25
  hideBorder?: boolean;
25
26
  className?: string;
@@ -1,6 +1,6 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["hideBorder", "className", "rightIcons", "rightLink", "title", "goBack", "isInverse", "titleIconBadge", "imgBackground", "noRight", "leftIconName", "leftIconSize", "hidegoback"];
3
+ var _excluded = ["hideBorder", "className", "rightIcons", "rightLink", "title", "goBack", "isInverse", "titleIconBadge", "imgBackground", "noRight", "leftIconName", "leftIconSize", "hidegoback", "titleStyle"];
4
4
  import React from 'react';
5
5
  import { useDesignTokens } from "./designTokens";
6
6
  import { useStyleRegister } from '@ant-design/cssinjs';
@@ -29,6 +29,8 @@ var Navigation = function Navigation(_ref) {
29
29
  leftIconSize = _ref.leftIconSize,
30
30
  _ref$hidegoback = _ref.hidegoback,
31
31
  hidegoback = _ref$hidegoback === void 0 ? false : _ref$hidegoback,
32
+ _ref$titleStyle = _ref.titleStyle,
33
+ titleStyle = _ref$titleStyle === void 0 ? {} : _ref$titleStyle,
32
34
  restProps = _objectWithoutProperties(_ref, _excluded);
33
35
  var designTokens = useDesignTokens();
34
36
  var spacingTopNavigationPaddingHorizontal = designTokens.spacingTopNavigationPaddingHorizontal,
@@ -87,6 +89,7 @@ var Navigation = function Navigation(_ref) {
87
89
  },
88
90
  type: titleIconBadge.iconName
89
91
  }), /*#__PURE__*/_jsx(Text, {
92
+ style: titleStyle,
90
93
  inverse: isInverse,
91
94
  size: "NavigationBold",
92
95
  className: "".concat(cssClasses.PREFIX, "-title ").concat(isInverse ? 'inverse' : '', " "),
@@ -96,6 +99,7 @@ var Navigation = function Navigation(_ref) {
96
99
  children: +titleIconBadge.badge > 99 ? '99+' : titleIconBadge.badge
97
100
  })]
98
101
  }) : /*#__PURE__*/_jsx(Text, {
102
+ style: titleStyle,
99
103
  inverse: isInverse,
100
104
  size: "NavigationBold",
101
105
  className: "".concat(cssClasses.PREFIX, "-title ").concat(isInverse ? 'inverse' : '', " "),
@@ -24,7 +24,7 @@
24
24
  height: 16px;
25
25
  width: 8px;
26
26
  position: absolute;
27
- z-index: 99;
27
+ z-index: 8;
28
28
  top: -8px;
29
29
  border: 1px solid #d5d5d5;
30
30
  }
@@ -67,3 +67,4 @@ export { default as AppStyleWrapper } from './AppStyleWrapper';
67
67
  export { default as Row } from './Row';
68
68
  export { default as Col } from './Col';
69
69
  export { default as GlobalTokenProvider } from './GlobalTokenProvider';
70
+ export { default as BaseSpin } from './BaseSpin';
@@ -41,4 +41,5 @@ export { default as Radio } from "./Radio";
41
41
  export { default as AppStyleWrapper } from "./AppStyleWrapper";
42
42
  export { default as Row } from "./Row";
43
43
  export { default as Col } from "./Col";
44
- export { default as GlobalTokenProvider } from "./GlobalTokenProvider";
44
+ export { default as GlobalTokenProvider } from "./GlobalTokenProvider";
45
+ export { default as BaseSpin } from "./BaseSpin";
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const BaseSpin: (props: {
4
+ [x: string]: any;
5
+ children: any;
6
+ className: any;
7
+ }) => React.JSX.Element;
8
+ export default BaseSpin;
@@ -0,0 +1,70 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
21
+ var __objRest = (source, exclude) => {
22
+ var target = {};
23
+ for (var prop in source)
24
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
+ target[prop] = source[prop];
26
+ if (source != null && __getOwnPropSymbols)
27
+ for (var prop of __getOwnPropSymbols(source)) {
28
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
+ target[prop] = source[prop];
30
+ }
31
+ return target;
32
+ };
33
+ var __export = (target, all) => {
34
+ for (var name in all)
35
+ __defProp(target, name, { get: all[name], enumerable: true });
36
+ };
37
+ var __copyProps = (to, from, except, desc) => {
38
+ if (from && typeof from === "object" || typeof from === "function") {
39
+ for (let key of __getOwnPropNames(from))
40
+ if (!__hasOwnProp.call(to, key) && key !== except)
41
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
42
+ }
43
+ return to;
44
+ };
45
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
46
+ // If the importer is in node compatibility mode or this is not an ESM
47
+ // file that has been converted to a CommonJS file using a Babel-
48
+ // compatible transform (i.e. "__esModule" has not been set), then set
49
+ // "default" to the CommonJS "module.exports" for node compatibility.
50
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
51
+ mod
52
+ ));
53
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
54
+
55
+ // src/components/BaseSpin/index.tsx
56
+ var BaseSpin_exports = {};
57
+ __export(BaseSpin_exports, {
58
+ default: () => BaseSpin_default
59
+ });
60
+ module.exports = __toCommonJS(BaseSpin_exports);
61
+ var import_react = __toESM(require("react"));
62
+ var import_antd = require("antd");
63
+ var import_tokenHelper = require("../../utils/tokenHelper");
64
+ var import_index = require("./index.less");
65
+ var Loading = () => /* @__PURE__ */ import_react.default.createElement("div", { className: "loadingWrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "loadingContainer" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "ant-spin-dot ant-spin-dot-spin" }, /* @__PURE__ */ import_react.default.createElement("i", { className: "ant-spin-dot-item" }), /* @__PURE__ */ import_react.default.createElement("i", { className: "ant-spin-dot-item" }), /* @__PURE__ */ import_react.default.createElement("i", { className: "ant-spin-dot-item" }), /* @__PURE__ */ import_react.default.createElement("i", { className: "ant-spin-dot-item" }))));
66
+ var BaseSpin = (props) => {
67
+ const _a = props, { children, className } = _a, otherProps = __objRest(_a, ["children", "className"]);
68
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, __spreadValues({ style: { color: (0, import_tokenHelper.getToken)("colorButtonBackgroundPrimary") }, wrapperClassName: `loading ${className}`, indicator: /* @__PURE__ */ import_react.default.createElement(Loading, null) }, otherProps), children);
69
+ };
70
+ var BaseSpin_default = BaseSpin;
@@ -0,0 +1,32 @@
1
+ .loadingWrap {
2
+ display: flex;
3
+ justify-content: center;
4
+ align-items: center;
5
+ left: 0;
6
+ top: 0;
7
+ position: fixed;
8
+ width: 100vw;
9
+ height: 100vh;
10
+ // background: rgba(255,255,255,0.5);
11
+ z-index: 1;
12
+
13
+ .loading {
14
+ // color: @primary-color;
15
+ font-size: 48px;
16
+ font-weight: 900;
17
+ }
18
+
19
+ .loadingContainer {
20
+ border-radius: 16px;
21
+ width: 100px;
22
+ height: 100px;
23
+ display: flex;
24
+ justify-content: center;
25
+ align-items: center;
26
+ background: none;
27
+ img {
28
+ width: 60px;
29
+ height: 60px;
30
+ }
31
+ }
32
+ }
@@ -20,6 +20,7 @@ export interface INavigationProps {
20
20
  hidegoback?: boolean;
21
21
  rightLink?: RightLinkConfig;
22
22
  titleIconBadge?: TitleIconBadgeConfig;
23
+ titleStyle?: React.CSSProperties;
23
24
  title?: string;
24
25
  hideBorder?: boolean;
25
26
  className?: string;
@@ -81,7 +81,8 @@ var Navigation = (_a) => {
81
81
  noRight = false,
82
82
  leftIconName,
83
83
  leftIconSize,
84
- hidegoback = false
84
+ hidegoback = false,
85
+ titleStyle = {}
85
86
  } = _b, restProps = __objRest(_b, [
86
87
  "hideBorder",
87
88
  "className",
@@ -95,7 +96,8 @@ var Navigation = (_a) => {
95
96
  "noRight",
96
97
  "leftIconName",
97
98
  "leftIconSize",
98
- "hidegoback"
99
+ "hidegoback",
100
+ "titleStyle"
99
101
  ]);
100
102
  var _a2;
101
103
  const designTokens = (0, import_designTokens.useDesignTokens)();
@@ -178,7 +180,7 @@ var Navigation = (_a) => {
178
180
  )
179
181
  }, restProps),
180
182
  !hidegoback && /* @__PURE__ */ import_react.default.createElement(import__.IconButton, { className: `${import_constants.cssClasses.PREFIX}-header-back`, customIconSize: leftIconSize, inverse: isInverse, size: "medium", name: leftIconName || "icon-a-Backarrow-copy", onClick: onGoBack }),
181
- /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${import_constants.cssClasses.PREFIX}-title-warp`, { hasIconBage: !(0, import_lodash.isEmpty)(titleIconBadge) }) }, !(0, import_lodash.isEmpty)(titleIconBadge) ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${import_constants.cssClasses.PREFIX}-title-badge` }, /* @__PURE__ */ import_react.default.createElement(import__.Icon, { inverse: isInverse, size: 24, style: { marginRight: "4px" }, type: titleIconBadge.iconName }), /* @__PURE__ */ import_react.default.createElement(import__.Text, { inverse: isInverse, size: "NavigationBold", className: `${import_constants.cssClasses.PREFIX}-title ${isInverse ? "inverse" : ""} ` }, titleIconBadge.title), /* @__PURE__ */ import_react.default.createElement("div", { className: `${import_constants.cssClasses.PREFIX}-badge` }, +titleIconBadge.badge > 99 ? "99+" : titleIconBadge.badge)) : /* @__PURE__ */ import_react.default.createElement(import__.Text, { inverse: isInverse, size: "NavigationBold", className: `${import_constants.cssClasses.PREFIX}-title ${isInverse ? "inverse" : ""} ` }, title)),
183
+ /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${import_constants.cssClasses.PREFIX}-title-warp`, { hasIconBage: !(0, import_lodash.isEmpty)(titleIconBadge) }) }, !(0, import_lodash.isEmpty)(titleIconBadge) ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${import_constants.cssClasses.PREFIX}-title-badge` }, /* @__PURE__ */ import_react.default.createElement(import__.Icon, { inverse: isInverse, size: 24, style: { marginRight: "4px" }, type: titleIconBadge.iconName }), /* @__PURE__ */ import_react.default.createElement(import__.Text, { style: titleStyle, inverse: isInverse, size: "NavigationBold", className: `${import_constants.cssClasses.PREFIX}-title ${isInverse ? "inverse" : ""} ` }, titleIconBadge.title), /* @__PURE__ */ import_react.default.createElement("div", { className: `${import_constants.cssClasses.PREFIX}-badge` }, +titleIconBadge.badge > 99 ? "99+" : titleIconBadge.badge)) : /* @__PURE__ */ import_react.default.createElement(import__.Text, { style: titleStyle, inverse: isInverse, size: "NavigationBold", className: `${import_constants.cssClasses.PREFIX}-title ${isInverse ? "inverse" : ""} ` }, title)),
182
184
  !noRight && /* @__PURE__ */ import_react.default.createElement(import__.IconButtonGroup, { className: `${import_constants.cssClasses.PREFIX}-rightWarp` }, (_a2 = rightIcons == null ? void 0 : rightIcons.slice(0, 3)) == null ? void 0 : _a2.map((i, index) => /* @__PURE__ */ import_react.default.createElement(import__.IconButton, { inverse: isInverse, key: index, name: i.iconName, size: "medium", onClick: i.onIconClick })), !(0, import_lodash.isEmpty)(rightLink) && /* @__PURE__ */ import_react.default.createElement(import__.TextLink, { inverse: isInverse, className: `${import_constants.cssClasses.PREFIX}-right-link`, type: import__.TextLinkEnum.default, text: rightLink.linkText, onClick: rightLink.onLinkClick }))
183
185
  );
184
186
  };
@@ -24,7 +24,7 @@
24
24
  height: 16px;
25
25
  width: 8px;
26
26
  position: absolute;
27
- z-index: 99;
27
+ z-index: 8;
28
28
  top: -8px;
29
29
  border: 1px solid #d5d5d5;
30
30
  }
@@ -67,3 +67,4 @@ export { default as AppStyleWrapper } from './AppStyleWrapper';
67
67
  export { default as Row } from './Row';
68
68
  export { default as Col } from './Col';
69
69
  export { default as GlobalTokenProvider } from './GlobalTokenProvider';
70
+ export { default as BaseSpin } from './BaseSpin';
@@ -37,6 +37,7 @@ __export(components_exports, {
37
37
  AmountTitleTypes: () => import_Amount.AmountTitleTypes,
38
38
  AppStyleWrapper: () => import_AppStyleWrapper.default,
39
39
  BackImageEnum: () => import_Image2.BackImageEnum,
40
+ BaseSpin: () => import_BaseSpin.default,
40
41
  Button: () => import_Button.default,
41
42
  Card: () => import_Card.default,
42
43
  Checkbox: () => import_Checkbox.default,
@@ -122,3 +123,4 @@ var import_AppStyleWrapper = __toESM(require("./AppStyleWrapper"));
122
123
  var import_Row = __toESM(require("./Row"));
123
124
  var import_Col = __toESM(require("./Col"));
124
125
  var import_GlobalTokenProvider = __toESM(require("./GlobalTokenProvider"));
126
+ var import_BaseSpin = __toESM(require("./BaseSpin"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalc/dxp-ui",
3
- "version": "0.0.6-alpha.5",
3
+ "version": "0.0.6-alpha.9",
4
4
  "description": "A UI library of Digitalc Design React Component",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -132,4 +132,4 @@
132
132
  "publishConfig": {
133
133
  "access": "public"
134
134
  }
135
- }
135
+ }