@welldot/vue 0.0.0-stage → 0.1.1
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/LICENSE +202 -0
- package/README.md +563 -2
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/_virtual/icons/ph/caret-down.js +21 -0
- package/dist/_virtual/icons/ph/caret-down.js.map +1 -0
- package/dist/_virtual/icons/ph/info.js +21 -0
- package/dist/_virtual/icons/ph/info.js.map +1 -0
- package/dist/_virtual/icons/ph/pencil-simple-line.js +21 -0
- package/dist/_virtual/icons/ph/pencil-simple-line.js.map +1 -0
- package/dist/_virtual/icons/ph/pencil-simple.js +21 -0
- package/dist/_virtual/icons/ph/pencil-simple.js.map +1 -0
- package/dist/_virtual/icons/ph/plus.js +21 -0
- package/dist/_virtual/icons/ph/plus.js.map +1 -0
- package/dist/_virtual/icons/ph/x.js +21 -0
- package/dist/_virtual/icons/ph/x.js.map +1 -0
- package/dist/components/WellChip.d.ts +30 -0
- package/dist/components/WellChip.d.ts.map +1 -0
- package/dist/components/WellChip.js +9 -0
- package/dist/components/WellChip.js.map +1 -0
- package/dist/components/WellChip.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/components/WellChip.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellComboSelect.d.ts +19 -0
- package/dist/components/WellComboSelect.d.ts.map +1 -0
- package/dist/components/WellComboSelect.js +7 -0
- package/dist/components/WellComboSelect.js.map +1 -0
- package/dist/components/WellComboSelect.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/WellComboSelect.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellInfoPopover.d.ts +31 -0
- package/dist/components/WellInfoPopover.d.ts.map +1 -0
- package/dist/components/WellInfoPopover.js +7 -0
- package/dist/components/WellInfoPopover.js.map +1 -0
- package/dist/components/WellInfoPopover.vue_vue_type_script_setup_true_lang.js +50 -0
- package/dist/components/WellInfoPopover.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellInputNumber.d.ts +4 -0
- package/dist/components/WellInputNumber.d.ts.map +1 -0
- package/dist/components/WellInputNumber.js +7 -0
- package/dist/components/WellInputNumber.js.map +1 -0
- package/dist/components/WellInputNumber.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/WellInputNumber.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellLabeledField.d.ts +22 -0
- package/dist/components/WellLabeledField.d.ts.map +1 -0
- package/dist/components/WellLabeledField.js +7 -0
- package/dist/components/WellLabeledField.js.map +1 -0
- package/dist/components/WellLabeledField.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/WellLabeledField.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellTagSelect.d.ts +21 -0
- package/dist/components/WellTagSelect.d.ts.map +1 -0
- package/dist/components/WellTagSelect.js +7 -0
- package/dist/components/WellTagSelect.js.map +1 -0
- package/dist/components/WellTagSelect.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/components/WellTagSelect.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellTextureSelect.d.ts +30 -0
- package/dist/components/WellTextureSelect.d.ts.map +1 -0
- package/dist/components/WellTextureSelect.js +7 -0
- package/dist/components/WellTextureSelect.js.map +1 -0
- package/dist/components/WellTextureSelect.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/components/WellTextureSelect.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellTextureThumbnail.d.ts +10 -0
- package/dist/components/WellTextureThumbnail.d.ts.map +1 -0
- package/dist/components/WellTextureThumbnail.js +9 -0
- package/dist/components/WellTextureThumbnail.js.map +1 -0
- package/dist/components/WellTextureThumbnail.vue_vue_type_script_setup_true_lang.js +393 -0
- package/dist/components/WellTextureThumbnail.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellUnitInput.d.ts +19 -0
- package/dist/components/WellUnitInput.d.ts.map +1 -0
- package/dist/components/WellUnitInput.js +7 -0
- package/dist/components/WellUnitInput.js.map +1 -0
- package/dist/components/WellUnitInput.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/components/WellUnitInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/parts/WellInfoTrigger.d.ts +8 -0
- package/dist/components/parts/WellInfoTrigger.d.ts.map +1 -0
- package/dist/components/parts/WellInfoTrigger.js +7 -0
- package/dist/components/parts/WellInfoTrigger.js.map +1 -0
- package/dist/components/parts/WellInfoTrigger.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/components/parts/WellInfoTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composables/useWellNumberFormat.d.ts +12 -0
- package/dist/composables/useWellNumberFormat.d.ts.map +1 -0
- package/dist/composables/useWellNumberFormat.js +25 -0
- package/dist/composables/useWellNumberFormat.js.map +1 -0
- package/dist/composables/useWellText.d.ts +11 -0
- package/dist/composables/useWellText.d.ts.map +1 -0
- package/dist/composables/useWellText.js +15 -0
- package/dist/composables/useWellText.js.map +1 -0
- package/dist/composables/useWellUnits.d.ts +29 -0
- package/dist/composables/useWellUnits.d.ts.map +1 -0
- package/dist/composables/useWellUnits.js +52 -0
- package/dist/composables/useWellUnits.js.map +1 -0
- package/dist/config.d.ts +110 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +76 -0
- package/dist/config.js.map +1 -0
- package/dist/grid/WellDataGrid.d.ts +34 -0
- package/dist/grid/WellDataGrid.d.ts.map +1 -0
- package/dist/grid/WellDataGrid.js +9 -0
- package/dist/grid/WellDataGrid.js.map +1 -0
- package/dist/grid/WellDataGrid.vue_vue_type_script_setup_true_lang.js +87 -0
- package/dist/grid/WellDataGrid.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridCheckboxCell.d.ts +10 -0
- package/dist/grid/cells/GridCheckboxCell.d.ts.map +1 -0
- package/dist/grid/cells/GridCheckboxCell.js +7 -0
- package/dist/grid/cells/GridCheckboxCell.js.map +1 -0
- package/dist/grid/cells/GridCheckboxCell.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/grid/cells/GridCheckboxCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridColorCell.d.ts +7 -0
- package/dist/grid/cells/GridColorCell.d.ts.map +1 -0
- package/dist/grid/cells/GridColorCell.js +7 -0
- package/dist/grid/cells/GridColorCell.js.map +1 -0
- package/dist/grid/cells/GridColorCell.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/grid/cells/GridColorCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridColorPickerEditor.d.ts +12 -0
- package/dist/grid/cells/GridColorPickerEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridColorPickerEditor.js +7 -0
- package/dist/grid/cells/GridColorPickerEditor.js.map +1 -0
- package/dist/grid/cells/GridColorPickerEditor.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/grid/cells/GridColorPickerEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridComboEditor.d.ts +14 -0
- package/dist/grid/cells/GridComboEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridComboEditor.js +7 -0
- package/dist/grid/cells/GridComboEditor.js.map +1 -0
- package/dist/grid/cells/GridComboEditor.vue_vue_type_script_setup_true_lang.js +177 -0
- package/dist/grid/cells/GridComboEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridDeleteCell.d.ts +12 -0
- package/dist/grid/cells/GridDeleteCell.d.ts.map +1 -0
- package/dist/grid/cells/GridDeleteCell.js +7 -0
- package/dist/grid/cells/GridDeleteCell.js.map +1 -0
- package/dist/grid/cells/GridDeleteCell.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/grid/cells/GridDeleteCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridDragCell.d.ts +16 -0
- package/dist/grid/cells/GridDragCell.d.ts.map +1 -0
- package/dist/grid/cells/GridDragCell.js +7 -0
- package/dist/grid/cells/GridDragCell.js.map +1 -0
- package/dist/grid/cells/GridDragCell.vue_vue_type_script_setup_true_lang.js +50 -0
- package/dist/grid/cells/GridDragCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridFormattedCell.d.ts +9 -0
- package/dist/grid/cells/GridFormattedCell.d.ts.map +1 -0
- package/dist/grid/cells/GridFormattedCell.js +7 -0
- package/dist/grid/cells/GridFormattedCell.js.map +1 -0
- package/dist/grid/cells/GridFormattedCell.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/grid/cells/GridFormattedCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridHeaderCell.d.ts +11 -0
- package/dist/grid/cells/GridHeaderCell.d.ts.map +1 -0
- package/dist/grid/cells/GridHeaderCell.js +7 -0
- package/dist/grid/cells/GridHeaderCell.js.map +1 -0
- package/dist/grid/cells/GridHeaderCell.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/grid/cells/GridHeaderCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridNumberEditor.d.ts +9 -0
- package/dist/grid/cells/GridNumberEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridNumberEditor.js +7 -0
- package/dist/grid/cells/GridNumberEditor.js.map +1 -0
- package/dist/grid/cells/GridNumberEditor.vue_vue_type_script_setup_true_lang.js +50 -0
- package/dist/grid/cells/GridNumberEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridSelectButtonCell.d.ts +12 -0
- package/dist/grid/cells/GridSelectButtonCell.d.ts.map +1 -0
- package/dist/grid/cells/GridSelectButtonCell.js +7 -0
- package/dist/grid/cells/GridSelectButtonCell.js.map +1 -0
- package/dist/grid/cells/GridSelectButtonCell.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/grid/cells/GridSelectButtonCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridSelectCell.d.ts +9 -0
- package/dist/grid/cells/GridSelectCell.d.ts.map +1 -0
- package/dist/grid/cells/GridSelectCell.js +7 -0
- package/dist/grid/cells/GridSelectCell.js.map +1 -0
- package/dist/grid/cells/GridSelectCell.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/grid/cells/GridSelectCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridSelectEditor.d.ts +11 -0
- package/dist/grid/cells/GridSelectEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridSelectEditor.js +7 -0
- package/dist/grid/cells/GridSelectEditor.js.map +1 -0
- package/dist/grid/cells/GridSelectEditor.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/grid/cells/GridSelectEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridTextEditor.d.ts +9 -0
- package/dist/grid/cells/GridTextEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridTextEditor.js +7 -0
- package/dist/grid/cells/GridTextEditor.js.map +1 -0
- package/dist/grid/cells/GridTextEditor.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/grid/cells/GridTextEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridTextureSelectCell.d.ts +7 -0
- package/dist/grid/cells/GridTextureSelectCell.d.ts.map +1 -0
- package/dist/grid/cells/GridTextureSelectCell.js +7 -0
- package/dist/grid/cells/GridTextureSelectCell.js.map +1 -0
- package/dist/grid/cells/GridTextureSelectCell.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/grid/cells/GridTextureSelectCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridTextureSelectEditor.d.ts +13 -0
- package/dist/grid/cells/GridTextureSelectEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridTextureSelectEditor.js +7 -0
- package/dist/grid/cells/GridTextureSelectEditor.js.map +1 -0
- package/dist/grid/cells/GridTextureSelectEditor.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/grid/cells/GridTextureSelectEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridUnitCell.d.ts +9 -0
- package/dist/grid/cells/GridUnitCell.d.ts.map +1 -0
- package/dist/grid/cells/GridUnitCell.js +7 -0
- package/dist/grid/cells/GridUnitCell.js.map +1 -0
- package/dist/grid/cells/GridUnitCell.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/grid/cells/GridUnitCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridUnitEditor.d.ts +11 -0
- package/dist/grid/cells/GridUnitEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridUnitEditor.js +7 -0
- package/dist/grid/cells/GridUnitEditor.js.map +1 -0
- package/dist/grid/cells/GridUnitEditor.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/grid/cells/GridUnitEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/columnStretchPlugin.d.ts +12 -0
- package/dist/grid/columnStretchPlugin.d.ts.map +1 -0
- package/dist/grid/columnStretchPlugin.js +35 -0
- package/dist/grid/columnStretchPlugin.js.map +1 -0
- package/dist/grid/composables/useCellTemplate.d.ts +35 -0
- package/dist/grid/composables/useCellTemplate.d.ts.map +1 -0
- package/dist/grid/composables/useCellTemplate.js +30 -0
- package/dist/grid/composables/useCellTemplate.js.map +1 -0
- package/dist/grid/composables/useGridOverlayFocusGuard.d.ts +5 -0
- package/dist/grid/composables/useGridOverlayFocusGuard.d.ts.map +1 -0
- package/dist/grid/composables/useGridOverlayFocusGuard.js +12 -0
- package/dist/grid/composables/useGridOverlayFocusGuard.js.map +1 -0
- package/dist/grid/composables/useUnitSuffix.d.ts +9 -0
- package/dist/grid/composables/useUnitSuffix.d.ts.map +1 -0
- package/dist/grid/composables/useUnitSuffix.js +13 -0
- package/dist/grid/composables/useUnitSuffix.js.map +1 -0
- package/dist/grid/gridHeight.d.ts +11 -0
- package/dist/grid/gridHeight.d.ts.map +1 -0
- package/dist/grid/gridHeight.js +8 -0
- package/dist/grid/gridHeight.js.map +1 -0
- package/dist/grid/index.d.ts +8 -0
- package/dist/grid/index.d.ts.map +1 -0
- package/dist/grid/index.js +4 -0
- package/dist/grid/parts/WellGridAddButton.d.ts +5 -0
- package/dist/grid/parts/WellGridAddButton.d.ts.map +1 -0
- package/dist/grid/parts/WellGridAddButton.js +7 -0
- package/dist/grid/parts/WellGridAddButton.js.map +1 -0
- package/dist/grid/parts/WellGridAddButton.vue_vue_type_script_setup_true_lang.js +23 -0
- package/dist/grid/parts/WellGridAddButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/parts/WellGridDeleteButton.d.ts +5 -0
- package/dist/grid/parts/WellGridDeleteButton.d.ts.map +1 -0
- package/dist/grid/parts/WellGridDeleteButton.js +7 -0
- package/dist/grid/parts/WellGridDeleteButton.js.map +1 -0
- package/dist/grid/parts/WellGridDeleteButton.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/grid/parts/WellGridDeleteButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/types.d.ts +90 -0
- package/dist/grid/types.d.ts.map +1 -0
- package/dist/grid/useWellGridColumns.d.ts +40 -0
- package/dist/grid/useWellGridColumns.d.ts.map +1 -0
- package/dist/grid/useWellGridColumns.js +242 -0
- package/dist/grid/useWellGridColumns.js.map +1 -0
- package/dist/grid.css +407 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/location/WellCoordinateInput.d.ts +14 -0
- package/dist/location/WellCoordinateInput.d.ts.map +1 -0
- package/dist/location/WellCoordinateInput.js +7 -0
- package/dist/location/WellCoordinateInput.js.map +1 -0
- package/dist/location/WellCoordinateInput.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/location/WellCoordinateInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/location/WellLocationMap.d.ts +22 -0
- package/dist/location/WellLocationMap.d.ts.map +1 -0
- package/dist/location/WellLocationMap.js +9 -0
- package/dist/location/WellLocationMap.js.map +1 -0
- package/dist/location/WellLocationMap.vue_vue_type_script_setup_true_lang.js +91 -0
- package/dist/location/WellLocationMap.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/location/WellLocationPicker.d.ts +32 -0
- package/dist/location/WellLocationPicker.d.ts.map +1 -0
- package/dist/location/WellLocationPicker.js +7 -0
- package/dist/location/WellLocationPicker.js.map +1 -0
- package/dist/location/WellLocationPicker.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/location/WellLocationPicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/location/index.d.ts +6 -0
- package/dist/location/index.d.ts.map +1 -0
- package/dist/location/index.js +5 -0
- package/dist/location/location.d.ts +61 -0
- package/dist/location/location.d.ts.map +1 -0
- package/dist/location/location.js +15 -0
- package/dist/location/location.js.map +1 -0
- package/dist/nuxt/module.d.ts +76 -0
- package/dist/nuxt/module.d.ts.map +1 -0
- package/dist/nuxt/module.js +129 -0
- package/dist/nuxt/module.js.map +1 -0
- package/dist/nuxt/runtime/plugin.d.ts +14 -0
- package/dist/nuxt/runtime/plugin.d.ts.map +1 -0
- package/dist/nuxt/runtime/plugin.js +13 -0
- package/dist/nuxt/runtime/plugin.js.map +1 -0
- package/dist/style.css +2 -0
- package/dist/tailwind.css +160 -0
- package/dist/theme/define.d.ts +44 -0
- package/dist/theme/define.d.ts.map +1 -0
- package/dist/theme/define.js +14 -0
- package/dist/theme/define.js.map +1 -0
- package/dist/theme/index.d.ts +5 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +4 -0
- package/dist/theme/preset.d.ts +20 -0
- package/dist/theme/preset.d.ts.map +1 -0
- package/dist/theme/preset.js +977 -0
- package/dist/theme/preset.js.map +1 -0
- package/dist/theme/pt.d.ts +8 -0
- package/dist/theme/pt.d.ts.map +1 -0
- package/dist/theme/pt.js +66 -0
- package/dist/theme/pt.js.map +1 -0
- package/dist/types.d.ts +38 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +134 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridColorPickerEditor.d.ts","sourceRoot":"","sources":["../../../src/grid/cells/GridColorPickerEditor.vue"],"names":[],"mappings":"wBA8GqB,OAAO,YAAY;AAAxC,wBAAyC;AACzC,QAAA,MAAM,YAAY;UAEV,OAAO;UACP,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI;WAC/C,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,IAAI;;UAF9B,OAAO;UACP,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI;WAC/C,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,IAAI;iGAwIlC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridColorPickerEditor.js","names":[],"sources":["../../../src/grid/cells/GridColorPickerEditor.vue"],"sourcesContent":["<script lang=\"ts\">\n// vue-color's stylesheet is imported dynamically, on the client only. A\n// static `import 'vue-color/style.css'` stays in `dist/` (vue-color is\n// external), so Node would fail to load `@welldot/vue/grid` during plain-Vite\n// SSR unless the app set `ssr.noExternal`. Editors only mount in the browser,\n// and loading at module evaluation means the CSS is there before one opens.\nif (typeof window !== 'undefined') void import('vue-color/style.css');\n</script>\n\n<script setup lang=\"ts\">\nimport Popover from 'primevue/popover';\nimport { SketchPicker, tinycolor } from 'vue-color';\nimport { nextTick, onMounted, onUnmounted, ref } from 'vue';\n\nconst props = defineProps<{\n val?: unknown;\n save: (value: unknown, preventFocus?: boolean) => void;\n close: (focusNext?: boolean) => void;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nconst triggerRef = ref<HTMLElement | null>(null);\nconst popoverRef = ref<InstanceType<typeof Popover> | null>(null);\n\n// vue-color echoes back the format of the value it was given (and can drift\n// to HSV objects), so normalize everything to `#rrggbb` on the way in and out.\nfunction toHex(value: unknown): string {\n const color = tinycolor(value as string);\n return color.isValid() ? color.toHexString() : '#cccccc';\n}\n\nconst localValue = ref(toHex(props.val));\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Enter' || e.key === 'Escape') {\n e.stopPropagation();\n popoverRef.value?.hide();\n }\n}\n\nonMounted(() => {\n nextTick(() => {\n popoverRef.value?.show(\n { currentTarget: triggerRef.value } as unknown as Event,\n triggerRef.value,\n );\n });\n document.addEventListener('keydown', onKeydown, true);\n});\n\nonUnmounted(() => {\n document.removeEventListener('keydown', onKeydown, true);\n});\n\nfunction onChange(value: unknown) {\n const hex = toHex(value);\n localValue.value = hex;\n props.save(hex, true);\n}\n\nfunction onHide() {\n props.close();\n}\n</script>\n\n<template>\n <div\n ref=\"triggerRef\"\n class=\"well-cell-color-trigger\"\n tabindex=\"-1\"\n @keydown=\"onKeydown\"\n >\n <span\n class=\"well-cell-color-swatch\"\n :style=\"{ backgroundColor: localValue }\"\n />\n <span class=\"well-cell-color-hex\">{{ localValue }}</span>\n </div>\n\n <Popover\n ref=\"popoverRef\"\n :pt=\"{\n content: 'p-0',\n }\"\n @hide=\"onHide\"\n >\n <div @mousedown.stop @click.stop @keydown=\"onKeydown\">\n <SketchPicker\n :model-value=\"localValue\"\n disable-alpha\n @update:model-value=\"onChange\"\n />\n </div>\n </Popover>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Fragment as e, createElementBlock as t, createElementVNode as n, createVNode as r, defineComponent as i, nextTick as a, normalizeStyle as o, onMounted as s, onUnmounted as c, openBlock as l, ref as u, toDisplayString as d, unref as f, withCtx as p, withModifiers as m } from "vue";
|
|
2
|
+
import h from "primevue/popover";
|
|
3
|
+
import { SketchPicker as g, tinycolor as _ } from "vue-color";
|
|
4
|
+
//#region src/grid/cells/GridColorPickerEditor.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var v = { class: "well-cell-color-hex" };
|
|
6
|
+
typeof window < "u" && import("vue-color/style.css");
|
|
7
|
+
var y = /* @__PURE__ */ i({
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "GridColorPickerEditor",
|
|
10
|
+
props: {
|
|
11
|
+
val: {},
|
|
12
|
+
save: { type: Function },
|
|
13
|
+
close: { type: Function }
|
|
14
|
+
},
|
|
15
|
+
setup(i) {
|
|
16
|
+
let y = i, b = u(null), x = u(null);
|
|
17
|
+
function S(e) {
|
|
18
|
+
let t = _(e);
|
|
19
|
+
return t.isValid() ? t.toHexString() : "#cccccc";
|
|
20
|
+
}
|
|
21
|
+
let C = u(S(y.val));
|
|
22
|
+
function w(e) {
|
|
23
|
+
(e.key === "Enter" || e.key === "Escape") && (e.stopPropagation(), x.value?.hide());
|
|
24
|
+
}
|
|
25
|
+
s(() => {
|
|
26
|
+
a(() => {
|
|
27
|
+
x.value?.show({ currentTarget: b.value }, b.value);
|
|
28
|
+
}), document.addEventListener("keydown", w, !0);
|
|
29
|
+
}), c(() => {
|
|
30
|
+
document.removeEventListener("keydown", w, !0);
|
|
31
|
+
});
|
|
32
|
+
function T(e) {
|
|
33
|
+
let t = S(e);
|
|
34
|
+
C.value = t, y.save(t, !0);
|
|
35
|
+
}
|
|
36
|
+
function E() {
|
|
37
|
+
y.close();
|
|
38
|
+
}
|
|
39
|
+
return (i, a) => (l(), t(e, null, [n("div", {
|
|
40
|
+
ref_key: "triggerRef",
|
|
41
|
+
ref: b,
|
|
42
|
+
class: "well-cell-color-trigger",
|
|
43
|
+
tabindex: "-1",
|
|
44
|
+
onKeydown: w
|
|
45
|
+
}, [n("span", {
|
|
46
|
+
class: "well-cell-color-swatch",
|
|
47
|
+
style: o({ backgroundColor: C.value })
|
|
48
|
+
}, null, 4), n("span", v, d(C.value), 1)], 544), r(f(h), {
|
|
49
|
+
ref_key: "popoverRef",
|
|
50
|
+
ref: x,
|
|
51
|
+
pt: { content: "p-0" },
|
|
52
|
+
onHide: E
|
|
53
|
+
}, {
|
|
54
|
+
default: p(() => [n("div", {
|
|
55
|
+
onMousedown: a[0] || (a[0] = m(() => {}, ["stop"])),
|
|
56
|
+
onClick: a[1] || (a[1] = m(() => {}, ["stop"])),
|
|
57
|
+
onKeydown: w
|
|
58
|
+
}, [r(f(g), {
|
|
59
|
+
"model-value": C.value,
|
|
60
|
+
"disable-alpha": "",
|
|
61
|
+
"onUpdate:modelValue": T
|
|
62
|
+
}, null, 8, ["model-value"])], 32)]),
|
|
63
|
+
_: 1
|
|
64
|
+
}, 512)], 64));
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
//#endregion
|
|
68
|
+
export { y as default };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=GridColorPickerEditor.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridColorPickerEditor.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/grid/cells/GridColorPickerEditor.vue"],"sourcesContent":["<script lang=\"ts\">\n// vue-color's stylesheet is imported dynamically, on the client only. A\n// static `import 'vue-color/style.css'` stays in `dist/` (vue-color is\n// external), so Node would fail to load `@welldot/vue/grid` during plain-Vite\n// SSR unless the app set `ssr.noExternal`. Editors only mount in the browser,\n// and loading at module evaluation means the CSS is there before one opens.\nif (typeof window !== 'undefined') void import('vue-color/style.css');\n</script>\n\n<script setup lang=\"ts\">\nimport Popover from 'primevue/popover';\nimport { SketchPicker, tinycolor } from 'vue-color';\nimport { nextTick, onMounted, onUnmounted, ref } from 'vue';\n\nconst props = defineProps<{\n val?: unknown;\n save: (value: unknown, preventFocus?: boolean) => void;\n close: (focusNext?: boolean) => void;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nconst triggerRef = ref<HTMLElement | null>(null);\nconst popoverRef = ref<InstanceType<typeof Popover> | null>(null);\n\n// vue-color echoes back the format of the value it was given (and can drift\n// to HSV objects), so normalize everything to `#rrggbb` on the way in and out.\nfunction toHex(value: unknown): string {\n const color = tinycolor(value as string);\n return color.isValid() ? color.toHexString() : '#cccccc';\n}\n\nconst localValue = ref(toHex(props.val));\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Enter' || e.key === 'Escape') {\n e.stopPropagation();\n popoverRef.value?.hide();\n }\n}\n\nonMounted(() => {\n nextTick(() => {\n popoverRef.value?.show(\n { currentTarget: triggerRef.value } as unknown as Event,\n triggerRef.value,\n );\n });\n document.addEventListener('keydown', onKeydown, true);\n});\n\nonUnmounted(() => {\n document.removeEventListener('keydown', onKeydown, true);\n});\n\nfunction onChange(value: unknown) {\n const hex = toHex(value);\n localValue.value = hex;\n props.save(hex, true);\n}\n\nfunction onHide() {\n props.close();\n}\n</script>\n\n<template>\n <div\n ref=\"triggerRef\"\n class=\"well-cell-color-trigger\"\n tabindex=\"-1\"\n @keydown=\"onKeydown\"\n >\n <span\n class=\"well-cell-color-swatch\"\n :style=\"{ backgroundColor: localValue }\"\n />\n <span class=\"well-cell-color-hex\">{{ localValue }}</span>\n </div>\n\n <Popover\n ref=\"popoverRef\"\n :pt=\"{\n content: 'p-0',\n }\"\n @hide=\"onHide\"\n >\n <div @mousedown.stop @click.stop @keydown=\"onKeydown\">\n <SketchPicker\n :model-value=\"localValue\"\n disable-alpha\n @update:model-value=\"onChange\"\n />\n </div>\n </Popover>\n</template>\n"],"mappings":";;;;;AAMI,OAAO,SAAW,OAAkB,OAAO;;;;;;;;;;EAQ/C,IAAM,IAAQ,GAQR,IAAa,EAAwB,KAAK,EAC1C,IAAa,EAAyC,KAAK;EAIjE,SAAS,EAAM,GAAwB;GACrC,IAAM,IAAQ,EAAU,EAAgB;AACxC,UAAO,EAAM,SAAS,GAAG,EAAM,aAAa,GAAG;;EAGjD,IAAM,IAAa,EAAI,EAAM,EAAM,IAAI,CAAC;EAExC,SAAS,EAAU,GAAkB;AACnC,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,cACjC,EAAE,iBAAiB,EACnB,EAAW,OAAO,MAAM;;AAc5B,EAVA,QAAgB;AAOd,GANA,QAAe;AACb,MAAW,OAAO,KAChB,EAAE,eAAe,EAAW,OAAO,EACnC,EAAW,MACZ;KACD,EACF,SAAS,iBAAiB,WAAW,GAAW,GAAK;IACrD,EAEF,QAAkB;AAChB,YAAS,oBAAoB,WAAW,GAAW,GAAK;IACxD;EAEF,SAAS,EAAS,GAAgB;GAChC,IAAM,IAAM,EAAM,EAAM;AAExB,GADA,EAAW,QAAQ,GACnB,EAAM,KAAK,GAAK,GAAK;;EAGvB,SAAS,IAAS;AAChB,KAAM,OAAO;;qCAKb,EAWM,OAAA;YAVA;GAAJ,KAAI;GACJ,OAAM;GACN,UAAS;GACC;MAEV,EAGE,QAAA;GAFA,OAAM;GACL,OAAK,EAAA,EAAA,iBAAqB,EAAA,OAAU,CAAA;eAEvC,EAAyD,QAAzD,GAAyD,EAApB,EAAA,MAAU,EAAA,EAAA,CAAA,EAAA,IAAA,EAGjD,EAcU,EAAA,EAAA,EAAA;YAbJ;GAAJ,KAAI;GACH,IAAI,EAAA,SAAA,OAEJ;GACM;;oBAQD,CANN,EAMM,OAAA;IANA,aAAS,EAAA,OAAA,EAAA,KAAA,QAAV,IAAe,CAAA,OAAA,CAAA;IAAE,SAAK,EAAA,OAAA,EAAA,KAAA,QAAN,IAAW,CAAA,OAAA,CAAA;IAAW;OACzC,EAIE,EAAA,EAAA,EAAA;IAHC,eAAa,EAAA;IACd,iBAAA;IACC,uBAAoB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LanguageTextInput } from '@welldot/core';
|
|
2
|
+
import { ResolvedGridOption } from '../types';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
val?: unknown;
|
|
5
|
+
save: (value: unknown, preventFocus?: boolean) => void;
|
|
6
|
+
close: (focusNext?: boolean) => void;
|
|
7
|
+
options: ResolvedGridOption[];
|
|
8
|
+
/** Note atop the suggestions saying free text is accepted. */
|
|
9
|
+
hint?: LanguageTextInput;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=GridComboEditor.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridComboEditor.d.ts","sourceRoot":"","sources":["../../../src/grid/cells/GridComboEditor.vue"],"names":[],"mappings":"AAqSA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAKvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,KAAK,WAAW,GAAG;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,8DAA8D;IAC9D,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B,CAAC;AAqVF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridComboEditor.js","names":[],"sources":["../../../src/grid/cells/GridComboEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n useId,\n watch,\n} from 'vue';\nimport type { LanguageTextInput } from '@welldot/core';\nimport IconCaretDown from '~icons/ph/caret-down';\nimport IconPencilSimpleLine from '~icons/ph/pencil-simple-line';\nimport { useWellText } from '../../composables/useWellText';\nimport { useGridOverlayFocusGuard } from '../composables/useGridOverlayFocusGuard';\nimport type { ResolvedGridOption } from '../types';\n\nconst props = defineProps<{\n val?: unknown;\n save: (value: unknown, preventFocus?: boolean) => void;\n close: (focusNext?: boolean) => void;\n options: ResolvedGridOption[];\n /** Note atop the suggestions saying free text is accepted. */\n hint?: LanguageTextInput;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nconst MAX_LENGTH = 90;\nconst PANEL_MAX_HEIGHT = 240;\n\nconst listId = `well-combo-${useId()}`;\nconst hintId = `${listId}-hint`;\nconst resolveText = useWellText();\nconst hintText = computed(() => resolveText(props.hint));\nconst rootRef = ref<HTMLElement | null>(null);\nconst inputRef = ref<HTMLInputElement | null>(null);\nconst panelRef = ref<HTMLElement | null>(null);\nconst overlayFocusGuard = useGridOverlayFocusGuard();\n\nconst normalize = (s: string) =>\n s\n .normalize('NFD')\n .replace(/\\p{Diacritic}/gu, '')\n .toLowerCase()\n .trim();\n\nfunction findOption(text: string) {\n const needle = normalize(text);\n if (!needle) return undefined;\n return props.options.find(\n o => normalize(o.label) === needle || normalize(o.value) === needle,\n );\n}\n\n// Show the option's label for canonical values, the raw text otherwise —\n// the same display rule PrimeVue's editable Select applied.\nconst rawVal = typeof props.val === 'string' ? props.val : '';\nconst initialText =\n props.options.find(o => o.value === rawVal)?.label ?? rawVal;\n\n// Deprecated entries still resolve typed text, but aren't suggested.\nconst suggestions = computed(() =>\n props.options.filter(o => !o.deprecated || o.value === rawVal),\n);\n\nconst text = ref(initialText);\nconst open = ref(true);\nconst activeIndex = ref(-1);\nconst panelStyle = ref<Record<string, string>>({});\nlet committed = false;\n\n// Until the user edits, the input holds the current value — filtering by it\n// would hide every other suggestion, so list them all.\nconst filtered = computed(() => {\n const needle = normalize(text.value);\n if (!needle || text.value === initialText) return suggestions.value;\n return suggestions.value.filter(\n o =>\n normalize(o.label).includes(needle) ||\n normalize(o.value).includes(needle),\n );\n});\n\nconst selectedValue = computed(() => findOption(text.value)?.value);\nconst panelVisible = computed(() => open.value && filtered.value.length > 0);\n\nwatch(filtered, () => {\n activeIndex.value = -1;\n});\n\nfunction commit(value: string, preventFocus = true) {\n if (committed) return;\n committed = true;\n const trimmed = value.trim();\n props.save(findOption(trimmed)?.value ?? trimmed, preventFocus);\n}\n\nfunction pick(option: ResolvedGridOption) {\n text.value = option.label;\n commit(option.label);\n props.close();\n}\n\nfunction updatePosition() {\n const el = rootRef.value;\n if (!el) return;\n const rect = el.getBoundingClientRect();\n const spaceBelow = window.innerHeight - rect.bottom;\n const flip = spaceBelow < PANEL_MAX_HEIGHT && rect.top > spaceBelow;\n panelStyle.value = {\n left: `${rect.left}px`,\n minWidth: `${rect.width}px`,\n ...(flip\n ? { bottom: `${window.innerHeight - rect.top + 2}px` }\n : { top: `${rect.bottom + 2}px` }),\n };\n}\n\nfunction scrollActiveIntoView() {\n nextTick(() => {\n panelRef.value\n ?.querySelector<HTMLElement>(`[data-index=\"${activeIndex.value}\"]`)\n ?.scrollIntoView({ block: 'nearest' });\n });\n}\n\nfunction moveActive(delta: number) {\n if (!open.value) {\n open.value = true;\n return;\n }\n const count = filtered.value.length;\n if (!count) return;\n activeIndex.value = (activeIndex.value + delta + count) % count;\n scrollActiveIntoView();\n}\n\nfunction onInput(e: Event) {\n text.value = (e.target as HTMLInputElement).value;\n open.value = true;\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n e.stopPropagation();\n moveActive(1);\n break;\n case 'ArrowUp':\n e.preventDefault();\n e.stopPropagation();\n moveActive(-1);\n break;\n case 'Enter': {\n e.preventDefault();\n e.stopPropagation();\n const option = panelVisible.value\n ? filtered.value[activeIndex.value]\n : undefined;\n if (option) text.value = option.label;\n commit(text.value, false);\n break;\n }\n case 'Tab':\n commit(text.value);\n break;\n case 'Escape':\n e.stopPropagation();\n if (panelVisible.value) {\n open.value = false;\n } else {\n committed = true;\n props.close();\n }\n break;\n }\n}\n\nfunction onBlur() {\n commit(text.value);\n}\n\nfunction togglePanel() {\n open.value = !open.value;\n inputRef.value?.focus();\n}\n\nwatch(panelVisible, visible => {\n if (visible) nextTick(updatePosition);\n});\n\nonMounted(() => {\n updatePosition();\n window.addEventListener('scroll', updatePosition, true);\n window.addEventListener('resize', updatePosition);\n nextTick(() => {\n inputRef.value?.focus();\n inputRef.value?.select();\n });\n});\n\nonBeforeUnmount(() => {\n window.removeEventListener('scroll', updatePosition, true);\n window.removeEventListener('resize', updatePosition);\n});\n</script>\n\n<template>\n <div ref=\"rootRef\" class=\"well-cell-combo\">\n <input\n ref=\"inputRef\"\n :value=\"text\"\n :maxlength=\"MAX_LENGTH\"\n class=\"well-cell-combo-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n :aria-expanded=\"panelVisible\"\n :aria-controls=\"listId\"\n :aria-describedby=\"panelVisible && hintText ? hintId : undefined\"\n :aria-activedescendant=\"\n activeIndex >= 0 ? `${listId}-${activeIndex}` : undefined\n \"\n @input=\"onInput\"\n @keydown=\"onKeydown\"\n @blur=\"onBlur\"\n />\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"well-cell-combo-toggle\"\n aria-hidden=\"true\"\n @mousedown.prevent=\"togglePanel\"\n >\n <IconCaretDown class=\"size-3.5\" />\n </button>\n\n <Teleport to=\"body\">\n <ul\n v-if=\"panelVisible\"\n :id=\"listId\"\n ref=\"panelRef\"\n role=\"listbox\"\n class=\"well-combo-panel\"\n :style=\"panelStyle\"\n v-bind=\"overlayFocusGuard\"\n @mousedown.prevent\n >\n <li\n v-if=\"hintText\"\n :id=\"hintId\"\n role=\"presentation\"\n class=\"well-combo-hint\"\n >\n <IconPencilSimpleLine class=\"size-3.5 shrink-0\" aria-hidden=\"true\" />\n {{ hintText }}\n </li>\n <li\n v-for=\"(option, i) in filtered\"\n :id=\"`${listId}-${i}`\"\n :key=\"option.value\"\n :data-index=\"i\"\n role=\"option\"\n :aria-selected=\"option.value === selectedValue\"\n class=\"well-combo-option text-sm p-1\"\n :class=\"{\n 'is-active': i === activeIndex,\n 'is-selected': option.value === selectedValue,\n }\"\n @mouseenter=\"activeIndex = i\"\n @click=\"pick(option)\"\n >\n {{ option.label }}\n </li>\n </ul>\n </Teleport>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { useWellText as e } from "../../composables/useWellText.js";
|
|
2
|
+
import t from "../../_virtual/icons/ph/pencil-simple-line.js";
|
|
3
|
+
import n from "../../_virtual/icons/ph/caret-down.js";
|
|
4
|
+
import { useGridOverlayFocusGuard as r } from "../composables/useGridOverlayFocusGuard.js";
|
|
5
|
+
import { Fragment as ee, Teleport as te, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeProps as f, nextTick as p, normalizeClass as m, onBeforeUnmount as h, onMounted as g, openBlock as _, ref as v, renderList as y, toDisplayString as b, unref as x, useId as S, watch as C, withModifiers as w } from "vue";
|
|
6
|
+
//#region src/grid/cells/GridComboEditor.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var T = [
|
|
8
|
+
"value",
|
|
9
|
+
"aria-expanded",
|
|
10
|
+
"aria-describedby",
|
|
11
|
+
"aria-activedescendant"
|
|
12
|
+
], E = [
|
|
13
|
+
"id",
|
|
14
|
+
"data-index",
|
|
15
|
+
"aria-selected",
|
|
16
|
+
"onMouseenter",
|
|
17
|
+
"onClick"
|
|
18
|
+
], D = 90, O = 240, k = /* @__PURE__ */ d({
|
|
19
|
+
inheritAttrs: !1,
|
|
20
|
+
__name: "GridComboEditor",
|
|
21
|
+
props: {
|
|
22
|
+
val: {},
|
|
23
|
+
save: { type: Function },
|
|
24
|
+
close: { type: Function },
|
|
25
|
+
options: {},
|
|
26
|
+
hint: {}
|
|
27
|
+
},
|
|
28
|
+
setup(d) {
|
|
29
|
+
let k = d, A = `well-combo-${S()}`, j = `${A}-hint`, M = e(), N = i(() => M(k.hint)), P = v(null), F = v(null), I = v(null), L = r(), R = (e) => e.normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase().trim();
|
|
30
|
+
function z(e) {
|
|
31
|
+
let t = R(e);
|
|
32
|
+
if (t) return k.options.find((e) => R(e.label) === t || R(e.value) === t);
|
|
33
|
+
}
|
|
34
|
+
let B = typeof k.val == "string" ? k.val : "", V = k.options.find((e) => e.value === B)?.label ?? B, H = i(() => k.options.filter((e) => !e.deprecated || e.value === B)), U = v(V), W = v(!0), G = v(-1), K = v({}), q = !1, J = i(() => {
|
|
35
|
+
let e = R(U.value);
|
|
36
|
+
return !e || U.value === V ? H.value : H.value.filter((t) => R(t.label).includes(e) || R(t.value).includes(e));
|
|
37
|
+
}), Y = i(() => z(U.value)?.value), X = i(() => W.value && J.value.length > 0);
|
|
38
|
+
C(J, () => {
|
|
39
|
+
G.value = -1;
|
|
40
|
+
});
|
|
41
|
+
function Z(e, t = !0) {
|
|
42
|
+
if (q) return;
|
|
43
|
+
q = !0;
|
|
44
|
+
let n = e.trim();
|
|
45
|
+
k.save(z(n)?.value ?? n, t);
|
|
46
|
+
}
|
|
47
|
+
function ne(e) {
|
|
48
|
+
U.value = e.label, Z(e.label), k.close();
|
|
49
|
+
}
|
|
50
|
+
function Q() {
|
|
51
|
+
let e = P.value;
|
|
52
|
+
if (!e) return;
|
|
53
|
+
let t = e.getBoundingClientRect(), n = window.innerHeight - t.bottom, r = n < O && t.top > n;
|
|
54
|
+
K.value = {
|
|
55
|
+
left: `${t.left}px`,
|
|
56
|
+
minWidth: `${t.width}px`,
|
|
57
|
+
...r ? { bottom: `${window.innerHeight - t.top + 2}px` } : { top: `${t.bottom + 2}px` }
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function re() {
|
|
61
|
+
p(() => {
|
|
62
|
+
I.value?.querySelector(`[data-index="${G.value}"]`)?.scrollIntoView({ block: "nearest" });
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function $(e) {
|
|
66
|
+
if (!W.value) {
|
|
67
|
+
W.value = !0;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
let t = J.value.length;
|
|
71
|
+
t && (G.value = (G.value + e + t) % t, re());
|
|
72
|
+
}
|
|
73
|
+
function ie(e) {
|
|
74
|
+
U.value = e.target.value, W.value = !0;
|
|
75
|
+
}
|
|
76
|
+
function ae(e) {
|
|
77
|
+
switch (e.key) {
|
|
78
|
+
case "ArrowDown":
|
|
79
|
+
e.preventDefault(), e.stopPropagation(), $(1);
|
|
80
|
+
break;
|
|
81
|
+
case "ArrowUp":
|
|
82
|
+
e.preventDefault(), e.stopPropagation(), $(-1);
|
|
83
|
+
break;
|
|
84
|
+
case "Enter": {
|
|
85
|
+
e.preventDefault(), e.stopPropagation();
|
|
86
|
+
let t = X.value ? J.value[G.value] : void 0;
|
|
87
|
+
t && (U.value = t.label), Z(U.value, !1);
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
case "Tab":
|
|
91
|
+
Z(U.value);
|
|
92
|
+
break;
|
|
93
|
+
case "Escape":
|
|
94
|
+
e.stopPropagation(), X.value ? W.value = !1 : (q = !0, k.close());
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function oe() {
|
|
99
|
+
Z(U.value);
|
|
100
|
+
}
|
|
101
|
+
function se() {
|
|
102
|
+
W.value = !W.value, F.value?.focus();
|
|
103
|
+
}
|
|
104
|
+
return C(X, (e) => {
|
|
105
|
+
e && p(Q);
|
|
106
|
+
}), g(() => {
|
|
107
|
+
Q(), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), p(() => {
|
|
108
|
+
F.value?.focus(), F.value?.select();
|
|
109
|
+
});
|
|
110
|
+
}), h(() => {
|
|
111
|
+
window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
|
|
112
|
+
}), (e, r) => (_(), s("div", {
|
|
113
|
+
ref_key: "rootRef",
|
|
114
|
+
ref: P,
|
|
115
|
+
class: "well-cell-combo"
|
|
116
|
+
}, [
|
|
117
|
+
c("input", {
|
|
118
|
+
ref_key: "inputRef",
|
|
119
|
+
ref: F,
|
|
120
|
+
value: U.value,
|
|
121
|
+
maxlength: D,
|
|
122
|
+
class: "well-cell-combo-input",
|
|
123
|
+
type: "text",
|
|
124
|
+
role: "combobox",
|
|
125
|
+
autocomplete: "off",
|
|
126
|
+
"aria-autocomplete": "list",
|
|
127
|
+
"aria-expanded": X.value,
|
|
128
|
+
"aria-controls": A,
|
|
129
|
+
"aria-describedby": X.value && N.value ? j : void 0,
|
|
130
|
+
"aria-activedescendant": G.value >= 0 ? `${A}-${G.value}` : void 0,
|
|
131
|
+
onInput: ie,
|
|
132
|
+
onKeydown: ae,
|
|
133
|
+
onBlur: oe
|
|
134
|
+
}, null, 40, T),
|
|
135
|
+
c("button", {
|
|
136
|
+
type: "button",
|
|
137
|
+
tabindex: "-1",
|
|
138
|
+
class: "well-cell-combo-toggle",
|
|
139
|
+
"aria-hidden": "true",
|
|
140
|
+
onMousedown: w(se, ["prevent"])
|
|
141
|
+
}, [u(x(n), { class: "size-3.5" })], 32),
|
|
142
|
+
(_(), a(te, { to: "body" }, [X.value ? (_(), s("ul", f({
|
|
143
|
+
key: 0,
|
|
144
|
+
id: A,
|
|
145
|
+
ref_key: "panelRef",
|
|
146
|
+
ref: I,
|
|
147
|
+
role: "listbox",
|
|
148
|
+
class: "well-combo-panel",
|
|
149
|
+
style: K.value
|
|
150
|
+
}, x(L), { onMousedown: r[0] || (r[0] = w(() => {}, ["prevent"])) }), [N.value ? (_(), s("li", {
|
|
151
|
+
key: 0,
|
|
152
|
+
id: j,
|
|
153
|
+
role: "presentation",
|
|
154
|
+
class: "well-combo-hint"
|
|
155
|
+
}, [u(x(t), {
|
|
156
|
+
class: "size-3.5 shrink-0",
|
|
157
|
+
"aria-hidden": "true"
|
|
158
|
+
}), l(" " + b(N.value), 1)])) : o("", !0), (_(!0), s(ee, null, y(J.value, (e, t) => (_(), s("li", {
|
|
159
|
+
id: `${A}-${t}`,
|
|
160
|
+
key: e.value,
|
|
161
|
+
"data-index": t,
|
|
162
|
+
role: "option",
|
|
163
|
+
"aria-selected": e.value === Y.value,
|
|
164
|
+
class: m(["well-combo-option text-sm p-1", {
|
|
165
|
+
"is-active": t === G.value,
|
|
166
|
+
"is-selected": e.value === Y.value
|
|
167
|
+
}]),
|
|
168
|
+
onMouseenter: (e) => G.value = t,
|
|
169
|
+
onClick: (t) => ne(e)
|
|
170
|
+
}, b(e.label), 43, E))), 128))], 16)) : o("", !0)]))
|
|
171
|
+
], 512));
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
//#endregion
|
|
175
|
+
export { k as default };
|
|
176
|
+
|
|
177
|
+
//# sourceMappingURL=GridComboEditor.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridComboEditor.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/grid/cells/GridComboEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n useId,\n watch,\n} from 'vue';\nimport type { LanguageTextInput } from '@welldot/core';\nimport IconCaretDown from '~icons/ph/caret-down';\nimport IconPencilSimpleLine from '~icons/ph/pencil-simple-line';\nimport { useWellText } from '../../composables/useWellText';\nimport { useGridOverlayFocusGuard } from '../composables/useGridOverlayFocusGuard';\nimport type { ResolvedGridOption } from '../types';\n\nconst props = defineProps<{\n val?: unknown;\n save: (value: unknown, preventFocus?: boolean) => void;\n close: (focusNext?: boolean) => void;\n options: ResolvedGridOption[];\n /** Note atop the suggestions saying free text is accepted. */\n hint?: LanguageTextInput;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nconst MAX_LENGTH = 90;\nconst PANEL_MAX_HEIGHT = 240;\n\nconst listId = `well-combo-${useId()}`;\nconst hintId = `${listId}-hint`;\nconst resolveText = useWellText();\nconst hintText = computed(() => resolveText(props.hint));\nconst rootRef = ref<HTMLElement | null>(null);\nconst inputRef = ref<HTMLInputElement | null>(null);\nconst panelRef = ref<HTMLElement | null>(null);\nconst overlayFocusGuard = useGridOverlayFocusGuard();\n\nconst normalize = (s: string) =>\n s\n .normalize('NFD')\n .replace(/\\p{Diacritic}/gu, '')\n .toLowerCase()\n .trim();\n\nfunction findOption(text: string) {\n const needle = normalize(text);\n if (!needle) return undefined;\n return props.options.find(\n o => normalize(o.label) === needle || normalize(o.value) === needle,\n );\n}\n\n// Show the option's label for canonical values, the raw text otherwise —\n// the same display rule PrimeVue's editable Select applied.\nconst rawVal = typeof props.val === 'string' ? props.val : '';\nconst initialText =\n props.options.find(o => o.value === rawVal)?.label ?? rawVal;\n\n// Deprecated entries still resolve typed text, but aren't suggested.\nconst suggestions = computed(() =>\n props.options.filter(o => !o.deprecated || o.value === rawVal),\n);\n\nconst text = ref(initialText);\nconst open = ref(true);\nconst activeIndex = ref(-1);\nconst panelStyle = ref<Record<string, string>>({});\nlet committed = false;\n\n// Until the user edits, the input holds the current value — filtering by it\n// would hide every other suggestion, so list them all.\nconst filtered = computed(() => {\n const needle = normalize(text.value);\n if (!needle || text.value === initialText) return suggestions.value;\n return suggestions.value.filter(\n o =>\n normalize(o.label).includes(needle) ||\n normalize(o.value).includes(needle),\n );\n});\n\nconst selectedValue = computed(() => findOption(text.value)?.value);\nconst panelVisible = computed(() => open.value && filtered.value.length > 0);\n\nwatch(filtered, () => {\n activeIndex.value = -1;\n});\n\nfunction commit(value: string, preventFocus = true) {\n if (committed) return;\n committed = true;\n const trimmed = value.trim();\n props.save(findOption(trimmed)?.value ?? trimmed, preventFocus);\n}\n\nfunction pick(option: ResolvedGridOption) {\n text.value = option.label;\n commit(option.label);\n props.close();\n}\n\nfunction updatePosition() {\n const el = rootRef.value;\n if (!el) return;\n const rect = el.getBoundingClientRect();\n const spaceBelow = window.innerHeight - rect.bottom;\n const flip = spaceBelow < PANEL_MAX_HEIGHT && rect.top > spaceBelow;\n panelStyle.value = {\n left: `${rect.left}px`,\n minWidth: `${rect.width}px`,\n ...(flip\n ? { bottom: `${window.innerHeight - rect.top + 2}px` }\n : { top: `${rect.bottom + 2}px` }),\n };\n}\n\nfunction scrollActiveIntoView() {\n nextTick(() => {\n panelRef.value\n ?.querySelector<HTMLElement>(`[data-index=\"${activeIndex.value}\"]`)\n ?.scrollIntoView({ block: 'nearest' });\n });\n}\n\nfunction moveActive(delta: number) {\n if (!open.value) {\n open.value = true;\n return;\n }\n const count = filtered.value.length;\n if (!count) return;\n activeIndex.value = (activeIndex.value + delta + count) % count;\n scrollActiveIntoView();\n}\n\nfunction onInput(e: Event) {\n text.value = (e.target as HTMLInputElement).value;\n open.value = true;\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n e.stopPropagation();\n moveActive(1);\n break;\n case 'ArrowUp':\n e.preventDefault();\n e.stopPropagation();\n moveActive(-1);\n break;\n case 'Enter': {\n e.preventDefault();\n e.stopPropagation();\n const option = panelVisible.value\n ? filtered.value[activeIndex.value]\n : undefined;\n if (option) text.value = option.label;\n commit(text.value, false);\n break;\n }\n case 'Tab':\n commit(text.value);\n break;\n case 'Escape':\n e.stopPropagation();\n if (panelVisible.value) {\n open.value = false;\n } else {\n committed = true;\n props.close();\n }\n break;\n }\n}\n\nfunction onBlur() {\n commit(text.value);\n}\n\nfunction togglePanel() {\n open.value = !open.value;\n inputRef.value?.focus();\n}\n\nwatch(panelVisible, visible => {\n if (visible) nextTick(updatePosition);\n});\n\nonMounted(() => {\n updatePosition();\n window.addEventListener('scroll', updatePosition, true);\n window.addEventListener('resize', updatePosition);\n nextTick(() => {\n inputRef.value?.focus();\n inputRef.value?.select();\n });\n});\n\nonBeforeUnmount(() => {\n window.removeEventListener('scroll', updatePosition, true);\n window.removeEventListener('resize', updatePosition);\n});\n</script>\n\n<template>\n <div ref=\"rootRef\" class=\"well-cell-combo\">\n <input\n ref=\"inputRef\"\n :value=\"text\"\n :maxlength=\"MAX_LENGTH\"\n class=\"well-cell-combo-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n :aria-expanded=\"panelVisible\"\n :aria-controls=\"listId\"\n :aria-describedby=\"panelVisible && hintText ? hintId : undefined\"\n :aria-activedescendant=\"\n activeIndex >= 0 ? `${listId}-${activeIndex}` : undefined\n \"\n @input=\"onInput\"\n @keydown=\"onKeydown\"\n @blur=\"onBlur\"\n />\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"well-cell-combo-toggle\"\n aria-hidden=\"true\"\n @mousedown.prevent=\"togglePanel\"\n >\n <IconCaretDown class=\"size-3.5\" />\n </button>\n\n <Teleport to=\"body\">\n <ul\n v-if=\"panelVisible\"\n :id=\"listId\"\n ref=\"panelRef\"\n role=\"listbox\"\n class=\"well-combo-panel\"\n :style=\"panelStyle\"\n v-bind=\"overlayFocusGuard\"\n @mousedown.prevent\n >\n <li\n v-if=\"hintText\"\n :id=\"hintId\"\n role=\"presentation\"\n class=\"well-combo-hint\"\n >\n <IconPencilSimpleLine class=\"size-3.5 shrink-0\" aria-hidden=\"true\" />\n {{ hintText }}\n </li>\n <li\n v-for=\"(option, i) in filtered\"\n :id=\"`${listId}-${i}`\"\n :key=\"option.value\"\n :data-index=\"i\"\n role=\"option\"\n :aria-selected=\"option.value === selectedValue\"\n class=\"well-combo-option text-sm p-1\"\n :class=\"{\n 'is-active': i === activeIndex,\n 'is-selected': option.value === selectedValue,\n }\"\n @mouseenter=\"activeIndex = i\"\n @click=\"pick(option)\"\n >\n {{ option.label }}\n </li>\n </ul>\n </Teleport>\n </div>\n</template>\n"],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
rowIndex: number;
|
|
4
|
+
model: Record<string, unknown>;
|
|
5
|
+
part: Component;
|
|
6
|
+
label?: string;
|
|
7
|
+
requestDelete: (rowIndex: number, model: Record<string, unknown>) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=GridDeleteCell.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridDeleteCell.d.ts","sourceRoot":"","sources":["../../../src/grid/cells/GridDeleteCell.vue"],"names":[],"mappings":"AAsCA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC3E,CAAC;AA6CF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridDeleteCell.js","names":[],"sources":["../../../src/grid/cells/GridDeleteCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Delete column cell: renders the `deleteButton` part (resolved by the\n * column builder) with the `WellDeleteButtonProps` contract and asks the grid\n * to delete the row on its `click`.\n */\nimport type { Component } from 'vue';\n\nconst props = defineProps<{\n rowIndex: number;\n model: Record<string, unknown>;\n part: Component;\n label?: string;\n requestDelete: (rowIndex: number, model: Record<string, unknown>) => void;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nfunction handleClick(e?: unknown) {\n // A native click (default part, or a part whose root gets the listener)\n // must not reach the grid, which would treat it as a cell click.\n if (e instanceof Event) e.stopPropagation();\n props.requestDelete(props.rowIndex, props.model);\n}\n</script>\n\n<template>\n <component\n :is=\"part\"\n :index=\"rowIndex\"\n :row=\"model\"\n :label=\"label\"\n @click=\"handleClick\"\n />\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createBlock as e, defineComponent as t, openBlock as n, resolveDynamicComponent as r } from "vue";
|
|
2
|
+
//#region src/grid/cells/GridDeleteCell.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var i = /* @__PURE__ */ t({
|
|
4
|
+
inheritAttrs: !1,
|
|
5
|
+
__name: "GridDeleteCell",
|
|
6
|
+
props: {
|
|
7
|
+
rowIndex: {},
|
|
8
|
+
model: {},
|
|
9
|
+
part: {},
|
|
10
|
+
label: {},
|
|
11
|
+
requestDelete: { type: Function }
|
|
12
|
+
},
|
|
13
|
+
setup(t) {
|
|
14
|
+
let i = t;
|
|
15
|
+
function a(e) {
|
|
16
|
+
e instanceof Event && e.stopPropagation(), i.requestDelete(i.rowIndex, i.model);
|
|
17
|
+
}
|
|
18
|
+
return (i, o) => (n(), e(r(t.part), {
|
|
19
|
+
index: t.rowIndex,
|
|
20
|
+
row: t.model,
|
|
21
|
+
label: t.label,
|
|
22
|
+
onClick: a
|
|
23
|
+
}, null, 8, [
|
|
24
|
+
"index",
|
|
25
|
+
"row",
|
|
26
|
+
"label"
|
|
27
|
+
]));
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
//#endregion
|
|
31
|
+
export { i as default };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=GridDeleteCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridDeleteCell.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/grid/cells/GridDeleteCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Delete column cell: renders the `deleteButton` part (resolved by the\n * column builder) with the `WellDeleteButtonProps` contract and asks the grid\n * to delete the row on its `click`.\n */\nimport type { Component } from 'vue';\n\nconst props = defineProps<{\n rowIndex: number;\n model: Record<string, unknown>;\n part: Component;\n label?: string;\n requestDelete: (rowIndex: number, model: Record<string, unknown>) => void;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nfunction handleClick(e?: unknown) {\n // A native click (default part, or a part whose root gets the listener)\n // must not reach the grid, which would treat it as a cell click.\n if (e instanceof Event) e.stopPropagation();\n props.requestDelete(props.rowIndex, props.model);\n}\n</script>\n\n<template>\n <component\n :is=\"part\"\n :index=\"rowIndex\"\n :row=\"model\"\n :label=\"label\"\n @click=\"handleClick\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;EAQA,IAAM,IAAQ;EAUd,SAAS,EAAY,GAAa;AAIhC,GADI,aAAa,SAAO,EAAE,iBAAiB,EAC3C,EAAM,cAAc,EAAM,UAAU,EAAM,MAAM;;yBAKhD,EAME,EALK,EAAA,KAAI,EAAA;GACR,OAAO,EAAA;GACP,KAAK,EAAA;GACL,OAAO,EAAA;GACP,SAAO"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
part: Component;
|
|
4
|
+
prop?: unknown;
|
|
5
|
+
model?: Record<string, unknown>;
|
|
6
|
+
column?: unknown;
|
|
7
|
+
rowIndex?: number;
|
|
8
|
+
colIndex?: number;
|
|
9
|
+
colType?: unknown;
|
|
10
|
+
type?: unknown;
|
|
11
|
+
data?: unknown;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=GridDragCell.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridDragCell.d.ts","sourceRoot":"","sources":["../../../src/grid/cells/GridDragCell.vue"],"names":[],"mappings":"AA0DA;;;;;;GAMG;AACH,OAAO,EAAO,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AAE1C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAyDF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridDragCell.js","names":[],"sources":["../../../src/grid/cells/GridDragCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Drag column cell, used only when a `dragHandle` part is given. A column\n * `cellTemplate` replaces RevoGrid's built-in handle, so this re-creates it:\n * the same `.revo-draggable` wrapper, and on mousedown the same bubbling\n * `dragstartcell` event the built-in handle emits (RevoGrid's row-order\n * editor only reads `originalEvent` from it).\n */\nimport { ref, type Component } from 'vue';\n\nconst props = defineProps<{\n part: Component;\n prop?: unknown;\n model?: Record<string, unknown>;\n column?: unknown;\n rowIndex?: number;\n colIndex?: number;\n colType?: unknown;\n type?: unknown;\n data?: unknown;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nconst root = ref<HTMLElement | null>(null);\n\nfunction onMousedown(originalEvent: MouseEvent) {\n root.value?.dispatchEvent(\n new CustomEvent('dragstartcell', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n originalEvent,\n model: {\n prop: props.prop,\n model: props.model,\n column: props.column,\n rowIndex: props.rowIndex,\n colIndex: props.colIndex,\n colType: props.colType,\n type: props.type,\n data: props.data,\n },\n },\n }),\n );\n}\n</script>\n\n<template>\n <span ref=\"root\" class=\"revo-draggable\" @mousedown=\"onMousedown\">\n <component :is=\"part\" />\n </span>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createBlock as e, createElementBlock as t, defineComponent as n, openBlock as r, ref as i, resolveDynamicComponent as a } from "vue";
|
|
2
|
+
//#region src/grid/cells/GridDragCell.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var o = /* @__PURE__ */ n({
|
|
4
|
+
inheritAttrs: !1,
|
|
5
|
+
__name: "GridDragCell",
|
|
6
|
+
props: {
|
|
7
|
+
part: {},
|
|
8
|
+
prop: {},
|
|
9
|
+
model: {},
|
|
10
|
+
column: {},
|
|
11
|
+
rowIndex: {},
|
|
12
|
+
colIndex: {},
|
|
13
|
+
colType: {},
|
|
14
|
+
type: {},
|
|
15
|
+
data: {}
|
|
16
|
+
},
|
|
17
|
+
setup(n) {
|
|
18
|
+
let o = n, s = i(null);
|
|
19
|
+
function c(e) {
|
|
20
|
+
s.value?.dispatchEvent(new CustomEvent("dragstartcell", {
|
|
21
|
+
bubbles: !0,
|
|
22
|
+
cancelable: !0,
|
|
23
|
+
composed: !0,
|
|
24
|
+
detail: {
|
|
25
|
+
originalEvent: e,
|
|
26
|
+
model: {
|
|
27
|
+
prop: o.prop,
|
|
28
|
+
model: o.model,
|
|
29
|
+
column: o.column,
|
|
30
|
+
rowIndex: o.rowIndex,
|
|
31
|
+
colIndex: o.colIndex,
|
|
32
|
+
colType: o.colType,
|
|
33
|
+
type: o.type,
|
|
34
|
+
data: o.data
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
return (i, o) => (r(), t("span", {
|
|
40
|
+
ref_key: "root",
|
|
41
|
+
ref: s,
|
|
42
|
+
class: "revo-draggable",
|
|
43
|
+
onMousedown: c
|
|
44
|
+
}, [(r(), e(a(n.part)))], 544));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
//#endregion
|
|
48
|
+
export { o as default };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=GridDragCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridDragCell.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/grid/cells/GridDragCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Drag column cell, used only when a `dragHandle` part is given. A column\n * `cellTemplate` replaces RevoGrid's built-in handle, so this re-creates it:\n * the same `.revo-draggable` wrapper, and on mousedown the same bubbling\n * `dragstartcell` event the built-in handle emits (RevoGrid's row-order\n * editor only reads `originalEvent` from it).\n */\nimport { ref, type Component } from 'vue';\n\nconst props = defineProps<{\n part: Component;\n prop?: unknown;\n model?: Record<string, unknown>;\n column?: unknown;\n rowIndex?: number;\n colIndex?: number;\n colType?: unknown;\n type?: unknown;\n data?: unknown;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nconst root = ref<HTMLElement | null>(null);\n\nfunction onMousedown(originalEvent: MouseEvent) {\n root.value?.dispatchEvent(\n new CustomEvent('dragstartcell', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n originalEvent,\n model: {\n prop: props.prop,\n model: props.model,\n column: props.column,\n rowIndex: props.rowIndex,\n colIndex: props.colIndex,\n colType: props.colType,\n type: props.type,\n data: props.data,\n },\n },\n }),\n );\n}\n</script>\n\n<template>\n <span ref=\"root\" class=\"revo-draggable\" @mousedown=\"onMousedown\">\n <component :is=\"part\" />\n </span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAUA,IAAM,IAAQ,GAcR,IAAO,EAAwB,KAAK;EAE1C,SAAS,EAAY,GAA2B;AAC9C,KAAK,OAAO,cACV,IAAI,YAAY,iBAAiB;IAC/B,SAAS;IACT,YAAY;IACZ,UAAU;IACV,QAAQ;KACN;KACA,OAAO;MACL,MAAM,EAAM;MACZ,OAAO,EAAM;MACb,QAAQ,EAAM;MACd,UAAU,EAAM;MAChB,UAAU,EAAM;MAChB,SAAS,EAAM;MACf,MAAM,EAAM;MACZ,MAAM,EAAM;MACb;KACF;IACF,CAAC,CACH;;yBAKD,EAEO,QAAA;YAFG;GAAJ,KAAI;GAAO,OAAM;GAA6B;YAClD,EAAwB,EAAR,EAAA,KAAI,CAAA,EAAA,EAAA,IAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
value?: unknown;
|
|
3
|
+
model: Record<string, unknown>;
|
|
4
|
+
formatter: (value: unknown, row: Record<string, unknown>) => string;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
//# sourceMappingURL=GridFormattedCell.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridFormattedCell.d.ts","sourceRoot":"","sources":["../../../src/grid/cells/GridFormattedCell.vue"],"names":[],"mappings":"AAsBA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;CACrE,CAAC;AA6BF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridFormattedCell.js","names":[],"sources":["../../../src/grid/cells/GridFormattedCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nconst props = defineProps<{\n value?: unknown;\n model: Record<string, unknown>;\n formatter: (value: unknown, row: Record<string, unknown>) => string;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nconst text = computed(() => props.formatter(props.value, props.model));\n</script>\n\n<template>\n <span class=\"flex h-full w-full items-center\">{{ text }}</span>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { computed as e, createElementBlock as t, defineComponent as n, openBlock as r, toDisplayString as i } from "vue";
|
|
2
|
+
//#region src/grid/cells/GridFormattedCell.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var a = { class: "flex h-full w-full items-center" }, o = /* @__PURE__ */ n({
|
|
4
|
+
inheritAttrs: !1,
|
|
5
|
+
__name: "GridFormattedCell",
|
|
6
|
+
props: {
|
|
7
|
+
value: {},
|
|
8
|
+
model: {},
|
|
9
|
+
formatter: { type: Function }
|
|
10
|
+
},
|
|
11
|
+
setup(n) {
|
|
12
|
+
let o = n, s = e(() => o.formatter(o.value, o.model));
|
|
13
|
+
return (e, n) => (r(), t("span", a, i(s.value), 1));
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { o as default };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=GridFormattedCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridFormattedCell.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/grid/cells/GridFormattedCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nconst props = defineProps<{\n value?: unknown;\n model: Record<string, unknown>;\n formatter: (value: unknown, row: Record<string, unknown>) => string;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nconst text = computed(() => props.formatter(props.value, props.model));\n</script>\n\n<template>\n <span class=\"flex h-full w-full items-center\">{{ text }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;EAGA,IAAM,IAAQ,GAQR,IAAO,QAAe,EAAM,UAAU,EAAM,OAAO,EAAM,MAAM,CAAC;yBAIpE,EAA+D,QAA/D,GAA+D,EAAd,EAAA,MAAI,EAAA,EAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
name?: string;
|
|
3
|
+
info?: string;
|
|
4
|
+
infoHighlight?: string;
|
|
5
|
+
/** Accessible label of the info trigger. */
|
|
6
|
+
infoLabel?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=GridHeaderCell.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridHeaderCell.d.ts","sourceRoot":"","sources":["../../../src/grid/cells/GridHeaderCell.vue"],"names":[],"mappings":"AAiDA,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAsGF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridHeaderCell.js","names":[],"sources":["../../../src/grid/cells/GridHeaderCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/** Column header with an info popover. Text arrives resolved. */\nimport IconPencilSimple from '~icons/ph/pencil-simple';\nimport WellInfoPopover from '../../components/WellInfoPopover.vue';\n\ndefineProps<{\n name?: string;\n info?: string;\n infoHighlight?: string;\n /** Accessible label of the info trigger. */\n infoLabel?: string;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n</script>\n\n<template>\n <span class=\"inline-flex items-center gap-1 min-w-0\">\n <span class=\"truncate\">{{ name }}</span>\n <span\n v-if=\"info\"\n class=\"inline-flex shrink-0 normal-case tracking-normal\"\n @click.stop\n @mousedown.stop\n >\n <WellInfoPopover :info=\"info\" :label=\"infoLabel\">\n <div class=\"flex flex-col gap-2.5\">\n <p class=\"m-0\">{{ info }}</p>\n <p\n v-if=\"infoHighlight\"\n class=\"m-0 flex items-start gap-1.5 rounded-md border border-primary-500/30 bg-primary-500/10 px-2.5 py-2 text-content-0\"\n >\n <IconPencilSimple\n class=\"size-3.5 shrink-0 mt-0.5 text-primary-500\"\n />\n <span>{{ infoHighlight }}</span>\n </p>\n </div>\n </WellInfoPopover>\n </span>\n </span>\n</template>\n"],"mappings":""}
|