@foxy.io/elements 1.22.0-beta.2 → 1.22.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +11 -11
- package/dist/cdn/foxy-customer.js +2 -2
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +2 -2
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-payments-api.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +1 -1
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +2 -2
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +1 -1
- package/dist/cdn/foxy-store-card.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +3 -3
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-abf20a0e.js → shared-00d2cbe9.js} +1 -1
- package/dist/cdn/{shared-63133859.js → shared-01dd0fd6.js} +1 -1
- package/dist/cdn/shared-095ad002.js +1 -0
- package/dist/cdn/{shared-b4d435fb.js → shared-10f92654.js} +1 -1
- package/dist/cdn/{shared-a14b401b.js → shared-14f0cf8e.js} +1 -1
- package/dist/cdn/{shared-0327faba.js → shared-1bd28b9c.js} +1 -1
- package/dist/cdn/{shared-5dc0d461.js → shared-26390fea.js} +1 -1
- package/dist/cdn/{shared-65253f91.js → shared-2a9718a9.js} +1 -1
- package/dist/cdn/{shared-083622c5.js → shared-2b1c3f7a.js} +1 -1
- package/dist/cdn/{shared-b10c7b82.js → shared-2bae351a.js} +1 -1
- package/dist/cdn/{shared-79ed860e.js → shared-308e67f3.js} +1 -1
- package/dist/cdn/shared-349bbd7e.js +1 -0
- package/dist/cdn/{shared-8955b88b.js → shared-394981eb.js} +1 -1
- package/dist/cdn/{shared-a622c91a.js → shared-3a329baf.js} +1 -1
- package/dist/cdn/{shared-2d2dd2fa.js → shared-3c20c295.js} +1 -1
- package/dist/cdn/{shared-5616c0d2.js → shared-445dda5a.js} +1 -1
- package/dist/cdn/{shared-2e34b6f3.js → shared-468eb208.js} +1 -1
- package/dist/cdn/{shared-a12723f2.js → shared-46c6d1e6.js} +1 -1
- package/dist/cdn/{shared-558a9b8a.js → shared-493b8bc1.js} +1 -1
- package/dist/cdn/shared-509a2f52.js +1 -0
- package/dist/cdn/{shared-e8eaf692.js → shared-50c6daa1.js} +1 -1
- package/dist/cdn/{shared-77530b46.js → shared-53af541e.js} +1 -1
- package/dist/cdn/{shared-f9b50bcb.js → shared-5897f089.js} +1 -1
- package/dist/cdn/{shared-9cc0b441.js → shared-5a09ad7e.js} +1 -1
- package/dist/cdn/{shared-e21b7917.js → shared-5a445ebd.js} +1 -1
- package/dist/cdn/{shared-18569685.js → shared-5c5d13bd.js} +1 -1
- package/dist/cdn/shared-5cf7e764.js +64 -0
- package/dist/cdn/{shared-3f814c12.js → shared-5ec39f11.js} +1 -1
- package/dist/cdn/{shared-8b4c0403.js → shared-643791c8.js} +1 -1
- package/dist/cdn/shared-64657919.js +1 -0
- package/dist/cdn/{shared-118ec530.js → shared-67790b63.js} +1 -1
- package/dist/cdn/{shared-d411ad01.js → shared-685ca959.js} +1 -1
- package/dist/cdn/{shared-3d9c4ca7.js → shared-6860c8d1.js} +1 -1
- package/dist/cdn/{shared-573c1e43.js → shared-698c9002.js} +1 -1
- package/dist/cdn/{shared-9fcc093e.js → shared-7163796c.js} +1 -1
- package/dist/cdn/shared-7f47c677.js +1 -0
- package/dist/cdn/{shared-ee3fd376.js → shared-83a12835.js} +3 -3
- package/dist/cdn/{shared-60fae9ab.js → shared-87405fc7.js} +1 -1
- package/dist/cdn/{shared-89af5026.js → shared-8db9452f.js} +1 -1
- package/dist/cdn/shared-98755831.js +15 -0
- package/dist/cdn/{shared-d1aefbeb.js → shared-9e18688d.js} +1 -1
- package/dist/cdn/shared-9eeb2bec.js +1 -0
- package/dist/cdn/{shared-1e27ecef.js → shared-a19ce620.js} +1 -1
- package/dist/cdn/{shared-fbd5a173.js → shared-a306168b.js} +1 -1
- package/dist/cdn/{shared-93252c06.js → shared-a6deb2a4.js} +1 -1
- package/dist/cdn/{shared-e3ab56d1.js → shared-a89cb472.js} +1 -1
- package/dist/cdn/{shared-4f037e43.js → shared-a8cf402a.js} +1 -1
- package/dist/cdn/{shared-b3bc4a12.js → shared-aa5785d9.js} +1 -1
- package/dist/cdn/{shared-2be4c804.js → shared-aa678ec4.js} +1 -1
- package/dist/cdn/{shared-59270327.js → shared-b2d6bbad.js} +1 -1
- package/dist/cdn/{shared-75e78c70.js → shared-b5517c1b.js} +1 -1
- package/dist/cdn/{shared-a9a49319.js → shared-b590adb2.js} +1 -1
- package/dist/cdn/{shared-758859b5.js → shared-bd819b5b.js} +1 -1
- package/dist/cdn/shared-bfdbd733.js +1 -0
- package/dist/cdn/{shared-522fcb23.js → shared-c5fe5675.js} +1 -1
- package/dist/cdn/shared-c7f56c90.js +1 -0
- package/dist/cdn/shared-ca5e1c6b.js +1 -0
- package/dist/cdn/{shared-7351db30.js → shared-ccfb87fb.js} +1 -1
- package/dist/cdn/{shared-d39285f6.js → shared-cf49ce0c.js} +1 -1
- package/dist/cdn/{shared-01e0a79c.js → shared-d7b778b7.js} +1 -1
- package/dist/cdn/shared-daf52401.js +1 -0
- package/dist/cdn/shared-de790de9.js +1 -0
- package/dist/cdn/{shared-203b10f4.js → shared-dfe7652e.js} +1 -1
- package/dist/cdn/shared-e41e53c0.js +1 -0
- package/dist/cdn/{shared-f885ce63.js → shared-e6d3d6f5.js} +1 -1
- package/dist/cdn/shared-eb900735.js +1 -0
- package/dist/cdn/{shared-c108e672.js → shared-f42077ab.js} +1 -1
- package/dist/cdn/{shared-0b1ffad9.js → shared-f628a723.js} +1 -1
- package/dist/cdn/{shared-18aec36f.js → shared-f8bcab5c.js} +1 -1
- package/dist/cdn/{shared-afc4b9ad.js → shared-fad30ff5.js} +1 -1
- package/dist/cdn/shared-ffb6c2d3.js +1 -0
- package/dist/cdn/translations/coupon-code-form/en.json +1 -0
- package/dist/cdn/translations/coupon-form/en.json +45 -0
- package/dist/cdn/translations/generate-codes-form/en.json +1 -0
- package/dist/cdn/translations/gift-card-code-form/en.json +1 -0
- package/dist/cdn/translations/transaction/en.json +2 -0
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js +17 -6
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js.map +1 -1
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js +1 -0
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js.map +1 -1
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.js +9 -5
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.js.map +1 -1
- package/dist/elements/public/CouponForm/CouponForm.d.ts +3 -0
- package/dist/elements/public/CouponForm/CouponForm.js +70 -0
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/CouponForm/index.d.ts +1 -0
- package/dist/elements/public/CouponForm/index.js +1 -0
- package/dist/elements/public/CouponForm/index.js.map +1 -1
- package/dist/elements/public/CouponForm/types.d.ts +5 -1
- package/dist/elements/public/CouponForm/types.js.map +1 -1
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js +1 -0
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +1 -0
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.js +9 -5
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.js.map +1 -1
- package/dist/elements/public/ItemCard/ItemCard.js +1 -1
- package/dist/elements/public/ItemCard/ItemCard.js.map +1 -1
- package/dist/elements/public/QueryBuilder/QueryBuilder.d.ts +1 -1
- package/dist/elements/public/QueryBuilder/QueryBuilder.js +4 -1
- package/dist/elements/public/QueryBuilder/QueryBuilder.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/BooleanValue.d.ts +2 -0
- package/dist/elements/public/QueryBuilder/components/BooleanValue.js +3 -1
- package/dist/elements/public/QueryBuilder/components/BooleanValue.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/Group.d.ts +2 -0
- package/dist/elements/public/QueryBuilder/components/Group.js +6 -0
- package/dist/elements/public/QueryBuilder/components/Group.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/Input.d.ts +2 -1
- package/dist/elements/public/QueryBuilder/components/Input.js +15 -4
- package/dist/elements/public/QueryBuilder/components/Input.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/IsDefinedValue.d.ts +2 -0
- package/dist/elements/public/QueryBuilder/components/IsDefinedValue.js +2 -0
- package/dist/elements/public/QueryBuilder/components/IsDefinedValue.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/ListValue.d.ts +2 -0
- package/dist/elements/public/QueryBuilder/components/ListValue.js +6 -1
- package/dist/elements/public/QueryBuilder/components/ListValue.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/Name.d.ts +2 -0
- package/dist/elements/public/QueryBuilder/components/Name.js +2 -0
- package/dist/elements/public/QueryBuilder/components/Name.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/OperatorToggle.d.ts +2 -0
- package/dist/elements/public/QueryBuilder/components/OperatorToggle.js +2 -2
- package/dist/elements/public/QueryBuilder/components/OperatorToggle.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/Path.d.ts +3 -1
- package/dist/elements/public/QueryBuilder/components/Path.js +3 -1
- package/dist/elements/public/QueryBuilder/components/Path.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/RangeValue.d.ts +2 -0
- package/dist/elements/public/QueryBuilder/components/RangeValue.js +5 -1
- package/dist/elements/public/QueryBuilder/components/RangeValue.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/Rule.d.ts +2 -0
- package/dist/elements/public/QueryBuilder/components/Rule.js +31 -11
- package/dist/elements/public/QueryBuilder/components/Rule.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/Select.d.ts +2 -0
- package/dist/elements/public/QueryBuilder/components/Select.js +27 -7
- package/dist/elements/public/QueryBuilder/components/Select.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/SingleValue.d.ts +2 -0
- package/dist/elements/public/QueryBuilder/components/SingleValue.js +3 -2
- package/dist/elements/public/QueryBuilder/components/SingleValue.js.map +1 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js +25 -8
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js.map +1 -1
- package/dist/elements/public/Transaction/types.d.ts +5 -1
- package/dist/elements/public/Transaction/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-11438c42.js +0 -1
- package/dist/cdn/shared-38b37888.js +0 -1
- package/dist/cdn/shared-40ceb4b6.js +0 -1
- package/dist/cdn/shared-531bb690.js +0 -1
- package/dist/cdn/shared-594848f3.js +0 -1
- package/dist/cdn/shared-6192121c.js +0 -1
- package/dist/cdn/shared-67546e10.js +0 -1
- package/dist/cdn/shared-740ad9e6.js +0 -64
- package/dist/cdn/shared-90e96bea.js +0 -1
- package/dist/cdn/shared-955db6b4.js +0 -1
- package/dist/cdn/shared-a5364194.js +0 -1
- package/dist/cdn/shared-a8ced8bf.js +0 -1
- package/dist/cdn/shared-dc91f7ae.js +0 -1
- package/dist/cdn/shared-dcdb6ea1.js +0 -15
- package/dist/cdn/shared-eb29e8ef.js +0 -1
- package/dist/cdn/shared-efa137cd.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/Input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,uCAAoC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,4CAAyC;
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/Input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,uCAAoC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,4CAAyC;AAepE,MAAM,UAAU,KAAK,CAAC,MAAmB;;IACvC,MAAM,EAAE,SAAG,MAAM,CAAC,EAAE,mCAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,GAAG,EAAE,OAAO,CAAC;IAC5B,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;IAE9C,IAAI,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC;IAEnC,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE;QAC1B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpC,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CA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utils/class-map';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { serializeDateUTC } from '../../../../utils/serialize-date';\n\nexport type InputParams = {\n t: I18n['t'];\n id?: string;\n list?: { label: string; value: string }[];\n type: string;\n label: string;\n value: string;\n disabled: boolean;\n readonly: boolean;\n displayValue?: string;\n onChange: (newValue: string) => void;\n};\n\nexport function Input(params: InputParams): TemplateResult {\n const id = params.id ?? String(Math.floor(Math.random() * Math.pow(10, 8)));\n const listId = `${id}-list`;\n const hasDisplayValue = !!params.displayValue;\n\n let normalizedValue = params.value;\n\n if (params.type === 'date') {\n const date = new Date(params.value);\n normalizedValue = isNaN(date.getTime()) ? '' : serializeDateUTC(date);\n }\n\n return html`\n <label class=\"relative flex items-center cursor-text group text-tertiary\">\n <div class=\"relative flex-1 min-w-0 overflow-hidden\">\n ${hasDisplayValue\n ? html`\n <div\n aria-hidden=\"true\"\n class=${classMap({\n 'absolute inset-0 h-m px-s font-medium flex items-center': true,\n 'text-body': !params.disabled && !params.readonly,\n 'text-disabled': params.disabled,\n 'text-secondary': params.readonly,\n })}\n >\n <div class=\"truncate\">${params.t(params.displayValue!)}</div>\n </div>\n `\n : ''}\n\n <input\n placeholder=${normalizedValue || params.type === 'date' ? '' : params.t(params.label)}\n class=${classMap({\n 'bg-base relative flex h-m px-s font-medium w-full': true,\n 'text-body': !params.disabled && !params.readonly,\n 'text-disabled': params.disabled,\n 'text-secondary': params.readonly,\n 'flex max-w-full whitespace-nowrap': true, // ugh safari\n 'focus-outline-none': true,\n 'opacity-0 focus-opacity-100': hasDisplayValue,\n })}\n list=${ifDefined(params.list ? listId : undefined)}\n type=${params.type}\n max=${ifDefined(params.type === 'date' ? '9999-12-31' : '')}\n .value=${normalizedValue}\n ?disabled=${params.disabled || params.readonly}\n @input=${(evt: Event) => {\n const input = evt.currentTarget as HTMLInputElement;\n\n try {\n const valueAsDate = input.valueAsDate as Date;\n if (valueAsDate.getFullYear() > 9999) valueAsDate.setFullYear(9999);\n params.onChange(valueAsDate.toISOString());\n } catch {\n params.onChange(input.value);\n }\n }}\n />\n </div>\n\n <span\n class=${classMap({\n 'font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s': true,\n 'inline-block': !!normalizedValue || params.type === 'date',\n 'sr-only': !normalizedValue && params.type !== 'date',\n 'text-body': !params.disabled && !params.readonly,\n 'text-disabled': params.disabled,\n 'text-secondary': params.readonly,\n })}\n >\n ${params.t(params.label)}\n </span>\n\n ${params.list\n ? html`\n <datalist id=${listId}>\n ${params.list.map(\n ({ label, value }) => html`<option value=${value}>${params.t(label)}</option>`\n )}\n </datalist>\n `\n : ''}\n ${params.disabled || params.readonly\n ? ''\n : html`\n <div\n class=\"absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none\"\n ></div>\n `}\n </label>\n `;\n}\n"]}
|
|
@@ -3,6 +3,8 @@ import { ParsedValue } from '../types';
|
|
|
3
3
|
import { TemplateResult } from 'lit-html';
|
|
4
4
|
export declare type IsDefinedValueParams = {
|
|
5
5
|
parsedValue: ParsedValue;
|
|
6
|
+
readonly: boolean;
|
|
7
|
+
disabled: boolean;
|
|
6
8
|
t: I18n['t'];
|
|
7
9
|
onChange: (newValue: ParsedValue) => void;
|
|
8
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsDefinedValue.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/IsDefinedValue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,oBAAiB;
|
|
1
|
+
{"version":3,"file":"IsDefinedValue.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/IsDefinedValue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,oBAAiB;AAWlC,MAAM,UAAU,cAAc,CAAC,MAA4B;IACzD,OAAO,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK;QAC/B,KAAK,EAAE,OAAO;QACd,IAAI,EAAE;YACJ,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE;YAC3C,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE;SAC9C;QACD,CAAC,EAAE,MAAM,CAAC,CAAC;QACX,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;KAClF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { I18n } from '../../I18n/I18n';\nimport { ParsedValue } from '../types';\nimport { Select } from './Select';\nimport { TemplateResult } from 'lit-html';\n\nexport type IsDefinedValueParams = {\n parsedValue: ParsedValue;\n readonly: boolean;\n disabled: boolean;\n t: I18n['t'];\n onChange: (newValue: ParsedValue) => void;\n};\n\nexport function IsDefinedValue(params: IsDefinedValueParams): TemplateResult {\n return Select({\n readonly: params.readonly,\n disabled: params.disabled,\n value: params.parsedValue.value,\n label: 'value',\n list: [\n { label: 'is_defined_true', value: 'true' },\n { label: 'is_defined_false', value: 'false' },\n ],\n t: params.t,\n onChange: newValue => params.onChange({ ...params.parsedValue, value: newValue }),\n });\n}\n"]}
|
|
@@ -3,6 +3,8 @@ import { TemplateResult } from 'lit-html';
|
|
|
3
3
|
import { I18n } from '../../I18n/I18n';
|
|
4
4
|
export declare type ListValueParams = {
|
|
5
5
|
parsedValue: ParsedValue;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
readonly: boolean;
|
|
6
8
|
option: Option | null;
|
|
7
9
|
t: I18n['t'];
|
|
8
10
|
onChange: (newValue: ParsedValue) => void;
|
|
@@ -10,9 +10,12 @@ export function ListValue(params) {
|
|
|
10
10
|
const optionType = (_c = (_b = params.option) === null || _b === void 0 ? void 0 : _b.type) !== null && _c !== void 0 ? _c : Type.Any;
|
|
11
11
|
const type = optionType === Type.Number ? 'number' : optionType === Type.Date ? 'date' : 'text';
|
|
12
12
|
const list = (_d = params.option) === null || _d === void 0 ? void 0 : _d.list;
|
|
13
|
+
const displayedValues = [...splitValue.filter(value => !!value)];
|
|
14
|
+
if (!params.readonly)
|
|
15
|
+
displayedValues.push(null);
|
|
13
16
|
return html `
|
|
14
17
|
<div class="bg-contrast-10 grid grid-cols-1 gap-1px">
|
|
15
|
-
${repeat(
|
|
18
|
+
${repeat(displayedValues, (value, index) => index, (value, index) => {
|
|
16
19
|
var _a;
|
|
17
20
|
return html `
|
|
18
21
|
<div class="bg-base">
|
|
@@ -22,6 +25,8 @@ export function ListValue(params) {
|
|
|
22
25
|
t: params.t,
|
|
23
26
|
value: value !== null && value !== void 0 ? value : '',
|
|
24
27
|
label: value ? String(index + 1) : 'add_value',
|
|
28
|
+
disabled: params.disabled,
|
|
29
|
+
readonly: params.readonly,
|
|
25
30
|
clearable: true,
|
|
26
31
|
displayValue: (_a = list === null || list === void 0 ? void 0 : list.find(item => item.value === value)) === null || _a === void 0 ? void 0 : _a.label,
|
|
27
32
|
onChange: newValue => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListValue.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/ListValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAE,oBAAiB;AACrD,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,KAAK,EAAE,mBAAgB;AAChC,OAAO,EAAE,MAAM,EAAE,oBAAiB;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"ListValue.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/ListValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAE,oBAAiB;AACrD,OAAO,EAAkB,IAAI,EAAE,MAA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,cAAL,KAAK,GAAI,EAAE;YAClB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW;YAC9C,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,SAAS,EAAE,IAAI;YACf,YAAY,QAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,KAAK,KAAK,2CAAG,KAAK;YAC7D,QAAQ,EAAE,QAAQ,CAAC,EAAE;gBACnB,IAAI,QAAQ,EAAE;oBACZ,UAAU,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;iBAC9B;qBAAM;oBACL,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;iBAC7B;gBAED,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC1E,CAAC;SACF,CAAC;;SAEL,CAAA;KAAA,CACF;;GAEJ,CAAC;AACJ,CAAC","sourcesContent":["import { Option, ParsedValue, Type } from '../types';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { I18n } from '../../I18n/I18n';\nimport { Input } from './Input';\nimport { Select } from './Select';\nimport { repeat } from 'lit-html/directives/repeat';\n\nexport type ListValueParams = {\n parsedValue: ParsedValue;\n disabled: boolean;\n readonly: boolean;\n option: Option | null;\n t: I18n['t'];\n onChange: (newValue: ParsedValue) => void;\n};\n\nexport function ListValue(params: ListValueParams): TemplateResult {\n const Field = params.option?.list ? Select : Input;\n const splitValue = params.parsedValue.value.split(',');\n const optionType = params.option?.type ?? Type.Any;\n const type = optionType === Type.Number ? 'number' : optionType === Type.Date ? 'date' : 'text';\n const list = params.option?.list;\n const displayedValues: (string | null)[] = [...splitValue.filter(value => !!value)];\n\n if (!params.readonly) displayedValues.push(null);\n\n return html`\n <div class=\"bg-contrast-10 grid grid-cols-1 gap-1px\">\n ${repeat(\n displayedValues,\n (value, index) => index,\n (value, index) => html`\n <div class=\"bg-base\">\n ${Field({\n type: type,\n list: list,\n t: params.t,\n value: value ?? '',\n label: value ? String(index + 1) : 'add_value',\n disabled: params.disabled,\n readonly: params.readonly,\n clearable: true,\n displayValue: list?.find(item => item.value === value)?.label,\n onChange: newValue => {\n if (newValue) {\n splitValue[index] = newValue;\n } else {\n splitValue.splice(index, 1);\n }\n\n params.onChange({ ...params.parsedValue, value: splitValue.join(',') });\n },\n })}\n </div>\n `\n )}\n </div>\n `;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Name.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/Name.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,mBAAgB;
|
|
1
|
+
{"version":3,"file":"Name.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/Name.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,mBAAgB;AAYhC,MAAM,UAAU,IAAI,CAAC,MAAkB;;IACrC,OAAO,KAAK,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,KAAK,QAAE,MAAM,CAAC,WAAW,CAAC,IAAI,mCAAI,EAAE;QACpC,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,MAAM;QACZ,CAAC,EAAE,MAAM,CAAC,CAAC;QACX,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;KAC/E,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { I18n } from '../../I18n/I18n';\nimport { Input } from './Input';\nimport { ParsedValue } from '../types';\nimport { TemplateResult } from 'lit-html';\n\nexport type NameParams = {\n parsedValue: ParsedValue;\n readonly: boolean;\n disabled: boolean;\n t: I18n['t'];\n onChange: (newValue: ParsedValue) => void;\n};\n\nexport function Name(params: NameParams): TemplateResult {\n return Input({\n disabled: params.disabled,\n readonly: params.readonly,\n value: params.parsedValue.name ?? '',\n label: 'name',\n type: 'text',\n t: params.t,\n onChange: newName => params.onChange({ ...params.parsedValue, name: newName }),\n });\n}\n"]}
|
|
@@ -3,6 +3,8 @@ import { TemplateResult } from 'lit-html';
|
|
|
3
3
|
import { I18n } from '../../I18n/I18n';
|
|
4
4
|
export declare type OperatorToggleParams = {
|
|
5
5
|
parsedValue: ParsedValue;
|
|
6
|
+
readonly: boolean;
|
|
7
|
+
disabled: boolean;
|
|
6
8
|
option: Option | null;
|
|
7
9
|
t: I18n['t'];
|
|
8
10
|
onChange: (newValue: ParsedValue) => void;
|
|
@@ -33,14 +33,14 @@ export function OperatorToggle(params) {
|
|
|
33
33
|
: params.parsedValue.name
|
|
34
34
|
? Object.values(Operator)
|
|
35
35
|
: Object.values(Operator).filter(v => v !== Operator.IsDefined);
|
|
36
|
-
const isDisabled = operatorsForType.length === 0 || !params.parsedValue.path;
|
|
36
|
+
const isDisabled = params.disabled || params.readonly || operatorsForType.length === 0 || !params.parsedValue.path;
|
|
37
37
|
return html `
|
|
38
38
|
<button
|
|
39
39
|
title=${params.t(`operator_${operator !== null && operator !== void 0 ? operator : 'equal'}`)}
|
|
40
40
|
class=${classMap({
|
|
41
41
|
'flex items-center justify-center w-m h-m transition-colors': true,
|
|
42
42
|
'focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50': true,
|
|
43
|
-
'text-
|
|
43
|
+
'text-disabled cursor-default': isDisabled,
|
|
44
44
|
'hover-bg-contrast-5': !isDisabled,
|
|
45
45
|
})}
|
|
46
46
|
?disabled=${isDisabled}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperatorToggle.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/OperatorToggle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,0BAAuB;AAExC,OAAO,EAAE,QAAQ,EAAuB,IAAI,EAAE,oBAAiB;AAC/D,OAAO,EAAqC,IAAI,EAAE,MAAM,UAAU,CAAC;AAGnE,OAAO,EAAE,QAAQ,EAAE,uCAAoC;
|
|
1
|
+
{"version":3,"file":"OperatorToggle.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/OperatorToggle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,0BAAuB;AAExC,OAAO,EAAE,QAAQ,EAAuB,IAAI,EAAE,oBAAiB;AAC/D,OAAO,EAAqC,IAAI,EAAE,MAAM,UAAU,CAAC;AAGnE,OAAO,EAAE,QAAQ,EAAE,uCAAoC;AAWvD,MAAM,UAAU,cAAc,CAAC,MAA4B;IACzD,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC;IAE7C,MAAM,cAAc,GAAsC;QACxD,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,mBAAmB;QACjD,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC,0BAA0B;QAC/D,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,UAAU;QAC/B,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB;QAC7C,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,gBAAgB;QAC3C,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC,uBAAuB;QACzD,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,WAAW;KAClC,CAAC;IAEF,MAAM,eAAe,GAAG;QACtB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,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ACf,4DAA4D,EAAE,IAAI;QAClE,wEAAwE,EAAE,IAAI;QAC9E,8BAA8B,EAAE,UAAU;QAC1C,qBAAqB,EAAE,CAAC,UAAU;KACnC,CAAC;kBACU,UAAU;eACb,GAAG,EAAE;;QACZ,MAAM,gBAAgB,GAAG,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5E,MAAM,WAAW,SAAG,gBAAgB,CAAC,gBAAgB,GAAG,CAAC,CAAC,mCAAI,IAAI,CAAC;QAEnE,MAAM,CAAC,QAAQ,CAAC;YACd,GAAG,MAAM,CAAC,WAAW;YACrB,QAAQ,EAAE,WAAW;YACrB,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK;SAChC,CAAC,CAAC;IACL,CAAC;;gCAEyB,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa;;GAEtF,CAAC;AACJ,CAAC","sourcesContent":["import * as icons from '../icons/index';\n\nimport { Operator, Option, ParsedValue, Type } from '../types';\nimport { SVGTemplateResult, TemplateResult, html } from 'lit-html';\n\nimport { I18n } from '../../I18n/I18n';\nimport { classMap } from '../../../../utils/class-map';\n\nexport type OperatorToggleParams = {\n parsedValue: ParsedValue;\n readonly: boolean;\n disabled: boolean;\n option: Option | null;\n t: I18n['t'];\n onChange: (newValue: ParsedValue) => void;\n};\n\nexport function OperatorToggle(params: OperatorToggleParams): TemplateResult {\n const operator = params.parsedValue.operator;\n\n const operatorToIcon: Record<string, SVGTemplateResult> = {\n [Operator.GreaterThan]: icons.operatorGreaterThan,\n [Operator.GreaterThanOrEqual]: icons.operatorGreaterThanOrEqual,\n [Operator.In]: icons.operatorIn,\n [Operator.IsDefined]: icons.operatorIsDefined,\n [Operator.LessThan]: icons.operatorLessThan,\n [Operator.LessThanOrEqual]: icons.operatorLessThanOrEqual,\n [Operator.Not]: icons.operatorNot,\n };\n\n const operatorsByType = {\n [Type.Attribute]: [Operator.In, Operator.Not, Operator.IsDefined],\n [Type.Boolean]: [],\n [Type.String]: [Operator.In, Operator.Not],\n [Type.Number]: [\n Operator.In,\n Operator.Not,\n Operator.GreaterThan,\n Operator.LessThan,\n Operator.GreaterThanOrEqual,\n Operator.LessThanOrEqual,\n ],\n [Type.Date]: [Operator.In, Operator.Not],\n [Type.Any]: Object.values(Operator),\n };\n\n const operatorsForType = params.option\n ? operatorsByType[params.option.type]\n : params.parsedValue.name\n ? Object.values(Operator)\n : Object.values(Operator).filter(v => v !== Operator.IsDefined);\n\n const isDisabled =\n params.disabled || params.readonly || operatorsForType.length === 0 || !params.parsedValue.path;\n\n return html`\n <button\n title=${params.t(`operator_${operator ?? 'equal'}`)}\n class=${classMap({\n 'flex items-center justify-center w-m h-m transition-colors': true,\n 'focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50': true,\n 'text-disabled cursor-default': isDisabled,\n 'hover-bg-contrast-5': !isDisabled,\n })}\n ?disabled=${isDisabled}\n @click=${() => {\n const newOperatorIndex = operator ? operatorsForType.indexOf(operator) : -1;\n const newOperator = operatorsForType[newOperatorIndex + 1] ?? null;\n\n params.onChange({\n ...params.parsedValue,\n operator: newOperator,\n value: params.parsedValue.value,\n });\n }}\n >\n <div aria-hidden=\"true\">${operator ? operatorToIcon[operator] : icons.operatorEqual}</div>\n </button>\n `;\n}\n"]}
|
|
@@ -3,9 +3,11 @@ import { I18n } from '../../I18n/I18n';
|
|
|
3
3
|
import { TemplateResult } from 'lit-html';
|
|
4
4
|
export declare type PathParams = {
|
|
5
5
|
parsedValue: ParsedValue;
|
|
6
|
+
readonly: boolean;
|
|
7
|
+
disabled: boolean;
|
|
6
8
|
options: Option[];
|
|
7
9
|
option: Option | null;
|
|
8
10
|
t: I18n['t'];
|
|
9
11
|
onChange: (newValue: ParsedValue) => void;
|
|
10
12
|
};
|
|
11
|
-
export declare function Path({ parsedValue,
|
|
13
|
+
export declare function Path({ parsedValue, disabled, readonly, options, option, t, onChange, }: PathParams): TemplateResult;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Input } from "./Input.js";
|
|
2
|
-
export function Path({ parsedValue,
|
|
2
|
+
export function Path({ parsedValue, disabled, readonly, options, option, t, onChange, }) {
|
|
3
3
|
return Input({
|
|
4
4
|
displayValue: option === null || option === void 0 ? void 0 : option.label,
|
|
5
|
+
disabled,
|
|
6
|
+
readonly,
|
|
5
7
|
value: parsedValue.path,
|
|
6
8
|
label: 'field',
|
|
7
9
|
list: options.map(option => ({ ...option, value: option.path })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Path.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/Path.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,mBAAgB;
|
|
1
|
+
{"version":3,"file":"Path.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/Path.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,mBAAgB;AAahC,MAAM,UAAU,IAAI,CAAC,EACnB,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,MAAM,EACN,CAAC,EACD,QAAQ,GACG;IACX,OAAO,KAAK,CAAC;QACX,YAAY,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK;QAC3B,QAAQ;QACR,QAAQ;QACR,KAAK,EAAE,WAAW,CAAC,IAAI;QACvB,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAChE,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,MAAM;QACV,CAAC,EAAE,CAAC;QACJ,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;KAC5E,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Option, ParsedValue } from '../types';\n\nimport { I18n } from '../../I18n/I18n';\nimport { Input } from './Input';\nimport { TemplateResult } from 'lit-html';\n\nexport type PathParams = {\n parsedValue: ParsedValue;\n readonly: boolean;\n disabled: boolean;\n options: Option[];\n option: Option | null;\n t: I18n['t'];\n onChange: (newValue: ParsedValue) => void;\n};\n\nexport function Path({\n parsedValue,\n disabled,\n readonly,\n options,\n option,\n t,\n onChange,\n}: PathParams): TemplateResult {\n return Input({\n displayValue: option?.label,\n disabled,\n readonly,\n value: parsedValue.path,\n label: 'field',\n list: options.map(option => ({ ...option, value: option.path })),\n type: 'text',\n id: 'path',\n t: t,\n onChange: newPath => onChange({ operator: null, value: '', path: newPath }),\n });\n}\n"]}
|
|
@@ -3,6 +3,8 @@ import { TemplateResult } from 'lit-html';
|
|
|
3
3
|
import { I18n } from '../../I18n/I18n';
|
|
4
4
|
export declare type RangeValueParams = {
|
|
5
5
|
parsedValue: ParsedValue;
|
|
6
|
+
readonly: boolean;
|
|
7
|
+
disabled: boolean;
|
|
6
8
|
option: Option | null;
|
|
7
9
|
t: I18n['t'];
|
|
8
10
|
onChange: (newValue: ParsedValue) => void;
|
|
@@ -4,7 +4,7 @@ import { Input } from "./Input.js";
|
|
|
4
4
|
import { Select } from "./Select.js";
|
|
5
5
|
export function RangeValue(params) {
|
|
6
6
|
var _a, _b, _c;
|
|
7
|
-
const { t, parsedValue, option, onChange } = params;
|
|
7
|
+
const { t, parsedValue, option, readonly, disabled, onChange } = params;
|
|
8
8
|
const splitValue = parsedValue.value.split('..');
|
|
9
9
|
const from = splitValue.length >= 1 ? splitValue[0] : '';
|
|
10
10
|
const to = splitValue.length >= 2 ? splitValue[1] : '';
|
|
@@ -17,6 +17,8 @@ export function RangeValue(params) {
|
|
|
17
17
|
<div class="bg-base">
|
|
18
18
|
${Field({
|
|
19
19
|
displayValue: (_b = list === null || list === void 0 ? void 0 : list.find(v => v.value === from)) === null || _b === void 0 ? void 0 : _b.label,
|
|
20
|
+
readonly,
|
|
21
|
+
disabled,
|
|
20
22
|
value: from,
|
|
21
23
|
label: 'range_from',
|
|
22
24
|
type: type,
|
|
@@ -29,6 +31,8 @@ export function RangeValue(params) {
|
|
|
29
31
|
<div class="bg-base">
|
|
30
32
|
${Field({
|
|
31
33
|
displayValue: (_c = list === null || list === void 0 ? void 0 : list.find(v => v.value === to)) === null || _c === void 0 ? void 0 : _c.label,
|
|
34
|
+
readonly,
|
|
35
|
+
disabled,
|
|
32
36
|
label: 'range_to',
|
|
33
37
|
value: to,
|
|
34
38
|
type: type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeValue.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/RangeValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAE,oBAAiB;AACrD,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,KAAK,EAAE,mBAAgB;AAChC,OAAO,EAAE,MAAM,EAAE,oBAAiB;
|
|
1
|
+
{"version":3,"file":"RangeValue.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/RangeValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAE,oBAAiB;AACrD,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,KAAK,EAAE,mBAAgB;AAChC,OAAO,EAAE,MAAM,EAAE,oBAAiB;AAWlC,MAAM,UAAU,UAAU,CAAC,MAAwB;;IACjD,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IACxE,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,KAA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AC;;;;UAIA,KAAK,CAAC;QACN,YAAY,QAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,2CAAG,KAAK;QACpD,QAAQ;QACR,QAAQ;QACR,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,IAAI;QACV,CAAC,EAAE,CAAC;QACJ,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,WAAW,EAAE,KAAK,EAAE,GAAG,IAAI,KAAK,QAAQ,EAAE,EAAE,CAAC;KAClF,CAAC;;;GAGP,CAAC;AACJ,CAAC","sourcesContent":["import { Option, ParsedValue, Type } from '../types';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { I18n } from '../../I18n/I18n';\nimport { Input } from './Input';\nimport { Select } from './Select';\n\nexport type RangeValueParams = {\n parsedValue: ParsedValue;\n readonly: boolean;\n disabled: boolean;\n option: Option | null;\n t: I18n['t'];\n onChange: (newValue: ParsedValue) => void;\n};\n\nexport function RangeValue(params: RangeValueParams): TemplateResult {\n const { t, parsedValue, option, readonly, disabled, onChange } = params;\n const splitValue = parsedValue.value.split('..');\n const from = splitValue.length >= 1 ? splitValue[0] : '';\n const to = splitValue.length >= 2 ? splitValue[1] : '';\n\n const Field = option?.list ? Select : Input;\n const optionType = option?.type ?? Type.Any;\n const type = optionType === Type.Number ? 'number' : optionType === Type.Date ? 'date' : 'text';\n const list = option?.list;\n\n return html`\n <div class=\"grid bg-contrast-10 gap-1px grid-cols-1 grid-rows-2 sm-grid-cols-2 sm-grid-rows-1\">\n <div class=\"bg-base\">\n ${Field({\n displayValue: list?.find(v => v.value === from)?.label,\n readonly,\n disabled,\n value: from,\n label: 'range_from',\n type: type,\n list: list,\n t: t,\n onChange: newValue => onChange({ ...parsedValue, value: `${newValue}..${to}` }),\n })}\n </div>\n\n <div class=\"bg-base\">\n ${Field({\n displayValue: list?.find(v => v.value === to)?.label,\n readonly,\n disabled,\n label: 'range_to',\n value: to,\n type: type,\n list: list,\n t: t,\n onChange: newValue => onChange({ ...parsedValue, value: `${from}..${newValue}` }),\n })}\n </div>\n </div>\n `;\n}\n"]}
|
|
@@ -12,11 +12,19 @@ import { SingleValue } from "./SingleValue.js";
|
|
|
12
12
|
import { classMap } from "../../../../utils/class-map.js";
|
|
13
13
|
export function Rule(params) {
|
|
14
14
|
var _a, _b;
|
|
15
|
-
const { parsedValue,
|
|
15
|
+
const { parsedValue, isFullSize, isNested, readonly, disabled, options, t, onConvert, onDelete, onChange, } = params;
|
|
16
16
|
const option = (_a = options.find(o => o.path === parsedValue.path)) !== null && _a !== void 0 ? _a : null;
|
|
17
17
|
const type = (_b = option === null || option === void 0 ? void 0 : option.type) !== null && _b !== void 0 ? _b : Type.Any;
|
|
18
18
|
const operator = parsedValue.operator;
|
|
19
|
-
const componentParams = {
|
|
19
|
+
const componentParams = {
|
|
20
|
+
parsedValue: parsedValue,
|
|
21
|
+
disabled,
|
|
22
|
+
readonly,
|
|
23
|
+
options,
|
|
24
|
+
option,
|
|
25
|
+
t,
|
|
26
|
+
onChange,
|
|
27
|
+
};
|
|
20
28
|
const typeToIcon = {
|
|
21
29
|
[Type.Attribute]: icons.typeAttribute,
|
|
22
30
|
[Type.Boolean]: icons.typeBoolean,
|
|
@@ -30,14 +38,23 @@ export function Rule(params) {
|
|
|
30
38
|
<div
|
|
31
39
|
class=${classMap({
|
|
32
40
|
'flex-1 bg-base rounded overflow-hidden border': true,
|
|
33
|
-
'border-contrast-10': !isNested,
|
|
34
|
-
'border-contrast-50': !!isNested,
|
|
41
|
+
'border-contrast-10': !isNested && !readonly,
|
|
42
|
+
'border-contrast-50': !!isNested || readonly,
|
|
43
|
+
'border-dashed': readonly,
|
|
44
|
+
'border-solid': !readonly,
|
|
35
45
|
})}
|
|
36
46
|
>
|
|
37
47
|
<div class="bg-contrast-10">
|
|
38
48
|
<div class="grid gap-1px grid-vertical sm-grid-horizontal">
|
|
39
49
|
<div class="bg-base" title=${t(`type_${type}`)}>
|
|
40
|
-
<div
|
|
50
|
+
<div
|
|
51
|
+
class=${classMap({
|
|
52
|
+
'w-m h-m': true,
|
|
53
|
+
'text-tertiary': !readonly && !disabled,
|
|
54
|
+
'text-disabled': readonly || disabled,
|
|
55
|
+
})}
|
|
56
|
+
aria-hidden="true"
|
|
57
|
+
>
|
|
41
58
|
${option ? typeToIcon[type] : icons.typeAny}
|
|
42
59
|
</div>
|
|
43
60
|
</div>
|
|
@@ -74,7 +91,7 @@ export function Rule(params) {
|
|
|
74
91
|
class=${classMap({
|
|
75
92
|
'-mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center': true,
|
|
76
93
|
'border-t border-b border-transparent divide-y divide-transparent': true,
|
|
77
|
-
'hidden': !!isFullSize,
|
|
94
|
+
'hidden': !!isFullSize || readonly,
|
|
78
95
|
'flex': !isFullSize,
|
|
79
96
|
})}
|
|
80
97
|
>
|
|
@@ -82,11 +99,12 @@ export function Rule(params) {
|
|
|
82
99
|
aria-label=${t('delete')}
|
|
83
100
|
class=${classMap({
|
|
84
101
|
'box-content flex w-m h-m rounded-full transition-colors': true,
|
|
85
|
-
'text-secondary hover-bg-contrast-5 hover-text-error':
|
|
102
|
+
'text-secondary hover-bg-contrast-5 hover-text-error': !disabled,
|
|
103
|
+
'cursor-default text-disabled': disabled,
|
|
86
104
|
'focus-outline-none focus-ring-2 ring-primary-50': true,
|
|
87
105
|
'opacity-0': !parsedValue.path,
|
|
88
106
|
})}
|
|
89
|
-
?disabled=${!parsedValue.path}
|
|
107
|
+
?disabled=${disabled || readonly || !parsedValue.path}
|
|
90
108
|
@click=${onDelete}
|
|
91
109
|
>
|
|
92
110
|
<iron-icon
|
|
@@ -100,11 +118,13 @@ export function Rule(params) {
|
|
|
100
118
|
<button
|
|
101
119
|
aria-label=${t('add_or_clause')}
|
|
102
120
|
class=${classMap({
|
|
103
|
-
'box-content flex w-m h-m rounded-full transition-colors
|
|
104
|
-
'hover-bg-contrast-5
|
|
121
|
+
'box-content flex w-m h-m rounded-full transition-colors': true,
|
|
122
|
+
'text-success hover-bg-contrast-5': !disabled,
|
|
123
|
+
'cursor-default text-disabled': disabled,
|
|
124
|
+
'focus-outline-none focus-ring-2 ring-primary-50': true,
|
|
105
125
|
'opacity-0': !parsedValue.path || !!isNested,
|
|
106
126
|
})}
|
|
107
|
-
?disabled=${!parsedValue.path}
|
|
127
|
+
?disabled=${disabled || readonly || !parsedValue.path}
|
|
108
128
|
@click=${onConvert}
|
|
109
129
|
>
|
|
110
130
|
<iron-icon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rule.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/Rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,0BAAuB;AAExC,OAAO,EAAE,QAAQ,EAAuB,IAAI,EAAE,oBAAiB;AAC/D,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,0BAAuB;AAE9C,OAAO,EAAE,cAAc,EAAE,4BAAyB;AAClD,OAAO,EAAE,SAAS,EAAE,uBAAoB;AACxC,OAAO,EAAE,IAAI,EAAE,kBAAe;AAC9B,OAAO,EAAE,cAAc,EAAE,4BAAyB;AAClD,OAAO,EAAE,IAAI,EAAE,kBAAe;AAC9B,OAAO,EAAE,UAAU,EAAE,wBAAqB;AAC1C,OAAO,EAAE,WAAW,EAAE,yBAAsB;AAC5C,OAAO,EAAE,QAAQ,EAAE,uCAAoC;
|
|
1
|
+
{"version":3,"file":"Rule.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/Rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,0BAAuB;AAExC,OAAO,EAAE,QAAQ,EAAuB,IAAI,EAAE,oBAAiB;AAC/D,OAAO,EAAkB,IAAI,E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AAO;gBACvB,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC;gBAC/B,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;oBAC9D,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC;oBAC7B,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC;;;;;;;gBAO9B,QAAQ,CAAC;QACf,kEAAkE,EAAE,IAAI;QACxE,kEAAkE,EAAE,IAAI;QACxE,QAAQ,EAAE,CAAC,CAAC,UAAU,IAAI,QAAQ;QAClC,MAAM,EAAE,CAAC,UAAU;KACpB,CAAC;;;uBAGa,CAAC,CAAC,QAAQ,CAAC;kBAChB,QAAQ,CAAC;QACf,yDAAyD,EAAE,IAAI;QAC/D,qDAAqD,EAAE,CAAC,QAAQ;QAChE,8BAA8B,EAAE,QAAQ;QACxC,iDAAiD,EAAE,IAAI;QACvD,WAAW,EAAE,CAAC,WAAW,CAAC,IAAI;KAC/B,CAAC;sBACU,QAAQ,IAAI,QAAQ,IAAI,CAAC,WAAW,CAAC,IAAI;mBAC5C,QAAQ;;;;;;;;;;;uBAWJ,CAAC,CAAC,eAAe,CAAC;kBACvB,QAAQ,CAAC;QACf,yDAAyD,EAAE,IAAI;QAC/D,kCAAkC,EAAE,CAAC,QAAQ;QAC7C,8BAA8B,EAAE,QAAQ;QACxC,iDAAiD,EAAE,IAAI;QACvD,WAAW,EAAE,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ;KAC7C,CAAC;sBACU,QAAQ,IAAI,QAAQ,IAAI,CAAC,WAAW,CAAC,IAAI;mBAC5C,SAAS;;;;;;;;;;;GAWzB,CAAC;AACJ,CAAC","sourcesContent":["import * as icons from '../icons/index';\n\nimport { Operator, Option, ParsedValue, Type } from '../types';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { BooleanValue } from './BooleanValue';\nimport { I18n } from '../../I18n/I18n';\nimport { IsDefinedValue } from './IsDefinedValue';\nimport { ListValue } from './ListValue';\nimport { Name } from './Name';\nimport { OperatorToggle } from './OperatorToggle';\nimport { Path } from './Path';\nimport { RangeValue } from './RangeValue';\nimport { SingleValue } from './SingleValue';\nimport { classMap } from '../../../../utils/class-map';\n\nexport type RuleParams = {\n parsedValue: ParsedValue;\n isFullSize?: boolean;\n isNested?: boolean;\n disabled: boolean;\n readonly: boolean;\n options: Option[];\n t: I18n['t'];\n onChange: (newValue: ParsedValue) => void;\n onDelete?: () => void;\n onConvert?: () => void;\n};\n\nexport function Rule(params: RuleParams): TemplateResult {\n const {\n parsedValue,\n isFullSize,\n isNested,\n readonly,\n disabled,\n options,\n t,\n onConvert,\n onDelete,\n onChange,\n } = params;\n\n const option = options.find(o => o.path === parsedValue.path) ?? null;\n const type = option?.type ?? Type.Any;\n const operator = parsedValue.operator;\n const componentParams = {\n parsedValue: parsedValue,\n disabled,\n readonly,\n options,\n option,\n t,\n onChange,\n };\n\n const typeToIcon = {\n [Type.Attribute]: icons.typeAttribute,\n [Type.Boolean]: icons.typeBoolean,\n [Type.Number]: icons.typeNumber,\n [Type.String]: icons.typeString,\n [Type.Date]: icons.typeDate,\n [Type.Any]: icons.typeAny,\n };\n\n return html`\n <div class=\"flex items-center space-x-s\" aria-label=${t('query_builder_rule')}>\n <div\n class=${classMap({\n 'flex-1 bg-base rounded overflow-hidden border': true,\n 'border-contrast-10': !isNested && !readonly,\n 'border-contrast-50': !!isNested || readonly,\n 'border-dashed': readonly,\n 'border-solid': !readonly,\n })}\n >\n <div class=\"bg-contrast-10\">\n <div class=\"grid gap-1px grid-vertical sm-grid-horizontal\">\n <div class=\"bg-base\" title=${t(`type_${type}`)}>\n <div\n class=${classMap({\n 'w-m h-m': true,\n 'text-tertiary': !readonly && !disabled,\n 'text-disabled': readonly || disabled,\n })}\n aria-hidden=\"true\"\n >\n ${option ? typeToIcon[type] : icons.typeAny}\n </div>\n </div>\n\n <div class=\"bg-base\">\n ${parsedValue.path && (type === Type.Attribute || parsedValue.name)\n ? html`\n <div class=\"bg-contrast-10 grid gap-1px grid-cols-1 sm-grid-cols-2\">\n <div class=\"bg-base\">${Path(componentParams)}</div>\n <div class=\"bg-base\">${Name(componentParams)}</div>\n </div>\n `\n : Path(componentParams)}\n </div>\n\n <div class=\"bg-base\">${OperatorToggle(componentParams)}</div>\n\n <div class=\"bg-base\">\n ${operator === Operator.In\n ? ListValue(componentParams)\n : operator === Operator.IsDefined\n ? IsDefinedValue(componentParams)\n : type === Type.Boolean\n ? BooleanValue(componentParams)\n : operator === null && [Type.Number, Type.Date].includes(type)\n ? RangeValue(componentParams)\n : SingleValue(componentParams)}\n </div>\n </div>\n </div>\n </div>\n\n <div\n class=${classMap({\n '-mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center': true,\n 'border-t border-b border-transparent divide-y divide-transparent': true,\n 'hidden': !!isFullSize || readonly,\n 'flex': !isFullSize,\n })}\n >\n <button\n aria-label=${t('delete')}\n class=${classMap({\n 'box-content flex w-m h-m rounded-full transition-colors': true,\n 'text-secondary hover-bg-contrast-5 hover-text-error': !disabled,\n 'cursor-default text-disabled': disabled,\n 'focus-outline-none focus-ring-2 ring-primary-50': true,\n 'opacity-0': !parsedValue.path,\n })}\n ?disabled=${disabled || readonly || !parsedValue.path}\n @click=${onDelete}\n >\n <iron-icon\n aria-hidden=\"true\"\n class=\"m-auto icon-inline text-xl\"\n icon=\"icons:remove-circle-outline\"\n >\n </iron-icon>\n </button>\n\n <button\n aria-label=${t('add_or_clause')}\n class=${classMap({\n 'box-content flex w-m h-m rounded-full transition-colors': true,\n 'text-success hover-bg-contrast-5': !disabled,\n 'cursor-default text-disabled': disabled,\n 'focus-outline-none focus-ring-2 ring-primary-50': true,\n 'opacity-0': !parsedValue.path || !!isNested,\n })}\n ?disabled=${disabled || readonly || !parsedValue.path}\n @click=${onConvert}\n >\n <iron-icon\n aria-hidden=\"true\"\n class=\"m-auto icon-inline text-xl\"\n icon=\"icons:add-circle-outline\"\n >\n </iron-icon>\n </button>\n </div>\n </div>\n `;\n}\n"]}
|
|
@@ -5,16 +5,25 @@ export function Select(params) {
|
|
|
5
5
|
const isEmpty = (_b = (_a = params.list) === null || _a === void 0 ? void 0 : _a.every(v => v.value !== params.value)) !== null && _b !== void 0 ? _b : true;
|
|
6
6
|
return html `
|
|
7
7
|
<label
|
|
8
|
-
class
|
|
8
|
+
class=${classMap({
|
|
9
|
+
'flex items-center transition-colors group text-tertiary': true,
|
|
10
|
+
'cursor-pointer hover-bg-contrast-5': !params.disabled && !params.readonly,
|
|
11
|
+
'cursor-default': params.disabled || params.readonly,
|
|
12
|
+
})}
|
|
9
13
|
>
|
|
10
14
|
<div class="relative flex-1 min-w-0 overflow-hidden">
|
|
11
15
|
<select
|
|
12
16
|
class=${classMap({
|
|
13
|
-
'
|
|
17
|
+
'bg-transparent relative appearance-none flex h-m px-s': true,
|
|
14
18
|
'font-medium w-full max-w-full whitespace-nowrap focus-outline-none': true,
|
|
15
|
-
'text-tertiary': isEmpty,
|
|
16
|
-
'text-body': !isEmpty,
|
|
19
|
+
'text-tertiary': isEmpty && !params.disabled,
|
|
20
|
+
'text-body': !isEmpty && !params.disabled && !params.readonly,
|
|
21
|
+
'text-disabled': params.disabled,
|
|
22
|
+
'text-secondary': !isEmpty && params.readonly,
|
|
23
|
+
'cursor-pointer': !params.disabled && !params.readonly,
|
|
24
|
+
'cursor-default': params.disabled || params.readonly,
|
|
17
25
|
})}
|
|
26
|
+
?disabled=${params.disabled || params.readonly}
|
|
18
27
|
@change=${(evt) => {
|
|
19
28
|
const select = evt.currentTarget;
|
|
20
29
|
const value = select.options[select.options.selectedIndex].value;
|
|
@@ -38,16 +47,27 @@ export function Select(params) {
|
|
|
38
47
|
? ''
|
|
39
48
|
: html `
|
|
40
49
|
<span
|
|
41
|
-
class
|
|
50
|
+
class=${classMap({
|
|
51
|
+
'font-tnum text-xs font-medium border mr-s px-xs rounded-s border-current inline-block': true,
|
|
52
|
+
'text-body': !params.disabled && !params.readonly,
|
|
53
|
+
'text-disabled': params.disabled,
|
|
54
|
+
'text-secondary': params.readonly,
|
|
55
|
+
})}
|
|
42
56
|
>
|
|
43
57
|
${params.t(params.label)}
|
|
44
58
|
</span>
|
|
45
59
|
|
|
46
|
-
${params.clearable
|
|
60
|
+
${params.clearable && !params.readonly
|
|
47
61
|
? html `
|
|
48
62
|
<button
|
|
49
63
|
aria-label=${params.t('delete')}
|
|
50
|
-
class
|
|
64
|
+
class=${classMap({
|
|
65
|
+
'w-s h-s mr-xs flex items-center justify-center transition-colors rounded-full': true,
|
|
66
|
+
'focus-outline-none focus-ring-2 focus-ring-primary-50': true,
|
|
67
|
+
'hover-bg-contrast-5 hover-text-error text-body': !params.disabled,
|
|
68
|
+
'text-disabled': params.disabled,
|
|
69
|
+
})}
|
|
70
|
+
?disabled=${params.disabled}
|
|
51
71
|
@click=${() => params.onChange('')}
|
|
52
72
|
>
|
|
53
73
|
<iron-icon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/Select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,uCAAoC;
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/Select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,uCAAoC;AAavD,MAAM,UAAU,MAAM,CAAC,MAAoB;;IACzC,MAAM,OAAO,eAAG,MAAM,CAAC,IAAI,0CAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,oCAAK,IAAI,CAAC;IAE1E,OAAO,IAAI,CAAA;;cAEC,QAAQ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Ac,KAAK,KAAK,MAAM,CAAC,KAAK;oBACrD,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;;eAEpB,CACJ;;;;QAIH,OAAO;QACP,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,IAAI,CAAA;;sBAEQ,QAAQ,CAAC;YACf,uFAAuF,EACrF,IAAI;YACN,WAAW,EAAE,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ;YACjD,eAAe,EAAE,MAAM,CAAC,QAAQ;YAChC,gBAAgB,EAAE,MAAM,CAAC,QAAQ;SAClC,CAAC;;gBAEA,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;;;cAGxB,MAAM,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ;YACpC,CAAC,CAAC,IAAI,CAAA;;iCAEa,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;4BACvB,QAAQ,CAAC;gBACf,+EAA+E,EAC7E,IAAI;gBACN,uDAAuD,EAAE,IAAI;gBAC7D,gDAAgD,EAAE,CAAC,MAAM,CAAC,QAAQ;gBAClE,eAAe,EAAE,MAAM,CAAC,QAAQ;aACjC,CAAC;gCACU,MAAM,CAAC,QAAQ;6BAClB,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;;;;;;;;;iBASrC;YACH,CAAC,CAAC,EAAE;WACP;;GAER,CAAC;AACJ,CAAC","sourcesContent":["import { TemplateResult, html } from 'lit-html';\n\nimport { I18n } from '../../I18n/I18n';\nimport { classMap } from '../../../../utils/class-map';\n\nexport type SelectParams = {\n clearable?: boolean;\n disabled: boolean;\n readonly: boolean;\n label: string;\n value: string;\n list?: { label: string; value: string }[];\n t: I18n['t'];\n onChange: (newValue: string) => void;\n};\n\nexport function Select(params: SelectParams): TemplateResult {\n const isEmpty = params.list?.every(v => v.value !== params.value) ?? true;\n\n return html`\n <label\n class=${classMap({\n 'flex items-center transition-colors group text-tertiary': true,\n 'cursor-pointer hover-bg-contrast-5': !params.disabled && !params.readonly,\n 'cursor-default': params.disabled || params.readonly,\n })}\n >\n <div class=\"relative flex-1 min-w-0 overflow-hidden\">\n <select\n class=${classMap({\n 'bg-transparent relative appearance-none flex h-m px-s': true,\n 'font-medium w-full max-w-full whitespace-nowrap focus-outline-none': true,\n 'text-tertiary': isEmpty && !params.disabled,\n 'text-body': !isEmpty && !params.disabled && !params.readonly,\n 'text-disabled': params.disabled,\n 'text-secondary': !isEmpty && params.readonly,\n 'cursor-pointer': !params.disabled && !params.readonly,\n 'cursor-default': params.disabled || params.readonly,\n })}\n ?disabled=${params.disabled || params.readonly}\n @change=${(evt: Event) => {\n const select = evt.currentTarget as HTMLSelectElement;\n const value = select.options[select.options.selectedIndex].value;\n params.onChange(value);\n }}\n >\n ${isEmpty\n ? html`\n <option value=\"\" disabled ?selected=${isEmpty}>${params.t(params.label)}</option>\n `\n : ''}\n ${params.list?.map(\n ({ label, value }) =>\n html`\n <option value=${value} ?selected=${value === params.value}>\n ${params.t(label)}\n </option>\n `\n )}\n </select>\n </div>\n\n ${isEmpty\n ? ''\n : html`\n <span\n class=${classMap({\n 'font-tnum text-xs font-medium border mr-s px-xs rounded-s border-current inline-block':\n true,\n 'text-body': !params.disabled && !params.readonly,\n 'text-disabled': params.disabled,\n 'text-secondary': params.readonly,\n })}\n >\n ${params.t(params.label)}\n </span>\n\n ${params.clearable && !params.readonly\n ? html`\n <button\n aria-label=${params.t('delete')}\n class=${classMap({\n 'w-s h-s mr-xs flex items-center justify-center transition-colors rounded-full':\n true,\n 'focus-outline-none focus-ring-2 focus-ring-primary-50': true,\n 'hover-bg-contrast-5 hover-text-error text-body': !params.disabled,\n 'text-disabled': params.disabled,\n })}\n ?disabled=${params.disabled}\n @click=${() => params.onChange('')}\n >\n <iron-icon\n aria-hidden=\"true\"\n class=\"icon-inline text-l\"\n icon=\"icons:remove-circle-outline\"\n >\n </iron-icon>\n </button>\n `\n : ''}\n `}\n </label>\n `;\n}\n"]}
|
|
@@ -3,6 +3,8 @@ import { I18n } from '../../I18n/I18n';
|
|
|
3
3
|
import { TemplateResult } from 'lit-html';
|
|
4
4
|
export declare type SingleValueParams = {
|
|
5
5
|
parsedValue: ParsedValue;
|
|
6
|
+
readonly: boolean;
|
|
7
|
+
disabled: boolean;
|
|
6
8
|
option: Option | null;
|
|
7
9
|
t: I18n['t'];
|
|
8
10
|
onChange: (newValue: ParsedValue) => void;
|
|
@@ -3,12 +3,13 @@ import { Input } from "./Input.js";
|
|
|
3
3
|
import { Select } from "./Select.js";
|
|
4
4
|
export function SingleValue(params) {
|
|
5
5
|
var _a, _b, _c, _d;
|
|
6
|
-
const { t, option, parsedValue, onChange } = params;
|
|
6
|
+
const { t, option, parsedValue, readonly, disabled, onChange } = params;
|
|
7
7
|
const Field = (option === null || option === void 0 ? void 0 : option.list) ? Select : Input;
|
|
8
8
|
const type = (_a = option === null || option === void 0 ? void 0 : option.type) !== null && _a !== void 0 ? _a : Type.Any;
|
|
9
9
|
return Field({
|
|
10
10
|
displayValue: (_c = (_b = option === null || option === void 0 ? void 0 : option.list) === null || _b === void 0 ? void 0 : _b.find(v => v.value === parsedValue.value)) === null || _c === void 0 ? void 0 : _c.label,
|
|
11
|
-
|
|
11
|
+
readonly,
|
|
12
|
+
disabled: disabled || !parsedValue.path,
|
|
12
13
|
value: (_d = parsedValue.value) !== null && _d !== void 0 ? _d : '',
|
|
13
14
|
label: 'value',
|
|
14
15
|
type: type === Type.Number ? 'number' : type === Type.Date ? 'date' : 'text',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleValue.js","sourceRoot":"","sources":["../../../../../src/elements/public/QueryBuilder/components/SingleValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAE,oBAAiB;AAGrD,OAAO,EAAE,KAAK,EAAE,mBAAgB;AAChC,OAAO,EAAE,MAAM,EAAE,oBAAiB;
|
|
1
|
+
{"version":3,"file":"SingleValue.js","sourceRoot":"","s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AQ,EAAE,CAAC;KACpE,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Option, ParsedValue, Type } from '../types';\n\nimport { I18n } from '../../I18n/I18n';\nimport { Input } from './Input';\nimport { Select } from './Select';\nimport { TemplateResult } from 'lit-html';\n\nexport type SingleValueParams = {\n parsedValue: ParsedValue;\n readonly: boolean;\n disabled: boolean;\n option: Option | null;\n t: I18n['t'];\n onChange: (newValue: ParsedValue) => void;\n};\n\nexport function SingleValue(params: SingleValueParams): TemplateResult {\n const { t, option, parsedValue, readonly, disabled, onChange } = params;\n const Field = option?.list ? Select : Input;\n const type = option?.type ?? Type.Any;\n\n return Field({\n displayValue: option?.list?.find(v => v.value === parsedValue.value)?.label,\n readonly,\n disabled: disabled || !parsedValue.path,\n value: parsedValue.value ?? '',\n label: 'value',\n type: type === Type.Number ? 'number' : type === Type.Date ? 'date' : 'text',\n list: option?.list,\n t: t,\n onChange: newValue => onChange({ ...parsedValue, value: newValue }),\n });\n}\n"]}
|