@thx/controls 16.0.0-alpha.27 → 16.0.0
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/esm/date/DatePicker/styles.css.js +7 -0
- package/dist/esm/date/DatePicker/styles.css.js.map +1 -0
- package/dist/esm/date/LocalDatePicker/LocalDatePicker.js +12 -60
- package/dist/esm/date/LocalDatePicker/LocalDatePicker.js.map +1 -1
- package/dist/esm/date/LocalDatePicker/MaskedDateInput.js +6 -35
- package/dist/esm/date/LocalDatePicker/MaskedDateInput.js.map +1 -1
- package/dist/esm/date/LocalMonthSelect/LocalMonthSelect.js +6 -32
- package/dist/esm/date/LocalMonthSelect/LocalMonthSelect.js.map +1 -1
- package/dist/esm/date/LocalTimePicker/LocalTimePicker.js +12 -57
- package/dist/esm/date/LocalTimePicker/LocalTimePicker.js.map +1 -1
- package/dist/esm/date/LocalTimePicker/MaskedTimeInput.js +7 -33
- package/dist/esm/date/LocalTimePicker/MaskedTimeInput.js.map +1 -1
- package/dist/esm/date/MonthDayPicker/MonthDayPicker.js +12 -57
- package/dist/esm/date/MonthDayPicker/MonthDayPicker.js.map +1 -1
- package/dist/esm/date/MonthYearPicker/MonthYearPicker.js +14 -61
- package/dist/esm/date/MonthYearPicker/MonthYearPicker.js.map +1 -1
- package/dist/esm/date/YearSelect/YearSelect.js +6 -32
- package/dist/esm/date/YearSelect/YearSelect.js.map +1 -1
- package/dist/esm/external/style-inject/dist/style-inject.es.js +29 -0
- package/dist/esm/external/style-inject/dist/style-inject.es.js.map +1 -0
- package/dist/esm/form/TForm/TForm.js +4 -4
- package/dist/esm/form/TForm/TForm.js.map +1 -1
- package/dist/esm/form/TForm/useTForm.js +5 -35
- package/dist/esm/form/TForm/useTForm.js.map +1 -1
- package/dist/esm/index.js +5 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inputs/CreditCardInput/CreditCardInput.js +3 -2
- package/dist/esm/inputs/CreditCardInput/CreditCardInput.js.map +1 -1
- package/dist/esm/inputs/CreditCardInput/CreditCardNumberInput.js +5 -35
- package/dist/esm/inputs/CreditCardInput/CreditCardNumberInput.js.map +1 -1
- package/dist/esm/inputs/CreditCardInput/styles.css.js +7 -0
- package/dist/esm/inputs/CreditCardInput/styles.css.js.map +1 -0
- package/dist/esm/inputs/MaskedInput/MaskedInput.js +5 -30
- package/dist/esm/inputs/MaskedInput/MaskedInput.js.map +1 -1
- package/dist/esm/inputs/MaskedInput/useMaskedInput.js +13 -32
- package/dist/esm/inputs/MaskedInput/useMaskedInput.js.map +1 -1
- package/dist/esm/inputs/PhoneInput/PhoneInput.js +6 -34
- package/dist/esm/inputs/PhoneInput/PhoneInput.js.map +1 -1
- package/dist/esm/inputs/RadioGroup/RadioGroup.js +6 -32
- package/dist/esm/inputs/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/inputs/Scriptel/Scriptel.js +1 -1
- package/dist/esm/inputs/Scriptel/Scriptel.js.map +1 -1
- package/dist/esm/inputs/Scriptel/ScriptelContext.js.map +1 -1
- package/dist/esm/inputs/Scriptel/scriptel/enums.js.map +1 -1
- package/dist/esm/inputs/Scriptel/scriptel/index.js.map +1 -1
- package/dist/esm/inputs/Scriptel/withScriptel.js +6 -17
- package/dist/esm/inputs/Scriptel/withScriptel.js.map +1 -1
- package/dist/esm/inputs/ScriptelInput/ScriptelInput.js +7 -10
- package/dist/esm/inputs/ScriptelInput/ScriptelInput.js.map +1 -1
- package/dist/esm/inputs/SinInput/SinInput.js +5 -35
- package/dist/esm/inputs/SinInput/SinInput.js.map +1 -1
- package/dist/esm/inputs/TableInput/DropdownCell.js +5 -34
- package/dist/esm/inputs/TableInput/DropdownCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/HoverCell.js +4 -17
- package/dist/esm/inputs/TableInput/HoverCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/MoneyCell.js +2 -1
- package/dist/esm/inputs/TableInput/MoneyCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/MoneyEditCell.js +3 -3
- package/dist/esm/inputs/TableInput/MoneyEditCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/MoneySumFooter.js +1 -0
- package/dist/esm/inputs/TableInput/MoneySumFooter.js.map +1 -1
- package/dist/esm/inputs/TableInput/StringEditCell.js +5 -24
- package/dist/esm/inputs/TableInput/StringEditCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/TableInput.js +24 -27
- package/dist/esm/inputs/TableInput/TableInput.js.map +1 -1
- package/dist/esm/inputs/TableInput/addRowOnTab.js.map +1 -1
- package/dist/esm/money/MoneyCurrencyInput/MoneyCurrencyInput.js +7 -37
- package/dist/esm/money/MoneyCurrencyInput/MoneyCurrencyInput.js.map +1 -1
- package/dist/esm/money/MoneyInput/MoneyInput.js +5 -31
- package/dist/esm/money/MoneyInput/MoneyInput.js.map +1 -1
- package/dist/esm/money/useMoneyInput.js +7 -10
- package/dist/esm/money/useMoneyInput.js.map +1 -1
- package/dist/esm/step/FormStep.js +1 -1
- package/dist/esm/step/FormStep.js.map +1 -1
- package/dist/esm/step/Step.js +1 -0
- package/dist/esm/step/Step.js.map +1 -1
- package/dist/esm/step/StepProvider.js +17 -37
- package/dist/esm/step/StepProvider.js.map +1 -1
- package/dist/esm/step/stepContext.js.map +1 -1
- package/dist/esm/step/useStep.js.map +1 -1
- package/dist/stats.html +2689 -0
- package/dist/stats.txt +94 -0
- package/dist/types/date/LocalDatePicker/LocalDatePicker.d.ts +1 -0
- package/dist/types/inputs/MaskedInput/useMaskedInput.d.ts +1 -1
- package/dist/types/inputs/Scriptel/withScriptel.d.ts +0 -1
- package/dist/types/inputs/TableInput/DropdownCell.d.ts +0 -1
- package/dist/types/inputs/TableInput/HoverCell.d.ts +0 -1
- package/dist/types/inputs/TableInput/MoneyCell.d.ts +0 -1
- package/dist/types/inputs/TableInput/MoneyEditCell.d.ts +0 -1
- package/dist/types/inputs/TableInput/MoneySumFooter.d.ts +0 -1
- package/dist/types/inputs/TableInput/StringEditCell.d.ts +0 -1
- package/package.json +9 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withScriptel.js","sources":["../../../../src/inputs/Scriptel/withScriptel.tsx"],"sourcesContent":["import {Scriptel, ScriptelProps} from './Scriptel';\n\n/**\n * A HoC that provides a connection to a Scriptel Omniscript device.\n * You can only have a single connection open at a time.\n * @param WrappedComponent\n * @return {Object}\n */\nexport function withScriptel(WrappedComponent: any, scriptelProps: ScriptelProps) {\n\treturn function withScriptelHoC(props: any) {\n\t\treturn (\n\t\t\t<Scriptel {...scriptelProps}>\n\t\t\t\t<WrappedComponent {...props} />\n\t\t\t</Scriptel>\n\t\t);\n\t};\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withScriptel.js","sources":["../../../../src/inputs/Scriptel/withScriptel.tsx"],"sourcesContent":["import {Scriptel, ScriptelProps} from './Scriptel';\n\n/**\n * A HoC that provides a connection to a Scriptel Omniscript device.\n * You can only have a single connection open at a time.\n * @param WrappedComponent\n * @return {Object}\n */\nexport function withScriptel(WrappedComponent: any, scriptelProps: ScriptelProps) {\n\treturn function withScriptelHoC(props: any) {\n\t\treturn (\n\t\t\t<Scriptel {...scriptelProps}>\n\t\t\t\t<WrappedComponent {...props} />\n\t\t\t</Scriptel>\n\t\t);\n\t};\n}\n"],"names":[],"mappings":";;;AAQO,SAAA,YAAA,CAAsB,kBAAuB,aAA8B,EAAA;AACjF,EAAA,OAAO,yBAAyB,KAAY,EAAA;AAC3C,IAAA,uBACE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAA,MAAa,GAAA,aAAA;AAAA,KAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA;AAAA,MAAqB,GAAA,KAAA;AAAA,KAAO,CAC9B,CAAA,CAAA;AAAA,GAEF,CAAA;AACD;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import React, { useContext, useState, useEffect } from 'react';
|
|
1
2
|
import debug from 'debug';
|
|
2
|
-
import { useContext, useState, useEffect } from 'react';
|
|
3
3
|
import { Button, Image } from 'semantic-ui-react';
|
|
4
4
|
import { ScriptelContext } from '../Scriptel/ScriptelContext.js';
|
|
5
5
|
|
|
@@ -10,7 +10,7 @@ function ScriptelInput(props) {
|
|
|
10
10
|
const [enterSignature, setEnterSignature] = useState(false);
|
|
11
11
|
useEffect(() => {
|
|
12
12
|
if (enterSignature) {
|
|
13
|
-
if (onChange &&
|
|
13
|
+
if (onChange && ctx?.renderImage) {
|
|
14
14
|
setEnterSignature(false);
|
|
15
15
|
if (ctx.renderImage.type === "image/svg+xml" || ctx.renderImage.type === "image/png") {
|
|
16
16
|
onChange({
|
|
@@ -28,22 +28,19 @@ function ScriptelInput(props) {
|
|
|
28
28
|
}
|
|
29
29
|
}, [ctx]);
|
|
30
30
|
if (enterSignature) {
|
|
31
|
-
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", null,
|
|
31
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", null, ctx?.isSigning ? "signing..." : "Enter a signature and click OK."), /* @__PURE__ */ React.createElement(Button, {
|
|
32
32
|
onClick: () => {
|
|
33
33
|
setEnterSignature(false);
|
|
34
34
|
},
|
|
35
35
|
color: "black",
|
|
36
|
-
loading: ctx
|
|
37
|
-
disabled: ctx
|
|
36
|
+
loading: ctx?.loading,
|
|
37
|
+
disabled: ctx?.loading
|
|
38
38
|
}, "Cancel"), /* @__PURE__ */ React.createElement(Button, {
|
|
39
39
|
size: "mini",
|
|
40
40
|
as: "a",
|
|
41
41
|
basic: true,
|
|
42
|
-
onClick: () =>
|
|
43
|
-
|
|
44
|
-
return (_a = ctx == null ? void 0 : ctx.socket.current) == null ? void 0 : _a.calibrate();
|
|
45
|
-
},
|
|
46
|
-
disabled: ctx == null ? void 0 : ctx.loading
|
|
42
|
+
onClick: () => ctx?.socket.current?.calibrate(),
|
|
43
|
+
disabled: ctx?.loading
|
|
47
44
|
}, "Calibrate"));
|
|
48
45
|
}
|
|
49
46
|
if (value && value.data) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptelInput.js","sources":["../../../../src/inputs/ScriptelInput/ScriptelInput.tsx"],"sourcesContent":["import type {ScriptelSchemaType} from '@thx/yup-types';\nimport debug from 'debug';\nimport {useContext, useEffect, useState} from 'react';\nimport {Button, Image} from 'semantic-ui-react';\nimport {ScriptelContext} from '../Scriptel/ScriptelContext';\n\nconst d = debug('thx.controls.inputs.ScriptelInput');\n\nexport interface ScriptelInputProps {\n\tvalue?: ScriptelSchemaType;\n\tonChange?: (value?: ScriptelSchemaType) => void;\n\tbuttonText?: string;\n}\n\nexport function ScriptelInput(props: ScriptelInputProps) {\n\tconst {value, onChange, buttonText = 'Enter Signature'} = props;\n\tconst ctx = useContext(ScriptelContext);\n\n\tconst [enterSignature, setEnterSignature] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (enterSignature) {\n\t\t\tif (onChange && ctx?.renderImage) {\n\t\t\t\tsetEnterSignature(false);\n\t\t\t\tif (ctx.renderImage.type === 'image/svg+xml' || ctx.renderImage.type === 'image/png') {\n\t\t\t\t\tonChange({\n\t\t\t\t\t\ttype: ctx.renderImage.type,\n\t\t\t\t\t\twidth: ctx.renderImage.width,\n\t\t\t\t\t\theight: ctx.renderImage.height,\n\t\t\t\t\t\ttimestamp: new Date(),\n\t\t\t\t\t\tdata: ctx.renderImage.data,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (onChange && !ctx) {\n\t\t\t\tonChange();\n\t\t\t}\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ctx]);\n\n\tif (enterSignature) {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<div>{ctx?.isSigning ? 'signing...' : 'Enter a signature and click OK.'}</div>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tsetEnterSignature(false);\n\t\t\t\t\t}}\n\t\t\t\t\tcolor=\"black\"\n\t\t\t\t\tloading={ctx?.loading}\n\t\t\t\t\tdisabled={ctx?.loading}\n\t\t\t\t>\n\t\t\t\t\tCancel\n\t\t\t\t</Button>\n\t\t\t\t<Button size=\"mini\" as=\"a\" basic onClick={() => ctx?.socket.current?.calibrate()} disabled={ctx?.loading}>\n\t\t\t\t\tCalibrate\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (value && value.data) {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<Image size=\"medium\" src={value.data} bordered />\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"mini\"\n\t\t\t\t\tcompact\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tsetEnterSignature(false);\n\t\t\t\t\t\tif (onChange) onChange();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\tReset\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn <Button onClick={() => setEnterSignature(true)}>{buttonText}</Button>;\n}\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"ScriptelInput.js","sources":["../../../../src/inputs/ScriptelInput/ScriptelInput.tsx"],"sourcesContent":["import type {ScriptelSchemaType} from '@thx/yup-types';\nimport debug from 'debug';\nimport {useContext, useEffect, useState} from 'react';\nimport {Button, Image} from 'semantic-ui-react';\nimport {ScriptelContext} from '../Scriptel/ScriptelContext';\n\nconst d = debug('thx.controls.inputs.ScriptelInput');\n\nexport interface ScriptelInputProps {\n\tvalue?: ScriptelSchemaType;\n\tonChange?: (value?: ScriptelSchemaType) => void;\n\tbuttonText?: string;\n}\n\nexport function ScriptelInput(props: ScriptelInputProps) {\n\tconst {value, onChange, buttonText = 'Enter Signature'} = props;\n\tconst ctx = useContext(ScriptelContext);\n\n\tconst [enterSignature, setEnterSignature] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (enterSignature) {\n\t\t\tif (onChange && ctx?.renderImage) {\n\t\t\t\tsetEnterSignature(false);\n\t\t\t\tif (ctx.renderImage.type === 'image/svg+xml' || ctx.renderImage.type === 'image/png') {\n\t\t\t\t\tonChange({\n\t\t\t\t\t\ttype: ctx.renderImage.type,\n\t\t\t\t\t\twidth: ctx.renderImage.width,\n\t\t\t\t\t\theight: ctx.renderImage.height,\n\t\t\t\t\t\ttimestamp: new Date(),\n\t\t\t\t\t\tdata: ctx.renderImage.data,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (onChange && !ctx) {\n\t\t\t\tonChange();\n\t\t\t}\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ctx]);\n\n\tif (enterSignature) {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<div>{ctx?.isSigning ? 'signing...' : 'Enter a signature and click OK.'}</div>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tsetEnterSignature(false);\n\t\t\t\t\t}}\n\t\t\t\t\tcolor=\"black\"\n\t\t\t\t\tloading={ctx?.loading}\n\t\t\t\t\tdisabled={ctx?.loading}\n\t\t\t\t>\n\t\t\t\t\tCancel\n\t\t\t\t</Button>\n\t\t\t\t<Button size=\"mini\" as=\"a\" basic onClick={() => ctx?.socket.current?.calibrate()} disabled={ctx?.loading}>\n\t\t\t\t\tCalibrate\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (value && value.data) {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<Image size=\"medium\" src={value.data} bordered />\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"mini\"\n\t\t\t\t\tcompact\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tsetEnterSignature(false);\n\t\t\t\t\t\tif (onChange) onChange();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\tReset\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn <Button onClick={() => setEnterSignature(true)}>{buttonText}</Button>;\n}\n"],"names":[],"mappings":";;;;;AAMU,MAAM,mCAAmC,EAAA;AAQ5C,SAAA,aAAA,CAAuB,KAA2B,EAAA;AACxD,EAAA,MAAM,EAAC,KAAA,EAAO,QAAU,EAAA,UAAA,GAAa,iBAAqB,EAAA,GAAA,KAAA,CAAA;AAC1D,EAAM,MAAA,GAAA,GAAM,WAAW,eAAe,CAAA,CAAA;AAEtC,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAqB,CAAA,GAAA,QAAA,CAAS,KAAK,CAAA,CAAA;AAE1D,EAAA,SAAA,CAAU,MAAM;AACf,IAAA,IAAI,cAAgB,EAAA;AACnB,MAAI,IAAA,QAAA,IAAY,KAAK,WAAa,EAAA;AACjC,QAAA,iBAAA,CAAkB,KAAK,CAAA,CAAA;AACvB,QAAA,IAAI,IAAI,WAAY,CAAA,IAAA,KAAS,mBAAmB,GAAI,CAAA,WAAA,CAAY,SAAS,WAAa,EAAA;AACrF,UAAS,QAAA,CAAA;AAAA,YACR,IAAA,EAAM,IAAI,WAAY,CAAA,IAAA;AAAA,YACtB,KAAA,EAAO,IAAI,WAAY,CAAA,KAAA;AAAA,YACvB,MAAA,EAAQ,IAAI,WAAY,CAAA,MAAA;AAAA,YACxB,SAAA,EAAW,IAAI,IAAK,EAAA;AAAA,YACpB,IAAA,EAAM,IAAI,WAAY,CAAA,IAAA;AAAA,WACtB,CAAA,CAAA;AAAA,SACF;AAAA,OACD;AACA,MAAI,IAAA,QAAA,IAAY,CAAC,GAAK,EAAA;AACrB,QAAS,QAAA,EAAA,CAAA;AAAA,OACV;AAAA,KACD;AAAA,GAED,EAAG,CAAC,GAAG,CAAC,CAAA,CAAA;AAER,EAAA,IAAI,cAAgB,EAAA;AACnB,IACC,uBAAA,KAAA,CAAA,aAAA,CAAC,6BACC,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EAAK,KAAK,SAAY,GAAA,YAAA,GAAe,iCAAkC,CAAA,kBACvE,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AAAA,MACA,SAAS,MAAM;AACd,QAAA,iBAAA,CAAkB,KAAK,CAAA,CAAA;AAAA,OACxB;AAAA,MACA,KAAM,EAAA,OAAA;AAAA,MACN,SAAS,GAAK,EAAA,OAAA;AAAA,MACd,UAAU,GAAK,EAAA,OAAA;AAAA,KACf,EAAA,QAED,mBACC,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AAAA,MAAO,IAAK,EAAA,MAAA;AAAA,MAAO,EAAG,EAAA,GAAA;AAAA,MAAI,KAAK,EAAA,IAAA;AAAA,MAAC,OAAS,EAAA,MAAM,GAAK,EAAA,MAAA,CAAO,SAAS,SAAU,EAAA;AAAA,MAAG,UAAU,GAAK,EAAA,OAAA;AAAA,KAAA,EAAS,WAE1G,CACD,CAAA,CAAA;AAAA,GAEF;AAEA,EAAI,IAAA,KAAA,IAAS,MAAM,IAAM,EAAA;AACxB,IACC,uBAAA,KAAA,CAAA,aAAA,CAAC,6BACC,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAA,MAAM,IAAK,EAAA,QAAA;AAAA,MAAS,KAAK,KAAM,CAAA,IAAA;AAAA,MAAM,QAAQ,EAAA,IAAA;AAAA,KAAC,mBAC9C,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AAAA,MACA,IAAK,EAAA,MAAA;AAAA,MACL,OAAO,EAAA,IAAA;AAAA,MACP,SAAS,MAAM;AACd,QAAA,iBAAA,CAAkB,KAAK,CAAA,CAAA;AACvB,QAAI,IAAA,QAAA;AAAU,UAAS,QAAA,EAAA,CAAA;AAAA,OACxB;AAAA,KAAA,EACA,OAED,CACD,CAAA,CAAA;AAAA,GAEF;AAEA,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AAAA,IAAO,OAAA,EAAS,MAAM,iBAAA,CAAkB,IAAI,CAAA;AAAA,GAAA,EAAI,UAAW,CAAA,CAAA;AACpE;;;;"}
|
|
@@ -1,43 +1,12 @@
|
|
|
1
|
+
import React, { useState, useCallback, useMemo } from 'react';
|
|
1
2
|
import debug from 'debug';
|
|
2
|
-
import { useState, useCallback, useMemo } from 'react';
|
|
3
3
|
import { Input, Icon } from 'semantic-ui-react';
|
|
4
4
|
import SIN from 'social-insurance-number';
|
|
5
5
|
import { useMaskedInput } from '../MaskedInput/useMaskedInput.js';
|
|
6
6
|
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __defProps = Object.defineProperties;
|
|
9
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
10
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
13
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
-
var __spreadValues = (a, b) => {
|
|
15
|
-
for (var prop in b || (b = {}))
|
|
16
|
-
if (__hasOwnProp.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
if (__getOwnPropSymbols)
|
|
19
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
-
if (__propIsEnum.call(b, prop))
|
|
21
|
-
__defNormalProp(a, prop, b[prop]);
|
|
22
|
-
}
|
|
23
|
-
return a;
|
|
24
|
-
};
|
|
25
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
|
-
var __objRest = (source, exclude) => {
|
|
27
|
-
var target = {};
|
|
28
|
-
for (var prop in source)
|
|
29
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
30
|
-
target[prop] = source[prop];
|
|
31
|
-
if (source != null && __getOwnPropSymbols)
|
|
32
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
33
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
34
|
-
target[prop] = source[prop];
|
|
35
|
-
}
|
|
36
|
-
return target;
|
|
37
|
-
};
|
|
38
7
|
debug("thx.controls.inputs.SinInput");
|
|
39
8
|
function SinInput(props) {
|
|
40
|
-
const
|
|
9
|
+
const { value, onChange, ...rest } = props;
|
|
41
10
|
const [color, setColor] = useState("black");
|
|
42
11
|
const checkValidation = useCallback((valueArray) => {
|
|
43
12
|
const num = valueArray.join("").replaceAll(/(_|\s|-)/g, "");
|
|
@@ -69,9 +38,10 @@ function SinInput(props) {
|
|
|
69
38
|
checkValidation([v || ""]);
|
|
70
39
|
}
|
|
71
40
|
});
|
|
72
|
-
return /* @__PURE__ */ React.createElement(Input,
|
|
41
|
+
return /* @__PURE__ */ React.createElement(Input, {
|
|
42
|
+
...rest,
|
|
73
43
|
icon: true
|
|
74
|
-
}
|
|
44
|
+
}, /* @__PURE__ */ React.createElement("input", {
|
|
75
45
|
ref: cardNumberRef
|
|
76
46
|
}), /* @__PURE__ */ React.createElement(Icon, {
|
|
77
47
|
name: "id badge",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SinInput.js","sources":["../../../../src/inputs/SinInput/SinInput.tsx"],"sourcesContent":["import debug from 'debug';\nimport {useCallback, useMemo, useState} from 'react';\nimport {Icon, Input, SemanticCOLORS} from 'semantic-ui-react';\nimport SIN from 'social-insurance-number';\nimport type {MaskedInputProps} from '../MaskedInput';\nimport {useMaskedInput} from '../MaskedInput/useMaskedInput';\n\nconst d = debug('thx.controls.inputs.SinInput');\n\nexport interface SinInputProps extends Omit<MaskedInputProps, 'mask'> {\n\tvalue?: string;\n\tonChange(value?: string): void;\n}\n\nexport function SinInput(props: SinInputProps) {\n\tconst {value, onChange, ...rest} = props;\n\tconst [color, setColor] = useState<SemanticCOLORS>('black');\n\n\tconst checkValidation = useCallback((valueArray: string[]) => {\n\t\tconst num = valueArray.join('').replaceAll(/(_|\\s|-)/g, '');\n\t\tconst validate = new SIN(num);\n\t\tif (num.length > 0) {\n\t\t\tif (validate.isValid()) {\n\t\t\t\tsetColor('green');\n\t\t\t} else {\n\t\t\t\tsetColor('red');\n\t\t\t}\n\t\t} else {\n\t\t\tsetColor('black');\n\t\t}\n\t\treturn validate.isValid();\n\t}, []);\n\n\tconst mask: MaskedInputProps['mask'] = useMemo(\n\t\t() => ({\n\t\t\tmask: '999-999-999',\n\t\t\tisComplete: checkValidation,\n\t\t\tgreedy: false,\n\t\t\tautoUnmask: true,\n\t\t}),\n\t\t[checkValidation],\n\t);\n\n\tconst cardNumberRef = useMaskedInput({\n\t\tmask,\n\t\tvalue,\n\t\tonChange: v => {\n\t\t\tonChange && onChange(v);\n\t\t},\n\t\tonSet: v => {\n\t\t\tcheckValidation([v || '']);\n\t\t},\n\t});\n\n\treturn (\n\t\t<Input {...rest} icon>\n\t\t\t<input ref={cardNumberRef} />\n\t\t\t<Icon name=\"id badge\" color={color} size=\"large\" />\n\t\t</Input>\n\t);\n}\n"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"SinInput.js","sources":["../../../../src/inputs/SinInput/SinInput.tsx"],"sourcesContent":["import debug from 'debug';\nimport {useCallback, useMemo, useState} from 'react';\nimport {Icon, Input, SemanticCOLORS} from 'semantic-ui-react';\nimport SIN from 'social-insurance-number';\nimport type {MaskedInputProps} from '../MaskedInput';\nimport {useMaskedInput} from '../MaskedInput/useMaskedInput';\n\nconst d = debug('thx.controls.inputs.SinInput');\n\nexport interface SinInputProps extends Omit<MaskedInputProps, 'mask'> {\n\tvalue?: string;\n\tonChange(value?: string): void;\n}\n\nexport function SinInput(props: SinInputProps) {\n\tconst {value, onChange, ...rest} = props;\n\tconst [color, setColor] = useState<SemanticCOLORS>('black');\n\n\tconst checkValidation = useCallback((valueArray: string[]) => {\n\t\tconst num = valueArray.join('').replaceAll(/(_|\\s|-)/g, '');\n\t\tconst validate = new SIN(num);\n\t\tif (num.length > 0) {\n\t\t\tif (validate.isValid()) {\n\t\t\t\tsetColor('green');\n\t\t\t} else {\n\t\t\t\tsetColor('red');\n\t\t\t}\n\t\t} else {\n\t\t\tsetColor('black');\n\t\t}\n\t\treturn validate.isValid();\n\t}, []);\n\n\tconst mask: MaskedInputProps['mask'] = useMemo(\n\t\t() => ({\n\t\t\tmask: '999-999-999',\n\t\t\tisComplete: checkValidation,\n\t\t\tgreedy: false,\n\t\t\tautoUnmask: true,\n\t\t}),\n\t\t[checkValidation],\n\t);\n\n\tconst cardNumberRef = useMaskedInput({\n\t\tmask,\n\t\tvalue,\n\t\tonChange: v => {\n\t\t\tonChange && onChange(v);\n\t\t},\n\t\tonSet: v => {\n\t\t\tcheckValidation([v || '']);\n\t\t},\n\t});\n\n\treturn (\n\t\t<Input {...rest} icon>\n\t\t\t<input ref={cardNumberRef} />\n\t\t\t<Icon name=\"id badge\" color={color} size=\"large\" />\n\t\t</Input>\n\t);\n}\n"],"names":[],"mappings":";;;;;;AAOU,MAAM,8BAA8B,EAAA;AAOvC,SAAA,QAAA,CAAkB,KAAsB,EAAA;AAC9C,EAAM,MAAA,EAAC,KAAO,EAAA,QAAA,EAAA,GAAa,IAAQ,EAAA,GAAA,KAAA,CAAA;AACnC,EAAA,MAAM,CAAC,KAAA,EAAO,QAAY,CAAA,GAAA,QAAA,CAAyB,OAAO,CAAA,CAAA;AAE1D,EAAM,MAAA,eAAA,GAAkB,WAAY,CAAA,CAAC,UAAyB,KAAA;AAC7D,IAAA,MAAM,MAAM,UAAW,CAAA,IAAA,CAAK,EAAE,CAAE,CAAA,UAAA,CAAW,aAAa,EAAE,CAAA,CAAA;AAC1D,IAAM,MAAA,QAAA,GAAW,IAAI,GAAA,CAAI,GAAG,CAAA,CAAA;AAC5B,IAAI,IAAA,GAAA,CAAI,SAAS,CAAG,EAAA;AACnB,MAAI,IAAA,QAAA,CAAS,SAAW,EAAA;AACvB,QAAA,QAAA,CAAS,OAAO,CAAA,CAAA;AAAA,OACV,MAAA;AACN,QAAA,QAAA,CAAS,KAAK,CAAA,CAAA;AAAA,OACf;AAAA,KACM,MAAA;AACN,MAAA,QAAA,CAAS,OAAO,CAAA,CAAA;AAAA,KACjB;AACA,IAAA,OAAO,SAAS,OAAQ,EAAA,CAAA;AAAA,GACzB,EAAG,EAAE,CAAA,CAAA;AAEL,EAAM,MAAA,IAAA,GAAiC,QACtC,OAAO;AAAA,IACN,IAAM,EAAA,aAAA;AAAA,IACN,UAAY,EAAA,eAAA;AAAA,IACZ,MAAQ,EAAA,KAAA;AAAA,IACR,UAAY,EAAA,IAAA;AAAA,GACb,CAAA,EACA,CAAC,eAAe,CACjB,CAAA,CAAA;AAEA,EAAA,MAAM,gBAAgB,cAAe,CAAA;AAAA,IACpC,IAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAU,CAAK,CAAA,KAAA;AACd,MAAA,QAAA,IAAY,SAAS,CAAC,CAAA,CAAA;AAAA,KACvB;AAAA,IACA,OAAO,CAAK,CAAA,KAAA;AACX,MAAgB,eAAA,CAAA,CAAC,CAAK,IAAA,EAAE,CAAC,CAAA,CAAA;AAAA,KAC1B;AAAA,GACA,CAAA,CAAA;AAED,EAAA,uBACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAA,IAAU,GAAA,IAAA;AAAA,IAAM,IAAI,EAAA,IAAA;AAAA,GAAA,kBACnB,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA;AAAA,IAAM,GAAK,EAAA,aAAA;AAAA,GAAe,mBAC1B,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA;AAAA,IAAK,IAAK,EAAA,UAAA;AAAA,IAAW,KAAA;AAAA,IAAc,IAAK,EAAA,OAAA;AAAA,GAAQ,CAClD,CAAA,CAAA;AAEF;;;;"}
|
|
@@ -1,36 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { Dropdown } from 'semantic-ui-react';
|
|
2
3
|
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
-
var __objRest = (source, exclude) => {
|
|
23
|
-
var target = {};
|
|
24
|
-
for (var prop in source)
|
|
25
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
26
|
-
target[prop] = source[prop];
|
|
27
|
-
if (source != null && __getOwnPropSymbols)
|
|
28
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
29
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
30
|
-
target[prop] = source[prop];
|
|
31
|
-
}
|
|
32
|
-
return target;
|
|
33
|
-
};
|
|
34
4
|
function DropdownCell(dropdownProps) {
|
|
35
5
|
return function DropdownCellFn(props) {
|
|
36
6
|
const {
|
|
@@ -39,15 +9,16 @@ function DropdownCell(dropdownProps) {
|
|
|
39
9
|
column: { id },
|
|
40
10
|
updateData
|
|
41
11
|
} = props;
|
|
42
|
-
const
|
|
43
|
-
return /* @__PURE__ */ React.createElement(Dropdown,
|
|
12
|
+
const { value: v, onChange, ...rest } = dropdownProps;
|
|
13
|
+
return /* @__PURE__ */ React.createElement(Dropdown, {
|
|
14
|
+
...rest,
|
|
44
15
|
value,
|
|
45
16
|
onChange: (event, val) => {
|
|
46
17
|
updateData(rowIndex, id, val.value);
|
|
47
18
|
if (onChange)
|
|
48
19
|
onChange(event, val);
|
|
49
20
|
}
|
|
50
|
-
})
|
|
21
|
+
});
|
|
51
22
|
};
|
|
52
23
|
}
|
|
53
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownCell.js","sources":["../../../../src/inputs/TableInput/DropdownCell.tsx"],"sourcesContent":["import {Dropdown} from 'semantic-ui-react';\nimport type {DropdownProps} from 'semantic-ui-react';\nimport type {TableCellProps} from './TableInput';\n\nexport function DropdownCell<D extends Record<string, unknown>>(dropdownProps: DropdownProps) {\n\treturn function DropdownCellFn(props: TableCellProps<D>) {\n\t\tconst {\n\t\t\tvalue,\n\t\t\trow: {index: rowIndex},\n\t\t\tcolumn: {id},\n\t\t\tupdateData,\n\t\t} = props;\n\n\t\t// eslint-disable-next-line no-unused-vars,@typescript-eslint/no-unused-vars\n\t\tconst {value: v, onChange, ...rest} = dropdownProps;\n\n\t\treturn (\n\t\t\t<Dropdown\n\t\t\t\t{...rest}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={(event, val) => {\n\t\t\t\t\tupdateData(rowIndex, id, val.value);\n\t\t\t\t\tif (onChange) onChange(event, val);\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t};\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DropdownCell.js","sources":["../../../../src/inputs/TableInput/DropdownCell.tsx"],"sourcesContent":["import {Dropdown} from 'semantic-ui-react';\nimport type {DropdownProps} from 'semantic-ui-react';\nimport type {TableCellProps} from './TableInput';\n\nexport function DropdownCell<D extends Record<string, unknown>>(dropdownProps: DropdownProps) {\n\treturn function DropdownCellFn(props: TableCellProps<D>) {\n\t\tconst {\n\t\t\tvalue,\n\t\t\trow: {index: rowIndex},\n\t\t\tcolumn: {id},\n\t\t\tupdateData,\n\t\t} = props;\n\n\t\t// eslint-disable-next-line no-unused-vars,@typescript-eslint/no-unused-vars\n\t\tconst {value: v, onChange, ...rest} = dropdownProps;\n\n\t\treturn (\n\t\t\t<Dropdown\n\t\t\t\t{...rest}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={(event, val) => {\n\t\t\t\t\tupdateData(rowIndex, id, val.value);\n\t\t\t\t\tif (onChange) onChange(event, val);\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t};\n}\n"],"names":[],"mappings":";;;AAIO,SAAA,YAAA,CAAyD,aAA8B,EAAA;AAC7F,EAAA,OAAO,wBAAwB,KAA0B,EAAA;AACxD,IAAM,MAAA;AAAA,MACL,KAAA;AAAA,MACA,GAAA,EAAK,EAAC,KAAO,EAAA,QAAA,EAAA;AAAA,MACb,QAAQ,EAAC,EAAA,EAAA;AAAA,MACT,UAAA;AAAA,KACG,GAAA,KAAA,CAAA;AAGJ,IAAA,MAAM,EAAC,KAAA,EAAO,CAAG,EAAA,QAAA,EAAA,GAAa,IAAQ,EAAA,GAAA,aAAA,CAAA;AAEtC,IAAA,uBACE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAA,MACI,GAAA,IAAA;AAAA,MACJ,KAAA;AAAA,MACA,QAAA,EAAU,CAAC,KAAA,EAAO,GAAQ,KAAA;AACzB,QAAW,UAAA,CAAA,QAAA,EAAU,EAAI,EAAA,GAAA,CAAI,KAAK,CAAA,CAAA;AAClC,QAAI,IAAA,QAAA;AAAU,UAAA,QAAA,CAAS,OAAO,GAAG,CAAA,CAAA;AAAA,OAClC;AAAA,KACD,CAAA,CAAA;AAAA,GAEF,CAAA;AACD;;;;"}
|
|
@@ -1,21 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import debug from 'debug';
|
|
2
3
|
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
4
|
debug("thx.controls.inputs.TableInput.HoverCell");
|
|
20
5
|
function HoverCell(options) {
|
|
21
6
|
return function HoverCellFn(props) {
|
|
@@ -23,7 +8,9 @@ function HoverCell(options) {
|
|
|
23
8
|
if (props.hoverRow === props.row.id) {
|
|
24
9
|
return /* @__PURE__ */ React.createElement("div", {
|
|
25
10
|
style: { textAlign: "right" }
|
|
26
|
-
}, /* @__PURE__ */ React.createElement(Action,
|
|
11
|
+
}, /* @__PURE__ */ React.createElement(Action, {
|
|
12
|
+
...props
|
|
13
|
+
}));
|
|
27
14
|
}
|
|
28
15
|
return null;
|
|
29
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoverCell.js","sources":["../../../../src/inputs/TableInput/HoverCell.tsx"],"sourcesContent":["import debug from 'debug';\nimport type {CellProps, Renderer} from 'react-table';\n\nconst d = debug('thx.controls.inputs.TableInput.HoverCell');\n\ninterface HoverCellOptions<D extends Record<string, unknown>> {\n\tAction: Renderer<CellProps<D>>;\n}\n\nexport function HoverCell<D extends Record<string, unknown>>(options: HoverCellOptions<D>) {\n\treturn function HoverCellFn(props: CellProps<D>) {\n\t\tconst {Action} = options;\n\n\t\t// @ts-expect-error\n\t\tif (props.hoverRow === props.row.id) {\n\t\t\treturn (\n\t\t\t\t<div style={{textAlign: 'right'}}>\n\t\t\t\t\t{/* @ts-expect-error */}\n\t\t\t\t\t<Action {...props} />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t};\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HoverCell.js","sources":["../../../../src/inputs/TableInput/HoverCell.tsx"],"sourcesContent":["import debug from 'debug';\nimport type {CellProps, Renderer} from 'react-table';\n\nconst d = debug('thx.controls.inputs.TableInput.HoverCell');\n\ninterface HoverCellOptions<D extends Record<string, unknown>> {\n\tAction: Renderer<CellProps<D>>;\n}\n\nexport function HoverCell<D extends Record<string, unknown>>(options: HoverCellOptions<D>) {\n\treturn function HoverCellFn(props: CellProps<D>) {\n\t\tconst {Action} = options;\n\n\t\t// @ts-expect-error\n\t\tif (props.hoverRow === props.row.id) {\n\t\t\treturn (\n\t\t\t\t<div style={{textAlign: 'right'}}>\n\t\t\t\t\t{/* @ts-expect-error */}\n\t\t\t\t\t<Action {...props} />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t};\n}\n"],"names":[],"mappings":";;;AAGU,MAAM,0CAA0C,EAAA;AAMnD,SAAA,SAAA,CAAsD,OAA8B,EAAA;AAC1F,EAAA,OAAO,qBAAqB,KAAqB,EAAA;AAChD,IAAA,MAAM,EAAC,MAAU,EAAA,GAAA,OAAA,CAAA;AAGjB,IAAA,IAAI,KAAM,CAAA,QAAA,KAAa,KAAM,CAAA,GAAA,CAAI,EAAI,EAAA;AACpC,MAAA,uBACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAA,QAAI,KAAA,EAAO,EAAC,SAAA,EAAW,OAAO,EAAA;AAAA,OAAA,kBAE7B,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AAAA,QAAW,GAAA,KAAA;AAAA,OAAO,CACpB,CAAA,CAAA;AAAA,KAEF;AACA,IAAO,OAAA,IAAA,CAAA;AAAA,GACR,CAAA;AACD;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { formatMoney } from '@thx/money';
|
|
2
3
|
|
|
3
4
|
function MoneyCell(options) {
|
|
4
5
|
return function MoneyCellFn(props) {
|
|
5
6
|
return /* @__PURE__ */ React.createElement("div", {
|
|
6
7
|
style: { textAlign: "right" }
|
|
7
|
-
}, formatMoney(
|
|
8
|
+
}, formatMoney(options?.overrideValue ? options.overrideValue(props) : props.value));
|
|
8
9
|
};
|
|
9
10
|
}
|
|
10
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoneyCell.js","sources":["../../../../src/inputs/TableInput/MoneyCell.tsx"],"sourcesContent":["import {formatMoney} from '@thx/money';\nimport type Money from 'js-money';\nimport type {CellProps} from 'react-table';\n\ninterface MoneyCellOptions<D extends Record<string, unknown>> {\n\t/** If provided, this function will override the Money value displayed */\n\toverrideValue?: (props: CellProps<D, Money>) => Money;\n}\n\nexport function MoneyCell<D extends Record<string, unknown>>(options?: MoneyCellOptions<D>) {\n\treturn function MoneyCellFn(props: CellProps<D, Money>) {\n\t\treturn <div style={{textAlign: 'right'}}>{formatMoney(options?.overrideValue ? options.overrideValue(props) : props.value)}</div>;\n\t};\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MoneyCell.js","sources":["../../../../src/inputs/TableInput/MoneyCell.tsx"],"sourcesContent":["import {formatMoney} from '@thx/money';\nimport type Money from 'js-money';\nimport type {CellProps} from 'react-table';\n\ninterface MoneyCellOptions<D extends Record<string, unknown>> {\n\t/** If provided, this function will override the Money value displayed */\n\toverrideValue?: (props: CellProps<D, Money>) => Money;\n}\n\nexport function MoneyCell<D extends Record<string, unknown>>(options?: MoneyCellOptions<D>) {\n\treturn function MoneyCellFn(props: CellProps<D, Money>) {\n\t\treturn <div style={{textAlign: 'right'}}>{formatMoney(options?.overrideValue ? options.overrideValue(props) : props.value)}</div>;\n\t};\n}\n"],"names":[],"mappings":";;;AASO,SAAA,SAAA,CAAsD,OAA+B,EAAA;AAC3F,EAAA,OAAO,qBAAqB,KAA4B,EAAA;AACvD,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAA,MAAI,KAAA,EAAO,EAAC,SAAA,EAAW,OAAO,EAAA;AAAA,KAAI,EAAA,WAAA,CAAY,SAAS,aAAgB,GAAA,OAAA,CAAQ,cAAc,KAAK,CAAA,GAAI,KAAM,CAAA,KAAK,CAAE,CAAA,CAAA;AAAA,GAC5H,CAAA;AACD;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
1
2
|
import debug from 'debug';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { addRowOnTab } from './addRowOnTab.js';
|
|
4
3
|
import { MoneyInput } from '../../money/MoneyInput/MoneyInput.js';
|
|
4
|
+
import { addRowOnTab } from './addRowOnTab.js';
|
|
5
5
|
|
|
6
6
|
debug("thx.controls.inputs.TableInput.MoneyEditCell");
|
|
7
7
|
function MoneyEditCell(opts) {
|
|
@@ -21,7 +21,7 @@ function MoneyEditCell(opts) {
|
|
|
21
21
|
onBlur: () => {
|
|
22
22
|
updateData(rowIndex, id, value);
|
|
23
23
|
},
|
|
24
|
-
onKeyDown: (event) => addRowOnTab(event, value, props, opts
|
|
24
|
+
onKeyDown: (event) => addRowOnTab(event, value, props, opts?.addRowOnTabIf)
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoneyEditCell.js","sources":["../../../../src/inputs/TableInput/MoneyEditCell.tsx"],"sourcesContent":["import debug from 'debug';\nimport type Money from 'js-money';\nimport {useState} from 'react';\nimport {MoneyInput} from '../../money/MoneyInput';\nimport type {TableCellProps} from './TableInput';\nimport type {AddRowOnTabIf} from './addRowOnTab';\nimport {addRowOnTab} from './addRowOnTab';\n\nconst d = debug('thx.controls.inputs.TableInput.MoneyEditCell');\n\ninterface MoneyEditCellOptions<D extends Record<string, unknown>> {\n\t/** If function is present, and returns true, will add a new row if tab is pressed on the last row */\n\taddRowOnTabIf?: AddRowOnTabIf<D, Money>;\n}\n\nexport function MoneyEditCell<D extends Record<string, unknown>>(opts?: MoneyEditCellOptions<D>) {\n\treturn function MoneyEditCellFn(props: TableCellProps<D, Money>) {\n\t\tconst {\n\t\t\tvalue: initialValue,\n\t\t\trow: {index: rowIndex},\n\t\t\tcolumn: {id},\n\t\t\tupdateData,\n\t\t} = props;\n\n\t\tconst [value, setValue] = useState(initialValue);\n\n\t\treturn (\n\t\t\t<MoneyInput\n\t\t\t\tfluid\n\t\t\t\ttransparent\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={setValue}\n\t\t\t\tonBlur={() => {\n\t\t\t\t\tupdateData(rowIndex, id, value);\n\t\t\t\t}}\n\t\t\t\tonKeyDown={(event: KeyboardEvent) => addRowOnTab(event, value, props, opts?.addRowOnTabIf)}\n\t\t\t/>\n\t\t);\n\t};\n}\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"MoneyEditCell.js","sources":["../../../../src/inputs/TableInput/MoneyEditCell.tsx"],"sourcesContent":["import debug from 'debug';\nimport type Money from 'js-money';\nimport {useState} from 'react';\nimport {MoneyInput} from '../../money/MoneyInput';\nimport type {TableCellProps} from './TableInput';\nimport type {AddRowOnTabIf} from './addRowOnTab';\nimport {addRowOnTab} from './addRowOnTab';\n\nconst d = debug('thx.controls.inputs.TableInput.MoneyEditCell');\n\ninterface MoneyEditCellOptions<D extends Record<string, unknown>> {\n\t/** If function is present, and returns true, will add a new row if tab is pressed on the last row */\n\taddRowOnTabIf?: AddRowOnTabIf<D, Money>;\n}\n\nexport function MoneyEditCell<D extends Record<string, unknown>>(opts?: MoneyEditCellOptions<D>) {\n\treturn function MoneyEditCellFn(props: TableCellProps<D, Money>) {\n\t\tconst {\n\t\t\tvalue: initialValue,\n\t\t\trow: {index: rowIndex},\n\t\t\tcolumn: {id},\n\t\t\tupdateData,\n\t\t} = props;\n\n\t\tconst [value, setValue] = useState(initialValue);\n\n\t\treturn (\n\t\t\t<MoneyInput\n\t\t\t\tfluid\n\t\t\t\ttransparent\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={setValue}\n\t\t\t\tonBlur={() => {\n\t\t\t\t\tupdateData(rowIndex, id, value);\n\t\t\t\t}}\n\t\t\t\tonKeyDown={(event: KeyboardEvent) => addRowOnTab(event, value, props, opts?.addRowOnTabIf)}\n\t\t\t/>\n\t\t);\n\t};\n}\n"],"names":[],"mappings":";;;;;AAQU,MAAM,8CAA8C,EAAA;AAOvD,SAAA,aAAA,CAA0D,IAAgC,EAAA;AAChG,EAAA,OAAO,yBAAyB,KAAiC,EAAA;AAChE,IAAM,MAAA;AAAA,MACL,KAAO,EAAA,YAAA;AAAA,MACP,GAAA,EAAK,EAAC,KAAO,EAAA,QAAA,EAAA;AAAA,MACb,QAAQ,EAAC,EAAA,EAAA;AAAA,MACT,UAAA;AAAA,KACG,GAAA,KAAA,CAAA;AAEJ,IAAA,MAAM,CAAC,KAAA,EAAO,QAAY,CAAA,GAAA,QAAA,CAAS,YAAY,CAAA,CAAA;AAE/C,IAAA,uBACE,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA;AAAA,MACA,KAAK,EAAA,IAAA;AAAA,MACL,WAAW,EAAA,IAAA;AAAA,MACX,KAAA;AAAA,MACA,QAAU,EAAA,QAAA;AAAA,MACV,QAAQ,MAAM;AACb,QAAW,UAAA,CAAA,QAAA,EAAU,IAAI,KAAK,CAAA,CAAA;AAAA,OAC/B;AAAA,MACA,SAAA,EAAW,CAAC,KAAyB,KAAA,WAAA,CAAY,OAAO,KAAO,EAAA,KAAA,EAAO,MAAM,aAAa,CAAA;AAAA,KAC1F,CAAA,CAAA;AAAA,GAEF,CAAA;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoneySumFooter.js","sources":["../../../../src/inputs/TableInput/MoneySumFooter.tsx"],"sourcesContent":["import {formatMoney, toMoney} from '@thx/money';\nimport type {IdType, TableInstance} from 'react-table';\n\ninterface MoneySumFooterOptions<A extends Record<string, unknown>> {\n\tid: IdType<A>;\n}\n\nexport function MoneySumFooter<A extends Record<string, unknown>>(options: MoneySumFooterOptions<A>) {\n\tconst {id} = options || {};\n\n\treturn function MoneySumFooterInstance(info: TableInstance<A>) {\n\t\tconst sum = info.rows.reduce((memo, row) => memo.add(row.values[id]), toMoney());\n\t\treturn <div style={{textAlign: 'right'}}>{formatMoney(sum)}</div>;\n\t};\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MoneySumFooter.js","sources":["../../../../src/inputs/TableInput/MoneySumFooter.tsx"],"sourcesContent":["import {formatMoney, toMoney} from '@thx/money';\nimport type {IdType, TableInstance} from 'react-table';\n\ninterface MoneySumFooterOptions<A extends Record<string, unknown>> {\n\tid: IdType<A>;\n}\n\nexport function MoneySumFooter<A extends Record<string, unknown>>(options: MoneySumFooterOptions<A>) {\n\tconst {id} = options || {};\n\n\treturn function MoneySumFooterInstance(info: TableInstance<A>) {\n\t\tconst sum = info.rows.reduce((memo, row) => memo.add(row.values[id]), toMoney());\n\t\treturn <div style={{textAlign: 'right'}}>{formatMoney(sum)}</div>;\n\t};\n}\n"],"names":[],"mappings":";;;AAOO,SAAA,cAAA,CAA2D,OAAmC,EAAA;AACpG,EAAM,MAAA,EAAC,EAAM,EAAA,GAAA,OAAA,IAAW,EAAC,CAAA;AAEzB,EAAA,OAAO,gCAAgC,IAAwB,EAAA;AAC9D,IAAA,MAAM,GAAM,GAAA,IAAA,CAAK,IAAK,CAAA,MAAA,CAAO,CAAC,IAAM,EAAA,GAAA,KAAQ,IAAK,CAAA,GAAA,CAAI,GAAI,CAAA,MAAA,CAAO,EAAG,CAAA,CAAA,EAAG,SAAS,CAAA,CAAA;AAC/E,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAA,MAAI,KAAA,EAAO,EAAC,SAAA,EAAW,OAAO,EAAA;AAAA,KAAI,EAAA,WAAA,CAAY,GAAG,CAAE,CAAA,CAAA;AAAA,GAC5D,CAAA;AACD;;;;"}
|
|
@@ -1,27 +1,8 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
1
2
|
import debug from 'debug';
|
|
2
|
-
import { useState } from 'react';
|
|
3
3
|
import { Input } from 'semantic-ui-react';
|
|
4
4
|
import { addRowOnTab } from './addRowOnTab.js';
|
|
5
5
|
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __defProps = Object.defineProperties;
|
|
8
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
6
|
debug("thx.controls.inputs.TableInput.StringEditCell");
|
|
26
7
|
function StringEditCell(options) {
|
|
27
8
|
const { inputProps, addRowOnTabIf } = options || {};
|
|
@@ -33,10 +14,10 @@ function StringEditCell(options) {
|
|
|
33
14
|
updateData
|
|
34
15
|
} = props;
|
|
35
16
|
const [value, setValue] = useState(initialValue);
|
|
36
|
-
return /* @__PURE__ */ React.createElement(Input,
|
|
17
|
+
return /* @__PURE__ */ React.createElement(Input, {
|
|
37
18
|
fluid: true,
|
|
38
|
-
transparent: true
|
|
39
|
-
|
|
19
|
+
transparent: true,
|
|
20
|
+
...inputProps,
|
|
40
21
|
value,
|
|
41
22
|
onChange: (ev, v) => {
|
|
42
23
|
setValue(v.value);
|
|
@@ -45,7 +26,7 @@ function StringEditCell(options) {
|
|
|
45
26
|
updateData(index, id, value);
|
|
46
27
|
},
|
|
47
28
|
onKeyDown: (event) => addRowOnTab(event, value, props, addRowOnTabIf)
|
|
48
|
-
})
|
|
29
|
+
});
|
|
49
30
|
};
|
|
50
31
|
}
|
|
51
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringEditCell.js","sources":["../../../../src/inputs/TableInput/StringEditCell.tsx"],"sourcesContent":["import debug from 'debug';\nimport {useState} from 'react';\nimport {Input, InputProps} from 'semantic-ui-react';\nimport type {TableCellProps} from './TableInput';\nimport type {AddRowOnTabIf} from './addRowOnTab';\nimport {addRowOnTab} from './addRowOnTab';\n\nconst d = debug('thx.controls.inputs.TableInput.StringEditCell');\n\ninterface StringEditCellOptions<D extends Record<string, unknown>> {\n\t/** Override SemanticUI Input props */\n\tinputProps?: InputProps;\n\t/** If function is present, and returns true, will add a new row if tab is pressed on the last row */\n\taddRowOnTabIf?: AddRowOnTabIf<D, string>;\n}\n\nexport function StringEditCell<D extends Record<string, unknown>>(options?: StringEditCellOptions<D>) {\n\tconst {inputProps, addRowOnTabIf} = options || {};\n\n\treturn function StringEditCellFn(props: TableCellProps<D, string>) {\n\t\tconst {\n\t\t\tvalue: initialValue,\n\t\t\trow: {index},\n\t\t\tcolumn: {id},\n\t\t\tupdateData,\n\t\t} = props;\n\n\t\tconst [value, setValue] = useState(initialValue);\n\n\t\treturn (\n\t\t\t<Input\n\t\t\t\tfluid\n\t\t\t\ttransparent\n\t\t\t\t{...inputProps}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={(ev, v) => {\n\t\t\t\t\tsetValue(v.value);\n\t\t\t\t}}\n\t\t\t\tonBlur={() => {\n\t\t\t\t\tupdateData(index, id, value);\n\t\t\t\t}}\n\t\t\t\tonKeyDown={(event: KeyboardEvent) => addRowOnTab(event, value, props, addRowOnTabIf)}\n\t\t\t/>\n\t\t);\n\t};\n}\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"StringEditCell.js","sources":["../../../../src/inputs/TableInput/StringEditCell.tsx"],"sourcesContent":["import debug from 'debug';\nimport {useState} from 'react';\nimport {Input, InputProps} from 'semantic-ui-react';\nimport type {TableCellProps} from './TableInput';\nimport type {AddRowOnTabIf} from './addRowOnTab';\nimport {addRowOnTab} from './addRowOnTab';\n\nconst d = debug('thx.controls.inputs.TableInput.StringEditCell');\n\ninterface StringEditCellOptions<D extends Record<string, unknown>> {\n\t/** Override SemanticUI Input props */\n\tinputProps?: InputProps;\n\t/** If function is present, and returns true, will add a new row if tab is pressed on the last row */\n\taddRowOnTabIf?: AddRowOnTabIf<D, string>;\n}\n\nexport function StringEditCell<D extends Record<string, unknown>>(options?: StringEditCellOptions<D>) {\n\tconst {inputProps, addRowOnTabIf} = options || {};\n\n\treturn function StringEditCellFn(props: TableCellProps<D, string>) {\n\t\tconst {\n\t\t\tvalue: initialValue,\n\t\t\trow: {index},\n\t\t\tcolumn: {id},\n\t\t\tupdateData,\n\t\t} = props;\n\n\t\tconst [value, setValue] = useState(initialValue);\n\n\t\treturn (\n\t\t\t<Input\n\t\t\t\tfluid\n\t\t\t\ttransparent\n\t\t\t\t{...inputProps}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={(ev, v) => {\n\t\t\t\t\tsetValue(v.value);\n\t\t\t\t}}\n\t\t\t\tonBlur={() => {\n\t\t\t\t\tupdateData(index, id, value);\n\t\t\t\t}}\n\t\t\t\tonKeyDown={(event: KeyboardEvent) => addRowOnTab(event, value, props, addRowOnTabIf)}\n\t\t\t/>\n\t\t);\n\t};\n}\n"],"names":[],"mappings":";;;;;AAOU,MAAM,+CAA+C,EAAA;AASxD,SAAA,cAAA,CAA2D,OAAoC,EAAA;AACrG,EAAA,MAAM,EAAC,UAAA,EAAY,aAAiB,EAAA,GAAA,OAAA,IAAW,EAAC,CAAA;AAEhD,EAAA,OAAO,0BAA0B,KAAkC,EAAA;AAClE,IAAM,MAAA;AAAA,MACL,KAAO,EAAA,YAAA;AAAA,MACP,KAAK,EAAC,KAAA,EAAA;AAAA,MACN,QAAQ,EAAC,EAAA,EAAA;AAAA,MACT,UAAA;AAAA,KACG,GAAA,KAAA,CAAA;AAEJ,IAAA,MAAM,CAAC,KAAA,EAAO,QAAY,CAAA,GAAA,QAAA,CAAS,YAAY,CAAA,CAAA;AAE/C,IAAA,uBACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAA,MACA,KAAK,EAAA,IAAA;AAAA,MACL,WAAW,EAAA,IAAA;AAAA,MACP,GAAA,UAAA;AAAA,MACJ,KAAA;AAAA,MACA,QAAA,EAAU,CAAC,EAAA,EAAI,CAAM,KAAA;AACpB,QAAA,QAAA,CAAS,EAAE,KAAK,CAAA,CAAA;AAAA,OACjB;AAAA,MACA,QAAQ,MAAM;AACb,QAAW,UAAA,CAAA,KAAA,EAAO,IAAI,KAAK,CAAA,CAAA;AAAA,OAC5B;AAAA,MACA,WAAW,CAAC,KAAA,KAAyB,YAAY,KAAO,EAAA,KAAA,EAAO,OAAO,aAAa,CAAA;AAAA,KACpF,CAAA,CAAA;AAAA,GAEF,CAAA;AACD;;;;"}
|
|
@@ -1,28 +1,9 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
1
2
|
import debug from 'debug';
|
|
2
3
|
import { FieldArray } from 'formik';
|
|
3
|
-
import { useMemo, useState } from 'react';
|
|
4
4
|
import { useTable } from 'react-table';
|
|
5
5
|
import { Table } from 'semantic-ui-react';
|
|
6
6
|
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __defProps = Object.defineProperties;
|
|
9
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
10
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
13
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
-
var __spreadValues = (a, b) => {
|
|
15
|
-
for (var prop in b || (b = {}))
|
|
16
|
-
if (__hasOwnProp.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
if (__getOwnPropSymbols)
|
|
19
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
-
if (__propIsEnum.call(b, prop))
|
|
21
|
-
__defNormalProp(a, prop, b[prop]);
|
|
22
|
-
}
|
|
23
|
-
return a;
|
|
24
|
-
};
|
|
25
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
7
|
debug("thx.controls.inputs.TableInput");
|
|
27
8
|
function TableInputTable(props) {
|
|
28
9
|
const {
|
|
@@ -56,21 +37,37 @@ function TableInputTable(props) {
|
|
|
56
37
|
arrayHelpers
|
|
57
38
|
});
|
|
58
39
|
const hasFooter = footerGroups.some((fg) => fg.headers.some((fgh) => fgh.Footer.name !== "emptyRenderer"));
|
|
59
|
-
const footer = hasFooter ? /* @__PURE__ */ React.createElement(Table.Footer, null, footerGroups.map((group) => /* @__PURE__ */ React.createElement(Table.Row,
|
|
60
|
-
|
|
40
|
+
const footer = hasFooter ? /* @__PURE__ */ React.createElement(Table.Footer, null, footerGroups.map((group) => /* @__PURE__ */ React.createElement(Table.Row, {
|
|
41
|
+
...{ ...group.getFooterGroupProps(), ...group.getFooterGroupProps(footerRowProps) }
|
|
42
|
+
}, group.headers.map((column) => /* @__PURE__ */ React.createElement(Table.HeaderCell, {
|
|
43
|
+
...{ ...column.getFooterProps(), ...column.getFooterProps(footerCellProps) }
|
|
44
|
+
}, column.render("Footer")))))) : null;
|
|
45
|
+
return /* @__PURE__ */ React.createElement(Table, {
|
|
46
|
+
...{ ...getTableProps(), ...getTableProps(tableProps) }
|
|
47
|
+
}, /* @__PURE__ */ React.createElement(Table.Header, null, headerGroups.map((headerGroup) => /* @__PURE__ */ React.createElement(Table.Row, {
|
|
48
|
+
...{ ...headerGroup.getHeaderGroupProps(), ...headerGroup.getHeaderGroupProps(headerRowProps) }
|
|
49
|
+
}, headerGroup.headers.map((column) => /* @__PURE__ */ React.createElement(Table.HeaderCell, {
|
|
50
|
+
...{ ...column.getHeaderProps(), ...column.getHeaderProps(headerCellProps) }
|
|
51
|
+
}, column.render("Header")))))), /* @__PURE__ */ React.createElement(Table.Body, {
|
|
52
|
+
...{ ...getTableBodyProps(), ...getTableBodyProps(bodyProps) }
|
|
53
|
+
}, rows.map((row) => {
|
|
61
54
|
prepareRow(row);
|
|
62
|
-
return /* @__PURE__ */ React.createElement(Table.Row,
|
|
55
|
+
return /* @__PURE__ */ React.createElement(Table.Row, {
|
|
56
|
+
...{ ...row.getRowProps(), ...row.getRowProps(rowProps) },
|
|
63
57
|
onMouseEnter: () => setHoverRow(row.id),
|
|
64
58
|
onMouseLeave: () => setHoverRow("")
|
|
65
|
-
}
|
|
59
|
+
}, row.cells.map((cell) => /* @__PURE__ */ React.createElement(Table.Cell, {
|
|
60
|
+
...{ ...cell.getCellProps(), ...cell.getCellProps(cellProps) }
|
|
61
|
+
}, cell.render("Cell", { hoverRow }))));
|
|
66
62
|
})), footer);
|
|
67
63
|
}
|
|
68
64
|
function TableInput(props) {
|
|
69
65
|
return /* @__PURE__ */ React.createElement(FieldArray, {
|
|
70
66
|
name: props.name,
|
|
71
|
-
render: (arrayHelpers) => /* @__PURE__ */ React.createElement(TableInputTable,
|
|
72
|
-
arrayHelpers
|
|
73
|
-
|
|
67
|
+
render: (arrayHelpers) => /* @__PURE__ */ React.createElement(TableInputTable, {
|
|
68
|
+
arrayHelpers,
|
|
69
|
+
...props
|
|
70
|
+
})
|
|
74
71
|
});
|
|
75
72
|
}
|
|
76
73
|
|