@tuya-miniapp/smart-ui 2.3.0-beta-4 → 2.3.0-beta-6

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 (130) hide show
  1. package/README-zh_CN.md +66 -0
  2. package/dist/calendar/index.js +1 -0
  3. package/dist/calendar/index.json +1 -2
  4. package/dist/calendar/index.wxml +0 -2
  5. package/dist/common/appLog.d.ts +10 -0
  6. package/dist/common/appLog.js +105 -0
  7. package/dist/dialog/dialog.js +9 -0
  8. package/dist/dialog/index.js +5 -0
  9. package/dist/mixins/transition.js +13 -2
  10. package/dist/popover/index.js +2 -2
  11. package/dist/toast/index.js +4 -0
  12. package/dist/toast/toast.js +7 -1
  13. package/lib/calendar/index.js +1 -0
  14. package/lib/calendar/index.json +1 -2
  15. package/lib/calendar/index.wxml +0 -2
  16. package/lib/common/appLog.d.ts +10 -0
  17. package/lib/common/appLog.js +112 -0
  18. package/lib/dialog/dialog.js +12 -0
  19. package/lib/dialog/index.js +5 -0
  20. package/lib/mixins/transition.js +16 -2
  21. package/lib/popover/index.js +2 -2
  22. package/lib/toast/index.js +7 -0
  23. package/lib/toast/toast.js +10 -1
  24. package/package.json +6 -2
  25. package/lib/action-sheet/demo/index.d.ts +0 -1
  26. package/lib/action-sheet/demo/index.js +0 -124
  27. package/lib/area/demo/index.d.ts +0 -1
  28. package/lib/area/demo/index.js +0 -47
  29. package/lib/battery/demo/index.d.ts +0 -1
  30. package/lib/battery/demo/index.js +0 -4
  31. package/lib/bottom-sheet/demo/index.d.ts +0 -1
  32. package/lib/bottom-sheet/demo/index.js +0 -27
  33. package/lib/button/demo/index.d.ts +0 -1
  34. package/lib/button/demo/index.js +0 -14
  35. package/lib/calendar/demo/index.d.ts +0 -1
  36. package/lib/calendar/demo/index.js +0 -110
  37. package/lib/cascader/demo/index.d.ts +0 -1
  38. package/lib/cascader/demo/index.js +0 -197
  39. package/lib/cell/demo/index.d.ts +0 -1
  40. package/lib/cell/demo/index.js +0 -20
  41. package/lib/checkbox/demo/index.d.ts +0 -1
  42. package/lib/checkbox/demo/index.js +0 -38
  43. package/lib/circle/demo/index.d.ts +0 -1
  44. package/lib/circle/demo/index.js +0 -21
  45. package/lib/col/demo/index.d.ts +0 -1
  46. package/lib/col/demo/index.js +0 -6
  47. package/lib/collapse/demo/index.d.ts +0 -1
  48. package/lib/collapse/demo/index.js +0 -42
  49. package/lib/config-provider/demo/index.d.ts +0 -1
  50. package/lib/config-provider/demo/index.js +0 -24
  51. package/lib/count-down/demo/index.d.ts +0 -1
  52. package/lib/count-down/demo/index.js +0 -38
  53. package/lib/custom-keyboard/demo/index.d.ts +0 -1
  54. package/lib/custom-keyboard/demo/index.js +0 -19
  55. package/lib/datetime-picker/demo/index.d.ts +0 -1
  56. package/lib/datetime-picker/demo/index.js +0 -99
  57. package/lib/dialog/demo/index.d.ts +0 -1
  58. package/lib/dialog/demo/index.js +0 -144
  59. package/lib/divider/demo/index.d.ts +0 -1
  60. package/lib/divider/demo/index.js +0 -6
  61. package/lib/dropdown-menu/demo/index.d.ts +0 -1
  62. package/lib/dropdown-menu/demo/index.js +0 -52
  63. package/lib/empty/demo/index.d.ts +0 -1
  64. package/lib/empty/demo/index.js +0 -15
  65. package/lib/field/demo/index.d.ts +0 -1
  66. package/lib/field/demo/index.js +0 -25
  67. package/lib/goods-action/demo/index.d.ts +0 -1
  68. package/lib/goods-action/demo/index.js +0 -17
  69. package/lib/grid/demo/index.d.ts +0 -1
  70. package/lib/grid/demo/index.js +0 -11
  71. package/lib/icon/demo/index.d.ts +0 -1
  72. package/lib/icon/demo/index.js +0 -54
  73. package/lib/image/demo/index.d.ts +0 -1
  74. package/lib/image/demo/index.js +0 -17
  75. package/lib/index-bar/demo/index.d.ts +0 -1
  76. package/lib/index-bar/demo/index.js +0 -23
  77. package/lib/loading/demo/index.d.ts +0 -1
  78. package/lib/loading/demo/index.js +0 -6
  79. package/lib/nav-bar/demo/index.d.ts +0 -1
  80. package/lib/nav-bar/demo/index.js +0 -31
  81. package/lib/normal-slider/demo/index.d.ts +0 -1
  82. package/lib/normal-slider/demo/index.js +0 -21
  83. package/lib/notice-bar/demo/index.d.ts +0 -1
  84. package/lib/notice-bar/demo/index.js +0 -16
  85. package/lib/notify/demo/index.d.ts +0 -1
  86. package/lib/notify/demo/index.js +0 -50
  87. package/lib/overlay/demo/index.d.ts +0 -1
  88. package/lib/overlay/demo/index.js +0 -24
  89. package/lib/picker/demo/index.d.ts +0 -1
  90. package/lib/picker/demo/index.js +0 -99
  91. package/lib/popover/demo/index.d.ts +0 -1
  92. package/lib/popover/demo/index.js +0 -27
  93. package/lib/popup/demo/index.d.ts +0 -1
  94. package/lib/popup/demo/index.js +0 -85
  95. package/lib/progress/demo/index.d.ts +0 -1
  96. package/lib/progress/demo/index.js +0 -6
  97. package/lib/radio/demo/index.d.ts +0 -1
  98. package/lib/radio/demo/index.js +0 -34
  99. package/lib/rate/demo/index.d.ts +0 -1
  100. package/lib/rate/demo/index.js +0 -30
  101. package/lib/search/demo/index.d.ts +0 -1
  102. package/lib/search/demo/index.js +0 -48
  103. package/lib/sidebar/demo/index.d.ts +0 -1
  104. package/lib/sidebar/demo/index.js +0 -14
  105. package/lib/skeleton/demo/index.d.ts +0 -1
  106. package/lib/skeleton/demo/index.js +0 -14
  107. package/lib/slider/demo/index.d.ts +0 -1
  108. package/lib/slider/demo/index.js +0 -21
  109. package/lib/stepper/demo/index.d.ts +0 -1
  110. package/lib/stepper/demo/index.js +0 -25
  111. package/lib/steps/demo/index.d.ts +0 -1
  112. package/lib/steps/demo/index.js +0 -48
  113. package/lib/sticky/demo/index.d.ts +0 -1
  114. package/lib/sticky/demo/index.js +0 -30
  115. package/lib/swipe-cell/demo/index.d.ts +0 -1
  116. package/lib/swipe-cell/demo/index.js +0 -50
  117. package/lib/switch/demo/index.d.ts +0 -1
  118. package/lib/switch/demo/index.js +0 -37
  119. package/lib/tab/demo/index.d.ts +0 -1
  120. package/lib/tab/demo/index.js +0 -57
  121. package/lib/tabbar/demo/index.d.ts +0 -1
  122. package/lib/tabbar/demo/index.js +0 -41
  123. package/lib/tag/demo/index.d.ts +0 -1
  124. package/lib/tag/demo/index.js +0 -19
  125. package/lib/toast/demo/index.d.ts +0 -1
  126. package/lib/toast/demo/index.js +0 -74
  127. package/lib/transition/demo/index.d.ts +0 -1
  128. package/lib/transition/demo/index.js +0 -71
  129. package/lib/tree-select/demo/index.d.ts +0 -1
  130. package/lib/tree-select/demo/index.js +0 -130
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var component_1 = require("../../common/component");
4
- (0, component_1.SmartComponent)({
5
- data: {
6
- tabs2: [1, 2],
7
- tabs3: [1, 2, 3],
8
- tabs4: [1, 2, 3, 4],
9
- tabs6: [1, 2, 3, 4, 5, 6],
10
- tabsWithName: [
11
- { name: 'a', index: 1 },
12
- { name: 'b', index: 2 },
13
- { name: 'c', index: 3 },
14
- ],
15
- },
16
- methods: {
17
- onClickDisabled: function (event) {
18
- wx.showToast({
19
- title: "".concat(I18n.t('label'), " ").concat(event.detail.index + 1, " ").concat(I18n.t('hasBeenDisabled')),
20
- icon: 'none',
21
- });
22
- },
23
- onChange: function (event) {
24
- wx.showToast({
25
- title: "".concat(I18n.t('switchToTab'), " ").concat(event.detail.index + 1),
26
- icon: 'none',
27
- });
28
- },
29
- onClickNavRight: function () {
30
- wx.showToast({
31
- title: "".concat(I18n.t('click'), " right nav"),
32
- icon: 'none',
33
- });
34
- },
35
- onClick: function (event) {
36
- wx.showToast({
37
- title: "".concat(I18n.t('clickTag'), " ").concat(event.detail.index + 1),
38
- icon: 'none',
39
- });
40
- },
41
- onBeforeChange: function (event) {
42
- var _a = event.detail, callback = _a.callback, title = _a.title;
43
- wx.showModal({
44
- title: I18n.t('asynchronousSwitching'),
45
- content: "".concat(I18n.t('areYouSureYouWantToSwitchTo'), " ").concat(title, "\uFF1F"),
46
- success: function (res) {
47
- if (res.confirm) {
48
- callback(true);
49
- }
50
- else if (res.cancel) {
51
- callback(false);
52
- }
53
- },
54
- });
55
- },
56
- },
57
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,41 +0,0 @@
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
- var Tornado_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Tornado"));
7
- var Timer_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Timer"));
8
- var Snow_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Snow"));
9
- var Connect_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Connect"));
10
- var component_1 = require("../../common/component");
11
- (0, component_1.SmartComponent)({
12
- data: {
13
- active: 0,
14
- active2: 'home',
15
- active3: 0,
16
- active4: 0,
17
- active5: 0,
18
- active6: 0,
19
- icon: {
20
- normal: '',
21
- active: 'https://static1.tuyacn.com/static/tuya-miniapp-doc/_next/static/images/logo-small.png',
22
- },
23
- defaultIcon1: Tornado_1.default,
24
- defaultIcon2: Timer_1.default,
25
- defaultIcon3: Snow_1.default,
26
- defaultIcon4: Connect_1.default,
27
- },
28
- methods: {
29
- onChange: function (event) {
30
- var _a;
31
- var key = event.currentTarget.dataset.key;
32
- this.setData((_a = {}, _a[key] = event.detail, _a));
33
- },
34
- handleChange: function (event) {
35
- var _a;
36
- var key = event.currentTarget.dataset.key;
37
- this.setData((_a = {}, _a[key] = event.detail, _a));
38
- wx.showToast({ title: "".concat(I18n.t('clickTheTab'), " ").concat(event.detail + 1), icon: 'none' });
39
- },
40
- },
41
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var component_1 = require("../../common/component");
4
- (0, component_1.SmartComponent)({
5
- data: {
6
- show: {
7
- success: true,
8
- primary: true,
9
- },
10
- },
11
- methods: {
12
- onClose: function (event) {
13
- var _a;
14
- this.setData((_a = {},
15
- _a["show.".concat(event.target.id)] = false,
16
- _a));
17
- },
18
- },
19
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,74 +0,0 @@
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
- var component_1 = require("../../common/component");
7
- var toast_1 = __importDefault(require("../../toast/toast"));
8
- (0, component_1.SmartComponent)({
9
- methods: {
10
- showToast: function () {
11
- (0, toast_1.default)({ context: this, message: I18n.t('promptContent') });
12
- },
13
- showLongToast: function () {
14
- (0, toast_1.default)({
15
- context: this,
16
- message: I18n.t('toastDemoTip1'),
17
- });
18
- },
19
- showLoadingToast: function () {
20
- toast_1.default.loading({
21
- context: this,
22
- message: I18n.t('loading') + '...',
23
- forbidClick: true,
24
- });
25
- },
26
- showCustomLoadingToast: function () {
27
- toast_1.default.loading({
28
- context: this,
29
- message: I18n.t('loading') + '...',
30
- forbidClick: true,
31
- loadingType: 'spinner',
32
- });
33
- },
34
- showSuccessToast: function () {
35
- toast_1.default.success({ context: this, message: I18n.t('successMessage') });
36
- },
37
- showFailToast: function () {
38
- toast_1.default.fail({ context: this, message: I18n.t('failurePrompt') });
39
- },
40
- showWarnToast: function () {
41
- toast_1.default.warn({ context: this, message: I18n.t('warningPrompt') });
42
- },
43
- showCustomizedToast: function () {
44
- var text = function (second) {
45
- return "".concat(I18n.t('countdown'), " ").concat(second, " ").concat(I18n.t('second'));
46
- };
47
- var toast = toast_1.default.loading({
48
- context: this,
49
- duration: 0,
50
- forbidClick: true,
51
- message: text(3),
52
- });
53
- var second = 3;
54
- var timer = setInterval(function () {
55
- second--;
56
- if (second) {
57
- toast === null || toast === void 0 ? void 0 : toast.setData({ message: text(second) });
58
- }
59
- else {
60
- clearInterval(timer);
61
- toast_1.default.clear();
62
- }
63
- }, 1000);
64
- },
65
- showCustomizedWidthToast: function () {
66
- toast_1.default.loading({
67
- context: this,
68
- message: I18n.t('loading') + '...',
69
- forbidClick: true,
70
- width: 200,
71
- });
72
- },
73
- },
74
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var component_1 = require("../../common/component");
4
- (0, component_1.SmartComponent)({
5
- data: {
6
- show: false,
7
- name: 'fade',
8
- showCustom: false,
9
- },
10
- methods: {
11
- onClickFade: function () {
12
- this.trigger('fade');
13
- },
14
- onClickFadeUp: function () {
15
- this.trigger('fade-up');
16
- },
17
- onClickFadeDown: function () {
18
- this.trigger('fade-down');
19
- },
20
- onClickFadeLeft: function () {
21
- this.trigger('fade-left');
22
- },
23
- onClickFadeRight: function () {
24
- this.trigger('fade-right');
25
- },
26
- onClickSlideUp: function () {
27
- this.trigger('slide-up');
28
- },
29
- onClickSlideDown: function () {
30
- this.trigger('slide-down');
31
- },
32
- onClickSlideLeft: function () {
33
- this.trigger('slide-left');
34
- },
35
- onClickSlideRight: function () {
36
- this.trigger('slide-right');
37
- },
38
- trigger: function (name) {
39
- var _this = this;
40
- this.setData({ name: name, show: true });
41
- setTimeout(function () {
42
- _this.setData({ show: false });
43
- }, 500);
44
- },
45
- onClickCustom: function () {
46
- var _this = this;
47
- this.setData({ showCustom: true });
48
- setTimeout(function () {
49
- _this.setData({ showCustom: false });
50
- }, 1000);
51
- },
52
- onBeforeEnter: function () {
53
- console.log('before enter');
54
- },
55
- onEnter: function () {
56
- console.log('enter');
57
- },
58
- onAfterEnter: function () {
59
- console.log('after enter');
60
- },
61
- onBeforeLeave: function () {
62
- console.log('before leave');
63
- },
64
- onLeave: function () {
65
- console.log('leave');
66
- },
67
- onAfterLeave: function () {
68
- console.log('after leave');
69
- },
70
- },
71
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,130 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- var component_1 = require("../../common/component");
15
- var config = {
16
- pro1Name: I18n.t('zhejiang'),
17
- pro1: [
18
- {
19
- text: I18n.t('hangzhou'),
20
- id: 1,
21
- },
22
- {
23
- text: I18n.t('wenzhou'),
24
- id: 2,
25
- },
26
- {
27
- text: I18n.t('ningbo'),
28
- id: 3,
29
- disabled: true,
30
- },
31
- {
32
- text: I18n.t('yiwu'),
33
- id: 4,
34
- },
35
- ],
36
- pro2Name: I18n.t('jiangsu'),
37
- pro2: [
38
- {
39
- text: I18n.t('nanjing'),
40
- id: 5,
41
- },
42
- {
43
- text: I18n.t('wuxi'),
44
- id: 6,
45
- },
46
- {
47
- text: I18n.t('xuzhou'),
48
- id: 7,
49
- },
50
- {
51
- text: I18n.t('suzhou'),
52
- id: 8,
53
- },
54
- ],
55
- pro3Name: I18n.t('fujian'),
56
- pro3: [
57
- {
58
- text: I18n.t('quanzhou'),
59
- id: 9,
60
- },
61
- {
62
- text: I18n.t('xiamen'),
63
- id: 10,
64
- },
65
- ],
66
- };
67
- var items = [
68
- {
69
- text: config.pro1Name,
70
- options: config.pro1,
71
- },
72
- {
73
- text: config.pro2Name,
74
- options: config.pro2,
75
- },
76
- {
77
- text: config.pro3Name,
78
- disabled: true,
79
- options: config.pro3,
80
- },
81
- ];
82
- (0, component_1.SmartComponent)({
83
- data: {
84
- items: items,
85
- badgeItems: items.slice(0, 2).map(function (item, index) {
86
- if (index === 0) {
87
- return __assign(__assign({}, item), { dot: true });
88
- }
89
- if (index === 1) {
90
- return __assign(__assign({}, item), { badge: 5 });
91
- }
92
- return item;
93
- }),
94
- mainActiveIndex: 0,
95
- activeId: 0,
96
- mainActiveIndexMulti: 0,
97
- activeIdMulti: [],
98
- },
99
- methods: {
100
- onClickNav: function (_a) {
101
- var detail = _a.detail;
102
- this.setData({
103
- mainActiveIndex: detail.index || 0,
104
- });
105
- },
106
- onClickItem: function (_a) {
107
- var detail = _a.detail;
108
- var activeId = this.data.activeId === detail.id ? null : detail.id;
109
- this.setData({ activeId: activeId });
110
- },
111
- onClickNavMulti: function (_a) {
112
- var detail = _a.detail;
113
- this.setData({
114
- mainActiveIndexMulti: detail.index || 0,
115
- });
116
- },
117
- onClickItemMulti: function (_a) {
118
- var detail = _a.detail;
119
- var activeIdMulti = this.data.activeIdMulti;
120
- var idx = activeIdMulti.indexOf(detail.id);
121
- if (idx > -1) {
122
- activeIdMulti.splice(idx, 1);
123
- }
124
- else {
125
- activeIdMulti.push(detail.id);
126
- }
127
- this.setData({ activeIdMulti: activeIdMulti });
128
- },
129
- },
130
- });