@xhsreds/reds-rn-next 0.0.23 → 0.1.0
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/benchmarks/out.json +332 -0
- package/coverage/.tmp/coverage-0.json +1 -0
- package/coverage/.tmp/coverage-1.json +1 -0
- package/coverage/.tmp/coverage-2.json +1 -0
- package/coverage/.tmp/coverage-3.json +1 -0
- package/coverage/.tmp/coverage-4.json +1 -0
- package/coverage/.tmp/coverage-5.json +1 -0
- package/coverage/.tmp/coverage-6.json +1 -0
- package/coverage/.tmp/coverage-7.json +1 -0
- package/coverage/.tmp/coverage-8.json +1 -0
- package/coverage/.tmp/coverage-9.json +1 -0
- package/lib/cjs/_chunks/8GiEQzJI.js +14 -0
- package/lib/cjs/_chunks/8GiEQzJI.js.map +1 -0
- package/lib/cjs/_chunks/C61-qTj5.js +45 -0
- package/lib/cjs/_chunks/C61-qTj5.js.map +1 -0
- package/lib/cjs/_chunks/CH-nghLh.js +25 -0
- package/lib/cjs/_chunks/CH-nghLh.js.map +1 -0
- package/lib/cjs/_chunks/CvikiypO.js +20 -0
- package/lib/cjs/_chunks/CvikiypO.js.map +1 -0
- package/lib/cjs/_chunks/CyggXkdu.js +20 -0
- package/lib/cjs/_chunks/CyggXkdu.js.map +1 -0
- package/lib/cjs/_chunks/{0oZeAV32.js → D9ngGICz.js} +14 -1
- package/lib/cjs/_chunks/{0oZeAV32.js.map → D9ngGICz.js.map} +1 -1
- package/lib/cjs/_chunks/DOAnQxcP.js +16 -0
- package/lib/cjs/_chunks/DOAnQxcP.js.map +1 -0
- package/lib/cjs/_chunks/{BUZe8G-Q.js → DkF74KKv.js} +31 -10
- package/lib/cjs/_chunks/DkF74KKv.js.map +1 -0
- package/lib/cjs/_chunks/Dmk9_Zw3.js +20 -0
- package/lib/cjs/_chunks/Dmk9_Zw3.js.map +1 -0
- package/lib/cjs/_chunks/y2LtPP5n.js +21 -0
- package/lib/cjs/_chunks/y2LtPP5n.js.map +1 -0
- package/lib/cjs/_chunks/zrKJYx9X.js +49 -0
- package/lib/cjs/_chunks/zrKJYx9X.js.map +1 -0
- package/lib/cjs/components/Button/Button.js +44 -0
- package/lib/cjs/components/Button/Button.js.map +1 -0
- package/lib/cjs/components/Button/index.js +25 -8
- package/lib/cjs/components/Button/index.js.map +1 -1
- package/lib/cjs/components/Button/interface/index.js +5 -11
- package/lib/cjs/components/Button/interface/index.js.map +1 -1
- package/lib/cjs/components/Button/styleMap.js +24 -8
- package/lib/cjs/components/Button/styleMap.js.map +1 -1
- package/lib/cjs/components/Collapse/Collapse.js +60 -0
- package/lib/cjs/components/Collapse/Collapse.js.map +1 -0
- package/lib/cjs/components/Collapse/Item/Item.js +113 -0
- package/lib/cjs/components/Collapse/Item/Item.js.map +1 -0
- package/lib/cjs/components/Collapse/Item/interface/index.js +12 -0
- package/lib/cjs/components/Collapse/Item/interface/index.js.map +1 -0
- package/lib/cjs/components/Collapse/Item/styles.js +36 -0
- package/lib/cjs/components/Collapse/Item/styles.js.map +1 -0
- package/lib/cjs/components/Collapse/hooks/useCollapseContext.js +14 -0
- package/lib/cjs/components/Collapse/hooks/useCollapseContext.js.map +1 -0
- package/lib/cjs/components/Collapse/index.js +21 -0
- package/lib/cjs/components/Collapse/index.js.map +1 -0
- package/lib/cjs/components/Collapse/interface/index.js +11 -0
- package/lib/cjs/components/Collapse/interface/index.js.map +1 -0
- package/lib/cjs/components/ConfigProvider/ConfigProvider.js +1 -1
- package/lib/cjs/components/ConfigProvider/hooks/ConfigCache/ConfigCache.js +1 -1
- package/lib/cjs/components/ConfigProvider/hooks/ConfigCache/index.js +1 -1
- package/lib/cjs/components/ConfigProvider/hooks/themeToken/useThemeToken.js +1 -1
- package/lib/cjs/components/ConfigProvider/index.js +13 -22
- package/lib/cjs/components/ConfigProvider/index.js.map +1 -1
- package/lib/cjs/components/ConfigProvider/interface/index.js +5 -34
- package/lib/cjs/components/ConfigProvider/interface/index.js.map +1 -1
- package/lib/cjs/components/Empty/Empty.js +44 -0
- package/lib/cjs/components/Empty/Empty.js.map +1 -0
- package/lib/cjs/components/Empty/hooks/useDefaultIcon.js +10 -0
- package/lib/cjs/components/Empty/hooks/useDefaultIcon.js.map +1 -0
- package/lib/cjs/components/Empty/index.js +22 -0
- package/lib/cjs/components/Empty/index.js.map +1 -0
- package/lib/cjs/components/Empty/interface/index.js +8 -0
- package/lib/cjs/components/Empty/interface/index.js.map +1 -0
- package/lib/cjs/components/Empty/styles.js +38 -0
- package/lib/cjs/components/Empty/styles.js.map +1 -0
- package/lib/cjs/components/Image/Image.js +130 -0
- package/lib/cjs/components/Image/Image.js.map +1 -0
- package/lib/cjs/components/Image/hook/index.js +2 -2
- package/lib/cjs/components/Image/index.js +4 -4
- package/lib/cjs/components/Image/index.js.map +1 -1
- package/lib/cjs/components/Image/interface/index.js +8 -35
- package/lib/cjs/components/Image/interface/index.js.map +1 -1
- package/lib/cjs/components/Popover/Popover.js +128 -0
- package/lib/cjs/components/Popover/Popover.js.map +1 -0
- package/lib/cjs/components/Popover/component.js +1 -1
- package/lib/cjs/components/Popover/hook.js +1 -1
- package/lib/cjs/components/Popover/index.js +12 -120
- package/lib/cjs/components/Popover/index.js.map +1 -1
- package/lib/cjs/components/Popover/interface/index.js +5 -11
- package/lib/cjs/components/Popover/interface/index.js.map +1 -1
- package/lib/cjs/components/Popover/styles.js +29 -0
- package/lib/cjs/components/Popover/styles.js.map +1 -0
- package/lib/cjs/components/Result/Result.js +52 -0
- package/lib/cjs/components/Result/Result.js.map +1 -0
- package/lib/cjs/components/Result/hooks/useDefaultIcon.js +19 -0
- package/lib/cjs/components/Result/hooks/useDefaultIcon.js.map +1 -0
- package/lib/cjs/components/Result/index.js +22 -0
- package/lib/cjs/components/Result/index.js.map +1 -0
- package/lib/cjs/components/Result/interface/index.js +8 -0
- package/lib/cjs/components/Result/interface/index.js.map +1 -0
- package/lib/cjs/components/Result/styles.js +47 -0
- package/lib/cjs/components/Result/styles.js.map +1 -0
- package/lib/cjs/components/Switch/Switch.js +80 -0
- package/lib/cjs/components/Switch/Switch.js.map +1 -0
- package/lib/cjs/components/Switch/index.js +10 -63
- package/lib/cjs/components/Switch/index.js.map +1 -1
- package/lib/cjs/components/Switch/interface/index.js +4 -9
- package/lib/cjs/components/Switch/interface/index.js.map +1 -1
- package/lib/cjs/components/Switch/styles.js.map +1 -1
- package/lib/cjs/components/Tag/Tag.js +203 -0
- package/lib/cjs/components/Tag/Tag.js.map +1 -0
- package/lib/cjs/components/Tag/index.js +10 -207
- package/lib/cjs/components/Tag/index.js.map +1 -1
- package/lib/cjs/components/Tag/interface/index.js +4 -17
- package/lib/cjs/components/Tag/interface/index.js.map +1 -1
- package/lib/cjs/components/Tag/styles.js +29 -0
- package/lib/cjs/components/Tag/styles.js.map +1 -0
- package/lib/cjs/components/Text/Text.js +159 -0
- package/lib/cjs/components/Text/Text.js.map +1 -0
- package/lib/cjs/components/Text/hooks/cloneContainer.js +1 -1
- package/lib/cjs/components/Text/hooks/index.js +1 -1
- package/lib/cjs/components/Text/hooks/loadFontFromFile.js +1 -1
- package/lib/cjs/components/Text/index.js +12 -146
- package/lib/cjs/components/Text/index.js.map +1 -1
- package/lib/cjs/components/Text/interface/index.js +5 -12
- package/lib/cjs/components/Text/interface/index.js.map +1 -1
- package/lib/cjs/components/Text/styles.js +1 -1
- package/lib/cjs/index.js +46 -22
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/_chunks/B3zY_xWO.js +17 -0
- package/lib/esm/_chunks/B3zY_xWO.js.map +1 -0
- package/lib/esm/_chunks/BITrbAAT.js +42 -0
- package/lib/esm/_chunks/BITrbAAT.js.map +1 -0
- package/lib/esm/_chunks/BKS4Pa1R.js +13 -0
- package/lib/esm/_chunks/BKS4Pa1R.js.map +1 -0
- package/lib/esm/_chunks/BfaGqGMC.js +11 -0
- package/lib/esm/_chunks/BfaGqGMC.js.map +1 -0
- package/lib/esm/_chunks/BswK5qRp.js +18 -0
- package/lib/esm/_chunks/BswK5qRp.js.map +1 -0
- package/lib/esm/_chunks/Bw08lvHs.js +17 -0
- package/lib/esm/_chunks/Bw08lvHs.js.map +1 -0
- package/lib/esm/_chunks/CszwJiJx.js +22 -0
- package/lib/esm/_chunks/CszwJiJx.js.map +1 -0
- package/lib/esm/_chunks/D7oyCwVx.js +17 -0
- package/lib/esm/_chunks/D7oyCwVx.js.map +1 -0
- package/lib/esm/_chunks/DKABHJAn.js +41 -0
- package/lib/esm/_chunks/DKABHJAn.js.map +1 -0
- package/lib/esm/_chunks/{C6lwOm3T.js → DhfjJNaB.js} +31 -11
- package/lib/esm/_chunks/DhfjJNaB.js.map +1 -0
- package/lib/esm/_chunks/{zVU7tqWk.js → GCWGuPmB.js} +14 -2
- package/lib/esm/_chunks/{zVU7tqWk.js.map → GCWGuPmB.js.map} +1 -1
- package/lib/esm/components/Button/Button.js +36 -0
- package/lib/esm/components/Button/Button.js.map +1 -0
- package/lib/esm/components/Button/index.js +27 -8
- package/lib/esm/components/Button/index.js.map +1 -1
- package/lib/esm/components/Button/interface/index.js +1 -11
- package/lib/esm/components/Button/interface/index.js.map +1 -1
- package/lib/esm/components/Button/styleMap.js +23 -8
- package/lib/esm/components/Button/styleMap.js.map +1 -1
- package/lib/esm/components/Collapse/Collapse.js +56 -0
- package/lib/esm/components/Collapse/Collapse.js.map +1 -0
- package/lib/esm/components/Collapse/Item/Item.js +109 -0
- package/lib/esm/components/Collapse/Item/Item.js.map +1 -0
- package/lib/esm/components/Collapse/Item/interface/index.js +10 -0
- package/lib/esm/components/Collapse/Item/interface/index.js.map +1 -0
- package/lib/esm/components/Collapse/Item/styles.js +32 -0
- package/lib/esm/components/Collapse/Item/styles.js.map +1 -0
- package/lib/esm/components/Collapse/hooks/useCollapseContext.js +12 -0
- package/lib/esm/components/Collapse/hooks/useCollapseContext.js.map +1 -0
- package/lib/esm/components/Collapse/index.js +14 -0
- package/lib/esm/components/Collapse/index.js.map +1 -0
- package/lib/esm/components/Collapse/interface/index.js +9 -0
- package/lib/esm/components/Collapse/interface/index.js.map +1 -0
- package/lib/esm/components/ConfigProvider/ConfigProvider.js +1 -1
- package/lib/esm/components/ConfigProvider/hooks/ConfigCache/ConfigCache.js +1 -1
- package/lib/esm/components/ConfigProvider/hooks/ConfigCache/index.js +1 -1
- package/lib/esm/components/ConfigProvider/hooks/themeToken/useThemeToken.js +1 -1
- package/lib/esm/components/ConfigProvider/index.js +10 -22
- package/lib/esm/components/ConfigProvider/index.js.map +1 -1
- package/lib/esm/components/ConfigProvider/interface/index.js +1 -34
- package/lib/esm/components/ConfigProvider/interface/index.js.map +1 -1
- package/lib/esm/components/Empty/Empty.js +40 -0
- package/lib/esm/components/Empty/Empty.js.map +1 -0
- package/lib/esm/components/Empty/hooks/useDefaultIcon.js +8 -0
- package/lib/esm/components/Empty/hooks/useDefaultIcon.js.map +1 -0
- package/lib/esm/components/Empty/index.js +16 -0
- package/lib/esm/components/Empty/index.js.map +1 -0
- package/lib/esm/components/Empty/interface/index.js +2 -0
- package/lib/esm/components/Empty/interface/index.js.map +1 -0
- package/lib/esm/components/Empty/styles.js +34 -0
- package/lib/esm/components/Empty/styles.js.map +1 -0
- package/lib/esm/components/Image/Image.js +126 -0
- package/lib/esm/components/Image/Image.js.map +1 -0
- package/lib/esm/components/Image/hook/index.js +2 -2
- package/lib/esm/components/Image/index.js +4 -4
- package/lib/esm/components/Image/index.js.map +1 -1
- package/lib/esm/components/Image/interface/index.js +1 -32
- package/lib/esm/components/Image/interface/index.js.map +1 -1
- package/lib/esm/components/Popover/Popover.js +124 -0
- package/lib/esm/components/Popover/Popover.js.map +1 -0
- package/lib/esm/components/Popover/component.js +1 -1
- package/lib/esm/components/Popover/hook.js +1 -1
- package/lib/esm/components/Popover/index.js +10 -120
- package/lib/esm/components/Popover/index.js.map +1 -1
- package/lib/esm/components/Popover/interface/index.js +1 -11
- package/lib/esm/components/Popover/interface/index.js.map +1 -1
- package/lib/esm/components/Popover/styles.js +25 -0
- package/lib/esm/components/Popover/styles.js.map +1 -0
- package/lib/esm/components/Result/Result.js +48 -0
- package/lib/esm/components/Result/Result.js.map +1 -0
- package/lib/esm/components/Result/hooks/useDefaultIcon.js +17 -0
- package/lib/esm/components/Result/hooks/useDefaultIcon.js.map +1 -0
- package/lib/esm/components/Result/index.js +16 -0
- package/lib/esm/components/Result/index.js.map +1 -0
- package/lib/esm/components/Result/interface/index.js +2 -0
- package/lib/esm/components/Result/interface/index.js.map +1 -0
- package/lib/esm/components/Result/styles.js +43 -0
- package/lib/esm/components/Result/styles.js.map +1 -0
- package/lib/esm/components/Switch/Switch.js +76 -0
- package/lib/esm/components/Switch/Switch.js.map +1 -0
- package/lib/esm/components/Switch/index.js +8 -63
- package/lib/esm/components/Switch/index.js.map +1 -1
- package/lib/esm/components/Switch/interface/index.js +2 -11
- package/lib/esm/components/Switch/interface/index.js.map +1 -1
- package/lib/esm/components/Switch/styles.js.map +1 -1
- package/lib/esm/components/Tag/Tag.js +199 -0
- package/lib/esm/components/Tag/Tag.js.map +1 -0
- package/lib/esm/components/Tag/index.js +8 -207
- package/lib/esm/components/Tag/index.js.map +1 -1
- package/lib/esm/components/Tag/interface/index.js +1 -18
- package/lib/esm/components/Tag/interface/index.js.map +1 -1
- package/lib/esm/components/Tag/styles.js +25 -0
- package/lib/esm/components/Tag/styles.js.map +1 -0
- package/lib/esm/components/Text/Text.js +155 -0
- package/lib/esm/components/Text/Text.js.map +1 -0
- package/lib/esm/components/Text/hooks/cloneContainer.js +1 -1
- package/lib/esm/components/Text/hooks/index.js +1 -1
- package/lib/esm/components/Text/hooks/loadFontFromFile.js +1 -1
- package/lib/esm/components/Text/index.js +10 -146
- package/lib/esm/components/Text/index.js.map +1 -1
- package/lib/esm/components/Text/interface/index.js +1 -12
- package/lib/esm/components/Text/interface/index.js.map +1 -1
- package/lib/esm/components/Text/styles.js +1 -1
- package/lib/esm/index.js +28 -11
- package/lib/esm/index.js.map +1 -1
- package/lib/types/components/Button/Button.d.ts +4 -0
- package/lib/types/components/Button/index.d.ts +3 -3
- package/lib/types/components/Button/interface/index.d.ts +2 -0
- package/lib/types/components/Button/styleMap.d.ts +8 -0
- package/lib/types/components/Collapse/Collapse.d.ts +13 -0
- package/lib/types/components/Collapse/Item/Item.d.ts +7 -0
- package/lib/types/components/Collapse/Item/interface/index.d.ts +12 -0
- package/lib/types/components/Collapse/Item/styles.d.ts +19 -0
- package/lib/types/components/Collapse/demo/index.d.ts +2 -0
- package/lib/types/components/Collapse/hooks/useCollapseContext.d.ts +3 -0
- package/lib/types/components/Collapse/index.d.ts +3 -0
- package/lib/types/components/Collapse/interface/index.d.ts +24 -0
- package/lib/types/components/Collapse/test/demo.d.ts +2 -0
- package/lib/types/components/Collapse/test/index.bench.d.ts +1 -0
- package/lib/types/components/Collapse/test/index.test.d.ts +1 -0
- package/lib/types/components/ConfigProvider/hooks/ConfigCache/interface.d.ts +1 -1
- package/lib/types/components/ConfigProvider/index.d.ts +2 -0
- package/lib/types/components/Empty/Empty.d.ts +9 -0
- package/lib/types/components/Empty/demo/index.d.ts +2 -0
- package/lib/types/components/Empty/hooks/useDefaultIcon.d.ts +5 -0
- package/lib/types/components/Empty/index.d.ts +4 -0
- package/lib/types/components/Empty/interface/index.d.ts +9 -0
- package/lib/types/components/Empty/styles.d.ts +20 -0
- package/lib/types/components/Empty/test/index.bench.d.ts +1 -0
- package/lib/types/components/Empty/test/index.test.d.ts +1 -0
- package/lib/types/components/Image/Image.d.ts +5 -0
- package/lib/types/components/Image/index.d.ts +4 -5
- package/lib/types/components/Popover/Popover.d.ts +4 -0
- package/lib/types/components/Popover/index.d.ts +4 -4
- package/lib/types/components/Popover/styles.d.ts +20 -0
- package/lib/types/components/Result/Result.d.ts +11 -0
- package/lib/types/components/Result/demo/index.d.ts +2 -0
- package/lib/types/components/Result/hooks/useDefaultIcon.d.ts +14 -0
- package/lib/types/components/Result/index.d.ts +4 -0
- package/lib/types/components/Result/interface/index.d.ts +13 -0
- package/lib/types/components/Result/styles.d.ts +29 -0
- package/lib/types/components/Result/test/Demo.d.ts +2 -0
- package/lib/types/components/Result/test/index.bench.d.ts +1 -0
- package/lib/types/components/Result/test/index.test.d.ts +1 -0
- package/lib/types/components/Switch/Switch.d.ts +13 -0
- package/lib/types/components/Switch/index.d.ts +3 -12
- package/lib/types/components/Tag/Tag.d.ts +4 -0
- package/lib/types/components/Tag/index.d.ts +3 -3
- package/lib/types/components/Tag/interface/index.d.ts +2 -5
- package/lib/types/components/Tag/styles.d.ts +20 -0
- package/lib/types/components/Text/Text.d.ts +4 -0
- package/lib/types/components/Text/index.d.ts +4 -4
- package/lib/types/index.d.ts +10 -10
- package/package.json +2 -2
- package/src/components/Button/{index.tsx → Button.tsx} +5 -2
- package/src/components/Button/demo/index.tsx +4 -1
- package/src/components/Button/doc/index.mdx +15 -13
- package/src/components/Button/index.ts +5 -0
- package/src/components/Button/interface/index.ts +2 -0
- package/src/components/Button/styleMap.ts +9 -0
- package/src/components/Button/test/__snapshots__/index.test.tsx.snap +3 -0
- package/src/components/Button/test/index.test.tsx +25 -1
- package/src/components/Collapse/Collapse.tsx +72 -0
- package/src/components/Collapse/Item/Item.tsx +103 -0
- package/src/components/Collapse/Item/interface/index.ts +21 -0
- package/src/components/Collapse/Item/styles.ts +27 -0
- package/src/components/Collapse/demo/index.tsx +60 -0
- package/src/components/Collapse/doc/index.mdx +24 -0
- package/src/components/Collapse/hooks/useCollapseContext.ts +8 -0
- package/src/components/Collapse/index.ts +4 -0
- package/src/components/Collapse/interface/index.ts +25 -0
- package/src/components/Collapse/test/demo.tsx +62 -0
- package/src/components/Collapse/test/index.bench.tsx +13 -0
- package/src/components/Collapse/test/index.test.tsx +61 -0
- package/src/components/ConfigProvider/doc/index.mdx +8 -8
- package/src/components/ConfigProvider/hooks/ConfigCache/interface.ts +1 -1
- package/src/components/ConfigProvider/index.ts +3 -0
- package/src/components/Empty/Empty.tsx +29 -0
- package/src/components/Empty/demo/index.tsx +39 -0
- package/src/components/Empty/doc/index.mdx +19 -0
- package/src/components/Empty/hooks/useDefaultIcon.ts +5 -0
- package/src/components/Empty/index.ts +5 -0
- package/src/components/Empty/interface/index.ts +10 -0
- package/src/components/Empty/styles.ts +29 -0
- package/src/components/Empty/test/index.bench.tsx +12 -0
- package/src/components/Empty/test/index.test.tsx +26 -0
- package/src/components/Image/Image.tsx +121 -0
- package/src/components/Image/demo/index.tsx +2 -1
- package/src/components/Image/doc/index.mdx +13 -13
- package/src/components/Image/index.ts +5 -0
- package/src/components/Image/index.tsx +1 -2
- package/src/components/Popover/demo/index.tsx +2 -2
- package/src/components/Popover/doc/index.mdx +15 -15
- package/src/components/Popover/index.ts +5 -0
- package/src/components/Popover/styles.ts +24 -0
- package/src/components/Result/Result.tsx +35 -0
- package/src/components/Result/demo/index.tsx +58 -0
- package/src/components/Result/doc/index.mdx +21 -0
- package/src/components/Result/hooks/useDefaultIcon.ts +21 -0
- package/src/components/Result/index.ts +5 -0
- package/src/components/Result/interface/index.ts +14 -0
- package/src/components/Result/styles.ts +38 -0
- package/src/components/Result/test/Demo.tsx +80 -0
- package/src/components/Result/test/index.bench.tsx +12 -0
- package/src/components/Result/test/index.test.tsx +101 -0
- package/src/components/Switch/{index.tsx → Switch.tsx} +23 -9
- package/src/components/Switch/demo/index.tsx +7 -1
- package/src/components/Switch/doc/index.mdx +11 -11
- package/src/components/Switch/index.ts +5 -0
- package/src/components/Switch/test/index.bench.tsx +1 -1
- package/src/components/Switch/test/paper.bench.tsx +1 -1
- package/src/components/Tag/Tag.tsx +195 -0
- package/src/components/Tag/demo/index.tsx +0 -24
- package/src/components/Tag/doc/index.mdx +18 -20
- package/src/components/Tag/index.ts +5 -0
- package/src/components/Tag/interface/index.ts +1 -5
- package/src/components/{Switch/styles.tsx → Tag/styles.ts} +1 -1
- package/src/components/Tag/test/index.test.tsx +4 -32
- package/src/components/Text/doc/index.mdx +17 -17
- package/src/components/Text/index.ts +5 -0
- package/src/index.ts +10 -12
- package/lib/cjs/_chunks/BUZe8G-Q.js.map +0 -1
- package/lib/cjs/components/Popover/manifest.js +0 -3
- package/lib/cjs/components/Popover/manifest.js.map +0 -1
- package/lib/esm/_chunks/C6lwOm3T.js.map +0 -1
- package/lib/esm/components/Popover/manifest.js +0 -2
- package/lib/esm/components/Popover/manifest.js.map +0 -1
- package/lib/types/components/Popover/manifest.d.ts +0 -3
- package/src/components/Popover/manifest.ts +0 -3
- package/src/components/Tag/index.tsx +0 -199
- /package/src/components/Popover/{index.tsx → Popover.tsx} +0 -0
- /package/src/components/{ConfigProvider/index.tsx → Switch/styles.ts} +0 -0
- /package/src/components/Text/{index.tsx → Text.tsx} +0 -0
|
@@ -4,7 +4,7 @@ var React = require('react');
|
|
|
4
4
|
var redsTokenNext = require('@xhsreds/reds-token-next');
|
|
5
5
|
var components_ConfigProvider_hooks_ConfigCache_ConfigCache = require('../ConfigCache/ConfigCache.js');
|
|
6
6
|
var components_ConfigProvider_hooks_ConfigContext_ConfigContext = require('../ConfigContext/ConfigContext.js');
|
|
7
|
-
require('../../../../_chunks/
|
|
7
|
+
require('../../../../_chunks/D9ngGICz.js');
|
|
8
8
|
|
|
9
9
|
var staticColor = {
|
|
10
10
|
lightColor: redsTokenNext.lightColor,
|
|
@@ -2,28 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var components_ConfigProvider_ConfigProvider = require('./ConfigProvider.js');
|
|
6
|
+
var components_ConfigProvider_interface_index = require('../../_chunks/C61-qTj5.js');
|
|
7
|
+
var components_ConfigProvider_hooks_themeToken_useThemeToken = require('./hooks/themeToken/useThemeToken.js');
|
|
8
|
+
require('../../_chunks/D9ngGICz.js');
|
|
9
|
+
require('./hooks/ConfigCache/ConfigCache.js');
|
|
10
|
+
require('@xhsreds/reds-token-next');
|
|
11
|
+
require('./hooks/ConfigContext/ConfigContext.js');
|
|
12
|
+
require('react');
|
|
7
13
|
|
|
8
|
-
var styles = reactNative.StyleSheet.create({
|
|
9
|
-
switchContainer: {
|
|
10
|
-
width: 40,
|
|
11
|
-
height: 24,
|
|
12
|
-
borderRadius: 15,
|
|
13
|
-
justifyContent: "center",
|
|
14
|
-
alignItems: "center"
|
|
15
|
-
},
|
|
16
|
-
thumb: {
|
|
17
|
-
width: 20,
|
|
18
|
-
height: 20,
|
|
19
|
-
borderRadius: 10,
|
|
20
|
-
backgroundColor: redsTokenNext.alwaysColor.White,
|
|
21
|
-
justifyContent: "center",
|
|
22
|
-
alignItems: "center",
|
|
23
|
-
position: "absolute",
|
|
24
|
-
left: 0
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
14
|
|
|
28
|
-
|
|
15
|
+
|
|
16
|
+
exports.ConfigProvider = components_ConfigProvider_ConfigProvider.default;
|
|
17
|
+
exports.default = components_ConfigProvider_ConfigProvider.default;
|
|
18
|
+
exports.ConfigProviderType = components_ConfigProvider_interface_index.index;
|
|
19
|
+
exports.useThemeColor = components_ConfigProvider_hooks_themeToken_useThemeToken.useThemeColor;
|
|
29
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,38 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
id: "root",
|
|
5
|
-
parentId: "root",
|
|
6
|
-
theme: {
|
|
7
|
-
colorMode: "light",
|
|
8
|
-
inherit: true,
|
|
9
|
-
token: {
|
|
10
|
-
lightColor: {},
|
|
11
|
-
darkColor: {},
|
|
12
|
-
alwaysColor: {}
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
colorMode: "light",
|
|
16
|
-
inherit: true,
|
|
17
|
-
token: {}
|
|
18
|
-
};
|
|
19
|
-
var ConfigProviderDefaultProps = {
|
|
20
|
-
id: "root",
|
|
21
|
-
parentId: "root",
|
|
22
|
-
theme: {
|
|
23
|
-
colorMode: "light",
|
|
24
|
-
inherit: true,
|
|
25
|
-
token: {
|
|
26
|
-
lightColor: {},
|
|
27
|
-
darkColor: {},
|
|
28
|
-
alwaysColor: {}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
colorMode: "light",
|
|
32
|
-
inherit: true,
|
|
33
|
-
token: {}
|
|
34
|
-
};
|
|
3
|
+
var components_ConfigProvider_interface_index = require('../../../_chunks/C61-qTj5.js');
|
|
35
4
|
|
|
36
|
-
|
|
37
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.ConfigProviderDefaultProps = components_ConfigProvider_interface_index.ConfigProviderDefaultProps;
|
|
8
|
+
exports.defaultProps = components_ConfigProvider_interface_index.defaultProps;
|
|
38
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../_chunks/D9ngGICz.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var reactNative = require('react-native');
|
|
8
|
+
var components_Empty_interface_index = require('../../_chunks/8GiEQzJI.js');
|
|
9
|
+
var components_Empty_styles = require('./styles.js');
|
|
10
|
+
var components_Empty_hooks_useDefaultIcon = require('./hooks/useDefaultIcon.js');
|
|
11
|
+
require('@xhsreds/reds-token-next');
|
|
12
|
+
require('../ConfigProvider/hooks/ConfigCache/ConfigCache.js');
|
|
13
|
+
require('../ConfigProvider/hooks/themeToken/useThemeToken.js');
|
|
14
|
+
require('../ConfigProvider/hooks/ConfigContext/ConfigContext.js');
|
|
15
|
+
|
|
16
|
+
var Empty = function Empty(props) {
|
|
17
|
+
var _EmptyDefaultProps$pr = _rollupPluginBabelHelpers._objectSpread2(_rollupPluginBabelHelpers._objectSpread2({}, components_Empty_interface_index.EmptyDefaultProps), props),
|
|
18
|
+
description = _EmptyDefaultProps$pr.description,
|
|
19
|
+
image = _EmptyDefaultProps$pr.image,
|
|
20
|
+
action = _EmptyDefaultProps$pr.action;
|
|
21
|
+
var styles = components_Empty_styles.default();
|
|
22
|
+
var defaultImage = image || /* @__PURE__ */React.createElement(reactNative.Image, {
|
|
23
|
+
style: {
|
|
24
|
+
height: 88,
|
|
25
|
+
width: 84
|
|
26
|
+
},
|
|
27
|
+
source: {
|
|
28
|
+
uri: components_Empty_hooks_useDefaultIcon.defaultIcon["default"].image
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return /* @__PURE__ */React.createElement(reactNative.View, {
|
|
32
|
+
style: styles.container
|
|
33
|
+
}, /* @__PURE__ */React.createElement(reactNative.View, null, defaultImage), /* @__PURE__ */React.createElement(reactNative.View, {
|
|
34
|
+
style: styles.description
|
|
35
|
+
}, /* @__PURE__ */React.createElement(reactNative.Text, {
|
|
36
|
+
style: styles.descriptionText
|
|
37
|
+
}, description || "\u6682\u65E0\u6570\u636E")), action && /* @__PURE__ */React.createElement(reactNative.View, {
|
|
38
|
+
style: styles.action
|
|
39
|
+
}, action));
|
|
40
|
+
};
|
|
41
|
+
Empty.defaultProps = components_Empty_interface_index.EmptyDefaultProps;
|
|
42
|
+
|
|
43
|
+
exports.default = Empty;
|
|
44
|
+
//# sourceMappingURL=Empty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Empty.js","sources":["../../../../src/components/Empty/Empty.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, useMemo, useCallback } from \"react\";\nimport { View, Image, Text, GestureResponderEvent } from \"react-native\";\nimport { RedsEmpty, EmptyDefaultProps } from \"./interface/index\";\nimport createStyles from \"./styles\";\nimport { defaultIcon } from \"./hooks/useDefaultIcon\";\n\nconst Empty = (props: RedsEmpty) => {\n const { description, image, action } = { ...(EmptyDefaultProps as RedsEmpty), ...props };\n\n const styles = createStyles();\n\n const defaultImage = image || (\n <Image style={{ height: 88, width: 84 }} source={{ uri: defaultIcon[\"default\"].image }}></Image>\n );\n\n return (\n <View style={styles.container}>\n <View>{defaultImage}</View>\n <View style={styles.description}>\n <Text style={styles.descriptionText}>{description || \"暂无数据\"}</Text>\n </View>\n {action && <View style={styles.action}>{action}</View>}\n </View>\n );\n};\n\nEmpty.defaultProps = EmptyDefaultProps;\n\nexport default Empty;\n"],"names":["Empty","props","_EmptyDefaultProps$pr","_objectSpread","EmptyDefaultProps","description","image","action","styles","createStyles","defaultImage","React","createElement","Image","style","height","width","source","uri","defaultIcon","View","container","Text","descriptionText","defaultProps"],"mappings":";;;;;;;;;;;;;;;AAMA,IAAMA,KAAA,GAAQ,SAARA,KAAAA,CAASC,KAAqB,EAAA;EAC5B,IAAAC,qBAAA,GAAAC,wCAAA,CAAAA,wCAAA,CAAuCC,EAAAA,EAAAA,kDAAiC,GAAGH,KAAM,CAAA;IAA/EI,oCAAAA;IAAaC,KAAO,GAAAJ,qBAAA,CAAPI,KAAO;IAAAC,MAAA,GAAAL,qBAAA,CAAAK,MAAA,CAAA;AAE5B,EAAA,IAAMC,SAASC,+BAAa,EAAA,CAAA;EAE5B,IAAMC,eAAeJ,KACnB,mBAAAK,KAAA,CAAAC,aAAA,CAACC;AAAMC,IAAAA,KAAO,EAAA;AAAEC,MAAAA,QAAQ,EAAI;AAAAC,MAAAA,KAAA,EAAO,EAAA;KAAG;AAAGC,IAAAA,QAAQ;AAAEC,MAAAA,GAAA,EAAKC,kDAAY,SAAS,CAAA,CAAEb,KAAAA;AAAM,KAAA;AAAG,GAAA,CAAA,CAAA;AAG1F,EAAA,sBACGK,KAAA,CAAAC,aAAA,CAAAQ,gBAAA,EAAA;IAAKN,KAAO,EAAAN,MAAA,CAAOa,SAAAA;AAClB,GAAA,iBAAAV,KAAA,CAAAC,aAAA,CAACQ,gBAAM,EAAA,IAAA,EAAAV,YAAa,CACpB,iBAAAC,KAAA,CAAAC,aAAA,CAACQ,gBAAK,EAAA;IAAAN,KAAA,EAAON,OAAOH,WAAAA;AAClB,GAAA,iBAAAM,KAAA,CAAAC,aAAA,CAACU,gBAAK,EAAA;IAAAR,KAAA,EAAON,MAAO,CAAAe,eAAAA;AAAA,GAAA,EAAkBlB,WAAe,IAAA,0BAAO,CAC9D,CAAA,EACCE,MAAU,mBAAAI,KAAA,CAAAC,aAAA,CAACQ,gBAAK,EAAA;IAAAN,KAAA,EAAON,MAAO,CAAAD,MAAAA;GAAA,EAASA,MAAO,CACjD,CAAA,CAAA;AAEJ,EAAA;AAEAP,KAAA,CAAMwB,YAAe,GAAApB,kDAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDefaultIcon.js","sources":["../../../../../src/components/Empty/hooks/useDefaultIcon.ts"],"sourcesContent":["export const defaultIcon = {\n default: {\n image: \"https://picasso-static.xiaohongshu.com/fe-platform/fb6202b046d7ee0a1d034948c37bd5e6d97bd417.png\",\n },\n};\n"],"names":["defaultIcon","image"],"mappings":";;AAAO,IAAMA,WAAc,GAAA;EACzB,SAAS,EAAA;AACPC,IAAAA,KAAO,EAAA,iGAAA;AACT,GAAA;AACF;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var components_Empty_Empty = require('./Empty.js');
|
|
6
|
+
var components_Empty_interface_index = require('../../_chunks/8GiEQzJI.js');
|
|
7
|
+
require('../../_chunks/D9ngGICz.js');
|
|
8
|
+
require('react');
|
|
9
|
+
require('react-native');
|
|
10
|
+
require('./styles.js');
|
|
11
|
+
require('@xhsreds/reds-token-next');
|
|
12
|
+
require('../ConfigProvider/hooks/ConfigCache/ConfigCache.js');
|
|
13
|
+
require('../ConfigProvider/hooks/themeToken/useThemeToken.js');
|
|
14
|
+
require('../ConfigProvider/hooks/ConfigContext/ConfigContext.js');
|
|
15
|
+
require('./hooks/useDefaultIcon.js');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
exports.Empty = components_Empty_Empty.default;
|
|
20
|
+
exports.default = components_Empty_Empty.default;
|
|
21
|
+
exports.EmptyType = components_Empty_interface_index.index;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var redsTokenNext = require('@xhsreds/reds-token-next');
|
|
6
|
+
var reactNative = require('react-native');
|
|
7
|
+
require('../ConfigProvider/hooks/ConfigCache/ConfigCache.js');
|
|
8
|
+
require('react');
|
|
9
|
+
var components_ConfigProvider_hooks_themeToken_useThemeToken = require('../ConfigProvider/hooks/themeToken/useThemeToken.js');
|
|
10
|
+
require('../../_chunks/D9ngGICz.js');
|
|
11
|
+
require('../ConfigProvider/hooks/ConfigContext/ConfigContext.js');
|
|
12
|
+
|
|
13
|
+
var createStyles = function createStyles() {
|
|
14
|
+
var themeColor = components_ConfigProvider_hooks_themeToken_useThemeToken.useThemeColor("Empty");
|
|
15
|
+
var styles = reactNative.StyleSheet.create({
|
|
16
|
+
container: {
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
paddingHorizontal: 48,
|
|
19
|
+
paddingVertical: 24
|
|
20
|
+
},
|
|
21
|
+
description: {
|
|
22
|
+
marginTop: 16
|
|
23
|
+
},
|
|
24
|
+
descriptionText: {
|
|
25
|
+
fontSize: redsTokenNext.typography.B2LooseFontSize,
|
|
26
|
+
fontWeight: redsTokenNext.typography.B2LooseFontWeight,
|
|
27
|
+
lineHeight: redsTokenNext.typography.B2LineHeight,
|
|
28
|
+
color: themeColor.Description
|
|
29
|
+
},
|
|
30
|
+
action: {
|
|
31
|
+
marginTop: 20
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return styles;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.default = createStyles;
|
|
38
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Empty/styles.ts"],"sourcesContent":["import { typography } from \"@xhsreds/reds-token-next\";\nimport { StyleSheet } from \"react-native\";\nimport { useThemeColor } from \"../ConfigProvider\";\n\nconst createStyles = () => {\n const themeColor = useThemeColor(\"Empty\");\n const styles = StyleSheet.create({\n container: {\n alignItems: \"center\",\n paddingHorizontal: 48,\n paddingVertical: 24,\n },\n description: {\n marginTop: 16,\n },\n descriptionText: {\n fontSize: typography.B2LooseFontSize,\n fontWeight: typography.B2LooseFontWeight,\n lineHeight: typography.B2LineHeight,\n color: themeColor.Description,\n },\n action: {\n marginTop: 20,\n },\n });\n return styles;\n};\n\nexport default createStyles;\n"],"names":["createStyles","themeColor","useThemeColor","styles","StyleSheet","create","container","alignItems","paddingHorizontal","paddingVertical","description","marginTop","descriptionText","fontSize","typography","B2LooseFontSize","fontWeight","B2LooseFontWeight","lineHeight","B2LineHeight","color","Description","action"],"mappings":";;;;;;;;;;;;AAIA,IAAMA,eAAe,SAAfA,eAAqB;AACnB,EAAA,IAAAC,UAAA,GAAaC,uEAAc,OAAO,CAAA,CAAA;AAClC,EAAA,IAAAC,MAAA,GAASC,uBAAWC,MAAO,CAAA;AAC/BC,IAAAA,SAAW,EAAA;AACTC,MAAAA,UAAY,EAAA,QAAA;AACZC,MAAAA,iBAAmB,EAAA,EAAA;AACnBC,MAAAA,eAAiB,EAAA,EAAA;KACnB;AACAC,IAAAA,WAAa,EAAA;AACXC,MAAAA,SAAW,EAAA,EAAA;KACb;AACAC,IAAAA,eAAiB,EAAA;MACfC,UAAUC,wBAAW,CAAAC,eAAA;MACrBC,YAAYF,wBAAW,CAAAG,iBAAA;MACvBC,YAAYJ,wBAAW,CAAAK,YAAA;MACvBC,OAAOnB,UAAW,CAAAoB,WAAAA;KACpB;AACAC,IAAAA,MAAQ,EAAA;AACNX,MAAAA,SAAW,EAAA,EAAA;AACb,KAAA;AACF,GAAC,CAAA,CAAA;AACM,EAAA,OAAAR,MAAA,CAAA;AACT;;;;"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../_chunks/D9ngGICz.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var reactNative = require('react-native');
|
|
8
|
+
var components_Image_interface_index = require('../../_chunks/zrKJYx9X.js');
|
|
9
|
+
var components_Image_styles = require('./styles.js');
|
|
10
|
+
var components_Image_hook_index = require('./hook/index.js');
|
|
11
|
+
var components_Image_CircularProgress = require('./CircularProgress.js');
|
|
12
|
+
require('@xhsreds/reds-token-next');
|
|
13
|
+
require('react-native-svg');
|
|
14
|
+
|
|
15
|
+
var _excluded = ["src", "source", "width", "height", "borderRadius", "errorStyle", "loadStyle", "style"];
|
|
16
|
+
var Image = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
17
|
+
var src = _ref.src,
|
|
18
|
+
_source = _ref.source,
|
|
19
|
+
width = _ref.width,
|
|
20
|
+
height = _ref.height,
|
|
21
|
+
borderRadius = _ref.borderRadius,
|
|
22
|
+
errorStyle = _ref.errorStyle,
|
|
23
|
+
loadStyle = _ref.loadStyle,
|
|
24
|
+
style = _ref.style,
|
|
25
|
+
props = _rollupPluginBabelHelpers._objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
var _useState = React.useState(components_Image_interface_index.IMAGE_STATUS.LOADING),
|
|
27
|
+
_useState2 = _rollupPluginBabelHelpers._slicedToArray(_useState, 2),
|
|
28
|
+
imageStatus = _useState2[0],
|
|
29
|
+
setImageStatus = _useState2[1];
|
|
30
|
+
var _useState3 = React.useState(0),
|
|
31
|
+
_useState4 = _rollupPluginBabelHelpers._slicedToArray(_useState3, 2),
|
|
32
|
+
progress = _useState4[0],
|
|
33
|
+
setProgress = _useState4[1];
|
|
34
|
+
var _useImage = components_Image_hook_index.useImage({
|
|
35
|
+
src: src,
|
|
36
|
+
source: _source,
|
|
37
|
+
errorStyle: errorStyle,
|
|
38
|
+
loadStyle: loadStyle
|
|
39
|
+
}),
|
|
40
|
+
source = _useImage.source,
|
|
41
|
+
aveColor = _useImage.aveColor,
|
|
42
|
+
blurSource = _useImage.blurSource;
|
|
43
|
+
var onProgress = function onProgress(e) {
|
|
44
|
+
var _props$onProgress;
|
|
45
|
+
var _e$nativeEvent = e.nativeEvent,
|
|
46
|
+
total = _e$nativeEvent.total,
|
|
47
|
+
loaded = _e$nativeEvent.loaded;
|
|
48
|
+
if (total) {
|
|
49
|
+
setProgress(loaded / total * 100 | 0);
|
|
50
|
+
}
|
|
51
|
+
(_props$onProgress = props.onProgress) === null || _props$onProgress === void 0 || _props$onProgress.call(props, e);
|
|
52
|
+
};
|
|
53
|
+
var onLoad = function onLoad(e) {
|
|
54
|
+
var _props$onLoad;
|
|
55
|
+
(_props$onLoad = props.onLoad) === null || _props$onLoad === void 0 || _props$onLoad.call(props, e);
|
|
56
|
+
setImageStatus(components_Image_interface_index.IMAGE_STATUS.LOADED);
|
|
57
|
+
};
|
|
58
|
+
var onError = function onError(e) {
|
|
59
|
+
var _props$onError;
|
|
60
|
+
(_props$onError = props.onError) === null || _props$onError === void 0 || _props$onError.call(props, e);
|
|
61
|
+
setImageStatus(errorStyle === components_Image_interface_index.TErrorStyle.ERROR ? components_Image_interface_index.IMAGE_STATUS.LOADERROR : components_Image_interface_index.IMAGE_STATUS.RELOAD);
|
|
62
|
+
};
|
|
63
|
+
var onReload = function onReload(e) {
|
|
64
|
+
var _props$onReload;
|
|
65
|
+
setImageStatus(components_Image_interface_index.IMAGE_STATUS.HIDE);
|
|
66
|
+
(_props$onReload = props.onReload) === null || _props$onReload === void 0 || _props$onReload.call(props, e);
|
|
67
|
+
setTimeout(function () {
|
|
68
|
+
setImageStatus(components_Image_interface_index.IMAGE_STATUS.LOADING);
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
return /* @__PURE__ */React.createElement(reactNative.View, {
|
|
72
|
+
style: _rollupPluginBabelHelpers._objectSpread2({
|
|
73
|
+
borderRadius: borderRadius,
|
|
74
|
+
height: height,
|
|
75
|
+
width: width
|
|
76
|
+
}, style),
|
|
77
|
+
ref: ref
|
|
78
|
+
}, imageStatus !== components_Image_interface_index.IMAGE_STATUS.HIDE && /* @__PURE__ */React.createElement(reactNative.Image, _rollupPluginBabelHelpers._objectSpread2(_rollupPluginBabelHelpers._objectSpread2({}, props), {}, {
|
|
79
|
+
source: source,
|
|
80
|
+
onLoad: onLoad,
|
|
81
|
+
onProgress: onProgress,
|
|
82
|
+
onError: onError,
|
|
83
|
+
style: {
|
|
84
|
+
width: width,
|
|
85
|
+
height: height,
|
|
86
|
+
borderRadius: borderRadius,
|
|
87
|
+
opacity: imageStatus === components_Image_interface_index.IMAGE_STATUS.LOADED ? 1 : 0
|
|
88
|
+
}
|
|
89
|
+
})), imageStatus === components_Image_interface_index.IMAGE_STATUS.LOADING && /* @__PURE__ */React.createElement(reactNative.View, {
|
|
90
|
+
style: _rollupPluginBabelHelpers._objectSpread2(_rollupPluginBabelHelpers._objectSpread2({
|
|
91
|
+
width: width,
|
|
92
|
+
height: height,
|
|
93
|
+
borderRadius: borderRadius
|
|
94
|
+
}, components_Image_styles.default.loadingContainer), {}, {
|
|
95
|
+
backgroundColor: loadStyle === components_Image_interface_index.TLoadStyle.AVE ? aveColor : components_Image_styles.default.loadingContainer.backgroundColor
|
|
96
|
+
})
|
|
97
|
+
}, loadStyle === components_Image_interface_index.TLoadStyle.BLUR && /* @__PURE__ */React.createElement(reactNative.Image, {
|
|
98
|
+
source: blurSource,
|
|
99
|
+
style: {
|
|
100
|
+
width: width,
|
|
101
|
+
height: height,
|
|
102
|
+
borderRadius: borderRadius
|
|
103
|
+
}
|
|
104
|
+
}), loadStyle === components_Image_interface_index.TLoadStyle.LOADING && /* @__PURE__ */React.createElement(components_Image_CircularProgress.default, {
|
|
105
|
+
progress: progress
|
|
106
|
+
})), (imageStatus === components_Image_interface_index.IMAGE_STATUS.LOADERROR || imageStatus === components_Image_interface_index.IMAGE_STATUS.RELOAD) && /* @__PURE__ */React.createElement(reactNative.TouchableOpacity, {
|
|
107
|
+
activeOpacity: 1,
|
|
108
|
+
onPress: function onPress(e) {
|
|
109
|
+
onReload(e);
|
|
110
|
+
},
|
|
111
|
+
style: _rollupPluginBabelHelpers._objectSpread2({
|
|
112
|
+
width: width,
|
|
113
|
+
height: height,
|
|
114
|
+
borderRadius: borderRadius
|
|
115
|
+
}, components_Image_styles.default.loadingContainer)
|
|
116
|
+
}, /* @__PURE__ */React.createElement(reactNative.Image, {
|
|
117
|
+
style: {
|
|
118
|
+
width: 40,
|
|
119
|
+
height: 40
|
|
120
|
+
},
|
|
121
|
+
source: {
|
|
122
|
+
uri: imageStatus === components_Image_interface_index.IMAGE_STATUS.RELOAD ? "https://picasso-static.xiaohongshu.com/fe-platform/06ae169b310c2926e541903b828486a80fcac404.png" : "https://picasso-static.xiaohongshu.com/fe-platform/76fee5bba4ce3bbf3e9ff5fe1935b737bb27625a.png"
|
|
123
|
+
}
|
|
124
|
+
})));
|
|
125
|
+
});
|
|
126
|
+
Image.defaultProps = components_Image_interface_index.ImageDefaultProps;
|
|
127
|
+
var Image$1 = /*#__PURE__*/React.memo(Image);
|
|
128
|
+
|
|
129
|
+
exports.default = Image$1;
|
|
130
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.js","sources":["../../../../src/components/Image/Image.tsx"],"sourcesContent":["import React, { useState, forwardRef, memo, ForwardRefRenderFunction, useEffect } from \"react\";\nimport {\n View,\n Image as RNImage,\n GestureResponderEvent,\n ImageProps,\n TouchableOpacity,\n ImageLoadEventData,\n NativeSyntheticEvent,\n ImageErrorEventData,\n ImageProgressEventDataIOS,\n} from \"react-native\";\nimport { RedsImage, ImageDefaultProps, IMAGE_STATUS, TErrorStyle, TLoadStyle } from \"./interface/index\";\nimport styles from \"./styles\";\nimport { useImage } from \"./hook\";\nimport CircularProgress from \"./CircularProgress\";\n\nconst Image = forwardRef<RNImage, RedsImage & Omit<ImageProps, keyof RedsImage>>(\n ({ src, source: _source, width, height, borderRadius, errorStyle, loadStyle, style, ...props }, ref) => {\n const [imageStatus, setImageStatus] = useState(IMAGE_STATUS.LOADING);\n const [progress, setProgress] = useState(0);\n\n const { source, aveColor, blurSource } = useImage({\n src,\n source: _source,\n errorStyle,\n loadStyle,\n });\n\n const onProgress = (e: NativeSyntheticEvent<ImageProgressEventDataIOS>) => {\n const {\n nativeEvent: { total, loaded },\n } = e;\n if (total) {\n setProgress(((loaded / total) * 100) | 0);\n }\n props.onProgress?.(e);\n };\n const onLoad = (e: NativeSyntheticEvent<ImageLoadEventData>) => {\n props.onLoad?.(e);\n setImageStatus(IMAGE_STATUS.LOADED);\n };\n const onError = (e: NativeSyntheticEvent<ImageErrorEventData>) => {\n props.onError?.(e);\n setImageStatus(errorStyle === TErrorStyle.ERROR ? IMAGE_STATUS.LOADERROR : IMAGE_STATUS.RELOAD);\n };\n const onReload = (e: GestureResponderEvent) => {\n setImageStatus(IMAGE_STATUS.HIDE);\n props.onReload?.(e);\n setTimeout(() => {\n setImageStatus(IMAGE_STATUS.LOADING);\n });\n };\n\n return (\n <View style={{ borderRadius, height, width, ...(style as {}) }} ref={ref}>\n {imageStatus !== IMAGE_STATUS.HIDE && (\n <RNImage\n {...props}\n source={source}\n onLoad={onLoad}\n onProgress={onProgress}\n onError={onError}\n style={{\n width,\n height,\n borderRadius,\n opacity: imageStatus === IMAGE_STATUS.LOADED ? 1 : 0,\n }}\n ></RNImage>\n )}\n {imageStatus === IMAGE_STATUS.LOADING && (\n <View\n style={{\n width,\n height,\n borderRadius,\n ...styles.loadingContainer,\n backgroundColor: loadStyle === TLoadStyle.AVE ? aveColor : styles.loadingContainer.backgroundColor,\n }}\n >\n {loadStyle === TLoadStyle.BLUR && (\n <RNImage\n source={blurSource}\n style={{\n width,\n height,\n borderRadius,\n }}\n ></RNImage>\n )}\n {loadStyle === TLoadStyle.LOADING && <CircularProgress progress={progress}></CircularProgress>}\n </View>\n )}\n {(imageStatus === IMAGE_STATUS.LOADERROR || imageStatus === IMAGE_STATUS.RELOAD) && (\n <TouchableOpacity\n activeOpacity={1}\n onPress={(e) => {\n onReload(e);\n }}\n style={{ width, height, borderRadius, ...styles.loadingContainer }}\n >\n <RNImage\n style={{ width: 40, height: 40 }}\n source={{\n uri:\n imageStatus === IMAGE_STATUS.RELOAD\n ? \"https://picasso-static.xiaohongshu.com/fe-platform/06ae169b310c2926e541903b828486a80fcac404.png\"\n : \"https://picasso-static.xiaohongshu.com/fe-platform/76fee5bba4ce3bbf3e9ff5fe1935b737bb27625a.png\",\n }}\n />\n </TouchableOpacity>\n )}\n </View>\n );\n },\n);\n\nImage.defaultProps = ImageDefaultProps;\n\nexport default memo(Image);\n"],"names":["Image","forwardRef","_ref","ref","src","_source","source","width","height","borderRadius","errorStyle","loadStyle","style","props","_objectWithoutProperties","_excluded","_useState","useState","IMAGE_STATUS","LOADING","_useState2","_slicedToArray","imageStatus","setImageStatus","_useState3","_useState4","progress","setProgress","_useImage","useImage","aveColor","blurSource","onProgress","e","_props$onProgress","_e$nativeEvent","nativeEvent","total","loaded","call","onLoad","_props$onLoad","LOADED","onError","_props$onError","TErrorStyle","ERROR","LOADERROR","RELOAD","onReload","_props$onReload","HIDE","setTimeout","React","createElement","View","_objectSpread","RNImage","opacity","styles","loadingContainer","backgroundColor","TLoadStyle","AVE","BLUR","CircularProgress","TouchableOpacity","activeOpacity","onPress","uri","defaultProps","ImageDefaultProps","memo"],"mappings":";;;;;;;;;;;;;;;AAiBA,IAAMA,KAAQ,gBAAAC,gBAAA,CACZ,UAAAC,IAAA,EAAgGC,GAAQ,EAAA;AAAA,EAAA,IAArGC,GAAK,GAAAF,IAAA,CAALE,GAAK;IAAQC,eAARC,MAAA;IAAiBC,KAAO,GAAAL,IAAA,CAAPK,KAAO;IAAAC,MAAA,GAAAN,IAAA,CAAAM,MAAA;IAAQC,YAAc,GAAAP,IAAA,CAAdO,YAAc;IAAAC,UAAA,GAAAR,IAAA,CAAAQ,UAAA;IAAYC,SAAW,GAAAT,IAAA,CAAXS,SAAW;IAAAC,KAAA,GAAAV,IAAA,CAAAU,KAAA;AAAUC,IAAAA,KAAA,GAAAC,kDAAA,CAAAZ,IAAA,EAAAa,SAAA,CAAA,CAAA;AACrF,EAAA,IAAAC,SAAA,GAAsCC,cAAA,CAASC,8CAAaC,OAAO,CAAA;IAAAC,UAAA,GAAAC,wCAAA,CAAAL,SAAA,EAAA,CAAA,CAAA;AAA5DM,IAAAA,WAAa,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAAG,IAAAA,cAAc,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AAClC,EAAA,IAAAI,UAAA,GAAgCP,eAAS,CAAC,CAAA;IAAAQ,UAAA,GAAAJ,wCAAA,CAAAG,UAAA,EAAA,CAAA,CAAA;AAAnCE,IAAAA,QAAA,GAAAD,UAAA,CAAA,CAAA,CAAA;AAAUE,IAAAA,WAAW,GAAAF,UAAA,CAAA,CAAA,CAAA,CAAA;EAE5B,IAAAG,SAAA,GAAyCC,oCAAS,CAAA;AAChDzB,MAAAA,GAAA,EAAAA,GAAA;AACAE,MAAAA,MAAQ,EAAAD,OAAA;AACRK,MAA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C,CAAA,CAAA;KACZ;AACArB,IAAAA;AAASL,MAAAA,KAAA,EAAAA,KAAA;AAAOC,MAAAA,QAAAA;AAAQC,MAAAA,YAAc,EAAdA,YAAAA;KAAiBkD,EAAAA,gCAAOC,gBAAiB,CAAA;AAAA,GAAA,iBAEjEP,KAAA,CAAAC,aAAA,CAACG,iBAAA,EAAA;AACC7C,IAAAA,KAAO,EAAA;AAAEL,MAAAA,KAAO,EAAA,EAAA;AAAIC,MAAAA,QAAQ,EAAA;KAAG;AAC/BF,IAAAA,MAAQ,EAAA;MACN+D,GACE,EAAA/C,WAAA,KAAgBJ,6CAAa,CAAA8B,MAAA,GACzB,iGACA,GAAA,iGAAA;AACR,KAAA;GACF,CACF,CAEJ,CAAA,CAAA;AAEJ,CACF,CAAA,CAAA;AAEAhD,KAAA,CAAMsE,YAAe,GAAAC,kDAAA,CAAA;AAErB,cAAeC,aAAAA,WAAKxE,KAAK,CAAA;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _rollupPluginBabelHelpers = require('../../../_chunks/
|
|
3
|
+
var _rollupPluginBabelHelpers = require('../../../_chunks/D9ngGICz.js');
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var components_Image_interface_index = require('
|
|
5
|
+
var components_Image_interface_index = require('../../../_chunks/zrKJYx9X.js');
|
|
6
6
|
var redsTokenNext = require('@xhsreds/reds-token-next');
|
|
7
7
|
|
|
8
8
|
var useAveColor = function useAveColor(_ref) {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _rollupPluginBabelHelpers = require('../../_chunks/
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../_chunks/D9ngGICz.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var reactNative = require('react-native');
|
|
8
|
-
var components_Image_interface_index = require('
|
|
8
|
+
var components_Image_interface_index = require('../../_chunks/zrKJYx9X.js');
|
|
9
9
|
var components_Image_styles = require('./styles.js');
|
|
10
10
|
var components_Image_hook_index = require('./hook/index.js');
|
|
11
11
|
var components_Image_CircularProgress = require('./CircularProgress.js');
|
|
@@ -73,9 +73,9 @@ var Image = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
73
73
|
borderRadius: borderRadius,
|
|
74
74
|
height: height,
|
|
75
75
|
width: width
|
|
76
|
-
}, style)
|
|
76
|
+
}, style),
|
|
77
|
+
ref: ref
|
|
77
78
|
}, imageStatus !== components_Image_interface_index.IMAGE_STATUS.HIDE && /* @__PURE__ */React.createElement(reactNative.Image, _rollupPluginBabelHelpers._objectSpread2(_rollupPluginBabelHelpers._objectSpread2({}, props), {}, {
|
|
78
|
-
ref: ref,
|
|
79
79
|
source: source,
|
|
80
80
|
onLoad: onLoad,
|
|
81
81
|
onProgress: onProgress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Image/index.tsx"],"sourcesContent":["import React, { useState, forwardRef, memo, ForwardRefRenderFunction, useEffect } from \"react\";\nimport {\n View,\n Image as RNImage,\n GestureResponderEvent,\n ImageProps,\n TouchableOpacity,\n ImageLoadEventData,\n NativeSyntheticEvent,\n ImageErrorEventData,\n ImageProgressEventDataIOS,\n} from \"react-native\";\nimport { RedsImage, ImageDefaultProps, IMAGE_STATUS, TErrorStyle, TLoadStyle } from \"./interface/index\";\nimport styles from \"./styles\";\nimport { useImage } from \"./hook\";\nimport CircularProgress from \"./CircularProgress\";\n\nconst Image = forwardRef<RNImage, RedsImage & Omit<ImageProps, keyof RedsImage>>(\n ({ src, source: _source, width, height, borderRadius, errorStyle, loadStyle, style, ...props }, ref) => {\n const [imageStatus, setImageStatus] = useState(IMAGE_STATUS.LOADING);\n const [progress, setProgress] = useState(0);\n\n const { source, aveColor, blurSource } = useImage({\n src,\n source: _source,\n errorStyle,\n loadStyle,\n });\n\n const onProgress = (e: NativeSyntheticEvent<ImageProgressEventDataIOS>) => {\n const {\n nativeEvent: { total, loaded },\n } = e;\n if (total) {\n setProgress(((loaded / total) * 100) | 0);\n }\n props.onProgress?.(e);\n };\n const onLoad = (e: NativeSyntheticEvent<ImageLoadEventData>) => {\n props.onLoad?.(e);\n setImageStatus(IMAGE_STATUS.LOADED);\n };\n const onError = (e: NativeSyntheticEvent<ImageErrorEventData>) => {\n props.onError?.(e);\n setImageStatus(errorStyle === TErrorStyle.ERROR ? IMAGE_STATUS.LOADERROR : IMAGE_STATUS.RELOAD);\n };\n const onReload = (e: GestureResponderEvent) => {\n setImageStatus(IMAGE_STATUS.HIDE);\n props.onReload?.(e);\n setTimeout(() => {\n setImageStatus(IMAGE_STATUS.LOADING);\n });\n };\n\n return (\n <View style={{ borderRadius, height, width, ...(style as {}) }}>\n {imageStatus !== IMAGE_STATUS.HIDE && (\n <RNImage\n {...props}\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Image/index.tsx"],"sourcesContent":["import React, { useState, forwardRef, memo, ForwardRefRenderFunction, useEffect } from \"react\";\nimport {\n View,\n Image as RNImage,\n GestureResponderEvent,\n ImageProps,\n TouchableOpacity,\n ImageLoadEventData,\n NativeSyntheticEvent,\n ImageErrorEventData,\n ImageProgressEventDataIOS,\n} from \"react-native\";\nimport { RedsImage, ImageDefaultProps, IMAGE_STATUS, TErrorStyle, TLoadStyle } from \"./interface/index\";\nimport styles from \"./styles\";\nimport { useImage } from \"./hook\";\nimport CircularProgress from \"./CircularProgress\";\n\nconst Image = forwardRef<RNImage, RedsImage & Omit<ImageProps, keyof RedsImage>>(\n ({ src, source: _source, width, height, borderRadius, errorStyle, loadStyle, style, ...props }, ref) => {\n const [imageStatus, setImageStatus] = useState(IMAGE_STATUS.LOADING);\n const [progress, setProgress] = useState(0);\n\n const { source, aveColor, blurSource } = useImage({\n src,\n source: _source,\n errorStyle,\n loadStyle,\n });\n\n const onProgress = (e: NativeSyntheticEvent<ImageProgressEventDataIOS>) => {\n const {\n nativeEvent: { total, loaded },\n } = e;\n if (total) {\n setProgress(((loaded / total) * 100) | 0);\n }\n props.onProgress?.(e);\n };\n const onLoad = (e: NativeSyntheticEvent<ImageLoadEventData>) => {\n props.onLoad?.(e);\n setImageStatus(IMAGE_STATUS.LOADED);\n };\n const onError = (e: NativeSyntheticEvent<ImageErrorEventData>) => {\n props.onError?.(e);\n setImageStatus(errorStyle === TErrorStyle.ERROR ? IMAGE_STATUS.LOADERROR : IMAGE_STATUS.RELOAD);\n };\n const onReload = (e: GestureResponderEvent) => {\n setImageStatus(IMAGE_STATUS.HIDE);\n props.onReload?.(e);\n setTimeout(() => {\n setImageStatus(IMAGE_STATUS.LOADING);\n });\n };\n\n return (\n <View style={{ borderRadius, height, width, ...(style as {}) }} ref={ref}>\n {imageStatus !== IMAGE_STATUS.HIDE && (\n <RNImage\n {...props}\n source={source}\n onLoad={onLoad}\n onProgress={onProgress}\n onError={onError}\n style={{\n width,\n height,\n borderRadius,\n opacity: imageStatus === IMAGE_STATUS.LOADED ? 1 : 0,\n }}\n ></RNImage>\n )}\n {imageStatus === IMAGE_STATUS.LOADING && (\n <View\n style={{\n width,\n height,\n borderRadius,\n ...styles.loadingContainer,\n backgroundColor: loadStyle === TLoadStyle.AVE ? aveColor : styles.loadingContainer.backgroundColor,\n }}\n >\n {loadStyle === TLoadStyle.BLUR && (\n <RNImage\n source={blurSource}\n style={{\n width,\n height,\n borderRadius,\n }}\n ></RNImage>\n )}\n {loadStyle === TLoadStyle.LOADING && <CircularProgress progress={progress}></CircularProgress>}\n </View>\n )}\n {(imageStatus === IMAGE_STATUS.LOADERROR || imageStatus === IMAGE_STATUS.RELOAD) && (\n <TouchableOpacity\n activeOpacity={1}\n onPress={(e) => {\n onReload(e);\n }}\n style={{ width, height, borderRadius, ...styles.loadingContainer }}\n >\n <RNImage\n style={{ width: 40, height: 40 }}\n source={{\n uri:\n imageStatus === IMAGE_STATUS.RELOAD\n ? \"https://picasso-static.xiaohongshu.com/fe-platform/06ae169b310c2926e541903b828486a80fcac404.png\"\n : \"https://picasso-static.xiaohongshu.com/fe-platform/76fee5bba4ce3bbf3e9ff5fe1935b737bb27625a.png\",\n }}\n />\n </TouchableOpacity>\n )}\n </View>\n );\n },\n);\n\nImage.defaultProps = ImageDefaultProps;\n\nexport default memo(Image);\n"],"names":["Image","forwardRef","_ref","ref","src","_source","source","width","height","borderRadius","errorStyle","loadStyle","style","props","_objectWithoutProperties","_excluded","_useState","useState","IMAGE_STATUS","LOADING","_useState2","_slicedToArray","imageStatus","setImageStatus","_useState3","_useState4","progress","setProgress","_useImage","useImage","aveColor","blurSource","onProgress","e","_props$onProgress","_e$nativeEvent","nativeEvent","total","loaded","call","onLoad","_props$onLoad","LOADED","onError","_props$onError","TErrorStyle","ERROR","LOADERROR","RELOAD","onReload","_props$onReload","HIDE","setTimeout","React","createElement","View","_objectSpread","RNImage","opacity","styles","loadingContainer","backgroundColor","TLoadStyle","AVE","BLUR","CircularProgress","TouchableOpacity","activeOpacity","onPress","uri","defaultProps","ImageDefaultProps","memo"],"mappings":";;;;;;;;;;;;;;;AAiBA,IAAMA,KAAQ,gBAAAC,gBAAA,CACZ,UAAAC,IAAA,EAAgGC,GAAQ,EAAA;AAAA,EAAA,IAArGC,GAAK,GAAAF,IAAA,CAALE,GAAK;IAAQC,eAARC,MAAA;IAAiBC,KAAO,GAAAL,IAAA,CAAPK,KAAO;IAAAC,MAAA,GAAAN,IAAA,CAAAM,MAAA;IAAQC,YAAc,GAAAP,IAAA,CAAdO,YAAc;IAAAC,UAAA,GAAAR,IAAA,CAAAQ,UAAA;IAAYC,SAAW,GAAAT,IAAA,CAAXS,SAAW;IAAAC,KAAA,GAAAV,IAAA,CAAAU,KAAA;AAAUC,IAAAA,KAAA,GAAAC,kDAAA,CAAAZ,IAAA,EAAAa,SAAA,CAAA,CAAA;AACrF,EAAA,IAAAC,SAAA,GAAsCC,cAAA,CAASC,8CAAaC,OAAO,CAAA;IAAAC,UAA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ave";
|
|
6
|
-
TLoadStyle2["BLUR"] = "blur";
|
|
7
|
-
TLoadStyle2["NONE"] = "none";
|
|
8
|
-
return TLoadStyle2;
|
|
9
|
-
}(TLoadStyle || {});
|
|
10
|
-
var IMAGE_STATUS = /* @__PURE__ */function (IMAGE_STATUS2) {
|
|
11
|
-
IMAGE_STATUS2[IMAGE_STATUS2["LOADING"] = 0] = "LOADING";
|
|
12
|
-
IMAGE_STATUS2[IMAGE_STATUS2["LOADED"] = 1] = "LOADED";
|
|
13
|
-
IMAGE_STATUS2[IMAGE_STATUS2["LOADERROR"] = 2] = "LOADERROR";
|
|
14
|
-
IMAGE_STATUS2[IMAGE_STATUS2["RELOAD"] = 3] = "RELOAD";
|
|
15
|
-
IMAGE_STATUS2[IMAGE_STATUS2["HIDE"] = 4] = "HIDE";
|
|
16
|
-
return IMAGE_STATUS2;
|
|
17
|
-
}(IMAGE_STATUS || {});
|
|
18
|
-
var TLoadMode = /* @__PURE__ */function (TLoadMode2) {
|
|
19
|
-
TLoadMode2["LAZY"] = "lazy";
|
|
20
|
-
TLoadMode2["EAGER"] = "eager";
|
|
21
|
-
return TLoadMode2;
|
|
22
|
-
}(TLoadMode || {});
|
|
23
|
-
var TErrorStyle = /* @__PURE__ */function (TErrorStyle2) {
|
|
24
|
-
TErrorStyle2["ERROR"] = "error";
|
|
25
|
-
TErrorStyle2["RELOAD"] = "reload";
|
|
26
|
-
return TErrorStyle2;
|
|
27
|
-
}(TErrorStyle || {});
|
|
28
|
-
var ImageDefaultProps = {
|
|
29
|
-
loadStyle: "loading" /* LOADING */,
|
|
30
|
-
loadMode: "lazy" /* LAZY */,
|
|
31
|
-
errorStyle: "error" /* ERROR */
|
|
32
|
-
};
|
|
3
|
+
var components_Image_interface_index = require('../../../_chunks/zrKJYx9X.js');
|
|
33
4
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.IMAGE_STATUS = components_Image_interface_index.IMAGE_STATUS;
|
|
8
|
+
exports.ImageDefaultProps = components_Image_interface_index.ImageDefaultProps;
|
|
9
|
+
exports.TErrorStyle = components_Image_interface_index.TErrorStyle;
|
|
10
|
+
exports.TLoadMode = components_Image_interface_index.TLoadMode;
|
|
11
|
+
exports.TLoadStyle = components_Image_interface_index.TLoadStyle;
|
|
39
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|