@milaboratories/uikit 2.2.96 → 2.2.98
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/.turbo/turbo-build.log +21 -21
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +16 -0
- package/dist/components/PlClipboard/PlClipboard.vue.d.ts +1 -1
- package/dist/components/PlElementList/PlElementList.vue.d.ts +19 -27
- package/dist/components/PlElementList/PlElementList.vue.d.ts.map +1 -1
- package/dist/components/PlElementList/PlElementList.vue2.js +155 -174
- package/dist/components/PlElementList/PlElementList.vue2.js.map +1 -1
- package/dist/components/PlElementList/PlElementListItem.vue.d.ts.map +1 -1
- package/dist/components/PlElementList/PlElementListItem.vue2.js +1 -1
- package/dist/components/PlElementList/PlElementListItem.vue2.js.map +1 -1
- package/dist/components/PlElementList/PlElementListItem.vue3.js +24 -24
- package/dist/components/PlElementList/utils.d.ts +0 -1
- package/dist/components/PlElementList/utils.d.ts.map +1 -1
- package/dist/components/PlElementList/utils.js +5 -11
- package/dist/components/PlElementList/utils.js.map +1 -1
- package/dist/components/PlErrorBoundary/PlErrorBoundary.vue.js +8 -8
- package/dist/components/PlFileInput/PlFileInput.vue.js +8 -8
- package/dist/components/PlIcon16/PlIcon16.vue.d.ts +1 -1
- package/dist/components/PlIcon24/PlIcon24.vue.d.ts +1 -1
- package/dist/components/PlSvg/PlSvg.vue.d.ts +1 -1
- package/dist/components/PlSvg/PlSvg.vue.d.ts.map +1 -1
- package/dist/components/PlSvg/PlSvg.vue2.js +24 -22
- package/dist/components/PlSvg/PlSvg.vue2.js.map +1 -1
- package/dist/composition/useWatchFetch.js +10 -10
- package/dist/lib/util/helpers/dist/index.js +108 -104
- package/dist/lib/util/helpers/dist/index.js.map +1 -1
- package/dist/sdk/model/dist/index.js +1 -1
- package/dist/sdk/model/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/PlDropdown/types.ts +1 -1
- package/src/components/PlElementList/PlElementList.vue +116 -135
- package/src/components/PlElementList/PlElementListItem.vue +9 -1
- package/src/components/PlElementList/README.md +325 -72
- package/src/components/PlElementList/utils.ts +0 -9
- package/src/components/PlSvg/PlSvg.vue +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../sdk/model/src/internal.ts","../../../../../../../sdk/model/src/render/util/label.ts","../../../../../../../sdk/model/src/version.ts","../../../../../../../sdk/model/src/raw_globals.ts"],"sourcesContent":["import type { ValueOrErrors } from '@milaboratories/pl-model-common';\nimport {} from './global';\nimport type { Platforma } from './platforma';\nimport type { FutureHandle, GlobalCfgRenderCtx } from './render/internal';\n\n/** Utility code helping to identify whether the code is running in actual UI environment */\nexport function isInUI() {\n return (\n typeof globalThis.getPlatforma !== 'undefined' || typeof globalThis.platforma !== 'undefined'\n );\n}\n\n/** Utility code helping to retrieve a platforma instance form the environment */\nexport function getPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(config?: { sdkVersion: string }): Platforma<Args, Outputs, UiState, Href> {\n if (config && typeof globalThis.getPlatforma === 'function')\n return globalThis.getPlatforma(config);\n else if (typeof globalThis.platforma !== 'undefined') return globalThis.platforma;\n else throw new Error('Can\\'t get platforma instance.');\n}\n\nexport function tryGetCfgRenderCtx(): GlobalCfgRenderCtx | undefined {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else return undefined;\n}\n\nexport function getCfgRenderCtx(): GlobalCfgRenderCtx {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else throw new Error('Not in config rendering context');\n}\n\nexport function tryRegisterCallback(key: string, callback: (...args: any[]) => any): boolean {\n const ctx = tryGetCfgRenderCtx();\n if (ctx === undefined) return false;\n if (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n ctx.callbackRegistry[key] = callback;\n return true;\n}\n\nconst futureResolves = new Map<string, ((value: unknown) => void)[]>();\n\nexport function registerFutureAwait(handle: FutureHandle, onResolve: (value: unknown) => void) {\n if (!(handle in getCfgRenderCtx().callbackRegistry)) {\n getCfgRenderCtx().callbackRegistry[handle] = (value: unknown) => {\n for (const res of futureResolves.get(handle)!) {\n res(value);\n }\n };\n futureResolves.set(handle, []);\n }\n futureResolves.get(handle)!.push(onResolve);\n}\n","import type { PObjectSpec } from '@milaboratories/pl-model-common';\nimport { z } from 'zod';\n\nexport const PAnnotationLabel = 'pl7.app/label';\nexport const PAnnotationTrace = 'pl7.app/trace';\n\nexport type RecordsWithLabel<T> = {\n value: T;\n label: string;\n};\n\nexport type LabelDerivationOps = {\n /** Force inclusion of native column label */\n includeNativeLabel?: boolean;\n /** Separator to use between label parts (\" / \" by default) */\n separator?: string;\n /** If true, label will be added as suffix (at the end of the generated label). By default label added as a prefix. */\n addLabelAsSuffix?: boolean;\n /** Trace elements list that will be forced to be included in the label. */\n forceTraceElements?: string[];\n};\n\nexport const TraceEntry = z.object({\n type: z.string(),\n importance: z.number().optional(),\n id: z.string().optional(),\n label: z.string(),\n});\nexport type TraceEntry = z.infer<typeof TraceEntry>;\ntype FullTraceEntry = TraceEntry & { fullType: string; occurrenceIndex: number };\n\nexport const Trace = z.array(TraceEntry);\nexport type Trace = z.infer<typeof Trace>;\ntype FullTrace = FullTraceEntry[];\n\n// Define the possible return types for the specExtractor function\ntype SpecExtractorResult = PObjectSpec | {\n spec: PObjectSpec;\n prefixTrace?: TraceEntry[];\n suffixTrace?: TraceEntry[];\n};\n\nconst DistancePenalty = 0.001;\n\nconst LabelType = '__LABEL__';\nconst LabelTypeFull = '__LABEL__@1';\n\nexport function deriveLabels<T>(\n values: T[],\n specExtractor: (obj: T) => SpecExtractorResult,\n ops: LabelDerivationOps = {},\n): RecordsWithLabel<T>[] {\n const importances = new Map<string, number>();\n\n const forceTraceElements = (ops.forceTraceElements !== undefined && ops.forceTraceElements.length > 0)\n ? new Set(ops.forceTraceElements)\n : undefined;\n\n // number of times certain type occurred among all of the\n const numberOfRecordsWithType = new Map<string, number>();\n\n const enrichedRecords = values.map((value) => {\n const extractorResult = specExtractor(value);\n let spec: PObjectSpec;\n let prefixTrace: TraceEntry[] | undefined;\n let suffixTrace: TraceEntry[] | undefined;\n\n // Check if the result is the new structure or just PObjectSpec\n if ('spec' in extractorResult && typeof extractorResult.spec === 'object') {\n // It's the new structure { spec, prefixTrace?, suffixTrace? }\n spec = extractorResult.spec;\n prefixTrace = extractorResult.prefixTrace;\n suffixTrace = extractorResult.suffixTrace;\n } else {\n // It's just PObjectSpec\n spec = extractorResult as PObjectSpec;\n }\n\n const label = spec.annotations?.[PAnnotationLabel];\n const traceStr = spec.annotations?.[PAnnotationTrace];\n const baseTrace = (traceStr ? Trace.safeParse(JSON.parse(traceStr)).data : undefined) ?? [];\n\n const trace = [\n ...(prefixTrace ?? []),\n ...baseTrace,\n ...(suffixTrace ?? []),\n ];\n\n if (label !== undefined) {\n const labelEntry = { label, type: LabelType, importance: -2 };\n if (ops.addLabelAsSuffix) trace.push(labelEntry);\n else trace.splice(0, 0, labelEntry);\n }\n\n const fullTrace: FullTrace = [];\n\n const occurrences = new Map<string, number>();\n for (let i = trace.length - 1; i >= 0; --i) {\n const { type: typeName } = trace[i];\n const importance = trace[i].importance ?? 0;\n const occurrenceIndex = (occurrences.get(typeName) ?? 0) + 1;\n occurrences.set(typeName, occurrenceIndex);\n const fullType = `${typeName}@${occurrenceIndex}`;\n numberOfRecordsWithType.set(fullType, (numberOfRecordsWithType.get(fullType) ?? 0) + 1);\n importances.set(\n fullType,\n Math.max(\n importances.get(fullType) ?? Number.NEGATIVE_INFINITY,\n importance - (trace.length - i) * DistancePenalty,\n ),\n );\n fullTrace.push({ ...trace[i], fullType, occurrenceIndex: occurrenceIndex });\n }\n fullTrace.reverse();\n return {\n value,\n spec,\n label,\n fullTrace,\n };\n });\n\n // excluding repeated types (i.e. ..@2, ..@3, etc.) not found in some records\n const mainTypes: string[] = [];\n // repeated types (i.e. ..@2, ..@3, etc.) not found in some records\n const secondaryTypes: string[] = [];\n\n const allTypeRecords = [...importances];\n // sorting: most important types go first\n allTypeRecords.sort(([, i1], [, i2]) => i2 - i1);\n\n for (const [typeName] of allTypeRecords) {\n if (typeName.endsWith('@1') || numberOfRecordsWithType.get(typeName) === values.length)\n mainTypes.push(typeName);\n else secondaryTypes.push(typeName);\n }\n\n const calculate = (includedTypes: Set<string>, force: boolean = false) => {\n const result: RecordsWithLabel<T>[] = [];\n for (let i = 0; i < enrichedRecords.length; i++) {\n const r = enrichedRecords[i];\n const includedTrace = r.fullTrace\n .filter((fm) => includedTypes.has(fm.fullType)\n || (forceTraceElements && forceTraceElements.has(fm.type)));\n if (includedTrace.length === 0) {\n if (force)\n result.push({\n label: 'Unlabeled',\n value: r.value,\n } satisfies RecordsWithLabel<T>);\n else return undefined;\n }\n const labelSet = includedTrace\n .map((fm) => fm.label);\n const sep = ops.separator ?? ' / ';\n result.push({\n label: labelSet.join(sep),\n value: r.value,\n } satisfies RecordsWithLabel<T>);\n }\n return result;\n };\n\n if (mainTypes.length === 0) {\n if (secondaryTypes.length !== 0) throw new Error('Non-empty secondary types list while main types list is empty.');\n return calculate(new Set(LabelTypeFull), true)!;\n }\n\n //\n // includedTypes = 2\n // * *\n // T0 T1 T2 T3 T4 T5\n // *\n // additionalType = 3\n //\n // Resulting set: T0, T1, T3\n //\n let includedTypes = 0;\n let additionalType = -1;\n while (includedTypes < mainTypes.length) {\n const currentSet = new Set<string>();\n if (ops.includeNativeLabel) currentSet.add(LabelTypeFull);\n for (let i = 0; i < includedTypes; ++i) currentSet.add(mainTypes[i]);\n if (additionalType >= 0)\n currentSet.add(mainTypes[additionalType]);\n\n const candidateResult = calculate(currentSet);\n\n // checking if labels uniquely separate our records\n if (candidateResult !== undefined && new Set(candidateResult.map((c) => c.label)).size === values.length) return candidateResult;\n\n additionalType++;\n if (additionalType >= mainTypes.length) {\n includedTypes++;\n additionalType = includedTypes;\n }\n }\n\n return calculate(new Set([...mainTypes, ...secondaryTypes]), true)!;\n}\n","export const PlatformaSDKVersion = '1.37.14';\n","import type { ValueOrErrors } from '@milaboratories/pl-model-common';\nimport {} from './global';\nimport { getPlatformaInstance } from './internal';\nimport type { Platforma } from './platforma';\nimport { PlatformaSDKVersion } from './version';\n\nexport function getRawPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(): Platforma<Args, Outputs, UiState, Href> {\n return getPlatformaInstance<Args, Outputs, UiState, Href>({ sdkVersion: PlatformaSDKVersion });\n}\n\n/** Returns a global platforma instance or a provided fallback if it's not available. */\nexport function getPlatformaOrDefault<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(platforma: Platforma<Args, Outputs, UiState, Href>): Platforma<Args, Outputs, UiState, Href> {\n try {\n return getRawPlatformaInstance<Args, Outputs, UiState, Href>();\n } catch {\n return platforma;\n }\n}\n"],"names":["getPlatformaInstance","config","TraceEntry","z","PlatformaSDKVersion","getRawPlatformaInstance"],"mappings":";;;AAaO,SAASA,EAKdC,GAA0E;AACtEA,MAAAA,KAAU,OAAO,WAAW,gBAAiB;AACxC,WAAA,WAAW,aAAaA,CAAM;AAAA,MAC9B,OAAO,WAAW,YAAc,IAAA,QAAoB,WAAW;AAC7D,QAAA,IAAI,MAAM,+BAAgC;AACvD;MCDaC,IAAaC,EAAE,OAAO;AAAA,EACjC,MAAMA,EAAE,OAAO;AAAA,EACf,YAAYA,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,IAAIA,EAAE,OAAO,EAAE,SAAS;AAAA,EACxB,OAAOA,EAAE,OAAO;AAClB,CAAC;AAIoBA,EAAE,MAAMD,CAAU;AC/BhC,MAAME,IAAsB;ACM5B,SAASC,IAK6B;AACpCL,SAAAA,EAAmD,EAAE,YAAYI,GAAqB;AAC/F;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../sdk/model/src/internal.ts","../../../../../../../sdk/model/src/render/util/label.ts","../../../../../../../sdk/model/src/version.ts","../../../../../../../sdk/model/src/raw_globals.ts"],"sourcesContent":["import type { ValueOrErrors } from '@milaboratories/pl-model-common';\nimport {} from './global';\nimport type { Platforma } from './platforma';\nimport type { FutureHandle, GlobalCfgRenderCtx } from './render/internal';\n\n/** Utility code helping to identify whether the code is running in actual UI environment */\nexport function isInUI() {\n return (\n typeof globalThis.getPlatforma !== 'undefined' || typeof globalThis.platforma !== 'undefined'\n );\n}\n\n/** Utility code helping to retrieve a platforma instance form the environment */\nexport function getPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(config?: { sdkVersion: string }): Platforma<Args, Outputs, UiState, Href> {\n if (config && typeof globalThis.getPlatforma === 'function')\n return globalThis.getPlatforma(config);\n else if (typeof globalThis.platforma !== 'undefined') return globalThis.platforma;\n else throw new Error('Can\\'t get platforma instance.');\n}\n\nexport function tryGetCfgRenderCtx(): GlobalCfgRenderCtx | undefined {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else return undefined;\n}\n\nexport function getCfgRenderCtx(): GlobalCfgRenderCtx {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else throw new Error('Not in config rendering context');\n}\n\nexport function tryRegisterCallback(key: string, callback: (...args: any[]) => any): boolean {\n const ctx = tryGetCfgRenderCtx();\n if (ctx === undefined) return false;\n if (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n ctx.callbackRegistry[key] = callback;\n return true;\n}\n\nconst futureResolves = new Map<string, ((value: unknown) => void)[]>();\n\nexport function registerFutureAwait(handle: FutureHandle, onResolve: (value: unknown) => void) {\n if (!(handle in getCfgRenderCtx().callbackRegistry)) {\n getCfgRenderCtx().callbackRegistry[handle] = (value: unknown) => {\n for (const res of futureResolves.get(handle)!) {\n res(value);\n }\n };\n futureResolves.set(handle, []);\n }\n futureResolves.get(handle)!.push(onResolve);\n}\n","import type { PObjectSpec } from '@milaboratories/pl-model-common';\nimport { z } from 'zod';\n\nexport const PAnnotationLabel = 'pl7.app/label';\nexport const PAnnotationTrace = 'pl7.app/trace';\n\nexport type RecordsWithLabel<T> = {\n value: T;\n label: string;\n};\n\nexport type LabelDerivationOps = {\n /** Force inclusion of native column label */\n includeNativeLabel?: boolean;\n /** Separator to use between label parts (\" / \" by default) */\n separator?: string;\n /** If true, label will be added as suffix (at the end of the generated label). By default label added as a prefix. */\n addLabelAsSuffix?: boolean;\n /** Trace elements list that will be forced to be included in the label. */\n forceTraceElements?: string[];\n};\n\nexport const TraceEntry = z.object({\n type: z.string(),\n importance: z.number().optional(),\n id: z.string().optional(),\n label: z.string(),\n});\nexport type TraceEntry = z.infer<typeof TraceEntry>;\ntype FullTraceEntry = TraceEntry & { fullType: string; occurrenceIndex: number };\n\nexport const Trace = z.array(TraceEntry);\nexport type Trace = z.infer<typeof Trace>;\ntype FullTrace = FullTraceEntry[];\n\n// Define the possible return types for the specExtractor function\ntype SpecExtractorResult = PObjectSpec | {\n spec: PObjectSpec;\n prefixTrace?: TraceEntry[];\n suffixTrace?: TraceEntry[];\n};\n\nconst DistancePenalty = 0.001;\n\nconst LabelType = '__LABEL__';\nconst LabelTypeFull = '__LABEL__@1';\n\nexport function deriveLabels<T>(\n values: T[],\n specExtractor: (obj: T) => SpecExtractorResult,\n ops: LabelDerivationOps = {},\n): RecordsWithLabel<T>[] {\n const importances = new Map<string, number>();\n\n const forceTraceElements = (ops.forceTraceElements !== undefined && ops.forceTraceElements.length > 0)\n ? new Set(ops.forceTraceElements)\n : undefined;\n\n // number of times certain type occurred among all of the\n const numberOfRecordsWithType = new Map<string, number>();\n\n const enrichedRecords = values.map((value) => {\n const extractorResult = specExtractor(value);\n let spec: PObjectSpec;\n let prefixTrace: TraceEntry[] | undefined;\n let suffixTrace: TraceEntry[] | undefined;\n\n // Check if the result is the new structure or just PObjectSpec\n if ('spec' in extractorResult && typeof extractorResult.spec === 'object') {\n // It's the new structure { spec, prefixTrace?, suffixTrace? }\n spec = extractorResult.spec;\n prefixTrace = extractorResult.prefixTrace;\n suffixTrace = extractorResult.suffixTrace;\n } else {\n // It's just PObjectSpec\n spec = extractorResult as PObjectSpec;\n }\n\n const label = spec.annotations?.[PAnnotationLabel];\n const traceStr = spec.annotations?.[PAnnotationTrace];\n const baseTrace = (traceStr ? Trace.safeParse(JSON.parse(traceStr)).data : undefined) ?? [];\n\n const trace = [\n ...(prefixTrace ?? []),\n ...baseTrace,\n ...(suffixTrace ?? []),\n ];\n\n if (label !== undefined) {\n const labelEntry = { label, type: LabelType, importance: -2 };\n if (ops.addLabelAsSuffix) trace.push(labelEntry);\n else trace.splice(0, 0, labelEntry);\n }\n\n const fullTrace: FullTrace = [];\n\n const occurrences = new Map<string, number>();\n for (let i = trace.length - 1; i >= 0; --i) {\n const { type: typeName } = trace[i];\n const importance = trace[i].importance ?? 0;\n const occurrenceIndex = (occurrences.get(typeName) ?? 0) + 1;\n occurrences.set(typeName, occurrenceIndex);\n const fullType = `${typeName}@${occurrenceIndex}`;\n numberOfRecordsWithType.set(fullType, (numberOfRecordsWithType.get(fullType) ?? 0) + 1);\n importances.set(\n fullType,\n Math.max(\n importances.get(fullType) ?? Number.NEGATIVE_INFINITY,\n importance - (trace.length - i) * DistancePenalty,\n ),\n );\n fullTrace.push({ ...trace[i], fullType, occurrenceIndex: occurrenceIndex });\n }\n fullTrace.reverse();\n return {\n value,\n spec,\n label,\n fullTrace,\n };\n });\n\n // excluding repeated types (i.e. ..@2, ..@3, etc.) not found in some records\n const mainTypes: string[] = [];\n // repeated types (i.e. ..@2, ..@3, etc.) not found in some records\n const secondaryTypes: string[] = [];\n\n const allTypeRecords = [...importances];\n // sorting: most important types go first\n allTypeRecords.sort(([, i1], [, i2]) => i2 - i1);\n\n for (const [typeName] of allTypeRecords) {\n if (typeName.endsWith('@1') || numberOfRecordsWithType.get(typeName) === values.length)\n mainTypes.push(typeName);\n else secondaryTypes.push(typeName);\n }\n\n const calculate = (includedTypes: Set<string>, force: boolean = false) => {\n const result: RecordsWithLabel<T>[] = [];\n for (let i = 0; i < enrichedRecords.length; i++) {\n const r = enrichedRecords[i];\n const includedTrace = r.fullTrace\n .filter((fm) => includedTypes.has(fm.fullType)\n || (forceTraceElements && forceTraceElements.has(fm.type)));\n if (includedTrace.length === 0) {\n if (force)\n result.push({\n label: 'Unlabeled',\n value: r.value,\n } satisfies RecordsWithLabel<T>);\n else return undefined;\n }\n const labelSet = includedTrace\n .map((fm) => fm.label);\n const sep = ops.separator ?? ' / ';\n result.push({\n label: labelSet.join(sep),\n value: r.value,\n } satisfies RecordsWithLabel<T>);\n }\n return result;\n };\n\n if (mainTypes.length === 0) {\n if (secondaryTypes.length !== 0) throw new Error('Non-empty secondary types list while main types list is empty.');\n return calculate(new Set(LabelTypeFull), true)!;\n }\n\n //\n // includedTypes = 2\n // * *\n // T0 T1 T2 T3 T4 T5\n // *\n // additionalType = 3\n //\n // Resulting set: T0, T1, T3\n //\n let includedTypes = 0;\n let additionalType = -1;\n while (includedTypes < mainTypes.length) {\n const currentSet = new Set<string>();\n if (ops.includeNativeLabel) currentSet.add(LabelTypeFull);\n for (let i = 0; i < includedTypes; ++i) currentSet.add(mainTypes[i]);\n if (additionalType >= 0)\n currentSet.add(mainTypes[additionalType]);\n\n const candidateResult = calculate(currentSet);\n\n // checking if labels uniquely separate our records\n if (candidateResult !== undefined && new Set(candidateResult.map((c) => c.label)).size === values.length) return candidateResult;\n\n additionalType++;\n if (additionalType >= mainTypes.length) {\n includedTypes++;\n additionalType = includedTypes;\n }\n }\n\n return calculate(new Set([...mainTypes, ...secondaryTypes]), true)!;\n}\n","export const PlatformaSDKVersion = '1.37.18';\n","import type { ValueOrErrors } from '@milaboratories/pl-model-common';\nimport {} from './global';\nimport { getPlatformaInstance } from './internal';\nimport type { Platforma } from './platforma';\nimport { PlatformaSDKVersion } from './version';\n\nexport function getRawPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(): Platforma<Args, Outputs, UiState, Href> {\n return getPlatformaInstance<Args, Outputs, UiState, Href>({ sdkVersion: PlatformaSDKVersion });\n}\n\n/** Returns a global platforma instance or a provided fallback if it's not available. */\nexport function getPlatformaOrDefault<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(platforma: Platforma<Args, Outputs, UiState, Href>): Platforma<Args, Outputs, UiState, Href> {\n try {\n return getRawPlatformaInstance<Args, Outputs, UiState, Href>();\n } catch {\n return platforma;\n }\n}\n"],"names":["getPlatformaInstance","config","TraceEntry","z","PlatformaSDKVersion","getRawPlatformaInstance"],"mappings":";;;AAaO,SAASA,EAKdC,GAA0E;AACtEA,MAAAA,KAAU,OAAO,WAAW,gBAAiB;AACxC,WAAA,WAAW,aAAaA,CAAM;AAAA,MAC9B,OAAO,WAAW,YAAc,IAAA,QAAoB,WAAW;AAC7D,QAAA,IAAI,MAAM,+BAAgC;AACvD;MCDaC,IAAaC,EAAE,OAAO;AAAA,EACjC,MAAMA,EAAE,OAAO;AAAA,EACf,YAAYA,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,IAAIA,EAAE,OAAO,EAAE,SAAS;AAAA,EACxB,OAAOA,EAAE,OAAO;AAClB,CAAC;AAIoBA,EAAE,MAAMD,CAAU;AC/BhC,MAAME,IAAsB;ACM5B,SAASC,IAK6B;AACpCL,SAAAA,EAAmD,EAAE,YAAYI,GAAqB;AAC/F;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/uikit",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.98",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"sortablejs": "^1.15.6",
|
|
20
20
|
"vue": "^3.5.13",
|
|
21
21
|
"d3": "^7.9.0",
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
22
|
+
"@milaboratories/helpers": "^1.6.17",
|
|
23
|
+
"@platforma-sdk/model": "^1.37.18"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/d3": "^7.4.3",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"yarpm": "^1.2.0",
|
|
36
36
|
"svgo": "^3.3.2",
|
|
37
37
|
"@milaboratories/ts-configs": "1.0.4",
|
|
38
|
-
"@milaboratories/
|
|
39
|
-
"@milaboratories/
|
|
38
|
+
"@milaboratories/eslint-config": "^1.0.4",
|
|
39
|
+
"@milaboratories/build-configs": "1.0.4"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"dev": "vite",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ListOptionNormalized } from '../../types';
|
|
2
2
|
|
|
3
|
-
export type LOption<M = unknown> = ListOptionNormalized<M> & { isSelected: boolean; isActive: boolean; index: number };
|
|
3
|
+
export type LOption<M = unknown> = ListOptionNormalized<M> & { isSelected: boolean; isActive: boolean; index: number };
|
|
@@ -1,62 +1,72 @@
|
|
|
1
1
|
<script generic="T extends unknown = unknown, K extends number | string = number | string" lang="ts" setup>
|
|
2
2
|
import type { ShallowRef } from 'vue';
|
|
3
3
|
import { computed, shallowRef, watch } from 'vue';
|
|
4
|
-
import {
|
|
4
|
+
import { isFunction, shallowHash } from '@milaboratories/helpers';
|
|
5
5
|
import { useSortable } from '@vueuse/integrations/useSortable';
|
|
6
6
|
import { type SortableEvent } from 'sortablejs';
|
|
7
|
-
import { moveElements
|
|
7
|
+
import { moveElements } from './utils.ts';
|
|
8
8
|
import PlElementListItem from './PlElementListItem.vue';
|
|
9
9
|
|
|
10
10
|
const itemsRef = defineModel<T[]>('items', { required: true });
|
|
11
|
-
const draggableSetRef = defineModel<Set<K>>('draggableItems');
|
|
12
|
-
const removableSetRef = defineModel<Set<K>>('removableItems');
|
|
13
|
-
|
|
14
|
-
const expandableSetRef = defineModel<Set<K>>('expandableItems');
|
|
15
|
-
const expandedSetRef = defineModel<Set<K>>('expandedItems');
|
|
16
|
-
|
|
17
|
-
const pinnableSetRef = defineModel<Set<K>>('pinnableItems');
|
|
18
|
-
const pinnedSetRef = defineModel<Set<K>>('pinnedItems');
|
|
19
|
-
|
|
20
|
-
const toggableSetRef = defineModel<Set<K>>('toggableItems');
|
|
21
|
-
const toggledSetRef = defineModel<Set<K>>('toggledItems');
|
|
22
11
|
|
|
23
12
|
const props = withDefaults(
|
|
24
13
|
defineProps<{
|
|
25
|
-
getItemKey
|
|
14
|
+
getItemKey?: (item: T, index: number) => K;
|
|
26
15
|
|
|
27
16
|
itemClass?: string | string[] | ((item: T, index: number) => string | string[]);
|
|
28
|
-
|
|
17
|
+
isActive?: (item: T, index: number) => boolean;
|
|
29
18
|
|
|
30
|
-
|
|
19
|
+
disableDragging?: boolean;
|
|
20
|
+
isDraggable?: (item: T, index: number) => boolean;
|
|
31
21
|
onDragEnd?: (oldIndex: number, newIndex: number) => void | boolean;
|
|
32
22
|
onSort?: (oldIndex: number, newIndex: number) => void | boolean;
|
|
33
23
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
enableRemoving?: boolean;
|
|
24
|
+
disableRemoving?: boolean;
|
|
25
|
+
isRemovable?: (item: T, index: number) => boolean;
|
|
38
26
|
onRemove?: (item: T, index: number) => void | boolean;
|
|
39
27
|
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
disableExpanding?: boolean;
|
|
29
|
+
isExpandable?: (item: T, index: number) => boolean;
|
|
30
|
+
isExpanded?: (item: T, index: number) => boolean;
|
|
31
|
+
onExpand?: (item: T, index: number) => unknown;
|
|
32
|
+
|
|
33
|
+
disableToggling?: boolean;
|
|
34
|
+
isToggable?: (item: T, index: number) => boolean;
|
|
35
|
+
isToggled?: (item: T, index: number) => boolean;
|
|
36
|
+
onToggle?: (item: T, index: number) => unknown;
|
|
42
37
|
|
|
43
|
-
|
|
38
|
+
disablePinning?: boolean;
|
|
39
|
+
isPinnable?: (item: T, index: number) => boolean;
|
|
40
|
+
isPinned?: (item: T, index: number) => boolean;
|
|
44
41
|
onPin?: (item: T, index: number) => void | boolean;
|
|
45
42
|
}>(), {
|
|
46
|
-
|
|
47
|
-
activeItems: undefined,
|
|
43
|
+
getItemKey: (item: T) => JSON.stringify(item) as K,
|
|
48
44
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
enableExpanding: undefined,
|
|
52
|
-
enableToggling: undefined,
|
|
53
|
-
enablePinning: undefined,
|
|
45
|
+
itemClass: undefined,
|
|
46
|
+
isActive: undefined,
|
|
54
47
|
|
|
48
|
+
disableDragging: undefined,
|
|
49
|
+
isDraggable: undefined,
|
|
55
50
|
onDragEnd: undefined,
|
|
56
51
|
onSort: undefined,
|
|
52
|
+
|
|
53
|
+
disableRemoving: undefined,
|
|
54
|
+
isRemovable: undefined,
|
|
57
55
|
onRemove: undefined,
|
|
56
|
+
|
|
57
|
+
disableExpanding: undefined,
|
|
58
|
+
isExpandable: undefined,
|
|
59
|
+
isExpanded: undefined,
|
|
58
60
|
onExpand: undefined,
|
|
61
|
+
|
|
62
|
+
disableToggling: undefined,
|
|
63
|
+
isToggable: undefined,
|
|
64
|
+
isToggled: undefined,
|
|
59
65
|
onToggle: undefined,
|
|
66
|
+
|
|
67
|
+
disablePinning: undefined,
|
|
68
|
+
isPinnable: undefined,
|
|
69
|
+
isPinned: undefined,
|
|
60
70
|
onPin: undefined,
|
|
61
71
|
},
|
|
62
72
|
);
|
|
@@ -71,30 +81,45 @@ const slots = defineSlots<{
|
|
|
71
81
|
}>();
|
|
72
82
|
|
|
73
83
|
const dndSortingEnabled = computed((): boolean => {
|
|
74
|
-
return props.
|
|
84
|
+
return props.disableDragging !== true;
|
|
75
85
|
});
|
|
76
86
|
|
|
77
|
-
const pinnedItemsRef = computed(() => itemsRef.value.filter(
|
|
87
|
+
const pinnedItemsRef = computed(() => itemsRef.value.filter(isPinnedItem));
|
|
78
88
|
const hasPinnedItems = computed(() => pinnedItemsRef.value.length > 0);
|
|
79
89
|
|
|
80
|
-
const unpinnedItemsRef = computed(() => itemsRef.value.filter((item, index) => !
|
|
90
|
+
const unpinnedItemsRef = computed(() => itemsRef.value.filter((item, index) => !isPinnedItem(item, index)));
|
|
81
91
|
const hasUnpinnedItems = computed(() => unpinnedItemsRef.value.length > 0);
|
|
82
92
|
|
|
83
93
|
const domProjectionItemsRef = shallowRef<undefined | T[]>();
|
|
84
94
|
const pinnedContainerRef = shallowRef<HTMLElement>();
|
|
85
95
|
const unpinnedContainerRef = shallowRef<HTMLElement>();
|
|
86
96
|
|
|
97
|
+
// version fix problem with sync between data and rendered values
|
|
98
|
+
const getKey = (item: T, index: number) => {
|
|
99
|
+
return `${versionRef.value}-${props.getItemKey(item, index)}`;
|
|
100
|
+
};
|
|
101
|
+
const pinnedKeysRef = computed(() => pinnedItemsRef.value.map(getKey));
|
|
102
|
+
const unpinnedKeysRef = computed(() => unpinnedItemsRef.value.map(getKey));
|
|
103
|
+
|
|
87
104
|
// version fix problem with sync between data and rendered values when items have been changed
|
|
88
105
|
const versionRef = computed<number>((oldVersion) => {
|
|
89
|
-
const
|
|
106
|
+
const currentKeys = itemsRef.value.map(props.getItemKey);
|
|
90
107
|
|
|
91
|
-
if (domProjectionItemsRef.value === undefined) return oldVersion ??
|
|
108
|
+
if (domProjectionItemsRef.value === undefined) return oldVersion ?? shallowHash(...currentKeys);
|
|
109
|
+
if (currentKeys.length !== domProjectionItemsRef.value.length) return shallowHash(...currentKeys);
|
|
92
110
|
|
|
93
|
-
const
|
|
111
|
+
const domProjectionKeys = domProjectionItemsRef.value.map(props.getItemKey);
|
|
112
|
+
const domProjectionKeysSet = new Set(domProjectionKeys);
|
|
94
113
|
|
|
95
|
-
|
|
114
|
+
for (let i = 0; i < currentKeys.length; i++) {
|
|
115
|
+
const hasInconsistentPosition = domProjectionKeysSet.has(currentKeys[i]) && domProjectionKeys[i] !== currentKeys[i];
|
|
96
116
|
|
|
97
|
-
|
|
117
|
+
if (hasInconsistentPosition) {
|
|
118
|
+
return shallowHash(...currentKeys);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return oldVersion ?? shallowHash(...currentKeys);
|
|
98
123
|
});
|
|
99
124
|
|
|
100
125
|
createSortable(hasPinnedItems, pinnedContainerRef, pinnedItemsRef, () => 0);
|
|
@@ -117,7 +142,9 @@ function createSortable(toggler: ShallowRef<boolean>, elRef: ShallowRef<undefine
|
|
|
117
142
|
}
|
|
118
143
|
},
|
|
119
144
|
});
|
|
120
|
-
watch(toggler, (on) => on ? sortable.
|
|
145
|
+
watch([() => props.disableDragging, toggler], ([disabled, on]) => disabled || !on ? sortable.stop() : sortable.start(), {
|
|
146
|
+
immediate: true,
|
|
147
|
+
});
|
|
121
148
|
|
|
122
149
|
return sortable;
|
|
123
150
|
}
|
|
@@ -133,77 +160,56 @@ function moveItems(oldIndex: number, newIndex: number, afterUpdateDom: boolean)
|
|
|
133
160
|
|
|
134
161
|
if (!preventDefault) {
|
|
135
162
|
moveElements(itemsRef.value, oldIndex, newIndex);
|
|
136
|
-
optionalUpdateRef(itemsRef);
|
|
137
163
|
}
|
|
138
164
|
}
|
|
139
165
|
|
|
140
|
-
function
|
|
141
|
-
|
|
142
|
-
return props.activeItems?.has(k) ?? false;
|
|
166
|
+
function isActiveItem(item: T, index: number): boolean {
|
|
167
|
+
return props.isActive?.(item, index) ?? false;
|
|
143
168
|
}
|
|
144
169
|
|
|
145
|
-
function
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return (draggableSetRef.value?.has(k) ?? true);
|
|
170
|
+
function isDraggableItem(item: T, index: number): boolean {
|
|
171
|
+
if (props.disableDragging === true) return false;
|
|
172
|
+
return (props.isDraggable?.(item, index) ?? true);
|
|
149
173
|
}
|
|
150
174
|
|
|
151
|
-
function
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return !isNil(toggledSetRef.value) && (toggableSetRef.value?.has(k) ?? true);
|
|
175
|
+
function isRemovableItem(item: T, index: number): boolean {
|
|
176
|
+
if (props.disableRemoving === true) return false;
|
|
177
|
+
return (props.isRemovable?.(item, index) ?? true);
|
|
155
178
|
}
|
|
156
179
|
|
|
157
|
-
function
|
|
158
|
-
|
|
159
|
-
return
|
|
180
|
+
function isToggableItem(item: T, index: number): boolean {
|
|
181
|
+
if (props.disableToggling === true) return false;
|
|
182
|
+
return (props.isToggable?.(item, index) ?? (isFunction(props.isToggled) || isFunction(props.onToggle)));
|
|
160
183
|
}
|
|
161
184
|
|
|
162
|
-
function
|
|
163
|
-
|
|
164
|
-
if (props.enablePinning === false) return false;
|
|
165
|
-
return !isNil(pinnedSetRef.value) && (pinnableSetRef.value?.has(k) ?? true);
|
|
185
|
+
function isToggledItem(item: T, index: number): boolean {
|
|
186
|
+
return props.isToggled?.(item, index) ?? false;
|
|
166
187
|
}
|
|
167
188
|
|
|
168
|
-
function
|
|
169
|
-
|
|
170
|
-
return
|
|
189
|
+
function isPinnableItem(item: T, index: number): boolean {
|
|
190
|
+
if (props.disablePinning === true) return false;
|
|
191
|
+
return (props.isPinnable?.(item, index) ?? (isFunction(props.isPinned) || isFunction(props.onPin)));
|
|
171
192
|
}
|
|
172
193
|
|
|
173
|
-
function
|
|
174
|
-
|
|
175
|
-
if (props.enableExpanding === false) return false;
|
|
176
|
-
return !isNil(expandedSetRef.value) && (expandableSetRef.value?.has(k) ?? true);
|
|
194
|
+
function isPinnedItem(item: T, index: number): boolean {
|
|
195
|
+
return props.isPinned?.(item, index) ?? false;
|
|
177
196
|
}
|
|
178
197
|
|
|
179
|
-
function
|
|
180
|
-
|
|
181
|
-
return
|
|
198
|
+
function isExpandableItem(item: T, index: number): boolean {
|
|
199
|
+
if (props.disableExpanding === true) return false;
|
|
200
|
+
return (props.isExpandable?.(item, index) ?? (isFunction(props.isExpanded) || isFunction(props.onExpand)));
|
|
182
201
|
}
|
|
183
202
|
|
|
184
|
-
function
|
|
185
|
-
|
|
186
|
-
if (props.enableRemoving === false) return false;
|
|
187
|
-
if (removableSetRef.value?.has(k) === false) return false;
|
|
188
|
-
return props.enableRemoving === true || typeof props.onRemove === 'function';
|
|
203
|
+
function isExpandedItem(item: T, index: number): boolean {
|
|
204
|
+
return props.isExpanded?.(item, index) ?? false;
|
|
189
205
|
}
|
|
190
206
|
|
|
191
207
|
function handleExpand(item: T, index: number) {
|
|
192
|
-
|
|
193
|
-
const k = props.getItemKey(item, index);
|
|
194
|
-
const expanded = expandedSetRef.value;
|
|
195
|
-
if (expanded.has(k)) expanded.delete(k);
|
|
196
|
-
else expanded.add(k);
|
|
197
|
-
optionalUpdateRef(expandedSetRef);
|
|
208
|
+
props.onExpand?.(item, index);
|
|
198
209
|
}
|
|
199
210
|
|
|
200
211
|
function handleToggle(item: T, index: number) {
|
|
201
|
-
|
|
202
|
-
const k = props.getItemKey(item, index);
|
|
203
|
-
const toggled = toggledSetRef.value;
|
|
204
|
-
if (toggled.has(k)) toggled.delete(k);
|
|
205
|
-
else toggled.add(k);
|
|
206
|
-
optionalUpdateRef(toggledSetRef);
|
|
212
|
+
props.onToggle?.(item, index);
|
|
207
213
|
}
|
|
208
214
|
|
|
209
215
|
function handlePin(item: T, index: number) {
|
|
@@ -211,43 +217,18 @@ function handlePin(item: T, index: number) {
|
|
|
211
217
|
throw new Error('Pinnable item not found');
|
|
212
218
|
}
|
|
213
219
|
|
|
214
|
-
|
|
220
|
+
const alreadyPinned = pinnedItemsRef.value.includes(item);
|
|
221
|
+
|
|
222
|
+
if (props.onPin?.(item, index) === false) return;
|
|
215
223
|
|
|
216
|
-
|
|
217
|
-
const pinned = pinnedSetRef.value;
|
|
218
|
-
const alreadyPinned = pinned.has(k);
|
|
219
|
-
if (alreadyPinned) pinned.delete(k);
|
|
220
|
-
else pinned.add(k);
|
|
221
|
-
optionalUpdateRef(pinnedSetRef);
|
|
222
|
-
moveItems(index, pinned.size + (alreadyPinned ? 0 : -1), false);
|
|
224
|
+
moveItems(index, pinnedItemsRef.value.length + (alreadyPinned ? 0 : -1), false);
|
|
223
225
|
}
|
|
224
226
|
|
|
225
227
|
function handleRemove(item: T, index: number) {
|
|
226
|
-
if (props.onRemove?.(item, index)
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
itemsRef.value.splice(index, 1);
|
|
230
|
-
optionalUpdateRef(itemsRef);
|
|
231
|
-
|
|
232
|
-
if (pinnedSetRef.value?.has(k)) {
|
|
233
|
-
pinnedSetRef.value.delete(k);
|
|
234
|
-
optionalUpdateRef(pinnedSetRef);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
if (toggledSetRef.value?.has(k)) {
|
|
238
|
-
toggledSetRef.value.delete(k);
|
|
239
|
-
optionalUpdateRef(toggledSetRef);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
228
|
+
if (props.onRemove?.(item, index) === false) return;
|
|
229
|
+
itemsRef.value.splice(index, 1);
|
|
242
230
|
}
|
|
243
231
|
|
|
244
|
-
// version fix problem with sync between data and rendered values
|
|
245
|
-
const getKey = (item: T, index: number) => {
|
|
246
|
-
return `${versionRef.value}-${props.getItemKey(item, index)}`;
|
|
247
|
-
};
|
|
248
|
-
const pinnedKeysRef = computed(() => pinnedItemsRef.value.map(getKey));
|
|
249
|
-
const unpinnedKeysRef = computed(() => unpinnedItemsRef.value.map(getKey));
|
|
250
|
-
|
|
251
232
|
const getItemClass = (item: T, index: number): null | string | string[] => {
|
|
252
233
|
if (typeof props.itemClass === 'function') {
|
|
253
234
|
return props.itemClass(item, index);
|
|
@@ -267,15 +248,15 @@ const getItemClass = (item: T, index: number): null | string | string[] => {
|
|
|
267
248
|
:index="pinnedIndex"
|
|
268
249
|
:item="pinnedItem"
|
|
269
250
|
:showDragHandle="dndSortingEnabled"
|
|
270
|
-
:isActive="
|
|
271
|
-
:isDraggable="
|
|
272
|
-
:isRemovable="
|
|
273
|
-
:isToggable="
|
|
274
|
-
:isToggled="
|
|
275
|
-
:isPinnable="
|
|
276
|
-
:isPinned="
|
|
277
|
-
:isExpandable="
|
|
278
|
-
:isExpanded="
|
|
251
|
+
:isActive="isActiveItem(pinnedItem, pinnedIndex)"
|
|
252
|
+
:isDraggable="isDraggableItem(pinnedItem, pinnedIndex)"
|
|
253
|
+
:isRemovable="isRemovableItem(pinnedItem, pinnedIndex)"
|
|
254
|
+
:isToggable="isToggableItem(pinnedItem, pinnedIndex)"
|
|
255
|
+
:isToggled="isToggledItem(pinnedItem, pinnedIndex)"
|
|
256
|
+
:isPinnable="isPinnableItem(pinnedItem, pinnedIndex)"
|
|
257
|
+
:isPinned="true"
|
|
258
|
+
:isExpandable="isExpandableItem(pinnedItem, pinnedIndex)"
|
|
259
|
+
:isExpanded="isExpandedItem(pinnedItem, pinnedIndex)"
|
|
279
260
|
|
|
280
261
|
@click="emits('itemClick', pinnedItem)"
|
|
281
262
|
@remove="handleRemove"
|
|
@@ -296,18 +277,18 @@ const getItemClass = (item: T, index: number): null | string | string[] => {
|
|
|
296
277
|
v-for="(unpinnedItem, unpinnedIndex) in unpinnedItemsRef" :key="unpinnedKeysRef[unpinnedIndex]"
|
|
297
278
|
:class="[$style.item, getItemClass(unpinnedItem, unpinnedIndex)]"
|
|
298
279
|
|
|
299
|
-
:index="unpinnedIndex + (
|
|
280
|
+
:index="unpinnedIndex + (pinnedItemsRef?.length ?? 0)"
|
|
300
281
|
:item="unpinnedItem"
|
|
301
282
|
:showDragHandle="dndSortingEnabled"
|
|
302
|
-
:isActive="
|
|
303
|
-
:isDraggable="
|
|
304
|
-
:isRemovable="
|
|
305
|
-
:isToggable="
|
|
306
|
-
:isToggled="
|
|
307
|
-
:isPinnable="
|
|
308
|
-
:isPinned="
|
|
309
|
-
:isExpandable="
|
|
310
|
-
:isExpanded="
|
|
283
|
+
:isActive="isActiveItem(unpinnedItem, unpinnedIndex)"
|
|
284
|
+
:isDraggable="isDraggableItem(unpinnedItem, unpinnedIndex)"
|
|
285
|
+
:isRemovable="isRemovableItem(unpinnedItem, unpinnedIndex)"
|
|
286
|
+
:isToggable="isToggableItem(unpinnedItem, unpinnedIndex)"
|
|
287
|
+
:isToggled="isToggledItem(unpinnedItem, unpinnedIndex)"
|
|
288
|
+
:isPinnable="isPinnableItem(unpinnedItem, unpinnedIndex)"
|
|
289
|
+
:isPinned="false"
|
|
290
|
+
:isExpandable="isExpandableItem(unpinnedItem, unpinnedIndex)"
|
|
291
|
+
:isExpanded="isExpandedItem(unpinnedItem, unpinnedIndex)"
|
|
311
292
|
|
|
312
293
|
@click="emits('itemClick', unpinnedItem)"
|
|
313
294
|
@remove="handleRemove"
|
|
@@ -86,7 +86,10 @@ const emit = defineEmits<{
|
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
88
88
|
</div>
|
|
89
|
-
<div
|
|
89
|
+
<div
|
|
90
|
+
v-if="hasContentSlot && props.isExpanded"
|
|
91
|
+
:class="[$style.body, { [$style.disabled]: props.isToggled }]"
|
|
92
|
+
>
|
|
90
93
|
<slot name="content" :item="props.item" :index="props.index" />
|
|
91
94
|
</div>
|
|
92
95
|
</div>
|
|
@@ -144,6 +147,7 @@ const emit = defineEmits<{
|
|
|
144
147
|
display: flex;
|
|
145
148
|
align-items: center;
|
|
146
149
|
padding: 8px;
|
|
150
|
+
min-height: 40px;
|
|
147
151
|
border-radius: var(--border-radius) var(--border-radius) 0 0;
|
|
148
152
|
background: var(--head-background);
|
|
149
153
|
|
|
@@ -180,6 +184,10 @@ const emit = defineEmits<{
|
|
|
180
184
|
gap: 12px;
|
|
181
185
|
padding: 24px;
|
|
182
186
|
border-radius: 0 0 var(--border-radius) var(--border-radius);
|
|
187
|
+
|
|
188
|
+
&.disabled {
|
|
189
|
+
pointer-events: none;
|
|
190
|
+
}
|
|
183
191
|
}
|
|
184
192
|
|
|
185
193
|
.actions {
|