ods-component-lib 1.22.2 → 1.22.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/_virtual/index5.js +2 -3
- package/dist/_virtual/index5.js.map +1 -1
- package/dist/_virtual/index6.js +3 -2
- package/dist/_virtual/index6.js.map +1 -1
- package/dist/components/antd/currencyInput/CurrencySelect.js +15 -14
- package/dist/components/antd/currencyInput/CurrencySelect.js.map +1 -1
- package/dist/node_modules/@ant-design/cssinjs/es/StyleContext.js +6 -6
- package/dist/node_modules/@ant-design/cssinjs/es/StyleContext.js.map +1 -1
- package/dist/node_modules/@ant-design/cssinjs/es/hooks/useCacheToken.js +20 -20
- package/dist/node_modules/@ant-design/cssinjs/es/hooks/useCacheToken.js.map +1 -1
- package/dist/node_modules/@ant-design/cssinjs/es/hooks/useGlobalCache.js.map +1 -1
- package/dist/node_modules/@ant-design/cssinjs/es/hooks/useStyleRegister.js +101 -98
- package/dist/node_modules/@ant-design/cssinjs/es/hooks/useStyleRegister.js.map +1 -1
- package/dist/node_modules/@ant-design/cssinjs/es/util/index.js +29 -27
- package/dist/node_modules/@ant-design/cssinjs/es/util/index.js.map +1 -1
- package/dist/node_modules/@rc-component/async-validator/es/index.js +20 -20
- package/dist/node_modules/@rc-component/async-validator/es/index.js.map +1 -1
- package/dist/node_modules/@rc-component/async-validator/es/messages.js +1 -0
- package/dist/node_modules/@rc-component/async-validator/es/messages.js.map +1 -1
- package/dist/node_modules/@rc-component/async-validator/es/rule/type.js +18 -8
- package/dist/node_modules/@rc-component/async-validator/es/rule/type.js.map +1 -1
- package/dist/node_modules/@rc-component/async-validator/es/util.js +1 -1
- package/dist/node_modules/@rc-component/async-validator/es/util.js.map +1 -1
- package/dist/node_modules/@rc-component/async-validator/es/validator/index.js +1 -0
- package/dist/node_modules/@rc-component/async-validator/es/validator/index.js.map +1 -1
- package/dist/node_modules/@rc-component/collapse/es/hooks/useItems.js +88 -68
- package/dist/node_modules/@rc-component/collapse/es/hooks/useItems.js.map +1 -1
- package/dist/node_modules/@rc-component/dialog/es/Dialog/Content/Panel.js +75 -96
- package/dist/node_modules/@rc-component/dialog/es/Dialog/Content/Panel.js.map +1 -1
- package/dist/node_modules/@rc-component/dialog/es/Dialog/Content/index.js +22 -20
- package/dist/node_modules/@rc-component/dialog/es/Dialog/Content/index.js.map +1 -1
- package/dist/node_modules/@rc-component/dialog/es/Dialog/index.js +92 -100
- package/dist/node_modules/@rc-component/dialog/es/Dialog/index.js.map +1 -1
- package/dist/node_modules/@rc-component/dialog/es/DialogWrap.js +40 -29
- package/dist/node_modules/@rc-component/dialog/es/DialogWrap.js.map +1 -1
- package/dist/node_modules/@rc-component/form/es/hooks/useForm.js +115 -100
- package/dist/node_modules/@rc-component/form/es/hooks/useForm.js.map +1 -1
- package/dist/node_modules/@rc-component/form/es/utils/NameMap.js +28 -22
- package/dist/node_modules/@rc-component/form/es/utils/NameMap.js.map +1 -1
- package/dist/node_modules/@rc-component/form/es/utils/messages.js +1 -0
- package/dist/node_modules/@rc-component/form/es/utils/messages.js.map +1 -1
- package/dist/node_modules/@rc-component/image/es/Preview/index.js +111 -105
- package/dist/node_modules/@rc-component/image/es/Preview/index.js.map +1 -1
- package/dist/node_modules/@rc-component/portal/es/useEscKeyDown.js +42 -22
- package/dist/node_modules/@rc-component/portal/es/useEscKeyDown.js.map +1 -1
- package/dist/node_modules/@rc-component/resize-observer/es/SingleObserver/index.js +18 -54
- package/dist/node_modules/@rc-component/resize-observer/es/SingleObserver/index.js.map +1 -1
- package/dist/node_modules/@rc-component/resize-observer/es/index.js.map +1 -1
- package/dist/node_modules/@rc-component/resize-observer/es/useResizeObserver.js +50 -0
- package/dist/node_modules/@rc-component/resize-observer/es/useResizeObserver.js.map +1 -0
- package/dist/node_modules/@rc-component/select/es/SelectInput/Content/MultipleContent.js +50 -50
- package/dist/node_modules/@rc-component/select/es/SelectInput/Content/MultipleContent.js.map +1 -1
- package/dist/node_modules/@rc-component/select/es/SelectInput/index.js +85 -80
- package/dist/node_modules/@rc-component/select/es/SelectInput/index.js.map +1 -1
- package/dist/node_modules/@rc-component/table/es/VirtualTable/BodyGrid.js +85 -80
- package/dist/node_modules/@rc-component/table/es/VirtualTable/BodyGrid.js.map +1 -1
- package/dist/node_modules/@rc-component/trigger/es/Popup/index.js +74 -72
- package/dist/node_modules/@rc-component/trigger/es/Popup/index.js.map +1 -1
- package/dist/node_modules/@rc-component/trigger/es/UniqueProvider/index.js +10 -9
- package/dist/node_modules/@rc-component/trigger/es/UniqueProvider/index.js.map +1 -1
- package/dist/node_modules/@rc-component/trigger/es/hooks/useAlign.js +27 -27
- package/dist/node_modules/@rc-component/trigger/es/hooks/useAlign.js.map +1 -1
- package/dist/node_modules/@rc-component/trigger/es/index.js +150 -140
- package/dist/node_modules/@rc-component/trigger/es/index.js.map +1 -1
- package/dist/node_modules/@rc-component/util/es/Dom/focus.js +65 -20
- package/dist/node_modules/@rc-component/util/es/Dom/focus.js.map +1 -1
- package/dist/node_modules/@rc-component/util/es/ref.js +1 -1
- package/dist/node_modules/antd/es/_util/wave/WaveEffect.js +53 -48
- package/dist/node_modules/antd/es/_util/wave/WaveEffect.js.map +1 -1
- package/dist/node_modules/antd/es/_util/wave/style.js +8 -7
- package/dist/node_modules/antd/es/_util/wave/style.js.map +1 -1
- package/dist/node_modules/antd/es/alert/Alert.js +133 -128
- package/dist/node_modules/antd/es/alert/Alert.js.map +1 -1
- package/dist/node_modules/antd/es/badge/Badge.js +29 -28
- package/dist/node_modules/antd/es/badge/Badge.js.map +1 -1
- package/dist/node_modules/antd/es/badge/style/index.js +1 -1
- package/dist/node_modules/antd/es/badge/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/button/buttonHelpers.js +47 -41
- package/dist/node_modules/antd/es/button/buttonHelpers.js.map +1 -1
- package/dist/node_modules/antd/es/button/style/variant.js +132 -132
- package/dist/node_modules/antd/es/button/style/variant.js.map +1 -1
- package/dist/node_modules/antd/es/calendar/generateCalendar.js +55 -57
- package/dist/node_modules/antd/es/calendar/generateCalendar.js.map +1 -1
- package/dist/node_modules/antd/es/calendar/style/index.js +18 -18
- package/dist/node_modules/antd/es/calendar/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/card/CardGrid.js.map +1 -1
- package/dist/node_modules/antd/es/card/style/index.js +15 -7
- package/dist/node_modules/antd/es/card/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/checkbox/Group.js +32 -30
- package/dist/node_modules/antd/es/checkbox/Group.js.map +1 -1
- package/dist/node_modules/antd/es/collapse/Collapse.js +61 -61
- package/dist/node_modules/antd/es/collapse/Collapse.js.map +1 -1
- package/dist/node_modules/antd/es/config-provider/index.js +76 -71
- package/dist/node_modules/antd/es/config-provider/index.js.map +1 -1
- package/dist/node_modules/antd/es/date-picker/generatePicker/generateRangePicker.js +29 -31
- package/dist/node_modules/antd/es/date-picker/generatePicker/generateRangePicker.js.map +1 -1
- package/dist/node_modules/antd/es/date-picker/generatePicker/generateSinglePicker.js +7 -9
- package/dist/node_modules/antd/es/date-picker/generatePicker/generateSinglePicker.js.map +1 -1
- package/dist/node_modules/antd/es/date-picker/generatePicker/{SuffixIcon.js → useSuffixIcon.js} +4 -4
- package/dist/node_modules/antd/es/date-picker/generatePicker/useSuffixIcon.js.map +1 -0
- package/dist/node_modules/antd/es/date-picker/style/panel.js +4 -4
- package/dist/node_modules/antd/es/date-picker/style/panel.js.map +1 -1
- package/dist/node_modules/antd/es/drawer/useFocusable.js +14 -0
- package/dist/node_modules/antd/es/drawer/useFocusable.js.map +1 -0
- package/dist/node_modules/antd/es/form/style/index.js +24 -24
- package/dist/node_modules/antd/es/form/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/grid/col.js +56 -54
- package/dist/node_modules/antd/es/grid/col.js.map +1 -1
- package/dist/node_modules/antd/es/grid/style/index.js +50 -50
- package/dist/node_modules/antd/es/grid/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/input/style/index.js +1 -0
- package/dist/node_modules/antd/es/input/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/input-number/index.js +91 -91
- package/dist/node_modules/antd/es/input-number/index.js.map +1 -1
- package/dist/node_modules/antd/es/input-number/style/index.js +80 -79
- package/dist/node_modules/antd/es/input-number/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/layout/style/sider.js +9 -9
- package/dist/node_modules/antd/es/layout/style/sider.js.map +1 -1
- package/dist/node_modules/antd/es/menu/MenuItem.js +6 -6
- package/dist/node_modules/antd/es/menu/MenuItem.js.map +1 -1
- package/dist/node_modules/antd/es/menu/SubMenu.js +8 -8
- package/dist/node_modules/antd/es/menu/SubMenu.js.map +1 -1
- package/dist/node_modules/antd/es/menu/style/horizontal.js +1 -1
- package/dist/node_modules/antd/es/menu/style/horizontal.js.map +1 -1
- package/dist/node_modules/antd/es/menu/style/index.js +58 -58
- package/dist/node_modules/antd/es/menu/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/menu/style/vertical.js +1 -1
- package/dist/node_modules/antd/es/menu/style/vertical.js.map +1 -1
- package/dist/node_modules/antd/es/modal/ConfirmDialog.js +117 -112
- package/dist/node_modules/antd/es/modal/ConfirmDialog.js.map +1 -1
- package/dist/node_modules/antd/es/modal/Modal.js +115 -109
- package/dist/node_modules/antd/es/modal/Modal.js.map +1 -1
- package/dist/node_modules/antd/es/modal/style/index.js +83 -80
- package/dist/node_modules/antd/es/modal/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/pagination/Pagination.js +85 -81
- package/dist/node_modules/antd/es/pagination/Pagination.js.map +1 -1
- package/dist/node_modules/antd/es/pagination/style/bordered.js +2 -2
- package/dist/node_modules/antd/es/pagination/style/bordered.js.map +1 -1
- package/dist/node_modules/antd/es/pagination/style/index.js +98 -132
- package/dist/node_modules/antd/es/pagination/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/popover/index.js +77 -82
- package/dist/node_modules/antd/es/popover/index.js.map +1 -1
- package/dist/node_modules/antd/es/popover/style/index.js +65 -63
- package/dist/node_modules/antd/es/popover/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/radio/context.js +3 -3
- package/dist/node_modules/antd/es/radio/context.js.map +1 -1
- package/dist/node_modules/antd/es/radio/group.js +31 -29
- package/dist/node_modules/antd/es/radio/group.js.map +1 -1
- package/dist/node_modules/antd/es/radio/style/index.js +1 -1
- package/dist/node_modules/antd/es/radio/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/select/style/dropdown.js +1 -1
- package/dist/node_modules/antd/es/select/style/dropdown.js.map +1 -1
- package/dist/node_modules/antd/es/select/style/select-input-multiple.js +71 -69
- package/dist/node_modules/antd/es/select/style/select-input-multiple.js.map +1 -1
- package/dist/node_modules/antd/es/select/style/select-input.js +104 -98
- package/dist/node_modules/antd/es/select/style/select-input.js.map +1 -1
- package/dist/node_modules/antd/es/space/Item.js +2 -2
- package/dist/node_modules/antd/es/space/Item.js.map +1 -1
- package/dist/node_modules/antd/es/space/index.js +4 -4
- package/dist/node_modules/antd/es/space/index.js.map +1 -1
- package/dist/node_modules/antd/es/space/style/addon.js +47 -46
- package/dist/node_modules/antd/es/space/style/addon.js.map +1 -1
- package/dist/node_modules/antd/es/steps/PanelArrow.js +2 -2
- package/dist/node_modules/antd/es/steps/PanelArrow.js.map +1 -1
- package/dist/node_modules/antd/es/steps/ProgressIcon.js +12 -10
- package/dist/node_modules/antd/es/steps/ProgressIcon.js.map +1 -1
- package/dist/node_modules/antd/es/steps/index.js +108 -106
- package/dist/node_modules/antd/es/steps/index.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/horizontal.js +13 -11
- package/dist/node_modules/antd/es/steps/style/horizontal.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/icon.js +23 -18
- package/dist/node_modules/antd/es/steps/style/icon.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/index.js +41 -41
- package/dist/node_modules/antd/es/steps/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/inline.js +28 -23
- package/dist/node_modules/antd/es/steps/style/inline.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/label-placement.js +44 -39
- package/dist/node_modules/antd/es/steps/style/label-placement.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/nav.js +29 -27
- package/dist/node_modules/antd/es/steps/style/nav.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/panel.js +61 -56
- package/dist/node_modules/antd/es/steps/style/panel.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/progress-dot.js +28 -26
- package/dist/node_modules/antd/es/steps/style/progress-dot.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/progress.js +24 -57
- package/dist/node_modules/antd/es/steps/style/progress.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/rtl.js +10 -8
- package/dist/node_modules/antd/es/steps/style/rtl.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/small.js +21 -16
- package/dist/node_modules/antd/es/steps/style/small.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/status.js +187 -176
- package/dist/node_modules/antd/es/steps/style/status.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/util.js +18 -16
- package/dist/node_modules/antd/es/steps/style/util.js.map +1 -1
- package/dist/node_modules/antd/es/steps/style/vertical.js +21 -16
- package/dist/node_modules/antd/es/steps/style/vertical.js.map +1 -1
- package/dist/node_modules/antd/es/style/placementArrow.js +31 -29
- package/dist/node_modules/antd/es/style/placementArrow.js.map +1 -1
- package/dist/node_modules/antd/es/table/InternalTable.js +65 -62
- package/dist/node_modules/antd/es/table/InternalTable.js.map +1 -1
- package/dist/node_modules/antd/es/table/TableMeasureRowContext.js +6 -0
- package/dist/node_modules/antd/es/table/TableMeasureRowContext.js.map +1 -0
- package/dist/node_modules/antd/es/table/hooks/useFilter/FilterDropdown.js +145 -137
- package/dist/node_modules/antd/es/table/hooks/useFilter/FilterDropdown.js.map +1 -1
- package/dist/node_modules/antd/es/table/style/index.js +3 -3
- package/dist/node_modules/antd/es/table/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/table/style/radius.js +10 -0
- package/dist/node_modules/antd/es/table/style/radius.js.map +1 -1
- package/dist/node_modules/antd/es/table/style/virtual.js +5 -5
- package/dist/node_modules/antd/es/table/style/virtual.js.map +1 -1
- package/dist/node_modules/antd/es/theme/util/genStyleUtils.js +29 -32
- package/dist/node_modules/antd/es/theme/util/genStyleUtils.js.map +1 -1
- package/dist/node_modules/antd/es/timeline/Timeline.js +76 -74
- package/dist/node_modules/antd/es/timeline/Timeline.js.map +1 -1
- package/dist/node_modules/antd/es/timeline/style/horizontal.js +21 -18
- package/dist/node_modules/antd/es/timeline/style/horizontal.js.map +1 -1
- package/dist/node_modules/antd/es/timeline/style/index.js +85 -70
- package/dist/node_modules/antd/es/timeline/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/timeline/useItems.js +38 -37
- package/dist/node_modules/antd/es/timeline/useItems.js.map +1 -1
- package/dist/node_modules/antd/es/tooltip/PurePanel.js +27 -27
- package/dist/node_modules/antd/es/tooltip/PurePanel.js.map +1 -1
- package/dist/node_modules/antd/es/tooltip/UniqueProvider/MotionContent.js +17 -22
- package/dist/node_modules/antd/es/tooltip/UniqueProvider/MotionContent.js.map +1 -1
- package/dist/node_modules/antd/es/tooltip/UniqueProvider/index.js +27 -26
- package/dist/node_modules/antd/es/tooltip/UniqueProvider/index.js.map +1 -1
- package/dist/node_modules/antd/es/tooltip/index.js +50 -50
- package/dist/node_modules/antd/es/tooltip/index.js.map +1 -1
- package/dist/node_modules/antd/es/tooltip/style/index.js +55 -52
- package/dist/node_modules/antd/es/tooltip/style/index.js.map +1 -1
- package/dist/node_modules/antd/es/tooltip/util.js +13 -12
- package/dist/node_modules/antd/es/tooltip/util.js.map +1 -1
- package/dist/node_modules/antd/es/tree/DirectoryTree.js +42 -41
- package/dist/node_modules/antd/es/tree/DirectoryTree.js.map +1 -1
- package/dist/node_modules/antd/es/version/version.js +1 -1
- package/dist/node_modules/antd/es/version/version.js.map +1 -1
- package/dist/node_modules/canvg/lib/index.es.js +84 -84
- package/dist/node_modules/canvg/lib/index.es.js.map +1 -1
- package/dist/node_modules/compute-scroll-into-view/dist/index.js +17 -17
- package/dist/node_modules/compute-scroll-into-view/dist/index.js.map +1 -1
- package/dist/node_modules/dompurify/dist/purify.es.js +217 -223
- package/dist/node_modules/dompurify/dist/purify.es.js.map +1 -1
- package/dist/node_modules/fflate/esm/browser.js +295 -335
- package/dist/node_modules/fflate/esm/browser.js.map +1 -1
- package/dist/node_modules/jspdf/dist/jspdf.es.min.js +1771 -1781
- package/dist/node_modules/jspdf/dist/jspdf.es.min.js.map +1 -1
- package/dist/node_modules/raf/index.js +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +6 -9
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
- package/package.json +1 -1
- package/dist/node_modules/antd/es/date-picker/generatePicker/SuffixIcon.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { useEffect as m } from "react";
|
|
2
|
+
import E from "./isVisible.js";
|
|
3
|
+
function f(t, e = !1) {
|
|
4
|
+
if (E(t)) {
|
|
5
|
+
const n = t.nodeName.toLowerCase(), s = (
|
|
5
6
|
// Focusable element
|
|
6
|
-
["input", "select", "textarea", "button"].includes(
|
|
7
|
+
["input", "select", "textarea", "button"].includes(n) || // Editable element
|
|
7
8
|
t.isContentEditable || // Anchor with href element
|
|
8
|
-
|
|
9
|
-
),
|
|
10
|
-
let
|
|
11
|
-
return
|
|
9
|
+
n === "a" && !!t.getAttribute("href")
|
|
10
|
+
), u = t.getAttribute("tabindex"), r = Number(u);
|
|
11
|
+
let o = null;
|
|
12
|
+
return u && !Number.isNaN(r) ? o = r : s && o === null && (o = 0), s && t.disabled && (o = null), o !== null && (o >= 0 || e && o < 0);
|
|
12
13
|
}
|
|
13
14
|
return !1;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
return
|
|
16
|
+
function d(t, e = !1) {
|
|
17
|
+
const n = [...t.querySelectorAll("*")].filter((s) => f(s, e));
|
|
18
|
+
return f(t, e) && n.unshift(t), n;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function v(t, e) {
|
|
20
21
|
if (!t) return;
|
|
21
|
-
t.focus(
|
|
22
|
+
t.focus(e);
|
|
22
23
|
const {
|
|
23
|
-
cursor:
|
|
24
|
-
} =
|
|
25
|
-
if (
|
|
24
|
+
cursor: n
|
|
25
|
+
} = e || {};
|
|
26
|
+
if (n && (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement)) {
|
|
26
27
|
const s = t.value.length;
|
|
27
|
-
switch (
|
|
28
|
+
switch (n) {
|
|
28
29
|
case "start":
|
|
29
30
|
t.setSelectionRange(0, 0);
|
|
30
31
|
break;
|
|
@@ -36,8 +37,52 @@ function o(t, n) {
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
}
|
|
40
|
+
let c = null, i = [];
|
|
41
|
+
function b() {
|
|
42
|
+
return i[i.length - 1];
|
|
43
|
+
}
|
|
44
|
+
function w(t) {
|
|
45
|
+
const {
|
|
46
|
+
activeElement: e
|
|
47
|
+
} = document;
|
|
48
|
+
return t === e || t.contains(e);
|
|
49
|
+
}
|
|
50
|
+
function l() {
|
|
51
|
+
const t = b(), {
|
|
52
|
+
activeElement: e
|
|
53
|
+
} = document;
|
|
54
|
+
if (t && !w(t)) {
|
|
55
|
+
const n = d(t);
|
|
56
|
+
(n.includes(c) ? c : n[0])?.focus();
|
|
57
|
+
} else
|
|
58
|
+
c = e;
|
|
59
|
+
}
|
|
60
|
+
function a(t) {
|
|
61
|
+
if (t.key === "Tab") {
|
|
62
|
+
const {
|
|
63
|
+
activeElement: e
|
|
64
|
+
} = document, n = b(), s = d(n), u = s[s.length - 1];
|
|
65
|
+
t.shiftKey && e === s[0] ? c = u : !t.shiftKey && e === u && (c = s[0]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function g(t) {
|
|
69
|
+
return t && (i = i.filter((e) => e !== t), i.push(t), window.addEventListener("focusin", l), window.addEventListener("keydown", a, !0), l()), () => {
|
|
70
|
+
c = null, i = i.filter((e) => e !== t), i.length === 0 && (window.removeEventListener("focusin", l), window.removeEventListener("keydown", a, !0));
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function y(t, e) {
|
|
74
|
+
m(() => {
|
|
75
|
+
if (t) {
|
|
76
|
+
const n = e();
|
|
77
|
+
if (n)
|
|
78
|
+
return g(n);
|
|
79
|
+
}
|
|
80
|
+
}, [t]);
|
|
81
|
+
}
|
|
39
82
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
83
|
+
d as getFocusNodeList,
|
|
84
|
+
g as lockFocus,
|
|
85
|
+
v as triggerFocus,
|
|
86
|
+
y as useLockFocus
|
|
42
87
|
};
|
|
43
88
|
//# sourceMappingURL=focus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.js","sources":["../../../../../../node_modules/@rc-component/util/es/Dom/focus.js"],"sourcesContent":["import { useEffect } from 'react';\nimport isVisible from \"./isVisible\";\nfunction focusable(node, includePositive = false) {\n if (isVisible(node)) {\n const nodeName = node.nodeName.toLowerCase();\n const isFocusableElement =\n // Focusable element\n ['input', 'select', 'textarea', 'button'].includes(nodeName) ||\n // Editable element\n node.isContentEditable ||\n // Anchor with href element\n nodeName === 'a' && !!node.getAttribute('href');\n\n // Get tabIndex\n const tabIndexAttr = node.getAttribute('tabindex');\n const tabIndexNum = Number(tabIndexAttr);\n\n // Parse as number if validate\n let tabIndex = null;\n if (tabIndexAttr && !Number.isNaN(tabIndexNum)) {\n tabIndex = tabIndexNum;\n } else if (isFocusableElement && tabIndex === null) {\n tabIndex = 0;\n }\n\n // Block focusable if disabled\n if (isFocusableElement && node.disabled) {\n tabIndex = null;\n }\n return tabIndex !== null && (tabIndex >= 0 || includePositive && tabIndex < 0);\n }\n return false;\n}\nexport function getFocusNodeList(node, includePositive = false) {\n const res = [...node.querySelectorAll('*')].filter(child => {\n return focusable(child, includePositive);\n });\n if (focusable(node, includePositive)) {\n res.unshift(node);\n }\n return res;\n}\n// Used for `rc-input` `rc-textarea` `rc-input-number`\n/**\n * Focus element and set cursor position for input/textarea elements.\n */\nexport function triggerFocus(element, option) {\n if (!element) return;\n element.focus(option);\n\n // Selection content\n const {\n cursor\n } = option || {};\n if (cursor && (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement)) {\n const len = element.value.length;\n switch (cursor) {\n case 'start':\n element.setSelectionRange(0, 0);\n break;\n case 'end':\n element.setSelectionRange(len, len);\n break;\n default:\n element.setSelectionRange(0, len);\n }\n }\n}\n\n// ======================================================\n// == Lock Focus ==\n// ======================================================\nlet lastFocusElement = null;\nlet focusElements = [];\nfunction getLastElement() {\n return focusElements[focusElements.length - 1];\n}\nfunction hasFocus(element) {\n const {\n activeElement\n } = document;\n return element === activeElement || element.contains(activeElement);\n}\nfunction syncFocus() {\n const lastElement = getLastElement();\n const {\n activeElement\n } = document;\n if (lastElement && !hasFocus(lastElement)) {\n const focusableList = getFocusNodeList(lastElement);\n const matchElement = focusableList.includes(lastFocusElement) ? lastFocusElement : focusableList[0];\n matchElement?.focus();\n } else {\n lastFocusElement = activeElement;\n }\n}\nfunction onWindowKeyDown(e) {\n if (e.key === 'Tab') {\n const {\n activeElement\n } = document;\n const lastElement = getLastElement();\n const focusableList = getFocusNodeList(lastElement);\n const last = focusableList[focusableList.length - 1];\n if (e.shiftKey && activeElement === focusableList[0]) {\n // Tab backward on first focusable element\n lastFocusElement = last;\n } else if (!e.shiftKey && activeElement === last) {\n // Tab forward on last focusable element\n lastFocusElement = focusableList[0];\n }\n }\n}\n\n/**\n * Lock focus in the element.\n * It will force back to the first focusable element when focus leaves the element.\n */\nexport function lockFocus(element) {\n if (element) {\n // Refresh focus elements\n focusElements = focusElements.filter(ele => ele !== element);\n focusElements.push(element);\n\n // Just add event since it will de-duplicate\n window.addEventListener('focusin', syncFocus);\n window.addEventListener('keydown', onWindowKeyDown, true);\n syncFocus();\n }\n\n // Always return unregister function\n return () => {\n lastFocusElement = null;\n focusElements = focusElements.filter(ele => ele !== element);\n if (focusElements.length === 0) {\n window.removeEventListener('focusin', syncFocus);\n window.removeEventListener('keydown', onWindowKeyDown, true);\n }\n };\n}\n\n/**\n * Lock focus within an element.\n * When locked, focus will be restricted to focusable elements within the specified element.\n * If multiple elements are locked, only the last locked element will be effective.\n */\nexport function useLockFocus(lock, getElement) {\n useEffect(() => {\n if (lock) {\n const element = getElement();\n if (element) {\n return lockFocus(element);\n }\n }\n }, [lock]);\n}"],"names":["focusable","node","includePositive","isVisible","nodeName","isFocusableElement","tabIndexAttr","tabIndexNum","tabIndex","getFocusNodeList","res","child","triggerFocus","element","option","cursor","len"],"mappings":"
|
|
1
|
+
{"version":3,"file":"focus.js","sources":["../../../../../../node_modules/@rc-component/util/es/Dom/focus.js"],"sourcesContent":["import { useEffect } from 'react';\nimport isVisible from \"./isVisible\";\nfunction focusable(node, includePositive = false) {\n if (isVisible(node)) {\n const nodeName = node.nodeName.toLowerCase();\n const isFocusableElement =\n // Focusable element\n ['input', 'select', 'textarea', 'button'].includes(nodeName) ||\n // Editable element\n node.isContentEditable ||\n // Anchor with href element\n nodeName === 'a' && !!node.getAttribute('href');\n\n // Get tabIndex\n const tabIndexAttr = node.getAttribute('tabindex');\n const tabIndexNum = Number(tabIndexAttr);\n\n // Parse as number if validate\n let tabIndex = null;\n if (tabIndexAttr && !Number.isNaN(tabIndexNum)) {\n tabIndex = tabIndexNum;\n } else if (isFocusableElement && tabIndex === null) {\n tabIndex = 0;\n }\n\n // Block focusable if disabled\n if (isFocusableElement && node.disabled) {\n tabIndex = null;\n }\n return tabIndex !== null && (tabIndex >= 0 || includePositive && tabIndex < 0);\n }\n return false;\n}\nexport function getFocusNodeList(node, includePositive = false) {\n const res = [...node.querySelectorAll('*')].filter(child => {\n return focusable(child, includePositive);\n });\n if (focusable(node, includePositive)) {\n res.unshift(node);\n }\n return res;\n}\n// Used for `rc-input` `rc-textarea` `rc-input-number`\n/**\n * Focus element and set cursor position for input/textarea elements.\n */\nexport function triggerFocus(element, option) {\n if (!element) return;\n element.focus(option);\n\n // Selection content\n const {\n cursor\n } = option || {};\n if (cursor && (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement)) {\n const len = element.value.length;\n switch (cursor) {\n case 'start':\n element.setSelectionRange(0, 0);\n break;\n case 'end':\n element.setSelectionRange(len, len);\n break;\n default:\n element.setSelectionRange(0, len);\n }\n }\n}\n\n// ======================================================\n// == Lock Focus ==\n// ======================================================\nlet lastFocusElement = null;\nlet focusElements = [];\nfunction getLastElement() {\n return focusElements[focusElements.length - 1];\n}\nfunction hasFocus(element) {\n const {\n activeElement\n } = document;\n return element === activeElement || element.contains(activeElement);\n}\nfunction syncFocus() {\n const lastElement = getLastElement();\n const {\n activeElement\n } = document;\n if (lastElement && !hasFocus(lastElement)) {\n const focusableList = getFocusNodeList(lastElement);\n const matchElement = focusableList.includes(lastFocusElement) ? lastFocusElement : focusableList[0];\n matchElement?.focus();\n } else {\n lastFocusElement = activeElement;\n }\n}\nfunction onWindowKeyDown(e) {\n if (e.key === 'Tab') {\n const {\n activeElement\n } = document;\n const lastElement = getLastElement();\n const focusableList = getFocusNodeList(lastElement);\n const last = focusableList[focusableList.length - 1];\n if (e.shiftKey && activeElement === focusableList[0]) {\n // Tab backward on first focusable element\n lastFocusElement = last;\n } else if (!e.shiftKey && activeElement === last) {\n // Tab forward on last focusable element\n lastFocusElement = focusableList[0];\n }\n }\n}\n\n/**\n * Lock focus in the element.\n * It will force back to the first focusable element when focus leaves the element.\n */\nexport function lockFocus(element) {\n if (element) {\n // Refresh focus elements\n focusElements = focusElements.filter(ele => ele !== element);\n focusElements.push(element);\n\n // Just add event since it will de-duplicate\n window.addEventListener('focusin', syncFocus);\n window.addEventListener('keydown', onWindowKeyDown, true);\n syncFocus();\n }\n\n // Always return unregister function\n return () => {\n lastFocusElement = null;\n focusElements = focusElements.filter(ele => ele !== element);\n if (focusElements.length === 0) {\n window.removeEventListener('focusin', syncFocus);\n window.removeEventListener('keydown', onWindowKeyDown, true);\n }\n };\n}\n\n/**\n * Lock focus within an element.\n * When locked, focus will be restricted to focusable elements within the specified element.\n * If multiple elements are locked, only the last locked element will be effective.\n */\nexport function useLockFocus(lock, getElement) {\n useEffect(() => {\n if (lock) {\n const element = getElement();\n if (element) {\n return lockFocus(element);\n }\n }\n }, [lock]);\n}"],"names":["focusable","node","includePositive","isVisible","nodeName","isFocusableElement","tabIndexAttr","tabIndexNum","tabIndex","getFocusNodeList","res","child","triggerFocus","element","option","cursor","len","lastFocusElement","focusElements","getLastElement","hasFocus","activeElement","syncFocus","lastElement","focusableList","onWindowKeyDown","e","last","lockFocus","ele","useLockFocus","lock","getElement","useEffect"],"mappings":";;AAEA,SAASA,EAAUC,GAAMC,IAAkB,IAAO;AAChD,MAAIC,EAAUF,CAAI,GAAG;AACnB,UAAMG,IAAWH,EAAK,SAAS,YAAW,GACpCI;AAAA;AAAA,MAEN,CAAC,SAAS,UAAU,YAAY,QAAQ,EAAE,SAASD,CAAQ;AAAA,MAE3DH,EAAK;AAAA,MAELG,MAAa,OAAO,CAAC,CAACH,EAAK,aAAa,MAAM;AAAA,OAGxCK,IAAeL,E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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isValidElement as u, version as p } from "react";
|
|
2
|
-
import { r as s } from "../../../../_virtual/
|
|
2
|
+
import { r as s } from "../../../../_virtual/index6.js";
|
|
3
3
|
import c from "./hooks/useMemo.js";
|
|
4
4
|
import l from "./React/isFragment.js";
|
|
5
5
|
const n = Number(p.split(".")[0]), a = (t, r) => {
|
|
@@ -1,66 +1,71 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { render as
|
|
5
|
-
import { composeRef as
|
|
6
|
-
import { clsx as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import H from "../../../../@rc-component/motion/es/CSSMotion.js";
|
|
3
|
+
import p from "../../../../@rc-component/util/es/raf.js";
|
|
4
|
+
import { render as _, unmount as j } from "../../../../@rc-component/util/es/React/render.js";
|
|
5
|
+
import { composeRef as D } from "../../../../@rc-component/util/es/ref.js";
|
|
6
|
+
import { clsx as G } from "../../../../clsx/dist/clsx.js";
|
|
7
|
+
import "../../config-provider/index.js";
|
|
8
|
+
import { genCssVar as M } from "../../theme/util/genStyleUtils.js";
|
|
9
|
+
import { TARGET_CLS as V } from "./interface.js";
|
|
10
|
+
import { getTargetWaveColor as $ } from "./util.js";
|
|
11
|
+
import { ConfigContext as I } from "../../config-provider/context.js";
|
|
9
12
|
function c(s) {
|
|
10
13
|
return Number.isNaN(s) ? 0 : s;
|
|
11
14
|
}
|
|
12
|
-
const
|
|
15
|
+
const J = (s) => {
|
|
13
16
|
const {
|
|
14
17
|
className: i,
|
|
15
|
-
target:
|
|
18
|
+
target: t,
|
|
16
19
|
component: n,
|
|
17
|
-
colorSource:
|
|
18
|
-
} = s,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
colorSource: d
|
|
21
|
+
} = s, m = e.useRef(null), {
|
|
22
|
+
getPrefixCls: b
|
|
23
|
+
} = e.useContext(I), h = b(), [R] = M(h, "wave"), [f, v] = e.useState(null), [S, C] = e.useState([]), [N, y] = e.useState(0), [x, E] = e.useState(0), [g, w] = e.useState(0), [T, W] = e.useState(0), [L, k] = e.useState(!1), l = {
|
|
24
|
+
left: N,
|
|
25
|
+
top: x,
|
|
26
|
+
width: g,
|
|
27
|
+
height: T,
|
|
28
|
+
borderRadius: S.map((r) => `${r}px`).join(" ")
|
|
24
29
|
};
|
|
25
|
-
f && (
|
|
30
|
+
f && (l[R("color")] = f);
|
|
26
31
|
function u() {
|
|
27
|
-
const r = getComputedStyle(
|
|
28
|
-
|
|
32
|
+
const r = getComputedStyle(t);
|
|
33
|
+
v($(t, d));
|
|
29
34
|
const o = r.position === "static", {
|
|
30
35
|
borderLeftWidth: a,
|
|
31
|
-
borderTopWidth:
|
|
36
|
+
borderTopWidth: z
|
|
32
37
|
} = r;
|
|
33
|
-
|
|
38
|
+
y(o ? t.offsetLeft : c(-Number.parseFloat(a))), E(o ? t.offsetTop : c(-Number.parseFloat(z))), w(t.offsetWidth), W(t.offsetHeight);
|
|
34
39
|
const {
|
|
35
|
-
borderTopLeftRadius:
|
|
36
|
-
borderTopRightRadius:
|
|
37
|
-
borderBottomLeftRadius:
|
|
38
|
-
borderBottomRightRadius:
|
|
40
|
+
borderTopLeftRadius: A,
|
|
41
|
+
borderTopRightRadius: F,
|
|
42
|
+
borderBottomLeftRadius: O,
|
|
43
|
+
borderBottomRightRadius: P
|
|
39
44
|
} = r;
|
|
40
|
-
|
|
45
|
+
C([A, F, P, O].map((q) => c(Number.parseFloat(q))));
|
|
41
46
|
}
|
|
42
|
-
if (
|
|
43
|
-
if (
|
|
44
|
-
const r =
|
|
45
|
-
u(),
|
|
47
|
+
if (e.useEffect(() => {
|
|
48
|
+
if (t) {
|
|
49
|
+
const r = p(() => {
|
|
50
|
+
u(), k(!0);
|
|
46
51
|
});
|
|
47
52
|
let o;
|
|
48
|
-
return typeof ResizeObserver < "u" && (o = new ResizeObserver(u), o.observe(
|
|
49
|
-
|
|
53
|
+
return typeof ResizeObserver < "u" && (o = new ResizeObserver(u), o.observe(t)), () => {
|
|
54
|
+
p.cancel(r), o?.disconnect();
|
|
50
55
|
};
|
|
51
56
|
}
|
|
52
|
-
}, [
|
|
57
|
+
}, [t]), !L)
|
|
53
58
|
return null;
|
|
54
|
-
const
|
|
55
|
-
return /* @__PURE__ */
|
|
59
|
+
const B = (n === "Checkbox" || n === "Radio") && t?.classList.contains(V);
|
|
60
|
+
return /* @__PURE__ */ e.createElement(H, {
|
|
56
61
|
visible: !0,
|
|
57
62
|
motionAppear: !0,
|
|
58
63
|
motionName: "wave-motion",
|
|
59
64
|
motionDeadline: 5e3,
|
|
60
65
|
onAppearEnd: (r, o) => {
|
|
61
66
|
if (o.deadline || o.propertyName === "opacity") {
|
|
62
|
-
const a =
|
|
63
|
-
|
|
67
|
+
const a = m.current?.parentElement;
|
|
68
|
+
j(a).then(() => {
|
|
64
69
|
a?.remove();
|
|
65
70
|
});
|
|
66
71
|
}
|
|
@@ -68,26 +73,26 @@ const M = (s) => {
|
|
|
68
73
|
}
|
|
69
74
|
}, ({
|
|
70
75
|
className: r
|
|
71
|
-
}, o) => /* @__PURE__ */
|
|
72
|
-
ref:
|
|
73
|
-
className:
|
|
74
|
-
"wave-quick":
|
|
76
|
+
}, o) => /* @__PURE__ */ e.createElement("div", {
|
|
77
|
+
ref: D(m, o),
|
|
78
|
+
className: G(i, r, {
|
|
79
|
+
"wave-quick": B
|
|
75
80
|
}),
|
|
76
|
-
style:
|
|
81
|
+
style: l
|
|
77
82
|
}));
|
|
78
|
-
},
|
|
83
|
+
}, se = (s, i) => {
|
|
79
84
|
const {
|
|
80
|
-
component:
|
|
85
|
+
component: t
|
|
81
86
|
} = i;
|
|
82
|
-
if (
|
|
87
|
+
if (t === "Checkbox" && !s.querySelector("input")?.checked)
|
|
83
88
|
return;
|
|
84
89
|
const n = document.createElement("div");
|
|
85
|
-
n.style.position = "absolute", n.style.left = "0px", n.style.top = "0px", s?.insertBefore(n, s?.firstChild),
|
|
90
|
+
n.style.position = "absolute", n.style.left = "0px", n.style.top = "0px", s?.insertBefore(n, s?.firstChild), _(/* @__PURE__ */ e.createElement(J, {
|
|
86
91
|
...i,
|
|
87
92
|
target: s
|
|
88
93
|
}), n);
|
|
89
94
|
};
|
|
90
95
|
export {
|
|
91
|
-
|
|
96
|
+
se as default
|
|
92
97
|
};
|
|
93
98
|
//# sourceMappingURL=WaveEffect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WaveEffect.js","sources":["../../../../../../node_modules/antd/es/_util/wave/WaveEffect.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport CSSMotion from '@rc-component/motion';\nimport raf from \"@rc-component/util/es/raf\";\nimport { render, unmount } from \"@rc-component/util/es/React/render\";\nimport { composeRef } from \"@rc-component/util/es/ref\";\nimport { clsx } from 'clsx';\nimport { TARGET_CLS } from './interface';\nimport { getTargetWaveColor } from './util';\nfunction validateNum(value) {\n return Number.isNaN(value) ? 0 : value;\n}\nconst WaveEffect = props => {\n const {\n className,\n target,\n component,\n colorSource\n } = props;\n const divRef = React.useRef(null);\n // ===================== Effect =====================\n const [color, setWaveColor] = React.useState(null);\n const [borderRadius, setBorderRadius] = React.useState([]);\n const [left, setLeft] = React.useState(0);\n const [top, setTop] = React.useState(0);\n const [width, setWidth] = React.useState(0);\n const [height, setHeight] = React.useState(0);\n const [enabled, setEnabled] = React.useState(false);\n const waveStyle = {\n left,\n top,\n width,\n height,\n borderRadius: borderRadius.map(radius => `${radius}px`).join(' ')\n };\n if (color) {\n waveStyle['
|
|
1
|
+
{"version":3,"file":"WaveEffect.js","sources":["../../../../../../node_modules/antd/es/_util/wave/WaveEffect.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport CSSMotion from '@rc-component/motion';\nimport raf from \"@rc-component/util/es/raf\";\nimport { render, unmount } from \"@rc-component/util/es/React/render\";\nimport { composeRef } from \"@rc-component/util/es/ref\";\nimport { clsx } from 'clsx';\nimport { ConfigContext } from '../../config-provider';\nimport { genCssVar } from '../../theme/util/genStyleUtils';\nimport { TARGET_CLS } from './interface';\nimport { getTargetWaveColor } from './util';\nfunction validateNum(value) {\n return Number.isNaN(value) ? 0 : value;\n}\nconst WaveEffect = props => {\n const {\n className,\n target,\n component,\n colorSource\n } = props;\n const divRef = React.useRef(null);\n const {\n getPrefixCls\n } = React.useContext(ConfigContext);\n const rootPrefixCls = getPrefixCls();\n const [varName] = genCssVar(rootPrefixCls, 'wave');\n // ===================== Effect =====================\n const [color, setWaveColor] = React.useState(null);\n const [borderRadius, setBorderRadius] = React.useState([]);\n const [left, setLeft] = React.useState(0);\n const [top, setTop] = React.useState(0);\n const [width, setWidth] = React.useState(0);\n const [height, setHeight] = React.useState(0);\n const [enabled, setEnabled] = React.useState(false);\n const waveStyle = {\n left,\n top,\n width,\n height,\n borderRadius: borderRadius.map(radius => `${radius}px`).join(' ')\n };\n if (color) {\n waveStyle[varName('color')] = color;\n }\n function syncPos() {\n const nodeStyle = getComputedStyle(target);\n // Get wave color from target\n setWaveColor(getTargetWaveColor(target, colorSource));\n const isStatic = nodeStyle.position === 'static';\n // Rect\n const {\n borderLeftWidth,\n borderTopWidth\n } = nodeStyle;\n setLeft(isStatic ? target.offsetLeft : validateNum(-Number.parseFloat(borderLeftWidth)));\n setTop(isStatic ? target.offsetTop : validateNum(-Number.parseFloat(borderTopWidth)));\n setWidth(target.offsetWidth);\n setHeight(target.offsetHeight);\n // Get border radius\n const {\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomLeftRadius,\n borderBottomRightRadius\n } = nodeStyle;\n setBorderRadius([borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius].map(radius => validateNum(Number.parseFloat(radius))));\n }\n React.useEffect(() => {\n if (target) {\n // We need delay to check position here\n // since UI may change after click\n const id = raf(() => {\n syncPos();\n setEnabled(true);\n });\n // Add resize observer to follow size\n let resizeObserver;\n if (typeof ResizeObserver !== 'undefined') {\n resizeObserver = new ResizeObserver(syncPos);\n resizeObserver.observe(target);\n }\n return () => {\n raf.cancel(id);\n resizeObserver?.disconnect();\n };\n }\n }, [target]);\n if (!enabled) {\n return null;\n }\n const isSmallComponent = (component === 'Checkbox' || component === 'Radio') && target?.classList.contains(TARGET_CLS);\n return /*#__PURE__*/React.createElement(CSSMotion, {\n visible: true,\n motionAppear: true,\n motionName: \"wave-motion\",\n motionDeadline: 5000,\n onAppearEnd: (_, event) => {\n if (event.deadline || event.propertyName === 'opacity') {\n const holder = divRef.current?.parentElement;\n unmount(holder).then(() => {\n holder?.remove();\n });\n }\n return false;\n }\n }, ({\n className: motionClassName\n }, ref) => (/*#__PURE__*/React.createElement(\"div\", {\n ref: composeRef(divRef, ref),\n className: clsx(className, motionClassName, {\n 'wave-quick': isSmallComponent\n }),\n style: waveStyle\n })));\n};\nconst showWaveEffect = (target, info) => {\n const {\n component\n } = info;\n // Skip for unchecked checkbox\n if (component === 'Checkbox' && !target.querySelector('input')?.checked) {\n return;\n }\n // Create holder\n const holder = document.createElement('div');\n holder.style.position = 'absolute';\n holder.style.left = '0px';\n holder.style.top = '0px';\n target?.insertBefore(holder, target?.firstChild);\n render(/*#__PURE__*/React.createElement(WaveEffect, {\n ...info,\n target: target\n }), holder);\n};\nexport default showWaveEffect;"],"names":["validateNum","value","WaveEffect","props","className","target","component","colorSource","divRef","React","getPrefixCls","ConfigContext","rootPrefixCls","varName","genCssVar","color","setWaveColor","borderRadius","setBorderRadius","left","setLeft","top","setTop","width","setWidth","height","setHeight","enabled","setEnabled","waveStyle","radius","syncPos","nodeStyle","getTargetWaveColor","isStatic","borderLeftWidth","borderTopWidth","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","id","raf","resizeObserver","isSmallComponent","TARGET_CLS","CSSMotion","_","event","holder","unmount","motionClassName","ref","composeRef","clsx","showWaveEffect","info","render"],"mappings":";;;;;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AAC;AAAA,MACH;AACA,aAAO;AAAA,IACT;AAAA,EACJ,GAAK,CAAC;AAAA,IACF,WAAWE;AAAA,EACf,GAAKC,MAAsB,gBAAA3C,EAAM,cAAc,OAAO;AAAA,IAClD,KAAK4C,EAAW7C,GAAQ4C,CAAG;AAAA,IAC3B,WAAWE,EAAKlD,GAAW+C,GAAiB;AAAA,MAC1C,cAAcP;AAAA,IACpB,CAAK;AAAA,IACD,OAAOf;AAAA,EACX,CAAG,CAAE;AACL,GACM0B,KAAiB,CAAClD,GAAQmD,MAAS;AACvC,QAAM;AAAA,IACJ,WAAAlD;AAAA,EACJ,IAAMkD;AAEJ,MAAIlD,MAAc,cAAc,CAACD,EAAO,cAAc,OAAO,GAAG;AAC9D;AAGF,QAAM4C,IAAS,SAAS,cAAc,KAAK;AAC3C,EAAAA,EAAO,MAAM,WAAW,YACxBA,EAAO,MAAM,OAAO,OACpBA,EAAO,MAAM,MAAM,OACnB5C,GAAQ,aAAa4C,GAAQ5C,GAAQ,UAAU,GAC/CoD,EAAoB,gBAAAhD,EAAM,cAAcP,GAAY;AAAA,IAClD,GAAGsD;AAAA,IACH,QAAQnD;AAAA,EACZ,CAAG,GAAG4C,CAAM;AACZ;","x_google_ignoreList":[0]}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { genComponentStyleHook as
|
|
2
|
-
const
|
|
1
|
+
import { genComponentStyleHook as i, genCssVar as e } from "../../theme/util/genStyleUtils.js";
|
|
2
|
+
const s = (o) => {
|
|
3
3
|
const {
|
|
4
4
|
componentCls: t,
|
|
5
|
-
colorPrimary:
|
|
6
|
-
|
|
5
|
+
colorPrimary: n,
|
|
6
|
+
antCls: a
|
|
7
|
+
} = o, [, r] = e(a, "wave");
|
|
7
8
|
return {
|
|
8
9
|
[t]: {
|
|
9
10
|
position: "absolute",
|
|
10
11
|
background: "transparent",
|
|
11
12
|
pointerEvents: "none",
|
|
12
13
|
boxSizing: "border-box",
|
|
13
|
-
color:
|
|
14
|
+
color: r("color", n),
|
|
14
15
|
boxShadow: "0 0 0 0 currentcolor",
|
|
15
16
|
opacity: 0.2,
|
|
16
17
|
// =================== Motion ===================
|
|
@@ -26,8 +27,8 @@ const i = (o) => {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
|
-
},
|
|
30
|
+
}, l = i("Wave", s);
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
+
l as default
|
|
32
33
|
};
|
|
33
34
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../../../node_modules/antd/es/_util/wave/style.js"],"sourcesContent":["import { genComponentStyleHook } from '../../theme/internal';\nconst genWaveStyle = token => {\n const {\n componentCls,\n colorPrimary\n } = token;\n return {\n [componentCls]: {\n position: 'absolute',\n background: 'transparent',\n pointerEvents: 'none',\n boxSizing: 'border-box',\n color:
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../../../node_modules/antd/es/_util/wave/style.js"],"sourcesContent":["import { genComponentStyleHook } from '../../theme/internal';\nimport { genCssVar } from '../../theme/util/genStyleUtils';\nconst genWaveStyle = token => {\n const {\n componentCls,\n colorPrimary,\n antCls\n } = token;\n const [, varRef] = genCssVar(antCls, 'wave');\n return {\n [componentCls]: {\n position: 'absolute',\n background: 'transparent',\n pointerEvents: 'none',\n boxSizing: 'border-box',\n color: varRef('color', colorPrimary),\n boxShadow: `0 0 0 0 currentcolor`,\n opacity: 0.2,\n // =================== Motion ===================\n '&.wave-motion-appear': {\n transition: [`box-shadow 0.4s ${token.motionEaseOutCirc}`, `opacity 2s ${token.motionEaseOutCirc}`].join(','),\n '&-active': {\n boxShadow: `0 0 0 6px currentcolor`,\n opacity: 0\n },\n '&.wave-quick': {\n transition: [`box-shadow ${token.motionDurationSlow} ${token.motionEaseInOut}`, `opacity ${token.motionDurationSlow} ${token.motionEaseInOut}`].join(',')\n }\n }\n }\n };\n};\nexport default genComponentStyleHook('Wave', genWaveStyle);"],"names":["genWaveStyle","token","componentCls","colorPrimary","antCls","varRef","genCssVar","useStyle","genComponentStyleHook"],"mappings":";AAEA,MAAMA,IAAe,CAAAC,MAAS;AAC5B,QAAM;AAAA,IACJ,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,QAAAC;AAAA,EACJ,IAAMH,GACE,CAAA,EAAGI,CAAM,IAAIC,EAAUF,GAAQ,MAAM;AAC3C,SAAO;AAAA,IACL,CAACF,CAAY,GAAG;AAAA,MACd,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,WAAW;AAAA,MACX,OAAOG,EAAO,SAASF,CAAY;AAAA,MACnC,WAAW;AAAA,MACX,SAAS;AAAA;AAAA,MAET,wBAAwB;AAAA,QACtB,YAAY,CAAC,mBAAmBF,EAAM,iBAAiB,IAAI,cAAcA,EAAM,iBAAiB,EAAE,EAAE,KAAK,GAAG;AAAA,QAC5G,YAAY;AAAA,UACV,WAAW;AAAA,UACX,SAAS;AAAA,QACnB;AAAA,QACQ,gBAAgB;AAAA,UACd,YAAY,CAAC,cAAcA,EAAM,kBAAkB,IAAIA,EAAM,eAAe,IAAI,WAAWA,EAAM,kBAAkB,IAAIA,EAAM,eAAe,EAAE,EAAE,KAAK,GAAG;AAAA,QAClK;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA,GACAM,IAAeC,EAAsB,QAAQR,CAAY;","x_google_ignoreList":[0]}
|