@servicetitan/form 22.3.0 → 22.4.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +24 -0
- package/dist/date-range-picker/date-range-picker.d.ts +1 -1
- package/dist/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/demo/date-range-picker.js.map +1 -1
- package/dist/demo/index.d.ts +0 -1
- package/dist/demo/index.d.ts.map +1 -1
- package/dist/demo/index.js +0 -1
- package/dist/demo/index.js.map +1 -1
- package/dist/demo/input-date-mask.d.ts.map +1 -1
- package/dist/demo/input-date-mask.js.map +1 -1
- package/dist/form-state-error-banner/form-state-error-banner.js +1 -1
- package/dist/form-state-error-banner/form-state-error-banner.js.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/package.json +15 -16
- package/src/date-range-picker/date-range-picker.tsx +1 -1
- package/src/demo/date-range-picker.tsx +1 -1
- package/src/demo/index.ts +0 -1
- package/src/demo/input-date-mask.tsx +0 -1
- package/src/form-state-error-banner/form-state-error-banner.tsx +1 -1
- package/src/index.ts +2 -4
- package/dist/date-range.d.ts +0 -5
- package/dist/date-range.d.ts.map +0 -1
- package/dist/date-range.js +0 -2
- package/dist/date-range.js.map +0 -1
- package/dist/demo/dropdown-state.d.ts +0 -3
- package/dist/demo/dropdown-state.d.ts.map +0 -1
- package/dist/demo/dropdown-state.js +0 -133
- package/dist/demo/dropdown-state.js.map +0 -1
- package/dist/dropdown-state.d.ts +0 -42
- package/dist/dropdown-state.d.ts.map +0 -1
- package/dist/dropdown-state.js +0 -314
- package/dist/dropdown-state.js.map +0 -1
- package/dist/form-helpers.d.ts +0 -70
- package/dist/form-helpers.d.ts.map +0 -1
- package/dist/form-helpers.js +0 -232
- package/dist/form-helpers.js.map +0 -1
- package/dist/form-validators.d.ts +0 -30
- package/dist/form-validators.d.ts.map +0 -1
- package/dist/form-validators.js +0 -56
- package/dist/form-validators.js.map +0 -1
- package/dist/persistent-form-state/domain-storage.d.ts +0 -14
- package/dist/persistent-form-state/domain-storage.d.ts.map +0 -1
- package/dist/persistent-form-state/domain-storage.js +0 -42
- package/dist/persistent-form-state/domain-storage.js.map +0 -1
- package/dist/persistent-form-state/in-memory-storage.d.ts +0 -13
- package/dist/persistent-form-state/in-memory-storage.d.ts.map +0 -1
- package/dist/persistent-form-state/in-memory-storage.js +0 -30
- package/dist/persistent-form-state/in-memory-storage.js.map +0 -1
- package/dist/persistent-form-state/index.d.ts +0 -2
- package/dist/persistent-form-state/index.d.ts.map +0 -1
- package/dist/persistent-form-state/index.js +0 -2
- package/dist/persistent-form-state/index.js.map +0 -1
- package/dist/persistent-form-state/persistent-form-state.d.ts +0 -18
- package/dist/persistent-form-state/persistent-form-state.d.ts.map +0 -1
- package/dist/persistent-form-state/persistent-form-state.js +0 -93
- package/dist/persistent-form-state/persistent-form-state.js.map +0 -1
- package/src/__tests__/__snapshots__/form-helpers.test.ts.snap +0 -37
- package/src/__tests__/form-helpers.test.ts +0 -229
- package/src/__tests__/form-validators.test.ts +0 -55
- package/src/date-range.ts +0 -4
- package/src/demo/dropdown-state.tsx +0 -233
- package/src/dropdown-state.ts +0 -205
- package/src/form-helpers.ts +0 -259
- package/src/form-validators.ts +0 -106
- package/src/persistent-form-state/__tests__/domain-storage.test.ts +0 -81
- package/src/persistent-form-state/domain-storage.ts +0 -43
- package/src/persistent-form-state/in-memory-storage.ts +0 -32
- package/src/persistent-form-state/index.ts +0 -1
- package/src/persistent-form-state/persistent-form-state.ts +0 -68
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,27 @@
|
|
1
|
+
# v22.4.1 (Wed Jul 13 2022)
|
2
|
+
|
3
|
+
#### 🐛 Bug Fix
|
4
|
+
|
5
|
+
- FAR-977: fix uikit peer dependencies [#127](https://github.com/servicetitan/anvil-uikit-contrib/pull/127) ([@karpoff-titan](https://github.com/karpoff-titan))
|
6
|
+
|
7
|
+
#### Authors: 1
|
8
|
+
|
9
|
+
- Anton Karpov ([@karpoff-titan](https://github.com/karpoff-titan))
|
10
|
+
|
11
|
+
---
|
12
|
+
|
13
|
+
# v22.4.0 (Tue Jul 12 2022)
|
14
|
+
|
15
|
+
#### 🚀 Enhancement
|
16
|
+
|
17
|
+
- [FAR-975] move form state helpers to separate package [#123](https://github.com/servicetitan/anvil-uikit-contrib/pull/123) ([@karpoff-titan](https://github.com/karpoff-titan))
|
18
|
+
|
19
|
+
#### Authors: 1
|
20
|
+
|
21
|
+
- Anton Karpov ([@karpoff-titan](https://github.com/karpoff-titan))
|
22
|
+
|
23
|
+
---
|
24
|
+
|
1
25
|
# v22.1.1 (Tue Jun 28 2022)
|
2
26
|
|
3
27
|
#### 🐛 Bug Fix
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ComponentType, Component, SyntheticEvent } from 'react';
|
2
2
|
import { DateRangePickerChangeEvent, CalendarHeaderTitleProps, MultiViewCalendarProps, CalendarCellProps, ActiveView } from '@progress/kendo-react-dateinputs';
|
3
|
+
import { DateRange } from '@servicetitan/form-state';
|
3
4
|
import { FieldState } from 'formstate';
|
4
|
-
import { DateRange } from '../date-range';
|
5
5
|
export interface DateRangePickerProps {
|
6
6
|
field: FieldState<DateRange | undefined>;
|
7
7
|
['qa-testing']: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"date-range-picker.d.ts","sourceRoot":"","sources":["../../src/date-range-picker/date-range-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAEH,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACb,MAAM,kCAAkC,CAAC;
|
1
|
+
{"version":3,"file":"date-range-picker.d.ts","sourceRoot":"","sources":["../../src/date-range-picker/date-range-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS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UAAS;IACtB,wBAAwB,UAAS;gBAErB,KAAK,EAAE,oBAAoB;IAMvC,SAAS,aAAc,cAAc,UAEnC;IAGF,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO;IAIzB,iBAAiB,QAAS,KAAK,UAqB7B;IAEF,0BAA0B,aAExB;IAEF,eAAe,aAUb;IAEF,iBAAiB;IAIjB,oBAAoB;IAIpB,YAAY,UAAW,0BAA0B,UAQ/C;IAEF,gBAAgB,oCAQd;IAEF,cAAc,kCAQZ;IAEF,MAAM;IA8HN,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,SAAM;IAIzC,uBAAuB,OAAQ,eAAe,gBAAgB,CAAC,UAG7D;IAEF,IAAI,WAAW,qBAad;IAED,IAAI,SAAS,qBAYZ;CACJ"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"date-range-picker.js","sourceRoot":"","sources":["../../src/date-range-picker/date-range-picker.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAiB,SAAS,EAAkB,MAAM,OAAO,CAAC;AACjE,OAAO,EACH,eAAe,IAAI,oBAAoB,GAM1C,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;
|
1
|
+
{"version":3,"file":"date-range-picker.js","sourceRoot":"","sources":["../../src/date-range-picker/date-range-picker.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAiB,SAAS,EAAkB,MAAM,OAAO,CAAC;AACjE,OAAO,EACH,eAAe,IAAI,oBAAoB,GAM1C,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,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,CAAC,CAAC,CAAC,SAAS,CAAC;QAEpD,IAAI,OAAO,IAAI,EAAE,EAAE;YACf,OAAO,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;SACtC;QAED,OAAO,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;IACzB,CAAC;IAED,IAAI,SAAS;QACT,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC9D,IAAI,sBAAsB,EAAE;YACxB,OAAO,OAAO,CAAC;SAClB;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QACxD,IAAI,OAAO,IAAI,IAAI,EAAE;YACjB,OAAO,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;SAC1C;QAED,OAAO,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,IAAI,CAAC;IAC3B,CAAC;CACJ,CAAA;AArQe;IAAX,UAAU;;iDAAqC;AAEpC;IAAX,UAAU;;uDAAwB;AAUnC;IADC,MAAM;;kDAGL;AAGF;IADC,MAAM;;;;iDAGN;AArBQ,eAAe;IAD3B,QAAQ;;GACI,eAAe,CAuQ3B;SAvQY,eAAe"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"date-range-picker.js","sourceRoot":"","sources":["../../src/demo/date-range-picker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAM,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;
|
1
|
+
{"version":3,"file":"date-range-picker.js","sourceRoot":"","sources":["../../src/demo/date-range-picker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAM,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAGnD,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,SAAS,iBAAiB,CAAkC,OAAU;IAClE,OAAO,MAAM,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AACnD,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAO,QAAQ,CAAC,GAAG,EAAE;IACpD,MAAM,YAAY,GAAG,iBAAiB,CAAwB,SAAS,CAAC,CAAC;IAEzE,OAAO,CACH,MAAC,QAAQ,eACL,KAAC,IAAI,kBAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAC,UAAU,6BAE5B,EACP,KAAC,eAAe,IACZ,QAAQ,EAAC,GAAG,EACZ,KAAK,EAAE,YAAY,gBACR,sBAAsB,EACjC,eAAe,EAAC,OAAO,EACvB,KAAK,SACP,IACK,CACd,CAAC;AACN,CAAC,CAAC,CAAC"}
|
package/dist/demo/index.d.ts
CHANGED
package/dist/demo/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/demo/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/demo/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC"}
|
package/dist/demo/index.js
CHANGED
package/dist/demo/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/demo/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/demo/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input-date-mask.d.ts","sourceRoot":"","sources":["../../src/demo/input-date-mask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAoB,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"input-date-mask.d.ts","sourceRoot":"","sources":["../../src/demo/input-date-mask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAoB,MAAM,OAAO,CAAC;AAa7C,eAAO,MAAM,oBAAoB,EAAE,EAejC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input-date-mask.js","sourceRoot":"","sources":["../../src/demo/input-date-mask.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;
|
1
|
+
{"version":3,"file":"input-date-mask.js","sourceRoot":"","sources":["../../src/demo/input-date-mask.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEnC,SAAS,qBAAqB,CAA6B,OAAU;IACjE,OAAO,MAAM,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AACnD,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAO,QAAQ,CAAC,GAAG,EAAE;IAClD,MAAM,YAAY,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAEtD,OAAO,CACH,MAAC,QAAQ,eACL,KAAC,IAAI,kBAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAC,UAAU,6BAE5B,EACP,KAAC,aAAa,IACV,KAAK,EAAE,YAAY,CAAC,KAAK,EACzB,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAC/B,UAAU,EAAE,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GACnC,IACK,CACd,CAAC;AACN,CAAC,CAAC,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { Banner } from '@servicetitan/design-system';
|
3
|
+
import { traverseFormState } from '@servicetitan/form-state';
|
3
4
|
import { observer } from 'mobx-react';
|
4
|
-
import { traverseFormState } from '..';
|
5
5
|
export const FormStateErrorBanner = observer(({ form, className, errorTitle = 'Form Incomplete', successTitle = 'Form Complete', }) => {
|
6
6
|
const errors = [];
|
7
7
|
traverseFormState(true, form, (_0, formState) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"form-state-error-banner.js","sourceRoot":"","sources":["../../src/form-state-error-banner/form-state-error-banner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"form-state-error-banner.js","sourceRoot":"","sources":["../../src/form-state-error-banner/form-state-error-banner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAUtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CACxC,CAAkC,EAC9B,IAAI,EACJ,SAAS,EACT,UAAU,GAAG,iBAAiB,EAC9B,YAAY,GAAG,eAAe,GACH,EAAE,EAAE;IAC/B,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE;QAC5C,IAAI,SAAS,CAAC,SAAS,EAAE;YACrB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;SACpC;IACL,CAAC,CAAC,CAAC;IACH,IAAI,IAAI,CAAC,SAAS,EAAE;QAChB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAC/B;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;IAC5D,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC;IAC9D,OAAO,CACH,KAAC,MAAM,kBAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,QAAC,KAAK,EAAE,KAAK,gBAC3D,uBACK,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;YACtB,oDAAoD;YACpD,uBAAiB,CAAC,IAAT,KAAK,CAAU,CAC3B,CAAC,GACD,IACA,CACZ,CAAC;AACN,CAAC,CACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
@@ -3,13 +3,10 @@ export * from './file-uploader';
|
|
3
3
|
export * from './form-state-error-banner';
|
4
4
|
export * from './label';
|
5
5
|
export * from './number-input';
|
6
|
-
export * from './persistent-form-state';
|
7
|
-
export * from './dropdown-state';
|
8
|
-
export * from './form-helpers';
|
9
|
-
export * from './form-validators';
|
10
6
|
export * from './masked-input';
|
11
7
|
export * from './date-range-picker';
|
12
8
|
export * from './phone-number-input';
|
13
9
|
export * from './original-number-input';
|
14
10
|
export * from './input-date-mask';
|
11
|
+
export * from '@servicetitan/form-state';
|
15
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAElC,cAAc,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
@@ -3,13 +3,10 @@ export * from './file-uploader';
|
|
3
3
|
export * from './form-state-error-banner';
|
4
4
|
export * from './label';
|
5
5
|
export * from './number-input';
|
6
|
-
export * from './persistent-form-state';
|
7
|
-
export * from './dropdown-state';
|
8
|
-
export * from './form-helpers';
|
9
|
-
export * from './form-validators';
|
10
6
|
export * from './masked-input';
|
11
7
|
export * from './date-range-picker';
|
12
8
|
export * from './phone-number-input';
|
13
9
|
export * from './original-number-input';
|
14
10
|
export * from './input-date-mask';
|
11
|
+
export * from '@servicetitan/form-state';
|
15
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAElC,cAAc,0BAA0B,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@servicetitan/form",
|
3
|
-
"version": "22.
|
3
|
+
"version": "22.4.2",
|
4
4
|
"description": "",
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/form",
|
6
6
|
"repository": {
|
@@ -16,18 +16,17 @@
|
|
16
16
|
"src"
|
17
17
|
],
|
18
18
|
"devDependencies": {
|
19
|
-
"@servicetitan/confirm": "^22.
|
20
|
-
"@servicetitan/culture": "^22.
|
21
|
-
"@servicetitan/data-query": "^22.3.0",
|
19
|
+
"@servicetitan/confirm": "^22.4.2",
|
20
|
+
"@servicetitan/culture": "^22.4.2",
|
22
21
|
"@servicetitan/design-system": "~11.8.0",
|
22
|
+
"@servicetitan/form-state": "^22.4.1",
|
23
23
|
"@servicetitan/react-ioc": "^21.6.0",
|
24
24
|
"@servicetitan/tokens": "~11.8.0",
|
25
|
-
"@types/debounce": "~1.2.1",
|
26
25
|
"@types/react": "~17.0.38",
|
27
26
|
"@types/react-input-mask": "~2.0.5",
|
28
27
|
"@types/uuid": "~8.3.4",
|
29
28
|
"accounting": "~0.4.1",
|
30
|
-
"formstate": "
|
29
|
+
"formstate": "^2.0.0",
|
31
30
|
"mobx": "~6.6.0",
|
32
31
|
"mobx-react": "~7.5.0",
|
33
32
|
"moment": "~2.29.3",
|
@@ -36,14 +35,14 @@
|
|
36
35
|
"resumablejs": "~1.0.2"
|
37
36
|
},
|
38
37
|
"peerDependencies": {
|
39
|
-
"@servicetitan/confirm": "^22.
|
40
|
-
"@servicetitan/culture": "^22.
|
41
|
-
"@servicetitan/
|
42
|
-
"@servicetitan/
|
43
|
-
"@servicetitan/react-ioc": "
|
44
|
-
"@servicetitan/tokens": "
|
38
|
+
"@servicetitan/confirm": "^22.4.2",
|
39
|
+
"@servicetitan/culture": "^22.4.2",
|
40
|
+
"@servicetitan/design-system": ">11.8.0",
|
41
|
+
"@servicetitan/form-state": "^22.3.0",
|
42
|
+
"@servicetitan/react-ioc": ">21.0.0",
|
43
|
+
"@servicetitan/tokens": ">11.8.0",
|
45
44
|
"accounting": "~0.4.1",
|
46
|
-
"formstate": "
|
45
|
+
"formstate": "^2.0.0",
|
47
46
|
"mobx": "~6.6.0",
|
48
47
|
"mobx-react": "~7.5.0",
|
49
48
|
"moment": "~2.29.3",
|
@@ -55,8 +54,8 @@
|
|
55
54
|
"@progress/kendo-licensing": "~1.2.0",
|
56
55
|
"@progress/kendo-react-dateinputs": "~4.10.0",
|
57
56
|
"@progress/kendo-react-intl": "~4.10.0",
|
58
|
-
"classnames": "
|
59
|
-
"debounce": "
|
57
|
+
"classnames": "^2.3.1",
|
58
|
+
"debounce": "^1.2.1",
|
60
59
|
"react-input-mask": "~2.0.4",
|
61
60
|
"uuid": "~8.3.2"
|
62
61
|
},
|
@@ -66,5 +65,5 @@
|
|
66
65
|
"cli": {
|
67
66
|
"webpack": false
|
68
67
|
},
|
69
|
-
"gitHead": "
|
68
|
+
"gitHead": "33f99859f917b9368fe7af22d8928a977c5249ca"
|
70
69
|
}
|
@@ -8,13 +8,13 @@ import {
|
|
8
8
|
ActiveView,
|
9
9
|
} from '@progress/kendo-react-dateinputs';
|
10
10
|
import { Icon, InputDateMask, Stack } from '@servicetitan/design-system';
|
11
|
+
import { DateRange } from '@servicetitan/form-state';
|
11
12
|
import { observable, action, makeObservable } from 'mobx';
|
12
13
|
import { observer } from 'mobx-react';
|
13
14
|
import classnames from 'classnames';
|
14
15
|
import moment from 'moment';
|
15
16
|
import * as Styles from './date-range-picker.module.css';
|
16
17
|
import { FieldState } from 'formstate';
|
17
|
-
import { DateRange } from '../date-range';
|
18
18
|
|
19
19
|
export interface DateRangePickerProps {
|
20
20
|
field: FieldState<DateRange | undefined>;
|
@@ -3,11 +3,11 @@ import { Fragment, useRef, FC } from 'react';
|
|
3
3
|
import { observer } from 'mobx-react';
|
4
4
|
|
5
5
|
import { Text } from '@servicetitan/design-system';
|
6
|
+
import { DateRange } from '@servicetitan/form-state';
|
6
7
|
|
7
8
|
import { DateRangePicker } from '..';
|
8
9
|
|
9
10
|
import { FieldState } from 'formstate';
|
10
|
-
import { DateRange } from '../date-range';
|
11
11
|
|
12
12
|
function useDateRangeField<T extends DateRange | undefined>(initial: T) {
|
13
13
|
return useRef(new FieldState(initial)).current;
|
package/src/demo/index.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Banner } from '@servicetitan/design-system';
|
2
|
+
import { traverseFormState } from '@servicetitan/form-state';
|
2
3
|
import { observer } from 'mobx-react';
|
3
|
-
import { traverseFormState } from '..';
|
4
4
|
import { FormState, ValidatableMapOrArray } from 'formstate';
|
5
5
|
|
6
6
|
export interface FormStateErrorBannerProps<T extends ValidatableMapOrArray> {
|
package/src/index.ts
CHANGED
@@ -3,12 +3,10 @@ export * from './file-uploader';
|
|
3
3
|
export * from './form-state-error-banner';
|
4
4
|
export * from './label';
|
5
5
|
export * from './number-input';
|
6
|
-
export * from './persistent-form-state';
|
7
|
-
export * from './dropdown-state';
|
8
|
-
export * from './form-helpers';
|
9
|
-
export * from './form-validators';
|
10
6
|
export * from './masked-input';
|
11
7
|
export * from './date-range-picker';
|
12
8
|
export * from './phone-number-input';
|
13
9
|
export * from './original-number-input';
|
14
10
|
export * from './input-date-mask';
|
11
|
+
|
12
|
+
export * from '@servicetitan/form-state';
|
package/dist/date-range.d.ts
DELETED
package/dist/date-range.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"date-range.d.ts","sourceRoot":"","sources":["../src/date-range.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,EAAE,CAAC,EAAE,IAAI,CAAC;CACb"}
|
package/dist/date-range.js
DELETED
package/dist/date-range.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"date-range.js","sourceRoot":"","sources":["../src/date-range.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"dropdown-state.d.ts","sourceRoot":"","sources":["../../src/demo/dropdown-state.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,EAAE,EAAE,MAAM,OAAO,CAAC;AA0N7C,eAAO,MAAM,oBAAoB,EAAE,EAclC,CAAC"}
|
@@ -1,133 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
11
|
-
import { useRef, Fragment } from 'react';
|
12
|
-
import { InMemoryDataSource, AsyncDataSource } from '@servicetitan/data-query';
|
13
|
-
import { AnvilSelect, Text, ButtonGroup, Button, } from '@servicetitan/design-system';
|
14
|
-
import { FieldState } from 'formstate';
|
15
|
-
import { observer } from 'mobx-react';
|
16
|
-
import { DropdownState } from '..';
|
17
|
-
function useDropdownField(initial) {
|
18
|
-
return useRef(new FieldState(initial)).current;
|
19
|
-
}
|
20
|
-
function useDropdownState(state) {
|
21
|
-
return useRef(state).current;
|
22
|
-
}
|
23
|
-
const options = [
|
24
|
-
{ value: 1, text: 'Alderaan', diameter: 12500, moons: 0 },
|
25
|
-
{ value: 2, text: 'Bespin', diameter: 118000, moons: 2 },
|
26
|
-
{ value: 3, text: 'Coruscant', diameter: 12240, moons: 4 },
|
27
|
-
{ value: 4, text: 'Dagobah', diameter: 14410, moons: 0 },
|
28
|
-
{ value: 5, text: 'Hoth', diameter: 7200, moons: 3 },
|
29
|
-
{ value: 6, text: 'Kashyyyk', diameter: 12765, moons: 3 },
|
30
|
-
{ value: 7, text: 'Naboo', diameter: 12120, moons: 3 },
|
31
|
-
{ value: 8, text: 'Tatooine', diameter: 10465, moons: 3 },
|
32
|
-
{ value: 9, text: 'Yavin', diameter: 200000, moons: 26 },
|
33
|
-
];
|
34
|
-
const optionsWithGroups = [
|
35
|
-
{ value: 1, text: 'Hem Dazon', group: 'Arcona' },
|
36
|
-
{ value: 2, text: 'El-Les', group: 'Arcona' },
|
37
|
-
{ value: 3, text: 'Jheeg', group: 'Arcona' },
|
38
|
-
{ value: 4, text: 'Paploo', group: 'Ewok' },
|
39
|
-
{ value: 5, text: 'Gallo', group: 'Gungan' },
|
40
|
-
{ value: 6, text: 'Lyonie', group: 'Gungan' },
|
41
|
-
{ value: 7, text: 'Tobler Ceel', group: 'Gungan' },
|
42
|
-
{ value: 8, text: 'Ganne', group: 'Gungan' },
|
43
|
-
{ value: 9, text: 'Augara Jowil', group: 'Gungan' },
|
44
|
-
{ value: 10, text: 'Reegesk', group: 'Ranat' },
|
45
|
-
{ value: 11, text: 'Rik-tak', group: 'Ranat' },
|
46
|
-
{ value: 12, text: 'Bahb', group: 'Zeltron' },
|
47
|
-
{ value: 13, text: 'Chantique', group: 'Zeltron' },
|
48
|
-
{ value: 14, text: 'Luxa', group: 'Zeltron' },
|
49
|
-
{ value: 15, text: 'Rahuhl', group: 'Zeltron' },
|
50
|
-
];
|
51
|
-
const InMemoryDropdownStateExample = observer(() => {
|
52
|
-
const field = useDropdownField([]);
|
53
|
-
const state = useDropdownState(new DropdownState({
|
54
|
-
dataSource: new InMemoryDataSource(options),
|
55
|
-
}));
|
56
|
-
const handleChange = (data) => {
|
57
|
-
field.onChange(Array.isArray(data) ? data : [data]);
|
58
|
-
};
|
59
|
-
const withReset = (handler) => {
|
60
|
-
return () => __awaiter(void 0, void 0, void 0, function* () {
|
61
|
-
handleChange([]);
|
62
|
-
state.setSearch('');
|
63
|
-
state.setDataSource(null);
|
64
|
-
state.setSearchByGroup(false);
|
65
|
-
state.setSort([{ field: 'text' }]);
|
66
|
-
state.setFilter(null);
|
67
|
-
state.setGroup([{ field: 'group' }]);
|
68
|
-
yield Promise.resolve();
|
69
|
-
handler();
|
70
|
-
});
|
71
|
-
};
|
72
|
-
const withoutGroups = withReset(() => {
|
73
|
-
state.setDataSource(new InMemoryDataSource(options));
|
74
|
-
});
|
75
|
-
const withGroups = withReset(() => {
|
76
|
-
state.setDataSource(new InMemoryDataSource(optionsWithGroups));
|
77
|
-
});
|
78
|
-
const withGroupsAndSearch = withReset(() => {
|
79
|
-
state.setDataSource(new InMemoryDataSource(optionsWithGroups));
|
80
|
-
state.setSearchByGroup(true);
|
81
|
-
});
|
82
|
-
const customSort = withReset(() => {
|
83
|
-
state.setDataSource(new InMemoryDataSource(options));
|
84
|
-
state.setSort([{ field: 'diameter', dir: 'desc' }]);
|
85
|
-
});
|
86
|
-
const customFilter = withReset(() => {
|
87
|
-
state.setDataSource(new InMemoryDataSource(options));
|
88
|
-
state.setFilter({
|
89
|
-
logic: 'and',
|
90
|
-
filters: [{ field: 'diameter', value: 12250, operator: 'gte' }],
|
91
|
-
});
|
92
|
-
});
|
93
|
-
const customGroup = withReset(() => {
|
94
|
-
state.setDataSource(new InMemoryDataSource(options));
|
95
|
-
state.setGroup([{ field: 'moons', dir: 'desc' }]);
|
96
|
-
});
|
97
|
-
return (_jsxs(Fragment, { children: [_jsx(AnvilSelect, { value: field.value, onChange: handleChange, options: state.options, search: { value: state.search, onChange: state.onSearchChange }, multiple: true }), _jsx(Text, Object.assign({ size: 4, className: "m-t-4 m-b-half" }, { children: "Without groups" })), _jsx(Button, Object.assign({ onClick: withoutGroups }, { children: "Apply" })), _jsx(Text, Object.assign({ size: 4, className: "m-t-4 m-b-half" }, { children: "With groups" })), _jsxs(ButtonGroup, { children: [_jsx(Button, Object.assign({ onClick: withGroups }, { children: "Search in options" })), _jsx(Button, Object.assign({ onClick: withGroupsAndSearch }, { children: "Search in options & groups" }))] }), _jsx(Text, Object.assign({ size: 4, className: "m-t-4 m-b-half" }, { children: "Custom sort" })), _jsx(Button, Object.assign({ onClick: customSort }, { children: "Apply" })), _jsx(Text, Object.assign({ size: 4, className: "m-t-4 m-b-half" }, { children: "Custom filter" })), _jsx(Button, Object.assign({ onClick: customFilter }, { children: "Apply" })), _jsx(Text, Object.assign({ size: 4, className: "m-t-4 m-b-half" }, { children: "Custom group" })), _jsx(Button, Object.assign({ onClick: customGroup }, { children: "Apply" }))] }));
|
98
|
-
});
|
99
|
-
const AsyncDropdownStateExample = observer(() => {
|
100
|
-
const field = useDropdownField([]);
|
101
|
-
const state = useDropdownState(new DropdownState({
|
102
|
-
dataSource: new AsyncDataSource({
|
103
|
-
get({ filter }) {
|
104
|
-
var _a, _b;
|
105
|
-
return __awaiter(this, void 0, void 0, function* () {
|
106
|
-
const search = (_b = (_a = filter === null || filter === void 0 ? void 0 : filter.filters) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value;
|
107
|
-
const result = search
|
108
|
-
? options.filter(({ text }) => text.toLowerCase().includes(search.toLowerCase()))
|
109
|
-
: options;
|
110
|
-
yield new Promise(resolver => setTimeout(resolver, 1000));
|
111
|
-
return {
|
112
|
-
data: result,
|
113
|
-
total: result.length,
|
114
|
-
};
|
115
|
-
});
|
116
|
-
},
|
117
|
-
}, undefined, true),
|
118
|
-
lazy: true,
|
119
|
-
}));
|
120
|
-
const handleChange = (data) => {
|
121
|
-
field.onChange(Array.isArray(data) ? data : [data]);
|
122
|
-
};
|
123
|
-
const handleOpenChange = (open) => {
|
124
|
-
if (open) {
|
125
|
-
state.fetch();
|
126
|
-
}
|
127
|
-
};
|
128
|
-
return (_jsx(AnvilSelect, { value: field.value, onChange: handleChange, options: state.options, search: { value: state.search, onChange: state.onSearchChange }, onOpenChange: handleOpenChange, loading: state.loading, multiple: true }));
|
129
|
-
});
|
130
|
-
export const DropdownStateExample = () => {
|
131
|
-
return (_jsxs(Fragment, { children: [_jsx(Text, Object.assign({ size: 5, className: "m-b-half" }, { children: "InMemoryDataSource" })), _jsx(InMemoryDropdownStateExample, {}), _jsx(Text, Object.assign({ size: 5, className: "m-t-5 m-b-half" }, { children: "AsyncDataSource" })), _jsx(AsyncDropdownStateExample, {})] }));
|
132
|
-
};
|
133
|
-
//# sourceMappingURL=dropdown-state.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"dropdown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AAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,CAAC,IAAa,EAAE,EAAE;QACvC,IAAI,IAAI,EAAE;YACN,KAAK,CAAC,KAAK,EAAE,CAAC;SACjB;IACL,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,WAAW,IACR,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,cAAc,EAAE,EAC/D,YAAY,EAAE,gBAAgB,EAC9B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,QAAQ,SACV,CACL,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAO,GAAG,EAAE;IACzC,OAAO,CACH,MAAC,QAAQ,eACL,KAAC,IAAI,kBAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAC,UAAU,wCAE5B,EACP,KAAC,4BAA4B,KAAG,EAEhC,KAAC,IAAI,kBAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAC,gBAAgB,qCAElC,EACP,KAAC,yBAAyB,KAAG,IACtB,CACd,CAAC;AACN,CAAC,CAAC"}
|
package/dist/dropdown-state.d.ts
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
import { ChangeEvent } from 'react';
|
2
|
-
import { State, SortDescriptor, CompositeFilterDescriptor, GroupDescriptor, DataSource } from '@servicetitan/data-query';
|
3
|
-
import { InputOnChangeData, AnvilSelectOptionsProps } from '@servicetitan/design-system';
|
4
|
-
export interface DropdownOption<T> {
|
5
|
-
value: T;
|
6
|
-
text: string;
|
7
|
-
}
|
8
|
-
interface DropdownStateConstructorParams<T> {
|
9
|
-
dataSource?: DataSource<T>;
|
10
|
-
searchByGroup?: boolean;
|
11
|
-
state?: {
|
12
|
-
sort?: SortDescriptor[];
|
13
|
-
filter?: CompositeFilterDescriptor;
|
14
|
-
group?: [GroupDescriptor];
|
15
|
-
};
|
16
|
-
lazy?: boolean;
|
17
|
-
}
|
18
|
-
export declare class DropdownState<T extends DropdownOption<any>> {
|
19
|
-
loading: boolean;
|
20
|
-
search: string;
|
21
|
-
get options(): AnvilSelectOptionsProps[];
|
22
|
-
get state(): State;
|
23
|
-
private get searchFilter();
|
24
|
-
private dataSource;
|
25
|
-
private searchByGroup;
|
26
|
-
private sort;
|
27
|
-
private filter;
|
28
|
-
private group;
|
29
|
-
private data;
|
30
|
-
constructor({ dataSource, searchByGroup, state, lazy, }?: DropdownStateConstructorParams<T>);
|
31
|
-
onSearchChange: (_0: ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => void;
|
32
|
-
setSearch: (search: string) => Promise<void>;
|
33
|
-
setDataSource: (dataSource: DataSource<T> | null) => Promise<void>;
|
34
|
-
setSearchByGroup: (searchByGroup: boolean) => Promise<void>;
|
35
|
-
setSort: (sort: SortDescriptor[]) => Promise<void>;
|
36
|
-
setFilter: (filter: CompositeFilterDescriptor | null) => Promise<void>;
|
37
|
-
setGroup: (group: [GroupDescriptor]) => Promise<void>;
|
38
|
-
fetch: () => Promise<void>;
|
39
|
-
private traverse;
|
40
|
-
}
|
41
|
-
export {};
|
42
|
-
//# sourceMappingURL=dropdown-state.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"dropdown-state.d.ts","sourceRoot":"","sources":["../src/dropdown-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EACH,KAAK,EACL,cAAc,EACd,yBAAyB,EACzB,eAAe,EAEf,UAAU,EACb,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAWzF,MAAM,WAAW,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