clxx 2.1.6 → 2.1.8

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.
Files changed (70) hide show
  1. package/AGENTS.md +2 -0
  2. package/README.md +63 -0
  3. package/build/Ago/index.js +14 -8
  4. package/build/Alert/Wrapper.js +20 -20
  5. package/build/Alert/index.js +17 -11
  6. package/build/Alert/style.js +44 -26
  7. package/build/AutoGrid/index.js +50 -14
  8. package/build/AutoGrid/style.js +9 -6
  9. package/build/CarouselNotice/index.js +22 -19
  10. package/build/CarouselNotice/style.js +6 -3
  11. package/build/CitySelect/data.d.ts +3 -0
  12. package/build/CitySelect/data.js +2355 -0
  13. package/build/CitySelect/index.d.ts +17 -0
  14. package/build/CitySelect/index.js +335 -0
  15. package/build/CitySelect/search.d.ts +2 -0
  16. package/build/CitySelect/search.js +70 -0
  17. package/build/CitySelect/style.d.ts +4 -0
  18. package/build/CitySelect/style.js +237 -0
  19. package/build/CitySelect/type.d.ts +17 -0
  20. package/build/CitySelect/type.js +2 -0
  21. package/build/Clickable/index.js +56 -20
  22. package/build/Container/index.js +52 -16
  23. package/build/Countdowner/index.js +50 -14
  24. package/build/Dialog/Wrapper.js +13 -10
  25. package/build/Dialog/index.js +18 -12
  26. package/build/Dialog/style.js +29 -25
  27. package/build/Effect/useInterval.js +7 -4
  28. package/build/Effect/useTick.js +9 -6
  29. package/build/Effect/useUpdate.js +6 -3
  30. package/build/Effect/useViewport.js +15 -8
  31. package/build/Effect/useWindowResize.js +7 -4
  32. package/build/Fixed/index.js +6 -3
  33. package/build/Flex/Col.js +23 -15
  34. package/build/Flex/Row.js +23 -15
  35. package/build/Flex/index.js +9 -5
  36. package/build/Indicator/index.js +20 -14
  37. package/build/Indicator/style.js +6 -3
  38. package/build/Loading/Wrapper.js +14 -11
  39. package/build/Loading/index.js +17 -10
  40. package/build/Loading/style.js +9 -6
  41. package/build/Overlay/index.js +12 -9
  42. package/build/SafeArea/index.js +8 -5
  43. package/build/ScrollView/index.js +24 -21
  44. package/build/ScrollView/style.js +4 -1
  45. package/build/Toast/Toast.js +53 -17
  46. package/build/Toast/index.js +21 -14
  47. package/build/Toast/style.d.ts +0 -3
  48. package/build/Toast/style.js +49 -41
  49. package/build/index.d.ts +1 -1
  50. package/build/index.js +102 -36
  51. package/build/utils/Countdown.js +7 -3
  52. package/build/utils/ago.js +10 -4
  53. package/build/utils/calendarTable.js +9 -3
  54. package/build/utils/createApp.js +35 -27
  55. package/build/utils/cssUtil.js +10 -5
  56. package/build/utils/defaultScroll.js +4 -1
  57. package/build/utils/dom.js +6 -3
  58. package/build/utils/is.js +6 -2
  59. package/build/utils/jsonp.js +4 -1
  60. package/build/utils/request.js +40 -27
  61. package/build/utils/tick.js +4 -1
  62. package/build/utils/uniqKey.js +4 -1
  63. package/build/utils/wait.js +8 -4
  64. package/package.json +1 -1
  65. package/test/src/city-select/index.jsx +21 -0
  66. package/test/src/index/index.jsx +1 -0
  67. package/test/src/toast/index.jsx +1 -0
  68. package/test/vite.config.js +6 -2
  69. package/build/context.d.ts +0 -14
  70. package/build/context.js +0 -21
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __rest = (this && this.__rest) || function (s, e) {
2
3
  var t = {};
3
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -9,12 +10,14 @@ var __rest = (this && this.__rest) || function (s, e) {
9
10
  }
10
11
  return t;
11
12
  };
