@stonecrop/aform 0.16.2 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aform.d.ts +42 -0
- package/dist/aform.js +1216 -3802
- package/dist/aform.js.map +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/types/index.d.ts +37 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +7 -7
- package/src/components/form/ACurrencyInput.vue +357 -0
- package/src/components/form/ADatePicker.vue +1 -1
- package/src/components/form/AFormLink.vue +79 -12
- package/src/components/form/AQuantityInput.vue +4 -4
- package/src/index.ts +3 -0
- package/src/types/index.ts +39 -0
package/dist/assets/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.atable-cell{border-radius:0;box-sizing:border-box;outline:none;box-shadow:none;color:var(--sc-cell-text-color);padding-left:.5ch!important;padding-right:.5ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);border-spacing:0px;border-collapse:collapse;overflow:hidden;text-overflow:ellipsis;order:1;white-space:nowrap;max-width:40ch;border-top:1px solid var(--sc-row-border-color);margin:0 0 0 1px}.atable-cell a{color:var(--sc-cell-text-color);text-decoration:none}.atable-cell:focus,.atable-cell:focus-within{background-color:var(--sc-focus-cell-background);outline-width:var(--sc-atable-cell-border-width);outline-style:solid;outline-offset:calc(var(--sc-atable-cell-border-width) * -1);outline-color:var(--sc-focus-cell-outline);box-shadow:none;overflow:hidden;text-wrap:nowrap;box-sizing:border-box}.cell-modified{font-weight:700;font-style:italic}.cell-modified-highlight{background-color:var(--sc-cell-changed-color)}.aganttcell[data-v-032ef6d9]{background-color:#f9f9f9;width:100%;padding:0;height:100%}.gantt-container[data-v-032ef6d9]{position:relative;height:100%;background-color:#f0f0f0;border-radius:4px;overflow:visible}.gantt-bar[data-v-032ef6d9]{position:absolute;border-radius:4px;display:flex;align-items:center;justify-content:space-between;cursor:grab;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);transition:left .1s ease-out,width .1s ease-out;height:80%;top:50%;z-index:0;transform:translateY(-50%)}.gantt-bar[data-v-032ef6d9]:active{cursor:grabbing}.gantt-bar.is-dragging[data-v-032ef6d9]{z-index:10}.gantt-label[data-v-032ef6d9]{flex:1;text-align:center;font-size:12px;color:#aaa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 8px;-webkit-user-select:none;user-select:none}.resize-handle[data-v-032ef6d9]{position:relative;width:12px;height:100%;cursor:ew-resize;display:flex;align-items:center;justify-content:center;z-index:0;background:#00000040}.left-resize-handle[data-v-032ef6d9]{border-right:1px solid rgba(0,0,0,.5)}.right-resize-handle[data-v-032ef6d9]{border-left:1px solid rgba(0,0,0,.5)}.handle-grip[data-v-032ef6d9]{width:4px;height:12px;border-radius:2px;background:#000c}.resize-handle[data-v-032ef6d9]:hover{background-color:#ffffff80}.vertical-indicator[data-v-032ef6d9]{position:absolute;width:2px;opacity:0;pointer-events:none;transition:opacity .2s ease;top:-100vh;height:100vh;z-index:5;background-color:var(--v564d6da1)}.left-indicator[data-v-032ef6d9]{left:50%;transform:translate(-50%)}.right-indicator[data-v-032ef6d9]{right:50%;transform:translate(50%)}.resize-handle.is-dragging .vertical-indicator[data-v-032ef6d9]{opacity:.7}.gantt-container[data-v-032ef6d9]:after{content:"";position:absolute;inset:0;background-size:calc(100% / var(--v4f540c19)) 100%;background-image:linear-gradient(to right,rgba(0,0,0,.1) 1px,transparent 1px);pointer-events:none;z-index:1}.connection-handle[data-v-032ef6d9]{position:absolute;top:50%;transform:translateY(-50%);width:16px;height:16px;opacity:0;transition:opacity .2s ease;cursor:crosshair;z-index:2;display:flex;align-items:center;justify-content:center}.connection-handle.visible[data-v-032ef6d9]{opacity:1}.left-connection-handle[data-v-032ef6d9]{left:-16px}.right-connection-handle[data-v-032ef6d9]{right:-16px}.connection-dot[data-v-032ef6d9]{width:8px;height:8px;border-radius:50%;background-color:#2196f3;border:2px solid white;box-shadow:0 1px 3px #0000004d}.connection-handle:hover .connection-dot[data-v-032ef6d9]{background-color:#1976d2;transform:scale(1.2)}.connection-handle.is-dragging[data-v-032ef6d9]{opacity:1!important}.connection-handle.is-dragging .connection-dot[data-v-032ef6d9]{background-color:#1976d2;transform:scale(1.3);box-shadow:0 2px 8px #2196f366}.atable-row-actions{width:2rem;min-width:2rem;padding:0 .25rem;vertical-align:middle;white-space:nowrap;border-top:1px solid var(--sc-row-border-color);background:#fff;-webkit-user-select:none;user-select:none;position:relative}.atable-row-actions.dropdown-active{z-index:101}.row-actions-icons{display:flex;gap:.25rem;align-items:center;justify-content:center}.row-action-btn{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.125rem;border:none;background:transparent;cursor:pointer;border-radius:.25rem;transition:background-color .15s ease}.row-action-btn:hover{background-color:var(--sc-gray-10, #e5e5e5)}.row-action-btn:focus{outline:2px solid var(--sc-focus-cell-outline, #3b82f6);outline-offset:1px}.row-action-btn .action-icon{display:flex;align-items:center;justify-content:center;width:1rem;height:1rem}.row-action-btn .action-icon :deep(svg){width:100%;height:100%}.row-actions-dropdown{position:relative;display:inline-block}.row-actions-dropdown:has(button:focus){outline:2px solid var(--sc-focus-cell-outline);outline-offset:-2px}.row-actions-toggle{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:0;border:none;background:transparent;cursor:pointer;border-radius:.25rem;font-size:1rem;font-weight:700;transition:background-color .15s ease}.row-actions-toggle:hover{background-color:var(--sc-gray-10, #e5e5e5)}.dropdown-icon{line-height:1}.row-actions-menu{position:fixed;z-index:100;min-width:10rem;padding:.25rem 0;background:#fff;border:1px solid var(--sc-row-border-color);border-left:4px solid var(--sc-row-border-color);border-radius:0}.row-actions-menu.menu-flipped{box-shadow:0 -4px 6px -1px #0000001a,0 -2px 4px -2px #0000001a}.row-action-menu-item{display:flex;align-items:center;gap:.5rem;width:100%;padding:.5rem .75rem;border:none;background:transparent;cursor:pointer;text-align:left;font-size:.875rem;transition:background-color .15s ease}.row-action-menu-item:hover{background-color:var(--sc-gray-10, #f5f5f5)}.row-action-menu-item:focus{outline:none;background-color:var(--sc-gray-10, #f5f5f5)}.row-action-menu-item:disabled,.row-action-btn:disabled{opacity:.4;cursor:not-allowed}.row-action-menu-item:disabled:hover,.row-action-btn:disabled:hover{background-color:transparent}.row-action-menu-item .action-icon{display:flex;align-items:center;justify-content:center;width:1rem;height:1rem;flex-shrink:0}.row-action-menu-item .action-icon :deep(svg){width:100%;height:100%}.row-action-menu-item .action-label{flex:1}.atable-row{background-color:#fff}.atable-row-clickable{cursor:pointer}.atable-row-clickable:hover>td{background-color:var(--sc-row-hover-color, #f0f4f8)}.atable-row:last-child>td{border-bottom:1px solid var(--sc-row-border-color)}.atable-row>td:first-child{border-left:4px solid var(--sc-row-border-color)}.atable-row>td:last-child{border-right:1px solid var(--sc-row-border-color)}.list-index{color:var(--sc-header-text-color);font-weight:700;padding-left:var(--sc-atable-row-padding);padding-right:.5em;text-align:left;-webkit-user-select:none;user-select:none;border-top:1px solid var(--sc-row-border-color);text-overflow:ellipsis;overflow:hidden;box-sizing:border-box;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding)}.tree-index,.expansion-index{color:var(--sc-header-text-color);font-weight:700;text-align:center;-webkit-user-select:none;user-select:none;width:2ch;box-sizing:border-box;cursor:pointer;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding)}.atable-expanded-row{border-left:2px solid var(--sc-row-border-color)}.atable-expanded-content{border-top:1px solid var(--sc-row-border-color);padding:1.5rem}.atable-row:has(td.cell-modified)>td.sticky-column,.atable-row:has(td.cell-modified)>th.sticky-column,.atable-row:has(td.cell-modified)>td.sticky-index,.atable-row:has(td.cell-modified)>th.sticky-index{background:var(--sc-cell-changed-color)}.atable-row.changed-row-gradient[data-v-4dd47763]:has(td.cell-modified){--cell-color-start: color-mix(in srgb, var(--sc-cell-changed-color), #fff 20%);--cell-color-end: color-mix(in srgb, var(--sc-cell-changed-color), #fff 60%);background:linear-gradient(90deg,var(--cell-color-start),var(--cell-color-end))}.gantt-connection-overlay[data-v-d5929c98]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:15}.connection-path[data-v-d5929c98]{transition:stroke-width .2s ease;pointer-events:auto;cursor:pointer;stroke-dasharray:5px;stroke:var(--sc-cell-text-color)}#arrowhead-marker polygon[data-v-d5929c98]{fill:var(--sc-cell-text-color)}.animated-path[data-v-d5929c98]{animation:animated-dash-d5929c98 infinite 1.5s linear}.connection-path[data-v-d5929c98]:hover{stroke-width:3px}.connection-hitbox[data-v-d5929c98]{pointer-events:auto;cursor:pointer}@keyframes animated-dash-d5929c98{0%{stroke-dashoffset:0px}to{stroke-dashoffset:-10px}}.column-filter[data-v-3257dbbe]{display:flex;align-items:center;gap:.25rem;width:100%}.filter-input[data-v-3257dbbe],.filter-select[data-v-3257dbbe]{background-color:var(--sc-form-background)!important;padding:.15rem .2rem;border:1px solid var(--sc-form-border);border-radius:3px;font-size:.875rem;color:var(--sc-text-color);width:100%;box-sizing:border-box}.filter-input[data-v-3257dbbe]:focus,.filter-select[data-v-3257dbbe]:focus{outline:none;border-color:var(--sc-input-active-border-color)}.checkbox-filter[data-v-3257dbbe]{display:flex;align-items:center;gap:.25rem;font-size:.875rem;color:var(--sc-text-color);cursor:pointer}.filter-checkbox[data-v-3257dbbe]{margin:0}.date-range-filter[data-v-3257dbbe]{display:flex;gap:.25rem;align-items:center;width:100%}.date-range-filter .filter-input[data-v-3257dbbe]{flex:1;min-width:0}.date-separator[data-v-3257dbbe]{color:var(--sc-gray-50);font-weight:500;padding:0 .25rem;flex-shrink:0}.clear-btn[data-v-3257dbbe]{background:var(--sc-gray-10, #f0f0f0);border:1px solid var(--sc-form-border);border-radius:3px;color:var(--sc-gray-70);cursor:pointer;font-size:1rem;padding:.15rem .4rem;line-height:1;flex-shrink:0}.atable-header-row th{padding-left:.5ch!important;font-weight:700;min-width:3ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);box-sizing:border-box;color:var(--sc-header-text-color);position:relative}#header-index{padding-left:var(--sc-atable-row-padding);box-sizing:border-box;border-top:none}.tree-index{padding-right:0}th{order:1}.list-expansion-index{width:2ch;margin-left:5px}.cursor-pointer{cursor:pointer}.atable-filters-row th{padding:.25rem .5ch;vertical-align:top}.row-actions-header{width:2rem;min-width:2rem;padding:0 .25rem}.amodal{position:absolute;background-color:var(--sc-row-color-zebra-dark);z-index:200}.atable-container{position:relative}.sticky-index{position:sticky;left:0;z-index:100;order:0}.sticky-column,th.sticky-column,td.sticky-column,th.sticky-index,td.sticky-index{position:sticky;z-index:100;order:0;background:#fff}.sticky-column-edge,.atable th.sticky-column-edge{border-right:1px solid var(--sc-row-border-color)}.atable[data-v-4bfbbeab]{position:relative;font-family:var(--sc-atable-font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:var(--sc-table-font-size);border-collapse:collapse;box-sizing:border-box;table-layout:auto;width:auto;overflow:clip;height:1px}.atable th[data-v-4bfbbeab]{border-width:0px;border-style:solid;border-radius:0;padding-left:.5ch;padding-right:.5ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);color:var(--sc-gray-60);height:var(--sc-atable-row-height);font-weight:300;letter-spacing:.05rem;order:1;box-sizing:border-box}.atable th[data-v-4bfbbeab]:focus{outline:none}.atable[data-v-4bfbbeab]:tbody{overflow:hidden;position:relative}.atable[data-v-4bfbbeab]:tbody:before{content:"";position:absolute;top:0;left:0;right:0;height:1px;background-color:transparent;z-index:100}.aloading[data-v-a930a25b]{width:100%;border-top:1px solid var(--sc-row-border-color);border-bottom:1px solid var(--sc-row-border-color);display:flex;background-color:#fff;border-left:4px solid var(--sc-row-border-color);padding-left:.5ch!important;padding-right:.5ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);align-items:center;box-sizing:border-box;background:var(--sc-focus-cell-background);overflow:hidden;position:relative}.aloading-bar[data-v-a930a25b]{width:100%;height:100%;position:absolute;left:-100%;top:0;background:linear-gradient(90deg,rgba(var(--sc-table-loading-color),0),rgba(var(--sc-table-loading-color),1),rgba(var(--sc-table-loading-color),0));animation:gradient-a930a25b infinite 2s;z-index:0}.aloading-header[data-v-a930a25b]{color:var(--sc-cell-text-color);font-family:var(--sc-atable-font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:var(--sc-table-font-size);padding:0;margin:0;font-weight:400;z-index:1}.aloading-header[data-v-a930a25b]:after{content:"...";animation:ellipse-a930a25b 2s;animation-iteration-count:infinite}@keyframes gradient-a930a25b{0%{left:-100%}to{left:100%}}@keyframes ellipse-a930a25b{0%{content:""}20%{content:""}40%{content:"."}60%{content:".."}80%{content:"..."}}.aloading[data-v-e1165876]{width:100%;border-top:1px solid var(--sc-row-border-color);border-bottom:1px solid var(--sc-row-border-color);display:flex;background-color:#fff;border-left:4px solid var(--sc-row-border-color);padding-left:.5ch!important;padding-right:.5ch;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding);align-items:center;box-sizing:border-box;background:var(--sc-focus-cell-background);overflow:hidden;position:relative}.aloading-bar[data-v-e1165876]{width:50%;height:3px;position:absolute;left:-100%;bottom:0;background:var(--sc-row-border-color);animation:bar-left-e1165876 infinite 2s;z-index:0}.aloading-header[data-v-e1165876]{color:var(--sc-cell-text-color);font-family:var(--sc-atable-font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:var(--sc-table-font-size);padding:0;margin:0;font-weight:400;z-index:1}.aloading-header[data-v-e1165876]:after{content:"...";animation:ellipse-e1165876 2s;animation-iteration-count:infinite}@keyframes bar-left-e1165876{0%{left:-50%}to{left:100%}}@keyframes ellipse-e1165876{0%{content:""}20%{content:""}40%{content:"."}60%{content:".."}80%{content:"..."}}.aform_checkbox[data-v-ca06741d]{cursor:pointer;width:auto;margin-top:0;display:block}.aform_checkbox[data-v-ca06741d]:checked{accent-color:var(--sc-primary-color);border:1px solid black}.aform_checkbox-container[data-v-ca06741d]{width:100%;display:inline-block;text-align:left}.aform_checkbox-container input[data-v-ca06741d]{width:auto}.aform_checkbox-container:hover+.aform_field-label[data-v-ca06741d]{color:var(--sc-input-active-label-color)}.adatepicker[data-v-51c0c73a]{font-size:var(--sc-table-font-size);display:inline-table;color:var(--sc-cell-text-color);outline:none;border-collapse:collapse;margin-bottom:10px}.adatepicker tr[data-v-51c0c73a]{height:1.15rem;text-align:center;vertical-align:middle}.adatepicker td[data-v-51c0c73a]{border:2px solid transparent;outline:2px solid transparent;min-width:3ch;max-width:3ch;cursor:pointer}.adatepicker td.date-cell[data-v-51c0c73a]:hover{background:var(--sc-gray-10)}.adatepicker td[data-v-51c0c73a]:focus,.adatepicker td[data-v-51c0c73a]:focus-within{box-shadow:none;min-height:1.15em;max-height:1.15em;overflow:hidden}.adatepicker .selectedDate[data-v-51c0c73a],.adatepicker .startDate[data-v-51c0c73a],.adatepicker .endDate[data-v-51c0c73a]{background:var(--sc-gray-20);font-weight:bolder}.adatepicker .startDate[data-v-51c0c73a]{border-left:1px solid var(--sc-gray-50);background:var(--sc-gray-20)!important}.adatepicker .endDate[data-v-51c0c73a]{border-right:1px solid var(--sc-gray-50);background:var(--sc-gray-20)!important}.adatepicker .withinRange[data-v-51c0c73a]{background:var(--sc-gray-5)}.adatepicker .todaysDate[data-v-51c0c73a]{font-weight:bolder;color:#000}.days-header>td[data-v-51c0c73a]{font-weight:700}.prev-date[data-v-51c0c73a]{color:var(--sc-gray-20)}.adatepicker .date-input[data-v-51c0c73a]{display:flex;width:100%;gap:5px;align-items:center}.adatepicker .date-input>input[data-v-51c0c73a]{width:50%;padding:2px}p.aform_error[data-v-51c0c73a]{position:static;display:block;color:var(--sc-brand-danger, red);font-size:.7rem;margin:.25rem 0 0}.adate_time[data-v-959a3e41]{width:auto;padding:10px;box-sizing:border-box;font-size:1rem;background:var(--sc-gray-10)}.adate_time_fields[data-v-959a3e41]{display:flex;align-items:stretch;gap:5px;justify-content:flex-start}.adate_time_fields>input[data-v-959a3e41]{min-width:30px;padding:2px;text-align:center;display:inline-block;flex-basis:0}.meridiem-selector[data-v-959a3e41]{cursor:pointer;display:inline-block;flex-basis:0;padding:5px;-webkit-user-select:none;user-select:none}.meridiem-selector[data-v-959a3e41]:focus{outline:2px solid black;outline-offset:-2px}.adate_time_segment[data-v-959a3e41]{display:flex;flex-direction:column;width:40px}.colon[data-v-959a3e41]{display:flex;align-items:normal}.aform_form-btn[data-v-959a3e41]{cursor:pointer}.aform-select[data-v-959a3e41]{border:1px solid rgb(118,118,118);font-size:1rem;padding:0rem;margin:0;border-radius:0;box-sizing:border-box;min-height:auto;position:relative;color:var(--sc-cell-text-color)}.meridiem-selector[data-v-959a3e41]{margin-left:6px}.adate-selection[data-v-eeadb3e2]{display:inline-block;border:1px solid var(--sc-gray-80);padding:10px;background:var(--sc-form-background)}.adate-selection__end-label[data-v-eeadb3e2]{font-size:.8em;font-weight:700;color:var(--sc-input-active-label-color, #555);margin-top:8px;margin-bottom:2px;padding-left:2px}.empty[data-v-eeadb3e2]{color:#ccc;padding:10px;text-align:center;border:1px solid #ccc}.adate-input[data-v-a73c275b]{overflow:auto}div[data-v-a73c275b]{min-width:40ch;width:100%;box-sizing:border-box;border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}input[data-v-a73c275b]{width:calc(100% - 1ch);box-sizing:border-box;outline:1px solid transparent;border:1px solid var(--sc-input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;min-height:1.15rem;border-radius:.25rem}p[data-v-a73c275b],label[data-v-a73c275b]{color:var(--sc-input-label-color);display:block;min-height:1.15rem;padding:0rem;margin:0rem 0rem .25rem;border:1px solid transparent;box-sizing:border-box}p[data-v-a73c275b]{width:100%;color:red;font-size:85%;box-sizing:border-box}label[data-v-a73c275b]{z-index:0;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch;box-sizing:border-box}input[data-v-a73c275b]:focus{border:1px solid var(--sc-input-active-border-color)}input:focus+label[data-v-a73c275b]{color:var(--sc-input-active-label-color)}.picker[data-v-a73c275b]{position:absolute;top:50px}.autocomplete[data-v-2b75e2d5]{position:relative}.input-wrapper[data-v-2b75e2d5]{border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}input[data-v-2b75e2d5]{width:calc(100% - 1ch);outline:1px solid transparent;border:1px solid var(--sc-input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;min-height:1.15rem;border-radius:.25rem;font-family:var(--sc-font-family)}input[data-v-2b75e2d5]:focus{border:1px solid var(--sc-input-active-border-color);border-radius:.25rem .25rem 0 0;border-bottom:none}label[data-v-2b75e2d5]{display:block;min-height:1.15rem;padding:0rem;margin:0rem 0rem .25rem;border:1px solid transparent;z-index:0;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch}.autocomplete-results[data-v-2b75e2d5]{position:absolute;width:calc(100% - 1ch + 1.5px);z-index:100;padding:0;margin:0;color:var(--sc-input-active-border-color);border:1px solid var(--sc-input-active-border-color);border-radius:0 0 .25rem .25rem;border-top:none;background-color:#fff}.autocomplete-result[data-v-2b75e2d5]{list-style:none;text-align:left;padding:4px 6px;cursor:pointer;border-bottom:.5px solid lightgray}.autocomplete-result.is-active[data-v-2b75e2d5],.autocomplete-result[data-v-2b75e2d5]:hover{background-color:var(--sc-row-color-zebra-light);color:var(--sc-input-active-border-color)}p.aform_error[data-v-2b75e2d5]{position:static;display:block;color:var(--sc-brand-danger, red);font-size:.7rem;margin:.25rem 0 0}.aduration[data-v-22611dd6]{position:relative;min-width:40ch;width:100%}.aduration__summary[data-v-22611dd6]{display:flex;gap:6px;align-items:baseline;margin-top:6px;font-size:.9em}.aduration__label[data-v-22611dd6]{font-weight:700;color:var(--sc-input-active-label-color, #555)}.aduration__value[data-v-22611dd6]{color:var(--sc-cell-text-color, #000)}.aduration__ms[data-v-22611dd6]{color:var(--sc-gray-50, #888);font-size:.85em}.aduration__footer[data-v-22611dd6]{margin-top:8px}.adaterange[data-v-b5838478]{min-width:40ch;width:100%;box-sizing:border-box;border:1px solid transparent;padding:0;margin:0;margin-right:1ch;position:relative;overflow:visible}.adate-input[data-v-b5838478]{width:calc(100% - 1ch);box-sizing:border-box;outline:1px solid transparent;border:1px solid var(--sc-input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;min-height:1.15rem;border-radius:.25rem;cursor:pointer;background:#fff;font-size:1rem}.adate-input[data-v-b5838478]:focus{border:1px solid var(--sc-input-active-border-color)}.adate-input:focus+label[data-v-b5838478]{color:var(--sc-input-active-label-color)}p[data-v-b5838478],label[data-v-b5838478]{color:var(--sc-input-label-color);display:block;min-height:1.15rem;padding:0;margin:0;border:1px solid transparent;margin-bottom:.25rem;box-sizing:border-box}p[data-v-b5838478]{width:100%;color:red;font-size:85%}label[data-v-b5838478]{z-index:0;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch;box-sizing:border-box}.picker[data-v-b5838478]{position:absolute;top:50px;left:0;z-index:1000}.aform input{font-family:var(--sc-font-family);border:none}.aform_form-element{padding:0;margin:0;position:relative;box-sizing:border-box;flex-grow:1;min-width:20ch}.aform__grid--full{flex-basis:100%;width:100%}.aform_input-field{outline:1px solid var(--sc-input-border-color);outline-offset:-1px;font-size:1rem;padding:.5rem;margin:0;border-radius:0;box-sizing:border-box;width:100%;min-height:auto;position:relative;color:var(--sc-cell-text-color);background:var(--sc-input-field-background);font-family:var(--sc-font-family)}.aform_input-field:focus{outline:1px solid var(--sc-input-active-border-color)}.aform_display-value{display:block;padding:.5rem;min-height:2rem;color:var(--sc-cell-text-color);word-break:break-word}.aform_input-field:focus+.aform_field-label{color:var(--sc-input-active-label-color)}.aform_field-label{color:var(--sc-input-label-color);display:inline-block;position:absolute;padding:0 .25rem;margin:0rem;z-index:1;font-size:.7rem;font-weight:300;letter-spacing:.05rem;background:linear-gradient(var(--sc-form-background) 50%,var(--sc-input-field-background) 50%);width:auto;box-sizing:border-box;background:#fff;margin:0;grid-row:1;top:0;left:10px;border:none;line-height:0;transform:translateY(-50%)}.aform_input-field:disabled,.aform_checkbox-container:has(.aform_checkbox:disabled){background:var(--sc-input-field-disabled-background)}.aform_input-field:disabled+.aform_field-label,.aform_checkbox-container:has(.aform_checkbox:disabled)+.aform_field-label{background:linear-gradient(var(--sc-form-background) 50%,var(--sc-input-field-disabled-background) 50%)}.aform_input-field:disabled~p.aform_error,.aform_checkbox-container:has(.aform_checkbox:disabled)~p.aform_error{background:linear-gradient(var(--sc-form-background) 50%,var(--sc-input-field-disabled-background) 50%)}.aform_field-label:after{margin:0;padding:0;box-sizing:border-box;content:"";line-height:normal}p.aform_error{display:inline-block;background:linear-gradient(var(--sc-form-background) 50%,var(--sc-input-field-background) 50%);padding:0 .25rem;margin:0rem;width:auto;color:var(--sc-brand-danger);font-size:.7rem;position:absolute;right:0;top:0;line-height:0;background:#fff;padding:.25rem;transform:translate(-1rem,-50%);margin:0}.aform[data-v-bb17171c]{display:flex;flex-wrap:wrap;gap:1rem;padding:1rem;border:1px solid var(--sc-form-border);border-left:4px solid var(--sc-form-border);margin-bottom:1rem;max-width:100%}@media screen and (max-width:400px){.aform[data-v-bb17171c]{flex-direction:column}}.aform-nested-section[data-v-bb17171c]{width:100%;padding:.5rem 0}.aform-nested-label[data-v-bb17171c]{font-size:.9rem;font-weight:600;margin:0 0 .5rem;color:var(--sc-input-label-color, #666)}.aform-nested-section .aform[data-v-bb17171c]{border-left-width:2px;margin-left:.5rem}.collapse-button[data-v-6f1c1b45]{width:2ch;min-width:calc(66px - 4ch);background-color:transparent;font-size:150%;text-align:center;border:none;margin-top:-.5rem}.rotated[data-v-6f1c1b45]{transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transition:transform .25s;transform-origin:center center}.unrotated[data-v-6f1c1b45]{transform:rotate(0);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg);transition:transform .25s}fieldset[data-v-162e7317]{max-width:100%;width:100%;margin-right:2ch;border:1px solid transparent;border-bottom:1px solid var(--sc-gray-50)}legend[data-v-162e7317]{width:100%;height:1.15rem;border:1px solid transparent;padding-bottom:.5rem;font-size:110%;font-weight:600;-webkit-user-select:none;user-select:none}.collapse-button[data-v-162e7317]{float:right}.aform_file-attach[data-v-8eefd179]{padding:1rem;display:flex;flex-wrap:wrap;gap:1rem;flex-direction:row;justify-content:center;align-items:center;border:1px dashed var(--sc-input-border-color);width:100%}@media screen and (max-width:400px){.aform_file-attach>.aform_form-btn[data-v-8eefd179]{width:100%}}.aform_file-attach-feedback[data-v-8eefd179]{color:var(--sc-input-label-color);width:100%;padding:.5rem;text-align:center;align-self:center}.aform_file-attach-feedback>li[data-v-8eefd179]{list-style:none;font-style:italic}.aform_file-attach-feedback>p[data-v-8eefd179]{margin-top:0}.aform_form-btn[data-v-8eefd179]{padding:.5rem 2rem;width:auto;border:1px solid var(--sc-input-border-color);color:var(--sc-input-label-color);cursor:pointer;background-color:#fff}.aform_form-btn[data-v-8eefd179]:disabled{background-color:var(--sc-gray-5)}.aform_form-link-wrapper[data-v-4b68886b]{position:relative}.input-group[data-v-4b68886b]{display:flex;align-items:stretch}.aform_input-field[data-v-4b68886b]{flex:1;min-width:0}.aform_form-btn[data-v-4b68886b]{appearance:none;border:none;outline:1px solid var(--sc-input-border-color);outline-offset:-1px;margin-left:-2px;background:var(--sc-input-field-background, white);padding:0 .75rem;cursor:pointer}.aform_form-btn[data-v-4b68886b]:focus,.input-group:focus-within .aform_form-btn[data-v-4b68886b]{outline-color:var(--sc-input-active-border-color)}.autocomplete-results[data-v-4b68886b]{position:absolute;width:100%;z-index:100;padding:0;margin:0;list-style:none;border:1px solid var(--sc-input-active-border-color);border-top:none;border-radius:0 0 .25rem .25rem;background:#fff}.autocomplete-result[data-v-4b68886b]{padding:4px 6px;cursor:pointer;border-bottom:.5px solid lightgray}.autocomplete-result.is-active[data-v-4b68886b],.autocomplete-result[data-v-4b68886b]:hover{background-color:var(--sc-row-color-zebra-light);color:var(--sc-input-active-border-color)}.aquantity__row[data-v-75e7ebee]{display:flex;gap:1ch}.aquantity__row--stock[data-v-75e7ebee]{margin-top:1.5rem}.aquantity__field[data-v-75e7ebee]{position:relative;flex:1;min-width:0}.aquantity__group[data-v-75e7ebee]{display:flex;align-items:stretch;width:100%;border:1px solid var(--sc-input-border-color);border-radius:.25rem}.aquantity__group[data-v-75e7ebee]:focus-within{border-color:var(--sc-input-active-border-color)}.aquantity__qty[data-v-75e7ebee]{flex:1;min-width:0;border:none;outline:none;padding:.5ch 1ch;background:transparent;border-radius:.25rem 0 0 .25rem;appearance:textfield;-moz-appearance:textfield}.aquantity__qty[data-v-75e7ebee]::-webkit-outer-spin-button,.aquantity__qty[data-v-75e7ebee]::-webkit-inner-spin-button{appearance:none;-webkit-appearance:none;margin:0}.aquantity__uom[data-v-75e7ebee]{position:relative;flex:0 0 auto;border-left:1px solid var(--sc-input-border-color)}.aquantity__uom-toggle[data-v-75e7ebee]{display:flex;align-items:center;gap:.75ch;height:100%;padding:.5ch 1ch;background:var(--sc-gray-5);border:none;border-radius:0 .25rem .25rem 0;white-space:nowrap;cursor:pointer}.aquantity__uom-toggle[data-v-75e7ebee]:disabled{cursor:not-allowed;color:var(--sc-gray-50, #888)}.aquantity__caret[data-v-75e7ebee]{display:inline-block;width:0;height:0;border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.3em solid currentColor}.aquantity__uom-menu[data-v-75e7ebee]{position:absolute;top:100%;right:0;z-index:100;min-width:100%;margin:.15rem 0 0;padding:.25rem 0;list-style:none;background:var(--sc-input-field-background, #fff);border:1px solid var(--sc-input-active-border-color);border-radius:.25rem}.aquantity__uom-option[data-v-75e7ebee]{padding:.4ch 1ch;white-space:nowrap;cursor:pointer}.aquantity__uom-option.is-active[data-v-75e7ebee],.aquantity__uom-option[data-v-75e7ebee]:hover{background-color:var(--sc-row-color-zebra-light)}.aquantity__stock-field[data-v-75e7ebee]{width:100%;font-size:1rem;padding:.5ch 1ch;border:1px solid var(--sc-input-border-color);border-radius:.25rem;outline:none}.aquantity__stock-field[data-v-75e7ebee]:disabled{color:var(--sc-gray-50, #888)}.aform_textbox[data-v-2a9c793b]{resize:vertical;line-height:1.5;min-height:4rem;font-family:inherit}.aform_textbox-display[data-v-2a9c793b]{white-space:pre-wrap}.login-container[data-v-2c0f0634]{width:100%;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;font-family:var(--sc-font-family)}.account-container[data-v-2c0f0634]{width:100%;margin-left:auto;margin-top:.5rem;margin-right:auto;display:flex;flex-direction:column;justify-content:center}.account-header[data-v-2c0f0634]{display:flex;flex-direction:column;text-align:center;margin-top:.5rem}#account-title[data-v-2c0f0634]{font-size:1.5rem;line-height:2rem;font-weight:600;letter-spacing:-.025em;margin:0}#account-subtitle[data-v-2c0f0634]{font-size:.875rem;line-height:1.25rem;margin:1rem}.login-form-container[data-v-2c0f0634]{display:grid;gap:.5rem}.login-form-element[data-v-2c0f0634]{display:grid;margin:.5rem 0;position:relative}.login-field[data-v-2c0f0634]{padding:.5rem .25rem .25rem .5rem;outline:1px solid transparent;border:1px solid var(--sc-input-border-color);border-radius:.25rem}.login-field[data-v-2c0f0634]:focus{border:1px solid black}.btn[data-v-2c0f0634]{background-color:var(--sc-btn-color);color:var(--sc-btn-label-color);border:1px solid var(--sc-btn-border);margin:.5rem 0;padding:.25rem;position:relative;cursor:pointer}.btn[data-v-2c0f0634]:hover{background-color:var(--sc-btn-hover)}.btn[data-v-2c0f0634]:disabled{background-color:var(--sc-input-field-disabled-background)}.disabled[data-v-2c0f0634]{opacity:.5}.loading-icon[data-v-2c0f0634]{animation:spin-2c0f0634 1s linear infinite forwards;display:inline-block;margin-right:.2rem;line-height:0;font-size:1rem;position:relative;top:.2rem}@keyframes spin-2c0f0634{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.aform-loading[data-v-274f5ba3]{width:100%;border:1px solid var(--sc-form-border);border-left:4px solid var(--sc-form-border);padding:1rem;margin-bottom:1rem;box-sizing:border-box;position:relative;overflow:hidden;background:var(--sc-input-field-background, #fff)}.aform-loading__label[data-v-274f5ba3]{font-size:.9rem;color:var(--sc-cell-text-color);z-index:1;position:relative}.aform-loading__label[data-v-274f5ba3]:not(:empty):after{content:"...";animation:ellipsis-274f5ba3 2s infinite}.aform-loading__bar[data-v-274f5ba3]{width:100%;height:100%;position:absolute;left:-100%;top:0;background:linear-gradient(90deg,rgba(var(--sc-table-loading-color),0),rgba(var(--sc-table-loading-color),1),rgba(var(--sc-table-loading-color),0));animation:bar-sweep-274f5ba3 2s infinite;z-index:0}@keyframes bar-sweep-274f5ba3{0%{left:-100%}to{left:100%}}@keyframes ellipsis-274f5ba3{0%,20%{content:""}40%{content:"."}60%{content:".."}80%,to{content:"..."}}
|
|
1
|
+
.aform_checkbox[data-v-ca06741d]{cursor:pointer;width:auto;margin-top:0;display:block}.aform_checkbox[data-v-ca06741d]:checked{accent-color:var(--sc-primary-color);border:1px solid black}.aform_checkbox-container[data-v-ca06741d]{width:100%;display:inline-block;text-align:left}.aform_checkbox-container input[data-v-ca06741d]{width:auto}.aform_checkbox-container:hover+.aform_field-label[data-v-ca06741d]{color:var(--sc-input-active-label-color)}.aform_form-link-wrapper[data-v-eb2fee75]{position:relative}.input-group[data-v-eb2fee75]{display:flex;align-items:stretch}.aform_input-field[data-v-eb2fee75]{flex:1;min-width:0}.aform_form-element--embedded[data-v-eb2fee75]{min-width:0;flex-grow:0}.aform_input-field--embedded[data-v-eb2fee75]{outline:none;background:transparent;padding:.5ch 1ch}.aform_form-element--embedded .autocomplete-results[data-v-eb2fee75]{min-width:100%;width:max-content}.aform_form-btn[data-v-eb2fee75]{appearance:none;border:none;outline:1px solid var(--sc-input-border-color);outline-offset:-1px;margin-left:-2px;background:var(--sc-input-field-background, white);padding:0 .75rem;cursor:pointer}.aform_form-btn[data-v-eb2fee75]:focus,.input-group:focus-within .aform_form-btn[data-v-eb2fee75]{outline-color:var(--sc-input-active-border-color)}.autocomplete-results[data-v-eb2fee75]{position:absolute;width:100%;z-index:100;padding:0;margin:0;list-style:none;border:1px solid var(--sc-input-active-border-color);border-top:none;border-radius:0 0 .25rem .25rem;background:#fff}.autocomplete-result[data-v-eb2fee75]{padding:4px 6px;cursor:pointer;border-bottom:.5px solid lightgray}.autocomplete-result.is-active[data-v-eb2fee75],.autocomplete-result[data-v-eb2fee75]:hover{background-color:var(--sc-row-color-zebra-light);color:var(--sc-input-active-border-color)}.acurrency__row[data-v-15bec6ef]{display:flex;gap:1ch}.acurrency__row--base[data-v-15bec6ef]{margin-top:1.5rem}.acurrency__field[data-v-15bec6ef]{position:relative;flex:1;min-width:0}.acurrency__group[data-v-15bec6ef]{display:flex;align-items:stretch;width:100%;border:1px solid var(--sc-input-border-color);border-radius:.25rem}.acurrency__group[data-v-15bec6ef]:focus-within{border-color:var(--sc-input-active-border-color)}.acurrency__amount-wrap[data-v-15bec6ef]{position:relative;flex:1;min-width:0}.acurrency__amount-wrap .aform_field-label[data-v-15bec6ef]{font-size:.85rem}.acurrency__amount[data-v-15bec6ef]{width:100%;box-sizing:border-box;border:none;outline:none;padding:.5ch 1ch;background:transparent;border-radius:0 .25rem .25rem 0;text-align:right;appearance:textfield;-moz-appearance:textfield}.acurrency__amount[data-v-15bec6ef]::-webkit-outer-spin-button,.acurrency__amount[data-v-15bec6ef]::-webkit-inner-spin-button{appearance:none;-webkit-appearance:none;margin:0}.acurrency__currency[data-v-15bec6ef]{position:relative;flex:0 0 auto;min-width:4.5rem;background:var(--sc-gray-5);border-right:1px solid var(--sc-input-border-color);border-radius:.25rem 0 0 .25rem}.acurrency__base-field[data-v-15bec6ef]{width:100%;box-sizing:border-box;font-size:1rem;padding:.5ch 1ch;border:1px solid var(--sc-input-border-color);border-radius:.25rem;outline:none;appearance:textfield;-moz-appearance:textfield}.acurrency__base-field[data-v-15bec6ef]:disabled{color:var(--sc-gray-50, #888)}.acurrency__base-field[data-v-15bec6ef]::-webkit-outer-spin-button,.acurrency__base-field[data-v-15bec6ef]::-webkit-inner-spin-button{appearance:none;-webkit-appearance:none;margin:0}.adatepicker[data-v-9e85c95a]{font-size:var(--sc-table-font-size);display:inline-table;color:var(--sc-cell-text-color);outline:none;border-collapse:collapse;margin-bottom:10px}.adatepicker tr[data-v-9e85c95a]{height:1.15rem;text-align:center;vertical-align:middle}.adatepicker td[data-v-9e85c95a]{border:2px solid transparent;outline:2px solid transparent;min-width:3ch;max-width:3ch;cursor:pointer}.adatepicker td.date-cell[data-v-9e85c95a]:hover{background:var(--sc-gray-10)}.adatepicker td[data-v-9e85c95a]:focus,.adatepicker td[data-v-9e85c95a]:focus-within{box-shadow:none;min-height:1.15em;max-height:1.15em;overflow:hidden}.adatepicker .selectedDate[data-v-9e85c95a],.adatepicker .startDate[data-v-9e85c95a],.adatepicker .endDate[data-v-9e85c95a]{background:var(--sc-gray-20);font-weight:bolder}.adatepicker .startDate[data-v-9e85c95a]{border-left:1px solid var(--sc-gray-50);background:var(--sc-gray-20)!important}.adatepicker .endDate[data-v-9e85c95a]{border-right:1px solid var(--sc-gray-50);background:var(--sc-gray-20)!important}.adatepicker .withinRange[data-v-9e85c95a]{background:var(--sc-gray-5)}.adatepicker .todaysDate[data-v-9e85c95a]{font-weight:bolder;color:#000}.days-header>td[data-v-9e85c95a]{font-weight:700}.prev-date[data-v-9e85c95a]{color:var(--sc-gray-20)}.adatepicker .date-input[data-v-9e85c95a]{display:flex;width:100%;gap:5px;align-items:center}.adatepicker .date-input>input[data-v-9e85c95a]{width:50%;padding:2px}p.aform_error[data-v-9e85c95a]{position:static;display:block;color:var(--sc-brand-danger, red);font-size:.7rem;margin:.25rem 0 0}.adate_time[data-v-959a3e41]{width:auto;padding:10px;box-sizing:border-box;font-size:1rem;background:var(--sc-gray-10)}.adate_time_fields[data-v-959a3e41]{display:flex;align-items:stretch;gap:5px;justify-content:flex-start}.adate_time_fields>input[data-v-959a3e41]{min-width:30px;padding:2px;text-align:center;display:inline-block;flex-basis:0}.meridiem-selector[data-v-959a3e41]{cursor:pointer;display:inline-block;flex-basis:0;padding:5px;-webkit-user-select:none;user-select:none}.meridiem-selector[data-v-959a3e41]:focus{outline:2px solid black;outline-offset:-2px}.adate_time_segment[data-v-959a3e41]{display:flex;flex-direction:column;width:40px}.colon[data-v-959a3e41]{display:flex;align-items:normal}.aform_form-btn[data-v-959a3e41]{cursor:pointer}.aform-select[data-v-959a3e41]{border:1px solid rgb(118,118,118);font-size:1rem;padding:0rem;margin:0;border-radius:0;box-sizing:border-box;min-height:auto;position:relative;color:var(--sc-cell-text-color)}.meridiem-selector[data-v-959a3e41]{margin-left:6px}.adate-selection[data-v-eeadb3e2]{display:inline-block;border:1px solid var(--sc-gray-80);padding:10px;background:var(--sc-form-background)}.adate-selection__end-label[data-v-eeadb3e2]{font-size:.8em;font-weight:700;color:var(--sc-input-active-label-color, #555);margin-top:8px;margin-bottom:2px;padding-left:2px}.empty[data-v-eeadb3e2]{color:#ccc;padding:10px;text-align:center;border:1px solid #ccc}.adate-input[data-v-a73c275b]{overflow:auto}div[data-v-a73c275b]{min-width:40ch;width:100%;box-sizing:border-box;border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}input[data-v-a73c275b]{width:calc(100% - 1ch);box-sizing:border-box;outline:1px solid transparent;border:1px solid var(--sc-input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;min-height:1.15rem;border-radius:.25rem}p[data-v-a73c275b],label[data-v-a73c275b]{color:var(--sc-input-label-color);display:block;min-height:1.15rem;padding:0rem;margin:0rem 0rem .25rem;border:1px solid transparent;box-sizing:border-box}p[data-v-a73c275b]{width:100%;color:red;font-size:85%;box-sizing:border-box}label[data-v-a73c275b]{z-index:0;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch;box-sizing:border-box}input[data-v-a73c275b]:focus{border:1px solid var(--sc-input-active-border-color)}input:focus+label[data-v-a73c275b]{color:var(--sc-input-active-label-color)}.picker[data-v-a73c275b]{position:absolute;top:50px}.autocomplete[data-v-2b75e2d5]{position:relative}.input-wrapper[data-v-2b75e2d5]{border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}input[data-v-2b75e2d5]{width:calc(100% - 1ch);outline:1px solid transparent;border:1px solid var(--sc-input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;min-height:1.15rem;border-radius:.25rem;font-family:var(--sc-font-family)}input[data-v-2b75e2d5]:focus{border:1px solid var(--sc-input-active-border-color);border-radius:.25rem .25rem 0 0;border-bottom:none}label[data-v-2b75e2d5]{display:block;min-height:1.15rem;padding:0rem;margin:0rem 0rem .25rem;border:1px solid transparent;z-index:0;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch}.autocomplete-results[data-v-2b75e2d5]{position:absolute;width:calc(100% - 1ch + 1.5px);z-index:100;padding:0;margin:0;color:var(--sc-input-active-border-color);border:1px solid var(--sc-input-active-border-color);border-radius:0 0 .25rem .25rem;border-top:none;background-color:#fff}.autocomplete-result[data-v-2b75e2d5]{list-style:none;text-align:left;padding:4px 6px;cursor:pointer;border-bottom:.5px solid lightgray}.autocomplete-result.is-active[data-v-2b75e2d5],.autocomplete-result[data-v-2b75e2d5]:hover{background-color:var(--sc-row-color-zebra-light);color:var(--sc-input-active-border-color)}p.aform_error[data-v-2b75e2d5]{position:static;display:block;color:var(--sc-brand-danger, red);font-size:.7rem;margin:.25rem 0 0}.aduration[data-v-22611dd6]{position:relative;min-width:40ch;width:100%}.aduration__summary[data-v-22611dd6]{display:flex;gap:6px;align-items:baseline;margin-top:6px;font-size:.9em}.aduration__label[data-v-22611dd6]{font-weight:700;color:var(--sc-input-active-label-color, #555)}.aduration__value[data-v-22611dd6]{color:var(--sc-cell-text-color, #000)}.aduration__ms[data-v-22611dd6]{color:var(--sc-gray-50, #888);font-size:.85em}.aduration__footer[data-v-22611dd6]{margin-top:8px}.adaterange[data-v-b5838478]{min-width:40ch;width:100%;box-sizing:border-box;border:1px solid transparent;padding:0;margin:0;margin-right:1ch;position:relative;overflow:visible}.adate-input[data-v-b5838478]{width:calc(100% - 1ch);box-sizing:border-box;outline:1px solid transparent;border:1px solid var(--sc-input-border-color);padding:1ch .5ch .5ch 1ch;margin:.575rem 0 0;min-height:1.15rem;border-radius:.25rem;cursor:pointer;background:#fff;font-size:1rem}.adate-input[data-v-b5838478]:focus{border:1px solid var(--sc-input-active-border-color)}.adate-input:focus+label[data-v-b5838478]{color:var(--sc-input-active-label-color)}p[data-v-b5838478],label[data-v-b5838478]{color:var(--sc-input-label-color);display:block;min-height:1.15rem;padding:0;margin:0;border:1px solid transparent;margin-bottom:.25rem;box-sizing:border-box}p[data-v-b5838478]{width:100%;color:red;font-size:85%}label[data-v-b5838478]{z-index:0;font-size:80%;position:absolute;background:#fff;margin:-2.575rem 0 0 1ch;padding:0 .25ch;box-sizing:border-box}.picker[data-v-b5838478]{position:absolute;top:50px;left:0;z-index:1000}.aform input{font-family:var(--sc-font-family);border:none}.aform_form-element{padding:0;margin:0;position:relative;box-sizing:border-box;flex-grow:1;min-width:20ch}.aform__grid--full{flex-basis:100%;width:100%}.aform_input-field{outline:1px solid var(--sc-input-border-color);outline-offset:-1px;font-size:1rem;padding:.5rem;margin:0;border-radius:0;box-sizing:border-box;width:100%;min-height:auto;position:relative;color:var(--sc-cell-text-color);background:var(--sc-input-field-background);font-family:var(--sc-font-family)}.aform_input-field:focus{outline:1px solid var(--sc-input-active-border-color)}.aform_display-value{display:block;padding:.5rem;min-height:2rem;color:var(--sc-cell-text-color);word-break:break-word}.aform_input-field:focus+.aform_field-label{color:var(--sc-input-active-label-color)}.aform_field-label{color:var(--sc-input-label-color);display:inline-block;position:absolute;padding:0 .25rem;margin:0rem;z-index:1;font-size:.7rem;font-weight:300;letter-spacing:.05rem;background:linear-gradient(var(--sc-form-background) 50%,var(--sc-input-field-background) 50%);width:auto;box-sizing:border-box;background:#fff;margin:0;grid-row:1;top:0;left:10px;border:none;line-height:0;transform:translateY(-50%)}.aform_input-field:disabled,.aform_checkbox-container:has(.aform_checkbox:disabled){background:var(--sc-input-field-disabled-background)}.aform_input-field:disabled+.aform_field-label,.aform_checkbox-container:has(.aform_checkbox:disabled)+.aform_field-label{background:linear-gradient(var(--sc-form-background) 50%,var(--sc-input-field-disabled-background) 50%)}.aform_input-field:disabled~p.aform_error,.aform_checkbox-container:has(.aform_checkbox:disabled)~p.aform_error{background:linear-gradient(var(--sc-form-background) 50%,var(--sc-input-field-disabled-background) 50%)}.aform_field-label:after{margin:0;padding:0;box-sizing:border-box;content:"";line-height:normal}p.aform_error{display:inline-block;background:linear-gradient(var(--sc-form-background) 50%,var(--sc-input-field-background) 50%);padding:0 .25rem;margin:0rem;width:auto;color:var(--sc-brand-danger);font-size:.7rem;position:absolute;right:0;top:0;line-height:0;background:#fff;padding:.25rem;transform:translate(-1rem,-50%);margin:0}.aform[data-v-bb17171c]{display:flex;flex-wrap:wrap;gap:1rem;padding:1rem;border:1px solid var(--sc-form-border);border-left:4px solid var(--sc-form-border);margin-bottom:1rem;max-width:100%}@media screen and (max-width:400px){.aform[data-v-bb17171c]{flex-direction:column}}.aform-nested-section[data-v-bb17171c]{width:100%;padding:.5rem 0}.aform-nested-label[data-v-bb17171c]{font-size:.9rem;font-weight:600;margin:0 0 .5rem;color:var(--sc-input-label-color, #666)}.aform-nested-section .aform[data-v-bb17171c]{border-left-width:2px;margin-left:.5rem}.collapse-button[data-v-6f1c1b45]{width:2ch;min-width:calc(66px - 4ch);background-color:transparent;font-size:150%;text-align:center;border:none;margin-top:-.5rem}.rotated[data-v-6f1c1b45]{transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transition:transform .25s;transform-origin:center center}.unrotated[data-v-6f1c1b45]{transform:rotate(0);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg);transition:transform .25s}fieldset[data-v-162e7317]{max-width:100%;width:100%;margin-right:2ch;border:1px solid transparent;border-bottom:1px solid var(--sc-gray-50)}legend[data-v-162e7317]{width:100%;height:1.15rem;border:1px solid transparent;padding-bottom:.5rem;font-size:110%;font-weight:600;-webkit-user-select:none;user-select:none}.collapse-button[data-v-162e7317]{float:right}.aform_file-attach[data-v-8eefd179]{padding:1rem;display:flex;flex-wrap:wrap;gap:1rem;flex-direction:row;justify-content:center;align-items:center;border:1px dashed var(--sc-input-border-color);width:100%}@media screen and (max-width:400px){.aform_file-attach>.aform_form-btn[data-v-8eefd179]{width:100%}}.aform_file-attach-feedback[data-v-8eefd179]{color:var(--sc-input-label-color);width:100%;padding:.5rem;text-align:center;align-self:center}.aform_file-attach-feedback>li[data-v-8eefd179]{list-style:none;font-style:italic}.aform_file-attach-feedback>p[data-v-8eefd179]{margin-top:0}.aform_form-btn[data-v-8eefd179]{padding:.5rem 2rem;width:auto;border:1px solid var(--sc-input-border-color);color:var(--sc-input-label-color);cursor:pointer;background-color:#fff}.aform_form-btn[data-v-8eefd179]:disabled{background-color:var(--sc-gray-5)}.aquantity__row[data-v-0b714861]{display:flex;gap:1ch}.aquantity__row--stock[data-v-0b714861]{margin-top:1.5rem}.aquantity__field[data-v-0b714861]{position:relative;flex:1;min-width:0}.aquantity__group[data-v-0b714861]{display:flex;align-items:stretch;width:100%;border:1px solid var(--sc-input-border-color);border-radius:.25rem}.aquantity__group[data-v-0b714861]:focus-within{border-color:var(--sc-input-active-border-color)}.aquantity__qty[data-v-0b714861]{flex:1;min-width:0;border:none;outline:none;padding:.5ch 1ch;background:transparent;border-radius:.25rem 0 0 .25rem;appearance:textfield;-moz-appearance:textfield}.aquantity__qty[data-v-0b714861]::-webkit-outer-spin-button,.aquantity__qty[data-v-0b714861]::-webkit-inner-spin-button{appearance:none;-webkit-appearance:none;margin:0}.aquantity__uom[data-v-0b714861]{position:relative;flex:0 0 auto;border-left:1px solid var(--sc-input-border-color)}.aquantity__uom-toggle[data-v-0b714861]{display:flex;align-items:center;gap:.75ch;height:100%;padding:.5ch 1ch;background:var(--sc-gray-5);border:none;border-radius:0 .25rem .25rem 0;white-space:nowrap;cursor:pointer}.aquantity__uom-toggle[data-v-0b714861]:disabled{cursor:not-allowed;color:var(--sc-gray-50, #888)}.aquantity__caret[data-v-0b714861]{display:inline-block;width:0;height:0;border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.3em solid currentColor}.aquantity__uom-menu[data-v-0b714861]{position:absolute;top:100%;right:0;z-index:100;min-width:100%;margin:.15rem 0 0;padding:.25rem 0;list-style:none;background:var(--sc-input-field-background, #fff);border:1px solid var(--sc-input-active-border-color);border-radius:.25rem}.aquantity__uom-option[data-v-0b714861]{padding:.4ch 1ch;white-space:nowrap;cursor:pointer}.aquantity__uom-option.is-active[data-v-0b714861],.aquantity__uom-option[data-v-0b714861]:hover{background-color:var(--sc-row-color-zebra-light)}.aquantity__stock-field[data-v-0b714861]{width:100%;font-size:1rem;padding:.5ch 1ch;border:1px solid var(--sc-input-border-color);border-radius:.25rem;outline:none}.aquantity__stock-field[data-v-0b714861]:disabled{color:var(--sc-gray-50, #888)}.aform_textbox[data-v-2a9c793b]{resize:vertical;line-height:1.5;min-height:4rem;font-family:inherit}.aform_textbox-display[data-v-2a9c793b]{white-space:pre-wrap}.login-container[data-v-2c0f0634]{width:100%;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;font-family:var(--sc-font-family)}.account-container[data-v-2c0f0634]{width:100%;margin-left:auto;margin-top:.5rem;margin-right:auto;display:flex;flex-direction:column;justify-content:center}.account-header[data-v-2c0f0634]{display:flex;flex-direction:column;text-align:center;margin-top:.5rem}#account-title[data-v-2c0f0634]{font-size:1.5rem;line-height:2rem;font-weight:600;letter-spacing:-.025em;margin:0}#account-subtitle[data-v-2c0f0634]{font-size:.875rem;line-height:1.25rem;margin:1rem}.login-form-container[data-v-2c0f0634]{display:grid;gap:.5rem}.login-form-element[data-v-2c0f0634]{display:grid;margin:.5rem 0;position:relative}.login-field[data-v-2c0f0634]{padding:.5rem .25rem .25rem .5rem;outline:1px solid transparent;border:1px solid var(--sc-input-border-color);border-radius:.25rem}.login-field[data-v-2c0f0634]:focus{border:1px solid black}.btn[data-v-2c0f0634]{background-color:var(--sc-btn-color);color:var(--sc-btn-label-color);border:1px solid var(--sc-btn-border);margin:.5rem 0;padding:.25rem;position:relative;cursor:pointer}.btn[data-v-2c0f0634]:hover{background-color:var(--sc-btn-hover)}.btn[data-v-2c0f0634]:disabled{background-color:var(--sc-input-field-disabled-background)}.disabled[data-v-2c0f0634]{opacity:.5}.loading-icon[data-v-2c0f0634]{animation:spin-2c0f0634 1s linear infinite forwards;display:inline-block;margin-right:.2rem;line-height:0;font-size:1rem;position:relative;top:.2rem}@keyframes spin-2c0f0634{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.aform-loading[data-v-274f5ba3]{width:100%;border:1px solid var(--sc-form-border);border-left:4px solid var(--sc-form-border);padding:1rem;margin-bottom:1rem;box-sizing:border-box;position:relative;overflow:hidden;background:var(--sc-input-field-background, #fff)}.aform-loading__label[data-v-274f5ba3]{font-size:.9rem;color:var(--sc-cell-text-color);z-index:1;position:relative}.aform-loading__label[data-v-274f5ba3]:not(:empty):after{content:"...";animation:ellipsis-274f5ba3 2s infinite}.aform-loading__bar[data-v-274f5ba3]{width:100%;height:100%;position:absolute;left:-100%;top:0;background:linear-gradient(90deg,rgba(var(--sc-table-loading-color),0),rgba(var(--sc-table-loading-color),1),rgba(var(--sc-table-loading-color),0));animation:bar-sweep-274f5ba3 2s infinite;z-index:0}@keyframes bar-sweep-274f5ba3{0%{left:-100%}to{left:100%}}@keyframes ellipsis-274f5ba3{0%,20%{content:""}40%{content:"."}60%{content:".."}80%,to{content:"..."}}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export type * from '@stonecrop/atable/types';
|
|
|
2
2
|
export { deserializeFunction } from './utils/deserialize';
|
|
3
3
|
import type { App } from 'vue';
|
|
4
4
|
import ACheckbox from './components/form/ACheckbox.vue';
|
|
5
|
+
import ACurrencyInput from './components/form/ACurrencyInput.vue';
|
|
5
6
|
import ADate from './components/form/ADate.vue';
|
|
6
7
|
import ADropdown from './components/form/ADropdown.vue';
|
|
7
8
|
import ADatePicker from './components/form/ADatePicker.vue';
|
|
@@ -26,5 +27,5 @@ export type * from './types';
|
|
|
26
27
|
* @public
|
|
27
28
|
*/
|
|
28
29
|
declare function install(app: App): void;
|
|
29
|
-
export { ACheckbox, ADate, ADropdown, ADatePicker, ADateRange, ADateSelection, ADuration, ADateTime, AFieldset, AFileAttach, AForm, AFormLink, ANumericInput, AQuantityInput, ATextInput, ATextboxInput, Login, AFormLoading, install, };
|
|
30
|
+
export { ACheckbox, ACurrencyInput, ADate, ADropdown, ADatePicker, ADateRange, ADateSelection, ADuration, ADateTime, AFieldset, AFileAttach, AForm, AFormLink, ANumericInput, AQuantityInput, ATextInput, ATextboxInput, Login, AFormLoading, install, };
|
|
30
31
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,yBAAyB,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,OAAO,SAAS,MAAM,iCAAiC,CAAA;AACvD,OAAO,KAAK,MAAM,6BAA6B,CAAA;AAC/C,OAAO,SAAS,MAAM,iCAAiC,CAAA;AACvD,OAAO,WAAW,MAAM,mCAAmC,CAAA;A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ACvD,OAAO,WAAW,MAAM,mCAAmC,CAAA;AAC3D,OAAO,KAAK,MAAM,wBAAwB,CAAA;AAC1C,OAAO,SAAS,MAAM,iCAAiC,CAAA;AACvD,OAAO,aAAa,MAAM,qCAAqC,CAAA;AAC/D,OAAO,cAAc,MAAM,sCAAsC,CAAA;AACjE,OAAO,UAAU,MAAM,kCAAkC,CAAA;AACzD,OAAO,aAAa,MAAM,qCAAqC,CAAA;AAC/D,OAAO,KAAK,MAAM,kCAAkC,CAAA;AACpD,OAAO,YAAY,MAAM,+BAA+B,CAAA;AAExD,mBAAmB,SAAS,CAAA;AAE5B;;;;GAIG;AACH,iBAAS,OAAO,CAAC,GAAG,EAAE,GAAG,QAqBxB;AAED,OAAO,EACN,SAAS,EACT,cAAc,EACd,KAAK,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,cAAc,EACd,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,KAAK,EACL,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,EACV,aAAa,EACb,KAAK,EACL,YAAY,EACZ,OAAO,GACP,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { deserializeFunction } from './utils/deserialize';
|
|
2
2
|
import { install as installATable } from '@stonecrop/atable';
|
|
3
3
|
import ACheckbox from './components/form/ACheckbox.vue';
|
|
4
|
+
import ACurrencyInput from './components/form/ACurrencyInput.vue';
|
|
4
5
|
import ADate from './components/form/ADate.vue';
|
|
5
6
|
import ADropdown from './components/form/ADropdown.vue';
|
|
6
7
|
import ADatePicker from './components/form/ADatePicker.vue';
|
|
@@ -26,6 +27,7 @@ import AFormLoading from './components/AFormLoading.vue';
|
|
|
26
27
|
function install(app /* options */) {
|
|
27
28
|
app.use(installATable); // Install ATable components for use within AForm
|
|
28
29
|
app.component('ACheckbox', ACheckbox);
|
|
30
|
+
app.component('ACurrencyInput', ACurrencyInput);
|
|
29
31
|
app.component('ADate', ADate);
|
|
30
32
|
app.component('ADropdown', ADropdown);
|
|
31
33
|
app.component('ADatePicker', ADatePicker);
|
|
@@ -43,4 +45,4 @@ function install(app /* options */) {
|
|
|
43
45
|
app.component('ADuration', ADuration);
|
|
44
46
|
app.component('AFormLoading', AFormLoading);
|
|
45
47
|
}
|
|
46
|
-
export { ACheckbox, ADate, ADropdown, ADatePicker, ADateRange, ADateSelection, ADuration, ADateTime, AFieldset, AFileAttach, AForm, AFormLink, ANumericInput, AQuantityInput, ATextInput, ATextboxInput, Login, AFormLoading, install, };
|
|
48
|
+
export { ACheckbox, ACurrencyInput, ADate, ADropdown, ADatePicker, ADateRange, ADateSelection, ADuration, ADateTime, AFieldset, AFileAttach, AForm, AFormLink, ANumericInput, AQuantityInput, ATextInput, ATextboxInput, Login, AFormLoading, install, };
|
|
@@ -223,4 +223,41 @@ export interface QuantityOptions {
|
|
|
223
223
|
/** Conversion factor lookup for each non-stock UOM, relative to `stockUom` (which is implicitly `1`) */
|
|
224
224
|
conversionFactors?: Record<string, number>;
|
|
225
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* The value shape for ACurrencyInput — an amount paired with its currency (an
|
|
228
|
+
* {@link AFormLinkValue} FK reference), plus the derived base-currency-equivalent amount.
|
|
229
|
+
* `exchangeRate` is carried on the value so it round-trips with the record even though it is
|
|
230
|
+
* never directly edited by the user.
|
|
231
|
+
* @public
|
|
232
|
+
*/
|
|
233
|
+
export interface CurrencyValue {
|
|
234
|
+
/** The entered amount, in `currency` units */
|
|
235
|
+
amount: number;
|
|
236
|
+
/** FK reference to the Currency doctype the user entered `amount` in */
|
|
237
|
+
currency: AFormLinkValue;
|
|
238
|
+
/** `amount` converted into `baseCurrency` units — `amount * exchangeRate` */
|
|
239
|
+
baseAmount: number;
|
|
240
|
+
/** The record's base currency — fixed, not user-editable */
|
|
241
|
+
baseCurrency: AFormLinkValue;
|
|
242
|
+
/** Multiplier from `currency` to `baseCurrency` — hidden from the UI, drives `baseAmount` */
|
|
243
|
+
exchangeRate: number;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Type-specific configuration for ACurrencyInput, passed via the field's `options` property.
|
|
247
|
+
* @public
|
|
248
|
+
*/
|
|
249
|
+
export interface CurrencyOptions {
|
|
250
|
+
/** Currency doctype name, used for FK resolution via `aformLinkResolver`. The currency picker is embedded, so it renders no navigate button. */
|
|
251
|
+
doctype?: string;
|
|
252
|
+
/** The record's base currency — fixed, not user-editable. A bare id resolves to displayText via `aformLinkResolver`. */
|
|
253
|
+
baseCurrency?: AFormLinkValue | string;
|
|
254
|
+
/** Exchange rate lookup for each non-base currency id, relative to `baseCurrency` (which is implicitly `1`) */
|
|
255
|
+
exchangeRates?: Record<string, number>;
|
|
256
|
+
/** Decimal places to round the derived `baseAmount` to — the base currency's scale (JPY carries 0, most carry 2, KWD 3). Applies only to `baseAmount`; the entered `amount` is left as typed. Omit to round only enough to shed binary floating-point noise, which never discards a digit the rate actually produced. A non-integer or out-of-range value falls back to that default. */
|
|
257
|
+
precision?: number;
|
|
258
|
+
/** Search function backing the `currency` autocomplete dropdown — see AFormLink's `filterFunction` */
|
|
259
|
+
filterFunction?: string | ((search: string) => AFormLinkValue[] | Promise<AFormLinkValue[]>);
|
|
260
|
+
/** Whether `filterFunction` results should show a loading state — see AFormLink's `isAsync` */
|
|
261
|
+
isAsync?: boolean;
|
|
262
|
+
}
|
|
226
263
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAMnG;;;;;GAKG;AACH,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAkBxD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG;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ACxH,YAAY,CAAC,EAAE,cAAc,GAAG,MAAM,CAAA;IACtC,+GAA+G;IAC/G,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,yXAAyX;IACzX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sGAAsG;IACtG,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,cAAc,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,CAAA;IAC5F,+FAA+F;IAC/F,OAAO,CAAC,EAAE,OAAO,CAAA;CACjB"}
|
package/dist/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/aform",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.4",
|
|
4
4
|
"description": "Schema-driven form components for Stonecrop",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/agritheory/stonecrop/issues"
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@vueuse/components": "^14.2.1",
|
|
37
37
|
"@vueuse/core": "^14.2.1",
|
|
38
|
-
"@stonecrop/atable": "0.16.
|
|
39
|
-
"@stonecrop/
|
|
40
|
-
"@stonecrop/
|
|
41
|
-
"@stonecrop/utilities": "0.16.
|
|
38
|
+
"@stonecrop/atable": "0.16.4",
|
|
39
|
+
"@stonecrop/schema": "0.16.4",
|
|
40
|
+
"@stonecrop/themes": "0.16.4",
|
|
41
|
+
"@stonecrop/utilities": "0.16.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@microsoft/api-documenter": "^7.30.5",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
|
-
"_phase:build": "heft build && vite build && rushx docs",
|
|
76
|
-
"build": "heft build && vite build && rushx docs",
|
|
75
|
+
"_phase:build": "heft build --clean && vite build && rushx docs",
|
|
76
|
+
"build": "heft build --clean && vite build && rushx docs",
|
|
77
77
|
"dev": "vite",
|
|
78
78
|
"docs": "bash ../common/scripts/run-docs.sh aform",
|
|
79
79
|
"lint": "oxlint",
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="aform_form-element acurrency">
|
|
3
|
+
<template v-if="mode === 'display'">
|
|
4
|
+
<span class="aform_display-value">{{ displayText }}</span>
|
|
5
|
+
<label class="aform_field-label">{{ label }}</label>
|
|
6
|
+
</template>
|
|
7
|
+
<template v-else>
|
|
8
|
+
<div class="acurrency__row">
|
|
9
|
+
<div class="acurrency__field acurrency__field--amount">
|
|
10
|
+
<div class="acurrency__group">
|
|
11
|
+
<div class="acurrency__currency">
|
|
12
|
+
<AFormLink
|
|
13
|
+
v-model="currency"
|
|
14
|
+
:mode="mode"
|
|
15
|
+
embedded
|
|
16
|
+
:placeholder="currencyLabel"
|
|
17
|
+
:aria-label="currencyLabel"
|
|
18
|
+
:required="required"
|
|
19
|
+
:formatter="currencySymbol"
|
|
20
|
+
:doctype="options.doctype"
|
|
21
|
+
:filter-function="options.filterFunction"
|
|
22
|
+
:is-async="options.isAsync">
|
|
23
|
+
<template #option="{ option }"
|
|
24
|
+
>{{ option.symbol ? `${option.symbol} — ` : '' }}{{ option.displayText ?? option.id }}</template
|
|
25
|
+
>
|
|
26
|
+
</AFormLink>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="acurrency__amount-wrap">
|
|
29
|
+
<input
|
|
30
|
+
:id="uuid"
|
|
31
|
+
v-model.number="amount"
|
|
32
|
+
class="acurrency__amount"
|
|
33
|
+
type="number"
|
|
34
|
+
:disabled="mode === 'read'"
|
|
35
|
+
:required="required"
|
|
36
|
+
@keydown="onAmountKeydown"
|
|
37
|
+
@paste="onAmountPaste" />
|
|
38
|
+
<label class="aform_field-label" :for="uuid">{{ label }}</label>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="acurrency__row acurrency__row--base">
|
|
44
|
+
<div class="acurrency__field acurrency__field--base-currency">
|
|
45
|
+
<input :value="baseCurrencyText" class="aform_input-field acurrency__base-field" type="text" disabled />
|
|
46
|
+
<label class="aform_field-label">{{ baseCurrencyLabel }}</label>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="acurrency__field acurrency__field--base-amount">
|
|
49
|
+
<input
|
|
50
|
+
:value="modelValue.baseAmount"
|
|
51
|
+
class="aform_input-field acurrency__base-field"
|
|
52
|
+
type="number"
|
|
53
|
+
disabled />
|
|
54
|
+
<label class="aform_field-label">{{ baseAmountLabel }}</label>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="acurrency__field acurrency__field--exchange-rate">
|
|
57
|
+
<input
|
|
58
|
+
:value="modelValue.exchangeRate"
|
|
59
|
+
class="aform_input-field acurrency__base-field"
|
|
60
|
+
type="number"
|
|
61
|
+
disabled />
|
|
62
|
+
<label class="aform_field-label">{{ exchangeRateLabel }}</label>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<p v-show="validation.errorMessage" class="aform_error" v-html="validation.errorMessage"></p>
|
|
66
|
+
</template>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script setup lang="ts">
|
|
71
|
+
import { computed, inject, ref, watch } from 'vue'
|
|
72
|
+
|
|
73
|
+
import type { AFormLinkValue, ComponentProps, CurrencyOptions, CurrencyValue } from '../../types'
|
|
74
|
+
import AFormLink from './AFormLink.vue'
|
|
75
|
+
|
|
76
|
+
const {
|
|
77
|
+
label,
|
|
78
|
+
required,
|
|
79
|
+
mode,
|
|
80
|
+
uuid,
|
|
81
|
+
validation = { errorMessage: ' ' },
|
|
82
|
+
options = {},
|
|
83
|
+
currencyLabel = 'Currency',
|
|
84
|
+
baseCurrencyLabel = 'Base Currency',
|
|
85
|
+
baseAmountLabel = 'Base Amount',
|
|
86
|
+
exchangeRateLabel = 'Exchange Rate',
|
|
87
|
+
} = defineProps<
|
|
88
|
+
ComponentProps & {
|
|
89
|
+
options?: CurrencyOptions
|
|
90
|
+
currencyLabel?: string
|
|
91
|
+
baseCurrencyLabel?: string
|
|
92
|
+
baseAmountLabel?: string
|
|
93
|
+
exchangeRateLabel?: string
|
|
94
|
+
}
|
|
95
|
+
>()
|
|
96
|
+
|
|
97
|
+
// The merged currency prefix is compact by design, so it shows the symbol rather than the
|
|
98
|
+
// full currency name once a value is picked — falls back gracefully when a currency record
|
|
99
|
+
// (or the story/app data behind it) doesn't carry a `symbol`.
|
|
100
|
+
const currencySymbol = (value: AFormLinkValue): string => value.symbol ?? value.displayText ?? String(value.id)
|
|
101
|
+
|
|
102
|
+
const modelValue = defineModel<CurrencyValue>({
|
|
103
|
+
default: () => ({
|
|
104
|
+
amount: 0,
|
|
105
|
+
currency: { id: '' },
|
|
106
|
+
baseAmount: 0,
|
|
107
|
+
baseCurrency: { id: '' },
|
|
108
|
+
exchangeRate: 1,
|
|
109
|
+
}),
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
// The base currency is fixed configuration, not user-editable. It may be supplied as a bare id
|
|
113
|
+
// (resolved to displayText below via the same `aformLinkResolver` injection AFormLink uses) or
|
|
114
|
+
// as a full AFormLinkValue that already carries displayText.
|
|
115
|
+
const normalizedBaseCurrency = computed<AFormLinkValue>(() => {
|
|
116
|
+
const base = options.baseCurrency ?? modelValue.value?.baseCurrency
|
|
117
|
+
if (!base) return { id: '' }
|
|
118
|
+
return typeof base === 'string' ? { id: base } : base
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
type ResolverFn = (doctype: string, id: string) => string | undefined | Promise<string | undefined>
|
|
122
|
+
const resolver = inject<ResolverFn | null>('aformLinkResolver', null)
|
|
123
|
+
|
|
124
|
+
const resolvedBaseCurrency = ref<AFormLinkValue>(normalizedBaseCurrency.value)
|
|
125
|
+
|
|
126
|
+
watch(
|
|
127
|
+
normalizedBaseCurrency,
|
|
128
|
+
async base => {
|
|
129
|
+
if (!base.id || base.displayText || !resolver || !options.doctype) {
|
|
130
|
+
resolvedBaseCurrency.value = base
|
|
131
|
+
return
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
const displayText = await resolver(options.doctype, String(base.id))
|
|
135
|
+
resolvedBaseCurrency.value = displayText ? { ...base, displayText } : base
|
|
136
|
+
} catch {
|
|
137
|
+
resolvedBaseCurrency.value = base
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
{ immediate: true }
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
const baseCurrencyText = computed(() => {
|
|
144
|
+
const base = resolvedBaseCurrency.value
|
|
145
|
+
if (!base?.id) return ''
|
|
146
|
+
return base.displayText ?? String(base.id)
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
const resolveExchangeRate = (currencyId: string | number | undefined): number => {
|
|
150
|
+
const baseId = resolvedBaseCurrency.value.id
|
|
151
|
+
if (!currencyId || String(currencyId) === String(baseId)) return 1
|
|
152
|
+
// The rate the value was booked at wins for as long as the currency is unchanged. Rates are
|
|
153
|
+
// time-varying in a way conversion factors are not (see AQuantityInput), so `exchangeRates`
|
|
154
|
+
// carries *today's* rates: preferring it here would silently re-rate a stored line to the
|
|
155
|
+
// current rate on any touch — including the write-back AFormLink does when it resolves the
|
|
156
|
+
// currency's display text, i.e. on mere render.
|
|
157
|
+
if (String(currencyId) === String(modelValue.value?.currency?.id)) {
|
|
158
|
+
return modelValue.value?.exchangeRate ?? options.exchangeRates?.[String(currencyId)] ?? 1
|
|
159
|
+
}
|
|
160
|
+
// Switching to a currency absent from the rate map resets to 1 rather than silently reusing
|
|
161
|
+
// the outgoing currency's rate.
|
|
162
|
+
return options.exchangeRates?.[String(currencyId)] ?? 1
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Enough decimal places to shed floating-point noise from the multiplication (e.g. 4 * 1.1 → 4.4
|
|
166
|
+
// rather than 4.4000000000000004) without discarding a digit the rate actually produced. Matches
|
|
167
|
+
// AQuantityInput's roundQty.
|
|
168
|
+
const FLOAT_NOISE_DECIMALS = 6
|
|
169
|
+
|
|
170
|
+
// How far to round the base amount is the *base currency's* business, and only the app knows what
|
|
171
|
+
// that is — so it says so via `precision` (JPY carries 0 decimals, most currencies 2, KWD 3).
|
|
172
|
+
// Unset stays deliberately loose rather than defaulting to 2: hard-rounding every currency to
|
|
173
|
+
// cents destroys value outright, e.g. 50 IDR at 0.000063 rounds to a base amount of 0. A garbage
|
|
174
|
+
// precision (non-integer, negative, or past toFixed's 100 ceiling) falls back rather than throwing
|
|
175
|
+
// inside the setter and breaking the field.
|
|
176
|
+
const baseDecimals = computed(() => {
|
|
177
|
+
const { precision } = options
|
|
178
|
+
if (precision === undefined) return FLOAT_NOISE_DECIMALS
|
|
179
|
+
return Number.isInteger(precision) && precision >= 0 && precision <= 100 ? precision : FLOAT_NOISE_DECIMALS
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
const roundAmount = (value: number): number => Number(value.toFixed(baseDecimals.value))
|
|
183
|
+
|
|
184
|
+
const recompute = (amount: number, currencyValue: AFormLinkValue) => {
|
|
185
|
+
const exchangeRate = resolveExchangeRate(currencyValue.id)
|
|
186
|
+
modelValue.value = {
|
|
187
|
+
amount,
|
|
188
|
+
currency: currencyValue,
|
|
189
|
+
exchangeRate,
|
|
190
|
+
baseCurrency: resolvedBaseCurrency.value,
|
|
191
|
+
baseAmount: roundAmount(amount * exchangeRate),
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const amount = computed({
|
|
196
|
+
get: () => modelValue.value?.amount ?? 0,
|
|
197
|
+
set: (value: number) => recompute(value, modelValue.value?.currency ?? { id: '' }),
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
const currency = computed<AFormLinkValue>({
|
|
201
|
+
get: () => modelValue.value?.currency ?? { id: '' },
|
|
202
|
+
set: (value: AFormLinkValue) => recompute(modelValue.value?.amount ?? 0, value),
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
const amountNavigationKeys = new Set([
|
|
206
|
+
'Backspace',
|
|
207
|
+
'Delete',
|
|
208
|
+
'Tab',
|
|
209
|
+
'Escape',
|
|
210
|
+
'Enter',
|
|
211
|
+
'ArrowLeft',
|
|
212
|
+
'ArrowRight',
|
|
213
|
+
'ArrowUp',
|
|
214
|
+
'ArrowDown',
|
|
215
|
+
'Home',
|
|
216
|
+
'End',
|
|
217
|
+
])
|
|
218
|
+
|
|
219
|
+
const onAmountKeydown = (event: KeyboardEvent) => {
|
|
220
|
+
if (event.ctrlKey || event.metaKey || event.altKey) return
|
|
221
|
+
if (amountNavigationKeys.has(event.key)) return
|
|
222
|
+
if (/^[0-9]$/.test(event.key)) return
|
|
223
|
+
// A currency amount is signed — credit notes, refunds and adjustments are negative.
|
|
224
|
+
//
|
|
225
|
+
// Both dedup checks below are best-effort: a `type="number"` input reports `value` as `''`
|
|
226
|
+
// whenever its content isn't a valid number, so mid-entry states like "1." or "-" read as
|
|
227
|
+
// empty and a second separator can slip through. The browser rejects the resulting value
|
|
228
|
+
// anyway; this guard exists to stop the obviously-wrong keys (letters, 'e', '+'), not to be
|
|
229
|
+
// the sole arbiter of well-formedness.
|
|
230
|
+
const input = event.target as HTMLInputElement
|
|
231
|
+
if (event.key === '.' && !input.value.includes('.')) return
|
|
232
|
+
if (event.key === '-' && !input.value.includes('-')) return
|
|
233
|
+
event.preventDefault()
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const onAmountPaste = (event: ClipboardEvent) => {
|
|
237
|
+
const pasted = event.clipboardData?.getData('text') ?? ''
|
|
238
|
+
if (!/^-?\d*\.?\d*$/.test(pasted)) event.preventDefault()
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const showBase = computed(() => {
|
|
242
|
+
const v = modelValue.value
|
|
243
|
+
return !!v?.baseCurrency?.id && (v.currency?.id !== v.baseCurrency?.id || v.amount !== v.baseAmount)
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
const displayText = computed(() => {
|
|
247
|
+
const v = modelValue.value
|
|
248
|
+
if (!v || !v.currency?.id) return '—'
|
|
249
|
+
const currencyText = v.currency.displayText ?? String(v.currency.id)
|
|
250
|
+
const base = `${v.amount} ${currencyText}`
|
|
251
|
+
if (!showBase.value) return base
|
|
252
|
+
const baseText = v.baseCurrency.displayText ?? String(v.baseCurrency.id)
|
|
253
|
+
return `${base} (${v.baseAmount} ${baseText})`
|
|
254
|
+
})
|
|
255
|
+
</script>
|
|
256
|
+
|
|
257
|
+
<style scoped>
|
|
258
|
+
.acurrency__row {
|
|
259
|
+
display: flex;
|
|
260
|
+
gap: 1ch;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.acurrency__row--base {
|
|
264
|
+
margin-top: 1.5rem;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.acurrency__field {
|
|
268
|
+
position: relative;
|
|
269
|
+
flex: 1;
|
|
270
|
+
min-width: 0;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.acurrency__group {
|
|
274
|
+
display: flex;
|
|
275
|
+
align-items: stretch;
|
|
276
|
+
width: 100%;
|
|
277
|
+
border: 1px solid var(--sc-input-border-color);
|
|
278
|
+
border-radius: 0.25rem;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.acurrency__group:focus-within {
|
|
282
|
+
border-color: var(--sc-input-active-border-color);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/* Wraps just the amount input so its floating label (`left: 10px` of the nearest
|
|
286
|
+
`position: relative` ancestor, per .aform_field-label) anchors above the amount box
|
|
287
|
+
specifically, not the group's outer left edge — which is now the currency prefix. */
|
|
288
|
+
.acurrency__amount-wrap {
|
|
289
|
+
position: relative;
|
|
290
|
+
flex: 1;
|
|
291
|
+
min-width: 0;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/* The amount label ("Total") is the primary label for the whole merged group — bumped up
|
|
295
|
+
slightly from the shared .aform_field-label size so it reads as the group's main label. */
|
|
296
|
+
.acurrency__amount-wrap .aform_field-label {
|
|
297
|
+
font-size: 0.85rem;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.acurrency__amount {
|
|
301
|
+
width: 100%;
|
|
302
|
+
box-sizing: border-box;
|
|
303
|
+
border: none;
|
|
304
|
+
outline: none;
|
|
305
|
+
padding: 0.5ch 1ch;
|
|
306
|
+
background: transparent;
|
|
307
|
+
border-radius: 0 0.25rem 0.25rem 0;
|
|
308
|
+
text-align: right;
|
|
309
|
+
appearance: textfield;
|
|
310
|
+
-moz-appearance: textfield;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.acurrency__amount::-webkit-outer-spin-button,
|
|
314
|
+
.acurrency__amount::-webkit-inner-spin-button {
|
|
315
|
+
appearance: none;
|
|
316
|
+
-webkit-appearance: none;
|
|
317
|
+
margin: 0;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* The currency picker reads as a simple prefix addon (like Bootstrap's "$" prepend) rather
|
|
321
|
+
than an equal partner to the amount box: compact width (it shows a symbol once a value is
|
|
322
|
+
picked, not the full name), tinted background, left-rounded to match the group's own
|
|
323
|
+
corner so the tint doesn't overhang the border. The dropdown itself isn't bound by this
|
|
324
|
+
width — see AFormLink's .autocomplete-results — so search results still show full names. */
|
|
325
|
+
.acurrency__currency {
|
|
326
|
+
position: relative;
|
|
327
|
+
flex: 0 0 auto;
|
|
328
|
+
min-width: 4.5rem;
|
|
329
|
+
background: var(--sc-gray-5);
|
|
330
|
+
border-right: 1px solid var(--sc-input-border-color);
|
|
331
|
+
border-radius: 0.25rem 0 0 0.25rem;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.acurrency__base-field {
|
|
335
|
+
width: 100%;
|
|
336
|
+
box-sizing: border-box;
|
|
337
|
+
font-size: 1rem;
|
|
338
|
+
padding: 0.5ch 1ch;
|
|
339
|
+
border: 1px solid var(--sc-input-border-color);
|
|
340
|
+
border-radius: 0.25rem;
|
|
341
|
+
outline: none;
|
|
342
|
+
appearance: textfield;
|
|
343
|
+
-moz-appearance: textfield;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.acurrency__base-field:disabled {
|
|
347
|
+
color: var(--sc-gray-50, #888);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/* Base Amount and Exchange Rate are read-only — the number spinner offers nothing here. */
|
|
351
|
+
.acurrency__base-field::-webkit-outer-spin-button,
|
|
352
|
+
.acurrency__base-field::-webkit-inner-spin-button {
|
|
353
|
+
appearance: none;
|
|
354
|
+
-webkit-appearance: none;
|
|
355
|
+
margin: 0;
|
|
356
|
+
}
|
|
357
|
+
</style>
|
|
@@ -91,7 +91,7 @@ const { mode, label, selectRange = false, errors, validation = { errorMessage: '
|
|
|
91
91
|
// Dynamic trigger errors take precedence over a static schema errorMessage; empty means the slot hides.
|
|
92
92
|
const errorText = computed(() => (errors?.length ? errors.join('; ') : (validation.errorMessage ?? '')))
|
|
93
93
|
|
|
94
|
-
const date = defineModel<number | Date>({ default: new Date() })
|
|
94
|
+
const date = defineModel<number | Date>({ default: () => new Date() })
|
|
95
95
|
const selectedDate = ref(new Date(date.value))
|
|
96
96
|
const currentMonth = ref<number>(selectedDate.value.getMonth())
|
|
97
97
|
const currentYear = ref<number>(selectedDate.value.getFullYear())
|