@wix/auto-patterns 1.5.0 → 1.7.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.
Files changed (87) hide show
  1. package/dist/cjs/collectionData/cms/CmsCollectionData.js +12 -7
  2. package/dist/cjs/collectionData/cms/CmsCollectionData.js.map +1 -1
  3. package/dist/cjs/collectionData/cms/filterUtils.js +2 -1
  4. package/dist/cjs/collectionData/cms/filterUtils.js.map +1 -1
  5. package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +13 -15
  6. package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
  7. package/dist/cjs/components/AutoPatternsEntityPage/Fields/Checkbox.js +5 -8
  8. package/dist/cjs/components/AutoPatternsEntityPage/Fields/Checkbox.js.map +1 -1
  9. package/dist/cjs/components/AutoPatternsEntityPage/Fields/DateInput.js +65 -0
  10. package/dist/cjs/components/AutoPatternsEntityPage/Fields/DateInput.js.map +1 -0
  11. package/dist/cjs/components/AutoPatternsEntityPage/Fields/DateTime.js +140 -0
  12. package/dist/cjs/components/AutoPatternsEntityPage/Fields/DateTime.js.map +1 -0
  13. package/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +16 -12
  14. package/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +1 -1
  15. package/dist/cjs/components/AutoPatternsEntityPage/Fields/LongText.js +36 -0
  16. package/dist/cjs/components/AutoPatternsEntityPage/Fields/LongText.js.map +1 -0
  17. package/dist/cjs/components/AutoPatternsEntityPage/Fields/Number.js +36 -0
  18. package/dist/cjs/components/AutoPatternsEntityPage/Fields/Number.js.map +1 -0
  19. package/dist/cjs/components/AutoPatternsEntityPage/Fields/ShortText.js +8 -32
  20. package/dist/cjs/components/AutoPatternsEntityPage/Fields/ShortText.js.map +1 -1
  21. package/dist/cjs/components/AutoPatternsEntityPage/Fields/Url.js +75 -0
  22. package/dist/cjs/components/AutoPatternsEntityPage/Fields/Url.js.map +1 -0
  23. package/dist/cjs/components/AutoPatternsEntityPage/Fields/types.js +4 -0
  24. package/dist/cjs/components/AutoPatternsEntityPage/Fields/types.js.map +1 -0
  25. package/dist/cjs/components/AutoPatternsEntityPage/Fields/utils/dates.js +16 -0
  26. package/dist/cjs/components/AutoPatternsEntityPage/Fields/utils/dates.js.map +1 -0
  27. package/dist/cjs/index.js +12 -0
  28. package/dist/cjs/index.js.map +1 -1
  29. package/dist/cjs/types/types.js.map +1 -1
  30. package/dist/esm/collectionData/cms/CmsCollectionData.js +11 -6
  31. package/dist/esm/collectionData/cms/CmsCollectionData.js.map +1 -1
  32. package/dist/esm/collectionData/cms/filterUtils.js +2 -1
  33. package/dist/esm/collectionData/cms/filterUtils.js.map +1 -1
  34. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +1 -3
  35. package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
  36. package/dist/esm/components/AutoPatternsEntityPage/Fields/Checkbox.js +3 -5
  37. package/dist/esm/components/AutoPatternsEntityPage/Fields/Checkbox.js.map +1 -1
  38. package/dist/esm/components/AutoPatternsEntityPage/Fields/DateInput.js +46 -0
  39. package/dist/esm/components/AutoPatternsEntityPage/Fields/DateInput.js.map +1 -0
  40. package/dist/esm/components/AutoPatternsEntityPage/Fields/DateTime.js +97 -0
  41. package/dist/esm/components/AutoPatternsEntityPage/Fields/DateTime.js.map +1 -0
  42. package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +16 -12
  43. package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +1 -1
  44. package/dist/esm/components/AutoPatternsEntityPage/Fields/LongText.js +17 -0
  45. package/dist/esm/components/AutoPatternsEntityPage/Fields/LongText.js.map +1 -0
  46. package/dist/esm/components/AutoPatternsEntityPage/Fields/Number.js +17 -0
  47. package/dist/esm/components/AutoPatternsEntityPage/Fields/Number.js.map +1 -0
  48. package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js +4 -27
  49. package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js.map +1 -1
  50. package/dist/esm/components/AutoPatternsEntityPage/Fields/Url.js +39 -0
  51. package/dist/esm/components/AutoPatternsEntityPage/Fields/Url.js.map +1 -0
  52. package/dist/esm/components/AutoPatternsEntityPage/Fields/types.js +2 -0
  53. package/dist/esm/components/AutoPatternsEntityPage/Fields/types.js.map +1 -0
  54. package/dist/esm/components/AutoPatternsEntityPage/Fields/utils/dates.js +10 -0
  55. package/dist/esm/components/AutoPatternsEntityPage/Fields/utils/dates.js.map +1 -0
  56. package/dist/esm/index.js +2 -0
  57. package/dist/esm/index.js.map +1 -1
  58. package/dist/esm/types/types.js.map +1 -1
  59. package/dist/types/collectionData/cms/CmsCollectionData.d.ts +2 -2
  60. package/dist/types/collectionData/cms/CmsCollectionData.d.ts.map +1 -1
  61. package/dist/types/collectionData/cms/filterUtils.d.ts.map +1 -1
  62. package/dist/types/components/AutoPatternsEntityPage/AutoPatternsEntityPage.d.ts.map +1 -1
  63. package/dist/types/components/AutoPatternsEntityPage/Fields/Checkbox.d.ts +1 -1
  64. package/dist/types/components/AutoPatternsEntityPage/Fields/Checkbox.d.ts.map +1 -1
  65. package/dist/types/components/AutoPatternsEntityPage/Fields/DateInput.d.ts +6 -0
  66. package/dist/types/components/AutoPatternsEntityPage/Fields/DateInput.d.ts.map +1 -0
  67. package/dist/types/components/AutoPatternsEntityPage/Fields/DateTime.d.ts +6 -0
  68. package/dist/types/components/AutoPatternsEntityPage/Fields/DateTime.d.ts.map +1 -0
  69. package/dist/types/components/AutoPatternsEntityPage/Fields/FormFieldInput.d.ts +2 -8
  70. package/dist/types/components/AutoPatternsEntityPage/Fields/FormFieldInput.d.ts.map +1 -1
  71. package/dist/types/components/AutoPatternsEntityPage/Fields/LongText.d.ts +6 -0
  72. package/dist/types/components/AutoPatternsEntityPage/Fields/LongText.d.ts.map +1 -0
  73. package/dist/types/components/AutoPatternsEntityPage/Fields/Number.d.ts +6 -0
  74. package/dist/types/components/AutoPatternsEntityPage/Fields/Number.d.ts.map +1 -0
  75. package/dist/types/components/AutoPatternsEntityPage/Fields/ShortText.d.ts +2 -9
  76. package/dist/types/components/AutoPatternsEntityPage/Fields/ShortText.d.ts.map +1 -1
  77. package/dist/types/components/AutoPatternsEntityPage/Fields/Url.d.ts +6 -0
  78. package/dist/types/components/AutoPatternsEntityPage/Fields/Url.d.ts.map +1 -0
  79. package/dist/types/components/AutoPatternsEntityPage/Fields/types.d.ts +11 -0
  80. package/dist/types/components/AutoPatternsEntityPage/Fields/types.d.ts.map +1 -0
  81. package/dist/types/components/AutoPatternsEntityPage/Fields/utils/dates.d.ts +3 -0
  82. package/dist/types/components/AutoPatternsEntityPage/Fields/utils/dates.d.ts.map +1 -0
  83. package/dist/types/index.d.ts +2 -0
  84. package/dist/types/index.d.ts.map +1 -1
  85. package/dist/types/types/types.d.ts +3 -5
  86. package/dist/types/types/types.d.ts.map +1 -1
  87. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"names":["React","EntityPage","useEntity","useEntityPage","useForm","Box","Card","Cell","FormFieldInput","useParams","useSchema","AutoPatternsEntityPage","_ref","configuration","title","subtitle","visibleFieldIds","collectionPagePath","parentPath","form","params","entityId","schema","state","onSave","_state$entity","formValues","getValues","updatedEntity","entity","newUpdatedEntity","_id","actions","update","create","saveErrorToast","fetch","undefined","get","createElement","dataHook","Header","text","displayField","Content","MainContent","minHeight","Divider","gap","direction","map","fieldId","Fragment","key","span","field","fields"],"sources":["../../../../src/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx"],"sourcesContent":["import React from 'react';\nimport { EntityPageConfig } from '../../types';\nimport {\n EntityPage,\n EntityPageState,\n useEntity,\n useEntityPage,\n} from '@wix/patterns';\nimport { useForm } from '@wix/patterns/form';\nimport { Box, Card, Cell } from '@wix/design-system';\nimport { FormFieldInput } from './Fields/FormFieldInput';\nimport { useParams } from 'react-router-dom';\nimport { useSchema } from '../../providers/SchemaContext';\n\nexport interface AutoPatternsEntityPageProps {\n configuration: EntityPageConfig;\n}\n\nexport const AutoPatternsEntityPage: React.FC<AutoPatternsEntityPageProps> = ({\n configuration,\n}) => {\n const {\n title,\n subtitle,\n visibleFieldIds = [],\n collectionPagePath: parentPath,\n } = configuration;\n const form = useForm<any>();\n const params = useParams();\n const entityId = params.entityId;\n const schema = useSchema();\n const state: EntityPageState<any> = useEntityPage<any, any>({\n parentPath,\n form,\n onSave: async () => {\n const formValues = form.getValues();\n const updatedEntity: any = {\n ...state.entity,\n ...formValues,\n };\n\n let newUpdatedEntity;\n // TODO: Works only for CMS collections, need to be extracted from collection data somehow or share similar context\n if (state.entity?._id) {\n newUpdatedEntity = await schema.actions.update(updatedEntity);\n } else {\n newUpdatedEntity = await schema.actions.create(updatedEntity);\n }\n\n return { updatedEntity: newUpdatedEntity };\n },\n saveErrorToast: () => 'Failed to save',\n fetch: async () => {\n if (!entityId) {\n return { entity: undefined };\n }\n\n const entity = await schema.actions.get(entityId);\n return { entity };\n },\n });\n const entity = useEntity<any, any>(state);\n\n return (\n <EntityPage state={state} dataHook=\"auto-patterns-entity-page\">\n <EntityPage.Header\n title={\n title ?? { text: entity?.[schema.displayField] ?? 'Edit Entity' }\n }\n subtitle={subtitle}\n />\n <EntityPage.Content>\n <EntityPage.MainContent>\n <EntityPage.Card minHeight=\"50px\">\n <Card.Header\n title=\"Item details\"\n subtitle=\"Modify the details of your selected item below\"\n />\n <Card.Divider />\n <Card.Content>\n <Box gap=\"SP2\" direction=\"vertical\">\n {visibleFieldIds.map((fieldId) => (\n <React.Fragment key={fieldId}>\n <Cell span={12}>\n <FormFieldInput\n key={fieldId}\n field={schema.fields[fieldId]}\n />\n </Cell>\n </React.Fragment>\n ))}\n </Box>\n </Card.Content>\n </EntityPage.Card>\n </EntityPage.MainContent>\n </EntityPage.Content>\n </EntityPage>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AA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eAAe,CAACkC,GAAG,CAAEC,OAAO,iBAC3BnD,KAAA,CAAAuC,aAAA,CAACvC,KAAK,CAACoD,QAAQ;IAACC,GAAG,EAAEF;EAAQ,gBAC3BnD,KAAA,CAAAuC,aAAA,CAAChC,IAAI;IAAC+C,IAAI,EAAE;EAAG,gBACbtD,KAAA,CAAAuC,aAAA,CAAC/B,cAAc;IACb6C,GAAG,EAAEF,OAAQ;IACbI,KAAK,EAAEjC,MAAM,CAACkC,MAAM,CAACL,OAAO;EAAE,CAC/B,CACG,CACQ,CACjB,CACE,CACO,CACC,CACK,CACN,CACV,CAAC;AAEjB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","EntityPage","useEntity","useEntityPage","useForm","Box","Card","Cell","FormFieldInput","useParams","useSchema","AutoPatternsEntityPage","_ref","configuration","title","subtitle","visibleFieldIds","collectionPagePath","parentPath","form","params","entityId","schema","state","onSave","formValues","getValues","updatedEntity","entity","newUpdatedEntity","actions","update","create","saveErrorToast","fetch","undefined","get","createElement","dataHook","Header","text","displayField","Content","MainContent","minHeight","Divider","gap","direction","map","fieldId","Fragment","key","span","field","fields"],"sources":["../../../../src/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx"],"sourcesContent":["import React from 'react';\nimport { EntityPageConfig } from '../../types';\nimport {\n EntityPage,\n EntityPageState,\n useEntity,\n useEntityPage,\n} from '@wix/patterns';\nimport { useForm } from '@wix/patterns/form';\nimport { Box, Card, Cell } from '@wix/design-system';\nimport { FormFieldInput } from './Fields/FormFieldInput';\nimport { useParams } from 'react-router-dom';\nimport { useSchema } from '../../providers/SchemaContext';\n\nexport interface AutoPatternsEntityPageProps {\n configuration: EntityPageConfig;\n}\n\nexport const AutoPatternsEntityPage: React.FC<AutoPatternsEntityPageProps> = ({\n configuration,\n}) => {\n const {\n title,\n subtitle,\n visibleFieldIds = [],\n collectionPagePath: parentPath,\n } = configuration;\n const form = useForm<any>();\n const params = useParams();\n const entityId = params.entityId;\n const schema = useSchema();\n const state: EntityPageState<any> = useEntityPage<any, any>({\n parentPath,\n form,\n onSave: async () => {\n const formValues = form.getValues();\n const updatedEntity: any = {\n ...state.entity,\n ...formValues,\n };\n\n let newUpdatedEntity;\n if (entityId) {\n newUpdatedEntity = await schema.actions.update(updatedEntity);\n } else {\n newUpdatedEntity = await schema.actions.create(updatedEntity);\n }\n\n return { updatedEntity: newUpdatedEntity };\n },\n saveErrorToast: () => 'Failed to save',\n fetch: async () => {\n if (!entityId) {\n return { entity: undefined };\n }\n\n const entity = await schema.actions.get(entityId);\n return { entity };\n },\n });\n const entity = useEntity(state);\n\n return (\n <EntityPage state={state} dataHook=\"auto-patterns-entity-page\">\n <EntityPage.Header\n title={\n title ?? { text: entity?.[schema.displayField] ?? 'Edit Entity' }\n }\n subtitle={subtitle}\n />\n <EntityPage.Content>\n <EntityPage.MainContent>\n <EntityPage.Card minHeight=\"50px\">\n <Card.Header\n title=\"Item details\"\n subtitle=\"Modify the details of your selected item below\"\n />\n <Card.Divider />\n <Card.Content>\n <Box gap=\"SP2\" direction=\"vertical\">\n {visibleFieldIds.map((fieldId) => (\n <React.Fragment key={fieldId}>\n <Cell span={12}>\n <FormFieldInput\n key={fieldId}\n field={schema.fields[fieldId]}\n />\n </Cell>\n </React.Fragment>\n ))}\n </Box>\n </Card.Content>\n </EntityPage.Card>\n </EntityPage.MainContent>\n </EntityPage.Content>\n </EntityPage>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SACEC,UAAU,EAEVC,SAAS,EACTC,aAAa,QACR,eAAe;AACtB,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,GAAG,EAAEC,IAAI,EAAEC,IAAI,QAAQ,oBAAoB;AACpD,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,SAAS,QAAQ,+BAA+B;AAMzD,OAAO,MAAMC,sBAA6D,GAAGC,IAAA,IAEvE;EAAA,IAFwE;IA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ignoreList":[]}
