@stonecrop/stonecrop 0.11.0 → 0.11.2
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/registry.js +0 -37
- package/dist/src/registry.d.ts +1 -24
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/stonecrop.d.ts +0 -24
- package/dist/stonecrop.js +0 -36
- package/dist/stonecrop.js.map +1 -1
- package/package.json +5 -5
- package/src/registry.ts +1 -39
- package/dist/composable.js +0 -1
- package/dist/composables/use-lazy-link-state.js +0 -125
- package/dist/composables/use-stonecrop.js +0 -476
- package/dist/operation-log-DB-dGNT9.js +0 -593
- package/dist/operation-log-DB-dGNT9.js.map +0 -1
- package/dist/src/composable.d.ts +0 -11
- package/dist/src/composable.d.ts.map +0 -1
- package/dist/src/composable.js +0 -477
- package/dist/src/composables/operation-log.js +0 -224
- package/dist/src/composables/stonecrop.js +0 -574
- package/dist/src/composables/use-lazy-link-state.d.ts +0 -25
- package/dist/src/composables/use-lazy-link-state.d.ts.map +0 -1
- package/dist/src/composables/use-stonecrop.d.ts +0 -93
- package/dist/src/composables/use-stonecrop.d.ts.map +0 -1
- package/dist/src/composables/useNestedSchema.d.ts +0 -110
- package/dist/src/composables/useNestedSchema.d.ts.map +0 -1
- package/dist/src/composables/useNestedSchema.js +0 -155
- package/dist/src/doctype.js +0 -234
- package/dist/src/exceptions.js +0 -16
- package/dist/src/field-triggers.js +0 -567
- package/dist/src/index.js +0 -23
- package/dist/src/plugins/index.js +0 -96
- package/dist/src/registry.js +0 -246
- package/dist/src/schema-validator.js +0 -315
- package/dist/src/stonecrop.js +0 -339
- package/dist/src/stores/data.d.ts +0 -11
- package/dist/src/stores/data.d.ts.map +0 -1
- package/dist/src/stores/hst.js +0 -495
- package/dist/src/stores/index.js +0 -12
- package/dist/src/stores/operation-log.js +0 -568
- package/dist/src/stores/xstate.d.ts +0 -31
- package/dist/src/stores/xstate.d.ts.map +0 -1
- package/dist/src/tsdoc-metadata.json +0 -11
- package/dist/src/types/field-triggers.js +0 -4
- package/dist/src/types/index.js +0 -4
- package/dist/src/types/operation-log.js +0 -0
- package/dist/src/types/registry.js +0 -0
- package/dist/src/utils.d.ts +0 -24
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/stonecrop.css +0 -1
- package/dist/stonecrop.umd.cjs +0 -6
- package/dist/stonecrop.umd.cjs.map +0 -1
- package/dist/stores/data.js +0 -7
- package/dist/stores/xstate.js +0 -29
- package/dist/tests/setup.d.ts +0 -5
- package/dist/tests/setup.d.ts.map +0 -1
- package/dist/tests/setup.js +0 -15
- package/dist/utils.js +0 -46
package/dist/stonecrop.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400..700;1,400..700&display=swap";.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)}.row-index{color:var(--sc-header-text-color);font-weight:700;text-align:center;-webkit-user-select:none;user-select:none;width:2ch;display:flex;align-items:center;justify-content:center}.expandable-row{border-top:1px solid var(--sc-row-border-color);height:var(--sc-atable-row-height)}.expandable-row>td:first-child{border-left:4px solid var(--sc-row-border-color)}.expanded-row{border-left:2px solid var(--sc-row-border-color)}.expandable-row:last-child{border-bottom:1px solid var(--sc-row-border-color)}.expanded-row-content{border-top:1px solid var(--sc-row-border-color);padding:1.5rem}.expandable-row.changed-row-gradient[data-v-a42297c7]: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))}.aganttcell[data-v-c2df3f52]{background-color:#f9f9f9;width:100%;padding:0;height:100%}.gantt-container[data-v-c2df3f52]{position:relative;height:100%;background-color:#f0f0f0;border-radius:4px;overflow:visible}.gantt-bar[data-v-c2df3f52]{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-c2df3f52]:active{cursor:grabbing}.gantt-bar.is-dragging[data-v-c2df3f52]{z-index:10}.gantt-label[data-v-c2df3f52]{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-c2df3f52]{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-c2df3f52]{border-right:1px solid rgba(0,0,0,.5)}.right-resize-handle[data-v-c2df3f52]{border-left:1px solid rgba(0,0,0,.5)}.handle-grip[data-v-c2df3f52]{width:4px;height:12px;border-radius:2px;background:#000c}.resize-handle[data-v-c2df3f52]:hover{background-color:#ffffff80}.vertical-indicator[data-v-c2df3f52]{position:absolute;width:2px;opacity:0;pointer-events:none;transition:opacity .2s ease;top:-100vh;height:100vh;z-index:5;background-color:var(--v737862e7)}.left-indicator[data-v-c2df3f52]{left:50%;transform:translate(-50%)}.right-indicator[data-v-c2df3f52]{right:50%;transform:translate(50%)}.resize-handle.is-dragging .vertical-indicator[data-v-c2df3f52]{opacity:.7}.gantt-container[data-v-c2df3f52]:after{content:"";position:absolute;inset:0;background-size:calc(100% / var(--v05f25613)) 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-c2df3f52]{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-c2df3f52]{opacity:1}.left-connection-handle[data-v-c2df3f52]{left:-16px}.right-connection-handle[data-v-c2df3f52]{right:-16px}.connection-dot[data-v-c2df3f52]{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-c2df3f52]{background-color:#1976d2;transform:scale(1.2)}.connection-handle.is-dragging[data-v-c2df3f52]{opacity:1!important}.connection-handle.is-dragging .connection-dot[data-v-c2df3f52]{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 .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: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{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;padding-top:var(--sc-atable-row-padding);padding-bottom:var(--sc-atable-row-padding)}.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-2e038a9c]: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-8487462d]{display:flex;align-items:center;gap:.25rem;width:100%}.filter-input[data-v-8487462d],.filter-select[data-v-8487462d]{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-8487462d]:focus,.filter-select[data-v-8487462d]:focus{outline:none;border-color:var(--sc-input-active-border-color)}.checkbox-filter[data-v-8487462d]{display:flex;align-items:center;gap:.25rem;font-size:.875rem;color:var(--sc-text-color);cursor:pointer}.filter-checkbox[data-v-8487462d]{margin:0}.date-range-filter[data-v-8487462d]{display:flex;gap:.25rem;align-items:center;width:100%}.date-range-filter .filter-input[data-v-8487462d]{flex:1;min-width:0}.date-separator[data-v-8487462d]{color:var(--sc-gray-50);font-weight:500;padding:0 .25rem;flex-shrink:0}.clear-btn[data-v-8487462d]{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}:root{--sc-primary-color: #0098c9;--sc-primary-text-color: #ffffff;--sc-brand-color: #202a44;--sc-gray-5: #f2f2f2;--sc-gray-10: #e6e6e6;--sc-gray-20: #cccccc;--sc-gray-50: #808080;--sc-gray-60: #666666;--sc-gray-80: #333333;--sc-brand-danger: #e63c28;--sc-brand-success: #155724;--sc-brand-warning: #b99d3e;--sc-active-cell-background: #ffffff;--sc-active-cell-outline: #e6a92d;--sc-cell-border-color: #ffffff;--sc-cell-text-color: #3a3c41;--sc-focus-cell-background: #ffffff;--sc-focus-cell-outline: #000000;--sc-header-border-color: #ffffff;--sc-header-text-color: var(--sc-gray-20);--sc-row-border-color: var(--sc-gray-20);--sc-row-color-zebra-dark: #dddddd;--sc-row-color-zebra-light: #eeeeee;--sc-row-number-background-color: #ffffff;--sc-input-active-border-color: #000000;--sc-input-active-label-color: #000000;--sc-input-border-color: var(--sc-gray-20);--sc-input-label-color: var(--sc-gray-60);--sc-required-border: #e63c28;--sc-cell-changed-color: #d8edff;--sc-form-border: var(--sc-gray-5);--sc-form-background: #ffffff;--sc-input-field-background: #ffffff;--sc-input-field-disabled-background: var(--sc-gray-5);--sc-font-size: 10px;--sc-font-family: Arimo, Arial, sans-serif;--sc-table-font-size: 16px;--sc-atable-font-family: "Arimo", sans-serif;--sc-atable-row-padding: .125rem;--sc-atable-row-height: 1.5em;--sc-atable-cell-border-width: 2px;--sc-table-loading-color: 204, 204, 204;--sc-btn-border: #cccccc;--sc-btn-color: white;--sc-btn-hover: #f2f2f2;--sc-btn-label-color: black}.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)}[data-v-56d7171c]:root{--sc-primary-color: #0098c9;--sc-primary-text-color: #ffffff;--sc-brand-color: #202a44;--sc-gray-5: #f2f2f2;--sc-gray-10: #e6e6e6;--sc-gray-20: #cccccc;--sc-gray-50: #808080;--sc-gray-60: #666666;--sc-gray-80: #333333;--sc-brand-danger: #e63c28;--sc-brand-success: #155724;--sc-brand-warning: #b99d3e;--sc-active-cell-background: #ffffff;--sc-active-cell-outline: #e6a92d;--sc-cell-border-color: #ffffff;--sc-cell-text-color: #3a3c41;--sc-focus-cell-background: #ffffff;--sc-focus-cell-outline: #000000;--sc-header-border-color: #ffffff;--sc-header-text-color: var(--sc-gray-20);--sc-row-border-color: var(--sc-gray-20);--sc-row-color-zebra-dark: #dddddd;--sc-row-color-zebra-light: #eeeeee;--sc-row-number-background-color: #ffffff;--sc-input-active-border-color: #000000;--sc-input-active-label-color: #000000;--sc-input-border-color: var(--sc-gray-20);--sc-input-label-color: var(--sc-gray-60);--sc-required-border: #e63c28;--sc-cell-changed-color: #d8edff;--sc-form-border: var(--sc-gray-5);--sc-form-background: #ffffff;--sc-input-field-background: #ffffff;--sc-input-field-disabled-background: var(--sc-gray-5);--sc-font-size: 10px;--sc-font-family: Arimo, Arial, sans-serif;--sc-table-font-size: 16px;--sc-atable-font-family: "Arimo", sans-serif;--sc-atable-row-padding: .125rem;--sc-atable-row-height: 1.5em;--sc-atable-cell-border-width: 2px;--sc-table-loading-color: 204, 204, 204;--sc-btn-border: #cccccc;--sc-btn-color: white;--sc-btn-hover: #f2f2f2;--sc-btn-label-color: black}.atable[data-v-56d7171c]{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-56d7171c]{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-56d7171c]:focus{outline:none}.atable[data-v-56d7171c]:tbody{overflow:hidden;position:relative}.atable[data-v-56d7171c]: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-cc185b72]{cursor:pointer;width:auto;margin-top:0;display:block}.aform_checkbox[data-v-cc185b72]:checked{accent-color:var(--sc-primary-color);border:1px solid black}.aform_checkbox-container[data-v-cc185b72]{width:100%;display:inline-block;text-align:left}.aform_checkbox-container input[data-v-cc185b72]{width:auto}.aform_checkbox-container:hover+.aform_field-label[data-v-cc185b72]{color:var(--sc-input-active-label-color)}div[data-v-8e467bb3]{min-width:40ch;width:100%;box-sizing:border-box;border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}input[data-v-8e467bb3]{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-8e467bb3],label[data-v-8e467bb3]{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-8e467bb3]{width:100%;color:red;font-size:85%;box-sizing:border-box}label[data-v-8e467bb3]{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-8e467bb3]:focus{border:1px solid var(--sc-input-active-border-color)}input:focus+label[data-v-8e467bb3]{color:var(--sc-input-active-label-color)}.autocomplete[data-v-c823d475]{position:relative}.input-wrapper[data-v-c823d475]{border:1px solid transparent;padding:0rem;margin:0rem;margin-right:1ch}input[data-v-c823d475]{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}input[data-v-c823d475]:focus{border:1px solid var(--sc-input-active-border-color);border-radius:.25rem .25rem 0 0;border-bottom:none}label[data-v-c823d475]{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-c823d475]{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-c823d475]{list-style:none;text-align:left;padding:4px 6px;cursor:pointer;border-bottom:.5px solid lightgray}.autocomplete-result.is-active[data-v-c823d475],.autocomplete-result[data-v-c823d475]:hover{background-color:var(--sc-row-color-zebra-light);color:var(--sc-input-active-border-color)}.adatepicker[data-v-9da05d06]{font-size:var(--sc-table-font-size);display:inline-table;color:var(--sc-cell-text-color);outline:none;border-collapse:collapse}.adatepicker tr[data-v-9da05d06]{height:1.15rem;text-align:center;vertical-align:middle}.adatepicker td[data-v-9da05d06]{border:2px solid transparent;outline:2px solid transparent;min-width:3ch;max-width:3ch}.adatepicker td[data-v-9da05d06]:focus,.adatepicker td[data-v-9da05d06]:focus-within{outline:1px dashed black;box-shadow:none;min-height:1.15em;max-height:1.15em;overflow:hidden}.adatepicker .selectedDate[data-v-9da05d06]{outline:1px solid black;background:var(--sc-gray-20);font-weight:bolder}.adatepicker .todaysDate[data-v-9da05d06]{font-weight:bolder;text-decoration:underline;color:#000}.days-header>td[data-v-9da05d06]{font-weight:700}.prev-date[data-v-9da05d06]{color:var(--sc-gray-20)}.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}.aform_form-element{padding:0;margin:0;position:relative;box-sizing:border-box;flex-grow:1;min-width:20ch;margin-bottom:1rem}.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)}.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{background:var(--sc-input-field-disabled-background)}.aform_input-field: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{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:block;display:inline-block;display:none;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-969d8869]{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-969d8869]{flex-direction:column}}.aform-nested-section[data-v-969d8869]{width:100%;padding:.5rem 0}.aform-nested-label[data-v-969d8869]{font-size:.9rem;font-weight:600;margin:0 0 .5rem;color:var(--sc-input-label-color, #666)}.aform-nested-section .aform[data-v-969d8869]{border-left-width:2px;margin-left:.5rem}fieldset[data-v-a3606386]{max-width:100%;width:100%;margin-right:2ch;border:1px solid transparent;border-bottom:1px solid var(--sc-gray-50)}legend[data-v-a3606386]{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-a3606386]{float:right}.aform_file-attach[data-v-6543d39a]{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-6543d39a]{width:100%}}.aform_file-attach-feedback[data-v-6543d39a]{color:var(--sc-input-label-color);width:100%;padding:.5rem;text-align:center;align-self:center}.aform_file-attach-feedback>li[data-v-6543d39a]{list-style:none;font-style:italic}.aform_file-attach-feedback>p[data-v-6543d39a]{margin-top:0}.aform_form-btn[data-v-6543d39a]{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-6543d39a]:disabled{background-color:var(--sc-gray-5)}.login-container[data-v-d9ffd0a7]{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-d9ffd0a7]{width:100%;margin-left:auto;margin-top:.5rem;margin-right:auto;display:flex;flex-direction:column;justify-content:center}.account-header[data-v-d9ffd0a7]{display:flex;flex-direction:column;text-align:center;margin-top:.5rem}#account-title[data-v-d9ffd0a7]{font-size:1.5rem;line-height:2rem;font-weight:600;letter-spacing:-.025em;margin:0}#account-subtitle[data-v-d9ffd0a7]{font-size:.875rem;line-height:1.25rem;margin:1rem}.login-form-container[data-v-d9ffd0a7]{display:grid;gap:.5rem}.login-form-element[data-v-d9ffd0a7]{display:grid;margin:.5rem 0;position:relative}.login-field[data-v-d9ffd0a7]{padding:.5rem .25rem .25rem .5rem;outline:1px solid transparent;border:1px solid var(--sc-input-border-color);border-radius:.25rem}.login-field[data-v-d9ffd0a7]:focus{border:1px solid black}.btn[data-v-d9ffd0a7]{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-d9ffd0a7]:hover{background-color:var(--sc-btn-hover)}.btn[data-v-d9ffd0a7]:disabled{background-color:var(--sc-input-field-disabled-background)}.disabled[data-v-d9ffd0a7]{opacity:.5}.loading-icon[data-v-d9ffd0a7]{animation:spin-d9ffd0a7 1s linear infinite forwards;display:inline-block;margin-right:.2rem;line-height:0;font-size:1rem;position:relative;top:.2rem}@keyframes spin-d9ffd0a7{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
package/dist/stonecrop.umd.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
(function(I,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(I=typeof globalThis<"u"?globalThis:I||self,a(I["@stonecrop/stonecrop"]={},I.Vue))})(this,(function(I,a){"use strict";const Y=typeof window<"u";let J;const ae=n=>J=n;process.env.NODE_ENV;const de=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function G(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var oe;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(oe||(oe={}));function we(n,e){for(const t in e){const r=e[t];if(!(t in n))continue;const o=n[t];G(o)&&G(r)&&!a.isRef(r)&&!a.isReactive(r)?n[t]=we(o,r):n[t]=r}return n}const Ee=()=>{};function Re(n,e,t,r=Ee){n.add(e);const o=()=>{n.delete(e)&&r()};return!t&&a.getCurrentScope()&&a.onScopeDispose(o),o}function X(n,...e){n.forEach(t=>{t(...e)})}const Fe=n=>n(),Oe=Symbol(),pe=Symbol();function he(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,r)=>n.set(r,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const r=e[t],o=n[t];G(o)&&G(r)&&n.hasOwnProperty(t)&&!a.isRef(r)&&!a.isReactive(r)?n[t]=he(o,r):n[t]=r}return n}const xe=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function je(n){return!G(n)||!Object.prototype.hasOwnProperty.call(n,xe)}const{assign:H}=Object;function Ae(n){return!!(a.isRef(n)&&n.effect)}function Pe(n,e,t,r){const{state:o,actions:s,getters:i}=e,c=t.state.value[n];let l;function d(){!c&&(process.env.NODE_ENV==="production"||!r)&&(t.state.value[n]=o?o():{});const m=process.env.NODE_ENV!=="production"&&r?a.toRefs(a.ref(o?o():{}).value):a.toRefs(t.state.value[n]);return H(m,s,Object.keys(i||{}).reduce((w,P)=>(process.env.NODE_ENV!=="production"&&P in m&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${P}" in store "${n}".`),w[P]=a.markRaw(a.computed(()=>{ae(t);const $=t._s.get(n);return i[P].call($,$)})),w),{}))}return l=ge(n,d,e,t,r,!0),l}function ge(n,e,t={},r,o,s){let i;const c=H({actions:{}},t);if(process.env.NODE_ENV!=="production"&&!r._e.active)throw new Error("Pinia destroyed");const l={deep:!0};process.env.NODE_ENV!=="production"&&(l.onTrigger=p=>{d?$=p:d==!1&&!y._hotUpdating&&(Array.isArray($)?$.push(p):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let d,m,w=new Set,P=new Set,$;const L=r.state.value[n];!s&&!L&&(process.env.NODE_ENV==="production"||!o)&&(r.state.value[n]={});const x=a.ref({});let _;function D(p){let h;d=m=!1,process.env.NODE_ENV!=="production"&&($=[]),typeof p=="function"?(p(r.state.value[n]),h={type:oe.patchFunction,storeId:n,events:$}):(he(r.state.value[n],p),h={type:oe.patchObject,payload:p,storeId:n,events:$});const A=_=Symbol();a.nextTick().then(()=>{_===A&&(d=!0)}),m=!0,X(w,h,r.state.value[n])}const N=s?function(){const{state:h}=t,A=h?h():{};this.$patch(B=>{H(B,A)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${n}" is built using the setup syntax and does not implement $reset().`)}:Ee;function b(){i.stop(),w.clear(),P.clear(),r._s.delete(n)}const V=(p,h="")=>{if(Oe in p)return p[pe]=h,p;const A=function(){ae(r);const B=Array.from(arguments),E=new Set,C=new Set;function M(S){E.add(S)}function v(S){C.add(S)}X(P,{args:B,name:A[pe],store:y,after:M,onError:v});let R;try{R=p.apply(this&&this.$id===n?this:y,B)}catch(S){throw X(C,S),S}return R instanceof Promise?R.then(S=>(X(E,S),S)).catch(S=>(X(C,S),Promise.reject(S))):(X(E,R),R)};return A[Oe]=!0,A[pe]=h,A},O=a.markRaw({actions:{},getters:{},state:[],hotState:x}),T={_p:r,$id:n,$onAction:Re.bind(null,P),$patch:D,$reset:N,$subscribe(p,h={}){const A=Re(w,p,h.detached,()=>B()),B=i.run(()=>a.watch(()=>r.state.value[n],E=>{(h.flush==="sync"?m:d)&&p({storeId:n,type:oe.direct,events:$},E)},H({},l,h)));return A},$dispose:b},y=a.reactive(process.env.NODE_ENV!=="production"||process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&Y?H({_hmrPayload:O,_customProperties:a.markRaw(new Set)},T):T);r._s.set(n,y);const j=(r._a&&r._a.runWithContext||Fe)(()=>r._e.run(()=>(i=a.effectScope()).run(()=>e({action:V}))));for(const p in j){const h=j[p];if(a.isRef(h)&&!Ae(h)||a.isReactive(h))process.env.NODE_ENV!=="production"&&o?x.value[p]=a.toRef(j,p):s||(L&&je(h)&&(a.isRef(h)?h.value=L[p]:he(h,L[p])),r.state.value[n][p]=h),process.env.NODE_ENV!=="production"&&O.state.push(p);else if(typeof h=="function"){const A=process.env.NODE_ENV!=="production"&&o?h:V(h,p);j[p]=A,process.env.NODE_ENV!=="production"&&(O.actions[p]=h),c.actions[p]=h}else process.env.NODE_ENV!=="production"&&Ae(h)&&(O.getters[p]=s?t.getters[p]:h,Y&&(j._getters||(j._getters=a.markRaw([]))).push(p))}if(H(y,j),H(a.toRaw(y),j),Object.defineProperty(y,"$state",{get:()=>process.env.NODE_ENV!=="production"&&o?x.value:r.state.value[n],set:p=>{if(process.env.NODE_ENV!=="production"&&o)throw new Error("cannot set hotState");D(h=>{H(h,p)})}}),process.env.NODE_ENV!=="production"&&(y._hotUpdate=a.markRaw(p=>{y._hotUpdating=!0,p._hmrPayload.state.forEach(h=>{if(h in y.$state){const A=p.$state[h],B=y.$state[h];typeof A=="object"&&G(A)&&G(B)?we(A,B):p.$state[h]=B}y[h]=a.toRef(p.$state,h)}),Object.keys(y.$state).forEach(h=>{h in p.$state||delete y[h]}),d=!1,m=!1,r.state.value[n]=a.toRef(p._hmrPayload,"hotState"),m=!0,a.nextTick().then(()=>{d=!0});for(const h in p._hmrPayload.actions){const A=p[h];y[h]=V(A,h)}for(const h in p._hmrPayload.getters){const A=p._hmrPayload.getters[h],B=s?a.computed(()=>(ae(r),A.call(y,y))):A;y[h]=B}Object.keys(y._hmrPayload.getters).forEach(h=>{h in p._hmrPayload.getters||delete y[h]}),Object.keys(y._hmrPayload.actions).forEach(h=>{h in p._hmrPayload.actions||delete y[h]}),y._hmrPayload=p._hmrPayload,y._getters=p._getters,y._hotUpdating=!1})),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&Y){const p={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(h=>{Object.defineProperty(y,h,H({value:y[h]},p))})}return r._p.forEach(p=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&Y){const h=i.run(()=>p({store:y,app:r._a,pinia:r,options:c}));Object.keys(h||{}).forEach(A=>y._customProperties.add(A)),H(y,h)}else H(y,i.run(()=>p({store:y,app:r._a,pinia:r,options:c})))}),process.env.NODE_ENV!=="production"&&y.$state&&typeof y.$state=="object"&&typeof y.$state.constructor=="function"&&!y.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
2
|
-
state: () => new MyClass()
|
|
3
|
-
Found in store "${y.$id}".`),L&&s&&t.hydrate&&t.hydrate(y.$state,L),d=!0,m=!0,y}function Be(n,e,t){let r;const o=typeof e=="function";r=o?t:e;function s(i,c){const l=a.hasInjectionContext();if(i=(process.env.NODE_ENV==="test"&&J&&J._testing?null:i)||(l?a.inject(de,null):null),i&&ae(i),process.env.NODE_ENV!=="production"&&!J)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
4
|
-
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
5
|
-
This will fail in production.`);i=J,i._s.has(n)||(o?ge(n,e,r,i):Pe(n,r,i),process.env.NODE_ENV!=="production"&&(s._pinia=i));const d=i._s.get(n);if(process.env.NODE_ENV!=="production"&&c){const m="__hot:"+n,w=o?ge(m,e,r,i,!0):Pe(m,H({},r),i,!0);c._hotUpdate(w),delete i.state.value[m],i._s.delete(m)}if(process.env.NODE_ENV!=="production"&&Y){const m=a.getCurrentInstance();if(m&&m.proxy&&!c){const w=m.proxy,P="_pStores"in w?w._pStores:w._pStores={};P[n]=d}}return d}return s.$id=n,s}function Ne(n){const e=a.toRaw(n),t={};for(const r in e){const o=e[r];o.effect?t[r]=a.computed({get:()=>n[r],set(s){n[r]=s}}):(a.isRef(o)||a.isReactive(o))&&(t[r]=a.toRef(n,r))}return t}const We=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const He=Object.prototype.toString,Ue=n=>He.call(n)==="[object Object]",_e=()=>{};function ze(...n){if(n.length!==1)return a.toRef(...n);const e=n[0];return typeof e=="function"?a.readonly(a.customRef(()=>({get:e,set:_e}))):a.ref(e)}function qe(n,e){function t(...r){return new Promise((o,s)=>{Promise.resolve(n(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(o).catch(s)})}return t}const Te=n=>n();function Je(n=Te,e={}){const{initialState:t="active"}=e,r=ze(t==="active");function o(){r.value=!1}function s(){r.value=!0}const i=(...c)=>{r.value&&n(...c)};return{isActive:a.readonly(r),pause:o,resume:s,eventFilter:i}}function me(n){return Array.isArray(n)?n:[n]}function Ge(n){return a.getCurrentInstance()}function Ke(n,e,t={}){const{eventFilter:r=Te,...o}=t;return a.watch(n,qe(r,e),o)}function Ze(n,e,t={}){const{eventFilter:r,initialState:o="active",...s}=t,{eventFilter:i,pause:c,resume:l,isActive:d}=Je(r,{initialState:o});return{stop:Ke(n,e,{...s,eventFilter:i}),pause:c,resume:l,isActive:d}}function Qe(n,e=!0,t){Ge()?a.onMounted(n,t):e?n():a.nextTick(n)}function Ye(n,e,t){return a.watch(n,e,{...t,immediate:!0})}function se(n,e,t){return a.watch(n,(o,s,i)=>{o&&e(o,s,i)},{...t,once:!1})}const K=We?window:void 0;function Xe(n){var e;const t=a.toValue(n);return(e=t?.$el)!==null&&e!==void 0?e:t}function ee(...n){const e=(r,o,s,i)=>(r.addEventListener(o,s,i),()=>r.removeEventListener(o,s,i)),t=a.computed(()=>{const r=me(a.toValue(n[0])).filter(o=>o!=null);return r.every(o=>typeof o!="string")?r:void 0});return Ye(()=>{var r,o;return[(r=(o=t.value)===null||o===void 0?void 0:o.map(s=>Xe(s)))!==null&&r!==void 0?r:[K].filter(s=>s!=null),me(a.toValue(t.value?n[1]:n[0])),me(a.unref(t.value?n[2]:n[1])),a.toValue(t.value?n[3]:n[2])]},([r,o,s,i],c,l)=>{if(!r?.length||!o?.length||!s?.length)return;const d=Ue(i)?{...i}:i,m=r.flatMap(w=>o.flatMap(P=>s.map($=>e(w,P,$,d))));l(()=>{m.forEach(w=>w())})},{flush:"post"})}const ce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},le="__vueuse_ssr_handlers__",et=tt();function tt(){return le in ce||(ce[le]=ce[le]||{}),ce[le]}function rt(n,e){return et[n]||e}function nt(n){return n==null?"any":n instanceof Set?"set":n instanceof Map?"map":n instanceof Date?"date":typeof n=="boolean"?"boolean":typeof n=="string"?"string":typeof n=="object"?"object":Number.isNaN(n)?"any":"number"}const ot={boolean:{read:n=>n==="true",write:n=>String(n)},object:{read:n=>JSON.parse(n),write:n=>JSON.stringify(n)},number:{read:n=>Number.parseFloat(n),write:n=>String(n)},any:{read:n=>n,write:n=>String(n)},string:{read:n=>n,write:n=>String(n)},map:{read:n=>new Map(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n.entries()))},set:{read:n=>new Set(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n))},date:{read:n=>new Date(n),write:n=>n.toISOString()}},$e="vueuse-storage";function st(n,e,t,r={}){var o;const{flush:s="pre",deep:i=!0,listenToStorageChanges:c=!0,writeDefaults:l=!0,mergeDefaults:d=!1,shallow:m,window:w=K,eventFilter:P,onError:$=E=>{console.error(E)},initOnMounted:L}=r,x=(m?a.shallowRef:a.ref)(e),_=a.computed(()=>a.toValue(n));if(!t)try{t=rt("getDefaultStorage",()=>K?.localStorage)()}catch(E){$(E)}if(!t)return x;const D=a.toValue(e),N=nt(D),b=(o=r.serializer)!==null&&o!==void 0?o:ot[N],{pause:V,resume:O}=Ze(x,E=>p(E),{flush:s,deep:i,eventFilter:P});a.watch(_,()=>A(),{flush:s});let T=!1;const y=E=>{L&&!T||A(E)},W=E=>{L&&!T||B(E)};w&&c&&(t instanceof Storage?ee(w,"storage",y,{passive:!0}):ee(w,$e,W)),L?Qe(()=>{T=!0,A()}):A();function j(E,C){if(w){const M={key:_.value,oldValue:E,newValue:C,storageArea:t};w.dispatchEvent(t instanceof Storage?new StorageEvent("storage",M):new CustomEvent($e,{detail:M}))}}function p(E){try{const C=t.getItem(_.value);if(E==null)j(C,null),t.removeItem(_.value);else{const M=b.write(E);C!==M&&(t.setItem(_.value,M),j(C,M))}}catch(C){$(C)}}function h(E){const C=E?E.newValue:t.getItem(_.value);if(C==null)return l&&D!=null&&t.setItem(_.value,b.write(D)),D;if(!E&&d){const M=b.read(C);return typeof d=="function"?d(M,D):N==="object"&&!Array.isArray(M)?{...D,...M}:M}else return typeof C!="string"?C:b.read(C)}function A(E){if(!(E&&E.storageArea!==t)){if(E&&E.key==null){x.value=D;return}if(!(E&&E.key!==_.value)){V();try{const C=b.write(x.value);(E===void 0||E?.newValue!==C)&&(x.value=h(E))}catch(C){$(C)}finally{E?a.nextTick(O):O()}}}}function B(E){A(E.detail)}return x}function it(n,e,t={}){const{window:r=K}=t;return st(n,e,r?.localStorage,t)}const at={ctrl:"control",command:"meta",cmd:"meta",option:"alt",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright"};function ct(n={}){const{reactive:e=!1,target:t=K,aliasMap:r=at,passive:o=!0,onEventFired:s=_e}=n,i=a.reactive(new Set),c={toJSON(){return{}},current:i},l=e?a.reactive(c):c,d=new Set,m=new Map([["Meta",d],["Shift",new Set],["Alt",new Set]]),w=new Set;function P(N,b){N in l&&(e?l[N]=b:l[N].value=b)}function $(){i.clear();for(const N of w)P(N,!1)}function L(N,b,V){if(!(!N||typeof b.getModifierState!="function")){for(const[O,T]of m)if(b.getModifierState(O)){V.forEach(y=>T.add(y));break}}}function x(N,b){if(N)return;const V=`${b[0].toUpperCase()}${b.slice(1)}`,O=m.get(V);if(!["shift","alt"].includes(b)||!O)return;const T=Array.from(O),y=T.indexOf(b);T.forEach((W,j)=>{j>=y&&(i.delete(W),P(W,!1))}),O.clear()}function _(N,b){var V,O;const T=(V=N.key)===null||V===void 0?void 0:V.toLowerCase(),y=[(O=N.code)===null||O===void 0?void 0:O.toLowerCase(),T].filter(Boolean);if(T){T&&(b?i.add(T):i.delete(T));for(const W of y)w.add(W),P(W,b);L(b,N,[...i,...y]),x(b,T),T==="meta"&&!b&&(d.forEach(W=>{i.delete(W),P(W,!1)}),d.clear())}}ee(t,"keydown",N=>(_(N,!0),s(N)),{passive:o}),ee(t,"keyup",N=>(_(N,!1),s(N)),{passive:o}),ee("blur",$,{passive:o}),ee("focus",$,{passive:o});const D=new Proxy(l,{get(N,b,V){if(typeof b!="string")return Reflect.get(N,b,V);if(b=b.toLowerCase(),b in r&&(b=r[b]),!(b in l))if(/[+_-]/.test(b)){const T=b.split(/[+_-]/g).map(y=>y.trim());l[b]=a.computed(()=>T.map(y=>a.toValue(D[y])).every(Boolean))}else l[b]=a.shallowRef(!1);const O=Reflect.get(N,b,V);return e?a.toValue(O):O}});return D}function ye(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function ue(n){const e={type:n.type,clientId:n.clientId,timestamp:n.timestamp.toISOString()};return n.operation&&(e.operation={...n.operation,timestamp:n.operation.timestamp.toISOString()}),n.operations&&(e.operations=n.operations.map(t=>({...t,timestamp:t.timestamp.toISOString()}))),e}function lt(n){const e={type:n.type,clientId:n.clientId,timestamp:new Date(n.timestamp)};return n.operation&&(e.operation={...n.operation,timestamp:new Date(n.operation.timestamp)}),n.operations&&(e.operations=n.operations.map(t=>({...t,timestamp:new Date(t.timestamp)}))),e}const te=Be("hst-operation-log",()=>{const n=a.ref({maxOperations:100,enableCrossTabSync:!0,autoSyncInterval:3e4,enablePersistence:!1,persistenceKeyPrefix:"stonecrop-ops"}),e=a.ref([]),t=a.ref(-1),r=a.ref(ye()),o=a.ref(!1),s=a.ref([]),i=a.ref(null),c=a.computed(()=>t.value<0?!1:e.value[t.value]?.reversible??!1),l=a.computed(()=>t.value<e.value.length-1),d=a.computed(()=>{let f=0;for(let u=t.value;u>=0&&e.value[u]?.reversible;u--)f++;return f}),m=a.computed(()=>e.value.length-1-t.value),w=a.computed(()=>({canUndo:c.value,canRedo:l.value,undoCount:d.value,redoCount:m.value,currentIndex:t.value}));function P(f){n.value={...n.value,...f},n.value.enablePersistence&&(v(),S()),n.value.enableCrossTabSync&&h()}function $(f,u="user"){const g={...f,id:ye(),timestamp:new Date,source:u,userId:n.value.userId};if(n.value.operationFilter&&!n.value.operationFilter(g))return g.id;if(o.value)return s.value.push(g),g.id;if(t.value<e.value.length-1&&(e.value=e.value.slice(0,t.value+1)),e.value.push(g),t.value++,n.value.maxOperations&&e.value.length>n.value.maxOperations){const k=e.value.length-n.value.maxOperations;e.value=e.value.slice(k),t.value-=k}return n.value.enableCrossTabSync&&A(g),g.id}function L(){o.value=!0,s.value=[],i.value=ye()}function x(f){if(!o.value||s.value.length===0)return o.value=!1,s.value=[],i.value=null,null;const u=i.value,g=s.value.every(F=>F.reversible),k={id:u,type:"batch",path:"",fieldname:"",beforeValue:null,afterValue:null,doctype:s.value[0]?.doctype||"",timestamp:new Date,source:"user",reversible:g,irreversibleReason:g?void 0:"Contains irreversible operations",childOperationIds:s.value.map(F=>F.id),metadata:{description:f}};s.value.forEach(F=>{F.parentOperationId=u}),e.value.push(...s.value,k),t.value=e.value.length-1,n.value.enableCrossTabSync&&B(s.value,k);const U=u;return o.value=!1,s.value=[],i.value=null,U}function _(){o.value=!1,s.value=[],i.value=null}function D(f){if(!c.value)return!1;const u=e.value[t.value];if(!u.reversible)return typeof console<"u"&&u.irreversibleReason&&console.warn("Cannot undo irreversible operation:",u.irreversibleReason),!1;try{if(u.type==="batch"&&u.childOperationIds)for(let g=u.childOperationIds.length-1;g>=0;g--){const k=u.childOperationIds[g],U=e.value.find(F=>F.id===k);U&&b(U,f)}else b(u,f);return t.value--,n.value.enableCrossTabSync&&E(u),!0}catch(g){return typeof console<"u"&&console.error("Undo failed:",g),!1}}function N(f){if(!l.value)return!1;const u=e.value[t.value+1];try{if(u.type==="batch"&&u.childOperationIds)for(const g of u.childOperationIds){const k=e.value.find(U=>U.id===g);k&&V(k,f)}else V(u,f);return t.value++,n.value.enableCrossTabSync&&C(u),!0}catch(g){return typeof console<"u"&&console.error("Redo failed:",g),!1}}function b(f,u){(f.type==="set"||f.type==="delete")&&u&&typeof u.set=="function"&&u.set(f.path,f.beforeValue,"undo")}function V(f,u){(f.type==="set"||f.type==="delete")&&u&&typeof u.set=="function"&&u.set(f.path,f.afterValue,"redo")}function O(){const f=e.value.filter(g=>g.reversible).length,u=e.value.map(g=>g.timestamp);return{operations:[...e.value],currentIndex:t.value,totalOperations:e.value.length,reversibleOperations:f,irreversibleOperations:e.value.length-f,oldestOperation:u.length>0?new Date(Math.min(...u.map(g=>g.getTime()))):void 0,newestOperation:u.length>0?new Date(Math.max(...u.map(g=>g.getTime()))):void 0}}function T(){e.value=[],t.value=-1}function y(f,u){return e.value.filter(g=>g.doctype===f&&(u===void 0||g.recordId===u))}function W(f,u){const g=e.value.find(k=>k.id===f);g&&(g.reversible=!1,g.irreversibleReason=u)}function j(f,u,g,k="success",U){const F={type:"action",path:g&&g.length>0?`${f}.${g[0]}`:f,fieldname:"",beforeValue:null,afterValue:null,doctype:f,recordId:g&&g.length>0?g[0]:void 0,reversible:!1,actionName:u,actionRecordIds:g,actionResult:k,actionError:U};return $(F)}let p=null;function h(){typeof window>"u"||!window.BroadcastChannel||(p=new BroadcastChannel("stonecrop-operation-log"),p.addEventListener("message",f=>{const u=f.data;if(!u||typeof u!="object")return;const g=lt(u);g.clientId!==r.value&&(g.type==="operation"&&g.operation?(e.value.push({...g.operation,source:"sync"}),t.value=e.value.length-1):g.type==="operation"&&g.operations&&(e.value.push(...g.operations.map(k=>({...k,source:"sync"}))),t.value=e.value.length-1))}))}function A(f){if(!p)return;const u={type:"operation",operation:f,clientId:r.value,timestamp:new Date};p.postMessage(ue(u))}function B(f,u){if(!p)return;const g={type:"operation",operations:[...f,u],clientId:r.value,timestamp:new Date};p.postMessage(ue(g))}function E(f){if(!p)return;const u={type:"undo",operation:f,clientId:r.value,timestamp:new Date};p.postMessage(ue(u))}function C(f){if(!p)return;const u={type:"redo",operation:f,clientId:r.value,timestamp:new Date};p.postMessage(ue(u))}const M=it("stonecrop-ops-operations",null,{serializer:{read:f=>{try{return JSON.parse(f)}catch{return null}},write:f=>f?JSON.stringify(f):""}});function v(){if(!(typeof window>"u"))try{const f=M.value;f&&Array.isArray(f.operations)&&(e.value=f.operations.map(u=>({...u,timestamp:new Date(u.timestamp)})),t.value=f.currentIndex??-1)}catch(f){typeof console<"u"&&console.error("Failed to load operations from persistence:",f)}}function R(){if(!(typeof window>"u"))try{M.value={operations:e.value.map(f=>({...f,timestamp:f.timestamp.toISOString()})),currentIndex:t.value}}catch(f){typeof console<"u"&&console.error("Failed to save operations to persistence:",f)}}function S(){a.watch([e,t],()=>{n.value.enablePersistence&&R()},{deep:!0})}return{operations:e,currentIndex:t,config:n,clientId:r,undoRedoState:w,canUndo:c,canRedo:l,undoCount:d,redoCount:m,configure:P,addOperation:$,startBatch:L,commitBatch:x,cancelBatch:_,undo:D,redo:N,clear:T,getOperationsFor:y,getSnapshot:O,markIrreversible:W,logAction:j}});class ie{static _root;options;doctypeActions=new Map;doctypeTransitions=new Map;fieldRollbackConfig=new Map;globalActions=new Map;globalTransitionActions=new Map;constructor(e={}){if(ie._root)return ie._root;ie._root=this,this.options={defaultTimeout:e.defaultTimeout??5e3,debug:e.debug??!1,enableRollback:e.enableRollback??!0,errorHandler:e.errorHandler}}registerAction(e,t){this.globalActions.set(e,t)}registerTransitionAction(e,t){this.globalTransitionActions.set(e,t)}setFieldRollback(e,t,r){this.fieldRollbackConfig.has(e)||this.fieldRollbackConfig.set(e,new Map),this.fieldRollbackConfig.get(e).set(t,r)}getFieldRollback(e,t){return this.fieldRollbackConfig.get(e)?.get(t)}registerDoctypeActions(e,t){if(!t)return;const r=new Map,o=new Map;if(typeof t.entrySeq=="function")t.entrySeq().forEach(([s,i])=>{this.categorizeAction(s,i,r,o)});else if(t instanceof Map)for(const[s,i]of t)this.categorizeAction(s,i,r,o);else t&&typeof t=="object"&&Object.entries(t).forEach(([s,i])=>{this.categorizeAction(s,i,r,o)});this.doctypeActions.set(e,r),this.doctypeTransitions.set(e,o)}categorizeAction(e,t,r,o){this.isTransitionKey(e)?o.set(e,t):r.set(e,t)}isTransitionKey(e){return/^[A-Z0-9_]+$/.test(e)&&e.length>0}async executeFieldTriggers(e,t={}){const{doctype:r,fieldname:o}=e,s=this.findFieldTriggers(r,o);if(s.length===0)return{path:e.path,actionResults:[],totalExecutionTime:0,allSucceeded:!0,stoppedOnError:!1,rolledBack:!1};const i=performance.now(),c=[];let l=!1,d=!1,m;const w=this.getFieldRollback(r,o),P=t.enableRollback??w??this.options.enableRollback;P&&e.store&&(m=this.captureSnapshot(e));for(const _ of s)try{const D=await this.executeAction(_,e,t.timeout);if(c.push(D),!D.success){l=!0;break}}catch(D){const b={success:!1,error:D instanceof Error?D:new Error(String(D)),executionTime:0,action:_};c.push(b),l=!0;break}if(P&&l&&m&&e.store)try{this.restoreSnapshot(e,m),d=!0}catch(_){console.error("[FieldTriggers] Rollback failed:",_)}const $=performance.now()-i,L=c.filter(_=>!_.success);if(L.length>0&&this.options.errorHandler)for(const _ of L)try{this.options.errorHandler(_.error,e,_.action)}catch(D){console.error("[FieldTriggers] Error in global error handler:",D)}return{path:e.path,actionResults:c,totalExecutionTime:$,allSucceeded:c.every(_=>_.success),stoppedOnError:l,rolledBack:d,snapshot:this.options.debug&&P?m:void 0}}async executeTransitionActions(e,t={}){const{doctype:r,transition:o}=e,s=this.findTransitionActions(r,o);if(s.length===0)return[];const i=[];for(const l of s)try{const d=await this.executeTransitionAction(l,e,t.timeout);if(i.push(d),!d.success)break}catch(d){const w={success:!1,error:d instanceof Error?d:new Error(String(d)),executionTime:0,action:l,transition:o};i.push(w);break}const c=i.filter(l=>!l.success);if(c.length>0&&this.options.errorHandler)for(const l of c)try{this.options.errorHandler(l.error,e,l.action)}catch(d){console.error("[FieldTriggers] Error in global error handler:",d)}return i}findTransitionActions(e,t){const r=this.doctypeTransitions.get(e);return r?r.get(t)||[]:[]}async executeTransitionAction(e,t,r){const o=performance.now(),s=r??this.options.defaultTimeout;try{let i=this.globalTransitionActions.get(e);if(!i){const l=this.globalActions.get(e);l&&(i=l)}if(!i)throw new Error(`Transition action "${e}" not found in registry`);return await this.executeWithTimeout(i,t,s),{success:!0,executionTime:performance.now()-o,action:e,transition:t.transition}}catch(i){const c=performance.now()-o;return{success:!1,error:i instanceof Error?i:new Error(String(i)),executionTime:c,action:e,transition:t.transition}}}findFieldTriggers(e,t){const r=this.doctypeActions.get(e);if(!r)return[];const o=[];for(const[s,i]of r)this.isFieldTriggerKey(s,t)&&o.push(...i);return o}isFieldTriggerKey(e,t){return e===t?!0:e.includes(".")?this.matchFieldPattern(e,t):e.includes("*")?this.matchFieldPattern(e,t):!1}matchFieldPattern(e,t){const r=e.split("."),o=t.split(".");if(r.length!==o.length)return!1;for(let s=0;s<r.length;s++){const i=r[s],c=o[s];if(i!=="*"&&i!==c)return!1}return!0}async executeAction(e,t,r){const o=performance.now(),s=r??this.options.defaultTimeout;try{const i=this.globalActions.get(e);if(!i)throw new Error(`Action "${e}" not found in registry`);return await this.executeWithTimeout(i,t,s),{success:!0,executionTime:performance.now()-o,action:e}}catch(i){const c=performance.now()-o;return{success:!1,error:i instanceof Error?i:new Error(String(i)),executionTime:c,action:e}}}async executeWithTimeout(e,t,r){return new Promise((o,s)=>{const i=setTimeout(()=>{s(new Error(`Action timeout after ${r}ms`))},r);Promise.resolve(e(t)).then(c=>{clearTimeout(i),o(c)}).catch(c=>{clearTimeout(i),s(c)})})}captureSnapshot(e){if(!(!e.store||!e.doctype||!e.recordId))try{const t=`${e.doctype}.${e.recordId}`,r=e.store.get(t);return!r||typeof r!="object"?void 0:JSON.parse(JSON.stringify(r))}catch(t){this.options.debug&&console.warn("[FieldTriggers] Failed to capture snapshot:",t);return}}restoreSnapshot(e,t){if(!(!e.store||!e.doctype||!e.recordId||!t))try{const r=`${e.doctype}.${e.recordId}`;e.store.set(r,t),this.options.debug&&console.log(`[FieldTriggers] Rolled back ${r} to previous state`)}catch(r){throw console.error("[FieldTriggers] Failed to restore snapshot:",r),r}}}function z(n){return new ie(n)}function ut(n,e){z().registerAction(n,e)}function ft(n,e){z().registerTransitionAction(n,e)}function dt(n,e,t){z().setFieldRollback(n,e,t)}async function pt(n,e,t){const r=z(),o={path:t?.path||(t?.recordId?`${n}.${t.recordId}`:n),fieldname:"",beforeValue:void 0,afterValue:void 0,operation:"set",doctype:n,recordId:t?.recordId,timestamp:new Date,transition:e,currentState:t?.currentState,targetState:t?.targetState,fsmContext:t?.fsmContext};return await r.executeTransitionActions(o)}function ht(n,e){if(n)try{te().markIrreversible(n,e)}catch{}}function De(){try{return te()}catch{return null}}class Z{static instance;static getInstance(){return Z.instance||(Z.instance=new Z),Z.instance}getRegistry(){if(typeof globalThis<"u"){const e=globalThis.Registry?._root;if(e)return e}if(typeof window<"u"){const e=window.Registry?._root;if(e)return e}if(typeof global<"u"&&global){const e=global.Registry?._root;if(e)return e}}getDoctypeMeta(e){const t=this.getRegistry();if(t&&typeof t=="object"&&"registry"in t)return t.registry[e]}}class fe{target;parentPath;rootNode;doctype;parentDoctype;hst;constructor(e,t,r="",o=null,s){return this.target=e,this.parentPath=r,this.rootNode=o||this,this.doctype=t,this.parentDoctype=s,this.hst=Z.getInstance(),new Proxy(this,{get(i,c){if(c in i)return i[c];const l=String(c);return i.getNode(l)},set(i,c,l){const d=String(c);return i.set(d,l),!0}})}get(e){return this.resolveValue(e)}getNode(e){const t=this.resolvePath(e),r=this.resolveValue(e),o=t.split(".");let s=this.doctype;return this.doctype==="StonecropStore"&&o.length>=1&&(s=o[0]),typeof r=="object"&&r!==null&&!this.isPrimitive(r)?new fe(r,s,t,this.rootNode,this.parentDoctype):new fe(r,s,t,this.rootNode,this.parentDoctype)}set(e,t,r="user"){const o=this.resolvePath(e),s=this.has(e)?this.get(e):void 0;if(r!=="undo"&&r!=="redo"){const i=De();if(i&&typeof i.addOperation=="function"){const c=o.split("."),l=this.doctype==="StonecropStore"&&c.length>=1?c[0]:this.doctype,d=c.length>=2?c[1]:void 0,m=c.slice(2).join(".")||c[c.length-1],P=t===void 0&&s!==void 0?"delete":"set";i.addOperation({type:P,path:o,fieldname:m,beforeValue:s,afterValue:t,doctype:l,recordId:d,reversible:!0},r)}}this.updateValue(e,t),this.triggerFieldActions(o,s,t)}has(e){try{if(e==="")return!0;const t=this.parsePath(e);let r=this.target;for(let o=0;o<t.length;o++){const s=t[o];if(r==null)return!1;if(o===t.length-1)return this.isImmutable(r)?r.has(s):this.isPiniaStore(r)&&r.$state&&s in r.$state||s in r;r=this.getProperty(r,s)}return!1}catch{return!1}}getParent(){if(!this.parentPath)return null;const t=this.parentPath.split(".").slice(0,-1).join(".");return t===""?this.rootNode:this.rootNode.getNode(t)}getRoot(){return this.rootNode}getPath(){return this.parentPath}getDepth(){return this.parentPath?this.parentPath.split(".").length:0}getBreadcrumbs(){return this.parentPath?this.parentPath.split("."):[]}async triggerTransition(e,t){const r=z(),o=this.parentPath.split(".");let s=this.doctype,i;this.doctype==="StonecropStore"&&o.length>=1&&(s=o[0]),o.length>=2&&(i=o[1]);const c={path:this.parentPath,fieldname:"",beforeValue:void 0,afterValue:void 0,operation:"set",doctype:s,recordId:i,timestamp:new Date,store:this.rootNode||void 0,transition:e,currentState:t?.currentState,targetState:t?.targetState,fsmContext:t?.fsmContext},l=De();return l&&typeof l.addOperation=="function"&&l.addOperation({type:"transition",path:this.parentPath,fieldname:e,beforeValue:t?.currentState,afterValue:t?.targetState,doctype:s,recordId:i,reversible:!1,metadata:{transition:e,currentState:t?.currentState,targetState:t?.targetState,fsmContext:t?.fsmContext}},"user"),await r.executeTransitionActions(c)}resolvePath(e){return e===""?this.parentPath:this.parentPath?`${this.parentPath}.${e}`:e}resolveValue(e){if(e==="")return this.target;const t=this.parsePath(e);let r=this.target;for(const o of t){if(r==null)return;r=this.getProperty(r,o)}return r}updateValue(e,t){if(e==="")throw new Error("Cannot set value on empty path");const r=this.parsePath(e),o=r.pop();let s=this.target;for(const i of r)if(s=this.getProperty(s,i),s==null)throw new Error(`Cannot set property on null/undefined path: ${e}`);this.setProperty(s,o,t)}getProperty(e,t){return this.isImmutable(e)?e.get(t):this.isVueReactive(e)?e[t]:this.isPiniaStore(e)?e.$state?.[t]??e[t]:e[t]}setProperty(e,t,r){if(this.isImmutable(e))throw new Error("Cannot directly mutate immutable objects. Use immutable update methods instead.");if(this.isPiniaStore(e)){e.$patch?e.$patch({[t]:r}):e[t]=r;return}e[t]=r}async triggerFieldActions(e,t,r){try{if(!e||typeof e!="string")return;const o=e.split(".");if(o.length<3)return;const s=z(),i=o.slice(2).join(".")||o[o.length-1];let c=this.doctype;this.doctype==="StonecropStore"&&o.length>=1&&(c=o[0]);let l;o.length>=2&&(l=o[1]);const d={path:e,fieldname:i,beforeValue:t,afterValue:r,operation:"set",doctype:c,recordId:l,timestamp:new Date,store:this.rootNode||void 0};await s.executeFieldTriggers(d)}catch(o){o instanceof Error&&console.warn("Field trigger error:",o.message)}}isVueReactive(e){return e&&typeof e=="object"&&"__v_isReactive"in e&&e.__v_isReactive===!0}isPiniaStore(e){return e&&typeof e=="object"&&("$state"in e||"$patch"in e||"$id"in e)}isImmutable(e){if(!e||typeof e!="object")return!1;const t="get"in e&&typeof e.get=="function",r="set"in e&&typeof e.set=="function",o="has"in e&&typeof e.has=="function",s="__ownerID"in e||"_map"in e||"_list"in e||"_origin"in e||"_capacity"in e||"_defaultValues"in e||"_tail"in e||"_root"in e||"size"in e&&t&&r;let i;try{const l=e;if("constructor"in l&&l.constructor&&typeof l.constructor=="object"&&"name"in l.constructor){const d=l.constructor.name;i=typeof d=="string"?d:void 0}}catch{i=void 0}const c=i&&(i.includes("Map")||i.includes("List")||i.includes("Set")||i.includes("Stack")||i.includes("Seq"))&&(t||r);return!!(t&&r&&o&&s||t&&r&&c)}isPrimitive(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="function"||typeof e=="symbol"||typeof e=="bigint"}parsePath(e){return e?e.replace(/\[(\d+)\]/g,".$1").split(".").filter(r=>r.length>0):[]}}function Ie(n,e,t){return new fe(n,e,"",null,t)}class ve{hstStore;_operationLogStore;_operationLogConfig;registry;constructor(e,t){this.registry=e,this._operationLogConfig=t,this.initializeHSTStore(),this.setupRegistrySync()}getOperationLogStore(){return this._operationLogStore||(this._operationLogStore=te(),this._operationLogConfig&&this._operationLogStore.configure(this._operationLogConfig)),this._operationLogStore}initializeHSTStore(){const e={};Object.keys(this.registry.registry).forEach(t=>{e[t]={}}),this.hstStore=Ie(a.reactive(e),"StonecropStore")}setupRegistrySync(){const e=this.registry.addDoctype.bind(this.registry);this.registry.addDoctype=t=>{e(t),this.hstStore.has(t.slug)||this.hstStore.set(t.slug,{})}}records(e){const t=typeof e=="string"?e:e.slug;return this.ensureDoctypeExists(t),this.hstStore.getNode(t)}addRecord(e,t,r){const o=typeof e=="string"?e:e.slug;this.ensureDoctypeExists(o),this.hstStore.set(`${o}.${t}`,r)}getRecordById(e,t){const r=typeof e=="string"?e:e.slug;if(this.ensureDoctypeExists(r),!(!this.hstStore.has(`${r}.${t}`)||this.hstStore.get(`${r}.${t}`)===void 0))return this.hstStore.getNode(`${r}.${t}`)}removeRecord(e,t){const r=typeof e=="string"?e:e.slug;this.ensureDoctypeExists(r),this.hstStore.has(`${r}.${t}`)&&this.hstStore.set(`${r}.${t}`,void 0)}getRecordIds(e){const t=typeof e=="string"?e:e.slug;this.ensureDoctypeExists(t);const r=this.hstStore.get(t);return!r||typeof r!="object"?[]:Object.keys(r).filter(o=>r[o]!==void 0)}clearRecords(e){const t=typeof e=="string"?e:e.slug;this.ensureDoctypeExists(t),this.getRecordIds(t).forEach(o=>{this.hstStore.set(`${t}.${o}`,void 0)})}setup(e){this.ensureDoctypeExists(e.slug)}runAction(e,t,r){const s=this.registry.registry[e.slug]?.actions?.get(t),i=Array.isArray(r)?r.filter(m=>typeof m=="string"):void 0,c=this.getOperationLogStore();let l="success",d;try{s&&s.length>0&&s.forEach(m=>{try{new Function("args",m)(r)}catch(w){throw l="failure",d=w instanceof Error?w.message:"Unknown error",w}})}catch{}finally{c.logAction(e.doctype,t,i,l,d)}}async getRecords(e){(await(await fetch(`/${e.slug}`)).json()).forEach(o=>{o.id&&this.addRecord(e,o.id,o)})}async getRecord(e,t){const o=await(await fetch(`/${e.slug}/${t}`)).json();this.addRecord(e,t,o)}ensureDoctypeExists(e){this.hstStore.has(e)||this.hstStore.set(e,{})}async getMeta(e){if(!this.registry.getMeta)throw new Error("No getMeta function provided to Registry");return await this.registry.getMeta(e)}getStore(){return this.hstStore}}function gt(n){n||(n={});const e=n.registry||a.inject("$registry"),t=a.inject("$stonecrop"),r=a.ref(),o=a.ref(),s=a.ref({}),i=a.ref(),c=a.ref(),l=a.ref([]);if(n.doctype&&e){const v=n.doctype.schema?Array.isArray(n.doctype.schema)?n.doctype.schema:Array.from(n.doctype.schema):[];l.value=e.resolveSchema(v)}const d=a.ref([]),m=a.ref(-1),w=a.computed(()=>r.value?.getOperationLogStore().canUndo??!1),P=a.computed(()=>r.value?.getOperationLogStore().canRedo??!1),$=a.computed(()=>r.value?.getOperationLogStore().undoCount??0),L=a.computed(()=>r.value?.getOperationLogStore().redoCount??0),x=a.computed(()=>r.value?.getOperationLogStore().undoRedoState??{canUndo:!1,canRedo:!1,undoCount:0,redoCount:0,currentIndex:-1}),_=v=>r.value?.getOperationLogStore().undo(v)??!1,D=v=>r.value?.getOperationLogStore().redo(v)??!1,N=()=>{r.value?.getOperationLogStore().startBatch()},b=v=>r.value?.getOperationLogStore().commitBatch(v)??null,V=()=>{r.value?.getOperationLogStore().cancelBatch()},O=()=>{r.value?.getOperationLogStore().clear()},T=(v,R)=>r.value?.getOperationLogStore().getOperationsFor(v,R)??[],y=()=>r.value?.getOperationLogStore().getSnapshot()??{operations:[],currentIndex:-1,totalOperations:0,reversibleOperations:0,irreversibleOperations:0},W=(v,R)=>{r.value?.getOperationLogStore().markIrreversible(v,R)},j=(v,R,S,f="success",u)=>r.value?.getOperationLogStore().logAction(v,R,S,f,u)??"",p=v=>{r.value?.getOperationLogStore().configure(v)};a.onMounted(async()=>{if(e){r.value=t||new ve(e);try{const v=r.value.getOperationLogStore(),R=Ne(v);d.value=R.operations.value,m.value=R.currentIndex.value,a.watch(()=>R.operations.value,S=>{d.value=S}),a.watch(()=>R.currentIndex.value,S=>{m.value=S})}catch{}if(!n.doctype&&e.router){const v=e.router.currentRoute.value;if(!v.path)return;const R=v.path.split("/").filter(f=>f.length>0),S=R[1]?.toLowerCase();if(R.length>0){const f={path:v.path,segments:R},u=await e.getMeta?.(f);if(u){if(e.addDoctype(u),r.value.setup(u),i.value=u,c.value=S,o.value=r.value.getStore(),e){const g=u.schema?Array.isArray(u.schema)?u.schema:Array.from(u.schema):[];l.value=e.resolveSchema(g)}if(S&&S!=="new"){const g=r.value.getRecordById(u,S);if(g)s.value=g.get("")||{};else try{await r.value.getRecord(u,S);const k=r.value.getRecordById(u,S);k&&(s.value=k.get("")||{})}catch{s.value=q(u)}}else s.value=q(u);o.value&&Ce(u,S||"new",s,o.value),r.value.runAction(u,"load",S?[S]:void 0)}}}if(n.doctype){o.value=r.value.getStore();const v=n.doctype,R=n.recordId;if(R&&R!=="new"){const S=r.value.getRecordById(v,R);if(S)s.value=S.get("")||{};else try{await r.value.getRecord(v,R);const f=r.value.getRecordById(v,R);f&&(s.value=f.get("")||{})}catch{s.value=q(v)}}else s.value=q(v);o.value&&Ce(v,R||"new",s,o.value)}}});const h=(v,R)=>{const S=n.doctype||i.value;if(!S)return"";const f=R||n.recordId||c.value||"new";return`${S.slug}.${f}.${v}`},A=v=>{const R=n.doctype||i.value;if(!(!o.value||!r.value||!R))try{const S=v.path.split(".");if(S.length>=2){const g=S[0],k=S[1];if(o.value.has(`${g}.${k}`)||r.value.addRecord(R,k,{...s.value}),S.length>3){const U=`${g}.${k}`,F=S.slice(2);let Q=U;for(let ne=0;ne<F.length-1;ne++)if(Q+=`.${F[ne]}`,!o.value.has(Q)){const be=F[ne+1],Rt=!isNaN(Number(be));o.value.set(Q,Rt?[]:{})}}}o.value.set(v.path,v.value);const f=v.fieldname.split("."),u={...s.value};f.length===1?u[f[0]]=v.value:mt(u,f,v.value),s.value=u}catch{}};(n.doctype||e?.router)&&(a.provide("hstPathProvider",h),a.provide("hstChangeHandler",A));const B=(v,R,S)=>{if(!r.value)return q(R);if(S)try{const f=o.value?.get(v);return f&&typeof f=="object"?f:q(R)}catch{return q(R)}return q(R)},E=async(v,R)=>{if(!o.value||!r.value)throw new Error("HST store not initialized");const S=`${v.slug}.${R}`,u={...o.value.get(S)||{}},g=v.schema?Array.isArray(v.schema)?v.schema:Array.from(v.schema):[],U=(e?e.resolveSchema(g):g).filter(F=>"fieldtype"in F&&F.fieldtype==="Doctype"&&"schema"in F&&Array.isArray(F.schema));for(const F of U){const Q=F,ne=`${S}.${Q.fieldname}`,be=ke(Q.schema,ne,o.value);u[Q.fieldname]=be}return u},C=(v,R)=>({provideHSTPath:u=>`${v}.${u}`,handleHSTChange:u=>{const g=u.path.startsWith(v)?u.path:`${v}.${u.fieldname}`;A({...u,path:g})}}),M={operations:d,currentIndex:m,undoRedoState:x,canUndo:w,canRedo:P,undoCount:$,redoCount:L,undo:_,redo:D,startBatch:N,commitBatch:b,cancelBatch:V,clear:O,getOperationsFor:T,getSnapshot:y,markIrreversible:W,logAction:j,configure:p};return n.doctype?{stonecrop:r,operationLog:M,provideHSTPath:h,handleHSTChange:A,hstStore:o,formData:s,resolvedSchema:l,loadNestedData:B,saveRecursive:E,createNestedContext:C}:!n.doctype&&e?.router?{stonecrop:r,operationLog:M,provideHSTPath:h,handleHSTChange:A,hstStore:o,formData:s,resolvedSchema:l,loadNestedData:B,saveRecursive:E,createNestedContext:C}:{stonecrop:r,operationLog:M}}function q(n){const e={};return n.schema&&n.schema.forEach(t=>{switch("fieldtype"in t?t.fieldtype:"Data"){case"Data":case"Text":e[t.fieldname]="";break;case"Check":e[t.fieldname]=!1;break;case"Int":case"Float":e[t.fieldname]=0;break;case"Table":e[t.fieldname]=[];break;case"JSON":e[t.fieldname]={};break;default:e[t.fieldname]=null}}),e}function Ce(n,e,t,r){a.watch(t,o=>{const s=`${n.slug}.${e}`;Object.keys(o).forEach(i=>{const c=`${s}.${i}`;try{r.set(c,o[i])}catch{}})},{deep:!0})}function mt(n,e,t){let r=n;for(let s=0;s<e.length-1;s++){const i=e[s];(!(i in r)||typeof r[i]!="object")&&(r[i]=isNaN(Number(e[s+1]))?{}:[]),r=r[i]}const o=e[e.length-1];r[o]=t}function ke(n,e,t){const o={...t.get(e)||{}},s=n.filter(i=>"fieldtype"in i&&i.fieldtype==="Doctype"&&"schema"in i&&Array.isArray(i.schema));for(const i of s){const c=i,l=`${e}.${c.fieldname}`,d=ke(c.schema,l,t);o[c.fieldname]=d}return o}function Se(n){const t=a.inject("$operationLogStore",void 0)||te();n&&t.configure(n);const{operations:r,currentIndex:o,undoRedoState:s,canUndo:i,canRedo:c,undoCount:l,redoCount:d}=Ne(t);function m(O){return t.undo(O)}function w(O){return t.redo(O)}function P(){t.startBatch()}function $(O){return t.commitBatch(O)}function L(){t.cancelBatch()}function x(){t.clear()}function _(O,T){return t.getOperationsFor(O,T)}function D(){return t.getSnapshot()}function N(O,T){t.markIrreversible(O,T)}function b(O,T,y,W="success",j){return t.logAction(O,T,y,W,j)}function V(O){t.configure(O)}return{operations:r,currentIndex:o,undoRedoState:s,canUndo:i,canRedo:c,undoCount:l,redoCount:d,undo:m,redo:w,startBatch:P,commitBatch:$,cancelBatch:L,clear:x,getOperationsFor:_,getSnapshot:D,markIrreversible:N,logAction:b,configure:V}}function yt(n,e=!0){if(!e)return;const{undo:t,redo:r,canUndo:o,canRedo:s}=Se(),i=ct();se(i["Ctrl+Z"],()=>{o.value&&t(n)}),se(i["Meta+Z"],()=>{o.value&&t(n)}),se(i["Ctrl+Shift+Z"],()=>{s.value&&r(n)}),se(i["Meta+Shift+Z"],()=>{s.value&&r(n)}),se(i["Ctrl+Y"],()=>{s.value&&r(n)})}async function vt(n,e){const{startBatch:t,commitBatch:r,cancelBatch:o}=Se();t();try{return await n(),r(e)}catch(s){throw o(),s}}class St{doctype;schema;workflow;actions;component;constructor(e,t,r,o,s){this.doctype=e,this.schema=t,this.workflow=r,this.actions=o,this.component=s}get slug(){return this.doctype.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}}class re{static _root;name;registry;router;constructor(e,t){if(re._root)return re._root;re._root=this,this.name="Registry",this.registry={},this.router=e,this.getMeta=t}getMeta;addDoctype(e){e.slug in this.registry||(this.registry[e.slug]=e);const t=z();t.registerDoctypeActions(e.doctype,e.actions),e.slug!==e.doctype&&t.registerDoctypeActions(e.slug,e.actions),e.component&&this.router&&!this.router.hasRoute(e.doctype)&&this.router.addRoute({path:`/${e.slug}`,name:e.slug,component:e.component})}resolveSchema(e,t){const r=t||new Set;return e.map(o=>{if("fieldtype"in o&&o.fieldtype==="Doctype"&&"options"in o&&typeof o.options=="string"){const s=o.options;if(r.has(s))return{...o};const i=this.registry[s];if(i&&i.schema){const c=Array.isArray(i.schema)?i.schema:Array.from(i.schema);r.add(s);const l=this.resolveSchema(c,r);return r.delete(s),{...o,schema:l}}}if("fieldtype"in o&&o.fieldtype==="Table"&&"options"in o&&typeof o.options=="string"){const s=o.options;if(r.has(s))return{...o};const i=this.registry[s];if(i&&i.schema){const c=Array.isArray(i.schema)?i.schema:Array.from(i.schema),l={...o};return(!("columns"in o)||!o.columns)&&(l.columns=c.map(d=>({name:d.fieldname,fieldname:d.fieldname,label:"label"in d&&d.label||d.fieldname,fieldtype:"fieldtype"in d?d.fieldtype:"Data",align:"align"in d&&d.align||"left",edit:"edit"in d?d.edit:!0,width:"width"in d&&d.width||"20ch"}))),l.component||(l.component="ATable"),(!("config"in o)||!o.config)&&(l.config={view:"list"}),(!("rows"in o)||!o.rows)&&(l.rows=[]),l}}return{...o}})}initializeRecord(e){const t={};return e.forEach(r=>{switch("fieldtype"in r?r.fieldtype:"Data"){case"Data":case"Text":case"Code":t[r.fieldname]="";break;case"Check":t[r.fieldname]=!1;break;case"Int":case"Float":case"Decimal":case"Currency":case"Quantity":t[r.fieldname]=0;break;case"Table":t[r.fieldname]=[];break;case"JSON":t[r.fieldname]={};break;case"Doctype":"schema"in r&&Array.isArray(r.schema)?t[r.fieldname]=this.initializeRecord(r.schema):t[r.fieldname]={};break;default:t[r.fieldname]=null}}),t}}async function bt(n,e,t){await a.nextTick();try{await t(n,e)}catch{}}const wt={install:(n,e)=>{const t=n.config.globalProperties.$router,r=e?.router,o=t||r;!t&&r&&n.use(r);const s=new re(o,e?.getMeta);n.provide("$registry",s),n.config.globalProperties.$registry=s;const i=new ve(s);n.provide("$stonecrop",i),n.config.globalProperties.$stonecrop=i;try{const c=n.config.globalProperties.$pinia;if(c){const l=te(c);n.provide("$operationLogStore",l),n.config.globalProperties.$operationLogStore=l}}catch(c){console.warn("Pinia not available - operation log features will be disabled:",c)}if(e?.components)for(const[c,l]of Object.entries(e.components))n.component(c,l);e?.autoInitializeRouter&&e.onRouterInitialized&&bt(s,i,e.onRouterInitialized)}};var Ve=(n=>(n.ERROR="error",n.WARNING="warning",n.INFO="info",n))(Ve||{});class Le{options;constructor(e={}){this.options={registry:e.registry||null,validateLinkTargets:e.validateLinkTargets??!0,validateActions:e.validateActions??!0,validateWorkflows:e.validateWorkflows??!0,validateRequiredProperties:e.validateRequiredProperties??!0}}validate(e,t,r,o){const s=[],i=t?Array.isArray(t)?t:t.toArray():[];if(this.options.validateRequiredProperties&&s.push(...this.validateRequiredProperties(e,i)),this.options.validateLinkTargets&&this.options.registry&&s.push(...this.validateLinkFields(e,i,this.options.registry)),this.options.validateWorkflows&&r&&s.push(...this.validateWorkflow(e,r)),this.options.validateActions&&o){const m=o instanceof Map?o:o.toObject();s.push(...this.validateActionRegistration(e,m))}const c=s.filter(m=>m.severity==="error").length,l=s.filter(m=>m.severity==="warning").length,d=s.filter(m=>m.severity==="info").length;return{valid:c===0,issues:s,errorCount:c,warningCount:l,infoCount:d}}validateRequiredProperties(e,t){const r=[];for(const o of t){if(!o.fieldname){r.push({severity:"error",rule:"required-fieldname",message:"Field is missing required property: fieldname",doctype:e,context:{field:o}});continue}if(!o.component&&!("fieldtype"in o)&&r.push({severity:"error",rule:"required-component-or-fieldtype",message:`Field "${o.fieldname}" must have either component or fieldtype property`,doctype:e,fieldname:o.fieldname}),"schema"in o){const s=o.schema,i=Array.isArray(s)?s:s.toArray?.()||[];r.push(...this.validateRequiredProperties(e,i))}}return r}validateLinkFields(e,t,r){const o=[];for(const s of t){if(("fieldtype"in s?s.fieldtype:void 0)==="Link"){const c="options"in s?s.options:void 0;if(!c){o.push({severity:"error",rule:"link-missing-options",message:`Link field "${s.fieldname}" is missing options property (target doctype)`,doctype:e,fieldname:s.fieldname});continue}const l=typeof c=="string"?c:"";if(!l){o.push({severity:"error",rule:"link-invalid-options",message:`Link field "${s.fieldname}" has invalid options format (expected string doctype name)`,doctype:e,fieldname:s.fieldname});continue}r.registry[l]||r.registry[l.toLowerCase()]||o.push({severity:"error",rule:"link-invalid-target",message:`Link field "${s.fieldname}" references non-existent doctype: "${l}"`,doctype:e,fieldname:s.fieldname,context:{targetDoctype:l}})}if("schema"in s){const c=s.schema,l=Array.isArray(c)?c:c.toArray?.()||[];o.push(...this.validateLinkFields(e,l,r))}}return o}validateWorkflow(e,t){const r=[];if(!t.initial&&!t.type&&r.push({severity:"warning",rule:"workflow-missing-initial",message:"Workflow is missing initial state property",doctype:e}),!t.states||Object.keys(t.states).length===0)return r.push({severity:"warning",rule:"workflow-no-states",message:"Workflow has no states defined",doctype:e}),r;t.initial&&typeof t.initial=="string"&&!t.states[t.initial]&&r.push({severity:"error",rule:"workflow-invalid-initial",message:`Workflow initial state "${t.initial}" does not exist in states`,doctype:e,context:{initialState:t.initial}});const o=Object.keys(t.states),s=new Set;t.initial&&typeof t.initial=="string"&&s.add(t.initial);for(const[i,c]of Object.entries(t.states)){const l=c;if(l.on){for(const[d,m]of Object.entries(l.on))if(typeof m=="string")s.add(m);else if(m&&typeof m=="object"){const w="target"in m?m.target:void 0;typeof w=="string"?s.add(w):Array.isArray(w)&&w.forEach(P=>{typeof P=="string"&&s.add(P)})}}}for(const i of o)s.has(i)||r.push({severity:"warning",rule:"workflow-unreachable-state",message:`Workflow state "${i}" may not be reachable`,doctype:e,context:{stateName:i}});return r}validateActionRegistration(e,t){const r=[],o=z();for(const[s,i]of Object.entries(t)){if(!Array.isArray(i)){r.push({severity:"error",rule:"action-invalid-format",message:`Action configuration for "${s}" must be an array`,doctype:e,context:{triggerName:s,actionNames:i}});continue}for(const c of i){const l=o;l.globalActions?.has(c)||l.globalTransitionActions?.has(c)||r.push({severity:"warning",rule:"action-not-registered",message:`Action "${c}" referenced in "${s}" is not registered in FieldTriggerEngine`,doctype:e,context:{triggerName:s,actionName:c}})}}return r}}function Me(n,e){return new Le({registry:n,...e})}function Et(n,e,t,r,o){return Me(t).validate(n,e,r,o)}I.DoctypeMeta=St,I.HST=Z,I.Registry=re,I.SchemaValidator=Le,I.Stonecrop=ve,I.ValidationSeverity=Ve,I.createHST=Ie,I.createValidator=Me,I.default=wt,I.getGlobalTriggerEngine=z,I.markOperationIrreversible=ht,I.registerGlobalAction=ut,I.registerTransitionAction=ft,I.setFieldRollback=dt,I.triggerTransition=pt,I.useOperationLog=Se,I.useOperationLogStore=te,I.useStonecrop=gt,I.useUndoRedoShortcuts=yt,I.validateSchema=Et,I.withBatch=vt,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
6
|
-
//# sourceMappingURL=stonecrop.umd.cjs.map
|