@limetech/lime-crm-building-blocks 1.103.0 → 1.103.1

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 (39) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
  3. package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +21 -15
  4. package/dist/cjs/limebb-lime-query-filter-builder_3.cjs.entry.js +4 -1
  5. package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +42 -70
  6. package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +12 -3
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/collection/components/lime-query-builder/expressions/filter-group-logic.js +2 -32
  9. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-builder.js +4 -1
  10. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.css +0 -7
  11. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +45 -38
  12. package/dist/collection/components/lime-query-builder/lime-query-builder.css +26 -36
  13. package/dist/collection/components/lime-query-builder/lime-query-builder.js +21 -15
  14. package/dist/collection/components/lime-query-builder/response-format/response-format-editor.css +5 -18
  15. package/dist/collection/components/lime-query-builder/response-format/response-format-editor.js +12 -3
  16. package/dist/components/lime-query-filter-builder.js +4 -1
  17. package/dist/components/lime-query-filter-expression.js +44 -71
  18. package/dist/components/limebb-lime-query-builder.js +22 -16
  19. package/dist/components/response-format-editor.js +12 -3
  20. package/dist/esm/lime-crm-building-blocks.js +1 -1
  21. package/dist/esm/limebb-lime-query-builder.entry.js +22 -16
  22. package/dist/esm/limebb-lime-query-filter-builder_3.entry.js +4 -1
  23. package/dist/esm/limebb-lime-query-filter-group_3.entry.js +42 -70
  24. package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +12 -3
  25. package/dist/esm/loader.js +1 -1
  26. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  27. package/dist/lime-crm-building-blocks/p-81dbda15.entry.js +1 -0
  28. package/dist/lime-crm-building-blocks/p-91074d93.entry.js +1 -0
  29. package/dist/lime-crm-building-blocks/p-a5bd74fb.entry.js +1 -0
  30. package/dist/lime-crm-building-blocks/p-d18697e3.entry.js +1 -0
  31. package/dist/types/components/lime-query-builder/expressions/filter-group-logic.d.ts +0 -16
  32. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-group.d.ts +5 -5
  33. package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +2 -1
  34. package/dist/types/components/lime-query-builder/response-format/response-format-editor.d.ts +1 -0
  35. package/package.json +1 -1
  36. package/dist/lime-crm-building-blocks/p-1f76540e.entry.js +0 -1
  37. package/dist/lime-crm-building-blocks/p-3384f1ee.entry.js +0 -1
  38. package/dist/lime-crm-building-blocks/p-8917c472.entry.js +0 -1
  39. package/dist/lime-crm-building-blocks/p-9167bc6c.entry.js +0 -1
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-1556b545.js";export{s as setNonce}from"./p-1556b545.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t(JSON.parse('[["p-3384f1ee",[[1,"limebb-lime-query-builder",{"platform":[16],"context":[16],"value":[16],"label":[1],"activeLimetype":[1,"active-limetype"],"limetypes":[32],"mode":[32],"codeValue":[32],"limetype":[32],"filter":[32],"internalResponseFormat":[32],"limit":[32],"orderBy":[32]}]]],["p-ee1b00b9",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[513],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":["highlightedItemIdChanged"]}]]],["p-3a406a20",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-2d5f83bc",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-32534eb7",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":["handleItemsChange"]}]]],["p-03af0e66",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-6f6fed59",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":["watchOpen"],"editorPickerQuery":["watchQuery"]}]]],["p-8491aaa1",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["p-4a82410e",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-568b7520",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-2fdcb868",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":["handleItemsChange"]}]]],["p-5464f0de",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-3175883d",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":["watchFormInfo"],"configComponent":["watchconfigComponent"]}]]],["p-1be0eec7",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-10ac8b3e",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-e35299e0",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-a200954f",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32]},null,{"filterId":["watchFilterId"],"propertyName":["watchPropertyName"],"aggregateOperator":["watchAggregateOperator"]}]]],["p-01cff04f",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-4caa8bbe",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-ff0b244b",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-25e1a434",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-6c56121c",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-206575e4",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-0de79b7f",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["p-cfa1a4ad",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-d0721b22",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-3d1be1c9",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":["valueChanged"]}]]],["p-577d8909",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":["valueChanged"]}]]],["p-7271f47a",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["p-eb81bceb",[[1,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-2faaacbc",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-218b7f38",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":["watchOpen"]}]]],["p-9031f136",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["p-098ee6c1",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["p-9d25ed5a",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513]}]]],["p-a9ac501f",[[1,"limebb-live-docs-info"]]],["p-0f7135ff",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-5c693302",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-5dc574a3",[[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-61282e1a",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-8917c472",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":["handleValueChange"]}],[0,"limebb-limetype-field",{"platform":[16],"context":[16],"label":[513],"required":[516],"readonly":[516],"disabled":[516],"value":[513],"helperText":[513,"helper-text"],"invalid":[4],"limetypes":[16],"propertyFields":[16],"fieldName":[1,"field-name"],"formInfo":[16]}]]],["p-292631ea",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-d8696b23",[[1,"limebb-property-selector",{"platform":[16],"context":[16],"limetype":[1],"value":[1],"label":[1],"required":[4],"helperText":[1,"helper-text"],"limetypes":[32],"isOpen":[32],"navigationPath":[32]}]]],["p-9167bc6c",[[1,"limebb-lime-query-response-format-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]}],[1,"limebb-lime-query-response-format-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16],"showAliasInput":[32],"showDescriptionInput":[32]}]]],["p-7e5528f6",[[1,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["p-1f76540e",[[1,"limebb-lime-query-value-input",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"propertyPath":[1,"property-path"],"operator":[1],"value":[8],"label":[1],"limetypes":[32],"inputMode":[32]}],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]],["p-18e9e1bc",[[1,"limebb-lime-query-filter-expression",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-comparison",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]]]'),e))));
1
+ import{p as e,b as t}from"./p-1556b545.js";export{s as setNonce}from"./p-1556b545.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t(JSON.parse('[["p-d18697e3",[[1,"limebb-lime-query-builder",{"platform":[16],"context":[16],"value":[16],"label":[1],"activeLimetype":[1,"active-limetype"],"limetypes":[32],"mode":[32],"codeValue":[32],"limetype":[32],"filter":[32],"internalResponseFormat":[32],"limit":[32],"orderBy":[32]}]]],["p-ee1b00b9",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[513],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":["highlightedItemIdChanged"]}]]],["p-3a406a20",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-2d5f83bc",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-32534eb7",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":["handleItemsChange"]}]]],["p-03af0e66",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-6f6fed59",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":["watchOpen"],"editorPickerQuery":["watchQuery"]}]]],["p-8491aaa1",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["p-4a82410e",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-568b7520",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-2fdcb868",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":["handleItemsChange"]}]]],["p-5464f0de",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-3175883d",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":["watchFormInfo"],"configComponent":["watchconfigComponent"]}]]],["p-1be0eec7",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-10ac8b3e",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-e35299e0",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-a200954f",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32]},null,{"filterId":["watchFilterId"],"propertyName":["watchPropertyName"],"aggregateOperator":["watchAggregateOperator"]}]]],["p-01cff04f",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-4caa8bbe",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-ff0b244b",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-25e1a434",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-6c56121c",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-206575e4",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-0de79b7f",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["p-cfa1a4ad",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-d0721b22",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-3d1be1c9",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":["valueChanged"]}]]],["p-577d8909",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":["valueChanged"]}]]],["p-7271f47a",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["p-eb81bceb",[[1,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-2faaacbc",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-218b7f38",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":["watchOpen"]}]]],["p-9031f136",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["p-098ee6c1",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["p-9d25ed5a",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513]}]]],["p-a9ac501f",[[1,"limebb-live-docs-info"]]],["p-0f7135ff",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-5c693302",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-5dc574a3",[[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-61282e1a",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-81dbda15",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":["handleValueChange"]}],[0,"limebb-limetype-field",{"platform":[16],"context":[16],"label":[513],"required":[516],"readonly":[516],"disabled":[516],"value":[513],"helperText":[513,"helper-text"],"invalid":[4],"limetypes":[16],"propertyFields":[16],"fieldName":[1,"field-name"],"formInfo":[16]}]]],["p-292631ea",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-d8696b23",[[1,"limebb-property-selector",{"platform":[16],"context":[16],"limetype":[1],"value":[1],"label":[1],"required":[4],"helperText":[1,"helper-text"],"limetypes":[32],"isOpen":[32],"navigationPath":[32]}]]],["p-a5bd74fb",[[1,"limebb-lime-query-response-format-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]}],[1,"limebb-lime-query-response-format-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16],"showAliasInput":[32],"showDescriptionInput":[32]}]]],["p-7e5528f6",[[1,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["p-91074d93",[[1,"limebb-lime-query-value-input",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"propertyPath":[1,"property-path"],"operator":[1],"value":[8],"label":[1],"limetypes":[32],"inputMode":[32]}],[1,"limebb-lime-query-filter-group",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16],"value":[32]}],[1,"limebb-lime-query-filter-not",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]],["p-18e9e1bc",[[1,"limebb-lime-query-filter-expression",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-filter-comparison",{"platform":[16],"context":[16],"label":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]]]'),e))));
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i}from"./p-1556b545.js";import{Z as s,c as r}from"./p-4838284a.js";import{b as o}from"./p-20bfca36.js";import{i as n}from"./p-1484e300.js";import{b as l}from"./p-a659d55a.js";import{i as h,a,b as d}from"./p-b31772c8.js";import"./p-35897ec3.js";import"./p-fe2b91d9.js";import"./p-5322fd19.js";function m(t){return"string"==typeof t||!h(t)&&a(t)&&"[object String]"==d(t)}const c=class{constructor(i){t(this,i),this.expressionChange=e(this,"expressionChange",7),this.handleAddFirstCondition=()=>{this.expressionChange.emit({key:"",op:s.EQUALS,exp:""})},this.handlePromoteAndAdd=()=>{this.expression&&this.expressionChange.emit({op:s.AND,exp:[this.expression,{key:"",op:s.EQUALS,exp:""}]})},this.handleExpressionChange=t=>{var e;t.stopPropagation(),this.expressionChange.emit(null!==(e=t.detail)&&void 0!==e?e:void 0)}}render(){return this.expression?this.needsPromotion()?this.renderWithPromotionButton():i("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression,onExpressionChange:this.handleExpressionChange}):this.renderEmptyState()}needsPromotion(){return!!this.expression&&("key"in this.expression||this.expression.op===s.NOT)}renderEmptyState(){return i("limel-button",{label:"Condition",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddFirstCondition})}renderWithPromotionButton(){return i("div",{class:"expression-with-promotion"},i("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression,onExpressionChange:this.handleExpressionChange}),i("limel-button",{label:"Add another condition",icon:"plus_math",onClick:this.handlePromoteAndAdd}))}};c.style=".expression-with-promotion{display:flex;flex-direction:column;gap:1rem}limel-button{width:100%}.query-options-section{margin-top:1rem}";const p=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.label="Sort Order",this.items=[],this.handleItemChange=t=>e=>{e.stopPropagation();const i=[...this.items];null===e.detail?i.splice(t,1):i[t]=e.detail,this.items=i,this.emitChange()},this.handleAddSortField=()=>{this.items=[...this.items,{"":"ASC"}],this.emitChange()}}componentWillLoad(){this.value&&this.value.length>0&&(this.items=[...this.value])}handleValueChange(t){t&&(t.length!==this.items.length||!t.every(((t,e)=>{const i=this.items[e];if(!i)return!1;const s=Object.keys(t)[0],r=Object.keys(i)[0];return s===r&&t[s]===i[r]})))&&(this.items=t.length>0?[...t]:[])}render(){return this.limetype?i("div",{class:"order-by-editor"},i("div",{class:"header"},i("h4",null,this.label)),this.renderOrderByList(),this.renderActions()):i("div",{class:"empty-state"},i("p",null,"Select a limetype to configure sorting"))}renderOrderByList(){return 0===this.items.length?null:i("div",{class:"order-by-list"},this.items.map(((t,e)=>this.renderItem(t,e))))}renderActions(){return i("limel-button",{label:"Add Sort Field",icon:"plus_math",onClick:this.handleAddSortField})}renderItem(t,e){const s=Object.keys(t)[0]||"";return i("limebb-lime-query-order-by-item",{key:`${s}-${e}`,class:"order-by-item",platform:this.platform,context:this.context,limetype:this.limetype,item:t,onItemChange:this.handleItemChange(e)})}emitChange(){this.change.emit(this.items)}static get watchers(){return{value:["handleValueChange"]}}};p.style=":host(limebb-lime-query-order-by-editor){display:block;width:100%}.order-by-editor{display:flex;flex-direction:column;gap:1rem;padding:1rem 0}.header{display:flex;justify-content:space-between;align-items:center;gap:1rem}.header h4{margin:0;font-size:1rem;font-weight:600;color:rgb(var(--contrast-1000))}.order-by-list{display:flex;flex-direction:column;gap:1rem;border:1px solid rgb(var(--contrast-300));border-radius:0.25rem;background-color:rgb(var(--contrast-50));min-height:4rem}.order-by-item{padding:0.5rem;border-radius:0.25rem;transition:background-color 0.2s}.order-by-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex;width:100%}.summary{display:flex;justify-content:space-between;align-items:center;padding-top:0.5rem;border-top:1px solid rgb(var(--contrast-300))}.summary .count{font-size:0.875rem;font-weight:500;color:rgb(var(--contrast-900))}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}";const u=["string","text","phone","integer","decimal","percent","time","date","year","quarter","month","yesno","link","user","xml","option","set","file","system"],b=u.filter((t=>"system"!==t));b.push("belongsto","hasone","hasmany","hasandbelongstomany");const y=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.propertyFields=[],this.fieldName="limetype",this.handleChange=t=>{t.stopPropagation();let e="";t.detail&&"value"in t.detail&&(e=t.detail.value),this.change.emit(e||void 0)}}componentWillLoad(){const t=this.platform.get(r.Application).getLanguage();this.collator=new Intl.Collator(t,{numeric:!0,sensitivity:"base"})}componentShouldUpdate(t,e,i){var s,r,o,n;return"formInfo"!==i||(o=null===(s=null==t?void 0:t.schema)||void 0===s?void 0:s.oneOf,n=null===(r=null==e?void 0:e.schema)||void 0===r?void 0:r.oneOf,!l(o,n))}render(){var t;const e=this.getLimeTypes().map(g);e.sort(((t,e)=>this.collator.compare(t.text,e.text)));let s=e.find((t=>t.value===this.value)),r=this.invalid;return this.value&&!s&&(r=!0,e.unshift({text:(null===(t=this.limeTypeRepository.getLimeType(this.value))||void 0===t?void 0:t.localname.singular)||this.value,value:this.value}),s=e[0]),e.unshift({text:"",value:""}),i("limel-select",{key:"ee9fdc46424c9e6dc5897260cb16bcbedd43413a",label:this.label,options:e,value:s,required:this.required,helperText:this.helperText,invalid:r,disabled:this.disabled||this.readonly,onChange:this.handleChange})}componentWillRender(){this.updatePropertyFields(this.value||"")}getLimeTypes(){var t,e;let i=this.limetypes;return(null===(e=null===(t=this.formInfo)||void 0===t?void 0:t.schema)||void 0===e?void 0:e.oneOf)&&(i=this.formInfo.schema.oneOf.map((t=>t.const)).filter(m)),i?i.map((t=>this.limeTypeRepository.getLimeType(t))).filter(n):this.limeTypeRepository.getLimeTypes()}updatePropertyFields(t){for(const e of this.propertyFields)e.limetype=t,e.allowedPropertyTypes===u&&(e.allowedPropertyTypes=b)}get limeTypeRepository(){return this.platform.get(r.LimeTypeRepository)}},g=t=>({text:t.localname.singular,value:t.name,icon:o(t)});export{c as limebb_lime_query_filter_builder,p as limebb_lime_query_order_by_editor,y as limebb_limetype_field}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as i}from"./p-1556b545.js";import{Z as s,T as r}from"./p-4838284a.js";import{g as l}from"./p-b748c770.js";function o(){return{key:"",op:s.EQUALS,exp:""}}function n(e,t){return{op:e.op,exp:[...e.exp,t]}}const a=class{constructor(r){e(this,r),this.expressionChange=t(this,"expressionChange",7),this.options=[{text:"All",secondaryText:"AND operator",value:"and"},{text:"Any",secondaryText:"OR operator",value:"or"}],this.renderChildExpression=(e,t)=>i("li",null,i("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:e,onExpressionChange:this.handleExpressionChange(t)})),this.handleToggleOperator=e=>{const t=Array.isArray(e.detail)?e.detail[0]:e.detail;if(this.value=t,("and"===t.value?s.AND:s.OR)!==this.expression.op){const e={op:(i=this.expression).op===s.AND?s.OR:s.AND,exp:[...i.exp]};this.expressionChange.emit(e)}var i},this.handleAddChildExpression=()=>{const e=o(),t=n(this.expression,e);this.expressionChange.emit(t)},this.handleAddChildGroup=()=>{const e={op:this.expression.op===s.AND?s.OR:s.AND,exp:[o()]},t=n(this.expression,e);this.expressionChange.emit(t)},this.handleExpressionChange=e=>t=>{t.stopPropagation();const i=function(e,t,i){const s=[...e.exp];return i?(s[t]=i,{type:"updated",expression:{op:e.op,exp:s}}):(s.splice(t,1),0===s.length?{type:"removed",expression:void 0}:1===s.length?{type:"unwrapped",expression:s[0]}:{type:"updated",expression:{op:e.op,exp:s}})}(this.expression,e,t.detail);this.expressionChange.emit(i.expression)}}componentWillLoad(){this.value=this.options.find((e=>e.value===(this.expression.op===s.AND?"and":"or")))||this.options[0]}render(){const e=this.getSubheading();return i("div",{key:"741f2870c545d8e879a53244e0334d5c0cf0a4bd",class:"expression"},e&&i("limel-header",{key:"c08e664d2aaa539a47d3f5b4bbb4daa350c15131",subheading:e},this.renderOperators()),i("ul",{key:"2bddf3cc8b4167845838844512aa6ab5688c46c5"},this.expression.exp.map(this.renderChildExpression),i("li",{key:"da86547dcf15b4c53a1991340f19d8bd54f4dee4",class:"add-button"},this.renderAddButton(),this.renderAddGroupButton())))}renderOperators(){return i("limel-select",{slot:"actions",value:this.value,options:this.options,onChange:this.handleToggleOperator})}getSubheading(){return this.expression.exp.length<=1?"":this.expression.op===s.AND?"All of these conditions are met":"Any of these conditions are met"}renderAddButton(){return i("limel-button",{label:"Condition",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddChildExpression})}renderAddGroupButton(){return i("limel-button",{label:"Group",icon:{name:"tree_structure",title:"Add"},onClick:this.handleAddChildGroup})}};a.style='@charset "UTF-8";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:0;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-500));border-radius:0.75rem}.expression>ul{list-style:none;margin-top:0;margin-right:1rem;margin-bottom:1rem;padding-left:1rem;list-style:disc}.expression>ul li{list-style:none;margin-top:1rem}.expression>ul li.add-button{list-style:none;display:flex;gap:0.5rem}';const h=class{constructor(i){e(this,i),this.expressionChange=t(this,"expressionChange",7),this.handleExpressionChange=e=>{var t;e.stopPropagation();const i=null!==(t=e.detail)&&void 0!==t?t:void 0;this.expressionChange.emit(void 0!==i?{op:s.NOT,exp:i}:void 0)}}render(){return i("div",{key:"29770b10d0b892750ad2aab3520cec5a82063774",class:"expression"},this.label&&i("limel-header",{key:"9e47d14c6cb526c9c31d67e11a5ed5ec665c7f62",heading:this.label}),i("limebb-lime-query-filter-expression",{key:"943c1529057aa6cc918dc935f1a5782b149351ae",platform:this.platform,context:this.context,label:"Not",limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression.exp,onExpressionChange:this.handleExpressionChange}))}};h.style='@charset "UTF-8";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:1rem;padding:1rem;border-left:0.25rem solid rgb(var(--contrast-400));background-color:rgb(var(--contrast-100))}';const c=class{constructor(i){e(this,i),this.change=t(this,"change",7),this.label="Value",this.inputMode="value",this.handleTextChange=e=>{e.stopPropagation();const t=e.detail,i=Number(t);Number.isNaN(i)||""===t?this.change.emit(t):this.change.emit(i)},this.handleSelectChange=e=>{e.stopPropagation();const t=e.detail;Array.isArray(t)?this.change.emit(t.map((e=>e.value))):this.change.emit(null==t?void 0:t.value)},this.handleBooleanChange=e=>{e.stopPropagation();const t=e.detail;Array.isArray(t)||this.change.emit("true"===(null==t?void 0:t.value))},this.handleDateChange=e=>{e.stopPropagation();const t=e.detail;this.change.emit(t?t.toISOString():null)},this.handleMultiValueChange=e=>{e.stopPropagation();const t=e.detail.split(",").map((e=>e.trim())).filter((e=>e.length>0));this.change.emit(t)},this.handleModeToggle=()=>{"value"===this.inputMode?(this.inputMode="placeholder",this.change.emit("%activeObject%")):(this.inputMode="value",this.change.emit(""))},this.handlePlaceholderPropertyChange=e=>{e.stopPropagation();const t=this.buildPlaceholderValue(e.detail);this.change.emit(t)}}componentWillLoad(){this.isPlaceholder(this.value)&&(this.inputMode="placeholder")}componentWillUpdate(){this.isPlaceholder(this.value)&&"placeholder"!==this.inputMode?this.inputMode="placeholder":this.isPlaceholder(this.value)||"placeholder"!==this.inputMode||(this.inputMode="value")}isPlaceholder(e){return"string"==typeof e&&e.startsWith("%activeObject%")}parsePlaceholderPath(e){return this.isPlaceholder(e)?e.replace(/^%activeObject%\.?/,""):""}buildPlaceholderValue(e){return e?`%activeObject%.${e}`:"%activeObject%"}render(){return this.operator?i("div",{class:"value-input-container"},this.renderModeToggle(),"placeholder"===this.inputMode?this.renderPlaceholderInput():this.renderValueInputByType()):null}renderModeToggle(){if(!this.activeLimetype)return null;const e="placeholder"===this.inputMode;return i("limel-icon-button",{class:"mode-toggle",icon:e?"text":"link",label:e?"Use Value":"Use Placeholder",onClick:this.handleModeToggle})}renderPlaceholderInput(){const e=this.parsePlaceholderPath(this.value);return i("div",{class:"placeholder-input"},i("limebb-property-selector",{platform:this.platform,context:this.context,limetype:this.activeLimetype,label:"Active Object Property",value:e,required:!1,helperText:"Select property from the active object",onChange:this.handlePlaceholderPropertyChange}),this.isPlaceholder(this.value)&&i("div",{class:"placeholder-preview"},i("limel-icon",{name:"info",size:"small"}),i("span",null,"Placeholder: ",this.value)))}renderValueInputByType(){if(this.operator===s.IN)return this.renderMultiValueInput();const e=this.getProperty();if(!e)return this.renderTextInput();switch(e.type){case"integer":case"decimal":return this.renderNumberInput(e.type);case"yesno":return this.renderBooleanInput();case"option":return this.renderOptionInput(e);case"date":return this.renderDateInput();case"time":return this.renderTimeInput();default:return this.renderTextInput()}}renderTextInput(){var e;return i("limel-input-field",{label:this.label,value:(null===(e=this.value)||void 0===e?void 0:e.toString())||"",placeholder:"Enter value",onChange:this.handleTextChange})}renderNumberInput(e){var t;const s="integer"===e?1:.01;return i("limel-input-field",{label:this.label,type:"number",value:(null===(t=this.value)||void 0===t?void 0:t.toString())||"",step:s,onChange:this.handleTextChange})}renderBooleanInput(){const e=[{text:"True",value:"true"},{text:"False",value:"false"}],t=!0===this.value||"true"===this.value?"true":"false",s=e.find((e=>e.value===t));return i("limel-select",{label:this.label,options:e,value:s,onChange:this.handleBooleanChange})}renderOptionInput(e){if(!e.options||0===e.options.length)return this.renderTextInput();const t=e.options.map((e=>({text:e.text||e.key,value:e.key}))),s=t.find((e=>e.value===this.value));return i("limel-select",{label:this.label,options:t,value:s,onChange:this.handleSelectChange})}renderDateInput(){const e="string"==typeof this.value?new Date(this.value):this.value;return i("limel-date-picker",{label:this.label,value:e,onChange:this.handleDateChange})}renderTimeInput(){return i("limel-input-field",{label:this.label,type:"time",value:this.value||"",onChange:this.handleTextChange})}renderMultiValueInput(){const e=Array.isArray(this.value)?this.value.join(", "):this.value||"";return i("limel-input-field",{label:this.label+" (comma-separated)",value:e,placeholder:"e.g., won, lost, tender",onChange:this.handleMultiValueChange})}getProperty(){if(this.limetypes&&this.limetype&&this.propertyPath)return l(this.limetypes,this.limetype,this.propertyPath)}};(function(e,t,i,s){var r,l=arguments.length,o=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(o=(l<3?r(o):l>3?r(t,i,o):r(t,i))||o);l>3&&o&&Object.defineProperty(t,i,o)})([r()],c.prototype,"limetypes",void 0),c.style=":host{display:block}.value-input-container{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.mode-toggle{flex-shrink:0;margin-top:0.5rem;opacity:0.7;transition:opacity 0.2s ease}.mode-toggle:hover{opacity:1}.placeholder-input{flex-grow:1;display:flex;flex-direction:column;gap:0.5rem}.placeholder-preview{display:flex;align-items:center;gap:0.5rem;padding:0.5rem;background-color:rgba(var(--color-blue-light), 0.1);border-radius:var(--border-radius-small);font-size:0.875rem;color:rgb(var(--color-blue-default));border-left:3px solid rgb(var(--color-blue-default))}.placeholder-preview limel-icon{flex-shrink:0;color:rgb(var(--color-blue-default))}.placeholder-preview span{font-family:var(--font-monospace);word-break:break-all}";export{a as limebb_lime_query_filter_group,h as limebb_lime_query_filter_not,c as limebb_lime_query_value_input}
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i}from"./p-1556b545.js";function o(t,e,i){if(null===i)return void t.push({path:e});const o=i,r="_alias"in o,a="#description"in o,l=Object.keys(o).filter((t=>"_alias"!==t&&"#description"!==t));if(0!==l.length)if(r||a){const i={};for(const t of l)i[t]=o[t];t.push(...s(i,e))}else t.push(...s(i,e));else{const i=o._alias,s=o["#description"];t.push(i||s?{path:e,alias:i,description:s}:{path:e})}}function s(t,e=""){if(!t)return[];const i=[];for(const[s,r]of Object.entries(t))"object"==typeof r&&o(i,e?`${e}.${s}`:s,r);return i}function r(t,e,i){const o=t[e];if(o&&"object"==typeof o&&!("_alias"in o)&&!("#description"in o))return;const s={};i.alias&&""!==i.alias.trim()&&(s._alias=i.alias),i.description&&""!==i.description.trim()&&(s["#description"]=i.description),t[e]=Object.keys(s).length>0?s:null}function a(t,e){const i=t[e];if(!i)return t[e]={},t[e];if("object"==typeof i){const t=i;return Object.keys(t).filter((t=>"_alias"!==t&&"#description"!==t)),t}return t[e]={},t[e]}const l=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.label="Properties",this.items=[{path:"_id"}],this.handleItemChange=t=>e=>{e.stopPropagation();const i=[...this.items];null===e.detail?i.splice(t,1):i[t]=e.detail,0===i.length&&i.push({path:"_id"}),this.items=i,this.emitChange()},this.handleAddProperty=()=>{this.items=[...this.items,{path:""}],this.emitChange()}}componentWillLoad(){var t;if(null===(t=this.value)||void 0===t?void 0:t.object){const t=s(this.value.object);t.length>0&&(this.items=t)}}componentWillUpdate(){var t;if(null===(t=this.value)||void 0===t?void 0:t.object){const t=s(this.value.object);(t.length!==this.items.length||!t.every(((t,e)=>{const i=this.items[e];return i&&t.path===i.path&&t.alias===i.alias&&t.description===i.description})))&&(this.items=t.length>0?t:[{path:"_id"}])}}render(){return this.limetype?i("div",{class:"response-format-editor"},i("limel-header",{subheading:this.label},this.renderPropertyCount()),i("div",{class:"property"},i("div",{class:"property-list"},this.items.map(((t,e)=>this.renderItem(t,e)))),i("div",{class:"actions"},i("limel-button",{label:"Property",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddProperty})))):i("div",{class:"empty-state"},i("p",null,"Select a limetype to choose properties"))}renderPropertyCount(){return[i("limel-badge",{slot:"actions",id:"counter-badge",label:this.items.length.toString()}),i("limel-tooltip",{elementId:"counter-badge",slot:"actions",label:"Number of selected properties"})]}renderItem(t,e){return i("limebb-lime-query-response-format-item",{key:`${t.path}-${e}`,class:"property-item",platform:this.platform,context:this.context,limetype:this.limetype,item:t,onItemChange:this.handleItemChange(e)})}emitChange(){const t=function(t){const e={};for(const i of t){const t=i.path.split(".");let o=e;for(let e=0;e<t.length;e++){const s=t[e];e===t.length-1?r(o,s,i):o=a(o,s)}}return e}(this.items);this.change.emit({object:t})}};l.style=":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;padding:1rem 0}limel-badge[slot=actions]{--badge-background-color:rgb(var(--contrast-200));margin-right:0.25rem}.property{border:1px solid var(--header-background-color);border-radius:0 0 0.75rem 0.75rem}.property-list{display:flex;flex-direction:column;border-radius:0.25rem;background-color:rgb(var(--contrast-100));gap:0.5rem;padding:0.5rem}.property-item{border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex}.actions limel-button{padding:0.5rem;width:100%}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}";const n=class{constructor(i){t(this,i),this.itemChange=e(this,"itemChange",7),this.showAliasInput=!1,this.showDescriptionInput=!1,this.handlePathChange=t=>{t.stopPropagation(),this.itemChange.emit(Object.assign(Object.assign({},this.item),{path:t.detail}))},this.toggleAliasInput=()=>{this.showAliasInput=!this.showAliasInput},this.toggleDescriptionInput=()=>{this.showDescriptionInput=!this.showDescriptionInput},this.handleAliasChange=t=>{t.stopPropagation();const e=t.detail;this.itemChange.emit(Object.assign(Object.assign({},this.item),{alias:e||void 0}))},this.handleDescriptionChange=t=>{t.stopPropagation();const e=t.detail;this.itemChange.emit(Object.assign(Object.assign({},this.item),{description:e||void 0}))},this.handleAliasBlur=()=>{if(this.item.alias){const t=this.item.alias.trim();t!==this.item.alias&&this.itemChange.emit(Object.assign(Object.assign({},this.item),{alias:t||void 0}))}},this.handleDescriptionBlur=()=>{if(this.item.description){const t=this.item.description.trim();t!==this.item.description&&this.itemChange.emit(Object.assign(Object.assign({},this.item),{description:t||void 0}))}},this.handleRemove=()=>{this.itemChange.emit(null)}}componentWillLoad(){this.showAliasInput=!!this.item.alias,this.showDescriptionInput=!!this.item.description}componentWillUpdate(){this.item.alias&&!this.showAliasInput&&(this.showAliasInput=!0),this.item.description&&!this.showDescriptionInput&&(this.showDescriptionInput=!0)}render(){return[i("div",{key:"e804c4feb61b44aeb2f141c5b5d3269a76ac9320",class:"property-controls"},i("div",{key:"becbf35e823b8b16df5366c099b98ce6566d514a",class:"property-path"},i("limebb-property-selector",{key:"2b35ccefecb9dbd4d2c418566482d9903a1c0d02",platform:this.platform,context:this.context,limetype:this.limetype,label:"Property",value:this.item.path,required:!0,onChange:this.handlePathChange})),i("div",{key:"1e598bbbb6df1c5e93bd4ae5f6b112a745a68df9",class:"control-buttons"},i("limel-icon-button",{key:"51d3dfaa9f3578802abf6f65ec876535740ae6a5",icon:this.getAliasIcon(),label:"Add alias",class:this.item.alias?"has-value":"",onClick:this.toggleAliasInput}),i("limel-icon-button",{key:"b2f6050b01d810cc20093e87a09452c625cd7847",icon:this.getDescriptionIcon(),label:"Add description",class:this.item.description?"has-value":"",onClick:this.toggleDescriptionInput}),i("limel-icon-button",{key:"cd58b575c383555db343ebe4a22392c51346751e",icon:"trash",label:"Remove property",onClick:this.handleRemove}))),this.showAliasInput&&i("div",{key:"cd95aa0e34945eb9da88e4be4e4c2326c41ec090",class:"alias"},i("limel-input-field",{key:"f62646327adfb8fcd3f0f2aa3a5325ad8a3bfcc3",label:"Alias",value:this.item.alias||"",placeholder:"Custom property name...",onChange:this.handleAliasChange,onBlur:this.handleAliasBlur})),this.showDescriptionInput&&i("div",{key:"b00f9859a80df3aacf3f524fc1451473e5fcdf5a",class:"description"},i("limel-input-field",{key:"044485f6a35f84816e7458a08882a40aaeacf2f4",label:"Description",value:this.item.description||"",placeholder:"Describe this property for AI...",onChange:this.handleDescriptionChange,onBlur:this.handleDescriptionBlur}))]}getAliasIcon(){return this.showAliasInput?{name:"add_tag",color:"rgb(var(--color-teal-default))"}:{name:"add_tag",color:"rgb(var(--color-gray-600))"}}getDescriptionIcon(){return this.showDescriptionInput?{name:"comments",color:"rgb(var(--color-teal-default))"}:{name:"comments",color:"rgb(var(--color-gray-600))"}}};n.style=":host(limebb-lime-query-response-format-item){display:flex;flex-direction:column;gap:0.5rem}.property-controls{display:flex;flex-wrap:wrap;gap:0.5rem;width:100%}.property-path{flex-grow:1;min-width:min(10rem, 100%)}.control-buttons{flex-shrink:0;display:flex;flex-direction:row;gap:0.25rem;align-items:center}.control-buttons limel-icon-button{opacity:0.6;transition:opacity 0.2s ease}.control-buttons limel-icon-button:hover{opacity:1}.control-buttons limel-icon-button.has-value{opacity:1;color:rgb(var(--color-blue-default))}.alias,.description{padding-left:1rem;width:calc(100% - 8.75rem)}@media (max-width: 768px){.property-controls{flex-direction:column;gap:0.5rem}.alias,.description{padding-left:0;width:100%}}";export{l as limebb_lime_query_response_format_editor,n as limebb_lime_query_response_format_item}
@@ -0,0 +1 @@
1
+ import{r as i,c as e,h as t,H as r}from"./p-1556b545.js";import{T as o}from"./p-4838284a.js";import{i as s}from"./p-fa2da6bc.js";import"./p-b748c770.js";const l=class{constructor(t){i(this,t),this.change=e(this,"change",7),this.mode="gui",this.codeValue="",this.limetype="",this.handleLimetypeChange=i=>{i.stopPropagation(),this.limetype=i.detail,this.filter=void 0,this.internalResponseFormat={object:{_id:null}},this.emitChange()},this.handleFilterChange=i=>{var e;i.stopPropagation(),this.filter=null!==(e=i.detail)&&void 0!==e?e:void 0,this.emitChange()},this.handleResponseFormatChange=i=>{i.stopPropagation(),this.internalResponseFormat=i.detail,this.emitChange()},this.handleLimitChange=i=>{i.stopPropagation();const e=i.detail;this.limit=e?Number.parseInt(e,10):void 0,this.emitChange()},this.handleOrderByChange=i=>{i.stopPropagation(),this.orderBy=i.detail,this.emitChange()},this.handleChange=i=>{i.stopPropagation();const e=i.detail.id;if("gui"===e)try{const i=JSON.parse(this.codeValue);if(!this.checkGuiSupport().guiSupported)return;this.limetype=i.limetype||"",this.filter=i.filter,this.internalResponseFormat=i.responseFormat,this.limit=i.limit,this.orderBy=i.orderBy,this.mode="gui",this.change.emit(i)}catch(i){}else"code"===e&&(this.updateCodeValue(),this.mode="code")},this.handleCodeChange=i=>{i.stopPropagation(),this.codeValue=i.detail;try{const i=JSON.parse(this.codeValue);this.change.emit(i)}catch(i){}}}getButtons(){return[{id:"gui",title:"Visual"},{id:"code",title:"Code"}]}get guiModeEnabled(){var i,e,t;return null!==(t=null===(e=null===(i=this.platform)||void 0===i?void 0:i.isFeatureEnabled)||void 0===e?void 0:e.call(i,"useLimeQueryBuilderGuiMode"))&&void 0!==t&&t}componentWillLoad(){if(!this.guiModeEnabled)return this.mode="code",void this.updateCodeValue();this.value&&(this.limetype=this.value.limetype||"",this.filter=this.value.filter,this.internalResponseFormat=this.value.responseFormat,this.limit=this.value.limit,this.orderBy=this.value.orderBy),this.updateCodeValue(),this.checkGuiSupport().guiSupported||(this.mode="code")}render(){return t(r,{key:"02e7367fbc718a8625c8d49d5e546acca0986ce2"},this.renderHeader(),this.renderContent())}renderContent(){const i=this.checkGuiSupport();return this.guiModeEnabled&&"code"!==this.mode?this.renderGuiMode():this.renderCodeMode(i)}emitChange(){"code"!==this.mode&&this.limetype&&this.change.emit(this.buildLimeQuery())}updateCodeValue(){this.codeValue=this.limetype?JSON.stringify(this.buildLimeQuery(),null,2):JSON.stringify(this.value||{},null,2)}buildLimeQuery(){const i={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter};return void 0!==this.limit&&this.limit>0&&(i.limit=this.limit),this.orderBy&&this.orderBy.length>0&&(i.orderBy=this.orderBy),i}checkGuiSupport(){if(!this.limetypes)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};let i;if("code"===this.mode&&this.codeValue)try{i=JSON.parse(this.codeValue)}catch(i){return{valid:!1,guiSupported:!1,validationErrors:["Invalid JSON"],guiLimitations:[]}}else{if(!this.limetype)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};i={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter},void 0!==this.limit&&this.limit>0&&(i.limit=this.limit)}return s(i,this.limetypes,this.activeLimetype,this.guiModeEnabled)}renderModeSwitch(i){const e=!i.guiSupported,r=this.getButtons().map((i=>Object.assign(Object.assign({},i),{selected:i.id===this.mode})));return t("limel-button-group",{slot:"actions",onChange:this.handleChange,value:r,disabled:e})}renderCodeEditor(i){return[t("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!i.valid&&i.validationErrors.length>0&&t("div",{class:"validation-errors"},t("strong",null,"Invalid Lime Query:"),t("ul",null,i.validationErrors.map((i=>t("li",null,i))))),this.guiModeEnabled&&i.valid&&!i.guiSupported&&i.guiLimitations.length>0&&t("div",{class:"gui-limitations"},t("strong",null,"Cannot switch to GUI mode:"),t("ul",null,i.guiLimitations.map((i=>t("li",null,i)))))]}renderLimetypeSection(){return t("div",{class:"limetype-section"},t("limebb-limetype-field",{platform:this.platform,context:this.context,label:"Object Type",value:this.limetype,required:!0,fieldName:"limetype",helperText:"Select the type of object you want to query",onChange:this.handleLimetypeChange}))}renderResponseFormatSection(){if(this.limetype)return t("div",{class:"response-format-section"},t("limebb-lime-query-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalResponseFormat,onChange:this.handleResponseFormatChange}))}renderFilterSection(){if(this.limetype)return t("div",{class:"filter-section"},t("h4",{class:"section-label"},"Filter Conditions"),t("limebb-lime-query-filter-builder",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.filter,onExpressionChange:this.handleFilterChange}))}renderQueryOptionsSection(){var i;if(this.limetype)return t("div",{class:"query-options-section"},t("h4",{class:"section-label"},"Query Options"),t("div",{class:"query-options-controls"},t("limel-input-field",{label:"Limit",type:"number",value:(null===(i=this.limit)||void 0===i?void 0:i.toString())||"",placeholder:"No limit",helperText:"Maximum number of results",onChange:this.handleLimitChange}),t("limebb-lime-query-order-by-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.orderBy,onChange:this.handleOrderByChange})))}renderGuiMode(){return t("div",{class:"gui-mode"},this.renderLimetypeSection(),this.renderResponseFormatSection(),this.renderFilterSection(),this.renderQueryOptionsSection())}renderHeader(){const i=this.checkGuiSupport();return t("limel-header",{heading:this.label},this.renderModeControls(i))}renderModeControls(i){if(this.guiModeEnabled)return this.renderModeSwitch(i)}renderCodeMode(i){return t("div",{class:"code-mode"},this.renderCodeEditor(i))}};(function(i,e,t,r){var o,s=arguments.length,l=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(i,e,t,r);else for(var n=i.length-1;n>=0;n--)(o=i[n])&&(l=(s<3?o(l):s>3?o(e,t,l):o(e,t))||l);s>3&&l&&Object.defineProperty(e,t,l)})([o()],l.prototype,"limetypes",void 0),l.style="*,*:before,*:after{box-sizing:border-box}:host(limebb-lime-query-builder){--header-background-color:rgb(var(--contrast-400));--limebb-lime-query-builder-background-color:rgb(var(--contrast-100));--limebb-lime-query-builder-border-radius:0.75rem;box-sizing:border-box;width:calc(100% - 1.5rem);margin:0.75rem auto;display:flex;flex-direction:column;border-radius:var(--limebb-lime-query-builder-border-radius);background-color:var(--limebb-lime-query-builder-background-color);box-shadow:var(--shadow-inflated-16)}.gui-mode{padding:1rem;border:1px solid var(--header-background-color);border-radius:0 0 0.754rem 0.75rem}.code-mode{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-mode .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-mode .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-mode .validation-errors ul{margin:0;padding-left:1.5rem}.code-mode .validation-errors li{margin:0.25rem 0}.code-mode .gui-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-mode .gui-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-mode .gui-limitations ul{margin:0;padding-left:1.5rem}.code-mode .gui-limitations li{margin:0.25rem 0}.limetype-section{display:flex;flex-direction:column}.filter-section,.query-options-section{display:flex;flex-direction:column;gap:1rem;padding-top:1rem}.section-label{margin:0;font-size:1.125rem;font-weight:600;color:rgb(var(--contrast-1000))}.query-options-controls{display:flex;flex-direction:column;gap:1rem}";export{l as limebb_lime_query_builder}
@@ -26,22 +26,6 @@ export interface UpdateChildExpressionResult {
26
26
  * @returns Subheading text, or empty string if 0 or 1 expressions
27
27
  */
28
28
  export declare function getFilterGroupSubheading(operator: Operator.AND | Operator.OR, expressionCount: number): string;
29
- /**
30
- * Get the label for the "Add condition" button
31
- *
32
- * @param operator - The group's operator (AND or OR)
33
- * @param expressionCount - Number of child expressions
34
- * @returns Appropriate button label based on context
35
- */
36
- export declare function getAddConditionButtonLabel(operator: Operator.AND | Operator.OR, expressionCount: number): string;
37
- /**
38
- * Get the label for the "Add group" button
39
- *
40
- * @param operator - The group's operator (AND or OR)
41
- * @param expressionCount - Number of child expressions
42
- * @returns Appropriate button label based on context
43
- */
44
- export declare function getAddGroupButtonLabel(operator: Operator.AND | Operator.OR, expressionCount: number): string;
45
29
  /**
46
30
  * Create a new empty comparison expression
47
31
  *
@@ -1,4 +1,5 @@
1
1
  import { EventEmitter } from '../../../stencil-public-runtime';
2
+ import { Option } from '@limetech/lime-elements';
2
3
  import { AndOrExpression, Expression, LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform } from '@limetech/lime-web-components';
3
4
  /**
4
5
  * Lime Query Filter Group Component
@@ -39,6 +40,8 @@ export declare class LimeQueryFilterGroupComponent implements LimeWebComponent {
39
40
  * The group expression (AND or OR)
40
41
  */
41
42
  expression: AndOrExpression;
43
+ value: Option;
44
+ componentWillLoad(): void;
42
45
  /**
43
46
  * Emitted when the group expression changes
44
47
  * Emits undefined when expression should be removed
@@ -46,15 +49,12 @@ export declare class LimeQueryFilterGroupComponent implements LimeWebComponent {
46
49
  */
47
50
  expressionChange: EventEmitter<Expression | undefined>;
48
51
  render(): any;
49
- private get actions();
50
- private renderActions;
51
- private renderActionButton;
52
+ private renderOperators;
53
+ private options;
52
54
  private getSubheading;
53
55
  private renderChildExpression;
54
56
  private renderAddButton;
55
57
  private renderAddGroupButton;
56
- private getAddButtonLabel;
57
- private getAddGroupButtonLabel;
58
58
  private handleToggleOperator;
59
59
  private handleAddChildExpression;
60
60
  private handleAddChildGroup;
@@ -69,6 +69,7 @@ export declare class LimeQueryBuilder implements LimeWebComponent {
69
69
  private get guiModeEnabled();
70
70
  componentWillLoad(): void;
71
71
  render(): any;
72
+ private renderContent;
72
73
  private handleLimetypeChange;
73
74
  private handleFilterChange;
74
75
  private handleResponseFormatChange;
@@ -85,7 +86,7 @@ export declare class LimeQueryBuilder implements LimeWebComponent {
85
86
  private renderFilterSection;
86
87
  private renderQueryOptionsSection;
87
88
  private renderGuiMode;
88
- private renderLabel;
89
+ private renderHeader;
89
90
  private renderModeControls;
90
91
  private renderCodeMode;
91
92
  private handleChange;
@@ -49,6 +49,7 @@ export declare class ResponseFormatEditor implements LimeWebComponent {
49
49
  componentWillLoad(): void;
50
50
  componentWillUpdate(): void;
51
51
  render(): any;
52
+ private renderPropertyCount;
52
53
  private renderItem;
53
54
  private handleItemChange;
54
55
  private handleAddProperty;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-crm-building-blocks",
3
- "version": "1.103.0",
3
+ "version": "1.103.1",
4
4
  "description": "A home for shared components meant for use with Lime CRM",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as e,c as t,h as i}from"./p-1556b545.js";import{Z as r,T as s}from"./p-4838284a.js";import{g as l}from"./p-b748c770.js";function o(){return{key:"",op:r.EQUALS,exp:""}}function n(e,t){return{op:e.op,exp:[...e.exp,t]}}const a=class{constructor(s){e(this,s),this.expressionChange=t(this,"expressionChange",7),this.renderActionButton=e=>i("limel-icon-button",{class:"action-icon",elevated:!0,icon:e.icon,label:e.label,onClick:this.handleToggleOperator}),this.renderChildExpression=(e,t)=>i("li",null,i("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:e,onExpressionChange:this.handleExpressionChange(t)})),this.handleToggleOperator=()=>{const e={op:(t=this.expression).op===r.AND?r.OR:r.AND,exp:[...t.exp]};var t;this.expressionChange.emit(e)},this.handleAddChildExpression=()=>{const e=o(),t=n(this.expression,e);this.expressionChange.emit(t)},this.handleAddChildGroup=()=>{const e={op:this.expression.op===r.AND?r.OR:r.AND,exp:[o()]},t=n(this.expression,e);this.expressionChange.emit(t)},this.handleExpressionChange=e=>t=>{t.stopPropagation();const i=function(e,t,i){const r=[...e.exp];return i?(r[t]=i,{type:"updated",expression:{op:e.op,exp:r}}):(r.splice(t,1),0===r.length?{type:"removed",expression:void 0}:1===r.length?{type:"unwrapped",expression:r[0]}:{type:"updated",expression:{op:e.op,exp:r}})}(this.expression,e,t.detail);this.expressionChange.emit(i.expression)}}render(){const e=this.getSubheading();return i("div",{key:"b7972fb9e34b8b0b57ae82b3bf4de3e55b66169f",class:"expression"},e&&i("limel-header",{key:"9721388fa6a60018f95dbe27b2959dcc1c11211e",icon:{name:this.expression.op===r.AND?"dot_bricks":"dot_circle",color:"rgb(var(--contrast-800))"},subheading:e,onClick:this.handleToggleOperator,class:"clickable-header"},this.renderActions()),i("ul",{key:"f3ae21204e082e81068c0e20b76e14ed4b577051"},this.expression.exp.map(this.renderChildExpression),i("li",{key:"d5958d8b61f348540b3dfb821de16ed0f2d0a1f4",class:"add-button"},this.renderAddButton(),this.renderAddGroupButton())))}get actions(){return[{id:"1",icon:this.expression.op===r.AND?"dot_circle":"dot_bricks",label:this.expression.op===r.AND?"Any condition (OR)":"All conditions (AND)"}]}renderActions(){return i("div",{class:"actions"},this.actions.map(this.renderActionButton))}getSubheading(){return this.expression.exp.length<=1?"":this.expression.op===r.AND?"All of these conditions are true":"Any of these conditions are true"}renderAddButton(){const e=this.getAddButtonLabel();return i("limel-button",{label:e,icon:"plus_math",onClick:this.handleAddChildExpression})}renderAddGroupButton(){const e=this.getAddGroupButtonLabel();return i("limel-button",{label:e,icon:"tree_structure",onClick:this.handleAddChildGroup})}getAddButtonLabel(){return 0===this.expression.exp.length?"Add a condition":this.expression.op===r.AND?"Add another condition":"Add alternative"}getAddGroupButtonLabel(){return 0===this.expression.exp.length?"Add a group":this.expression.op===r.AND?"Add another group":"Add alternative group"}};a.style='@charset "UTF-8";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:0;background-color:rgb(var(--contrast-100));border:1px solid rgb(var(--contrast-500));border-radius:0.75rem}.expression .clickable-header{cursor:pointer;user-select:none}.expression .clickable-header:hover{background-color:rgb(var(--contrast-200))}.expression>ul{list-style:none;margin-top:0;margin-right:1rem;margin-bottom:1rem;padding-left:1rem;list-style:disc}.expression>ul li{list-style:none;margin-top:1rem}.expression>ul li.add-button{list-style:none;display:flex;gap:0.5rem}';const h=class{constructor(i){e(this,i),this.expressionChange=t(this,"expressionChange",7),this.handleExpressionChange=e=>{var t;e.stopPropagation();const i=null!==(t=e.detail)&&void 0!==t?t:void 0;this.expressionChange.emit(void 0!==i?{op:r.NOT,exp:i}:void 0)}}render(){return i("div",{key:"29770b10d0b892750ad2aab3520cec5a82063774",class:"expression"},this.label&&i("limel-header",{key:"9e47d14c6cb526c9c31d67e11a5ed5ec665c7f62",heading:this.label}),i("limebb-lime-query-filter-expression",{key:"943c1529057aa6cc918dc935f1a5782b149351ae",platform:this.platform,context:this.context,label:"Not",limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression.exp,onExpressionChange:this.handleExpressionChange}))}};h.style='@charset "UTF-8";.expression{display:flex;flex-direction:column;margin-bottom:1rem;gap:1rem;padding:1rem;border-left:0.25rem solid rgb(var(--contrast-400));background-color:rgb(var(--contrast-100))}';const c=class{constructor(i){e(this,i),this.change=t(this,"change",7),this.label="Value",this.inputMode="value",this.handleTextChange=e=>{e.stopPropagation();const t=e.detail,i=Number(t);Number.isNaN(i)||""===t?this.change.emit(t):this.change.emit(i)},this.handleSelectChange=e=>{e.stopPropagation();const t=e.detail;Array.isArray(t)?this.change.emit(t.map((e=>e.value))):this.change.emit(null==t?void 0:t.value)},this.handleBooleanChange=e=>{e.stopPropagation();const t=e.detail;Array.isArray(t)||this.change.emit("true"===(null==t?void 0:t.value))},this.handleDateChange=e=>{e.stopPropagation();const t=e.detail;this.change.emit(t?t.toISOString():null)},this.handleMultiValueChange=e=>{e.stopPropagation();const t=e.detail.split(",").map((e=>e.trim())).filter((e=>e.length>0));this.change.emit(t)},this.handleModeToggle=()=>{"value"===this.inputMode?(this.inputMode="placeholder",this.change.emit("%activeObject%")):(this.inputMode="value",this.change.emit(""))},this.handlePlaceholderPropertyChange=e=>{e.stopPropagation();const t=this.buildPlaceholderValue(e.detail);this.change.emit(t)}}componentWillLoad(){this.isPlaceholder(this.value)&&(this.inputMode="placeholder")}componentWillUpdate(){this.isPlaceholder(this.value)&&"placeholder"!==this.inputMode?this.inputMode="placeholder":this.isPlaceholder(this.value)||"placeholder"!==this.inputMode||(this.inputMode="value")}isPlaceholder(e){return"string"==typeof e&&e.startsWith("%activeObject%")}parsePlaceholderPath(e){return this.isPlaceholder(e)?e.replace(/^%activeObject%\.?/,""):""}buildPlaceholderValue(e){return e?`%activeObject%.${e}`:"%activeObject%"}render(){return this.operator?i("div",{class:"value-input-container"},this.renderModeToggle(),"placeholder"===this.inputMode?this.renderPlaceholderInput():this.renderValueInputByType()):null}renderModeToggle(){if(!this.activeLimetype)return null;const e="placeholder"===this.inputMode;return i("limel-icon-button",{class:"mode-toggle",icon:e?"text":"link",label:e?"Use Value":"Use Placeholder",onClick:this.handleModeToggle})}renderPlaceholderInput(){const e=this.parsePlaceholderPath(this.value);return i("div",{class:"placeholder-input"},i("limebb-property-selector",{platform:this.platform,context:this.context,limetype:this.activeLimetype,label:"Active Object Property",value:e,required:!1,helperText:"Select property from the active object",onChange:this.handlePlaceholderPropertyChange}),this.isPlaceholder(this.value)&&i("div",{class:"placeholder-preview"},i("limel-icon",{name:"info",size:"small"}),i("span",null,"Placeholder: ",this.value)))}renderValueInputByType(){if(this.operator===r.IN)return this.renderMultiValueInput();const e=this.getProperty();if(!e)return this.renderTextInput();switch(e.type){case"integer":case"decimal":return this.renderNumberInput(e.type);case"yesno":return this.renderBooleanInput();case"option":return this.renderOptionInput(e);case"date":return this.renderDateInput();case"time":return this.renderTimeInput();default:return this.renderTextInput()}}renderTextInput(){var e;return i("limel-input-field",{label:this.label,value:(null===(e=this.value)||void 0===e?void 0:e.toString())||"",placeholder:"Enter value",onChange:this.handleTextChange})}renderNumberInput(e){var t;const r="integer"===e?1:.01;return i("limel-input-field",{label:this.label,type:"number",value:(null===(t=this.value)||void 0===t?void 0:t.toString())||"",step:r,onChange:this.handleTextChange})}renderBooleanInput(){const e=[{text:"True",value:"true"},{text:"False",value:"false"}],t=!0===this.value||"true"===this.value?"true":"false",r=e.find((e=>e.value===t));return i("limel-select",{label:this.label,options:e,value:r,onChange:this.handleBooleanChange})}renderOptionInput(e){if(!e.options||0===e.options.length)return this.renderTextInput();const t=e.options.map((e=>({text:e.text||e.key,value:e.key}))),r=t.find((e=>e.value===this.value));return i("limel-select",{label:this.label,options:t,value:r,onChange:this.handleSelectChange})}renderDateInput(){const e="string"==typeof this.value?new Date(this.value):this.value;return i("limel-date-picker",{label:this.label,value:e,onChange:this.handleDateChange})}renderTimeInput(){return i("limel-input-field",{label:this.label,type:"time",value:this.value||"",onChange:this.handleTextChange})}renderMultiValueInput(){const e=Array.isArray(this.value)?this.value.join(", "):this.value||"";return i("limel-input-field",{label:this.label+" (comma-separated)",value:e,placeholder:"e.g., won, lost, tender",onChange:this.handleMultiValueChange})}getProperty(){if(this.limetypes&&this.limetype&&this.propertyPath)return l(this.limetypes,this.limetype,this.propertyPath)}};(function(e,t,i,r){var s,l=arguments.length,o=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(o=(l<3?s(o):l>3?s(t,i,o):s(t,i))||o);l>3&&o&&Object.defineProperty(t,i,o)})([s()],c.prototype,"limetypes",void 0),c.style=":host{display:block}.value-input-container{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.mode-toggle{flex-shrink:0;margin-top:0.5rem;opacity:0.7;transition:opacity 0.2s ease}.mode-toggle:hover{opacity:1}.placeholder-input{flex-grow:1;display:flex;flex-direction:column;gap:0.5rem}.placeholder-preview{display:flex;align-items:center;gap:0.5rem;padding:0.5rem;background-color:rgba(var(--color-blue-light), 0.1);border-radius:var(--border-radius-small);font-size:0.875rem;color:rgb(var(--color-blue-default));border-left:3px solid rgb(var(--color-blue-default))}.placeholder-preview limel-icon{flex-shrink:0;color:rgb(var(--color-blue-default))}.placeholder-preview span{font-family:var(--font-monospace);word-break:break-all}";export{a as limebb_lime_query_filter_group,h as limebb_lime_query_filter_not,c as limebb_lime_query_value_input}
@@ -1 +0,0 @@
1
- import{r as i,c as e,h as t}from"./p-1556b545.js";import{T as r}from"./p-4838284a.js";import{i as o}from"./p-fa2da6bc.js";import"./p-b748c770.js";const s=class{constructor(t){i(this,t),this.change=e(this,"change",7),this.mode="gui",this.codeValue="",this.limetype="",this.handleLimetypeChange=i=>{i.stopPropagation(),this.limetype=i.detail,this.filter=void 0,this.internalResponseFormat={object:{_id:null}},this.emitChange()},this.handleFilterChange=i=>{var e;i.stopPropagation(),this.filter=null!==(e=i.detail)&&void 0!==e?e:void 0,this.emitChange()},this.handleResponseFormatChange=i=>{i.stopPropagation(),this.internalResponseFormat=i.detail,this.emitChange()},this.handleLimitChange=i=>{i.stopPropagation();const e=i.detail;this.limit=e?Number.parseInt(e,10):void 0,this.emitChange()},this.handleOrderByChange=i=>{i.stopPropagation(),this.orderBy=i.detail,this.emitChange()},this.handleChange=i=>{i.stopPropagation();const e=i.detail.id;if("gui"===e)try{const i=JSON.parse(this.codeValue);if(!this.checkGuiSupport().guiSupported)return;this.limetype=i.limetype||"",this.filter=i.filter,this.internalResponseFormat=i.responseFormat,this.limit=i.limit,this.orderBy=i.orderBy,this.mode="gui",this.change.emit(i)}catch(i){}else"code"===e&&(this.updateCodeValue(),this.mode="code")},this.handleCodeChange=i=>{i.stopPropagation(),this.codeValue=i.detail;try{const i=JSON.parse(this.codeValue);this.change.emit(i)}catch(i){}}}getButtons(){return[{id:"gui",title:"Visual"},{id:"code",title:"Code"}]}get guiModeEnabled(){var i,e,t;return null!==(t=null===(e=null===(i=this.platform)||void 0===i?void 0:i.isFeatureEnabled)||void 0===e?void 0:e.call(i,"useLimeQueryBuilderGuiMode"))&&void 0!==t&&t}componentWillLoad(){if(!this.guiModeEnabled)return this.mode="code",void this.updateCodeValue();this.value&&(this.limetype=this.value.limetype||"",this.filter=this.value.filter,this.internalResponseFormat=this.value.responseFormat,this.limit=this.value.limit,this.orderBy=this.value.orderBy),this.updateCodeValue(),this.checkGuiSupport().guiSupported||(this.mode="code")}render(){const i=this.checkGuiSupport(),e=!this.guiModeEnabled||"code"===this.mode;return t("div",{key:"5e9c8bb860cf348b08272831bc2e252752fad24d",class:"lime-query-builder"},this.renderLabel(),this.renderModeControls(i),e?this.renderCodeMode(i):this.renderGuiMode())}emitChange(){"code"!==this.mode&&this.limetype&&this.change.emit(this.buildLimeQuery())}updateCodeValue(){this.codeValue=this.limetype?JSON.stringify(this.buildLimeQuery(),null,2):JSON.stringify(this.value||{},null,2)}buildLimeQuery(){const i={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter};return void 0!==this.limit&&this.limit>0&&(i.limit=this.limit),this.orderBy&&this.orderBy.length>0&&(i.orderBy=this.orderBy),i}checkGuiSupport(){if(!this.limetypes)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};let i;if("code"===this.mode&&this.codeValue)try{i=JSON.parse(this.codeValue)}catch(i){return{valid:!1,guiSupported:!1,validationErrors:["Invalid JSON"],guiLimitations:[]}}else{if(!this.limetype)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};i={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter},void 0!==this.limit&&this.limit>0&&(i.limit=this.limit)}return o(i,this.limetypes,this.activeLimetype,this.guiModeEnabled)}renderModeSwitch(i){const e=!i.guiSupported,r=this.getButtons().map((i=>Object.assign(Object.assign({},i),{selected:i.id===this.mode})));return t("limel-button-group",{onChange:this.handleChange,value:r,disabled:e})}renderCodeEditor(i){return t("div",{class:"code-editor-container"},t("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!i.valid&&i.validationErrors.length>0&&t("div",{class:"validation-errors"},t("strong",null,"Invalid Lime Query:"),t("ul",null,i.validationErrors.map((i=>t("li",null,i))))),this.guiModeEnabled&&i.valid&&!i.guiSupported&&i.guiLimitations.length>0&&t("div",{class:"gui-limitations"},t("strong",null,"Cannot switch to GUI mode:"),t("ul",null,i.guiLimitations.map((i=>t("li",null,i))))))}renderLimetypeSection(){return t("div",{class:"limetype-section"},t("limebb-limetype-field",{platform:this.platform,context:this.context,label:"Object Type",value:this.limetype,required:!0,fieldName:"limetype",helperText:"Select the type of object you want to query",onChange:this.handleLimetypeChange}))}renderResponseFormatSection(){if(this.limetype)return t("div",{class:"response-format-section"},t("limebb-lime-query-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalResponseFormat,onChange:this.handleResponseFormatChange}))}renderFilterSection(){if(this.limetype)return t("div",{class:"filter-section"},t("h4",{class:"section-label"},"Filter Conditions"),t("limebb-lime-query-filter-builder",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.filter,onExpressionChange:this.handleFilterChange}))}renderQueryOptionsSection(){var i;if(this.limetype)return t("div",{class:"query-options-section"},t("h4",{class:"section-label"},"Query Options"),t("div",{class:"query-options-controls"},t("limel-input-field",{label:"Limit",type:"number",value:(null===(i=this.limit)||void 0===i?void 0:i.toString())||"",placeholder:"No limit",helperText:"Maximum number of results",onChange:this.handleLimitChange}),t("limebb-lime-query-order-by-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.orderBy,onChange:this.handleOrderByChange})))}renderGuiMode(){return t("div",{class:"gui-mode"},this.renderLimetypeSection(),this.renderResponseFormatSection(),this.renderFilterSection(),this.renderQueryOptionsSection())}renderLabel(){if(this.label)return t("h3",{class:"lime-query-builder-label"},this.label)}renderModeControls(i){if(this.guiModeEnabled)return t("div",{class:"mode-controls"},this.renderModeSwitch(i))}renderCodeMode(i){return t("div",{class:"code-mode"},this.renderCodeEditor(i))}};(function(i,e,t,r){var o,s=arguments.length,l=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(i,e,t,r);else for(var n=i.length-1;n>=0;n--)(o=i[n])&&(l=(s<3?o(l):s>3?o(e,t,l):o(e,t))||l);s>3&&l&&Object.defineProperty(e,t,l)})([r()],s.prototype,"limetypes",void 0),s.style=":host(limebb-lime-lime-query-builder){display:block;width:100%}.lime-query-builder{display:flex;flex-direction:column;gap:1rem;padding:1rem}.mode-controls{display:flex;justify-content:flex-end;padding:0.5rem}.gui-mode,.code-mode{display:block}.code-editor-container{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-editor-container .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .validation-errors ul{margin:0;padding-left:1.5rem}.code-editor-container .validation-errors li{margin:0.25rem 0}.code-editor-container .gui-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .gui-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .gui-limitations ul{margin:0;padding-left:1.5rem}.code-editor-container .gui-limitations li{margin:0.25rem 0}.lime-query-builder-label{margin:0;font-size:1.5rem;font-weight:600;color:rgb(var(--contrast-1100))}.limetype-section{display:flex;flex-direction:column}.filter-section,.query-options-section{display:flex;flex-direction:column;gap:1rem;padding-top:1rem}.section-label{margin:0;font-size:1.125rem;font-weight:600;color:rgb(var(--contrast-1000))}.query-options-controls{display:flex;flex-direction:column;gap:1rem}@media (max-width: 768px){.lime-query-builder{gap:1.5rem}}";export{s as limebb_lime_query_builder}
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as i}from"./p-1556b545.js";import{Z as s,c as r}from"./p-4838284a.js";import{b as o}from"./p-20bfca36.js";import{i as n}from"./p-1484e300.js";import{b as l}from"./p-a659d55a.js";import{i as h,a,b as d}from"./p-b31772c8.js";import"./p-35897ec3.js";import"./p-fe2b91d9.js";import"./p-5322fd19.js";function m(t){return"string"==typeof t||!h(t)&&a(t)&&"[object String]"==d(t)}const c=class{constructor(i){t(this,i),this.expressionChange=e(this,"expressionChange",7),this.handleAddFirstCondition=()=>{this.expressionChange.emit({key:"",op:s.EQUALS,exp:""})},this.handlePromoteAndAdd=()=>{this.expression&&this.expressionChange.emit({op:s.AND,exp:[this.expression,{key:"",op:s.EQUALS,exp:""}]})},this.handleExpressionChange=t=>{var e;t.stopPropagation(),this.expressionChange.emit(null!==(e=t.detail)&&void 0!==e?e:void 0)}}render(){return this.expression?this.needsPromotion()?this.renderWithPromotionButton():i("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression,onExpressionChange:this.handleExpressionChange}):this.renderEmptyState()}needsPromotion(){return!!this.expression&&("key"in this.expression||this.expression.op===s.NOT)}renderEmptyState(){return i("limel-button",{label:"Add a condition",icon:"plus_math",onClick:this.handleAddFirstCondition})}renderWithPromotionButton(){return i("div",{class:"expression-with-promotion"},i("limebb-lime-query-filter-expression",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.expression,onExpressionChange:this.handleExpressionChange}),i("limel-button",{label:"Add another condition",icon:"plus_math",onClick:this.handlePromoteAndAdd}))}};c.style=".expression-with-promotion{display:flex;flex-direction:column;gap:1rem}limel-button{width:100%}.query-options-section{margin-top:1rem}";const p=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.label="Sort Order",this.items=[],this.handleItemChange=t=>e=>{e.stopPropagation();const i=[...this.items];null===e.detail?i.splice(t,1):i[t]=e.detail,this.items=i,this.emitChange()},this.handleAddSortField=()=>{this.items=[...this.items,{"":"ASC"}],this.emitChange()}}componentWillLoad(){this.value&&this.value.length>0&&(this.items=[...this.value])}handleValueChange(t){t&&(t.length!==this.items.length||!t.every(((t,e)=>{const i=this.items[e];if(!i)return!1;const s=Object.keys(t)[0],r=Object.keys(i)[0];return s===r&&t[s]===i[r]})))&&(this.items=t.length>0?[...t]:[])}render(){return this.limetype?i("div",{class:"order-by-editor"},i("div",{class:"header"},i("h4",null,this.label)),this.renderOrderByList(),this.renderActions()):i("div",{class:"empty-state"},i("p",null,"Select a limetype to configure sorting"))}renderOrderByList(){return 0===this.items.length?null:i("div",{class:"order-by-list"},this.items.map(((t,e)=>this.renderItem(t,e))))}renderActions(){return i("limel-button",{label:"Add Sort Field",icon:"plus_math",onClick:this.handleAddSortField})}renderItem(t,e){const s=Object.keys(t)[0]||"";return i("limebb-lime-query-order-by-item",{key:`${s}-${e}`,class:"order-by-item",platform:this.platform,context:this.context,limetype:this.limetype,item:t,onItemChange:this.handleItemChange(e)})}emitChange(){this.change.emit(this.items)}static get watchers(){return{value:["handleValueChange"]}}};p.style=":host(limebb-lime-query-order-by-editor){display:block;width:100%}.order-by-editor{display:flex;flex-direction:column;gap:1rem;padding:1rem 0}.header{display:flex;justify-content:space-between;align-items:center;gap:1rem}.header h4{margin:0;font-size:1rem;font-weight:600;color:rgb(var(--contrast-1000))}.order-by-list{display:flex;flex-direction:column;gap:1rem;border:1px solid rgb(var(--contrast-300));border-radius:0.25rem;background-color:rgb(var(--contrast-50));min-height:4rem}.order-by-item{padding:0.5rem;border-radius:0.25rem;transition:background-color 0.2s}.order-by-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex;width:100%}.summary{display:flex;justify-content:space-between;align-items:center;padding-top:0.5rem;border-top:1px solid rgb(var(--contrast-300))}.summary .count{font-size:0.875rem;font-weight:500;color:rgb(var(--contrast-900))}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}";const u=["string","text","phone","integer","decimal","percent","time","date","year","quarter","month","yesno","link","user","xml","option","set","file","system"],b=u.filter((t=>"system"!==t));b.push("belongsto","hasone","hasmany","hasandbelongstomany");const y=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.propertyFields=[],this.fieldName="limetype",this.handleChange=t=>{t.stopPropagation();let e="";t.detail&&"value"in t.detail&&(e=t.detail.value),this.change.emit(e||void 0)}}componentWillLoad(){const t=this.platform.get(r.Application).getLanguage();this.collator=new Intl.Collator(t,{numeric:!0,sensitivity:"base"})}componentShouldUpdate(t,e,i){var s,r,o,n;return"formInfo"!==i||(o=null===(s=null==t?void 0:t.schema)||void 0===s?void 0:s.oneOf,n=null===(r=null==e?void 0:e.schema)||void 0===r?void 0:r.oneOf,!l(o,n))}render(){var t;const e=this.getLimeTypes().map(g);e.sort(((t,e)=>this.collator.compare(t.text,e.text)));let s=e.find((t=>t.value===this.value)),r=this.invalid;return this.value&&!s&&(r=!0,e.unshift({text:(null===(t=this.limeTypeRepository.getLimeType(this.value))||void 0===t?void 0:t.localname.singular)||this.value,value:this.value}),s=e[0]),e.unshift({text:"",value:""}),i("limel-select",{key:"ee9fdc46424c9e6dc5897260cb16bcbedd43413a",label:this.label,options:e,value:s,required:this.required,helperText:this.helperText,invalid:r,disabled:this.disabled||this.readonly,onChange:this.handleChange})}componentWillRender(){this.updatePropertyFields(this.value||"")}getLimeTypes(){var t,e;let i=this.limetypes;return(null===(e=null===(t=this.formInfo)||void 0===t?void 0:t.schema)||void 0===e?void 0:e.oneOf)&&(i=this.formInfo.schema.oneOf.map((t=>t.const)).filter(m)),i?i.map((t=>this.limeTypeRepository.getLimeType(t))).filter(n):this.limeTypeRepository.getLimeTypes()}updatePropertyFields(t){for(const e of this.propertyFields)e.limetype=t,e.allowedPropertyTypes===u&&(e.allowedPropertyTypes=b)}get limeTypeRepository(){return this.platform.get(r.LimeTypeRepository)}},g=t=>({text:t.localname.singular,value:t.name,icon:o(t)});export{c as limebb_lime_query_filter_builder,p as limebb_lime_query_order_by_editor,y as limebb_limetype_field}
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as i}from"./p-1556b545.js";function s(t,e,i){if(null===i)return void t.push({path:e});const s=i,r="_alias"in s,a="#description"in s,c=Object.keys(s).filter((t=>"_alias"!==t&&"#description"!==t));if(0!==c.length)if(r||a){const i={};for(const t of c)i[t]=s[t];t.push(...o(i,e))}else t.push(...o(i,e));else{const i=s._alias,o=s["#description"];t.push(i||o?{path:e,alias:i,description:o}:{path:e})}}function o(t,e=""){if(!t)return[];const i=[];for(const[o,r]of Object.entries(t))"object"==typeof r&&s(i,e?`${e}.${o}`:o,r);return i}function r(t,e,i){const s=t[e];if(s&&"object"==typeof s&&!("_alias"in s)&&!("#description"in s))return;const o={};i.alias&&""!==i.alias.trim()&&(o._alias=i.alias),i.description&&""!==i.description.trim()&&(o["#description"]=i.description),t[e]=Object.keys(o).length>0?o:null}function a(t,e){const i=t[e];if(!i)return t[e]={},t[e];if("object"==typeof i){const t=i;return Object.keys(t).filter((t=>"_alias"!==t&&"#description"!==t)),t}return t[e]={},t[e]}const c=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.label="Select Properties to Return",this.items=[{path:"_id"}],this.handleItemChange=t=>e=>{e.stopPropagation();const i=[...this.items];null===e.detail?i.splice(t,1):i[t]=e.detail,0===i.length&&i.push({path:"_id"}),this.items=i,this.emitChange()},this.handleAddProperty=()=>{this.items=[...this.items,{path:""}],this.emitChange()}}componentWillLoad(){var t;if(null===(t=this.value)||void 0===t?void 0:t.object){const t=o(this.value.object);t.length>0&&(this.items=t)}}componentWillUpdate(){var t;if(null===(t=this.value)||void 0===t?void 0:t.object){const t=o(this.value.object);(t.length!==this.items.length||!t.every(((t,e)=>{const i=this.items[e];return i&&t.path===i.path&&t.alias===i.alias&&t.description===i.description})))&&(this.items=t.length>0?t:[{path:"_id"}])}}render(){return this.limetype?i("div",{class:"response-format-editor"},i("h4",{class:"header"},this.label),i("div",{class:"summary"},i("span",{class:"count"},"(",this.items.length," ",1===this.items.length?"property":"properties"," ","selected)")),i("div",{class:"property"},i("div",{class:"property-list"},this.items.map(((t,e)=>this.renderItem(t,e)))),i("div",{class:"actions"},i("limel-button",{label:"Add Property",icon:"plus_math",onClick:this.handleAddProperty})))):i("div",{class:"empty-state"},i("p",null,"Select a limetype to choose properties"))}renderItem(t,e){return i("limebb-lime-query-response-format-item",{key:`${t.path}-${e}`,class:"property-item",platform:this.platform,context:this.context,limetype:this.limetype,item:t,onItemChange:this.handleItemChange(e)})}emitChange(){const t=function(t){const e={};for(const i of t){const t=i.path.split(".");let s=e;for(let e=0;e<t.length;e++){const o=t[e];e===t.length-1?r(s,o,i):s=a(s,o)}}return e}(this.items);this.change.emit({object:t})}};c.style=":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;gap:0.5rem;padding:1rem 0}.header{margin:0;font-size:1rem;font-weight:600;color:rgb(var(--contrast-1000))}.property{border:1px solid rgb(var(--contrast-500))}.property-list{display:flex;flex-direction:column;border-radius:0.25rem;background-color:rgb(var(--contrast-100));gap:0.5rem;padding:0.5rem}.property-item{border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex}.actions limel-button{padding:0.5rem;width:100%}.summary{display:flex;justify-content:space-between;align-items:center}.summary .count{font-size:0.875rem;font-weight:500;color:rgb(var(--contrast-900))}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}";const n=class{constructor(i){t(this,i),this.itemChange=e(this,"itemChange",7),this.showAliasInput=!1,this.showDescriptionInput=!1,this.handlePathChange=t=>{t.stopPropagation(),this.itemChange.emit(Object.assign(Object.assign({},this.item),{path:t.detail}))},this.toggleAliasInput=()=>{this.showAliasInput=!this.showAliasInput},this.toggleDescriptionInput=()=>{this.showDescriptionInput=!this.showDescriptionInput},this.handleAliasChange=t=>{t.stopPropagation();const e=t.detail;this.itemChange.emit(Object.assign(Object.assign({},this.item),{alias:e||void 0}))},this.handleDescriptionChange=t=>{t.stopPropagation();const e=t.detail;this.itemChange.emit(Object.assign(Object.assign({},this.item),{description:e||void 0}))},this.handleAliasBlur=()=>{if(this.item.alias){const t=this.item.alias.trim();t!==this.item.alias&&this.itemChange.emit(Object.assign(Object.assign({},this.item),{alias:t||void 0}))}},this.handleDescriptionBlur=()=>{if(this.item.description){const t=this.item.description.trim();t!==this.item.description&&this.itemChange.emit(Object.assign(Object.assign({},this.item),{description:t||void 0}))}},this.handleRemove=()=>{this.itemChange.emit(null)}}componentWillLoad(){this.showAliasInput=!!this.item.alias,this.showDescriptionInput=!!this.item.description}componentWillUpdate(){this.item.alias&&!this.showAliasInput&&(this.showAliasInput=!0),this.item.description&&!this.showDescriptionInput&&(this.showDescriptionInput=!0)}render(){return[i("div",{key:"e804c4feb61b44aeb2f141c5b5d3269a76ac9320",class:"property-controls"},i("div",{key:"becbf35e823b8b16df5366c099b98ce6566d514a",class:"property-path"},i("limebb-property-selector",{key:"2b35ccefecb9dbd4d2c418566482d9903a1c0d02",platform:this.platform,context:this.context,limetype:this.limetype,label:"Property",value:this.item.path,required:!0,onChange:this.handlePathChange})),i("div",{key:"1e598bbbb6df1c5e93bd4ae5f6b112a745a68df9",class:"control-buttons"},i("limel-icon-button",{key:"51d3dfaa9f3578802abf6f65ec876535740ae6a5",icon:this.getAliasIcon(),label:"Add alias",class:this.item.alias?"has-value":"",onClick:this.toggleAliasInput}),i("limel-icon-button",{key:"b2f6050b01d810cc20093e87a09452c625cd7847",icon:this.getDescriptionIcon(),label:"Add description",class:this.item.description?"has-value":"",onClick:this.toggleDescriptionInput}),i("limel-icon-button",{key:"cd58b575c383555db343ebe4a22392c51346751e",icon:"trash",label:"Remove property",onClick:this.handleRemove}))),this.showAliasInput&&i("div",{key:"cd95aa0e34945eb9da88e4be4e4c2326c41ec090",class:"alias"},i("limel-input-field",{key:"f62646327adfb8fcd3f0f2aa3a5325ad8a3bfcc3",label:"Alias",value:this.item.alias||"",placeholder:"Custom property name...",onChange:this.handleAliasChange,onBlur:this.handleAliasBlur})),this.showDescriptionInput&&i("div",{key:"b00f9859a80df3aacf3f524fc1451473e5fcdf5a",class:"description"},i("limel-input-field",{key:"044485f6a35f84816e7458a08882a40aaeacf2f4",label:"Description",value:this.item.description||"",placeholder:"Describe this property for AI...",onChange:this.handleDescriptionChange,onBlur:this.handleDescriptionBlur}))]}getAliasIcon(){return this.showAliasInput?{name:"add_tag",color:"rgb(var(--color-teal-default))"}:{name:"add_tag",color:"rgb(var(--color-gray-600))"}}getDescriptionIcon(){return this.showDescriptionInput?{name:"comments",color:"rgb(var(--color-teal-default))"}:{name:"comments",color:"rgb(var(--color-gray-600))"}}};n.style=":host(limebb-lime-query-response-format-item){display:flex;flex-direction:column;gap:0.5rem}.property-controls{display:flex;flex-wrap:wrap;gap:0.5rem;width:100%}.property-path{flex-grow:1;min-width:min(10rem, 100%)}.control-buttons{flex-shrink:0;display:flex;flex-direction:row;gap:0.25rem;align-items:center}.control-buttons limel-icon-button{opacity:0.6;transition:opacity 0.2s ease}.control-buttons limel-icon-button:hover{opacity:1}.control-buttons limel-icon-button.has-value{opacity:1;color:rgb(var(--color-blue-default))}.alias,.description{padding-left:1rem;width:calc(100% - 8.75rem)}@media (max-width: 768px){.property-controls{flex-direction:column;gap:0.5rem}.alias,.description{padding-left:0;width:100%}}";export{c as limebb_lime_query_response_format_editor,n as limebb_lime_query_response_format_item}