andoncloud-workplaces-status-widget 1.2.16 → 1.2.17
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/assets/thumbnail.svg +25 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/thumbnail-BxaTDsDt.js +6 -0
- package/dist/thumbnail-BxaTDsDt.js.map +1 -0
- package/package.json +14 -14
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 180" fill="none">
|
|
2
|
+
<!-- Card 1 -->
|
|
3
|
+
<rect x="8" y="30" width="96" height="90" rx="6" fill="#1C1F25" stroke="#11BD4C" stroke-width="1.5"/>
|
|
4
|
+
<rect x="8" y="30" width="96" height="4" rx="0" fill="#11BD4C"/>
|
|
5
|
+
<text x="56" y="52" text-anchor="middle" font-size="9" font-weight="600" font-family="Inter, system-ui" fill="#A7ADB6">CNC-01</text>
|
|
6
|
+
<circle cx="56" cy="64" r="4" fill="#11BD4C"/>
|
|
7
|
+
<text x="56" y="92" text-anchor="middle" font-size="22" font-weight="700" font-family="Inter, system-ui" fill="#A7ADB6">2:34</text>
|
|
8
|
+
<rect x="28" y="104" width="56" height="3" rx="1" fill="#A7ADB640"/>
|
|
9
|
+
|
|
10
|
+
<!-- Card 2 -->
|
|
11
|
+
<rect x="112" y="30" width="96" height="90" rx="6" fill="#1C1F25" stroke="#FD2121" stroke-width="1.5"/>
|
|
12
|
+
<rect x="112" y="30" width="96" height="4" rx="0" fill="#FD2121"/>
|
|
13
|
+
<text x="160" y="52" text-anchor="middle" font-size="9" font-weight="600" font-family="Inter, system-ui" fill="#A7ADB6">CNC-02</text>
|
|
14
|
+
<circle cx="160" cy="64" r="4" fill="#FD2121"/>
|
|
15
|
+
<text x="160" y="92" text-anchor="middle" font-size="22" font-weight="700" font-family="Inter, system-ui" fill="#A7ADB6">0:47</text>
|
|
16
|
+
<rect x="132" y="104" width="56" height="3" rx="1" fill="#A7ADB640"/>
|
|
17
|
+
|
|
18
|
+
<!-- Card 3 -->
|
|
19
|
+
<rect x="216" y="30" width="96" height="90" rx="6" fill="#1C1F25" stroke="#11BD4C" stroke-width="1.5"/>
|
|
20
|
+
<rect x="216" y="30" width="96" height="4" rx="0" fill="#11BD4C"/>
|
|
21
|
+
<text x="264" y="52" text-anchor="middle" font-size="9" font-weight="600" font-family="Inter, system-ui" fill="#A7ADB6">WP-03</text>
|
|
22
|
+
<circle cx="264" cy="64" r="4" fill="#11BD4C"/>
|
|
23
|
+
<text x="264" y="92" text-anchor="middle" font-size="22" font-weight="700" font-family="Inter, system-ui" fill="#A7ADB6">5:12</text>
|
|
24
|
+
<rect x="236" y="104" width="56" height="3" rx="1" fill="#A7ADB640"/>
|
|
25
|
+
</svg>
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as thumbnail_default } from "./thumbnail-BxaTDsDt.js";
|
|
1
2
|
import { BaseWidgetData, BaseWidgetSettings, CompanyConfig, FilterValues, ListStatusChanges_StatusChange, ListWorkplaces_Workplace, WidgetProps } from "andoncloud-dashboard-toolkit";
|
|
2
3
|
//#region src/types.d.ts
|
|
3
4
|
interface WidgetViewData {
|
|
@@ -22,12 +23,11 @@ declare const getDisplayName: (lang: string) => string;
|
|
|
22
23
|
declare const getTitle: (data: WidgetData | undefined, settings: WidgetSettings | undefined, _filters: FilterValues | undefined, lang: string) => string;
|
|
23
24
|
//#endregion
|
|
24
25
|
//#region src/version.d.ts
|
|
25
|
-
declare const LIBRARY_VERSION = "1.2.
|
|
26
|
+
declare const LIBRARY_VERSION = "1.2.17";
|
|
26
27
|
//#endregion
|
|
27
28
|
//#region src/index.d.ts
|
|
28
|
-
declare const thumbnail: string | undefined;
|
|
29
29
|
declare const requiredFeatures: string[];
|
|
30
30
|
declare const extraPermissions: string[];
|
|
31
31
|
//#endregion
|
|
32
|
-
export { Widget, extraPermissions, getDisplayName, getTitle, requiredFeatures, thumbnail, LIBRARY_VERSION as version };
|
|
32
|
+
export { Widget, extraPermissions, getDisplayName, getTitle, requiredFeatures, thumbnail_default as thumbnail, LIBRARY_VERSION as version };
|
|
33
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as thumbnail_default } from "./thumbnail-BxaTDsDt.js";
|
|
1
2
|
import { Checkbox, registerTranslations } from "andoncloud-sdk";
|
|
2
3
|
import { useEffect, useMemo, useState } from "react";
|
|
3
4
|
import { AndonLightColor, MetricCard, MetricTypeEnum, MetricUnitEnum, Period, SortableSelect, WorkplaceEvent, WorkplaceEventDocument, useGqlClients } from "andoncloud-dashboard-toolkit";
|
|
@@ -61,7 +62,7 @@ const resources = {
|
|
|
61
62
|
};
|
|
62
63
|
//#endregion
|
|
63
64
|
//#region src/version.ts
|
|
64
|
-
const LIBRARY_VERSION = "1.2.
|
|
65
|
+
const LIBRARY_VERSION = "1.2.17";
|
|
65
66
|
//#endregion
|
|
66
67
|
//#region src/components/SettingsFormContent/index.tsx
|
|
67
68
|
const SettingsFormContent = ({ data, formProps }) => {
|
|
@@ -358,10 +359,9 @@ const getTitle = (data, settings, _filters, lang) => {
|
|
|
358
359
|
//#endregion
|
|
359
360
|
//#region src/index.tsx
|
|
360
361
|
registerTranslations(resources);
|
|
361
|
-
const thumbnail = void 0;
|
|
362
362
|
const requiredFeatures = ["feature.workplaces-status-widget"];
|
|
363
363
|
const extraPermissions = [];
|
|
364
364
|
//#endregion
|
|
365
|
-
export { Widget, extraPermissions, getDisplayName, getTitle, requiredFeatures, thumbnail, LIBRARY_VERSION as version };
|
|
365
|
+
export { Widget, extraPermissions, getDisplayName, getTitle, requiredFeatures, thumbnail_default as thumbnail, LIBRARY_VERSION as version };
|
|
366
366
|
|
|
367
367
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["en","pl","locales","locales"],"sources":["../src/locales/en/translation.json","../src/locales/pl/translation.json","../src/locales/index.ts","../src/version.ts","../src/components/SettingsFormContent/index.tsx","../src/components/StatusCard/helpers.ts","../src/components/StatusCard/index.tsx","../src/components/WidgetView/index.tsx","../src/components/Widget/utils.ts","../src/components/Widget/index.tsx","../src/core/title.ts","../src/index.tsx"],"sourcesContent":["","","import en from './en/translation.json';\nimport pl from './pl/translation.json';\n\nconst resources = {\n en: {\n translation: en,\n },\n pl: {\n translation: pl,\n },\n};\n\nexport default resources;\n","export const LIBRARY_VERSION = '1.2.16';\n","import { useMemo, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { TabContext, TabList, TabPanel } from '@mui/lab';\nimport { List, ListItem, ListItemButton, ListItemIcon, ListItemText, Tab, TextField } from '@mui/material';\nimport { SortableSelect } from 'andoncloud-dashboard-toolkit';\nimport { Checkbox } from 'andoncloud-sdk';\nimport { SettingsFormContentProps } from 'andoncloud-widget-base';\n\nimport { WidgetData, WidgetSettings } from '@/types';\n\nconst SettingsFormContent: React.FC<SettingsFormContentProps<WidgetData, WidgetSettings>> = ({ data, formProps }) => {\n // -- Local state --\n const [selectedTab, setSelectedTab] = useState('statuses');\n\n // -- Translation --\n const { t } = useTranslation();\n\n const statusOptions = useMemo(\n () => [\n { label: t('workplacesStatusWidget.green'), value: 'green' },\n { label: t('workplacesStatusWidget.yellow'), value: 'yellow' },\n { label: t('workplacesStatusWidget.red'), value: 'red' },\n { label: t('workplacesStatusWidget.gray'), value: 'gray' },\n ],\n [t],\n );\n\n const handleToggleWorkplaceSelected = (workplaceId: string) => {\n const selectedWorkplacesIds = formProps.values.workplacesIds || [];\n\n if (selectedWorkplacesIds.indexOf(workplaceId) !== -1) {\n formProps.setFieldValue(\n 'workplacesIds',\n selectedWorkplacesIds.filter((id) => id !== workplaceId),\n );\n } else {\n formProps.setFieldValue('workplacesIds', [...selectedWorkplacesIds, workplaceId]);\n }\n };\n\n return (\n <TabContext value={selectedTab}>\n <TabList onChange={(_, value) => setSelectedTab(value)} centered>\n <Tab label={t('workplacesStatusWidget.statuses')} value=\"statuses\" />\n <Tab label={t('workplacesStatusWidget.workplaces')} value=\"workplaces\" />\n <Tab label={t('workplacesStatusWidget.advanced')} value=\"advanced\" />\n </TabList>\n\n <TabPanel value=\"statuses\">\n <SortableSelect\n placeholder={`${t('workplacesStatusWidget.selectAndArrangeTheOrder')}...`}\n options={statusOptions}\n selected={formProps.values.statusColors || []}\n onChange={(selected) => formProps.setFieldValue('statusColors', [...selected])}\n />\n </TabPanel>\n\n <TabPanel value=\"workplaces\">\n <List sx={{ maxHeight: '500px', overflowY: 'scroll' }}>\n {data.workplaces?.map((workplace) => (\n <ListItem key={workplace.id}>\n <ListItemButton role={undefined} onClick={() => handleToggleWorkplaceSelected(workplace.id)} dense>\n <ListItemIcon>\n <Checkbox checked={(formProps.values.workplacesIds || []).indexOf(workplace.id) !== -1} />\n </ListItemIcon>\n <ListItemText id={workplace.id} primary={workplace.name} />\n </ListItemButton>\n </ListItem>\n ))}\n </List>\n </TabPanel>\n\n <TabPanel value=\"advanced\">\n <TextField\n name=\"customTitle\"\n label={t('workplacesStatusWidget.customTitle')}\n value={formProps.values.customTitle}\n onChange={formProps.handleChange}\n fullWidth\n />\n </TabPanel>\n </TabContext>\n );\n};\n\nexport default SettingsFormContent;\n","import { ListStatusChanges_StatusChange } from 'andoncloud-dashboard-toolkit';\nimport dayjs from 'dayjs';\n\nexport const getDuration = (statusChange: ListStatusChanges_StatusChange) => {\n if (statusChange.finishedAt && statusChange.startedAt) {\n return Math.abs(dayjs(statusChange.startedAt).diff(dayjs(statusChange.finishedAt), 'seconds'));\n }\n return Math.abs(dayjs().diff(dayjs(statusChange.startedAt), 'seconds'));\n};\n","import { useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { AndonLightColor, MetricCard, MetricTypeEnum, MetricUnitEnum, MetricValue } from 'andoncloud-dashboard-toolkit';\n\nimport { WorkplaceStatusProps } from '@/types';\n\nimport { getDuration } from './helpers';\n\nconst StatusCard: React.FC<WorkplaceStatusProps> = ({ companyConfig, workplace, statusChange }) => {\n const [metricValue, setMetricValue] = useState<MetricValue>({\n id: `last_status_change_${workplace.id}`,\n workplaceId: workplace.id,\n metricId: 'last_status_change',\n type: MetricTypeEnum.Kpi,\n statusColor: statusChange?.reason.statusColor || AndonLightColor.Gray,\n textValue: statusChange ? getDuration(statusChange).toString() : '0',\n unit: MetricUnitEnum.Duration,\n active: true,\n });\n const { t } = useTranslation();\n\n const workplaceConfig = companyConfig?.workplacesConfigs.find((config) => config.workplaceId === workplace.id);\n const orderLabel = !!workplaceConfig?.orderConfig.alternativeName ? t('workplacesStatusWidget.alternativeOrder') : t('workplacesStatusWidget.order');\n const orderNumber = statusChange?.order?.number;\n\n useEffect(() => {\n let interval: NodeJS.Timeout;\n\n if (statusChange) {\n setMetricValue((metric) => ({\n ...metric,\n statusColor: statusChange.reason.statusColor,\n textValue: getDuration(statusChange).toString(),\n }));\n\n if (!statusChange.finishedAt) {\n interval = setInterval(() => {\n setMetricValue((metric) => ({\n ...metric,\n statusColor: statusChange.reason.statusColor,\n textValue: getDuration(statusChange).toString(),\n }));\n }, 10_000);\n }\n }\n return () => {\n if (interval) clearInterval(interval);\n };\n }, [statusChange]);\n\n return (\n <MetricCard\n title={workplace.name}\n metricLabel={statusChange?.reason.name || ''}\n metricValue={metricValue}\n extraValue={`${orderLabel}: ${orderNumber || '-'}`}\n animateBackgroundColor={statusChange?.reason.temporary}\n rounded\n />\n );\n};\n\nexport default StatusCard;\n","import { useEffect, useState } from 'react';\n\nimport { List, ListItem } from '@mui/material';\nimport type { ListStatusChanges_StatusChange, ListWorkplaces_Workplace, Workplace } from 'andoncloud-dashboard-toolkit';\n\nimport { WidgetViewProps } from '@/types';\n\nimport StatusCard from '../StatusCard';\n\ninterface WorkplaceDetails {\n workplace: ListWorkplaces_Workplace;\n statusChange?: ListStatusChanges_StatusChange;\n}\n\nconst WidgetView: React.FC<WidgetViewProps> = ({ data, settings }) => {\n const [workplacesDetails, setWorkplacesDetails] = useState<WorkplaceDetails[]>([]);\n\n useEffect(() => {\n const workplacesIds = settings?.workplacesIds || [];\n const statusColors = settings?.statusColors || [];\n const getCurrentStatusChange = (workplace: Workplace) =>\n (data?.statusChanges || [])\n .filter((statusChange) => statusChange.workplaceId === workplace.id)\n .sort((a, b) => new Date(a.startedAt).getTime() - new Date(b.startedAt).getTime())\n .pop();\n\n setWorkplacesDetails(\n (data.workplaces || [])\n .filter((workplace) => !workplacesIds.length || workplacesIds.indexOf(workplace.id) !== -1)\n .map((workplace) => ({ workplace, statusChange: getCurrentStatusChange(workplace) }))\n .filter(\n (details) =>\n !statusColors.length || statusColors.indexOf(details.statusChange?.reason.statusColor || '') !== -1,\n )\n .sort((a, b) => {\n const aStatusColor = a.statusChange?.reason.statusColor;\n const bStatusColor = b.statusChange?.reason.statusColor;\n\n if (aStatusColor && bStatusColor) {\n return statusColors.indexOf(aStatusColor) - statusColors.indexOf(bStatusColor);\n }\n return aStatusColor ? -1 : 1;\n }),\n );\n }, [data, settings]);\n\n return (\n <List sx={{ display: 'flex', height: '100%', '&:last-child': { marginRight: '10px' } }}>\n {workplacesDetails.slice(0, 6).map(({ workplace, statusChange }) => (\n <ListItem key={workplace.id} sx={{ minWidth: '15.5vw', marginLeft: '10px', padding: 0 }}>\n <StatusCard companyConfig={data.companyConfig} workplace={workplace} statusChange={statusChange} />\n </ListItem>\n ))}\n </List>\n );\n};\n\nexport default WidgetView;\n","import { TFunction } from 'i18next';\nimport * as yup from 'yup';\n\nexport const getSettingsFormProps = (t: TFunction) => {\n yup.setLocale({\n mixed: {\n required: t('workplacesStatusWidget.thisFieldIsRequired'),\n },\n });\n return {\n initialValues: {\n customTitle: '',\n statusColors: [],\n workplacesIds: [],\n },\n validationSchema: yup.object({\n statusColors: yup.array().of(yup.string()).required(),\n workplacesIds: yup.array().of(yup.string()).required(),\n }),\n };\n};\n","import { useEffect, useState } from 'react';\n\nimport {\n Period,\n StatusChange,\n useGqlClients,\n WidgetProps,\n WorkplaceEvent,\n WorkplaceEventDocument,\n WorkplaceEventSubscriptionPayload,\n} from 'andoncloud-dashboard-toolkit';\nimport { BaseWidget } from 'andoncloud-widget-base';\nimport { print } from 'graphql';\n\nimport locales from '@/locales';\nimport { WidgetData, WidgetSettings } from '@/types';\nimport { LIBRARY_VERSION } from '@/version';\n\nimport SettingsFormContent from '../SettingsFormContent';\nimport WidgetView from '../WidgetView';\n\nimport { getSettingsFormProps } from './utils';\n\nconst Widget: React.FC<WidgetProps<WidgetData, WidgetSettings>> = ({ url, wsUrl, lang, data, ...widgetProps }) => {\n const { graphqlSdk, gqlWsClient } = useGqlClients({ url, wsUrl, lang });\n const [gqlWsSubscribed, setGqlWsSubscribed] = useState<boolean>(false);\n const [widgetData, setWidgetData] = useState<WidgetData | undefined>(data);\n\n useEffect(() => {\n if (!widgetData && graphqlSdk) {\n graphqlSdk\n .companyConfig()\n .then(({ companyConfig }) =>\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n companyConfig,\n })),\n )\n .catch(() => {});\n\n graphqlSdk\n .listWorkplaces()\n .then(({ workplaces }) =>\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n workplaces,\n })),\n )\n .catch(() => {});\n\n graphqlSdk\n .listStatusChanges({ filter: { period: Period.CurrentShift } })\n .then(({ statusChanges }) =>\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n statusChanges,\n })),\n )\n .catch(() => {});\n }\n if (widgetData?.workplaces && gqlWsClient && !gqlWsSubscribed) {\n widgetData.workplaces.forEach(({ id }) => {\n gqlWsClient.subscribe<WorkplaceEventSubscriptionPayload>(\n print(WorkplaceEventDocument),\n { id },\n ({ event, subject }) => {\n if (event === WorkplaceEvent.StatusChangeCreated) {\n const statusChange = subject as StatusChange;\n\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n statusChanges: [statusChange, ...current.statusChanges],\n }));\n } else if (event === WorkplaceEvent.StatusChangeUpdated) {\n const updatedStatusChange = subject as StatusChange;\n\n setWidgetData((current: WidgetData) => {\n const statusChanges = current.statusChanges.map((statusChange) =>\n statusChange.id === updatedStatusChange.id ? updatedStatusChange : statusChange,\n );\n return {\n ...(current || {}),\n statusChanges,\n };\n });\n } else if (event === WorkplaceEvent.CurrentShiftChanged && graphqlSdk) {\n graphqlSdk\n .listStatusChanges({ filter: { period: Period.CurrentShift } })\n .then(({ statusChanges }) =>\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n statusChanges,\n })),\n )\n .catch(() => {});\n }\n },\n );\n setGqlWsSubscribed(true);\n });\n }\n }, [data, graphqlSdk, gqlWsClient, gqlWsSubscribed, widgetData]);\n\n return (\n <BaseWidget\n {...widgetProps}\n lang={lang}\n locales={locales}\n data={widgetData}\n gqlClients={{ graphqlSdk, gqlWsClient }}\n WidgetView={WidgetView}\n getSettingsFormProps={getSettingsFormProps}\n SettingsFormContent={SettingsFormContent}\n version={LIBRARY_VERSION}\n data-testid=\"workplaces-status-widget\"\n />\n );\n};\n\nexport default Widget;\n","import type { FilterValues } from 'andoncloud-dashboard-toolkit';\nimport i18n from 'i18next';\n\nimport type { WidgetData, WidgetSettings } from '../types';\n\nconst ns = 'workplacesStatusWidget';\n\nconst t = (key: string, lng: string, options?: Record<string, unknown>) => i18n.t(`${ns}.${key}`, { lng, ...options });\n\nexport const getDisplayName = (lang: string) => t('displayName', lang);\n\nexport const getTitle = (\n data: WidgetData | undefined,\n settings: WidgetSettings | undefined,\n _filters: FilterValues | undefined,\n lang: string,\n): string => {\n const name = getDisplayName(lang);\n\n const allWorkplaces = data?.workplaces;\n if (!allWorkplaces?.length) return name;\n\n const selectedIds = settings?.workplacesIds?.length ? new Set(settings.workplacesIds) : null;\n const workplaces = selectedIds ? allWorkplaces.filter((wp) => selectedIds.has(wp.id)) : allWorkplaces;\n if (!workplaces.length) return name;\n\n let green = 0;\n let red = 0;\n for (const wp of workplaces) {\n const color = wp.currentStatusChange?.reason?.statusColor;\n if (color === 'green') green++;\n else if (color === 'red') red++;\n }\n\n const parts = [t('titleWorkplaces', lang, { count: workplaces.length })];\n if (green > 0) parts.push(t('titleGreen', lang, { count: green }));\n if (red > 0) parts.push(t('titleRed', lang, { count: red }));\n\n return `${name} — ${parts.join(', ')}`;\n};\n","import { registerTranslations } from 'andoncloud-sdk';\n\nimport locales from './locales';\n\nregisterTranslations(locales);\n\nexport { default as Widget } from './components/Widget';\nexport { getDisplayName, getTitle } from './core/title';\n\nexport const thumbnail: string | undefined = undefined;\n\nexport const requiredFeatures: string[] = ['feature.workplaces-status-widget'];\nexport const extraPermissions: string[] = [];\n\nexport { LIBRARY_VERSION as version } from './version';\n"],"mappings":";;;;;;;;;;;;;;AEGA,MAAM,YAAY;CAChB,IAAI,EACF;;;;;;;;;;;;;;;;;;;;MACD;CACD,IAAI,EACF;;;;;;;;;;;;;;;;;;;;;;;MACD;CACF;;;ACVD,MAAa,kBAAkB;;;ACW/B,MAAM,uBAAuF,EAAE,MAAM,gBAAgB;CAEnH,MAAM,CAAC,aAAa,kBAAkB,SAAS,WAAW;CAG1D,MAAM,EAAE,MAAM,gBAAgB;CAE9B,MAAM,gBAAgB,cACd;EACJ;GAAE,OAAO,EAAE,+BAA+B;GAAE,OAAO;GAAS;EAC5D;GAAE,OAAO,EAAE,gCAAgC;GAAE,OAAO;GAAU;EAC9D;GAAE,OAAO,EAAE,6BAA6B;GAAE,OAAO;GAAO;EACxD;GAAE,OAAO,EAAE,8BAA8B;GAAE,OAAO;GAAQ;EAC3D,EACD,CAAC,EAAE,CACJ;CAED,MAAM,iCAAiC,gBAAwB;EAC7D,MAAM,wBAAwB,UAAU,OAAO,iBAAiB,EAAE;AAElE,MAAI,sBAAsB,QAAQ,YAAY,KAAK,GACjD,WAAU,cACR,iBACA,sBAAsB,QAAQ,OAAO,OAAO,YAAY,CACzD;MAED,WAAU,cAAc,iBAAiB,CAAC,GAAG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IAAI,GAAG,GAAG,CAAC,GAAG;AACxF,KAAI,CAAC,WAAW,OAAQ,QAAO;CAE/B,IAAI,QAAQ;CACZ,IAAI,MAAM;AACV,MAAK,MAAM,MAAM,YAAY;EAC3B,MAAM,QAAQ,GAAG,qBAAqB,QAAQ;AAC9C,MAAI,UAAU,QAAS;WACd,UAAU,MAAO;;CAG5B,MAAM,QAAQ,CAAC,EAAE,mBAAmB,MAAM,EAAE,OAAO,WAAW,QAAQ,CAAC,CAAC;AACxE,KAAI,QAAQ,EAAG,OAAM,KAAK,EAAE,cAAc,MAAM,EAAE,OAAO,OAAO,CAAC,CAAC;AAClE,KAAI,MAAM,EAAG,OAAM,KAAK,EAAE,YAAY,MAAM,EAAE,OAAO,KAAK,CAAC,CAAC;AAE5D,QAAO,GAAG,KAAK,KAAK,MAAM,KAAK,KAAK;;;;AClCtC,qBAAqBC,UAAQ;AAK7B,MAAa,YAAgC,KAAA;AAE7C,MAAa,mBAA6B,CAAC,mCAAmC;AAC9E,MAAa,mBAA6B,EAAE"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["en","pl","locales","locales"],"sources":["../src/locales/en/translation.json","../src/locales/pl/translation.json","../src/locales/index.ts","../src/version.ts","../src/components/SettingsFormContent/index.tsx","../src/components/StatusCard/helpers.ts","../src/components/StatusCard/index.tsx","../src/components/WidgetView/index.tsx","../src/components/Widget/utils.ts","../src/components/Widget/index.tsx","../src/core/title.ts","../src/index.tsx"],"sourcesContent":["","","import en from './en/translation.json';\nimport pl from './pl/translation.json';\n\nconst resources = {\n en: {\n translation: en,\n },\n pl: {\n translation: pl,\n },\n};\n\nexport default resources;\n","export const LIBRARY_VERSION = '1.2.17';\n","import { useMemo, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { TabContext, TabList, TabPanel } from '@mui/lab';\nimport { List, ListItem, ListItemButton, ListItemIcon, ListItemText, Tab, TextField } from '@mui/material';\nimport { SortableSelect } from 'andoncloud-dashboard-toolkit';\nimport { Checkbox } from 'andoncloud-sdk';\nimport { SettingsFormContentProps } from 'andoncloud-widget-base';\n\nimport { WidgetData, WidgetSettings } from '@/types';\n\nconst SettingsFormContent: React.FC<SettingsFormContentProps<WidgetData, WidgetSettings>> = ({ data, formProps }) => {\n // -- Local state --\n const [selectedTab, setSelectedTab] = useState('statuses');\n\n // -- Translation --\n const { t } = useTranslation();\n\n const statusOptions = useMemo(\n () => [\n { label: t('workplacesStatusWidget.green'), value: 'green' },\n { label: t('workplacesStatusWidget.yellow'), value: 'yellow' },\n { label: t('workplacesStatusWidget.red'), value: 'red' },\n { label: t('workplacesStatusWidget.gray'), value: 'gray' },\n ],\n [t],\n );\n\n const handleToggleWorkplaceSelected = (workplaceId: string) => {\n const selectedWorkplacesIds = formProps.values.workplacesIds || [];\n\n if (selectedWorkplacesIds.indexOf(workplaceId) !== -1) {\n formProps.setFieldValue(\n 'workplacesIds',\n selectedWorkplacesIds.filter((id) => id !== workplaceId),\n );\n } else {\n formProps.setFieldValue('workplacesIds', [...selectedWorkplacesIds, workplaceId]);\n }\n };\n\n return (\n <TabContext value={selectedTab}>\n <TabList onChange={(_, value) => setSelectedTab(value)} centered>\n <Tab label={t('workplacesStatusWidget.statuses')} value=\"statuses\" />\n <Tab label={t('workplacesStatusWidget.workplaces')} value=\"workplaces\" />\n <Tab label={t('workplacesStatusWidget.advanced')} value=\"advanced\" />\n </TabList>\n\n <TabPanel value=\"statuses\">\n <SortableSelect\n placeholder={`${t('workplacesStatusWidget.selectAndArrangeTheOrder')}...`}\n options={statusOptions}\n selected={formProps.values.statusColors || []}\n onChange={(selected) => formProps.setFieldValue('statusColors', [...selected])}\n />\n </TabPanel>\n\n <TabPanel value=\"workplaces\">\n <List sx={{ maxHeight: '500px', overflowY: 'scroll' }}>\n {data.workplaces?.map((workplace) => (\n <ListItem key={workplace.id}>\n <ListItemButton role={undefined} onClick={() => handleToggleWorkplaceSelected(workplace.id)} dense>\n <ListItemIcon>\n <Checkbox checked={(formProps.values.workplacesIds || []).indexOf(workplace.id) !== -1} />\n </ListItemIcon>\n <ListItemText id={workplace.id} primary={workplace.name} />\n </ListItemButton>\n </ListItem>\n ))}\n </List>\n </TabPanel>\n\n <TabPanel value=\"advanced\">\n <TextField\n name=\"customTitle\"\n label={t('workplacesStatusWidget.customTitle')}\n value={formProps.values.customTitle}\n onChange={formProps.handleChange}\n fullWidth\n />\n </TabPanel>\n </TabContext>\n );\n};\n\nexport default SettingsFormContent;\n","import { ListStatusChanges_StatusChange } from 'andoncloud-dashboard-toolkit';\nimport dayjs from 'dayjs';\n\nexport const getDuration = (statusChange: ListStatusChanges_StatusChange) => {\n if (statusChange.finishedAt && statusChange.startedAt) {\n return Math.abs(dayjs(statusChange.startedAt).diff(dayjs(statusChange.finishedAt), 'seconds'));\n }\n return Math.abs(dayjs().diff(dayjs(statusChange.startedAt), 'seconds'));\n};\n","import { useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { AndonLightColor, MetricCard, MetricTypeEnum, MetricUnitEnum, MetricValue } from 'andoncloud-dashboard-toolkit';\n\nimport { WorkplaceStatusProps } from '@/types';\n\nimport { getDuration } from './helpers';\n\nconst StatusCard: React.FC<WorkplaceStatusProps> = ({ companyConfig, workplace, statusChange }) => {\n const [metricValue, setMetricValue] = useState<MetricValue>({\n id: `last_status_change_${workplace.id}`,\n workplaceId: workplace.id,\n metricId: 'last_status_change',\n type: MetricTypeEnum.Kpi,\n statusColor: statusChange?.reason.statusColor || AndonLightColor.Gray,\n textValue: statusChange ? getDuration(statusChange).toString() : '0',\n unit: MetricUnitEnum.Duration,\n active: true,\n });\n const { t } = useTranslation();\n\n const workplaceConfig = companyConfig?.workplacesConfigs.find((config) => config.workplaceId === workplace.id);\n const orderLabel = !!workplaceConfig?.orderConfig.alternativeName ? t('workplacesStatusWidget.alternativeOrder') : t('workplacesStatusWidget.order');\n const orderNumber = statusChange?.order?.number;\n\n useEffect(() => {\n let interval: NodeJS.Timeout;\n\n if (statusChange) {\n setMetricValue((metric) => ({\n ...metric,\n statusColor: statusChange.reason.statusColor,\n textValue: getDuration(statusChange).toString(),\n }));\n\n if (!statusChange.finishedAt) {\n interval = setInterval(() => {\n setMetricValue((metric) => ({\n ...metric,\n statusColor: statusChange.reason.statusColor,\n textValue: getDuration(statusChange).toString(),\n }));\n }, 10_000);\n }\n }\n return () => {\n if (interval) clearInterval(interval);\n };\n }, [statusChange]);\n\n return (\n <MetricCard\n title={workplace.name}\n metricLabel={statusChange?.reason.name || ''}\n metricValue={metricValue}\n extraValue={`${orderLabel}: ${orderNumber || '-'}`}\n animateBackgroundColor={statusChange?.reason.temporary}\n rounded\n />\n );\n};\n\nexport default StatusCard;\n","import { useEffect, useState } from 'react';\n\nimport { List, ListItem } from '@mui/material';\nimport type { ListStatusChanges_StatusChange, ListWorkplaces_Workplace, Workplace } from 'andoncloud-dashboard-toolkit';\n\nimport { WidgetViewProps } from '@/types';\n\nimport StatusCard from '../StatusCard';\n\ninterface WorkplaceDetails {\n workplace: ListWorkplaces_Workplace;\n statusChange?: ListStatusChanges_StatusChange;\n}\n\nconst WidgetView: React.FC<WidgetViewProps> = ({ data, settings }) => {\n const [workplacesDetails, setWorkplacesDetails] = useState<WorkplaceDetails[]>([]);\n\n useEffect(() => {\n const workplacesIds = settings?.workplacesIds || [];\n const statusColors = settings?.statusColors || [];\n const getCurrentStatusChange = (workplace: Workplace) =>\n (data?.statusChanges || [])\n .filter((statusChange) => statusChange.workplaceId === workplace.id)\n .sort((a, b) => new Date(a.startedAt).getTime() - new Date(b.startedAt).getTime())\n .pop();\n\n setWorkplacesDetails(\n (data.workplaces || [])\n .filter((workplace) => !workplacesIds.length || workplacesIds.indexOf(workplace.id) !== -1)\n .map((workplace) => ({ workplace, statusChange: getCurrentStatusChange(workplace) }))\n .filter(\n (details) =>\n !statusColors.length || statusColors.indexOf(details.statusChange?.reason.statusColor || '') !== -1,\n )\n .sort((a, b) => {\n const aStatusColor = a.statusChange?.reason.statusColor;\n const bStatusColor = b.statusChange?.reason.statusColor;\n\n if (aStatusColor && bStatusColor) {\n return statusColors.indexOf(aStatusColor) - statusColors.indexOf(bStatusColor);\n }\n return aStatusColor ? -1 : 1;\n }),\n );\n }, [data, settings]);\n\n return (\n <List sx={{ display: 'flex', height: '100%', '&:last-child': { marginRight: '10px' } }}>\n {workplacesDetails.slice(0, 6).map(({ workplace, statusChange }) => (\n <ListItem key={workplace.id} sx={{ minWidth: '15.5vw', marginLeft: '10px', padding: 0 }}>\n <StatusCard companyConfig={data.companyConfig} workplace={workplace} statusChange={statusChange} />\n </ListItem>\n ))}\n </List>\n );\n};\n\nexport default WidgetView;\n","import { TFunction } from 'i18next';\nimport * as yup from 'yup';\n\nexport const getSettingsFormProps = (t: TFunction) => {\n yup.setLocale({\n mixed: {\n required: t('workplacesStatusWidget.thisFieldIsRequired'),\n },\n });\n return {\n initialValues: {\n customTitle: '',\n statusColors: [],\n workplacesIds: [],\n },\n validationSchema: yup.object({\n statusColors: yup.array().of(yup.string()).required(),\n workplacesIds: yup.array().of(yup.string()).required(),\n }),\n };\n};\n","import { useEffect, useState } from 'react';\n\nimport {\n Period,\n StatusChange,\n useGqlClients,\n WidgetProps,\n WorkplaceEvent,\n WorkplaceEventDocument,\n WorkplaceEventSubscriptionPayload,\n} from 'andoncloud-dashboard-toolkit';\nimport { BaseWidget } from 'andoncloud-widget-base';\nimport { print } from 'graphql';\n\nimport locales from '@/locales';\nimport { WidgetData, WidgetSettings } from '@/types';\nimport { LIBRARY_VERSION } from '@/version';\n\nimport SettingsFormContent from '../SettingsFormContent';\nimport WidgetView from '../WidgetView';\n\nimport { getSettingsFormProps } from './utils';\n\nconst Widget: React.FC<WidgetProps<WidgetData, WidgetSettings>> = ({ url, wsUrl, lang, data, ...widgetProps }) => {\n const { graphqlSdk, gqlWsClient } = useGqlClients({ url, wsUrl, lang });\n const [gqlWsSubscribed, setGqlWsSubscribed] = useState<boolean>(false);\n const [widgetData, setWidgetData] = useState<WidgetData | undefined>(data);\n\n useEffect(() => {\n if (!widgetData && graphqlSdk) {\n graphqlSdk\n .companyConfig()\n .then(({ companyConfig }) =>\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n companyConfig,\n })),\n )\n .catch(() => {});\n\n graphqlSdk\n .listWorkplaces()\n .then(({ workplaces }) =>\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n workplaces,\n })),\n )\n .catch(() => {});\n\n graphqlSdk\n .listStatusChanges({ filter: { period: Period.CurrentShift } })\n .then(({ statusChanges }) =>\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n statusChanges,\n })),\n )\n .catch(() => {});\n }\n if (widgetData?.workplaces && gqlWsClient && !gqlWsSubscribed) {\n widgetData.workplaces.forEach(({ id }) => {\n gqlWsClient.subscribe<WorkplaceEventSubscriptionPayload>(\n print(WorkplaceEventDocument),\n { id },\n ({ event, subject }) => {\n if (event === WorkplaceEvent.StatusChangeCreated) {\n const statusChange = subject as StatusChange;\n\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n statusChanges: [statusChange, ...current.statusChanges],\n }));\n } else if (event === WorkplaceEvent.StatusChangeUpdated) {\n const updatedStatusChange = subject as StatusChange;\n\n setWidgetData((current: WidgetData) => {\n const statusChanges = current.statusChanges.map((statusChange) =>\n statusChange.id === updatedStatusChange.id ? updatedStatusChange : statusChange,\n );\n return {\n ...(current || {}),\n statusChanges,\n };\n });\n } else if (event === WorkplaceEvent.CurrentShiftChanged && graphqlSdk) {\n graphqlSdk\n .listStatusChanges({ filter: { period: Period.CurrentShift } })\n .then(({ statusChanges }) =>\n setWidgetData((current: WidgetData) => ({\n ...(current || {}),\n statusChanges,\n })),\n )\n .catch(() => {});\n }\n },\n );\n setGqlWsSubscribed(true);\n });\n }\n }, [data, graphqlSdk, gqlWsClient, gqlWsSubscribed, widgetData]);\n\n return (\n <BaseWidget\n {...widgetProps}\n lang={lang}\n locales={locales}\n data={widgetData}\n gqlClients={{ graphqlSdk, gqlWsClient }}\n WidgetView={WidgetView}\n getSettingsFormProps={getSettingsFormProps}\n SettingsFormContent={SettingsFormContent}\n version={LIBRARY_VERSION}\n data-testid=\"workplaces-status-widget\"\n />\n );\n};\n\nexport default Widget;\n","import type { FilterValues } from 'andoncloud-dashboard-toolkit';\nimport i18n from 'i18next';\n\nimport type { WidgetData, WidgetSettings } from '../types';\n\nconst ns = 'workplacesStatusWidget';\n\nconst t = (key: string, lng: string, options?: Record<string, unknown>) => i18n.t(`${ns}.${key}`, { lng, ...options });\n\nexport const getDisplayName = (lang: string) => t('displayName', lang);\n\nexport const getTitle = (\n data: WidgetData | undefined,\n settings: WidgetSettings | undefined,\n _filters: FilterValues | undefined,\n lang: string,\n): string => {\n const name = getDisplayName(lang);\n\n const allWorkplaces = data?.workplaces;\n if (!allWorkplaces?.length) return name;\n\n const selectedIds = settings?.workplacesIds?.length ? new Set(settings.workplacesIds) : null;\n const workplaces = selectedIds ? allWorkplaces.filter((wp) => selectedIds.has(wp.id)) : allWorkplaces;\n if (!workplaces.length) return name;\n\n let green = 0;\n let red = 0;\n for (const wp of workplaces) {\n const color = wp.currentStatusChange?.reason?.statusColor;\n if (color === 'green') green++;\n else if (color === 'red') red++;\n }\n\n const parts = [t('titleWorkplaces', lang, { count: workplaces.length })];\n if (green > 0) parts.push(t('titleGreen', lang, { count: green }));\n if (red > 0) parts.push(t('titleRed', lang, { count: red }));\n\n return `${name} — ${parts.join(', ')}`;\n};\n","import { registerTranslations } from 'andoncloud-sdk';\n\nimport locales from './locales';\n\nregisterTranslations(locales);\n\nexport { default as Widget } from './components/Widget';\nexport { getDisplayName, getTitle } from './core/title';\n\nexport { default as thumbnail } from './assets/thumbnail.svg';\n\nexport const requiredFeatures: string[] = ['feature.workplaces-status-widget'];\nexport const extraPermissions: string[] = [];\n\nexport { LIBRARY_VERSION as version } from './version';\n"],"mappings":";;;;;;;;;;;;;;;AEGA,MAAM,YAAY;CAChB,IAAI,EACF;;;;;;;;;;;;;;;;;;;;MACD;CACD,IAAI,EACF;;;;;;;;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AAmC;AAC9E,MAAa,mBAA6B,EAAE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/assets/thumbnail.svg
|
|
2
|
+
var thumbnail_default = "data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 180\" fill=\"none\">%0A <!-- Card 1 -->%0A <rect x=\"8\" y=\"30\" width=\"96\" height=\"90\" rx=\"6\" fill=\"%231C1F25\" stroke=\"%2311BD4C\" stroke-width=\"1.5\"/>%0A <rect x=\"8\" y=\"30\" width=\"96\" height=\"4\" rx=\"0\" fill=\"%2311BD4C\"/>%0A <text x=\"56\" y=\"52\" text-anchor=\"middle\" font-size=\"9\" font-weight=\"600\" font-family=\"Inter, system-ui\" fill=\"%23A7ADB6\">CNC-01</text>%0A <circle cx=\"56\" cy=\"64\" r=\"4\" fill=\"%2311BD4C\"/>%0A <text x=\"56\" y=\"92\" text-anchor=\"middle\" font-size=\"22\" font-weight=\"700\" font-family=\"Inter, system-ui\" fill=\"%23A7ADB6\">2:34</text>%0A <rect x=\"28\" y=\"104\" width=\"56\" height=\"3\" rx=\"1\" fill=\"%23A7ADB640\"/>%0A%0A <!-- Card 2 -->%0A <rect x=\"112\" y=\"30\" width=\"96\" height=\"90\" rx=\"6\" fill=\"%231C1F25\" stroke=\"%23FD2121\" stroke-width=\"1.5\"/>%0A <rect x=\"112\" y=\"30\" width=\"96\" height=\"4\" rx=\"0\" fill=\"%23FD2121\"/>%0A <text x=\"160\" y=\"52\" text-anchor=\"middle\" font-size=\"9\" font-weight=\"600\" font-family=\"Inter, system-ui\" fill=\"%23A7ADB6\">CNC-02</text>%0A <circle cx=\"160\" cy=\"64\" r=\"4\" fill=\"%23FD2121\"/>%0A <text x=\"160\" y=\"92\" text-anchor=\"middle\" font-size=\"22\" font-weight=\"700\" font-family=\"Inter, system-ui\" fill=\"%23A7ADB6\">0:47</text>%0A <rect x=\"132\" y=\"104\" width=\"56\" height=\"3\" rx=\"1\" fill=\"%23A7ADB640\"/>%0A%0A <!-- Card 3 -->%0A <rect x=\"216\" y=\"30\" width=\"96\" height=\"90\" rx=\"6\" fill=\"%231C1F25\" stroke=\"%2311BD4C\" stroke-width=\"1.5\"/>%0A <rect x=\"216\" y=\"30\" width=\"96\" height=\"4\" rx=\"0\" fill=\"%2311BD4C\"/>%0A <text x=\"264\" y=\"52\" text-anchor=\"middle\" font-size=\"9\" font-weight=\"600\" font-family=\"Inter, system-ui\" fill=\"%23A7ADB6\">WP-03</text>%0A <circle cx=\"264\" cy=\"64\" r=\"4\" fill=\"%2311BD4C\"/>%0A <text x=\"264\" y=\"92\" text-anchor=\"middle\" font-size=\"22\" font-weight=\"700\" font-family=\"Inter, system-ui\" fill=\"%23A7ADB6\">5:12</text>%0A <rect x=\"236\" y=\"104\" width=\"56\" height=\"3\" rx=\"1\" fill=\"%23A7ADB640\"/>%0A</svg>%0A";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { thumbnail_default as t };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=thumbnail-BxaTDsDt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thumbnail-BxaTDsDt.js","names":[],"sources":["../src/assets/thumbnail.svg"],"sourcesContent":["\"data:image/svg+xml,<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 320 180\\\" fill=\\\"none\\\">%0A <!-- Card 1 -->%0A <rect x=\\\"8\\\" y=\\\"30\\\" width=\\\"96\\\" height=\\\"90\\\" rx=\\\"6\\\" fill=\\\"%231C1F25\\\" stroke=\\\"%2311BD4C\\\" stroke-width=\\\"1.5\\\"/>%0A <rect x=\\\"8\\\" y=\\\"30\\\" width=\\\"96\\\" height=\\\"4\\\" rx=\\\"0\\\" fill=\\\"%2311BD4C\\\"/>%0A <text x=\\\"56\\\" y=\\\"52\\\" text-anchor=\\\"middle\\\" font-size=\\\"9\\\" font-weight=\\\"600\\\" font-family=\\\"Inter, system-ui\\\" fill=\\\"%23A7ADB6\\\">CNC-01</text>%0A <circle cx=\\\"56\\\" cy=\\\"64\\\" r=\\\"4\\\" fill=\\\"%2311BD4C\\\"/>%0A <text x=\\\"56\\\" y=\\\"92\\\" text-anchor=\\\"middle\\\" font-size=\\\"22\\\" font-weight=\\\"700\\\" font-family=\\\"Inter, system-ui\\\" fill=\\\"%23A7ADB6\\\">2:34</text>%0A <rect x=\\\"28\\\" y=\\\"104\\\" width=\\\"56\\\" height=\\\"3\\\" rx=\\\"1\\\" fill=\\\"%23A7ADB640\\\"/>%0A%0A <!-- Card 2 -->%0A <rect x=\\\"112\\\" y=\\\"30\\\" width=\\\"96\\\" height=\\\"90\\\" rx=\\\"6\\\" fill=\\\"%231C1F25\\\" stroke=\\\"%23FD2121\\\" stroke-width=\\\"1.5\\\"/>%0A <rect x=\\\"112\\\" y=\\\"30\\\" width=\\\"96\\\" height=\\\"4\\\" rx=\\\"0\\\" fill=\\\"%23FD2121\\\"/>%0A <text x=\\\"160\\\" y=\\\"52\\\" text-anchor=\\\"middle\\\" font-size=\\\"9\\\" font-weight=\\\"600\\\" font-family=\\\"Inter, system-ui\\\" fill=\\\"%23A7ADB6\\\">CNC-02</text>%0A <circle cx=\\\"160\\\" cy=\\\"64\\\" r=\\\"4\\\" fill=\\\"%23FD2121\\\"/>%0A <text x=\\\"160\\\" y=\\\"92\\\" text-anchor=\\\"middle\\\" font-size=\\\"22\\\" font-weight=\\\"700\\\" font-family=\\\"Inter, system-ui\\\" fill=\\\"%23A7ADB6\\\">0:47</text>%0A <rect x=\\\"132\\\" y=\\\"104\\\" width=\\\"56\\\" height=\\\"3\\\" rx=\\\"1\\\" fill=\\\"%23A7ADB640\\\"/>%0A%0A <!-- Card 3 -->%0A <rect x=\\\"216\\\" y=\\\"30\\\" width=\\\"96\\\" height=\\\"90\\\" rx=\\\"6\\\" fill=\\\"%231C1F25\\\" stroke=\\\"%2311BD4C\\\" stroke-width=\\\"1.5\\\"/>%0A <rect x=\\\"216\\\" y=\\\"30\\\" width=\\\"96\\\" height=\\\"4\\\" rx=\\\"0\\\" fill=\\\"%2311BD4C\\\"/>%0A <text x=\\\"264\\\" y=\\\"52\\\" text-anchor=\\\"middle\\\" font-size=\\\"9\\\" font-weight=\\\"600\\\" font-family=\\\"Inter, system-ui\\\" fill=\\\"%23A7ADB6\\\">WP-03</text>%0A <circle cx=\\\"264\\\" cy=\\\"64\\\" r=\\\"4\\\" fill=\\\"%2311BD4C\\\"/>%0A <text x=\\\"264\\\" y=\\\"92\\\" text-anchor=\\\"middle\\\" font-size=\\\"22\\\" font-weight=\\\"700\\\" font-family=\\\"Inter, system-ui\\\" fill=\\\"%23A7ADB6\\\">5:12</text>%0A <rect x=\\\"236\\\" y=\\\"104\\\" width=\\\"56\\\" height=\\\"3\\\" rx=\\\"1\\\" fill=\\\"%23A7ADB640\\\"/>%0A</svg>%0A\""],"mappings":";wBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "andoncloud-workplaces-status-widget",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.17",
|
|
4
4
|
"description": "Made with create-andoncloud-widget",
|
|
5
5
|
"author": "Adrian Olszewski",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"start": "run-p build:watch start:preview",
|
|
19
19
|
"start:preview": "cd preview && npm run start",
|
|
20
20
|
"test": "cypress run --component",
|
|
21
|
-
"update": "ncu --reject graphql-request -u && npm install --ignore-scripts && cd preview && ncu -u && npm install",
|
|
21
|
+
"update": "ncu --reject graphql-request,typescript,@mui/material,@mui/icons-material,@mui/lab,@mui/x-date-pickers -u && npm install --ignore-scripts && cd preview && ncu -u && npm install --ignore-scripts",
|
|
22
22
|
"version:bump": "npm version --no-git-tag-version patch"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
@@ -44,25 +44,25 @@
|
|
|
44
44
|
"@mui/x-date-pickers": "^8.27.2",
|
|
45
45
|
"@types/react": "^19.2.14",
|
|
46
46
|
"ajv": "^8.18.0",
|
|
47
|
-
"andoncloud-dashboard-toolkit": "^1.5.
|
|
47
|
+
"andoncloud-dashboard-toolkit": "^1.5.79",
|
|
48
48
|
"andoncloud-library-scripts": "^2.0.0",
|
|
49
|
-
"andoncloud-sdk": "^1.7.
|
|
50
|
-
"andoncloud-widget-base": "^1.2.
|
|
51
|
-
"cypress": "^15.13.
|
|
49
|
+
"andoncloud-sdk": "^1.7.30",
|
|
50
|
+
"andoncloud-widget-base": "^1.2.30",
|
|
51
|
+
"cypress": "^15.13.1",
|
|
52
52
|
"eslint-config-andoncloud": "^1.1.0",
|
|
53
53
|
"graphql-request": "^6.1.0",
|
|
54
|
-
"i18next": "^26.0.
|
|
54
|
+
"i18next": "^26.0.5",
|
|
55
55
|
"mobx": "^6.15.0",
|
|
56
56
|
"mobx-react-lite": "^4.1.1",
|
|
57
|
-
"npm-check-updates": "^
|
|
57
|
+
"npm-check-updates": "^21.0.0",
|
|
58
58
|
"npm-run-all": "^4.1.5",
|
|
59
|
-
"postcss": "^8.5.
|
|
60
|
-
"react": "^19.2.
|
|
61
|
-
"react-dom": "^19.2.
|
|
62
|
-
"react-i18next": "^17.0.
|
|
63
|
-
"react-router-dom": "^7.
|
|
59
|
+
"postcss": "^8.5.9",
|
|
60
|
+
"react": "^19.2.5",
|
|
61
|
+
"react-dom": "^19.2.5",
|
|
62
|
+
"react-i18next": "^17.0.3",
|
|
63
|
+
"react-router-dom": "^7.14.1",
|
|
64
64
|
"react-scripts": "^5.0.1",
|
|
65
|
-
"tsdown": "^0.21.
|
|
65
|
+
"tsdown": "^0.21.8",
|
|
66
66
|
"typescript": "~5.9.3",
|
|
67
67
|
"webpack-dev-server": "^5.2.3"
|
|
68
68
|
},
|