viewkitjs 0.0.0-stage → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/LICENSE.md +7 -0
- package/README.md +36 -2
- package/fields/CHANGELOG.md +1299 -0
- package/fields/NOTICE.md +12 -0
- package/fields/README.md +134 -0
- package/fields/dist/accept.d.ts +39 -0
- package/fields/dist/accept.js +309 -0
- package/fields/dist/actor.d.ts +16 -0
- package/fields/dist/actor.js +44 -0
- package/fields/dist/bands.d.ts +5 -0
- package/fields/dist/bands.js +12 -0
- package/fields/dist/close.d.ts +19 -0
- package/fields/dist/close.js +1 -0
- package/fields/dist/codecs.d.ts +32 -0
- package/fields/dist/codecs.js +119 -0
- package/fields/dist/conventions.d.ts +61 -0
- package/fields/dist/conventions.js +97 -0
- package/fields/dist/countries.d.ts +11 -0
- package/fields/dist/countries.js +98 -0
- package/fields/dist/creatable.d.ts +85 -0
- package/fields/dist/creatable.js +188 -0
- package/fields/dist/date-codec.d.ts +17 -0
- package/fields/dist/date-codec.js +41 -0
- package/fields/dist/definitions.d.ts +2 -0
- package/fields/dist/definitions.js +2 -0
- package/fields/dist/derived.d.ts +84 -0
- package/fields/dist/derived.js +126 -0
- package/fields/dist/design/category-colors.d.ts +17 -0
- package/fields/dist/design/category-colors.js +41 -0
- package/fields/dist/design/stage-marks.d.ts +26 -0
- package/fields/dist/design/stage-marks.js +1 -0
- package/fields/dist/design/status-slots.d.ts +34 -0
- package/fields/dist/design/status-slots.js +72 -0
- package/fields/dist/domain.d.ts +6 -0
- package/fields/dist/domain.js +34 -0
- package/fields/dist/entities.d.ts +67 -0
- package/fields/dist/entities.js +528 -0
- package/fields/dist/equality.d.ts +41 -0
- package/fields/dist/equality.js +114 -0
- package/fields/dist/errors.d.ts +3 -0
- package/fields/dist/errors.js +6 -0
- package/fields/dist/format/time.d.ts +25 -0
- package/fields/dist/format/time.js +77 -0
- package/fields/dist/formula.d.ts +54 -0
- package/fields/dist/formula.js +510 -0
- package/fields/dist/index.d.ts +35 -0
- package/fields/dist/index.js +32 -0
- package/fields/dist/kit.d.ts +23 -0
- package/fields/dist/kit.js +25 -0
- package/fields/dist/labels.d.ts +3 -0
- package/fields/dist/labels.js +5 -0
- package/fields/dist/link.d.ts +33 -0
- package/fields/dist/link.js +58 -0
- package/fields/dist/location.d.ts +26 -0
- package/fields/dist/location.js +92 -0
- package/fields/dist/markdown.d.ts +7 -0
- package/fields/dist/markdown.js +64 -0
- package/fields/dist/messages.d.ts +374 -0
- package/fields/dist/messages.js +332 -0
- package/fields/dist/name.d.ts +23 -0
- package/fields/dist/name.js +53 -0
- package/fields/dist/normalize.d.ts +6 -0
- package/fields/dist/normalize.js +17 -0
- package/fields/dist/optimistic.d.ts +37 -0
- package/fields/dist/optimistic.js +56 -0
- package/fields/dist/options.d.ts +26 -0
- package/fields/dist/options.js +31 -0
- package/fields/dist/parse-number.d.ts +55 -0
- package/fields/dist/parse-number.js +142 -0
- package/fields/dist/phone.d.ts +47 -0
- package/fields/dist/phone.js +121 -0
- package/fields/dist/places/format.d.ts +29 -0
- package/fields/dist/places/format.js +97 -0
- package/fields/dist/places/formats.d.ts +25 -0
- package/fields/dist/places/formats.js +260 -0
- package/fields/dist/places/index.d.ts +13 -0
- package/fields/dist/places/index.js +21 -0
- package/fields/dist/places/load-regions.d.ts +7 -0
- package/fields/dist/places/load-regions.js +65 -0
- package/fields/dist/places/regions/AD.d.ts +4 -0
- package/fields/dist/places/regions/AD.js +11 -0
- package/fields/dist/places/regions/AE.d.ts +4 -0
- package/fields/dist/places/regions/AE.js +11 -0
- package/fields/dist/places/regions/AM.d.ts +4 -0
- package/fields/dist/places/regions/AM.js +15 -0
- package/fields/dist/places/regions/AR.d.ts +4 -0
- package/fields/dist/places/regions/AR.js +28 -0
- package/fields/dist/places/regions/AU.d.ts +4 -0
- package/fields/dist/places/regions/AU.js +13 -0
- package/fields/dist/places/regions/BB.d.ts +4 -0
- package/fields/dist/places/regions/BB.js +15 -0
- package/fields/dist/places/regions/BR.d.ts +4 -0
- package/fields/dist/places/regions/BR.js +31 -0
- package/fields/dist/places/regions/BS.d.ts +4 -0
- package/fields/dist/places/regions/BS.js +23 -0
- package/fields/dist/places/regions/BY.d.ts +4 -0
- package/fields/dist/places/regions/BY.js +11 -0
- package/fields/dist/places/regions/CA.d.ts +4 -0
- package/fields/dist/places/regions/CA.js +17 -0
- package/fields/dist/places/regions/CL.d.ts +4 -0
- package/fields/dist/places/regions/CL.js +20 -0
- package/fields/dist/places/regions/CN.d.ts +4 -0
- package/fields/dist/places/regions/CN.js +38 -0
- package/fields/dist/places/regions/CO.d.ts +4 -0
- package/fields/dist/places/regions/CO.js +37 -0
- package/fields/dist/places/regions/CR.d.ts +4 -0
- package/fields/dist/places/regions/CR.js +11 -0
- package/fields/dist/places/regions/CU.d.ts +4 -0
- package/fields/dist/places/regions/CU.js +20 -0
- package/fields/dist/places/regions/CV.d.ts +4 -0
- package/fields/dist/places/regions/CV.js +13 -0
- package/fields/dist/places/regions/EE.d.ts +4 -0
- package/fields/dist/places/regions/EE.js +19 -0
- package/fields/dist/places/regions/EG.d.ts +4 -0
- package/fields/dist/places/regions/EG.js +31 -0
- package/fields/dist/places/regions/ES.d.ts +4 -0
- package/fields/dist/places/regions/ES.js +56 -0
- package/fields/dist/places/regions/FM.d.ts +4 -0
- package/fields/dist/places/regions/FM.js +8 -0
- package/fields/dist/places/regions/HK.d.ts +4 -0
- package/fields/dist/places/regions/HK.js +7 -0
- package/fields/dist/places/regions/HN.d.ts +4 -0
- package/fields/dist/places/regions/HN.js +22 -0
- package/fields/dist/places/regions/ID.d.ts +4 -0
- package/fields/dist/places/regions/ID.js +38 -0
- package/fields/dist/places/regions/IE.d.ts +4 -0
- package/fields/dist/places/regions/IE.js +30 -0
- package/fields/dist/places/regions/IN.d.ts +4 -0
- package/fields/dist/places/regions/IN.js +40 -0
- package/fields/dist/places/regions/IQ.d.ts +4 -0
- package/fields/dist/places/regions/IQ.js +23 -0
- package/fields/dist/places/regions/IR.d.ts +4 -0
- package/fields/dist/places/regions/IR.js +35 -0
- package/fields/dist/places/regions/IT.d.ts +4 -0
- package/fields/dist/places/regions/IT.js +115 -0
- package/fields/dist/places/regions/JM.d.ts +4 -0
- package/fields/dist/places/regions/JM.js +18 -0
- package/fields/dist/places/regions/JP.d.ts +4 -0
- package/fields/dist/places/regions/JP.js +51 -0
- package/fields/dist/places/regions/KN.d.ts +4 -0
- package/fields/dist/places/regions/KN.js +6 -0
- package/fields/dist/places/regions/KP.d.ts +4 -0
- package/fields/dist/places/regions/KP.js +17 -0
- package/fields/dist/places/regions/KR.d.ts +4 -0
- package/fields/dist/places/regions/KR.js +21 -0
- package/fields/dist/places/regions/KY.d.ts +4 -0
- package/fields/dist/places/regions/KY.js +7 -0
- package/fields/dist/places/regions/KZ.d.ts +4 -0
- package/fields/dist/places/regions/KZ.js +24 -0
- package/fields/dist/places/regions/MN.d.ts +4 -0
- package/fields/dist/places/regions/MN.js +26 -0
- package/fields/dist/places/regions/MX.d.ts +4 -0
- package/fields/dist/places/regions/MX.js +36 -0
- package/fields/dist/places/regions/MY.d.ts +4 -0
- package/fields/dist/places/regions/MY.js +20 -0
- package/fields/dist/places/regions/MZ.d.ts +4 -0
- package/fields/dist/places/regions/MZ.js +15 -0
- package/fields/dist/places/regions/NG.d.ts +4 -0
- package/fields/dist/places/regions/NG.js +41 -0
- package/fields/dist/places/regions/NI.d.ts +4 -0
- package/fields/dist/places/regions/NI.js +21 -0
- package/fields/dist/places/regions/NR.d.ts +4 -0
- package/fields/dist/places/regions/NR.js +18 -0
- package/fields/dist/places/regions/PA.d.ts +4 -0
- package/fields/dist/places/regions/PA.js +18 -0
- package/fields/dist/places/regions/PE.d.ts +4 -0
- package/fields/dist/places/regions/PE.js +30 -0
- package/fields/dist/places/regions/PG.d.ts +4 -0
- package/fields/dist/places/regions/PG.js +26 -0
- package/fields/dist/places/regions/PH.d.ts +4 -0
- package/fields/dist/places/regions/PH.js +86 -0
- package/fields/dist/places/regions/PW.d.ts +4 -0
- package/fields/dist/places/regions/PW.js +20 -0
- package/fields/dist/places/regions/RO.d.ts +4 -0
- package/fields/dist/places/regions/RO.js +46 -0
- package/fields/dist/places/regions/RU.d.ts +4 -0
- package/fields/dist/places/regions/RU.js +89 -0
- package/fields/dist/places/regions/SO.d.ts +4 -0
- package/fields/dist/places/regions/SO.js +22 -0
- package/fields/dist/places/regions/SR.d.ts +4 -0
- package/fields/dist/places/regions/SR.js +14 -0
- package/fields/dist/places/regions/SV.d.ts +4 -0
- package/fields/dist/places/regions/SV.js +18 -0
- package/fields/dist/places/regions/TH.d.ts +4 -0
- package/fields/dist/places/regions/TH.js +81 -0
- package/fields/dist/places/regions/TR.d.ts +4 -0
- package/fields/dist/places/regions/TR.js +85 -0
- package/fields/dist/places/regions/TV.d.ts +4 -0
- package/fields/dist/places/regions/TV.js +13 -0
- package/fields/dist/places/regions/TW.d.ts +4 -0
- package/fields/dist/places/regions/TW.js +26 -0
- package/fields/dist/places/regions/UA.d.ts +4 -0
- package/fields/dist/places/regions/UA.js +31 -0
- package/fields/dist/places/regions/US.d.ts +4 -0
- package/fields/dist/places/regions/US.js +66 -0
- package/fields/dist/places/regions/UY.d.ts +4 -0
- package/fields/dist/places/regions/UY.js +23 -0
- package/fields/dist/places/regions/UZ.d.ts +4 -0
- package/fields/dist/places/regions/UZ.js +18 -0
- package/fields/dist/places/regions/VE.d.ts +4 -0
- package/fields/dist/places/regions/VE.js +29 -0
- package/fields/dist/places/regions/VN.d.ts +4 -0
- package/fields/dist/places/regions/VN.js +67 -0
- package/fields/dist/query/board.d.ts +28 -0
- package/fields/dist/query/board.js +44 -0
- package/fields/dist/query/buckets.d.ts +95 -0
- package/fields/dist/query/buckets.js +453 -0
- package/fields/dist/query/change.d.ts +8 -0
- package/fields/dist/query/change.js +43 -0
- package/fields/dist/query/collate.d.ts +10 -0
- package/fields/dist/query/collate.js +22 -0
- package/fields/dist/query/column-state.d.ts +25 -0
- package/fields/dist/query/column-state.js +10 -0
- package/fields/dist/query/date.d.ts +82 -0
- package/fields/dist/query/date.js +254 -0
- package/fields/dist/query/evaluate.d.ts +69 -0
- package/fields/dist/query/evaluate.js +84 -0
- package/fields/dist/query/figure-kinds.d.ts +26 -0
- package/fields/dist/query/figure-kinds.js +27 -0
- package/fields/dist/query/figures.d.ts +69 -0
- package/fields/dist/query/figures.js +169 -0
- package/fields/dist/query/filter.d.ts +138 -0
- package/fields/dist/query/filter.js +475 -0
- package/fields/dist/query/fold.d.ts +1 -0
- package/fields/dist/query/fold.js +4 -0
- package/fields/dist/query/group.d.ts +15 -0
- package/fields/dist/query/group.js +7 -0
- package/fields/dist/query/hold.d.ts +35 -0
- package/fields/dist/query/hold.js +70 -0
- package/fields/dist/query/index.d.ts +25 -0
- package/fields/dist/query/index.js +25 -0
- package/fields/dist/query/kit.d.ts +57 -0
- package/fields/dist/query/kit.js +29 -0
- package/fields/dist/query/layer.d.ts +35 -0
- package/fields/dist/query/layer.js +51 -0
- package/fields/dist/query/link.d.ts +8 -0
- package/fields/dist/query/link.js +18 -0
- package/fields/dist/query/list-link.d.ts +65 -0
- package/fields/dist/query/list-link.js +174 -0
- package/fields/dist/query/location.d.ts +20 -0
- package/fields/dist/query/location.js +36 -0
- package/fields/dist/query/name.d.ts +6 -0
- package/fields/dist/query/name.js +23 -0
- package/fields/dist/query/number.d.ts +94 -0
- package/fields/dist/query/number.js +180 -0
- package/fields/dist/query/option-counts.d.ts +38 -0
- package/fields/dist/query/option-counts.js +89 -0
- package/fields/dist/query/range.d.ts +22 -0
- package/fields/dist/query/range.js +79 -0
- package/fields/dist/query/read-rule.d.ts +3 -0
- package/fields/dist/query/read-rule.js +13 -0
- package/fields/dist/query/search.d.ts +20 -0
- package/fields/dist/query/search.js +77 -0
- package/fields/dist/query/set-aside.d.ts +82 -0
- package/fields/dist/query/set-aside.js +172 -0
- package/fields/dist/query/settings.d.ts +94 -0
- package/fields/dist/query/settings.js +195 -0
- package/fields/dist/query/sort.d.ts +32 -0
- package/fields/dist/query/sort.js +270 -0
- package/fields/dist/query/text.d.ts +55 -0
- package/fields/dist/query/text.js +80 -0
- package/fields/dist/range.d.ts +25 -0
- package/fields/dist/range.js +63 -0
- package/fields/dist/registry.d.ts +114 -0
- package/fields/dist/registry.js +864 -0
- package/fields/dist/relation.d.ts +84 -0
- package/fields/dist/relation.js +106 -0
- package/fields/dist/root-domain.d.ts +4 -0
- package/fields/dist/root-domain.js +12 -0
- package/fields/dist/settlement.d.ts +4 -0
- package/fields/dist/settlement.js +11 -0
- package/fields/dist/spec-changes.d.ts +20 -0
- package/fields/dist/spec-changes.js +170 -0
- package/fields/dist/testing/backend.d.ts +75 -0
- package/fields/dist/testing/backend.js +1 -0
- package/fields/dist/testing/cases.d.ts +14 -0
- package/fields/dist/testing/cases.js +327 -0
- package/fields/dist/testing/compare.d.ts +39 -0
- package/fields/dist/testing/compare.js +123 -0
- package/fields/dist/testing/index.d.ts +7 -0
- package/fields/dist/testing/index.js +5 -0
- package/fields/dist/testing/memory.d.ts +4 -0
- package/fields/dist/testing/memory.js +90 -0
- package/fields/dist/testing/now.d.ts +4 -0
- package/fields/dist/testing/now.js +2 -0
- package/fields/dist/testing/query-of.d.ts +8 -0
- package/fields/dist/testing/query-of.js +16 -0
- package/fields/dist/testing/question.d.ts +3 -0
- package/fields/dist/testing/question.js +10 -0
- package/fields/dist/testing/reader.d.ts +11 -0
- package/fields/dist/testing/reader.js +12 -0
- package/fields/dist/testing/reference.d.ts +20 -0
- package/fields/dist/testing/reference.js +58 -0
- package/fields/dist/testing/runner.d.ts +32 -0
- package/fields/dist/testing/runner.js +145 -0
- package/fields/dist/testing/samples.d.ts +5 -0
- package/fields/dist/testing/samples.js +338 -0
- package/fields/dist/testing/speed.d.ts +35 -0
- package/fields/dist/testing/speed.js +134 -0
- package/fields/dist/testing/sweep.d.ts +11 -0
- package/fields/dist/testing/sweep.js +154 -0
- package/fields/dist/testing/text-order.d.ts +8 -0
- package/fields/dist/testing/text-order.js +73 -0
- package/fields/dist/testing/worked-out.d.ts +16 -0
- package/fields/dist/testing/worked-out.js +234 -0
- package/fields/dist/types.d.ts +722 -0
- package/fields/dist/types.js +1 -0
- package/fields/dist/value-list.d.ts +56 -0
- package/fields/dist/value-list.js +75 -0
- package/fields/dist/write-result.d.ts +49 -0
- package/fields/dist/write-result.js +34 -0
- package/fields/dist/zod.d.ts +29 -0
- package/fields/dist/zod.js +419 -0
- package/fields/docs/getting-started.md +147 -0
- package/fields/docs/guides/checking-definitions.md +517 -0
- package/fields/docs/guides/contact-values.md +466 -0
- package/fields/docs/guides/conventions.md +312 -0
- package/fields/docs/guides/derived-fields.md +701 -0
- package/fields/docs/guides/field-types.md +665 -0
- package/fields/docs/guides/names-and-places.md +356 -0
- package/fields/docs/guides/narrowing-names.md +146 -0
- package/fields/docs/guides/options.md +348 -0
- package/fields/docs/guides/queries.md +1055 -0
- package/fields/docs/guides/the-index.md +415 -0
- package/fields/docs/guides/validation-and-acceptance.md +314 -0
- package/fields/docs/guides/who-may-change.md +299 -0
- package/fields/docs/index.md +47 -0
- package/fields/docs/reference/definitions.md +22 -0
- package/fields/docs/reference/design-category-colors.md +8 -0
- package/fields/docs/reference/design-stage-marks.md +4 -0
- package/fields/docs/reference/design-status-slots.md +6 -0
- package/fields/docs/reference/fields.md +275 -0
- package/fields/docs/reference/format-time.md +9 -0
- package/fields/docs/reference/phone.md +17 -0
- package/fields/docs/reference/places.md +9 -0
- package/fields/docs/reference/query.md +295 -0
- package/fields/docs/reference/root-domain.md +5 -0
- package/fields/docs/reference/testing.md +87 -0
- package/fields/docs/reference/types.md +95 -0
- package/fields/skills/viewkit/SKILL.md +377 -0
- package/package.json +261 -3
- package/postgres/CHANGELOG.md +676 -0
- package/postgres/README.md +35 -0
- package/postgres/dist/access.d.ts +131 -0
- package/postgres/dist/access.js +168 -0
- package/postgres/dist/actor.d.ts +3 -0
- package/postgres/dist/actor.js +6 -0
- package/postgres/dist/bounds.d.ts +16 -0
- package/postgres/dist/bounds.js +69 -0
- package/postgres/dist/calendar.d.ts +31 -0
- package/postgres/dist/calendar.js +64 -0
- package/postgres/dist/check.d.ts +53 -0
- package/postgres/dist/check.js +326 -0
- package/postgres/dist/counts.d.ts +44 -0
- package/postgres/dist/counts.js +96 -0
- package/postgres/dist/cursor.d.ts +26 -0
- package/postgres/dist/cursor.js +210 -0
- package/postgres/dist/date-groups.d.ts +45 -0
- package/postgres/dist/date-groups.js +176 -0
- package/postgres/dist/definitions/build.d.ts +28 -0
- package/postgres/dist/definitions/build.js +174 -0
- package/postgres/dist/definitions/float.d.ts +55 -0
- package/postgres/dist/definitions/float.js +108 -0
- package/postgres/dist/definitions/formula-forms.d.ts +29 -0
- package/postgres/dist/definitions/formula-forms.js +209 -0
- package/postgres/dist/definitions/formula.d.ts +14 -0
- package/postgres/dist/definitions/formula.js +209 -0
- package/postgres/dist/definitions/index.d.ts +3 -0
- package/postgres/dist/definitions/index.js +2 -0
- package/postgres/dist/definitions/json.d.ts +14 -0
- package/postgres/dist/definitions/json.js +68 -0
- package/postgres/dist/definitions/label.d.ts +8 -0
- package/postgres/dist/definitions/label.js +35 -0
- package/postgres/dist/definitions/lookup.d.ts +8 -0
- package/postgres/dist/definitions/lookup.js +88 -0
- package/postgres/dist/definitions/money.d.ts +29 -0
- package/postgres/dist/definitions/money.js +80 -0
- package/postgres/dist/definitions/place.d.ts +50 -0
- package/postgres/dist/definitions/place.js +38 -0
- package/postgres/dist/definitions/relations.d.ts +9 -0
- package/postgres/dist/definitions/relations.js +48 -0
- package/postgres/dist/definitions/rollup.d.ts +17 -0
- package/postgres/dist/definitions/rollup.js +343 -0
- package/postgres/dist/definitions/storage.d.ts +120 -0
- package/postgres/dist/definitions/storage.js +334 -0
- package/postgres/dist/definitions/stored.d.ts +3 -0
- package/postgres/dist/definitions/stored.js +72 -0
- package/postgres/dist/definitions/user.d.ts +7 -0
- package/postgres/dist/definitions/user.js +42 -0
- package/postgres/dist/double.d.ts +6 -0
- package/postgres/dist/double.js +10 -0
- package/postgres/dist/field-values.d.ts +16 -0
- package/postgres/dist/field-values.js +75 -0
- package/postgres/dist/figures.d.ts +37 -0
- package/postgres/dist/figures.js +88 -0
- package/postgres/dist/filled.d.ts +7 -0
- package/postgres/dist/filled.js +47 -0
- package/postgres/dist/fold.d.ts +15 -0
- package/postgres/dist/fold.js +21 -0
- package/postgres/dist/groups.d.ts +85 -0
- package/postgres/dist/groups.js +189 -0
- package/postgres/dist/ids.d.ts +8 -0
- package/postgres/dist/ids.js +16 -0
- package/postgres/dist/index.d.ts +21 -0
- package/postgres/dist/index.js +20 -0
- package/postgres/dist/kept.d.ts +36 -0
- package/postgres/dist/kept.js +43 -0
- package/postgres/dist/keyed.d.ts +48 -0
- package/postgres/dist/keyed.js +269 -0
- package/postgres/dist/lanes.d.ts +26 -0
- package/postgres/dist/lanes.js +69 -0
- package/postgres/dist/limits.d.ts +12 -0
- package/postgres/dist/limits.js +1 -0
- package/postgres/dist/map.d.ts +198 -0
- package/postgres/dist/map.js +475 -0
- package/postgres/dist/page.d.ts +116 -0
- package/postgres/dist/page.js +577 -0
- package/postgres/dist/parts.d.ts +10 -0
- package/postgres/dist/parts.js +82 -0
- package/postgres/dist/phone.d.ts +28 -0
- package/postgres/dist/phone.js +54 -0
- package/postgres/dist/predicates.d.ts +8 -0
- package/postgres/dist/predicates.js +35 -0
- package/postgres/dist/range-groups.d.ts +22 -0
- package/postgres/dist/range-groups.js +97 -0
- package/postgres/dist/records.d.ts +24 -0
- package/postgres/dist/records.js +183 -0
- package/postgres/dist/refusals.d.ts +38 -0
- package/postgres/dist/refusals.js +46 -0
- package/postgres/dist/relations.d.ts +23 -0
- package/postgres/dist/relations.js +71 -0
- package/postgres/dist/rules.d.ts +60 -0
- package/postgres/dist/rules.js +218 -0
- package/postgres/dist/search-indexes.d.ts +62 -0
- package/postgres/dist/search-indexes.js +189 -0
- package/postgres/dist/search.d.ts +56 -0
- package/postgres/dist/search.js +152 -0
- package/postgres/dist/several.d.ts +49 -0
- package/postgres/dist/several.js +174 -0
- package/postgres/dist/sort.d.ts +104 -0
- package/postgres/dist/sort.js +368 -0
- package/postgres/dist/sql.d.ts +60 -0
- package/postgres/dist/sql.js +247 -0
- package/postgres/dist/statement.d.ts +4 -0
- package/postgres/dist/statement.js +7 -0
- package/postgres/dist/steps.d.ts +18 -0
- package/postgres/dist/steps.js +18 -0
- package/postgres/dist/users.d.ts +35 -0
- package/postgres/dist/users.js +33 -0
- package/postgres/dist/value-rows.d.ts +23 -0
- package/postgres/dist/value-rows.js +64 -0
- package/postgres/dist/values.d.ts +56 -0
- package/postgres/dist/values.js +160 -0
- package/postgres/dist/view-counts.d.ts +14 -0
- package/postgres/dist/view-counts.js +50 -0
- package/postgres/dist/walker.d.ts +12 -0
- package/postgres/dist/walker.js +18 -0
- package/postgres/docs/guides/definitions.md +221 -0
- package/postgres/docs/guides/field-map.md +705 -0
- package/postgres/docs/guides/test-kit.md +110 -0
- package/postgres/docs/index.md +11 -0
- package/postgres/docs/reference/definitions.md +41 -0
- package/postgres/docs/reference/postgres.md +108 -0
- package/views/CHANGELOG.md +3582 -0
- package/views/README.md +104 -0
- package/views/dist/atoms/Avatar.d.ts +2 -0
- package/views/dist/atoms/Avatar.js +13 -0
- package/views/dist/atoms/CellMore.d.ts +2 -0
- package/views/dist/atoms/CellMore.js +4 -0
- package/views/dist/atoms/CommandMenu.d.ts +2 -0
- package/views/dist/atoms/CommandMenu.js +24 -0
- package/views/dist/atoms/DisabledReason.d.ts +13 -0
- package/views/dist/atoms/DisabledReason.js +27 -0
- package/views/dist/atoms/DrillRows.d.ts +3 -0
- package/views/dist/atoms/DrillRows.js +27 -0
- package/views/dist/atoms/List.d.ts +2 -0
- package/views/dist/atoms/List.js +6 -0
- package/views/dist/atoms/LoadMore.d.ts +2 -0
- package/views/dist/atoms/LoadMore.js +35 -0
- package/views/dist/atoms/Loading.d.ts +8 -0
- package/views/dist/atoms/Loading.js +10 -0
- package/views/dist/atoms/PanelRows.d.ts +5 -0
- package/views/dist/atoms/PanelRows.js +38 -0
- package/views/dist/atoms/PanelSearch.d.ts +2 -0
- package/views/dist/atoms/PanelSearch.js +23 -0
- package/views/dist/atoms/Pill.d.ts +2 -0
- package/views/dist/atoms/Pill.js +25 -0
- package/views/dist/atoms/PlatformMark.d.ts +2 -0
- package/views/dist/atoms/PlatformMark.js +4 -0
- package/views/dist/atoms/RangeCalendar.d.ts +8 -0
- package/views/dist/atoms/RangeCalendar.js +30 -0
- package/views/dist/atoms/RelationLink.d.ts +2 -0
- package/views/dist/atoms/RelationLink.js +6 -0
- package/views/dist/atoms/RelationRoles.d.ts +2 -0
- package/views/dist/atoms/RelationRoles.js +6 -0
- package/views/dist/atoms/Row.d.ts +3 -0
- package/views/dist/atoms/Row.js +31 -0
- package/views/dist/atoms/RowMenu.d.ts +2 -0
- package/views/dist/atoms/RowMenu.js +116 -0
- package/views/dist/atoms/SelectionSheet.d.ts +3 -0
- package/views/dist/atoms/SelectionSheet.js +31 -0
- package/views/dist/atoms/StatusBadge.d.ts +2 -0
- package/views/dist/atoms/StatusBadge.js +7 -0
- package/views/dist/atoms/StatusMarker.d.ts +2 -0
- package/views/dist/atoms/StatusMarker.js +21 -0
- package/views/dist/atoms/Tag.d.ts +2 -0
- package/views/dist/atoms/Tag.js +14 -0
- package/views/dist/atoms/TickBox.d.ts +2 -0
- package/views/dist/atoms/TickBox.js +8 -0
- package/views/dist/atoms/ToolbarButton.d.ts +2 -0
- package/views/dist/atoms/ToolbarButton.js +50 -0
- package/views/dist/atoms/defaults.d.ts +2 -0
- package/views/dist/atoms/defaults.js +51 -0
- package/views/dist/atoms/tones.d.ts +5 -0
- package/views/dist/atoms/tones.js +28 -0
- package/views/dist/atoms/types.d.ts +496 -0
- package/views/dist/atoms/types.js +3 -0
- package/views/dist/cells/cell-format.d.ts +147 -0
- package/views/dist/cells/cell-format.js +16 -0
- package/views/dist/cells/cell-title.d.ts +20 -0
- package/views/dist/cells/cell-title.js +8 -0
- package/views/dist/cells/cell-values.d.ts +28 -0
- package/views/dist/cells/cell-values.js +107 -0
- package/views/dist/cells/index.d.ts +4 -0
- package/views/dist/cells/index.js +4 -0
- package/views/dist/cells/legacy-field.d.ts +52 -0
- package/views/dist/cells/legacy-field.js +164 -0
- package/views/dist/cells/relation-wrap.d.ts +3 -0
- package/views/dist/cells/relation-wrap.js +26 -0
- package/views/dist/cells/use-cell-format.d.ts +5 -0
- package/views/dist/cells/use-cell-format.js +10 -0
- package/views/dist/contract.d.ts +1337 -0
- package/views/dist/contract.js +1824 -0
- package/views/dist/display/actor.d.ts +4 -0
- package/views/dist/display/actor.js +26 -0
- package/views/dist/display/boolean.d.ts +18 -0
- package/views/dist/display/boolean.js +50 -0
- package/views/dist/display/breakdown.d.ts +15 -0
- package/views/dist/display/breakdown.js +32 -0
- package/views/dist/display/converted.d.ts +19 -0
- package/views/dist/display/converted.js +12 -0
- package/views/dist/display/currency.d.ts +9 -0
- package/views/dist/display/currency.js +29 -0
- package/views/dist/display/date.d.ts +12 -0
- package/views/dist/display/date.js +28 -0
- package/views/dist/display/display-cores.d.ts +31 -0
- package/views/dist/display/display-cores.js +57 -0
- package/views/dist/display/entity-chip.d.ts +29 -0
- package/views/dist/display/entity-chip.js +8 -0
- package/views/dist/display/fit-values.d.ts +34 -0
- package/views/dist/display/fit-values.js +45 -0
- package/views/dist/display/format.d.ts +66 -0
- package/views/dist/display/format.js +206 -0
- package/views/dist/display/index.d.ts +9 -0
- package/views/dist/display/index.js +8 -0
- package/views/dist/display/link-click.d.ts +11 -0
- package/views/dist/display/link-click.js +3 -0
- package/views/dist/display/link.d.ts +29 -0
- package/views/dist/display/link.js +56 -0
- package/views/dist/display/location.d.ts +8 -0
- package/views/dist/display/location.js +22 -0
- package/views/dist/display/multi-value.d.ts +18 -0
- package/views/dist/display/multi-value.js +93 -0
- package/views/dist/display/name.d.ts +6 -0
- package/views/dist/display/name.js +14 -0
- package/views/dist/display/number.d.ts +11 -0
- package/views/dist/display/number.js +27 -0
- package/views/dist/display/options.d.ts +167 -0
- package/views/dist/display/options.js +1 -0
- package/views/dist/display/percent.d.ts +4 -0
- package/views/dist/display/percent.js +41 -0
- package/views/dist/display/phone.d.ts +11 -0
- package/views/dist/display/phone.js +49 -0
- package/views/dist/display/range.d.ts +6 -0
- package/views/dist/display/range.js +19 -0
- package/views/dist/display/relation.d.ts +4 -0
- package/views/dist/display/relation.js +44 -0
- package/views/dist/display/rich-text.d.ts +10 -0
- package/views/dist/display/rich-text.js +46 -0
- package/views/dist/display/select.d.ts +6 -0
- package/views/dist/display/select.js +40 -0
- package/views/dist/display/status-steps.d.ts +8 -0
- package/views/dist/display/status-steps.js +18 -0
- package/views/dist/display/text-class.d.ts +23 -0
- package/views/dist/display/text-class.js +5 -0
- package/views/dist/display/text.d.ts +19 -0
- package/views/dist/display/text.js +8 -0
- package/views/dist/display/use-display-options.d.ts +2 -0
- package/views/dist/display/use-display-options.js +14 -0
- package/views/dist/display/user.d.ts +11 -0
- package/views/dist/display/user.js +10 -0
- package/views/dist/display/value-list.d.ts +10 -0
- package/views/dist/display/value-list.js +12 -0
- package/views/dist/display/viewer.d.ts +4 -0
- package/views/dist/display/viewer.js +12 -0
- package/views/dist/display/web-href.d.ts +16 -0
- package/views/dist/display/web-href.js +19 -0
- package/views/dist/editors/BodyFrame.d.ts +30 -0
- package/views/dist/editors/BodyFrame.js +86 -0
- package/views/dist/editors/ChipsEditor.d.ts +76 -0
- package/views/dist/editors/ChipsEditor.js +118 -0
- package/views/dist/editors/DateEditor.d.ts +42 -0
- package/views/dist/editors/DateEditor.js +298 -0
- package/views/dist/editors/EditorPanel.d.ts +71 -0
- package/views/dist/editors/EditorPanel.js +158 -0
- package/views/dist/editors/LocationEditor.d.ts +33 -0
- package/views/dist/editors/LocationEditor.js +320 -0
- package/views/dist/editors/NameEditor.d.ts +29 -0
- package/views/dist/editors/NameEditor.js +119 -0
- package/views/dist/editors/NumberEditor.d.ts +90 -0
- package/views/dist/editors/NumberEditor.js +126 -0
- package/views/dist/editors/RangeEditor.d.ts +51 -0
- package/views/dist/editors/RangeEditor.js +125 -0
- package/views/dist/editors/RelationEditor.d.ts +52 -0
- package/views/dist/editors/RelationEditor.js +55 -0
- package/views/dist/editors/RelationSetEditor.d.ts +63 -0
- package/views/dist/editors/RelationSetEditor.js +222 -0
- package/views/dist/editors/SelectEditor.d.ts +104 -0
- package/views/dist/editors/SelectEditor.js +154 -0
- package/views/dist/editors/TextEditor.d.ts +61 -0
- package/views/dist/editors/TextEditor.js +102 -0
- package/views/dist/editors/ValueListEditor.d.ts +51 -0
- package/views/dist/editors/ValueListEditor.js +239 -0
- package/views/dist/editors/body-panel.d.ts +11 -0
- package/views/dist/editors/body-panel.js +11 -0
- package/views/dist/editors/body-step.d.ts +12 -0
- package/views/dist/editors/body-step.js +6 -0
- package/views/dist/editors/edit-cores.d.ts +86 -0
- package/views/dist/editors/edit-cores.js +39 -0
- package/views/dist/editors/edit-session.d.ts +113 -0
- package/views/dist/editors/edit-session.js +97 -0
- package/views/dist/editors/escape-rule.d.ts +34 -0
- package/views/dist/editors/escape-rule.js +15 -0
- package/views/dist/editors/inner-escape.d.ts +12 -0
- package/views/dist/editors/inner-escape.js +10 -0
- package/views/dist/editors/keep-inside.d.ts +12 -0
- package/views/dist/editors/keep-inside.js +20 -0
- package/views/dist/editors/leave-scope.d.ts +31 -0
- package/views/dist/editors/leave-scope.js +29 -0
- package/views/dist/editors/link-roles.d.ts +9 -0
- package/views/dist/editors/link-roles.js +19 -0
- package/views/dist/editors/number-body.d.ts +30 -0
- package/views/dist/editors/number-body.js +38 -0
- package/views/dist/editors/number-step.d.ts +39 -0
- package/views/dist/editors/number-step.js +47 -0
- package/views/dist/editors/open-value.d.ts +22 -0
- package/views/dist/editors/open-value.js +37 -0
- package/views/dist/editors/open-values.d.ts +32 -0
- package/views/dist/editors/open-values.js +33 -0
- package/views/dist/editors/option-add-flow.d.ts +66 -0
- package/views/dist/editors/option-add-flow.js +155 -0
- package/views/dist/editors/parts-body.d.ts +68 -0
- package/views/dist/editors/parts-body.js +117 -0
- package/views/dist/editors/picker-slot.d.ts +25 -0
- package/views/dist/editors/picker-slot.js +37 -0
- package/views/dist/editors/relation-kinds.d.ts +7 -0
- package/views/dist/editors/relation-kinds.js +21 -0
- package/views/dist/editors/relation-links-body.d.ts +36 -0
- package/views/dist/editors/relation-links-body.js +22 -0
- package/views/dist/editors/relation-panel.d.ts +69 -0
- package/views/dist/editors/relation-panel.js +40 -0
- package/views/dist/editors/relation-picker.d.ts +63 -0
- package/views/dist/editors/relation-picker.js +58 -0
- package/views/dist/editors/relation-source.d.ts +67 -0
- package/views/dist/editors/relation-source.js +108 -0
- package/views/dist/editors/tab-ends.d.ts +7 -0
- package/views/dist/editors/tab-ends.js +10 -0
- package/views/dist/editors/text-body.d.ts +16 -0
- package/views/dist/editors/text-body.js +30 -0
- package/views/dist/editors/values-body.d.ts +47 -0
- package/views/dist/editors/values-body.js +140 -0
- package/views/dist/field-row/FieldNoteLine.d.ts +14 -0
- package/views/dist/field-row/FieldNoteLine.js +15 -0
- package/views/dist/field-row/FieldRow.d.ts +81 -0
- package/views/dist/field-row/FieldRow.js +232 -0
- package/views/dist/field-row/FieldRowLane.d.ts +19 -0
- package/views/dist/field-row/FieldRowLane.js +21 -0
- package/views/dist/field-row/drawn-text.d.ts +7 -0
- package/views/dist/field-row/drawn-text.js +27 -0
- package/views/dist/field-row/editors/RowChipsEditor.d.ts +11 -0
- package/views/dist/field-row/editors/RowChipsEditor.js +27 -0
- package/views/dist/field-row/editors/RowDateEditor.d.ts +16 -0
- package/views/dist/field-row/editors/RowDateEditor.js +18 -0
- package/views/dist/field-row/editors/RowEditor.d.ts +39 -0
- package/views/dist/field-row/editors/RowEditor.js +66 -0
- package/views/dist/field-row/editors/RowNameEditor.d.ts +7 -0
- package/views/dist/field-row/editors/RowNameEditor.js +23 -0
- package/views/dist/field-row/editors/RowNumberEditor.d.ts +12 -0
- package/views/dist/field-row/editors/RowNumberEditor.js +34 -0
- package/views/dist/field-row/editors/RowPlaceEditor.d.ts +9 -0
- package/views/dist/field-row/editors/RowPlaceEditor.js +20 -0
- package/views/dist/field-row/editors/RowRangeEditor.d.ts +7 -0
- package/views/dist/field-row/editors/RowRangeEditor.js +25 -0
- package/views/dist/field-row/editors/RowRelationEditor.d.ts +20 -0
- package/views/dist/field-row/editors/RowRelationEditor.js +80 -0
- package/views/dist/field-row/editors/RowSelectEditor.d.ts +13 -0
- package/views/dist/field-row/editors/RowSelectEditor.js +26 -0
- package/views/dist/field-row/editors/RowTextEditor.d.ts +15 -0
- package/views/dist/field-row/editors/RowTextEditor.js +25 -0
- package/views/dist/field-row/editors/RowValueListEditor.d.ts +6 -0
- package/views/dist/field-row/editors/RowValueListEditor.js +34 -0
- package/views/dist/field-row/editors/host.d.ts +65 -0
- package/views/dist/field-row/editors/host.js +1 -0
- package/views/dist/field-row/editors/row-frame.d.ts +2 -0
- package/views/dist/field-row/editors/row-frame.js +1 -0
- package/views/dist/field-row/editors/row-session.d.ts +63 -0
- package/views/dist/field-row/editors/row-session.js +102 -0
- package/views/dist/field-row/field-row-button.d.ts +40 -0
- package/views/dist/field-row/field-row-button.js +18 -0
- package/views/dist/field-row/field-row-checkbox.d.ts +9 -0
- package/views/dist/field-row/field-row-checkbox.js +7 -0
- package/views/dist/field-row/index.d.ts +5 -0
- package/views/dist/field-row/index.js +5 -0
- package/views/dist/field-row/row-target.d.ts +20 -0
- package/views/dist/field-row/row-target.js +3 -0
- package/views/dist/field-row/useFieldWrite.d.ts +45 -0
- package/views/dist/field-row/useFieldWrite.js +233 -0
- package/views/dist/field-row/useRowSettlement.d.ts +33 -0
- package/views/dist/field-row/useRowSettlement.js +23 -0
- package/views/dist/fields/binding.d.ts +96 -0
- package/views/dist/fields/binding.js +128 -0
- package/views/dist/fields/currency.d.ts +82 -0
- package/views/dist/fields/currency.js +41 -0
- package/views/dist/fields/denomination.d.ts +42 -0
- package/views/dist/fields/denomination.js +11 -0
- package/views/dist/fields/edit-core-types.d.ts +40 -0
- package/views/dist/fields/edit-core-types.js +29 -0
- package/views/dist/fields/format-knobs.d.ts +34 -0
- package/views/dist/fields/format-knobs.js +36 -0
- package/views/dist/fields/menus.d.ts +30 -0
- package/views/dist/fields/menus.js +1 -0
- package/views/dist/fields/money.d.ts +65 -0
- package/views/dist/fields/money.js +88 -0
- package/views/dist/fields/number-edit.d.ts +17 -0
- package/views/dist/fields/number-edit.js +21 -0
- package/views/dist/fields/option-add.d.ts +25 -0
- package/views/dist/fields/option-add.js +9 -0
- package/views/dist/fields/prepare-write.d.ts +55 -0
- package/views/dist/fields/prepare-write.js +72 -0
- package/views/dist/fields/range-unit.d.ts +7 -0
- package/views/dist/fields/range-unit.js +13 -0
- package/views/dist/fields/relation-source-types.d.ts +66 -0
- package/views/dist/fields/relation-source-types.js +1 -0
- package/views/dist/fields/write-target.d.ts +56 -0
- package/views/dist/fields/write-target.js +10 -0
- package/views/dist/figures.d.ts +9 -0
- package/views/dist/figures.js +1 -0
- package/views/dist/filters/date-filter.d.ts +2 -0
- package/views/dist/filters/date-filter.js +1 -0
- package/views/dist/filters/filter-model.d.ts +181 -0
- package/views/dist/filters/filter-model.js +41 -0
- package/views/dist/filters/filter-tree.d.ts +146 -0
- package/views/dist/filters/filter-tree.js +256 -0
- package/views/dist/filters/number-filter.d.ts +2 -0
- package/views/dist/filters/number-filter.js +1 -0
- package/views/dist/filters/range-filter.d.ts +2 -0
- package/views/dist/filters/range-filter.js +1 -0
- package/views/dist/filters/registry.d.ts +103 -0
- package/views/dist/filters/registry.js +8 -0
- package/views/dist/filters/relation-filter.d.ts +16 -0
- package/views/dist/filters/relation-filter.js +63 -0
- package/views/dist/filters/text-filter.d.ts +2 -0
- package/views/dist/filters/text-filter.js +1 -0
- package/views/dist/grid/chrome/GridAddColumn.d.ts +23 -0
- package/views/dist/grid/chrome/GridAddColumn.js +106 -0
- package/views/dist/grid/chrome/GridAggregateMenu.d.ts +36 -0
- package/views/dist/grid/chrome/GridAggregateMenu.js +60 -0
- package/views/dist/grid/chrome/GridCellEditors.d.ts +81 -0
- package/views/dist/grid/chrome/GridCellEditors.js +156 -0
- package/views/dist/grid/chrome/GridCellOutline.d.ts +53 -0
- package/views/dist/grid/chrome/GridCellOutline.js +36 -0
- package/views/dist/grid/chrome/GridChipsEditor.d.ts +40 -0
- package/views/dist/grid/chrome/GridChipsEditor.js +39 -0
- package/views/dist/grid/chrome/GridColumnColorSection.d.ts +13 -0
- package/views/dist/grid/chrome/GridColumnColorSection.js +40 -0
- package/views/dist/grid/chrome/GridColumnDateSection.d.ts +27 -0
- package/views/dist/grid/chrome/GridColumnDateSection.js +23 -0
- package/views/dist/grid/chrome/GridColumnDurationSection.d.ts +23 -0
- package/views/dist/grid/chrome/GridColumnDurationSection.js +24 -0
- package/views/dist/grid/chrome/GridColumnMenu.d.ts +113 -0
- package/views/dist/grid/chrome/GridColumnMenu.js +149 -0
- package/views/dist/grid/chrome/GridColumnNumberSection.d.ts +29 -0
- package/views/dist/grid/chrome/GridColumnNumberSection.js +27 -0
- package/views/dist/grid/chrome/GridColumnPercentSection.d.ts +16 -0
- package/views/dist/grid/chrome/GridColumnPercentSection.js +16 -0
- package/views/dist/grid/chrome/GridColumnSortSection.d.ts +38 -0
- package/views/dist/grid/chrome/GridColumnSortSection.js +33 -0
- package/views/dist/grid/chrome/GridDateEditor.d.ts +41 -0
- package/views/dist/grid/chrome/GridDateEditor.js +26 -0
- package/views/dist/grid/chrome/GridFlyout.d.ts +44 -0
- package/views/dist/grid/chrome/GridFlyout.js +80 -0
- package/views/dist/grid/chrome/GridFooter.d.ts +40 -0
- package/views/dist/grid/chrome/GridFooter.js +55 -0
- package/views/dist/grid/chrome/GridGroupMenu.d.ts +47 -0
- package/views/dist/grid/chrome/GridGroupMenu.js +101 -0
- package/views/dist/grid/chrome/GridHeader.d.ts +83 -0
- package/views/dist/grid/chrome/GridHeader.js +58 -0
- package/views/dist/grid/chrome/GridLongTextEditor.d.ts +55 -0
- package/views/dist/grid/chrome/GridLongTextEditor.js +73 -0
- package/views/dist/grid/chrome/GridMenuRow.d.ts +15 -0
- package/views/dist/grid/chrome/GridMenuRow.js +15 -0
- package/views/dist/grid/chrome/GridNameEditor.d.ts +24 -0
- package/views/dist/grid/chrome/GridNameEditor.js +25 -0
- package/views/dist/grid/chrome/GridNumberEditor.d.ts +56 -0
- package/views/dist/grid/chrome/GridNumberEditor.js +42 -0
- package/views/dist/grid/chrome/GridPager.d.ts +7 -0
- package/views/dist/grid/chrome/GridPager.js +34 -0
- package/views/dist/grid/chrome/GridPlaceEditor.d.ts +29 -0
- package/views/dist/grid/chrome/GridPlaceEditor.js +26 -0
- package/views/dist/grid/chrome/GridRangeEditor.d.ts +35 -0
- package/views/dist/grid/chrome/GridRangeEditor.js +32 -0
- package/views/dist/grid/chrome/GridRelationEditor.d.ts +47 -0
- package/views/dist/grid/chrome/GridRelationEditor.js +99 -0
- package/views/dist/grid/chrome/GridResizeHandle.d.ts +19 -0
- package/views/dist/grid/chrome/GridResizeHandle.js +19 -0
- package/views/dist/grid/chrome/GridRow.d.ts +32 -0
- package/views/dist/grid/chrome/GridRow.js +171 -0
- package/views/dist/grid/chrome/GridRowActions.d.ts +37 -0
- package/views/dist/grid/chrome/GridRowActions.js +36 -0
- package/views/dist/grid/chrome/GridRowCells.d.ts +4 -0
- package/views/dist/grid/chrome/GridRowCells.js +157 -0
- package/views/dist/grid/chrome/GridRowGlyph.d.ts +14 -0
- package/views/dist/grid/chrome/GridRowGlyph.js +18 -0
- package/views/dist/grid/chrome/GridSelectEditor.d.ts +35 -0
- package/views/dist/grid/chrome/GridSelectEditor.js +58 -0
- package/views/dist/grid/chrome/GridStructure.d.ts +64 -0
- package/views/dist/grid/chrome/GridStructure.js +87 -0
- package/views/dist/grid/chrome/GridTable.d.ts +4 -0
- package/views/dist/grid/chrome/GridTable.js +394 -0
- package/views/dist/grid/chrome/GridTableSurface.d.ts +80 -0
- package/views/dist/grid/chrome/GridTableSurface.js +39 -0
- package/views/dist/grid/chrome/GridTextEditor.d.ts +49 -0
- package/views/dist/grid/chrome/GridTextEditor.js +51 -0
- package/views/dist/grid/chrome/GridValueListEditor.d.ts +38 -0
- package/views/dist/grid/chrome/GridValueListEditor.js +29 -0
- package/views/dist/grid/chrome/StuckMarker.d.ts +26 -0
- package/views/dist/grid/chrome/StuckMarker.js +44 -0
- package/views/dist/grid/chrome/cell-clipboard.d.ts +10 -0
- package/views/dist/grid/chrome/cell-clipboard.js +28 -0
- package/views/dist/grid/chrome/cell-cut-off.d.ts +11 -0
- package/views/dist/grid/chrome/cell-cut-off.js +20 -0
- package/views/dist/grid/chrome/cells.d.ts +23 -0
- package/views/dist/grid/chrome/cells.js +19 -0
- package/views/dist/grid/chrome/checks.d.ts +56 -0
- package/views/dist/grid/chrome/checks.js +48 -0
- package/views/dist/grid/chrome/column-glyph.d.ts +16 -0
- package/views/dist/grid/chrome/column-glyph.js +52 -0
- package/views/dist/grid/chrome/editors.d.ts +9 -0
- package/views/dist/grid/chrome/editors.js +10 -0
- package/views/dist/grid/chrome/grid-add-column-items.d.ts +13 -0
- package/views/dist/grid/chrome/grid-add-column-items.js +47 -0
- package/views/dist/grid/chrome/grid-body-place.d.ts +4 -0
- package/views/dist/grid/chrome/grid-body-place.js +15 -0
- package/views/dist/grid/chrome/grid-button.d.ts +32 -0
- package/views/dist/grid/chrome/grid-button.js +12 -0
- package/views/dist/grid/chrome/grid-cell-classes.d.ts +96 -0
- package/views/dist/grid/chrome/grid-cell-classes.js +70 -0
- package/views/dist/grid/chrome/grid-cell-link.d.ts +13 -0
- package/views/dist/grid/chrome/grid-cell-link.js +9 -0
- package/views/dist/grid/chrome/grid-column-menu-items.d.ts +78 -0
- package/views/dist/grid/chrome/grid-column-menu-items.js +292 -0
- package/views/dist/grid/chrome/grid-columns-template.d.ts +45 -0
- package/views/dist/grid/chrome/grid-columns-template.js +18 -0
- package/views/dist/grid/chrome/grid-edit-escape.d.ts +4 -0
- package/views/dist/grid/chrome/grid-edit-escape.js +12 -0
- package/views/dist/grid/chrome/grid-edit-session.d.ts +67 -0
- package/views/dist/grid/chrome/grid-edit-session.js +141 -0
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +7 -0
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-figure-value.d.ts +25 -0
- package/views/dist/grid/chrome/grid-figure-value.js +40 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +15 -0
- package/views/dist/grid/chrome/grid-fitted-box.js +26 -0
- package/views/dist/grid/chrome/grid-group-menu-items.d.ts +38 -0
- package/views/dist/grid/chrome/grid-group-menu-items.js +92 -0
- package/views/dist/grid/chrome/grid-group-menu-parts.d.ts +31 -0
- package/views/dist/grid/chrome/grid-group-menu-parts.js +21 -0
- package/views/dist/grid/chrome/grid-hover.d.ts +74 -0
- package/views/dist/grid/chrome/grid-hover.js +150 -0
- package/views/dist/grid/chrome/grid-lab.d.ts +7 -0
- package/views/dist/grid/chrome/grid-lab.js +7 -0
- package/views/dist/grid/chrome/grid-menu-focus.d.ts +65 -0
- package/views/dist/grid/chrome/grid-menu-focus.js +160 -0
- package/views/dist/grid/chrome/grid-menu-search.d.ts +7 -0
- package/views/dist/grid/chrome/grid-menu-search.js +7 -0
- package/views/dist/grid/chrome/grid-pages.d.ts +15 -0
- package/views/dist/grid/chrome/grid-pages.js +9 -0
- package/views/dist/grid/chrome/grid-row-menu-items.d.ts +49 -0
- package/views/dist/grid/chrome/grid-row-menu-items.js +159 -0
- package/views/dist/grid/chrome/grid-row-menu-key.d.ts +15 -0
- package/views/dist/grid/chrome/grid-row-menu-key.js +36 -0
- package/views/dist/grid/chrome/grid-row-props.d.ts +155 -0
- package/views/dist/grid/chrome/grid-row-props.js +1 -0
- package/views/dist/grid/chrome/grid-row-window.d.ts +78 -0
- package/views/dist/grid/chrome/grid-row-window.js +280 -0
- package/views/dist/grid/chrome/grid-rows-menu.d.ts +42 -0
- package/views/dist/grid/chrome/grid-rows-menu.js +85 -0
- package/views/dist/grid/chrome/grid-scroll-owner.d.ts +38 -0
- package/views/dist/grid/chrome/grid-scroll-owner.js +75 -0
- package/views/dist/grid/chrome/grid-styles.d.ts +50 -0
- package/views/dist/grid/chrome/grid-styles.js +11 -0
- package/views/dist/grid/chrome/grid-table-props.d.ts +310 -0
- package/views/dist/grid/chrome/grid-table-props.js +1 -0
- package/views/dist/grid/chrome/grid-wait.d.ts +22 -0
- package/views/dist/grid/chrome/grid-wait.js +4 -0
- package/views/dist/grid/chrome/useBarRoom.d.ts +19 -0
- package/views/dist/grid/chrome/useBarRoom.js +96 -0
- package/views/dist/grid/chrome/useGridBandFigures.d.ts +26 -0
- package/views/dist/grid/chrome/useGridBandFigures.js +50 -0
- package/views/dist/grid/chrome/useGridBatchApi.d.ts +34 -0
- package/views/dist/grid/chrome/useGridBatchApi.js +36 -0
- package/views/dist/grid/chrome/useGridBoxes.d.ts +22 -0
- package/views/dist/grid/chrome/useGridBoxes.js +22 -0
- package/views/dist/grid/chrome/useGridCellPick.d.ts +30 -0
- package/views/dist/grid/chrome/useGridCellPick.js +77 -0
- package/views/dist/grid/chrome/useGridColumnLayout.d.ts +32 -0
- package/views/dist/grid/chrome/useGridColumnLayout.js +251 -0
- package/views/dist/grid/chrome/useGridFocus.d.ts +48 -0
- package/views/dist/grid/chrome/useGridFocus.js +129 -0
- package/views/dist/grid/chrome/useGridHeaderDrag.d.ts +20 -0
- package/views/dist/grid/chrome/useGridHeaderDrag.js +37 -0
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +65 -0
- package/views/dist/grid/chrome/useGridKeyboard.js +463 -0
- package/views/dist/grid/chrome/useGridLongPress.d.ts +30 -0
- package/views/dist/grid/chrome/useGridLongPress.js +98 -0
- package/views/dist/grid/chrome/useGridPartColumns.d.ts +5 -0
- package/views/dist/grid/chrome/useGridPartColumns.js +9 -0
- package/views/dist/grid/chrome/useGridPendingReconciliation.d.ts +12 -0
- package/views/dist/grid/chrome/useGridPendingReconciliation.js +32 -0
- package/views/dist/grid/chrome/useGridRailReveal.d.ts +57 -0
- package/views/dist/grid/chrome/useGridRailReveal.js +67 -0
- package/views/dist/grid/chrome/useGridRangeActions.d.ts +51 -0
- package/views/dist/grid/chrome/useGridRangeActions.js +199 -0
- package/views/dist/grid/chrome/useGridRangeGestures.d.ts +33 -0
- package/views/dist/grid/chrome/useGridRangeGestures.js +241 -0
- package/views/dist/grid/chrome/useGridRecorder.d.ts +16 -0
- package/views/dist/grid/chrome/useGridRecorder.js +144 -0
- package/views/dist/grid/chrome/useGridRowOpener.d.ts +41 -0
- package/views/dist/grid/chrome/useGridRowOpener.js +83 -0
- package/views/dist/grid/chrome/useGridScaleStyles.d.ts +3 -0
- package/views/dist/grid/chrome/useGridScaleStyles.js +28 -0
- package/views/dist/grid/chrome/useGridScrollArea.d.ts +47 -0
- package/views/dist/grid/chrome/useGridScrollArea.js +120 -0
- package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +81 -0
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +336 -0
- package/views/dist/grid/chrome/useGridTableSelection.d.ts +31 -0
- package/views/dist/grid/chrome/useGridTableSelection.js +55 -0
- package/views/dist/grid/chrome/useHeaderDragReorder.d.ts +21 -0
- package/views/dist/grid/chrome/useHeaderDragReorder.js +218 -0
- package/views/dist/grid/core/clipboard-model.d.ts +123 -0
- package/views/dist/grid/core/clipboard-model.js +388 -0
- package/views/dist/grid/core/column-values.d.ts +27 -0
- package/views/dist/grid/core/column-values.js +76 -0
- package/views/dist/grid/core/commit-model.d.ts +48 -0
- package/views/dist/grid/core/commit-model.js +3 -0
- package/views/dist/grid/core/coordinates.d.ts +48 -0
- package/views/dist/grid/core/coordinates.js +27 -0
- package/views/dist/grid/core/edge-scroll.d.ts +21 -0
- package/views/dist/grid/core/edge-scroll.js +23 -0
- package/views/dist/grid/core/edit-values.d.ts +9 -0
- package/views/dist/grid/core/edit-values.js +1 -0
- package/views/dist/grid/core/editing-controller.d.ts +146 -0
- package/views/dist/grid/core/editing-controller.js +563 -0
- package/views/dist/grid/core/editing-model.d.ts +113 -0
- package/views/dist/grid/core/editing-model.js +168 -0
- package/views/dist/grid/core/flat-rows.d.ts +35 -0
- package/views/dist/grid/core/flat-rows.js +20 -0
- package/views/dist/grid/core/grid-aria.d.ts +31 -0
- package/views/dist/grid/core/grid-aria.js +41 -0
- package/views/dist/grid/core/grid-focus.d.ts +60 -0
- package/views/dist/grid/core/grid-focus.js +171 -0
- package/views/dist/grid/core/grid-recorder.d.ts +111 -0
- package/views/dist/grid/core/grid-recorder.js +223 -0
- package/views/dist/grid/core/grid-scale.d.ts +14 -0
- package/views/dist/grid/core/grid-scale.js +8 -0
- package/views/dist/grid/core/nav.d.ts +94 -0
- package/views/dist/grid/core/nav.js +92 -0
- package/views/dist/grid/core/part-edits.d.ts +18 -0
- package/views/dist/grid/core/part-edits.js +48 -0
- package/views/dist/grid/core/pending-reconciliation.d.ts +53 -0
- package/views/dist/grid/core/pending-reconciliation.js +60 -0
- package/views/dist/grid/core/range-model.d.ts +25 -0
- package/views/dist/grid/core/range-model.js +59 -0
- package/views/dist/grid/core/refusal-sentence.d.ts +3 -0
- package/views/dist/grid/core/refusal-sentence.js +15 -0
- package/views/dist/grid/core/row-opened-from.d.ts +21 -0
- package/views/dist/grid/core/row-opened-from.js +11 -0
- package/views/dist/grid/core/row-window.d.ts +40 -0
- package/views/dist/grid/core/row-window.js +43 -0
- package/views/dist/grid/core/spreadsheet-operations.d.ts +101 -0
- package/views/dist/grid/core/spreadsheet-operations.js +282 -0
- package/views/dist/grid/core/useGridEditing.d.ts +72 -0
- package/views/dist/grid/core/useGridEditing.js +105 -0
- package/views/dist/grid/core/useGridRange.d.ts +22 -0
- package/views/dist/grid/core/useGridRange.js +27 -0
- package/views/dist/grid/core/value-equality.d.ts +72 -0
- package/views/dist/grid/core/value-equality.js +104 -0
- package/views/dist/grid/core/write-states.d.ts +20 -0
- package/views/dist/grid/core/write-states.js +21 -0
- package/views/dist/grid/grid-format-props.d.ts +26 -0
- package/views/dist/grid/grid-format-props.js +65 -0
- package/views/dist/grid/index.d.ts +23 -0
- package/views/dist/grid/index.js +7 -0
- package/views/dist/grid/useGridTablePrefs.d.ts +48 -0
- package/views/dist/grid/useGridTablePrefs.js +47 -0
- package/views/dist/grid/useGridTableSettings.d.ts +60 -0
- package/views/dist/grid/useGridTableSettings.js +61 -0
- package/views/dist/grid-lab.d.ts +18 -0
- package/views/dist/grid-lab.js +16 -0
- package/views/dist/grouping/sort-groups.d.ts +17 -0
- package/views/dist/grouping/sort-groups.js +33 -0
- package/views/dist/grouping/types.d.ts +10 -0
- package/views/dist/grouping/types.js +1 -0
- package/views/dist/index.d.ts +31 -0
- package/views/dist/index.js +30 -0
- package/views/dist/internal/chip.d.ts +4 -0
- package/views/dist/internal/chip.js +3 -0
- package/views/dist/internal/count.d.ts +3 -0
- package/views/dist/internal/count.js +3 -0
- package/views/dist/internal/cx.d.ts +3 -0
- package/views/dist/internal/cx.js +3 -0
- package/views/dist/internal/reset.d.ts +9 -0
- package/views/dist/internal/reset.js +1 -0
- package/views/dist/internal/use-idle-write.d.ts +1 -0
- package/views/dist/internal/use-idle-write.js +13 -0
- package/views/dist/internal/viewport.d.ts +3 -0
- package/views/dist/internal/viewport.js +15 -0
- package/views/dist/internal/zone-clock.d.ts +20 -0
- package/views/dist/internal/zone-clock.js +77 -0
- package/views/dist/model/aggregates.d.ts +61 -0
- package/views/dist/model/aggregates.js +134 -0
- package/views/dist/model/body-frame.d.ts +34 -0
- package/views/dist/model/body-frame.js +15 -0
- package/views/dist/model/card-density.d.ts +8 -0
- package/views/dist/model/card-density.js +10 -0
- package/views/dist/model/card-layout.d.ts +85 -0
- package/views/dist/model/card-layout.js +90 -0
- package/views/dist/model/column-capabilities.d.ts +193 -0
- package/views/dist/model/column-capabilities.js +280 -0
- package/views/dist/model/column-filters.d.ts +109 -0
- package/views/dist/model/column-filters.js +348 -0
- package/views/dist/model/column-format.d.ts +103 -0
- package/views/dist/model/column-format.js +1 -0
- package/views/dist/model/column-from.d.ts +28 -0
- package/views/dist/model/column-from.js +165 -0
- package/views/dist/model/column-inspect.d.ts +28 -0
- package/views/dist/model/column-inspect.js +17 -0
- package/views/dist/model/column-knobs.d.ts +20 -0
- package/views/dist/model/column-knobs.js +16 -0
- package/views/dist/model/column-mark.d.ts +13 -0
- package/views/dist/model/column-mark.js +10 -0
- package/views/dist/model/column-money.d.ts +13 -0
- package/views/dist/model/column-money.js +27 -0
- package/views/dist/model/column-order.d.ts +36 -0
- package/views/dist/model/column-order.js +68 -0
- package/views/dist/model/column-schema.d.ts +355 -0
- package/views/dist/model/column-schema.js +1 -0
- package/views/dist/model/column-sort.d.ts +28 -0
- package/views/dist/model/column-sort.js +25 -0
- package/views/dist/model/column-state.d.ts +72 -0
- package/views/dist/model/column-state.js +92 -0
- package/views/dist/model/column-types.d.ts +97 -0
- package/views/dist/model/column-types.js +50 -0
- package/views/dist/model/column-warnings.d.ts +44 -0
- package/views/dist/model/column-warnings.js +24 -0
- package/views/dist/model/density.d.ts +3 -0
- package/views/dist/model/density.js +13 -0
- package/views/dist/model/field-type-of.d.ts +21 -0
- package/views/dist/model/field-type-of.js +11 -0
- package/views/dist/model/filter-capabilities.d.ts +1 -0
- package/views/dist/model/filter-capabilities.js +1 -0
- package/views/dist/model/index.d.ts +38 -0
- package/views/dist/model/index.js +20 -0
- package/views/dist/model/one-value.d.ts +6 -0
- package/views/dist/model/one-value.js +5 -0
- package/views/dist/model/part-columns.d.ts +17 -0
- package/views/dist/model/part-columns.js +69 -0
- package/views/dist/model/part-rows.d.ts +21 -0
- package/views/dist/model/part-rows.js +35 -0
- package/views/dist/model/part-write.d.ts +11 -0
- package/views/dist/model/part-write.js +52 -0
- package/views/dist/model/place-parts.d.ts +6 -0
- package/views/dist/model/place-parts.js +14 -0
- package/views/dist/model/preferences.d.ts +131 -0
- package/views/dist/model/preferences.js +67 -0
- package/views/dist/model/prefs-buckets.d.ts +145 -0
- package/views/dist/model/prefs-buckets.js +68 -0
- package/views/dist/model/relation-filters.d.ts +64 -0
- package/views/dist/model/relation-filters.js +93 -0
- package/views/dist/model/render-count.d.ts +8 -0
- package/views/dist/model/render-count.js +35 -0
- package/views/dist/model/row-icon.d.ts +29 -0
- package/views/dist/model/row-icon.js +5 -0
- package/views/dist/model/settings-columns.d.ts +34 -0
- package/views/dist/model/settings-columns.js +146 -0
- package/views/dist/model/settings-look.d.ts +17 -0
- package/views/dist/model/settings-look.js +23 -0
- package/views/dist/model/view-rules.d.ts +92 -0
- package/views/dist/model/view-rules.js +300 -0
- package/views/dist/panels/availability.d.ts +26 -0
- package/views/dist/panels/availability.js +28 -0
- package/views/dist/panels/customize-body.d.ts +45 -0
- package/views/dist/panels/customize-body.js +292 -0
- package/views/dist/panels/filter/DateFilterBody.d.ts +44 -0
- package/views/dist/panels/filter/DateFilterBody.js +84 -0
- package/views/dist/panels/filter/DateFilterCalendar.d.ts +19 -0
- package/views/dist/panels/filter/DateFilterCalendar.js +37 -0
- package/views/dist/panels/filter/DateFilterInput.d.ts +16 -0
- package/views/dist/panels/filter/DateFilterInput.js +36 -0
- package/views/dist/panels/filter/FilterIcon.d.ts +7 -0
- package/views/dist/panels/filter/FilterIcon.js +15 -0
- package/views/dist/panels/filter/MenuSelect.d.ts +12 -0
- package/views/dist/panels/filter/MenuSelect.js +50 -0
- package/views/dist/panels/filter/NumberFilterBody.d.ts +21 -0
- package/views/dist/panels/filter/NumberFilterBody.js +75 -0
- package/views/dist/panels/filter/RangeFilterBody.d.ts +19 -0
- package/views/dist/panels/filter/RangeFilterBody.js +78 -0
- package/views/dist/panels/filter/RelationFilterBody.d.ts +17 -0
- package/views/dist/panels/filter/RelationFilterBody.js +20 -0
- package/views/dist/panels/filter/TextFilterBody.d.ts +31 -0
- package/views/dist/panels/filter/TextFilterBody.js +43 -0
- package/views/dist/panels/filter/TimeScopeDetail.d.ts +6 -0
- package/views/dist/panels/filter/TimeScopeDetail.js +47 -0
- package/views/dist/panels/filter/details.d.ts +21 -0
- package/views/dist/panels/filter/details.js +100 -0
- package/views/dist/panels/filter/filter-list.d.ts +23 -0
- package/views/dist/panels/filter/filter-list.js +38 -0
- package/views/dist/panels/group-sort.d.ts +24 -0
- package/views/dist/panels/group-sort.js +58 -0
- package/views/dist/panels/index.d.ts +31 -0
- package/views/dist/panels/index.js +22 -0
- package/views/dist/panels/labels.d.ts +37 -0
- package/views/dist/panels/labels.js +166 -0
- package/views/dist/panels/model.d.ts +429 -0
- package/views/dist/panels/model.js +95 -0
- package/views/dist/panels/panel-button.d.ts +50 -0
- package/views/dist/panels/panel-button.js +21 -0
- package/views/dist/panels/quick/model.d.ts +102 -0
- package/views/dist/panels/quick/model.js +102 -0
- package/views/dist/panels/react/GroupBucketsList.d.ts +16 -0
- package/views/dist/panels/react/GroupBucketsList.js +44 -0
- package/views/dist/panels/react/LayoutColumnsList.d.ts +24 -0
- package/views/dist/panels/react/LayoutColumnsList.js +101 -0
- package/views/dist/panels/react/PopoverColumnDetail.d.ts +11 -0
- package/views/dist/panels/react/PopoverColumnDetail.js +24 -0
- package/views/dist/panels/react/chrome.d.ts +20 -0
- package/views/dist/panels/react/chrome.js +9 -0
- package/views/dist/panels/react/column-refusals.d.ts +7 -0
- package/views/dist/panels/react/column-refusals.js +14 -0
- package/views/dist/panels/react/customize-body.d.ts +15 -0
- package/views/dist/panels/react/customize-body.js +63 -0
- package/views/dist/panels/react/customize.d.ts +33 -0
- package/views/dist/panels/react/customize.js +113 -0
- package/views/dist/panels/react/drag-kit.d.ts +55 -0
- package/views/dist/panels/react/drag-kit.js +89 -0
- package/views/dist/panels/react/drag-load.d.ts +8 -0
- package/views/dist/panels/react/drag-load.js +24 -0
- package/views/dist/panels/react/drag.d.ts +2 -0
- package/views/dist/panels/react/drag.js +5 -0
- package/views/dist/panels/react/field-editor.d.ts +10 -0
- package/views/dist/panels/react/field-editor.js +1 -0
- package/views/dist/panels/react/filter/FilterEditor.d.ts +24 -0
- package/views/dist/panels/react/filter/FilterEditor.js +344 -0
- package/views/dist/panels/react/filter/FilterFieldList.d.ts +15 -0
- package/views/dist/panels/react/filter/FilterFieldList.js +57 -0
- package/views/dist/panels/react/filter/FilterValueBody.d.ts +5 -0
- package/views/dist/panels/react/filter/FilterValueBody.js +22 -0
- package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +22 -0
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +186 -0
- package/views/dist/panels/react/filter/editor-ctx.d.ts +98 -0
- package/views/dist/panels/react/filter/editor-ctx.js +131 -0
- package/views/dist/panels/react/filter/filter-body.d.ts +19 -0
- package/views/dist/panels/react/filter/filter-body.js +72 -0
- package/views/dist/panels/react/filter/filter-part-body.d.ts +20 -0
- package/views/dist/panels/react/filter/filter-part-body.js +23 -0
- package/views/dist/panels/react/filter/rule-writes.d.ts +56 -0
- package/views/dist/panels/react/filter/rule-writes.js +152 -0
- package/views/dist/panels/react/filter-panel.d.ts +18 -0
- package/views/dist/panels/react/filter-panel.js +48 -0
- package/views/dist/panels/react/layout-detail.d.ts +4 -0
- package/views/dist/panels/react/layout-detail.js +29 -0
- package/views/dist/panels/react/order-details.d.ts +32 -0
- package/views/dist/panels/react/order-details.js +89 -0
- package/views/dist/panels/react/panel-header.d.ts +10 -0
- package/views/dist/panels/react/panel-header.js +20 -0
- package/views/dist/panels/react/panel-sheet.d.ts +23 -0
- package/views/dist/panels/react/panel-sheet.js +24 -0
- package/views/dist/panels/react/popover.d.ts +71 -0
- package/views/dist/panels/react/popover.js +47 -0
- package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +12 -0
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +148 -0
- package/views/dist/panels/react/quick/QuickFiltersReminder.d.ts +13 -0
- package/views/dist/panels/react/quick/QuickFiltersReminder.js +46 -0
- package/views/dist/panels/react/root-list.d.ts +6 -0
- package/views/dist/panels/react/root-list.js +31 -0
- package/views/dist/panels/react/sort/SortEditor.d.ts +24 -0
- package/views/dist/panels/react/sort/SortEditor.js +290 -0
- package/views/dist/panels/react/sort/SortFieldList.d.ts +12 -0
- package/views/dist/panels/react/sort/SortFieldList.js +34 -0
- package/views/dist/panels/react/sort/use-sort-drag.d.ts +17 -0
- package/views/dist/panels/react/sort/use-sort-drag.js +39 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +62 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +240 -0
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +30 -0
- package/views/dist/panels/react/toolbar/Toolbar.js +113 -0
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.d.ts +25 -0
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +85 -0
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.d.ts +20 -0
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +78 -0
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.d.ts +21 -0
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +126 -0
- package/views/dist/panels/react/toolbar/ToolbarButton.d.ts +5 -0
- package/views/dist/panels/react/toolbar/ToolbarButton.js +9 -0
- package/views/dist/panels/react/toolbar/ToolbarFilter.d.ts +28 -0
- package/views/dist/panels/react/toolbar/ToolbarFilter.js +42 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterSheet.d.ts +12 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +30 -0
- package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +19 -0
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +281 -0
- package/views/dist/panels/react/toolbar/ToolbarNew.d.ts +12 -0
- package/views/dist/panels/react/toolbar/ToolbarNew.js +31 -0
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +29 -0
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +33 -0
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +14 -0
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +16 -0
- package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +8 -0
- package/views/dist/panels/react/toolbar/ToolbarSave.js +42 -0
- package/views/dist/panels/react/toolbar/ToolbarSearch.d.ts +9 -0
- package/views/dist/panels/react/toolbar/ToolbarSearch.js +84 -0
- package/views/dist/panels/react/toolbar/ToolbarSort.d.ts +14 -0
- package/views/dist/panels/react/toolbar/ToolbarSort.js +29 -0
- package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +18 -0
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +81 -0
- package/views/dist/panels/react/toolbar/ToolbarViews.d.ts +13 -0
- package/views/dist/panels/react/toolbar/ToolbarViews.js +29 -0
- package/views/dist/panels/react/toolbar/bar-writes.d.ts +31 -0
- package/views/dist/panels/react/toolbar/bar-writes.js +82 -0
- package/views/dist/panels/react/toolbar/context.d.ts +83 -0
- package/views/dist/panels/react/toolbar/context.js +74 -0
- package/views/dist/panels/react/toolbar/panel-part.d.ts +54 -0
- package/views/dist/panels/react/toolbar/panel-part.js +49 -0
- package/views/dist/panels/react/toolbar/panel-state.d.ts +9 -0
- package/views/dist/panels/react/toolbar/panel-state.js +12 -0
- package/views/dist/panels/react/toolbar/use-box-narrow.d.ts +2 -0
- package/views/dist/panels/react/toolbar/use-box-narrow.js +18 -0
- package/views/dist/panels/react/toolbar/use-give-way.d.ts +4 -0
- package/views/dist/panels/react/toolbar/use-give-way.js +110 -0
- package/views/dist/panels/react/toolbar/use-list-settings-state.d.ts +10 -0
- package/views/dist/panels/react/toolbar/use-list-settings-state.js +10 -0
- package/views/dist/panels/react/view-actions.d.ts +4 -0
- package/views/dist/panels/react/view-actions.js +47 -0
- package/views/dist/panels/react/view-footer.d.ts +20 -0
- package/views/dist/panels/react/view-footer.js +41 -0
- package/views/dist/panels/react/views-row/FoldingViewRow.d.ts +5 -0
- package/views/dist/panels/react/views-row/FoldingViewRow.js +137 -0
- package/views/dist/panels/react/views-row/HScrollRow.d.ts +7 -0
- package/views/dist/panels/react/views-row/HScrollRow.js +42 -0
- package/views/dist/panels/react/views-row/PillGroup.d.ts +30 -0
- package/views/dist/panels/react/views-row/PillGroup.js +85 -0
- package/views/dist/panels/react/views-row/ViewAxes.d.ts +9 -0
- package/views/dist/panels/react/views-row/ViewAxes.js +16 -0
- package/views/dist/panels/react/views-row/ViewCreatePill.d.ts +7 -0
- package/views/dist/panels/react/views-row/ViewCreatePill.js +28 -0
- package/views/dist/panels/react/views-row/ViewPicker.d.ts +5 -0
- package/views/dist/panels/react/views-row/ViewPicker.js +112 -0
- package/views/dist/panels/react/views-row/ViewPickerRow.d.ts +7 -0
- package/views/dist/panels/react/views-row/ViewPickerRow.js +47 -0
- package/views/dist/panels/react/views-row/ViewTabs.d.ts +31 -0
- package/views/dist/panels/react/views-row/ViewTabs.js +29 -0
- package/views/dist/panels/react/views-row/in-frame.d.ts +8 -0
- package/views/dist/panels/react/views-row/in-frame.js +9 -0
- package/views/dist/panels/react/views-row/menu-classes.d.ts +6 -0
- package/views/dist/panels/react/views-row/menu-classes.js +3 -0
- package/views/dist/panels/react/views-row/use-anchored-toggle.d.ts +19 -0
- package/views/dist/panels/react/views-row/use-anchored-toggle.js +31 -0
- package/views/dist/panels/react.d.ts +67 -0
- package/views/dist/panels/react.js +58 -0
- package/views/dist/panels/settings/axes.d.ts +28 -0
- package/views/dist/panels/settings/axes.js +71 -0
- package/views/dist/panels/settings/filter-groups.d.ts +58 -0
- package/views/dist/panels/settings/filter-groups.js +305 -0
- package/views/dist/panels/settings/filters.d.ts +20 -0
- package/views/dist/panels/settings/filters.js +128 -0
- package/views/dist/panels/settings/group-buckets.d.ts +24 -0
- package/views/dist/panels/settings/group-buckets.js +69 -0
- package/views/dist/panels/settings/input.d.ts +84 -0
- package/views/dist/panels/settings/input.js +1 -0
- package/views/dist/panels/settings/layout.d.ts +5 -0
- package/views/dist/panels/settings/layout.js +259 -0
- package/views/dist/panels/settings/order.d.ts +21 -0
- package/views/dist/panels/settings/order.js +227 -0
- package/views/dist/panels/settings/settings-panels.d.ts +21 -0
- package/views/dist/panels/settings/settings-panels.js +33 -0
- package/views/dist/panels/settings/sort-keys.d.ts +25 -0
- package/views/dist/panels/settings/sort-keys.js +74 -0
- package/views/dist/panels/settings/sorts.d.ts +33 -0
- package/views/dist/panels/settings/sorts.js +135 -0
- package/views/dist/panels/sort-body-options.d.ts +4 -0
- package/views/dist/panels/sort-body-options.js +10 -0
- package/views/dist/panels/toolbar/clear.d.ts +9 -0
- package/views/dist/panels/toolbar/clear.js +33 -0
- package/views/dist/panels/toolbar/counts.d.ts +21 -0
- package/views/dist/panels/toolbar/counts.js +29 -0
- package/views/dist/panels/toolbar/edit-view.d.ts +5 -0
- package/views/dist/panels/toolbar/edit-view.js +18 -0
- package/views/dist/panels/toolbar/filter-words.d.ts +42 -0
- package/views/dist/panels/toolbar/filter-words.js +145 -0
- package/views/dist/panels/toolbar/model.d.ts +74 -0
- package/views/dist/panels/toolbar/model.js +110 -0
- package/views/dist/panels/use-filter-opened.d.ts +8 -0
- package/views/dist/panels/use-filter-opened.js +11 -0
- package/views/dist/panels/view-state.d.ts +38 -0
- package/views/dist/panels/view-state.js +1 -0
- package/views/dist/panels/views-row/model.d.ts +141 -0
- package/views/dist/panels/views-row/model.js +24 -0
- package/views/dist/provider/ViewsProvider.d.ts +103 -0
- package/views/dist/provider/ViewsProvider.js +75 -0
- package/views/dist/provider/components.d.ts +1375 -0
- package/views/dist/provider/components.js +5 -0
- package/views/dist/provider/context.d.ts +58 -0
- package/views/dist/provider/context.js +10 -0
- package/views/dist/provider/desktop.d.ts +12 -0
- package/views/dist/provider/desktop.js +25 -0
- package/views/dist/provider/icons.d.ts +6 -0
- package/views/dist/provider/icons.js +1 -0
- package/views/dist/provider/menu-groups.d.ts +9 -0
- package/views/dist/provider/menu-groups.js +44 -0
- package/views/dist/provider/missing-slot.d.ts +10 -0
- package/views/dist/provider/missing-slot.js +15 -0
- package/views/dist/provider/plain-input.d.ts +9 -0
- package/views/dist/provider/plain-input.js +7 -0
- package/views/dist/provider/ports.d.ts +57 -0
- package/views/dist/provider/ports.js +9 -0
- package/views/dist/react.d.ts +14 -0
- package/views/dist/react.js +5 -0
- package/views/dist/selection/SelectCheckbox.d.ts +19 -0
- package/views/dist/selection/SelectCheckbox.js +11 -0
- package/views/dist/selection/SelectionBar.d.ts +18 -0
- package/views/dist/selection/SelectionBar.js +100 -0
- package/views/dist/selection/SelectionBarPhone.d.ts +3 -0
- package/views/dist/selection/SelectionBarPhone.js +14 -0
- package/views/dist/selection/bar-overflow.d.ts +12 -0
- package/views/dist/selection/bar-overflow.js +55 -0
- package/views/dist/selection/bar-parts.d.ts +17 -0
- package/views/dist/selection/bar-parts.js +19 -0
- package/views/dist/selection/bar-room.d.ts +7 -0
- package/views/dist/selection/bar-room.js +3 -0
- package/views/dist/selection/index.d.ts +9 -0
- package/views/dist/selection/index.js +7 -0
- package/views/dist/selection/model.d.ts +55 -0
- package/views/dist/selection/model.js +86 -0
- package/views/dist/selection/row-click.d.ts +35 -0
- package/views/dist/selection/row-click.js +20 -0
- package/views/dist/selection/types.d.ts +21 -0
- package/views/dist/selection/types.js +1 -0
- package/views/dist/selection/useCheckDragSelect.d.ts +61 -0
- package/views/dist/selection/useCheckDragSelect.js +166 -0
- package/views/dist/selection/useListSelection.d.ts +39 -0
- package/views/dist/selection/useListSelection.js +48 -0
- package/views/dist/selection/useListSelectionShortcuts.d.ts +7 -0
- package/views/dist/selection/useListSelectionShortcuts.js +14 -0
- package/views/dist/selection/useRestIntent.d.ts +18 -0
- package/views/dist/selection/useRestIntent.js +35 -0
- package/views/dist/selection/verbs.d.ts +41 -0
- package/views/dist/selection/verbs.js +1 -0
- package/views/docs/contract.md +1181 -0
- package/views/docs/getting-started.md +250 -0
- package/views/docs/guides/atoms.md +305 -0
- package/views/docs/guides/cells.md +302 -0
- package/views/docs/guides/columns.md +413 -0
- package/views/docs/guides/display.md +205 -0
- package/views/docs/guides/editors.md +496 -0
- package/views/docs/guides/ports.md +246 -0
- package/views/docs/guides/selection.md +284 -0
- package/views/docs/guides/the-grid.md +736 -0
- package/views/docs/guides/the-provider.md +478 -0
- package/views/docs/index.md +54 -0
- package/views/docs/install.md +74 -0
- package/views/docs/reference/cells.md +28 -0
- package/views/docs/reference/display.md +46 -0
- package/views/docs/reference/editors-chips.md +6 -0
- package/views/docs/reference/editors-date.md +8 -0
- package/views/docs/reference/editors-location.md +12 -0
- package/views/docs/reference/editors-name.md +8 -0
- package/views/docs/reference/editors-number.md +13 -0
- package/views/docs/reference/editors-open-values.md +10 -0
- package/views/docs/reference/editors-panel.md +12 -0
- package/views/docs/reference/editors-range.md +8 -0
- package/views/docs/reference/editors-relation.md +12 -0
- package/views/docs/reference/editors-select.md +9 -0
- package/views/docs/reference/editors-session.md +13 -0
- package/views/docs/reference/editors-text.md +9 -0
- package/views/docs/reference/editors-value-list.md +6 -0
- package/views/docs/reference/editors.md +5 -0
- package/views/docs/reference/field-row.md +16 -0
- package/views/docs/reference/grid.md +64 -0
- package/views/docs/reference/panels-react.md +172 -0
- package/views/docs/reference/panels.md +220 -0
- package/views/docs/reference/react.md +164 -0
- package/views/docs/reference/selection.md +41 -0
- package/views/docs/reference/views.md +638 -0
- package/views/docs/reshaping.md +19 -0
- package/views/skills/views/SKILL.md +103 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Sql } from "../sql.js";
|
|
2
|
+
/** 2^1024 − 2^970, exact: the least magnitude a double rounds to infinity. */
|
|
3
|
+
export declare const DOUBLE_LIMIT_SQL: Sql;
|
|
4
|
+
/** 2^-1075, exact: the greatest magnitude a double rounds to zero. */
|
|
5
|
+
export declare const HALF_MIN_SUBNORMAL_SQL: Sql;
|
|
6
|
+
/**
|
|
7
|
+
* Where a named value is read: its subquery's alias and its column. Each place that names a value has an alias of its
|
|
8
|
+
* own, written out here, so a value named inside another's body never hides the outer one. A value handed in to be named
|
|
9
|
+
* sits in the subquery's own select list, where it reads the aliases around it, so nesting a form in another's argument
|
|
10
|
+
* is always safe.
|
|
11
|
+
*/
|
|
12
|
+
export type Alias = {
|
|
13
|
+
readonly as: Sql;
|
|
14
|
+
readonly v: Sql;
|
|
15
|
+
};
|
|
16
|
+
/** Two values named together. */
|
|
17
|
+
export type Alias2 = {
|
|
18
|
+
readonly as: Sql;
|
|
19
|
+
readonly a: Sql;
|
|
20
|
+
readonly b: Sql;
|
|
21
|
+
};
|
|
22
|
+
/** `body` over `value` named once: `(SELECT <body> FROM (SELECT <value> AS "v" OFFSET 0) AS <alias>)`. */
|
|
23
|
+
export declare function named(value: Sql, alias: Alias, body: (v: Sql) => Sql): Sql;
|
|
24
|
+
/** Two values named once together. */
|
|
25
|
+
export declare function named2(a: Sql, b: Sql, alias: Alias2, body: (a: Sql, b: Sql) => Sql): Sql;
|
|
26
|
+
/**
|
|
27
|
+
* The shortest decimal that reads back as `x`, signed: a numeric holding JavaScript's digits; 0 for ±0, NULL for NULL. A
|
|
28
|
+
* normal double whose numeric cast (its nearest 15 significant digits, as the arithmetic below reads it) reads back is
|
|
29
|
+
* that cast: a shorter decimal that reads back is the 15-digit one with zeros, the same number, and taking it skips the
|
|
30
|
+
* spelling. Any other is spelled.
|
|
31
|
+
*/
|
|
32
|
+
export declare function shortestNumeric(x: Sql): Sql;
|
|
33
|
+
/** `x` as JavaScript's String() writes it: "0" for ±0, a plain decimal from 1e-6 to below 1e21, else `<digits>e±<n>`. */
|
|
34
|
+
export declare function numberText(x: Sql): Sql;
|
|
35
|
+
/** `a + b`, NULL where the sum is past a double's range. */
|
|
36
|
+
export declare function safeAdd(a: Sql, b: Sql): Sql;
|
|
37
|
+
/** `a − b`, NULL where the difference is past a double's range. */
|
|
38
|
+
export declare function safeSubtract(a: Sql, b: Sql): Sql;
|
|
39
|
+
/** `a × b`, NULL past a double's range, a signed zero where it underflows to zero. */
|
|
40
|
+
export declare function safeMultiply(a: Sql, b: Sql): Sql;
|
|
41
|
+
/** `a ÷ b`, NULL for a division by zero or past a double's range, a signed zero where it underflows to zero. */
|
|
42
|
+
export declare function safeDivide(a: Sql, b: Sql): Sql;
|
|
43
|
+
/**
|
|
44
|
+
* fields' `round(x, places)`: places truncated and held to −15…15 (no places, or none given, is 0); half away from zero,
|
|
45
|
+
* on the decimal exponent of x's shortest spelling and back; NULL where the result isn't a finite double; the sign of a
|
|
46
|
+
* zero kept as JavaScript keeps it.
|
|
47
|
+
*/
|
|
48
|
+
export declare function jsRound(x: Sql, places: Sql | null): Sql;
|
|
49
|
+
/**
|
|
50
|
+
* A row's number as the double ViewKit reads it, never raising: NaN and the infinities as no number; an integer or a
|
|
51
|
+
* bigint as itself; a numeric past a double's range as no number, at or below 2^-1075 as 0, else rounded to 40
|
|
52
|
+
* significant digits first and read as the double nearest it. (A numeric of hundreds of digits next to the greatest
|
|
53
|
+
* double is refused by some C libraries' strtod, which Postgres' cast runs; 40 digits read back as the same double.)
|
|
54
|
+
*/
|
|
55
|
+
export declare function numberOf(value: Sql, stored: "integer" | "bigint" | "numeric" | "float8"): Sql;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { DOUBLE_OVERFLOW, DOUBLE_UNDERFLOW } from "../bounds.js";
|
|
2
|
+
import { sql } from "../sql.js";
|
|
3
|
+
export const DOUBLE_LIMIT_SQL = sql `${DOUBLE_OVERFLOW}::numeric`;
|
|
4
|
+
export const HALF_MIN_SUBNORMAL_SQL = sql `${DOUBLE_UNDERFLOW}::numeric`;
|
|
5
|
+
const MIN_NORMAL = sql `${String(2 ** -1022)}::float8`;
|
|
6
|
+
export function named(value, alias, body) {
|
|
7
|
+
return sql `(SELECT ${body(alias.v)} FROM (SELECT ${value} AS "v" OFFSET 0) AS ${alias.as})`;
|
|
8
|
+
}
|
|
9
|
+
export function named2(a, b, alias, body) {
|
|
10
|
+
return sql `(SELECT ${body(alias.a, alias.b)} FROM (SELECT ${a} AS "a", ${b} AS "b" OFFSET 0) AS ${alias.as})`;
|
|
11
|
+
}
|
|
12
|
+
const SHORTEST = { as: sql `"vk_sn"`, v: sql `"vk_sn"."v"` };
|
|
13
|
+
const TEXT_OF = { as: sql `"vk_nt"`, v: sql `"vk_nt"."v"` };
|
|
14
|
+
const SPELLING = { as: sql `"vk_ns"`, v: sql `"vk_ns"."v"` };
|
|
15
|
+
const OPERANDS = { as: sql `"vk_ab"`, a: sql `"vk_ab"."a"`, b: sql `"vk_ab"."b"` };
|
|
16
|
+
const DOUBLE_OF = { as: sql `"vk_db"`, v: sql `"vk_db"."v"` };
|
|
17
|
+
const ROUNDED_X = { as: sql `"vk_rx"`, v: sql `"vk_rx"."v"` };
|
|
18
|
+
const ROUNDED_P = { as: sql `"vk_rp"`, v: sql `"vk_rp"."v"` };
|
|
19
|
+
const ROUNDED_D = { as: sql `"vk_rd"`, v: sql `"vk_rd"."v"` };
|
|
20
|
+
const ROUNDED_R = { as: sql `"vk_rr"`, v: sql `"vk_rr"."v"` };
|
|
21
|
+
const ROUNDED_M = { as: sql `"vk_rm"`, v: sql `"vk_rm"."v"` };
|
|
22
|
+
const SIZE = { as: sql `"vk_sz"`, v: sql `"vk_sz"."v"` };
|
|
23
|
+
function shortestText(v) {
|
|
24
|
+
const format = sql `CASE WHEN "p"."d" = 1 THEN '9EEEE' ELSE '9.' || repeat('9', "p"."d" - 1) || 'EEEE' END`;
|
|
25
|
+
const unit = sql `('1e' || (split_part("s"."t", 'e', 2)::int - "p"."d" + 1)::text)::numeric`;
|
|
26
|
+
return sql `(SELECT "c"."t" FROM generate_series(CASE WHEN abs(${v}) < ${MIN_NORMAL} THEN 1 ELSE 15 END, 17) AS "p"("d") CROSS JOIN LATERAL (SELECT btrim(to_char(abs(${v}), ${format})) AS "t") AS "s" CROSS JOIN LATERAL (VALUES (("s"."t")::numeric, 0), (("s"."t")::numeric + ${unit}, 1)) AS "k"("n", "up") CROSS JOIN LATERAL (SELECT CASE WHEN "k"."up" = 0 THEN "s"."t" ELSE btrim(to_char("k"."n", ${format})) END AS "t") AS "c" WHERE CASE WHEN "k"."n" < ${DOUBLE_LIMIT_SQL} THEN ("k"."n")::float8 = abs(${v}) ELSE FALSE END ORDER BY "p"."d", "k"."up" LIMIT 1)`;
|
|
27
|
+
}
|
|
28
|
+
export function shortestNumeric(x) {
|
|
29
|
+
return named(x, SHORTEST, (v) => {
|
|
30
|
+
const cast = sql `abs(${v})::numeric`;
|
|
31
|
+
const castReadsBack = sql `abs(${v}) >= ${MIN_NORMAL} AND CASE WHEN ${cast} < ${DOUBLE_LIMIT_SQL} THEN (${cast})::float8 = abs(${v}) ELSE FALSE END`;
|
|
32
|
+
const magnitude = sql `(CASE WHEN ${castReadsBack} THEN ${cast} ELSE (${shortestText(v)})::numeric END)`;
|
|
33
|
+
return sql `(CASE WHEN ${v} = 0 THEN 0::numeric ELSE (CASE WHEN ${v} < 0 THEN -1 ELSE 1 END) * ${magnitude} END)`;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export function numberText(x) {
|
|
37
|
+
return named(x, TEXT_OF, (v) => named(shortestText(v), SPELLING, (t) => {
|
|
38
|
+
const exponent = sql `split_part(${t}, 'e', 2)::int`;
|
|
39
|
+
const mantissa = sql `rtrim(rtrim(split_part(${t}, 'e', 1), '0'), '.')`;
|
|
40
|
+
const sign = sql `CASE WHEN ${v} < 0 THEN '-' ELSE '' END`;
|
|
41
|
+
return sql `(CASE WHEN ${v} = 0 THEN '0' WHEN ${exponent} >= 21 OR ${exponent} <= -7 THEN ${sign} || ${mantissa} || 'e' || CASE WHEN ${exponent} > 0 THEN '+' ELSE '-' END || abs(${exponent})::text ELSE ${sign} || trim_scale((${t})::numeric)::text END)`;
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
const f8 = (n) => sql `${String(n)}::float8`;
|
|
45
|
+
const TWO_1023 = f8(2 ** 1023);
|
|
46
|
+
const TWO_512 = f8(2 ** 512);
|
|
47
|
+
const TWO_MINUS_512 = f8(2 ** -512);
|
|
48
|
+
const TIE = f8(2 ** -563);
|
|
49
|
+
const MAX_MANTISSA_BITS = "4503599627370495";
|
|
50
|
+
const HIDDEN_BIT = "4503599627370496";
|
|
51
|
+
const isNegative = (x) => sql `(${x} < 0 OR float8send(${x}) = float8send('-0'::float8))`;
|
|
52
|
+
const zeroOf = (x, y) => sql `(CASE WHEN ${isNegative(x)} <> ${isNegative(y)} THEN '-0'::float8 ELSE 0::float8 END)`;
|
|
53
|
+
const half = (x) => sql `(CASE WHEN abs(${x}) >= 1 THEN ${x} * 0.5::float8 ELSE 0::float8 END)`;
|
|
54
|
+
const bits = (x) => sql `(('x' || encode(float8send(abs(${x})), 'hex'))::bit(64)::bigint)`;
|
|
55
|
+
const mantissa = (x) => sql `((${bits(x)} & ${MAX_MANTISSA_BITS}::bigint) + CASE WHEN (${bits(x)} >> 52) & 2047 = 0 THEN 0 ELSE ${HIDDEN_BIT}::bigint END)::numeric`;
|
|
56
|
+
const exponent = (x) => sql `(CASE WHEN (${bits(x)} >> 52) & 2047 = 0 THEN -1074 ELSE ((${bits(x)} >> 52) & 2047)::int - 1075 END)`;
|
|
57
|
+
const scaledAtMost = (m, k, n) => sql `(CASE WHEN ${k} >= 0 THEN ${m} * (2::numeric ^ ${k}) <= ${n} ELSE ${m} <= ${n} * (2::numeric ^ (-(${k}))) END)`;
|
|
58
|
+
export function safeAdd(a, b) {
|
|
59
|
+
return named2(a, b, OPERANDS, (x, y) => sql `(CASE WHEN abs(${half(x)} + ${half(y)}) >= ${TWO_1023} THEN NULL ELSE ${x} + ${y} END)`);
|
|
60
|
+
}
|
|
61
|
+
export function safeSubtract(a, b) {
|
|
62
|
+
return named2(a, b, OPERANDS, (x, y) => sql `(CASE WHEN abs(${half(x)} - ${half(y)}) >= ${TWO_1023} THEN NULL ELSE ${x} - ${y} END)`);
|
|
63
|
+
}
|
|
64
|
+
export function safeMultiply(a, b) {
|
|
65
|
+
return named2(a, b, OPERANDS, (x, y) => {
|
|
66
|
+
const size = sql `(abs(${x})::numeric * abs(${y})::numeric)`;
|
|
67
|
+
const big = sql `greatest(abs(${x}), abs(${y}))`;
|
|
68
|
+
const small = sql `least(abs(${x}), abs(${y}))`;
|
|
69
|
+
const down = sql `((${big} * ${TWO_MINUS_512}) * ${small})`;
|
|
70
|
+
const up = sql `((${small} * ${TWO_512}) * ${big})`;
|
|
71
|
+
const tieIsZero = scaledAtMost(sql `(${mantissa(x)} * ${mantissa(y)})`, sql `(${exponent(x)} + ${exponent(y)} + 1075)`, sql `1::numeric`);
|
|
72
|
+
const placed = named(size, SIZE, (n) => sql `(CASE WHEN ${n} > '1e309'::numeric THEN NULL WHEN ${n} < '1e-325'::numeric THEN ${zeroOf(x, y)} WHEN ${n} >= '1e-321'::numeric AND ${n} <= '1e307'::numeric THEN ${x} * ${y} WHEN ${n} > '1e307'::numeric THEN (CASE WHEN ${down} >= ${TWO_512} THEN NULL ELSE ${x} * ${y} END) WHEN ${up} > ${TIE} THEN ${x} * ${y} WHEN ${up} < ${TIE} OR ${tieIsZero} THEN ${zeroOf(x, y)} ELSE ${x} * ${y} END)`);
|
|
73
|
+
return sql `(CASE WHEN ${x} IS NULL OR ${y} IS NULL THEN NULL WHEN ${x} = 0 OR ${y} = 0 THEN ${x} * ${y} ELSE ${placed} END)`;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
export function safeDivide(a, b) {
|
|
77
|
+
return named2(a, b, OPERANDS, (x, y) => {
|
|
78
|
+
const size = sql `(abs(${x})::numeric / abs(${y})::numeric)`;
|
|
79
|
+
const down = sql `((abs(${x}) * ${TWO_MINUS_512}) / abs(${y}))`;
|
|
80
|
+
const up = sql `((abs(${x}) * ${TWO_512}) / abs(${y}))`;
|
|
81
|
+
const tieIsZero = scaledAtMost(mantissa(x), sql `(${exponent(x)} - ${exponent(y)} + 1075)`, mantissa(y));
|
|
82
|
+
const placed = named(size, SIZE, (n) => sql `(CASE WHEN ${n} > '1e309'::numeric THEN NULL WHEN ${n} < '1e-325'::numeric THEN ${zeroOf(x, y)} WHEN ${n} >= '1e-321'::numeric AND ${n} <= '1e307'::numeric THEN ${x} / ${y} WHEN ${n} > '1e307'::numeric THEN (CASE WHEN ${down} >= ${TWO_512} THEN NULL ELSE ${x} / ${y} END) WHEN ${up} > ${TIE} THEN ${x} / ${y} WHEN ${up} < ${TIE} OR ${tieIsZero} THEN ${zeroOf(x, y)} ELSE ${x} / ${y} END)`);
|
|
83
|
+
return sql `(CASE WHEN ${x} IS NULL OR ${y} IS NULL OR ${y} = 0 THEN NULL WHEN ${x} = 0 THEN ${x} / ${y} ELSE ${placed} END)`;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const roundHalfUp = (d) => sql `(floor(${d}) + CASE WHEN ${d} - floor(${d}) >= 0.5::float8 THEN 1::float8 ELSE 0::float8 END)`;
|
|
87
|
+
const doubleOf = (n) => named(n, DOUBLE_OF, (t) => sql `(CASE WHEN ${t} >= ${DOUBLE_LIMIT_SQL} THEN NULL WHEN ${t} <= ${HALF_MIN_SUBNORMAL_SQL} THEN 0::float8 ELSE (${t})::float8 END)`);
|
|
88
|
+
export function jsRound(x, places) {
|
|
89
|
+
return named(x, ROUNDED_X, (v) => {
|
|
90
|
+
const signed = (magnitude) => named(magnitude, ROUNDED_M, (m) => sql `(CASE WHEN ${isNegative(v)} THEN -(${m}) ELSE ${m} END)`);
|
|
91
|
+
if (places === null)
|
|
92
|
+
return signed(roundHalfUp(sql `abs(${v})`));
|
|
93
|
+
return named(sql `greatest(-15::float8, least(15::float8, trunc(coalesce(${places}, 0::float8))))::int`, ROUNDED_P, (p) => {
|
|
94
|
+
const shifted = doubleOf(sql `(${shortestNumeric(sql `abs(${v})`)} * ('1e' || (${p})::text)::numeric)`);
|
|
95
|
+
const rounded = named(shifted, ROUNDED_D, (d) => roundHalfUp(d));
|
|
96
|
+
const back = named(rounded, ROUNDED_R, (r) => doubleOf(sql `(${shortestNumeric(r)} * ('1e' || (-(${p}))::text)::numeric)`));
|
|
97
|
+
return signed(back);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
const NUMBER_OF = { as: sql `"vk_no"`, v: sql `"vk_no"."v"` };
|
|
102
|
+
export function numberOf(value, stored) {
|
|
103
|
+
if (stored === "integer" || stored === "bigint")
|
|
104
|
+
return sql `(${value})::float8`;
|
|
105
|
+
if (stored === "float8")
|
|
106
|
+
return named(value, NUMBER_OF, (v) => sql `(CASE WHEN ${v} IN ('NaN'::float8, 'Infinity'::float8, '-Infinity'::float8) THEN NULL ELSE ${v} END)`);
|
|
107
|
+
return named(sql `(${value})::numeric`, NUMBER_OF, (v) => sql `(CASE WHEN ${v} IN ('NaN'::numeric, 'Infinity'::numeric, '-Infinity'::numeric) THEN NULL WHEN abs(${v}) >= ${DOUBLE_LIMIT_SQL} THEN NULL WHEN abs(${v}) <= ${HALF_MIN_SUBNORMAL_SQL} THEN 0::float8 ELSE round(${v}, (39 - floor(log(abs(${v}))))::int)::float8 END)`);
|
|
108
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FormulaNode, FormulaType } from "viewkitjs/fields";
|
|
2
|
+
import { type Sql } from "../sql.js";
|
|
3
|
+
/** A value in a rule: its SQL, its type as checkFormula types it, and whether it is held as its JavaScript text. */
|
|
4
|
+
export type Typed = {
|
|
5
|
+
readonly sql: Sql;
|
|
6
|
+
readonly type: FormulaType;
|
|
7
|
+
readonly spelled?: true;
|
|
8
|
+
};
|
|
9
|
+
/** The request's clock: the zone as the request names it and as Intl resolves it (the first Postgres knows is read), today
|
|
10
|
+
* in that zone, and now. */
|
|
11
|
+
export type FormulaClock = {
|
|
12
|
+
readonly given: string;
|
|
13
|
+
readonly zone: string;
|
|
14
|
+
readonly today: string;
|
|
15
|
+
readonly now: string;
|
|
16
|
+
};
|
|
17
|
+
/** An instant's text as toISOString writes it: from the UTC wall clock, which no session setting reaches. */
|
|
18
|
+
export declare const instantText: (x: Sql) => Sql;
|
|
19
|
+
/** A day's text. */
|
|
20
|
+
export declare const dayText: (d: Sql) => Sql;
|
|
21
|
+
/** A value as JavaScript's String() writes it (the rule's reading of a value into text). */
|
|
22
|
+
export declare function textOf(v: Typed): Sql;
|
|
23
|
+
/** A spelled day or instant as the instant Date.parse reads: a day is midnight UTC. */
|
|
24
|
+
export declare const instantOfSpelled: (s: Sql) => Sql;
|
|
25
|
+
/**
|
|
26
|
+
* `rule` as SQL. `read` gives each field the rule names, typed; `clock` the request's zone, today and now, asked only by
|
|
27
|
+
* today, now and a day read off an instant, so a rule without them needs no context.
|
|
28
|
+
*/
|
|
29
|
+
export declare function formulaSql(rule: FormulaNode, read: (key: string) => Typed, clock: () => FormulaClock): Typed;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { join, sql } from "../sql.js";
|
|
2
|
+
import { jsRound, named, named2, numberText, safeAdd, safeDivide, safeMultiply, safeSubtract } from "./float.js";
|
|
3
|
+
const JS_WHITESPACE = String.fromCodePoint(0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x20, 0xa0, 0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200a, 0x2028, 0x2029, 0x202f, 0x205f, 0x3000, 0xfeff);
|
|
4
|
+
const DAY_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
|
|
5
|
+
const SPELLED_INSTANT = { as: sql `"vk_si"`, v: sql `"vk_si"."v"` };
|
|
6
|
+
const SPELLED_DAY = { as: sql `"vk_sd"`, v: sql `"vk_sd"."v"` };
|
|
7
|
+
const ZONED_DAY = { as: sql `"vk_zd"`, v: sql `"vk_zd"."v"` };
|
|
8
|
+
const ENDS_WITH = { as: sql `"vk_ew"`, a: sql `"vk_ew"."a"`, b: sql `"vk_ew"."b"` };
|
|
9
|
+
const double = (n) => sql `${Object.is(n, -0) ? "-0" : String(n)}::float8`;
|
|
10
|
+
const asNumber = (v) => (v.type === "number" ? v.sql : sql `(${v.sql})::float8`);
|
|
11
|
+
const asBoolean = (v) => (v.type === "boolean" ? v.sql : sql `(${v.sql})::boolean`);
|
|
12
|
+
const inC = (x) => sql `((${x}) COLLATE "C")`;
|
|
13
|
+
export const instantText = (x) => sql `to_char((${x}) AT TIME ZONE 'UTC', 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"')`;
|
|
14
|
+
export const dayText = (d) => sql `to_char((${d})::timestamp, 'YYYY-MM-DD')`;
|
|
15
|
+
export function textOf(v) {
|
|
16
|
+
if (v.spelled)
|
|
17
|
+
return v.sql;
|
|
18
|
+
switch (v.type) {
|
|
19
|
+
case "text":
|
|
20
|
+
return v.sql;
|
|
21
|
+
case "number":
|
|
22
|
+
return numberText(v.sql);
|
|
23
|
+
case "boolean":
|
|
24
|
+
return sql `(CASE ${v.sql} WHEN TRUE THEN 'true' WHEN FALSE THEN 'false' END)`;
|
|
25
|
+
case "date":
|
|
26
|
+
return dayText(v.sql);
|
|
27
|
+
case "datetime":
|
|
28
|
+
return instantText(v.sql);
|
|
29
|
+
case "any":
|
|
30
|
+
return sql `(${v.sql})::text`;
|
|
31
|
+
default:
|
|
32
|
+
throw new TypeError(`formulaSql: a ${v.type} has no text`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export const instantOfSpelled = (s) => named(s, SPELLED_INSTANT, (t) => sql `(CASE WHEN ${t} ~ ${DAY_PATTERN}::text THEN (${t} || 'T00:00:00Z')::timestamptz ELSE (${t})::timestamptz END)`);
|
|
36
|
+
function unified(values) {
|
|
37
|
+
const known = values.map((v) => v.type).filter((t) => t !== "any");
|
|
38
|
+
return known.includes("datetime") ? "datetime" : (known[0] ?? "any");
|
|
39
|
+
}
|
|
40
|
+
const mixesDays = (values) => values.some((v) => v.spelled === true) ||
|
|
41
|
+
(values.some((v) => v.type === "date") && values.some((v) => v.type === "datetime"));
|
|
42
|
+
function shared(values) {
|
|
43
|
+
const type = unified(values);
|
|
44
|
+
if (mixesDays(values))
|
|
45
|
+
return { sqls: values.map(textOf), type, spelled: true };
|
|
46
|
+
const cast = (v) => {
|
|
47
|
+
if (v.type !== "any")
|
|
48
|
+
return v.sql;
|
|
49
|
+
if (type === "number")
|
|
50
|
+
return sql `(${v.sql})::float8`;
|
|
51
|
+
if (type === "text")
|
|
52
|
+
return sql `(${v.sql})::text`;
|
|
53
|
+
if (type === "boolean")
|
|
54
|
+
return sql `(${v.sql})::boolean`;
|
|
55
|
+
if (type === "date")
|
|
56
|
+
return sql `(${v.sql})::date`;
|
|
57
|
+
if (type === "datetime")
|
|
58
|
+
return sql `(${v.sql})::timestamptz`;
|
|
59
|
+
return v.sql;
|
|
60
|
+
};
|
|
61
|
+
return { sqls: values.map(cast), type, spelled: false };
|
|
62
|
+
}
|
|
63
|
+
const typed = (sqlOf, type, spelled = false) => (spelled ? { sql: sqlOf, type, spelled: true } : { sql: sqlOf, type });
|
|
64
|
+
export function formulaSql(rule, read, clock) {
|
|
65
|
+
const dayOf = (v) => {
|
|
66
|
+
if (v.type === "any")
|
|
67
|
+
return sql `(${v.sql})::date`;
|
|
68
|
+
if (v.type === "date" && !v.spelled)
|
|
69
|
+
return v.sql;
|
|
70
|
+
const zoned = (x) => {
|
|
71
|
+
const { given, zone } = clock();
|
|
72
|
+
const known = sql `(SELECT "vk_tz"."name" FROM pg_timezone_names AS "vk_tz" WHERE "vk_tz"."name" IN (${given}::text, ${zone}::text) ORDER BY "vk_tz"."name" = ${given}::text DESC LIMIT 1)`;
|
|
73
|
+
return named(sql `((${x}) AT TIME ZONE ${known})::date`, ZONED_DAY, (d) => sql `(CASE WHEN ${d} BETWEEN '0001-01-01'::date AND '9999-12-31'::date THEN ${d} END)`);
|
|
74
|
+
};
|
|
75
|
+
if (!v.spelled)
|
|
76
|
+
return zoned(v.sql);
|
|
77
|
+
return named(v.sql, SPELLED_DAY, (t) => sql `(CASE WHEN ${t} ~ ${DAY_PATTERN}::text THEN (${t})::date ELSE ${zoned(sql `(${t})::timestamptz`)} END)`);
|
|
78
|
+
};
|
|
79
|
+
const instantOf = (v) => (v.spelled ? instantOfSpelled(v.sql) : v.type === "date" ? sql `((${v.sql})::timestamp AT TIME ZONE 'UTC')` : sql `(${v.sql})::timestamptz`);
|
|
80
|
+
const walk = (node) => {
|
|
81
|
+
if ("field" in node)
|
|
82
|
+
return read(node.field);
|
|
83
|
+
if ("value" in node) {
|
|
84
|
+
const v = node.value;
|
|
85
|
+
if (v === null)
|
|
86
|
+
return typed(sql `NULL`, "any");
|
|
87
|
+
if (typeof v === "number")
|
|
88
|
+
return typed(double(v), "number");
|
|
89
|
+
if (typeof v === "boolean")
|
|
90
|
+
return typed(sql `${v}::boolean`, "boolean");
|
|
91
|
+
return typed(sql `${v}::text`, "text");
|
|
92
|
+
}
|
|
93
|
+
const args = node.args.map(walk);
|
|
94
|
+
const [a, b] = args;
|
|
95
|
+
const number = (sqlOf) => typed(sqlOf, "number");
|
|
96
|
+
const boolean = (sqlOf) => typed(sqlOf, "boolean");
|
|
97
|
+
const text = (sqlOf) => typed(sqlOf, "text");
|
|
98
|
+
const compare = (operator) => {
|
|
99
|
+
if ((a.type === "number" || a.type === "any") && (b.type === "number" || b.type === "any") && (a.type === "number" || b.type === "number"))
|
|
100
|
+
return boolean(sql `(${asNumber(a)} ${operator} ${asNumber(b)})`);
|
|
101
|
+
return boolean(sql `(${inC(textOf(a))} ${operator} ${inC(textOf(b))})`);
|
|
102
|
+
};
|
|
103
|
+
switch (node.fn) {
|
|
104
|
+
case "add":
|
|
105
|
+
return number(safeAdd(asNumber(a), asNumber(b)));
|
|
106
|
+
case "subtract":
|
|
107
|
+
return number(safeSubtract(asNumber(a), asNumber(b)));
|
|
108
|
+
case "multiply":
|
|
109
|
+
return number(safeMultiply(asNumber(a), asNumber(b)));
|
|
110
|
+
case "divide":
|
|
111
|
+
return number(safeDivide(asNumber(a), asNumber(b)));
|
|
112
|
+
case "round":
|
|
113
|
+
return number(jsRound(asNumber(a), b === undefined ? null : asNumber(b)));
|
|
114
|
+
case "abs":
|
|
115
|
+
return number(sql `abs(${asNumber(a)})`);
|
|
116
|
+
case "min":
|
|
117
|
+
case "max": {
|
|
118
|
+
const list = sql `unnest(ARRAY[${join(args.map(asNumber), sql `, `)}]::float8[]) AS "vk_mm"("x")`;
|
|
119
|
+
const negativeZero = sql `float8send("vk_mm"."x") = float8send('-0'::float8)`;
|
|
120
|
+
return number(node.fn === "min"
|
|
121
|
+
? sql `(SELECT CASE WHEN min("vk_mm"."x") = 0 THEN (CASE WHEN bool_or(${negativeZero}) THEN '-0'::float8 ELSE 0::float8 END) ELSE min("vk_mm"."x") END FROM ${list})`
|
|
122
|
+
: sql `(SELECT CASE WHEN max("vk_mm"."x") = 0 THEN (CASE WHEN bool_or("vk_mm"."x" = 0 AND NOT ${negativeZero}) THEN 0::float8 ELSE '-0'::float8 END) ELSE max("vk_mm"."x") END FROM ${list})`);
|
|
123
|
+
}
|
|
124
|
+
case "eq":
|
|
125
|
+
return compare(sql `=`);
|
|
126
|
+
case "neq":
|
|
127
|
+
return compare(sql `<>`);
|
|
128
|
+
case "gt":
|
|
129
|
+
return compare(sql `>`);
|
|
130
|
+
case "gte":
|
|
131
|
+
return compare(sql `>=`);
|
|
132
|
+
case "lt":
|
|
133
|
+
return compare(sql `<`);
|
|
134
|
+
case "lte":
|
|
135
|
+
return compare(sql `<=`);
|
|
136
|
+
case "and":
|
|
137
|
+
return boolean(sql `(${join(args.map(asBoolean), sql ` AND `)})`);
|
|
138
|
+
case "or":
|
|
139
|
+
return boolean(sql `(${join(args.map(asBoolean), sql ` OR `)})`);
|
|
140
|
+
case "not":
|
|
141
|
+
return boolean(sql `(NOT ${asBoolean(a)})`);
|
|
142
|
+
case "if": {
|
|
143
|
+
const branches = shared([b, args[2]]);
|
|
144
|
+
return typed(sql `(CASE WHEN ${asBoolean(a)} THEN ${branches.sqls[0]} ELSE ${branches.sqls[1]} END)`, branches.type, branches.spelled);
|
|
145
|
+
}
|
|
146
|
+
case "switch": {
|
|
147
|
+
const [subject, ...rest] = args;
|
|
148
|
+
const cases = rest.filter((_, i) => i % 2 === 0 && i + 1 < rest.length);
|
|
149
|
+
const results = rest.filter((_, i) => i % 2 === 1 || i === rest.length - 1);
|
|
150
|
+
const numeric = [subject, ...cases].some((v) => v.type === "number");
|
|
151
|
+
const key = (v) => (numeric ? asNumber(v) : inC(textOf(v)));
|
|
152
|
+
const out = shared(results);
|
|
153
|
+
const hasElse = rest.length % 2 === 1;
|
|
154
|
+
const whens = cases.map((c, i) => sql `WHEN ${key(c)} THEN ${out.sqls[i]}`);
|
|
155
|
+
const otherwise = hasElse ? sql ` ELSE ${out.sqls[out.sqls.length - 1]}` : sql ``;
|
|
156
|
+
return typed(sql `(CASE ${key(subject)} ${join(whens, sql ` `)}${otherwise} END)`, out.type, out.spelled);
|
|
157
|
+
}
|
|
158
|
+
case "coalesce": {
|
|
159
|
+
const out = shared(args);
|
|
160
|
+
const blankless = out.sqls.map((one, i) => (out.spelled || args[i].type === "text" ? sql `NULLIF(${one}, '')` : one));
|
|
161
|
+
return typed(sql `COALESCE(${join(blankless, sql `, `)})`, out.type, out.spelled);
|
|
162
|
+
}
|
|
163
|
+
case "isEmpty":
|
|
164
|
+
return boolean(a.type === "text" || a.spelled ? sql `(NULLIF(${a.sql}, '') IS NULL)` : sql `(${a.sql} IS NULL)`);
|
|
165
|
+
case "concat":
|
|
166
|
+
return text(sql `concat(${join(args.map(textOf), sql `, `)})`);
|
|
167
|
+
case "join": {
|
|
168
|
+
const [separator, ...parts] = args;
|
|
169
|
+
if (parts.length === 0)
|
|
170
|
+
return text(sql `''::text`);
|
|
171
|
+
const s = sql `COALESCE(${textOf(separator)}, '')`;
|
|
172
|
+
const pieces = parts.map((one) => sql `COALESCE(${s} || NULLIF(${textOf(one)}, ''), '')`);
|
|
173
|
+
return text(sql `substr(${join(pieces, sql ` || `)}, char_length(${s}) + 1)`);
|
|
174
|
+
}
|
|
175
|
+
case "trim":
|
|
176
|
+
return text(sql `btrim(${textOf(a)}, ${JS_WHITESPACE}::text)`);
|
|
177
|
+
case "lower":
|
|
178
|
+
return text(sql `(lower((${textOf(a)}) COLLATE "und-x-icu") COLLATE "default")`);
|
|
179
|
+
case "upper":
|
|
180
|
+
return text(sql `(upper((${textOf(a)}) COLLATE "und-x-icu") COLLATE "default")`);
|
|
181
|
+
case "startsWith":
|
|
182
|
+
return boolean(sql `starts_with(${inC(textOf(a))}, ${inC(textOf(b))})`);
|
|
183
|
+
case "endsWith":
|
|
184
|
+
return boolean(named2(textOf(a), textOf(b), ENDS_WITH, (s, p) => sql `starts_with(${inC(sql `reverse(${s})`)}, ${inC(sql `reverse(${p})`)})`));
|
|
185
|
+
case "contains":
|
|
186
|
+
return boolean(sql `(strpos(${inC(textOf(a))}, ${inC(textOf(b))}) > 0)`);
|
|
187
|
+
case "before":
|
|
188
|
+
return text(sql `(split_part(${inC(textOf(a))}, ${inC(textOf(b))}, 1) COLLATE "default")`);
|
|
189
|
+
case "today":
|
|
190
|
+
return typed(sql `${clock().today}::date`, "date");
|
|
191
|
+
case "now":
|
|
192
|
+
return typed(sql `${clock().now}::timestamptz`, "datetime");
|
|
193
|
+
case "daysBetween":
|
|
194
|
+
return number(sql `((${dayOf(b)}) - (${dayOf(a)}))::float8`);
|
|
195
|
+
case "secondsBetween":
|
|
196
|
+
return number(sql `(extract(epoch FROM ${instantOf(b)}) - extract(epoch FROM ${instantOf(a)}))::float8`);
|
|
197
|
+
case "addDays": {
|
|
198
|
+
const since = sql `(((${dayOf(a)}) - date '1970-01-01')::float8 + trunc(${asNumber(b)}))`;
|
|
199
|
+
const held = sql `NULLIF(NULLIF(greatest(least(${since}, 2932897::float8), -719163::float8), 2932897::float8), -719163::float8)`;
|
|
200
|
+
return typed(sql `(date '1970-01-01' + (${held})::int)`, "date");
|
|
201
|
+
}
|
|
202
|
+
case "percentOf":
|
|
203
|
+
return number(jsRound(safeDivide(safeMultiply(double(100), asNumber(a)), asNumber(b)), null));
|
|
204
|
+
default:
|
|
205
|
+
throw new TypeError(`formulaSql: "${String(node.fn)}" is not a formula function`);
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
return walk(rule);
|
|
209
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Place } from "./place.js";
|
|
2
|
+
/** Why a formula is left out. */
|
|
3
|
+
export declare const FORMULA_REASONS: {
|
|
4
|
+
readonly noRule: "a formula with no rule is not built";
|
|
5
|
+
readonly namedSql: (name: string) => string;
|
|
6
|
+
readonly readsLeftOut: (key: string) => string;
|
|
7
|
+
readonly phone: "a formula reading a phone is not built yet";
|
|
8
|
+
readonly withParts: "a formula giving a value with parts is not built yet";
|
|
9
|
+
readonly dayFromInstant: "a formula giving a day from an instant is not built yet";
|
|
10
|
+
readonly readsMixedDay: (key: string) => string;
|
|
11
|
+
readonly noName: (key: string) => string;
|
|
12
|
+
readonly nameLeftOut: (key: string, why: string) => string;
|
|
13
|
+
};
|
|
14
|
+
export declare const placeFormula: Place;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { checkFormula, defineConventions, isPerCodeCurrency, valueTypeOf, } from "viewkitjs/fields";
|
|
2
|
+
import { valueDayKey } from "viewkitjs/fields/query";
|
|
3
|
+
import { openedOf } from "../access.js";
|
|
4
|
+
import { reachedFrom } from "../relations.js";
|
|
5
|
+
import { elementsOn } from "../several.js";
|
|
6
|
+
import { castTo, join, sql } from "../sql.js";
|
|
7
|
+
import { hasParts, joinedOf, labelOf as tableLabelOf, mappingReadsZone, partNamesOf, partSql, readSql, readsZone, valueSql } from "../values.js";
|
|
8
|
+
import { labelOf as kindLabelOf } from "./label.js";
|
|
9
|
+
import { keptOf } from "./money.js";
|
|
10
|
+
import { named, numberOf } from "./float.js";
|
|
11
|
+
import { formulaSql, instantOfSpelled, textOf } from "./formula-forms.js";
|
|
12
|
+
export const FORMULA_REASONS = {
|
|
13
|
+
noRule: "a formula with no rule is not built",
|
|
14
|
+
namedSql: (name) => `names the SQL function ${name}, which the builder doesn't write`,
|
|
15
|
+
readsLeftOut: (key) => `it reads ${key}, which is left out`,
|
|
16
|
+
phone: "a formula reading a phone is not built yet",
|
|
17
|
+
withParts: "a formula giving a value with parts is not built yet",
|
|
18
|
+
dayFromInstant: "a formula giving a day from an instant is not built yet",
|
|
19
|
+
readsMixedDay: (key) => `it reads ${key}, a formula that mixes a day and an instant, which is not read yet`,
|
|
20
|
+
noName: (key) => `it reads ${key}, a relation whose records have no name`,
|
|
21
|
+
nameLeftOut: (key, why) => `it reads ${key}, a relation whose records' name is left out: ${why}`,
|
|
22
|
+
};
|
|
23
|
+
const isRelationOfOne = (field) => field.type === "relation" && field.cardinality !== "many";
|
|
24
|
+
const READ_DAY = { as: sql `"vk_rdy"`, v: sql `"vk_rdy"."v"` };
|
|
25
|
+
const READ_INSTANT = { as: sql `"vk_rin"`, v: sql `"vk_rin"."v"` };
|
|
26
|
+
const OFFSET_ZONE = /^[+-]|^(UTC|GMT)[+-]/i;
|
|
27
|
+
function readsOf(rule) {
|
|
28
|
+
const out = [];
|
|
29
|
+
const walk = (node) => {
|
|
30
|
+
if ("field" in node) {
|
|
31
|
+
if (!out.includes(node.field))
|
|
32
|
+
out.push(node.field);
|
|
33
|
+
}
|
|
34
|
+
else if ("fn" in node)
|
|
35
|
+
node.args.forEach(walk);
|
|
36
|
+
};
|
|
37
|
+
walk(rule);
|
|
38
|
+
return out;
|
|
39
|
+
}
|
|
40
|
+
const SHAPE_CLOCK = { given: "UTC", zone: "UTC", today: "2000-01-01", now: "2000-01-01T00:00:00.000Z" };
|
|
41
|
+
function mixesDays(field, fields) {
|
|
42
|
+
if (field.type !== "formula" || field.rule === undefined || "sql" in field.rule || valueTypeOf(field) !== "datetime")
|
|
43
|
+
return false;
|
|
44
|
+
const read = (key) => ({ sql: sql `NULL`, type: checkFormula({ field: key }, fields, field.key) });
|
|
45
|
+
return formulaSql(field.rule, read, () => SHAPE_CLOCK).spelled === true;
|
|
46
|
+
}
|
|
47
|
+
function storedOf(type) {
|
|
48
|
+
if (type === "number" || type === "percent" || type === "currency")
|
|
49
|
+
return "float8";
|
|
50
|
+
if (type === "boolean")
|
|
51
|
+
return "boolean";
|
|
52
|
+
if (type === "date")
|
|
53
|
+
return "date";
|
|
54
|
+
if (type === "datetime")
|
|
55
|
+
return "timestamptz";
|
|
56
|
+
return "text";
|
|
57
|
+
}
|
|
58
|
+
function clockOf(key, scope) {
|
|
59
|
+
let clock;
|
|
60
|
+
return () => {
|
|
61
|
+
if (clock !== undefined)
|
|
62
|
+
return clock;
|
|
63
|
+
const context = scope.context;
|
|
64
|
+
if (context === undefined)
|
|
65
|
+
throw new TypeError(`${key}: a formula reading today, now or an instant's day needs the request's context`);
|
|
66
|
+
const given = context.timeZone;
|
|
67
|
+
if (OFFSET_ZONE.test(given))
|
|
68
|
+
throw new TypeError(`${key}: an offset is no time zone a formula reads; name one`);
|
|
69
|
+
let zone;
|
|
70
|
+
try {
|
|
71
|
+
zone = new Intl.DateTimeFormat("en", { timeZone: given }).resolvedOptions().timeZone;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
throw new TypeError(`${key}: ${given} is no time zone`);
|
|
75
|
+
}
|
|
76
|
+
const year = context.now.getUTCFullYear();
|
|
77
|
+
if (!(year >= 1 && year <= 9999))
|
|
78
|
+
throw new TypeError(`${key}: a formula reads a moment within the years 1 to 9999`);
|
|
79
|
+
const now = context.now.toISOString();
|
|
80
|
+
const today = valueDayKey(now, "datetime", defineConventions({ timeZone: zone, locale: "en" }));
|
|
81
|
+
if (today === null)
|
|
82
|
+
throw new TypeError(`${key}: ${now} has no day in ${zone}`);
|
|
83
|
+
clock = { given, zone, today, now };
|
|
84
|
+
return clock;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function presentSql(scope, at, def, mapping) {
|
|
88
|
+
if (typeof mapping.value === "object" && mapping.value !== null) {
|
|
89
|
+
const reached = reachedFrom(scope, at, def.key);
|
|
90
|
+
return sql `EXISTS (SELECT 1 FROM ${reached.from} WHERE ${reached.ties})`;
|
|
91
|
+
}
|
|
92
|
+
if (mapping.several !== undefined) {
|
|
93
|
+
const found = elementsOn(scope, at, def.key);
|
|
94
|
+
return sql `EXISTS (SELECT 1 FROM ${found.from} WHERE ${found.ties})`;
|
|
95
|
+
}
|
|
96
|
+
if (hasParts(mapping)) {
|
|
97
|
+
const parts = partNamesOf(mapping).map((part) => {
|
|
98
|
+
const read = partSql(scope, at, def.key, part);
|
|
99
|
+
return sql `(${read} IS NOT NULL AND (${read})::text <> '')`;
|
|
100
|
+
});
|
|
101
|
+
return parts.length === 0 ? sql `FALSE` : sql `(${join(parts, sql ` OR `)})`;
|
|
102
|
+
}
|
|
103
|
+
return sql `(${valueSql(scope, at, def.key)} IS NOT NULL)`;
|
|
104
|
+
}
|
|
105
|
+
function readField(scope, at, def, mapping, type) {
|
|
106
|
+
if (type === "list")
|
|
107
|
+
return { sql: sql `(CASE WHEN ${presentSql(scope, at, def, mapping)} THEN 1::float8 END)`, type };
|
|
108
|
+
if (typeof mapping.value === "object" && mapping.value !== null) {
|
|
109
|
+
const joined = joinedOf(scope, at, mapping.value.relation);
|
|
110
|
+
const label = tableLabelOf(scope, joined.far);
|
|
111
|
+
if (label === undefined)
|
|
112
|
+
throw new TypeError(`${def.key}: its far table names no label`);
|
|
113
|
+
return { sql: joined.read(sql `(CASE WHEN ${joined.far.row.key} IS NOT NULL THEN COALESCE(${label}, '') END)`), type };
|
|
114
|
+
}
|
|
115
|
+
if (mapping.several !== undefined)
|
|
116
|
+
return { sql: sql `(CASE WHEN ${presentSql(scope, at, def, mapping)} THEN '1'::text END)`, type };
|
|
117
|
+
const keptRead = typeof mapping.value === "object" ? undefined : keptOf(mapping.value);
|
|
118
|
+
const value = keptRead === undefined ? valueSql(scope, at, def.key) : readSql(at, keptRead, def.key);
|
|
119
|
+
if (type === "number") {
|
|
120
|
+
return { sql: numberOf(value, mapping.stored), type };
|
|
121
|
+
}
|
|
122
|
+
if (type === "date")
|
|
123
|
+
return { sql: named(value, READ_DAY, (d) => sql `(CASE WHEN ${d} BETWEEN '0001-01-01'::date AND '9999-12-31'::date THEN ${d} END)`), type };
|
|
124
|
+
if (type === "datetime") {
|
|
125
|
+
const instant = mapping.stored === "timestamp" ? sql `((${value}) AT TIME ZONE 'UTC')` : sql `(${value})::timestamptz`;
|
|
126
|
+
return {
|
|
127
|
+
sql: named(instant, READ_INSTANT, (t) => sql `(CASE WHEN ${t} >= '0001-01-01T00:00:00Z'::timestamptz AND ${t} < '10000-01-01T00:00:00Z'::timestamptz THEN ${t} END)`),
|
|
128
|
+
type,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (type === "boolean")
|
|
132
|
+
return { sql: value, type };
|
|
133
|
+
return { sql: sql `(${value})::text`, type };
|
|
134
|
+
}
|
|
135
|
+
function outputOf(result, stored) {
|
|
136
|
+
if (stored === "text")
|
|
137
|
+
return textOf(result);
|
|
138
|
+
if (stored === "timestamptz") {
|
|
139
|
+
if (result.spelled)
|
|
140
|
+
return instantOfSpelled(result.sql);
|
|
141
|
+
if (result.type === "date")
|
|
142
|
+
return sql `((${result.sql})::timestamp AT TIME ZONE 'UTC')`;
|
|
143
|
+
return sql `(${result.sql})::timestamptz`;
|
|
144
|
+
}
|
|
145
|
+
return sql `(${result.sql})${castTo(stored)}`;
|
|
146
|
+
}
|
|
147
|
+
export const placeFormula = (at) => {
|
|
148
|
+
const def = at.def;
|
|
149
|
+
const rule = def.rule;
|
|
150
|
+
if (rule === undefined)
|
|
151
|
+
return { leftOut: FORMULA_REASONS.noRule };
|
|
152
|
+
if ("sql" in rule)
|
|
153
|
+
return { leftOut: FORMULA_REASONS.namedSql(rule.sql) };
|
|
154
|
+
if (isPerCodeCurrency(def))
|
|
155
|
+
return { leftOut: FORMULA_REASONS.withParts };
|
|
156
|
+
const entity = at.kind.entity;
|
|
157
|
+
const ruleType = checkFormula(rule, entity.fields, def.key);
|
|
158
|
+
const resultType = valueTypeOf(def);
|
|
159
|
+
if (resultType === "date" && ruleType === "datetime")
|
|
160
|
+
return { leftOut: FORMULA_REASONS.dayFromInstant };
|
|
161
|
+
const reads = [];
|
|
162
|
+
const types = new Map();
|
|
163
|
+
let zoned = false;
|
|
164
|
+
for (const key of readsOf(rule)) {
|
|
165
|
+
const field = entity.fields[key];
|
|
166
|
+
if (valueTypeOf(field) === "phone")
|
|
167
|
+
return { leftOut: FORMULA_REASONS.phone };
|
|
168
|
+
const placed = at.placed(at.table, key);
|
|
169
|
+
if ("leftOut" in placed)
|
|
170
|
+
return { leftOut: FORMULA_REASONS.readsLeftOut(key) };
|
|
171
|
+
if (mixesDays(field, entity.fields))
|
|
172
|
+
return { leftOut: FORMULA_REASONS.readsMixedDay(key) };
|
|
173
|
+
if (isRelationOfOne(field)) {
|
|
174
|
+
const far = placed.relation?.map.to;
|
|
175
|
+
const relation = field.relation;
|
|
176
|
+
const farEntity = "kind" in relation ? at.input.kinds[relation.kind]?.entity : undefined;
|
|
177
|
+
const identity = farEntity?.fields[farEntity.identity];
|
|
178
|
+
if (far === undefined || identity === undefined)
|
|
179
|
+
return { leftOut: FORMULA_REASONS.noName(key) };
|
|
180
|
+
const named = at.placed(far, identity.key);
|
|
181
|
+
if ("leftOut" in named)
|
|
182
|
+
return { leftOut: FORMULA_REASONS.nameLeftOut(key, named.leftOut) };
|
|
183
|
+
if (kindLabelOf({ placed: at.placed }, far, identity).label === undefined)
|
|
184
|
+
return { leftOut: FORMULA_REASONS.noName(key) };
|
|
185
|
+
zoned ||= mappingReadsZone(named.mapping);
|
|
186
|
+
}
|
|
187
|
+
reads.push(...placed.reads);
|
|
188
|
+
types.set(key, checkFormula({ field: key }, entity.fields, def.key));
|
|
189
|
+
zoned ||= mappingReadsZone(placed.mapping);
|
|
190
|
+
}
|
|
191
|
+
if (!zoned) {
|
|
192
|
+
const shape = (key) => ({ sql: sql `NULL`, type: types.get(key) });
|
|
193
|
+
formulaSql(rule, shape, () => {
|
|
194
|
+
zoned = true;
|
|
195
|
+
return SHAPE_CLOCK;
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
const stored = storedOf(resultType);
|
|
199
|
+
const value = (row) => {
|
|
200
|
+
const opened = openedOf(row);
|
|
201
|
+
if (opened === undefined)
|
|
202
|
+
throw new TypeError(`${def.key}: a formula is read only on a row the translator opened`);
|
|
203
|
+
const { scope, at: on } = opened;
|
|
204
|
+
const mappings = scope.map.tableFields[on.table].fields;
|
|
205
|
+
const read = (key) => readField(scope, on, mappings[key].def, mappings[key].mapping, types.get(key));
|
|
206
|
+
return outputOf(formulaSql(rule, read, clockOf(def.key, scope)), stored);
|
|
207
|
+
};
|
|
208
|
+
return { mapping: { value: zoned ? readsZone(value) : value, stored }, reads };
|
|
209
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { buildFieldMap, type BuiltFieldMap, type LeftOut, type TableReads } from "./build.js";
|
|
2
|
+
export type { ConvertMoney, MoneyAsk, MoneyDay, MoneyInto } from "./money.js";
|
|
3
|
+
export { StorageError, type AppStorage, type BuildFieldMapInput, type FieldStorage, type KindStorage, } from "./storage.js";
|