@devgateway/dvz-ui-react 1.9.3 → 1.9.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),j=require("react"),a=require("semantic-ui-react"),f=require("react-redux"),l=require("../reducers/embeddable.js"),c=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/,S=t=>{const{status:n,editing:r,"data-list":o,"data-placeholder":d="enter your email address","data-success-message":u="Thanks","data-failure-message":m="Something didn't go well","data-label":g="Send","data-tag":b}=t,[s,h]=j.useState(""),x=()=>{c.test(s)&&t.onSubmit({email:s,list:o,tag:b})};let i="";(n==="OK"||r)&&(i=e.jsx(a.Message,{success:!0,children:e.jsx("p",{children:u})})),(n==="ERROR"||r)&&(i=e.jsx(a.Message,{negative:!0,children:e.jsx("p",{children:m})}));const p=c.test(s);return e.jsxs("div",{className:"viz newsLetter",children:[e.jsxs("div",{className:"viz newsLetter form",children:[e.jsx(a.Input,{icon:"envelope",name:"email",value:s,onChange:(w,v)=>h(v.value),iconPosition:"left",placeholder:d}),e.jsx(a.Button,{disabled:!p,primary:!0,onClick:w=>x(),children:g})]}),i]})},R=(t,n)=>({status:t.getIn(["embeddable","newsletter","status"]),email:t.getIn(["embeddable","newsletter","email"])}),q={onSubmit:l.newsletterSubscription,onChange:l.setEmail},C=f.connect(R,q)(S);exports.default=C;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),q=require("react"),n=require("semantic-ui-react"),T=require("react-redux"),d=require("../reducers/embeddable.js"),u=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/,y=t=>{const{status:i,editing:r,"data-list":m,list:g,"data-placeholder":p="enter your email address","data-success-message":b="Thanks","data-failure-message":h="Something didn't go well","data-label":x="Send","data-tag":w,tag:f}=t,o=m??g,c=w??f,[s,v]=q.useState(""),j=()=>{if(!u.test(s))return;const a={email:s};o!=null&&(a.list=o),c!=null&&(a.tag=c),t.onSubmit(a)};let l="";(i==="OK"||r)&&(l=e.jsx(n.Message,{success:!0,children:e.jsx("p",{children:b})})),(i==="ERROR"||r)&&(l=e.jsx(n.Message,{negative:!0,children:e.jsx("p",{children:h})}));const S=u.test(s);return e.jsxs("div",{className:"viz newsLetter",children:[e.jsxs("div",{className:"viz newsLetter form",children:[e.jsx(n.Input,{icon:"envelope",name:"email",value:s,onChange:(a,R)=>v(R.value),iconPosition:"left",placeholder:p}),e.jsx(n.Button,{disabled:!S,primary:!0,onClick:j,children:x})]}),l]})},C=(t,i)=>({status:t.getIn(["embeddable","newsletter","status"]),email:t.getIn(["embeddable","newsletter","email"])}),I={onSubmit:d.newsletterSubscription,onChange:d.setEmail},L=T.connect(C,I)(y);exports.default=L;
@@ -1,48 +1,52 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import S from "react";
3
- import { Input as x, Button as C, Message as o } from "semantic-ui-react";
4
- import { connect as I } from "react-redux";
5
- import { setEmail as R, newsletterSubscription as E } from "../reducers/embeddable.js";
6
- const l = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/, P = (t) => {
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import L from "react";
3
+ import { Input as R, Button as T, Message as d } from "semantic-ui-react";
4
+ import { connect as y } from "react-redux";
5
+ import { setEmail as E, newsletterSubscription as P } from "../reducers/embeddable.js";
6
+ const m = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/, j = (t) => {
7
7
  const {
8
- status: a,
9
- editing: i,
10
- "data-list": m,
11
- "data-placeholder": c = "enter your email address",
12
- "data-success-message": d = "Thanks",
13
- "data-failure-message": u = "Something didn't go well",
14
- "data-label": p = "Send",
15
- "data-tag": g
16
- } = t, [s, f] = S.useState(""), h = () => {
17
- l.test(s) && t.onSubmit({ email: s, list: m, tag: g });
8
+ status: n,
9
+ editing: l,
10
+ "data-list": u,
11
+ list: p,
12
+ "data-placeholder": g = "enter your email address",
13
+ "data-success-message": f = "Thanks",
14
+ "data-failure-message": h = "Something didn't go well",
15
+ "data-label": w = "Send",
16
+ "data-tag": b,
17
+ tag: v
18
+ } = t, o = u ?? p, r = b ?? v, [s, S] = L.useState(""), x = () => {
19
+ if (!m.test(s)) return;
20
+ const a = { email: s };
21
+ o != null && (a.list = o), r != null && (a.tag = r), t.onSubmit(a);
18
22
  };
19
- let n = "";
20
- (a === "OK" || i) && (n = /* @__PURE__ */ e(o, { success: !0, children: /* @__PURE__ */ e("p", { children: d }) })), (a === "ERROR" || i) && (n = /* @__PURE__ */ e(o, { negative: !0, children: /* @__PURE__ */ e("p", { children: u }) }));
21
- const w = l.test(s);
22
- return /* @__PURE__ */ r("div", { className: "viz newsLetter", children: [
23
- /* @__PURE__ */ r("div", { className: "viz newsLetter form", children: [
23
+ let i = "";
24
+ (n === "OK" || l) && (i = /* @__PURE__ */ e(d, { success: !0, children: /* @__PURE__ */ e("p", { children: f }) })), (n === "ERROR" || l) && (i = /* @__PURE__ */ e(d, { negative: !0, children: /* @__PURE__ */ e("p", { children: h }) }));
25
+ const C = m.test(s);
26
+ return /* @__PURE__ */ c("div", { className: "viz newsLetter", children: [
27
+ /* @__PURE__ */ c("div", { className: "viz newsLetter form", children: [
24
28
  /* @__PURE__ */ e(
25
- x,
29
+ R,
26
30
  {
27
31
  icon: "envelope",
28
32
  name: "email",
29
33
  value: s,
30
- onChange: (b, v) => f(v.value),
34
+ onChange: (a, I) => S(I.value),
31
35
  iconPosition: "left",
32
- placeholder: c
36
+ placeholder: g
33
37
  }
34
38
  ),
35
- /* @__PURE__ */ e(C, { disabled: !w, primary: !0, onClick: (b) => h(), children: p })
39
+ /* @__PURE__ */ e(T, { disabled: !C, primary: !0, onClick: x, children: w })
36
40
  ] }),
37
- n
41
+ i
38
42
  ] });
39
- }, j = (t, a) => ({
43
+ }, k = (t, n) => ({
40
44
  status: t.getIn(["embeddable", "newsletter", "status"]),
41
45
  email: t.getIn(["embeddable", "newsletter", "email"])
42
- }), k = {
43
- onSubmit: E,
44
- onChange: R
45
- }, T = I(j, k)(P);
46
+ }), z = {
47
+ onSubmit: P,
48
+ onChange: E
49
+ }, M = y(k, z)(j);
46
50
  export {
47
- T as default
51
+ M as default
48
52
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devgateway/dvz-ui-react",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",