@@ -1,16 +1,14 @@
1
- import React, { useState } from 'react';
1
+ import React from 'react';
2
2
  import { Checkbox as CheckboxWSR } from '@wix/design-system';
3
3
  export const Checkbox = props => {
4
4
  const {
5
5
  field,
6
- initialValue,
7
- onChange
6
+ onChange,
7
+ value
8
8
  } = props;
9
- const [value, setValue] = useState(initialValue);
10
9
  return /*#__PURE__*/React.createElement(CheckboxWSR, {
11
10
  checked: value,
12
11
  onChange: e => {
13
- setValue(e.target.checked);
14
12
  onChange(e.target.checked);
15
13
  },
16
14
  dataHook: `checkbox-${field.id}`
@@ -1 +1 @@
1
- {"version":3,"names":["React","useState","Checkbox","CheckboxWSR","props","field","initialValue","onChange","value","setValue","createElement","checked","e","target","dataHook","id","displayName"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/Checkbox.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Checkbox as CheckboxWSR } from '@wix/design-system';\nimport { BaseInputProps } from './FormFieldInput';\n\nexport interface CheckboxProps extends BaseInputProps<boolean> {}\n\nexport const Checkbox = (props: CheckboxProps) => {\n const { field, initialValue, onChange } = props;\n const [value, setValue] = useState(initialValue);\n\n return (\n <CheckboxWSR\n checked={value}\n onChange={(e) => {\n setValue(e.target.checked);\n onChange(e.target.checked);\n }}\n dataHook={`checkbox-${field.id}`}\n >\n {field.displayName}\n </CheckboxWSR>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,QAAQ,IAAIC,WAAW,QAAQ,oBAAoB;AAK5D,OAAO,MAAMD,QAAQ,GAAIE,KAAoB,IAAK;EAChD,MAAM;IAAEC,KAAK;IAAEC,YAAY;IAAEC;EAAS,CAAC,GAAGH,KAAK;EAC/C,MAAM,CAACI,KAAK,EAAEC,QAAQ,CAAC,GAAGR,QAAQ,CAACK,YAAY,CAAC;EAEhD,oBACEN,KAAA,CAAAU,aAAA,CAACP,WAAW;IACVQ,OAAO,EAAEH,KAAM;IACfD,QAAQ,EAAGK,CAAC,IAAK;MACfH,QAAQ,CAACG,CAAC,CAACC,MAAM,CAACF,OAAO,CAAC;MAC1BJ,QAAQ,CAACK,CAAC,CAACC,MAAM,CAACF,OAAO,CAAC;IAC5B,CAAE;IACFG,QAAQ,EAAE,YAAYT,KAAK,CAACU,EAAE;EAAG,GAEhCV,KAAK,CAACW,WACI,CAAC;AAElB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","Checkbox","CheckboxWSR","props","field","onChange","value","createElement","checked","e","target","dataHook","id","displayName"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/Checkbox.tsx"],"sourcesContent":["import React from 'react';\nimport { Checkbox as CheckboxWSR } from '@wix/design-system';\nimport { BaseInputProps } from './types';\n\nexport interface CheckboxProps extends BaseInputProps<boolean> {}\n\nexport const Checkbox = (props: CheckboxProps) => {\n const { field, onChange, value } = props;\n\n return (\n <CheckboxWSR\n checked={value}\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n dataHook={`checkbox-${field.id}`}\n >\n {field.displayName}\n </CheckboxWSR>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,IAAIC,WAAW,QAAQ,oBAAoB;AAK5D,OAAO,MAAMD,QAAQ,GAAIE,KAAoB,IAAK;EAChD,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAGH,KAAK;EAExC,oBACEH,KAAA,CAAAO,aAAA,CAACL,WAAW;IACVM,OAAO,EAAEF,KAAM;IACfD,QAAQ,EAAGI,CAAC,IAAK;MACfJ,QAAQ,CAACI,CAAC,CAACC,MAAM,CAACF,OAAO,CAAC;IAC5B,CAAE;IACFG,QAAQ,EAAE,YAAYP,KAAK,CAACQ,EAAE;EAAG,GAEhCR,KAAK,CAACS,WACI,CAAC;AAElB,CAAC","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ import React, { useRef, useState } from 'react';
2
+ import { FormField, DatePicker } from '@wix/design-system';
3
+ import { getDateWithoutTimezone, getISODateStringWithFixedTimezone } from './utils/dates';
4
+ export const DateInput = props => {
5
+ const {
6
+ field,
7
+ value,
8
+ onChange
9
+ } = props;
10
+ const [date, setDate] = useState(() => value ? getDateWithoutTimezone(getISODateStringWithFixedTimezone(value)) : undefined);
11
+ const ref = useRef({});
12
+ const [statusMessage, setStatusMessage] = useState('');
13
+ return /*#__PURE__*/React.createElement(FormField, {
14
+ label: field.displayName
15
+ }, /*#__PURE__*/React.createElement(DatePicker, {
16
+ dataHook: `date-${field.id}`,
17
+ width: "100%",
18
+ value: date,
19
+ onChange: newValue => {
20
+ const formattedDate = getISODateStringWithFixedTimezone(newValue);
21
+ setDate(newValue);
22
+ onChange(formattedDate.split('T')[0]);
23
+ },
24
+ onValidate: _ref => {
25
+ let {
26
+ validationType,
27
+ value: newValue
28
+ } = _ref;
29
+ if (validationType === 'valid') {
30
+ setStatusMessage('');
31
+ ref.current.invalid = false;
32
+ } else if (validationType === 'formatError' && newValue === '') {
33
+ setDate(undefined);
34
+ onChange(null);
35
+ setStatusMessage('');
36
+ ref.current.invalid = false;
37
+ } else {
38
+ setStatusMessage('Invalid date');
39
+ ref.current.invalid = true;
40
+ }
41
+ },
42
+ status: ref.current.invalid ? 'error' : undefined,
43
+ statusMessage: statusMessage
44
+ }));
45
+ };
46
+ //# sourceMappingURL=DateInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useRef","useState","FormField","DatePicker","getDateWithoutTimezone","getISODateStringWithFixedTimezone","DateInput","props","field","value","onChange","date","setDate","undefined","ref","statusMessage","setStatusMessage","createElement","label","displayName","dataHook","id","width","newValue","formattedDate","split","onValidate","_ref","validationType","current","invalid","status"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/DateInput.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { FormField, DatePicker } from '@wix/design-system';\nimport {\n getDateWithoutTimezone,\n getISODateStringWithFixedTimezone,\n} from './utils/dates';\nimport { BaseInputProps, BaseInputRef } from './types';\n\nexport interface DateProps extends BaseInputProps<string | null> {}\n\nexport const DateInput = (props: DateProps) => {\n const { field, value, onChange } = props;\n\n const [date, setDate] = useState<Date | undefined>(() =>\n value\n ? getDateWithoutTimezone(getISODateStringWithFixedTimezone(value))\n : undefined,\n );\n\n const ref = useRef<BaseInputRef>({});\n const [statusMessage, setStatusMessage] = useState('');\n\n return (\n <FormField label={field.displayName}>\n <DatePicker\n dataHook={`date-${field.id}`}\n width=\"100%\"\n value={date}\n onChange={(newValue: Date) => {\n const formattedDate = getISODateStringWithFixedTimezone(newValue);\n setDate(newValue);\n onChange(formattedDate.split('T')[0]);\n }}\n onValidate={({ validationType, value: newValue }) => {\n if (validationType === 'valid') {\n setStatusMessage('');\n ref.current.invalid = false;\n } else if (validationType === 'formatError' && newValue === '') {\n setDate(undefined);\n onChange(null);\n setStatusMessage('');\n ref.current.invalid = false;\n } else {\n setStatusMessage('Invalid date');\n ref.current.invalid = true;\n }\n }}\n status={ref.current.invalid ? 'error' : undefined}\n statusMessage={statusMessage}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/C,SAASC,SAAS,EAAEC,UAAU,QAAQ,oBAAoB;AAC1D,SACEC,sBAAsB,EACtBC,iCAAiC,QAC5B,eAAe;AAKtB,OAAO,MAAMC,SAAS,GAAIC,KAAgB,IAAK;EAC7C,MAAM;IAAEC,KAAK;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGH,KAAK;EAExC,MAAM,CAACI,IAAI,EAAEC,OAAO,CAAC,GAAGX,QAAQ,CAAmB,MACjDQ,KAAK,GACDL,sBAAsB,CAACC,iCAAiC,CAACI,KAAK,CAAC,CAAC,GAChEI,SACN,CAAC;EAED,MAAMC,GAAG,GAAGd,MAAM,CAAe,CAAC,CAAC,CAAC;EACpC,MAAM,CAACe,aAAa,EAAEC,gBAAgB,CAAC,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ef, useMemo, useState } from 'react';
2
+ import { Cell, DatePicker, FormField, Layout, TimeInput } from '@wix/design-system';
3
+ export const DateTime = props => {
4
+ const {
5
+ field,
6
+ value,
7
+ onChange
8
+ } = props;
9
+ const date = useMemo(() => {
10
+ if (!value) {
11
+ return undefined;
12
+ }
13
+ const d = new Date(value);
14
+ return isNaN(d.getTime()) ? undefined : d;
15
+ }, [value]);
16
+ const [statusMessage, setStatusMessage] = useState('');
17
+ const ref = useRef({});
18
+ const dateRef = useRef({});
19
+ const timeRef = useRef({});
20
+ const [dateValue, setDateValue] = useState(date == null ? void 0 : date.getDate());
21
+ const [timeValue, setTimeValue] = useState(date == null ? void 0 : date.getTime());
22
+ return /*#__PURE__*/React.createElement(FormField, {
23
+ label: field.displayName
24
+ }, /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Cell, {
25
+ span: 6
26
+ }, /*#__PURE__*/React.createElement(DatePicker, {
27
+ width: "100%",
28
+ value: date
29
+ // onChange is triggered only when you have valid, non-empty value. and onValidate is triggered on every change to we use onValidate
30
+ ,
31
+ onChange: () => {},
32
+ onValidate: _ref => {
33
+ let {
34
+ validationType,
35
+ value: newValue
36
+ } = _ref;
37
+ if (validationType === 'valid') {
38
+ const dateWithNewDate = date ? new Date(date) : new Date(newValue);
39
+ const _value = new Date(newValue);
40
+ dateWithNewDate.setFullYear(_value.getFullYear());
41
+ dateWithNewDate.setMonth(_value.getMonth());
42
+ dateWithNewDate.setDate(_value.getDate());
43
+ onChange(dateWithNewDate.toISOString());
44
+ setDateValue(new Date(newValue).getDate());
45
+ setStatusMessage('');
46
+ dateRef.current.invalid = false;
47
+ } else if (validationType === 'formatError' && value === '') {
48
+ setStatusMessage('');
49
+ dateRef.current.invalid = false;
50
+ setDateValue(value);
51
+ if (!timeValue) {
52
+ onChange(null);
53
+ }
54
+ } else {
55
+ setStatusMessage('Invalid date');
56
+ dateRef.current.invalid = true;
57
+ }
58
+ ref.current.invalid = dateRef.current.invalid || timeRef.current.invalid;
59
+ },
60
+ status: ref.current.invalid ? 'error' : undefined,
61
+ statusMessage: statusMessage,
62
+ dataHook: `datetime-date-${field.id}`
63
+ })), /*#__PURE__*/React.createElement(Cell, {
64
+ span: 6
65
+ }, /*#__PURE__*/React.createElement(TimeInput, {
66
+ dataHook: `datetime-time-${field.id}`,
67
+ value: date ?? null,
68
+ invalidMessage: "Invalid time",
69
+ onInvalid: () => {
70
+ timeRef.current.invalid = true;
71
+ ref.current.invalid = dateRef.current.invalid || timeRef.current.invalid;
72
+ },
73
+ onChange: _ref2 => {
74
+ let {
75
+ date: newValue
76
+ } = _ref2;
77
+ timeRef.current.invalid = false;
78
+ ref.current.invalid = dateRef.current.invalid || timeRef.current.invalid;
79
+ if (newValue) {
80
+ const dateWithNewTime = date ? new Date(date) : newValue;
81
+ dateWithNewTime.setHours(newValue.getHours());
82
+ dateWithNewTime.setMinutes(newValue.getMinutes());
83
+ dateWithNewTime.setSeconds(newValue.getSeconds());
84
+ dateWithNewTime.setMilliseconds(newValue.getMilliseconds());
85
+ onChange(dateWithNewTime.toISOString());
86
+ } else if (!ref.current.invalid) {
87
+ if (!newValue) {
88
+ setTimeValue('');
89
+ if (!dateValue) {
90
+ onChange(null);
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }))));
96
+ };
97
+ //# sourceMappingURL=DateTime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useRef","useMemo","useState","Cell","DatePicker","FormField","Layout","TimeInput","DateTime","props","field","value","onChange","date","undefined","d","Date","isNaN","getTime","statusMessage","setStatusMessage","ref","dateRef","timeRef","dateValue","setDateValue","getDate","timeValue","setTimeValue","createElement","label","displayName","span","width","onValidate","_ref","validationType","newValue","dateWithNewDate","_value","setFullYear","getFullYear","setMonth","getMonth","setDate","toISOString","current","invalid","status","dataHook","id","invalidMessage","onInvalid","_ref2","dateWithNewTime","setHours","getHours","setMinutes","getMinutes","setSeconds","getSeconds","setMilliseconds","getMilliseconds"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/DateTime.tsx"],"sourcesContent":["import React, { useRef, useMemo, useState } from 'react';\nimport {\n Cell,\n DatePicker,\n FormField,\n Layout,\n TimeInput,\n} from '@wix/design-system';\nimport { BaseInputProps, BaseInputRef } from './types';\n\nexport interface DateTimeProps extends BaseInputProps<string | null> {}\nexport const DateTime = (props: DateTimeProps) => {\n const { field, value, onChange } = props;\n\n const date = useMemo(() => {\n if (!value) {\n return undefined;\n }\n const d = new Date(value);\n return isNaN(d.getTime()) ? undefined : d;\n }, [value]);\n const [statusMessage, setStatusMessage] = useState('');\n\n const ref = useRef<BaseInputRef>({});\n const dateRef = useRef<BaseInputRef>({});\n const timeRef = useRef<BaseInputRef>({});\n const [dateValue, setDateValue] = useState<number | string | undefined>(\n date?.getDate(),\n );\n const [timeValue, setTimeValue] = useState<number | string | undefined>(\n date?.getTime(),\n );\n\n return (\n <FormField label={field.displayName}>\n <Layout>\n <Cell span={6}>\n <DatePicker\n width=\"100%\"\n value={date}\n // onChange is triggered only when you have valid, non-empty value. and onValidate is triggered on every change to we use onValidate\n onChange={() => {}}\n onValidate={({ validationType, value: newValue }) => {\n if (validationType === 'valid') {\n const dateWithNewDate = date\n ? new Date(date)\n : new Date(newValue);\n const _value = new Date(newValue);\n dateWithNewDate.setFullYear(_value.getFullYear());\n dateWithNewDate.setMonth(_value.getMonth());\n dateWithNewDate.setDate(_value.getDate());\n onChange(dateWithNewDate.toISOString());\n setDateValue(new Date(newValue).getDate());\n setStatusMessage('');\n dateRef.current.invalid = false;\n } else if (validationType === 'formatError' && value === '') {\n setStatusMessage('');\n dateRef.current.invalid = false;\n setDateValue(value);\n if (!timeValue) {\n onChange(null);\n }\n } else {\n setStatusMessage('Invalid date');\n dateRef.current.invalid = true;\n }\n\n ref.current.invalid =\n dateRef.current.invalid || timeRef.current.invalid;\n }}\n status={ref.current.invalid ? 'error' : undefined}\n statusMessage={statusMessage}\n dataHook={`datetime-date-${field.id}`}\n />\n </Cell>\n <Cell span={6}>\n <TimeInput\n dataHook={`datetime-time-${field.id}`}\n value={date ?? null}\n invalidMessage=\"Invalid time\"\n onInvalid={() => {\n timeRef.current.invalid = true;\n ref.current.invalid =\n dateRef.current.invalid || timeRef.current.invalid;\n }}\n onChange={({ date: newValue }) => {\n timeRef.current.invalid = false;\n ref.current.invalid =\n dateRef.current.invalid || timeRef.current.invalid;\n\n if (newValue) {\n const dateWithNewTime = date ? new Date(date) : newValue;\n dateWithNewTime.setHours(newValue.getHours());\n dateWithNewTime.setMinutes(newValue.getMinutes());\n dateWithNewTime.setSeconds(newValue.getSeconds());\n dateWithNewTime.setMilliseconds(newValue.getMilliseconds());\n onChange(dateWithNewTime.toISOString());\n } else if (!ref.current.invalid) {\n if (!newValue) {\n setTimeValue('');\n if (!dateValue) {\n onChange(null);\n }\n }\n }\n }}\n />\n </Cell>\n </Layout>\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SACEC,IAAI,EACJC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,SAAS,QACJ,oBAAoB;AAI3B,OAAO,MAAMC,QAAQ,GAAIC,KAAoB,IAAK;EAChD,MAAM;IAAEC,KAAK;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGH,KAAK;EAExC,MAAMI,IAAI,GAAGZ,OAAO,CAAC,MAAM;IACzB,IAAI,CAACU,KAAK,EAAE;MACV,OAAOG,SAAS;IAClB;IACA,MAAMC,CAAC,GAAG,IAAIC,IAAI,CAACL,KAAK,CAAC;IACzB,OAAOM,KAAK,CAACF,CAAC,CAACG,OAAO,CAAC,CAAC,CAAC,GAAGJ,SAAS,GAAGC,CAAC;EAC3C,CAAC,EAAE,CAACJ,KAAK,CAAC,CAAC;EACX,MAAM,CAACQ,aAAa,EAAEC,gBAAgB,CAAC,GAAGlB,QAAQ,CAAC,EAAE,CAAC;EAEtD,MAAMmB,GAAG,GAAGr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O,GAAG,IAAI;MAC9B1B,GAAG,CAACyB,OAAO,CAACC,OAAO,GACjBzB,OAAO,CAACwB,OAAO,CAACC,OAAO,IAAIxB,OAAO,CAACuB,OAAO,CAACC,OAAO;IACtD,CAAE;IACFnC,QAAQ,EAAEyC,KAAA,IAAwB;MAAA,IAAvB;QAAExC,IAAI,EAAEwB;MAAS,CAAC,GAAAgB,KAAA;MAC3B9B,OAAO,CAACuB,OAAO,CAACC,OAAO,GAAG,KAAK;MAC/B1B,GAAG,CAACyB,OAAO,CAACC,OAAO,GACjBzB,OAAO,CAACwB,OAAO,CAACC,OAAO,IAAIxB,OAAO,CAACuB,OAAO,CAACC,OAAO;MAEpD,IAAIV,QAAQ,EAAE;QACZ,MAAMiB,eAAe,GAAGzC,IAAI,GAAG,IAAIG,IAAI,CAACH,IAAI,CAAC,GAAGwB,QAAQ;QACxDiB,eAAe,CAACC,QAAQ,CAAClB,QAAQ,CAACmB,QAAQ,CAAC,CAAC,CAAC;QAC7CF,eAAe,CAACG,UAAU,CAACpB,QAAQ,CAACqB,UAAU,CAAC,CAAC,CAAC;QACjDJ,eAAe,CAACK,UAAU,CAACtB,QAAQ,CAACuB,UAAU,CAAC,CAAC,CAAC;QACjDN,eAAe,CAACO,eAAe,CAACxB,QAAQ,CAACyB,eAAe,CAAC,CAAC,CAAC;QAC3DlD,QAAQ,CAAC0C,eAAe,CAACT,WAAW,CAAC,CAAC,CAAC;MACzC,CAAC,MAAM,IAAI,CAACxB,GAAG,CAACyB,OAAO,CAACC,OAAO,EAAE;QAC/B,IAAI,CAACV,QAAQ,EAAE;UACbT,YAAY,CAAC,EAAE,CAAC;UAChB,IAAI,CAACJ,SAAS,EAAE;YACdZ,QAAQ,CAAC,IAAI,CAAC;UAChB;QACF;MACF;IACF;EAAE,CACH,CACG,CACA,CACC,CAAC;AAEhB,CAAC","ignoreList":[]}
@@ -2,14 +2,23 @@ import React from 'react';
2
2
  import { ShortText } from './ShortText';
3
3
  import { useEntityPageContext } from '@wix/patterns';
4
4
  import { useController } from '@wix/patterns/form';
5
- import { collections } from '@wix/data';
6
5
  import { Checkbox } from './Checkbox';
6
+ import { DateInput } from './DateInput';
7
+ import { DateTime } from './DateTime';
8
+ import { Number } from './Number';
9
+ import { LongText } from './LongText';
10
+ import { Url } from './Url';
7
11
  export const EDITABLE_INPUT_ELEMENTS = {
8
- [collections.Type.TEXT]: ShortText,
9
- [collections.Type.BOOLEAN]: Checkbox
12
+ SHORT_TEXT: ShortText,
13
+ LONG_TEXT: LongText,
14
+ BOOLEAN: Checkbox,
15
+ DATE: DateInput,
16
+ DATETIME: DateTime,
17
+ NUMBER: Number,
18
+ URL: Url
10
19
  };
11
20
  export const FormFieldInput = props => {
12
- var _pageState$entity, _controller$fieldStat;
21
+ var _pageState$entity;
13
22
  const {
14
23
  field
15
24
  } = props;
@@ -19,19 +28,14 @@ export const FormFieldInput = props => {
19
28
  control: pageState.form.control,
20
29
  defaultValue: (_pageState$entity = pageState.entity) == null ? void 0 : _pageState$entity[(field == null ? void 0 : field.id) ?? '']
21
30
  });
22
- if (!field || !EDITABLE_INPUT_ELEMENTS.hasOwnProperty(field.originalType) || !pageState || !pageState.entity) {
31
+ if (!field || !EDITABLE_INPUT_ELEMENTS.hasOwnProperty(field.type) || !pageState || !pageState.entity) {
23
32
  return null;
24
33
  }
25
- const FieldInput = EDITABLE_INPUT_ELEMENTS[field.originalType];
34
+ const FieldInput = EDITABLE_INPUT_ELEMENTS[field.type];
26
35
  return /*#__PURE__*/React.createElement(FieldInput, {
27
36
  field: field,
28
- initialValue: pageState.entity[field.id],
29
- status: controller.fieldState.invalid ? 'error' : undefined,
30
- statusMessage: (_controller$fieldStat = controller.fieldState.error) == null ? void 0 : _controller$fieldStat.message,
31
- inputRef: controller.field.ref,
32
37
  value: controller.field.value,
33
- onChange: controller.field.onChange,
34
- onBlur: controller.field.onBlur
38
+ onChange: controller.field.onChange
35
39
  });
36
40
  };
37
41
  //# sourceMappingURL=FormFieldInput.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","ShortText","useEntityPageContext","useController","collections","Checkbox","EDITABLE_INPUT_ELEMENTS","Type","TEXT","BOOLEAN","FormFieldInput","props","_pageState$entity","_controller$fieldStat","field","pageState","controller","name","id","control","form","defaultValue","entity","hasOwnProperty","originalType","FieldInput","createElement","initialValue","status","fieldState","invalid","undefined","statusMessage","error","message","inputRef","ref","value","onChange","onBlur"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/FormFieldInput.tsx"],"sourcesContent":["import React from 'react';\nimport { ShortText } from './ShortText';\nimport { useEntityPageContext } from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\nimport { Field } from '../../../types';\nimport { collections } from '@wix/data';\nimport { Checkbox } from './Checkbox';\n\nexport interface BaseInputProps<T> {\n field: Field;\n initialValue: T;\n onChange: (newValue: T) => void;\n}\n\nexport const EDITABLE_INPUT_ELEMENTS: Partial<\n Record<collections.Type, React.ComponentType<any>>\n> = {\n [collections.Type.TEXT]: ShortText,\n [collections.Type.BOOLEAN]: Checkbox,\n};\n\nexport interface FormFieldInputProps {\n field?: Field;\n}\n\nexport const FormFieldInput = (props: FormFieldInputProps) => {\n const { field } = props;\n\n const pageState = useEntityPageContext();\n const controller = useController({\n name: field?.id ?? '',\n control: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[field?.id ?? ''],\n });\n\n if (\n !field ||\n !EDITABLE_INPUT_ELEMENTS.hasOwnProperty(field.originalType) ||\n !pageState ||\n !pageState.entity\n ) {\n return null;\n }\n const FieldInput = EDITABLE_INPUT_ELEMENTS[field.originalType]!;\n\n return (\n <FieldInput\n field={field}\n initialValue={(pageState.entity as any)[field.id]}\n status={controller.fieldState.invalid ? 'error' : undefined}\n statusMessage={controller.fieldState.error?.message}\n inputRef={controller.field.ref}\n value={controller.field.value}\n onChange={controller.field.onChange}\n onBlur={controller.field.onBlur}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS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AC5DC,aAAa,GAAAnB,qBAAA,GAAEG,UAAU,CAACa,UAAU,CAACI,KAAK,qBAA3BpB,qBAAA,CAA6BqB,OAAQ;IACpDC,QAAQ,EAAEnB,UAAU,CAACF,KAAK,CAACsB,GAAI;IAC/BC,KAAK,EAAErB,UAAU,CAACF,KAAK,CAACuB,KAAM;IAC9BC,QAAQ,EAAEtB,UAAU,CAACF,KAAK,CAACwB,QAAS;IACpCC,MAAM,EAAEvB,UAAU,CAACF,KAAK,CAACyB;EAAO,CACjC,CAAC;AAEN,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","ShortText","useEntityPageContext","useController","Checkbox","DateInput","DateTime","Number","LongText","Url","EDITABLE_INPUT_ELEMENTS","SHORT_TEXT","LONG_TEXT","BOOLEAN","DATE","DATETIME","NUMBER","URL","FormFieldInput","props","_pageState$entity","field","pageState","controller","name","id","control","form","defaultValue","entity","hasOwnProperty","type","FieldInput","createElement","value","onChange"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/FormFieldInput.tsx"],"sourcesContent":["import React from 'react';\nimport { ShortText } from './ShortText';\nimport { useEntityPageContext } from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\nimport { Field, PatternsFieldType } from '../../../types';\nimport { Checkbox } from './Checkbox';\nimport { DateInput } from './DateInput';\nimport { DateTime } from './DateTime';\nimport { Number } from './Number';\nimport { LongText } from './LongText';\nimport { Url } from './Url';\n\nexport const EDITABLE_INPUT_ELEMENTS: Partial<\n Record<PatternsFieldType, React.ComponentType<any>>\n> = {\n SHORT_TEXT: ShortText,\n LONG_TEXT: LongText,\n BOOLEAN: Checkbox,\n DATE: DateInput,\n DATETIME: DateTime,\n NUMBER: Number,\n URL: Url,\n};\n\nexport interface FormFieldInputProps {\n field?: Field;\n}\n\nexport const FormFieldInput = (props: FormFieldInputProps) => {\n const { field } = props;\n\n const pageState = useEntityPageContext();\n const controller = useController({\n name: field?.id ?? '',\n control: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[field?.id ?? ''],\n });\n\n if (\n !field ||\n !EDITABLE_INPUT_ELEMENTS.hasOwnProperty(field.type) ||\n !pageState ||\n !pageState.entity\n ) {\n return null;\n }\n const FieldInput = EDITABLE_INPUT_ELEMENTS[field.type]!;\n\n return (\n <FieldInput\n field={field}\n value={controller.field.value}\n onChange={controller.field.onChange}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,aAAa,QAAQ,oBAAoB;AAElD,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,GAAG,QAAQ,OAAO;AAE3B,OAAO,MAAMC,uBAEZ,GAAG;EACFC,UAAU,EAAEV,SAAS;EACrBW,SAAS,EAAEJ,QAAQ;EACnBK,OAAO,EAAET,QAAQ;EACjBU,IAAI,EAAET,SAAS;EACfU,QAAQ,EAAET,QAAQ;EAClBU,MAAM,EAAET,MAAM;EACdU,GAAG,EAAER;AACP,CAAC;AAMD,OAAO,MAAMS,cAAc,GAAIC,KAA0B,IAAK;EAAA,IAAAC,iBAAA;EAC5D,MAAM;IAAEC;EAAM,CAAC,GAAGF,KAAK;EAEvB,MAAMG,SAAS,GAAGpB,oBAAoB,CAAC,CAAC;EACxC,MAAMqB,UAAU,GAAGpB,aAAa,CAAC;IAC/BqB,IAAI,EAAE,CAAAH,KAAK,oBAALA,KAAK,CAAEI,EAAE,KAAI,EAAE;IACrBC,OAAO,EAAEJ,SAAS,CAACK,IAAI,CAACD,OAAO;IAC/BE,YAAY,GAAAR,iBAAA,GAAGE,SAAS,CAACO,MAAM,qBAAjBT,iBAAA,CAA4B,CAAAC,KAAK,oBAALA,KAAK,CAAEI,EAAE,KAAI,EAAE;EAC3D,CAAC,CAAC;EAEF,IACE,CAACJ,KAAK,IACN,CAACX,uBAAuB,CAACoB,cAAc,CAACT,KAAK,CAACU,IAAI,CAAC,IACnD,CAACT,SAAS,IACV,CAACA,SAAS,CAACO,MAAM,EACjB;IACA,OAAO,IAAI;EACb;EACA,MAAMG,UAAU,GAAGtB,uBAAuB,CAACW,KAAK,CAACU,IAAI,CAAE;EAEvD,oBACE/B,KAAA,CAAAiC,aAAA,CAACD,UAAU;IACTX,KAAK,EAAEA,KAAM;IACba,KAAK,EAAEX,UAAU,CAACF,KAAK,CAACa,KAAM;IAC9BC,QAAQ,EAAEZ,UAAU,CAACF,KAAK,CAACc;EAAS,CACrC,CAAC;AAEN,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { FormField, InputArea } from '@wix/design-system';
3
+ export const LongText = props => {
4
+ const {
5
+ field,
6
+ value,
7
+ onChange
8
+ } = props;
9
+ return /*#__PURE__*/React.createElement(FormField, {
10
+ label: field.displayName
11
+ }, /*#__PURE__*/React.createElement(InputArea, {
12
+ value: value,
13
+ onChange: e => onChange == null ? void 0 : onChange(e.target.value),
14
+ dataHook: `long-text-${field.id}`
15
+ }));
16
+ };
17
+ //# sourceMappingURL=LongText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","FormField","InputArea","LongText","props","field","value","onChange","createElement","label","displayName","e","target","dataHook","id"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/LongText.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, InputArea } from '@wix/design-system';\nimport { BaseInputProps } from './types';\n\nexport interface LongTextProps extends BaseInputProps<string> {}\n\nexport const LongText = (props: LongTextProps) => {\n const { field, value, onChange } = props;\n\n return (\n <FormField label={field.displayName}>\n <InputArea\n value={value}\n onChange={(e) => onChange?.(e.target.value)}\n dataHook={`long-text-${field.id}`}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AAKzD,OAAO,MAAMC,QAAQ,GAAIC,KAAoB,IAAK;EAChD,MAAM;IAAEC,KAAK;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGH,KAAK;EAExC,oBACEJ,KAAA,CAAAQ,aAAA,CAACP,SAAS;IAACQ,KAAK,EAAEJ,KAAK,CAACK;EAAY,gBAClCV,KAAA,CAAAQ,aAAA,CAACN,SAAS;IACRI,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAGI,CAAC,IAAKJ,QAAQ,oBAARA,QAAQ,CAAGI,CAAC,CAACC,MAAM,CAACN,KAAK,CAAE;IAC5CO,QAAQ,EAAE,aAAaR,KAAK,CAACS,EAAE;EAAG,CACnC,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { FormField, NumberInput } from '@wix/design-system';
3
+ export const Number = props => {
4
+ const {
5
+ field,
6
+ value,
7
+ onChange
8
+ } = props;
9
+ return /*#__PURE__*/React.createElement(FormField, {
10
+ label: field.displayName
11
+ }, /*#__PURE__*/React.createElement(NumberInput, {
12
+ value: value || undefined,
13
+ onChange: e => onChange(e),
14
+ dataHook: `number-${field.id}`
15
+ }));
16
+ };
17
+ //# sourceMappingURL=Number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","FormField","NumberInput","Number","props","field","value","onChange","createElement","label","displayName","undefined","e","dataHook","id"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/Number.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, NumberInput } from '@wix/design-system';\nimport { BaseInputProps } from './types';\n\nexport interface NumberProps extends BaseInputProps<number | null> {}\n\nexport const Number = (props: NumberProps) => {\n const { field, value, onChange } = props;\n\n return (\n <FormField label={field.displayName}>\n <NumberInput\n value={value || undefined}\n onChange={(e) => onChange(e)}\n dataHook={`number-${field.id}`}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AAK3D,OAAO,MAAMC,MAAM,GAAIC,KAAkB,IAAK;EAC5C,MAAM;IAAEC,KAAK;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGH,KAAK;EAExC,oBACEJ,KAAA,CAAAQ,aAAA,CAACP,SAAS;IAACQ,KAAK,EAAEJ,KAAK,CAACK;EAAY,gBAClCV,KAAA,CAAAQ,aAAA,CAACN,WAAW;IACVI,KAAK,EAAEA,KAAK,IAAIK,SAAU;IAC1BJ,QAAQ,EAAGK,CAAC,IAAKL,QAAQ,CAACK,CAAC,CAAE;IAC7BC,QAAQ,EAAE,UAAUR,KAAK,CAACS,EAAE;EAAG,CAChC,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
@@ -1,39 +1,16 @@
1
- import React, { useState } from 'react';
1
+ import React from 'react';
2
2
  import { FormField, Input } from '@wix/design-system';
3
- export const useTextInput = _ref => {
4
- let {
5
- initialValue,
6
- onChange
7
- } = _ref;
8
- const [value, setValue] = useState(initialValue || '');
9
- const handleChange = e => {
10
- const newValue = e.target.value;
11
- setValue(newValue);
12
- onChange == null || onChange(newValue);
13
- };
14
- return {
15
- value,
16
- handleChange
17
- };
18
- };
19
3
  export const ShortText = props => {
20
4
  const {
21
5
  field,
22
- initialValue,
23
- onChange
6
+ onChange,
7
+ value
24
8
  } = props;
25
- const {
26
- value,
27
- handleChange
28
- } = useTextInput({
29
- initialValue,
30
- onChange
31
- });
32
9
  return /*#__PURE__*/React.createElement(FormField, {
33
10
  label: field.displayName
34
11
  }, /*#__PURE__*/React.createElement(Input, {
35
12
  value: value,
36
- onChange: handleChange,
13
+ onChange: e => onChange == null ? void 0 : onChange(e.target.value),
37
14
  dataHook: `short-text-${field.id}`
38
15
  }));
39
16
  };
@@ -1 +1 @@
1
- {"version":3,"names":["React","useState","FormField","Input","useTextInput","_ref","initialValue","onChange","value","setValue","handleChange","e","newValue","target","ShortText","props","field","createElement","label","displayName","dataHook","id"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/ShortText.tsx"],"sourcesContent":["import React, { ChangeEvent, useState } from 'react';\nimport { FormField, Input } from '@wix/design-system';\nimport { BaseInputProps } from './FormFieldInput';\n\nexport const useTextInput = ({\n initialValue,\n onChange,\n}: {\n initialValue: string;\n onChange: (value: string) => void;\n}) => {\n const [value, setValue] = useState(initialValue || '');\n\n const handleChange = (\n e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => {\n const newValue = e.target.value;\n\n setValue(newValue);\n onChange?.(newValue);\n };\n\n return {\n value,\n handleChange,\n };\n};\n\nexport interface ShortTextProps extends BaseInputProps<string> {}\n\nexport const ShortText = (props: ShortTextProps) => {\n const { field, initialValue, onChange } = props;\n const { value, handleChange } = useTextInput({\n initialValue,\n onChange,\n });\n\n return (\n <FormField label={field.displayName}>\n <Input\n value={value}\n onChange={handleChange}\n dataHook={`short-text-${field.id}`}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAiBC,QAAQ,QAAQ,OAAO;AACpD,SAASC,SAAS,EAAEC,KAAK,QAAQ,oBAAoB;AAGrD,OAAO,MAAMC,YAAY,GAAGC,IAAA,IAMtB;EAAA,IANuB;IAC3BC,YAAY;IACZC;EAIF,CAAC,GAAAF,IAAA;EACC,MAAM,CAACG,KAAK,EAAEC,QAAQ,CAAC,GAAGR,QAAQ,CAACK,YAAY,IAAI,EAAE,CAAC;EAEtD,MAAMI,YAAY,GAChBC,CAAsD,IACnD;IACH,MAAMC,QAAQ,GAAGD,CAAC,CAACE,MAAM,CAACL,KAAK;IAE/BC,QAAQ,CAACG,QAAQ,CAAC;IAClBL,QAAQ,YAARA,QAAQ,CAAGK,QAAQ,CAAC;EACtB,CAAC;EAED,OAAO;IACLJ,KAAK;IACLE;EACF,CAAC;AACH,CAAC;AAID,OAAO,MAAMI,SAAS,GAAIC,KAAqB,IAAK;EAClD,MAAM;IAAEC,KAAK;IAAEV,YAAY;IAAEC;EAAS,CAAC,GAAGQ,KAAK;EAC/C,MAAM;IAAEP,KAAK;IAAEE;EAAa,CAAC,GAAGN,YAAY,CAAC;IAC3CE,YAAY;IACZC;EACF,CAAC,CAAC;EAEF,oBACEP,KAAA,CAAAiB,aAAA,CAACf,SAAS;IAACgB,KAAK,EAAEF,KAAK,CAACG;EAAY,gBAClCnB,KAAA,CAAAiB,aAAA,CAACd,KAAK;IACJK,KAAK,EAAEA,KAAM;IACbD,QAAQ,EAAEG,YAAa;IACvBU,QAAQ,EAAE,cAAcJ,KAAK,CAACK,EAAE;EAAG,CACpC,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","FormField","Input","ShortText","props","field","onChange","value","createElement","label","displayName","e","target","dataHook","id"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/ShortText.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, Input } from '@wix/design-system';\nimport { BaseInputProps } from './types';\n\nexport interface ShortTextProps extends BaseInputProps<string> {}\n\nexport const ShortText = (props: ShortTextProps) => {\n const { field, onChange, value } = props;\n return (\n <FormField label={field.displayName}>\n <Input\n value={value}\n onChange={(e) => onChange?.(e.target.value)}\n dataHook={`short-text-${field.id}`}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,KAAK,QAAQ,oBAAoB;AAKrD,OAAO,MAAMC,SAAS,GAAIC,KAAqB,IAAK;EAClD,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAGH,KAAK;EACxC,oBACEJ,KAAA,CAAAQ,aAAA,CAACP,SAAS;IAACQ,KAAK,EAAEJ,KAAK,CAACK;EAAY,gBAClCV,KAAA,CAAAQ,aAAA,CAACN,KAAK;IACJK,KAAK,EAAEA,KAAM;IACbD,QAAQ,EAAGK,CAAC,IAAKL,QAAQ,oBAARA,QAAQ,CAAGK,CAAC,CAACC,MAAM,CAACL,KAAK,CAAE;IAC5CM,QAAQ,EAAE,cAAcR,KAAK,CAACS,EAAE;EAAG,CACpC,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { useRef, useState } from 'react';
3
+ import { FormField, Input } from '@wix/design-system';
4
+ import { Link } from '@wix/wix-ui-icons-common';
5
+ export const Url = props => {
6
+ const {
7
+ field,
8
+ value,
9
+ onChange
10
+ } = props;
11
+ const ref = useRef({});
12
+ const [fieldsStatus, setFieldStatus] = useState({});
13
+ // Same regex as data-extensions https://github.com/wix-private/server-infra/blob/a6c3009d39bbb0312c929f68ee81c559e1eb5b4e/iptf/dataextensions/src/main/scala/com/wixpress/infra/dataextensions/runtime/validator/Formats.scala#L31
14
+ const uriPattern = /^[A-Za-z][A-Za-z0-9+.-]*:(\/\/([A-Za-z0-9._~\-%!$&'()*+,;=:]*@)?[A-Za-z0-9._~\-!$&'()*+,;=%:\[\]]*(:[0-9]*)?)?[A-Za-z0-9._~\-%!$&'()*+,;=:@\/]*([?][A-Za-z0-9._~\-%!$&'()*+,;=:@\/?]*)?([#][A-Za-z0-9._~\-%!$&'()*+,;=:@\/?]*)?$/;
15
+ return /*#__PURE__*/React.createElement(FormField, _extends({
16
+ label: field.displayName
17
+ }, fieldsStatus), /*#__PURE__*/React.createElement(Input, {
18
+ prefix: /*#__PURE__*/React.createElement(Input.IconAffix, null, /*#__PURE__*/React.createElement(Link, null)),
19
+ placeholder: "https://www.wix.com",
20
+ dataHook: `url-${field.id}`,
21
+ value: value,
22
+ onChange: e => onChange == null ? void 0 : onChange(e.target.value),
23
+ onBlur: () => {
24
+ ref.current.invalid = value ? !uriPattern.test(value) : false;
25
+ if (ref.current.invalid) {
26
+ setFieldStatus({
27
+ status: 'error',
28
+ statusMessage: 'Invalid URL'
29
+ });
30
+ } else {
31
+ setFieldStatus({
32
+ status: undefined,
33
+ statusMessage: undefined
34
+ });
35
+ }
36
+ }
37
+ }));
38
+ };
39
+ //# sourceMappingURL=Url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useRef","useState","FormField","Input","Link","Url","props","field","value","onChange","ref","fieldsStatus","setFieldStatus","uriPattern","createElement","_extends","label","displayName","prefix","IconAffix","placeholder","dataHook","id","e","target","onBlur","current","invalid","test","status","statusMessage","undefined"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/Url.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { FormField, Input, StatusType } from '@wix/design-system';\nimport { BaseInputProps, BaseInputRef } from './types';\nimport { Link } from '@wix/wix-ui-icons-common';\n\nexport interface UrlProps extends BaseInputProps<string> {}\n\nexport const Url = (props: UrlProps) => {\n const { field, value, onChange } = props;\n const ref = useRef<BaseInputRef>({});\n const [fieldsStatus, setFieldStatus] = useState<{\n status?: StatusType;\n statusMessage?: string;\n }>({});\n // Same regex as data-extensions https://github.com/wix-private/server-infra/blob/a6c3009d39bbb0312c929f68ee81c559e1eb5b4e/iptf/dataextensions/src/main/scala/com/wixpress/infra/dataextensions/runtime/validator/Formats.scala#L31\n const uriPattern =\n /^[A-Za-z][A-Za-z0-9+.-]*:(\\/\\/([A-Za-z0-9._~\\-%!$&'()*+,;=:]*@)?[A-Za-z0-9._~\\-!$&'()*+,;=%:\\[\\]]*(:[0-9]*)?)?[A-Za-z0-9._~\\-%!$&'()*+,;=:@\\/]*([?][A-Za-z0-9._~\\-%!$&'()*+,;=:@\\/?]*)?([#][A-Za-z0-9._~\\-%!$&'()*+,;=:@\\/?]*)?$/;\n\n return (\n <FormField label={field.displayName} {...fieldsStatus}>\n <Input\n prefix={\n <Input.IconAffix>\n <Link />\n </Input.IconAffix>\n }\n placeholder=\"https://www.wix.com\"\n dataHook={`url-${field.id}`}\n value={value}\n onChange={(e) => onChange?.(e.target.value)}\n onBlur={() => {\n ref.current.invalid = value ? !uriPattern.test(value) : false;\n\n if (ref.current.invalid) {\n setFieldStatus({\n status: 'error',\n statusMessage: 'Invalid URL',\n });\n } else {\n setFieldStatus({ status: undefined, statusMessage: undefined });\n }\n }}\n />\n </FormField>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/C,SAASC,SAAS,EAAEC,KAAK,QAAoB,oBAAoB;AAEjE,SAASC,IAAI,QAAQ,0BAA0B;AAI/C,OAAO,MAAMC,GAAG,GAAIC,KAAe,IAAK;EACtC,MAAM;IAAEC,KAAK;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGH,KAAK;EACxC,MAAMI,GAAG,GAAGV,MAAM,CAAe,CAAC,CAAC,CAAC;EACpC,MAAM,CAACW,YAAY,EAAEC,cAAc,CAAC,GAAGX,QAAQ,CAG5C,CAAC,CAAC,CAAC;EACN;EACA,MAAMY,UAAU,GACd,kOAAkO;EAEpO,oBACEd,KAAA,CAAAe,aAAA,CAACZ,SAAS,EAAAa,QAAA;IAACC,KAAK,EAAET,KAAK,CAACU;EAAY,GAAKN,YAAY,gBACnDZ,KAAA,CAAAe,aAAA,CAACX,KAAK;IACJe,MAAM,eACJnB,KAAA,CAAAe,aAAA,CAACX,KAAK,CAACgB,SAAS,qBACdpB,KAAA,CAAAe,aAAA,CAACV,IAAI,MAAE,CACQ,CAClB;IACDgB,WAAW,EAAC,qBAAqB;IACjCC,QAAQ,EAAE,OAAOd,KAAK,CAACe,EAAE,EAAG;IAC5Bd,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAGc,CAAC,IAAKd,QAAQ,oBAARA,QAAQ,CAAGc,CAAC,CAACC,MAAM,CAAChB,KAAK,CAAE;IAC5CiB,MAAM,EAAEA,CAAA,KAAM;MACZf,GAAG,CAACgB,OAAO,CAACC,OAAO,GAAGnB,KAAK,GAAG,CAACK,UAAU,CAACe,IAAI,CAACpB,KAAK,CAAC,GAAG,KAAK;MAE7D,IAAIE,GAAG,CAACgB,OAAO,CAACC,OAAO,EAAE;QACvBf,cAAc,CAAC;UACbiB,MAAM,EAAE,OAAO;UACfC,aAAa,EAAE;QACjB,CAAC,CAAC;MACJ,CAAC,MAAM;QACLlB,cAAc,CAAC;UAAEiB,MAAM,EAAEE,SAAS;UAAED,aAAa,EAAEC;QAAU,CAAC,CAAC;MACjE;IACF;EAAE,CACH,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/types.ts"],"sourcesContent":["import { Field } from '../../../types';\n\nexport interface BaseInputRef {\n focus?: () => void;\n invalid?: boolean;\n}\n\nexport interface BaseInputProps<T> {\n field: Field;\n value: T;\n onChange: (newValue: T) => void;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ // this function is used to get the date without timezone
2
+ export const getDateWithoutTimezone = date => new Date(new Date(date).toISOString().slice(0, -1));
3
+
4
+ // this function is used to get the date with fixed timezone
5
+ export const getISODateStringWithFixedTimezone = date => {
6
+ const _date = new Date(date);
7
+ const userTimezoneOffset = _date.getTimezoneOffset() * 60000;
8
+ return new Date(_date.getTime() - userTimezoneOffset).toISOString().slice(0, -1);
9
+ };
10
+ //# sourceMappingURL=dates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getDateWithoutTimezone","date","Date","toISOString","slice","getISODateStringWithFixedTimezone","_date","userTimezoneOffset","getTimezoneOffset","getTime"],"sources":["../../../../../../src/components/AutoPatternsEntityPage/Fields/utils/dates.ts"],"sourcesContent":["// this function is used to get the date without timezone\nexport const getDateWithoutTimezone = (date: Date | string) =>\n new Date(new Date(date).toISOString().slice(0, -1));\n\n// this function is used to get the date with fixed timezone\nexport const getISODateStringWithFixedTimezone = (date: Date | string) => {\n const _date = new Date(date);\n const userTimezoneOffset = _date.getTimezoneOffset() * 60000;\n return new Date(_date.getTime() - userTimezoneOffset)\n .toISOString()\n .slice(0, -1);\n};\n"],"mappings":"AAAA;AACA,OAAO,MAAMA,sBAAsB,GAAIC,IAAmB,IACxD,IAAIC,IAAI,CAAC,IAAIA,IAAI,CAACD,IAAI,CAAC,CAACE,WAAW,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;;AAErD;AACA,OAAO,MAAMC,iCAAiC,GAAIJ,IAAmB,IAAK;EACxE,MAAMK,KAAK,GAAG,IAAIJ,IAAI,CAACD,IAAI,CAAC;EAC5B,MAAMM,kBAAkB,GAAGD,KAAK,CAACE,iBAAiB,CAAC,CAAC,GAAG,KAAK;EAC5D,OAAO,IAAIN,IAAI,CAACI,KAAK,CAACG,OAAO,CAAC,CAAC,GAAGF,kBAAkB,CAAC,CAClDJ,WAAW,CAAC,CAAC,CACbC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACjB,CAAC","ignoreList":[]}
package/dist/esm/index.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from './providers';
2
2
  export * from './hooks';
3
+ export * from './components/AutoPatternsApp';
4
+ export * from './types';
3
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from './providers';\nexport * from './hooks';\n"],"mappings":"AAAA,cAAc,aAAa;AAC3B,cAAc,SAAS","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from './providers';\nexport * from './hooks';\nexport * from './components/AutoPatternsApp';\nexport * from './types';\n"],"mappings":"AAAA,cAAc,aAAa;AAC3B,cAAc,SAAS;AACvB,cAAc,8BAA8B;AAC5C,cAAc,SAAS","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/types/types.ts"],"sourcesContent":["import { PrimaryActions, SecondaryActions } from '@wix/patterns';\nimport { EntityPageConfig } from './EntityPageConfig';\nimport { CollectionPageConfig } from './CollectionPageConfig';\nimport { collections } from '@wix/data';\n\nexport type PatternsColumnType =\n | 'STRING'\n | 'NUMBER'\n | 'BOOLEAN'\n | 'DATE'\n | 'DATETIME'\n | 'ARRAY'\n | 'ENUM';\n\nexport interface AppConfig {\n pages: PageConfig[];\n}\n\nexport interface PageConfig {\n id: string;\n routePath: string;\n type: 'collectionPage' | 'entityPage';\n collectionPage?: CollectionPageConfig;\n entityPage?: EntityPageConfig;\n}\n\nexport type EntityProps = { [key: string]: any };\n\nexport interface IMenuItem<T extends EntityProps = {}> {\n item: T;\n}\nexport interface IColumnValue<T> {\n value: T;\n}\n\nexport type QueryOperator =\n | 'CONTAINS'\n | 'ENDS_WITH'\n | 'EQ'\n | 'EXISTS'\n | 'GT'\n | 'GTE'\n | 'HAS_ALL'\n | 'HAS_SOME'\n | 'LT'\n | 'LTE'\n | 'NE'\n | 'STARTS_WITH'\n | 'URLIZED';\n\nexport interface Field {\n id: string;\n displayName: string;\n type: PatternsColumnType;\n originalType: collections.Type;\n capabilities: {\n supportedQueryOperators: QueryOperator[];\n sortable: boolean;\n };\n}\n\nexport interface SchemaConfig {\n fields: Record<string, Field | undefined>;\n displayField: string;\n actions: {\n get: (entityId: string) => Promise<any>;\n create: (newEntity: Partial<any>) => Promise<any>;\n update: (updatedEntity: any) => Promise<any>;\n delete: (entityId: string) => Promise<any>;\n };\n}\n\nexport type PagePrimaryActionProps = React.ComponentProps<\n typeof PrimaryActions\n>;\n\nexport type PageSecondaryActionProps = React.ComponentProps<\n typeof SecondaryActions\n>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../src/types/types.ts"],"sourcesContent":["import { PrimaryActions, SecondaryActions } from '@wix/patterns';\nimport { EntityPageConfig } from './EntityPageConfig';\nimport { CollectionPageConfig } from './CollectionPageConfig';\n\nexport type PatternsFieldType =\n | 'SHORT_TEXT'\n | 'LONG_TEXT'\n | 'NUMBER'\n | 'BOOLEAN'\n | 'DATE'\n | 'DATETIME'\n | 'URL'\n | 'ARRAY';\n\nexport interface AppConfig {\n pages: PageConfig[];\n}\n\nexport interface PageConfig {\n id: string;\n routePath: string;\n type: 'collectionPage' | 'entityPage';\n collectionPage?: CollectionPageConfig;\n entityPage?: EntityPageConfig;\n}\n\nexport type EntityProps = { [key: string]: any };\n\nexport interface IMenuItem<T extends EntityProps = any> {\n item: T;\n}\nexport interface IColumnValue<T> {\n value: T;\n}\n\nexport type QueryOperator =\n | 'CONTAINS'\n | 'ENDS_WITH'\n | 'EQ'\n | 'EXISTS'\n | 'GT'\n | 'GTE'\n | 'HAS_ALL'\n | 'HAS_SOME'\n | 'LT'\n | 'LTE'\n | 'NE'\n | 'STARTS_WITH'\n | 'URLIZED';\n\nexport interface Field {\n id: string;\n displayName: string;\n type: PatternsFieldType;\n capabilities: {\n supportedQueryOperators: QueryOperator[];\n sortable: boolean;\n };\n}\n\nexport interface SchemaConfig {\n fields: Record<string, Field | undefined>;\n displayField: string;\n actions: {\n get: (entityId: string) => Promise<any>;\n create: (newEntity: Partial<any>) => Promise<any>;\n update: (updatedEntity: any) => Promise<any>;\n delete: (entityId: string) => Promise<any>;\n };\n}\n\nexport type PagePrimaryActionProps = React.ComponentProps<\n typeof PrimaryActions\n>;\n\nexport type PageSecondaryActionProps = React.ComponentProps<\n typeof SecondaryActions\n>;\n"],"mappings":"","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { SchemaConfig, PatternsColumnType } from '../../types';
1
+ import { SchemaConfig, PatternsFieldType } from '../../types';
2
2
  import { collections } from '@wix/data';
3
3
  import { CollectionData } from '../CollectionData';
4
4
  import { CollectionConfig } from '../../types/CollectionPageConfig';
5
- export declare const CmsColumnTypeToPatternsColumnType: Partial<Record<collections.Type, PatternsColumnType>>;
5
+ export declare const CmsFieldTypeToPatternsFieldType: Partial<Record<collections.Type, PatternsFieldType>>;
6
6
  export declare function fetchCmsSchema(collectionId: CollectionConfig['collectionId']): Promise<SchemaConfig>;
7
7
  export declare function getCmsCollectionData(config: CollectionConfig, visibleFieldIds: string[]): Promise<CollectionData>;
8
8
  //# sourceMappingURL=CmsCollectionData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CmsCollectionData.d.ts","sourceRoot":"","sources":["../../../../src/collectionData/cms/CmsCollectionData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,WAAW,EAAS,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAInD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,eAAO,MAAM,iCAAiC,EAAE,OAAO,CACrD,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAQ7C,CAAC;AAEF,wBAAsB,cAAc,CAClC,YAAY,EAAE,gBAAgB,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,YAAY,CAAC,CAuCvB;AAED,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,gBAAgB,EACxB,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,cAAc,CAAC,CAwCzB"}
1
+ {"version":3,"file":"CmsCollectionData.d.ts","sourceRoot":"","sources":["../../../../src/collectionData/cms/CmsCollectionData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,WAAW,EAAS,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAInD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,eAAO,MAAM,+BAA+B,EAAE,OAAO,CACnD,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAc5C,CAAC;AAEF,wBAAsB,cAAc,CAClC,YAAY,EAAE,gBAAgB,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,YAAY,CAAC,CAsCvB;AAED,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,gBAAgB,EACxB,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,cAAc,CAAC,CAwCzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"filterUtils.d.ts","sourceRoot":"","sources":["../../../../src/collectionData/cms/filterUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAC;AAqC5C,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,KAAK,EACL,MAAM,GACP,EAAE;IACD,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;IAC9B,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,EAAE,YAAY,CAAC;CACtB,sBA4CA;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,KAAK,EACL,MAAM,EACN,eAAe,GAChB,EAAE;IACD,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;IAC9B,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,EAAE,YAAY,CAAC;IACrB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,sBAwBA"}
1
+ {"version":3,"file":"filterUtils.d.ts","sourceRoot":"","sources":["../../../../src/collectionData/cms/filterUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAC;AAqC5C,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,KAAK,EACL,MAAM,GACP,EAAE;IACD,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;IAC9B,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,EAAE,YAAY,CAAC;CACtB,sBA4CA;AAGD,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,KAAK,EACL,MAAM,EACN,eAAe,GAChB,EAAE;IACD,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;IAC9B,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,EAAE,YAAY,CAAC;IACrB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,sBAwBA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AutoPatternsEntityPage.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAa/C,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAgFxE,CAAC"}
1
+ {"version":3,"file":"AutoPatternsEntityPage.d.ts","sourceRoot":"","sources":["../../../../src/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAa/C,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CA+ExE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BaseInputProps } from './FormFieldInput';
2
+ import { BaseInputProps } from './types';
3
3
  export interface CheckboxProps extends BaseInputProps<boolean> {
4
4
  }
5
5
  export declare const Checkbox: (props: CheckboxProps) => React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,OAAO,CAAC;CAAG;AAEjE,eAAO,MAAM,QAAQ,UAAW,aAAa,sBAgB5C,CAAC"}
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,OAAO,CAAC;CAAG;AAEjE,eAAO,MAAM,QAAQ,UAAW,aAAa,sBAc5C,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { BaseInputProps } from './types';
3
+ export interface DateProps extends BaseInputProps<string | null> {
4
+ }
5
+ export declare const DateInput: (props: DateProps) => React.JSX.Element;
6
+ //# sourceMappingURL=DateInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/DateInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAMhD,OAAO,EAAE,cAAc,EAAgB,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC;CAAG;AAEnE,eAAO,MAAM,SAAS,UAAW,SAAS,sBA0CzC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { BaseInputProps } from './types';
3
+ export interface DateTimeProps extends BaseInputProps<string | null> {
4
+ }
5
+ export declare const DateTime: (props: DateTimeProps) => React.JSX.Element;
6
+ //# sourceMappingURL=DateTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTime.d.ts","sourceRoot":"","sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/DateTime.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAQzD,OAAO,EAAE,cAAc,EAAgB,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC;CAAG;AACvE,eAAO,MAAM,QAAQ,UAAW,aAAa,sBAoG5C,CAAC"}