@jingx/lottery-components-react-jsx 1.0.9 → 1.0.11

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/dist/index.esm.js CHANGED
@@ -31613,10 +31613,6 @@ const lotteryLabelOnline = {
31613
31613
  TH: "\u1790\u17C3TH",
31614
31614
  KP: "\u1780\u17C6\u1796\u178F KP"
31615
31615
  };
31616
- const lotteryLabelVN = __spreadProps$2(__spreadValues$4({}, lotteryLabel), {
31617
- VN1: "\u1786\u17D2\u1793\u17C4\u178F\u1799\u17BD\u1793",
31618
- TN: "\u1786\u17D2\u1793\u17C4\u178F\u1799\u17BD\u1793"
31619
- });
31620
31616
  const lotteryLabel = {
31621
31617
  LEAP: "\u179B\u17B6\u1797\u1798\u17A0\u17B6\u179F\u1798\u17D2\u1794\u178F\u17D2\u178F\u17B7",
31622
31618
  VN2: "\u1798\u17A0\u17B6\u1791\u17C1\u1796",
@@ -31628,6 +31624,11 @@ const lotteryLabel = {
31628
31624
  HOSO: "\u1786\u17D2\u1793\u17C4\u178F HOSO",
31629
31625
  KP: "\u1780\u17C6\u1796\u178F KP"
31630
31626
  };
31627
+ const lotteryLabelVN = __spreadProps$2(__spreadValues$4({}, lotteryLabel), {
31628
+ VN1: "\u1786\u17D2\u1793\u17C4\u178F\u1799\u17BD\u1793",
31629
+ TN: "\u1786\u17D2\u1793\u17C4\u178F\u1799\u17BD\u1793",
31630
+ KH: "\u1786\u17D2\u1793\u17C4\u178F\u1781\u17D2\u1798\u17C2\u179A"
31631
+ });
31631
31632
  const mapBetTitle = {
31632
31633
  "NORMAL": "\u1792\u1798\u17D2\u1798\u178F\u17B6",
31633
31634
  "NORMAL_MULTIPLE": "\u1782\u17BB\u178E",
@@ -31729,6 +31730,7 @@ const THLabel = {
31729
31730
  A: "3D",
31730
31731
  B: "2D"
31731
31732
  };
31733
+ const isVNType = (lotteryType) => [lType.MC, lType.TN, lType.KH].includes(lotteryType);
31732
31734
 
31733
31735
  const TicketPrintBody = (props) => {
31734
31736
  const { item, bodyClass, is58 } = props;
@@ -32093,31 +32095,6 @@ const PrintTicket58 = (props) => {
32093
32095
  }) }) });
32094
32096
  };
32095
32097
 
32096
- const RenderTitle = ({ lotteryType, className = "", logo, isVN }) => {
32097
- let title = lotteryLabel[lotteryType];
32098
- if (logo) {
32099
- title = lotteryLabelOnline[lotteryType];
32100
- }
32101
- if (isVN) {
32102
- title = lotteryLabelVN[lotteryType];
32103
- }
32104
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
32105
- "td",
32106
- {
32107
- colSpan: "3",
32108
- className,
32109
- children: title
32110
- }
32111
- );
32112
- };
32113
-
32114
- const RenderHead$1 = ({ logo }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
32115
- logo && /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: "mr-2", style: {
32116
- width: "50px"
32117
- }, src: logo, alt: "__log__" }),
32118
- logo ? "\u1786\u17D2\u1793\u17C4\u178F\u1782\u17D2\u179A\u1794\u17CB\u1794\u17D2\u179A\u1797\u17C1\u1791" : "\u1786\u17D2\u1793\u17C4\u178F\u1795\u17D2\u179F\u1784\u179F\u17C6\u178E\u17B6\u1784"
32119
- ] });
32120
-
32121
32098
  function commonjsRequire(path) {
32122
32099
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
32123
32100
  }
@@ -37823,6 +37800,35 @@ const getDateHourKey = (date) => {
37823
37800
  const getTime = (date) => {
37824
37801
  return moment(date).format("hh:mm A");
37825
37802
  };
37803
+ const getHH = (date) => Number(moment(date).format("h"));
37804
+
37805
+ const RenderTitle = ({ lotteryType, className = "", logo, isVN, drawAt }) => {
37806
+ let title = lotteryLabel[lotteryType];
37807
+ if (logo) {
37808
+ title = lotteryLabelOnline[lotteryType];
37809
+ }
37810
+ if (isVN) {
37811
+ title = lotteryLabelVN[lotteryType];
37812
+ if (isVNType(lotteryType) && drawAt) {
37813
+ title = `${lotteryLabelVN[lotteryType]} \u1798\u17C9\u17C4\u1784${getHH(drawAt)}`;
37814
+ }
37815
+ }
37816
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
37817
+ "td",
37818
+ {
37819
+ colSpan: "3",
37820
+ className,
37821
+ children: title
37822
+ }
37823
+ );
37824
+ };
37825
+
37826
+ const RenderHead$1 = ({ logo }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
37827
+ logo && /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: "mr-2", style: {
37828
+ width: "50px"
37829
+ }, src: logo, alt: "__log__" }),
37830
+ logo ? "\u1786\u17D2\u1793\u17C4\u178F\u1782\u17D2\u179A\u1794\u17CB\u1794\u17D2\u179A\u1797\u17C1\u1791" : "\u1786\u17D2\u1793\u17C4\u178F\u1795\u17D2\u179F\u1784\u179F\u17C6\u178E\u17B6\u1784"
37831
+ ] });
37826
37832
 
37827
37833
  function ScopeHost({ className, children, style }) {
37828
37834
  const ref = useRef(null);
@@ -37852,8 +37858,9 @@ const Ticket = ({ object, lotteryType, plusCount = 1, logo, hideWaterAmount = fa
37852
37858
  /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { style: { lineHeight: "35px" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37853
37859
  RenderTitle,
37854
37860
  {
37855
- isVN,
37856
37861
  className: "text-center ticket-logo pt-2 mt-1 p-0",
37862
+ drawAt: object == null ? void 0 : object.drawAt,
37863
+ isVN,
37857
37864
  lotteryType,
37858
37865
  logo
37859
37866
  }
@@ -46848,5 +46855,5 @@ const SaryPrintAll = ({ children, list, type }) => {
46848
46855
  }
46849
46856
  };
46850
46857
 
46851
- export { KPLO, KPPostCode, Printer$1 as Printer, SCPostCode, SaryLottery, SaryPrintAll, THLabel, Ticket, TicketModal, lType, lotteryLabel, lotteryLabelOnline, lotteryLabelVN, mapBetTitle, mapLabels, mapStrPost };
46858
+ export { KPLO, KPPostCode, Printer$1 as Printer, SCPostCode, SaryLottery, SaryPrintAll, THLabel, Ticket, TicketModal, isVNType, lType, lotteryLabel, lotteryLabelOnline, lotteryLabelVN, mapBetTitle, mapLabels, mapStrPost };
46852
46859
  //# sourceMappingURL=index.esm.js.map