reactive-md 0.9.3 → 0.10.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-ch.md +34 -0
- package/CHANGELOG.md +34 -0
- package/README-ch.md +7 -7
- package/README-en.md +7 -7
- package/README.md +7 -7
- package/THIRD_PARTY_NOTICES.md +0 -57
- package/cli/help.mjs +6 -4
- package/cli/init.mjs +1 -1
- package/cli/migrate.mjs +1 -1
- package/dist-library/{LocalDocumentView-D6zQkTkt.js → LocalDocumentView-CP2QG86k.js} +46 -44
- package/dist-library/{LocalDocumentViewCore-CmJhemcA.js → LocalDocumentViewCore-Cd6yMEkg.js} +284 -265
- package/dist-library/{LocalReactiveDocumentCore-lAKOGAZ7.js → LocalReactiveDocumentCore-VuYpZqdn.js} +7 -7
- package/dist-library/LocalStaticDocumentView-DfX6bemE.js +147 -0
- package/dist-library/authoring-Bwu_zCWs.js +768 -0
- package/dist-library/choice-values-BItGjPD2.js +58 -0
- package/dist-library/compile-B35rfzKr.js +1742 -0
- package/dist-library/{compile-cache-key-6GgpETz_.js → compile-cache-key-D21X2Obx.js} +5 -5
- package/dist-library/{compiler-DLkKUK4t.js → compiler-DBwLawMZ.js} +4 -4
- package/dist-library/{compiler-core-Niqhp9wV.js → compiler-core-kkDiQ1RK.js} +3146 -2055
- package/dist-library/{component-kernel-IG4wOO0i.js → component-kernel-CsJSabHX.js} +42 -26
- package/dist-library/{component-state-Ht-hOK0W.js → component-state-Da0G8Ajc.js} +1 -1
- package/dist-library/{component-utils-eSj5IdG4.js → component-utils-ZM3jUJNy.js} +80 -79
- package/dist-library/conditional-branches-CIhJXasR.js +17 -0
- package/dist-library/{config-validation-Cpol91_M.js → config-validation-DbmsWAEV.js} +165 -152
- package/dist-library/{controls-B-CLSK8Q.js → controls-DRy5rzzN.js} +271 -228
- package/dist-library/{coordinate-PyLPMIQK.js → coordinate-c54pHfgf.js} +29 -29
- package/dist-library/data-table-CSAkm1eU.js +290 -0
- package/dist-library/data-table-model-DruztQFt.js +391 -0
- package/dist-library/{data-visuals-_Z7QqYTk.js → data-visuals-rZQUeQM0.js} +14 -14
- package/dist-library/{default-components-jugH7Ubr.js → default-components-B-39etG9.js} +233 -71
- package/dist-library/{default-config-DIrRpuQz.js → default-config-CCa8rm2k.js} +236 -216
- package/dist-library/default-options-By16CVw1.js +131 -0
- package/dist-library/{default-registry-BlloaZi7.js → default-registry-DXJy66xj.js} +3 -3
- package/dist-library/{default-schema-Ch-Vznpm.js → default-schema-CeYiEW1K.js} +3 -3
- package/dist-library/display-Bb6hAG5T.js +2065 -0
- package/dist-library/{document-theme-DBAfnk7y.js → document-theme-CJvN-nC1.js} +190 -3
- package/dist-library/{export-heVBqgxA.js → export-BSV4E0jv.js} +105 -106
- package/dist-library/font-aliases-CKYjwn4o.js +4 -0
- package/dist-library/{gallery-Q6VPS2ep.js → gallery-DM2yTVZJ.js} +1 -1
- package/dist-library/{html-CCnvzan1.js → html-CY9mC3Sr.js} +5 -5
- package/dist-library/{incremental-Bzvh8_lB.js → incremental-B-wW4H3F.js} +251 -245
- package/dist-library/{display-y4v9v0Qd.js → katex-4ukd4ZxT.js} +1555 -3618
- package/dist-library/layout-CPQggKxk.js +592 -0
- package/dist-library/{layout-BnfDeUNy.js → layout-CaDWsDof.js} +1 -1
- package/dist-library/{math-view-B0jthpRw.js → math-view-CyGTS6kv.js} +1 -1
- package/dist-library/{mount-preset-C_i37FvY.js → mount-preset-DtrCX4G8.js} +4 -4
- package/dist-library/{numeric-sliders-CkWS0-ja.js → numeric-sliders-BmJ1LCLx.js} +190 -190
- package/dist-library/{observability-CYLuvFfL.js → observability-BVQ16ByQ.js} +5 -4
- package/dist-library/{package-core-9UK5ZdqB.js → package-core-Cu_r_qs7.js} +7 -6
- package/dist-library/{parser-9yNJxGip.js → parser-BHl9Lxbw.js} +2 -2
- package/dist-library/{parser-standard-BPIy4HOu.js → parser-standard-DDAKv_DZ.js} +247 -247
- package/dist-library/{plugin-packs-CZb46nuv.js → plugin-packs-CkI0floL.js} +3 -3
- package/dist-library/{preset-core-BW3NWZJ9.js → preset-core-BKPbH_Nv.js} +377 -306
- package/dist-library/{props-pJRrfDc6.js → props-0iDqxlTk.js} +56 -61
- package/dist-library/{react-BSo0o998.js → react-74jdGBmu.js} +2 -2
- package/dist-library/reactive-md-authoring.js +277 -269
- package/dist-library/reactive-md-build.js +327 -33
- package/dist-library/reactive-md-compiler-session.js +3 -3
- package/dist-library/reactive-md-compiler-standard.js +10 -10
- package/dist-library/reactive-md-compiler.js +3 -3
- package/dist-library/reactive-md-contracts.js +4 -4
- package/dist-library/reactive-md-default-packs.js +4 -3
- package/dist-library/reactive-md-default-preset.js +3 -3
- package/dist-library/reactive-md-export.js +6 -6
- package/dist-library/reactive-md-minimal-preset.js +3 -2
- package/dist-library/reactive-md-minimal-react-preset.js +18 -17
- package/dist-library/reactive-md-minimal.css +1 -1
- package/dist-library/reactive-md-observability.js +2 -2
- package/dist-library/reactive-md-pack-style-manifest.js +8 -0
- package/dist-library/reactive-md-plugin-chart.js +13 -9
- package/dist-library/reactive-md-plugin-data.js +4 -4
- package/dist-library/reactive-md-plugin-diagram.js +3 -3
- package/dist-library/reactive-md-plugin-forms.js +5 -5
- package/dist-library/reactive-md-plugin-gallery.js +3 -3
- package/dist-library/reactive-md-plugin-navigation.js +10 -10
- package/dist-library/reactive-md-plugin-network.js +5 -5
- package/dist-library/reactive-md-plugin-plot.js +4 -4
- package/dist-library/reactive-md-react-component-accordion.js +3 -3
- package/dist-library/reactive-md-react-component-alert.js +3 -3
- package/dist-library/reactive-md-react-component-anchor.js +3 -3
- package/dist-library/reactive-md-react-component-badge.js +3 -3
- package/dist-library/reactive-md-react-component-card.js +3 -3
- package/dist-library/reactive-md-react-component-chart.js +2 -2
- package/dist-library/reactive-md-react-component-checkbox.js +2 -2
- package/dist-library/reactive-md-react-component-checklist.js +2 -2
- package/dist-library/reactive-md-react-component-choices.js +2 -2
- package/dist-library/reactive-md-react-component-column.js +1 -1
- package/dist-library/reactive-md-react-component-coordinate.js +2 -2
- package/dist-library/reactive-md-react-component-counter.js +2 -2
- package/dist-library/reactive-md-react-component-data-table.js +2 -2
- package/dist-library/reactive-md-react-component-date.js +2 -2
- package/dist-library/reactive-md-react-component-diagram.js +2 -2
- package/dist-library/reactive-md-react-component-disclosure.js +3 -3
- package/dist-library/reactive-md-react-component-edge.js +1 -1
- package/dist-library/reactive-md-react-component-else.js +10 -0
- package/dist-library/reactive-md-react-component-gallery-item.js +2 -2
- package/dist-library/reactive-md-react-component-gallery.js +2 -2
- package/dist-library/reactive-md-react-component-grid.js +3 -3
- package/dist-library/reactive-md-react-component-if.js +3 -3
- package/dist-library/reactive-md-react-component-input.js +2 -2
- package/dist-library/reactive-md-react-component-jump.js +3 -3
- package/dist-library/reactive-md-react-component-multi-select.js +2 -2
- package/dist-library/reactive-md-react-component-node.js +2 -2
- package/dist-library/reactive-md-react-component-number.js +2 -2
- package/dist-library/reactive-md-react-component-option.js +1 -1
- package/dist-library/reactive-md-react-component-panel.js +3 -3
- package/dist-library/reactive-md-react-component-plot.js +2 -2
- package/dist-library/reactive-md-react-component-progress.js +2 -2
- package/dist-library/reactive-md-react-component-quiz.js +2 -2
- package/dist-library/reactive-md-react-component-radio-group.js +2 -2
- package/dist-library/reactive-md-react-component-range-slider.js +2 -2
- package/dist-library/reactive-md-react-component-section.js +3 -3
- package/dist-library/reactive-md-react-component-select.js +2 -2
- package/dist-library/reactive-md-react-component-slider.js +2 -2
- package/dist-library/reactive-md-react-component-step.js +3 -3
- package/dist-library/reactive-md-react-component-steps.js +3 -3
- package/dist-library/reactive-md-react-component-tab.js +3 -3
- package/dist-library/reactive-md-react-component-table.js +2 -2
- package/dist-library/reactive-md-react-component-tabs.js +3 -3
- package/dist-library/reactive-md-react-component-text.js +3 -3
- package/dist-library/reactive-md-react-component-textarea.js +2 -2
- package/dist-library/reactive-md-react-component-timeline.js +2 -2
- package/dist-library/reactive-md-react-component-timer.js +2 -2
- package/dist-library/reactive-md-react-component-toggle.js +2 -2
- package/dist-library/reactive-md-react-component-tooltip.js +3 -3
- package/dist-library/reactive-md-react-component-validation.js +3 -3
- package/dist-library/reactive-md-react-minimal.js +4 -4
- package/dist-library/reactive-md-react-pack-controls.js +4 -4
- package/dist-library/reactive-md-react-pack-data.js +3 -3
- package/dist-library/reactive-md-react-pack-layout.js +25 -24
- package/dist-library/reactive-md-react-pack-visuals.js +2 -2
- package/dist-library/reactive-md-react-packed.js +6 -6
- package/dist-library/reactive-md-react-server.js +37 -36
- package/dist-library/reactive-md-react-static-server.js +2 -2
- package/dist-library/reactive-md-react-static.js +1 -1
- package/dist-library/reactive-md-react-unstyled.js +12 -12
- package/dist-library/reactive-md-react.js +12 -12
- package/dist-library/reactive-md-scan.js +1 -1
- package/dist-library/reactive-md-sdk.js +23 -9
- package/dist-library/reactive-md-standalone-configured.js +2 -2
- package/dist-library/reactive-md-standalone-host.js +2 -2
- package/dist-library/reactive-md-testing-browser.js +2 -2
- package/dist-library/reactive-md-testing-react.js +6 -6
- package/dist-library/reactive-md-testing.js +6 -6
- package/dist-library/reactive-md-vite.js +25 -9
- package/dist-library/reactive-md-worker-pool.js +3 -3
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +52 -43
- package/dist-library/{registry-core-CziAIP5P.js → registry-core-DxEaxhJ6.js} +3 -2
- package/dist-library/{render-nodes-DKjg_TR1.js → render-nodes-B6j6Ip5I.js} +766 -731
- package/dist-library/{requirements-DhIkxAbl.js → requirements-C56sFIEs.js} +2 -2
- package/dist-library/{resources-B_nbROgj.js → resources-6VaNgk-h.js} +2 -2
- package/dist-library/rmd-pack-layout.css +9 -0
- package/dist-library/rmd-pack-resource-layout.css +9 -0
- package/dist-library/runtime-BHeuLOv_.js +1369 -0
- package/dist-library/{runtime-requirement-C4-vNcf5.js → runtime-requirement-DzPO8raU.js} +166 -163
- package/dist-library/{schema-core-4sd1Vu7V.js → schema-core-CDXfxdID.js} +24 -1
- package/dist-library/{sdk-core-BLsW9cCy.js → sdk-core-CnE-n0Z7.js} +469 -314
- package/dist-library/{session-core-DLBRPV7f.js → session-core-C071yQwV.js} +140 -127
- package/dist-library/{validation-XXlb-spV.js → sha256-utf16-Bmandi_H.js} +392 -315
- package/dist-library/shareable-CHCDnl6j.js +844 -0
- package/dist-library/types/authoring/catalog.d.ts +3 -1
- package/dist-library/types/authoring/index.d.ts +1 -1
- package/dist-library/types/components/chart/default-chart-types.d.ts +3 -0
- package/dist-library/types/components/chart/default-chart.d.ts +7 -0
- package/dist-library/types/components/entries/else.d.ts +3 -0
- package/dist-library/types/components/layout/layout.d.ts +5 -0
- package/dist-library/types/components/shared/visuals.d.ts +1 -1
- package/dist-library/types/components/table/data-table-model.d.ts +95 -2
- package/dist-library/types/components/table/data-table.d.ts +2 -2
- package/dist-library/types/contracts/component-kernel.d.ts +5 -0
- package/dist-library/types/contracts/font-aliases.d.ts +18 -0
- package/dist-library/types/contracts/number-literal.d.ts +2 -0
- package/dist-library/types/contracts/sha256-utf16.d.ts +2 -0
- package/dist-library/types/export/index.d.ts +4 -1
- package/dist-library/types/local/compilation/compiler-choices.d.ts +4 -0
- package/dist-library/types/local/compilation/compiler-declarations.d.ts +2 -1
- package/dist-library/types/local/compilation/compiler-expressions.d.ts +12 -1
- package/dist-library/types/local/compilation/compiler-macros.d.ts +18 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +8 -2
- package/dist-library/types/local/compilation/compiler-tables.d.ts +1 -0
- package/dist-library/types/local/compilation/compiler-validation.d.ts +11 -0
- package/dist-library/types/local/compilation/compiler-values.d.ts +1 -2
- package/dist-library/types/local/configuration/diagnostic-messages.d.ts +173 -2
- package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +40 -0
- package/dist-library/types/local/evaluation/choice-values.d.ts +22 -0
- package/dist-library/types/local/evaluation/computations.d.ts +13 -5
- package/dist-library/types/local/evaluation/dataset.d.ts +4 -0
- package/dist-library/types/local/evaluation/expression/collection-functions.d.ts +13 -0
- package/dist-library/types/local/evaluation/expression/compile.d.ts +11 -4
- package/dist-library/types/local/evaluation/expression/data-functions.d.ts +23 -0
- package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -1
- package/dist-library/types/local/evaluation/expression/internal-names.d.ts +8 -0
- package/dist-library/types/local/evaluation/expression/syntax.d.ts +19 -2
- package/dist-library/types/local/evaluation/expression/transform-budget.d.ts +13 -0
- package/dist-library/types/local/evaluation/expression/values.d.ts +9 -1
- package/dist-library/types/local/evaluation/validation.d.ts +8 -6
- package/dist-library/types/local/index.d.ts +4 -3
- package/dist-library/types/local/parsing/conditional-branches.d.ts +4 -0
- package/dist-library/types/local/parsing/source-revision.d.ts +3 -0
- package/dist-library/types/local/runtime/runtime-choices.d.ts +11 -0
- package/dist-library/types/local/runtime/runtime.d.ts +3 -1
- package/dist-library/types/local/runtime/state.d.ts +30 -15
- package/dist-library/types/local/source/authoring-requirements.d.ts +3 -0
- package/dist-library/types/local/source/authoring-syntax.d.ts +3 -2
- package/dist-library/types/local/source/authoring.d.ts +10 -0
- package/dist-library/types/local/source/source-migration.d.ts +1 -0
- package/dist-library/types/local/types.d.ts +33 -2
- package/dist-library/types/react/component-api.d.ts +21 -2
- package/dist-library/types/react/component-utils.d.ts +11 -0
- package/dist-library/types/react/font-aliases.d.ts +2 -0
- package/dist-library/types/react/package-core.d.ts +3 -0
- package/dist-library/types/react/rendering/document/validation-state.d.ts +1 -1
- package/dist-library/types/react/rendering/document/view-revision.d.ts +3 -12
- package/dist-library/types/react/rendering/table/data-table.d.ts +1 -1
- package/dist-library/types/react/sdk-core.d.ts +3 -1
- package/dist-library/types/sdk/assembly.d.ts +3 -0
- package/dist-library/types/sdk/font.d.ts +13 -0
- package/dist-library/types/sdk/index.d.ts +1 -0
- package/dist-library/types/sdk/theme.d.ts +5 -0
- package/dist-library/types/sdk/types.d.ts +6 -0
- package/dist-library/types/sdk/version.d.ts +1 -1
- package/dist-library/types/shareable.d.ts +15 -3
- package/dist-library/types/standalone/prepare.d.ts +4 -2
- package/dist-library/types/standalone/session-core.d.ts +4 -1
- package/dist-library/types/vite/index.d.ts +3 -0
- package/dist-library/types/vite/registration.d.ts +1 -0
- package/dist-library/{types-Bza88SGK.js → types-B4qG8J4S.js} +1 -1
- package/dist-library/types-FYhRWRn9.js +3 -0
- package/dist-library/use-hydrated-D1gFY2Dq.js +2655 -0
- package/dist-library/validation-DRuW0Wl9.js +433 -0
- package/dist-library/{version-B0G1699c.js → version-4wzhbvDG.js} +1 -1
- package/dist-library/{visual-helpers-CRmaqCHX.js → visual-helpers-UU6xiL8g.js} +3 -3
- package/dist-library/visuals-7xzoL9ql.js +49340 -0
- package/dist-library/{worker-D6WMV8xJ.js → worker-3ldRjOEG.js} +9 -9
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +128 -368
- package/docs/README-ch.md +3 -1
- package/docs/README.md +3 -1
- package/docs/compatibility/api-stability-ch.md +1 -1
- package/docs/compatibility/api-stability-en.md +1 -1
- package/docs/compatibility/compatibility-ch.md +15 -15
- package/docs/compatibility/compatibility-en.md +15 -15
- package/docs/compatibility/compatibility-manifest.schema.json +3 -2
- package/docs/compatibility/deprecation-ch.md +2 -2
- package/docs/compatibility/deprecation-en.md +2 -2
- package/docs/compatibility/source-versioning-ch.md +22 -14
- package/docs/compatibility/source-versioning-en.md +22 -13
- package/docs/compatibility/support-matrix-ch.md +4 -3
- package/docs/compatibility/support-matrix-en.md +4 -3
- package/docs/development/component-development-ch.md +2 -2
- package/docs/development/component-development-en.md +2 -2
- package/docs/development/component-protocol-ch.md +18 -18
- package/docs/development/component-protocol-en.md +14 -14
- package/docs/guides/local-guide-ch.md +109 -20
- package/docs/guides/local-guide-en.md +109 -20
- package/docs/integration/author-tools-ch.md +1 -1
- package/docs/integration/author-tools-en.md +1 -1
- package/docs/integration/editor-ch.md +3 -3
- package/docs/integration/editor-en.md +3 -3
- package/docs/integration/extension-sdk-ch.md +29 -3
- package/docs/integration/extension-sdk-en.md +29 -3
- package/docs/integration/local-integration-ch.md +3 -3
- package/docs/integration/local-integration-en.md +3 -3
- package/docs/integration/pdf-export-ch.md +42 -0
- package/docs/integration/pdf-export-en.md +42 -0
- package/docs/integration/shareable-export-ch.md +11 -19
- package/docs/integration/shareable-export-en.md +11 -19
- package/docs/reference/diagnostics-counting-ch.md +24 -1
- package/docs/reference/diagnostics-counting-en.md +24 -1
- package/docs/reference/local-interaction-syntax-ch.md +222 -33
- package/docs/reference/local-interaction-syntax-en.md +220 -31
- package/docs/reference/public-api-ch.md +24 -18
- package/docs/reference/public-api-en.md +24 -18
- package/docs/reference/theme-protocol-ch.md +1 -1
- package/docs/reference/theme-protocol-en.md +1 -1
- package/docs/releases/release-0.10.0-ch.md +45 -0
- package/docs/releases/release-0.10.0-en.md +45 -0
- package/examples/conformance/README-ch.md +3 -3
- package/examples/conformance/README.md +3 -3
- package/examples/conformance/local-draft-4.json +441 -0
- package/examples/integration/README-ch.md +3 -3
- package/examples/integration/README.md +3 -3
- package/examples/integration/chat-session/package.json +1 -1
- package/examples/local/README-ch.md +1 -1
- package/examples/local/README.md +1 -1
- package/package.json +6 -1
- package/dist-library/LocalStaticDocumentView-2J7w0sKm.js +0 -143
- package/dist-library/authoring-B14SsOXZ.js +0 -893
- package/dist-library/compile-D50B5_Ww.js +0 -1249
- package/dist-library/computations-CffoW7Ff.js +0 -340
- package/dist-library/data-table-Kv_ZA2Z2.js +0 -297
- package/dist-library/default-options-DU5dxuU6.js +0 -125
- package/dist-library/layout-BfUzzO2b.js +0 -553
- package/dist-library/runtime-CuJndKqK.js +0 -1289
- package/dist-library/shareable-C6mUerpQ.js +0 -817
- package/dist-library/types-daDo2c_w.js +0 -3
- package/dist-library/use-hydrated-W-laKPhY.js +0 -22975
- package/dist-library/visuals-CoVSjVD8.js +0 -49159
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as g, t as _ } from "./use-hydrated-
|
|
1
|
+
import { D as e, E as t, I as n, M as r, N as i, P as a, R as o, a as s, i as c, j as l, k as u, l as d, s as f, t as p, v as m, x as h } from "./component-utils-ZM3jUJNy.js";
|
|
2
|
+
import { n as g, t as _ } from "./use-hydrated-D1gFY2Dq.js";
|
|
3
3
|
import { useEffect as v, useId as ee, useRef as y, useState as b } from "react";
|
|
4
4
|
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
5
5
|
// src/components/plot/coordinate.tsx
|
|
6
|
-
function C({ id:
|
|
7
|
-
let [
|
|
6
|
+
function C({ id: t, label: n, value: r, min: i, max: a, step: o, disabled: s, onCommit: c, reset: l }) {
|
|
7
|
+
let [u, f] = b(() => String(r)), [p, m] = b(!1), h = y(r);
|
|
8
8
|
v(() => {
|
|
9
9
|
f(String(r)), m(!1);
|
|
10
10
|
}, [l]), v(() => {
|
|
11
11
|
h.current !== r && (h.current = r, p || f(String(r)));
|
|
12
12
|
}, [r, p]);
|
|
13
|
-
let g = (
|
|
14
|
-
let n =
|
|
13
|
+
let g = (t) => {
|
|
14
|
+
let n = t.trim();
|
|
15
15
|
if (n === "" || n === "-" || n === "." || n === "-.") return null;
|
|
16
16
|
let r = Number(n);
|
|
17
|
-
return Number.isFinite(r) ?
|
|
17
|
+
return Number.isFinite(r) ? e(d(r, i, a), i, a, o) : null;
|
|
18
18
|
};
|
|
19
19
|
return /* @__PURE__ */ S("div", {
|
|
20
20
|
className: "local-number-field",
|
|
21
21
|
children: [/* @__PURE__ */ x("label", {
|
|
22
22
|
className: "md-label",
|
|
23
|
-
htmlFor:
|
|
23
|
+
htmlFor: t,
|
|
24
24
|
children: n
|
|
25
25
|
}), /* @__PURE__ */ x("input", {
|
|
26
|
-
id:
|
|
26
|
+
id: t,
|
|
27
27
|
className: "md-text-input",
|
|
28
28
|
type: "text",
|
|
29
29
|
inputMode: "decimal",
|
|
30
|
-
value:
|
|
30
|
+
value: u,
|
|
31
31
|
disabled: s,
|
|
32
32
|
onFocus: () => m(!0),
|
|
33
33
|
onBlur: () => {
|
|
34
34
|
m(!1);
|
|
35
|
-
let e = g(
|
|
35
|
+
let e = g(u);
|
|
36
36
|
f(String(e ?? r));
|
|
37
37
|
},
|
|
38
38
|
onChange: (e) => {
|
|
@@ -45,60 +45,60 @@ function C({ id: e, label: n, value: r, min: i, max: a, step: o, disabled: s, on
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
function w(v) {
|
|
48
|
-
let b =
|
|
48
|
+
let b = l(v), w = r(v), T = ee(), { content: E, mode: D, resetToken: O, t: k } = w, { write: A, writeMany: j, error: te, setError: ne } = o(v), M = u(v, "label", k("Coordinate", "坐标")), { disabled: N, invalid: re } = i(v), P = n(v), F = h(v, "x-min", "x-max", -5, 5, 1), I = h(v, "y-min", "y-max", -5, 5, 1), L = e(0, F.min, F.max, F.step), R = e(0, I.min, I.max, I.step), z = e(t(v, "x", L), F.min, F.max, F.step), B = e(t(v, "y", R), I.min, I.max, I.step), V = y(null), H = y(!1), U = _();
|
|
49
49
|
a(v, () => ne(null));
|
|
50
50
|
let W = `X: ${z} · Y: ${B}`;
|
|
51
|
-
if (D === "static") return /* @__PURE__ */ x(
|
|
51
|
+
if (D === "static") return /* @__PURE__ */ x(s, {
|
|
52
52
|
authorRoot: b(),
|
|
53
53
|
className: "local-coordinate",
|
|
54
54
|
label: M,
|
|
55
55
|
value: W
|
|
56
56
|
});
|
|
57
|
-
let G = (e) => F.max > F.min ? 40 + (e - F.min) / (F.max - F.min) * 320 : 200, K = (e) => I.max > I.min ? 360 - (e - I.min) / (I.max - I.min) * 320 : 200, q = G(z), J = K(B), Y = G(
|
|
57
|
+
let G = (e) => F.max > F.min ? 40 + (e - F.min) / (F.max - F.min) * 320 : 200, K = (e) => I.max > I.min ? 360 - (e - I.min) / (I.max - I.min) * 320 : 200, q = G(z), J = K(B), Y = G(d(0, F.min, F.max)), X = K(d(0, I.min, I.max)), Z = (e) => {
|
|
58
58
|
let t = e.step * Math.max(1, Math.ceil((e.max - e.min) / (e.step * 10))), n = Math.min(11, Math.floor((e.max - e.min) / t) + 1);
|
|
59
59
|
return Array.from({ length: n }, (n, r) => e.min + r * t);
|
|
60
|
-
}, Q = (
|
|
60
|
+
}, Q = (t) => {
|
|
61
61
|
let n = V.current?.getBoundingClientRect();
|
|
62
62
|
if (!n || n.width === 0 || n.height === 0) return null;
|
|
63
|
-
let r =
|
|
63
|
+
let r = d(((t.clientX - n.left) / n.width - .1) / .8, 0, 1), i = d(((t.clientY - n.top) / n.height - .1) / .8, 0, 1);
|
|
64
64
|
return {
|
|
65
|
-
x:
|
|
66
|
-
y:
|
|
65
|
+
x: e(F.min + r * (F.max - F.min), F.min, F.max, F.step),
|
|
66
|
+
y: e(I.min + (1 - i) * (I.max - I.min), I.min, I.max, I.step)
|
|
67
67
|
};
|
|
68
68
|
}, $ = (e, t) => {
|
|
69
69
|
(e !== z || t !== B) && j({
|
|
70
70
|
x: e,
|
|
71
71
|
y: t
|
|
72
72
|
});
|
|
73
|
-
}, ie = (
|
|
73
|
+
}, ie = (t) => {
|
|
74
74
|
if (N) return;
|
|
75
75
|
let n = z, r = B;
|
|
76
|
-
switch (
|
|
76
|
+
switch (t.key) {
|
|
77
77
|
case "ArrowLeft":
|
|
78
|
-
n =
|
|
78
|
+
n = e(z - F.step, F.min, F.max, F.step);
|
|
79
79
|
break;
|
|
80
80
|
case "ArrowRight":
|
|
81
|
-
n =
|
|
81
|
+
n = e(z + F.step, F.min, F.max, F.step);
|
|
82
82
|
break;
|
|
83
83
|
case "ArrowDown":
|
|
84
|
-
r =
|
|
84
|
+
r = e(B - I.step, I.min, I.max, I.step);
|
|
85
85
|
break;
|
|
86
86
|
case "ArrowUp":
|
|
87
|
-
r =
|
|
87
|
+
r = e(B + I.step, I.min, I.max, I.step);
|
|
88
88
|
break;
|
|
89
89
|
case "Home":
|
|
90
90
|
n = F.min, r = I.min;
|
|
91
91
|
break;
|
|
92
92
|
case "End":
|
|
93
|
-
n =
|
|
93
|
+
n = e(F.max, F.min, F.max, F.step), r = e(I.max, I.min, I.max, I.step);
|
|
94
94
|
break;
|
|
95
95
|
default: return;
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
t.preventDefault(), t.stopPropagation(), $(n, r);
|
|
98
98
|
};
|
|
99
99
|
return /* @__PURE__ */ S("div", {
|
|
100
100
|
className: "local-coordinate",
|
|
101
|
-
...b(
|
|
101
|
+
...b(f(m(E))),
|
|
102
102
|
role: "group",
|
|
103
103
|
"aria-label": M,
|
|
104
104
|
"data-rmd-component": "coordinate",
|
|
@@ -285,8 +285,8 @@ function w(v) {
|
|
|
285
285
|
onCommit: (e) => A(e, "y")
|
|
286
286
|
})]
|
|
287
287
|
}),
|
|
288
|
-
/* @__PURE__ */ x(
|
|
289
|
-
/* @__PURE__ */ x(
|
|
288
|
+
/* @__PURE__ */ x(c, { value: W }),
|
|
289
|
+
/* @__PURE__ */ x(p, { message: re ? k("Cannot compute", "无法计算") : te })
|
|
290
290
|
]
|
|
291
291
|
});
|
|
292
292
|
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import "./limits-CFERRrlC.js";
|
|
2
|
+
import { a as e, o as t, s as n } from "./compile-B35rfzKr.js";
|
|
3
|
+
import { h as r } from "./sdk-core-CnE-n0Z7.js";
|
|
4
|
+
import { M as i, P as a, R as o, c as s, j as c, k as l, t as u } from "./component-utils-ZM3jUJNy.js";
|
|
5
|
+
import { a as d, c as f, f as p, i as ee, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S } from "./data-table-model-DruztQFt.js";
|
|
6
|
+
import { useEffect as te, useMemo as C, useState as w } from "react";
|
|
7
|
+
import { Fragment as ne, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
8
|
+
// src/components/table/data-table.tsx
|
|
9
|
+
var D = /^\s*\{\{([\s\S]*)\}\}\s*$/, O = 20;
|
|
10
|
+
function k(e) {
|
|
11
|
+
if (e === void 0) return null;
|
|
12
|
+
let t = D.exec(e), n = t ? t[1].trim() : "";
|
|
13
|
+
return n === "" ? null : n;
|
|
14
|
+
}
|
|
15
|
+
function A(e) {
|
|
16
|
+
return e.kind === "comment" || e.kind === "text" && e.text.trim() === "" || e.kind === "paragraph" && e.children.length === 0 && e.text.trim() === "";
|
|
17
|
+
}
|
|
18
|
+
function j(e) {
|
|
19
|
+
return typeof e == "string" && x.includes(e);
|
|
20
|
+
}
|
|
21
|
+
function M(e) {
|
|
22
|
+
let t = {}, n = e.props.format;
|
|
23
|
+
p(n) && n !== "plain" && (t.format = n);
|
|
24
|
+
let r = e.props.digits;
|
|
25
|
+
typeof r == "number" && Number.isInteger(r) && r >= 0 && r <= O && (t.digits = r);
|
|
26
|
+
let i = e.props.currency;
|
|
27
|
+
typeof i == "string" && i.trim() !== "" && i.trim() !== "USD" && (t.currency = i.trim());
|
|
28
|
+
let a = e.props.locale;
|
|
29
|
+
return typeof a == "string" && a.trim() !== "" && a.trim() !== "en-US" && (t.locale = a.trim()), t;
|
|
30
|
+
}
|
|
31
|
+
function N(e) {
|
|
32
|
+
let t = l(e, "label", "").trim();
|
|
33
|
+
if (t === "") return {
|
|
34
|
+
ok: !1,
|
|
35
|
+
failure: "label"
|
|
36
|
+
};
|
|
37
|
+
let n = k(e.content.attrs.rows);
|
|
38
|
+
if (!n) return {
|
|
39
|
+
ok: !1,
|
|
40
|
+
failure: "rows"
|
|
41
|
+
};
|
|
42
|
+
let r = k(e.content.attrs.key);
|
|
43
|
+
if (!r) return {
|
|
44
|
+
ok: !1,
|
|
45
|
+
failure: "key"
|
|
46
|
+
};
|
|
47
|
+
let i = e.content.attrs["max-rows"], a = 100;
|
|
48
|
+
if (i !== void 0 && (!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(i.trim()) || (a = Number(i.trim()), !Number.isSafeInteger(a) || a <= 0 || a > 1e3))) return {
|
|
49
|
+
ok: !1,
|
|
50
|
+
failure: "max-rows"
|
|
51
|
+
};
|
|
52
|
+
let o = j(e.props.align) ? e.props.align : "center", s = k(e.content.attrs["row-align"]) ?? void 0, c = e.content.children.filter((e) => !A(e)), u = [];
|
|
53
|
+
for (let e of c) {
|
|
54
|
+
let t = e.children.filter((e) => !A(e));
|
|
55
|
+
if (e.kind !== "component" || e.name !== "column" || t.length > 0) return {
|
|
56
|
+
ok: !1,
|
|
57
|
+
failure: "columns"
|
|
58
|
+
};
|
|
59
|
+
let n = (e.attrs.label ?? "").trim(), r = k(e.attrs.value);
|
|
60
|
+
if (n === "" || !r) return {
|
|
61
|
+
ok: !1,
|
|
62
|
+
failure: "columns"
|
|
63
|
+
};
|
|
64
|
+
let i = e.props.summary, a = e.props.align;
|
|
65
|
+
u.push({
|
|
66
|
+
label: n,
|
|
67
|
+
value: r,
|
|
68
|
+
...M(e),
|
|
69
|
+
...i === "sum" || i === "average" || i === "count" ? { summary: i } : {},
|
|
70
|
+
...j(a) ? { align: a } : {}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return u.length < 1 || u.length > 20 ? {
|
|
74
|
+
ok: !1,
|
|
75
|
+
failure: "columns"
|
|
76
|
+
} : {
|
|
77
|
+
ok: !0,
|
|
78
|
+
table: {
|
|
79
|
+
label: t,
|
|
80
|
+
rows: n,
|
|
81
|
+
key: r,
|
|
82
|
+
maxRows: a,
|
|
83
|
+
align: o,
|
|
84
|
+
...s === void 0 ? {} : { rowAlign: s },
|
|
85
|
+
columns: u
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function P(e) {
|
|
90
|
+
let t = e.props["page-size"];
|
|
91
|
+
return typeof t == "number" && Number.isInteger(t) && t > 0 ? t : null;
|
|
92
|
+
}
|
|
93
|
+
function F(p) {
|
|
94
|
+
let x = c(p), D = i(p), [O, k] = w(""), [A, j] = w(null), [M, F] = w(1), { write: I, error: L } = o(p);
|
|
95
|
+
a(p, () => {
|
|
96
|
+
k(""), j(null), F(1);
|
|
97
|
+
});
|
|
98
|
+
let R = C(() => N(p), [p]), z = l(p, "empty", "").trim(), B = C(() => {
|
|
99
|
+
if (!R.ok) return null;
|
|
100
|
+
let i = { evaluate: (e) => r(p.runtime, e) }, a = t() ?? e();
|
|
101
|
+
return n(a, () => {
|
|
102
|
+
try {
|
|
103
|
+
let e = S(i, R.table.rows, a);
|
|
104
|
+
return y({
|
|
105
|
+
rows: e,
|
|
106
|
+
columns: R.table.columns,
|
|
107
|
+
keyExpression: R.table.key,
|
|
108
|
+
maxRows: R.table.maxRows,
|
|
109
|
+
...z === "" ? {} : { emptyText: z },
|
|
110
|
+
...R.table.rowAlign === void 0 ? {} : { rowAlign: R.table.rowAlign },
|
|
111
|
+
runtime: i,
|
|
112
|
+
stage: a
|
|
113
|
+
});
|
|
114
|
+
} catch (e) {
|
|
115
|
+
return {
|
|
116
|
+
ok: !1,
|
|
117
|
+
failure: e instanceof g ? e.failure : "rows"
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}, [
|
|
122
|
+
p,
|
|
123
|
+
R,
|
|
124
|
+
z
|
|
125
|
+
]), V = D.mode !== "static", H = V && s(p, "searchable", !1), U = V && s(p, "sortable", !1), W = p.content.attrs.bind !== void 0 || p.content.attrs.initial !== void 0, G = B?.ok ? B.model : null, K = G ? ee(G, {
|
|
126
|
+
search: H ? O : "",
|
|
127
|
+
sort: U ? A : null,
|
|
128
|
+
page: M,
|
|
129
|
+
pageSize: V ? P(p) : null
|
|
130
|
+
}) : null, q = K === null ? null : K.page;
|
|
131
|
+
if (te(() => {
|
|
132
|
+
q !== null && q !== M && F(q);
|
|
133
|
+
}, [q, M]), !R.ok) return /* @__PURE__ */ T("div", {
|
|
134
|
+
...x(),
|
|
135
|
+
className: "local-error local-data-table-error",
|
|
136
|
+
role: "alert",
|
|
137
|
+
children: b(D.t, R.failure)
|
|
138
|
+
});
|
|
139
|
+
if (!B || !B.ok || G === null || K === null) {
|
|
140
|
+
let e = B && !B.ok ? B.failure : "rows";
|
|
141
|
+
return /* @__PURE__ */ T("div", {
|
|
142
|
+
...x(),
|
|
143
|
+
className: "local-error local-data-table-error",
|
|
144
|
+
role: "alert",
|
|
145
|
+
children: b(D.t, e)
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
let J = W ? v(G, (() => {
|
|
149
|
+
try {
|
|
150
|
+
let e = p.bindings.value.get();
|
|
151
|
+
return typeof e == "string" ? e : "";
|
|
152
|
+
} catch {
|
|
153
|
+
return "";
|
|
154
|
+
}
|
|
155
|
+
})()) : null, re = G.columns.length + +!!W, Y = K.pageCount, X = m(K.filteredRows, R.table.columns), Z = D.t("Summary", "汇总"), Q = R.table.align, $ = (e) => R.table.columns[e]?.align ?? Q, ie = (e, t) => R.table.columns[e]?.align ?? t ?? Q, ae = (e) => {
|
|
156
|
+
F(1), j((t) => d(t, e));
|
|
157
|
+
}, oe = (e) => !A || A.column !== e ? "none" : A.direction === "asc" ? "ascending" : "descending";
|
|
158
|
+
return /* @__PURE__ */ E("div", {
|
|
159
|
+
...x(),
|
|
160
|
+
className: "md-table-scroll local-data-table-scroll",
|
|
161
|
+
"data-local-data-table": "",
|
|
162
|
+
children: [
|
|
163
|
+
H ? /* @__PURE__ */ E("label", {
|
|
164
|
+
className: "local-visual-search",
|
|
165
|
+
children: [/* @__PURE__ */ T("span", { children: D.t("Search", "搜索") }), /* @__PURE__ */ T("input", {
|
|
166
|
+
type: "search",
|
|
167
|
+
value: O,
|
|
168
|
+
placeholder: D.t("Search all columns", "搜索所有列"),
|
|
169
|
+
"aria-label": D.t(`Search ${R.table.label}`, `搜索${R.table.label}`),
|
|
170
|
+
onChange: (e) => {
|
|
171
|
+
k(e.target.value), F(1);
|
|
172
|
+
}
|
|
173
|
+
})]
|
|
174
|
+
}) : null,
|
|
175
|
+
/* @__PURE__ */ E("table", {
|
|
176
|
+
className: "md-table local-data-table",
|
|
177
|
+
"aria-label": R.table.label,
|
|
178
|
+
children: [
|
|
179
|
+
/* @__PURE__ */ T("thead", { children: /* @__PURE__ */ E("tr", { children: [W ? /* @__PURE__ */ T("th", {
|
|
180
|
+
scope: "col",
|
|
181
|
+
"data-align": "center",
|
|
182
|
+
className: "local-visual-select-column",
|
|
183
|
+
children: /* @__PURE__ */ T("span", {
|
|
184
|
+
className: "local-visual-sr-only",
|
|
185
|
+
children: D.t("Select", "选择")
|
|
186
|
+
})
|
|
187
|
+
}) : null, G.columns.map((e, t) => /* @__PURE__ */ T("th", {
|
|
188
|
+
scope: "col",
|
|
189
|
+
"data-align": $(t),
|
|
190
|
+
"aria-sort": U ? oe(t) : void 0,
|
|
191
|
+
className: K.numericColumns[t] ? "is-numeric" : void 0,
|
|
192
|
+
children: U ? /* @__PURE__ */ E("button", {
|
|
193
|
+
type: "button",
|
|
194
|
+
className: `local-visual-sort-button${A && A.column === t ? " is-sorted" : ""}`,
|
|
195
|
+
"data-rmd-appearance": "custom",
|
|
196
|
+
onClick: () => ae(t),
|
|
197
|
+
title: D.t("Click to cycle ascending, descending and original order", "点击切换升序、降序和原始顺序"),
|
|
198
|
+
children: [e, A && A.column === t ? /* @__PURE__ */ T("span", {
|
|
199
|
+
className: "local-visual-sort-marker",
|
|
200
|
+
"aria-hidden": "true",
|
|
201
|
+
children: A.direction === "asc" ? "▲" : "▼"
|
|
202
|
+
}) : null]
|
|
203
|
+
}) : e
|
|
204
|
+
}, `column-${t}`))] }) }),
|
|
205
|
+
/* @__PURE__ */ T("tbody", { children: G.empty || K.total === 0 ? /* @__PURE__ */ T("tr", { children: /* @__PURE__ */ T("td", {
|
|
206
|
+
className: "local-data-table-empty",
|
|
207
|
+
"data-align": "center",
|
|
208
|
+
colSpan: re,
|
|
209
|
+
children: _(G, z, D.t)
|
|
210
|
+
}) }) : K.rows.map((e) => {
|
|
211
|
+
let t = J !== null && J.key === e.key, n = f(e);
|
|
212
|
+
return /* @__PURE__ */ E("tr", {
|
|
213
|
+
className: t ? "is-selected" : void 0,
|
|
214
|
+
"data-state": t ? "selected" : void 0,
|
|
215
|
+
children: [W ? /* @__PURE__ */ T("td", {
|
|
216
|
+
className: "local-visual-select-cell",
|
|
217
|
+
"data-align": "center",
|
|
218
|
+
children: V ? /* @__PURE__ */ T("button", {
|
|
219
|
+
type: "button",
|
|
220
|
+
className: `local-visual-select-button${t ? " is-selected" : ""}`,
|
|
221
|
+
"data-rmd-appearance": "custom",
|
|
222
|
+
"aria-pressed": t,
|
|
223
|
+
"aria-label": D.t(`Select row ${n}`, `选择行 ${n}`),
|
|
224
|
+
title: D.t(`Select row ${n}`, `选择行 ${n}`),
|
|
225
|
+
onClick: () => h(e, I),
|
|
226
|
+
children: /* @__PURE__ */ T("span", {
|
|
227
|
+
"aria-hidden": "true",
|
|
228
|
+
children: t ? "●" : "○"
|
|
229
|
+
})
|
|
230
|
+
}) : /* @__PURE__ */ T("span", {
|
|
231
|
+
className: `local-visual-select-button${t ? " is-selected" : ""}`,
|
|
232
|
+
"aria-hidden": "true",
|
|
233
|
+
children: t ? "●" : "○"
|
|
234
|
+
})
|
|
235
|
+
}) : null, e.cells.map((t, n) => /* @__PURE__ */ T("td", {
|
|
236
|
+
"data-align": ie(n, e.align ?? null),
|
|
237
|
+
className: K.numericColumns[n] ? "is-numeric" : void 0,
|
|
238
|
+
children: t.ok ? t.text : /* @__PURE__ */ T("span", {
|
|
239
|
+
className: "local-error local-data-table-cell-error",
|
|
240
|
+
children: D.t("Cannot compute", "无法计算")
|
|
241
|
+
})
|
|
242
|
+
}, `cell-${n}`))]
|
|
243
|
+
}, e.key);
|
|
244
|
+
}) }),
|
|
245
|
+
X.some((e) => e !== null) ? /* @__PURE__ */ T("tfoot", { children: /* @__PURE__ */ E("tr", { children: [W ? /* @__PURE__ */ T("th", {
|
|
246
|
+
scope: "row",
|
|
247
|
+
"data-align": "center",
|
|
248
|
+
children: Z
|
|
249
|
+
}) : null, X.map((e, t) => {
|
|
250
|
+
let n = e === "" ? /* @__PURE__ */ T("span", {
|
|
251
|
+
className: "local-error",
|
|
252
|
+
children: D.t("Cannot compute", "无法计算")
|
|
253
|
+
}) : e;
|
|
254
|
+
return t === 0 && !W ? /* @__PURE__ */ E("th", {
|
|
255
|
+
scope: "row",
|
|
256
|
+
"data-align": $(0),
|
|
257
|
+
children: [Z, e === null ? null : /* @__PURE__ */ E(ne, { children: [" ", n] })]
|
|
258
|
+
}, t) : /* @__PURE__ */ T("td", {
|
|
259
|
+
"data-align": $(t),
|
|
260
|
+
children: n
|
|
261
|
+
}, t);
|
|
262
|
+
})] }) }) : null
|
|
263
|
+
]
|
|
264
|
+
}),
|
|
265
|
+
Y > 1 ? /* @__PURE__ */ E("nav", {
|
|
266
|
+
className: "local-visual-pagination",
|
|
267
|
+
"aria-label": D.t("Table pagination", "表格分页"),
|
|
268
|
+
children: [
|
|
269
|
+
/* @__PURE__ */ T("button", {
|
|
270
|
+
type: "button",
|
|
271
|
+
className: "md-button md-button-secondary",
|
|
272
|
+
disabled: K.page <= 1,
|
|
273
|
+
onClick: () => F(Math.max(1, K.page - 1)),
|
|
274
|
+
children: D.t("Previous", "上一页")
|
|
275
|
+
}),
|
|
276
|
+
/* @__PURE__ */ T("span", { children: D.t(`Page ${K.page} of ${Y} · ${K.total} rows`, `第 ${K.page} / ${Y} 页 · 共 ${K.total} 行`) }),
|
|
277
|
+
/* @__PURE__ */ T("button", {
|
|
278
|
+
type: "button",
|
|
279
|
+
className: "md-button md-button-secondary",
|
|
280
|
+
disabled: K.page >= Y,
|
|
281
|
+
onClick: () => F(Math.min(Y, K.page + 1)),
|
|
282
|
+
children: D.t("Next", "下一页")
|
|
283
|
+
})
|
|
284
|
+
]
|
|
285
|
+
}) : null,
|
|
286
|
+
/* @__PURE__ */ T(u, { message: L })
|
|
287
|
+
]
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
export { F as t };
|