@subiz/widget-v4 4.0.78 → 4.0.81

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.
@@ -426,7 +426,7 @@ a.message_error {
426
426
  }
427
427
 
428
428
  .generic-attachment {
429
- display: inline-block;
429
+ display: flex;
430
430
  width: 100%;
431
431
  overflow: hidden;
432
432
  width: 100%;
@@ -436,6 +436,10 @@ a.message_error {
436
436
  cursor: grab;
437
437
  }
438
438
 
439
+ .generic-attachment--element-content {
440
+ flex: 1;
441
+ }
442
+
439
443
  .generic-attachment--element {
440
444
  border: 1px solid #d8d8d8;
441
445
  background: white;
@@ -443,8 +447,10 @@ a.message_error {
443
447
  overflow: hidden;
444
448
  width: 220px;
445
449
  margin-right: 10px;
446
- display: inline-block;
447
450
  vertical-align: top;
451
+ display: flex;
452
+ flex-direction: column;
453
+ flex-shrink: 0;
448
454
 
449
455
  &:last-child {
450
456
  margin-right: 0;
@@ -452,6 +458,7 @@ a.message_error {
452
458
  .generic-attachment--element-img {
453
459
  width: 100%;
454
460
  height: 150px;
461
+ object-fit: cover;
455
462
  }
456
463
 
457
464
  .url-button-attachment:first-child {
@@ -36,7 +36,8 @@ class ButtonAttachments extends _common.Com {
36
36
 
37
37
  return (0, _preact.h)(_Buttons.default, {
38
38
  store: this.props.store,
39
- buttons: buttons
39
+ buttons: buttons,
40
+ t: this.props.t
40
41
  });
41
42
  }
42
43
 
@@ -183,7 +183,8 @@ class Event extends _common.Com {
183
183
  ev: ev
184
184
  }), (0, _preact.h)(_ButtonAttachments.default, {
185
185
  store: this.props.store,
186
- ev: ev
186
+ ev: ev,
187
+ t: this.props.t
187
188
  }), (0, _preact.h)(_FormAttachments.default, {
188
189
  store: this.props.store,
189
190
  onSubmit: this.props.onFormSubmit,
@@ -273,7 +274,8 @@ class Event extends _common.Com {
273
274
  ev: ev
274
275
  }), (0, _preact.h)(_ButtonAttachments.default, {
275
276
  store: this.props.store,
276
- ev: ev
277
+ ev: ev,
278
+ t: this.props.t
277
279
  }), (0, _preact.h)(_FormAttachments.default, {
278
280
  store: this.props.store,
279
281
  onSubmit: this.props.onFormSubmit,
@@ -34,7 +34,10 @@ class GenericTemplateAttachments extends _common.Com {
34
34
  this.setState({
35
35
  focusing: eleindex
36
36
  });
37
- this.galleryRef.current.scrollLeft = 190 * eleindex - 20;
37
+ this.galleryRef.current.scrollTo({
38
+ left: 220 * eleindex,
39
+ behavior: 'smooth'
40
+ });
38
41
  }
39
42
 
40
43
  render() {
@@ -64,7 +67,9 @@ class GenericTemplateAttachments extends _common.Com {
64
67
  alt: "generic attachment element",
65
68
  class: "generic-attachment--element-img",
66
69
  src: this.props.store.replaceFileUrl(ele.image_url)
67
- })), $title, $subtitle, (0, _preact.h)(_Buttons.default, {
70
+ })), (0, _preact.h)("div", {
71
+ class: "generic-attachment--element-content"
72
+ }, $title, $subtitle), (0, _preact.h)(_Buttons.default, {
68
73
  buttons: ele.buttons,
69
74
  onSelect: button => this.props.onSelect(button),
70
75
  t: this.props.t
@@ -1012,6 +1012,16 @@ class Popup extends _common.Com {
1012
1012
  if (com.type === 'image') return this.renderImageComponent(com, i);
1013
1013
  });
1014
1014
 
1015
+ let formComponents = _index.default.filter(page.components, com => com.type !== 'image');
1016
+
1017
+ if (!formComponents.length) {
1018
+ formcss.background = 'transparent';
1019
+ formcss.padding_top = '0';
1020
+ formcss.padding_bottom = '0';
1021
+ formcss.padding_left = '0';
1022
+ formcss.padding_right = '0';
1023
+ }
1024
+
1015
1025
  return (0, _preact.h)("div", {
1016
1026
  class: "overlay",
1017
1027
  style: overlaystyle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subiz/widget-v4",
3
- "version": "4.0.78",
3
+ "version": "4.0.81",
4
4
  "main": "./compiled_src/lib.js",
5
5
  "scripts": {
6
6
  "dev": "npx webpack serve --config webpack.dev.js",
@@ -21,6 +21,6 @@ export default class ButtonAttachments extends Com {
21
21
  sb.each(sb.get(att, 'buttons') || [], btn => buttons.push(btn))
22
22
  })
23
23
 
24
- return <Buttons store={this.props.store} buttons={buttons} />
24
+ return <Buttons store={this.props.store} buttons={buttons} t={this.props.t}/>
25
25
  }
26
26
  }
@@ -130,7 +130,7 @@ export default class Event extends Com {
130
130
  <AudioAttachments store={this.props.store} ev={ev} />
131
131
  <VideoAttachments store={this.props.store} ev={ev} />
132
132
  <FileAttachments store={this.props.store} ev={ev} />
133
- <ButtonAttachments store={this.props.store} ev={ev} />
133
+ <ButtonAttachments store={this.props.store} ev={ev} t={this.props.t}/>
134
134
  <FormAttachments
135
135
  store={this.props.store}
136
136
  onSubmit={this.props.onFormSubmit}
@@ -182,7 +182,7 @@ export default class Event extends Com {
182
182
  <AudioAttachments store={this.props.store} ev={ev} />
183
183
  <VideoAttachments store={this.props.store} ev={ev} />
184
184
  <FileAttachments store={this.props.store} ev={ev} />
185
- <ButtonAttachments store={this.props.store} ev={ev} />
185
+ <ButtonAttachments store={this.props.store} ev={ev} t={this.props.t}/>
186
186
  <FormAttachments store={this.props.store} onSubmit={this.props.onFormSubmit} ref={this.refForm} ev={ev} />
187
187
  <ProductAttachments t={this.props.t} store={this.props.store} ev={ev} />
188
188
  <FormSubmitAttachments store={this.props.store} ev={ev} />
@@ -21,8 +21,8 @@ export default class GenericTemplateAttachments extends Com {
21
21
 
22
22
  focus(eleindex) {
23
23
  this.setState({focusing: eleindex})
24
- // this.galleryRef.current.scrollTo({ left: 190 * eleindex - 20, behavior: 'smooth' })
25
- this.galleryRef.current.scrollLeft = 190 * eleindex - 20
24
+ this.galleryRef.current.scrollTo({left: 220 * eleindex, behavior: 'smooth'})
25
+ //this.galleryRef.current.scrollLeft = 220 * eleindex - 20
26
26
  }
27
27
 
28
28
  render() {
@@ -51,8 +51,10 @@ export default class GenericTemplateAttachments extends Com {
51
51
  src={this.props.store.replaceFileUrl(ele.image_url)}
52
52
  />
53
53
  </div>
54
- {$title}
55
- {$subtitle}
54
+ <div class='generic-attachment--element-content'>
55
+ {$title}
56
+ {$subtitle}
57
+ </div>
56
58
  <Buttons buttons={ele.buttons} onSelect={(button) => this.props.onSelect(button)} t={this.props.t} />
57
59
  </div>
58
60
  )
@@ -918,6 +918,17 @@ export default class Popup extends Com {
918
918
  let $imgs = sb.map(page.components, (com, i) => {
919
919
  if (com.type === 'image') return this.renderImageComponent(com, i)
920
920
  })
921
+
922
+ // fix bug image only popup has white block
923
+ let formComponents = sb.filter(page.components, (com) => com.type !== 'image')
924
+ if (!formComponents.length) {
925
+ formcss.background = 'transparent'
926
+ formcss.padding_top = '0'
927
+ formcss.padding_bottom = '0'
928
+ formcss.padding_left = '0'
929
+ formcss.padding_right = '0'
930
+ }
931
+
921
932
  return (
922
933
  <div class='overlay' style={overlaystyle}>
923
934
  <div class={animation} style={this.js2css(containercss)} onClick={(e) => e.stopPropagation()}>