@selfdecode/sd-component-library 4.0.100 → 4.0.102
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/lib/components/forms-v2/input-container/interfaces.d.ts +1 -0
- package/lib/components/inputs/autocomplete-input/interfaces.d.ts +1 -1
- package/lib/components/inputs/date-inputs/primary-date-input/interfaces.d.ts +3 -3
- package/lib/sd-component-library100.js +2 -2
- package/lib/sd-component-library130.js +1 -1
- package/lib/sd-component-library134.js +3 -3
- package/lib/sd-component-library135.js +1 -1
- package/lib/sd-component-library197.js +3 -3
- package/lib/sd-component-library201.js +2 -3
- package/lib/sd-component-library201.js.map +1 -1
- package/lib/sd-component-library202.js +30 -2
- package/lib/sd-component-library202.js.map +1 -1
- package/lib/sd-component-library203.js +590 -21
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +3 -599
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library210.js +21 -18
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +3 -21
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library212.js +1 -1
- package/lib/sd-component-library212.js.map +1 -1
- package/lib/sd-component-library213.js +18 -3
- package/lib/sd-component-library213.js.map +1 -1
- package/lib/sd-component-library217.js +1 -1
- package/lib/sd-component-library222.js +3 -65
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +52 -3
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +65 -3
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +3 -52
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library229.js +3 -3
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +3 -31
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +31 -19
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +19 -20
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +20 -28
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +27 -32
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +32 -128
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +129 -43
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +41 -45
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +46 -7
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +8 -3
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library240.js +2 -2
- package/lib/sd-component-library241.js +1 -1
- package/lib/sd-component-library242.js +1 -1
- package/lib/sd-component-library244.js +1 -1
- package/lib/sd-component-library245.js +1 -1
- package/lib/sd-component-library247.js +1 -1
- package/lib/sd-component-library249.js +26 -60
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library250.js +27 -41
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library251.js +74 -26
- package/lib/sd-component-library251.js.map +1 -1
- package/lib/sd-component-library268.js +122 -30
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +29 -20
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +17 -121
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library271.js +112 -109
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library281.js +2 -6
- package/lib/sd-component-library281.js.map +1 -1
- package/lib/sd-component-library282.js +2 -10
- package/lib/sd-component-library282.js.map +1 -1
- package/lib/sd-component-library283.js +70 -2
- package/lib/sd-component-library283.js.map +1 -1
- package/lib/sd-component-library284.js +102 -2
- package/lib/sd-component-library284.js.map +1 -1
- package/lib/sd-component-library285.js +105 -69
- package/lib/sd-component-library285.js.map +1 -1
- package/lib/sd-component-library286.js +9 -101
- package/lib/sd-component-library286.js.map +1 -1
- package/lib/sd-component-library287.js +6 -106
- package/lib/sd-component-library287.js.map +1 -1
- package/lib/sd-component-library290.js +1 -1
- package/lib/sd-component-library292.js +3 -3
- package/lib/sd-component-library293.js +4 -4
- package/lib/sd-component-library294.js +1 -1
- package/lib/sd-component-library295.js +3 -2
- package/lib/sd-component-library295.js.map +1 -1
- package/lib/sd-component-library296.js +3 -77
- package/lib/sd-component-library296.js.map +1 -1
- package/lib/sd-component-library297.js +3 -93
- package/lib/sd-component-library297.js.map +1 -1
- package/lib/sd-component-library298.js +2 -53
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library299.js +76 -8
- package/lib/sd-component-library299.js.map +1 -1
- package/lib/sd-component-library300.js +92 -4
- package/lib/sd-component-library300.js.map +1 -1
- package/lib/sd-component-library301.js +48 -48
- package/lib/sd-component-library301.js.map +1 -1
- package/lib/sd-component-library302.js +9 -3
- package/lib/sd-component-library302.js.map +1 -1
- package/lib/sd-component-library303.js +5 -3
- package/lib/sd-component-library303.js.map +1 -1
- package/lib/sd-component-library304.js +53 -3
- package/lib/sd-component-library304.js.map +1 -1
- package/lib/sd-component-library315.js +89 -47
- package/lib/sd-component-library315.js.map +1 -1
- package/lib/sd-component-library316.js +47 -89
- package/lib/sd-component-library316.js.map +1 -1
- package/lib/sd-component-library317.js +33 -23
- package/lib/sd-component-library317.js.map +1 -1
- package/lib/sd-component-library318.js +23 -33
- package/lib/sd-component-library318.js.map +1 -1
- package/lib/sd-component-library322.js +1 -1
- package/lib/sd-component-library49.js +1 -1
- package/lib/sd-component-library5.js +1 -1
- package/lib/sd-component-library50.js +1 -1
- package/lib/sd-component-library52.js +3 -3
- package/lib/sd-component-library59.js +16 -15
- package/lib/sd-component-library59.js.map +1 -1
- package/lib/sd-component-library6.js +1 -1
- package/lib/sd-component-library61.js +37 -35
- package/lib/sd-component-library61.js.map +1 -1
- package/lib/sd-component-library62.js +2 -2
- package/lib/sd-component-library63.js +5 -5
- package/lib/sd-component-library64.js +1 -1
- package/lib/sd-component-library65.js +1 -1
- package/lib/sd-component-library66.js +2 -2
- package/lib/sd-component-library66.js.map +1 -1
- package/lib/sd-component-library75.js +2 -2
- package/lib/sd-component-library76.js +3 -3
- package/lib/sd-component-library80.js +1 -1
- package/lib/sd-component-library87.js +6 -6
- package/lib/sd-component-library88.js +2 -2
- package/lib/sd-component-library89.js +1 -1
- package/lib/sd-component-library90.js +5 -5
- package/lib/sd-component-library91.js +1 -1
- package/lib/sd-component-library93.js +3 -3
- package/lib/sd-component-library94.js +1 -1
- package/lib/sd-component-library95.js +2 -2
- package/lib/sd-component-library96.js +1 -1
- package/lib/sd-component-library99.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library316.js","sources":["../src/components/meters/
|
|
1
|
+
{"version":3,"file":"sd-component-library316.js","sources":["../src/components/meters/smiley-meter-v2/partials/smiley-meter-range/smiley-meter-range.tsx"],"sourcesContent":["import React from \"react\";\n\nimport theme from \"../../../../../core/theme\";\nimport { LabelPointer } from \"../../../common-outline-meter-partials\";\nimport { OutlineMeterRange } from \"../../../outline-meter/partials/outline-meter-range\";\nimport { getIsHorizontal, getRangeProperties } from \"../../utils\";\nimport { SmileyMeterRangeProps as Props } from \"./interfaces\";\n\nexport const SmileyMeterRange = React.forwardRef<SVGCircleElement, Props>(\n (props, pointRef) => {\n const {\n segmented,\n diameter,\n arc,\n totalRanges,\n distanceBetweenRanges,\n start,\n end,\n idx,\n hideLabels,\n isMatchedRange,\n } = props;\n\n const needConnection = !segmented;\n\n const radius = diameter / 2;\n\n const { rangeArcMiddle: alpha } = getRangeProperties(\n arc,\n totalRanges,\n distanceBetweenRanges,\n idx,\n start,\n end\n );\n\n return (\n <>\n <OutlineMeterRange\n {...props}\n hideLabels\n connected={needConnection}\n ref={pointRef}\n />\n\n {!hideLabels && !isMatchedRange && (\n <LabelPointer\n {...props}\n radius={radius}\n color={theme.colors.cl_lightGrey}\n alpha={alpha}\n horizontal={getIsHorizontal(props)}\n />\n )}\n </>\n );\n }\n);\n"],"names":["SmileyMeterRange","React","props","pointRef","segmented","diameter","arc","totalRanges","distanceBetweenRanges","start","end","idx","hideLabels","isMatchedRange","needConnection","radius","alpha","getRangeProperties","jsxs","Fragment","jsx","OutlineMeterRange","LabelPointer","theme","getIsHorizontal"],"mappings":";;;;;;AAQO,MAAMA,IAAmBC,EAAM;AAAA,EACpC,CAACC,GAAOC,MAAa;AACb,UAAA;AAAA,MACJ,WAAAC;AAAA,MACA,UAAAC;AAAA,MACA,KAAAC;AAAA,MACA,aAAAC;AAAA,MACA,uBAAAC;AAAA,MACA,OAAAC;AAAA,MACA,KAAAC;AAAA,MACA,KAAAC;AAAA,MACA,YAAAC;AAAA,MACA,gBAAAC;AAAA,IACE,IAAAX,GAEEY,IAAiB,CAACV,GAElBW,IAASV,IAAW,GAEpB,EAAE,gBAAgBW,EAAA,IAAUC;AAAA,MAChCX;AAAA,MACAC;AAAA,MACAC;AAAA,MACAG;AAAA,MACAF;AAAA,MACAC;AAAA,IAAA;AAGF,WAEIQ,gBAAAA,EAAA,KAAAC,YAAA,EAAA,UAAA;AAAA,MAAAC,gBAAAA,EAAA;AAAA,QAACC;AAAA,QAAA;AAAA,UACE,GAAGnB;AAAA,UACJ,YAAU;AAAA,UACV,WAAWY;AAAA,UACX,KAAKX;AAAA,QAAA;AAAA,MACP;AAAA,MAEC,CAACS,KAAc,CAACC,KACfO,gBAAAA,EAAA;AAAA,QAACE;AAAA,QAAA;AAAA,UACE,GAAGpB;AAAA,UACJ,QAAAa;AAAA,UACA,OAAOQ,EAAM,OAAO;AAAA,UACpB,OAAAP;AAAA,UACA,YAAYQ,EAAgBtB,CAAK;AAAA,QAAA;AAAA,MACnC;AAAA,IAEJ,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
|
|
3
|
-
const j = (p) => {
|
|
1
|
+
import { j as t } from "./sd-component-library197.js";
|
|
2
|
+
const h = (n) => {
|
|
4
3
|
const {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
color: s,
|
|
5
|
+
innerCircleRadius: $,
|
|
6
|
+
innerCircleStrokeWidth: d,
|
|
7
|
+
dx: i,
|
|
8
|
+
dy: r,
|
|
9
|
+
radius: e,
|
|
10
|
+
tipX: l,
|
|
11
|
+
tipY: o,
|
|
12
|
+
needleWidth: c
|
|
13
|
+
} = n;
|
|
14
|
+
return /* @__PURE__ */ t.jsxs("g", { children: [
|
|
15
|
+
/* @__PURE__ */ t.jsx(
|
|
16
|
+
"path",
|
|
17
|
+
{
|
|
18
|
+
d: `M${l - i},${o - r} A${c / 2},${c / 2} 0 0,0 ${l + i},${o + r} L${e + i},${e + r} L${e - i},${e - r} Z`,
|
|
19
|
+
fill: s
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
/* @__PURE__ */ t.jsx(
|
|
23
|
+
"circle",
|
|
24
|
+
{
|
|
25
|
+
cx: e,
|
|
26
|
+
cy: e,
|
|
27
|
+
r: $ + d,
|
|
28
|
+
strokeWidth: d,
|
|
29
|
+
stroke: s,
|
|
30
|
+
fill: "white"
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] });
|
|
24
34
|
};
|
|
25
35
|
export {
|
|
26
|
-
|
|
36
|
+
h as BaseNeedle
|
|
27
37
|
};
|
|
28
38
|
//# sourceMappingURL=sd-component-library317.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library317.js","sources":["../src/components/meters/outline-meter/partials/base-
|
|
1
|
+
{"version":3,"file":"sd-component-library317.js","sources":["../src/components/meters/outline-meter/partials/base-needle/base-needle.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { BaseNeedleProps as Props } from \"./interfaces\";\n\nexport const BaseNeedle: React.FC<Props> = (props) => {\n const {\n color,\n innerCircleRadius,\n innerCircleStrokeWidth,\n dx,\n dy,\n radius,\n tipX,\n tipY,\n needleWidth,\n } = props;\n\n return (\n <g>\n <path\n d={`M${tipX - dx},${tipY - dy} A${needleWidth / 2},${\n needleWidth / 2\n } 0 0,0 ${tipX + dx},${tipY + dy} L${radius + dx},${radius + dy} L${\n radius - dx\n },${radius - dy} Z`}\n fill={color}\n />\n <circle\n cx={radius}\n cy={radius}\n r={innerCircleRadius + innerCircleStrokeWidth}\n strokeWidth={innerCircleStrokeWidth}\n stroke={color}\n fill=\"white\"\n />\n </g>\n );\n};\n"],"names":["BaseNeedle","props","color","innerCircleRadius","innerCircleStrokeWidth","dx","dy","radius","tipX","tipY","needleWidth","jsx"],"mappings":";AAIa,MAAAA,IAA8B,CAACC,MAAU;AAC9C,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,IAAAC;AAAA,IACA,IAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,aAAAC;AAAA,EACE,IAAAT;AAEJ,gCACG,KACC,EAAA,UAAA;AAAA,IAAAU,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAG,IAAIH,IAAOH,CAAE,IAAII,IAAOH,CAAE,KAAKI,IAAc,CAAC,IAC/CA,IAAc,CAChB,UAAUF,IAAOH,CAAE,IAAII,IAAOH,CAAE,KAAKC,IAASF,CAAE,IAAIE,IAASD,CAAE,KAC7DC,IAASF,CACX,IAAIE,IAASD,CAAE;AAAA,QACf,MAAMJ;AAAA,MAAA;AAAA,IACR;AAAA,IACAS,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAIJ;AAAA,QACJ,IAAIA;AAAA,QACJ,GAAGJ,IAAoBC;AAAA,QACvB,aAAaA;AAAA,QACb,QAAQF;AAAA,QACR,MAAK;AAAA,MAAA;AAAA,IACP;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
|
|
1
|
+
import { j as x } from "./sd-component-library197.js";
|
|
2
|
+
import { getInnerX as u, degToRad as r, getInnerY as i } from "./sd-component-library92.js";
|
|
3
|
+
const j = (p) => {
|
|
3
4
|
const {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"circle",
|
|
24
|
-
{
|
|
25
|
-
cx: e,
|
|
26
|
-
cy: e,
|
|
27
|
-
r: $ + d,
|
|
28
|
-
strokeWidth: d,
|
|
29
|
-
stroke: s,
|
|
30
|
-
fill: "white"
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
] });
|
|
5
|
+
startX: $,
|
|
6
|
+
startY: e,
|
|
7
|
+
endX: a,
|
|
8
|
+
endY: d,
|
|
9
|
+
radius: n,
|
|
10
|
+
color: A,
|
|
11
|
+
width: t,
|
|
12
|
+
roundStart: l = !0,
|
|
13
|
+
roundEnd: I = !0,
|
|
14
|
+
startAlpha: o,
|
|
15
|
+
endAlpha: s
|
|
16
|
+
} = p, c = s - o, m = u($, r(o), t), X = i(e, r(o), t), Y = u(a, r(s), t), h = i(d, r(s), t);
|
|
17
|
+
return /* @__PURE__ */ x.jsx(
|
|
18
|
+
"path",
|
|
19
|
+
{
|
|
20
|
+
d: `M${$},${e} A${n},${n} 0 ${c > 180 ? "1" : "0"},1 ${a},${d} ${I ? `A${t / 2},${t / 2} 0 0,1 ` : "L"}${Y},${h} A${n - t},${n - t} 0 ${c > 180 ? "1" : "0"},0 ${m},${X} ${l ? `A${t / 2},${t / 2} 0 0,1 ` : "L"}${$},${e}`,
|
|
21
|
+
fill: A
|
|
22
|
+
}
|
|
23
|
+
);
|
|
34
24
|
};
|
|
35
25
|
export {
|
|
36
|
-
|
|
26
|
+
j as BaseOutlineArc
|
|
37
27
|
};
|
|
38
28
|
//# sourceMappingURL=sd-component-library318.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library318.js","sources":["../src/components/meters/outline-meter/partials/base-
|
|
1
|
+
{"version":3,"file":"sd-component-library318.js","sources":["../src/components/meters/outline-meter/partials/base-outline-arc/base-outline-arc.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { degToRad, getInnerX, getInnerY } from \"../../utils\";\nimport { BaseOutlineArcProps as Props } from \"./interfaces\";\n\nexport const BaseOutlineArc: React.FC<Props> = (props) => {\n const {\n startX,\n startY,\n endX,\n endY,\n radius,\n color,\n width,\n roundStart = true,\n roundEnd = true,\n startAlpha,\n endAlpha,\n } = props;\n\n const arc = endAlpha - startAlpha;\n\n const startInnerX = getInnerX(startX, degToRad(startAlpha), width);\n const startInnerY = getInnerY(startY, degToRad(startAlpha), width);\n\n const endInnerX = getInnerX(endX, degToRad(endAlpha), width);\n const endInnerY = getInnerY(endY, degToRad(endAlpha), width);\n\n return (\n <path\n d={`M${startX},${startY} A${radius},${radius} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },1 ${endX},${endY} ${\n roundEnd ? `A${width / 2},${width / 2} 0 0,1 ` : \"L\"\n }${endInnerX},${endInnerY} A${radius - width},${radius - width} 0 ${\n arc > 180 ? \"1\" : \"0\"\n },0 ${startInnerX},${startInnerY} ${\n roundStart ? `A${width / 2},${width / 2} 0 0,1 ` : \"L\"\n }${startX},${startY}`}\n fill={color}\n />\n );\n};\n"],"names":["BaseOutlineArc","props","startX","startY","endX","endY","radius","color","width","roundStart","roundEnd","startAlpha","endAlpha","arc","startInnerX","getInnerX","degToRad","startInnerY","getInnerY","endInnerX","endInnerY","jsx"],"mappings":";;AAKa,MAAAA,IAAkC,CAACC,MAAU;AAClD,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,UAAAC,IAAW;AAAA,IACX,YAAAC;AAAA,IACA,UAAAC;AAAA,EACE,IAAAX,GAEEY,IAAMD,IAAWD,GAEjBG,IAAcC,EAAUb,GAAQc,EAASL,CAAU,GAAGH,CAAK,GAC3DS,IAAcC,EAAUf,GAAQa,EAASL,CAAU,GAAGH,CAAK,GAE3DW,IAAYJ,EAAUX,GAAMY,EAASJ,CAAQ,GAAGJ,CAAK,GACrDY,IAAYF,EAAUb,GAAMW,EAASJ,CAAQ,GAAGJ,CAAK;AAGzD,SAAAa,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,GAAG,IAAInB,CAAM,IAAIC,CAAM,KAAKG,CAAM,IAAIA,CAAM,MAC1CO,IAAM,MAAM,MAAM,GACpB,MAAMT,CAAI,IAAIC,CAAI,IAChBK,IAAW,IAAIF,IAAQ,CAAC,IAAIA,IAAQ,CAAC,YAAY,GACnD,GAAGW,CAAS,IAAIC,CAAS,KAAKd,IAASE,CAAK,IAAIF,IAASE,CAAK,MAC5DK,IAAM,MAAM,MAAM,GACpB,MAAMC,CAAW,IAAIG,CAAW,IAC9BR,IAAa,IAAID,IAAQ,CAAC,IAAIA,IAAQ,CAAC,YAAY,GACrD,GAAGN,CAAM,IAAIC,CAAM;AAAA,MACnB,MAAMI;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as e } from "./sd-component-library197.js";
|
|
2
|
-
import { getSelectedRangeText as l } from "./sd-component-
|
|
2
|
+
import { getSelectedRangeText as l } from "./sd-component-library283.js";
|
|
3
3
|
import { FourteenRegular as n } from "./sd-component-library145.js";
|
|
4
4
|
import { FourteenSb as p } from "./sd-component-library146.js";
|
|
5
5
|
import { BaseGridContainer as i } from "./sd-component-library36.js";
|
|
@@ -2,7 +2,7 @@ import { j as e } from "./sd-component-library197.js";
|
|
|
2
2
|
import { useRef as T, useState as q, useCallback as J } from "react";
|
|
3
3
|
import { Box as o } from "rebass";
|
|
4
4
|
import { useResize as K } from "./sd-component-library3.js";
|
|
5
|
-
import { ReactComponent as L } from "./sd-component-
|
|
5
|
+
import { ReactComponent as L } from "./sd-component-library204.js";
|
|
6
6
|
const Z = (p) => {
|
|
7
7
|
const {
|
|
8
8
|
width: x = ["100%"],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as t } from "./sd-component-library197.js";
|
|
2
|
-
import { BaseBooleanFeedback as m } from "./sd-component-
|
|
2
|
+
import { BaseBooleanFeedback as m } from "./sd-component-library210.js";
|
|
3
3
|
import { IconButton as n } from "./sd-component-library22.js";
|
|
4
|
-
import { ReactComponent as c } from "./sd-component-
|
|
5
|
-
import { ReactComponent as u } from "./sd-component-
|
|
4
|
+
import { ReactComponent as c } from "./sd-component-library211.js";
|
|
5
|
+
import { ReactComponent as u } from "./sd-component-library212.js";
|
|
6
6
|
const f = (i) => {
|
|
7
7
|
const { title: s, onPositiveFeedback: r, onNegativeFeedback: d, optionSelected: e } = i, a = (o) => /* @__PURE__ */ t.jsx(n, { onClick: o, "data-testid": "thumbs-up-button", children: /* @__PURE__ */ t.jsx(
|
|
8
8
|
c,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as n } from "./sd-component-library197.js";
|
|
2
|
-
import { InputLabel as
|
|
3
|
-
import { GridContainerV2 as
|
|
2
|
+
import { InputLabel as v } from "./sd-component-library60.js";
|
|
3
|
+
import { GridContainerV2 as z } from "./sd-component-library39.js";
|
|
4
4
|
import { BaseTextV2 as p } from "./sd-component-library139.js";
|
|
5
|
-
const
|
|
5
|
+
const k = ({
|
|
6
6
|
gap: f = "0px",
|
|
7
7
|
cursor: m = "pointer",
|
|
8
8
|
sx: d,
|
|
@@ -13,20 +13,21 @@ const W = ({
|
|
|
13
13
|
labelProps: i,
|
|
14
14
|
secondaryLabel: l = o ? "*" : void 0,
|
|
15
15
|
secondaryLabelProps: u = o ? { color: "cl_purple", fontSize: 16, lineHeight: "12px" } : void 0,
|
|
16
|
+
showErrorMessageText: r = !0,
|
|
16
17
|
errorMessage: t,
|
|
17
18
|
errorMessageProps: x,
|
|
18
|
-
bg:
|
|
19
|
-
id:
|
|
20
|
-
children:
|
|
21
|
-
...
|
|
19
|
+
bg: j = t ? "rgba(255, 0, 0, 0.05)" : "white",
|
|
20
|
+
id: _,
|
|
21
|
+
children: a,
|
|
22
|
+
...S
|
|
22
23
|
}) => /* @__PURE__ */ n.jsxs(
|
|
23
|
-
|
|
24
|
+
z,
|
|
24
25
|
{
|
|
25
26
|
width: h,
|
|
26
27
|
gap: f,
|
|
27
|
-
bg:
|
|
28
|
+
bg: j,
|
|
28
29
|
textAlign: e,
|
|
29
|
-
...
|
|
30
|
+
...S,
|
|
30
31
|
sx: {
|
|
31
32
|
position: "relative",
|
|
32
33
|
cursor: m,
|
|
@@ -36,9 +37,9 @@ const W = ({
|
|
|
36
37
|
},
|
|
37
38
|
children: [
|
|
38
39
|
c && /* @__PURE__ */ n.jsxs(
|
|
39
|
-
|
|
40
|
+
v,
|
|
40
41
|
{
|
|
41
|
-
htmlFor:
|
|
42
|
+
htmlFor: _,
|
|
42
43
|
maxWidth: "100%",
|
|
43
44
|
color: t ? "cl_red" : "cl_darkGrey",
|
|
44
45
|
fontSize: 10,
|
|
@@ -67,8 +68,8 @@ const W = ({
|
|
|
67
68
|
]
|
|
68
69
|
}
|
|
69
70
|
),
|
|
70
|
-
|
|
71
|
-
t && /* @__PURE__ */ n.jsx(
|
|
71
|
+
a,
|
|
72
|
+
r && !!t && /* @__PURE__ */ n.jsx(
|
|
72
73
|
p,
|
|
73
74
|
{
|
|
74
75
|
fontSize: "12px",
|
|
@@ -90,6 +91,6 @@ const W = ({
|
|
|
90
91
|
}
|
|
91
92
|
);
|
|
92
93
|
export {
|
|
93
|
-
|
|
94
|
+
k as InputContainer
|
|
94
95
|
};
|
|
95
96
|
//# sourceMappingURL=sd-component-library59.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library59.js","sources":["../src/components/forms-v2/input-container/input-container.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Grid } from \"../../containers\";\nimport { BaseTextV2 } from \"../../texts\";\nimport { InputLabel } from \"../input-label\";\nimport { InputContainerProps as Props } from \"./interfaces\";\n\nexport const InputContainer: React.FC<Props> = ({\n gap = \"0px\",\n cursor = \"pointer\",\n sx,\n required = false,\n textAlign = \"left\",\n width = \"240px\",\n label,\n labelProps,\n secondaryLabel = required ? \"*\" : undefined,\n secondaryLabelProps = required\n ? { color: \"cl_purple\", fontSize: 16, lineHeight: \"12px\" }\n : undefined,\n errorMessage,\n errorMessageProps,\n bg = errorMessage ? \"rgba(255, 0, 0, 0.05)\" : \"white\",\n id,\n children,\n ...props\n}) => (\n <Grid\n {...{ width, gap, bg, textAlign }}\n {...props}\n sx={{\n position: \"relative\",\n cursor,\n flexGrow: 1,\n \"> * \": !!errorMessage ? { borderBottomColor: \"cl_red\" } : {},\n ...sx,\n }}\n >\n {label && (\n <InputLabel\n htmlFor={id}\n maxWidth=\"100%\"\n color={!!errorMessage ? \"cl_red\" : \"cl_darkGrey\"}\n fontSize={10}\n fontWeight=\"600\"\n {...labelProps}\n sx={{\n letterSpacing: \"1px\",\n textTransform: \"uppercase\",\n cursor: \"default\",\n ...labelProps?.sx,\n }}\n >\n {label}\n\n {secondaryLabel && (\n <BaseTextV2\n display=\"inline-block\"\n textTransform=\"uppercase\"\n letterSpacing=\"1px\"\n color=\"cl_grey\"\n ml=\"3px\"\n {...secondaryLabelProps}\n >\n {secondaryLabel}\n </BaseTextV2>\n )}\n </InputLabel>\n )}\n\n {children}\n\n {errorMessage && (\n <BaseTextV2\n fontSize=\"12px\"\n lineHeight=\"12px\"\n color=\"cl_red\"\n maxWidth=\"100%\"\n {...errorMessageProps}\n sx={{\n position: \"absolute\",\n top: \"calc(100% + 5px)\",\n left: 0,\n cursor: \"default\",\n ...errorMessageProps?.sx,\n }}\n >\n {errorMessage}\n </BaseTextV2>\n )}\n </Grid>\n);\n"],"names":["InputContainer","gap","cursor","sx","required","textAlign","width","label","labelProps","secondaryLabel","secondaryLabelProps","errorMessage","errorMessageProps","bg","id","children","props","jsxs","Grid","InputLabel","jsx","BaseTextV2"],"mappings":";;;;AAOO,MAAMA,IAAkC,CAAC;AAAA,EAC9C,KAAAC,IAAM;AAAA,EACN,QAAAC,IAAS;AAAA,EACT,IAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ;AAAA,EACR,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,gBAAAC,IAAiBL,IAAW,MAAM;AAAA,EAClC,qBAAAM,IAAsBN,IAClB,EAAE,OAAO,aAAa,UAAU,IAAI,YAAY,OAChD,IAAA;AAAA,EACJ,
|
|
1
|
+
{"version":3,"file":"sd-component-library59.js","sources":["../src/components/forms-v2/input-container/input-container.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Grid } from \"../../containers\";\nimport { BaseTextV2 } from \"../../texts\";\nimport { InputLabel } from \"../input-label\";\nimport { InputContainerProps as Props } from \"./interfaces\";\n\nexport const InputContainer: React.FC<Props> = ({\n gap = \"0px\",\n cursor = \"pointer\",\n sx,\n required = false,\n textAlign = \"left\",\n width = \"240px\",\n label,\n labelProps,\n secondaryLabel = required ? \"*\" : undefined,\n secondaryLabelProps = required\n ? { color: \"cl_purple\", fontSize: 16, lineHeight: \"12px\" }\n : undefined,\n showErrorMessageText = true,\n errorMessage,\n errorMessageProps,\n bg = errorMessage ? \"rgba(255, 0, 0, 0.05)\" : \"white\",\n id,\n children,\n ...props\n}) => (\n <Grid\n {...{ width, gap, bg, textAlign }}\n {...props}\n sx={{\n position: \"relative\",\n cursor,\n flexGrow: 1,\n \"> * \": !!errorMessage ? { borderBottomColor: \"cl_red\" } : {},\n ...sx,\n }}\n >\n {label && (\n <InputLabel\n htmlFor={id}\n maxWidth=\"100%\"\n color={!!errorMessage ? \"cl_red\" : \"cl_darkGrey\"}\n fontSize={10}\n fontWeight=\"600\"\n {...labelProps}\n sx={{\n letterSpacing: \"1px\",\n textTransform: \"uppercase\",\n cursor: \"default\",\n ...labelProps?.sx,\n }}\n >\n {label}\n\n {secondaryLabel && (\n <BaseTextV2\n display=\"inline-block\"\n textTransform=\"uppercase\"\n letterSpacing=\"1px\"\n color=\"cl_grey\"\n ml=\"3px\"\n {...secondaryLabelProps}\n >\n {secondaryLabel}\n </BaseTextV2>\n )}\n </InputLabel>\n )}\n\n {children}\n\n {showErrorMessageText && !!errorMessage && (\n <BaseTextV2\n fontSize=\"12px\"\n lineHeight=\"12px\"\n color=\"cl_red\"\n maxWidth=\"100%\"\n {...errorMessageProps}\n sx={{\n position: \"absolute\",\n top: \"calc(100% + 5px)\",\n left: 0,\n cursor: \"default\",\n ...errorMessageProps?.sx,\n }}\n >\n {errorMessage}\n </BaseTextV2>\n )}\n </Grid>\n);\n"],"names":["InputContainer","gap","cursor","sx","required","textAlign","width","label","labelProps","secondaryLabel","secondaryLabelProps","showErrorMessageText","errorMessage","errorMessageProps","bg","id","children","props","jsxs","Grid","InputLabel","jsx","BaseTextV2"],"mappings":";;;;AAOO,MAAMA,IAAkC,CAAC;AAAA,EAC9C,KAAAC,IAAM;AAAA,EACN,QAAAC,IAAS;AAAA,EACT,IAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ;AAAA,EACR,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,gBAAAC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QAACC;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,YAAW;AAAA,UACX,OAAM;AAAA,UACN,UAAS;AAAA,UACR,GAAGT;AAAA,UACJ,IAAI;AAAA,YACF,UAAU;AAAA,YACV,KAAK;AAAA,YACL,MAAM;AAAA,YACN,QAAQ;AAAA,YACR,GAAGA,KAAA,gBAAAA,EAAmB;AAAA,UACxB;AAAA,UAEC,UAAAD;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAEJ;"}
|
|
@@ -4,7 +4,7 @@ import { Box as i, Flex as b } from "rebass";
|
|
|
4
4
|
import { isPDFFlow as v } from "./sd-component-library4.js";
|
|
5
5
|
import { SecondaryBadge as C } from "./sd-component-library9.js";
|
|
6
6
|
import { MaxFrContainer as E } from "./sd-component-library40.js";
|
|
7
|
-
import { ReactComponent as S } from "./sd-component-
|
|
7
|
+
import { ReactComponent as S } from "./sd-component-library204.js";
|
|
8
8
|
const $ = (d) => {
|
|
9
9
|
const {
|
|
10
10
|
header: s,
|
|
@@ -1,51 +1,52 @@
|
|
|
1
1
|
import { j as p } from "./sd-component-library197.js";
|
|
2
|
-
import { useState as d, useRef as
|
|
3
|
-
import { Box as
|
|
4
|
-
import { useOnClickOutside as
|
|
5
|
-
import { SecondaryTextInput as
|
|
6
|
-
import { ResultsBox as
|
|
7
|
-
function
|
|
2
|
+
import { useState as d, useRef as w, useCallback as I, useMemo as L } from "react";
|
|
3
|
+
import { Box as V } from "rebass";
|
|
4
|
+
import { useOnClickOutside as _ } from "./sd-component-library3.js";
|
|
5
|
+
import { SecondaryTextInput as $ } from "./sd-component-library78.js";
|
|
6
|
+
import { ResultsBox as A } from "./sd-component-library216.js";
|
|
7
|
+
function P(i, l, a) {
|
|
8
8
|
const o = (c) => {
|
|
9
|
-
const t = c.toLowerCase().indexOf(
|
|
9
|
+
const t = c.toLowerCase().indexOf(a.toLowerCase());
|
|
10
10
|
return t === -1 ? Number.POSITIVE_INFINITY : t;
|
|
11
11
|
};
|
|
12
|
-
return o(i) - o(
|
|
12
|
+
return o(i) - o(l);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function H(i) {
|
|
15
15
|
const {
|
|
16
|
-
label:
|
|
17
|
-
placeholder:
|
|
16
|
+
label: l,
|
|
17
|
+
placeholder: a,
|
|
18
18
|
options: o,
|
|
19
19
|
width: c,
|
|
20
20
|
onSelect: t,
|
|
21
21
|
errorMessage: x,
|
|
22
22
|
hideErrorText: R,
|
|
23
|
-
onSearch:
|
|
23
|
+
onSearch: b,
|
|
24
24
|
initialValue: h = "",
|
|
25
25
|
onFocus: m,
|
|
26
|
-
errorBackground:
|
|
26
|
+
errorBackground: O,
|
|
27
27
|
focusInput: j,
|
|
28
28
|
autoFocus: T = !1,
|
|
29
|
-
translateContent: k = !0
|
|
29
|
+
translateContent: k = !0,
|
|
30
|
+
labelSx: v
|
|
30
31
|
} = i, [s, g] = d(h), [f, y] = d(
|
|
31
32
|
() => !!h
|
|
32
|
-
), [
|
|
33
|
-
|
|
34
|
-
}, []),
|
|
35
|
-
|
|
33
|
+
), [B, S] = d(!0), C = w(null), M = I(() => {
|
|
34
|
+
S(!1);
|
|
35
|
+
}, []), E = (e) => {
|
|
36
|
+
S(!0), m == null || m(e);
|
|
36
37
|
};
|
|
37
|
-
|
|
38
|
-
const u =
|
|
38
|
+
_(C, M);
|
|
39
|
+
const u = L(() => {
|
|
39
40
|
if (s && !f)
|
|
40
41
|
return o.map((e) => ({
|
|
41
42
|
...e,
|
|
42
|
-
synonyms: e.synonyms.sort((n, r) =>
|
|
43
|
+
synonyms: e.synonyms.sort((n, r) => P(n, r, s))
|
|
43
44
|
}));
|
|
44
|
-
}, [s, o, f]),
|
|
45
|
+
}, [s, o, f]), F = I(
|
|
45
46
|
(e) => {
|
|
46
47
|
g(e);
|
|
47
48
|
const n = u.find(
|
|
48
|
-
(r) => !!r.synonyms.find((
|
|
49
|
+
(r) => !!r.synonyms.find((N) => N === e)
|
|
49
50
|
);
|
|
50
51
|
t == null || t(
|
|
51
52
|
n.value,
|
|
@@ -55,36 +56,37 @@ function G(i) {
|
|
|
55
56
|
[t, u]
|
|
56
57
|
);
|
|
57
58
|
return /* @__PURE__ */ p.jsxs(
|
|
58
|
-
|
|
59
|
+
V,
|
|
59
60
|
{
|
|
60
61
|
sx: { position: "relative", bg: "inherit", width: c },
|
|
61
|
-
ref:
|
|
62
|
+
ref: C,
|
|
62
63
|
"data-test": "autocomplete-input",
|
|
63
64
|
children: [
|
|
64
65
|
/* @__PURE__ */ p.jsx(
|
|
65
|
-
|
|
66
|
+
$,
|
|
66
67
|
{
|
|
67
68
|
onChange: (e, n) => {
|
|
68
|
-
f && (t(null), y(!1)), g(`${e}`),
|
|
69
|
+
f && (t(null), y(!1)), g(`${e}`), b(`${e}`);
|
|
69
70
|
},
|
|
70
71
|
value: s,
|
|
71
|
-
label:
|
|
72
|
-
placeholder:
|
|
72
|
+
label: l,
|
|
73
|
+
placeholder: a,
|
|
73
74
|
labelMargin: ["0"],
|
|
75
|
+
labelSx: v,
|
|
74
76
|
errorMessage: x || void 0,
|
|
75
77
|
hideErrorText: R,
|
|
76
|
-
onFocus:
|
|
78
|
+
onFocus: E,
|
|
77
79
|
focusInput: j,
|
|
78
80
|
autoFocus: T,
|
|
79
|
-
errorBackground:
|
|
81
|
+
errorBackground: O
|
|
80
82
|
}
|
|
81
83
|
),
|
|
82
|
-
u &&
|
|
83
|
-
|
|
84
|
+
u && B && /* @__PURE__ */ p.jsx(
|
|
85
|
+
A,
|
|
84
86
|
{
|
|
85
87
|
value: s,
|
|
86
88
|
results: u,
|
|
87
|
-
onSelect:
|
|
89
|
+
onSelect: F,
|
|
88
90
|
translateContent: k
|
|
89
91
|
}
|
|
90
92
|
)
|
|
@@ -93,6 +95,6 @@ function G(i) {
|
|
|
93
95
|
);
|
|
94
96
|
}
|
|
95
97
|
export {
|
|
96
|
-
|
|
98
|
+
H as AutocompleteInput
|
|
97
99
|
};
|
|
98
100
|
//# sourceMappingURL=sd-component-library61.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library61.js","sources":["../src/components/inputs/autocomplete-input/autocomplete-input.tsx"],"sourcesContent":["import React, {\n PropsWithChildren,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport { Box } from \"rebass\";\n\nimport { useOnClickOutside } from \"../../../core/custom-hooks\";\nimport { SecondaryTextInput } from \"../secondary-text-input\";\nimport { AutocompleteInputProps as Props } from \"./interfaces\";\nimport { ResultsBox } from \"./partials/results-box\";\n\n/**\n * Sort synonyms. Synonyms in which the search value appear first show up first.\n * Synonyms which do not contain the search string will come up last.\n */\nfunction compareWithValue(a: string, b: string, value: string): number {\n const getValueToCompare = (text: string) => {\n const index = text.toLowerCase().indexOf(value.toLowerCase());\n if (index === -1) return Number.POSITIVE_INFINITY;\n return index;\n };\n\n return getValueToCompare(a) - getValueToCompare(b);\n}\n\nexport function AutocompleteInput<T>(props: PropsWithChildren<Props<T>>) {\n const {\n label,\n placeholder,\n options,\n width,\n onSelect,\n errorMessage,\n hideErrorText,\n onSearch,\n initialValue = \"\",\n onFocus: handleFocus,\n errorBackground,\n focusInput,\n autoFocus = false,\n translateContent = true,\n } = props;\n const [value, setValue] = useState(initialValue);\n const [optionSelected, setOptionSelected] = useState(() =>\n Boolean(initialValue)\n );\n const [showResults, setShowResults] = useState(true);\n const ref = useRef<HTMLElement | null>(null);\n\n const onClickOutside = useCallback(() => {\n setShowResults(false);\n }, []);\n\n const onFocus: Props<T>[\"onFocus\"] = (event) => {\n setShowResults(true);\n handleFocus?.(event);\n };\n\n useOnClickOutside(ref, onClickOutside);\n\n /* Sorted list of results that match the query. */\n const matchingResults = useMemo(() => {\n if (value && !optionSelected) {\n return options.map((option) => ({\n ...option,\n synonyms: option.synonyms.sort((a, b) => compareWithValue(a, b, value)),\n }));\n }\n }, [value, options, optionSelected]);\n\n const handleSelect = useCallback(\n (newValue: string) => {\n setValue(newValue);\n const matchingResult = matchingResults!.find(\n (result) => !!result.synonyms.find((synonym) => synonym === newValue)\n )!;\n onSelect?.(\n matchingResult.value,\n matchingResult.synonyms.find((synonym) => synonym === newValue)\n );\n setOptionSelected(true);\n },\n [onSelect, matchingResults]\n );\n\n return (\n <Box\n sx={{ position: \"relative\", bg: \"inherit\", width }}\n ref={ref}\n data-test=\"autocomplete-input\"\n >\n <SecondaryTextInput\n onChange={(newValue, _) => {\n if (optionSelected) {\n onSelect(null);\n setOptionSelected(false);\n }\n setValue(`${newValue}`);\n onSearch(`${newValue}`);\n }}\n value={value}\n label={label}\n placeholder={placeholder}\n labelMargin={[\"0\"]}\n errorMessage={errorMessage ? errorMessage : undefined}\n hideErrorText={hideErrorText}\n onFocus={onFocus}\n focusInput={focusInput}\n autoFocus={autoFocus}\n errorBackground={errorBackground}\n />\n {matchingResults && showResults && (\n <ResultsBox\n value={value}\n results={matchingResults}\n onSelect={handleSelect}\n translateContent={translateContent}\n />\n )}\n </Box>\n );\n}\n"],"names":["compareWithValue","a","b","value","getValueToCompare","text","index","AutocompleteInput","props","label","placeholder","options","width","onSelect","errorMessage","hideErrorText","onSearch","initialValue","handleFocus","errorBackground","focusInput","autoFocus","translateContent","setValue","useState","optionSelected","setOptionSelected","showResults","setShowResults","ref","useRef","onClickOutside","useCallback","onFocus","event","useOnClickOutside","matchingResults","useMemo","option","handleSelect","newValue","matchingResult","result","synonym","jsxs","Box","jsx","SecondaryTextInput","_","ResultsBox"],"mappings":";;;;;;AAmBA,SAASA,EAAiBC,GAAWC,GAAWC,GAAuB;AAC/D,QAAAC,IAAoB,CAACC,MAAiB;AAC1C,UAAMC,IAAQD,EAAK,YAAA,EAAc,QAAQF,EAAM,aAAa;AAC5D,WAAIG,MAAU,KAAW,OAAO,oBACzBA;AAAA,EAAA;AAGT,SAAOF,EAAkBH,CAAC,IAAIG,EAAkBF,CAAC;AACnD;AAEO,SAASK,EAAqBC,GAAoC;AACjE,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,SAASC;AAAA,IACT,iBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,kBAAAC,IAAmB;AAAA,
|
|
1
|
+
{"version":3,"file":"sd-component-library61.js","sources":["../src/components/inputs/autocomplete-input/autocomplete-input.tsx"],"sourcesContent":["import React, {\n PropsWithChildren,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport { Box } from \"rebass\";\n\nimport { useOnClickOutside } from \"../../../core/custom-hooks\";\nimport { SecondaryTextInput } from \"../secondary-text-input\";\nimport { AutocompleteInputProps as Props } from \"./interfaces\";\nimport { ResultsBox } from \"./partials/results-box\";\n\n/**\n * Sort synonyms. Synonyms in which the search value appear first show up first.\n * Synonyms which do not contain the search string will come up last.\n */\nfunction compareWithValue(a: string, b: string, value: string): number {\n const getValueToCompare = (text: string) => {\n const index = text.toLowerCase().indexOf(value.toLowerCase());\n if (index === -1) return Number.POSITIVE_INFINITY;\n return index;\n };\n\n return getValueToCompare(a) - getValueToCompare(b);\n}\n\nexport function AutocompleteInput<T>(props: PropsWithChildren<Props<T>>) {\n const {\n label,\n placeholder,\n options,\n width,\n onSelect,\n errorMessage,\n hideErrorText,\n onSearch,\n initialValue = \"\",\n onFocus: handleFocus,\n errorBackground,\n focusInput,\n autoFocus = false,\n translateContent = true,\n labelSx,\n } = props;\n const [value, setValue] = useState(initialValue);\n const [optionSelected, setOptionSelected] = useState(() =>\n Boolean(initialValue)\n );\n const [showResults, setShowResults] = useState(true);\n const ref = useRef<HTMLElement | null>(null);\n\n const onClickOutside = useCallback(() => {\n setShowResults(false);\n }, []);\n\n const onFocus: Props<T>[\"onFocus\"] = (event) => {\n setShowResults(true);\n handleFocus?.(event);\n };\n\n useOnClickOutside(ref, onClickOutside);\n\n /* Sorted list of results that match the query. */\n const matchingResults = useMemo(() => {\n if (value && !optionSelected) {\n return options.map((option) => ({\n ...option,\n synonyms: option.synonyms.sort((a, b) => compareWithValue(a, b, value)),\n }));\n }\n }, [value, options, optionSelected]);\n\n const handleSelect = useCallback(\n (newValue: string) => {\n setValue(newValue);\n const matchingResult = matchingResults!.find(\n (result) => !!result.synonyms.find((synonym) => synonym === newValue)\n )!;\n onSelect?.(\n matchingResult.value,\n matchingResult.synonyms.find((synonym) => synonym === newValue)\n );\n setOptionSelected(true);\n },\n [onSelect, matchingResults]\n );\n\n return (\n <Box\n sx={{ position: \"relative\", bg: \"inherit\", width }}\n ref={ref}\n data-test=\"autocomplete-input\"\n >\n <SecondaryTextInput\n onChange={(newValue, _) => {\n if (optionSelected) {\n onSelect(null);\n setOptionSelected(false);\n }\n setValue(`${newValue}`);\n onSearch(`${newValue}`);\n }}\n value={value}\n label={label}\n placeholder={placeholder}\n labelMargin={[\"0\"]}\n labelSx={labelSx}\n errorMessage={errorMessage ? errorMessage : undefined}\n hideErrorText={hideErrorText}\n onFocus={onFocus}\n focusInput={focusInput}\n autoFocus={autoFocus}\n errorBackground={errorBackground}\n />\n {matchingResults && showResults && (\n <ResultsBox\n value={value}\n results={matchingResults}\n onSelect={handleSelect}\n translateContent={translateContent}\n />\n )}\n </Box>\n );\n}\n"],"names":["compareWithValue","a","b","value","getValueToCompare","text","index","AutocompleteInput","props","label","placeholder","options","width","onSelect","errorMessage","hideErrorText","onSearch","initialValue","handleFocus","errorBackground","focusInput","autoFocus","translateContent","labelSx","setValue","useState","optionSelected","setOptionSelected","showResults","setShowResults","ref","useRef","onClickOutside","useCallback","onFocus","event","useOnClickOutside","matchingResults","useMemo","option","handleSelect","newValue","matchingResult","result","synonym","jsxs","Box","jsx","SecondaryTextInput","_","ResultsBox"],"mappings":";;;;;;AAmBA,SAASA,EAAiBC,GAAWC,GAAWC,GAAuB;AAC/D,QAAAC,IAAoB,CAAC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@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as e } from "./sd-component-library197.js";
|
|
2
2
|
import { useCallback as p, useMemo as u } from "react";
|
|
3
3
|
import { Calendar as g } from "react-date-range";
|
|
4
|
-
import "./sd-component-
|
|
5
|
-
import "./sd-component-
|
|
4
|
+
import "./sd-component-library281.js";
|
|
5
|
+
import "./sd-component-library282.js";
|
|
6
6
|
import { Box as o } from "rebass";
|
|
7
7
|
import { TenSb as b } from "./sd-component-library154.js";
|
|
8
8
|
const B = (a) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as t } from "./sd-component-library197.js";
|
|
2
2
|
import { useState as v, useRef as w } from "react";
|
|
3
|
-
import "./sd-component-
|
|
4
|
-
import "./sd-component-
|
|
3
|
+
import "./sd-component-library281.js";
|
|
4
|
+
import "./sd-component-library282.js";
|
|
5
5
|
import { Box as s } from "rebass";
|
|
6
6
|
import { useBreakPoints as M, useDependantState as y } from "./sd-component-library3.js";
|
|
7
|
-
import { getStaticRanges as E } from "./sd-component-
|
|
8
|
-
import { BaseDateRangeInputMobile as O } from "./sd-component-
|
|
9
|
-
import { BaseDateRangeInputDesktop as P } from "./sd-component-
|
|
7
|
+
import { getStaticRanges as E } from "./sd-component-library283.js";
|
|
8
|
+
import { BaseDateRangeInputMobile as O } from "./sd-component-library284.js";
|
|
9
|
+
import { BaseDateRangeInputDesktop as P } from "./sd-component-library285.js";
|
|
10
10
|
const J = (n) => {
|
|
11
11
|
const {
|
|
12
12
|
color: d = "#9E1CB5",
|
|
@@ -2,7 +2,7 @@ import { j as t } from "./sd-component-library197.js";
|
|
|
2
2
|
import { useState as u } from "react";
|
|
3
3
|
import { Flex as g } from "rebass";
|
|
4
4
|
import { BaseDateInput as C } from "./sd-component-library62.js";
|
|
5
|
-
import { ReactComponent as S } from "./sd-component-
|
|
5
|
+
import { ReactComponent as S } from "./sd-component-library286.js";
|
|
6
6
|
import { Button as D } from "./sd-component-library25.js";
|
|
7
7
|
import { FrMaxContainer as b } from "./sd-component-library38.js";
|
|
8
8
|
const k = (r) => {
|
|
@@ -2,7 +2,7 @@ import { j as e } from "./sd-component-library197.js";
|
|
|
2
2
|
import { useState as I, useCallback as M, useMemo as v } from "react";
|
|
3
3
|
import { Box as F, Flex as O } from "rebass";
|
|
4
4
|
import { useBreakPoints as W } from "./sd-component-library3.js";
|
|
5
|
-
import { ReactComponent as z } from "./sd-component-
|
|
5
|
+
import { ReactComponent as z } from "./sd-component-library286.js";
|
|
6
6
|
import { BaseLabel as E } from "./sd-component-library227.js";
|
|
7
7
|
import { OutsideClickBox as J } from "./sd-component-library11.js";
|
|
8
8
|
import { BaseDateRangeInput as L } from "./sd-component-library63.js";
|
|
@@ -62,7 +62,7 @@ const K = (u) => {
|
|
|
62
62
|
rowGap: b
|
|
63
63
|
},
|
|
64
64
|
children: [
|
|
65
|
-
l
|
|
65
|
+
l && /* @__PURE__ */ e.jsx(
|
|
66
66
|
I,
|
|
67
67
|
{
|
|
68
68
|
"data-testid": "primary-date-input-label",
|
|
@@ -71,7 +71,7 @@ const K = (u) => {
|
|
|
71
71
|
height: [""],
|
|
72
72
|
m: S
|
|
73
73
|
}
|
|
74
|
-
)
|
|
74
|
+
),
|
|
75
75
|
/* @__PURE__ */ e.jsx(
|
|
76
76
|
r,
|
|
77
77
|
{
|