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