{"version":3,"file":"buttons-bc8fe1ca.js","sources":["../../src/tradeportal/tpcontrols/styleFormat.ts","../../src/tradeportal/tpcontrols/tpLayouts.ts","../../src/controls/buttons.ts"],"sourcesContent":["import type { Maybe } from \"@/components/utils/typeHelpers\";\nimport type { IPadding } from \"@tp/tpcontrols/paddings\";\n\nconst fromPadding = (padding: IPadding | null) => {\n return padding\n ? \"padding: \" +\n padding.top +\n \"px \" +\n padding.right +\n \"px \" +\n padding.bottom +\n \"px \" +\n padding.left +\n \"px; \"\n : \"\";\n};\n\nconst styleFormat = {\n fromPadding,\n fromBackColour: (backColour: string | null) =>\n backColour ? \"background-color: \" + backColour + \"; \" : \"\",\n fromMaxWidth: (maxWidth: Maybe) =>\n maxWidth ? \" max-width:\" + maxWidth + \"px; \" : \"\",\n fromColour: (colour: string | null) =>\n colour ? \"color: \" + colour + \"; \" : \"\",\n};\n\nexport { styleFormat };\n","import { makeRef } from \"@/components/composables/reactivityTypes\";\nimport type { Maybe } from \"@/components/utils/typeHelpers\";\nimport type { IControl } from \"@/controls/control\";\nimport type { PartialQ } from \"@/controls/tpcontrol\";\nimport {\n controlDefaults,\n extendDefaults,\n TpControl,\n} from \"@/controls/tpcontrol\";\nimport { type IPadding } from \"@tp/tpcontrols/paddings\";\nimport { styleFormat } from \"@tp/tpcontrols/styleFormat\";\nimport { computed, type CreateElement } from \"vue\";\n\nexport const containerControlDefaults = extendDefaults(controlDefaults, {\n backColour: \"\",\n innerPad: null as IPadding | null,\n});\n\nexport type ContainerControlIn = typeof containerControlDefaults;\n\nabstract class ContainerControl<\n TIn extends ContainerControlIn,\n> extends TpControl {\n constructor(defaults: TIn, ...opts: PartialQ[]) {\n super(defaults, ...opts);\n }\n\n private children = makeRef([]);\n\n protected visibleChildren = computed(() =>\n this.children.value.filter((x) => x.in.visible)\n );\n\n protected _setChildren(newChildSet: readonly IControl[]) {\n const newSet = new Set(newChildSet);\n for (const removedChild of this.children.value.filter(\n (x) => !newSet.has(x)\n )) {\n removedChild.parent = null;\n }\n for (const child of newChildSet.filter((x) => x.parent !== this)) {\n child.parent = this;\n }\n\n this.children.value = newChildSet;\n }\n\n renderVisibleChildren(h: CreateElement) {\n return this.visibleChildren.value.map((x) => x.render(h));\n }\n}\n\nexport abstract class ContainerSingle<\n TIn extends ContainerControlIn,\n> extends ContainerControl {\n setChild(newChild: Maybe) {\n this._setChildren(newChild ? [newChild] : []);\n }\n}\n\nexport abstract class ContainerMultiple<\n TIn extends ContainerControlIn,\n> extends ContainerControl {\n setChildren(newChildSet: readonly IControl[]) {\n this._setChildren(newChildSet);\n }\n}\n\nconst vStackDefaults = extendDefaults(containerControlDefaults, {\n spaceBetween: 0,\n});\n\ntype VStackIn = typeof vStackDefaults;\n\nexport class VStack extends ContainerMultiple {\n constructor(...opts: PartialQ[]) {\n super(vStackDefaults, ...opts);\n }\n\n render(h: CreateElement) {\n const rows = this.visibleChildren.value.map((child, index) =>\n h(\n \"div\",\n index === 0 || this.in.spaceBetween === 0\n ? {}\n : { style: \"margin-top: \" + this.in.spaceBetween + \"px; \" },\n [child.render(h)]\n )\n );\n\n return h(\n \"div\",\n {\n style:\n \"width: 100%; \" +\n styleFormat.fromPadding(this.in.innerPad) +\n styleFormat.fromBackColour(this.in.backColour),\n },\n rows\n );\n }\n}\n\nconst vSpaceDefaults = extendDefaults(controlDefaults, {\n height: 0,\n});\n\ntype VSpaceIn = typeof vSpaceDefaults;\n\nexport class VSpace extends TpControl {\n constructor(...opts: PartialQ[]) {\n super(vSpaceDefaults, ...opts);\n }\n\n render(h: CreateElement) {\n return h(\"div\", {\n style: \"height: \" + this.in.height + \"px; \",\n });\n }\n}\n\nconst centeredDefaults = extendDefaults(containerControlDefaults, {\n maxWidth: null as number | null,\n});\n\ntype CenteredIn = typeof centeredDefaults;\n\nclass Centered extends ContainerSingle {\n constructor(...opts: PartialQ[]) {\n super(centeredDefaults, ...opts);\n }\n\n render(h: CreateElement) {\n return h(\n \"div\",\n {\n style:\n \"display: flex; justify-content: center;\" +\n styleFormat.fromPadding(this.in.innerPad) +\n styleFormat.fromBackColour(this.in.backColour),\n },\n [\n h(\n \"span\",\n {},\n this.visibleChildren.value.map((child) => child.render(h))\n ),\n ]\n );\n }\n}\n\nclass CenteredDiv extends ContainerSingle {\n constructor(...opts: PartialQ[]) {\n super(centeredDefaults, ...opts);\n }\n\n render(h: CreateElement) {\n return h(\n \"div\",\n {\n style:\n \"display: flex; justify-content: center; width: 100%; \" +\n //styleFormat.fromMaxWidth(this.in.maxWidth) +\n styleFormat.fromPadding(this.in.innerPad) +\n styleFormat.fromBackColour(this.in.backColour),\n },\n [\n h(\n \"div\",\n {\n style: \"width: 100%; \" + styleFormat.fromMaxWidth(this.in.maxWidth),\n },\n this.visibleChildren.value.map((child) => child.render(h))\n ),\n ]\n );\n }\n}\n\nconst leftCenterRightDefaults = extendDefaults(controlDefaults, {\n innerPad: null as IPadding | null,\n gap: 0,\n});\ntype LeftCenterRightIn = typeof leftCenterRightDefaults;\n\nclass LeftCenterRight extends TpControl {\n private _left = makeRef(null);\n private _center = makeRef(null);\n private _right = makeRef(null);\n\n constructor(...opts: PartialQ[]) {\n super(leftCenterRightDefaults, ...opts);\n }\n\n private updateChildsParent(\n oldChild: Maybe,\n newChild: Maybe\n ) {\n if (oldChild !== newChild) {\n if (oldChild) {\n oldChild.parent = null;\n }\n if (newChild) {\n newChild.parent = this;\n }\n }\n }\n\n public setLeft(control: Maybe) {\n this.updateChildsParent(this._left.value, control);\n this._left.value = control ?? null;\n }\n\n public setCenter(control: Maybe) {\n this.updateChildsParent(this._center.value, control);\n this._center.value = control ?? null;\n }\n\n public setRight(control: Maybe) {\n this.updateChildsParent(this._right.value, control);\n this._right.value = control ?? null;\n }\n\n private renderedControl(control: IControl | null, h: CreateElement) {\n return control && control.in.visible ? [control.render(h)] : [];\n }\n\n render(h: CreateElement) {\n return h(\n \"div\",\n {\n style: \"display: flex; \" + styleFormat.fromPadding(this.in.innerPad),\n },\n [\n h(\"span\", {}, this.renderedControl(this._left.value, h)),\n h(\n \"span\",\n {\n style:\n \"flex: 1; display: flex; justify-content: center; padding-left: \" +\n this.in.gap +\n \"px; padding-right: \" +\n this.in.gap +\n \"px\",\n },\n this.renderedControl(this._center.value, h)\n ),\n h(\"span\", {}, this.renderedControl(this._right.value, h)),\n ]\n );\n }\n}\n\nconst hStackDefaults = extendDefaults(containerControlDefaults, {\n // None : No handling of spare space\n // GrowFirst : Grow the first child to take up spare space\n // GrowLast : Grow the last child to take up spare space\n // GrowAll : Grow all children equally to take up spare space\n // Spread : Spread the children out to use up spare space\n spareSpace: \"none\" as\n | \"none\"\n | \"growfirst\"\n | \"growsecond\"\n | \"growlast\"\n | \"growall\"\n | \"spread\",\n gap: 0,\n});\n\ntype HStackIn = typeof hStackDefaults;\n\nclass HStack extends ContainerMultiple {\n constructor(...opts: PartialQ[]) {\n super(hStackDefaults, ...opts);\n }\n\n render(h: CreateElement) {\n const spare = this.in.spareSpace;\n const visibleChildren = this.visibleChildren.value;\n\n const childNodes = visibleChildren.map((child, index) => {\n const grows =\n spare === \"growall\" ||\n (spare === \"growfirst\" && index === 0) ||\n (spare === \"growsecond\" && index === 1) ||\n (spare === \"growlast\" && index === visibleChildren.length - 1);\n\n return h(\n \"span\",\n {\n style: grows ? \"flex: 1;\" : \"\",\n },\n [child.render(h)]\n );\n });\n\n return h(\n \"div\",\n {\n style:\n \"width: 100%; display: flex; flex-flow: row wrap; justify-content:\" +\n (this.in.spareSpace === \"spread\"\n ? \"space-between; \"\n : \"flex-start; \") +\n \"gap: \" +\n this.in.gap +\n \"px; \" +\n styleFormat.fromPadding(this.in.innerPad) +\n styleFormat.fromBackColour(this.in.backColour),\n },\n\n childNodes\n );\n }\n}\n\nconst hSpanDefaults = extendDefaults(containerControlDefaults, {\n gap: 0,\n});\n\ntype HSpanIn = typeof hSpanDefaults;\n\nclass HSpan extends ContainerMultiple {\n constructor(...opts: PartialQ[]) {\n super(hSpanDefaults, ...opts);\n }\n\n render(h: CreateElement) {\n const visibleChildren = this.visibleChildren.value;\n\n const childNodes = visibleChildren.map((child, index) =>\n h(\n \"span\",\n {\n style:\n \"display: inline-block; \" +\n (this.in.gap > 0 && index !== visibleChildren.length - 1\n ? \"padding-right: \" + this.in.gap + \"px; \"\n : \"\"),\n },\n [child.render(h)]\n )\n );\n\n return h(\n \"span\",\n {\n style:\n //\"width: max-content;\" +\n styleFormat.fromPadding(this.in.innerPad) +\n styleFormat.fromBackColour(this.in.backColour),\n },\n childNodes\n );\n }\n}\n\nconst spanDefaults = extendDefaults(containerControlDefaults, {\n gap: 0,\n});\n\ntype SpanIn = typeof spanDefaults;\n\nclass Span extends ContainerMultiple {\n constructor(...opts: PartialQ[]) {\n super(spanDefaults, ...opts);\n }\n\n render(h: CreateElement) {\n const visibleChildren = this.visibleChildren.value;\n\n const childNodes = visibleChildren.map((child, index) =>\n this.in.gap === 0\n ? child.render(h)\n : h(\"span\", { style: \"padding-left: \" + this.in.gap + \"px; \" }, [\n child.render(h),\n ])\n );\n\n return h(\n \"span\",\n {\n style:\n styleFormat.fromPadding(this.in.innerPad) +\n styleFormat.fromBackColour(this.in.backColour),\n },\n childNodes\n );\n }\n}\n\nconst leftRightDefaults = extendDefaults(controlDefaults, {\n innerPad: null as IPadding | null,\n});\ntype LeftRightIn = typeof leftRightDefaults;\n\nexport class LeftRight extends TpControl {\n private _left = makeRef(null);\n private _right = makeRef(null);\n\n constructor(...opts: PartialQ[]) {\n super(leftRightDefaults, ...opts);\n }\n\n private updateChildsParent(\n oldChild: Maybe,\n newChild: Maybe\n ) {\n if (oldChild !== newChild) {\n if (oldChild) {\n oldChild.parent = null;\n }\n if (newChild) {\n newChild.parent = this;\n }\n }\n }\n\n public setLeft(control: Maybe) {\n this.updateChildsParent(this._left.value, control);\n this._left.value = control ?? null;\n }\n\n public setRight(control: Maybe) {\n this.updateChildsParent(this._right.value, control);\n this._right.value = control ?? null;\n }\n\n render(h: CreateElement) {\n const left = this._left.value;\n const right = this._right.value;\n return h(\n \"div\",\n {\n style:\n \"width: 100%; display: flex; flex-flow: row wrap; justify-content: space-between; \" +\n styleFormat.fromPadding(this.in.innerPad),\n },\n [\n left && left.in.visible ? left.render(h) : h(\"span\"),\n right && right.in.visible ? right.render(h) : h(\"span\"),\n ]\n );\n }\n}\n\nconst tpLayouts = {\n vStack: (opts?: Partial, contents?: readonly IControl[]) => {\n const vstack = new VStack(opts);\n vstack.setChildren(contents ?? []);\n return vstack;\n },\n centered: (opts?: Partial, contents?: IControl) => {\n const centered = new Centered(opts);\n centered.setChild(contents);\n return centered;\n },\n centeredDiv: (opts?: Partial, contents?: IControl) => {\n const centered = new CenteredDiv(opts);\n centered.setChild(contents);\n return centered;\n },\n leftCenterRight: (\n opts?: Partial,\n left?: IControl | null,\n center?: IControl | null,\n right?: IControl | null\n ) => {\n const control = new LeftCenterRight(opts);\n control.setLeft(left);\n control.setCenter(center);\n control.setRight(right);\n return control;\n },\n hStack: (opts?: Partial, contents?: readonly IControl[]) => {\n const hstack = new HStack(opts);\n hstack.setChildren(contents ?? []);\n return hstack;\n },\n hSpan: (opts?: Partial, contents?: readonly IControl[]) => {\n const ctrl = new HSpan(opts);\n ctrl.setChildren(contents ?? []);\n return ctrl;\n },\n span: (opts?: Partial, contents?: readonly IControl[]) => {\n const ctrl = new Span(opts);\n ctrl.setChildren(contents ?? []);\n return ctrl;\n },\n leftRight: (\n opts?: Partial,\n left?: IControl | null,\n right?: IControl | null\n ) => {\n const control = new LeftRight(opts);\n control.setLeft(left);\n control.setRight(right);\n return control;\n },\n vSpace: (opts?: Partial) => new VSpace(opts),\n};\n\nexport { tpLayouts };\n","import type { ControlIn, IControl } from \"@/controls/control\";\nimport { Control, extendIn, mergeIn } from \"@/controls/control\";\nimport type { CreateElement } from \"vue\";\nimport { watchEffect, type ShallowReactive } from \"vue\";\nimport BmBtn from \"@/components/controls/input/BmBtn.vue\";\nimport type { Location } from \"vue-router\";\nimport type { PartialQ } from \"@/controls/tpcontrol\";\nimport {\n controlDefaults,\n extendDefaults,\n TpControl,\n} from \"@/controls/tpcontrol\";\nimport { tpLayouts } from \"@/tradeportal/tpcontrols/tpLayouts\";\nimport { useVuetify } from \"@/plugins/vuetify\";\nimport { VBottomSheet, VSheet } from \"vuetify/lib\";\nimport { makeRef } from \"@/components/composables/reactivityTypes\";\nimport messages from \"@/plugins/i18n\";\n\ntype ButtonType = \"primary\" | \"secondary\" | \"ghost\";\ntype ButtonIn = ControlIn & {\n type: ButtonType;\n text: string;\n toLocation: Location | null;\n fullWidth: boolean;\n};\n\nexport class Button extends Control {\n #in: ShallowReactive;\n public onClick: () => void = () => {};\n\n get in() {\n return this.#in;\n }\n\n constructor(type: ButtonType, initialText: string) {\n super();\n this.#in = extendIn(super.in, {\n type,\n text: initialText,\n toLocation: null,\n fullWidth: false,\n });\n }\n\n render(h: any) {\n const inp = () => this.onClick();\n\n return h(BmBtn, {\n props: {\n buttonType: this.in.type,\n label: this.in.text,\n },\n attrs: {\n disabled: !this.resolveEnabled(),\n to: this.in.toLocation,\n block: this.in.fullWidth,\n },\n on: {\n click: inp,\n },\n });\n }\n}\n\nconst moreButtonDefaults = extendDefaults(controlDefaults, {\n text: \"\", // Will be resolved to translation for \"More\" when button constructed\n fullWidth: false,\n buttons: [] as readonly IControl[],\n moreMode: \"sheet\" as const, // Sheet is a bottom sheet. May add Eg popup menu in future.\n});\n\nexport type MoreButtonIn = typeof moreButtonDefaults;\n\nexport class MoreButton extends TpControl {\n private _showBottomSheet = makeRef(false);\n\n render(h: CreateElement) {\n const inp = () => (this._showBottomSheet.value = true);\n return h(\n VBottomSheet,\n {\n props: {\n value: this._showBottomSheet.value,\n },\n on: {\n input: (val: boolean) => {\n this._showBottomSheet.value = val;\n },\n },\n scopedSlots: {\n activator: () => {\n return h(BmBtn, {\n props: {\n buttonType: \"secondary\",\n label: this.in.text,\n },\n attrs: {\n disabled: !this.resolveEnabled(),\n block: this.in.fullWidth,\n },\n on: {\n click: inp,\n },\n });\n },\n },\n },\n [\n h(VSheet, { class: \"button-bar\" }, [\n h(\n \"div\",\n {\n class: \"sheet-container flex\",\n },\n this.in.buttons.filter((x) => x.in.visible).map((x) => x.render(h))\n ),\n ]),\n ]\n );\n }\n\n constructor(...opts: PartialQ[]) {\n super(moreButtonDefaults, ...opts);\n }\n}\n\nconst more = (opts?: Partial) =>\n new MoreButton({ text: messages.more }, opts);\n\n/**\n * left: Controls to show on left as desktop - typically \"Cancel\"\n * primary: Important controls to show on the right, and to always show on Mobile - typically \"Save\" / \"OK\" / \"Confirm\"\n * right: Controls to show on right as desktop in addition to primary. Often empty, but sometimes secondary buttons\n *\n * On mobile, if there is one control it will be shown, if more than one then everything other than primary is\n * wrapped under a \"More\" button.\n */\nconst dialogButtonLayoutDefaults = extendDefaults(controlDefaults, {\n left: [] as readonly IControl[],\n primary: [] as readonly IControl[],\n right: [] as readonly IControl[],\n});\n\nexport type DialogButtonLayoutIn = typeof dialogButtonLayoutDefaults;\n\nexport class DialogButtonLayout extends TpControl {\n private _vStack = tpLayouts.vStack({ spaceBetween: 8 });\n private _desktopLeftRight = tpLayouts.leftRight();\n private _vuetify = useVuetify().$vuetify;\n private _mobileMoreBtn = more({ fullWidth: true });\n\n render(h: any) {\n return this._vStack.render(h);\n }\n\n constructor(opts?: Partial) {\n super(dialogButtonLayoutDefaults, opts);\n\n const desktopLeftHStack = tpLayouts.hSpan({ gap: 8 });\n const desktopRightHStack = tpLayouts.hSpan({ gap: 8 });\n\n this._desktopLeftRight.setLeft(desktopLeftHStack);\n this._desktopLeftRight.setRight(desktopRightHStack);\n\n watchEffect(() => {\n const isMobile = this._vuetify.breakpoint.xsOnly;\n const right = this.in.right.filter((x) => x.in.visible);\n const left = this.in.left.filter((x) => x.in.visible);\n const primary = this.in.primary.filter((x) => x.in.visible);\n\n const all = left.concat(right).concat(primary);\n\n if (isMobile) {\n desktopLeftHStack.setChildren([]);\n desktopRightHStack.setChildren([]);\n if (all.length < 2) {\n // Only 1 (or 0) buttons - just show it\n this._vStack.setChildren(all);\n } else {\n // 2 or more buttons - just show the primary (if any) and put the others in more.\n this._vStack.setChildren(\n [this._mobileMoreBtn as IControl].concat(primary)\n );\n this._mobileMoreBtn.in.buttons = left.concat(right);\n }\n } else {\n this._vStack.setChildren([this._desktopLeftRight]);\n desktopLeftHStack.setChildren(left);\n desktopRightHStack.setChildren(right.concat(primary));\n }\n\n for (const child of all) {\n const c = child as any;\n if (c && c.in && Object.hasOwn(c.in, \"fullWidth\")) {\n c.in.fullWidth = this._vuetify.breakpoint.xs;\n }\n }\n });\n }\n}\n\nconst buttons = {\n ghost: (initialText: string, opts?: Partial) =>\n mergeIn(new Button(\"ghost\", initialText), opts ?? {}),\n primary: (initialText: string, opts?: Partial) =>\n mergeIn(new Button(\"primary\", initialText), opts ?? {}),\n primaryRoute: (\n initialText: string,\n initialTo: Location | null,\n opts?: Partial\n ) => {\n opts = Object.assign({}, opts ?? {});\n opts.toLocation = initialTo;\n return mergeIn(new Button(\"primary\", initialText), opts);\n },\n secondary: (initialText: string, opts?: Partial) =>\n mergeIn(new Button(\"secondary\", initialText), opts ?? {}),\n dialogButtonLayout: (opts?: Partial) =>\n new DialogButtonLayout(opts),\n more,\n};\n\nexport { buttons };\n"],"names":[],"mappings":"8oCAGA,MAAM,YAAc,OAAC,SACZ,QACH,YACE,QAAQ,IACR,MACA,QAAQ,MACR,MACA,QAAQ,OACR,MACA,QAAQ,KACR,OACF,GAXc,eAcd,YAAc,CAClB,YACA,eAAiB,YACf,WAAa,qBAAuB,WAAa,KAAO,GAC1D,aAAe,UACb,SAAW,cAAgB,SAAW,OAAS,GACjD,WAAa,QACX,OAAS,UAAY,OAAS,KAAO,EACzC,ECZa,yBAA2B,eAAe,gBAAiB,CACtE,WAAY,GACZ,SAAU,IACZ,CAAC,EAID,MAAe,yBAEL,SAAe,CACvB,YAAY,YAAkB,KAAuB,CAC7C,MAAA,SAAU,GAAG,IAAI,EAGjB,8BAAW,QAA6B,CAAA,CAAE,GAExC,qCAAkB,SAAS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