@svgrid/enterprise 3.1.40 → 3.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SvGridBoard.svelte +20 -3
- package/dist/SvGridScheduler.svelte +112 -6
- package/dist/cdn/svgrid-enterprise.svelte-external.js +546 -540
- package/dist/designer/assets/GridFind-DSgjlakI.js +1 -0
- package/dist/designer/assets/GridFooter-EjA_7y8w.js +1 -0
- package/dist/designer/assets/GridMenus-BBsuf2vC.js +1 -0
- package/dist/designer/assets/PinSplitter-oi6ffxQy.js +1 -0
- package/dist/designer/assets/SvChartMenu-Durtznhb.js +1 -0
- package/dist/designer/assets/SvDateRangeInput-oZyXTEr3.js +1 -0
- package/dist/designer/assets/SvDateTimePicker-CUobIgHE.js +1 -0
- package/dist/designer/assets/SvGridCellEditor-D_rvqE02.js +3 -0
- package/dist/designer/assets/SvGridChart-D0XxAoxS.js +2 -0
- package/dist/designer/assets/SvGridChartBuilder-CkuDEcl1.js +1 -0
- package/dist/designer/assets/SvGridChartPanel-BUsAzEtx.js +3 -0
- package/dist/designer/assets/SvGridChartView-CU_9mwuA.js +1 -0
- package/dist/designer/assets/SvGridDropdown-BtnFfHzX.js +1 -0
- package/dist/designer/assets/SvListBox-0SCz8lCl.js +2 -0
- package/dist/designer/assets/SvMenuList-DpXScUvp.js +1 -0
- package/dist/designer/assets/SvTabs-CYhfWOzJ.js +1 -0
- package/dist/designer/assets/{chart-panel-messages-BeJhiEym.js → chart-panel-messages-CUwx2rdP.js} +1 -1
- package/dist/designer/assets/date-format-C5MG3rPF.js +1 -0
- package/dist/designer/assets/grid-extension.svelte-BKJJBM8e.js +1 -0
- package/dist/designer/assets/{index-HLPzqCOg.js → index-CZZrEXgj.js} +652 -652
- package/dist/designer/assets/index-DY182YW4.css +1 -0
- package/dist/designer/assets/index-client-CwjHmKgT.js +2 -0
- package/dist/designer/assets/{range-commit-CvP8vrGh.js → range-commit-B_t6HYjs.js} +1 -1
- package/dist/designer/assets/row-drag-Dt3zdAss.js +1 -0
- package/dist/designer/assets/src-CYr2fa73.js +35 -0
- package/dist/designer/assets/src-rcijGyZS.js +1 -0
- package/dist/designer/index.html +15 -16
- package/dist/fields/AttachmentDialog.svelte +5 -1
- package/dist/fields/AutomationAction.svelte +170 -0
- package/dist/fields/AutomationAction.svelte.d.ts +25 -0
- package/dist/fields/AutomationSteps.svelte +32 -0
- package/dist/fields/AutomationSteps.svelte.d.ts +25 -0
- package/dist/fields/AutomationTrigger.svelte +54 -0
- package/dist/fields/AutomationTrigger.svelte.d.ts +15 -0
- package/dist/fields/BarcodeScanner.svelte +17 -0
- package/dist/fields/BarcodeScanner.svelte.d.ts +6 -0
- package/dist/fields/BaseAutomations.svelte +6 -126
- package/dist/fields/BasePivotView.svelte +56 -0
- package/dist/fields/BasePivotView.svelte.d.ts +9 -0
- package/dist/fields/BaseTableView.svelte +21 -2
- package/dist/fields/BaseTableView.svelte.d.ts +10 -1
- package/dist/fields/BaseTabs.svelte +54 -6
- package/dist/fields/BaseTabs.svelte.d.ts +7 -1
- package/dist/fields/DateEditor.svelte +8 -3
- package/dist/fields/FieldInput.svelte +9 -2
- package/dist/fields/LinkPickerEditor.svelte +3 -2
- package/dist/fields/RecordTemplates.svelte +52 -0
- package/dist/fields/RecordTemplates.svelte.d.ts +10 -0
- package/dist/fields/RecordView.svelte +15 -3
- package/dist/fields/RowAdder.svelte +21 -3
- package/dist/fields/RowHeader.svelte +21 -2
- package/dist/fields/SelectEditor.svelte +12 -6
- package/dist/fields/SummaryCell.svelte +1 -1
- package/dist/fields/SvBase.svelte +4 -1
- package/dist/fields/SvBaseAutomations.svelte +205 -0
- package/dist/fields/SvBaseAutomations.svelte.d.ts +27 -0
- package/dist/fields/SvBaseForm.svelte +69 -34
- package/dist/fields/SvBaseForm.svelte.d.ts +13 -0
- package/dist/fields/SvBaseViewBar.svelte +24 -6
- package/dist/fields/SvBaseViewBar.svelte.d.ts +4 -0
- package/dist/fields/TimerCell.svelte +28 -0
- package/dist/fields/TimerCell.svelte.d.ts +16 -0
- package/dist/fields/TimerEditor.svelte +7 -0
- package/dist/fields/TimerEditor.svelte.d.ts +14 -0
- package/dist/fields/airtable.js +1 -1
- package/dist/fields/attachments.d.ts +8 -0
- package/dist/fields/attachments.js +1 -1
- package/dist/fields/automation-edit.d.ts +36 -0
- package/dist/fields/automation-edit.js +12 -0
- package/dist/fields/automation-outbound.d.ts +37 -1
- package/dist/fields/automation-outbound.js +1 -1
- package/dist/fields/automation-script.d.ts +59 -0
- package/dist/fields/automation-script.js +101 -0
- package/dist/fields/automation-server.d.ts +6 -1
- package/dist/fields/automation-server.js +1 -1
- package/dist/fields/automations.svelte.d.ts +76 -5
- package/dist/fields/automations.svelte.js +1 -1
- package/dist/fields/barcode-scan.d.ts +8 -0
- package/dist/fields/barcode-scan.js +1 -0
- package/dist/fields/base-compute.js +1 -1
- package/dist/fields/base-export.js +1 -1
- package/dist/fields/base-import.js +1 -1
- package/dist/fields/base-search.js +1 -1
- package/dist/fields/base-sync.js +1 -1
- package/dist/fields/base-tables.d.ts +20 -0
- package/dist/fields/base-tables.js +1 -1
- package/dist/fields/builtin-types.js +1 -1
- package/dist/fields/chart-view.d.ts +4 -0
- package/dist/fields/chart-view.js +1 -1
- package/dist/fields/convert.js +1 -1
- package/dist/fields/copy-text.js +1 -1
- package/dist/fields/filter-model.js +1 -1
- package/dist/fields/index.d.ts +11 -3
- package/dist/fields/index.js +1 -1
- package/dist/fields/messages/extras.d.ts +108 -0
- package/dist/fields/messages/extras.js +1 -1
- package/dist/fields/messages/fields.d.ts +19 -0
- package/dist/fields/messages/fields.js +1 -1
- package/dist/fields/messages/record.d.ts +12 -0
- package/dist/fields/messages/record.js +1 -1
- package/dist/fields/messages/shell.d.ts +5 -0
- package/dist/fields/messages/shell.js +1 -1
- package/dist/fields/messages/viewbar.d.ts +35 -2
- package/dist/fields/messages/viewbar.js +1 -1
- package/dist/fields/messages.svelte.d.ts +179 -2
- package/dist/fields/phone-sheet.d.ts +6 -0
- package/dist/fields/phone-sheet.js +1 -0
- package/dist/fields/record-actions.d.ts +23 -0
- package/dist/fields/record-actions.js +1 -0
- package/dist/fields/record-menu.js +1 -1
- package/dist/fields/record-store.svelte.d.ts +6 -2
- package/dist/fields/record-store.svelte.js +1 -1
- package/dist/fields/sources.svelte.d.ts +8 -0
- package/dist/fields/summaries.js +1 -1
- package/dist/fields/timer-clock.svelte.d.ts +4 -0
- package/dist/fields/timer-clock.svelte.js +1 -0
- package/dist/fields/timer.d.ts +22 -0
- package/dist/fields/timer.js +1 -0
- package/dist/fields/tree-edit.d.ts +47 -0
- package/dist/fields/tree-edit.js +1 -0
- package/dist/fields/view-actions.d.ts +23 -0
- package/dist/fields/view-actions.js +1 -0
- package/dist/fields/view-model.d.ts +28 -3
- package/dist/fields/view-model.js +1 -1
- package/dist/fields/viewbar/FilterPanel.svelte +1 -1
- package/dist/fields/viewbar/GanttPanel.svelte +13 -3
- package/dist/fields/viewbar/GanttPanel.svelte.d.ts +3 -1
- package/dist/fields/viewbar/HideFieldsPanel.svelte +13 -2
- package/dist/fields/viewbar/ViewsMenu.svelte +69 -7
- package/dist/fields/viewbar/ViewsMenu.svelte.d.ts +4 -0
- package/dist/node/studio.js +2 -2
- package/dist/scheduler-config.d.ts +10 -0
- package/dist/studio/ui-components.generated.js +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/dist/wc/CardMenu-D7hQ19pw.js +1 -0
- package/dist/wc/GridFind-CBZMU9J6.js +1 -0
- package/dist/wc/GridFind-DtGF31ks.js +1 -0
- package/dist/wc/GridFooter-DQq6qsE3.js +1 -0
- package/dist/wc/GridFooter-p4dE9uns.js +1 -0
- package/dist/wc/GridMenus-C4QZ5jnj.js +16 -0
- package/dist/wc/GridMenus-sqW-Y7S5.js +16 -0
- package/dist/wc/{PinSplitter-DyRfU4Wz.js → PinSplitter-3i65naKl.js} +2 -2
- package/dist/wc/{PinSplitter-1fKh3Bwq.js → PinSplitter-CLTE0bRc.js} +2 -2
- package/dist/wc/SvChartMenu-B9HnHez5.js +3 -0
- package/dist/wc/SvChartMenu-B_tNFTkg.js +1 -0
- package/dist/wc/SvDateRangeInput-BPlKigkO.js +1 -0
- package/dist/wc/SvDateRangeInput-Djc93m9x.js +1 -0
- package/dist/wc/SvDateTimePicker-BEAAe3-f.js +4 -0
- package/dist/wc/SvDateTimePicker-DgPz0cBp.js +4 -0
- package/dist/wc/{SvField-DUBHk-OY.js → SvField-JpRX8GTw.js} +2 -2
- package/dist/wc/SvGridCellEditor-BrFHlf2T.js +3 -0
- package/dist/wc/SvGridCellEditor-DK9sYePL.js +3 -0
- package/dist/wc/SvGridChart-BHlM2v-1.js +171 -0
- package/dist/wc/SvGridChart-CH3IBusu.js +171 -0
- package/dist/wc/SvGridChartBuilder-BPbq8uLi.js +7 -0
- package/dist/wc/SvGridChartBuilder-Dil4AM1y.js +8 -0
- package/dist/wc/SvGridChartPanel-BNX4ElVR.js +5 -0
- package/dist/wc/{SvGridChartPanel-BeRUjgjM.js → SvGridChartPanel-gLhTPhip.js} +3 -3
- package/dist/wc/{SvGridChartView-BG-qLHK8.js → SvGridChartView-CIogzaUy.js} +2 -2
- package/dist/wc/{SvGridChartView-s0BqDKZ9.js → SvGridChartView-TujvKvl6.js} +2 -2
- package/dist/wc/{SvGridDropdown-Co1FnDeB.js → SvGridDropdown-B1iMiyRf.js} +2 -2
- package/dist/wc/{SvGridDropdown-CbVCAI1K.js → SvGridDropdown-DauXQKai.js} +2 -2
- package/dist/wc/SvMenuList-DD8DyfUc.js +3 -0
- package/dist/wc/SvModal-BN4l4cAE.js +7 -0
- package/dist/wc/SvModal-CbOvVSpm.js +7 -0
- package/dist/wc/SvTabs-CGPGO9Vn.js +2 -0
- package/dist/wc/board-DS5OxhbF.js +23 -0
- package/dist/wc/board-view.svelte-DZiQ6CpS.js +1 -0
- package/dist/wc/{card-marks.svelte-DEmCHZCd.js → card-marks.svelte-Dym4W2PD.js} +1 -1
- package/dist/wc/chart-panel-messages-P6qAeRsp.js +1 -0
- package/dist/wc/client-CjVagnyk.js +3 -0
- package/dist/wc/client-DTHOsJhV.js +3 -0
- package/dist/wc/core-BhGMIO3G.js +1 -0
- package/dist/wc/date-format-DAQ3T50M.js +18 -0
- package/dist/wc/{date-format-C_AhjL_N.js → date-format-DYC0HfpK.js} +3 -3
- package/dist/wc/{dist-xwz8hbY3.js → dist-CU5leork.js} +1 -1
- package/dist/wc/{export-CCM-mATF.js → export-CzdwAsQD.js} +2 -2
- package/dist/wc/extent-Dg7_h_Do.js +1 -0
- package/dist/wc/gallery-Bij5kkwt.js +11 -0
- package/dist/wc/gantt-DkHZhrMS.js +114 -0
- package/dist/wc/grid-extension.svelte-BhPbpIEL.js +1 -0
- package/dist/wc/grid-extension.svelte-CgyuY7mw.js +1 -0
- package/dist/wc/{js-scroller.svelte-yqKev7S0.js → js-scroller.svelte-DhpfIqCT.js} +1 -1
- package/dist/wc/palette-DkaM8TCP.js +46 -0
- package/dist/wc/popover-sheets.svelte-DkljoAro.js +2 -0
- package/dist/wc/popover-sheets.svelte-ra8as21o.js +2 -0
- package/dist/wc/{range-commit-BeTBd6HK.js → range-commit-CGSw1ziH.js} +1 -1
- package/dist/wc/{range-commit-CKuvQBcr.js → range-commit-i3L3UjPV.js} +1 -1
- package/dist/wc/row-drag-DbVYQ0eO.js +1 -0
- package/dist/wc/row-drag-DevACK09.js +1 -0
- package/dist/wc/scheduler-B0UPSWNJ.js +159 -0
- package/dist/wc/scheduler-view.svelte-B4snqguw.js +1 -0
- package/dist/wc/{server-block-cache-CQ03vNXZ.js → server-block-cache-C9XwJyu2.js} +1 -1
- package/dist/wc/{server-row-model-DHuIO53Q.js → server-row-model-C-FV79zV.js} +1 -1
- package/dist/wc/sv-base-element.js +222 -81
- package/dist/wc/sv-sheet-element.js +54 -158
- package/dist/wc/{validate-Blppk1Na.js → validate--KGSlMvP.js} +1 -1
- package/package.json +3 -3
- package/dist/designer/assets/GridFind-PWsi9BvQ.js +0 -1
- package/dist/designer/assets/GridFooter-CsnWeWLs.js +0 -1
- package/dist/designer/assets/GridMenus-CDtNPHWk.js +0 -1
- package/dist/designer/assets/PinSplitter-66yg1L9j.js +0 -1
- package/dist/designer/assets/SvChartMenu-C0vyEINZ.js +0 -1
- package/dist/designer/assets/SvDateRangeInput-DsFP11vx.js +0 -1
- package/dist/designer/assets/SvDateTimePicker-BnjsZQZx.js +0 -1
- package/dist/designer/assets/SvGridCellEditor-BIyRn_Yg.js +0 -3
- package/dist/designer/assets/SvGridChart-BGMfcq66.js +0 -2
- package/dist/designer/assets/SvGridChartBuilder-5ICrrwzC.js +0 -1
- package/dist/designer/assets/SvGridChartPanel-Dcu3NUge.js +0 -3
- package/dist/designer/assets/SvGridChartView-T5tSN_S5.js +0 -1
- package/dist/designer/assets/SvGridDropdown-CvyfuIx7.js +0 -1
- package/dist/designer/assets/SvListBox-BZg4K2A3.js +0 -2
- package/dist/designer/assets/SvMenuList-COwzLYsg.js +0 -1
- package/dist/designer/assets/SvTabs-CmusmxDR.js +0 -1
- package/dist/designer/assets/date-format-rjHbB1Og.js +0 -1
- package/dist/designer/assets/grid-extension.svelte-BoCs0zu4.js +0 -1
- package/dist/designer/assets/index-Bmck0uP2.css +0 -1
- package/dist/designer/assets/index-client-C8cere9K.js +0 -2
- package/dist/designer/assets/row-drag-D5c8CRVe.js +0 -1
- package/dist/designer/assets/src--KGN0Gre.js +0 -1
- package/dist/designer/assets/src-B7p4SvJd.js +0 -35
- package/dist/wc/CardMenu-CvAlOSac.js +0 -1
- package/dist/wc/GridFind-BMXaq4Jr.js +0 -1
- package/dist/wc/GridFind-vvGzjjGo.js +0 -1
- package/dist/wc/GridFooter-DPREGhF6.js +0 -1
- package/dist/wc/GridFooter-DwsjY5ez.js +0 -1
- package/dist/wc/GridMenus-B762nokq.js +0 -16
- package/dist/wc/GridMenus-DuhBs36k.js +0 -16
- package/dist/wc/SvChartMenu-COh9NMzD.js +0 -3
- package/dist/wc/SvChartMenu-DblAgoRA.js +0 -1
- package/dist/wc/SvDateRangeInput-Fw2yWBDs.js +0 -1
- package/dist/wc/SvDateRangeInput-v249WzvQ.js +0 -1
- package/dist/wc/SvDateTimePicker-ggMYm4Pp.js +0 -4
- package/dist/wc/SvDateTimePicker-rbFCHbRQ.js +0 -4
- package/dist/wc/SvGridCellEditor-CODvFtka.js +0 -3
- package/dist/wc/SvGridCellEditor-N-j2l14U.js +0 -3
- package/dist/wc/SvGridChart-7UgF0l4W.js +0 -171
- package/dist/wc/SvGridChart-Cly6j21z.js +0 -171
- package/dist/wc/SvGridChartBuilder-CyVZ-lZQ.js +0 -7
- package/dist/wc/SvGridChartBuilder-D4BAUF_O.js +0 -8
- package/dist/wc/SvGridChartPanel-CeaYS-Vh.js +0 -5
- package/dist/wc/SvMenuList-QPKlIa2U.js +0 -3
- package/dist/wc/SvModal-CN10qQ5E.js +0 -7
- package/dist/wc/SvModal-y_CF6yXp.js +0 -7
- package/dist/wc/SvTabs-DhRSxzwH.js +0 -2
- package/dist/wc/board-view.svelte-BctMVU40.js +0 -1
- package/dist/wc/board-wkFIFCpH.js +0 -23
- package/dist/wc/chart-panel-messages-CvyfXnB0.js +0 -1
- package/dist/wc/client-BzI-P2yq.js +0 -3
- package/dist/wc/client-DA6JtMaz.js +0 -3
- package/dist/wc/core-SYwyf5FD.js +0 -1
- package/dist/wc/custom-filter-Dp8JxlQu.js +0 -2
- package/dist/wc/date-format-DFerRDR7.js +0 -18
- package/dist/wc/extent-CcmrrtGQ.js +0 -1
- package/dist/wc/gallery-vM0PqrWd.js +0 -11
- package/dist/wc/gantt-BlvgFAt_.js +0 -114
- package/dist/wc/grid-extension.svelte-CVqh736Q.js +0 -1
- package/dist/wc/grid-extension.svelte-DvHfl92l.js +0 -1
- package/dist/wc/palette-BPzVof_y.js +0 -46
- package/dist/wc/row-drag-DD3TudN_.js +0 -1
- package/dist/wc/row-drag-DLQMyiV3.js +0 -1
- package/dist/wc/scheduler-D2ksQuvM.js +0 -153
- package/dist/wc/scheduler-view.svelte-BFCITmR8.js +0 -1
- package/dist/wc/svelte-virtualizer.svelte-DYCT_xZg.js +0 -2
|
@@ -305,6 +305,114 @@ export declare const BASE_MESSAGES: {
|
|
|
305
305
|
readonly 'extras.pickAutomation': "Pick an automation, or add one.";
|
|
306
306
|
readonly 'extras.noName': "(no name)";
|
|
307
307
|
readonly 'extras.noRecordValue': "(no record)";
|
|
308
|
+
readonly 'extras.pageLabel': "Automations of the base";
|
|
309
|
+
readonly 'extras.createAutomation': "+ Create automation";
|
|
310
|
+
readonly 'extras.runHistory': "Run history";
|
|
311
|
+
readonly 'extras.pageEmpty': "No automations yet. An automation does something on its own: when a record is added or changes, a form is sent, a button is pressed or at a time you set.";
|
|
312
|
+
readonly 'extras.pickOne': "Pick an automation on the left, or create one.";
|
|
313
|
+
readonly 'extras.triggerCard': "Trigger";
|
|
314
|
+
readonly 'extras.whenIn': "{when}, in {table}";
|
|
315
|
+
readonly 'extras.conditionCard': "Only for records where";
|
|
316
|
+
readonly 'extras.conditionEvery': "Every record";
|
|
317
|
+
readonly 'extras.conditionCount.one': "{count} condition";
|
|
318
|
+
readonly 'extras.conditionCount.other': "{count} conditions";
|
|
319
|
+
readonly 'extras.addCondition': "+ Add a condition";
|
|
320
|
+
readonly 'extras.actionCard': "Action {n}";
|
|
321
|
+
readonly 'extras.insertAction': "Add an action here";
|
|
322
|
+
readonly 'extras.addActionPage': "+ Add an action";
|
|
323
|
+
readonly 'extras.flowLabel': "What {name} does";
|
|
324
|
+
readonly 'extras.summarySet': "Set {fields}";
|
|
325
|
+
readonly 'extras.summaryNothing': "No fields set yet";
|
|
326
|
+
readonly 'extras.summaryCreate': "A new record in {table}";
|
|
327
|
+
readonly 'extras.summaryEmail': "To {to}";
|
|
328
|
+
readonly 'extras.summaryNoTo': "No address yet";
|
|
329
|
+
readonly 'extras.summaryColor': "While it matches";
|
|
330
|
+
readonly 'extras.tableOfTrigger': "Table";
|
|
331
|
+
readonly 'extras.tableMoveHint': "Its trigger, condition and fields are for this table: a new table starts them again.";
|
|
332
|
+
readonly 'extras.settingsOf': "Settings";
|
|
333
|
+
readonly 'extras.testOn': "Test on";
|
|
334
|
+
readonly 'extras.test': "Test";
|
|
335
|
+
readonly 'extras.testRuns': "Its runs show in the run history.";
|
|
336
|
+
readonly 'extras.allRunsOf': "Runs of {name}";
|
|
337
|
+
readonly 'extras.allRuns': "All runs";
|
|
338
|
+
readonly 'extras.showAllRuns': "Show every automation's runs";
|
|
339
|
+
readonly 'extras.whenWebhook': "When a webhook is received";
|
|
340
|
+
readonly 'extras.triggerWebhook': "A webhook is received";
|
|
341
|
+
readonly 'extras.webhookAddress': "Webhook address";
|
|
342
|
+
readonly 'extras.webhookNoUrl': "This automation listens for the token {token}: give it to your server runner (webhookReceived).";
|
|
343
|
+
readonly 'extras.webhookHint': "Send a POST with a JSON body to this address. Its values are {webhook.name} in the steps ({webhook.order.id} inside objects). Anyone with the address can start the automation: keep it secret.";
|
|
344
|
+
readonly 'extras.newAddress': "Make a new address";
|
|
345
|
+
readonly 'extras.copy': "Copy";
|
|
346
|
+
readonly 'extras.copied': "Copied";
|
|
347
|
+
readonly 'extras.actionChat': "Send a message";
|
|
348
|
+
readonly 'extras.actionRepeat': "Find records";
|
|
349
|
+
readonly 'extras.actionIf': "If";
|
|
350
|
+
readonly 'extras.actionAi': "Ask AI";
|
|
351
|
+
readonly 'extras.actionScript': "Run a script";
|
|
352
|
+
readonly 'extras.doChat': "Send a Slack, Teams or Google Chat message";
|
|
353
|
+
readonly 'extras.doRepeat': "Find records and, for each, do";
|
|
354
|
+
readonly 'extras.doIf': "If a condition holds, do";
|
|
355
|
+
readonly 'extras.doAi': "Ask AI";
|
|
356
|
+
readonly 'extras.doScript': "Run a script";
|
|
357
|
+
readonly 'extras.stepChat': "Message";
|
|
358
|
+
readonly 'extras.stepIf': "If";
|
|
359
|
+
readonly 'extras.stepIfThen': "It matched: the Then steps ran";
|
|
360
|
+
readonly 'extras.stepIfElse': "It did not match: the Otherwise steps ran";
|
|
361
|
+
readonly 'extras.stepFound': "Find records";
|
|
362
|
+
readonly 'extras.foundIn': "{count} in {table}";
|
|
363
|
+
readonly 'extras.stepAi': "AI";
|
|
364
|
+
readonly 'extras.stepScript': "Script";
|
|
365
|
+
readonly 'extras.noAi': "No AI model is set up here.";
|
|
366
|
+
readonly 'extras.aiNoPrompt': "The prompt is empty.";
|
|
367
|
+
readonly 'extras.scriptFailed': "The script failed.";
|
|
368
|
+
readonly 'extras.noField': "No field named {field}.";
|
|
369
|
+
readonly 'extras.noRecordId': "No record {id}.";
|
|
370
|
+
readonly 'extras.stepKind': "{list}, step {n}";
|
|
371
|
+
readonly 'extras.addStep': "+ Add a step";
|
|
372
|
+
readonly 'extras.addStepTo': "Add a step to {list}";
|
|
373
|
+
readonly 'extras.chatApp': "Chat app";
|
|
374
|
+
readonly 'extras.chatUrl': "Webhook address";
|
|
375
|
+
readonly 'extras.chatHintSlack': "In Slack: Apps, Incoming Webhooks, Add to a channel; paste the address it gives here.";
|
|
376
|
+
readonly 'extras.chatHintTeams': "In Teams: the channel's Workflows, \"Post to a channel when a webhook request is received\"; paste the address it gives here.";
|
|
377
|
+
readonly 'extras.chatHintGoogle': "In Google Chat: the space's Apps and integrations, Webhooks, Add webhook; paste the address it gives here.";
|
|
378
|
+
readonly 'extras.actionText': "Send a text message";
|
|
379
|
+
readonly 'extras.doText': "Send a text message (SMS or Viber)";
|
|
380
|
+
readonly 'extras.stepText': "Text message";
|
|
381
|
+
readonly 'extras.textNeedsServer': "Text messages are sent by the server: set Runs in to The server.";
|
|
382
|
+
readonly 'extras.textBy': "Send by";
|
|
383
|
+
readonly 'extras.textSms': "SMS";
|
|
384
|
+
readonly 'extras.textViber': "Viber (SMS if not on Viber)";
|
|
385
|
+
readonly 'extras.textTo': "To";
|
|
386
|
+
readonly 'extras.textToPlaceholder': "+359 88 123 4567, {Phone}";
|
|
387
|
+
readonly 'extras.textMessage': "Message";
|
|
388
|
+
readonly 'extras.textHint': "Phone numbers with their country code, or a phone field in braces; several apart with commas. The text names fields in braces.";
|
|
389
|
+
readonly 'extras.summarySms': "SMS to {to}";
|
|
390
|
+
readonly 'extras.summaryViber': "Viber to {to}";
|
|
391
|
+
readonly 'extras.summaryNoPhone': "No phone yet";
|
|
392
|
+
readonly 'extras.ifHint': "When the record matches this condition the Then steps run, otherwise the Otherwise steps.";
|
|
393
|
+
readonly 'extras.ifAlways': "No condition: Then always runs";
|
|
394
|
+
readonly 'extras.then': "Then";
|
|
395
|
+
readonly 'extras.otherwise': "Otherwise";
|
|
396
|
+
readonly 'extras.findIn': "Find in";
|
|
397
|
+
readonly 'extras.whichRecords': "Records where";
|
|
398
|
+
readonly 'extras.atMost': "At most";
|
|
399
|
+
readonly 'extras.forEach': "For each record found";
|
|
400
|
+
readonly 'extras.repeatHint': "In these steps {Field} is the found record's field, {trigger.Field} the field of the record that set the automation off, and {found} how many were found.";
|
|
401
|
+
readonly 'extras.aiPrompt': "Prompt";
|
|
402
|
+
readonly 'extras.aiPlaceholder': "Write a two-line summary of {{field}} for a weekly report.";
|
|
403
|
+
readonly 'extras.aiInto': "Put the answer in";
|
|
404
|
+
readonly 'extras.aiNowhere': "No field (use {ai} in the next steps)";
|
|
405
|
+
readonly 'extras.aiHint': "Name fields in braces. The answer is {ai} in the next steps.";
|
|
406
|
+
readonly 'extras.scriptCode': "Script";
|
|
407
|
+
readonly 'extras.scriptNeedsBrowser': "A script runs in the browser: set Runs in to The browser.";
|
|
408
|
+
readonly 'extras.scriptHint': "JavaScript, as in Airtable: input.config() has the record's fields by name; base.getTable('Name') reads and changes a table (selectRecordsAsync, updateRecordAsync, createRecordAsync, deleteRecordAsync); output.set('name', value) is {script.name} in the next steps; fetch() calls https addresses that allow it. It runs in a sandbox for up to 30 seconds.";
|
|
409
|
+
readonly 'extras.scriptInPageHint': "It runs in the page of the person who made the change, with what they may do. A run with no one's page behind it (a schedule, a webhook, a change through the API) stops at this step and says so.";
|
|
410
|
+
readonly 'extras.summaryNoText': "Nothing written yet";
|
|
411
|
+
readonly 'extras.stepCount.one': "{count} step";
|
|
412
|
+
readonly 'extras.stepCount.other': "{count} steps";
|
|
413
|
+
readonly 'extras.summaryRepeat': "{steps} for each record in {table}";
|
|
414
|
+
readonly 'extras.summaryIf': "Then {then}; otherwise {otherwise}";
|
|
415
|
+
readonly 'extras.summaryScript': "{lines} lines";
|
|
308
416
|
readonly 'fields.editorTitleEdit': "Edit field";
|
|
309
417
|
readonly 'fields.editorTitleAdd': "Add field";
|
|
310
418
|
readonly 'fields.name': "Name";
|
|
@@ -351,6 +459,20 @@ export declare const BASE_MESSAGES: {
|
|
|
351
459
|
readonly 'fields.optionsSameName': "Two options cannot have the same name: {name}.";
|
|
352
460
|
readonly 'fields.optionNeedsName': "An option in use needs a name: {name}. Name it, or remove it.";
|
|
353
461
|
readonly 'fields.cancel': "Cancel";
|
|
462
|
+
readonly 'fields.templatesOf': "Record templates of {table}";
|
|
463
|
+
readonly 'fields.templatesHint': "A template fills in some fields of a new record. Pick it from the arrow beside + Add row.";
|
|
464
|
+
readonly 'fields.templateNew': "New template";
|
|
465
|
+
readonly 'fields.templateAdd': "+ New template";
|
|
466
|
+
readonly 'fields.templateName': "Template name";
|
|
467
|
+
readonly 'fields.templateHint': "The fields a new record starts with, written as the field shows them: an option's name, a person's name, today or today+7 for a date, a linked record's name.";
|
|
468
|
+
readonly 'fields.templateDone': "Done";
|
|
469
|
+
readonly 'fields.templateFields.one': "{count} field set";
|
|
470
|
+
readonly 'fields.templateFields.other': "{count} fields set";
|
|
471
|
+
readonly 'fields.templateDelete': "Delete the template {name}";
|
|
472
|
+
readonly 'fields.templateDeleteAsk': "Delete \"{name}\"?";
|
|
473
|
+
readonly 'fields.templateDeleteYes': "Delete";
|
|
474
|
+
readonly 'fields.fromTemplate': "Add from a template";
|
|
475
|
+
readonly 'fields.manageTemplates': "Manage templates";
|
|
354
476
|
readonly 'fields.save': "Save";
|
|
355
477
|
readonly 'fields.createField': "Create field";
|
|
356
478
|
readonly 'fields.choose': "Choose...";
|
|
@@ -430,6 +552,8 @@ export declare const BASE_MESSAGES: {
|
|
|
430
552
|
readonly 'fields.typeTimeOfDayDescription': "A time on the clock with no date, typed as 9:30 am, 14:05 or 2pm.";
|
|
431
553
|
readonly 'fields.typeRating': "Rating";
|
|
432
554
|
readonly 'fields.typeRatingDescription': "One to ten stars, hearts, thumbs, flags or dots.";
|
|
555
|
+
readonly 'fields.typeTimer': "Timer";
|
|
556
|
+
readonly 'fields.typeTimerDescription': "Time counted with a start and stop button; each run adds to the total.";
|
|
433
557
|
readonly 'fields.typeVote': "Vote";
|
|
434
558
|
readonly 'fields.typeVoteDescription': "Who voted for it: one click adds your vote or takes it back.";
|
|
435
559
|
readonly 'fields.typeSparkline': "Sparkline";
|
|
@@ -508,6 +632,9 @@ export declare const BASE_MESSAGES: {
|
|
|
508
632
|
readonly 'fields.propTable': "Table";
|
|
509
633
|
readonly 'fields.propTableHint': "The table gets a field that links back to this one.";
|
|
510
634
|
readonly 'fields.propMultipleRecords': "Allow linking to multiple records";
|
|
635
|
+
readonly 'fields.propPickFrom': "Pick records from";
|
|
636
|
+
readonly 'fields.pickFromAll': "All records";
|
|
637
|
+
readonly 'fields.propPickFromHint': "People pick only the records this view of the linked table shows (its filter).";
|
|
511
638
|
readonly 'fields.propAggregation': "Aggregation";
|
|
512
639
|
readonly 'fields.propPrompt': "Prompt";
|
|
513
640
|
readonly 'fields.propPromptPlaceholder': "Write a one-line pitch for {Name}, aimed at {Audience}";
|
|
@@ -657,6 +784,10 @@ export declare const BASE_MESSAGES: {
|
|
|
657
784
|
readonly 'record.formThanks': "Thank you";
|
|
658
785
|
readonly 'record.formAdded': "The record was added.";
|
|
659
786
|
readonly 'record.formSubmitAnother': "Submit another";
|
|
787
|
+
readonly 'record.formNext': "Next";
|
|
788
|
+
readonly 'record.formBack': "Back";
|
|
789
|
+
readonly 'record.formStepOf': "Question {n} of {count}";
|
|
790
|
+
readonly 'record.formPressEnter': "or press Enter";
|
|
660
791
|
readonly 'record.unnamed': "Untitled";
|
|
661
792
|
readonly 'record.linkedGone': "This record is not in its table any more.";
|
|
662
793
|
readonly 'record.openIn': "Open in {table}";
|
|
@@ -664,6 +795,7 @@ export declare const BASE_MESSAGES: {
|
|
|
664
795
|
readonly 'record.linkToRecords': "Link to records";
|
|
665
796
|
readonly 'record.linkTableMissing': "The table this field links to is not available.";
|
|
666
797
|
readonly 'record.searchTable': "Search {table}";
|
|
798
|
+
readonly 'record.pickingFromView': "Records of the view \"{view}\"";
|
|
667
799
|
readonly 'record.noRecordsMatch': "No records match.";
|
|
668
800
|
readonly 'record.createRecord': "Create “{name}”";
|
|
669
801
|
readonly 'record.showingOf': "Showing {shown} of {total}. Type to narrow.";
|
|
@@ -685,6 +817,11 @@ export declare const BASE_MESSAGES: {
|
|
|
685
817
|
readonly 'record.retry': "Retry";
|
|
686
818
|
readonly 'record.remove': "Remove";
|
|
687
819
|
readonly 'record.addFiles': "Add files";
|
|
820
|
+
readonly 'record.takePhoto': "Take a photo";
|
|
821
|
+
readonly 'record.scanCode': "Scan a code";
|
|
822
|
+
readonly 'record.scanHint': "Point the camera at a barcode or a QR code.";
|
|
823
|
+
readonly 'record.scanUnsupported': "This browser cannot read codes from the camera.";
|
|
824
|
+
readonly 'record.scanNoCamera': "The camera is not available: allow it for this site, or close another app using it.";
|
|
688
825
|
readonly 'record.pasteUrl': "or paste a URL";
|
|
689
826
|
readonly 'record.addByUrl': "Add a file by URL";
|
|
690
827
|
readonly 'record.uploadingCount': "Uploading {count}...";
|
|
@@ -765,6 +902,8 @@ export declare const BASE_MESSAGES: {
|
|
|
765
902
|
readonly 'record.noVotes': "No votes yet";
|
|
766
903
|
readonly 'record.votes.one': "{count} vote";
|
|
767
904
|
readonly 'record.votes.other': "{count} votes";
|
|
905
|
+
readonly 'record.timerStart': "Start the timer";
|
|
906
|
+
readonly 'record.timerStop': "Stop the timer";
|
|
768
907
|
readonly 'record.votesMine.one': "{count} vote, including yours";
|
|
769
908
|
readonly 'record.votesMine.other': "{count} votes, including yours";
|
|
770
909
|
readonly 'record.buttonOpen': "Open";
|
|
@@ -805,6 +944,10 @@ export declare const BASE_MESSAGES: {
|
|
|
805
944
|
readonly 'viewbar.calendar.week': "Week";
|
|
806
945
|
readonly 'viewbar.calendar.day': "Day";
|
|
807
946
|
readonly 'viewbar.calendar.agenda': "Agenda";
|
|
947
|
+
readonly 'viewbar.calendar.timelineDay': "Day";
|
|
948
|
+
readonly 'viewbar.calendar.timelineWeek': "Week";
|
|
949
|
+
readonly 'viewbar.calendar.timelineMonth': "Month";
|
|
950
|
+
readonly 'viewbar.calendar.timelineYear': "Year";
|
|
808
951
|
readonly 'viewbar.calendar.today': "Today";
|
|
809
952
|
readonly 'viewbar.calendar.previous': "Previous";
|
|
810
953
|
readonly 'viewbar.calendar.next': "Next";
|
|
@@ -828,7 +971,7 @@ export declare const BASE_MESSAGES: {
|
|
|
828
971
|
readonly 'viewbar.gantt.zoomQuarter': "quarter";
|
|
829
972
|
readonly 'viewbar.gantt.zoomYear': "year";
|
|
830
973
|
readonly 'viewbar.gantt.tableLabel': "Records";
|
|
831
|
-
readonly 'viewbar.gantt.chartLabel': "
|
|
974
|
+
readonly 'viewbar.gantt.chartLabel': "Gantt bars";
|
|
832
975
|
readonly 'viewbar.gantt.resizeTable': "Resize the record table";
|
|
833
976
|
readonly 'viewbar.gantt.days': "Days";
|
|
834
977
|
readonly 'viewbar.gantt.progress': "Progress";
|
|
@@ -915,6 +1058,7 @@ export declare const BASE_MESSAGES: {
|
|
|
915
1058
|
readonly 'viewbar.formMoveUp': "Move {field} up";
|
|
916
1059
|
readonly 'viewbar.formMoveDown': "Move {field} down";
|
|
917
1060
|
readonly 'viewbar.customizeTimeline': "Customize timeline";
|
|
1061
|
+
readonly 'viewbar.customizeGantt': "Customize Gantt";
|
|
918
1062
|
readonly 'viewbar.customizeList': "Customize list";
|
|
919
1063
|
readonly 'viewbar.customizeInbox': "Customize inbox";
|
|
920
1064
|
readonly 'viewbar.rowHeight': "Row height";
|
|
@@ -926,8 +1070,13 @@ export declare const BASE_MESSAGES: {
|
|
|
926
1070
|
readonly 'viewbar.records.other': "{count} records";
|
|
927
1071
|
readonly 'viewbar.findRecord': "Find a record";
|
|
928
1072
|
readonly 'viewbar.search': "Search";
|
|
1073
|
+
readonly 'viewbar.scanToFind': "Scan a code to find its record";
|
|
929
1074
|
readonly 'viewbar.searchShortcut': "Search (Ctrl+F)";
|
|
930
1075
|
readonly 'viewbar.myViews': "My views";
|
|
1076
|
+
readonly 'viewbar.section': "Section";
|
|
1077
|
+
readonly 'viewbar.moveToSection': "Move {name} to a section";
|
|
1078
|
+
readonly 'viewbar.sectionOf': "Section of {name}";
|
|
1079
|
+
readonly 'viewbar.sectionPlaceholder': "A section, or empty for none";
|
|
931
1080
|
readonly 'viewbar.newView': "New {type} view";
|
|
932
1081
|
readonly 'viewbar.name': "Name";
|
|
933
1082
|
readonly 'viewbar.stackBy': "Stack records by";
|
|
@@ -968,13 +1117,33 @@ export declare const BASE_MESSAGES: {
|
|
|
968
1117
|
readonly 'viewbar.typeGrid': "Grid";
|
|
969
1118
|
readonly 'viewbar.typeKanban': "Kanban";
|
|
970
1119
|
readonly 'viewbar.typeCalendar': "Calendar";
|
|
971
|
-
readonly 'viewbar.
|
|
1120
|
+
readonly 'viewbar.typeTimeline': "Timeline";
|
|
1121
|
+
readonly 'viewbar.typeGantt': "Gantt";
|
|
972
1122
|
readonly 'viewbar.deleteViewAsk': "Delete {name}?";
|
|
973
1123
|
readonly 'viewbar.typeGallery': "Gallery";
|
|
974
1124
|
readonly 'viewbar.typeChart': "Chart";
|
|
975
1125
|
readonly 'viewbar.typeForm': "Form";
|
|
976
1126
|
readonly 'viewbar.typeList': "List";
|
|
977
1127
|
readonly 'viewbar.typeInbox': "Inbox";
|
|
1128
|
+
readonly 'viewbar.typeTree': "Tree";
|
|
1129
|
+
readonly 'viewbar.typePivot': "Pivot";
|
|
1130
|
+
readonly 'viewbar.parent': "Parent";
|
|
1131
|
+
readonly 'viewbar.treeNeedsParent': "A tree needs a link to this table that names each record's parent.";
|
|
1132
|
+
readonly 'viewbar.treeNeedsAll': "A tree needs every record at once, and this table is read a part at a time.";
|
|
1133
|
+
readonly 'viewbar.pivotRows': "Rows";
|
|
1134
|
+
readonly 'viewbar.pivotCols': "Columns";
|
|
1135
|
+
readonly 'viewbar.pivotValues': "Values";
|
|
1136
|
+
readonly 'viewbar.pivotAddRow': "Add a field";
|
|
1137
|
+
readonly 'viewbar.pivotNoCols': "None";
|
|
1138
|
+
readonly 'viewbar.pivotCount': "Count of records";
|
|
1139
|
+
readonly 'viewbar.pivotSum': "Sum of {field}";
|
|
1140
|
+
readonly 'viewbar.pivotAvg': "Average of {field}";
|
|
1141
|
+
readonly 'viewbar.pivotMin': "Smallest {field}";
|
|
1142
|
+
readonly 'viewbar.pivotMax': "Largest {field}";
|
|
1143
|
+
readonly 'viewbar.pivotRemove': "Remove {field}";
|
|
1144
|
+
readonly 'viewbar.pivotEmpty': "No records to add up.";
|
|
1145
|
+
readonly 'viewbar.pivotLoaded': "Adds up the {count} records loaded in the page; the table has {total}.";
|
|
1146
|
+
readonly 'viewbar.pivotTotal': "Total";
|
|
978
1147
|
readonly 'viewbar.typeDashboard': "Dashboard";
|
|
979
1148
|
readonly 'viewbar.sortFirstLast': "first → last";
|
|
980
1149
|
readonly 'viewbar.sortLastFirst': "last → first";
|
|
@@ -1011,6 +1180,7 @@ export declare const BASE_MESSAGES: {
|
|
|
1011
1180
|
readonly 'viewbar.primaryAlwaysShown': "The primary field is always shown";
|
|
1012
1181
|
readonly 'viewbar.hideAll': "Hide all";
|
|
1013
1182
|
readonly 'viewbar.showAll': "Show all";
|
|
1183
|
+
readonly 'viewbar.editFieldNamed': "Edit the field {name}";
|
|
1014
1184
|
readonly 'viewbar.colorRows': "Color rows";
|
|
1015
1185
|
readonly 'viewbar.selectField': "Select field";
|
|
1016
1186
|
readonly 'viewbar.conditions': "Conditions";
|
|
@@ -1024,6 +1194,8 @@ export declare const BASE_MESSAGES: {
|
|
|
1024
1194
|
readonly 'viewbar.sum': "Sum";
|
|
1025
1195
|
readonly 'viewbar.average': "Average";
|
|
1026
1196
|
readonly 'viewbar.timeline': "Timeline";
|
|
1197
|
+
readonly 'viewbar.gantt': "Gantt";
|
|
1198
|
+
readonly 'viewbar.laneBy': "Lanes by";
|
|
1027
1199
|
readonly 'viewbar.noneMilestone': "None (a milestone)";
|
|
1028
1200
|
readonly 'viewbar.ganttHint': "Arrows between records come from a link field to this same table.";
|
|
1029
1201
|
readonly 'viewbar.under': "Under {field}";
|
|
@@ -1684,6 +1856,11 @@ export declare const BASE_MESSAGES: {
|
|
|
1684
1856
|
readonly 'shell.menuComment': "Comment";
|
|
1685
1857
|
readonly 'shell.menuInsertAbove': "Insert record above";
|
|
1686
1858
|
readonly 'shell.menuInsertBelow': "Insert record below";
|
|
1859
|
+
readonly 'shell.menuAddSubtask': "Add subtask";
|
|
1860
|
+
readonly 'shell.subtasks': "Subtasks";
|
|
1861
|
+
readonly 'shell.treeNoLoop': "A record cannot go under itself or one of its own subtasks.";
|
|
1862
|
+
readonly 'shell.treeMovedUnder': "{name} is now under {parent}";
|
|
1863
|
+
readonly 'shell.treeMovedTop': "{name} is now at the top level";
|
|
1687
1864
|
readonly 'shell.menuDuplicate': "Duplicate record";
|
|
1688
1865
|
readonly 'shell.addField': "Add a field";
|
|
1689
1866
|
readonly 'shell.addRow': "Add row";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{popoverSheets as e,SHEET_MAX_WIDTH as n}from"@svgrid/grid";export function phoneSheet(){return e()==="phone"&&typeof window<"u"&&window.innerWidth>0&&window.innerWidth<=n}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actions an app adds to a record: in its right-click menu (a grid row, a
|
|
3
|
+
* card) and at the top of the record view. "Print", "Open in the CRM",
|
|
4
|
+
* "Send as e-mail". The app decides per table which there are.
|
|
5
|
+
*
|
|
6
|
+
* setRecordActions((tableId) => [{ id: 'print', label: 'Print', run: ({ rowId }) => window.open(`/print/${tableId}/${rowId}`) }])
|
|
7
|
+
*/
|
|
8
|
+
export type RecordActionContext = {
|
|
9
|
+
tableId: string | undefined;
|
|
10
|
+
rowId: string;
|
|
11
|
+
row: Record<string, unknown>;
|
|
12
|
+
};
|
|
13
|
+
export type RecordAction = {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
/** An SVG path on a 16 by 16 box, for the menu and the record view. */
|
|
17
|
+
icon?: string;
|
|
18
|
+
run: (ctx: RecordActionContext) => void;
|
|
19
|
+
};
|
|
20
|
+
/** The app's actions on records, per table, or `null` for none. */
|
|
21
|
+
export declare function setRecordActions(fn: ((tableId: string | undefined) => RecordAction[]) | null): void;
|
|
22
|
+
/** A table's record actions; a provider that throws gives none. */
|
|
23
|
+
export declare function recordActionsFor(tableId: string | undefined): RecordAction[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let t=null;export function setRecordActions(r){t=r}export function recordActionsFor(r){if(!t)return[];try{return t(r)??[]}catch{return[]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{openRecord as R}from"./editor-request.svelte.js";import{newRowValues as
|
|
1
|
+
import{openRecord as R}from"./editor-request.svelte.js";import{newRowValues as z,recordCopyValues as A}from"./field-ops.js";import{askDeleteRecord as V}from"./record-delete.svelte.js";import{revealRow as F}from"./grid-access.js";import{canCommentIn as T,canCreateIn as E,canDeleteIn as H}from"./base-permissions.js";import{recordActionsFor as j}from"./record-actions.js";import{addInTree as B,canAddInTree as q}from"./tree-edit.js";import{bm as s}from"./messages.svelte.js";const d={expand:{paths:[{d:"M9.5 2.5h4v4M13.5 2.5 9 7M6.5 13.5h-4v-4M2.5 13.5 7 9"}]},above:{paths:[{d:"M2.5 9.5h11v4h-11zM8 2.5v5M5.5 5 8 2.5 10.5 5"}]},below:{paths:[{d:"M2.5 2.5h11v4h-11zM8 8.5v5M5.5 11 8 13.5 10.5 11"}]},subtask:{paths:[{d:"M2.5 2.5h11v4h-11zM5 6.5v5h3M9 11.5h4.5M11.25 9.25v4.5"}]},duplicate:{paths:[{d:"M5.5 5.5h8v8h-8zM10.5 5.5v-3h-8v8h3M9.5 8v3M8 9.5h3"}]},copy:{paths:[{d:"M5.5 5.5h8v8h-8zM10.5 5.5v-3h-8v8h3"}]},paste:{paths:[{d:"M5.5 3h-2v10.5h9V3h-2M6 2h4v2.5H6zM6 8h4M6 10.5h4"}]},comment:{paths:[{d:"M2.5 3.5h11v7.5H8l-3 2.5V11H2.5z"}]},select:{paths:[{d:"M2.5 2.5h11v11h-11zM5 8l2.2 2.2L11 6"}]},delete:{paths:[{d:"M2.5 4.5h11M6 4.5v-2h4v2M4 4.5l.7 9h6.6l.7-9M6.8 7v4.5M9.2 7v4.5"}]}},C=i=>Array.isArray(i)?[...i]:i;export function cardRecordMenu(i,k){const o=recordMenu(i,k);return(M,p)=>{const m={rowIndex:-1,colIndex:-1,columnId:"",rowId:p,row:M,card:!0},r=[];for(const c of o)if(c==="separator")r.length&&!r[r.length-1].separator&&r.push({separator:!0});else if(typeof c=="object"&&c.action&&!c.hidden?.(m)){const y=c.action;r.push({label:c.label,onSelect:()=>y(m)})}return r[r.length-1]?.separator&&r.pop(),r}}export function recordMenu(i,k){const o=()=>k(),M=()=>!!o()?.editingEnabled,p=e=>{const t=e.row?.__group;return!e.row||!!t&&t.kind!=="leaf"},m=e=>p(e)||!M()||!E(o()),r=e=>p(e)||!M()||!H(o()),c=e=>!!o()?.isRowSelected?.(e.rowId,e.row),y=e=>o()?.toggleRowSelectionById?.(e.rowId,e.row);function S(e,t,v,g){const n=o(),w=i();if(!n||!w||!e.row)return;if((n.props.rowModel||n.props.baseFeed)&&typeof n.props.baseServerAdd=="function"){const{__group:f,...I}=t;return n.props.baseServerAdd(I,g)}const u=n.props.rowAdder,a=u&&typeof u=="object"&&typeof u.defaults=="function"?u.defaults():{},l=z(n,{...a,...t}),h=e.row.id,b=n.internalData.findIndex(f=>f===e.row||h!=null&&f?.id===h);w.addRow(l,b<0?"bottom":b+v),n.props.onRowAdd?.({row:l}),queueMicrotask(()=>{const f=n.allRows.findIndex(I=>I.original===l);if(!(f<0)){if(e.card){g&&R({ctrl:n,rowId:n.allRows[f].id,editPrimary:!0});return}if(F(n,w,f),g){for(const I of n.allColumns)if(w.startEditing(f,I.id))break}}})}function x(e){const t=o(),v={},g=t?.grid?.getState?.()??{},n=g.grouping??[],w=(g.sorting??[]).map(a=>a.id).filter(a=>!n.includes(a));for(const a of[...n,...w]){const l=t.internalColumns.find(b=>String(b.id??b.field)===a);if(!l?.field||l.fieldFn)continue;const h=t.allColumns?.find(b=>b.id===a)?.columnDef;w.includes(a)&&(l.editable===!1||h?.editable===!1)||typeof h?.groupValue=="function"&&!h.groupCopies||(v[l.field]=C(h?.groupCopies?h.groupValue(e.row[l.field]):e.row[l.field]))}const u=t?.props?.treeData?.parentField;return u&&e.row&&(v[u]=C(e.row[u]??[])),v}function D(e){const t=o();t&&e.row&&S(e,A(t,e.row),1,!1)}const _=j(o()?.props?.baseTableId).map(e=>({key:"app_"+e.id,label:e.label,...e.icon?{icon:{paths:[{d:e.icon}]}}:{},hidden:p,action:t=>e.run({tableId:o()?.props?.baseTableId,rowId:String(t.row?.id??t.rowId??""),row:t.row??{}})}));return[{key:"expand",get label(){return s("shell.menuExpand")},icon:d.expand,hidden:p,action:e=>R({ctrl:o(),rowId:e.rowId})},{key:"comment",get label(){return s("shell.menuComment")},icon:d.comment,hidden:e=>p(e)||!T(o()),action:e=>R({ctrl:o(),rowId:e.rowId,focus:"comment"})},{key:"select",get label(){return s("shell.menuSelect")},icon:d.select,hidden:e=>r(e)||c(e),action:y},{key:"deselect",get label(){return s("shell.menuDeselect")},icon:d.select,hidden:e=>p(e)||!c(e),action:y},..._,"separator",{key:"record_above",get label(){return s("shell.menuInsertAbove")},icon:d.above,hidden:m,action:e=>S(e,x(e),0,!0)},{key:"record_below",get label(){return s("shell.menuInsertBelow")},icon:d.below,hidden:m,action:e=>S(e,x(e),1,!0)},{key:"subtask",get label(){return s("shell.menuAddSubtask")},icon:d.subtask,hidden:e=>m(e)||!q(o()),action:e=>B(o(),i(),String(e.row?.[o()?.props?.treeData?.idField??"id"]??e.rowId??""))},{key:"duplicate",get label(){return s("shell.menuDuplicate")},icon:d.duplicate,hidden:m,action:D},"separator",{key:"copy",icon:d.copy},{key:"paste",icon:d.paste,hidden:()=>!M()},"separator",{key:"delete_record",get label(){return s("shell.deleteRecord")},icon:d.delete,hidden:r,action:e=>V({ctrl:o(),api:i(),row:e.row})}]}
|
|
@@ -31,8 +31,12 @@ export declare function createRecordStore(options: {
|
|
|
31
31
|
get(id: string): Row | undefined;
|
|
32
32
|
/** The records with these ids, read now if they are not held. */
|
|
33
33
|
read(ids: ReadonlyArray<string>): Promise<Row[]>;
|
|
34
|
-
/**
|
|
35
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Records by what they say: the same search a view's box runs; with
|
|
36
|
+
* `expression`, only those a view's filter keeps (a source that cannot
|
|
37
|
+
* apply it answers without `appliedExpression`).
|
|
38
|
+
*/
|
|
39
|
+
search(text: string, start: number, end: number, expression?: unknown): Promise<ServerResult<Row>>;
|
|
36
40
|
/** The id of a record already read, by its name. */
|
|
37
41
|
idByName: (name: string) => string | undefined;
|
|
38
42
|
/** The id of the record called `name`, asking the server. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{noGroups,reportRead}from"./view-feed.svelte.js";const CHUNK=200;const KEEP=2e4;const NAMED=20;const emptyRequest=over=>({startRow:0,endRow:1,pageIndex:0,pageSize:1,sortModel:[],filterModel:{},...over});const inList=values=>({operator:"in",value:"",selectedValues:values});const keyOfGroup=v=>String(Array.isArray(v)?v[0]??"":v??"");export function createRecordStore(options){let version=$state(0);const known=new Map;const wanted=new Set;const names=new Map;const totals=new Map;const totalsWanted=new Map;const named=new Map;const namedWanted=new Set;const whole=new Map;const wholeWanted=new Set;const shownTotals=new Map;const shownNamed=new Map;let queued=false;let flushing=Promise.resolve();let generation=0;function queue(){if(queued)return;queued=true;queueMicrotask(()=>{queued=false;flushing=flushing.then(flush,flush)})}function take(rows){for(const r of rows){const id=options.idOf(r);known.delete(id);known.set(id,r);const name=options.nameOf?.(r);if(name)names.set(name.trim().toLowerCase(),id)}for(const id of known.keys()){if(known.size<=KEEP)break;known.delete(id)}}async function readIds(list){const src=options.source();if(!src)return;for(let at=0;at<list.length;at+=CHUNK){const part=list.slice(at,at+CHUNK);const res=await src.getRows(emptyRequest({endRow:part.length,pageSize:part.length,filterModel:{columns:{id:inList(part)}}}));take(res.rows);for(const id of part)if(!known.has(id))known.set(id,null)}}async function flush(){const src=options.source();if(!src)return;const ids=[...wanted];wanted.clear();const groups=[...totalsWanted];totalsWanted.clear();const lists=[...namedWanted];namedWanted.clear();const everything=[...wholeWanted];wholeWanted.clear();const asked=generation;await Promise.all([ids.length?readIds(ids):null,...groups.map(async([key,set])=>{const[field,col,fn]=key.split("|");const list=[...set];for(let at=0;at<list.length;at+=CHUNK){const part=list.slice(at,at+CHUNK);const answer=new Map(part.map(id=>[id,col?null:0]));try{const res=await src.getRows(emptyRequest({endRow:part.length,pageSize:part.length,groupBy:[field],groupRawKeys:true,...col?{aggregations:[{col,fn}]}:{},filterModel:{columns:{[field]:inList(part)}}}));for(const r of res.rows)answer.set(keyOfGroup(r[field]),col?r[col]??null:Number(r.childCount??0))}catch(e){if(col||!noGroups(e))reportRead(e);else{await Promise.all(part.map(async id=>{const one=await src.getRows(emptyRequest({filterModel:{columns:{[field]:inList([id])}}}));answer.set(id,one.rowCount)}))}}if(asked!==generation)continue;const into=totals.get(key)??new Map;totals.set(key,into);for(const[id,v]of answer)into.set(id,v)}}),...lists.map(async key=>{const at=key.indexOf("|");const field=key.slice(0,at);const id=key.slice(at+1);const res=await src.getRows(emptyRequest({endRow:NAMED,pageSize:NAMED,filterModel:{columns:{[field]:inList([id])}}}));take(res.rows);if(asked===generation)named.set(key,[...res.rows])}),...everything.map(async key=>{const at=key.indexOf("|");const filter={columns:{[key.slice(0,at)]:inList([key.slice(at+1)])}};const rows=[];for(;;){const res=await src.getRows(emptyRequest({startRow:rows.length,endRow:rows.length+2e3,pageSize:2e3,filterModel:filter}));rows.push(...res.rows);if(!res.rows.length||res.rowCount>=0&&rows.length>=res.rowCount)break}if(asked===generation)whole.set(key,rows)})]);version+=1}return{get version(){return version},stores:field=>options.storedLinks?.().has(field)??false,get(id){void version;if(known.has(id))return known.get(id)??void 0;wanted.add(id);queue();return void 0},async read(ids){const missing=ids.filter(id=>!known.has(id));if(missing.length){await readIds(missing);version+=1}return ids.map(id=>known.get(id)).filter(r=>!!r)},async search(text,start,end){const src=options.source();if(!src)return{rows:[],rowCount:0};const res=await src.getRows(emptyRequest({startRow:start,endRow:end,pageSize:end-start,filterModel
|
|
1
|
+
import{noGroups,reportRead}from"./view-feed.svelte.js";const CHUNK=200;const KEEP=2e4;const NAMED=20;const emptyRequest=over=>({startRow:0,endRow:1,pageIndex:0,pageSize:1,sortModel:[],filterModel:{},...over});const inList=values=>({operator:"in",value:"",selectedValues:values});const keyOfGroup=v=>String(Array.isArray(v)?v[0]??"":v??"");export function createRecordStore(options){let version=$state(0);const known=new Map;const wanted=new Set;const names=new Map;const totals=new Map;const totalsWanted=new Map;const named=new Map;const namedWanted=new Set;const whole=new Map;const wholeWanted=new Set;const shownTotals=new Map;const shownNamed=new Map;let queued=false;let flushing=Promise.resolve();let generation=0;function queue(){if(queued)return;queued=true;queueMicrotask(()=>{queued=false;flushing=flushing.then(flush,flush)})}function take(rows){for(const r of rows){const id=options.idOf(r);known.delete(id);known.set(id,r);const name=options.nameOf?.(r);if(name)names.set(name.trim().toLowerCase(),id)}for(const id of known.keys()){if(known.size<=KEEP)break;known.delete(id)}}async function readIds(list){const src=options.source();if(!src)return;for(let at=0;at<list.length;at+=CHUNK){const part=list.slice(at,at+CHUNK);const res=await src.getRows(emptyRequest({endRow:part.length,pageSize:part.length,filterModel:{columns:{id:inList(part)}}}));take(res.rows);for(const id of part)if(!known.has(id))known.set(id,null)}}async function flush(){const src=options.source();if(!src)return;const ids=[...wanted];wanted.clear();const groups=[...totalsWanted];totalsWanted.clear();const lists=[...namedWanted];namedWanted.clear();const everything=[...wholeWanted];wholeWanted.clear();const asked=generation;await Promise.all([ids.length?readIds(ids):null,...groups.map(async([key,set])=>{const[field,col,fn]=key.split("|");const list=[...set];for(let at=0;at<list.length;at+=CHUNK){const part=list.slice(at,at+CHUNK);const answer=new Map(part.map(id=>[id,col?null:0]));try{const res=await src.getRows(emptyRequest({endRow:part.length,pageSize:part.length,groupBy:[field],groupRawKeys:true,...col?{aggregations:[{col,fn}]}:{},filterModel:{columns:{[field]:inList(part)}}}));for(const r of res.rows)answer.set(keyOfGroup(r[field]),col?r[col]??null:Number(r.childCount??0))}catch(e){if(col||!noGroups(e))reportRead(e);else{await Promise.all(part.map(async id=>{const one=await src.getRows(emptyRequest({filterModel:{columns:{[field]:inList([id])}}}));answer.set(id,one.rowCount)}))}}if(asked!==generation)continue;const into=totals.get(key)??new Map;totals.set(key,into);for(const[id,v]of answer)into.set(id,v)}}),...lists.map(async key=>{const at=key.indexOf("|");const field=key.slice(0,at);const id=key.slice(at+1);const res=await src.getRows(emptyRequest({endRow:NAMED,pageSize:NAMED,filterModel:{columns:{[field]:inList([id])}}}));take(res.rows);if(asked===generation)named.set(key,[...res.rows])}),...everything.map(async key=>{const at=key.indexOf("|");const filter={columns:{[key.slice(0,at)]:inList([key.slice(at+1)])}};const rows=[];for(;;){const res=await src.getRows(emptyRequest({startRow:rows.length,endRow:rows.length+2e3,pageSize:2e3,filterModel:filter}));rows.push(...res.rows);if(!res.rows.length||res.rowCount>=0&&rows.length>=res.rowCount)break}if(asked===generation)whole.set(key,rows)})]);version+=1}return{get version(){return version},stores:field=>options.storedLinks?.().has(field)??false,get(id){void version;if(known.has(id))return known.get(id)??void 0;wanted.add(id);queue();return void 0},async read(ids){const missing=ids.filter(id=>!known.has(id));if(missing.length){await readIds(missing);version+=1}return ids.map(id=>known.get(id)).filter(r=>!!r)},async search(text,start,end,expression){const src=options.source();if(!src)return{rows:[],rowCount:0};const filterModel={...text?{global:text}:{},...expression?{expression}:{}};const res=await src.getRows(emptyRequest({startRow:start,endRow:end,pageSize:end-start,filterModel}));take(res.rows);return res},idByName:name=>names.get(name.trim().toLowerCase()),async findByName(name){const low=name.trim().toLowerCase();if(names.has(low))return names.get(low);await this.search(name.trim(),0,20);return names.get(low)},total(field,id,col="",fn=""){void version;const key=`${field}|${col}|${fn}`;const held=totals.get(key);if(held?.has(id))return held.get(id);const set=totalsWanted.get(key)??new Set;set.add(id);totalsWanted.set(key,set);queue();return shownTotals.get(key)?.get(id)},linkedTo(field,id){void version;const key=`${field}|${id}`;const held=named.get(key);if(held)return held;namedWanted.add(key);queue();return shownNamed.get(key)??[]},allLinkedTo(field,id){void version;const key=`${field}|${id}`;const held=whole.get(key);if(held)return held;wholeWanted.add(key);queue();return named.get(key)??shownNamed.get(key)??[]},source:()=>options.source(),async idle(){await Promise.resolve();for(;;){const now=flushing;await now;await Promise.resolve();if(now===flushing&&!queued)return}},put(row){take([row]);version+=1},patch(id,fields){const was=known.get(id);if(was)known.set(id,{...was,...fields});touched(fields,was??void 0);version+=1},written(fields,was){if(fields)touched(fields,was);else forgetTotals();version+=1},forget(id){known.delete(id);forgetTotals();version+=1},clear(){known.clear();names.clear();forgetTotals();version+=1}};function touched(fields,was){const after={...was,...fields};const linkIds=(row,field)=>{const v=row?.[field];return(Array.isArray(v)?v:v==null||v===""?[]:[v]).map(String)};let hit=false;const forget=(key,map,id)=>{if(!map.has(id))return;const shown=shownTotals.get(key)??new Map;shown.set(id,map.get(id));shownTotals.set(key,shown);map.delete(id);hit=true};for(const[key,map]of totals){const[field,col]=key.split("|");if(field in fields)for(const id of[...linkIds(was,field),...linkIds(after,field)])forget(key,map,id);else if(col&&col in fields)for(const id of linkIds(after,field))forget(key,map,id)}for(const field of Object.keys(fields)){for(const id of[...linkIds(was,field),...linkIds(after,field)]){const key=`${field}|${id}`;whole.delete(key);const list=named.get(key);if(!list)continue;shownNamed.set(key,list);named.delete(key);hit=true}}if(hit)generation+=1}function forgetTotals(){generation+=1;whole.clear();for(const[key,map]of totals)shownTotals.set(key,new Map([...shownTotals.get(key)??[],...map]));for(const[key,list]of named)shownNamed.set(key,list);totals.clear();named.clear()}}
|
|
@@ -69,6 +69,14 @@ export type LinkedTable = {
|
|
|
69
69
|
* linked record view then offers "Open in {name}".
|
|
70
70
|
*/
|
|
71
71
|
open?: (rowId: string) => void;
|
|
72
|
+
/** Its saved views: a link field can let people pick only the records one of them shows (`pickFrom`). */
|
|
73
|
+
views?: () => ReadonlyArray<{
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
type?: string;
|
|
77
|
+
personal?: string;
|
|
78
|
+
state?: Record<string, unknown>;
|
|
79
|
+
}>;
|
|
72
80
|
};
|
|
73
81
|
/** A linked table's fields as filled columns (formatter, cell), for showing one of its records. */
|
|
74
82
|
export type LinkedField = {
|
package/dist/fields/summaries.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toDate as v}from"./format.js";import{liveLink as M}from"./sources.svelte.js";import{maxOf as h,minOf as b}from"../extent.js";const T=[{value:"empty",label:"Empty"},{value:"filled",label:"Filled"},{value:"unique",label:"Unique"},{value:"percentEmpty",label:"Percent empty"},{value:"percentFilled",label:"Percent filled"}],S=[{value:"sum",label:"Sum"},{value:"avg",label:"Average"},{value:"median",label:"Median"},{value:"min",label:"Min"},{value:"max",label:"Max"},{value:"range",label:"Range"}],x=[{value:"checked",label:"Checked"},{value:"unchecked",label:"Unchecked"},{value:"percentChecked",label:"Percent checked"}],k=[{value:"earliest",label:"Earliest date"},{value:"latest",label:"Latest date"},{value:"dateRange",label:"Date range (days)"}];function
|
|
1
|
+
import{toDate as v}from"./format.js";import{liveLink as M}from"./sources.svelte.js";import{timerSeconds as N}from"./timer.js";import{maxOf as h,minOf as b}from"../extent.js";const T=[{value:"empty",label:"Empty"},{value:"filled",label:"Filled"},{value:"unique",label:"Unique"},{value:"percentEmpty",label:"Percent empty"},{value:"percentFilled",label:"Percent filled"}],S=[{value:"sum",label:"Sum"},{value:"avg",label:"Average"},{value:"median",label:"Median"},{value:"min",label:"Min"},{value:"max",label:"Max"},{value:"range",label:"Range"}],x=[{value:"checked",label:"Checked"},{value:"unchecked",label:"Unchecked"},{value:"percentChecked",label:"Percent checked"}],k=[{value:"earliest",label:"Earliest date"},{value:"latest",label:"Latest date"},{value:"dateRange",label:"Date range (days)"}];function C(e){if(e.fieldType==="checkbox"||e.cellDataType==="boolean")return"checkbox";const n=e.fieldType==="formula"?e.fieldProps?.result:void 0;return n==="number"||n==="currency"||n==="percent"?"number":n==="date"?"date":e.cellDataType==="number"||e.fieldType==="currency"||e.fieldType==="percent"?"number":e.cellDataType==="date"||e.cellDataType==="dateString"||["createdTime","lastModifiedTime"].includes(e.fieldType)?"date":"other"}export function summaryChoices(e){const n=C(e);return[{value:"none",label:"None"},...n==="number"?S:n==="checkbox"?x:n==="date"?k:[],...T]}export const summaryLabel=e=>[...S,...x,...k,...T].find(n=>n.value===e)?.label??"";const m=e=>e==null||e===""||Array.isArray(e)&&e.length===0,y=(e,n)=>n?`${Math.round(e/n*100)}%`:"0%";export function makeSummary(e,n){if(e==="none")return!1;const c=a=>typeof n.fieldFn=="function"?n.fieldFn(a):n.field!=null?a?.[n.field]:void 0,p=a=>n.fieldType==="link"?M(n.fieldProps?.table,c(a)):n.fieldType==="timer"?N(c(a)):c(a),u=a=>{const f=n.formatter;return String(f?f({value:a})??"":a)};return(a,f)=>{const l=f.map(p),d=l.length;switch(e){case"empty":return String(l.filter(m).length);case"filled":return String(l.filter(t=>!m(t)).length);case"percentEmpty":return y(l.filter(m).length,d);case"percentFilled":return y(l.filter(t=>!m(t)).length,d);case"unique":return String(new Set(l.filter(t=>!m(t)).map(t=>JSON.stringify(t))).size);case"checked":return String(l.filter(t=>t===!0).length);case"unchecked":return String(l.filter(t=>t!==!0).length);case"percentChecked":return y(l.filter(t=>t===!0).length,d);case"earliest":case"latest":case"dateRange":{const t=l.map(r=>v(r)?.getTime()).filter(r=>r!=null&&Number.isFinite(r));if(!t.length)return"";const s=b(t),i=h(t);if(e==="dateRange")return`${Math.round((i-s)/864e5)} days`;const o=l[l.findIndex(r=>v(r)?.getTime()===(e==="earliest"?s:i))];return u(o)}default:{const t=l.map(r=>typeof r=="number"?r:r===""||r==null?NaN:Number(r)).filter(r=>Number.isFinite(r));if(!t.length)return"";const s=t.reduce((r,g)=>r+g,0);if(e==="sum")return u(s);if(e==="avg")return u(s/t.length);if(e==="min")return u(b(t));if(e==="max")return u(h(t));if(e==="range")return u(h(t)-b(t));const i=[...t].sort((r,g)=>r-g),o=i.length>>1;return u(i.length%2?i[o]:(i[o-1]+i[o])/2)}}}}export function withSummary(e,n){if(e.summary!==void 0)return e;const c=n.summary??"none",p=summaryChoices(e).some(u=>u.value===c);return{...e,summary:p?makeSummary(c,e):!1}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let now=$state(Date.now());let users=0;let tick=null;export function clockNow(){return now}export function holdClock(){users+=1;if(users===1){now=Date.now();tick=setInterval(()=>now=Date.now(),1e3)}let held=true;return()=>{if(!held)return;held=false;users-=1;if(users===0&&tick){clearInterval(tick);tick=null}}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A timer field's value. Stopped, it is a plain number of seconds, as a
|
|
3
|
+
* duration field holds, so sums, pivots, charts, filters, formulas and exports
|
|
4
|
+
* read it as they read a duration. While it runs it is `{ total, since }`: the
|
|
5
|
+
* seconds of the runs before this one and when this one started (an ISO time),
|
|
6
|
+
* so a reload, another device or the server all see the same running timer.
|
|
7
|
+
* Starting and stopping go through the grid's own edit commit, so undo, the
|
|
8
|
+
* record history and protected fields behave as for any edit.
|
|
9
|
+
*/
|
|
10
|
+
export type TimerRunning = {
|
|
11
|
+
total: number;
|
|
12
|
+
since: string;
|
|
13
|
+
};
|
|
14
|
+
export type TimerValue = number | TimerRunning | null;
|
|
15
|
+
/** The running part of a timer value, or null when it is stopped. */
|
|
16
|
+
export declare function timerRunning(v: unknown): TimerRunning | null;
|
|
17
|
+
/** The seconds of the runs already ended (the whole value when stopped), or null when it never ran. */
|
|
18
|
+
export declare function timerTotal(v: unknown): number | null;
|
|
19
|
+
/** Every second the timer counted, the run going on now included, as of `now` (ms). */
|
|
20
|
+
export declare function timerSeconds(v: unknown, now?: number): number | null;
|
|
21
|
+
/** Start a stopped timer, or stop a running one (its run added to the total). */
|
|
22
|
+
export declare function timerToggle(v: unknown, now?: number): number | TimerRunning;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function i(t){if(typeof t=="string"&&t.trim().startsWith("{"))try{return JSON.parse(t)}catch{return t}return t}export function timerRunning(t){const n=i(t);if(!n||typeof n!="object"||Array.isArray(n)||typeof n.since!="string"||!Number.isFinite(Date.parse(n.since)))return null;const r=Number(n.total??0);return{total:Number.isFinite(r)&&r>0?r:0,since:n.since}}export function timerTotal(t){const n=timerRunning(t);if(n)return n.total;const r=i(t);if(r==null||r==="")return null;const e=typeof r=="number"?r:Number(r);return Number.isFinite(e)?e:null}export function timerSeconds(t,n=Date.now()){const r=timerRunning(t);return r?r.total+Math.max(0,Math.floor((n-Date.parse(r.since))/1e3)):timerTotal(t)}export function timerToggle(t,n=Date.now()){return timerRunning(t)?timerSeconds(t,n)??0:{total:timerTotal(t)??0,since:new Date(n).toISOString()}}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
type Row = Record<string, unknown>;
|
|
2
|
+
type Tree = {
|
|
3
|
+
parentField: string;
|
|
4
|
+
idField?: string;
|
|
5
|
+
column?: string;
|
|
6
|
+
};
|
|
7
|
+
/** The record a row's Parent names: a link holds one id in a list; several, or none, is no parent. */
|
|
8
|
+
export declare function parentIdOf(tree: Tree, row: Row | undefined): string | null;
|
|
9
|
+
/** Whether this person may move records in the tree: the grid is editable and so is the Parent field. */
|
|
10
|
+
export declare function canMoveInTree(ctrl: any): boolean;
|
|
11
|
+
/** Whether this person may add a record to the tree. */
|
|
12
|
+
export declare const canAddInTree: (ctrl: any) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* A new record in the tree: under `parent` (a record id, or null for the top),
|
|
15
|
+
* placed right after `after` (a sibling) or last. It opens for its name.
|
|
16
|
+
*/
|
|
17
|
+
export declare function addInTree(ctrl: any, api: any, parent: string | null, after?: Row): void;
|
|
18
|
+
/**
|
|
19
|
+
* Put `row` under `parent` (a record id, or null for the top). Refused, with
|
|
20
|
+
* a notice, when `parent` is the record itself or one of its own subtasks.
|
|
21
|
+
*/
|
|
22
|
+
export declare function moveInTree(ctrl: any, api: any, row: Row, parent: string | null): boolean;
|
|
23
|
+
/** Alt+Shift+Right: the record goes under the one above it at its level. */
|
|
24
|
+
export declare function indentInTree(ctrl: any, api: any, rowIndex: number): boolean;
|
|
25
|
+
/** Alt+Shift+Left: the record moves up a level, beside its parent. */
|
|
26
|
+
export declare function outdentInTree(ctrl: any, api: any, rowIndex: number): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* A row dropped in a tree view (the grid's `onRowDrop`): on the middle of a
|
|
29
|
+
* row it goes under it; between two rows, beside them; below the last row,
|
|
30
|
+
* at the top level.
|
|
31
|
+
*/
|
|
32
|
+
export declare function dropInTree(ctrl: any, api: any, e: {
|
|
33
|
+
row: unknown;
|
|
34
|
+
target: unknown;
|
|
35
|
+
side: 'before' | 'after' | 'into';
|
|
36
|
+
}): void;
|
|
37
|
+
/** The tree's keys, in the grid's shortcut chain. */
|
|
38
|
+
export declare function treeGridKey(e: KeyboardEvent, cmd: {
|
|
39
|
+
api: any;
|
|
40
|
+
editing: boolean;
|
|
41
|
+
editor?: HTMLInputElement | HTMLTextAreaElement | null;
|
|
42
|
+
activeCell: {
|
|
43
|
+
rowIndex: number;
|
|
44
|
+
columnId: string | null;
|
|
45
|
+
} | null;
|
|
46
|
+
}): boolean;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{announce as b,toast as C}from"@svgrid/grid";import{fieldColumns as A,gridOf as E,revealRow as S,writeCell as k}from"./grid-access.js";import{newRowValues as K}from"./field-ops.js";import{canCreateIn as T}from"./base-permissions.js";import{canEditField as D}from"./field-access.svelte.js";import{fieldPropsOf as F,originalColumn as R}from"./registry.svelte.js";import{bm as w}from"./messages.svelte.js";import{forgetRowSteps as O,forgetStep as M}from"./base-history.js";const p=e=>e?.props?.treeData?.parentField?e.props.treeData:null,y=e=>e==null||e===""?null:String(e),c=(e,i)=>y(i?.[e.idField??"id"]);export function parentIdOf(e,i){const n=i?.[e.parentField];return Array.isArray(n)?n.length===1?y(n[0]):null:y(n)}const x=(e,i)=>A(e).find(n=>String(n.field)===i.parentField);export function canMoveInTree(e){const i=p(e),n=i?x(e,i):void 0;return!!n&&!!e?.editingEnabled&&n.def.editable!==!1&&D(R(n.def),F(R(n.def)))}export const canAddInTree=e=>!!p(e)&&!!e?.editingEnabled&&T(e)&&canMoveInTree(e);const v=new WeakSet;function h(e,i,n,o){if(o==null)return;const t=e.allRows.find(l=>c(n,l.original)===o);t&&i.setRowExpanded?.(t.id,!0)}export function addInTree(e,i,n,o){const t=p(e);if(!t||!i||!canAddInTree(e))return;const l=n==null?[]:[n];if((e.props.rowModel||e.props.baseFeed)&&typeof e.props.baseServerAdd=="function"){e.props.baseServerAdd({[t.parentField]:l},!0);return}const s=e.props.rowAdder,a=s&&typeof s=="object"&&typeof s.defaults=="function"?s.defaults():{},d=K(e,{...a,[t.parentField]:l}),m=e.internalData,u=o?m.findIndex(r=>r===o||o.id!=null&&r?.id===o.id):-1;i.addRow(d,u<0?"bottom":u+1),e.props.onRowAdd?.({row:d}),h(e,i,t,n),v.add(d),queueMicrotask(()=>{const r=e.allRows.findIndex(g=>g.original===d);if(r<0)return;S(e,i,r);const f=t.column?[t.column]:[];for(const g of[...f,...e.allColumns.map(I=>I.id)])if(i.startEditing(r,g))break})}export function moveInTree(e,i,n,o){const t=p(e),l=t?x(e,t):void 0;if(!t||!l||!canMoveInTree(e))return!1;const s=c(t,n);if(s==null||parentIdOf(t,n)===o)return!1;const a=new Map;for(const r of e.internalData){const f=c(t,r);f!=null&&a.set(f,r)}const d=new Set;for(let r=o;r!=null&&!d.has(r);r=parentIdOf(t,a.get(r)))if(d.add(r),r===s)return C(w("shell.treeNoLoop")),!1;const m=e.allRows.find(r=>r.original===n||c(t,r.original)===s);if(!m)return!1;const u=k(e,m.id,l.id,o==null?[]:[o]);if(u){h(e,i,t,o);const r=g=>String((t.column&&g?g[t.column]:"")??"").trim(),f=o==null?null:a.get(o);b(f?w("shell.treeMovedUnder",{name:r(n),parent:r(f)}):w("shell.treeMovedTop",{name:r(n)}))}return u}export function indentInTree(e,i,n){const o=p(e),t=e?.allRows??[],l=t[n];if(!o||!l)return!1;const s=l.depth??0;for(let a=n-1;a>=0;a-=1){const d=t[a].depth??0;if(d<s)return!1;if(d===s)return moveInTree(e,i,l.original,c(o,t[a].original))}return!1}export function outdentInTree(e,i,n){const o=p(e),t=(e?.allRows??[])[n];if(!o||!t)return!1;const l=parentIdOf(o,t.original);if(l==null)return!1;const s=e.internalData.find(a=>c(o,a)===l);return moveInTree(e,i,t.original,parentIdOf(o,s))}export function dropInTree(e,i,n){const o=p(e);if(!o||n.row===n.target)return;const t=n.target,l=t==null?null:n.side==="into"?c(o,t):parentIdOf(o,t);moveInTree(e,i,n.row,l)}export function treeGridKey(e,i){const n=i.api,o=E(n),t=p(o);if(!t||!i.activeCell)return!1;const l=i.activeCell.rowIndex;if(!i.editing&&e.altKey&&e.shiftKey&&!e.ctrlKey&&!e.metaKey&&(e.key==="ArrowRight"||e.key==="ArrowLeft")){e.preventDefault();const s=o.scrollContainer?.closest?.('[dir="rtl"]')!=null,a=e.key==="ArrowRight"!==s,d=(o.allRows??[])[l]?.original;if((a?indentInTree(o,n,l):outdentInTree(o,n,l))&&d){const u=o.allRows.findIndex(f=>f.original===d),r=o.allColumns.findIndex(f=>f.id===i.activeCell.columnId);u>=0&&r>=0&&(o.setActiveCell?.(u,r),o.setSelection?.(u,r))}return!0}if(i.editing&&(e.key==="Enter"||e.key==="Escape")&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey){const s=(o.allRows??[])[l];return!s||!v.has(s.original)||t.column&&i.activeCell.columnId!==t.column?!1:(e.preventDefault(),v.delete(s.original),String(i.editor?.value??"").trim()?e.key==="Escape"?!1:(o.saveEditingCell?.(),addInTree(o,n,parentIdOf(t,s.original),s.original),!0):(o.stopEditing?.(!0),L(o,n,s),!0))}return!1}function L(e,i,n){const t=e.internalData.indexOf(n.original);t<0||(e.props?.baseTableId&&O(e,n.id),i.removeRows([t]),M(e,w("shell.stepAddRecord")),e.props?.baseRowsChanged?.())}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actions an app adds to each saved view in the views menu, beside rename
|
|
3
|
+
* and duplicate: "Subscribe in your calendar app" for a calendar view, "Copy
|
|
4
|
+
* a link", "Export". Anyone who sees the view gets them; the app decides
|
|
5
|
+
* which views have which.
|
|
6
|
+
*
|
|
7
|
+
* setViewActions((view, tableId) => view.type === 'calendar'
|
|
8
|
+
* ? [{ id: 'feed', label: 'Subscribe in your calendar app', run: () => openFeed(tableId, view.id) }]
|
|
9
|
+
* : [])
|
|
10
|
+
*/
|
|
11
|
+
import type { FieldView } from './view-model.js';
|
|
12
|
+
export type ViewAction = {
|
|
13
|
+
id: string;
|
|
14
|
+
/** Its tooltip and, with the view's name, what a screen reader says. */
|
|
15
|
+
label: string;
|
|
16
|
+
/** An SVG path on a 24 by 24 box; a dot when none. */
|
|
17
|
+
icon?: string;
|
|
18
|
+
run: (view: FieldView, tableId: string | undefined) => void;
|
|
19
|
+
};
|
|
20
|
+
/** The app's actions for a view, or `null` for none. */
|
|
21
|
+
export declare function setViewActions(fn: ((view: FieldView, tableId: string | undefined) => ViewAction[]) | null): void;
|
|
22
|
+
/** A view's actions; a provider that throws gives none. */
|
|
23
|
+
export declare function viewActionsFor(view: FieldView, tableId: string | undefined): ViewAction[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let r=null;export function setViewActions(t){r=t}export function viewActionsFor(t,e){if(!r)return[];try{return r(t,e)??[]}catch{return[]}}
|