pb-sxp-ui 1.4.2 → 1.4.4

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.
@@ -2,7 +2,7 @@ import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../core/utils/event';
2
2
  import React, { forwardRef, memo, useEffect, useImperativeHandle, useRef, useState } from 'react';
3
3
  const FormatImage = forwardRef((props, ref) => {
4
4
  const { src, onLoad, style, className, loading, alt = 'image' } = props;
5
- const [imgSrc, setImgSrc] = useState();
5
+ const [imgSrc, setImgSrc] = useState(src);
6
6
  const imgRef = useRef(null);
7
7
  const [visible, setVisible] = useState(false);
8
8
  useImperativeHandle(ref, () => ({
@@ -28,7 +28,7 @@ const FormatImage = forwardRef((props, ref) => {
28
28
  };
29
29
  }, [src, visible]);
30
30
  return (React.createElement(React.Fragment, null,
31
- !visible && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
31
+ !visible && !imgSrc && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
32
32
  (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
33
33
  React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
34
34
  React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
@@ -238,12 +238,14 @@ declare const _default: ({
238
238
  label: string;
239
239
  name: string[];
240
240
  type: string;
241
+ initialValue: string;
241
242
  addonAfter?: undefined;
242
243
  } | {
243
244
  label: string;
244
245
  name: string[];
245
246
  type: string;
246
247
  addonAfter: string;
248
+ initialValue?: undefined;
247
249
  })[];
248
250
  })[];
249
251
  export default _default;
@@ -333,12 +333,14 @@ export default [
333
333
  {
334
334
  label: '背景色',
335
335
  name: ['props', 'swiper', 'dotsBgColor'],
336
- type: 'Color'
336
+ type: 'Color',
337
+ initialValue: 'rgba(0,0,0,.2)'
337
338
  },
338
339
  {
339
340
  label: '选中色',
340
341
  name: ['props', 'swiper', 'dotsActiveColor'],
341
- type: 'Color'
342
+ type: 'Color',
343
+ initialValue: 'rgba(0,0,0,1)'
342
344
  },
343
345
  {
344
346
  label: '底边距',
@@ -226,12 +226,14 @@ declare const _default: ({
226
226
  label: string;
227
227
  name: string[];
228
228
  type: string;
229
+ initialValue: string;
229
230
  addonAfter?: undefined;
230
231
  } | {
231
232
  label: string;
232
233
  name: string[];
233
234
  type: string;
234
235
  addonAfter: string;
236
+ initialValue?: undefined;
235
237
  })[];
236
238
  })[];
237
239
  export default _default;
@@ -316,12 +316,14 @@ export default [
316
316
  {
317
317
  label: '背景色',
318
318
  name: ['props', 'swiper', 'dotsBgColor'],
319
- type: 'Color'
319
+ type: 'Color',
320
+ initialValue: 'rgba(0,0,0,.2)'
320
321
  },
321
322
  {
322
323
  label: '选中色',
323
324
  name: ['props', 'swiper', 'dotsActiveColor'],
324
- type: 'Color'
325
+ type: 'Color',
326
+ initialValue: 'rgba(0,0,0,1)'
325
327
  },
326
328
  {
327
329
  label: '底边距',
@@ -5,7 +5,7 @@ const event_1 = tslib_1.__importStar(require("../../../core/utils/event"));
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
6
  const FormatImage = (0, react_1.forwardRef)((props, ref) => {
7
7
  const { src, onLoad, style, className, loading, alt = 'image' } = props;
8
- const [imgSrc, setImgSrc] = (0, react_1.useState)();
8
+ const [imgSrc, setImgSrc] = (0, react_1.useState)(src);
9
9
  const imgRef = (0, react_1.useRef)(null);
10
10
  const [visible, setVisible] = (0, react_1.useState)(false);
11
11
  (0, react_1.useImperativeHandle)(ref, () => ({
@@ -31,7 +31,7 @@ const FormatImage = (0, react_1.forwardRef)((props, ref) => {
31
31
  };
32
32
  }, [src, visible]);
33
33
  return (react_1.default.createElement(react_1.default.Fragment, null,
34
- !visible && react_1.default.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
34
+ !visible && !imgSrc && react_1.default.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
35
35
  (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (react_1.default.createElement("picture", null,
36
36
  react_1.default.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
37
37
  react_1.default.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
@@ -238,12 +238,14 @@ declare const _default: ({
238
238
  label: string;
239
239
  name: string[];
240
240
  type: string;
241
+ initialValue: string;
241
242
  addonAfter?: undefined;
242
243
  } | {
243
244
  label: string;
244
245
  name: string[];
245
246
  type: string;
246
247
  addonAfter: string;
248
+ initialValue?: undefined;
247
249
  })[];
248
250
  })[];
249
251
  export default _default;
@@ -335,12 +335,14 @@ exports.default = [
335
335
  {
336
336
  label: '背景色',
337
337
  name: ['props', 'swiper', 'dotsBgColor'],
338
- type: 'Color'
338
+ type: 'Color',
339
+ initialValue: 'rgba(0,0,0,.2)'
339
340
  },
340
341
  {
341
342
  label: '选中色',
342
343
  name: ['props', 'swiper', 'dotsActiveColor'],
343
- type: 'Color'
344
+ type: 'Color',
345
+ initialValue: 'rgba(0,0,0,1)'
344
346
  },
345
347
  {
346
348
  label: '底边距',
@@ -226,12 +226,14 @@ declare const _default: ({
226
226
  label: string;
227
227
  name: string[];
228
228
  type: string;
229
+ initialValue: string;
229
230
  addonAfter?: undefined;
230
231
  } | {
231
232
  label: string;
232
233
  name: string[];
233
234
  type: string;
234
235
  addonAfter: string;
236
+ initialValue?: undefined;
235
237
  })[];
236
238
  })[];
237
239
  export default _default;
@@ -318,12 +318,14 @@ exports.default = [
318
318
  {
319
319
  label: '背景色',
320
320
  name: ['props', 'swiper', 'dotsBgColor'],
321
- type: 'Color'
321
+ type: 'Color',
322
+ initialValue: 'rgba(0,0,0,.2)'
322
323
  },
323
324
  {
324
325
  label: '选中色',
325
326
  name: ['props', 'swiper', 'dotsActiveColor'],
326
- type: 'Color'
327
+ type: 'Color',
328
+ initialValue: 'rgba(0,0,0,1)'
327
329
  },
328
330
  {
329
331
  label: '底边距',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",