@svgrid/enterprise 3.1.58 → 3.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/cdn/svgrid-enterprise.svelte-external.js +1 -1
  2. package/dist/designer/assets/{index-DoEhPIfX.js → index-BC3lgv-R.js} +1 -1
  3. package/dist/designer/index.html +1 -1
  4. package/dist/fields/FieldEditor.svelte +30 -6
  5. package/dist/fields/PeopleRulePicker.svelte +34 -0
  6. package/dist/fields/PeopleRulePicker.svelte.d.ts +16 -0
  7. package/dist/fields/PropertyInput.svelte +12 -1
  8. package/dist/fields/RecordView.svelte +26 -8
  9. package/dist/fields/SelectEditor.svelte +1 -1
  10. package/dist/fields/activity.svelte.d.ts +34 -0
  11. package/dist/fields/activity.svelte.js +1 -1
  12. package/dist/fields/base-permissions.d.ts +13 -0
  13. package/dist/fields/base-permissions.js +1 -1
  14. package/dist/fields/base-sync.js +1 -1
  15. package/dist/fields/builtin-types.js +1 -1
  16. package/dist/fields/button-host.d.ts +2 -0
  17. package/dist/fields/button-host.js +1 -1
  18. package/dist/fields/field-access.svelte.d.ts +38 -8
  19. package/dist/fields/field-access.svelte.js +1 -1
  20. package/dist/fields/index.d.ts +4 -3
  21. package/dist/fields/index.js +1 -1
  22. package/dist/fields/messages/fields.d.ts +21 -0
  23. package/dist/fields/messages/fields.js +1 -1
  24. package/dist/fields/messages/record.d.ts +7 -0
  25. package/dist/fields/messages/record.js +1 -1
  26. package/dist/fields/messages.svelte.d.ts +28 -0
  27. package/dist/fields/people-rule.d.ts +35 -0
  28. package/dist/fields/people-rule.js +1 -0
  29. package/dist/fields/record-delete.svelte.js +1 -1
  30. package/dist/fields/record-menu.js +1 -1
  31. package/dist/fields/registry.svelte.d.ts +11 -0
  32. package/dist/fields/registry.svelte.js +1 -1
  33. package/dist/fields/view-model.js +1 -1
  34. package/dist/node/studio.js +1 -1
  35. package/dist/version.d.ts +2 -2
  36. package/dist/version.js +1 -1
  37. package/dist/wc/sv-base-element.js +97 -97
  38. package/package.json +3 -3
