diff --git a/compiled/alipay/demo/pages/Grid/index.axml b/compiled/alipay/demo/pages/Grid/index.axml index 0f0fe44c9..089387f1f 100644 --- a/compiled/alipay/demo/pages/Grid/index.axml +++ b/compiled/alipay/demo/pages/Grid/index.axml @@ -22,7 +22,7 @@ @@ -107,7 +107,7 @@ key="{{'swiper-item-' + index}}" > diff --git a/compiled/alipay/demo/pages/Grid/index.js b/compiled/alipay/demo/pages/Grid/index.js index 4f5934d5d..a89e3bcf6 100644 --- a/compiled/alipay/demo/pages/Grid/index.js +++ b/compiled/alipay/demo/pages/Grid/index.js @@ -117,10 +117,13 @@ Page({ icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*I27zQbOu8ScAAAAAAAAAAAAAARQnAQ', }, ], + items5More: [], }, onLoad() { + const { items5 } = this.data; this.setData({ scrollItems: this.data.items4.concat(this.data.items4), + items5More: [...items5, ...items5], }); }, handleTapItem(item) { diff --git a/compiled/alipay/src/PopoverList/index.md b/compiled/alipay/src/PopoverList/index.md index 94bf4202d..b2057563d 100644 --- a/compiled/alipay/src/PopoverList/index.md +++ b/compiled/alipay/src/PopoverList/index.md @@ -9,8 +9,6 @@ toc: 'content' # PopoverList 气泡菜单 - - 点击元素,弹出气泡式的菜单 ## 何时使用 @@ -21,11 +19,9 @@ toc: 'content' ### 基本使用 - - ### 结合 List 组件使用 - + ## API diff --git a/compiled/alipay/src/PopoverList/index.ts b/compiled/alipay/src/PopoverList/index.ts index 3a9297a84..87b95fbcd 100644 --- a/compiled/alipay/src/PopoverList/index.ts +++ b/compiled/alipay/src/PopoverList/index.ts @@ -1,10 +1,9 @@ -import { Component, triggerEvent, getValueFromProps } from '../_util/simply'; -import { PopoverDefaultProps } from './props'; import mixinValue from '../mixins/value'; import { getInstanceBoundingClientRect } from '../_util/jsapi/get-instance-bounding-client-rect'; import { getSystemInfo } from '../_util/jsapi/get-system-info'; +import { Component, getValueFromProps, triggerEvent } from '../_util/simply'; +import { PopoverDefaultProps } from './props'; import { getPopoverStyle } from './utils'; -import get from '../_util/get'; Component( PopoverDefaultProps, @@ -16,7 +15,8 @@ Component( return this; }, onTapItem(e) { - this.props.onTapItem(e, get(e, 'currentTarget.dataset.item', {})); + const { item } = e.currentTarget.dataset; + triggerEvent(this, 'tapItem', item, e); }, async updatePopover() { const [placement, autoAdjustOverflow] = getValueFromProps(this, [ diff --git a/compiled/alipay/src/PopoverList/props.ts b/compiled/alipay/src/PopoverList/props.ts index e02a6650d..21022d922 100644 --- a/compiled/alipay/src/PopoverList/props.ts +++ b/compiled/alipay/src/PopoverList/props.ts @@ -70,7 +70,7 @@ export interface IPopoverProps extends IBaseProps { * @description visible 变更时回调 */ onVisibleChange?: (visible: boolean, e: Record) => void; - onTapItem?: (e: Record, item: PopoverListItem) => void; + onTapItem?: (item: PopoverListItem, e: Record) => void; /** * @description 气泡框位置 */ diff --git a/compiled/wechat/app.js b/compiled/wechat/app.js new file mode 100644 index 000000000..bca1d7008 --- /dev/null +++ b/compiled/wechat/app.js @@ -0,0 +1 @@ +App({}) \ No newline at end of file diff --git a/compiled/wechat/app.json b/compiled/wechat/app.json index 4951f9e79..b594763d2 100644 --- a/compiled/wechat/app.json +++ b/compiled/wechat/app.json @@ -33,7 +33,6 @@ "demo/pages/Grid/index", "demo/pages/Toast/index", "demo/pages/ActionSheet/index", - "demo/pages/StepsControl/index", "demo/pages/Checklist/index", "demo/pages/Modal/index", "demo/pages/GuideTour/index", @@ -53,16 +52,11 @@ "demo/pages/FormValidateMessages/index", "demo/pages/FormWatch/index", "demo/pages/Avatar/index", - "demo/pages/RateCustom/index", - "demo/pages/RadioGroup/index", "demo/pages/Radio/index", "demo/pages/Rate/index", - "demo/pages/SelectorFilter/index", "demo/pages/Selector/index", - "demo/pages/ImageUploadControl/index", "demo/pages/ImageUpload/index", "demo/pages/DatePicker/index", - "demo/pages/CascaderPicker/index", "demo/pages/Picker/index", "demo/pages/Checkbox/index", "demo/pages/Popup/index", @@ -85,7 +79,6 @@ "demo/pages/Icon/index", "demo/pages/Loading/index", "demo/pages/Tag/index", - "demo/pages/Feedback/index", "demo/pages/ButtonCustom/index" ] } diff --git a/compiled/wechat/app.wxss b/compiled/wechat/app.wxss new file mode 100644 index 000000000..6dd77edc4 --- /dev/null +++ b/compiled/wechat/app.wxss @@ -0,0 +1,3 @@ +page { + background-color: #F5F5f5; +} diff --git a/compiled/wechat/demo/pages/Grid/index.js b/compiled/wechat/demo/pages/Grid/index.js index 5ef77d6eb..d78149f04 100644 --- a/compiled/wechat/demo/pages/Grid/index.js +++ b/compiled/wechat/demo/pages/Grid/index.js @@ -117,10 +117,13 @@ Page({ icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*I27zQbOu8ScAAAAAAAAAAAAAARQnAQ', }, ], + items5More: [], }, onLoad() { + const { items5 } = this.data; this.setData({ scrollItems: this.data.items4.concat(this.data.items4), + items5More: [...items5, ...items5], }); }, handleTapItem(item) { diff --git a/compiled/wechat/demo/pages/Grid/index.wxml b/compiled/wechat/demo/pages/Grid/index.wxml index 7f5a4a6d0..2b8474792 100644 --- a/compiled/wechat/demo/pages/Grid/index.wxml +++ b/compiled/wechat/demo/pages/Grid/index.wxml @@ -22,7 +22,7 @@ @@ -107,7 +107,7 @@ key="{{'swiper-item-' + index}}" > diff --git a/compiled/wechat/package.json b/compiled/wechat/package.json new file mode 100644 index 000000000..c33ce0eb8 --- /dev/null +++ b/compiled/wechat/package.json @@ -0,0 +1,12 @@ +{ + "dependencies": { + "@preact/signals-core": "^1.7.0", + "@mini-types/alipay": "^3.0.5", + "async-validator": "^4.0.7", + "dayjs": "^1.11.10", + "fast-deep-equal": "3.1.3", + "lodash-es": "^4.17.21", + "tslib": "2.5.0" + }, + "repository": "git@github.com:ant-design/ant-design-mini.git" +} diff --git a/compiled/wechat/src/PopoverList/index.en.md b/compiled/wechat/src/PopoverList/index.en.md new file mode 100644 index 000000000..93518bb55 --- /dev/null +++ b/compiled/wechat/src/PopoverList/index.en.md @@ -0,0 +1,61 @@ +--- +nav: + path: /components +group: + title: Feedback + order: 12 +toc: 'content' +--- + +# PopoverList + + + +Click on the element to pop up the bubble menu + +## When to use + +The bubble menu for navigation functions is evoked, usually used to accommodate functions used at low frequencies. This function can only be activated via the icon on the navigation bar. + +## Code Sample + +### Basic use + + + +### Use with List component + + + +## API + +| Property | Description | Type | Default Value | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------ | +| autoAdjustOverflow | Automatically adjust the position when the bubble is blocked | boolean | true | +| className | Class Name | string | - | +| color | Background Color | string | - | +| contentClassName | content Class Name | string | - | +| contentStyle | content Style | string | - | +| content | Content | string \| slot | - | +| defaultVisible | Display by default | boolean | false | +| destroyOnClose | Whether to unload content when invisible | boolean | false | +| maskClassName | Class name of the layer | string | - | +| maskStyle | The style of the layer | string | - | +| placement | Bubble box position, optional `top`、`top-right`、`top-left`、`bottom`、`bottom-left`、`bottom-right`、`left`、`left-top`、`left-bottom`、`right`、`right-top` or `right-bottom` | string | top | +| showMask | Whether to show the layer, if true, click the blank to close the Popover. | boolean | true | +| style | Style | string | - | +| visible | Display | boolean | - | +| onVisibleChange | Callback at the time of visible change | (visible: boolean, event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | + +### Theme customization + +#### Style Variables + +Component provides the following CSS variables, which can be used to customize styles. For details, see ConfigProvider Components. + +| Variable name | Default Value | Remarks | +| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------ | +| --popover-list-content-bg |
rgba(0, 0, 0, 0.93)
| Popover List Content Background Color | +| --popover-list-content-color |
#ffffff
| Popover List Content Color | +| --popover-list-badge-color |
#ff411c
| Popover List Badge Color | +| --popover-list-content-color |
#333333
| Popover List Content Text Color | diff --git a/compiled/wechat/src/PopoverList/index.js b/compiled/wechat/src/PopoverList/index.js new file mode 100644 index 000000000..1e5f28e06 --- /dev/null +++ b/compiled/wechat/src/PopoverList/index.js @@ -0,0 +1,128 @@ +var __awaiter = (this && this.__awaiter) || function (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()); + }); +}; +var __generator = (this && this.__generator) || function (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 }; + } +}; +import mixinValue from '../mixins/value'; +import { getInstanceBoundingClientRect } from '../_util/jsapi/get-instance-bounding-client-rect'; +import { getSystemInfo } from '../_util/jsapi/get-system-info'; +import { Component, getValueFromProps, triggerEvent } from '../_util/simply'; +import { PopoverDefaultProps } from './props'; +import { getPopoverStyle } from './utils'; +Component(PopoverDefaultProps, { + getInstance: function () { + if (this.$id) { + return my; + } + return this; + }, + onTapItem: function (e) { + var item = e.currentTarget.dataset.item; + triggerEvent(this, 'tapItem', item, e); + }, + updatePopover: function () { + return __awaiter(this, void 0, void 0, function () { + var _a, placement, autoAdjustOverflow, _b, containerRect, childrenRect, contentRect, systemInfo, _c, popoverContentStyle, adjustedPlacement; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + _a = getValueFromProps(this, [ + 'placement', + 'autoAdjustOverflow', + ]), placement = _a[0], autoAdjustOverflow = _a[1]; + return [4 /*yield*/, Promise.all([ + getInstanceBoundingClientRect(this.getInstance(), "#ant-popover-list-children".concat(this.$id ? "-".concat(this.$id) : '')), + getInstanceBoundingClientRect(this.getInstance(), this.$id + ? "#ant-popover-list-children-".concat(this.$id, " > *") + : "#ant-popover-list-children-container"), + getInstanceBoundingClientRect(this.getInstance(), this.$id + ? "#ant-popover-list-content-".concat(this.$id) + : '#ant-popover-list-content'), + getSystemInfo(), + ])]; + case 1: + _b = _d.sent(), containerRect = _b[0], childrenRect = _b[1], contentRect = _b[2], systemInfo = _b[3]; + _c = getPopoverStyle(placement, autoAdjustOverflow, { + containerRect: containerRect, + childrenRect: childrenRect, + contentRect: contentRect, + systemInfo: systemInfo, + }), popoverContentStyle = _c.popoverContentStyle, adjustedPlacement = _c.adjustedPlacement; + this.setData({ + popoverContentStyle: popoverContentStyle, + adjustedPlacement: adjustedPlacement, + }); + return [2 /*return*/]; + } + }); + }); + }, + onVisibleChange: function (e) { + var value = !this.getValue(); + if (!this.isControlled()) { + this.update(value); + } + triggerEvent(this, 'visibleChange', value, e); + }, +}, { + adjustedPlacement: '', + popoverContentStyle: '', +}, [ + mixinValue({ + valueKey: 'visible', + defaultValueKey: 'defaultVisible', + transformValue: function (value) { + if (value) { + this.updatePopover(); + } + else { + this.setData({ + adjustedPlacement: '', + }); + } + return { + needUpdate: true, + value: value, + }; + }, + }), +], { + observers: { + 'placement, autoAdjustOverflow, mixin': function () { + if (this.getValue()) { + this.updatePopover(); + } + }, + }, +}); diff --git a/compiled/wechat/src/PopoverList/index.json b/compiled/wechat/src/PopoverList/index.json new file mode 100644 index 000000000..5845a1d91 --- /dev/null +++ b/compiled/wechat/src/PopoverList/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "ant-icon": "../Icon/index", + "mask": "../Mask/index" + } +} diff --git a/compiled/wechat/src/PopoverList/index.md b/compiled/wechat/src/PopoverList/index.md new file mode 100644 index 000000000..b2057563d --- /dev/null +++ b/compiled/wechat/src/PopoverList/index.md @@ -0,0 +1,57 @@ +--- +nav: + path: /components +group: + title: 反馈 + order: 12 +toc: 'content' +--- + +# PopoverList 气泡菜单 + +点击元素,弹出气泡式的菜单 + +## 何时使用 + +用于导航功能的气泡菜单唤起,通常用于收纳低频使用的功能。该功能只能通过导航栏上的图标激活。 + +## 代码示例 + +### 基本使用 + +### 结合 List 组件使用 + + + +## API + +| 属性 | 说明 | 类型 | 默认值 | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------ | +| autoAdjustOverflow | 气泡被遮挡时的自动调整位置 | boolean | true | +| className | 类名 | string | - | +| color | 背景颜色 | string | - | +| contentClassName | content 类名 | string | - | +| contentStyle | content 样式 | string | - | +| content | 内容 | string \| slot | - | +| defaultVisible | 默认是否显示 | boolean | false | +| destroyOnClose | 不可见时是否卸载内容 | boolean | false | +| maskClassName | 蒙层的类名 | string | - | +| maskStyle | 蒙层的样式 | string | - | +| placement | 气泡框位置,可选 `top`、`top-right`、`top-left`、`bottom`、`bottom-left`、`bottom-right`、`left`、`left-top`、`left-bottom`、`right`、`right-top` 或 `right-bottom` | string | top | +| showMask | 是否展示蒙层,为 true 时点击空白处可关闭 Popover | boolean | true | +| style | 样式 | string | - | +| visible | 是否显示 | boolean | - | +| onVisibleChange | visible 变更时的回调 | (visible: boolean, event: [Event](https://opendocs.alipay.com/mini/framework/event-object)) => void | - | + +### 主题定制 + +#### 样式变量 + +组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 ConfigProvider 组件。 + +| 变量名 | 默认值 | 备注 | +| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------ | +| --popover-list-content-bg |
rgba(0, 0, 0, 0.93)
| Popover 列表内容背景颜色 | +| --popover-list-content-color |
#ffffff
| Popover 列表内容颜色 | +| --popover-list-badge-color |
#ff411c
| Popover 列表徽章颜色 | +| --popover-list-content-color |
#333333
| Popover 列表内容文字颜色 | diff --git a/compiled/wechat/src/PopoverList/index.wxml b/compiled/wechat/src/PopoverList/index.wxml new file mode 100644 index 000000000..f70aae165 --- /dev/null +++ b/compiled/wechat/src/PopoverList/index.wxml @@ -0,0 +1,59 @@ + + + + + + + + + \ No newline at end of file diff --git a/compiled/wechat/src/PopoverList/index.wxss b/compiled/wechat/src/PopoverList/index.wxss new file mode 100644 index 000000000..8d42a0a75 --- /dev/null +++ b/compiled/wechat/src/PopoverList/index.wxss @@ -0,0 +1,181 @@ +.ant-popover-list { + position: relative; +} +.ant-popover-list-children { + z-index: 999; +} +.ant-popover-list-mask { + z-index: 998; + background: none; +} +.ant-popover-list-content { + position: absolute; + max-width: calc(100vw - 48 * 1rpx); + z-index: 999; + border-radius: 24rpx; + background: var(--popover-list-content-bg, rgba(0, 0, 0, 0.93)); + box-shadow: 0 4rpx 10rpx 0 var(--popover-list-content-bg, rgba(0, 0, 0, 0.93)); + color: var(--popover-list-content-color, #333333); +} +.ant-popover-list-content-arrow { + position: absolute; + width: 0; + height: 0; + border-left: 18rpx solid transparent; + border-right: 18rpx solid transparent; + border-bottom: 18rpx solid var(--popover-list-content-bg, rgba(0, 0, 0, 0.93)); +} +.ant-popover-list-content .ant-popover-list-item::before { + background: var(--popover-list-item-bg, #e5e5e5); +} +.ant-popover-list-item { + padding: 26rpx 24rpx 26rpx 32rpx; + display: flex; + justify-content: flex-start; + align-items: center; + flex-direction: row; + position: relative; + z-index: 1; +} +.ant-popover-list-item-0::before { + display: none; +} +.ant-popover-list-item::before { + content: ''; + position: absolute; + top: 0; + left: 16rpx; + width: calc(200% - 192 * 1rpx); + height: 2rpx; + transform: scale(0.5); + background: var(--popover-list-content-color, #333333); + z-index: 2; +} +.ant-popover-list-item-left { + padding-right: 16rpx; + width: 48rpx; + height: 48rpx; + overflow: hidden; +} +.ant-popover-list-item-left .ant-icon { + font-size: 48rpx; + width: 48rpx; + height: 48rpx; +} +.ant-popover-list-item-image { + width: 48rpx; + height: 48rpx; +} +.ant-popover-list-item-text { + font-weight: 400; + font-size: 30rpx; + letter-spacing: 0; + white-space: nowrap; + display: flex; + justify-content: flex-start; + align-items: center; + flex-direction: row; +} +.ant-popover-list-item-text-badge { + background: var(--popover-list-badge-color, #ff411c); + width: 20rpx; + border-radius: 50vh; + height: 20rpx; + margin-left: 8rpx; +} +.ant-popover-list-top { + transform: translate(-50%, -100%); +} +.ant-popover-list-top-arrow { + bottom: 2rpx; + transform: translate(-50%, 100%) rotate(180deg); + left: 50%; +} +.ant-popover-list-bottom { + transform: translate(-50%, 100%); +} +.ant-popover-list-bottom-arrow { + top: 2rpx; + transform: translate(-50%, -100%) rotate(0deg); + left: 50%; +} +.ant-popover-list-left { + transform: translate(-100%, -50%); +} +.ant-popover-list-left-arrow { + right: 2rpx; + transform: translate(75%, -50%) rotate(90deg); + top: 50%; +} +.ant-popover-list-right { + transform: translate(100%, -50%); +} +.ant-popover-list-right-arrow { + left: 2rpx; + transform: translate(-75%, -50%) rotate(-90deg); + top: 50%; +} +.ant-popover-list-top-left { + transform: translate(0, -100%); +} +.ant-popover-list-top-left-arrow { + bottom: 2rpx; + transform: translate(0, 100%) rotate(180deg); + left: 24rpx; +} +.ant-popover-list-top-right { + transform: translate(0, -100%); +} +.ant-popover-list-top-right-arrow { + bottom: 2rpx; + transform: translate(0, 100%) rotate(180deg); + right: 24rpx; +} +.ant-popover-list-bottom-left { + transform: translate(0, 100%); +} +.ant-popover-list-bottom-left-arrow { + top: 2rpx; + transform: translate(0, -100%) rotate(0deg); + left: 24rpx; +} +.ant-popover-list-bottom-right { + transform: translate(0, 100%); +} +.ant-popover-list-bottom-right-arrow { + top: 2rpx; + transform: translate(0, -100%) rotate(0deg); + right: 24rpx; +} +.ant-popover-list-left-top { + transform: translate(-100%, 0); +} +.ant-popover-list-left-top-arrow { + right: 2rpx; + transform: translate(75%, 0) rotate(90deg); + top: 24rpx; +} +.ant-popover-list-left-bottom { + transform: translate(-100%, 0); +} +.ant-popover-list-left-bottom-arrow { + right: 2rpx; + transform: translate(75%, 0) rotate(90deg); + bottom: 24rpx; +} +.ant-popover-list-right-top { + transform: translate(100%, 0); +} +.ant-popover-list-right-top-arrow { + left: 2rpx; + transform: translate(-75%, 0) rotate(-90deg); + top: 24rpx; +} +.ant-popover-list-right-bottom { + transform: translate(100%, 0); +} +.ant-popover-list-right-bottom-arrow { + left: 2rpx; + transform: translate(-75%, 0) rotate(-90deg); + bottom: 24rpx; +} diff --git a/compiled/wechat/src/PopoverList/props.js b/compiled/wechat/src/PopoverList/props.js new file mode 100644 index 000000000..8f4c979b7 --- /dev/null +++ b/compiled/wechat/src/PopoverList/props.js @@ -0,0 +1,16 @@ +export var PopoverDefaultProps = { + visible: null, + defaultVisible: false, + destroyOnClose: false, + contentClassName: '', + contentStyle: '', + showMask: true, + placement: 'top', + autoAdjustOverflow: true, + maskClassName: '', + maskStyle: '', + content: '', + list: [], + onVisibleChange: function () { }, + onTapItem: function () { }, +}; diff --git a/compiled/wechat/src/PopoverList/utils.js b/compiled/wechat/src/PopoverList/utils.js new file mode 100644 index 000000000..151d14cf5 --- /dev/null +++ b/compiled/wechat/src/PopoverList/utils.js @@ -0,0 +1,179 @@ +export function getPopoverStyle(placement, autoAdjustOverflow, size) { + var containerRect = size.containerRect, childrenRect = size.childrenRect, contentRect = size.contentRect, systemInfo = size.systemInfo; + var left = childrenRect.left - containerRect.left; + var top = childrenRect.top - containerRect.top; + var bottom = containerRect.bottom - childrenRect.bottom; + var right = containerRect.right - childrenRect.right; + var adjustedPlacement = placement; + var arrowMargin = 12; + var contentRectWidth = contentRect.width + arrowMargin; + var contentRectHeight = contentRect.height + arrowMargin; + if (autoAdjustOverflow) { + if (adjustedPlacement === 'top') { + if (childrenRect.top - contentRectHeight < 0) { + adjustedPlacement = 'bottom'; + } + } + else if (adjustedPlacement === 'bottom') { + if (childrenRect.bottom + contentRectHeight > systemInfo.windowHeight) { + adjustedPlacement = 'top'; + } + } + else if (adjustedPlacement === 'left') { + if (childrenRect.left - contentRectWidth < 0) { + adjustedPlacement = 'right'; + } + } + else if (adjustedPlacement === 'right') { + if (childrenRect.right + contentRectWidth > systemInfo.windowWidth) { + adjustedPlacement = 'left'; + } + } + else if (adjustedPlacement === 'top-left') { + if (childrenRect.top - contentRectHeight < 0) { + adjustedPlacement = adjustedPlacement.replace('top', 'bottom'); + } + if (childrenRect.left + contentRectWidth > systemInfo.windowWidth) { + adjustedPlacement = adjustedPlacement.replace('left', 'right'); + } + } + else if (adjustedPlacement === 'top-right') { + if (childrenRect.top - contentRectHeight < 0) { + adjustedPlacement = adjustedPlacement.replace('top', 'bottom'); + } + if (childrenRect.right - contentRectWidth < 0) { + adjustedPlacement = adjustedPlacement.replace('right', 'left'); + } + } + else if (adjustedPlacement === 'bottom-left') { + if (childrenRect.bottom + contentRectHeight > systemInfo.windowHeight) { + adjustedPlacement = adjustedPlacement.replace('bottom', 'top'); + } + if (childrenRect.left + contentRectWidth > systemInfo.windowWidth) { + adjustedPlacement = adjustedPlacement.replace('left', 'right'); + } + } + else if (adjustedPlacement === 'bottom-right') { + if (childrenRect.bottom + contentRectHeight > systemInfo.windowHeight) { + adjustedPlacement = adjustedPlacement.replace('bottom', 'top'); + } + if (childrenRect.right - contentRectWidth < 0) { + adjustedPlacement = adjustedPlacement.replace('right', 'left'); + } + } + else if (adjustedPlacement === 'left-top') { + if (childrenRect.left - contentRectWidth < 0) { + adjustedPlacement = adjustedPlacement.replace('left', 'right'); + } + if (childrenRect.top + contentRectHeight > systemInfo.windowHeight) { + adjustedPlacement = adjustedPlacement.replace('top', 'bottom'); + } + } + else if (adjustedPlacement === 'left-bottom') { + if (childrenRect.left - contentRectWidth < 0) { + adjustedPlacement = adjustedPlacement.replace('left', 'right'); + } + if (childrenRect.bottom - contentRectHeight < 0) { + adjustedPlacement = adjustedPlacement.replace('bottom', 'top'); + } + } + else if (adjustedPlacement === 'right-top') { + if (childrenRect.right + contentRectWidth > systemInfo.windowWidth) { + adjustedPlacement = adjustedPlacement.replace('right', 'left'); + } + if (childrenRect.top + contentRectHeight > systemInfo.windowHeight) { + adjustedPlacement = adjustedPlacement.replace('top', 'bottom'); + } + } + else if (adjustedPlacement === 'right-bottom') { + if (childrenRect.right + contentRectWidth > systemInfo.windowWidth) { + adjustedPlacement = adjustedPlacement.replace('right', 'left'); + } + if (childrenRect.bottom - contentRectHeight < 0) { + adjustedPlacement = adjustedPlacement.replace('bottom', 'top'); + } + } + } + var popoverContentStyle; + if (adjustedPlacement === 'top') { + popoverContentStyle = getStyle({ + left: left + childrenRect.width / 2, + top: top - arrowMargin, + }); + } + else if (adjustedPlacement === 'bottom') { + popoverContentStyle = getStyle({ + left: left + childrenRect.width / 2, + bottom: bottom - arrowMargin, + }); + } + else if (adjustedPlacement === 'left') { + popoverContentStyle = getStyle({ + left: left - arrowMargin, + top: top + childrenRect.height / 2, + }); + } + else if (adjustedPlacement === 'right') { + popoverContentStyle = getStyle({ + right: right - arrowMargin, + top: top + childrenRect.height / 2, + }); + } + else if (adjustedPlacement === 'top-left') { + popoverContentStyle = getStyle({ + left: left, + top: top - arrowMargin, + }); + } + else if (adjustedPlacement === 'top-right') { + popoverContentStyle = getStyle({ + right: right, + top: top - arrowMargin, + }); + } + else if (adjustedPlacement === 'bottom-left') { + popoverContentStyle = getStyle({ + left: left, + bottom: bottom - arrowMargin, + }); + } + else if (adjustedPlacement === 'bottom-right') { + popoverContentStyle = getStyle({ + right: right, + bottom: bottom - arrowMargin, + }); + } + else if (adjustedPlacement === 'left-top') { + popoverContentStyle = getStyle({ + left: left - arrowMargin, + top: top, + }); + } + else if (adjustedPlacement === 'left-bottom') { + popoverContentStyle = getStyle({ + left: left - arrowMargin, + bottom: bottom, + }); + } + else if (adjustedPlacement === 'right-top') { + popoverContentStyle = getStyle({ + right: right - arrowMargin, + top: top, + }); + } + else if (adjustedPlacement === 'right-bottom') { + popoverContentStyle = getStyle({ + right: right - arrowMargin, + bottom: bottom, + }); + } + return { + popoverContentStyle: popoverContentStyle, + adjustedPlacement: adjustedPlacement, + }; +} +function getStyle(obj) { + return Object.keys(obj) + .map(function (item) { return "".concat(item, ": ").concat(obj[item], "px"); }) + .join(';'); +} diff --git a/compiled/wechat/src/PopoverList/variable.wxss b/compiled/wechat/src/PopoverList/variable.wxss new file mode 100644 index 000000000..e69de29bb diff --git a/compiled/wechat/src/_locale/ar-SA.js b/compiled/wechat/src/_locale/ar-SA.js new file mode 100644 index 000000000..45a35339d --- /dev/null +++ b/compiled/wechat/src/_locale/ar-SA.js @@ -0,0 +1,60 @@ +//ar-SA 阿拉伯语 +var arSA = { + // locales for all components + locale: 'ar-SA', + global: { + placeholder: 'يرجى الاختيار', + emptyText: 'لا توجد بيانات حتى الآن', + okText: 'تأكيد', + cancelText: 'إلغاء', + }, + calendar: { + weekdayNames: [ + 'الإثنين', + 'الثلاثاء', + 'الأربعاء', + 'الخميس', + 'الجمعة', + 'السبت', + 'الأحد', + ], + today: 'اليوم', + start: 'ابدأ', + end: 'النهاية', + startAndEnd: 'البداية/النهاية', + format: 'MM/YYYY', + }, + rangePicker: { + startPlaceholder: 'لم يبدأ الاختيار', + endPlaceholder: 'لم يكتمل الاختيار', + }, + guideTour: { + gotItText: 'فهمت ذلك', + nextStepText: 'الخطوة التالية', + prevStepText: 'الخطوة السابقة', + jumpText: 'تخطي', + }, + imageUpload: { + uploadingText: 'جارٍ التحميل', + uploadfailedText: 'فشل في التحميل', + }, + pageContainer: { + failed: { + title: 'تواجه الصفحة بعض المشكلات البسيطة', + message: 'سأحاول ذلك لاحقًا', + }, + disconnected: { + title: 'الشبكة مشغولة بعض الشيء', + message: 'حرّك إصبعك للمساعدة في الإصلاح', + }, + empty: { + title: 'لا يوجد شيء هنا', + message: 'انظر إلى أشياء أخرى', + }, + busy: { + title: 'الازدحام الأمامي', + message: 'جرّب الانتعاش.', + }, + }, +}; +export default arSA; diff --git a/compiled/wechat/src/_locale/de-DE.js b/compiled/wechat/src/_locale/de-DE.js new file mode 100644 index 000000000..c9d0ee78c --- /dev/null +++ b/compiled/wechat/src/_locale/de-DE.js @@ -0,0 +1,59 @@ +var deDE = { + // locales for all components + locale: 'de-DE', + global: { + placeholder: 'Bitte wählen Sie', + emptyText: 'Keine Daten verfügbar', + okText: 'Bestimmt', + cancelText: 'Abbrechen', + }, + calendar: { + weekdayNames: [ + 'Montag', + 'Dienstag', + 'Mittwoch', + 'Donnerstag', + 'Freitag', + 'Samstag', + 'Sonntag', + ], + today: 'Heute', + start: 'Start', + end: 'Ende', + startAndEnd: 'Anfang/Ende', + format: 'MM/YYYY', + }, + rangePicker: { + startPlaceholder: 'Die Auswahl hat noch nicht begonnen', + endPlaceholder: 'Unvollständige Auswahl', + }, + guideTour: { + gotItText: 'Ich habe es verstanden', + nextStepText: 'Nächster Schritt', + prevStepText: 'Vorheriger Schritt', + jumpText: 'Überspringen', + }, + imageUpload: { + uploadingText: 'Hochladen', + uploadfailedText: 'Der Upload ist fehlgeschlagen', + }, + pageContainer: { + failed: { + title: 'Auf der Seite treten einige kleinere Probleme auf', + message: 'Ich werde es später ausprobieren', + }, + disconnected: { + title: 'Das Netzwerk ist etwas beschäftigt', + message: 'Bewegen Sie bitte Ihre Finger, um zu helfen, es zu reparieren.', + }, + empty: { + title: 'Hier gibt es nichts.', + message: 'Schauen Sie sich auch die anderen an.', + }, + busy: { + title: 'Stau voraus', + message: 'Versuchen Sie es erneut.', + }, + }, +}; +export default deDE; diff --git a/compiled/wechat/src/_locale/en-US.js b/compiled/wechat/src/_locale/en-US.js new file mode 100644 index 000000000..d81d1679e --- /dev/null +++ b/compiled/wechat/src/_locale/en-US.js @@ -0,0 +1,51 @@ +var enUS = { + // locales for all components + locale: 'en-US', + global: { + placeholder: 'Please select', + emptyText: 'No data available', + okText: 'Ok', + cancelText: 'Cancel', + }, + calendar: { + weekdayNames: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], + today: 'Today', + start: 'Start', + end: 'End', + startAndEnd: 'Start/End', + format: 'MMM D, YYYY', + }, + rangePicker: { + startPlaceholder: 'No selection started', + endPlaceholder: 'Incomplete selection', + }, + guideTour: { + gotItText: 'Got it', + nextStepText: 'Next step', + prevStepText: 'Previous step', + jumpText: 'Skip', + }, + imageUpload: { + uploadingText: 'Uploading', + uploadfailedText: 'Upload failed', + }, + pageContainer: { + failed: { + title: 'The page is experiencing some minor issues', + message: "I'll try it later", + }, + disconnected: { + title: 'The network is a bit busy', + message: 'Move your fingers to help repair', + }, + empty: { + title: "There's nothing here", + message: 'Check out the others', + }, + busy: { + title: 'Congestion ahead', + message: 'Try refreshing', + }, + }, +}; +export default enUS; diff --git a/compiled/wechat/src/_locale/es-ES.js b/compiled/wechat/src/_locale/es-ES.js new file mode 100644 index 000000000..562db8fad --- /dev/null +++ b/compiled/wechat/src/_locale/es-ES.js @@ -0,0 +1,59 @@ +var esES = { + // locales for all components + locale: 'es-ES', + global: { + placeholder: 'Por favor, seleccione', + emptyText: 'No hay datos disponibles', + okText: 'Confirmar', + cancelText: 'Cancelar', + }, + calendar: { + weekdayNames: [ + 'Lunes', + 'Martes', + 'Miércoles', + 'Jueves', + 'Viernes', + 'Sábado', + 'Domingo', + ], + format: 'MM/YYYY', + today: 'Hoy', + start: 'Empezar', + end: 'Fin', + startAndEnd: 'Inicio/Fin', + }, + rangePicker: { + startPlaceholder: 'No ha comenzado la selección', + endPlaceholder: 'Selección no completada', + }, + guideTour: { + gotItText: 'Entendido', + nextStepText: 'Siguiente paso', + prevStepText: 'Paso anterior', + jumpText: 'Saltar', + }, + imageUpload: { + uploadingText: 'Subiendo', + uploadfailedText: 'Error al subir', + }, + pageContainer: { + failed: { + title: 'La página ha encontrado algunos pequeños problemas', + message: 'Lo probaré más tarde', + }, + disconnected: { + title: 'La red está un poco ocupada', + message: 'Mueve tus dedos para ayudar a arreglarlo', + }, + empty: { + title: 'Aquí no hay nada', + message: 'Echa un vistazo a los demás', + }, + busy: { + title: 'Congestión por delante', + message: 'Intente refrescar', + }, + }, +}; +export default esES; diff --git a/compiled/wechat/src/_locale/fr-FR.js b/compiled/wechat/src/_locale/fr-FR.js new file mode 100644 index 000000000..64dd3dd88 --- /dev/null +++ b/compiled/wechat/src/_locale/fr-FR.js @@ -0,0 +1,59 @@ +var frFR = { + // locales for all components + locale: 'fr-FR', + global: { + placeholder: 'Veuillez sélectionner', + emptyText: 'Aucune donnée disponible', + okText: 'Déterminer', + cancelText: 'Annuler', + }, + calendar: { + weekdayNames: [ + 'Lundi', + 'Mardi', + 'Mercredi', + 'Jeudi', + 'Vendredi', + 'Samedi', + 'Dimanche', + ], + format: 'MM/YYYY', + today: "Aujourd'hui", + start: 'Commencer', + end: 'Fin', + startAndEnd: 'Début/Fin', + }, + rangePicker: { + startPlaceholder: "La sélection n'a pas commencé", + endPlaceholder: 'Sélection incomplète', + }, + guideTour: { + gotItText: "J'ai compris", + nextStepText: 'Prochaine étape', + prevStepText: 'Étape précédente', + jumpText: 'Sauter', + }, + imageUpload: { + uploadingText: 'Téléchargement en cours', + uploadfailedText: 'Échec du téléchargement', + }, + pageContainer: { + failed: { + title: 'La page rencontre quelques problèmes mineurs', + message: 'Je l’essaierai plus tard', + }, + disconnected: { + title: 'Le réseau est un peu occupé.', + message: 'Bougez vos doigts pour aider à le réparer', + }, + empty: { + title: "Il n'y a rien ici.", + message: 'Regardez les autres.', + }, + busy: { + title: "La congestion à l'avant", + message: 'Essayez de rafraîchir.', + }, + }, +}; +export default frFR; diff --git a/compiled/wechat/src/_locale/in-ID.js b/compiled/wechat/src/_locale/in-ID.js new file mode 100644 index 000000000..79f014d6c --- /dev/null +++ b/compiled/wechat/src/_locale/in-ID.js @@ -0,0 +1,59 @@ +var inID = { + // locales for all components + locale: 'in-ID', + global: { + placeholder: 'Silakan pilih', + emptyText: 'Tidak ada data', + okText: 'Tentu', + cancelText: 'Pembatalan', + }, + calendar: { + weekdayNames: [ + 'Senin', + 'Selasa', + 'Rabu', + 'Kamis', + 'Jumat', + 'Sabtu', + 'Minggu', + ], + format: 'MM/YYYY', + today: 'Hari ini', + start: 'Mulai', + end: 'Akhir', + startAndEnd: 'Mulai/Akhir', + }, + rangePicker: { + startPlaceholder: 'Seleksi belum dimulai', + endPlaceholder: 'Seleksi belum selesai', + }, + guideTour: { + gotItText: 'Aku tahu', + nextStepText: 'Langkah selanjutnya', + prevStepText: 'Langkah sebelumnya', + jumpText: 'Lewati', + }, + imageUpload: { + uploadingText: 'Sedang diunggah', + uploadfailedText: 'Gagal mengunggah', + }, + pageContainer: { + failed: { + title: 'Halaman ini mengalami beberapa masalah kecil', + message: 'Saya akan mencobanya nanti.', + }, + disconnected: { + title: 'Jaringannya agak sibuk', + message: 'Gerakkan jari Anda untuk membantu memperbaikinya', + }, + empty: { + title: 'Tidak ada apa-apa di sini.', + message: 'Lihat yang lain.', + }, + busy: { + title: 'Kemacetan di depan', + message: 'Cobalah menyegarkan', + }, + }, +}; +export default inID; diff --git a/compiled/wechat/src/_locale/index.js b/compiled/wechat/src/_locale/index.js new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/compiled/wechat/src/_locale/index.js @@ -0,0 +1 @@ +export {}; diff --git a/compiled/wechat/src/_locale/it-IT.js b/compiled/wechat/src/_locale/it-IT.js new file mode 100644 index 000000000..3d2aaa186 --- /dev/null +++ b/compiled/wechat/src/_locale/it-IT.js @@ -0,0 +1,59 @@ +var itIT = { + // locales for all components + locale: 'it-IT', + global: { + placeholder: 'Seleziona', + emptyText: 'Nessun dato disponibile', + okText: 'Certamente', + cancelText: 'Annulla', + }, + calendar: { + weekdayNames: [ + 'Lunedì', + 'Martedì', + 'Mercoledì', + 'Giovedì', + 'Venerdì', + 'Sabato', + 'Domenica', + ], + format: 'MM/YYYY', + today: 'Oggi', + start: 'Inizia', + end: 'Fine', + startAndEnd: 'Inizio/Fine', + }, + rangePicker: { + startPlaceholder: 'Nessuna selezione avviata', + endPlaceholder: 'Selezione non completata', + }, + guideTour: { + gotItText: 'Capito', + nextStepText: 'Passo successivo', + prevStepText: 'Passaggio precedente', + jumpText: 'Salta', + }, + imageUpload: { + uploadingText: 'Caricamento in corso', + uploadfailedText: 'Caricamento non riuscito', + }, + pageContainer: { + failed: { + title: 'La pagina ha riscontrato alcuni problemi minori', + message: 'Lo proverò più tardi', + }, + disconnected: { + title: "La rete è un po' occupata", + message: 'Muovi le dita per ripararlo', + }, + empty: { + title: "Non c'è niente qui", + message: 'Guarda gli altri', + }, + busy: { + title: 'Congestione in vista', + message: 'Prova a ricaricare', + }, + }, +}; +export default itIT; diff --git a/compiled/wechat/src/_locale/ja-JP.js b/compiled/wechat/src/_locale/ja-JP.js new file mode 100644 index 000000000..9c9cb769e --- /dev/null +++ b/compiled/wechat/src/_locale/ja-JP.js @@ -0,0 +1,59 @@ +var jaJP = { + // locales for all components + locale: 'ja-JP', + global: { + placeholder: '選択してください', + emptyText: 'データはありません。', + okText: '確定', + cancelText: 'キャンセル', + }, + calendar: { + weekdayNames: [ + '月曜日', + '火曜日', + '水曜日', + '木曜日', + '金曜日', + '土曜日', + '日曜日', + ], + format: 'MM/YYYY', + today: '今日です', + start: '開始', + end: '終了', + startAndEnd: '開始/終了', + }, + rangePicker: { + startPlaceholder: '選択が開始されていません', + endPlaceholder: '未完成の選択', + }, + guideTour: { + gotItText: 'わかりました', + nextStepText: '次のステップ', + prevStepText: '前のステップ', + jumpText: 'スキップ', + }, + imageUpload: { + uploadingText: 'アップロード中です', + uploadfailedText: 'アップロードに失敗しました', + }, + pageContainer: { + failed: { + title: 'ページにいくつかの小さな問題が発生しています', + message: '後で試してみます', + }, + disconnected: { + title: 'ネットワークが少し混雑しています', + message: '指を動かして修正してください', + }, + empty: { + title: 'ここには何もありません', + message: '他のものをチェックしてください', + }, + busy: { + title: '前方が渋滞しています', + message: 'リフレッシュしてみてください', + }, + }, +}; +export default jaJP; diff --git a/compiled/wechat/src/_locale/ko-KR.js b/compiled/wechat/src/_locale/ko-KR.js new file mode 100644 index 000000000..491ea9756 --- /dev/null +++ b/compiled/wechat/src/_locale/ko-KR.js @@ -0,0 +1,59 @@ +var koKR = { + // locales for all components + locale: 'ko-KR', + global: { + placeholder: '선택해 주세요', + emptyText: '데이터가 없습니다', + okText: '확실합니다', + cancelText: '취소', + }, + calendar: { + weekdayNames: [ + '월요일', + '화요일', + '수요일', + '목요일', + '금요일', + '토요일', + '일요일', + ], + format: 'MM/YYYY', + today: '오늘', + start: '시작', + end: '끝', + startAndEnd: '시작/종료', + }, + rangePicker: { + startPlaceholder: '선택이 시작되지 않았습니다', + endPlaceholder: '선택이 완료되지 않았습니다', + }, + guideTour: { + gotItText: '알았어요', + nextStepText: '다음 단계', + prevStepText: '이전 단계', + jumpText: '건너뛰기', + }, + imageUpload: { + uploadingText: '업로드 중', + uploadfailedText: '업로드 실패', + }, + pageContainer: { + failed: { + title: '페이지에 작은 문제가 발생했습니다', + message: '나중에 해볼게요', + }, + disconnected: { + title: '네트워크가 좀 바쁩니다', + message: '손가락을 움직여 문제를 해결하세요', + }, + empty: { + title: '여기에는 아무것도 없습니다', + message: '다른 것을 보세요', + }, + busy: { + title: '전방 혼잡', + message: '새로 고침 해보세요', + }, + }, +}; +export default koKR; diff --git a/compiled/wechat/src/_locale/ms-MY.js b/compiled/wechat/src/_locale/ms-MY.js new file mode 100644 index 000000000..5632ddb73 --- /dev/null +++ b/compiled/wechat/src/_locale/ms-MY.js @@ -0,0 +1,59 @@ +var msMY = { + // locales for all components + locale: 'ms-MY', + global: { + placeholder: 'Sila pilih', + emptyText: 'Tiada data', + okText: 'Tentu', + cancelText: 'Batal', + }, + calendar: { + weekdayNames: [ + 'Isnin', + 'Selasa', + 'Rabu', + 'Khamis', + 'Jumaat', + 'Sabtu', + 'Ahad', + ], + format: 'MM/YYYY', + today: 'Hari ini', + start: 'Mula', + end: 'Tamat', + startAndEnd: 'Mula/Tamat', + }, + rangePicker: { + startPlaceholder: 'Pemilihan belum bermula', + endPlaceholder: 'Pilihan yang belum selesai', + }, + guideTour: { + gotItText: 'Tahu', + nextStepText: 'Langkah seterusnya', + prevStepText: 'Langkah sebelumnya', + jumpText: 'Langkau', + }, + imageUpload: { + uploadingText: 'Sedang memuat naik', + uploadfailedText: 'Muat naik gagal', + }, + pageContainer: { + failed: { + title: 'Halaman ini mengalami beberapa masalah kecil', + message: 'Saya akan cuba nanti', + }, + disconnected: { + title: 'Jaringan agak sibuk', + message: 'Gerakkan jari anda untuk membantu membetulkan', + }, + empty: { + title: 'Tiada apa-apa di sini', + message: 'Lihat yang lain', + }, + busy: { + title: 'Kesesakan di hadapan', + message: 'Cuba segarkan semula', + }, + }, +}; +export default msMY; diff --git a/compiled/wechat/src/_locale/pt-BR.js b/compiled/wechat/src/_locale/pt-BR.js new file mode 100644 index 000000000..534ef636b --- /dev/null +++ b/compiled/wechat/src/_locale/pt-BR.js @@ -0,0 +1,59 @@ +var ptBR = { + // locales for all components + locale: 'pt-BR', + global: { + placeholder: 'Por favor, selecione', + emptyText: 'Não há dados disponíveis', + okText: 'Confirmar', + cancelText: 'Cancelar', + }, + calendar: { + weekdayNames: [ + 'Segunda-feira', + 'Terça-feira', + 'Quarta-feira', + 'Quinta-feira', + 'Sexta-feira', + 'Sábado', + 'Domingo', + ], + format: 'MM/YYYY', + today: 'Hoje', + start: 'Início', + end: 'Fim', + startAndEnd: 'Início/Fim', + }, + rangePicker: { + startPlaceholder: 'Nenhuma seleção foi iniciada', + endPlaceholder: 'Seleção não concluída', + }, + guideTour: { + gotItText: 'Entendi', + nextStepText: 'Próximo passo', + prevStepText: 'Etapa anterior', + jumpText: 'Pular', + }, + imageUpload: { + uploadingText: 'Carregando', + uploadfailedText: 'Falha no upload', + }, + pageContainer: { + failed: { + title: 'A página encontrou alguns pequenos problemas', + message: 'Vou tentar mais tarde', + }, + disconnected: { + title: 'A rede está um pouco ocupada', + message: 'Mova os dedos para ajudar a consertar', + }, + empty: { + title: 'Não há nada aqui', + message: 'Veja outros', + }, + busy: { + title: 'Congestionamento à frente', + message: 'Tente atualizar', + }, + }, +}; +export default ptBR; diff --git a/compiled/wechat/src/_locale/ru-RU.js b/compiled/wechat/src/_locale/ru-RU.js new file mode 100644 index 000000000..262977d4f --- /dev/null +++ b/compiled/wechat/src/_locale/ru-RU.js @@ -0,0 +1,59 @@ +var ruRU = { + // locales for all components + locale: 'ru-RU', + global: { + placeholder: 'Пожалуйста, выберите', + emptyText: 'Нет данных', + okText: 'Конечно', + cancelText: 'Отмена', + }, + calendar: { + weekdayNames: [ + 'Понедельник', + 'Вторник', + 'Среда', + 'Четверг', + 'Пятница', + 'Суббота', + 'Воскресенье', + ], + format: 'MM/YYYY', + today: 'Сегодня', + start: 'Начать', + end: 'Конец', + startAndEnd: 'Начало/конец', + }, + rangePicker: { + startPlaceholder: 'Выбор не начался', + endPlaceholder: 'Выбор не завершен', + }, + guideTour: { + gotItText: 'Понял', + nextStepText: 'Следующий шаг', + prevStepText: 'Предыдущий шаг', + jumpText: 'Пропустить', + }, + imageUpload: { + uploadingText: 'Загрузка', + uploadfailedText: 'Загрузка не удалась', + }, + pageContainer: { + failed: { + title: 'На странице возникли небольшие проблемы', + message: 'Попробую позже', + }, + disconnected: { + title: 'Сеть немного загружена', + message: 'Пожалуйста, помогите исправить, немного пошевелив пальцами', + }, + empty: { + title: 'Здесь ничего нет', + message: 'Посмотрите на другие', + }, + busy: { + title: 'Впереди заторы', + message: 'Попробуйте обновить', + }, + }, +}; +export default ruRU; diff --git a/compiled/wechat/src/_locale/th-TH.js b/compiled/wechat/src/_locale/th-TH.js new file mode 100644 index 000000000..2852197f0 --- /dev/null +++ b/compiled/wechat/src/_locale/th-TH.js @@ -0,0 +1,59 @@ +var thTH = { + // locales for all components + locale: 'th-TH', + global: { + placeholder: 'กรุณาเลือก', + emptyText: 'ยังไม่มีข้อมูล', + okText: 'แน่นอน', + cancelText: 'ยกเลิก', + }, + calendar: { + weekdayNames: [ + 'วันจันทร์', + 'วันอังคาร', + 'วันพุธ', + 'วันพฤหัสบดี', + 'วันศุกร์', + 'วันเสาร์', + 'วันอาทิตย์', + ], + format: 'MM/YYYY', + today: 'วันนี้', + start: 'เริ่มต้น', + end: 'สิ้นสุด', + startAndEnd: 'เริ่ม/สิ้นสุด', + }, + rangePicker: { + startPlaceholder: 'ยังไม่ได้เริ่มเลือก', + endPlaceholder: 'การเลือกไม่สมบูรณ์', + }, + guideTour: { + gotItText: 'รู้แล้ว', + nextStepText: 'ขั้นตอนต่อไป', + prevStepText: 'ขั้นตอนก่อนหน้า', + jumpText: 'ข้าม', + }, + imageUpload: { + uploadingText: 'กำลังอัปโหลด', + uploadfailedText: 'อัปโหลดล้มเหลว', + }, + pageContainer: { + failed: { + title: 'หน้าเว็บพบปัญหาเล็กน้อย', + message: 'จะลองในภายหลัง', + }, + disconnected: { + title: 'เครือข่ายยุ่งนิดหน่อย', + message: 'ขยับนิ้วของคุณเพื่อช่วยแก้ไข', + }, + empty: { + title: 'ที่นี่ไม่มีอะไรเลย', + message: 'ดูสิ่งอื่นๆ', + }, + busy: { + title: 'ความแออัดข้างหน้า', + message: 'ลองรีเฟรชดูครับ', + }, + }, +}; +export default thTH; diff --git a/compiled/wechat/src/_locale/tr-TR.js b/compiled/wechat/src/_locale/tr-TR.js new file mode 100644 index 000000000..322c03a3d --- /dev/null +++ b/compiled/wechat/src/_locale/tr-TR.js @@ -0,0 +1,59 @@ +var trTR = { + // locales for all components + locale: 'tr-TR', + global: { + placeholder: 'Lütfen seçin', + emptyText: 'Henüz veri yok.', + okText: 'Kesinlikle', + cancelText: 'İptal', + }, + calendar: { + weekdayNames: [ + 'Pazartesi', + 'Salı', + 'Çarşamba', + 'Perşembe', + 'Cuma', + 'Cumartesi', + 'Pazar', + ], + format: 'MM/YYYY', + today: 'Bugün', + start: 'Başla', + end: 'Bitiyor', + startAndEnd: 'Başlangıç/Bitiş', + }, + rangePicker: { + startPlaceholder: 'Seçim henüz başlamadı', + endPlaceholder: 'Seçim tamamlanmadı', + }, + guideTour: { + gotItText: 'Anladım', + nextStepText: 'Sonraki adım', + prevStepText: 'Önceki adım', + jumpText: 'Atla', + }, + imageUpload: { + uploadingText: 'Yükleniyor', + uploadfailedText: 'Yükleme başarısız oldu', + }, + pageContainer: { + failed: { + title: 'Sayfa bazı küçük sorunlar yaşıyor', + message: 'Daha sonra deneyeceğim', + }, + disconnected: { + title: 'Ağ biraz meşgul', + message: 'Düzeltmeye yardımcı olmak için parmağınızı hareket ettirin', + }, + empty: { + title: 'Burada hiçbir şey yok', + message: 'Diğerlerine bir göz atın', + }, + busy: { + title: 'Önümüzde trafik sıkışıklığı', + message: 'Yenilemeyi deneyin', + }, + }, +}; +export default trTR; diff --git a/compiled/wechat/src/_locale/vi-VN.js b/compiled/wechat/src/_locale/vi-VN.js new file mode 100644 index 000000000..54e60cf3e --- /dev/null +++ b/compiled/wechat/src/_locale/vi-VN.js @@ -0,0 +1,59 @@ +var viVN = { + // locales for all components + locale: 'vi-VN', + global: { + placeholder: 'Vui lòng chọn', + emptyText: 'Hiện tại không có dữ liệu', + okText: 'Xác định', + cancelText: 'Hủy bỏ', + }, + calendar: { + weekdayNames: [ + 'Thứ Hai', + 'Thứ ba', + 'Thứ Tư', + 'Thứ Năm', + 'Thứ Sáu', + 'Thứ Bảy', + 'Chủ nhật', + ], + today: 'Hôm nay', + start: 'Bắt đầu', + end: 'Kết thúc', + startAndEnd: 'Bắt đầu/Kết thúc', + format: 'MM/YYYY', + }, + rangePicker: { + startPlaceholder: 'Lựa chọn chưa bắt đầu', + endPlaceholder: 'Lựa chọn chưa hoàn thành', + }, + guideTour: { + gotItText: 'Biết rồi', + nextStepText: 'Bước tiếp theo', + prevStepText: 'Bước trước', + jumpText: 'Bỏ qua', + }, + imageUpload: { + uploadingText: 'Đang tải lên', + uploadfailedText: 'Tải lên không thành công', + }, + pageContainer: { + failed: { + title: 'Trang gặp phải một số vấn đề nhỏ', + message: 'Chờ một chút rồi thử xem', + }, + disconnected: { + title: 'Mạng hơi bận', + message: 'Di chuyển ngón tay của bạn để giúp khắc phục sự cố', + }, + empty: { + title: 'Ở đây không có gì cả', + message: 'Hãy xem những cái khác đi', + }, + busy: { + title: 'Tắc nghẽn phía trước', + message: 'Hãy thử làm mới', + }, + }, +}; +export default viVN; diff --git a/compiled/wechat/src/_locale/zh-CN.js b/compiled/wechat/src/_locale/zh-CN.js new file mode 100644 index 000000000..26435a2f2 --- /dev/null +++ b/compiled/wechat/src/_locale/zh-CN.js @@ -0,0 +1,51 @@ +var zhCN = { + // locales for all components + locale: 'zh-CN', + global: { + placeholder: '请选择', + emptyText: '暂无数据', + okText: '确定', + cancelText: '取消', + }, + calendar: { + weekdayNames: ['一', '二', '三', '四', '五', '六', '日'], + today: '今日', + start: '开始', + end: '结束', + startAndEnd: '开始/结束', + format: 'YYYY年MM月', + }, + rangePicker: { + startPlaceholder: '未选择', + endPlaceholder: '未选择', + }, + guideTour: { + gotItText: '知道了', + nextStepText: '下一步', + prevStepText: '上一步', + jumpText: '跳过', + }, + imageUpload: { + uploadingText: '上传中', + uploadfailedText: '上传失败', + }, + pageContainer: { + failed: { + title: '页面遇到一些小问题', + message: '待会来试试', + }, + disconnected: { + title: '网络有点忙', + message: '动动手指帮忙修复', + }, + empty: { + title: '这里什么也没有', + message: '看看其它吧', + }, + busy: { + title: '前方拥堵', + message: '刷新试试', + }, + }, +}; +export default zhCN; diff --git a/compiled/wechat/src/_locale/zh-HK.js b/compiled/wechat/src/_locale/zh-HK.js new file mode 100644 index 000000000..43cefb71b --- /dev/null +++ b/compiled/wechat/src/_locale/zh-HK.js @@ -0,0 +1,51 @@ +var zhHK = { + // locales for all components + locale: 'zh_HK', + global: { + placeholder: '請選擇', + emptyText: '暫無數據', + okText: '確定', + cancelText: '取消', + }, + calendar: { + weekdayNames: ['一', '二', '三', '四', '五', '六', '日'], + today: '今日', + start: '開始', + end: '結束', + startAndEnd: '開始/結束', + format: 'YYYY年MM月', + }, + rangePicker: { + startPlaceholder: '未選擇', + endPlaceholder: '未選擇', + }, + guideTour: { + gotItText: '知道了', + nextStepText: '下一步', + prevStepText: '上一步', + jumpText: '跳過', + }, + imageUpload: { + uploadingText: '上傳中', + uploadfailedText: '上傳失敗', + }, + pageContainer: { + failed: { + title: '頁面遇到一些小問題', + message: '待會來試試', + }, + disconnected: { + title: '網絡有點忙', + message: '動動手指幫忙修復', + }, + empty: { + title: '這裡什麼也沒有', + message: '看看其它吧', + }, + busy: { + title: '前方擁堵', + message: '刷新試試', + }, + }, +}; +export default zhHK; diff --git a/compiled/wechat/src/_locale/zh-TW.js b/compiled/wechat/src/_locale/zh-TW.js new file mode 100644 index 000000000..314e59bbe --- /dev/null +++ b/compiled/wechat/src/_locale/zh-TW.js @@ -0,0 +1,51 @@ +var zhTW = { + // locales for all components + locale: 'zh_TW', + global: { + placeholder: '請選擇', + emptyText: '暫無數據', + okText: '確定', + cancelText: '取消', + }, + calendar: { + weekdayNames: ['一', '二', '三', '四', '五', '六', '日'], + today: '今日', + start: '開始', + end: '結束', + startAndEnd: '開始/結束', + format: 'YYYY年MM月', + }, + rangePicker: { + startPlaceholder: '未選擇', + endPlaceholder: '未選擇', + }, + guideTour: { + gotItText: '知道了', + nextStepText: '下一步', + prevStepText: '上一步', + jumpText: '跳過', + }, + imageUpload: { + uploadingText: '上傳中', + uploadfailedText: '上傳失敗', + }, + pageContainer: { + failed: { + title: '頁面遇到一些小問題', + message: '待會來試試', + }, + disconnected: { + title: '網路有點忙', + message: '動動手指幫忙修復', + }, + empty: { + title: '這裡什麼也沒有', + message: '看看其它吧', + }, + busy: { + title: '前方擁堵', + message: '刷新試試', + }, + }, +}; +export default zhTW; diff --git a/config/wechat.json b/config/wechat.json index 505cc16f7..41a4b8abd 100644 --- a/config/wechat.json +++ b/config/wechat.json @@ -85,6 +85,7 @@ "pages/DatePicker" ], "src": [ + "_locale", "Empty", "_util", "Button", @@ -104,7 +105,7 @@ "ImageIcon", "Result", "Popover", - "popoverList", + "PopoverList", "Mask", "Stepper", "Popup", diff --git a/demo/pages/Grid/index.axml b/demo/pages/Grid/index.axml index b93a090c4..7642f7dc3 100644 --- a/demo/pages/Grid/index.axml +++ b/demo/pages/Grid/index.axml @@ -19,7 +19,7 @@
@@ -90,7 +90,7 @@ > diff --git a/demo/pages/Grid/index.ts b/demo/pages/Grid/index.ts index 1d6e8b02e..2cc60f9c7 100644 --- a/demo/pages/Grid/index.ts +++ b/demo/pages/Grid/index.ts @@ -117,10 +117,13 @@ Page({ icon: 'https://gw.alipayobjects.com/mdn/rms_3a7189/afts/img/A*I27zQbOu8ScAAAAAAAAAAAAAARQnAQ', }, ], + items5More: [], }, onLoad() { + const { items5 } = this.data; this.setData({ scrollItems: this.data.items4.concat(this.data.items4), + items5More: [...items5, ...items5], }); }, handleTapItem(item) { diff --git a/src/PopoverList/index.md b/src/PopoverList/index.md index 94bf4202d..b2057563d 100644 --- a/src/PopoverList/index.md +++ b/src/PopoverList/index.md @@ -9,8 +9,6 @@ toc: 'content' # PopoverList 气泡菜单 - - 点击元素,弹出气泡式的菜单 ## 何时使用 @@ -21,11 +19,9 @@ toc: 'content' ### 基本使用 - - ### 结合 List 组件使用 - + ## API diff --git a/src/PopoverList/index.ts b/src/PopoverList/index.ts index a4d4a4dfd..19886e213 100644 --- a/src/PopoverList/index.ts +++ b/src/PopoverList/index.ts @@ -1,10 +1,9 @@ -import { Component, triggerEvent, getValueFromProps } from '../_util/simply'; -import { PopoverDefaultProps } from './props'; import mixinValue from '../mixins/value'; import { getInstanceBoundingClientRect } from '../_util/jsapi/get-instance-bounding-client-rect'; import { getSystemInfo } from '../_util/jsapi/get-system-info'; +import { Component, getValueFromProps, triggerEvent } from '../_util/simply'; +import { PopoverDefaultProps } from './props'; import { getPopoverStyle } from './utils'; -import get from '../_util/get'; Component( PopoverDefaultProps, @@ -16,7 +15,8 @@ Component( return this; }, onTapItem(e) { - this.props.onTapItem(e, get(e, 'currentTarget.dataset.item', {})); + const { item } = e.currentTarget.dataset; + triggerEvent(this, 'tapItem', item, e); }, async updatePopover() { const [placement, autoAdjustOverflow] = getValueFromProps(this, [ diff --git a/src/PopoverList/props.ts b/src/PopoverList/props.ts index e02a6650d..21022d922 100644 --- a/src/PopoverList/props.ts +++ b/src/PopoverList/props.ts @@ -70,7 +70,7 @@ export interface IPopoverProps extends IBaseProps { * @description visible 变更时回调 */ onVisibleChange?: (visible: boolean, e: Record) => void; - onTapItem?: (e: Record, item: PopoverListItem) => void; + onTapItem?: (item: PopoverListItem, e: Record) => void; /** * @description 气泡框位置 */