@rainbow-oh/yee-c 0.8.1 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Cascader/cascader.js +38 -30
- package/dist/cjs/Cascader/column.js +17 -9
- package/dist/cjs/Cascader/search-list.js +30 -22
- package/dist/cjs/Cascader/utils/index.js +1 -5
- package/dist/cjs/Checkbox/checkbox-group.js +23 -14
- package/dist/cjs/Dialog/dialog.js +1 -1
- package/dist/cjs/Dialog/interface.d.ts +1 -1
- package/dist/cjs/Dialog/style/index.less +2 -1
- package/dist/cjs/Drawer/drawer.js +9 -1
- package/dist/cjs/Form/Group.js +1 -1
- package/dist/cjs/Form/demo/tooltip.js +1 -3
- package/dist/cjs/Input/style/index.less +1 -0
- package/dist/cjs/List/hooks/useListKeyboard.js +3 -1
- package/dist/cjs/Menu/menu.js +18 -2
- package/dist/cjs/Pagination/items.js +54 -26
- package/dist/cjs/Pagination/pagination.js +25 -9
- package/dist/cjs/PickerPanel/panels/DateTimePanel/index.d.ts +1 -1
- package/dist/cjs/PickerPanel/panels/MonthPanel/MonthHeader.js +7 -1
- package/dist/cjs/Rate/star.js +27 -3
- package/dist/cjs/Segmented/demo/variant.js +15 -1
- package/dist/cjs/Segmented/index.d.ts +1 -1
- package/dist/cjs/Segmented/segmented.js +12 -15
- package/dist/cjs/Select/option.js +8 -1
- package/dist/cjs/Select/options.js +9 -1
- package/dist/cjs/Select/select.js +3 -1
- package/dist/cjs/Selector/style/index.less +1 -0
- package/dist/cjs/Steps/step.js +14 -2
- package/dist/cjs/Steps/steps.js +11 -1
- package/dist/cjs/Table/demo/components-override.js +31 -2
- package/dist/cjs/Table/demo/grouping.js +7 -1
- package/dist/cjs/Table/hooks/useColumns.d.ts +3 -3
- package/dist/cjs/Table/hooks/useColumns.js +11 -14
- package/dist/cjs/Table/icon/arrow-icon.js +1 -1
- package/dist/cjs/Table/index.d.ts +1 -1
- package/dist/cjs/Table/style/index.less +2 -4
- package/dist/cjs/Table/tbody/row.js +1 -4
- package/dist/cjs/Table/theader/cell.js +6 -3
- package/dist/cjs/Table/theader/index.js +12 -4
- package/dist/cjs/TextArea/style/index.less +1 -0
- package/dist/cjs/Tour/index.d.ts +1 -1
- package/dist/cjs/Tree/style/index.less +1 -5
- package/dist/cjs/Tree/tree.js +38 -35
- package/dist/cjs/VerificationCode/style/index.less +1 -0
- package/dist/cjs/hooks/useCountdown.d.ts +2 -1
- package/dist/cjs/hooks/useCountdown.js +46 -23
- package/dist/cjs/hooks/useEvent.js +1 -4
- package/dist/cjs/locale/interface.d.ts +3 -0
- package/dist/cjs/locale/lang/en_US.js +4 -1
- package/dist/cjs/locale/lang/ja_JP.js +4 -1
- package/dist/cjs/locale/lang/zh_CN.js +4 -1
- package/dist/cjs/locale/lang/zh_TW.js +4 -1
- package/dist/cjs/message/demo/base.js +1 -1
- package/dist/cjs/message/index.d.ts +1 -1
- package/dist/cjs/message/interface.d.ts +16 -7
- package/dist/cjs/message/message-provider.d.ts +2 -1
- package/dist/cjs/message/message-provider.js +1 -1
- package/dist/cjs/message/message.js +14 -9
- package/dist/cjs/message/style/index.less +3 -1
- package/dist/cjs/message/use-message.d.ts +3 -12
- package/dist/cjs/message/use-message.js +103 -45
- package/dist/cjs/message/wrapper.d.ts +21 -27
- package/dist/cjs/message/wrapper.js +49 -19
- package/dist/cjs/notice/index.d.ts +1 -1
- package/dist/cjs/notice/interface.d.ts +17 -7
- package/dist/cjs/notice/notice-list.d.ts +3 -3
- package/dist/cjs/notice/notice-provider.d.ts +2 -1
- package/dist/cjs/notice/notice-provider.js +1 -1
- package/dist/cjs/notice/notice.js +63 -20
- package/dist/cjs/notice/style/index.less +13 -1
- package/dist/cjs/notice/use-notice.d.ts +2 -11
- package/dist/cjs/notice/use-notice.js +156 -71
- package/dist/cjs/notice/wrapper.d.ts +19 -15
- package/dist/cjs/notice/wrapper.js +122 -52
- package/dist/cjs/style/size.css +5 -3
- package/dist/cjs/style/themes.css +1 -1
- package/dist/cjs/style/variables.css +6 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Dialog/dialog.js +2 -2
- package/dist/esm/Dialog/interface.d.ts +1 -1
- package/dist/esm/Dialog/style/index.less +2 -1
- package/dist/esm/Form/Group.js +1 -1
- package/dist/esm/Input/style/index.less +1 -0
- package/dist/esm/PickerPanel/panels/DateTimePanel/index.d.ts +1 -1
- package/dist/esm/Segmented/index.d.ts +1 -1
- package/dist/esm/Segmented/segmented.js +1 -1
- package/dist/esm/Selector/style/index.less +1 -0
- package/dist/esm/Table/demo/components-override.js +1 -0
- package/dist/esm/Table/hooks/useColumns.d.ts +3 -3
- package/dist/esm/Table/hooks/useColumns.js +13 -16
- package/dist/esm/Table/icon/arrow-icon.js +1 -1
- package/dist/esm/Table/index.d.ts +1 -1
- package/dist/esm/Table/style/index.less +2 -4
- package/dist/esm/Table/theader/cell.js +7 -3
- package/dist/esm/TextArea/style/index.less +1 -0
- package/dist/esm/Tour/index.d.ts +1 -1
- package/dist/esm/Tree/style/index.less +1 -5
- package/dist/esm/Tree/tree.js +1 -1
- package/dist/esm/VerificationCode/style/index.less +1 -0
- package/dist/esm/hooks/useCountdown.d.ts +2 -1
- package/dist/esm/hooks/useCountdown.js +44 -14
- package/dist/esm/locale/interface.d.ts +3 -0
- package/dist/esm/locale/lang/en_US.js +4 -1
- package/dist/esm/locale/lang/ja_JP.js +4 -1
- package/dist/esm/locale/lang/zh_CN.js +4 -1
- package/dist/esm/locale/lang/zh_TW.js +4 -1
- package/dist/esm/message/demo/base.js +4 -1
- package/dist/esm/message/index.d.ts +1 -1
- package/dist/esm/message/interface.d.ts +16 -7
- package/dist/esm/message/message-provider.d.ts +2 -1
- package/dist/esm/message/message-provider.js +1 -1
- package/dist/esm/message/message.js +22 -9
- package/dist/esm/message/style/index.less +3 -1
- package/dist/esm/message/use-message.d.ts +3 -12
- package/dist/esm/message/use-message.js +129 -79
- package/dist/esm/message/wrapper.d.ts +21 -27
- package/dist/esm/message/wrapper.js +60 -18
- package/dist/esm/notice/index.d.ts +1 -1
- package/dist/esm/notice/interface.d.ts +17 -7
- package/dist/esm/notice/notice-list.d.ts +3 -3
- package/dist/esm/notice/notice-provider.d.ts +2 -1
- package/dist/esm/notice/notice-provider.js +1 -1
- package/dist/esm/notice/notice.js +73 -21
- package/dist/esm/notice/style/index.less +13 -1
- package/dist/esm/notice/use-notice.d.ts +2 -11
- package/dist/esm/notice/use-notice.js +180 -100
- package/dist/esm/notice/wrapper.d.ts +19 -15
- package/dist/esm/notice/wrapper.js +144 -62
- package/dist/esm/style/size.css +5 -3
- package/dist/esm/style/themes.css +1 -1
- package/dist/esm/style/variables.css +6 -4
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/yee-c.min.css +2 -2
- package/dist/umd/yee-c.min.js +1 -1
- package/package.json +1 -1
- package/src/Anchor/anchor.tsx +2 -2
- package/src/Carousel/carousel.tsx +1 -2
- package/src/Cascader/cascader.tsx +5 -1
- package/src/Cascader/column.tsx +5 -1
- package/src/Cascader/search-list.tsx +10 -3
- package/src/Cascader/utils/index.ts +3 -6
- package/src/Checkbox/checkbox-group.tsx +6 -1
- package/src/Dialog/dialog.tsx +7 -3
- package/src/Dialog/interface.ts +1 -1
- package/src/Dialog/style/index.less +2 -1
- package/src/Drawer/drawer.tsx +7 -1
- package/src/Form/Group.tsx +2 -4
- package/src/Form/demo/tooltip.tsx +2 -11
- package/src/Form/utils/validate.ts +1 -4
- package/src/Input/style/index.less +1 -0
- package/src/List/hooks/useListKeyboard.ts +3 -3
- package/src/List/list.tsx +2 -1
- package/src/Menu/menu.tsx +14 -3
- package/src/Pagination/items.tsx +16 -4
- package/src/Pagination/pagination.tsx +18 -4
- package/src/PickerPanel/panels/DatePanel/DateBody.tsx +1 -1
- package/src/PickerPanel/panels/DateTimePanel/index.tsx +1 -1
- package/src/PickerPanel/panels/MonthPanel/MonthHeader.tsx +7 -2
- package/src/PickerPanel/panels/PanelBody.tsx +1 -1
- package/src/PickerPanel/panels/QuarterPanel/QuarterHeader.tsx +1 -1
- package/src/PickerPanel/panels/RangePanel/index.tsx +1 -1
- package/src/PickerPanel/panels/TimePanel/TimeBody.tsx +1 -1
- package/src/PickerPanel/panels/YearPanel/YearHeader.tsx +1 -1
- package/src/PickerPanel/utils/pickerUtils.ts +2 -1
- package/src/RangePicker/range-picker-mobile.tsx +1 -3
- package/src/Rate/star.tsx +16 -4
- package/src/Segmented/demo/variant.tsx +10 -2
- package/src/Segmented/index.ts +2 -2
- package/src/Segmented/segmented.tsx +4 -11
- package/src/Select/interface.ts +0 -1
- package/src/Select/option.tsx +8 -2
- package/src/Select/options.tsx +11 -4
- package/src/Select/select.tsx +4 -4
- package/src/Selector/style/index.less +1 -0
- package/src/Steps/step.tsx +11 -3
- package/src/Steps/steps.tsx +8 -1
- package/src/Table/demo/components-override.tsx +34 -7
- package/src/Table/demo/grouping.tsx +8 -4
- package/src/Table/hooks/useColumns.ts +14 -18
- package/src/Table/icon/arrow-icon.tsx +1 -1
- package/src/Table/index.ts +3 -3
- package/src/Table/style/index.less +2 -4
- package/src/Table/table.tsx +2 -4
- package/src/Table/tbody/row.tsx +1 -3
- package/src/Table/theader/cell.tsx +6 -3
- package/src/Table/theader/index.tsx +9 -10
- package/src/TextArea/style/index.less +1 -0
- package/src/Tour/demo/placement.tsx +2 -1
- package/src/Tour/index.ts +1 -1
- package/src/Tree/style/index.less +1 -5
- package/src/Tree/tree.tsx +16 -11
- package/src/Tree/utils/tree-tools.ts +4 -1
- package/src/VerificationCode/style/index.less +1 -0
- package/src/hooks/useCountdown.ts +52 -21
- package/src/hooks/useEvent.ts +1 -3
- package/src/locale/context.tsx +5 -1
- package/src/locale/interface.ts +6 -1
- package/src/locale/lang/en_US.ts +3 -0
- package/src/locale/lang/ja_JP.ts +3 -0
- package/src/locale/lang/zh_CN.ts +3 -0
- package/src/locale/lang/zh_TW.ts +3 -0
- package/src/message/demo/base.tsx +1 -1
- package/src/message/index.ts +1 -1
- package/src/message/interface.ts +22 -7
- package/src/message/message-provider.tsx +3 -2
- package/src/message/message.test.tsx +283 -0
- package/src/message/message.tsx +14 -9
- package/src/message/style/index.less +3 -1
- package/src/message/use-message.tsx +144 -67
- package/src/message/wrapper.tsx +62 -20
- package/src/notice/index.en-US.md +76 -75
- package/src/notice/index.ts +6 -1
- package/src/notice/index.zh-CN.md +3 -2
- package/src/notice/interface.ts +31 -14
- package/src/notice/notice-list.tsx +3 -9
- package/src/notice/notice-provider.tsx +3 -2
- package/src/notice/notice.test.tsx +450 -0
- package/src/notice/notice.tsx +69 -21
- package/src/notice/style/index.less +13 -1
- package/src/notice/use-notice.tsx +210 -94
- package/src/notice/wrapper.tsx +159 -71
- package/src/style/size.css +5 -3
- package/src/utils/debounce.ts +1 -3
- package/src/version.ts +1 -1
|
@@ -10,20 +10,52 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { createRoot } from 'react-dom/client';
|
|
12
12
|
import NoticeList from "./notice-list";
|
|
13
|
+
var noop = function noop() {};
|
|
14
|
+
var invokeOnClose = function invokeOnClose(notices) {
|
|
15
|
+
var errors = [];
|
|
16
|
+
notices.forEach(function (notice) {
|
|
17
|
+
try {
|
|
18
|
+
var _notice$onClose;
|
|
19
|
+
(_notice$onClose = notice.onClose) === null || _notice$onClose === void 0 || _notice$onClose.call(notice);
|
|
20
|
+
} catch (error) {
|
|
21
|
+
errors.push(error);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
errors.forEach(function (error) {
|
|
25
|
+
var reportError = globalThis.reportError;
|
|
26
|
+
if (reportError) {
|
|
27
|
+
reportError(error);
|
|
28
|
+
} else {
|
|
29
|
+
console.error(error);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
13
33
|
var NoticeWrapper = /*#__PURE__*/function () {
|
|
14
34
|
function NoticeWrapper() {
|
|
15
35
|
_classCallCheck(this, NoticeWrapper);
|
|
16
36
|
_defineProperty(this, "roots", void 0);
|
|
17
37
|
_defineProperty(this, "containers", void 0);
|
|
18
38
|
_defineProperty(this, "notices", void 0);
|
|
39
|
+
_defineProperty(this, "generationByKey", void 0);
|
|
40
|
+
_defineProperty(this, "generation", void 0);
|
|
41
|
+
_defineProperty(this, "timerGeneration", void 0);
|
|
19
42
|
this.roots = new Map();
|
|
20
43
|
this.containers = new Map();
|
|
21
44
|
this.notices = new Map();
|
|
45
|
+
this.generationByKey = new Map();
|
|
46
|
+
this.generation = 0;
|
|
47
|
+
this.timerGeneration = 0;
|
|
48
|
+
this.destroy = this.destroy.bind(this);
|
|
22
49
|
}
|
|
23
50
|
_createClass(NoticeWrapper, [{
|
|
24
51
|
key: "uuid",
|
|
25
52
|
value: function uuid() {
|
|
26
|
-
|
|
53
|
+
var _globalThis$crypto, _globalThis$crypto$ra;
|
|
54
|
+
var randomUUID = (_globalThis$crypto = globalThis.crypto) === null || _globalThis$crypto === void 0 || (_globalThis$crypto$ra = _globalThis$crypto.randomUUID) === null || _globalThis$crypto$ra === void 0 ? void 0 : _globalThis$crypto$ra.call(_globalThis$crypto);
|
|
55
|
+
if (randomUUID) {
|
|
56
|
+
return randomUUID;
|
|
57
|
+
}
|
|
58
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
27
59
|
var r = Math.random() * 16 | 0;
|
|
28
60
|
var v = c === 'x' ? r : r & 0x3 | 0x8;
|
|
29
61
|
return v.toString(16);
|
|
@@ -44,46 +76,48 @@ var NoticeWrapper = /*#__PURE__*/function () {
|
|
|
44
76
|
key: "cleanupContainer",
|
|
45
77
|
value: function cleanupContainer(placement) {
|
|
46
78
|
var container = this.containers.get(placement);
|
|
47
|
-
if (container && container.parentNode) {
|
|
79
|
+
if (container !== null && container !== void 0 && container.parentNode) {
|
|
48
80
|
container.parentNode.removeChild(container);
|
|
49
|
-
this.containers.delete(placement);
|
|
50
81
|
}
|
|
82
|
+
this.containers.delete(placement);
|
|
51
83
|
}
|
|
52
84
|
}, {
|
|
53
85
|
key: "unmount",
|
|
54
86
|
value: function unmount(placement) {
|
|
55
87
|
var _this = this;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
_this.cleanupContainer(placement);
|
|
69
|
-
});
|
|
88
|
+
var placements = placement ? [placement] : Array.from(this.notices.keys());
|
|
89
|
+
var removed = placements.flatMap(function (item) {
|
|
90
|
+
return _this.notices.get(item) || [];
|
|
91
|
+
});
|
|
92
|
+
placements.forEach(function (item) {
|
|
93
|
+
var _this$roots$get;
|
|
94
|
+
(_this$roots$get = _this.roots.get(item)) === null || _this$roots$get === void 0 || _this$roots$get.unmount();
|
|
95
|
+
_this.roots.delete(item);
|
|
96
|
+
_this.cleanupContainer(item);
|
|
97
|
+
_this.notices.delete(item);
|
|
98
|
+
});
|
|
99
|
+
if (!placement) {
|
|
70
100
|
this.roots.clear();
|
|
71
101
|
this.containers.clear();
|
|
72
|
-
this.notices.clear();
|
|
73
102
|
}
|
|
103
|
+
removed.forEach(function (item) {
|
|
104
|
+
_this.generationByKey.delete(item.key);
|
|
105
|
+
});
|
|
106
|
+
invokeOnClose(removed);
|
|
74
107
|
}
|
|
75
108
|
}, {
|
|
76
109
|
key: "render",
|
|
77
110
|
value: function render(placement) {
|
|
78
|
-
|
|
111
|
+
if (typeof document === 'undefined') {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
79
114
|
var notices = this.notices.get(placement) || [];
|
|
80
115
|
if (notices.length === 0) {
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
116
|
+
var _this$roots$get2;
|
|
117
|
+
(_this$roots$get2 = this.roots.get(placement)) === null || _this$roots$get2 === void 0 || _this$roots$get2.unmount();
|
|
118
|
+
this.roots.delete(placement);
|
|
119
|
+
this.cleanupContainer(placement);
|
|
120
|
+
this.notices.delete(placement);
|
|
87
121
|
return;
|
|
88
122
|
}
|
|
89
123
|
var container = this.createContainer(placement);
|
|
@@ -95,63 +129,110 @@ var NoticeWrapper = /*#__PURE__*/function () {
|
|
|
95
129
|
root.render( /*#__PURE__*/React.createElement(NoticeList, {
|
|
96
130
|
items: notices,
|
|
97
131
|
placement: placement,
|
|
98
|
-
onDestroy:
|
|
99
|
-
return _this2.destroy(key, placement);
|
|
100
|
-
}
|
|
132
|
+
onDestroy: this.destroy
|
|
101
133
|
}));
|
|
102
134
|
}
|
|
103
135
|
}, {
|
|
104
136
|
key: "show",
|
|
105
137
|
value: function show(params) {
|
|
106
|
-
var placement
|
|
107
|
-
|
|
108
|
-
|
|
138
|
+
var _params$placement,
|
|
139
|
+
_params$key,
|
|
140
|
+
_this$generationByKey,
|
|
141
|
+
_this2 = this;
|
|
142
|
+
if (typeof document === 'undefined') {
|
|
143
|
+
return noop;
|
|
109
144
|
}
|
|
110
|
-
var
|
|
111
|
-
var
|
|
112
|
-
|
|
145
|
+
var placement = (_params$placement = params.placement) !== null && _params$placement !== void 0 ? _params$placement : 'topRight';
|
|
146
|
+
var key = (_params$key = params.key) !== null && _params$key !== void 0 ? _params$key : this.uuid();
|
|
147
|
+
var keyGeneration = (_this$generationByKey = this.generationByKey.get(key)) !== null && _this$generationByKey !== void 0 ? _this$generationByKey : this.generation++;
|
|
148
|
+
this.generationByKey.set(key, keyGeneration);
|
|
149
|
+
var affectedPlacements = new Set([placement]);
|
|
150
|
+
this.notices.forEach(function (items, currentPlacement) {
|
|
151
|
+
if (currentPlacement !== placement && items.some(function (item) {
|
|
152
|
+
return item.key === key;
|
|
153
|
+
})) {
|
|
154
|
+
_this2.notices.set(currentPlacement, items.filter(function (item) {
|
|
155
|
+
return item.key !== key;
|
|
156
|
+
}));
|
|
157
|
+
affectedPlacements.add(currentPlacement);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
var currentNotices = this.notices.get(placement) || [];
|
|
161
|
+
var existingIndex = currentNotices.findIndex(function (item) {
|
|
162
|
+
return item.key === key;
|
|
113
163
|
});
|
|
114
|
-
|
|
115
|
-
|
|
164
|
+
var nextNotice = _objectSpread(_objectSpread({}, params), {}, {
|
|
165
|
+
key: key,
|
|
166
|
+
placement: placement,
|
|
167
|
+
timerGeneration: this.timerGeneration++
|
|
168
|
+
});
|
|
169
|
+
var nextNotices = currentNotices.filter(function (item) {
|
|
170
|
+
return item.key !== key;
|
|
171
|
+
});
|
|
172
|
+
if (existingIndex >= 0) {
|
|
173
|
+
nextNotices.splice(existingIndex, 0, nextNotice);
|
|
116
174
|
} else {
|
|
117
|
-
|
|
175
|
+
nextNotices.push(nextNotice);
|
|
118
176
|
}
|
|
119
|
-
this.notices.set(placement,
|
|
120
|
-
|
|
177
|
+
this.notices.set(placement, nextNotices);
|
|
178
|
+
affectedPlacements.forEach(function (item) {
|
|
179
|
+
return _this2.render(item);
|
|
180
|
+
});
|
|
181
|
+
return function () {
|
|
182
|
+
if (_this2.generationByKey.get(key) === keyGeneration) {
|
|
183
|
+
_this2.destroy(key);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
121
186
|
}
|
|
122
187
|
}, {
|
|
123
188
|
key: "destroy",
|
|
124
|
-
value: function destroy(key,
|
|
125
|
-
var _this3 = this
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
} else {
|
|
134
|
-
// Find and remove in all placements
|
|
135
|
-
this.notices.forEach(function (notices, p) {
|
|
136
|
-
var filtered = notices.filter(function (item) {
|
|
137
|
-
return item.key !== key;
|
|
138
|
-
});
|
|
139
|
-
_this3.notices.set(p, filtered);
|
|
140
|
-
_this3.render(p);
|
|
189
|
+
value: function destroy(key, expectedTimerGeneration) {
|
|
190
|
+
var _this3 = this,
|
|
191
|
+
_target$onClose,
|
|
192
|
+
_target2;
|
|
193
|
+
var target;
|
|
194
|
+
this.notices.forEach(function (items) {
|
|
195
|
+
var _target;
|
|
196
|
+
(_target = target) !== null && _target !== void 0 ? _target : target = items.find(function (item) {
|
|
197
|
+
return item.key === key;
|
|
141
198
|
});
|
|
199
|
+
});
|
|
200
|
+
if (!target || expectedTimerGeneration !== undefined && target.timerGeneration !== expectedTimerGeneration) {
|
|
201
|
+
return;
|
|
142
202
|
}
|
|
203
|
+
var affectedPlacements = new Set();
|
|
204
|
+
this.notices.forEach(function (items, placement) {
|
|
205
|
+
if (items.some(function (item) {
|
|
206
|
+
return item.key === key;
|
|
207
|
+
})) {
|
|
208
|
+
_this3.notices.set(placement, items.filter(function (item) {
|
|
209
|
+
return item.key !== key;
|
|
210
|
+
}));
|
|
211
|
+
affectedPlacements.add(placement);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
this.generationByKey.delete(key);
|
|
215
|
+
affectedPlacements.forEach(function (item) {
|
|
216
|
+
return _this3.render(item);
|
|
217
|
+
});
|
|
218
|
+
(_target$onClose = (_target2 = target).onClose) === null || _target$onClose === void 0 || _target$onClose.call(_target2);
|
|
219
|
+
}
|
|
220
|
+
}, {
|
|
221
|
+
key: "clear",
|
|
222
|
+
value: function clear(placement) {
|
|
223
|
+
this.unmount(placement);
|
|
143
224
|
}
|
|
144
225
|
}, {
|
|
145
226
|
key: "open",
|
|
146
227
|
value: function open(params) {
|
|
147
|
-
this.show(typeof params === 'string' ? {
|
|
228
|
+
return this.show(typeof params === 'string' ? {
|
|
148
229
|
content: params
|
|
149
230
|
} : params);
|
|
150
231
|
}
|
|
151
232
|
}, {
|
|
152
233
|
key: "info",
|
|
153
234
|
value: function info(params) {
|
|
154
|
-
this.show(typeof params === 'string' ? {
|
|
235
|
+
return this.show(typeof params === 'string' ? {
|
|
155
236
|
status: 'info',
|
|
156
237
|
content: params
|
|
157
238
|
} : _objectSpread(_objectSpread({}, params), {}, {
|
|
@@ -161,7 +242,7 @@ var NoticeWrapper = /*#__PURE__*/function () {
|
|
|
161
242
|
}, {
|
|
162
243
|
key: "success",
|
|
163
244
|
value: function success(params) {
|
|
164
|
-
this.show(typeof params === 'string' ? {
|
|
245
|
+
return this.show(typeof params === 'string' ? {
|
|
165
246
|
status: 'success',
|
|
166
247
|
content: params
|
|
167
248
|
} : _objectSpread(_objectSpread({}, params), {}, {
|
|
@@ -171,7 +252,7 @@ var NoticeWrapper = /*#__PURE__*/function () {
|
|
|
171
252
|
}, {
|
|
172
253
|
key: "warning",
|
|
173
254
|
value: function warning(params) {
|
|
174
|
-
this.show(typeof params === 'string' ? {
|
|
255
|
+
return this.show(typeof params === 'string' ? {
|
|
175
256
|
status: 'warning',
|
|
176
257
|
content: params
|
|
177
258
|
} : _objectSpread(_objectSpread({}, params), {}, {
|
|
@@ -181,7 +262,7 @@ var NoticeWrapper = /*#__PURE__*/function () {
|
|
|
181
262
|
}, {
|
|
182
263
|
key: "error",
|
|
183
264
|
value: function error(params) {
|
|
184
|
-
this.show(typeof params === 'string' ? {
|
|
265
|
+
return this.show(typeof params === 'string' ? {
|
|
185
266
|
status: 'error',
|
|
186
267
|
content: params
|
|
187
268
|
} : _objectSpread(_objectSpread({}, params), {}, {
|
|
@@ -203,5 +284,6 @@ export var notice = {
|
|
|
203
284
|
success: noticeWrapper.success.bind(noticeWrapper),
|
|
204
285
|
warning: noticeWrapper.warning.bind(noticeWrapper),
|
|
205
286
|
error: noticeWrapper.error.bind(noticeWrapper),
|
|
206
|
-
destroy: noticeWrapper.destroy.bind(noticeWrapper)
|
|
287
|
+
destroy: noticeWrapper.destroy.bind(noticeWrapper),
|
|
288
|
+
clear: noticeWrapper.clear.bind(noticeWrapper)
|
|
207
289
|
};
|
package/dist/esm/style/size.css
CHANGED
|
@@ -224,6 +224,8 @@
|
|
|
224
224
|
/* --Dialog-- */
|
|
225
225
|
--yee-dialog-z-index: var(--yee-z-index-overlay);
|
|
226
226
|
--yee-dialog-mask-z-index: var(--yee-z-index-mask);
|
|
227
|
+
--yee-dialog-title-font-size: 18px;
|
|
228
|
+
--yee-dialog-title-font-weight: 600;
|
|
227
229
|
--yee-dialog-content-wrapper-z-index: var(--yee-z-index-overlay);
|
|
228
230
|
--yee-dialog-header-margin-bottom: 12px;
|
|
229
231
|
--yee-dialog-content-margin-top: 10%;
|
|
@@ -321,9 +323,9 @@
|
|
|
321
323
|
--yee-menu-submenu-vertical-top: -4px;
|
|
322
324
|
|
|
323
325
|
/* --Message-- */
|
|
324
|
-
--yee-message-gap:
|
|
325
|
-
--yee-message-padding: 12px
|
|
326
|
-
--yee-message-border-radius:
|
|
326
|
+
--yee-message-gap: 6px;
|
|
327
|
+
--yee-message-padding: 9px 12px;
|
|
328
|
+
--yee-message-border-radius: 8px;
|
|
327
329
|
--yee-message-box-shadow: 0 8px 24px 0 var(--yee-box-shadow-color);
|
|
328
330
|
--yee-message-icon-size: 20px;
|
|
329
331
|
--yee-message-list-top: 24px;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @rainbow-oh/yee-c CSS Variables
|
|
3
3
|
* Auto-generated, do not edit manually
|
|
4
|
-
* Generated on 2026-07-
|
|
4
|
+
* Generated on 2026-07-27T02:28:20.784Z
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/* ========== color.css ========== */
|
|
@@ -1346,6 +1346,8 @@
|
|
|
1346
1346
|
/* --Dialog-- */
|
|
1347
1347
|
--yee-dialog-z-index: var(--yee-z-index-overlay);
|
|
1348
1348
|
--yee-dialog-mask-z-index: var(--yee-z-index-mask);
|
|
1349
|
+
--yee-dialog-title-font-size: 18px;
|
|
1350
|
+
--yee-dialog-title-font-weight: 600;
|
|
1349
1351
|
--yee-dialog-content-wrapper-z-index: var(--yee-z-index-overlay);
|
|
1350
1352
|
--yee-dialog-header-margin-bottom: 12px;
|
|
1351
1353
|
--yee-dialog-content-margin-top: 10%;
|
|
@@ -1443,9 +1445,9 @@
|
|
|
1443
1445
|
--yee-menu-submenu-vertical-top: -4px;
|
|
1444
1446
|
|
|
1445
1447
|
/* --Message-- */
|
|
1446
|
-
--yee-message-gap:
|
|
1447
|
-
--yee-message-padding: 12px
|
|
1448
|
-
--yee-message-border-radius:
|
|
1448
|
+
--yee-message-gap: 6px;
|
|
1449
|
+
--yee-message-padding: 9px 12px;
|
|
1450
|
+
--yee-message-border-radius: 8px;
|
|
1449
1451
|
--yee-message-box-shadow: 0 8px 24px 0 var(--yee-box-shadow-color);
|
|
1450
1452
|
--yee-message-icon-size: 20px;
|
|
1451
1453
|
--yee-message-list-top: 24px;
|
package/dist/esm/version.d.ts
CHANGED
package/dist/esm/version.js
CHANGED