@open-mercato/core 0.5.1-develop.2953.6647bb2c43 → 0.5.1-develop.2964.d5ac4a6ebb
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/helpers/integration/salesUi.js +25 -23
- package/dist/helpers/integration/salesUi.js.map +2 -2
- package/dist/modules/api_docs/frontend/docs/api/Explorer.js +24 -24
- package/dist/modules/api_docs/frontend/docs/api/Explorer.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js +15 -7
- package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +2 -2
- package/dist/modules/attachments/fields/attachment.js +4 -6
- package/dist/modules/attachments/fields/attachment.js.map +2 -2
- package/dist/modules/auth/backend/users/create/page.js +26 -26
- package/dist/modules/auth/backend/users/create/page.js.map +2 -2
- package/dist/modules/business_rules/components/ActionRow.js +36 -25
- package/dist/modules/business_rules/components/ActionRow.js.map +2 -2
- package/dist/modules/business_rules/components/ConditionGroup.js +14 -5
- package/dist/modules/business_rules/components/ConditionGroup.js.map +2 -2
- package/dist/modules/business_rules/components/ConditionRow.js +19 -10
- package/dist/modules/business_rules/components/ConditionRow.js.map +2 -2
- package/dist/modules/business_rules/components/RuleSetMembers.js +16 -10
- package/dist/modules/business_rules/components/RuleSetMembers.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +30 -34
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +220 -223
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/components/PriceKindSettings.js +20 -19
- package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductUomSection.js +42 -37
- package/dist/modules/catalog/components/products/ProductUomSection.js.map +2 -2
- package/dist/modules/catalog/components/products/VariantBuilder.js +22 -18
- package/dist/modules/catalog/components/products/VariantBuilder.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +18 -26
- package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +4 -6
- package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js +5 -4
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js.map +2 -2
- package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js +19 -7
- package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js +24 -21
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +2 -2
- package/dist/modules/customers/components/AddressEditor.js +24 -7
- package/dist/modules/customers/components/AddressEditor.js.map +2 -2
- package/dist/modules/customers/components/AddressFormatSettings.js +35 -25
- package/dist/modules/customers/components/AddressFormatSettings.js.map +2 -2
- package/dist/modules/customers/components/detail/ActivityForm.js +20 -12
- package/dist/modules/customers/components/detail/ActivityForm.js.map +2 -2
- package/dist/modules/customers/components/detail/AnnualRevenueField.js +2 -2
- package/dist/modules/customers/components/detail/AnnualRevenueField.js.map +2 -2
- package/dist/modules/customers/components/detail/DealForm.js +19 -14
- package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
- package/dist/modules/customers/components/formConfig.js +16 -12
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js +18 -10
- package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js +3 -2
- package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js.map +2 -2
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +27 -28
- package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +14 -6
- package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +14 -6
- package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +3 -2
- package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +3 -2
- package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +2 -2
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +17 -8
- package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +40 -23
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/components/IntegrationScheduleTab.js +15 -6
- package/dist/modules/data_sync/components/IntegrationScheduleTab.js.map +2 -2
- package/dist/modules/dictionaries/components/AppearanceSelector.js +4 -4
- package/dist/modules/dictionaries/components/AppearanceSelector.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +4 -5
- package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +22 -14
- package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +2 -2
- package/dist/modules/dictionaries/fields/dictionary.js +18 -13
- package/dist/modules/dictionaries/fields/dictionary.js.map +2 -2
- package/dist/modules/entities/components/EncryptionManager.js +23 -19
- package/dist/modules/entities/components/EncryptionManager.js.map +2 -2
- package/dist/modules/feature_toggles/components/formConfig.js +17 -9
- package/dist/modules/feature_toggles/components/formConfig.js.map +2 -2
- package/dist/modules/feature_toggles/components/overrideFormConfig.js +17 -9
- package/dist/modules/feature_toggles/components/overrideFormConfig.js.map +2 -2
- package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js +15 -8
- package/dist/modules/inbox_ops/backend/inbox-ops/settings/page.js.map +2 -2
- package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js +37 -22
- package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/[id]/page.js +22 -17
- package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js +12 -6
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js.map +2 -2
- package/dist/modules/planner/components/AvailabilityRulesEditor.js +19 -12
- package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
- package/dist/modules/resources/components/ResourceCrudForm.js +15 -10
- package/dist/modules/resources/components/ResourceCrudForm.js.map +3 -3
- package/dist/modules/sales/backend/sales/documents/[id]/page.js +15 -18
- package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
- package/dist/modules/sales/components/ProviderFieldInput.js +23 -20
- package/dist/modules/sales/components/ProviderFieldInput.js.map +2 -2
- package/dist/modules/sales/components/ShippingMethodsSettings.js +25 -17
- package/dist/modules/sales/components/ShippingMethodsSettings.js.map +3 -3
- package/dist/modules/sales/components/channels/ChannelOfferForm.js +35 -42
- package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
- package/dist/modules/sales/components/documents/AddressesSection.js +87 -90
- package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentDialog.js +17 -6
- package/dist/modules/sales/components/documents/AdjustmentDialog.js.map +3 -3
- package/dist/modules/sales/components/documents/LineItemDialog.js +42 -25
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentForm.js +96 -87
- package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js +20 -11
- package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js.map +2 -2
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js +20 -11
- package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js.map +2 -2
- package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js +36 -22
- package/dist/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.js.map +2 -2
- package/dist/modules/staff/components/TeamMemberForm.js +14 -9
- package/dist/modules/staff/components/TeamMemberForm.js.map +3 -3
- package/dist/modules/workflows/backend/tasks/[id]/page.js +42 -21
- package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
- package/dist/modules/workflows/components/ActivitiesEditor.js +14 -6
- package/dist/modules/workflows/components/ActivitiesEditor.js.map +3 -3
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js +25 -17
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +3 -3
- package/dist/modules/workflows/components/EdgeEditDialog.js +48 -45
- package/dist/modules/workflows/components/EdgeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/NodeEditDialog.js +90 -90
- package/dist/modules/workflows/components/NodeEditDialog.js.map +2 -2
- package/dist/modules/workflows/components/StepsEditor.js +14 -6
- package/dist/modules/workflows/components/StepsEditor.js.map +3 -3
- package/dist/modules/workflows/components/TransitionsEditor.js +31 -26
- package/dist/modules/workflows/components/TransitionsEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/ActivityArrayEditor.js +19 -11
- package/dist/modules/workflows/components/fields/ActivityArrayEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js +12 -14
- package/dist/modules/workflows/components/fields/BusinessRuleConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js +24 -16
- package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js.map +3 -3
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js +12 -13
- package/dist/modules/workflows/components/fields/StartPreConditionsEditor.js.map +2 -2
- package/dist/modules/workflows/components/mobile/MobileTaskForm.js +12 -8
- package/dist/modules/workflows/components/mobile/MobileTaskForm.js.map +2 -2
- package/dist/modules/workflows/frontend/checkout-demo/page.js +43 -46
- package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
- package/package.json +3 -3
- package/src/helpers/integration/salesUi.ts +40 -30
- package/src/modules/api_docs/frontend/docs/api/Explorer.tsx +25 -19
- package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +21 -11
- package/src/modules/attachments/fields/attachment.tsx +4 -6
- package/src/modules/auth/backend/users/create/page.tsx +16 -20
- package/src/modules/business_rules/components/ActionRow.tsx +51 -32
- package/src/modules/business_rules/components/ConditionGroup.tsx +20 -9
- package/src/modules/business_rules/components/ConditionRow.tsx +24 -15
- package/src/modules/business_rules/components/RuleSetMembers.tsx +23 -13
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +47 -53
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +84 -87
- package/src/modules/catalog/components/PriceKindSettings.tsx +9 -9
- package/src/modules/catalog/components/products/ProductUomSection.tsx +85 -83
- package/src/modules/catalog/components/products/VariantBuilder.tsx +49 -33
- package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +12 -27
- package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +4 -6
- package/src/modules/customer_accounts/widgets/injection/account-status/widget.client.tsx +5 -4
- package/src/modules/customers/backend/config/customers/pipeline-stages/page.tsx +28 -15
- package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +37 -26
- package/src/modules/customers/components/AddressEditor.tsx +30 -16
- package/src/modules/customers/components/AddressFormatSettings.tsx +25 -19
- package/src/modules/customers/components/detail/ActivityForm.tsx +35 -23
- package/src/modules/customers/components/detail/AnnualRevenueField.tsx +2 -2
- package/src/modules/customers/components/detail/DealForm.tsx +33 -20
- package/src/modules/customers/components/formConfig.tsx +25 -17
- package/src/modules/customers/widgets/dashboard/customer-todos/widget.client.tsx +3 -2
- package/src/modules/customers/widgets/dashboard/new-customers/widget.client.tsx +21 -11
- package/src/modules/customers/widgets/dashboard/new-deals/widget.client.tsx +3 -2
- package/src/modules/customers/widgets/dashboard/next-interactions/widget.client.tsx +3 -2
- package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +17 -22
- package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +17 -7
- package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +20 -10
- package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +3 -2
- package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +3 -2
- package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +20 -9
- package/src/modules/data_sync/backend/data-sync/page.tsx +64 -38
- package/src/modules/data_sync/components/IntegrationScheduleTab.tsx +18 -7
- package/src/modules/dictionaries/components/AppearanceSelector.tsx +4 -4
- package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +3 -4
- package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +27 -21
- package/src/modules/dictionaries/fields/dictionary.tsx +36 -23
- package/src/modules/entities/components/EncryptionManager.tsx +49 -33
- package/src/modules/feature_toggles/components/formConfig.tsx +20 -10
- package/src/modules/feature_toggles/components/overrideFormConfig.tsx +20 -10
- package/src/modules/inbox_ops/backend/inbox-ops/settings/page.tsx +19 -10
- package/src/modules/inbox_ops/components/proposals/EditActionDialog.tsx +49 -26
- package/src/modules/integrations/backend/integrations/[id]/page.tsx +20 -11
- package/src/modules/integrations/backend/integrations/bundle/[id]/page.tsx +19 -9
- package/src/modules/planner/components/AvailabilityRulesEditor.tsx +34 -21
- package/src/modules/resources/components/ResourceCrudForm.tsx +24 -15
- package/src/modules/sales/backend/sales/documents/[id]/page.tsx +12 -15
- package/src/modules/sales/components/ProviderFieldInput.tsx +26 -17
- package/src/modules/sales/components/ShippingMethodsSettings.tsx +28 -20
- package/src/modules/sales/components/channels/ChannelOfferForm.tsx +51 -46
- package/src/modules/sales/components/documents/AddressesSection.tsx +78 -76
- package/src/modules/sales/components/documents/AdjustmentDialog.tsx +27 -15
- package/src/modules/sales/components/documents/LineItemDialog.tsx +69 -51
- package/src/modules/sales/components/documents/SalesDocumentForm.tsx +98 -87
- package/src/modules/sales/widgets/dashboard/new-orders/widget.client.tsx +23 -12
- package/src/modules/sales/widgets/dashboard/new-quotes/widget.client.tsx +23 -12
- package/src/modules/shipping_carriers/lib/shipment-wizard/components/ConfigureStep.tsx +35 -19
- package/src/modules/staff/components/TeamMemberForm.tsx +23 -14
- package/src/modules/workflows/backend/tasks/[id]/page.tsx +51 -23
- package/src/modules/workflows/components/ActivitiesEditor.tsx +20 -10
- package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +28 -18
- package/src/modules/workflows/components/EdgeEditDialog.tsx +51 -40
- package/src/modules/workflows/components/NodeEditDialog.tsx +81 -77
- package/src/modules/workflows/components/StepsEditor.tsx +20 -10
- package/src/modules/workflows/components/TransitionsEditor.tsx +61 -44
- package/src/modules/workflows/components/fields/ActivityArrayEditor.tsx +22 -12
- package/src/modules/workflows/components/fields/BusinessRuleConditionsEditor.tsx +9 -13
- package/src/modules/workflows/components/fields/FormFieldArrayEditor.tsx +27 -17
- package/src/modules/workflows/components/fields/StartPreConditionsEditor.tsx +9 -12
- package/src/modules/workflows/components/mobile/MobileTaskForm.tsx +19 -11
- package/src/modules/workflows/frontend/checkout-demo/page.tsx +71 -60
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
5
5
|
import { Spinner } from '@open-mercato/ui/primitives/spinner'
|
|
6
|
+
import { RadioGroup } from '@open-mercato/ui/primitives/radio'
|
|
7
|
+
import { RadioField } from '@open-mercato/ui/primitives/radio-field'
|
|
6
8
|
import { apiCallOrThrow, readApiResultOrThrow } from '@open-mercato/ui/backend/utils/apiCall'
|
|
7
9
|
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
8
10
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
@@ -279,28 +281,21 @@ export const WidgetVisibilityEditor = React.forwardRef<WidgetVisibilityEditorHan
|
|
|
279
281
|
)}
|
|
280
282
|
|
|
281
283
|
{kind === 'user' && (
|
|
282
|
-
<
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
value="override"
|
|
298
|
-
checked={mode === 'override'}
|
|
299
|
-
onChange={() => setMode('override')}
|
|
300
|
-
/>
|
|
301
|
-
{t('dashboards.widgets.mode.override', 'Override for this user')}
|
|
302
|
-
</label>
|
|
303
|
-
</div>
|
|
284
|
+
<RadioGroup
|
|
285
|
+
className="flex flex-row items-center gap-3 rounded-md border bg-muted/30 px-3 py-2"
|
|
286
|
+
name="widgetOverride"
|
|
287
|
+
value={mode}
|
|
288
|
+
onValueChange={(next) => setMode(next as 'inherit' | 'override')}
|
|
289
|
+
>
|
|
290
|
+
<RadioField
|
|
291
|
+
value="inherit"
|
|
292
|
+
label={t('dashboards.widgets.mode.inherit', 'Inherit from roles')}
|
|
293
|
+
/>
|
|
294
|
+
<RadioField
|
|
295
|
+
value="override"
|
|
296
|
+
label={t('dashboards.widgets.mode.override', 'Override for this user')}
|
|
297
|
+
/>
|
|
298
|
+
</RadioGroup>
|
|
304
299
|
)}
|
|
305
300
|
|
|
306
301
|
{kind === 'user' && mode === 'inherit' && (
|
|
@@ -10,6 +10,13 @@ import {
|
|
|
10
10
|
InlineDateRangeSelect,
|
|
11
11
|
type DateRangePreset,
|
|
12
12
|
} from '@open-mercato/ui/backend/date-range'
|
|
13
|
+
import {
|
|
14
|
+
Select,
|
|
15
|
+
SelectContent,
|
|
16
|
+
SelectItem,
|
|
17
|
+
SelectTrigger,
|
|
18
|
+
SelectValue,
|
|
19
|
+
} from '@open-mercato/ui/primitives/select'
|
|
13
20
|
import { DEFAULT_SETTINGS, hydrateSettings, type OrdersByStatusSettings } from './config'
|
|
14
21
|
import type { WidgetDataResponse } from '../../../services/widgetDataService'
|
|
15
22
|
|
|
@@ -115,15 +122,18 @@ const OrdersByStatusWidget: React.FC<DashboardWidgetComponentProps<OrdersByStatu
|
|
|
115
122
|
>
|
|
116
123
|
{t('dashboards.analytics.settings.chartVariant', 'Chart Style')}
|
|
117
124
|
</label>
|
|
118
|
-
<
|
|
119
|
-
id="orders-by-status-variant"
|
|
120
|
-
className="w-full rounded-md border bg-background px-2 py-1 text-sm text-foreground focus-visible:border-ring focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
125
|
+
<Select
|
|
121
126
|
value={hydrated.variant}
|
|
122
|
-
|
|
127
|
+
onValueChange={(value) => onSettingsChange({ ...hydrated, variant: value as 'pie' | 'donut' })}
|
|
123
128
|
>
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
129
|
+
<SelectTrigger id="orders-by-status-variant" size="sm">
|
|
130
|
+
<SelectValue />
|
|
131
|
+
</SelectTrigger>
|
|
132
|
+
<SelectContent>
|
|
133
|
+
<SelectItem value="donut">{t('dashboards.analytics.chartVariant.donut', 'Donut')}</SelectItem>
|
|
134
|
+
<SelectItem value="pie">{t('dashboards.analytics.chartVariant.pie', 'Pie')}</SelectItem>
|
|
135
|
+
</SelectContent>
|
|
136
|
+
</Select>
|
|
127
137
|
</div>
|
|
128
138
|
</div>
|
|
129
139
|
)
|
|
@@ -10,6 +10,13 @@ import {
|
|
|
10
10
|
InlineDateRangeSelect,
|
|
11
11
|
type DateRangePreset,
|
|
12
12
|
} from '@open-mercato/ui/backend/date-range'
|
|
13
|
+
import {
|
|
14
|
+
Select,
|
|
15
|
+
SelectContent,
|
|
16
|
+
SelectItem,
|
|
17
|
+
SelectTrigger,
|
|
18
|
+
SelectValue,
|
|
19
|
+
} from '@open-mercato/ui/primitives/select'
|
|
13
20
|
import type { DateGranularity } from '@open-mercato/shared/modules/analytics'
|
|
14
21
|
import { DEFAULT_SETTINGS, hydrateSettings, type RevenueTrendSettings } from './config'
|
|
15
22
|
import type { WidgetDataResponse } from '../../../services/widgetDataService'
|
|
@@ -163,18 +170,21 @@ const RevenueTrendWidget: React.FC<DashboardWidgetComponentProps<RevenueTrendSet
|
|
|
163
170
|
>
|
|
164
171
|
{t('dashboards.analytics.settings.granularity', 'Granularity')}
|
|
165
172
|
</label>
|
|
166
|
-
<
|
|
167
|
-
id="revenue-trend-granularity"
|
|
168
|
-
className="w-full rounded-md border bg-background px-2 py-1 text-sm text-foreground focus-visible:border-ring focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
173
|
+
<Select
|
|
169
174
|
value={hydrated.granularity}
|
|
170
|
-
|
|
175
|
+
onValueChange={(value) => onSettingsChange({ ...hydrated, granularity: value as DateGranularity })}
|
|
171
176
|
>
|
|
172
|
-
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
177
|
+
<SelectTrigger id="revenue-trend-granularity" size="sm">
|
|
178
|
+
<SelectValue />
|
|
179
|
+
</SelectTrigger>
|
|
180
|
+
<SelectContent>
|
|
181
|
+
{GRANULARITY_OPTIONS.map((opt) => (
|
|
182
|
+
<SelectItem key={opt.value} value={opt.value}>
|
|
183
|
+
{t(opt.labelKey, opt.value)}
|
|
184
|
+
</SelectItem>
|
|
185
|
+
))}
|
|
186
|
+
</SelectContent>
|
|
187
|
+
</Select>
|
|
178
188
|
</div>
|
|
179
189
|
<div className="space-y-1.5">
|
|
180
190
|
<label className="flex items-center gap-2 text-sm">
|
|
@@ -6,6 +6,7 @@ import { apiCall } from '@open-mercato/ui/backend/utils/apiCall'
|
|
|
6
6
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
7
7
|
import { BarChart, type BarChartDataItem } from '@open-mercato/ui/backend/charts'
|
|
8
8
|
import { DateRangeSelect, type DateRangePreset } from '@open-mercato/ui/backend/date-range'
|
|
9
|
+
import { Input } from '@open-mercato/ui/primitives/input'
|
|
9
10
|
import { DEFAULT_SETTINGS, hydrateSettings, type SalesByRegionSettings } from './config'
|
|
10
11
|
import type { WidgetDataResponse } from '../../../services/widgetDataService'
|
|
11
12
|
import { formatCurrencyCompact } from '../../../lib/formatters'
|
|
@@ -94,12 +95,12 @@ const SalesByRegionWidget: React.FC<DashboardWidgetComponentProps<SalesByRegionS
|
|
|
94
95
|
>
|
|
95
96
|
{t('dashboards.analytics.settings.limit', 'Number of items')}
|
|
96
97
|
</label>
|
|
97
|
-
<
|
|
98
|
+
<Input
|
|
98
99
|
id="sales-by-region-limit"
|
|
99
100
|
type="number"
|
|
100
101
|
min={1}
|
|
101
102
|
max={20}
|
|
102
|
-
className="w-24
|
|
103
|
+
className="w-24"
|
|
103
104
|
value={hydrated.limit}
|
|
104
105
|
onChange={(e) => {
|
|
105
106
|
const next = Number(e.target.value)
|
|
@@ -6,6 +6,7 @@ import { apiCall } from '@open-mercato/ui/backend/utils/apiCall'
|
|
|
6
6
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
7
7
|
import { TopNTable, type TopNTableColumn } from '@open-mercato/ui/backend/charts'
|
|
8
8
|
import { DateRangeSelect, type DateRangePreset } from '@open-mercato/ui/backend/date-range'
|
|
9
|
+
import { Input } from '@open-mercato/ui/primitives/input'
|
|
9
10
|
import { DEFAULT_SETTINGS, hydrateSettings, type TopCustomersSettings } from './config'
|
|
10
11
|
import type { WidgetDataResponse } from '../../../services/widgetDataService'
|
|
11
12
|
import { formatCurrencySafe } from '../../../lib/formatters'
|
|
@@ -130,12 +131,12 @@ const TopCustomersWidget: React.FC<DashboardWidgetComponentProps<TopCustomersSet
|
|
|
130
131
|
>
|
|
131
132
|
{t('dashboards.analytics.settings.limit', 'Number of items')}
|
|
132
133
|
</label>
|
|
133
|
-
<
|
|
134
|
+
<Input
|
|
134
135
|
id="top-customers-limit"
|
|
135
136
|
type="number"
|
|
136
137
|
min={1}
|
|
137
138
|
max={20}
|
|
138
|
-
className="w-24
|
|
139
|
+
className="w-24"
|
|
139
140
|
value={hydrated.limit}
|
|
140
141
|
onChange={(e) => {
|
|
141
142
|
const next = Number(e.target.value)
|
|
@@ -6,6 +6,14 @@ import { apiCall } from '@open-mercato/ui/backend/utils/apiCall'
|
|
|
6
6
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
7
7
|
import { BarChart, type BarChartDataItem } from '@open-mercato/ui/backend/charts'
|
|
8
8
|
import { DateRangeSelect, InlineDateRangeSelect, type DateRangePreset } from '@open-mercato/ui/backend/date-range'
|
|
9
|
+
import { Input } from '@open-mercato/ui/primitives/input'
|
|
10
|
+
import {
|
|
11
|
+
Select,
|
|
12
|
+
SelectContent,
|
|
13
|
+
SelectItem,
|
|
14
|
+
SelectTrigger,
|
|
15
|
+
SelectValue,
|
|
16
|
+
} from '@open-mercato/ui/primitives/select'
|
|
9
17
|
import { DEFAULT_SETTINGS, hydrateSettings, type TopProductsSettings } from './config'
|
|
10
18
|
import type { WidgetDataResponse } from '../../../services/widgetDataService'
|
|
11
19
|
import { formatCurrencyCompact } from '../../../lib/formatters'
|
|
@@ -117,12 +125,12 @@ const TopProductsWidget: React.FC<DashboardWidgetComponentProps<TopProductsSetti
|
|
|
117
125
|
>
|
|
118
126
|
{t('dashboards.analytics.settings.limit', 'Number of items')}
|
|
119
127
|
</label>
|
|
120
|
-
<
|
|
128
|
+
<Input
|
|
121
129
|
id="top-products-limit"
|
|
122
130
|
type="number"
|
|
123
131
|
min={1}
|
|
124
132
|
max={20}
|
|
125
|
-
className="w-24
|
|
133
|
+
className="w-24"
|
|
126
134
|
value={hydrated.limit}
|
|
127
135
|
onChange={(e) => {
|
|
128
136
|
const next = Number(e.target.value)
|
|
@@ -137,15 +145,18 @@ const TopProductsWidget: React.FC<DashboardWidgetComponentProps<TopProductsSetti
|
|
|
137
145
|
>
|
|
138
146
|
{t('dashboards.analytics.settings.chartLayout', 'Chart Layout')}
|
|
139
147
|
</label>
|
|
140
|
-
<
|
|
141
|
-
id="top-products-layout"
|
|
142
|
-
className="w-full rounded-md border bg-background px-2 py-1 text-sm text-foreground focus-visible:border-ring focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
148
|
+
<Select
|
|
143
149
|
value={hydrated.layout}
|
|
144
|
-
|
|
150
|
+
onValueChange={(value) => onSettingsChange({ ...hydrated, layout: value as 'horizontal' | 'vertical' })}
|
|
145
151
|
>
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
|
|
152
|
+
<SelectTrigger id="top-products-layout" size="sm">
|
|
153
|
+
<SelectValue />
|
|
154
|
+
</SelectTrigger>
|
|
155
|
+
<SelectContent>
|
|
156
|
+
<SelectItem value="horizontal">{t('dashboards.analytics.settings.horizontal', 'Horizontal')}</SelectItem>
|
|
157
|
+
<SelectItem value="vertical">{t('dashboards.analytics.settings.vertical', 'Vertical')}</SelectItem>
|
|
158
|
+
</SelectContent>
|
|
159
|
+
</Select>
|
|
149
160
|
</div>
|
|
150
161
|
</div>
|
|
151
162
|
)
|
|
@@ -13,6 +13,13 @@ import { Button } from '@open-mercato/ui/primitives/button'
|
|
|
13
13
|
import { Input } from '@open-mercato/ui/primitives/input'
|
|
14
14
|
import { Label } from '@open-mercato/ui/primitives/label'
|
|
15
15
|
import { Alert, AlertDescription } from '@open-mercato/ui/primitives/alert'
|
|
16
|
+
import {
|
|
17
|
+
Select,
|
|
18
|
+
SelectContent,
|
|
19
|
+
SelectItem,
|
|
20
|
+
SelectTrigger,
|
|
21
|
+
SelectValue,
|
|
22
|
+
} from '@open-mercato/ui/primitives/select'
|
|
16
23
|
import { Separator } from '@open-mercato/ui/primitives/separator'
|
|
17
24
|
import { Switch } from '@open-mercato/ui/primitives/switch'
|
|
18
25
|
import { RowActions } from '@open-mercato/ui/backend/RowActions'
|
|
@@ -676,56 +683,71 @@ export default function SyncRunsDashboardPage() {
|
|
|
676
683
|
<PlugZap className="size-4 text-muted-foreground" />
|
|
677
684
|
<span>{t('data_sync.dashboard.columns.integration')}</span>
|
|
678
685
|
</Label>
|
|
679
|
-
<
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
onChange={(event) => setSelectedIntegrationId(event.target.value)}
|
|
686
|
+
<Select
|
|
687
|
+
value={selectedIntegrationId || undefined}
|
|
688
|
+
onValueChange={(value) => setSelectedIntegrationId(value ?? '')}
|
|
683
689
|
disabled={isLoadingOptions || options.length === 0}
|
|
684
690
|
>
|
|
685
|
-
|
|
686
|
-
<
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
691
|
+
<SelectTrigger size="lg">
|
|
692
|
+
<SelectValue
|
|
693
|
+
placeholder={
|
|
694
|
+
options.length === 0
|
|
695
|
+
? t('integrations.marketplace.noResults', 'No integrations found')
|
|
696
|
+
: undefined
|
|
697
|
+
}
|
|
698
|
+
/>
|
|
699
|
+
</SelectTrigger>
|
|
700
|
+
<SelectContent>
|
|
701
|
+
{options.map((item) => (
|
|
702
|
+
<SelectItem key={item.integrationId} value={item.integrationId}>
|
|
703
|
+
{item.title}
|
|
704
|
+
</SelectItem>
|
|
705
|
+
))}
|
|
706
|
+
</SelectContent>
|
|
707
|
+
</Select>
|
|
694
708
|
</div>
|
|
695
709
|
<div className="space-y-2">
|
|
696
710
|
<Label className="flex items-center gap-2 text-sm font-medium">
|
|
697
711
|
<Boxes className="size-4 text-muted-foreground" />
|
|
698
712
|
<span>{t('data_sync.dashboard.columns.entityType')}</span>
|
|
699
713
|
</Label>
|
|
700
|
-
<
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
onChange={(event) => setSelectedEntityType(event.target.value)}
|
|
714
|
+
<Select
|
|
715
|
+
value={selectedEntityType || undefined}
|
|
716
|
+
onValueChange={(value) => setSelectedEntityType(value ?? '')}
|
|
704
717
|
disabled={entityOptions.length === 0}
|
|
705
718
|
>
|
|
706
|
-
|
|
707
|
-
<
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
719
|
+
<SelectTrigger size="lg">
|
|
720
|
+
<SelectValue />
|
|
721
|
+
</SelectTrigger>
|
|
722
|
+
<SelectContent>
|
|
723
|
+
{entityOptions.map((entityType) => (
|
|
724
|
+
<SelectItem key={entityType} value={entityType}>
|
|
725
|
+
{formatEntityTypeLabel(entityType)}
|
|
726
|
+
</SelectItem>
|
|
727
|
+
))}
|
|
728
|
+
</SelectContent>
|
|
729
|
+
</Select>
|
|
712
730
|
</div>
|
|
713
731
|
<div className="space-y-2">
|
|
714
732
|
<Label className="flex items-center gap-2 text-sm font-medium">
|
|
715
733
|
<ArrowRightLeft className="size-4 text-muted-foreground" />
|
|
716
734
|
<span>{t('data_sync.dashboard.columns.direction')}</span>
|
|
717
735
|
</Label>
|
|
718
|
-
<
|
|
719
|
-
className="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"
|
|
736
|
+
<Select
|
|
720
737
|
value={selectedDirection}
|
|
721
|
-
|
|
738
|
+
onValueChange={(value) => setSelectedDirection(value === 'export' ? 'export' : 'import')}
|
|
722
739
|
disabled={selectedIntegration?.direction !== 'bidirectional'}
|
|
723
740
|
>
|
|
724
|
-
<
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
741
|
+
<SelectTrigger size="lg">
|
|
742
|
+
<SelectValue />
|
|
743
|
+
</SelectTrigger>
|
|
744
|
+
<SelectContent>
|
|
745
|
+
<SelectItem value="import">{t('data_sync.dashboard.direction.import')}</SelectItem>
|
|
746
|
+
{(selectedIntegration?.direction === 'bidirectional' || selectedIntegration?.direction === 'export') ? (
|
|
747
|
+
<SelectItem value="export">{t('data_sync.dashboard.direction.export')}</SelectItem>
|
|
748
|
+
) : null}
|
|
749
|
+
</SelectContent>
|
|
750
|
+
</Select>
|
|
729
751
|
</div>
|
|
730
752
|
</div>
|
|
731
753
|
|
|
@@ -818,17 +840,21 @@ export default function SyncRunsDashboardPage() {
|
|
|
818
840
|
<Clock3 className="size-4 text-muted-foreground" />
|
|
819
841
|
<span>{t('data_sync.dashboard.schedule.type', 'Schedule type')}</span>
|
|
820
842
|
</Label>
|
|
821
|
-
<
|
|
822
|
-
className="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"
|
|
843
|
+
<Select
|
|
823
844
|
value={scheduleEditor.scheduleType}
|
|
824
|
-
|
|
825
|
-
scheduleType:
|
|
845
|
+
onValueChange={(value) => updateScheduleEditor({
|
|
846
|
+
scheduleType: value === 'cron' ? 'cron' : 'interval',
|
|
826
847
|
})}
|
|
827
848
|
disabled={isLoadingSchedule || isSavingSchedule || isDeletingSchedule || !selectedIntegration || !selectedEntityType}
|
|
828
849
|
>
|
|
829
|
-
<
|
|
830
|
-
|
|
831
|
-
|
|
850
|
+
<SelectTrigger size="lg">
|
|
851
|
+
<SelectValue />
|
|
852
|
+
</SelectTrigger>
|
|
853
|
+
<SelectContent>
|
|
854
|
+
<SelectItem value="interval">{t('data_sync.dashboard.schedule.interval', 'Interval')}</SelectItem>
|
|
855
|
+
<SelectItem value="cron">{t('data_sync.dashboard.schedule.cron', 'Cron')}</SelectItem>
|
|
856
|
+
</SelectContent>
|
|
857
|
+
</Select>
|
|
832
858
|
</div>
|
|
833
859
|
<div className="space-y-2">
|
|
834
860
|
<Label className="flex items-center gap-2 text-sm font-medium">
|
|
@@ -8,6 +8,13 @@ import { Button } from '@open-mercato/ui/primitives/button'
|
|
|
8
8
|
import { Input } from '@open-mercato/ui/primitives/input'
|
|
9
9
|
import { Label } from '@open-mercato/ui/primitives/label'
|
|
10
10
|
import { Alert, AlertDescription } from '@open-mercato/ui/primitives/alert'
|
|
11
|
+
import {
|
|
12
|
+
Select,
|
|
13
|
+
SelectContent,
|
|
14
|
+
SelectItem,
|
|
15
|
+
SelectTrigger,
|
|
16
|
+
SelectValue,
|
|
17
|
+
} from '@open-mercato/ui/primitives/select'
|
|
11
18
|
import { Spinner } from '@open-mercato/ui/primitives/spinner'
|
|
12
19
|
import { useOrganizationScopeVersion } from '@open-mercato/shared/lib/frontend/useOrganizationScope'
|
|
13
20
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
@@ -396,17 +403,21 @@ export function IntegrationScheduleTab(props: IntegrationScheduleTabProps) {
|
|
|
396
403
|
<td className="px-3 py-3 font-medium">{formatEntityTypeLabel(row.entityType)}</td>
|
|
397
404
|
<td className="px-3 py-3">{t(`data_sync.dashboard.direction.${row.direction}`, row.direction === 'import' ? 'Import' : 'Export')}</td>
|
|
398
405
|
<td className="px-3 py-3">
|
|
399
|
-
<
|
|
400
|
-
className="flex h-10 w-full min-w-32 rounded-md border border-input bg-background px-3 py-2 text-sm"
|
|
406
|
+
<Select
|
|
401
407
|
value={scheduleState.scheduleType}
|
|
402
|
-
|
|
403
|
-
scheduleType:
|
|
408
|
+
onValueChange={(value) => updateScheduleEditor(row.key, {
|
|
409
|
+
scheduleType: value === 'cron' ? 'cron' : 'interval',
|
|
404
410
|
}, row.entityType)}
|
|
405
411
|
disabled={controlsDisabled}
|
|
406
412
|
>
|
|
407
|
-
<
|
|
408
|
-
|
|
409
|
-
|
|
413
|
+
<SelectTrigger size="lg" className="min-w-32">
|
|
414
|
+
<SelectValue />
|
|
415
|
+
</SelectTrigger>
|
|
416
|
+
<SelectContent>
|
|
417
|
+
<SelectItem value="interval">{t('data_sync.dashboard.schedule.interval', 'Interval')}</SelectItem>
|
|
418
|
+
<SelectItem value="cron">{t('data_sync.dashboard.schedule.cron', 'Cron')}</SelectItem>
|
|
419
|
+
</SelectContent>
|
|
420
|
+
</Select>
|
|
410
421
|
</td>
|
|
411
422
|
<td className="px-3 py-3">
|
|
412
423
|
<Input
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import { Ellipsis } from 'lucide-react'
|
|
5
5
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
6
|
+
import { Input } from '@open-mercato/ui/primitives/input'
|
|
6
7
|
import { ICON_LIBRARY, ICON_SUGGESTIONS, type IconOption, renderDictionaryColor, renderDictionaryIcon } from './dictionaryAppearance'
|
|
7
8
|
|
|
8
9
|
export type AppearanceSelectorLabels = {
|
|
@@ -142,12 +143,12 @@ export function AppearanceSelector({
|
|
|
142
143
|
<label className="text-sm font-medium">{labels.iconLabel}</label>
|
|
143
144
|
<div ref={pickerContainerRef} className="relative">
|
|
144
145
|
<div className="flex gap-2">
|
|
145
|
-
<
|
|
146
|
+
<Input
|
|
146
147
|
type="text"
|
|
147
148
|
value={normalizedIcon}
|
|
148
149
|
onChange={(event) => onIconChange(event.target.value)}
|
|
149
150
|
placeholder={labels.iconPlaceholder}
|
|
150
|
-
className="flex-1
|
|
151
|
+
className="flex-1"
|
|
151
152
|
disabled={disabled}
|
|
152
153
|
/>
|
|
153
154
|
<Button
|
|
@@ -166,14 +167,13 @@ export function AppearanceSelector({
|
|
|
166
167
|
{pickerOpen ? (
|
|
167
168
|
<div className="absolute left-0 right-0 top-full z-dropdown mt-2 rounded-md border border-border bg-popover p-3 shadow-lg">
|
|
168
169
|
<div className="space-y-3">
|
|
169
|
-
<
|
|
170
|
+
<Input
|
|
170
171
|
ref={searchInputRef}
|
|
171
172
|
type="search"
|
|
172
173
|
value={iconSearch}
|
|
173
174
|
onChange={(event) => setIconSearch(event.target.value)}
|
|
174
175
|
placeholder={labels.iconSearchPlaceholder}
|
|
175
176
|
aria-label={labels.iconSearchPlaceholder}
|
|
176
|
-
className="w-full rounded border border-border px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
177
177
|
autoComplete="off"
|
|
178
178
|
/>
|
|
179
179
|
<div className="max-h-64 overflow-y-auto pr-1">
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as React from 'react'
|
|
4
4
|
import { Plus, Pencil, Trash2, RefreshCw, Languages } from 'lucide-react'
|
|
5
5
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
6
|
+
import { Input } from '@open-mercato/ui/primitives/input'
|
|
6
7
|
import {
|
|
7
8
|
Dialog,
|
|
8
9
|
DialogContent,
|
|
@@ -362,7 +363,7 @@ export function DictionaryEntriesEditor({ dictionaryId, dictionaryName, readOnly
|
|
|
362
363
|
{t('dictionaries.config.entries.dialog.valueLabel', 'Value')}
|
|
363
364
|
<span className="ml-1 text-destructive">*</span>
|
|
364
365
|
</label>
|
|
365
|
-
<
|
|
366
|
+
<Input
|
|
366
367
|
type="text"
|
|
367
368
|
value={formState.value}
|
|
368
369
|
onChange={(event) => {
|
|
@@ -372,7 +373,6 @@ export function DictionaryEntriesEditor({ dictionaryId, dictionaryName, readOnly
|
|
|
372
373
|
setErrors((prev) => ({ ...prev, value: undefined }))
|
|
373
374
|
}
|
|
374
375
|
}}
|
|
375
|
-
className={`w-full rounded border px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${errors.value ? 'border-destructive focus-visible:ring-destructive' : ''}`}
|
|
376
376
|
aria-invalid={errors.value ? 'true' : 'false'}
|
|
377
377
|
aria-describedby="dictionary-entry-value-error"
|
|
378
378
|
/>
|
|
@@ -386,12 +386,11 @@ export function DictionaryEntriesEditor({ dictionaryId, dictionaryName, readOnly
|
|
|
386
386
|
<label className="text-sm font-medium">
|
|
387
387
|
{t('dictionaries.config.entries.dialog.labelLabel', 'Label')}
|
|
388
388
|
</label>
|
|
389
|
-
<
|
|
389
|
+
<Input
|
|
390
390
|
type="text"
|
|
391
391
|
value={formState.label}
|
|
392
392
|
onChange={(event) => setFormState((prev) => ({ ...prev, label: event.target.value }))}
|
|
393
393
|
placeholder={t('dictionaries.config.entries.dialog.labelPlaceholder', 'Display name shown in UI')}
|
|
394
|
-
className="w-full rounded border px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
395
394
|
/>
|
|
396
395
|
</div>
|
|
397
396
|
<AppearanceSelector
|
|
@@ -5,6 +5,7 @@ import Link from 'next/link'
|
|
|
5
5
|
import { usePathname, useSearchParams } from 'next/navigation'
|
|
6
6
|
import { Plus, Settings, Save } from 'lucide-react'
|
|
7
7
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
8
|
+
import { Input } from '@open-mercato/ui/primitives/input'
|
|
8
9
|
import {
|
|
9
10
|
Dialog,
|
|
10
11
|
DialogContent,
|
|
@@ -14,6 +15,13 @@ import {
|
|
|
14
15
|
DialogTitle,
|
|
15
16
|
DialogTrigger,
|
|
16
17
|
} from '@open-mercato/ui/primitives/dialog'
|
|
18
|
+
import {
|
|
19
|
+
Select,
|
|
20
|
+
SelectContent,
|
|
21
|
+
SelectItem,
|
|
22
|
+
SelectTrigger,
|
|
23
|
+
SelectValue,
|
|
24
|
+
} from '@open-mercato/ui/primitives/select'
|
|
17
25
|
import { Spinner } from '@open-mercato/ui/primitives/spinner'
|
|
18
26
|
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
19
27
|
import { buildHrefWithReturnTo } from '@open-mercato/shared/lib/navigation/returnTo'
|
|
@@ -233,25 +241,25 @@ export function DictionaryEntrySelect({
|
|
|
233
241
|
return (
|
|
234
242
|
<div className="space-y-2">
|
|
235
243
|
<div className="flex items-center gap-2">
|
|
236
|
-
<
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
selectClassName,
|
|
240
|
-
]
|
|
241
|
-
.filter(Boolean)
|
|
242
|
-
.join(' ')}
|
|
243
|
-
value={value ?? ''}
|
|
244
|
-
onChange={(event) => onChange(event.target.value ? event.target.value : undefined)}
|
|
244
|
+
<Select
|
|
245
|
+
value={value || undefined}
|
|
246
|
+
onValueChange={(next) => onChange(next || undefined)}
|
|
245
247
|
disabled={disabled}
|
|
246
|
-
title={activeOption?.label ?? undefined}
|
|
247
248
|
>
|
|
248
|
-
<
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
249
|
+
<SelectTrigger
|
|
250
|
+
className={selectClassName}
|
|
251
|
+
title={activeOption?.label ?? undefined}
|
|
252
|
+
>
|
|
253
|
+
<SelectValue placeholder={labels.placeholder} />
|
|
254
|
+
</SelectTrigger>
|
|
255
|
+
<SelectContent>
|
|
256
|
+
{options.map((option) => (
|
|
257
|
+
<SelectItem key={option.value} value={option.value}>
|
|
258
|
+
{option.label}
|
|
259
|
+
</SelectItem>
|
|
260
|
+
))}
|
|
261
|
+
</SelectContent>
|
|
262
|
+
</Select>
|
|
255
263
|
<div className="flex items-center gap-1">
|
|
256
264
|
{allowInlineCreate && createOption ? (
|
|
257
265
|
<Dialog open={dialogOpen} onOpenChange={setDialogOpen}>
|
|
@@ -275,9 +283,8 @@ export function DictionaryEntrySelect({
|
|
|
275
283
|
<div className="space-y-4">
|
|
276
284
|
<div className="space-y-2">
|
|
277
285
|
<label className="text-sm font-medium">{labels.valueLabel}</label>
|
|
278
|
-
<
|
|
286
|
+
<Input
|
|
279
287
|
type="text"
|
|
280
|
-
className="w-full rounded border px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
281
288
|
value={newValue}
|
|
282
289
|
onChange={(event) => {
|
|
283
290
|
setNewValue(event.target.value)
|
|
@@ -291,9 +298,8 @@ export function DictionaryEntrySelect({
|
|
|
291
298
|
{showLabelInput ? (
|
|
292
299
|
<div className="space-y-2">
|
|
293
300
|
<label className="text-sm font-medium">{labels.labelLabel}</label>
|
|
294
|
-
<
|
|
301
|
+
<Input
|
|
295
302
|
type="text"
|
|
296
|
-
className="w-full rounded border px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
297
303
|
value={newLabel}
|
|
298
304
|
onChange={(event) => setNewLabel(event.target.value)}
|
|
299
305
|
placeholder={labels.labelPlaceholder}
|