@onereach/ui-components 27.0.2-beta.6100.0 → 27.0.2-beta.6102.0
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/esm/{OrAutocomplete-BN3Xpwjd.mjs → OrAutocomplete-ChjEV7kw.mjs} +5 -5
- package/dist/esm/{OrAutocomplete-BN3Xpwjd.mjs.map → OrAutocomplete-ChjEV7kw.mjs.map} +1 -1
- package/dist/esm/{OrButtonGroup-CzWH9eea.mjs → OrButtonGroup-D7l0IW6B.mjs} +4 -4
- package/dist/esm/{OrButtonGroup-CzWH9eea.mjs.map → OrButtonGroup-D7l0IW6B.mjs.map} +1 -1
- package/dist/esm/{OrCardCollection-CjekjM1k.mjs → OrCardCollection-lBM8Kzcj.mjs} +2 -2
- package/dist/esm/{OrCardCollection-CjekjM1k.mjs.map → OrCardCollection-lBM8Kzcj.mjs.map} +1 -1
- package/dist/esm/{OrCode-ztGltLid.mjs → OrCode-C3RMwYeu.mjs} +2 -2
- package/dist/esm/{OrCode-ztGltLid.mjs.map → OrCode-C3RMwYeu.mjs.map} +1 -1
- package/dist/esm/{OrCombinedInput-BNkXzDBe.mjs → OrCombinedInput-dpWGsQmE.mjs} +7 -7
- package/dist/esm/{OrCombinedInput-BNkXzDBe.mjs.map → OrCombinedInput-dpWGsQmE.mjs.map} +1 -1
- package/dist/esm/{OrConfirm-BPhIA7mR.mjs → OrConfirm-BShQfZJi.mjs} +2 -2
- package/dist/esm/{OrConfirm-BPhIA7mR.mjs.map → OrConfirm-BShQfZJi.mjs.map} +1 -1
- package/dist/esm/{OrDataGrid-CTRE2equ.mjs → OrDataGrid-edH2V98b.mjs} +10 -10
- package/dist/esm/{OrDataGrid-CTRE2equ.mjs.map → OrDataGrid-edH2V98b.mjs.map} +1 -1
- package/dist/esm/{OrDateFormat-BjiFSSuj.mjs → OrDateFormat-SmitpZ_l.mjs} +2 -2
- package/dist/esm/{OrDateFormat-BjiFSSuj.mjs.map → OrDateFormat-SmitpZ_l.mjs.map} +1 -1
- package/dist/esm/{OrDatePicker-1F67cACL.mjs → OrDatePicker-BJG40aAa.mjs} +4 -4
- package/dist/esm/{OrDatePicker-1F67cACL.mjs.map → OrDatePicker-BJG40aAa.mjs.map} +1 -1
- package/dist/esm/{OrDateRangePicker-DNVZygmL.mjs → OrDateRangePicker-BmkbpmMB.mjs} +4 -4
- package/dist/esm/{OrDateRangePicker-DNVZygmL.mjs.map → OrDateRangePicker-BmkbpmMB.mjs.map} +1 -1
- package/dist/esm/{OrDateTimeFormat-DlpIdVns.mjs → OrDateTimeFormat-YPwfwJRM.mjs} +2 -2
- package/dist/esm/{OrDateTimeFormat-DlpIdVns.mjs.map → OrDateTimeFormat-YPwfwJRM.mjs.map} +1 -1
- package/dist/esm/{OrDateTimePicker-C4MLM7_6.mjs → OrDateTimePicker-Beef-L9c.mjs} +2 -2
- package/dist/esm/{OrDateTimePicker-C4MLM7_6.mjs.map → OrDateTimePicker-Beef-L9c.mjs.map} +1 -1
- package/dist/esm/{OrDateTimePicker.vue_vue_type_script_lang-BPdT_UVf.mjs → OrDateTimePicker.vue_vue_type_script_lang-D13hjO4b.mjs} +3 -3
- package/dist/esm/{OrDateTimePicker.vue_vue_type_script_lang-BPdT_UVf.mjs.map → OrDateTimePicker.vue_vue_type_script_lang-D13hjO4b.mjs.map} +1 -1
- package/dist/esm/{OrInput-KTr5t05G.mjs → OrInput-CsCfAKL7.mjs} +3 -3
- package/dist/esm/{OrInput-KTr5t05G.mjs.map → OrInput-CsCfAKL7.mjs.map} +1 -1
- package/dist/esm/{OrInputBox-6ciokFdU.mjs → OrInputBox-CouSnPFr.mjs} +2 -2
- package/dist/esm/{OrInputBox-6ciokFdU.mjs.map → OrInputBox-CouSnPFr.mjs.map} +1 -1
- package/dist/esm/{OrInputBox.vue_vue_type_script_lang-q2L7rmth.mjs → OrInputBox.vue_vue_type_script_lang-BE6o1X-I.mjs} +15 -15
- package/dist/esm/OrInputBox.vue_vue_type_script_lang-BE6o1X-I.mjs.map +1 -0
- package/dist/esm/{OrPagination-ePWsnwsu.mjs → OrPagination-CCEOMfsC.mjs} +3 -3
- package/dist/esm/OrPagination-CCEOMfsC.mjs.map +1 -0
- package/dist/esm/{OrRichTextEditor-DBHpnkJU.mjs → OrRichTextEditor-v1uIPBrt.mjs} +3 -3
- package/dist/esm/{OrRichTextEditor-DBHpnkJU.mjs.map → OrRichTextEditor-v1uIPBrt.mjs.map} +1 -1
- package/dist/esm/{OrSearch-CrYPoIJM.mjs → OrSearch-DbS9U9Ah.mjs} +3 -3
- package/dist/esm/{OrSearch-CrYPoIJM.mjs.map → OrSearch-DbS9U9Ah.mjs.map} +1 -1
- package/dist/esm/{OrSelect-Dr6j_nSl.mjs → OrSelect-AJylFqfZ.mjs} +4 -4
- package/dist/esm/{OrSelect-Dr6j_nSl.mjs.map → OrSelect-AJylFqfZ.mjs.map} +1 -1
- package/dist/esm/{OrTagInput-B2cjYeWN.mjs → OrTagInput-DXI6vlv4.mjs} +3 -3
- package/dist/esm/{OrTagInput-B2cjYeWN.mjs.map → OrTagInput-DXI6vlv4.mjs.map} +1 -1
- package/dist/esm/{OrTextarea-sLey7v2k.mjs → OrTextarea-BBBoqins.mjs} +3 -3
- package/dist/esm/{OrTextarea-sLey7v2k.mjs.map → OrTextarea-BBBoqins.mjs.map} +1 -1
- package/dist/esm/{OrTimeFormat-DWJ-VXll.mjs → OrTimeFormat-rbBNiQ9g.mjs} +2 -2
- package/dist/esm/{OrTimeFormat-DWJ-VXll.mjs.map → OrTimeFormat-rbBNiQ9g.mjs.map} +1 -1
- package/dist/esm/{OrTimePicker-fI5D3Eo9.mjs → OrTimePicker-CYj0hnfp.mjs} +4 -4
- package/dist/esm/{OrTimePicker-fI5D3Eo9.mjs.map → OrTimePicker-CYj0hnfp.mjs.map} +1 -1
- package/dist/esm/{OrTimeRangePicker-Bnhl5CLg.mjs → OrTimeRangePicker-BeutvIHx.mjs} +4 -4
- package/dist/esm/{OrTimeRangePicker-Bnhl5CLg.mjs.map → OrTimeRangePicker-BeutvIHx.mjs.map} +1 -1
- package/dist/esm/components/index.mjs +25 -25
- package/dist/esm/components/or-autocomplete-v3/index.mjs +1 -1
- package/dist/esm/components/or-button-group-v3/index.mjs +1 -1
- package/dist/esm/components/or-card-collection-v3/index.mjs +1 -1
- package/dist/esm/components/or-code-v3/index.mjs +1 -1
- package/dist/esm/components/or-combined-input-v3/index.mjs +1 -1
- package/dist/esm/components/or-confirm-v3/index.mjs +1 -1
- package/dist/esm/components/or-data-grid-v3/index.mjs +1 -1
- package/dist/esm/components/or-date-format-v3/index.mjs +1 -1
- package/dist/esm/components/or-date-picker-v3/index.mjs +1 -1
- package/dist/esm/components/or-date-range-picker-v3/index.mjs +1 -1
- package/dist/esm/components/or-date-time-format-v3/index.mjs +1 -1
- package/dist/esm/components/or-date-time-picker-v3/index.mjs +2 -2
- package/dist/esm/components/or-input-box-v3/index.mjs +2 -2
- package/dist/esm/components/or-input-v3/index.mjs +1 -1
- package/dist/esm/components/or-pagination-v3/index.mjs +1 -1
- package/dist/esm/components/or-rich-text-editor-v3/index.mjs +1 -1
- package/dist/esm/components/or-search-v3/index.mjs +1 -1
- package/dist/esm/components/or-select-v3/index.mjs +1 -1
- package/dist/esm/components/or-tag-input-v3/index.mjs +1 -1
- package/dist/esm/components/or-textarea-v3/index.mjs +1 -1
- package/dist/esm/components/or-time-format-v3/index.mjs +1 -1
- package/dist/esm/components/or-time-picker-v3/index.mjs +1 -1
- package/dist/esm/components/or-time-range-picker-v3/index.mjs +1 -1
- package/dist/esm/index.mjs +25 -25
- package/package.json +3 -3
- package/dist/esm/OrInputBox.vue_vue_type_script_lang-q2L7rmth.mjs.map +0 -1
- package/dist/esm/OrPagination-ePWsnwsu.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrInput-KTr5t05G.mjs","sources":["../../../components/or-input-v3/src/styles.ts","../../../components/or-input-v3/src/types.ts","../../../components/or-input-v3/src/OrInput.vue"],"sourcesContent":["export const Input: string[] = [\n // Layout\n 'layout-column',\n\n // Spacing\n 'gap-xs',\n];\n\nexport const InputControl: string[] = [\n // Box\n 'flex-auto',\n\n // Typography\n 'typography-inherit',\n // Ensure text color inherits from container theme (preflight uses `color: revert`, so keep it important)\n '!text-inherit',\n\n // Theme (placeholder)\n 'placeholder:theme-foreground-outline',\n 'dark:placeholder:theme-foreground-outline-dark',\n\n // Autofill hack.\n // Chrome/WebKit may apply very long autofill transitions; keep it only for background,\n // so theme text color switches instantly.\n 'autofill:[transition-property:background-color] autofill:duration-[5000s]',\n\n // Safari UA styles may force `color: black` in autofill state.\n // Don’t rely on `currentColor` here: set text/caret color directly via theme CSS vars.\n 'autofill:[-webkit-text-fill-color:var(--or-c-on-background-light)!important]',\n 'dark:autofill:[-webkit-text-fill-color:var(--or-c-on-background-dark)!important]',\n 'autofill:[caret-color:var(--or-c-on-background-light)!important]',\n 'dark:autofill:[caret-color:var(--or-c-on-background-dark)!important]',\n\n // Override Safari/Chrome autofill background (yellow) via box-shadow using theme CSS vars.\n 'autofill:[-webkit-box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-light)_inset!important]',\n 'autofill:[box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-light)_inset!important]',\n 'dark:autofill:[-webkit-box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-dark)_inset!important]',\n 'dark:autofill:[box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-dark)_inset!important]',\n\n // Safari password/credential autofill variants (when they don’t also match `:-webkit-autofill`)\n '[&:-webkit-autofill-strong-password]:[-webkit-text-fill-color:var(--or-c-on-background-light)!important]',\n 'dark:[&:-webkit-autofill-strong-password]:[-webkit-text-fill-color:var(--or-c-on-background-dark)!important]',\n '[&:-webkit-autofill-strong-password]:[caret-color:var(--or-c-on-background-light)!important]',\n 'dark:[&:-webkit-autofill-strong-password]:[caret-color:var(--or-c-on-background-dark)!important]',\n '[&:-webkit-autofill-strong-password]:[-webkit-box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-light)_inset!important]',\n '[&:-webkit-autofill-strong-password]:[box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-light)_inset!important]',\n 'dark:[&:-webkit-autofill-strong-password]:[-webkit-box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-dark)_inset!important]',\n 'dark:[&:-webkit-autofill-strong-password]:[box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-dark)_inset!important]',\n\n '[&:-webkit-autofill-strong-password-viewable]:[-webkit-text-fill-color:var(--or-c-on-background-light)!important]',\n 'dark:[&:-webkit-autofill-strong-password-viewable]:[-webkit-text-fill-color:var(--or-c-on-background-dark)!important]',\n '[&:-webkit-autofill-strong-password-viewable]:[caret-color:var(--or-c-on-background-light)!important]',\n 'dark:[&:-webkit-autofill-strong-password-viewable]:[caret-color:var(--or-c-on-background-dark)!important]',\n '[&:-webkit-autofill-strong-password-viewable]:[-webkit-box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-light)_inset!important]',\n '[&:-webkit-autofill-strong-password-viewable]:[box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-light)_inset!important]',\n 'dark:[&:-webkit-autofill-strong-password-viewable]:[-webkit-box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-dark)_inset!important]',\n 'dark:[&:-webkit-autofill-strong-password-viewable]:[box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-dark)_inset!important]',\n];\n","import { ModelValue } from '@onereach/ui-components-common/types';\n\nexport type InputModelValue = ModelValue<string | number>;\n\nexport enum InputType {\n Text = 'text',\n Number = 'number',\n Password = 'password',\n Search = 'search',\n}\n\nexport enum InputMode {\n None = 'none',\n Text = 'text',\n Tel = 'tel',\n Url = 'url',\n Email = 'email',\n Numeric = 'numeric',\n Decimal = 'decimal',\n Search = 'search',\n}\n","<template>\n <div\n :ref=\"'root'\"\n :class=\"rootStyles\"\n >\n <template v-if=\"$slots.label || $slots.addon || label\">\n <OrLabel\n :control-id=\"attributes.id\"\n :variant=\"'input'\"\n :required=\"required\"\n :disabled=\"disabled\"\n >\n <slot name=\"label\">\n {{ label }}\n </slot>\n\n <template v-slot:addon>\n <slot name=\"addon\" />\n </template>\n </OrLabel>\n </template>\n\n <div class=\"layout-row gap-md md:gap-md\">\n <slot name=\"prepend\" />\n <OrInputBox\n :variant=\"variant\"\n :size=\"size\"\n :invalid=\"!!error\"\n :readonly=\"readonly || loading\"\n :disabled=\"disabled\"\n >\n <template\n v-if=\"$slots.prependInner\"\n v-slot:prepend\n >\n <slot name=\"prependInner\" />\n </template>\n <input\n :ref=\"'control'\"\n v-bind=\"attributes\"\n v-model.trim=\"model\"\n :class=\"controlStyles\"\n :name=\"name\"\n :type=\"type === 'password' && disclosed ? 'text' : type\"\n :inputmode=\"inputmode\"\n :autocomplete=\"autocomplete\"\n :placeholder=\"placeholder\"\n :required=\"required\"\n :readonly=\"readonly || loading\"\n :disabled=\"disabled\"\n @input=\"$emit('input', $event)\"\n @keydown=\"$emit('keydown', $event)\"\n @keyup=\"$emit('keyup', $event)\"\n @focus=\"$emit('focus', $event)\"\n @blur=\"$emit('blur', $event)\"\n >\n\n <template\n v-if=\"loading || type === 'password' || type === 'search' || $slots.appendInner\"\n v-slot:addon\n >\n <slot name=\"appendInner\">\n <template v-if=\"loading\">\n <OrLoader\n :variant=\"'circular'\"\n :color=\"error ? 'danger' : 'primary'\"\n :size=\"isMobile ? 'm' : 's'\"\n />\n </template>\n\n <template v-else>\n <template v-if=\"type === 'password'\">\n <OrIconButton\n :icon=\"{ icon: disclosed ? 'visibility' : 'visibility_off', variant: 'filled' }\"\n :size=\"'l'\"\n :color=\"'inherit'\"\n :disabled=\"disabled\"\n @click.stop=\"disclosed = !disclosed\"\n />\n </template>\n\n <template v-if=\"type === 'search'\">\n <template v-if=\"modelValue && !readonly\">\n <OrIconButton\n :icon=\"'close'\"\n :color=\"'inherit'\"\n :size=\"'l'\"\n :disabled=\"disabled\"\n @click.stop=\"clear()\"\n />\n </template>\n\n <template v-else>\n <OrIcon\n :icon=\"'search'\"\n :size=\"'l'\"\n :variant=\"'outlined'\"\n />\n </template>\n </template>\n </template>\n </slot>\n </template>\n </OrInputBox>\n <slot name=\"append\" />\n </div>\n <template v-if=\"$slots.hint || hint || maxLength\">\n <OrHint\n v-show=\"!error\"\n :disabled=\"disabled\"\n >\n <slot name=\"hint\">\n {{ hint }}\n </slot>\n\n <template\n v-if=\"maxLength\"\n v-slot:addon\n >\n {{ length }} / {{ maxLength }}\n </template>\n </OrHint>\n </template>\n\n <OrError\n v-show=\"typeof error === 'string' && error.length > 0\"\n :disabled=\"disabled\"\n >\n {{ error }}\n\n <template\n v-if=\"maxLength\"\n v-slot:addon\n >\n {{ length }} / {{ maxLength }}\n </template>\n </OrError>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { useControlAttributes, useIdAttribute, useProxyModelValue, useResponsive, useValidationAttributes } from '@onereach/ui-components-common/hooks';\nimport { OrErrorV3 as OrError } from '@onereach/ui-components.or-error-v3';\nimport { OrHintV3 as OrHint } from '@onereach/ui-components.or-hint-v3';\nimport { OrIconButtonV3 as OrIconButton } from '@onereach/ui-components.or-icon-button-v3';\nimport { OrIconV3 as OrIcon } from '@onereach/ui-components.or-icon-v3';\nimport { InputBoxSize, InputBoxVariant, OrInputBoxV3 as OrInputBox } from '@onereach/ui-components.or-input-box-v3';\nimport { OrLabelV3 as OrLabel } from '@onereach/ui-components.or-label-v3';\nimport { OrLoaderV3 as OrLoader } from '@onereach/ui-components.or-loader-v3';\nimport { PropType, computed, defineComponent, reactive, ref, toRef } from 'vue';\n\nimport * as Styles from './styles';\nimport { InputMode, InputModelValue, InputType } from './types';\n\nexport default defineComponent({\n name: 'OrInput',\n\n components: {\n OrError,\n OrHint,\n OrIcon,\n OrIconButton,\n OrInputBox,\n OrLabel,\n OrLoader,\n },\n\n model: {\n prop: 'modelValue',\n event: 'update:modelValue',\n },\n\n props: {\n modelValue: {\n type: undefined as unknown as PropType<InputModelValue>,\n default: undefined,\n },\n\n name: {\n type: String,\n default: undefined,\n },\n\n type: {\n type: String as PropType<`${InputType}`>,\n default: () => InputType.Text,\n },\n\n autocomplete: {\n type: String,\n default: 'off',\n },\n\n inputmode: {\n type: String as PropType<`${InputMode}`>,\n default: InputMode.Text,\n },\n\n variant: {\n type: String as PropType<`${InputBoxVariant}`>,\n default: undefined,\n },\n\n size: {\n type: String as PropType<`${InputBoxSize}`>,\n default: undefined,\n },\n\n label: {\n type: String,\n default: undefined,\n },\n\n placeholder: {\n type: String,\n default: undefined,\n },\n\n hint: {\n type: String,\n default: undefined,\n },\n\n error: {\n type: [String, Boolean],\n default: undefined,\n },\n\n loading: {\n type: Boolean,\n default: false,\n },\n\n required: {\n type: Boolean,\n default: false,\n },\n\n readonly: {\n type: Boolean,\n default: false,\n },\n\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n 'update:modelValue',\n\n 'input',\n 'keydown',\n 'keyup',\n 'focus',\n 'blur',\n ],\n\n expose: [\n 'root',\n\n 'clear',\n 'focus',\n 'blur',\n ],\n\n setup(props, context) {\n const attributes = reactive({\n id: useIdAttribute(),\n ...useControlAttributes(),\n ...useValidationAttributes(),\n });\n\n // Refs & Styles\n const root = ref<HTMLElement>();\n\n const rootStyles = computed(() => [\n 'or-input-v3',\n ...Styles.Input,\n ...props.variant === InputBoxVariant.Embedded ? ['grow'] : [],\n ]);\n\n const control = ref<HTMLInputElement>();\n\n const controlStyles = computed(() => [\n ...Styles.InputControl,\n ]);\n\n // State\n const model = useProxyModelValue(toRef(props, 'modelValue'), context.emit);\n const disclosed = ref(false);\n\n const length = computed(() => {\n return model.value?.toString().length ?? 0;\n });\n\n const maxLength = computed(() => {\n return attributes.maxlength;\n });\n\n // Methods\n function clear(): void {\n model.value = undefined;\n }\n\n function focus(): void {\n control.value?.focus();\n }\n\n function blur(): void {\n control.value?.blur();\n }\n\n // Helpers\n const { isMobile } = useResponsive();\n\n return {\n attributes,\n\n root,\n rootStyles,\n\n control,\n controlStyles,\n\n model,\n disclosed,\n\n length,\n maxLength,\n\n clear,\n focus,\n blur,\n\n isMobile,\n };\n },\n});\n</script>\n\n<style scoped>\ninput {\n min-width: 0;\n background: none;\n outline: none;\n}\n\ninput[type=\"search\"]::-webkit-search-cancel-button {\n display: none;\n}\n</style>\n"],"names":["Input","InputControl","InputType","InputMode","_sfc_main","defineComponent","OrError","OrHint","OrIcon","OrIconButton","OrInputBox","OrLabel","OrLoader","props","context","attributes","reactive","useIdAttribute","useControlAttributes","useValidationAttributes","root","ref","rootStyles","computed","Styles.Input","InputBoxVariant","control","controlStyles","Styles.InputControl","model","useProxyModelValue","toRef","disclosed","length","_a","maxLength","clear","focus","blur","isMobile","useResponsive","_resolveComponent","_openBlock","_createElementBlock","_normalizeClass","_ctx","_createBlock","_component_OrLabel","_renderSlot","_createCommentVNode","_createElementVNode","_hoisted_1","_createVNode","_component_OrInputBox","_mergeProps","_cache","$event","_withCtx","_component_OrLoader","_Fragment","_component_OrIconButton","_withModifiers","_component_OrIcon","_component_OrHint","_createSlots","_withDirectives","_component_OrError"],"mappings":";;;;;;;;;;;AAAO,MAAMA,KAAkB;AAAA;AAAA,EAE7B;AAAA;AAAA,EAGA;AACF,GAEaC,KAAyB;AAAA;AAAA,EAEpC;AAAA;AAAA,EAGA;AAAA;AAAA,EAEA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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AC,EAAA;AAAA,MAAA,SAAAP,EAAA,MAAA;AAAA;;;;MAGC,GAAA;AAAA,IAAA,GAAA;AAAA;;;;;;;;;IAYC,CAAA,IAAAR,EAAA,IAAA,EAAA;AAAA,IAAAgB,EAAAb,EAAAc,GAAH,EAER,UAAArB,EAAA,SAAA,GAAAmB,EAAA;AAAA,MAAA,SAAAP,EAAA,MAAA;AAAA;;MACQ,GAAA;AAAA,IAAA,GAAA;AAAA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"OrInput-CsCfAKL7.mjs","sources":["../../../components/or-input-v3/src/styles.ts","../../../components/or-input-v3/src/types.ts","../../../components/or-input-v3/src/OrInput.vue"],"sourcesContent":["export const Input: string[] = [\n // Layout\n 'layout-column',\n\n // Spacing\n 'gap-xs',\n];\n\nexport const InputControl: string[] = [\n // Box\n 'flex-auto',\n\n // Typography\n 'typography-inherit',\n // Ensure text color inherits from container theme (preflight uses `color: revert`, so keep it important)\n '!text-inherit',\n\n // Theme (placeholder)\n 'placeholder:theme-foreground-outline',\n 'dark:placeholder:theme-foreground-outline-dark',\n\n // Autofill hack.\n // Chrome/WebKit may apply very long autofill transitions; keep it only for background,\n // so theme text color switches instantly.\n 'autofill:[transition-property:background-color] autofill:duration-[5000s]',\n\n // Safari UA styles may force `color: black` in autofill state.\n // Don’t rely on `currentColor` here: set text/caret color directly via theme CSS vars.\n 'autofill:[-webkit-text-fill-color:var(--or-c-on-background-light)!important]',\n 'dark:autofill:[-webkit-text-fill-color:var(--or-c-on-background-dark)!important]',\n 'autofill:[caret-color:var(--or-c-on-background-light)!important]',\n 'dark:autofill:[caret-color:var(--or-c-on-background-dark)!important]',\n\n // Override Safari/Chrome autofill background (yellow) via box-shadow using theme CSS vars.\n 'autofill:[-webkit-box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-light)_inset!important]',\n 'autofill:[box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-light)_inset!important]',\n 'dark:autofill:[-webkit-box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-dark)_inset!important]',\n 'dark:autofill:[box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-dark)_inset!important]',\n\n // Safari password/credential autofill variants (when they don’t also match `:-webkit-autofill`)\n '[&:-webkit-autofill-strong-password]:[-webkit-text-fill-color:var(--or-c-on-background-light)!important]',\n 'dark:[&:-webkit-autofill-strong-password]:[-webkit-text-fill-color:var(--or-c-on-background-dark)!important]',\n '[&:-webkit-autofill-strong-password]:[caret-color:var(--or-c-on-background-light)!important]',\n 'dark:[&:-webkit-autofill-strong-password]:[caret-color:var(--or-c-on-background-dark)!important]',\n '[&:-webkit-autofill-strong-password]:[-webkit-box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-light)_inset!important]',\n '[&:-webkit-autofill-strong-password]:[box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-light)_inset!important]',\n 'dark:[&:-webkit-autofill-strong-password]:[-webkit-box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-dark)_inset!important]',\n 'dark:[&:-webkit-autofill-strong-password]:[box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-dark)_inset!important]',\n\n '[&:-webkit-autofill-strong-password-viewable]:[-webkit-text-fill-color:var(--or-c-on-background-light)!important]',\n 'dark:[&:-webkit-autofill-strong-password-viewable]:[-webkit-text-fill-color:var(--or-c-on-background-dark)!important]',\n '[&:-webkit-autofill-strong-password-viewable]:[caret-color:var(--or-c-on-background-light)!important]',\n 'dark:[&:-webkit-autofill-strong-password-viewable]:[caret-color:var(--or-c-on-background-dark)!important]',\n '[&:-webkit-autofill-strong-password-viewable]:[-webkit-box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-light)_inset!important]',\n '[&:-webkit-autofill-strong-password-viewable]:[box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-light)_inset!important]',\n 'dark:[&:-webkit-autofill-strong-password-viewable]:[-webkit-box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-dark)_inset!important]',\n 'dark:[&:-webkit-autofill-strong-password-viewable]:[box-shadow:0_0_0px_1000px_var(--or-c-primary-opacity-0-08-dark)_inset!important]',\n];\n","import { ModelValue } from '@onereach/ui-components-common/types';\n\nexport type InputModelValue = ModelValue<string | number>;\n\nexport enum InputType {\n Text = 'text',\n Number = 'number',\n Password = 'password',\n Search = 'search',\n}\n\nexport enum InputMode {\n None = 'none',\n Text = 'text',\n Tel = 'tel',\n Url = 'url',\n Email = 'email',\n Numeric = 'numeric',\n Decimal = 'decimal',\n Search = 'search',\n}\n","<template>\n <div\n :ref=\"'root'\"\n :class=\"rootStyles\"\n >\n <template v-if=\"$slots.label || $slots.addon || label\">\n <OrLabel\n :control-id=\"attributes.id\"\n :variant=\"'input'\"\n :required=\"required\"\n :disabled=\"disabled\"\n >\n <slot name=\"label\">\n {{ label }}\n </slot>\n\n <template v-slot:addon>\n <slot name=\"addon\" />\n </template>\n </OrLabel>\n </template>\n\n <div class=\"layout-row gap-md md:gap-md\">\n <slot name=\"prepend\" />\n <OrInputBox\n :variant=\"variant\"\n :size=\"size\"\n :invalid=\"!!error\"\n :readonly=\"readonly || loading\"\n :disabled=\"disabled\"\n >\n <template\n v-if=\"$slots.prependInner\"\n v-slot:prepend\n >\n <slot name=\"prependInner\" />\n </template>\n <input\n :ref=\"'control'\"\n v-bind=\"attributes\"\n v-model.trim=\"model\"\n :class=\"controlStyles\"\n :name=\"name\"\n :type=\"type === 'password' && disclosed ? 'text' : type\"\n :inputmode=\"inputmode\"\n :autocomplete=\"autocomplete\"\n :placeholder=\"placeholder\"\n :required=\"required\"\n :readonly=\"readonly || loading\"\n :disabled=\"disabled\"\n @input=\"$emit('input', $event)\"\n @keydown=\"$emit('keydown', $event)\"\n @keyup=\"$emit('keyup', $event)\"\n @focus=\"$emit('focus', $event)\"\n @blur=\"$emit('blur', $event)\"\n >\n\n <template\n v-if=\"loading || type === 'password' || type === 'search' || $slots.appendInner\"\n v-slot:addon\n >\n <slot name=\"appendInner\">\n <template v-if=\"loading\">\n <OrLoader\n :variant=\"'circular'\"\n :color=\"error ? 'danger' : 'primary'\"\n :size=\"isMobile ? 'm' : 's'\"\n />\n </template>\n\n <template v-else>\n <template v-if=\"type === 'password'\">\n <OrIconButton\n :icon=\"{ icon: disclosed ? 'visibility' : 'visibility_off', variant: 'filled' }\"\n :size=\"'l'\"\n :color=\"'inherit'\"\n :disabled=\"disabled\"\n @click.stop=\"disclosed = !disclosed\"\n />\n </template>\n\n <template v-if=\"type === 'search'\">\n <template v-if=\"modelValue && !readonly\">\n <OrIconButton\n :icon=\"'close'\"\n :color=\"'inherit'\"\n :size=\"'l'\"\n :disabled=\"disabled\"\n @click.stop=\"clear()\"\n />\n </template>\n\n <template v-else>\n <OrIcon\n :icon=\"'search'\"\n :size=\"'l'\"\n :variant=\"'outlined'\"\n />\n </template>\n </template>\n </template>\n </slot>\n </template>\n </OrInputBox>\n <slot name=\"append\" />\n </div>\n <template v-if=\"$slots.hint || hint || maxLength\">\n <OrHint\n v-show=\"!error\"\n :disabled=\"disabled\"\n >\n <slot name=\"hint\">\n {{ hint }}\n </slot>\n\n <template\n v-if=\"maxLength\"\n v-slot:addon\n >\n {{ length }} / {{ maxLength }}\n </template>\n </OrHint>\n </template>\n\n <OrError\n v-show=\"typeof error === 'string' && error.length > 0\"\n :disabled=\"disabled\"\n >\n {{ error }}\n\n <template\n v-if=\"maxLength\"\n v-slot:addon\n >\n {{ length }} / {{ maxLength }}\n </template>\n </OrError>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { useControlAttributes, useIdAttribute, useProxyModelValue, useResponsive, useValidationAttributes } from '@onereach/ui-components-common/hooks';\nimport { OrErrorV3 as OrError } from '@onereach/ui-components.or-error-v3';\nimport { OrHintV3 as OrHint } from '@onereach/ui-components.or-hint-v3';\nimport { OrIconButtonV3 as OrIconButton } from '@onereach/ui-components.or-icon-button-v3';\nimport { OrIconV3 as OrIcon } from '@onereach/ui-components.or-icon-v3';\nimport { InputBoxSize, InputBoxVariant, OrInputBoxV3 as OrInputBox } from '@onereach/ui-components.or-input-box-v3';\nimport { OrLabelV3 as OrLabel } from '@onereach/ui-components.or-label-v3';\nimport { OrLoaderV3 as OrLoader } from '@onereach/ui-components.or-loader-v3';\nimport { PropType, computed, defineComponent, reactive, ref, toRef } from 'vue';\n\nimport * as Styles from './styles';\nimport { InputMode, InputModelValue, InputType } from './types';\n\nexport default defineComponent({\n name: 'OrInput',\n\n components: {\n OrError,\n OrHint,\n OrIcon,\n OrIconButton,\n OrInputBox,\n OrLabel,\n OrLoader,\n },\n\n model: {\n prop: 'modelValue',\n event: 'update:modelValue',\n },\n\n props: {\n modelValue: {\n type: undefined as unknown as PropType<InputModelValue>,\n default: undefined,\n },\n\n name: {\n type: String,\n default: undefined,\n },\n\n type: {\n type: String as PropType<`${InputType}`>,\n default: () => InputType.Text,\n },\n\n autocomplete: {\n type: String,\n default: 'off',\n },\n\n inputmode: {\n type: String as PropType<`${InputMode}`>,\n default: InputMode.Text,\n },\n\n variant: {\n type: String as PropType<`${InputBoxVariant}`>,\n default: undefined,\n },\n\n size: {\n type: String as PropType<`${InputBoxSize}`>,\n default: undefined,\n },\n\n label: {\n type: String,\n default: undefined,\n },\n\n placeholder: {\n type: String,\n default: undefined,\n },\n\n hint: {\n type: String,\n default: undefined,\n },\n\n error: {\n type: [String, Boolean],\n default: undefined,\n },\n\n loading: {\n type: Boolean,\n default: false,\n },\n\n required: {\n type: Boolean,\n default: false,\n },\n\n readonly: {\n type: Boolean,\n default: false,\n },\n\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n 'update:modelValue',\n\n 'input',\n 'keydown',\n 'keyup',\n 'focus',\n 'blur',\n ],\n\n expose: [\n 'root',\n\n 'clear',\n 'focus',\n 'blur',\n ],\n\n setup(props, context) {\n const attributes = reactive({\n id: useIdAttribute(),\n ...useControlAttributes(),\n ...useValidationAttributes(),\n });\n\n // Refs & Styles\n const root = ref<HTMLElement>();\n\n const rootStyles = computed(() => [\n 'or-input-v3',\n ...Styles.Input,\n ...props.variant === InputBoxVariant.Embedded ? ['grow'] : [],\n ]);\n\n const control = ref<HTMLInputElement>();\n\n const controlStyles = computed(() => [\n ...Styles.InputControl,\n ]);\n\n // State\n const model = useProxyModelValue(toRef(props, 'modelValue'), context.emit);\n const disclosed = ref(false);\n\n const length = computed(() => {\n return model.value?.toString().length ?? 0;\n });\n\n const maxLength = computed(() => {\n return attributes.maxlength;\n });\n\n // Methods\n function clear(): void {\n model.value = undefined;\n }\n\n function focus(): void {\n control.value?.focus();\n }\n\n function blur(): void {\n control.value?.blur();\n }\n\n // Helpers\n const { isMobile } = useResponsive();\n\n return {\n attributes,\n\n root,\n rootStyles,\n\n control,\n controlStyles,\n\n model,\n disclosed,\n\n length,\n maxLength,\n\n clear,\n focus,\n blur,\n\n isMobile,\n };\n },\n});\n</script>\n\n<style scoped>\ninput {\n min-width: 0;\n background: none;\n outline: none;\n}\n\ninput[type=\"search\"]::-webkit-search-cancel-button {\n display: none;\n}\n</style>\n"],"names":["Input","InputControl","InputType","InputMode","_sfc_main","defineComponent","OrError","OrHint","OrIcon","OrIconButton","OrInputBox","OrLabel","OrLoader","props","context","attributes","reactive","useIdAttribute","useControlAttributes","useValidationAttributes","root","ref","rootStyles","computed","Styles.Input","InputBoxVariant","control","controlStyles","Styles.InputControl","model","useProxyModelValue","toRef","disclosed","length","_a","maxLength","clear","focus","blur","isMobile","useResponsive","_resolveComponent","_openBlock","_createElementBlock","_normalizeClass","_ctx","_createBlock","_component_OrLabel","_renderSlot","_createCommentVNode","_createElementVNode","_hoisted_1","_createVNode","_component_OrInputBox","_mergeProps","_cache","$event","_withCtx","_component_OrLoader","_Fragment","_component_OrIconButton","_withModifiers","_component_OrIcon","_component_OrHint","_createSlots","_withDirectives","_component_OrError"],"mappings":";;;;;;;;;;;AAAO,MAAMA,KAAkB;AAAA;AAAA,EAE7B;AAAA;AAAA,EA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AA,MAAA,CAAA;AAAA,kBAAA,GAAA,MAAA,GAAA,CAAA,UAAA,CAAA,MAAAH,EAHe,GAAAI,EAAAgB,GAAA;AAAA,oBACd,KAAI;AAAA,oBACJ,MAAA;AAAA,oBAAA,MAAA;AAAA;;;;;;;QAQf,IAAA;AAAA,MAAA,CAAA,GAAA,MAAA,CAAA,WAAA,QAAA,WAAA,YAAA,UAAA,CAAA;AAAA,MAEcd,EAAOH,EAAI,QAAI,UAAQ,CAAA,GAAS,QAAA,EAAA;AAAA,IAAA,CAAA;AAAA,gDAGjCH,KAAQI,EAAAiB,GAAA;AAAA,MAAA,KAAA;AAAA;IAIZ,GAAAC,EAAA;AAAA,MAAA,SAAAP,EAAA,MAAA;AAAA;;;;MAGC,GAAA;AAAA,IAAA,GAAA;AAAA;;;;;;;;;IAYC,CAAA,IAAAR,EAAA,IAAA,EAAA;AAAA,IAAAgB,EAAAb,EAAAc,GAAH,EAER,UAAArB,EAAA,SAAA,GAAAmB,EAAA;AAAA,MAAA,SAAAP,EAAA,MAAA;AAAA;;MACQ,GAAA;AAAA,IAAA,GAAA;AAAA;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as i } from "./OrInputBox.vue_vue_type_script_lang-
|
|
1
|
+
import { _ as i } from "./OrInputBox.vue_vue_type_script_lang-BE6o1X-I.mjs";
|
|
2
2
|
import { resolveComponent as t, openBlock as o, createElementBlock as p, normalizeClass as m, createBlock as a, withCtx as r, renderSlot as d, createCommentVNode as s } from "vue";
|
|
3
3
|
import { _ as u } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const f = ["invalid", "readonly", "disabled"];
|
|
@@ -41,4 +41,4 @@ const A = /* @__PURE__ */ u(i, [["render", v]]);
|
|
|
41
41
|
export {
|
|
42
42
|
A as O
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=OrInputBox-
|
|
44
|
+
//# sourceMappingURL=OrInputBox-CouSnPFr.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrInputBox-
|
|
1
|
+
{"version":3,"file":"OrInputBox-CouSnPFr.mjs","sources":["../../../components/or-input-box-v3/src/OrInputBox.vue"],"sourcesContent":["<template>\n <div\n :ref=\"'root'\"\n :class=\"rootStyles\"\n :invalid=\"invalid\"\n :readonly=\"readonly\"\n :disabled=\"disabled\"\n @focus=\"$emit('focus')\"\n >\n <template v-if=\"$slots.prepend\">\n <OrInputBoxAddon\n :invalid=\"invalid\"\n :readonly=\"readonly\"\n :disabled=\"disabled\"\n >\n <slot name=\"prepend\" />\n </OrInputBoxAddon>\n </template>\n\n <slot />\n\n <template v-if=\"$slots.addon\">\n <OrInputBoxAddon\n :invalid=\"invalid\"\n :readonly=\"readonly\"\n :disabled=\"disabled\"\n >\n <slot name=\"addon\" />\n </OrInputBoxAddon>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { computed, defineComponent, PropType, ref } from 'vue';\n\nimport OrInputBoxAddon from './partials/or-input-box-addon/OrInputBoxAddon.vue';\nimport * as Styles from './styles';\nimport { InputBoxDirection, InputBoxSize, InputBoxVariant } from './types';\n\nexport default defineComponent({\n name: 'OrInputBox',\n\n components: {\n OrInputBoxAddon,\n },\n\n props: {\n direction: {\n type: String as PropType<`${InputBoxDirection}`>,\n default: () => InputBoxDirection.Row,\n },\n\n variant: {\n type: String as PropType<`${InputBoxVariant}`>,\n default: () => InputBoxVariant.Styled,\n },\n\n size: {\n type: String as PropType<`${InputBoxSize}`>,\n default: () => InputBoxSize.M,\n },\n\n invalid: {\n type: Boolean,\n default: false,\n },\n\n readonly: {\n type: Boolean,\n default: false,\n },\n\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n\n expose: [\n 'root',\n ],\n\n emits: [\n 'focus',\n ],\n\n setup(props) {\n // Refs\n const root = ref<HTMLElement>();\n\n // Styles\n const rootStyles = computed(() => [\n 'or-input-box-v3',\n ...Styles.InputBox,\n ...Styles.InputBoxDirections[props.direction],\n ...Styles.InputBoxVariants[props.variant],\n ...Styles.InputBoxSizes[`${props.size}-${props.direction}`],\n ]);\n\n return {\n root,\n rootStyles,\n };\n },\n});\n</script>\n"],"names":["_resolveComponent","_openBlock","_createElementBlock","_normalizeClass","_ctx","_cache","$event","_createBlock","_component_OrInputBoxAddon","_createCommentVNode","_renderSlot"],"mappings":";;;;;YACEA,EA6BM,iBAAA;SA3BEC,EAAY,GAAAC,EAAA,OAAA;AAAA,IACjB,KAAA;AAAA,IACA,OAAkBC,EAAAC,EAAA,UAAA;AAAA,IAClB,SAAQA,EAAE;AAAA,IACV,UAAKA,EAAA;AAAA,IAAA,UAAAA,EAAA;AAAA,IAEU,SAAAC,EAAO,CAAO,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAAF,EAAA,MAAA,OAAA;AAAA,EAAA,GAAA;AAAA,6BAETG,EAAAC,GAAA;AAAA,MAChB,KAAA;AAAA,MACA,SAAQJ,EAAE;AAAA,MAAA,UAAAA,EAAA;AAAA;;;;;;IAMf,GAAA,GAAA,CAAA,WAAQ,4BAEQK,EAAY,IAAA,EAAA;AAAA,IAAAC,EAAAN,EAAA,QAC1B,SAMkB;AAAA,IAAAA,EAAA,OAAA,SAAAH,EAAA,GALCM,EAAAC,GAAA;AAAA,MAChB,KAAA;AAAA,MACA,SAAQJ,EAAE;AAAA,MAAA,UAAAA,EAAA;AAAA;;;;;;;;;;"}
|
|
@@ -36,7 +36,7 @@ const p = [
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
}), y = ["invalid", "readonly", "disabled"];
|
|
39
|
-
function k(e, n,
|
|
39
|
+
function k(e, n, t, S, x, _) {
|
|
40
40
|
return s(), u("div", {
|
|
41
41
|
ref: "root",
|
|
42
42
|
class: m(e.rootStyles),
|
|
@@ -48,7 +48,7 @@ function k(e, n, o, S, x, _) {
|
|
|
48
48
|
], 10, y);
|
|
49
49
|
}
|
|
50
50
|
const b = /* @__PURE__ */ h(f, [["render", k]]);
|
|
51
|
-
var
|
|
51
|
+
var o = /* @__PURE__ */ ((e) => (e.Row = "row", e.Column = "column", e))(o || {}), r = /* @__PURE__ */ ((e) => (e.Styled = "styled", e.Unstyled = "unstyled", e.Embedded = "embedded", e))(r || {}), l = /* @__PURE__ */ ((e) => (e.M = "m", e.S = "s", e))(l || {});
|
|
52
52
|
const v = [
|
|
53
53
|
// Overflow
|
|
54
54
|
"overflow-hidden",
|
|
@@ -59,11 +59,11 @@ const v = [
|
|
|
59
59
|
// Theme (children)
|
|
60
60
|
"children:outline-none"
|
|
61
61
|
], g = {
|
|
62
|
-
[
|
|
62
|
+
[o.Row]: [
|
|
63
63
|
// Layout
|
|
64
64
|
"layout-row"
|
|
65
65
|
],
|
|
66
|
-
[
|
|
66
|
+
[o.Column]: [
|
|
67
67
|
// Layout
|
|
68
68
|
"layout-column"
|
|
69
69
|
]
|
|
@@ -121,8 +121,8 @@ const v = [
|
|
|
121
121
|
],
|
|
122
122
|
[r.Embedded]: [
|
|
123
123
|
// Spacing (children)
|
|
124
|
-
"first
|
|
125
|
-
"last
|
|
124
|
+
"children:first:!ms-0",
|
|
125
|
+
"children:last:!me-0"
|
|
126
126
|
]
|
|
127
127
|
}, B = {
|
|
128
128
|
"m-row": [
|
|
@@ -131,8 +131,8 @@ const v = [
|
|
|
131
131
|
// Spacing
|
|
132
132
|
"gap-sm+ md:gap-sm",
|
|
133
133
|
// Spacing (children)
|
|
134
|
-
"first:
|
|
135
|
-
"last:
|
|
134
|
+
"children:first:ms-md md:children:first:ms-[var(--or-s-smplus)]",
|
|
135
|
+
"children:last:me-md md:children:last:me-[var(--or-s-smplus)]",
|
|
136
136
|
// Typography
|
|
137
137
|
"typography-body-2-regular"
|
|
138
138
|
],
|
|
@@ -146,8 +146,8 @@ const v = [
|
|
|
146
146
|
// Spacing
|
|
147
147
|
"gap-[6px]",
|
|
148
148
|
// Spacing (children)
|
|
149
|
-
"first:
|
|
150
|
-
"last:
|
|
149
|
+
"children:first:ms-md md:children:first:ms-[var(--or-s-smplus)]",
|
|
150
|
+
"children:last:me-md md:children:last:me-[var(--or-s-smplus)]",
|
|
151
151
|
// Typography
|
|
152
152
|
"typography-caption-regular"
|
|
153
153
|
],
|
|
@@ -163,7 +163,7 @@ const v = [
|
|
|
163
163
|
props: {
|
|
164
164
|
direction: {
|
|
165
165
|
type: String,
|
|
166
|
-
default: () =>
|
|
166
|
+
default: () => o.Row
|
|
167
167
|
},
|
|
168
168
|
variant: {
|
|
169
169
|
type: String,
|
|
@@ -193,7 +193,7 @@ const v = [
|
|
|
193
193
|
"focus"
|
|
194
194
|
],
|
|
195
195
|
setup(e) {
|
|
196
|
-
const n = a(),
|
|
196
|
+
const n = a(), t = i(() => [
|
|
197
197
|
"or-input-box-v3",
|
|
198
198
|
...v,
|
|
199
199
|
...g[e.direction],
|
|
@@ -202,14 +202,14 @@ const v = [
|
|
|
202
202
|
]);
|
|
203
203
|
return {
|
|
204
204
|
root: n,
|
|
205
|
-
rootStyles:
|
|
205
|
+
rootStyles: t
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
209
|
export {
|
|
210
|
-
|
|
210
|
+
o as I,
|
|
211
211
|
C as _,
|
|
212
212
|
r as a,
|
|
213
213
|
l as b
|
|
214
214
|
};
|
|
215
|
-
//# sourceMappingURL=OrInputBox.vue_vue_type_script_lang-
|
|
215
|
+
//# sourceMappingURL=OrInputBox.vue_vue_type_script_lang-BE6o1X-I.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrInputBox.vue_vue_type_script_lang-BE6o1X-I.mjs","sources":["../../../components/or-input-box-v3/src/partials/or-input-box-addon/styles.ts","../../../components/or-input-box-v3/src/partials/or-input-box-addon/OrInputBoxAddon.vue","../../../components/or-input-box-v3/src/types.ts","../../../components/or-input-box-v3/src/styles.ts","../../../components/or-input-box-v3/src/OrInputBox.vue"],"sourcesContent":["export const InputBoxAddon: string[] = [\n // Layout\n 'layout-inline-row',\n\n // Theme\n 'theme-foreground-outline',\n 'dark:theme-foreground-outline-dark',\n];\n","<template>\n <div\n :ref=\"'root'\"\n :class=\"rootStyles\"\n :invalid=\"invalid\"\n :readonly=\"readonly\"\n :disabled=\"disabled\"\n >\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { computed, defineComponent, ref } from 'vue';\n\nimport { InputBoxAddon } from './styles';\n\nexport default defineComponent({\n name: 'OrInputBoxAddon',\n\n props: {\n invalid: {\n type: Boolean,\n default: false,\n },\n\n readonly: {\n type: Boolean,\n default: false,\n },\n\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n\n expose: [\n 'root',\n ],\n\n setup() {\n // Refs\n const root = ref<HTMLElement>();\n\n // Styles\n const rootStyles = computed(() => [\n 'or-input-box-addon-v3',\n ...InputBoxAddon,\n ]);\n\n return {\n root,\n rootStyles,\n };\n },\n});\n</script>\n","export enum InputBoxDirection {\n Row = 'row',\n Column = 'column',\n}\n\nexport enum InputBoxVariant {\n Styled = 'styled',\n Unstyled = 'unstyled',\n Embedded = 'embedded',\n}\n\nexport enum InputBoxSize {\n M = 'm',\n S = 's',\n}\n","import { InputBoxDirection, InputBoxSize, InputBoxVariant } from './types';\n\nexport const InputBox: string[] = [\n // Overflow\n 'overflow-hidden',\n\n // Box\n 'w-full',\n\n // Shape\n 'rounded-md',\n\n // Theme (children)\n 'children:outline-none',\n];\n\nexport const InputBoxDirections: Record<InputBoxDirection, string[]> = {\n [InputBoxDirection.Row]: [\n // Layout\n 'layout-row',\n ],\n\n [InputBoxDirection.Column]: [\n // Layout\n 'layout-column',\n ],\n};\n\nexport const InputBoxVariants: Record<InputBoxVariant, string[]> = {\n [InputBoxVariant.Styled]: [\n // Theme\n 'theme-preset-3-primary',\n 'dark:theme-preset-3-primary-dark',\n\n 'theme-foreground-default',\n 'dark:theme-foreground-default-dark',\n\n 'theme-border-outline border-1',\n 'dark:theme-border-outline-dark',\n\n 'theme-outline-transparent outline-2',\n 'dark:theme-outline-transparent',\n\n // Theme (focus)\n 'focus-within:theme-background-primary-translucent-1',\n 'dark:focus-within:theme-background-primary-translucent-1-dark',\n\n 'focus-within:theme-border-primary focus-within:border-1',\n 'dark:focus-within:theme-border-primary-dark',\n\n 'focus-within:theme-outline-primary focus-within:outline-2',\n 'dark:focus-within:theme-outline-primary-dark',\n\n // Theme (invalid)\n 'invalid:theme-preset-3-error',\n 'dark:invalid:theme-preset-3-error-dark',\n\n 'invalid:theme-background-error-translucent-1',\n 'dark:invalid:theme-background-error-translucent-1-dark',\n\n 'invalid:theme-foreground-default',\n 'dark:invalid:theme-foreground-default-dark',\n\n 'invalid:theme-border-error invalid:border-1',\n 'dark:invalid:theme-border-error-dark',\n\n 'invalid:theme-outline-transparent invalid:outline-2',\n 'dark:invalid:theme-outline-transparent',\n\n // Theme (invalid + focus)\n 'invalid:focus-within:theme-background-error-translucent-1',\n 'dark:invalid:focus-within:theme-background-error-translucent-1-dark',\n\n 'invalid:focus-within:theme-border-error invalid:focus-within:border-1',\n 'dark:invalid:focus-within:theme-border-error-dark',\n\n 'invalid:focus-within:theme-outline-error invalid:focus-within:outline-2',\n 'dark:invalid:focus-within:theme-outline-error-dark',\n\n // Theme (read-only)\n 'read-only:theme-background-primary-translucent-1',\n 'dark:read-only:theme-background-primary-translucent-1-dark',\n\n 'read-only:!border-transparent',\n 'dark:read-only:!border-transparent',\n\n // Theme (invalid + read-only)\n 'invalid:read-only:bg-error-opacity-0-08',\n 'dark:invalid:read-only:bg-error-opacity-0-08-dark',\n\n 'invalid:read-only:!border-transparent',\n 'dark:invalid:read-only:!border-transparent',\n ],\n\n [InputBoxVariant.Unstyled]: [\n // Theme (disabled)\n 'disabled:theme-foreground-disabled',\n 'dark:disabled:theme-foreground-disabled-dark',\n ],\n\n [InputBoxVariant.Embedded]: [\n // Spacing (children)\n 'children:first:!ms-0',\n 'children:last:!me-0',\n ],\n};\n\nexport const InputBoxSizes: Record<`${InputBoxSize}-${InputBoxDirection}`, string[]> = {\n 'm-row': [\n // Box (children)\n 'children:min-h-[46px] md:children:min-h-[34px]',\n\n // Spacing\n 'gap-sm+ md:gap-sm',\n\n // Spacing (children)\n 'children:first:ms-md md:children:first:ms-[var(--or-s-smplus)]',\n 'children:last:me-md md:children:last:me-[var(--or-s-smplus)]',\n\n // Typography\n 'typography-body-2-regular',\n ],\n\n 'm-column': [\n // Typography\n 'typography-body-2-regular',\n ],\n\n 's-row': [\n // Box (children)\n 'children:min-h-[30px]',\n\n // Spacing\n 'gap-[6px]',\n\n // Spacing (children)\n 'children:first:ms-md md:children:first:ms-[var(--or-s-smplus)]',\n 'children:last:me-md md:children:last:me-[var(--or-s-smplus)]',\n\n // Typography\n 'typography-caption-regular',\n ],\n\n 's-column': [\n // Typography\n 'typography-caption-regular',\n ],\n};\n","<template>\n <div\n :ref=\"'root'\"\n :class=\"rootStyles\"\n :invalid=\"invalid\"\n :readonly=\"readonly\"\n :disabled=\"disabled\"\n @focus=\"$emit('focus')\"\n >\n <template v-if=\"$slots.prepend\">\n <OrInputBoxAddon\n :invalid=\"invalid\"\n :readonly=\"readonly\"\n :disabled=\"disabled\"\n >\n <slot name=\"prepend\" />\n </OrInputBoxAddon>\n </template>\n\n <slot />\n\n <template v-if=\"$slots.addon\">\n <OrInputBoxAddon\n :invalid=\"invalid\"\n :readonly=\"readonly\"\n :disabled=\"disabled\"\n >\n <slot name=\"addon\" />\n </OrInputBoxAddon>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { computed, defineComponent, PropType, ref } from 'vue';\n\nimport OrInputBoxAddon from './partials/or-input-box-addon/OrInputBoxAddon.vue';\nimport * as Styles from './styles';\nimport { InputBoxDirection, InputBoxSize, InputBoxVariant } from './types';\n\nexport default defineComponent({\n name: 'OrInputBox',\n\n components: {\n OrInputBoxAddon,\n },\n\n props: {\n direction: {\n type: String as PropType<`${InputBoxDirection}`>,\n default: () => InputBoxDirection.Row,\n },\n\n variant: {\n type: String as PropType<`${InputBoxVariant}`>,\n default: () => InputBoxVariant.Styled,\n },\n\n size: {\n type: String as PropType<`${InputBoxSize}`>,\n default: () => InputBoxSize.M,\n },\n\n invalid: {\n type: Boolean,\n default: false,\n },\n\n readonly: {\n type: Boolean,\n default: false,\n },\n\n disabled: {\n type: Boolean,\n default: false,\n },\n },\n\n expose: [\n 'root',\n ],\n\n emits: [\n 'focus',\n ],\n\n setup(props) {\n // Refs\n const root = ref<HTMLElement>();\n\n // Styles\n const rootStyles = computed(() => [\n 'or-input-box-v3',\n ...Styles.InputBox,\n ...Styles.InputBoxDirections[props.direction],\n ...Styles.InputBoxVariants[props.variant],\n ...Styles.InputBoxSizes[`${props.size}-${props.direction}`],\n ]);\n\n return {\n root,\n rootStyles,\n };\n },\n});\n</script>\n"],"names":["InputBoxAddon","_sfc_main$1","defineComponent","root","ref","rootStyles","computed","_sfc_render","_ctx","_cache","$props","$setup","$data","$options","_openBlock","_createElementBlock","_normalizeClass","InputBoxDirection","InputBoxVariant","InputBoxSize","InputBox","InputBoxDirections","InputBoxVariants","InputBoxSizes","_sfc_main","OrInputBoxAddon","props","Styles.InputBox","Styles.InputBoxDirections","Styles.InputBoxVariants","Styles.InputBoxSizes"],"mappings":";;AAAO,MAAMA,IAA0B;AAAA;AAAA,EAErC;AAAA;AAAA,EAGA;AAAA,EACA;AACF,GCUAC,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EAEN,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IAEA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IAEA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,QAAQ;AAAA,IACN;AAAA,EACF;AAAA,EAEA,QAAQ;AAEN,UAAMC,IAAOC,KAGPC,IAAaC,EAAS,MAAM;AAAA,MAChC;AAAA,MACA,GAAGN;AAAA,IAAA,CACJ;AAEM,WAAA;AAA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F;AAAA,EAEA,OAAO;AAAA,IACL;AAAA,EACF;AAAA,EAEA,MAAMO,GAAO;AAEX,UAAMvB,IAAOC,KAGPC,IAAaC,EAAS,MAAM;AAAA,MAChC;AAAA,MACA,GAAGqB;AAAAA,MACH,GAAGC,EAA0BF,EAAM,SAAS;AAAA,MAC5C,GAAGG,EAAwBH,EAAM,OAAO;AAAA,MACxC,GAAGI,EAAqB,GAAGJ,EAAM,IAAI,IAAIA,EAAM,SAAS,EAAE;AAAA,IAAA,CAC3D;AAEM,WAAA;AAAA,MACL,MAAAvB;AAAA,MACA,YAAAE;AAAA,IAAA;AAAA,EAEJ;AACF,CAAC;"}
|
|
@@ -219,7 +219,7 @@ function le(e, i, R, I, $, N) {
|
|
|
219
219
|
}, 8, ["class"]),
|
|
220
220
|
s(k, {
|
|
221
221
|
ref: "limitMenu",
|
|
222
|
-
"additional-styles": ["min-w-[60px]"],
|
|
222
|
+
"additional-styles": ["!min-w-[60px]"],
|
|
223
223
|
trigger: e.limitButtonRoot,
|
|
224
224
|
placement: "top"
|
|
225
225
|
}, {
|
|
@@ -291,7 +291,7 @@ function le(e, i, R, I, $, N) {
|
|
|
291
291
|
}, 8, ["class"]),
|
|
292
292
|
s(k, {
|
|
293
293
|
ref: "offsetMenu",
|
|
294
|
-
"additional-styles": ["min-w-[60px]"],
|
|
294
|
+
"additional-styles": ["!min-w-[60px]"],
|
|
295
295
|
trigger: e.offsetButtonRoot,
|
|
296
296
|
placement: "top"
|
|
297
297
|
}, {
|
|
@@ -331,4 +331,4 @@ const pe = /* @__PURE__ */ x(re, [["render", le]]);
|
|
|
331
331
|
export {
|
|
332
332
|
pe as O
|
|
333
333
|
};
|
|
334
|
-
//# sourceMappingURL=OrPagination-
|
|
334
|
+
//# sourceMappingURL=OrPagination-CCEOMfsC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrPagination-CCEOMfsC.mjs","sources":["../../../components/or-pagination-v3/src/styles.ts","../../../components/or-pagination-v3/src/OrPagination.vue"],"sourcesContent":["export const Pagination: string[] = [\n // Layout\n 'layout-row justify-between md:justify-end',\n\n // Spacing\n 'gap-xl',\n\n // Typography\n 'typography-caption-regular',\n\n // Theme\n 'theme-foreground-outline',\n 'dark:theme-foreground-outline-dark',\n];\n\nexport const PaginationLimitGroup: string[] = [\n // Layout\n 'layout-row shrink-0',\n\n // Spacing\n 'gap-lg md:gap-md',\n];\n\nexport const PaginationOffsetGroup: string[] = [\n // Layout\n 'layout-row shrink-0',\n\n // Spacing\n 'gap-md',\n];\n\nexport const PaginationItem: string[] = [\n // Typography\n 'typography-caption-regular',\n\n // Typography (activated)\n 'activated:typography-caption-bold',\n];\n","<template>\n <div\n :ref=\"'root'\"\n :class=\"rootStyles\"\n >\n <div :class=\"limitGroupStyles\">\n <template v-if=\"features.limit\">\n <div :class=\"['layout-row', 'gap-sm']\">\n Per page:\n\n <OrButton\n :ref=\"'limitButton'\"\n :class=\"itemStyles\"\n :variant=\"'link'\"\n :color=\"'inherit'\"\n :activated=\"true\"\n @click=\"limitMenu && limitMenu.toggle()\"\n >\n {{ currentLimit }} <OrIcon :icon=\"limitMenu && limitMenu.state === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'\" />\n </OrButton>\n\n <OrMenu\n :ref=\"'limitMenu'\"\n :additional-styles=\"['!min-w-[60px]']\"\n :trigger=\"limitButtonRoot\"\n :placement=\"'top'\"\n >\n <OrMenuItem\n v-for=\"limit of options\"\n :key=\"limit\"\n :selected=\"currentLimit === limit\"\n @click=\"currentLimit = limit; limitMenu && limitMenu.close()\"\n >\n {{ limit }}\n </OrMenuItem>\n </OrMenu>\n </div>\n </template>\n\n <template v-if=\"features.range\">\n {{ currentOffset + 1 }}-{{ Math.min(currentOffset + currentLimit, length) }} of {{ length }}\n </template>\n </div>\n\n <div :class=\"offsetGroupStyles\">\n <OrButton\n :class=\"itemStyles\"\n :variant=\"'link'\"\n :color=\"'inherit'\"\n :disabled=\"currentPage === firstPage\"\n @click=\"toPreviousPage()\"\n >\n <OrIcon :icon=\"'keyboard_arrow_left'\" />\n </OrButton>\n\n <template v-if=\"isDesktop\">\n <OrButton\n v-for=\"(page, index) of buttonGroup\"\n :key=\"index\"\n :class=\"itemStyles\"\n :variant=\"'link'\"\n :color=\"'inherit'\"\n :activated=\"currentPage === page\"\n @click=\"typeof page === 'number' && toPage(page)\"\n >\n {{ page }}\n </OrButton>\n </template>\n\n <template v-if=\"isMobile\">\n <OrButton\n :ref=\"'offsetButton'\"\n :class=\"itemStyles\"\n :variant=\"'link'\"\n :color=\"'inherit'\"\n :activated=\"true\"\n @click=\"offsetMenu && offsetMenu.open()\"\n >\n {{ currentPage }} <OrIcon :icon=\"offsetMenu && offsetMenu.state === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'\" />\n </OrButton>\n\n <OrMenu\n :ref=\"'offsetMenu'\"\n :additional-styles=\"['!min-w-[60px]']\"\n :trigger=\"offsetButtonRoot\"\n :placement=\"'top'\"\n >\n <OrMenuItem\n v-for=\"page of lastPage\"\n :key=\"page\"\n :selected=\"currentPage === page\"\n @click=\"currentPage = page; offsetMenu && offsetMenu.close()\"\n >\n {{ page }}\n </OrMenuItem>\n </OrMenu>\n </template>\n\n <OrButton\n :class=\"itemStyles\"\n :variant=\"'link'\"\n :color=\"'inherit'\"\n :disabled=\"currentPage === lastPage\"\n @click=\"toNextPage()\"\n >\n <OrIcon :icon=\"'keyboard_arrow_right'\" />\n </OrButton>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { useProxyModelValue, useResponsive } from '@onereach/ui-components-common/hooks';\nimport { OrButtonV3 as OrButton } from '@onereach/ui-components.or-button-v3';\nimport { OrIconV3 as OrIcon } from '@onereach/ui-components.or-icon-v3';\nimport { OrMenuItemV3 as OrMenuItem } from '@onereach/ui-components.or-menu-item-v3';\nimport { OrMenuV3 as OrMenu } from '@onereach/ui-components.or-menu-v3';\nimport { computed, defineComponent, PropType, ref, toRef } from 'vue';\n\nimport * as Styles from './styles';\nimport { PaginationFeatures, PaginationModelValue } from './types';\n\nexport default defineComponent({\n name: 'OrPagination',\n\n components: {\n OrButton,\n OrIcon,\n OrMenu,\n OrMenuItem,\n },\n\n model: {\n prop: 'modelValue',\n event: 'update:modelValue',\n },\n\n props: {\n modelValue: {\n type: undefined as unknown as PropType<PaginationModelValue>,\n default: undefined,\n },\n\n length: {\n type: Number,\n required: true,\n },\n\n options: {\n type: Array as PropType<number[]>,\n default: () => [50, 20, 10, 5],\n },\n\n features: {\n type: Object as PropType<PaginationFeatures>,\n\n default: () => ({\n limit: true,\n range: true,\n }) as PaginationFeatures,\n },\n },\n\n emits: [\n 'update:modelValue',\n ],\n\n expose: [\n 'root',\n 'currentLimit',\n ],\n\n setup(props, context) {\n // Refs & Styles\n const root = ref<HTMLElement>();\n\n const rootStyles = computed(() => [\n 'or-pagination-v3',\n ...Styles.Pagination,\n ]);\n\n const limitButton = ref<InstanceType<typeof OrButton>>();\n const limitButtonRoot = computed(() => limitButton.value?.root);\n\n const limitMenu = ref<InstanceType<typeof OrMenu>>();\n const limitMenuRoot = computed(() => limitMenu.value?.root);\n\n const limitGroupStyles = computed(() => [\n ...Styles.PaginationLimitGroup,\n ]);\n\n const offsetButton = ref<InstanceType<typeof OrButton>>();\n const offsetButtonRoot = computed(() => offsetButton.value?.root);\n\n const offsetMenu = ref<InstanceType<typeof OrMenu>>();\n const offsetMenuRoot = computed(() => offsetMenu.value?.root);\n\n const offsetGroupStyles = computed(() => [\n ...Styles.PaginationOffsetGroup,\n ]);\n\n const itemStyles = computed(() => [\n ...Styles.PaginationItem,\n ]);\n\n // State\n const model = useProxyModelValue(toRef(props, 'modelValue'), context.emit);\n\n const currentLimit = computed<number>({\n get: () => model.value?.limit ?? props.options[0],\n\n set: (value) => {\n model.value = {\n limit: value,\n offset: 0,\n };\n },\n });\n\n const currentOffset = computed<number>({\n get: () => model.value?.offset ?? 0,\n\n set: (value) => {\n model.value = {\n limit: currentLimit.value,\n offset: value,\n };\n },\n });\n\n const currentPage = computed<number>({\n get: () => Math.floor(currentOffset.value / currentLimit.value) + 1,\n\n set: (value) => {\n currentOffset.value = (value - 1) * currentLimit.value;\n },\n });\n\n const firstPage = computed<number>(() => {\n return 1;\n });\n\n const lastPage = computed<number>(() => {\n return Math.ceil(props.length / currentLimit.value);\n });\n\n const buttonGroup = computed<(number | string)[]>(() => {\n const pages = Array.from({ length: lastPage.value }, (_, index) => index + 1);\n\n switch (true) {\n case lastPage.value <= 7:\n return pages;\n\n case currentPage.value < firstPage.value + 4:\n return [\n ...pages.slice(0, 5),\n '…',\n lastPage.value,\n ];\n\n case currentPage.value > lastPage.value - 4:\n return [\n firstPage.value,\n '…',\n ...pages.slice(-5),\n ];\n\n default:\n return pages\n .map((page) => {\n switch (true) {\n case page > firstPage.value && page < currentPage.value - 1:\n case page < lastPage.value && page > currentPage.value + 1:\n return '…';\n\n default:\n return page;\n }\n })\n .reduce((accumulator, page) => {\n if (accumulator[accumulator.length - 1] === page) {\n return accumulator;\n }\n\n return [...accumulator, page];\n }, [] as (number | string)[]);\n }\n });\n\n // Methods\n function toPreviousPage(): void {\n currentPage.value = currentPage.value - 1;\n }\n\n function toNextPage(): void {\n currentPage.value = currentPage.value + 1;\n }\n\n function toPage(page: number): void {\n currentPage.value = page;\n }\n\n // Helpers\n const { isDesktop, isMobile } = useResponsive();\n\n return {\n root,\n rootStyles,\n\n limitButton,\n limitButtonRoot,\n\n limitMenu,\n limitMenuRoot,\n\n limitGroupStyles,\n\n offsetButton,\n offsetButtonRoot,\n\n offsetMenu,\n offsetMenuRoot,\n\n offsetGroupStyles,\n\n itemStyles,\n\n model,\n\n currentLimit,\n currentOffset,\n currentPage,\n\n firstPage,\n lastPage,\n\n buttonGroup,\n\n toPreviousPage,\n toNextPage,\n toPage,\n\n isDesktop,\n isMobile,\n };\n },\n});\n</script>\n"],"names":["Pagination","PaginationLimitGroup","PaginationOffsetGroup","PaginationItem","_sfc_main","defineComponent","OrButton","OrIcon","OrMenu","OrMenuItem","props","context","root","ref","rootStyles","computed","Styles.Pagination","limitButton","limitButtonRoot","_a","limitMenu","limitMenuRoot","limitGroupStyles","Styles.PaginationLimitGroup","offsetButton","offsetButtonRoot","offsetMenu","offsetMenuRoot","offsetGroupStyles","Styles.PaginationOffsetGroup","itemStyles","Styles.PaginationItem","model","useProxyModelValue","toRef","currentLimit","value","currentOffset","currentPage","firstPage","lastPage","buttonGroup","pages","_","index","page","accumulator","toPreviousPage","toNextPage","toPage","isDesktop","isMobile","useResponsive","_hoisted_1","_resolveComponent","_openBlock","_createElementBlock","_normalizeClass","_ctx","_createTextVNode","_createVNode","_component_OrButton","_cache","$event","_withCtx","_toDisplayString","_component_OrIcon","_component_OrMenu","_Fragment","_renderList","limit","_component_OrMenuItem","_createCommentVNode","_createElementVNode","_createBlock"],"mappings":";;;;;;;AAAO,MAAMA,KAAuB;AAAA;AAAA,EAElC;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA,EACA;AACF,GAEaC,KAAiC;AAAA;AAAA,EAE5C;AAAA;AAAA,EAGA;AACF,GAEaC,KAAkC;AAAA;AAAA,EAE7C;AAAA;AAAA,EAGA;AACF,GAEaC,KAA2B;AAAA;AAAA,EAEtC;AAAA;AAAA,EAGA;AACF,GCqFAC,KAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,EACF;AAAA,EAEA,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAAA,EAEA,OAAO;AAAA,IACL,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IAEA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,IAEA,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS,MAAM,CAAC,IAAI,IAAI,IAA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,UACA,qBAAgB,CAAA,eAAA;AAAA,UAAA,SAAAT,EAAA;AAAA;;;eAIT,EAAI,GAAAF,EAAAY,GAAA,MAAAC,EAAAX,EAAA,UAAA,CAAAb,OACTU,EAAA,KAA0BgB,GAAI;AAAA,cAC9B,KAAA1B;AAAA,cAAA,UAAAa,EAAA,gBAAAb;AAAA,cAES,SAAA,CAAAkB,MAAA;AAAA,gBAAAL,EAAA,cAAAb,GAAAa,EAAA,cAAAA,EAAA,WAAA,MAAA;AAAA,cAAA;AAAA,YAAA,GAAA;AAAA;;;;;;;;MAKhB,GAAA,EAAA,KACGc,EAAK,IAAE,EAAA;AAAA,MAAAZ,EACEC,GAAM;AAAA,QACf,OAAOJ,EAASC,EAAA,UAAA;AAAA,QAChB,SAAQ;AAAA,QACR,OAAK;AAAA,QAAA,UAAAA,EAAA,gBAAAA,EAAA;AAAA,QAEmC,SAAAI,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAAL,EAAA;MAAA,GAAA;AAAA;;;;;;;;;"}
|
|
@@ -5,8 +5,8 @@ import { O as ht } from "./OrButton-ZxDr22t7.mjs";
|
|
|
5
5
|
import { O as vt } from "./OrError-B5ihH6-3.mjs";
|
|
6
6
|
import { O as bt } from "./OrHint-NvbZyURY.mjs";
|
|
7
7
|
import { O as kt } from "./OrIconButton-BuRmTHpT.mjs";
|
|
8
|
-
import { O as yt } from "./OrInputBox-
|
|
9
|
-
import { O as Ct } from "./OrInput-
|
|
8
|
+
import { O as yt } from "./OrInputBox-CouSnPFr.mjs";
|
|
9
|
+
import { O as Ct } from "./OrInput-CsCfAKL7.mjs";
|
|
10
10
|
import { O as wt } from "./OrLabel-K7_HgvcK.mjs";
|
|
11
11
|
import { O as Ot } from "./OrMenuItem-CFz6OW23.mjs";
|
|
12
12
|
import { O as St } from "./OrMenu-DdcBdA4v.mjs";
|
|
@@ -1055,4 +1055,4 @@ export {
|
|
|
1055
1055
|
Ke as R,
|
|
1056
1056
|
Qe as a
|
|
1057
1057
|
};
|
|
1058
|
-
//# sourceMappingURL=OrRichTextEditor-
|
|
1058
|
+
//# sourceMappingURL=OrRichTextEditor-v1uIPBrt.mjs.map
|