12
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
13
- import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
14
- import { Indicator } from "../Indicator";
15
- import { RowCenter } from "../Flex/Row";
16
- import { style } from "./style";
17
- export function ScrollView(props) {
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.ScrollView = ScrollView;
15
+ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
16
+ const react_1 = require("react");
17
+ const Indicator_1 = require("../Indicator");
18
+ const Row_1 = require("../Flex/Row");
19
+ const style_1 = require("./style");
20
+ function ScrollView(props) {
18
21
  const { children, height, reachTopThreshold = 50, onReachTop, reachBottomThreshold = 50, onReachBottom, showLoading = true, loadingContent, onScroll, scrollThrottle = 16, containerStyle, wrapperStyle, loadingStyle } = props, attrs = __rest(props, ["children", "height", "reachTopThreshold", "onReachTop", "reachBottomThreshold", "onReachBottom", "showLoading", "loadingContent", "onScroll", "scrollThrottle", "containerStyle", "wrapperStyle", "loadingStyle"]);
19
22
  // 容器高度
20
23
  const heightStyle = {};
@@ -22,17 +25,17 @@ export function ScrollView(props) {
22
25
  heightStyle.height = height;
23
26
  }
24
27
  // 滚动容器
25
- const container = useRef(null);
28
+ const container = (0, react_1.useRef)(null);
26
29
  // 当前滚动到顶部的距离
27
- const lastScrollTop = useRef(0);
30
+ const lastScrollTop = (0, react_1.useRef)(0);
28
31
  // 防止重复触发的标记
29
- const hasReachedTop = useRef(false);
30
- const hasReachedBottom = useRef(false);
32
+ const hasReachedTop = (0, react_1.useRef)(false);
33
+ const hasReachedBottom = (0, react_1.useRef)(false);
31
34
  // 节流控制
32
- const throttleTimer = useRef(undefined);
33
- const lastCallTime = useRef(0);
35
+ const throttleTimer = (0, react_1.useRef)(undefined);
36
+ const lastCallTime = (0, react_1.useRef)(0);
34
37
  // 使用 ref 保存所有滚动处理需要的 props,彻底消除陈旧闭包
35
- const propsRef = useRef({
38
+ const propsRef = (0, react_1.useRef)({
36
39
  onScroll,
37
40
  onReachTop,
38
41
  onReachBottom,
@@ -47,16 +50,16 @@ export function ScrollView(props) {
47
50
  reachBottomThreshold,
48
51
  };
49
52
  // container 是否有滚动条
50
- const [hasScrollBar, setHasScrollBar] = useState(false);
53
+ const [hasScrollBar, setHasScrollBar] = (0, react_1.useState)(false);
51
54
  // 检查是否有滚动条
52
- const checkScrollBar = useCallback(() => {
55
+ const checkScrollBar = (0, react_1.useCallback)(() => {
53
56
  if (container.current) {
54
57
  const hasScroll = container.current.scrollHeight > container.current.clientHeight;
55
58
  setHasScrollBar(hasScroll);
56
59
  }
57
60
  }, []);
58
61
  // 使用 ResizeObserver 监听内容高度变化
59
- useLayoutEffect(() => {
62
+ (0, react_1.useLayoutEffect)(() => {
60
63
  const containerEl = container.current;
61
64
  if (!containerEl)
62
65
  return;
@@ -77,7 +80,7 @@ export function ScrollView(props) {
77
80
  }, [checkScrollBar]);
78
81
  // 核心滚动处理逻辑
79
82
  // 所有外部值从 ref 读取,deps 为空,引用永远稳定,不存在闭包过期问题
80
- const processScroll = useCallback((rawEvent) => {
83
+ const processScroll = (0, react_1.useCallback)((rawEvent) => {
81
84
  const box = container.current;
82
85
  if (!box)
83
86
  return;
@@ -129,7 +132,7 @@ export function ScrollView(props) {
129
132
  lastScrollTop.current = scrollTop;
130
133
  }, []);
131
134
  // 节流滚动回调(leading + trailing)
132
- const scrollCallback = useCallback((rawEvent) => {
135
+ const scrollCallback = (0, react_1.useCallback)((rawEvent) => {
133
136
  // 不节流时直接执行
134
137
  if (scrollThrottle <= 0) {
135
138
  processScroll(rawEvent);
@@ -161,7 +164,7 @@ export function ScrollView(props) {
161
164
  }
162
165
  }, [scrollThrottle, processScroll]);
163
166
  // 清理节流定时器
164
- useEffect(() => {
167
+ (0, react_1.useEffect)(() => {
165
168
  return () => {
166
169
  if (throttleTimer.current !== undefined) {
167
170
  clearTimeout(throttleTimer.current);
@@ -172,11 +175,11 @@ export function ScrollView(props) {
172
175
  let showLoadingContent = null;
173
176
  if (showLoading) {
174
177
  if (!loadingContent) {
175
- showLoadingContent = (_jsxs(RowCenter, { css: [style.loading, loadingStyle], children: [_jsx(Indicator, { barColor: "#333", barCount: 12 }), _jsx("p", { children: "\u6570\u636E\u52A0\u8F7D\u4E2D..." })] }));
178
+ showLoadingContent = ((0, jsx_runtime_1.jsxs)(Row_1.RowCenter, { css: [style_1.style.loading, loadingStyle], children: [(0, jsx_runtime_1.jsx)(Indicator_1.Indicator, { barColor: "#333", barCount: 12 }), (0, jsx_runtime_1.jsx)("p", { children: "\u6570\u636E\u52A0\u8F7D\u4E2D..." })] }));
176
179
  }
177
180
  else {
178
181
  showLoadingContent = loadingContent;
179
182
  }
180
183
  }
181
- return (_jsxs("div", Object.assign({ css: [style.container, heightStyle, containerStyle], onScroll: scrollCallback, ref: container }, attrs, { children: [_jsx("div", { css: wrapperStyle, children: children }), hasScrollBar && showLoadingContent] })));
184
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ css: [style_1.style.container, heightStyle, containerStyle], onScroll: scrollCallback, ref: container }, attrs, { children: [(0, jsx_runtime_1.jsx)("div", { css: wrapperStyle, children: children }), hasScrollBar && showLoadingContent] })));
182
185
  }
@@ -1,4 +1,7 @@
1
- export const style = {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.style = void 0;
4
+ exports.style = {
2
5
  container: {
3
6
  overflow: "auto",
4
7
  height: "100%",
@@ -1,3 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
1
35
  var __rest = (this && this.__rest) || function (s, e) {
2
36
  var t = {};
3
37
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -9,17 +43,19 @@ var __rest = (this && this.__rest) || function (s, e) {
9
43
  }
10
44
  return t;
11
45
  };
12
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
13
- import React, { useState, useEffect } from "react";
14
- import { style, getAnimation } from "./style";
15
- export function Toast(props) {
46
+ Object.defineProperty(exports, "__esModule", { value: true });
47
+ exports.Toast = Toast;
48
+ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
49
+ const react_1 = __importStar(require("react"));
50
+ const style_1 = require("./style");
51
+ function Toast(props) {
16
52
  const { content = "", position = "middle", duration = 2000, radius = 16, offsetTop = 50, offsetBottom = 50, onHide = () => undefined, containerStyle, contentStyle } = props, attributes = __rest(props, ["content", "position", "duration", "radius", "offsetTop", "offsetBottom", "onHide", "containerStyle", "contentStyle"]);
17
53
  // 初始化显示的动画
18
- const getResult = getAnimation(position, "show");
19
- const [animation, setAnimation] = useState(getResult.animation);
20
- useEffect(() => {
54
+ const getResult = (0, style_1.getAnimation)(position, "show");
55
+ const [animation, setAnimation] = (0, react_1.useState)(getResult.animation);
56
+ (0, react_1.useEffect)(() => {
21
57
  const timer = window.setTimeout(() => {
22
- const { animation } = getAnimation(position, "hide");
58
+ const { animation } = (0, style_1.getAnimation)(position, "hide");
23
59
  setAnimation(animation);
24
60
  }, duration);
25
61
  return () => {
@@ -27,29 +63,29 @@ export function Toast(props) {
27
63
  };
28
64
  }, [position, duration]);
29
65
  let showContent;
30
- const middleStyle = position === "middle" ? style.contentMiddle : undefined;
31
- if (React.isValidElement(content)) {
32
- showContent = _jsx("div", { css: [middleStyle, contentStyle], children: content });
66
+ const middleStyle = position === "middle" ? style_1.style.contentMiddle : undefined;
67
+ if (react_1.default.isValidElement(content)) {
68
+ showContent = (0, jsx_runtime_1.jsx)("div", { css: [middleStyle, contentStyle], children: content });
33
69
  }
34
70
  else {
35
- showContent = (_jsx("p", { css: [style.content(radius), middleStyle, contentStyle], children: content }));
71
+ showContent = ((0, jsx_runtime_1.jsx)("p", { css: [style_1.style.content(radius), middleStyle, contentStyle], children: content }));
36
72
  }
37
73
  // toast消失动画结束触发
38
74
  const animationEnd = (event) => {
39
- const { keyframes } = getAnimation(position, "hide");
75
+ const { keyframes } = (0, style_1.getAnimation)(position, "hide");
40
76
  if (event.animationName === keyframes.name) {
41
77
  onHide === null || onHide === void 0 ? void 0 : onHide();
42
78
  }
43
79
  };
44
80
  let positionStyle;
45
81
  if (position === "top") {
46
- positionStyle = style.top(offsetTop);
82
+ positionStyle = style_1.style.top(offsetTop);
47
83
  }
48
84
  else if (position === "bottom") {
49
- positionStyle = style.bottom(offsetBottom);
85
+ positionStyle = style_1.style.bottom(offsetBottom);
50
86
  }
51
87
  else {
52
- positionStyle = style.middle;
88
+ positionStyle = style_1.style.middle;
53
89
  }
54
- return (_jsx("div", Object.assign({ css: [style.container(), positionStyle, animation, containerStyle], onAnimationEnd: animationEnd }, attributes, { children: showContent })));
90
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ css: [style_1.style.container(), positionStyle, animation, containerStyle], onAnimationEnd: animationEnd }, attributes, { children: showContent })));
55
91
  }
@@ -1,39 +1,46 @@
1
- import { createElement as _createElement } from "@emotion/react";
2
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
3
- import React from 'react';
4
- import { uniqKey } from '../utils/uniqKey';
5
- import { createPortalDOM } from '../utils/dom';
6
- import { Toast as ToastComponent } from './Toast';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.showToast = showToast;
7
+ exports.showUniqToast = showUniqToast;
8
+ const react_1 = require("@emotion/react");
9
+ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
10
+ const react_2 = __importDefault(require("react"));
11
+ const uniqKey_1 = require("../utils/uniqKey");
12
+ const dom_1 = require("../utils/dom");
13
+ const Toast_1 = require("./Toast");
7
14
  /**
8
15
  * 显示一个全局的轻提示,这个toast不是唯一的
9
16
  * @param option 可以是一个字符串,也可以是一个React组件
10
17
  */
11
- export function showToast(option) {
12
- const { mount, unmount } = createPortalDOM();
18
+ function showToast(option) {
19
+ const { mount, unmount } = (0, dom_1.createPortalDOM)();
13
20
  let props = {};
14
- if (React.isValidElement(option) || typeof option !== 'object') {
21
+ if (react_2.default.isValidElement(option) || typeof option !== 'object') {
15
22
  props.content = option;
16
23
  }
17
24
  else {
18
25
  props = option;
19
26
  }
20
27
  props.onHide = unmount;
21
- mount(_jsx(ToastComponent, Object.assign({}, props)));
28
+ mount((0, jsx_runtime_1.jsx)(Toast_1.Toast, Object.assign({}, props)));
22
29
  }
23
30
  /**
24
31
  * 生成一个全局唯一的Toast
25
32
  * @param option
26
33
  */
27
34
  let portalDOM = null;
28
- export function showUniqToast(option) {
35
+ function showUniqToast(option) {
29
36
  // 先清理上一个 Toast 的 DOM 容器,避免快速连续调用时旧容器泄漏
30
37
  if (portalDOM) {
31
38
  portalDOM.unmount();
32
39
  portalDOM = null;
33
40
  }
34
- portalDOM = createPortalDOM();
41
+ portalDOM = (0, dom_1.createPortalDOM)();
35
42
  let props = {};
36
- if (React.isValidElement(option) || typeof option !== 'object') {
43
+ if (react_2.default.isValidElement(option) || typeof option !== 'object') {
37
44
  props.content = option;
38
45
  }
39
46
  else {
@@ -44,5 +51,5 @@ export function showUniqToast(option) {
44
51
  portalDOM = null;
45
52
  };
46
53
  props.onHide = onHide;
47
- portalDOM.mount(_createElement(ToastComponent, Object.assign({}, props, { key: uniqKey() })));
54
+ portalDOM.mount((0, react_1.createElement)(Toast_1.Toast, Object.assign({}, props, { key: (0, uniqKey_1.uniqKey)() })));
48
55
  }
@@ -37,9 +37,6 @@ export declare const bottomHideAnimation: {
37
37
  } & string;
38
38
  /**
39
39
  * 根据位置和类型获取动画
40
- * @param position
41
- * @param type
42
- * @returns
43
40
  */
44
41
  export declare function getAnimation(position: "top" | "middle" | "bottom", type: "show" | "hide"): {
45
42
  keyframes: Keyframes;
@@ -1,75 +1,78 @@
1
- import { css, keyframes } from "@emotion/react";
2
- export const middleShowAnimation = keyframes `
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.style = exports.bottomHideAnimation = exports.bottomShowAnimation = exports.topHideAnimation = exports.topShowAnimation = exports.middleHideAnimation = exports.middleShowAnimation = void 0;
4
+ exports.getAnimation = getAnimation;
5
+ const react_1 = require("@emotion/react");
6
+ const fontStack = '-apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif';
7
+ const easing = "cubic-bezier(.22,.61,.36,1)";
8
+ exports.middleShowAnimation = (0, react_1.keyframes) `
3
9
  from {
4
10
  opacity: 0;
5
- transform: translateX(-50%) scale(0.9);
11
+ transform: translateX(-50%) scale(0.92);
6
12
  }
7
13
  to {
8
14
  opacity: 1;
9
15
  transform: translateX(-50%) scale(1);
10
16
  }
11
17
  `;
12
- export const middleHideAnimation = keyframes `
18
+ exports.middleHideAnimation = (0, react_1.keyframes) `
13
19
  from {
14
20
  opacity: 1;
15
21
  transform: translateX(-50%) scale(1);
16
22
  }
17
23
  to {
18
24
  opacity: 0;
19
- transform: translateX(-50%) scale(0.9);
25
+ transform: translateX(-50%) scale(0.92);
20
26
  }
21
27
  `;
22
- export const topShowAnimation = keyframes `
28
+ exports.topShowAnimation = (0, react_1.keyframes) `
23
29
  from {
24
30
  opacity: 0;
25
- transform: translate(-50%, -100%);
31
+ transform: translate(-50%, -120%);
26
32
  }
27
33
  to {
28
34
  opacity: 1;
29
35
  transform: translate(-50%, 0);
30
36
  }
31
37
  `;
32
- export const topHideAnimation = keyframes `
38
+ exports.topHideAnimation = (0, react_1.keyframes) `
33
39
  from {
34
40
  opacity: 1;
35
41
  transform: translate(-50%, 0);
36
42
  }
37
43
  to {
38
44
  opacity: 0;
39
- transform: translate(-50%, -100%);
45
+ transform: translate(-50%, -120%);
40
46
  }
41
47
  `;
42
- export const bottomShowAnimation = keyframes `
48
+ exports.bottomShowAnimation = (0, react_1.keyframes) `
43
49
  from {
44
50
  opacity: 0;
45
- transform: translate(-50%, 100%);
51
+ transform: translate(-50%, 120%);
46
52
  }
47
53
  to {
48
54
  opacity: 1;
49
55
  transform: translate(-50%, 0);
50
56
  }
51
57
  `;
52
- export const bottomHideAnimation = keyframes `
58
+ exports.bottomHideAnimation = (0, react_1.keyframes) `
53
59
  from {
54
60
  opacity: 1;
55
61
  transform: translate(-50%, 0);
56
62
  }
57
63
  to {
58
64
  opacity: 0;
59
- transform: translate(-50%, 100%);
65
+ transform: translate(-50%, 120%);
60
66
  }
61
67
  `;
62
68
  /**
63
69
  * 根据位置和类型获取动画
64
- * @param position
65
- * @param type
66
- * @returns
67
70
  */
68
- export function getAnimation(position, type) {
71
+ function getAnimation(position, type) {
69
72
  const animation = {
70
- top: [topShowAnimation, topHideAnimation],
71
- middle: [middleShowAnimation, middleHideAnimation],
72
- bottom: [bottomShowAnimation, bottomHideAnimation],
73
+ top: [exports.topShowAnimation, exports.topHideAnimation],
74
+ middle: [exports.middleShowAnimation, exports.middleHideAnimation],
75
+ bottom: [exports.bottomShowAnimation, exports.bottomHideAnimation],
73
76
  };
74
77
  let keyframes;
75
78
  if (type === "show") {
@@ -80,44 +83,49 @@ export function getAnimation(position, type) {
80
83
  }
81
84
  return {
82
85
  keyframes,
83
- animation: css({
84
- animation: `${keyframes} 300ms ease`,
86
+ animation: (0, react_1.css)({
87
+ animation: `${keyframes} 260ms ${easing}`,
85
88
  }),
86
89
  };
87
90
  }
88
- export const style = {
91
+ exports.style = {
89
92
  container() {
90
- return css({
93
+ return (0, react_1.css)({
91
94
  position: "fixed",
92
95
  left: "50%",
93
96
  transform: "translateX(-50%)",
94
97
  zIndex: 9999,
95
- maxWidth: '6rem',
98
+ maxWidth: "6rem",
99
+ pointerEvents: "none",
100
+ fontFamily: fontStack,
101
+ WebkitFontSmoothing: "antialiased",
102
+ MozOsxFontSmoothing: "grayscale",
96
103
  });
97
104
  },
98
105
  top(offset) {
99
- return css({ top: offset / 100 + 'rem' });
106
+ return (0, react_1.css)({ top: offset / 100 + "rem" });
100
107
  },
101
- middle: css({ top: "50%" }),
108
+ middle: (0, react_1.css)({ top: "50%" }),
102
109
  bottom(offset) {
103
- return css({ bottom: offset / 100 + 'rem' });
110
+ return (0, react_1.css)({ bottom: offset / 100 + "rem" });
104
111
  },
105
112
  content: (radius) => {
106
- return css({
113
+ return (0, react_1.css)({
107
114
  position: "relative",
108
- backgroundColor: "rgba(0, 0, 0, .8)",
109
- color: "#fff",
115
+ backgroundColor: "rgba(17,24,39,.88)",
116
+ color: "#ffffff",
110
117
  margin: 0,
111
- whiteSpace: "nowrap",
112
- textOverflow: "ellipsis",
113
- overflow: "hidden",
114
- lineHeight: 1,
115
- fontSize: '.26rem',
116
- paddingLeft: '.3rem',
117
- paddingRight: '.3rem',
118
- paddingTop: '.4rem',
119
- paddingBottom: '.4rem',
120
- borderRadius: radius ? radius / 100 + 'rem' : 0,
118
+ // 允许多行,超过 maxWidth 时自然换行
119
+ whiteSpace: "pre-wrap",
120
+ wordBreak: "break-word",
121
+ lineHeight: 1.5,
122
+ fontSize: ".28rem",
123
+ fontWeight: 400,
124
+ letterSpacing: ".01rem",
125
+ textAlign: "center",
126
+ padding: ".2rem .32rem",
127
+ borderRadius: radius ? radius / 100 + "rem" : 0,
128
+ boxShadow: "0 .12rem .32rem rgba(0,0,0,.25)",
121
129
  });
122
130
  },
123
131
  contentMiddle: {
package/build/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export { tick } from './utils/tick';
2
- export { setContextValue, getContextValue } from './context';
3
2
  export { jsonp } from './utils/jsonp';
4
3
  export { uniqKey } from './utils/uniqKey';
5
4
  export { ago } from './utils/ago';
@@ -34,3 +33,4 @@ export { AutoGrid } from './AutoGrid';
34
33
  export { showAlert } from './Alert';
35
34
  export { ScrollView } from './ScrollView';
36
35
  export { CarouselNotice } from './CarouselNotice';
36
+ export { CitySelect, showCitySelect } from './CitySelect';
package/build/index.js CHANGED
@@ -1,36 +1,102 @@
1
- export { tick } from './utils/tick';
2
- export { setContextValue, getContextValue } from './context';
3
- export { jsonp } from './utils/jsonp';
4
- export { uniqKey } from './utils/uniqKey';
5
- export { ago } from './utils/ago';
6
- export { GET, POST, sendJSON, sugarSend, sendRequest, buildUrlByOption, registerHostAlias, } from './utils/request';
7
- export { calendarTable } from './utils/calendarTable';
8
- export { Countdown } from './utils/Countdown';
9
- export { defaultScroll } from './utils/defaultScroll';
10
- export { is } from './utils/is';
11
- export { waitFor, waitUntil } from './utils/wait';
12
- export { normalizeUnit, splitValue } from './utils/cssUtil';
13
- export { createApp, history, getHistory } from './utils/createApp';
14
- export { createPortalDOM } from './utils/dom';
15
- export { useInterval } from './Effect/useInterval';
16
- export { useTick } from './Effect/useTick';
17
- export { useUpdate } from './Effect/useUpdate';
18
- export { useWindowResize } from './Effect/useWindowResize';
19
- export { useViewport } from './Effect/useViewport';
20
- export { Ago } from './Ago';
21
- export { Container } from './Container';
22
- export { Flex, FlexItem } from './Flex';
23
- export { Row, RowAround, RowBetween, RowCenter, RowEnd, RowEvenly, RowStart, } from './Flex/Row';
24
- export { Col, ColAround, ColBetween, ColCenter, ColEnd, ColEvenly, ColStart, } from './Flex/Col';
25
- export { Countdowner } from './Countdowner';
26
- export { Overlay } from './Overlay';
27
- export { showToast, showUniqToast } from './Toast';
28
- export { showDialog } from './Dialog';
29
- export { Clickable } from './Clickable';
30
- export { Indicator } from './Indicator';
31
- export { showLoading, showLoadingAtLeast } from './Loading';
32
- export { SafeArea } from './SafeArea';
33
- export { AutoGrid } from './AutoGrid';
34
- export { showAlert } from './Alert';
35
- export { ScrollView } from './ScrollView';
36
- export { CarouselNotice } from './CarouselNotice';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.showUniqToast = exports.showToast = exports.Overlay = exports.Countdowner = exports.ColStart = exports.ColEvenly = exports.ColEnd = exports.ColCenter = exports.ColBetween = exports.ColAround = exports.Col = exports.RowStart = exports.RowEvenly = exports.RowEnd = exports.RowCenter = exports.RowBetween = exports.RowAround = exports.Row = exports.FlexItem = exports.Flex = exports.Container = exports.Ago = exports.useViewport = exports.useWindowResize = exports.useUpdate = exports.useTick = exports.useInterval = exports.createPortalDOM = exports.getHistory = exports.history = exports.createApp = exports.splitValue = exports.normalizeUnit = exports.waitUntil = exports.waitFor = exports.is = exports.defaultScroll = exports.Countdown = exports.calendarTable = exports.registerHostAlias = exports.buildUrlByOption = exports.sendRequest = exports.sugarSend = exports.sendJSON = exports.POST = exports.GET = exports.ago = exports.uniqKey = exports.jsonp = exports.tick = void 0;
4
+ exports.showCitySelect = exports.CitySelect = exports.CarouselNotice = exports.ScrollView = exports.showAlert = exports.AutoGrid = exports.SafeArea = exports.showLoadingAtLeast = exports.showLoading = exports.Indicator = exports.Clickable = exports.showDialog = void 0;
5
+ var tick_1 = require("./utils/tick");
6
+ Object.defineProperty(exports, "tick", { enumerable: true, get: function () { return tick_1.tick; } });
7
+ var jsonp_1 = require("./utils/jsonp");
8
+ Object.defineProperty(exports, "jsonp", { enumerable: true, get: function () { return jsonp_1.jsonp; } });
9
+ var uniqKey_1 = require("./utils/uniqKey");
10
+ Object.defineProperty(exports, "uniqKey", { enumerable: true, get: function () { return uniqKey_1.uniqKey; } });
11
+ var ago_1 = require("./utils/ago");
12
+ Object.defineProperty(exports, "ago", { enumerable: true, get: function () { return ago_1.ago; } });
13
+ var request_1 = require("./utils/request");
14
+ Object.defineProperty(exports, "GET", { enumerable: true, get: function () { return request_1.GET; } });
15
+ Object.defineProperty(exports, "POST", { enumerable: true, get: function () { return request_1.POST; } });
16
+ Object.defineProperty(exports, "sendJSON", { enumerable: true, get: function () { return request_1.sendJSON; } });
17
+ Object.defineProperty(exports, "sugarSend", { enumerable: true, get: function () { return request_1.sugarSend; } });
18
+ Object.defineProperty(exports, "sendRequest", { enumerable: true, get: function () { return request_1.sendRequest; } });
19
+ Object.defineProperty(exports, "buildUrlByOption", { enumerable: true, get: function () { return request_1.buildUrlByOption; } });
20
+ Object.defineProperty(exports, "registerHostAlias", { enumerable: true, get: function () { return request_1.registerHostAlias; } });
21
+ var calendarTable_1 = require("./utils/calendarTable");
22
+ Object.defineProperty(exports, "calendarTable", { enumerable: true, get: function () { return calendarTable_1.calendarTable; } });
23
+ var Countdown_1 = require("./utils/Countdown");
24
+ Object.defineProperty(exports, "Countdown", { enumerable: true, get: function () { return Countdown_1.Countdown; } });
25
+ var defaultScroll_1 = require("./utils/defaultScroll");
26
+ Object.defineProperty(exports, "defaultScroll", { enumerable: true, get: function () { return defaultScroll_1.defaultScroll; } });
27
+ var is_1 = require("./utils/is");
28
+ Object.defineProperty(exports, "is", { enumerable: true, get: function () { return is_1.is; } });
29
+ var wait_1 = require("./utils/wait");
30
+ Object.defineProperty(exports, "waitFor", { enumerable: true, get: function () { return wait_1.waitFor; } });
31
+ Object.defineProperty(exports, "waitUntil", { enumerable: true, get: function () { return wait_1.waitUntil; } });
32
+ var cssUtil_1 = require("./utils/cssUtil");
33
+ Object.defineProperty(exports, "normalizeUnit", { enumerable: true, get: function () { return cssUtil_1.normalizeUnit; } });
34
+ Object.defineProperty(exports, "splitValue", { enumerable: true, get: function () { return cssUtil_1.splitValue; } });
35
+ var createApp_1 = require("./utils/createApp");
36
+ Object.defineProperty(exports, "createApp", { enumerable: true, get: function () { return createApp_1.createApp; } });
37
+ Object.defineProperty(exports, "history", { enumerable: true, get: function () { return createApp_1.history; } });
38
+ Object.defineProperty(exports, "getHistory", { enumerable: true, get: function () { return createApp_1.getHistory; } });
39
+ var dom_1 = require("./utils/dom");
40
+ Object.defineProperty(exports, "createPortalDOM", { enumerable: true, get: function () { return dom_1.createPortalDOM; } });
41
+ var useInterval_1 = require("./Effect/useInterval");
42
+ Object.defineProperty(exports, "useInterval", { enumerable: true, get: function () { return useInterval_1.useInterval; } });
43
+ var useTick_1 = require("./Effect/useTick");
44
+ Object.defineProperty(exports, "useTick", { enumerable: true, get: function () { return useTick_1.useTick; } });
45
+ var useUpdate_1 = require("./Effect/useUpdate");
46
+ Object.defineProperty(exports, "useUpdate", { enumerable: true, get: function () { return useUpdate_1.useUpdate; } });
47
+ var useWindowResize_1 = require("./Effect/useWindowResize");
48
+ Object.defineProperty(exports, "useWindowResize", { enumerable: true, get: function () { return useWindowResize_1.useWindowResize; } });
49
+ var useViewport_1 = require("./Effect/useViewport");
50
+ Object.defineProperty(exports, "useViewport", { enumerable: true, get: function () { return useViewport_1.useViewport; } });
51
+ var Ago_1 = require("./Ago");
52
+ Object.defineProperty(exports, "Ago", { enumerable: true, get: function () { return Ago_1.Ago; } });
53
+ var Container_1 = require("./Container");
54
+ Object.defineProperty(exports, "Container", { enumerable: true, get: function () { return Container_1.Container; } });
55
+ var Flex_1 = require("./Flex");
56
+ Object.defineProperty(exports, "Flex", { enumerable: true, get: function () { return Flex_1.Flex; } });
57
+ Object.defineProperty(exports, "FlexItem", { enumerable: true, get: function () { return Flex_1.FlexItem; } });
58
+ var Row_1 = require("./Flex/Row");
59
+ Object.defineProperty(exports, "Row", { enumerable: true, get: function () { return Row_1.Row; } });
60
+ Object.defineProperty(exports, "RowAround", { enumerable: true, get: function () { return Row_1.RowAround; } });
61
+ Object.defineProperty(exports, "RowBetween", { enumerable: true, get: function () { return Row_1.RowBetween; } });
62
+ Object.defineProperty(exports, "RowCenter", { enumerable: true, get: function () { return Row_1.RowCenter; } });
63
+ Object.defineProperty(exports, "RowEnd", { enumerable: true, get: function () { return Row_1.RowEnd; } });
64
+ Object.defineProperty(exports, "RowEvenly", { enumerable: true, get: function () { return Row_1.RowEvenly; } });
65
+ Object.defineProperty(exports, "RowStart", { enumerable: true, get: function () { return Row_1.RowStart; } });
66
+ var Col_1 = require("./Flex/Col");
67
+ Object.defineProperty(exports, "Col", { enumerable: true, get: function () { return Col_1.Col; } });
68
+ Object.defineProperty(exports, "ColAround", { enumerable: true, get: function () { return Col_1.ColAround; } });
69
+ Object.defineProperty(exports, "ColBetween", { enumerable: true, get: function () { return Col_1.ColBetween; } });
70
+ Object.defineProperty(exports, "ColCenter", { enumerable: true, get: function () { return Col_1.ColCenter; } });
71
+ Object.defineProperty(exports, "ColEnd", { enumerable: true, get: function () { return Col_1.ColEnd; } });
72
+ Object.defineProperty(exports, "ColEvenly", { enumerable: true, get: function () { return Col_1.ColEvenly; } });
73
+ Object.defineProperty(exports, "ColStart", { enumerable: true, get: function () { return Col_1.ColStart; } });
74
+ var Countdowner_1 = require("./Countdowner");
75
+ Object.defineProperty(exports, "Countdowner", { enumerable: true, get: function () { return Countdowner_1.Countdowner; } });
76
+ var Overlay_1 = require("./Overlay");
77
+ Object.defineProperty(exports, "Overlay", { enumerable: true, get: function () { return Overlay_1.Overlay; } });
78
+ var Toast_1 = require("./Toast");
79
+ Object.defineProperty(exports, "showToast", { enumerable: true, get: function () { return Toast_1.showToast; } });
80
+ Object.defineProperty(exports, "showUniqToast", { enumerable: true, get: function () { return Toast_1.showUniqToast; } });
81
+ var Dialog_1 = require("./Dialog");
82
+ Object.defineProperty(exports, "showDialog", { enumerable: true, get: function () { return Dialog_1.showDialog; } });
83
+ var Clickable_1 = require("./Clickable");
84
+ Object.defineProperty(exports, "Clickable", { enumerable: true, get: function () { return Clickable_1.Clickable; } });
85
+ var Indicator_1 = require("./Indicator");
86
+ Object.defineProperty(exports, "Indicator", { enumerable: true, get: function () { return Indicator_1.Indicator; } });
87
+ var Loading_1 = require("./Loading");
88
+ Object.defineProperty(exports, "showLoading", { enumerable: true, get: function () { return Loading_1.showLoading; } });
89
+ Object.defineProperty(exports, "showLoadingAtLeast", { enumerable: true, get: function () { return Loading_1.showLoadingAtLeast; } });
90
+ var SafeArea_1 = require("./SafeArea");
91
+ Object.defineProperty(exports, "SafeArea", { enumerable: true, get: function () { return SafeArea_1.SafeArea; } });
92
+ var AutoGrid_1 = require("./AutoGrid");
93
+ Object.defineProperty(exports, "AutoGrid", { enumerable: true, get: function () { return AutoGrid_1.AutoGrid; } });
94
+ var Alert_1 = require("./Alert");
95
+ Object.defineProperty(exports, "showAlert", { enumerable: true, get: function () { return Alert_1.showAlert; } });
96
+ var ScrollView_1 = require("./ScrollView");
97
+ Object.defineProperty(exports, "ScrollView", { enumerable: true, get: function () { return ScrollView_1.ScrollView; } });
98
+ var CarouselNotice_1 = require("./CarouselNotice");
99
+ Object.defineProperty(exports, "CarouselNotice", { enumerable: true, get: function () { return CarouselNotice_1.CarouselNotice; } });
100
+ var CitySelect_1 = require("./CitySelect");
101
+ Object.defineProperty(exports, "CitySelect", { enumerable: true, get: function () { return CitySelect_1.CitySelect; } });
102
+ Object.defineProperty(exports, "showCitySelect", { enumerable: true, get: function () { return CitySelect_1.showCitySelect; } });