@@ -1 +1 @@
1
- export const FIELDS_MESSAGES={"fields.editorTitleEdit":"Edit field","fields.editorTitleAdd":"Add field","fields.name":"Name","fields.namePlaceholder":"Field name","fields.fallbackName":"Field","fields.nameRequired":"A field needs a name","fields.needLinkField":"Pick the link field this reads.","fields.needLinkFieldFirst":"This table has no link field yet: add one first.","fields.needLinkedField":"Pick the field to read from the linked table.","fields.needPrompt":"Write what the field should work out.","fields.nameTaken":"Another field has this name","fields.fixFormulaFirst":"Fix the formula first: {message}","fields.fixPromptFirst":"Fix the prompt first: {message}","fields.fieldType":"Field type","fields.keyFixed":"This field is the record key the database gives each record. Its type and values cannot change; its name and description can.","fields.findType":"Find a type","fields.findTypeLabel":"Find a field type","fields.noTypeMatches":'No type matches "{search}".',"fields.groupBasic":"Fields","fields.groupNumber":"Numbers and time","fields.groupDate":"Dates","fields.groupPeople":"People","fields.groupComputed":"Computed and automatic","fields.groupRelation":"Other tables","fields.whoCanEdit":"Who can edit its values","fields.whoEveryone":"Everyone who can edit the base","fields.whoOnly":"Only these people","fields.peopleWhoCanEdit":"People who can edit","fields.nameYou":"{name} (you)","fields.nobodyCanChange":"Nobody will be able to change its values.","fields.youCannotChange":"You will not be able to change its values yourself.","fields.othersReadOnly":"Others see the field read-only. Its name, type and options stay editable.","fields.description":"Description","fields.optional":"optional","fields.descriptionPlaceholder":"What goes in this field","fields.convertsValues":"{from} to {to} converts the values.","fields.everyValueConverts":"Every value converts.","fields.cellsCleared.one":"{count} cell will be cleared or cut short.","fields.cellsCleared.other":"{count} cells will be cleared or cut short.","fields.optionRemoved.one":"{count} record holds {name}. Saving clears it from that record.","fields.optionRemoved.other":"{count} records hold {name}. Saving clears it from those records.","fields.optionRenamed.one":"Renames {name} on {count} record.","fields.optionRenamed.other":"Renames {name} on {count} records.","fields.optionsSameName":"Two options cannot have the same name: {name}.","fields.optionNeedsName":"An option in use needs a name: {name}. Name it, or remove it.","fields.cancel":"Cancel","fields.templatesOf":"Record templates of {table}","fields.templatesHint":"A template fills in some fields of a new record. Pick it from the arrow beside + Add row.","fields.templateNew":"New template","fields.templateAdd":"+ New template","fields.templateName":"Template name","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.","fields.templateDone":"Done","fields.templateFields.one":"{count} field set","fields.templateFields.other":"{count} fields set","fields.templateDelete":"Delete the template {name}","fields.templateDeleteAsk":'Delete "{name}"?',"fields.templateDeleteYes":"Delete","fields.fromTemplate":"Add from a template","fields.manageTemplates":"Manage templates","fields.save":"Save","fields.createField":"Create field","fields.choose":"Choose...","fields.checked":"Checked","fields.defaultNone":"None","fields.addOptionsFirst":"Add options first.","fields.nobody":"Nobody","fields.empty":"Empty","fields.formulaPlaceholder":'IF({Budget} > 2000, "Large", "Small")',"fields.insertField":"Insert a field","fields.functions":"Functions","fields.hideFunctions":"Hide functions","fields.formulaAskPlaceholder":'Describe it, such as "total with 20% VAT"',"fields.formulaAskLabel":"Describe the formula in your own words","fields.formulaAskButton":"Write it","fields.formulaAskWorking":"Writing…","fields.formulaAiFailed":"The AI could not write a formula that works. Try describing it another way.","fields.formulaSuggestions":"Suggestions","fields.formulaFieldHint":"Field","fields.formulaPreview":"Result:","fields.formulaUnnamed":"Unnamed record","fields.formulaEmpty":"(empty)","fields.formulaTrue":"true","fields.formulaFalse":"false","fields.formulaTips":"Tips","fields.formulaHideTips":"Hide tips","fields.formulaTip1":"Start with a field: click its name below, or type { and pick it from the list.","fields.formulaTip2":"Do math as in a spreadsheet, with field names instead of cells:","fields.formulaTip3":"Put text in quotes, and join pieces with &:","fields.formulaTip4":"Choose between two answers with IF:","fields.formulaTip5":"No = at the start, and commas between the parts of a function. The result for your first records shows as you type.","fields.formulaTip6":"Not sure how? Describe what you want in the box at the top, and AI writes the formula for you.","fields.formulaFindFunction":"Find a function","fields.formulaNoFunction":"No function matches","fields.formulaGroup.logic":"Logic","fields.formulaGroup.text":"Text","fields.formulaGroup.numbers":"Numbers","fields.formulaGroup.dates":"Dates","fields.formulaGroup.lists":"Lists","fields.formulaGroup.records":"Records","fields.optionsList":"Options","fields.colorOf":"Color of {name}","fields.colorOfOption":"Color of option {n}","fields.optionName":"Option name","fields.optionN":"Option {n}","fields.moveUp":"Move up","fields.moveDown":"Move down","fields.removeNamed":"Remove {name}","fields.removeOption":"Remove option","fields.addOption":"+ Add option","fields.sortAZ":"Sort A to Z","fields.menuColorRows":"Color rows by this field","fields.menuStopColoring":"Stop coloring rows","fields.menuFilter":"Filter by this field","fields.menuGroup":"Group by this field","fields.menuEdit":"Edit field","fields.menuInsertLeft":"Insert left","fields.menuInsertRight":"Insert right","fields.menuMoveLeft":"Move left","fields.menuMoveRight":"Move right","fields.menuDuplicate":"Duplicate field","fields.menuHide":"Hide field","fields.menuDelete":"Delete field","fields.typeText":"Single line text","fields.typeTextDescription":"A short line of text, like a name or a title.","fields.typeLongText":"Long text","fields.typeLongTextDescription":"Several lines of text; Alt+Enter starts a new line.","fields.typeRichText":"Rich text","fields.typeRichTextDescription":"Formatted notes: bold, italic, lists and links from a toolbar.","fields.typeAttachment":"Attachment","fields.typeAttachmentDescription":"Images and files: thumbnails in the cell, a dialog to add more.","fields.typeCheckbox":"Checkbox","fields.typeCheckboxDescription":"Done or not done: one click to toggle.","fields.typeSingleSelect":"Single select","fields.typeSingleSelectDescription":"One choice from a list of colored options.","fields.typeMultiSelect":"Multiple select","fields.typeMultiSelectDescription":"Any number of choices from a list of colored options.","fields.typeUser":"User","fields.typeUserDescription":"A person (or several) from the people the app lists.","fields.typeDate":"Date","fields.typeDateDescription":"A calendar date, with or without the time.","fields.typePhone":"Phone number","fields.typePhoneDescription":"A phone number, shown as a tel link.","fields.typeEmail":"Email","fields.typeEmailDescription":"An email address, shown as a mailto link.","fields.typeUrl":"URL","fields.typeUrlDescription":"A web address, shown as a link.","fields.typeBarcode":"Barcode","fields.typeBarcodeDescription":"A barcode's text, from a scanner or typed.","fields.typeButton":"Button","fields.typeButtonDescription":"A button in every row: open a link, change the record, print it, copy text or run an automation.","fields.typeChecklist":"Checklist","fields.typeChecklistDescription":"A list of to-dos; the cell shows how many are done.","fields.typeColor":"Color","fields.typeColorDescription":"A color from the palette, or any hex code.","fields.typeNumber":"Number","fields.typeNumberDescription":"A number: whole, decimal, an amount of money or a percentage.","fields.typeCurrency":"Currency","fields.typeCurrencyDescription":"An amount, with a currency symbol.","fields.typePercent":"Percent","fields.typePercentDescription":"A share, shown with a percent sign.","fields.typeDuration":"Duration","fields.typeDurationDescription":"A length of time, typed as 1:30 or 1h 30m.","fields.typeTimeOfDay":"Time of day","fields.typeTimeOfDayDescription":"A time on the clock with no date, typed as 9:30 am, 14:05 or 2pm.","fields.typeRating":"Rating","fields.typeRatingDescription":"One to ten stars, hearts, thumbs, flags or dots.","fields.typeTimer":"Timer","fields.typeTimerDescription":"Time counted with a start and stop button; each run adds to the total.","fields.typeVote":"Vote","fields.typeVoteDescription":"Who voted for it: one click adds your vote or takes it back.","fields.typeSparkline":"Sparkline","fields.typeSparklineDescription":"A list of numbers drawn as a small line, area or column chart.","fields.typeFormula":"Formula","fields.typeFormulaDescription":"A value computed from the row's other fields.","fields.typeCreatedTime":"Created time","fields.typeCreatedTimeDescription":"When the row was added. Set automatically.","fields.typeLastModifiedTime":"Last modified time","fields.typeLastModifiedTimeDescription":"When the row last changed. Set automatically.","fields.typeCreatedBy":"Created by","fields.typeCreatedByDescription":"Who added the row. Set automatically.","fields.typeLastModifiedBy":"Last modified by","fields.typeLastModifiedByDescription":"Who last changed the row. Set automatically.","fields.typeAutoNumber":"Autonumber","fields.typeAutoNumberDescription":"A number every row gets, counting up. Set automatically.","fields.typeLink":"Link to records","fields.typeLinkDescription":"Rows of another table this row points at.","fields.typeLookup":"Lookup","fields.typeLookupDescription":"A field of the linked rows, shown here.","fields.typeRollup":"Rollup","fields.typeRollupDescription":"A summary of a field over the linked rows (a sum, a count, a list).","fields.typeCount":"Count","fields.typeCountDescription":"How many rows a link field points at.","fields.typeAi":"AI","fields.typeAiDescription":"A model writes the value from a prompt that names the record's fields. Stored, and editable by hand.","fields.propSeparators":"Separators","fields.propShowThousands":"Show thousands separator","fields.propAbbreviation":"Large number abbreviation","fields.propAllowNegative":"Allow negative numbers","fields.propDefault":"Default value","fields.propDefaultHint":"New rows start with this value.","fields.propDateFormat":"Date format","fields.propIncludeTime":"Include time","fields.propTimeFormat":"Time format","fields.propGmt":"Use the same time zone (GMT) for everyone","fields.propShowTimeZone":"Display time zone","fields.propLinkField":"Link field","fields.propLinkFieldHint":"A link-to-records field of this table.","fields.propLinkedField":"Field in the linked table","fields.propWatch":"Changes to","fields.propWatchFields":"Fields","fields.propMarkdown":"Format with Markdown","fields.propMarkdownHint":"**bold**, *italic*, `code`, [links](https://...) and lists. For a toolbar, use Rich text.","fields.propToolbar":"Toolbar","fields.propToolbarHint":"Full adds headings, quotes, code blocks, undo and redo.","fields.propAccept":"Accepted types","fields.propAcceptPlaceholder":"image/*,.pdf (any when empty)","fields.propMaxFiles":"Most files per cell","fields.propIcon":"Icon","fields.propColor":"Color","fields.propOptions":"Options","fields.propMultipleUsers":"Allow adding multiple users","fields.propDefaultToday":"Default to today","fields.propButtonLabel":"Label","fields.propButtonLabelPlaceholder":"Open","fields.propButtonStyle":"Style","fields.propButtonUrl":"URL","fields.propButtonUrlPlaceholder":"https://example.com/orders/{Order id}","fields.propButtonUrlHint":'Use {Field name} for a value of the record, or write a formula: "mailto:" & {Email}, or {Website} for the link a field holds. mailto:, tel: and sms: links open the e-mail, phone or messages app.',"fields.propButtonAction":"When pressed","fields.buttonActionLink":"Open a link","fields.buttonActionAutomation":"Run automations","fields.buttonActionUpdate":"Change this record","fields.buttonActionTemplate":"Fill in from a record template","fields.buttonActionRecordAction":"Print or another record action","fields.buttonActionCopy":"Copy text","fields.buttonActionDuplicate":"Duplicate the record","fields.buttonActionDelete":"Delete the record","fields.buttonActionOpen":"Open the record","fields.propButtonValues":"Set these fields","fields.propButtonValuesHint":"Write a value as you would type it. A date can be today or today+7, a person can be me (whoever presses).","fields.buttonValuesInBase":"Pick the fields once the button is in a table of a base.","fields.propButtonTemplate":"Record template","fields.propButtonTemplateHint":"Fills only the fields that are empty. Make one from the arrow beside + Add row, then Manage templates.","fields.propButtonRecordAction":"Action","fields.propButtonCopy":"Text to copy","fields.propButtonCopyPlaceholder":"Order {Order id} for {Customer}","fields.propButtonCopyHint":"Use {Field name} for a value of the record. Start with = to write a formula.","fields.propButtonDoneLabel":"Label once done","fields.propButtonDoneLabelPlaceholder":"Done","fields.propButtonDoneLabelHint":"When the record already has these values, the button shows a check and this label, and cannot be pressed again.","fields.propButtonWhen":"Can be pressed when","fields.propButtonWhenHint":"On other records the button is greyed out.","fields.buttonWhenAlways":"On every record","fields.propButtonAsk":"Ask before it runs","fields.propButtonAskText":"Question","fields.buttonAskDefault":"Are you sure?","fields.buttonNotNow":"This record does not meet the button's condition.","fields.buttonReadOnly":"You can view this base but not change it.","fields.buttonNoAutomation":"No automation starts when this button is pressed yet. Add one on the Automations page.","fields.buttonNoLink":"This record has no link to open.","fields.buttonNoText":"This record has no text to copy.","fields.buttonNoValues":"Pick the fields this button sets.","fields.buttonNoTemplate":"Pick the record template this button uses.","fields.buttonNoRecordAction":"This action is not available here.","fields.buttonSomeRefused":"Some fields were not changed: you may not edit them.","fields.buttonCopied":"Copied.","fields.buttonCopyFailed":"Could not copy. Try again.","fields.propFormat":"Format","fields.propCurrencySymbol":"Currency symbol","fields.propSymbolPosition":"Symbol position","fields.propPrecision":"Precision","fields.propStep":"Spinner step","fields.propStepHint":"What the editor's arrows and Up / Down add or take away; Shift for ten times as much.","fields.propShowBar":"Show as a progress bar","fields.propPoints":"Values are 0 to 100 (not 0 to 1)","fields.propDurationFormat":"Duration format","fields.propShowSeconds":"Show seconds","fields.propMaximum":"Maximum","fields.propChart":"Chart","fields.propShowLast":"Show the last value","fields.propFormula":"Formula","fields.propResult":"Format the result as","fields.propTable":"Table","fields.propTableHint":"The table gets a field that links back to this one.","fields.propMultipleRecords":"Allow linking to multiple records","fields.propPickFrom":"Pick records from","fields.pickFromAll":"All records","fields.propPickFromHint":"People pick only the records this view of the linked table shows (its filter).","fields.propAggregation":"Aggregation","fields.propPrompt":"Prompt","fields.propPromptPlaceholder":"Write a one-line pitch for {Name}, aimed at {Audience}","fields.propPromptHint":"Use {Field name} for that field's value in the record.","fields.propOutput":"The model writes","fields.propAuto":"Generate again when a field the prompt names changes","fields.propAutoHint":"Off: only when someone presses the button or uses the column menu.","fields.choiceLocal":"Local","fields.choiceNone":"None","fields.choiceThousand":"Thousand (K)","fields.choiceMillion":"Million (M)","fields.choiceBillion":"Billion (B)","fields.choiceFriendly":"Friendly (October 14, 2026)","fields.choiceUs":"US (10/14/2026)","fields.choiceEuropean":"European (14/10/2026)","fields.choiceIso":"ISO (2026-10-14)","fields.choice12Hour":"12 hour","fields.choice24Hour":"24 hour","fields.choiceAllFields":"All fields","fields.choiceSpecificFields":"Specific fields","fields.choiceStandard":"Standard","fields.choiceFull":"Full","fields.choiceInteger":"Integer","fields.choiceDecimal":"Decimal","fields.choiceCurrency":"Currency","fields.choicePercent":"Percent","fields.choiceBefore":"Before ($1.00)","fields.choiceAfter":"After (1.00 kr)","fields.choiceArrow":"Arrow","fields.choiceThumb":"Thumb","fields.choiceHeart":"Heart","fields.choiceLine":"Line","fields.choiceArea":"Area","fields.choiceColumns":"Columns","fields.choiceAsComputed":"As computed","fields.choiceNumber":"Number","fields.choiceDate":"Date","fields.choiceText":"Text","fields.choiceOneOption":"One option","fields.choiceANumber":"A number","fields.notJson":"{field} holds JSON, and this text is not valid JSON. Check its brackets and quotes.","fields.negativeNotAllowed":"Negative numbers are not allowed","fields.aiStop":"Stop generating ({count} left)","fields.aiGenerateEmpty.one":"Generate for {count} empty record","fields.aiGenerateEmpty.other":"Generate for {count} empty records","fields.aiAllTitle.one":"Generate for {count} record?","fields.aiAllTitle.other":"Generate for all {count} records?","fields.aiAllBody.one":"This replaces the value 1 record holds, and sends the AI provider a request for each of {records}. One Undo takes the replaced values back.","fields.aiAllBody.other":"This replaces the values {count} records hold, and sends the AI provider a request for each of {records}. One Undo takes the replaced values back.","fields.aiAllRecords.one":"{count} record","fields.aiAllRecords.other":"{count} records","fields.aiAllYes":"Generate","fields.aiGenerateAll.one":"Generate for all {count} record","fields.aiGenerateAll.other":"Generate for all {count} records","fields.aiNoProvider":"No AI provider. The app sets one with setAIProvider() from @svgrid/grid.","fields.aiNotEditable":"You cannot edit this field, so nothing was written.","fields.aiNotShown":"The record is not in the grid (filtered out or deleted).","fields.aiNotAiField":"The field is no longer an AI field.","fields.aiNoPrompt":"The field has no prompt yet: write one in Edit field.","fields.aiRequestFailed":"The request failed","fields.aiNotNumber":'The model answered "{answer}", which is not a number',"fields.aiNotOption":'The model answered "{answer}", which is not one of the options',"fields.promptNotClosed":"The { at {at} is not closed","fields.promptEmptyRef":"Empty {} at {at}: put a field name in it","fields.promptInvalid":"The prompt is not valid","fields.promptOwnField":"A prompt cannot read its own field {{name}}","fields.promptNoField":"No field is named {{name}}"};
1
+ export const FIELDS_MESSAGES={"fields.editorTitleEdit":"Edit field","fields.editorTitleAdd":"Add field","fields.name":"Name","fields.namePlaceholder":"Field name","fields.fallbackName":"Field","fields.nameRequired":"A field needs a name","fields.needLinkField":"Pick the link field this reads.","fields.needLinkFieldFirst":"This table has no link field yet: add one first.","fields.needLinkedField":"Pick the field to read from the linked table.","fields.needPrompt":"Write what the field should work out.","fields.nameTaken":"Another field has this name","fields.fixFormulaFirst":"Fix the formula first: {message}","fields.fixPromptFirst":"Fix the prompt first: {message}","fields.fieldType":"Field type","fields.keyFixed":"This field is the record key the database gives each record. Its type and values cannot change; its name and description can.","fields.findType":"Find a type","fields.findTypeLabel":"Find a field type","fields.noTypeMatches":'No type matches "{search}".',"fields.groupBasic":"Fields","fields.groupNumber":"Numbers and time","fields.groupDate":"Dates","fields.groupPeople":"People","fields.groupComputed":"Computed and automatic","fields.groupRelation":"Other tables","fields.whoCanEdit":"Who can edit its values","fields.whoEveryone":"Everyone who can edit the base","fields.whoOnly":"Only these people","fields.peopleWhoCanEdit":"People who can edit","fields.nameYou":"{name} (you)","fields.nobodyCanChange":"Nobody will be able to change its values.","fields.youCannotChange":"You will not be able to change its values yourself.","fields.othersReadOnly":"Others see the field read-only. Its name, type and options stay editable.","fields.whoeverInLabel":"And whoever the record names in","fields.whoeverIn":"Whoever is in {field}","fields.onlySomeChoices":"Only for some choices","fields.heldChoices":"Choices only they can pick","fields.pickHeldChoices":"Tick the choices only they can pick.","fields.nobodyCanPick":"Nobody will be able to pick these choices.","fields.youCannotPick":"You will not be able to pick these choices yourself.","fields.othersPickRest":"Everyone else picks the other choices, and cannot change a record that has one of these.","fields.description":"Description","fields.optional":"optional","fields.descriptionPlaceholder":"What goes in this field","fields.convertsValues":"{from} to {to} converts the values.","fields.everyValueConverts":"Every value converts.","fields.cellsCleared.one":"{count} cell will be cleared or cut short.","fields.cellsCleared.other":"{count} cells will be cleared or cut short.","fields.optionRemoved.one":"{count} record holds {name}. Saving clears it from that record.","fields.optionRemoved.other":"{count} records hold {name}. Saving clears it from those records.","fields.optionRenamed.one":"Renames {name} on {count} record.","fields.optionRenamed.other":"Renames {name} on {count} records.","fields.optionsSameName":"Two options cannot have the same name: {name}.","fields.optionNeedsName":"An option in use needs a name: {name}. Name it, or remove it.","fields.cancel":"Cancel","fields.templatesOf":"Record templates of {table}","fields.templatesHint":"A template fills in some fields of a new record. Pick it from the arrow beside + Add row.","fields.templateNew":"New template","fields.templateAdd":"+ New template","fields.templateName":"Template name","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.","fields.templateDone":"Done","fields.templateFields.one":"{count} field set","fields.templateFields.other":"{count} fields set","fields.templateDelete":"Delete the template {name}","fields.templateDeleteAsk":'Delete "{name}"?',"fields.templateDeleteYes":"Delete","fields.fromTemplate":"Add from a template","fields.manageTemplates":"Manage templates","fields.save":"Save","fields.createField":"Create field","fields.choose":"Choose...","fields.checked":"Checked","fields.defaultNone":"None","fields.addOptionsFirst":"Add options first.","fields.nobody":"Nobody","fields.empty":"Empty","fields.formulaPlaceholder":'IF({Budget} > 2000, "Large", "Small")',"fields.insertField":"Insert a field","fields.functions":"Functions","fields.hideFunctions":"Hide functions","fields.formulaAskPlaceholder":'Describe it, such as "total with 20% VAT"',"fields.formulaAskLabel":"Describe the formula in your own words","fields.formulaAskButton":"Write it","fields.formulaAskWorking":"Writing…","fields.formulaAiFailed":"The AI could not write a formula that works. Try describing it another way.","fields.formulaSuggestions":"Suggestions","fields.formulaFieldHint":"Field","fields.formulaPreview":"Result:","fields.formulaUnnamed":"Unnamed record","fields.formulaEmpty":"(empty)","fields.formulaTrue":"true","fields.formulaFalse":"false","fields.formulaTips":"Tips","fields.formulaHideTips":"Hide tips","fields.formulaTip1":"Start with a field: click its name below, or type { and pick it from the list.","fields.formulaTip2":"Do math as in a spreadsheet, with field names instead of cells:","fields.formulaTip3":"Put text in quotes, and join pieces with &:","fields.formulaTip4":"Choose between two answers with IF:","fields.formulaTip5":"No = at the start, and commas between the parts of a function. The result for your first records shows as you type.","fields.formulaTip6":"Not sure how? Describe what you want in the box at the top, and AI writes the formula for you.","fields.formulaFindFunction":"Find a function","fields.formulaNoFunction":"No function matches","fields.formulaGroup.logic":"Logic","fields.formulaGroup.text":"Text","fields.formulaGroup.numbers":"Numbers","fields.formulaGroup.dates":"Dates","fields.formulaGroup.lists":"Lists","fields.formulaGroup.records":"Records","fields.optionsList":"Options","fields.colorOf":"Color of {name}","fields.colorOfOption":"Color of option {n}","fields.optionName":"Option name","fields.optionN":"Option {n}","fields.moveUp":"Move up","fields.moveDown":"Move down","fields.removeNamed":"Remove {name}","fields.removeOption":"Remove option","fields.addOption":"+ Add option","fields.sortAZ":"Sort A to Z","fields.menuColorRows":"Color rows by this field","fields.menuStopColoring":"Stop coloring rows","fields.menuFilter":"Filter by this field","fields.menuGroup":"Group by this field","fields.menuEdit":"Edit field","fields.menuInsertLeft":"Insert left","fields.menuInsertRight":"Insert right","fields.menuMoveLeft":"Move left","fields.menuMoveRight":"Move right","fields.menuDuplicate":"Duplicate field","fields.menuHide":"Hide field","fields.menuDelete":"Delete field","fields.typeText":"Single line text","fields.typeTextDescription":"A short line of text, like a name or a title.","fields.typeLongText":"Long text","fields.typeLongTextDescription":"Several lines of text; Alt+Enter starts a new line.","fields.typeRichText":"Rich text","fields.typeRichTextDescription":"Formatted notes: bold, italic, lists and links from a toolbar.","fields.typeAttachment":"Attachment","fields.typeAttachmentDescription":"Images and files: thumbnails in the cell, a dialog to add more.","fields.typeCheckbox":"Checkbox","fields.typeCheckboxDescription":"Done or not done: one click to toggle.","fields.typeSingleSelect":"Single select","fields.typeSingleSelectDescription":"One choice from a list of colored options.","fields.typeMultiSelect":"Multiple select","fields.typeMultiSelectDescription":"Any number of choices from a list of colored options.","fields.typeUser":"User","fields.typeUserDescription":"A person (or several) from the people the app lists.","fields.typeDate":"Date","fields.typeDateDescription":"A calendar date, with or without the time.","fields.typePhone":"Phone number","fields.typePhoneDescription":"A phone number, shown as a tel link.","fields.typeEmail":"Email","fields.typeEmailDescription":"An email address, shown as a mailto link.","fields.typeUrl":"URL","fields.typeUrlDescription":"A web address, shown as a link.","fields.typeBarcode":"Barcode","fields.typeBarcodeDescription":"A barcode's text, from a scanner or typed.","fields.typeButton":"Button","fields.typeButtonDescription":"A button in every row: open a link, change the record, print it, copy text or run an automation.","fields.typeChecklist":"Checklist","fields.typeChecklistDescription":"A list of to-dos; the cell shows how many are done.","fields.typeColor":"Color","fields.typeColorDescription":"A color from the palette, or any hex code.","fields.typeNumber":"Number","fields.typeNumberDescription":"A number: whole, decimal, an amount of money or a percentage.","fields.typeCurrency":"Currency","fields.typeCurrencyDescription":"An amount, with a currency symbol.","fields.typePercent":"Percent","fields.typePercentDescription":"A share, shown with a percent sign.","fields.typeDuration":"Duration","fields.typeDurationDescription":"A length of time, typed as 1:30 or 1h 30m.","fields.typeTimeOfDay":"Time of day","fields.typeTimeOfDayDescription":"A time on the clock with no date, typed as 9:30 am, 14:05 or 2pm.","fields.typeRating":"Rating","fields.typeRatingDescription":"One to ten stars, hearts, thumbs, flags or dots.","fields.typeTimer":"Timer","fields.typeTimerDescription":"Time counted with a start and stop button; each run adds to the total.","fields.typeVote":"Vote","fields.typeVoteDescription":"Who voted for it: one click adds your vote or takes it back.","fields.typeSparkline":"Sparkline","fields.typeSparklineDescription":"A list of numbers drawn as a small line, area or column chart.","fields.typeFormula":"Formula","fields.typeFormulaDescription":"A value computed from the row's other fields.","fields.typeCreatedTime":"Created time","fields.typeCreatedTimeDescription":"When the row was added. Set automatically.","fields.typeLastModifiedTime":"Last modified time","fields.typeLastModifiedTimeDescription":"When the row last changed. Set automatically.","fields.typeCreatedBy":"Created by","fields.typeCreatedByDescription":"Who added the row. Set automatically.","fields.typeLastModifiedBy":"Last modified by","fields.typeLastModifiedByDescription":"Who last changed the row. Set automatically.","fields.typeAutoNumber":"Autonumber","fields.typeAutoNumberDescription":"A number every row gets, counting up. Set automatically.","fields.typeLink":"Link to records","fields.typeLinkDescription":"Rows of another table this row points at.","fields.typeLookup":"Lookup","fields.typeLookupDescription":"A field of the linked rows, shown here.","fields.typeRollup":"Rollup","fields.typeRollupDescription":"A summary of a field over the linked rows (a sum, a count, a list).","fields.typeCount":"Count","fields.typeCountDescription":"How many rows a link field points at.","fields.typeAi":"AI","fields.typeAiDescription":"A model writes the value from a prompt that names the record's fields. Stored, and editable by hand.","fields.propSeparators":"Separators","fields.propShowThousands":"Show thousands separator","fields.propAbbreviation":"Large number abbreviation","fields.propAllowNegative":"Allow negative numbers","fields.propDefault":"Default value","fields.propDefaultHint":"New rows start with this value.","fields.propDateFormat":"Date format","fields.propIncludeTime":"Include time","fields.propTimeFormat":"Time format","fields.propGmt":"Use the same time zone (GMT) for everyone","fields.propShowTimeZone":"Display time zone","fields.propLinkField":"Link field","fields.propLinkFieldHint":"A link-to-records field of this table.","fields.propLinkedField":"Field in the linked table","fields.propWatch":"Changes to","fields.propWatchFields":"Fields","fields.propMarkdown":"Format with Markdown","fields.propMarkdownHint":"**bold**, *italic*, `code`, [links](https://...) and lists. For a toolbar, use Rich text.","fields.propToolbar":"Toolbar","fields.propToolbarHint":"Full adds headings, quotes, code blocks, undo and redo.","fields.propAccept":"Accepted types","fields.propAcceptPlaceholder":"image/*,.pdf (any when empty)","fields.propMaxFiles":"Most files per cell","fields.propIcon":"Icon","fields.propColor":"Color","fields.propOptions":"Options","fields.propMultipleUsers":"Allow adding multiple users","fields.propDefaultToday":"Default to today","fields.propButtonLabel":"Label","fields.propButtonLabelPlaceholder":"Open","fields.propButtonStyle":"Style","fields.propButtonUrl":"URL","fields.propButtonUrlPlaceholder":"https://example.com/orders/{Order id}","fields.propButtonUrlHint":'Use {Field name} for a value of the record, or write a formula: "mailto:" & {Email}, or {Website} for the link a field holds. mailto:, tel: and sms: links open the e-mail, phone or messages app.',"fields.propButtonAction":"When pressed","fields.buttonActionLink":"Open a link","fields.buttonActionAutomation":"Run automations","fields.buttonActionUpdate":"Change this record","fields.buttonActionTemplate":"Fill in from a record template","fields.buttonActionRecordAction":"Print or another record action","fields.buttonActionCopy":"Copy text","fields.buttonActionDuplicate":"Duplicate the record","fields.buttonActionDelete":"Delete the record","fields.buttonActionOpen":"Open the record","fields.propButtonValues":"Set these fields","fields.propButtonValuesHint":"Write a value as you would type it. A date can be today or today+7, a person can be me (whoever presses).","fields.buttonValuesInBase":"Pick the fields once the button is in a table of a base.","fields.propButtonTemplate":"Record template","fields.propButtonTemplateHint":"Fills only the fields that are empty. Make one from the arrow beside + Add row, then Manage templates.","fields.propButtonRecordAction":"Action","fields.propButtonCopy":"Text to copy","fields.propButtonCopyPlaceholder":"Order {Order id} for {Customer}","fields.propButtonCopyHint":"Use {Field name} for a value of the record. Start with = to write a formula.","fields.propButtonDoneLabel":"Label once done","fields.propButtonDoneLabelPlaceholder":"Done","fields.propButtonDoneLabelHint":"When the record already has these values, the button shows a check and this label, and cannot be pressed again.","fields.propButtonWhen":"Can be pressed when","fields.propButtonWhenHint":"On other records the button is greyed out.","fields.buttonWhenAlways":"On every record","fields.propButtonAsk":"Ask before it runs","fields.propButtonAskText":"Question","fields.buttonAskDefault":"Are you sure?","fields.buttonNotNow":"This record does not meet the button's condition.","fields.buttonReadOnly":"You can view this base but not change it.","fields.buttonNoAutomation":"No automation starts when this button is pressed yet. Add one on the Automations page.","fields.buttonNoLink":"This record has no link to open.","fields.buttonNoText":"This record has no text to copy.","fields.buttonNoValues":"Pick the fields this button sets.","fields.buttonNoTemplate":"Pick the record template this button uses.","fields.buttonNoRecordAction":"This action is not available here.","fields.buttonSomeRefused":"Some fields were not changed: you may not edit them.","fields.buttonCopied":"Copied.","fields.buttonCopyFailed":"Could not copy. Try again.","fields.protectedOnly":"Only {names} can edit this field.","fields.propButtonWho":"Who can press it","fields.buttonWhoEveryone":"Everyone who can use the base","fields.propButtonWhoHint":"Tick a person field to let whoever it names on each record press the button, such as the approver of each request.","fields.whoNobody":"Nobody will be able to press it.","fields.buttonOnlyWho":"Only {names} can press this.","fields.protectedNobody":"Nobody can edit this field.","fields.protectedNotYou":"You cannot edit this field.","fields.protectedChoices":"Only {names} can choose {choices}.","fields.protectedChoicesNobody":"Nobody can choose {choices}.","fields.protectedWhoeverIn":"whoever is in {field}","fields.protectedAnd":"and","fields.protectedOr":"or","fields.propFormat":"Format","fields.propCurrencySymbol":"Currency symbol","fields.propSymbolPosition":"Symbol position","fields.propPrecision":"Precision","fields.propStep":"Spinner step","fields.propStepHint":"What the editor's arrows and Up / Down add or take away; Shift for ten times as much.","fields.propShowBar":"Show as a progress bar","fields.propPoints":"Values are 0 to 100 (not 0 to 1)","fields.propDurationFormat":"Duration format","fields.propShowSeconds":"Show seconds","fields.propMaximum":"Maximum","fields.propChart":"Chart","fields.propShowLast":"Show the last value","fields.propFormula":"Formula","fields.propResult":"Format the result as","fields.propTable":"Table","fields.propTableHint":"The table gets a field that links back to this one.","fields.propMultipleRecords":"Allow linking to multiple records","fields.propPickFrom":"Pick records from","fields.pickFromAll":"All records","fields.propPickFromHint":"People pick only the records this view of the linked table shows (its filter).","fields.propAggregation":"Aggregation","fields.propPrompt":"Prompt","fields.propPromptPlaceholder":"Write a one-line pitch for {Name}, aimed at {Audience}","fields.propPromptHint":"Use {Field name} for that field's value in the record.","fields.propOutput":"The model writes","fields.propAuto":"Generate again when a field the prompt names changes","fields.propAutoHint":"Off: only when someone presses the button or uses the column menu.","fields.choiceLocal":"Local","fields.choiceNone":"None","fields.choiceThousand":"Thousand (K)","fields.choiceMillion":"Million (M)","fields.choiceBillion":"Billion (B)","fields.choiceFriendly":"Friendly (October 14, 2026)","fields.choiceUs":"US (10/14/2026)","fields.choiceEuropean":"European (14/10/2026)","fields.choiceIso":"ISO (2026-10-14)","fields.choice12Hour":"12 hour","fields.choice24Hour":"24 hour","fields.choiceAllFields":"All fields","fields.choiceSpecificFields":"Specific fields","fields.choiceStandard":"Standard","fields.choiceFull":"Full","fields.choiceInteger":"Integer","fields.choiceDecimal":"Decimal","fields.choiceCurrency":"Currency","fields.choicePercent":"Percent","fields.choiceBefore":"Before ($1.00)","fields.choiceAfter":"After (1.00 kr)","fields.choiceArrow":"Arrow","fields.choiceThumb":"Thumb","fields.choiceHeart":"Heart","fields.choiceLine":"Line","fields.choiceArea":"Area","fields.choiceColumns":"Columns","fields.choiceAsComputed":"As computed","fields.choiceNumber":"Number","fields.choiceDate":"Date","fields.choiceText":"Text","fields.choiceOneOption":"One option","fields.choiceANumber":"A number","fields.notJson":"{field} holds JSON, and this text is not valid JSON. Check its brackets and quotes.","fields.negativeNotAllowed":"Negative numbers are not allowed","fields.aiStop":"Stop generating ({count} left)","fields.aiGenerateEmpty.one":"Generate for {count} empty record","fields.aiGenerateEmpty.other":"Generate for {count} empty records","fields.aiAllTitle.one":"Generate for {count} record?","fields.aiAllTitle.other":"Generate for all {count} records?","fields.aiAllBody.one":"This replaces the value 1 record holds, and sends the AI provider a request for each of {records}. One Undo takes the replaced values back.","fields.aiAllBody.other":"This replaces the values {count} records hold, and sends the AI provider a request for each of {records}. One Undo takes the replaced values back.","fields.aiAllRecords.one":"{count} record","fields.aiAllRecords.other":"{count} records","fields.aiAllYes":"Generate","fields.aiGenerateAll.one":"Generate for all {count} record","fields.aiGenerateAll.other":"Generate for all {count} records","fields.aiNoProvider":"No AI provider. The app sets one with setAIProvider() from @svgrid/grid.","fields.aiNotEditable":"You cannot edit this field, so nothing was written.","fields.aiNotShown":"The record is not in the grid (filtered out or deleted).","fields.aiNotAiField":"The field is no longer an AI field.","fields.aiNoPrompt":"The field has no prompt yet: write one in Edit field.","fields.aiRequestFailed":"The request failed","fields.aiNotNumber":'The model answered "{answer}", which is not a number',"fields.aiNotOption":'The model answered "{answer}", which is not one of the options',"fields.promptNotClosed":"The { at {at} is not closed","fields.promptEmptyRef":"Empty {} at {at}: put a field name in it","fields.promptInvalid":"The prompt is not valid","fields.promptOwnField":"A prompt cannot read its own field {{name}}","fields.promptNoField":"No field is named {{name}}"};
@@ -67,6 +67,13 @@ export declare const RECORD_MESSAGES: {
67
67
  readonly 'record.commentEdited': "(edited)";
68
68
  readonly 'record.saveComment': "Save";
69
69
  readonly 'record.cancelComment': "Cancel";
70
+ readonly 'record.commentVotes': "Votes";
71
+ readonly 'record.voteUp': "Vote up";
72
+ readonly 'record.voteDown': "Vote down";
73
+ readonly 'record.voteUpCount': "Vote up ({count})";
74
+ readonly 'record.voteDownCount': "Vote down ({count})";
75
+ readonly 'record.votedUpBy': "Voted up by {names}";
76
+ readonly 'record.votedDownBy': "Voted down by {names}";
70
77
  readonly 'record.previousRecord': "Previous record";
71
78
  readonly 'record.nextRecord': "Next record";
72
79
  readonly 'record.position': "{index} of {total}";
@@ -1 +1 @@
1
- export const RECORD_MESSAGES={"record.untitled":"Untitled","record.record":"Record","record.protected":"protected","record.readOnly":"read-only","record.hiddenInGrid":"hidden in the grid","record.notInGridView":"This row is not in the grid's view any more.","record.showHiddenFields.one":"Show {count} hidden field","record.showHiddenFields.other":"Show {count} hidden fields","record.hideHiddenFields.one":"Hide {count} hidden field","record.hideHiddenFields.other":"Hide {count} hidden fields","record.activity":"Activity","record.someone":"Someone","record.someoneElse":"Someone else","record.you":"You","record.byAutomation":"Automation: {name}","record.acceptedBy":"{source} (accepted by {person})","record.through":"{person} via {source}","record.changedField":"changed {field}","record.undidField":"undid a change to {field}","record.redidField":"redid a change to {field}","record.addedRecord":"added this record","record.changedTo":"to","record.cleared":"(cleared)","record.noActivity":"No changes or comments yet.","record.loadingHistory":"Loading the history...","record.historyError":"The history could not be read: {error}","record.comment":"Comment","record.attachFiles":"Attach files","record.commentFiles":"Files","record.commentUploadFailed":"{name} was not uploaded: {error}","record.internalNote":"Internal note","record.internalNoteHint":"Only your team sees it, never a client.","record.internalTag":"Internal","record.savedReplies":"Saved replies","record.formSuggestTitle":"These may already answer it","record.formSolved":"This solved it","record.formSolvedTitle":"Glad it helped","record.formSolvedNote":"Nothing was sent.","record.formAskAnother":"Ask something else","record.searchReplies":"Search the saved replies","record.noReplies":"No saved replies yet.","record.noRepliesFound":"No saved reply matches.","record.loadingReplies":"Loading the saved replies...","record.repliesFailed":"The saved replies could not be read: {error}","record.saveAsReply":"Save this text as a reply","record.replyName":"Name of the reply","record.replySaved":"Saved as a reply.","record.replyNotSaved":"The reply was not saved: {error}","record.editComment":"Edit","record.deleteComment":"Delete","record.deleteCommentAsk":"Delete this comment?","record.commentNotSent":"This comment is not sent. Send it, or clear the box, and Esc closes the record.","record.commentNotSaved":"This change is not saved. Save or cancel it, and Esc closes the record.","record.commentHoldsStep":"This change is not saved. Save or cancel it, then move to another record.","record.fileRemoved":"{file} removed.","record.commentAddedSay":"Comment added.","record.commentKept":"Your comment was not sent. It is still in this record, ready to send.","record.commentSavedSay":"Comment saved.","record.commentDeletedSay":"Comment deleted.","record.commentEdited":"(edited)","record.saveComment":"Save","record.cancelComment":"Cancel","record.previousRecord":"Previous record","record.nextRecord":"Next record","record.position":"{index} of {total}","record.newRecord":"New record","record.linkedOf":"{table} of {owner} ({count})","record.filteredOut":"This record is filtered out of this view.","record.notInView.one":"Not in view ({count} record)","record.notInView.other":"Not in view ({count} records)","record.close":"Close","record.justNow":"just now","record.minutesAgo.one":"{count} minute ago","record.minutesAgo.other":"{count} minutes ago","record.hoursAgo.one":"{count} hour ago","record.hoursAgo.other":"{count} hours ago","record.leaveComment":"Leave a comment","record.commentPlaceholder":"Leave a comment, @ to mention","record.peopleToMention":"People to mention","record.empty":"Empty","record.emptyValue":"empty","record.fieldValue":"{label}: {value}","record.fieldValueEdit":"{label}: {value}, edit","record.formProblems.one":"{count} field needs attention","record.formProblems.other":"{count} fields need attention","record.formTitle":"New record","record.formSubmit":"Submit","record.formChoose":"Choose","record.formPickDate":"Pick a date","record.formAddFiles":"Add files","record.formLinkRecords":"Link records","record.formTypeHere":"Type here","record.formRequired":"required","record.formInvalidEmail":"Not a valid email address","record.formInvalidUrl":"Not a valid web address","record.formInvalidPhone":"Not a valid phone number","record.formFieldRequired":"{field} is required","record.formFieldInvalid":"{field} is not valid","record.formSendFailed":"The record could not be sent. Try again.","record.formEmpty":"Fill in at least one field before you send this.","record.formThanks":"Thank you","record.formAdded":"The record was added.","record.formSubmitAnother":"Submit another","record.formNext":"Next","record.formBack":"Back","record.formStepOf":"Question {n} of {count}","record.formPressEnter":"or press Enter","record.unnamed":"Untitled","record.linkedGone":"This record is not in its table any more.","record.openIn":"Open in {table}","record.linkTo":"Link to {table}","record.linkToRecords":"Link to records","record.linkTableMissing":"The table this field links to is not available.","record.searchTable":"Search {table}","record.pickingFromView":'Records of the view "{view}"',"record.noRecordsMatch":"No records match.","record.createRecord":"Create “{name}”","record.showingOf":"Showing {shown} of {total}. Type to narrow.","record.linkedCount":"{count} linked","record.cancel":"Cancel","record.done":"Done","record.attachments":"Attachments","record.fileBadge":"FILE","record.uploadFailed":"Upload failed","record.uploadsFailed.one":"Upload failed","record.uploadsFailed.other":"{count} uploads failed","record.noUrlFound":"No http(s) URL found","record.noFilesYet":"No files yet. Drop files here, paste them, or use Add files.","record.files":"Files","record.fileTile":"{file}. Enter to preview, Delete to remove, Alt+Arrow to move.","record.removeFile":"Remove {name}","record.uploadingFile":"Uploading {name}","record.cancelUpload":"Cancel {name}","record.retry":"Retry","record.remove":"Remove","record.addFiles":"Add files","record.takePhoto":"Take a photo","record.scanCode":"Scan a code","record.dictateField":"Speak into {field}","record.dictateComment":"Speak a comment","record.listening":"Listening...","record.scanHint":"Point the camera at a barcode or a QR code.","record.scanUnsupported":"This browser cannot read codes from the camera.","record.scanNoCamera":"The camera is not available: allow it for this site, or close another app using it.","record.pasteUrl":"or paste a URL","record.addByUrl":"Add a file by URL","record.addFrom":"Add files from","record.sourceDevice":"Your device","record.sourceLink":"Link (URL)","record.dropHere":"Drop files here","record.dropOr":"or","record.chooseFiles":"Choose files","record.pasteHint":"You can also paste files or pictures here.","record.linkHint":"Paste the address of a file or a picture on the web.","record.addLink":"Add","record.photoHint":"Take a picture with the camera.","record.openSource":"Open {source}","record.sourceHint":"Choose files in {source}. They are added here.","record.sourceWaiting":"Waiting for {source}...","record.backToFiles":"Back to the files","record.gettingFile":"Getting {name}","record.uploadingCount":"Uploading {count}...","record.download":"Download","record.previous":"Previous","record.next":"Next","record.previousFile":"Previous file","record.nextFile":"Next file","record.filePosition":"{index} of {total}","record.noAttachments":"No attachments","record.attachmentList.one":"{count} attachment: {names}","record.attachmentList.other":"{count} attachments: {names}","record.notAdded":"Not added","record.uploading":"Uploading","record.keyMove":"move","record.keySave":"save","record.keyCancel":"cancel","record.checklist":"Checklist","record.checklistDone":"{done} of {total} done","record.noItemsYet":"No items yet","record.noItems":"No items","record.items":"Items","record.item":"item","record.itemNumber":"Item {n}","record.itemDone":"Done: {item}","record.moveItem":"Move {item}","record.deleteItem":"Delete {item}","record.addItem":"Add an item","record.color":"Color","record.hexCode":"Hex code","record.clear":"Clear","record.notAColor":"Not a color: use #rrggbb, #rgb, rgb() or a color name","record.colors":"Colors","record.notATime":"Not a time (9:30 am, 14:05, 2pm)","record.notADate":"Not a date (12/24/2026, 2026-12-24, Dec 24, 2026)","record.dateLabel":"Date","record.dateAndTimeLabel":"Date and time","record.calendarTab":"Date","record.timeTab":"Time","record.openCalendar":"Open the calendar","record.timeOfDay":"Time of day","record.longText":"Long text","record.markupHint":"**bold** *italic* `code` [link](https://...) - list","record.richText":"Rich text","record.removeValue":"Remove {name}","record.findPerson":"Find a person","record.findOption":"Find an option","record.addPerson":"Add a person","record.choosePerson":"Choose a person","record.addOption":"Add an option","record.chooseOption":"Choose an option","record.addNewOption":"Add option","record.everyoneChosen":"Everyone is chosen","record.nobodyMatches":"Nobody matches","record.noPeople":"No people (setFieldUsers)","record.everyOptionChosen":"Every option is chosen","record.noOptionMatches":"No option matches","record.noOptions":"No options","record.notADuration":"Not a duration (1:30, 1h 30m)","record.notANumber":"Not a number","record.formulaInNumber":"This field holds numbers. Press Enter to see how a formula field works this out.","record.noNegative":"Negative numbers are not allowed","record.durationLabel":"Duration ({format})","record.amountIn":"Amount in {symbol}","record.money":"money","record.percent":"Percent","record.number":"Number","record.increaseBy":"Increase by {step}","record.decreaseBy":"Decrease by {step}","record.ratingLabel":"Rating, {value} of {max}","record.aiNeedsPrompt":"Write a prompt for this field first (Edit field).","record.aiGenerating":"Generating...","record.aiWaiting":"Waiting...","record.aiGenerate":"Generate","record.aiGenerateAgain":"Generate again","record.aiNoProvider":"No AI provider","record.aiNoPrompt":"No prompt","record.voted":"{names} voted","record.noVotes":"No votes yet","record.votes.one":"{count} vote","record.votes.other":"{count} votes","record.timerStart":"Start the timer","record.timerStop":"Stop the timer","record.votesMine.one":"{count} vote, including yours","record.votesMine.other":"{count} votes, including yours","record.buttonOpen":"Open","record.nobody":"Nobody"};
1
+ export const RECORD_MESSAGES={"record.untitled":"Untitled","record.record":"Record","record.protected":"protected","record.readOnly":"read-only","record.hiddenInGrid":"hidden in the grid","record.notInGridView":"This row is not in the grid's view any more.","record.showHiddenFields.one":"Show {count} hidden field","record.showHiddenFields.other":"Show {count} hidden fields","record.hideHiddenFields.one":"Hide {count} hidden field","record.hideHiddenFields.other":"Hide {count} hidden fields","record.activity":"Activity","record.someone":"Someone","record.someoneElse":"Someone else","record.you":"You","record.byAutomation":"Automation: {name}","record.acceptedBy":"{source} (accepted by {person})","record.through":"{person} via {source}","record.changedField":"changed {field}","record.undidField":"undid a change to {field}","record.redidField":"redid a change to {field}","record.addedRecord":"added this record","record.changedTo":"to","record.cleared":"(cleared)","record.noActivity":"No changes or comments yet.","record.loadingHistory":"Loading the history...","record.historyError":"The history could not be read: {error}","record.comment":"Comment","record.attachFiles":"Attach files","record.commentFiles":"Files","record.commentUploadFailed":"{name} was not uploaded: {error}","record.internalNote":"Internal note","record.internalNoteHint":"Only your team sees it, never a client.","record.internalTag":"Internal","record.savedReplies":"Saved replies","record.formSuggestTitle":"These may already answer it","record.formSolved":"This solved it","record.formSolvedTitle":"Glad it helped","record.formSolvedNote":"Nothing was sent.","record.formAskAnother":"Ask something else","record.searchReplies":"Search the saved replies","record.noReplies":"No saved replies yet.","record.noRepliesFound":"No saved reply matches.","record.loadingReplies":"Loading the saved replies...","record.repliesFailed":"The saved replies could not be read: {error}","record.saveAsReply":"Save this text as a reply","record.replyName":"Name of the reply","record.replySaved":"Saved as a reply.","record.replyNotSaved":"The reply was not saved: {error}","record.editComment":"Edit","record.deleteComment":"Delete","record.deleteCommentAsk":"Delete this comment?","record.commentNotSent":"This comment is not sent. Send it, or clear the box, and Esc closes the record.","record.commentNotSaved":"This change is not saved. Save or cancel it, and Esc closes the record.","record.commentHoldsStep":"This change is not saved. Save or cancel it, then move to another record.","record.fileRemoved":"{file} removed.","record.commentAddedSay":"Comment added.","record.commentKept":"Your comment was not sent. It is still in this record, ready to send.","record.commentSavedSay":"Comment saved.","record.commentDeletedSay":"Comment deleted.","record.commentEdited":"(edited)","record.saveComment":"Save","record.cancelComment":"Cancel","record.commentVotes":"Votes","record.voteUp":"Vote up","record.voteDown":"Vote down","record.voteUpCount":"Vote up ({count})","record.voteDownCount":"Vote down ({count})","record.votedUpBy":"Voted up by {names}","record.votedDownBy":"Voted down by {names}","record.previousRecord":"Previous record","record.nextRecord":"Next record","record.position":"{index} of {total}","record.newRecord":"New record","record.linkedOf":"{table} of {owner} ({count})","record.filteredOut":"This record is filtered out of this view.","record.notInView.one":"Not in view ({count} record)","record.notInView.other":"Not in view ({count} records)","record.close":"Close","record.justNow":"just now","record.minutesAgo.one":"{count} minute ago","record.minutesAgo.other":"{count} minutes ago","record.hoursAgo.one":"{count} hour ago","record.hoursAgo.other":"{count} hours ago","record.leaveComment":"Leave a comment","record.commentPlaceholder":"Leave a comment, @ to mention","record.peopleToMention":"People to mention","record.empty":"Empty","record.emptyValue":"empty","record.fieldValue":"{label}: {value}","record.fieldValueEdit":"{label}: {value}, edit","record.formProblems.one":"{count} field needs attention","record.formProblems.other":"{count} fields need attention","record.formTitle":"New record","record.formSubmit":"Submit","record.formChoose":"Choose","record.formPickDate":"Pick a date","record.formAddFiles":"Add files","record.formLinkRecords":"Link records","record.formTypeHere":"Type here","record.formRequired":"required","record.formInvalidEmail":"Not a valid email address","record.formInvalidUrl":"Not a valid web address","record.formInvalidPhone":"Not a valid phone number","record.formFieldRequired":"{field} is required","record.formFieldInvalid":"{field} is not valid","record.formSendFailed":"The record could not be sent. Try again.","record.formEmpty":"Fill in at least one field before you send this.","record.formThanks":"Thank you","record.formAdded":"The record was added.","record.formSubmitAnother":"Submit another","record.formNext":"Next","record.formBack":"Back","record.formStepOf":"Question {n} of {count}","record.formPressEnter":"or press Enter","record.unnamed":"Untitled","record.linkedGone":"This record is not in its table any more.","record.openIn":"Open in {table}","record.linkTo":"Link to {table}","record.linkToRecords":"Link to records","record.linkTableMissing":"The table this field links to is not available.","record.searchTable":"Search {table}","record.pickingFromView":'Records of the view "{view}"',"record.noRecordsMatch":"No records match.","record.createRecord":"Create “{name}”","record.showingOf":"Showing {shown} of {total}. Type to narrow.","record.linkedCount":"{count} linked","record.cancel":"Cancel","record.done":"Done","record.attachments":"Attachments","record.fileBadge":"FILE","record.uploadFailed":"Upload failed","record.uploadsFailed.one":"Upload failed","record.uploadsFailed.other":"{count} uploads failed","record.noUrlFound":"No http(s) URL found","record.noFilesYet":"No files yet. Drop files here, paste them, or use Add files.","record.files":"Files","record.fileTile":"{file}. Enter to preview, Delete to remove, Alt+Arrow to move.","record.removeFile":"Remove {name}","record.uploadingFile":"Uploading {name}","record.cancelUpload":"Cancel {name}","record.retry":"Retry","record.remove":"Remove","record.addFiles":"Add files","record.takePhoto":"Take a photo","record.scanCode":"Scan a code","record.dictateField":"Speak into {field}","record.dictateComment":"Speak a comment","record.listening":"Listening...","record.scanHint":"Point the camera at a barcode or a QR code.","record.scanUnsupported":"This browser cannot read codes from the camera.","record.scanNoCamera":"The camera is not available: allow it for this site, or close another app using it.","record.pasteUrl":"or paste a URL","record.addByUrl":"Add a file by URL","record.addFrom":"Add files from","record.sourceDevice":"Your device","record.sourceLink":"Link (URL)","record.dropHere":"Drop files here","record.dropOr":"or","record.chooseFiles":"Choose files","record.pasteHint":"You can also paste files or pictures here.","record.linkHint":"Paste the address of a file or a picture on the web.","record.addLink":"Add","record.photoHint":"Take a picture with the camera.","record.openSource":"Open {source}","record.sourceHint":"Choose files in {source}. They are added here.","record.sourceWaiting":"Waiting for {source}...","record.backToFiles":"Back to the files","record.gettingFile":"Getting {name}","record.uploadingCount":"Uploading {count}...","record.download":"Download","record.previous":"Previous","record.next":"Next","record.previousFile":"Previous file","record.nextFile":"Next file","record.filePosition":"{index} of {total}","record.noAttachments":"No attachments","record.attachmentList.one":"{count} attachment: {names}","record.attachmentList.other":"{count} attachments: {names}","record.notAdded":"Not added","record.uploading":"Uploading","record.keyMove":"move","record.keySave":"save","record.keyCancel":"cancel","record.checklist":"Checklist","record.checklistDone":"{done} of {total} done","record.noItemsYet":"No items yet","record.noItems":"No items","record.items":"Items","record.item":"item","record.itemNumber":"Item {n}","record.itemDone":"Done: {item}","record.moveItem":"Move {item}","record.deleteItem":"Delete {item}","record.addItem":"Add an item","record.color":"Color","record.hexCode":"Hex code","record.clear":"Clear","record.notAColor":"Not a color: use #rrggbb, #rgb, rgb() or a color name","record.colors":"Colors","record.notATime":"Not a time (9:30 am, 14:05, 2pm)","record.notADate":"Not a date (12/24/2026, 2026-12-24, Dec 24, 2026)","record.dateLabel":"Date","record.dateAndTimeLabel":"Date and time","record.calendarTab":"Date","record.timeTab":"Time","record.openCalendar":"Open the calendar","record.timeOfDay":"Time of day","record.longText":"Long text","record.markupHint":"**bold** *italic* `code` [link](https://...) - list","record.richText":"Rich text","record.removeValue":"Remove {name}","record.findPerson":"Find a person","record.findOption":"Find an option","record.addPerson":"Add a person","record.choosePerson":"Choose a person","record.addOption":"Add an option","record.chooseOption":"Choose an option","record.addNewOption":"Add option","record.everyoneChosen":"Everyone is chosen","record.nobodyMatches":"Nobody matches","record.noPeople":"No people (setFieldUsers)","record.everyOptionChosen":"Every option is chosen","record.noOptionMatches":"No option matches","record.noOptions":"No options","record.notADuration":"Not a duration (1:30, 1h 30m)","record.notANumber":"Not a number","record.formulaInNumber":"This field holds numbers. Press Enter to see how a formula field works this out.","record.noNegative":"Negative numbers are not allowed","record.durationLabel":"Duration ({format})","record.amountIn":"Amount in {symbol}","record.money":"money","record.percent":"Percent","record.number":"Number","record.increaseBy":"Increase by {step}","record.decreaseBy":"Decrease by {step}","record.ratingLabel":"Rating, {value} of {max}","record.aiNeedsPrompt":"Write a prompt for this field first (Edit field).","record.aiGenerating":"Generating...","record.aiWaiting":"Waiting...","record.aiGenerate":"Generate","record.aiGenerateAgain":"Generate again","record.aiNoProvider":"No AI provider","record.aiNoPrompt":"No prompt","record.voted":"{names} voted","record.noVotes":"No votes yet","record.votes.one":"{count} vote","record.votes.other":"{count} votes","record.timerStart":"Start the timer","record.timerStop":"Stop the timer","record.votesMine.one":"{count} vote, including yours","record.votesMine.other":"{count} votes, including yours","record.buttonOpen":"Open","record.nobody":"Nobody"};
@@ -476,6 +476,14 @@ export declare const BASE_MESSAGES: {
476
476
  readonly 'fields.nobodyCanChange': "Nobody will be able to change its values.";
477
477
  readonly 'fields.youCannotChange': "You will not be able to change its values yourself.";
478
478
  readonly 'fields.othersReadOnly': "Others see the field read-only. Its name, type and options stay editable.";
479
+ readonly 'fields.whoeverInLabel': "And whoever the record names in";
480
+ readonly 'fields.whoeverIn': "Whoever is in {field}";
481
+ readonly 'fields.onlySomeChoices': "Only for some choices";
482
+ readonly 'fields.heldChoices': "Choices only they can pick";
483
+ readonly 'fields.pickHeldChoices': "Tick the choices only they can pick.";
484
+ readonly 'fields.nobodyCanPick': "Nobody will be able to pick these choices.";
485
+ readonly 'fields.youCannotPick': "You will not be able to pick these choices yourself.";
486
+ readonly 'fields.othersPickRest': "Everyone else picks the other choices, and cannot change a record that has one of these.";
479
487
  readonly 'fields.description': "Description";
480
488
  readonly 'fields.optional': "optional";
481
489
  readonly 'fields.descriptionPlaceholder': "What goes in this field";
@@ -712,6 +720,19 @@ export declare const BASE_MESSAGES: {
712
720
  readonly 'fields.buttonSomeRefused': "Some fields were not changed: you may not edit them.";
713
721
  readonly 'fields.buttonCopied': "Copied.";
714
722
  readonly 'fields.buttonCopyFailed': "Could not copy. Try again.";
723
+ readonly 'fields.protectedOnly': "Only {names} can edit this field.";
724
+ readonly 'fields.propButtonWho': "Who can press it";
725
+ readonly 'fields.buttonWhoEveryone': "Everyone who can use the base";
726
+ readonly 'fields.propButtonWhoHint': "Tick a person field to let whoever it names on each record press the button, such as the approver of each request.";
727
+ readonly 'fields.whoNobody': "Nobody will be able to press it.";
728
+ readonly 'fields.buttonOnlyWho': "Only {names} can press this.";
729
+ readonly 'fields.protectedNobody': "Nobody can edit this field.";
730
+ readonly 'fields.protectedNotYou': "You cannot edit this field.";
731
+ readonly 'fields.protectedChoices': "Only {names} can choose {choices}.";
732
+ readonly 'fields.protectedChoicesNobody': "Nobody can choose {choices}.";
733
+ readonly 'fields.protectedWhoeverIn': "whoever is in {field}";
734
+ readonly 'fields.protectedAnd': "and";
735
+ readonly 'fields.protectedOr': "or";
715
736
  readonly 'fields.propFormat': "Format";
716
737
  readonly 'fields.propCurrencySymbol': "Currency symbol";
717
738
  readonly 'fields.propSymbolPosition': "Symbol position";
@@ -862,6 +883,13 @@ export declare const BASE_MESSAGES: {
862
883
  readonly 'record.commentEdited': "(edited)";
863
884
  readonly 'record.saveComment': "Save";
864
885
  readonly 'record.cancelComment': "Cancel";
886
+ readonly 'record.commentVotes': "Votes";
887
+ readonly 'record.voteUp': "Vote up";
888
+ readonly 'record.voteDown': "Vote down";
889
+ readonly 'record.voteUpCount': "Vote up ({count})";
890
+ readonly 'record.voteDownCount': "Vote down ({count})";
891
+ readonly 'record.votedUpBy': "Voted up by {names}";
892
+ readonly 'record.votedDownBy': "Voted down by {names}";
865
893
  readonly 'record.previousRecord': "Previous record";
866
894
  readonly 'record.nextRecord': "Next record";
867
895
  readonly 'record.position': "{index} of {total}";
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Who a rule names: people by user id, and `field:<field>` for whoever a
3
+ * person field of the record names (a person field, or Created by). A
4
+ * field's "Who can edit" (`fieldProps.editors`), a table's "Who can delete
5
+ * its records" (`permissions.deleters`) and a button's "Who can press"
6
+ * (`fieldProps.who`) are such rules, so "only the record's approver" is one
7
+ * entry: `field:approver`.
8
+ *
9
+ * ```ts
10
+ * fieldProps: { editors: ['u1', 'field:approver'], editorChoices: ['Approved', 'Declined'] }
11
+ * ```
12
+ */
13
+ /** The prefix of an entry that names a person field of the record. */
14
+ export declare const FIELD_PREFIX = "field:";
15
+ /** The entry for whoever the person field `field` of a record names. */
16
+ export declare const fieldToken: (field: string) => string;
17
+ /** Whether an entry names a person field of the record, not a person. */
18
+ export declare const isFieldToken: (entry: string) => boolean;
19
+ /** The field an entry names (`field:approver` gives `approver`). */
20
+ export declare const tokenField: (entry: string) => string;
21
+ /** The people a rule lists by id. */
22
+ export declare const ruleUsers: (rule: ReadonlyArray<string>) => string[];
23
+ /** The person fields a rule names. */
24
+ export declare const ruleFields: (rule: ReadonlyArray<string>) => string[];
25
+ /** The people a person field's value names: an id, a list of ids, or people ({id}). */
26
+ export declare function personIds(value: unknown): string[];
27
+ /**
28
+ * Whether `rule` names the person `userId` on `record`: listed by id, or in
29
+ * one of the rule's person fields of the record. With no record (a question
30
+ * about the field as a whole), a rule with person fields may name anyone:
31
+ * each record decides, and the server refuses the rest.
32
+ */
33
+ export declare function ruleNames(rule: ReadonlyArray<string>, userId: string | null | undefined, record?: Record<string, unknown> | null): boolean;
34
+ /** The record a grid row holds: its data object (`row.original`), or the row itself when it is one. */
35
+ export declare function recordOf(row: unknown): Record<string, unknown> | null;
@@ -0,0 +1 @@
1
+ export const FIELD_PREFIX="field:",fieldToken=t=>FIELD_PREFIX+t,isFieldToken=t=>t.startsWith(FIELD_PREFIX),tokenField=t=>t.slice(FIELD_PREFIX.length),ruleUsers=t=>t.filter(r=>!isFieldToken(r)),ruleFields=t=>t.filter(isFieldToken).map(tokenField);export function personIds(t){if(t==null||t==="")return[];if(Array.isArray(t))return t.flatMap(personIds);if(typeof t=="object"){const r=t.id;return r==null||r===""?[]:[String(r)]}return[String(t)]}export function ruleNames(t,r,e){if(!r)return!1;if(t.includes(r))return!0;const n=ruleFields(t);return n.length?e?n.some(i=>personIds(e[i]).includes(r)):!0:!1}export function recordOf(t){if(!t||typeof t!="object")return null;const r=t;return r.original&&typeof r.original=="object"?r.original:t}
@@ -1 +1 @@
1
- import{canDeleteIn}from"./base-permissions.js";let request=$state.raw(null);export const getDeleteRecordRequest=()=>request;export function askDeleteRecord(r){if(r&&!canDeleteIn(r.ctrl))return;request=r}
1
+ import{canDeleteRecord}from"./base-permissions.js";let request=$state.raw(null);export const getDeleteRecordRequest=()=>request;export function askDeleteRecord(r){if(r&&!canDeleteRecord(r.ctrl,r.row))return;request=r}
@@ -1 +1 @@
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})}]}
1
+ import{openRecord as S}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,canDeleteRecord 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},n=[];for(const c of o)if(c==="separator")n.length&&!n[n.length-1].separator&&n.push({separator:!0});else if(typeof c=="object"&&c.action&&!c.hidden?.(m)){const y=c.action;n.push({label:c.label,onSelect:()=>y(m)})}return n[n.length-1]?.separator&&n.pop(),n}}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()),n=e=>p(e)||!M()||!H(o(),e.row),c=e=>!!o()?.isRowSelected?.(e.rowId,e.row),y=e=>o()?.toggleRowSelectionById?.(e.rowId,e.row);function R(e,t,v,g){const r=o(),w=i();if(!r||!w||!e.row)return;if((r.props.rowModel||r.props.baseFeed)&&typeof r.props.baseServerAdd=="function"){const{__group:f,...I}=t;return r.props.baseServerAdd(I,g)}const u=r.props.rowAdder,a=u&&typeof u=="object"&&typeof u.defaults=="function"?u.defaults():{},l=z(r,{...a,...t}),h=e.row.id,b=r.internalData.findIndex(f=>f===e.row||h!=null&&f?.id===h);w.addRow(l,b<0?"bottom":b+v),r.props.onRowAdd?.({row:l}),queueMicrotask(()=>{const f=r.allRows.findIndex(I=>I.original===l);if(!(f<0)){if(e.card){g&&S({ctrl:r,rowId:r.allRows[f].id,editPrimary:!0});return}if(F(r,w,f),g){for(const I of r.allColumns)if(w.startEditing(f,I.id))break}}})}function x(e){const t=o(),v={},g=t?.grid?.getState?.()??{},r=g.grouping??[],w=(g.sorting??[]).map(a=>a.id).filter(a=>!r.includes(a));for(const a of[...r,...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&&R(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=>S({ctrl:o(),rowId:e.rowId})},{key:"comment",get label(){return s("shell.menuComment")},icon:d.comment,hidden:e=>p(e)||!T(o()),action:e=>S({ctrl:o(),rowId:e.rowId,focus:"comment"})},{key:"select",get label(){return s("shell.menuSelect")},icon:d.select,hidden:e=>n(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=>R(e,x(e),0,!0)},{key:"record_below",get label(){return s("shell.menuInsertBelow")},icon:d.below,hidden:m,action:e=>R(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:n,action:e=>V({ctrl:o(),api:i(),row:e.row})}]}
@@ -111,6 +111,15 @@ export type FieldPropertyDef = Base & ({
111
111
  */
112
112
  | {
113
113
  kind: 'recordValues';
114
+ }
115
+ /**
116
+ * Who a rule names (people-rule.ts): everyone (undefined), or people by id
117
+ * and `field:<field>` for whoever a person field of the record names.
118
+ */
119
+ | {
120
+ kind: 'people';
121
+ everyone: string;
122
+ only: string;
114
123
  });
115
124
  /** What a type is told when it fills in a column. */
116
125
  export type FieldFillContext = {
@@ -180,6 +189,8 @@ export declare function fieldPropsOf(def: {
180
189
  fieldType?: unknown;
181
190
  fieldProps?: Record<string, unknown>;
182
191
  }): Record<string, unknown>;
192
+ /** The names of the person fields a filled column's "Who can edit" is about, by their key. */
193
+ export declare const ruleFieldNames: (def: unknown) => Record<string, string> | undefined;
183
194
  /** The column as the grid should see it, filled in by its type. Unknown types pass through. */
184
195
  export declare function fillFieldColumn<T extends Record<string, unknown>>(def: T, columns?: ReadonlyArray<Record<string, any>>): T & Record<string, unknown>;
185
196
  /** A group, footer or total row of the server row model, not a record. */
@@ -1 +1 @@
1
- import{withSummary}from"./summaries.js";import{canEditField,fieldEditors,hasCanEditField}from"./field-access.svelte.js";let types=$state.raw({});export function registerFieldType(def){types={...types,[def.id]:def}}export function getFieldType(id){return typeof id==="string"?types[id]:void 0}export function listFieldTypes(){return Object.values(types)}export function fieldPropsOf(def){return{...getFieldType(def.fieldType)?.defaults??{},...def.fieldProps??{}}}const ORIGINAL=new WeakMap;const SOURCE=Symbol("svgrid.fieldSource");export function fillFieldColumn(def,columns=[]){const type=getFieldType(def.fieldType);if(!type)return def;const source=originalColumn(def);const props=fieldPropsOf(source);const filled=type.fill?type.fill(source,props,{columns:columns.map(c=>originalColumn(c))}):{...source};const out=withSummary(filled,props);if(out.groupOrder==null)out.groupOrder=groupOrderOf(out.sortValue);const own=out.editable;if(own!==false&&(fieldEditors(props)||hasCanEditField())){;out.editable=cell=>(typeof own==="function"?own(cell)!==false:true)&&canEditField(source,props)}const fn=out.fieldFn;if(typeof fn==="function")out.fieldFn=row=>isServerGroupRow(row)?void 0:fn(row);const parse=out.valueParser;if(typeof parse==="function")out.valueParser=x=>x.rawInput!==void 0&&x.rawInput===x.oldValue?x.oldValue:parse(x);ORIGINAL.set(out,source);out[SOURCE]=source;return out}export function isServerGroupRow(row){const g=row?.__group;return!!g&&g.kind!=="leaf"}const groupText=v=>Array.isArray(v)?v.map(groupText).join(", "):v==null?"":String(v);const groupCollator=new Intl.Collator(void 0,{numeric:true,sensitivity:"base"});function groupOrderOf(sortValue){return(a,b)=>{const ka=sortValue?sortValue(a):a;const kb=sortValue?sortValue(b):b;const ba=ka==null||ka===""||Array.isArray(ka)&&!ka.length;const bb=kb==null||kb===""||Array.isArray(kb)&&!kb.length;if(ba||bb)return Number(ba)-Number(bb);if(typeof ka==="number"&&typeof kb==="number")return ka-kb;if(typeof ka==="boolean"&&typeof kb==="boolean")return Number(ka)-Number(kb);return groupCollator.compare(groupText(ka),groupText(kb))}}export function originalColumn(def){return def[SOURCE]??ORIGINAL.get(def)??def}export function typeDrawsCell(def){const type=getFieldType(def.fieldType);if(!type?.cell)return false;return type.hasCell?type.hasCell(fieldPropsOf(def)):true}
1
+ import{withSummary}from"./summaries.js";import{canEditField,fieldEditors,hasCanEditField}from"./field-access.svelte.js";import{isFieldToken,recordOf,tokenField}from"./people-rule.js";let types=$state.raw({});export function registerFieldType(def){types={...types,[def.id]:def}}export function getFieldType(id){return typeof id==="string"?types[id]:void 0}export function listFieldTypes(){return Object.values(types)}export function fieldPropsOf(def){return{...getFieldType(def.fieldType)?.defaults??{},...def.fieldProps??{}}}const ORIGINAL=new WeakMap;const SOURCE=Symbol("svgrid.fieldSource");const RULE_NAMES=Symbol("svgrid.ruleFieldNames");export const ruleFieldNames=def=>def?.[RULE_NAMES];export function fillFieldColumn(def,columns=[]){const type=getFieldType(def.fieldType);if(!type)return def;const source=originalColumn(def);const props=fieldPropsOf(source);const filled=type.fill?type.fill(source,props,{columns:columns.map(c=>originalColumn(c))}):{...source};const out=withSummary(filled,props);if(out.groupOrder==null)out.groupOrder=groupOrderOf(out.sortValue);const own=out.editable;if(own!==false&&(fieldEditors(props)||hasCanEditField())){;out.editable=cell=>(typeof own==="function"?own(cell)!==false:true)&&canEditField(source,props,recordOf(cell?.row))}const ruled=(fieldEditors(props)??[]).filter(isFieldToken).map(tokenField);if(ruled.length){const names={};for(const f of ruled){const c=columns.map(x=>originalColumn(x)).find(x=>String(x.field??x.id)===f);if(c)names[f]=String(c.header??f)};out[RULE_NAMES]=names}const fn=out.fieldFn;if(typeof fn==="function")out.fieldFn=row=>isServerGroupRow(row)?void 0:fn(row);const parse=out.valueParser;if(typeof parse==="function")out.valueParser=x=>x.rawInput!==void 0&&x.rawInput===x.oldValue?x.oldValue:parse(x);ORIGINAL.set(out,source);out[SOURCE]=source;return out}export function isServerGroupRow(row){const g=row?.__group;return!!g&&g.kind!=="leaf"}const groupText=v=>Array.isArray(v)?v.map(groupText).join(", "):v==null?"":String(v);const groupCollator=new Intl.Collator(void 0,{numeric:true,sensitivity:"base"});function groupOrderOf(sortValue){return(a,b)=>{const ka=sortValue?sortValue(a):a;const kb=sortValue?sortValue(b):b;const ba=ka==null||ka===""||Array.isArray(ka)&&!ka.length;const bb=kb==null||kb===""||Array.isArray(kb)&&!kb.length;if(ba||bb)return Number(ba)-Number(bb);if(typeof ka==="number"&&typeof kb==="number")return ka-kb;if(typeof ka==="boolean"&&typeof kb==="boolean")return Number(ka)-Number(kb);return groupCollator.compare(groupText(ka),groupText(kb))}}export function originalColumn(def){return def[SOURCE]??ORIGINAL.get(def)??def}export function typeDrawsCell(def){const type=getFieldType(def.fieldType);if(!type?.cell)return false;return type.hasCell?type.hasCell(fieldPropsOf(def)):true}
@@ -1 +1 @@
1
- import{toast as ue}from"@svgrid/grid";import{compileFieldFilter as ce,setFilterWords as pe}from"./filter-model.js";import{cellText as me,fieldColumns as O,primaryIdOf as _,writeCell as k}from"./grid-access.js";import{fieldPropsOf as L,originalColumn as E}from"./registry.svelte.js";import{getFieldUsers as X,getLinkedTable as ee,linkedRows as be}from"./sources.svelte.js";import{canEditField as ge}from"./field-access.svelte.js";import{chooseRowColor as he,chosenRowColor as ye,clearRowColorChoice as we}from"./row-color-choice.svelte.js";import{cellRulesOf as ve,setCellRules as Me}from"./cell-colors.svelte.js";import{defId as $,filterWithout as Te,newRowValues as V,recordCopyValues as ne}from"./field-ops.js";import{openRecord as D}from"./editor-request.svelte.js";import{rowColorOf as Oe,rowMarkColor as Se}from"./row-colors.js";import{recordHeightOf as Ce}from"./row-height.js";import{orderWithReturned as Re}from"./column-order.js";import{askDeleteRecord as Y}from"./record-delete.svelte.js";import{cardRecordMenu as ke}from"./record-menu.js";import{recordActionsFor as Fe}from"./record-actions.js";import{recordSeries as H,recordSeriesEpoch as De}from"./record-series.svelte.js";import{commentsOf as Ie}from"./activity.svelte.js";import{VIEW_MOVE as Ae}from"./base-history.js";import{canCommentIn as Ee,canCreateIn as x,canDeleteIn as G}from"./base-permissions.js";import{bm as p}from"./messages.svelte.js";import{boardLanes as xe,calendarDays as ze,flatRecords as Le,ganttRows as We}from"./view-feed.svelte.js";import{boardWalk as Pe,calendarWalk as je,listWalk as oe,walkOfIds as _e}from"./record-walk.js";pe((e,n)=>{const o=p(e);return o===e?n:o});export const VIEW_TYPES=[{type:"grid",get label(){return p("viewbar.typeGrid")},icon:"M3 5h18v14H3zM3 10h18M3 15h18M9 5v14"},{type:"tree",get label(){return p("viewbar.typeTree")},icon:"M4 5h7M9 11h7M9 17h7M6 5v12h3M6 11h3"},{type:"kanban",get label(){return p("viewbar.typeKanban")},icon:"M4 4h4v16H4zM10 4h4v10h-4zM16 4h4v13h-4z"},{type:"calendar",get label(){return p("viewbar.typeCalendar")},icon:"M4 6h16v14H4zM4 10h16M8 3v4M16 3v4"},{type:"timeline",get label(){return p("viewbar.typeTimeline")},icon:"M3 4v16M6 7h8M9 12h11M6 17h6"},{type:"gantt",get label(){return p("viewbar.typeGantt")},icon:"M4 5h9M7 10h11M10 15h8M4 20h16"},{type:"gallery",get label(){return p("viewbar.typeGallery")},icon:"M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z"},{type:"chart",get label(){return p("viewbar.typeChart")},icon:"M4 20h16M6 20V11M11 20V5M16 20v-7"},{type:"pivot",get label(){return p("viewbar.typePivot")},icon:"M4 4h16v16H4zM4 9h16M9 4v16M13 13h4M13 17h4"},{type:"form",get label(){return p("viewbar.typeForm")},icon:"M6 3h12v18H6zM9 8h6M9 12h6M9 16h3"},{type:"list",get label(){return p("viewbar.typeList")},icon:"M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01"},{type:"inbox",get label(){return p("viewbar.typeInbox")},icon:"M3 13h5l1.5 3h5l1.5-3h5M5.5 5h13L21 13v6H3v-6z"},{type:"dashboard",get label(){return p("viewbar.typeDashboard")},icon:"M4 4h7v9H4zM13 4h7v5h-7zM13 11h7v9h-7zM4 15h7v5H4z"}],viewTypeInfo=e=>VIEW_TYPES.find(n=>n.type===e)??VIEW_TYPES[0];let He=0;export const newViewId=()=>`view-${Date.now().toString(36)}-${He+=1}`;export function sortLabels(e){const n=e?.fieldType,o=e?.cellDataType;return n==="checkbox"||o==="boolean"?["☐ → ☑","☑ → ☐"]:n==="singleSelect"?[p("viewbar.sortFirstLast"),p("viewbar.sortLastFirst")]:n==="checklist"?[p("viewbar.sortDoneUp"),p("viewbar.sortDoneDown")]:n==="color"?[p("viewbar.sortHueUp"),p("viewbar.sortHueDown")]:o==="number"||o==="date"||o==="dateString"||["number","currency","percent","rating","duration","timer","autoNumber","count","date","createdTime","lastModifiedTime","timeOfDay"].includes(n??"")||n==="ai"&&e?.fieldProps?.output==="number"?["1 → 9","9 → 1"]:[p("viewbar.sortAZ"),p("viewbar.sortZA")]}export function colorSettingOf(e,n){const o=Oe(e);return o?"field"in o?{mode:"field",field:o.field}:n?.mode==="conditions"?n:{mode:"none"}:n?.mode==="conditions"?n:{mode:"none"}}export function rowColorFor(e,n,o){if(n.mode==="none")return null;const r=e?.props?.rowColor?.target,t=r?{target:r}:{};if(n.mode==="field")return{field:n.field,...t};const a=new Map(O(e).map(l=>[l.id,l])),s=(l,i)=>{const m=a.get(i),b=m.def.fieldFn;return b?b(l):l?.[m.field]},d=n.rules.map(l=>{if(!a.has(l.condition.column))return null;const i=ce({kind:"fieldFilter",conjunction:"and",conditions:[l.condition]},s,o);return i?{color:l.color,when:m=>i(m)}:null}).filter(l=>!!l);return d.length?{rules:d,...t}:null}export function applyColor(e,n,o){he(e,rowColorFor(e,n,o))}function h(e,n,o){const r=e?.props?.getRowId;if(r)return String(r(o,-1));const t=n.getRowId(o);return t==null?String(o?.id??""):String(t)}export function lanesFor(e){const n=[{id:"",title:p("viewbar.uncategorized"),hideWhenEmpty:!0}];if(e.fieldType==="user"){for(const r of X())n.push({id:r.id,title:r.name});return n}const o=L(E(e.def));for(const r of o.options??[])n.push({id:r.value,title:r.value,...r.color?{color:r.color}:{}});return n}export const stackableColumns=e=>O(e).filter(n=>n.fieldType==="singleSelect"||n.fieldType==="user"&&!n.def.fieldProps?.multiple),laneColumns=e=>O(e).filter(n=>n.fieldType==="singleSelect"||n.fieldType==="user"||n.fieldType==="link");function W(e,n){const o=n?.[e.field],r=Array.isArray(o)?o[0]:o;return r==null||r===""?"":String(typeof r=="object"?r.id??"":r)}function te(e,n){if(n==="")return p("viewbar.uncategorized");if(e.fieldType==="user")return X().find(o=>String(o.id)===n)?.name??n;if(e.fieldType==="link"){const o=ee(L(E(e.def)).table),r=o?be(o,n)[0]:void 0;return r&&o?String(r[o.primaryField]??n):n}return n}function U(e,n,o,r){const t=n?.[e.field];if(!(Array.isArray(t)||e.fieldType==="link"||e.fieldType==="user"&&!!e.def.fieldProps?.multiple))return r===""?null:r;const d=(Array.isArray(t)?t:t==null||t===""?[]:[t]).map(l=>String(l&&typeof l=="object"?l.id??"":l)).filter(l=>l!==o&&l!==r);return r===""?d:[r,...d]}export const dateColumns=e=>O(e).filter(n=>n.fieldType==="date"||n.def.cellDataType==="date"||n.def.cellDataType==="dateString"),progressColumns=e=>O(e).filter(n=>n.fieldType==="percent"||n.fieldType==="number"&&L(E(n.def)).format==="percent"),dependencyColumns=e=>O(e).filter(n=>{if(n.fieldType!=="link")return!1;const o=ee(L(E(n.def)).table);if(!o)return!1;if(o.records)return o.id===e.props?.baseTableId;const r=typeof o.rows=="function"?o.rows():o.rows;return r===e.internalData||r.length>0&&r[0]===e.internalData?.[0]});export function applyGanttSettings(e,n,o,r){const t=_(e),a=r??O(e).find(s=>s.id===t)?.field;o.type==="gantt"?n.setOption("gantt",le(e,n,o,a)):o.type==="calendar"?n.setOption("scheduler",Z(e,n,o,a)):o.type==="timeline"&&n.setOption("scheduler",se(e,n,o,a))}export const coverColumns=e=>O(e).filter(n=>n.fieldType==="attachment");const I=e=>e?.props?.baseFeed??null;function q(e,n,o,r=!1){if(I(e)&&typeof e.props.baseServerAdd=="function")return void e.props.baseServerAdd(o,r);n.addRow(o,"bottom"),e.props.onRowAdd?.({row:o}),r&&queueMicrotask(()=>{const t=h(e,n,o);e.props.baseFilling?.(t),D({ctrl:e,rowId:t,editPrimary:!0})})}const Ve=200;function Ge(e,n,o,r){const t=(e.allRowsBeforePagination??e.allRows??[]).filter(d=>!e.isGroupRow?.(d)&&d.original),a=new Set(r.map(d=>d.id)),s=d=>{const l=d.original[o.field],i=l==null?"":String(l);return a.has(i)?i:""};return r.flatMap(d=>t.filter(l=>s(l)===d.id).map(l=>h(e,n,l.original)))}export function boardConfig(e,n,o){const r=O(e),t=r.find(i=>i.id===o.stackBy);if(!t)return;const a=r.find(i=>i.id===_(e)),s=I(e),d=lanesFor(t),l=s?xe(s,t):null;return{groupBy:t.field,lanes:d,text:Ye,...l?{server:l,walk:Pe(s,d,l,i=>h(e,n,i))}:{walk:_e(()=>Ge(e,n,t,d))},...a?{titleField:a.field}:{},cardFields:r.filter(i=>i.visible&&i!==a&&i!==t).slice(0,3).map(i=>i.field),searchable:!1,virtualized:!!s||(e.props?.data?.length??0)>Ve,moveCards:C(e)&&A(t),controlled:!0,otherLane:"",onCardMove:i=>{i.toLane!==i.fromLane&&P(e,()=>k(e,h(e,n,i.row),t.id,i.toLane===""?null:i.toLane))},onCardClick:i=>D({ctrl:e,rowId:h(e,n,i)}),onCardEdit:i=>D({ctrl:e,rowId:h(e,n,i)}),commentCount:i=>Ie(e,h(e,n,i)).length,onCommentsOpen:i=>D({ctrl:e,rowId:h(e,n,i),focus:"comment"}),cellGrid:cardGrid(e),onCardReorder:i=>{const m=(n.getState?.()?.sorting??[])[0],b=m?r.find(S=>S.id===m.id):void 0;if(!(!!b&&(b.fieldType==="number"||b.fieldType==="rating"||b.fieldType==="currency"||b.fieldType==="percent")&&A(b)&&C(e)))return s&&ue.info(p("viewbar.sortToOrder")),!1;const u=S=>Number(S?.[b.field]),c=u(i.before),g=u(i.after),v=m.desc?-1:1,R=i.before&&i.after?(c+g)/2:i.before?c+v:i.after?g-v:NaN;if(!Number.isFinite(R))return!1;const M=h(e,n,i.row);return P(e,()=>k(e,M,b.id,R)),s&&n.getOption("board")?.server?.seat(i.laneId,M,i.before?h(e,n,i.before):null),!0},cardMenu:(i,m)=>{const b=!!e.editingEnabled;return[{label:p("viewbar.expandRecord"),onSelect:()=>D({ctrl:e,rowId:h(e,n,i)})},...Ee(e)?[{label:p("viewbar.comment"),onSelect:()=>D({ctrl:e,rowId:h(e,n,i),focus:"comment"})}]:[],...Fe(e.props?.baseTableId).map(y=>({label:y.label,onSelect:()=>y.run({tableId:e.props?.baseTableId,rowId:String(h(e,n,i)),row:i??{}})})),...b?[...A(t)?[{label:p("viewbar.moveTo"),children:m.lanes.map(y=>({label:y.title??(y.id||p("viewbar.empty")),onSelect:()=>m.moveTo(y.id)}))}]:[],...x(e)?[{label:p("viewbar.duplicateRecord"),onSelect:()=>ae(e,n,i)}]:[],...G(e)?[{separator:!0},{label:p("viewbar.deleteRecord"),onSelect:()=>Y({ctrl:e,api:n,row:i})}]:[]]:[]]},composer:C(e)&&x(e),onCardAdd:!C(e)||!x(e)?void 0:(i,m)=>{const b=O(e).find(g=>g.id===_(e)),y=e.props.rowAdder,u=y&&typeof y=="object"&&typeof y.defaults=="function"?y.defaults():{},c=V(e,{...u,[t.field]:i===""?null:i,...b&&m?{[b.field]:m}:{}});q(e,n,c)}}}export function galleryConfig(e,n,o){const r=O(e),t=r.find(i=>i.id===_(e))??r.find(i=>i.visible),a=r.find(i=>i.id===o.coverField),s=I(e),d=s?Le(s):null,l=ke(()=>n,()=>e);return{...d?{server:d,walk:oe(s,d,i=>h(e,n,i))}:{},...a?{coverField:a.field}:{},...t?{titleField:t.field}:{},cardFields:r.filter(i=>i.visible&&i!==t&&i!==a).map(i=>i.field),searchable:!1,onCardClick:i=>D({ctrl:e,rowId:h(e,n,i)}),cardMenu:i=>l(i,h(e,n,i)),isSelected:i=>!!e.isRowSelected?.(h(e,n,i),i),text:Ne,cellGrid:cardGrid(e)}}const Ne={get records(){return p("viewbar.recordsList")},get cardActions(){return p("viewbar.board.cardActions")},get selected(){return p("viewbar.selectedCard")},get untitled(){return p("viewbar.untitled")}};export function cardGrid(e){return(n,o=!1)=>new Proxy(e,{get:(r,t)=>{if(t==="getColumnWidth")return()=>n;if(t==="editingEnabled")return!1;if(t==="insideButton")return o;const a=Reflect.get(r,t,r);return typeof a=="function"?a.bind(r):a}})}const N=e=>e.fieldType==="date"&&!e.def.fieldProps?.time||e.def.cellDataType==="dateString";function F(e,n){if(!N(e))return n.toISOString();const o=r=>String(r).padStart(2,"0");return`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())}`}function Be(e,n,o){if(o?.mode==="conditions"){const a=rowColorFor(e,o)?.rules;return a?.length?{colorOf:s=>a.find(d=>d.when(s))?.color}:{}}if(o?.mode!=="field")return{};const r=n.find(a=>a.field===o.field);if(!r||r.fieldType!=="singleSelect")return{};const t=lanesFor(r).filter(a=>a.id!==""&&a.color).map(({id:a,title:s,color:d})=>({id:a,title:s,color:d}));return t.length?{calendars:t,calendarField:r.field}:{}}function $e(e,n,o,r,t){const s=(n.listFields?.length?n.listFields.map(d=>e.find(l=>l.id===d)).filter(d=>!!d):e.filter(d=>d.visible)).filter(d=>d.field!==o&&d.id!==r&&d.id!==t).slice(0,2);return s.length?{detailsOf:d=>s.map(l=>{const i=d,m=l.def.fieldFn;return me(l,m?m(i):i?.[l.field],d)}).filter(l=>l!==""&&l!==p("viewbar.valueUnchecked")).join(" · ")}:{}}const Ye=Object.defineProperties({},Object.fromEntries(["board","addCard","addCardTo","cardTitle","noCards","cardActions","clearFilters","blocked","age","comments","writeComment","deleteComment","addSubtask","rename","cancel","save","grabbed","dropped","movedTo","movedUp","movedDown","movedPosition","cancelled","wipLimit","cannotMove","cardBlocked","selected","deselected"].map(e=>[e,{enumerable:!0,get:()=>p(`viewbar.board.${e}`)}]))),re=Object.defineProperties({},Object.fromEntries(["month","week","day","agenda","today","previous","next","allDay","more","noEvents","eventsColumn","edit","duplicate","delete","moveGrabbed","moveDone","moveCancelled","moveBlocked","scopeEdit","scopeDelete","scopeOccurrence","scopeFollowing","scopeSeries","upcoming"].map(e=>[e,{enumerable:!0,get:()=>p(`viewbar.calendar.${e}`)}]))),Ue=Object.defineProperties({},{...Object.getOwnPropertyDescriptors(re),...Object.fromEntries(["timelineDay","timelineWeek","timelineMonth","timelineYear"].map(e=>[e,{enumerable:!0,get:()=>p(`viewbar.calendar.${e}`)}]))}),qe=Object.defineProperties({},Object.fromEntries(["expandAll","collapseAll","expandTask","collapseTask","zoomIn","zoomOut","zoomDay","zoomWeek","zoomMonth","zoomQuarter","zoomYear","tableLabel","chartLabel","resizeTable","days","progress","slack","start","finish","progressPercent","task","milestone","day","daysCount","open","openTask","edit","addSubtask","delete","deleteTask","removeLink","taskActions","save","cancel","onBaseline","laterThanBaseline","aheadOfBaseline","dragProgress","linkFromStart","linkFromFinish","workingDays","onCriticalPath","daysOfSlack","notMet","peak","loadOf","moveGrabbed","moveDone","moveCancelled","resized","progressSet","upcoming"].map(e=>[e,{enumerable:!0,get:()=>p(`viewbar.gantt.${e}`)}])));function Z(e,n,o,r,t){const a=O(e),s=a.find(u=>u.id===o.dateField);if(!s)return;const d=a.find(u=>u.id===o.endField),l=!!t&&A(t),i=u=>{const c=h(e,n,u.row);P(e,()=>{if(k(e,c,s.id,F(s,u.start)),d&&k(e,c,d.id,u.end.getTime()>u.start.getTime()?K(d,u.end):F(d,u.start)),t&&l&&u.toResource!=null){const g=u.fromResource??W(t,u.row);u.toResource!==g&&k(e,c,t.id,U(t,u.row,g,u.toResource))}}),e.props.baseReflow?.()},m=(u,c)=>({[s.field]:F(s,u),...d?{[d.field]:c.getTime()>u.getTime()?K(d,c):F(d,u)}:{}}),b=C(e)&&A(s)&&(!d||A(d)),y=t===void 0?I(e):null;return{...y?{server:ze(y,s,d,(u,c)=>e.props.baseOpenDay?.(u,c)),walk:je(y,s,u=>h(e,n,u))}:{},searchable:!1,text:re,editable:b,history:b&&!de(e),controlled:!0,tooltip:!0,onEventOpen:u=>D({ctrl:e,rowId:h(e,n,u)}),onEventDelete:C(e)?u=>Y({ctrl:e,api:n,row:u}):void 0,startField:s.field,...d?{endField:d.field}:{},...r?{titleField:r}:{},...N(s)?{allDay:!0}:{},...Be(e,a,o.color),...$e(a,o,r,s.id,d?.id),onEventMove:i,...d?{onEventResize:i}:{resizable:!1},onEventAdd:!C(e)||!x(e)?void 0:(u,c,g)=>{const v=e.props.rowAdder,R=v&&typeof v=="object"&&typeof v.defaults=="function"?v.defaults():{},M=t&&l&&g?{[t.field]:U(t,{},void 0,g)}:{},S=V(e,{...R,...M,...m(u,c)});q(e,n,S,!0)},onEventDuplicate:!C(e)||!x(e)?void 0:(u,c,g)=>ae(e,n,u,m(c,g)),...ie(e,n,b,s,y,u=>({...m(u.start,u.end),...t&&l&&u.toResource!=null&&u.toResource!==(u.fromResource??W(t,u.row))?{[t.field]:U(t,u.row,u.fromResource??W(t,u.row),u.toResource)}:{}}))}}function ie(e,n,o,r,t,a){const s=e.props?.baseTableId;if(typeof s!="string"||!s)return{};const d=O(e),l=new Map(d.map(c=>[c.id,c.field])),i=new Map(d.map(c=>[c.field,c.id])),m=c=>Object.fromEntries(Object.entries(c??{}).map(([g,v])=>[l.get(g)??g,v])),b=c=>Object.fromEntries(Object.entries(c).map(([g,v])=>[i.get(g)??g,v])),y=new WeakMap,u=c=>y.get(c)??c;return{upcoming:{enabled:()=>!!H(),epoch:()=>De(s),idOf:c=>String(h(e,n,c)),load:async(c,g)=>{const v=await H()?.occurrences(s,c,g)??[],R=t&&v.length?await Ze(t,[...new Set(v.map(M=>String(M.rowId)))],M=>String(h(e,n,M))):null;return v.flatMap(M=>{const S=R?.get(String(M.rowId));if(R&&!S)return[];const z={rowId:String(M.rowId),day:M.day,values:m(M.values),...S?{row:S}:{}};return y.set(z,M),[z]})},open:c=>H()?.open(s,u(c)),...o&&a?{move:(c,g,v)=>H()?.move(s,u(c),g,b(a(v))),canMove:c=>Qe(e,n,c,r)}:{},...C(e)&&G(e)?{remove:(c,g)=>H()?.remove(s,u(c),g)}:{}}}}const Q=200;async function Ze(e,n,o){const r=new Map;for(let t=0;t<n.length&&t<Q*5;t+=Q){const a=n.slice(t,t+Q),s=new Set(a);try{const d=await e.ask({startRow:0,endRow:a.length,columns:{id:{operator:"in",value:"",selectedValues:a}}});for(const l of d.rows??[]){const i=o(l);s.has(i)&&r.set(i,l)}}catch{}}return r}function Qe(e,n,o,r){const t=String(h(e,n,o)),a=(e.allRows??[]).find(d=>d.id===t);if(!a||typeof e.isCellEditable!="function")return!0;const s=(e.allColumns??[]).find(d=>d.id===r.id);return!s||e.isCellEditable(s,a)!==!1}const Ke={day:"timelineDay",week:"timelineWeek",month:"timelineMonth",year:"timelineYear"};function se(e,n,o,r){const t=laneColumns(e).find(d=>d.id===o.laneField)??null,a=Z(e,n,o,r,t);if(!a)return;let s;if(t&&(t.fieldType==="singleSelect"||t.fieldType==="user")){const d=e.props?.data??[];s=lanesFor(t).filter(i=>i.id!==""||d.some(m=>W(t,m)==="")).map(({id:i,title:m,color:b})=>({id:i,title:m,...b?{color:b}:{}}));const l=new Set(s.map(i=>i.id));for(const i of d){const m=W(t,i);l.has(m)||(l.add(m),s.push({id:m,title:te(t,m)}))}}return{...a,views:["timelineDay","timelineWeek","timelineMonth","timelineYear"],initialView:Ke[o.zoom??""]??"timelineMonth",text:Ue,...t?{resourceField:t.field,resourceOf:d=>W(t,d),resourceTitle:d=>te(t,d),resourceLegend:!1,...s?{resources:s}:{}}:{}}}const A=e=>e.def.editable!==!1&&ge(E(e.def),L(E(e.def))),C=e=>e.props.editable!==!1&&!!(e.props.editable??e.props.enableInlineEditing);let Je=0,B=null;function P(e,n){const o=e.historyGroupId;B||(B=`${Ae}${Je+=1}`,queueMicrotask(()=>B=null)),e.historyGroupId=o??B;try{n()}finally{e.historyGroupId=o}}const de=e=>!!e.props?.baseTableId;function K(e,n){return N(e)?F(e,new Date(n.getFullYear(),n.getMonth(),n.getDate()-1)):F(e,n)}function ae(e,n,o,r={}){if(!x(e))return;const t=h(e,n,o),a=e.internalData,s=a.findIndex(l=>h(e,n,l)===t);if((e.props.rowModel||I(e))&&typeof e.props.baseServerAdd=="function"){const{__group:l,...i}=ne(e,s<0?o:a[s]);return e.props.baseServerAdd({...i,...r})}if(s<0)return;const d=V(e,{...ne(e,a[s]),...r});n.addRow(d,s+1),e.props.onRowAdd?.({row:d})}export function deleteRecord(e,n,o){if(!G(e))return;const r=h(e,n,o),t=e.internalData,a=t.findIndex(d=>h(e,n,d)===r);if(a<0)return;const s=t[a];!e.props.rowModel&&!I(e)&&n.removeRows([a]),e.props.onRowsDelete?.({rows:[s],ids:[r],data:e.internalData})}const Xe=124,J=new WeakMap;function le(e,n,o,r){J.delete(e);const t=O(e),a=t.find(f=>f.id===o.dateField);if(!a)return;const s=t.find(f=>f.id===o.endField),d=t.find(f=>f.id===o.progressField),l=t.find(f=>f.id===o.dependencyField&&f.fieldType==="link"),m=[(f=>t.find(w=>w.field===f)?.id)(r),a.id,s?.id].filter(f=>!!f),b=f=>h(e,n,f),y=!!e.props?.basePhone,u=o.color&&o.color.mode!=="none"?f=>Se(e,f)??void 0:void 0,c=f=>K(s,f),g=(f,w,T)=>{k(e,f,a.id,F(a,w)),s&&k(e,f,s.id,T.getTime()>w.getTime()?c(T):F(s,w))},v=!!(d&&L(E(d.def)).points),R=f=>{const T=e.internalData.find(j=>b(j)===f)?.[l.field];return Array.isArray(T)?T.map(String):T==null||T===""?[]:[String(T)]},M=C(e)&&A(a)&&(!s||A(s)),S=I(e),z=S?We(S,a,s,l):null;return{...z?{server:z,walk:oe(S,z.list,b)}:{},searchable:!1,startField:a.field,...s?{endField:s.field}:{},...r?{titleField:r}:{},tableColumns:y?m.slice(0,1):[...new Set(m),"__duration"],...y?{tableWidth:Xe}:{},tableColumnWidths:Object.fromEntries([a,s].filter(f=>!!f).map(f=>[f.id,N(f)?144:176])),...u?{colorOf:u}:{},...o.zoom?{zoom:o.zoom}:{},tooltip:!0,text:qe,pickUpToMove:!0,respectWorkingTime:!1,editable:M,history:M&&!de(e),controlled:!0,onTaskOpen:f=>D({ctrl:e,rowId:b(f)}),onTaskMove:f=>{P(e,()=>{g(b(f.row),f.start,f.end);for(const w of f.subtree??[])g(b(w.row),w.start,w.end)}),e.props.baseReflow?.()},onTaskResize:f=>{P(e,()=>g(b(f.row),f.start,f.end)),e.props.baseReflow?.()},onDependenciesChange:f=>{P(e,()=>{for(const w of f)g(w.id,w.start,w.end)}),e.props.baseReflow?.()},...d?{progressField:d.field,...v?{}:{progressValue:f=>Number(f?.[d.field]??0)*100},onProgressChange:f=>k(e,b(f.row),d.id,v?f.progress:f.progress/100)}:{},...l?{predecessorField:l.field,onDependencyAdd:f=>{const w=R(f.to);w.includes(f.from)||k(e,f.to,l.id,[...w,f.from])},onDependencyRemove:f=>{const[w,T]=f.split("->");w&&T&&k(e,T,l.id,R(T).filter(j=>j!==w))}}:{},onZoomChange:f=>{J.set(e,f)},...ie(e,n,!1,a,null),onTaskAdd:!C(e)||!x(e)?void 0:(f,w)=>{const T=e.props.rowAdder,j=T&&typeof T=="object"&&typeof T.defaults=="function"?T.defaults():{},fe=V(e,{...j,[a.field]:F(a,f),...s?{[s.field]:w.getTime()>f.getTime()?c(w):F(s,f)}:{}});q(e,n,fe,!0)},onTaskDelete:C(e)&&G(e)?f=>Y({ctrl:e,api:n,row:f}):void 0}}const en=e=>e.state?.advancedFilter??null;export function viewsWithoutFields(e,n,o=""){const r=[],t=e?.map(a=>{const s=en(a),d=Te(s,n);return d===s?a:(r.push({table:o,view:a.id,was:s,now:d}),{...a,state:{...a.state,advancedFilter:d}})});return{views:r.length?t:e,changes:r}}export function filterChangesOf(e,n){return n.flatMap(o=>{const r=e.find(s=>s.id===o.id);if(!r)return[];const t=new Set(o.columns.map(s=>$(s))),a=new Set(r.columns.map(s=>$(s)).filter(s=>!t.has(s)));return a.size?viewsWithoutFields(o.views,s=>a.has(s),o.id).changes:[]})}export function applyViewFilters(e,n,o){return e.map(r=>{const t=n.filter(a=>a.table===r.id);return t.length?{...r,views:r.views?.map(a=>{const s=t.find(d=>d.view===a.id);return s?{...a,state:{...a.state,advancedFilter:s[o]}}:a})}:r})}export const PLAIN_STATE={sorting:[],grouping:[],hiddenColumns:[],advancedFilter:null};export function captureView(e,n,o){const r={...n.getState()};delete r.pagination,delete r.chart,delete r.charts,delete r.chartActive,delete r.globalFilter;const t=Ce(n.getOption("rowHeight")),a=o.type==="gantt"?J.get(e):void 0,{color:s,cellColors:d,...l}=o,i=ye(e)===void 0?void 0:colorSettingOf(e,o.color),m=ve(e);return{...l,state:r,...typeof t=="number"?{rowHeight:t}:{},...a?{zoom:a}:{},...i?{color:i}:{},...m.length?{cellColors:m}:{}}}const nn=e=>(e?.internalColumns??[]).filter(n=>n.field!=null).map(n=>$(n));export function applyView(e,n,o,r={}){const t={...PLAIN_STATE,...o.state??{},globalFilter:""};Array.isArray(t.columnOrder)&&t.columnOrder.length&&(t.columnOrder=Re(t.columnOrder,nn(e))),n.setState(t),I(e)?.readQuery?.();const a=o.state;a?.grouping?.length&&a.expanded===void 0&&setTimeout(()=>{e.props?.rowModel||n.expandAllGroups?.()},0),o.rowHeight!=null&&n.setOption("rowHeight",o.rowHeight),o.color?applyColor(e,o.color,r.linkNames):we(e),Me(e,o.cellColors??[]),n.setOption("board",o.type==="kanban"?boardConfig(e,n,o):void 0),n.setOption("gallery",o.type==="gallery"?galleryConfig(e,n,o):void 0);const s=_(e),d=r.primaryField??O(e).find(l=>l.id===s)?.field;n.setOption("scheduler",o.type==="calendar"?Z(e,n,o,d):o.type==="timeline"?se(e,n,o,d):void 0),n.setOption("gantt",o.type==="gantt"?le(e,n,o,d):void 0)}
1
+ import{toast as ce}from"@svgrid/grid";import{compileFieldFilter as pe,setFilterWords as me}from"./filter-model.js";import{cellText as be,fieldColumns as O,primaryIdOf as _,writeCell as k}from"./grid-access.js";import{fieldPropsOf as L,originalColumn as E}from"./registry.svelte.js";import{getFieldUsers as J,getLinkedTable as X,linkedRows as ge}from"./sources.svelte.js";import{canEditField as he}from"./field-access.svelte.js";import{chooseRowColor as ye,chosenRowColor as we,clearRowColorChoice as ve}from"./row-color-choice.svelte.js";import{cellRulesOf as Me,setCellRules as Te}from"./cell-colors.svelte.js";import{defId as B,filterWithout as Oe,newRowValues as V,recordCopyValues as ee}from"./field-ops.js";import{openRecord as D}from"./editor-request.svelte.js";import{rowColorOf as Se,rowMarkColor as Ce}from"./row-colors.js";import{recordHeightOf as Re}from"./row-height.js";import{orderWithReturned as ke}from"./column-order.js";import{askDeleteRecord as $}from"./record-delete.svelte.js";import{cardRecordMenu as Fe}from"./record-menu.js";import{recordActionsFor as De}from"./record-actions.js";import{recordSeries as H,recordSeriesEpoch as Ie}from"./record-series.svelte.js";import{commentsOf as Ae}from"./activity.svelte.js";import{VIEW_MOVE as Ee}from"./base-history.js";import{canCommentIn as xe,canCreateIn as x,canDeleteIn as ne,canDeleteRecord as oe}from"./base-permissions.js";import{bm as p}from"./messages.svelte.js";import{boardLanes as ze,calendarDays as Le,flatRecords as We,ganttRows as Pe}from"./view-feed.svelte.js";import{boardWalk as je,calendarWalk as _e,listWalk as te,walkOfIds as He}from"./record-walk.js";me((e,n)=>{const o=p(e);return o===e?n:o});export const VIEW_TYPES=[{type:"grid",get label(){return p("viewbar.typeGrid")},icon:"M3 5h18v14H3zM3 10h18M3 15h18M9 5v14"},{type:"tree",get label(){return p("viewbar.typeTree")},icon:"M4 5h7M9 11h7M9 17h7M6 5v12h3M6 11h3"},{type:"kanban",get label(){return p("viewbar.typeKanban")},icon:"M4 4h4v16H4zM10 4h4v10h-4zM16 4h4v13h-4z"},{type:"calendar",get label(){return p("viewbar.typeCalendar")},icon:"M4 6h16v14H4zM4 10h16M8 3v4M16 3v4"},{type:"timeline",get label(){return p("viewbar.typeTimeline")},icon:"M3 4v16M6 7h8M9 12h11M6 17h6"},{type:"gantt",get label(){return p("viewbar.typeGantt")},icon:"M4 5h9M7 10h11M10 15h8M4 20h16"},{type:"gallery",get label(){return p("viewbar.typeGallery")},icon:"M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z"},{type:"chart",get label(){return p("viewbar.typeChart")},icon:"M4 20h16M6 20V11M11 20V5M16 20v-7"},{type:"pivot",get label(){return p("viewbar.typePivot")},icon:"M4 4h16v16H4zM4 9h16M9 4v16M13 13h4M13 17h4"},{type:"form",get label(){return p("viewbar.typeForm")},icon:"M6 3h12v18H6zM9 8h6M9 12h6M9 16h3"},{type:"list",get label(){return p("viewbar.typeList")},icon:"M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01"},{type:"inbox",get label(){return p("viewbar.typeInbox")},icon:"M3 13h5l1.5 3h5l1.5-3h5M5.5 5h13L21 13v6H3v-6z"},{type:"dashboard",get label(){return p("viewbar.typeDashboard")},icon:"M4 4h7v9H4zM13 4h7v5h-7zM13 11h7v9h-7zM4 15h7v5H4z"}],viewTypeInfo=e=>VIEW_TYPES.find(n=>n.type===e)??VIEW_TYPES[0];let Ve=0;export const newViewId=()=>`view-${Date.now().toString(36)}-${Ve+=1}`;export function sortLabels(e){const n=e?.fieldType,o=e?.cellDataType;return n==="checkbox"||o==="boolean"?["☐ → ☑","☑ → ☐"]:n==="singleSelect"?[p("viewbar.sortFirstLast"),p("viewbar.sortLastFirst")]:n==="checklist"?[p("viewbar.sortDoneUp"),p("viewbar.sortDoneDown")]:n==="color"?[p("viewbar.sortHueUp"),p("viewbar.sortHueDown")]:o==="number"||o==="date"||o==="dateString"||["number","currency","percent","rating","duration","timer","autoNumber","count","date","createdTime","lastModifiedTime","timeOfDay"].includes(n??"")||n==="ai"&&e?.fieldProps?.output==="number"?["1 → 9","9 → 1"]:[p("viewbar.sortAZ"),p("viewbar.sortZA")]}export function colorSettingOf(e,n){const o=Se(e);return o?"field"in o?{mode:"field",field:o.field}:n?.mode==="conditions"?n:{mode:"none"}:n?.mode==="conditions"?n:{mode:"none"}}export function rowColorFor(e,n,o){if(n.mode==="none")return null;const r=e?.props?.rowColor?.target,t=r?{target:r}:{};if(n.mode==="field")return{field:n.field,...t};const a=new Map(O(e).map(l=>[l.id,l])),s=(l,i)=>{const m=a.get(i),b=m.def.fieldFn;return b?b(l):l?.[m.field]},d=n.rules.map(l=>{if(!a.has(l.condition.column))return null;const i=pe({kind:"fieldFilter",conjunction:"and",conditions:[l.condition]},s,o);return i?{color:l.color,when:m=>i(m)}:null}).filter(l=>!!l);return d.length?{rules:d,...t}:null}export function applyColor(e,n,o){ye(e,rowColorFor(e,n,o))}function h(e,n,o){const r=e?.props?.getRowId;if(r)return String(r(o,-1));const t=n.getRowId(o);return t==null?String(o?.id??""):String(t)}export function lanesFor(e){const n=[{id:"",title:p("viewbar.uncategorized"),hideWhenEmpty:!0}];if(e.fieldType==="user"){for(const r of J())n.push({id:r.id,title:r.name});return n}const o=L(E(e.def));for(const r of o.options??[])n.push({id:r.value,title:r.value,...r.color?{color:r.color}:{}});return n}export const stackableColumns=e=>O(e).filter(n=>n.fieldType==="singleSelect"||n.fieldType==="user"&&!n.def.fieldProps?.multiple),laneColumns=e=>O(e).filter(n=>n.fieldType==="singleSelect"||n.fieldType==="user"||n.fieldType==="link");function W(e,n){const o=n?.[e.field],r=Array.isArray(o)?o[0]:o;return r==null||r===""?"":String(typeof r=="object"?r.id??"":r)}function re(e,n){if(n==="")return p("viewbar.uncategorized");if(e.fieldType==="user")return J().find(o=>String(o.id)===n)?.name??n;if(e.fieldType==="link"){const o=X(L(E(e.def)).table),r=o?ge(o,n)[0]:void 0;return r&&o?String(r[o.primaryField]??n):n}return n}function Y(e,n,o,r){const t=n?.[e.field];if(!(Array.isArray(t)||e.fieldType==="link"||e.fieldType==="user"&&!!e.def.fieldProps?.multiple))return r===""?null:r;const d=(Array.isArray(t)?t:t==null||t===""?[]:[t]).map(l=>String(l&&typeof l=="object"?l.id??"":l)).filter(l=>l!==o&&l!==r);return r===""?d:[r,...d]}export const dateColumns=e=>O(e).filter(n=>n.fieldType==="date"||n.def.cellDataType==="date"||n.def.cellDataType==="dateString"),progressColumns=e=>O(e).filter(n=>n.fieldType==="percent"||n.fieldType==="number"&&L(E(n.def)).format==="percent"),dependencyColumns=e=>O(e).filter(n=>{if(n.fieldType!=="link")return!1;const o=X(L(E(n.def)).table);if(!o)return!1;if(o.records)return o.id===e.props?.baseTableId;const r=typeof o.rows=="function"?o.rows():o.rows;return r===e.internalData||r.length>0&&r[0]===e.internalData?.[0]});export function applyGanttSettings(e,n,o,r){const t=_(e),a=r??O(e).find(s=>s.id===t)?.field;o.type==="gantt"?n.setOption("gantt",fe(e,n,o,a)):o.type==="calendar"?n.setOption("scheduler",q(e,n,o,a)):o.type==="timeline"&&n.setOption("scheduler",de(e,n,o,a))}export const coverColumns=e=>O(e).filter(n=>n.fieldType==="attachment");const I=e=>e?.props?.baseFeed??null;function U(e,n,o,r=!1){if(I(e)&&typeof e.props.baseServerAdd=="function")return void e.props.baseServerAdd(o,r);n.addRow(o,"bottom"),e.props.onRowAdd?.({row:o}),r&&queueMicrotask(()=>{const t=h(e,n,o);e.props.baseFilling?.(t),D({ctrl:e,rowId:t,editPrimary:!0})})}const Ge=200;function Ne(e,n,o,r){const t=(e.allRowsBeforePagination??e.allRows??[]).filter(d=>!e.isGroupRow?.(d)&&d.original),a=new Set(r.map(d=>d.id)),s=d=>{const l=d.original[o.field],i=l==null?"":String(l);return a.has(i)?i:""};return r.flatMap(d=>t.filter(l=>s(l)===d.id).map(l=>h(e,n,l.original)))}export function boardConfig(e,n,o){const r=O(e),t=r.find(i=>i.id===o.stackBy);if(!t)return;const a=r.find(i=>i.id===_(e)),s=I(e),d=lanesFor(t),l=s?ze(s,t):null;return{groupBy:t.field,lanes:d,text:Ue,...l?{server:l,walk:je(s,d,l,i=>h(e,n,i))}:{walk:He(()=>Ne(e,n,t,d))},...a?{titleField:a.field}:{},cardFields:r.filter(i=>i.visible&&i!==a&&i!==t).slice(0,3).map(i=>i.field),searchable:!1,virtualized:!!s||(e.props?.data?.length??0)>Ge,moveCards:C(e)&&A(t),controlled:!0,otherLane:"",onCardMove:i=>{i.toLane!==i.fromLane&&P(e,()=>k(e,h(e,n,i.row),t.id,i.toLane===""?null:i.toLane))},onCardClick:i=>D({ctrl:e,rowId:h(e,n,i)}),onCardEdit:i=>D({ctrl:e,rowId:h(e,n,i)}),commentCount:i=>Ae(e,h(e,n,i)).length,onCommentsOpen:i=>D({ctrl:e,rowId:h(e,n,i),focus:"comment"}),cellGrid:cardGrid(e),onCardReorder:i=>{const m=(n.getState?.()?.sorting??[])[0],b=m?r.find(S=>S.id===m.id):void 0;if(!(!!b&&(b.fieldType==="number"||b.fieldType==="rating"||b.fieldType==="currency"||b.fieldType==="percent")&&A(b)&&C(e)))return s&&ce.info(p("viewbar.sortToOrder")),!1;const u=S=>Number(S?.[b.field]),c=u(i.before),g=u(i.after),v=m.desc?-1:1,R=i.before&&i.after?(c+g)/2:i.before?c+v:i.after?g-v:NaN;if(!Number.isFinite(R))return!1;const M=h(e,n,i.row);return P(e,()=>k(e,M,b.id,R)),s&&n.getOption("board")?.server?.seat(i.laneId,M,i.before?h(e,n,i.before):null),!0},cardMenu:(i,m)=>{const b=!!e.editingEnabled;return[{label:p("viewbar.expandRecord"),onSelect:()=>D({ctrl:e,rowId:h(e,n,i)})},...xe(e)?[{label:p("viewbar.comment"),onSelect:()=>D({ctrl:e,rowId:h(e,n,i),focus:"comment"})}]:[],...De(e.props?.baseTableId).map(y=>({label:y.label,onSelect:()=>y.run({tableId:e.props?.baseTableId,rowId:String(h(e,n,i)),row:i??{}})})),...b?[...A(t)?[{label:p("viewbar.moveTo"),children:m.lanes.map(y=>({label:y.title??(y.id||p("viewbar.empty")),onSelect:()=>m.moveTo(y.id)}))}]:[],...x(e)?[{label:p("viewbar.duplicateRecord"),onSelect:()=>le(e,n,i)}]:[],...oe(e,i)?[{separator:!0},{label:p("viewbar.deleteRecord"),onSelect:()=>$({ctrl:e,api:n,row:i})}]:[]]:[]]},composer:C(e)&&x(e),onCardAdd:!C(e)||!x(e)?void 0:(i,m)=>{const b=O(e).find(g=>g.id===_(e)),y=e.props.rowAdder,u=y&&typeof y=="object"&&typeof y.defaults=="function"?y.defaults():{},c=V(e,{...u,[t.field]:i===""?null:i,...b&&m?{[b.field]:m}:{}});U(e,n,c)}}}export function galleryConfig(e,n,o){const r=O(e),t=r.find(i=>i.id===_(e))??r.find(i=>i.visible),a=r.find(i=>i.id===o.coverField),s=I(e),d=s?We(s):null,l=Fe(()=>n,()=>e);return{...d?{server:d,walk:te(s,d,i=>h(e,n,i))}:{},...a?{coverField:a.field}:{},...t?{titleField:t.field}:{},cardFields:r.filter(i=>i.visible&&i!==t&&i!==a).map(i=>i.field),searchable:!1,onCardClick:i=>D({ctrl:e,rowId:h(e,n,i)}),cardMenu:i=>l(i,h(e,n,i)),isSelected:i=>!!e.isRowSelected?.(h(e,n,i),i),text:Be,cellGrid:cardGrid(e)}}const Be={get records(){return p("viewbar.recordsList")},get cardActions(){return p("viewbar.board.cardActions")},get selected(){return p("viewbar.selectedCard")},get untitled(){return p("viewbar.untitled")}};export function cardGrid(e){return(n,o=!1)=>new Proxy(e,{get:(r,t)=>{if(t==="getColumnWidth")return()=>n;if(t==="editingEnabled")return!1;if(t==="insideButton")return o;const a=Reflect.get(r,t,r);return typeof a=="function"?a.bind(r):a}})}const G=e=>e.fieldType==="date"&&!e.def.fieldProps?.time||e.def.cellDataType==="dateString";function F(e,n){if(!G(e))return n.toISOString();const o=r=>String(r).padStart(2,"0");return`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())}`}function $e(e,n,o){if(o?.mode==="conditions"){const a=rowColorFor(e,o)?.rules;return a?.length?{colorOf:s=>a.find(d=>d.when(s))?.color}:{}}if(o?.mode!=="field")return{};const r=n.find(a=>a.field===o.field);if(!r||r.fieldType!=="singleSelect")return{};const t=lanesFor(r).filter(a=>a.id!==""&&a.color).map(({id:a,title:s,color:d})=>({id:a,title:s,color:d}));return t.length?{calendars:t,calendarField:r.field}:{}}function Ye(e,n,o,r,t){const s=(n.listFields?.length?n.listFields.map(d=>e.find(l=>l.id===d)).filter(d=>!!d):e.filter(d=>d.visible)).filter(d=>d.field!==o&&d.id!==r&&d.id!==t).slice(0,2);return s.length?{detailsOf:d=>s.map(l=>{const i=d,m=l.def.fieldFn;return be(l,m?m(i):i?.[l.field],d)}).filter(l=>l!==""&&l!==p("viewbar.valueUnchecked")).join(" · ")}:{}}const Ue=Object.defineProperties({},Object.fromEntries(["board","addCard","addCardTo","cardTitle","noCards","cardActions","clearFilters","blocked","age","comments","writeComment","deleteComment","addSubtask","rename","cancel","save","grabbed","dropped","movedTo","movedUp","movedDown","movedPosition","cancelled","wipLimit","cannotMove","cardBlocked","selected","deselected"].map(e=>[e,{enumerable:!0,get:()=>p(`viewbar.board.${e}`)}]))),ie=Object.defineProperties({},Object.fromEntries(["month","week","day","agenda","today","previous","next","allDay","more","noEvents","eventsColumn","edit","duplicate","delete","moveGrabbed","moveDone","moveCancelled","moveBlocked","scopeEdit","scopeDelete","scopeOccurrence","scopeFollowing","scopeSeries","upcoming"].map(e=>[e,{enumerable:!0,get:()=>p(`viewbar.calendar.${e}`)}]))),qe=Object.defineProperties({},{...Object.getOwnPropertyDescriptors(ie),...Object.fromEntries(["timelineDay","timelineWeek","timelineMonth","timelineYear"].map(e=>[e,{enumerable:!0,get:()=>p(`viewbar.calendar.${e}`)}]))}),Ze=Object.defineProperties({},Object.fromEntries(["expandAll","collapseAll","expandTask","collapseTask","zoomIn","zoomOut","zoomDay","zoomWeek","zoomMonth","zoomQuarter","zoomYear","tableLabel","chartLabel","resizeTable","days","progress","slack","start","finish","progressPercent","task","milestone","day","daysCount","open","openTask","edit","addSubtask","delete","deleteTask","removeLink","taskActions","save","cancel","onBaseline","laterThanBaseline","aheadOfBaseline","dragProgress","linkFromStart","linkFromFinish","workingDays","onCriticalPath","daysOfSlack","notMet","peak","loadOf","moveGrabbed","moveDone","moveCancelled","resized","progressSet","upcoming"].map(e=>[e,{enumerable:!0,get:()=>p(`viewbar.gantt.${e}`)}])));function q(e,n,o,r,t){const a=O(e),s=a.find(u=>u.id===o.dateField);if(!s)return;const d=a.find(u=>u.id===o.endField),l=!!t&&A(t),i=u=>{const c=h(e,n,u.row);P(e,()=>{if(k(e,c,s.id,F(s,u.start)),d&&k(e,c,d.id,u.end.getTime()>u.start.getTime()?Q(d,u.end):F(d,u.start)),t&&l&&u.toResource!=null){const g=u.fromResource??W(t,u.row);u.toResource!==g&&k(e,c,t.id,Y(t,u.row,g,u.toResource))}}),e.props.baseReflow?.()},m=(u,c)=>({[s.field]:F(s,u),...d?{[d.field]:c.getTime()>u.getTime()?Q(d,c):F(d,u)}:{}}),b=C(e)&&A(s)&&(!d||A(d)),y=t===void 0?I(e):null;return{...y?{server:Le(y,s,d,(u,c)=>e.props.baseOpenDay?.(u,c)),walk:_e(y,s,u=>h(e,n,u))}:{},searchable:!1,text:ie,editable:b,history:b&&!ae(e),controlled:!0,tooltip:!0,onEventOpen:u=>D({ctrl:e,rowId:h(e,n,u)}),onEventDelete:C(e)?u=>$({ctrl:e,api:n,row:u}):void 0,startField:s.field,...d?{endField:d.field}:{},...r?{titleField:r}:{},...G(s)?{allDay:!0}:{},...$e(e,a,o.color),...Ye(a,o,r,s.id,d?.id),onEventMove:i,...d?{onEventResize:i}:{resizable:!1},onEventAdd:!C(e)||!x(e)?void 0:(u,c,g)=>{const v=e.props.rowAdder,R=v&&typeof v=="object"&&typeof v.defaults=="function"?v.defaults():{},M=t&&l&&g?{[t.field]:Y(t,{},void 0,g)}:{},S=V(e,{...R,...M,...m(u,c)});U(e,n,S,!0)},onEventDuplicate:!C(e)||!x(e)?void 0:(u,c,g)=>le(e,n,u,m(c,g)),...se(e,n,b,s,y,u=>({...m(u.start,u.end),...t&&l&&u.toResource!=null&&u.toResource!==(u.fromResource??W(t,u.row))?{[t.field]:Y(t,u.row,u.fromResource??W(t,u.row),u.toResource)}:{}}))}}function se(e,n,o,r,t,a){const s=e.props?.baseTableId;if(typeof s!="string"||!s)return{};const d=O(e),l=new Map(d.map(c=>[c.id,c.field])),i=new Map(d.map(c=>[c.field,c.id])),m=c=>Object.fromEntries(Object.entries(c??{}).map(([g,v])=>[l.get(g)??g,v])),b=c=>Object.fromEntries(Object.entries(c).map(([g,v])=>[i.get(g)??g,v])),y=new WeakMap,u=c=>y.get(c)??c;return{upcoming:{enabled:()=>!!H(),epoch:()=>Ie(s),idOf:c=>String(h(e,n,c)),load:async(c,g)=>{const v=await H()?.occurrences(s,c,g)??[],R=t&&v.length?await Qe(t,[...new Set(v.map(M=>String(M.rowId)))],M=>String(h(e,n,M))):null;return v.flatMap(M=>{const S=R?.get(String(M.rowId));if(R&&!S)return[];const z={rowId:String(M.rowId),day:M.day,values:m(M.values),...S?{row:S}:{}};return y.set(z,M),[z]})},open:c=>H()?.open(s,u(c)),...o&&a?{move:(c,g,v)=>H()?.move(s,u(c),g,b(a(v))),canMove:c=>Ke(e,n,c,r)}:{},...C(e)&&ne(e)?{remove:(c,g)=>H()?.remove(s,u(c),g)}:{}}}}const Z=200;async function Qe(e,n,o){const r=new Map;for(let t=0;t<n.length&&t<Z*5;t+=Z){const a=n.slice(t,t+Z),s=new Set(a);try{const d=await e.ask({startRow:0,endRow:a.length,columns:{id:{operator:"in",value:"",selectedValues:a}}});for(const l of d.rows??[]){const i=o(l);s.has(i)&&r.set(i,l)}}catch{}}return r}function Ke(e,n,o,r){const t=String(h(e,n,o)),a=(e.allRows??[]).find(d=>d.id===t);if(!a||typeof e.isCellEditable!="function")return!0;const s=(e.allColumns??[]).find(d=>d.id===r.id);return!s||e.isCellEditable(s,a)!==!1}const Je={day:"timelineDay",week:"timelineWeek",month:"timelineMonth",year:"timelineYear"};function de(e,n,o,r){const t=laneColumns(e).find(d=>d.id===o.laneField)??null,a=q(e,n,o,r,t);if(!a)return;let s;if(t&&(t.fieldType==="singleSelect"||t.fieldType==="user")){const d=e.props?.data??[];s=lanesFor(t).filter(i=>i.id!==""||d.some(m=>W(t,m)==="")).map(({id:i,title:m,color:b})=>({id:i,title:m,...b?{color:b}:{}}));const l=new Set(s.map(i=>i.id));for(const i of d){const m=W(t,i);l.has(m)||(l.add(m),s.push({id:m,title:re(t,m)}))}}return{...a,views:["timelineDay","timelineWeek","timelineMonth","timelineYear"],initialView:Je[o.zoom??""]??"timelineMonth",text:qe,...t?{resourceField:t.field,resourceOf:d=>W(t,d),resourceTitle:d=>re(t,d),resourceLegend:!1,...s?{resources:s}:{}}:{}}}const A=e=>e.def.editable!==!1&&he(E(e.def),L(E(e.def))),C=e=>e.props.editable!==!1&&!!(e.props.editable??e.props.enableInlineEditing);let Xe=0,N=null;function P(e,n){const o=e.historyGroupId;N||(N=`${Ee}${Xe+=1}`,queueMicrotask(()=>N=null)),e.historyGroupId=o??N;try{n()}finally{e.historyGroupId=o}}const ae=e=>!!e.props?.baseTableId;function Q(e,n){return G(e)?F(e,new Date(n.getFullYear(),n.getMonth(),n.getDate()-1)):F(e,n)}function le(e,n,o,r={}){if(!x(e))return;const t=h(e,n,o),a=e.internalData,s=a.findIndex(l=>h(e,n,l)===t);if((e.props.rowModel||I(e))&&typeof e.props.baseServerAdd=="function"){const{__group:l,...i}=ee(e,s<0?o:a[s]);return e.props.baseServerAdd({...i,...r})}if(s<0)return;const d=V(e,{...ee(e,a[s]),...r});n.addRow(d,s+1),e.props.onRowAdd?.({row:d})}export function deleteRecord(e,n,o){if(!oe(e,o))return;const r=h(e,n,o),t=e.internalData,a=t.findIndex(d=>h(e,n,d)===r);if(a<0)return;const s=t[a];!e.props.rowModel&&!I(e)&&n.removeRows([a]),e.props.onRowsDelete?.({rows:[s],ids:[r],data:e.internalData})}const en=124,K=new WeakMap;function fe(e,n,o,r){K.delete(e);const t=O(e),a=t.find(f=>f.id===o.dateField);if(!a)return;const s=t.find(f=>f.id===o.endField),d=t.find(f=>f.id===o.progressField),l=t.find(f=>f.id===o.dependencyField&&f.fieldType==="link"),m=[(f=>t.find(w=>w.field===f)?.id)(r),a.id,s?.id].filter(f=>!!f),b=f=>h(e,n,f),y=!!e.props?.basePhone,u=o.color&&o.color.mode!=="none"?f=>Ce(e,f)??void 0:void 0,c=f=>Q(s,f),g=(f,w,T)=>{k(e,f,a.id,F(a,w)),s&&k(e,f,s.id,T.getTime()>w.getTime()?c(T):F(s,w))},v=!!(d&&L(E(d.def)).points),R=f=>{const T=e.internalData.find(j=>b(j)===f)?.[l.field];return Array.isArray(T)?T.map(String):T==null||T===""?[]:[String(T)]},M=C(e)&&A(a)&&(!s||A(s)),S=I(e),z=S?Pe(S,a,s,l):null;return{...z?{server:z,walk:te(S,z.list,b)}:{},searchable:!1,startField:a.field,...s?{endField:s.field}:{},...r?{titleField:r}:{},tableColumns:y?m.slice(0,1):[...new Set(m),"__duration"],...y?{tableWidth:en}:{},tableColumnWidths:Object.fromEntries([a,s].filter(f=>!!f).map(f=>[f.id,G(f)?144:176])),...u?{colorOf:u}:{},...o.zoom?{zoom:o.zoom}:{},tooltip:!0,text:Ze,pickUpToMove:!0,respectWorkingTime:!1,editable:M,history:M&&!ae(e),controlled:!0,onTaskOpen:f=>D({ctrl:e,rowId:b(f)}),onTaskMove:f=>{P(e,()=>{g(b(f.row),f.start,f.end);for(const w of f.subtree??[])g(b(w.row),w.start,w.end)}),e.props.baseReflow?.()},onTaskResize:f=>{P(e,()=>g(b(f.row),f.start,f.end)),e.props.baseReflow?.()},onDependenciesChange:f=>{P(e,()=>{for(const w of f)g(w.id,w.start,w.end)}),e.props.baseReflow?.()},...d?{progressField:d.field,...v?{}:{progressValue:f=>Number(f?.[d.field]??0)*100},onProgressChange:f=>k(e,b(f.row),d.id,v?f.progress:f.progress/100)}:{},...l?{predecessorField:l.field,onDependencyAdd:f=>{const w=R(f.to);w.includes(f.from)||k(e,f.to,l.id,[...w,f.from])},onDependencyRemove:f=>{const[w,T]=f.split("->");w&&T&&k(e,T,l.id,R(T).filter(j=>j!==w))}}:{},onZoomChange:f=>{K.set(e,f)},...se(e,n,!1,a,null),onTaskAdd:!C(e)||!x(e)?void 0:(f,w)=>{const T=e.props.rowAdder,j=T&&typeof T=="object"&&typeof T.defaults=="function"?T.defaults():{},ue=V(e,{...j,[a.field]:F(a,f),...s?{[s.field]:w.getTime()>f.getTime()?c(w):F(s,f)}:{}});U(e,n,ue,!0)},onTaskDelete:C(e)&&ne(e)?f=>$({ctrl:e,api:n,row:f}):void 0}}const nn=e=>e.state?.advancedFilter??null;export function viewsWithoutFields(e,n,o=""){const r=[],t=e?.map(a=>{const s=nn(a),d=Oe(s,n);return d===s?a:(r.push({table:o,view:a.id,was:s,now:d}),{...a,state:{...a.state,advancedFilter:d}})});return{views:r.length?t:e,changes:r}}export function filterChangesOf(e,n){return n.flatMap(o=>{const r=e.find(s=>s.id===o.id);if(!r)return[];const t=new Set(o.columns.map(s=>B(s))),a=new Set(r.columns.map(s=>B(s)).filter(s=>!t.has(s)));return a.size?viewsWithoutFields(o.views,s=>a.has(s),o.id).changes:[]})}export function applyViewFilters(e,n,o){return e.map(r=>{const t=n.filter(a=>a.table===r.id);return t.length?{...r,views:r.views?.map(a=>{const s=t.find(d=>d.view===a.id);return s?{...a,state:{...a.state,advancedFilter:s[o]}}:a})}:r})}export const PLAIN_STATE={sorting:[],grouping:[],hiddenColumns:[],advancedFilter:null};export function captureView(e,n,o){const r={...n.getState()};delete r.pagination,delete r.chart,delete r.charts,delete r.chartActive,delete r.globalFilter;const t=Re(n.getOption("rowHeight")),a=o.type==="gantt"?K.get(e):void 0,{color:s,cellColors:d,...l}=o,i=we(e)===void 0?void 0:colorSettingOf(e,o.color),m=Me(e);return{...l,state:r,...typeof t=="number"?{rowHeight:t}:{},...a?{zoom:a}:{},...i?{color:i}:{},...m.length?{cellColors:m}:{}}}const on=e=>(e?.internalColumns??[]).filter(n=>n.field!=null).map(n=>B(n));export function applyView(e,n,o,r={}){const t={...PLAIN_STATE,...o.state??{},globalFilter:""};Array.isArray(t.columnOrder)&&t.columnOrder.length&&(t.columnOrder=ke(t.columnOrder,on(e))),n.setState(t),I(e)?.readQuery?.();const a=o.state;a?.grouping?.length&&a.expanded===void 0&&setTimeout(()=>{e.props?.rowModel||n.expandAllGroups?.()},0),o.rowHeight!=null&&n.setOption("rowHeight",o.rowHeight),o.color?applyColor(e,o.color,r.linkNames):ve(e),Te(e,o.cellColors??[]),n.setOption("board",o.type==="kanban"?boardConfig(e,n,o):void 0),n.setOption("gallery",o.type==="gallery"?galleryConfig(e,n,o):void 0);const s=_(e),d=r.primaryField??O(e).find(l=>l.id===s)?.field;n.setOption("scheduler",o.type==="calendar"?q(e,n,o,d):o.type==="timeline"?de(e,n,o,d):void 0),n.setOption("gantt",o.type==="gantt"?fe(e,n,o,d):void 0)}
@@ -913,7 +913,7 @@ ${E}
913
913
  @keyframes st-home-spin { to { transform: rotate(360deg); } }
914
914
  </style>
915
915
  `}}function Ka(e){for(const r of e)je(r);const t=new Map(e.map(r=>[r.name,r])),a=e.map(r=>{const o=Eu(r,t);return{schema:Fu(r,o),infos:o}});return{entries:a,seed:Du(a)}}function fo(e,t={}){const{entries:a,seed:r}=Ka(e),{file:o,needs:n}=em(a,r,t.sources,t.supabaseConn,t.serverMemory),i=[Lu(a),o];(n.supabase||t.supabaseAuth)&&!n.supabaseUrl&&(t.supabaseConn?.url||t.supabaseConn?.key)&&(n.supabaseUrl=t.supabaseConn.url,n.supabaseKey=t.supabaseConn.key),(n.supabase||t.supabaseAuth)&&i.push(tm(n));for(const s of n.sqlRoutes)i.push(Hu(s.schema,s.table,s.dialect,{access:t.accessEnabled,audit:t.auditEnabled,screenIds:t.screensByEntity?.get(s.schema.name)??[],triggers:t.triggers?.[s.schema.name],dbSchema:s.dbSchema,tenantField:t.tenantField&&t.tenantScoped?.(s.schema.name)!==!1?t.tenantField:void 0}));if(n.memoryRoutes.length){i.push(Gu(n.memoryRoutes));for(const s of n.memoryRoutes)i.push(Vu(s.schema,{access:t.accessEnabled,audit:t.auditEnabled,screenIds:t.screensByEntity?.get(s.schema.name)??[],triggers:t.triggers?.[s.schema.name],tenantField:t.tenantField&&t.tenantScoped?.(s.schema.name)!==!1?t.tenantField:void 0}))}return{files:i,prepared:a.map(s=>s.schema)}}function am(e){if(e.length===0)throw new Error("emitStudioApp: no schemas to emit");const{files:t,prepared:a}=fo(e),r=a.map(n=>{const i=z(n);return{href:`/${i.route}`,label:i.label}}),o={path:"src/custom.css",description:"Your custom styles (imported after app.css so it overrides).",userOwned:!0,contents:`/* Your custom styles. Imported after app.css, so these rules override the defaults. */
916
- `};return[...t,...a.map(n=>Ni(n)),Mi(r),ji(r),o]}function rm(e){return e.fields.some(t=>!!t.when&&(!!t.when.visible||!!t.when.disabled||!!t.when.required))}var om="3.1.58",nm="3.0.37",V=(e,t)=>e.some(a=>a.config.kind===t),qi=e=>`activeTab_${e.replace(/[^a-zA-Z0-9_$]/g,"_")}`,aa=(e,t)=>`${e}-${t}`,zi=e=>`accOpen_${e.replace(/[^a-zA-Z0-9_$]/g,"_")}`,ra=(e,t)=>`${e}-s${t}`,oa=e=>`md_${e.replace(/[^a-zA-Z0-9]/g,"_")}_rows`;function im(e){switch(e.type){case"number":{const t=e.decimals;return t!=null?`{ type: 'number', options: { minimumFractionDigits: ${t}, maximumFractionDigits: ${t} } }`:"{ type: 'number' }"}case"currency":return`{ type: 'currency', currency: ${S(e.currency||"USD")} }`;case"percent":{const t=["type: 'percent'"];return e.valueIsPercentPoints&&t.push("valueIsPercentPoints: true"),e.decimals!=null&&t.push(`options: { minimumFractionDigits: ${e.decimals}, maximumFractionDigits: ${e.decimals} }`),`{ ${t.join(", ")} }`}case"date":case"datetime":return e.pattern?`{ type: '${e.type}', pattern: ${S(e.pattern)} }`:`{ type: '${e.type}' }`}}function sm(e,t,a,r){if(t.config.kind!=="grid")return`schemaToColumns(${e})`;const o=t.config,n=t.id.replace(/-/g,"_"),i=o.columns.filter(b=>b.show),s=new Set(i.map(b=>b.field)),d=new Set,l=i.map(b=>{const y=r?.get(b.field);return{c:b,col:y&&!s.has(y)?y:b.field}}).filter(b=>!d.has(b.col)&&!!d.add(b.col)),c=o.editing==="inline"?"":", editable: false";if(l.length===0)return c?`schemaToColumns(${e}).map((c) => ({ ...c${c} }))`:`schemaToColumns(${e})`;const p=l.map(b=>`'${b.col}'`),u=l.map(({c:b,col:y})=>{const w=[];return b.header&&w.push(`header: ${JSON.stringify(b.header)}`),b.width!=null&&w.push(`width: ${b.width}`),b.align&&w.push(`align: '${b.align}'`),b.aggregate&&w.push(`aggregate: '${b.aggregate}'`),o.treeData&&b.field===o.treeData.labelField&&a?w.push(`cell: (ctx: CellContext<${a}>) => renderSnippet(treeCell_${n}, { value: ctx.getValue(), row: ctx.row.original })`):b.cellType&&a?w.push(`cell: (ctx: CellContext<${a}>) => renderSnippet(${Gi(n,b.field)}, { value: ctx.getValue() })`):b.format&&w.push(`format: ${im(b.format)}`),w.length?`'${y}': { ${w.join(", ")} }`:null}).filter(b=>!!b),m=u.length?` const ov: Record<string, Partial<(typeof all)[number]>> = { ${u.join(", ")} };`:"",g=u.length?", ...(ov[String(c.field)] ?? {})":"",h=`[${p.join(", ")}].map((f) => all.find((c) => c.field === f)).filter((c): c is (typeof all)[number] => !!c)`;return`(() => { const all = schemaToColumns(${e});${m} return ${c||g?`${h}.map((c) => ({ ...c${c}${g} }))`:h} })()`}function Ae(e,t){const a=[`grid-column: span ${ei(e)}`,"min-width: 0"];t&&a.push(t);const r=ti(e.style);return r&&a.push(r),`style="${a.join("; ")}"`}var lm=e=>e&&e.replace(/[^#a-zA-Z0-9(),.%\s_-]/g,"").slice(0,40)||"var(--sg-accent)";function Ue(e,t){const a=[t,Xn(e)].filter(Boolean).join(" ");return a?` class="${a}"`:""}function Ha(e){const t=Ta(e.className);return t?` ${t}`:""}function dm(e){const t=Fe(e);if(t==="grid"){const a=ui(e),r=a.maxWidth?` max-width: ${a.maxWidth}px; margin-inline: auto;`:"";return` .st-screen { grid-template-columns: repeat(12, 1fr); gap: ${a.rowGap}px ${a.colGap}px; align-items: ${a.align};${r} }
916
+ `};return[...t,...a.map(n=>Ni(n)),Mi(r),ji(r),o]}function rm(e){return e.fields.some(t=>!!t.when&&(!!t.when.visible||!!t.when.disabled||!!t.when.required))}var om="3.1.60",nm="3.0.38",V=(e,t)=>e.some(a=>a.config.kind===t),qi=e=>`activeTab_${e.replace(/[^a-zA-Z0-9_$]/g,"_")}`,aa=(e,t)=>`${e}-${t}`,zi=e=>`accOpen_${e.replace(/[^a-zA-Z0-9_$]/g,"_")}`,ra=(e,t)=>`${e}-s${t}`,oa=e=>`md_${e.replace(/[^a-zA-Z0-9]/g,"_")}_rows`;function im(e){switch(e.type){case"number":{const t=e.decimals;return t!=null?`{ type: 'number', options: { minimumFractionDigits: ${t}, maximumFractionDigits: ${t} } }`:"{ type: 'number' }"}case"currency":return`{ type: 'currency', currency: ${S(e.currency||"USD")} }`;case"percent":{const t=["type: 'percent'"];return e.valueIsPercentPoints&&t.push("valueIsPercentPoints: true"),e.decimals!=null&&t.push(`options: { minimumFractionDigits: ${e.decimals}, maximumFractionDigits: ${e.decimals} }`),`{ ${t.join(", ")} }`}case"date":case"datetime":return e.pattern?`{ type: '${e.type}', pattern: ${S(e.pattern)} }`:`{ type: '${e.type}' }`}}function sm(e,t,a,r){if(t.config.kind!=="grid")return`schemaToColumns(${e})`;const o=t.config,n=t.id.replace(/-/g,"_"),i=o.columns.filter(b=>b.show),s=new Set(i.map(b=>b.field)),d=new Set,l=i.map(b=>{const y=r?.get(b.field);return{c:b,col:y&&!s.has(y)?y:b.field}}).filter(b=>!d.has(b.col)&&!!d.add(b.col)),c=o.editing==="inline"?"":", editable: false";if(l.length===0)return c?`schemaToColumns(${e}).map((c) => ({ ...c${c} }))`:`schemaToColumns(${e})`;const p=l.map(b=>`'${b.col}'`),u=l.map(({c:b,col:y})=>{const w=[];return b.header&&w.push(`header: ${JSON.stringify(b.header)}`),b.width!=null&&w.push(`width: ${b.width}`),b.align&&w.push(`align: '${b.align}'`),b.aggregate&&w.push(`aggregate: '${b.aggregate}'`),o.treeData&&b.field===o.treeData.labelField&&a?w.push(`cell: (ctx: CellContext<${a}>) => renderSnippet(treeCell_${n}, { value: ctx.getValue(), row: ctx.row.original })`):b.cellType&&a?w.push(`cell: (ctx: CellContext<${a}>) => renderSnippet(${Gi(n,b.field)}, { value: ctx.getValue() })`):b.format&&w.push(`format: ${im(b.format)}`),w.length?`'${y}': { ${w.join(", ")} }`:null}).filter(b=>!!b),m=u.length?` const ov: Record<string, Partial<(typeof all)[number]>> = { ${u.join(", ")} };`:"",g=u.length?", ...(ov[String(c.field)] ?? {})":"",h=`[${p.join(", ")}].map((f) => all.find((c) => c.field === f)).filter((c): c is (typeof all)[number] => !!c)`;return`(() => { const all = schemaToColumns(${e});${m} return ${c||g?`${h}.map((c) => ({ ...c${c}${g} }))`:h} })()`}function Ae(e,t){const a=[`grid-column: span ${ei(e)}`,"min-width: 0"];t&&a.push(t);const r=ti(e.style);return r&&a.push(r),`style="${a.join("; ")}"`}var lm=e=>e&&e.replace(/[^#a-zA-Z0-9(),.%\s_-]/g,"").slice(0,40)||"var(--sg-accent)";function Ue(e,t){const a=[t,Xn(e)].filter(Boolean).join(" ");return a?` class="${a}"`:""}function Ha(e){const t=Ta(e.className);return t?` ${t}`:""}function dm(e){const t=Fe(e);if(t==="grid"){const a=ui(e),r=a.maxWidth?` max-width: ${a.maxWidth}px; margin-inline: auto;`:"";return` .st-screen { grid-template-columns: repeat(12, 1fr); gap: ${a.rowGap}px ${a.colGap}px; align-items: ${a.align};${r} }
917
917
  @media (max-width: ${a.mobileBreakpoint}px) { .st-screen { grid-template-columns: 1fr; gap: 12px; } }
918
918
  `}if(t==="stack"){const a=mi(e),r=a.maxWidth?` max-width: ${a.maxWidth}px;${a.align==="center"?" margin-inline: auto;":""}`:"",o=a.minHeight?`
919
919
  .st-stack > * { min-height: ${a.minHeight}px; }`:"",n=a.dividers?`
package/dist/version.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * `version.test.ts` asserts this matches `package.json`, so the two cannot drift.
12
12
  */
13
- export declare const SVGRID_VERSION = "3.1.58";
13
+ export declare const SVGRID_VERSION = "3.1.60";
14
14
  /**
15
15
  * The version of `@svgrid/grid`, which releases on its own line: enterprise is
16
16
  * on 3.1.x while the grid is on 3.0.x.
@@ -23,4 +23,4 @@ export declare const SVGRID_VERSION = "3.1.58";
23
23
  *
24
24
  * `version.test.ts` asserts this matches packages/grid/package.json.
25
25
  */
26
- export declare const GRID_VERSION = "3.0.37";
26
+ export declare const GRID_VERSION = "3.0.38";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const SVGRID_VERSION="3.1.58",GRID_VERSION="3.0.37";
1
+ export const SVGRID_VERSION="3.1.60",GRID_VERSION="3.0.38";