@topvisor/ui 1.0.0-rc-3 → 1.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-C_OH9IT3.amd.js","sources":["../../src/core/plugins/i18n.ts"],"sourcesContent":["import type { ObjectPlugin, Reactive, Ref } from 'vue';\nimport { getCurrentInstance, inject, reactive, ref } from 'vue';\nimport type { components as I18nComponents } from 'topvisor-openapi/src/ts/I18n';\n\nexport type Lang = 'ru' | 'en';\n\ntype Options = {\n\t/**\n\t * Предзагруженные словари\n\t *\n\t * Для загрузки нужного словаря используйте @r/i18n.esm.js\n\t *\n\t * ```js\n\t * import '@r/i18n.esm.js?Projects';\n\t * ```\n\t */\n\ti18n: I18nComponents['schemas'];\n\n\t/**\n\t * Текущий язык\n\t */\n\tlang: Lang;\n};\n\n/**\n * Загруженные словари\n *\n * Для загрузки нужного словаря используйте @r/i18n.esm.js\n *\n * ```js\n * import '@r/i18n.esm.js?Projects';\n * ```\n */\ntype I18n = Reactive<Options['i18n']>;\n\ntype i18nSetLang = (lang: Lang, forceReload?: boolean) => void;\n\ndeclare module 'vue' {\n\texport interface ComponentCustomProperties {\n\t\t/**\n\t\t * Загруженные словари\n\t\t *\n\t\t * @see I18n\n\t\t */\n\t\t$i18n: I18n;\n\n\t\t/**\n\t\t * Текущий язык\n\t\t */\n\t\t$i18nLang: Ref<Lang>;\n\n\t\t/**\n\t\t * Установить язык\n\t\t */\n\t\t$i18nSetLang: i18nSetLang;\n\t}\n}\n\n/**\n * Плагин работает в сваязке с плагином requirejs('i18n')\n *\n * При инициализации необходимо указать в $i18n объект с предзагруежнными словарями, остальные словари можно импортировать диномически вместе с\n * компонентами\n *\n * Внутри UI дозагрузка словарей недоступна и требует предзагрузки необходимых словарей\n *\n * Добавляет глобальные свойства:\n * - \\$i18n\n * - \\$i18nLang\n * - \\$i18nSetLang\n *\n * Для загрузки необходимого словаря указывайте его в зависимостях компонента:\n *\n * ```js\n * import '@r/i18n.esm.js?Projects';\n * ```\n *\n * В setup():\n *\n * ```js\n * useI18n().Projects.Site; // выполнит inject('$i18n').Projects.Site, не испоьзуйте inject('$i18n') напрямую, так как он не типизирован\n * ```\n *\n * В template:\n *\n * ```html\n * {{ $i18n.Projects.Site }}\n * ```\n */\nexport default {\n\n\tinstall: (app, options) => {\n\t\tapp.config.globalProperties.$i18n = reactive(options.i18n);\n\t\tapp.config.globalProperties.$i18nLang = ref(options.lang);\n\t\tapp.config.globalProperties.$i18nSetLang = () => {};\n\n\t\t/**\n\t\t * @deprecated\n\t\t */\n\t\tapp.config.globalProperties.i18n = app.config.globalProperties.$i18n;\n\n\t\t// только в браузере (не ssr)\n\t\tif (typeof window !== 'undefined' && window['requirejs']) {\n\t\t\tapp.config.globalProperties.$i18nSetLang = async (lang, forceReload) => {\n\t\t\t\tawait window['requirejs']('i18n').setLang(lang, forceReload);\n\n\t\t\t\tconst categoriesActual = window['requirejs']('i18n').categories[lang];\n\t\t\t\tObject.keys(categoriesActual).forEach(categoryName => {\n\t\t\t\t\tapp.config.globalProperties.$i18n[categoryName] = categoriesActual[categoryName];\n\t\t\t\t});\n\n\t\t\t\tapp.config.globalProperties.$i18nLang.value = lang;\n\t\t\t};\n\t\t}\n\n\t\tapp.provide('$i18n', app.config.globalProperties.$i18n);\n\t\tapp.provide('$i18nLang', app.config.globalProperties.$i18nLang);\n\t\tapp.provide('$i18nSetLang', app.config.globalProperties.$i18nSetLang);\n\n\t\t/**\n\t\t * @deprecated\n\t\t */\n\t\tapp.provide('i18n', app.config.globalProperties.i18n);\n\t},\n\n} satisfies ObjectPlugin<Options>;\n\n/**\n * Получить доступ к загруженным словарям\n *\n * @see I18n\n */\nexport const useI18n = () => {\n\t// @ts-ignore - no vue\n\tif (!getCurrentInstance() && window['mo']?.user?.lang) return requirejs('i18n').categories[mo.user.lang];\n\n\treturn inject('$i18n') as I18n;\n};\n\n/**\n * Текущий язык\n */\nexport const useI18nLang = () => {\n\t// @ts-ignore - no vue\n\tif (!getCurrentInstance() && window['mo']?.user?.lang) return ref(mo.user.lang);\n\n\treturn inject('$i18nLang') as Ref<Lang>;\n};\n\n/**\n * Получить функцию для установки языка\n */\nexport const useI18nSetLang = () => {\n\treturn inject('$i18nSetLang') as i18nSetLang;\n};\n"],"names":["i18n","app","options","vue","lang","forceReload","categoriesActual","categoryName","useI18n","_b","_a","useI18nLang","useI18nSetLang"],"mappings":"iGAyFA,MAAAA,EAAA,CAAe,QAAA,CAAAC,EAAAC,IAAA,CAGbD,EAAA,OAAA,iBAAA,MAAAE,EAAA,SAAAD,EAAA,IAAA,EACAD,EAAA,OAAA,iBAAA,UAAAE,EAAA,IAAAD,EAAA,IAAA,8CACiD,EAKjDD,EAAA,OAAA,iBAAA,KAAAA,EAAA,OAAA,iBAAA,4CAICA,EAAA,OAAA,iBAAA,aAAA,MAAAG,EAAAC,IAAA,CACC,MAAA,OAAA,UAAA,MAAA,EAAA,QAAAD,EAAAC,CAAA,EAEA,MAAAC,EAAA,OAAA,UAAA,MAAA,EAAA,WAAAF,CAAA,6BAECH,EAAA,OAAA,iBAAA,MAAAM,CAAA,EAAAD,EAAAC,CAAA,CAA+E,CAAA,6CAGlC,GAIhDN,EAAA,QAAA,QAAAA,EAAA,OAAA,iBAAA,KAAA,EACAA,EAAA,QAAA,YAAAA,EAAA,OAAA,iBAAA,SAAA,EACAA,EAAA,QAAA,eAAAA,EAAA,OAAA,iBAAA,YAAA,EAKAA,EAAA,QAAA,OAAAA,EAAA,OAAA,iBAAA,IAAA,EAGF,EAOOO,EAAA,IAAA,SAEN,MAAA,CAAAL,EAAA,mBAAA,KAAAM,GAAAC,EAAA,OAAA,KAAA,YAAAA,EAAA,OAAA,MAAAD,EAAA,MAAA,UAAA,MAAA,EAAA,WAAA,GAAA,KAAA,IAAA,EAEAN,EAAA,OAAA,OAAA,GAMMQ,EAAA,IAAA,kHAINR,EAAA,OAAA,WAAA,GAMMS,EAAA,IACNT,EAAA,OAAA,cAAA"}
1
+ {"version":3,"file":"i18n-C_OH9IT3.amd.js","sources":["../../src/core/plugins/i18n.ts"],"sourcesContent":["import type { ObjectPlugin, Reactive, Ref } from 'vue';\nimport { getCurrentInstance, inject, reactive, ref } from 'vue';\nimport type { components as I18nComponents } from 'topvisor-openapi/src/ts/I18n';\n\nexport type Lang = 'ru' | 'en';\n\ntype Options = {\n\t/**\n\t * Предзагруженные словари\n\t *\n\t * Для загрузки нужного словаря используйте @r/i18n.esm.js\n\t *\n\t * ```js\n\t * import '@r/i18n.esm.js?Projects';\n\t * ```\n\t */\n\ti18n: I18nComponents['schemas'];\n\n\t/**\n\t * Текущий язык\n\t */\n\tlang: Lang;\n};\n\n/**\n * Загруженные словари\n *\n * Для загрузки нужного словаря используйте @r/i18n.esm.js\n *\n * ```js\n * import '@r/i18n.esm.js?Projects';\n * ```\n */\ntype I18n = Reactive<Options['i18n']>;\n\ntype i18nSetLang = (lang: Lang, forceReload?: boolean) => void;\n\ndeclare module 'vue' {\n\texport interface ComponentCustomProperties {\n\t\t/**\n\t\t * Загруженные словари\n\t\t *\n\t\t * @see I18n\n\t\t */\n\t\t$i18n: I18n;\n\n\t\t/**\n\t\t * Текущий язык\n\t\t */\n\t\t$i18nLang: Ref<Lang>;\n\n\t\t/**\n\t\t * Установить язык\n\t\t */\n\t\t$i18nSetLang: i18nSetLang;\n\t}\n}\n\n/**\n * Плагин работает в сваязке с плагином requirejs('i18n')\n *\n * При инициализации необходимо указать в $i18n объект с предзагруежнными словарями, остальные словари можно импортировать диномически вместе с\n * компонентами\n *\n * Внутри UI дозагрузка словарей недоступна и требует предзагрузки необходимых словарей\n *\n * Добавляет глобальные свойства:\n * - \\$i18n\n * - \\$i18nLang\n * - \\$i18nSetLang\n *\n * Для загрузки необходимого словаря указывайте его в зависимостях компонента:\n *\n * ```js\n * import '@r/i18n.esm.js?Projects';\n * ```\n *\n * В setup():\n *\n * ```js\n * useI18n().Projects.Site; // выполнит inject('$i18n').Projects.Site, не испоьзуйте inject('$i18n') напрямую, так как он не типизирован\n * ```\n *\n * В template:\n *\n * ```html\n * {{ $i18n.Projects.Site }}\n * ```\n */\nexport default {\n\n\tinstall: (app, options) => {\n\t\tapp.config.globalProperties.$i18n = reactive(options.i18n);\n\t\tapp.config.globalProperties.$i18nLang = ref(options.lang);\n\t\tapp.config.globalProperties.$i18nSetLang = () => {};\n\n\t\t/**\n\t\t * @deprecated\n\t\t */\n\t\tapp.config.globalProperties.i18n = app.config.globalProperties.$i18n;\n\n\t\t// только в браузере (не ssr)\n\t\tif (typeof window !== 'undefined' && window['requirejs']) {\n\t\t\tapp.config.globalProperties.$i18nSetLang = async (lang, forceReload) => {\n\t\t\t\tawait window['requirejs']('i18n').setLang(lang, forceReload);\n\n\t\t\t\tconst categoriesActual = window['requirejs']('i18n').categories[lang];\n\t\t\t\tObject.keys(categoriesActual).forEach(categoryName => {\n\t\t\t\t\tapp.config.globalProperties.$i18n[categoryName] = categoriesActual[categoryName];\n\t\t\t\t});\n\n\t\t\t\tapp.config.globalProperties.$i18nLang.value = lang;\n\t\t\t};\n\t\t}\n\n\t\tapp.provide('$i18n', app.config.globalProperties.$i18n);\n\t\tapp.provide('$i18nLang', app.config.globalProperties.$i18nLang);\n\t\tapp.provide('$i18nSetLang', app.config.globalProperties.$i18nSetLang);\n\n\t\t/**\n\t\t * @deprecated\n\t\t */\n\t\tapp.provide('i18n', app.config.globalProperties.i18n);\n\t},\n\n} satisfies ObjectPlugin<Options>;\n\n/**\n * Получить доступ к загруженным словарям\n *\n * @see I18n\n */\nexport const useI18n = (): I18n => {\n\t// @ts-ignore - no vue\n\tif (!getCurrentInstance() && window['mo']?.user?.lang) return requirejs('i18n').categories[mo.user.lang];\n\n\treturn inject('$i18n') as I18n;\n};\n\n/**\n * Текущий язык\n */\nexport const useI18nLang = (): Ref<Lang> => {\n\t// @ts-ignore - no vue\n\tif (!getCurrentInstance() && window['mo']?.user?.lang) return ref(mo.user.lang);\n\n\treturn inject('$i18nLang') as Ref<Lang>;\n};\n\n/**\n * Получить функцию для установки языка\n */\nexport const useI18nSetLang = () => {\n\treturn inject('$i18nSetLang') as i18nSetLang;\n};\n"],"names":["i18n","app","options","vue","lang","forceReload","categoriesActual","categoryName","useI18n","_b","_a","useI18nLang","useI18nSetLang"],"mappings":"iGAyFA,MAAAA,EAAA,CAAe,QAAA,CAAAC,EAAAC,IAAA,CAGbD,EAAA,OAAA,iBAAA,MAAAE,EAAA,SAAAD,EAAA,IAAA,EACAD,EAAA,OAAA,iBAAA,UAAAE,EAAA,IAAAD,EAAA,IAAA,8CACiD,EAKjDD,EAAA,OAAA,iBAAA,KAAAA,EAAA,OAAA,iBAAA,4CAICA,EAAA,OAAA,iBAAA,aAAA,MAAAG,EAAAC,IAAA,CACC,MAAA,OAAA,UAAA,MAAA,EAAA,QAAAD,EAAAC,CAAA,EAEA,MAAAC,EAAA,OAAA,UAAA,MAAA,EAAA,WAAAF,CAAA,6BAECH,EAAA,OAAA,iBAAA,MAAAM,CAAA,EAAAD,EAAAC,CAAA,CAA+E,CAAA,6CAGlC,GAIhDN,EAAA,QAAA,QAAAA,EAAA,OAAA,iBAAA,KAAA,EACAA,EAAA,QAAA,YAAAA,EAAA,OAAA,iBAAA,SAAA,EACAA,EAAA,QAAA,eAAAA,EAAA,OAAA,iBAAA,YAAA,EAKAA,EAAA,QAAA,OAAAA,EAAA,OAAA,iBAAA,IAAA,EAGF,EAOOO,EAAA,IAAA,SAEN,MAAA,CAAAL,EAAA,mBAAA,KAAAM,GAAAC,EAAA,OAAA,KAAA,YAAAA,EAAA,OAAA,MAAAD,EAAA,MAAA,UAAA,MAAA,EAAA,WAAA,GAAA,KAAA,IAAA,EAEAN,EAAA,OAAA,OAAA,GAMMQ,EAAA,IAAA,kHAINR,EAAA,OAAA,WAAA,GAMMS,EAAA,IACNT,EAAA,OAAA,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-DuTvft1T.es.js","sources":["../../src/core/plugins/i18n.ts"],"sourcesContent":["import type { ObjectPlugin, Reactive, Ref } from 'vue';\nimport { getCurrentInstance, inject, reactive, ref } from 'vue';\nimport type { components as I18nComponents } from 'topvisor-openapi/src/ts/I18n';\n\nexport type Lang = 'ru' | 'en';\n\ntype Options = {\n\t/**\n\t * Предзагруженные словари\n\t *\n\t * Для загрузки нужного словаря используйте @r/i18n.esm.js\n\t *\n\t * ```js\n\t * import '@r/i18n.esm.js?Projects';\n\t * ```\n\t */\n\ti18n: I18nComponents['schemas'];\n\n\t/**\n\t * Текущий язык\n\t */\n\tlang: Lang;\n};\n\n/**\n * Загруженные словари\n *\n * Для загрузки нужного словаря используйте @r/i18n.esm.js\n *\n * ```js\n * import '@r/i18n.esm.js?Projects';\n * ```\n */\ntype I18n = Reactive<Options['i18n']>;\n\ntype i18nSetLang = (lang: Lang, forceReload?: boolean) => void;\n\ndeclare module 'vue' {\n\texport interface ComponentCustomProperties {\n\t\t/**\n\t\t * Загруженные словари\n\t\t *\n\t\t * @see I18n\n\t\t */\n\t\t$i18n: I18n;\n\n\t\t/**\n\t\t * Текущий язык\n\t\t */\n\t\t$i18nLang: Ref<Lang>;\n\n\t\t/**\n\t\t * Установить язык\n\t\t */\n\t\t$i18nSetLang: i18nSetLang;\n\t}\n}\n\n/**\n * Плагин работает в сваязке с плагином requirejs('i18n')\n *\n * При инициализации необходимо указать в $i18n объект с предзагруежнными словарями, остальные словари можно импортировать диномически вместе с\n * компонентами\n *\n * Внутри UI дозагрузка словарей недоступна и требует предзагрузки необходимых словарей\n *\n * Добавляет глобальные свойства:\n * - \\$i18n\n * - \\$i18nLang\n * - \\$i18nSetLang\n *\n * Для загрузки необходимого словаря указывайте его в зависимостях компонента:\n *\n * ```js\n * import '@r/i18n.esm.js?Projects';\n * ```\n *\n * В setup():\n *\n * ```js\n * useI18n().Projects.Site; // выполнит inject('$i18n').Projects.Site, не испоьзуйте inject('$i18n') напрямую, так как он не типизирован\n * ```\n *\n * В template:\n *\n * ```html\n * {{ $i18n.Projects.Site }}\n * ```\n */\nexport default {\n\n\tinstall: (app, options) => {\n\t\tapp.config.globalProperties.$i18n = reactive(options.i18n);\n\t\tapp.config.globalProperties.$i18nLang = ref(options.lang);\n\t\tapp.config.globalProperties.$i18nSetLang = () => {};\n\n\t\t/**\n\t\t * @deprecated\n\t\t */\n\t\tapp.config.globalProperties.i18n = app.config.globalProperties.$i18n;\n\n\t\t// только в браузере (не ssr)\n\t\tif (typeof window !== 'undefined' && window['requirejs']) {\n\t\t\tapp.config.globalProperties.$i18nSetLang = async (lang, forceReload) => {\n\t\t\t\tawait window['requirejs']('i18n').setLang(lang, forceReload);\n\n\t\t\t\tconst categoriesActual = window['requirejs']('i18n').categories[lang];\n\t\t\t\tObject.keys(categoriesActual).forEach(categoryName => {\n\t\t\t\t\tapp.config.globalProperties.$i18n[categoryName] = categoriesActual[categoryName];\n\t\t\t\t});\n\n\t\t\t\tapp.config.globalProperties.$i18nLang.value = lang;\n\t\t\t};\n\t\t}\n\n\t\tapp.provide('$i18n', app.config.globalProperties.$i18n);\n\t\tapp.provide('$i18nLang', app.config.globalProperties.$i18nLang);\n\t\tapp.provide('$i18nSetLang', app.config.globalProperties.$i18nSetLang);\n\n\t\t/**\n\t\t * @deprecated\n\t\t */\n\t\tapp.provide('i18n', app.config.globalProperties.i18n);\n\t},\n\n} satisfies ObjectPlugin<Options>;\n\n/**\n * Получить доступ к загруженным словарям\n *\n * @see I18n\n */\nexport const useI18n = () => {\n\t// @ts-ignore - no vue\n\tif (!getCurrentInstance() && window['mo']?.user?.lang) return requirejs('i18n').categories[mo.user.lang];\n\n\treturn inject('$i18n') as I18n;\n};\n\n/**\n * Текущий язык\n */\nexport const useI18nLang = () => {\n\t// @ts-ignore - no vue\n\tif (!getCurrentInstance() && window['mo']?.user?.lang) return ref(mo.user.lang);\n\n\treturn inject('$i18nLang') as Ref<Lang>;\n};\n\n/**\n * Получить функцию для установки языка\n */\nexport const useI18nSetLang = () => {\n\treturn inject('$i18nSetLang') as i18nSetLang;\n};\n"],"names":["i18n","app","options","reactive","ref","lang","forceReload","categoriesActual","categoryName","useI18n","getCurrentInstance","_b","_a","inject","useI18nLang","useI18nSetLang"],"mappings":";AAyFA,MAAeA,IAAA;AAAA,EAEd,SAAS,CAACC,GAAKC,MAAY;AAC1B,IAAAD,EAAI,OAAO,iBAAiB,QAAQE,EAASD,EAAQ,IAAI,GACzDD,EAAI,OAAO,iBAAiB,YAAYG,EAAIF,EAAQ,IAAI,GACpDD,EAAA,OAAO,iBAAiB,eAAe,MAAM;AAAA,IAAA,GAKjDA,EAAI,OAAO,iBAAiB,OAAOA,EAAI,OAAO,iBAAiB,OAG3D,OAAO,SAAW,OAAe,OAAO,cAC3CA,EAAI,OAAO,iBAAiB,eAAe,OAAOI,GAAMC,MAAgB;AACvE,YAAM,OAAO,UAAa,MAAM,EAAE,QAAQD,GAAMC,CAAW;AAE3D,YAAMC,IAAmB,OAAO,UAAa,MAAM,EAAE,WAAWF,CAAI;AACpE,aAAO,KAAKE,CAAgB,EAAE,QAAQ,CAAgBC,MAAA;AACrD,QAAAP,EAAI,OAAO,iBAAiB,MAAMO,CAAY,IAAID,EAAiBC,CAAY;AAAA,MAAA,CAC/E,GAEGP,EAAA,OAAO,iBAAiB,UAAU,QAAQI;AAAA,IAAA,IAIhDJ,EAAI,QAAQ,SAASA,EAAI,OAAO,iBAAiB,KAAK,GACtDA,EAAI,QAAQ,aAAaA,EAAI,OAAO,iBAAiB,SAAS,GAC9DA,EAAI,QAAQ,gBAAgBA,EAAI,OAAO,iBAAiB,YAAY,GAKpEA,EAAI,QAAQ,QAAQA,EAAI,OAAO,iBAAiB,IAAI;AAAA,EACrD;AAED,GAOaQ,IAAU,MAAM;;AAE5B,SAAI,CAACC,EAAA,OAAwBC,KAAAC,IAAA,OAAO,OAAP,gBAAAA,EAAc,SAAd,QAAAD,EAAoB,QAAa,UAAU,MAAM,EAAE,WAAW,GAAG,KAAK,IAAI,IAEhGE,EAAO,OAAO;AACtB,GAKaC,IAAc,MAAM;;AAEhC,SAAI,CAACJ,EAAA,OAAwBC,KAAAC,IAAA,OAAO,OAAP,gBAAAA,EAAc,SAAd,QAAAD,EAAoB,QAAaP,EAAI,GAAG,KAAK,IAAI,IAEvES,EAAO,WAAW;AAC1B,GAKaE,IAAiB,MACtBF,EAAO,cAAc;"}
1
+ {"version":3,"file":"i18n-DuTvft1T.es.js","sources":["../../src/core/plugins/i18n.ts"],"sourcesContent":["import type { ObjectPlugin, Reactive, Ref } from 'vue';\nimport { getCurrentInstance, inject, reactive, ref } from 'vue';\nimport type { components as I18nComponents } from 'topvisor-openapi/src/ts/I18n';\n\nexport type Lang = 'ru' | 'en';\n\ntype Options = {\n\t/**\n\t * Предзагруженные словари\n\t *\n\t * Для загрузки нужного словаря используйте @r/i18n.esm.js\n\t *\n\t * ```js\n\t * import '@r/i18n.esm.js?Projects';\n\t * ```\n\t */\n\ti18n: I18nComponents['schemas'];\n\n\t/**\n\t * Текущий язык\n\t */\n\tlang: Lang;\n};\n\n/**\n * Загруженные словари\n *\n * Для загрузки нужного словаря используйте @r/i18n.esm.js\n *\n * ```js\n * import '@r/i18n.esm.js?Projects';\n * ```\n */\ntype I18n = Reactive<Options['i18n']>;\n\ntype i18nSetLang = (lang: Lang, forceReload?: boolean) => void;\n\ndeclare module 'vue' {\n\texport interface ComponentCustomProperties {\n\t\t/**\n\t\t * Загруженные словари\n\t\t *\n\t\t * @see I18n\n\t\t */\n\t\t$i18n: I18n;\n\n\t\t/**\n\t\t * Текущий язык\n\t\t */\n\t\t$i18nLang: Ref<Lang>;\n\n\t\t/**\n\t\t * Установить язык\n\t\t */\n\t\t$i18nSetLang: i18nSetLang;\n\t}\n}\n\n/**\n * Плагин работает в сваязке с плагином requirejs('i18n')\n *\n * При инициализации необходимо указать в $i18n объект с предзагруежнными словарями, остальные словари можно импортировать диномически вместе с\n * компонентами\n *\n * Внутри UI дозагрузка словарей недоступна и требует предзагрузки необходимых словарей\n *\n * Добавляет глобальные свойства:\n * - \\$i18n\n * - \\$i18nLang\n * - \\$i18nSetLang\n *\n * Для загрузки необходимого словаря указывайте его в зависимостях компонента:\n *\n * ```js\n * import '@r/i18n.esm.js?Projects';\n * ```\n *\n * В setup():\n *\n * ```js\n * useI18n().Projects.Site; // выполнит inject('$i18n').Projects.Site, не испоьзуйте inject('$i18n') напрямую, так как он не типизирован\n * ```\n *\n * В template:\n *\n * ```html\n * {{ $i18n.Projects.Site }}\n * ```\n */\nexport default {\n\n\tinstall: (app, options) => {\n\t\tapp.config.globalProperties.$i18n = reactive(options.i18n);\n\t\tapp.config.globalProperties.$i18nLang = ref(options.lang);\n\t\tapp.config.globalProperties.$i18nSetLang = () => {};\n\n\t\t/**\n\t\t * @deprecated\n\t\t */\n\t\tapp.config.globalProperties.i18n = app.config.globalProperties.$i18n;\n\n\t\t// только в браузере (не ssr)\n\t\tif (typeof window !== 'undefined' && window['requirejs']) {\n\t\t\tapp.config.globalProperties.$i18nSetLang = async (lang, forceReload) => {\n\t\t\t\tawait window['requirejs']('i18n').setLang(lang, forceReload);\n\n\t\t\t\tconst categoriesActual = window['requirejs']('i18n').categories[lang];\n\t\t\t\tObject.keys(categoriesActual).forEach(categoryName => {\n\t\t\t\t\tapp.config.globalProperties.$i18n[categoryName] = categoriesActual[categoryName];\n\t\t\t\t});\n\n\t\t\t\tapp.config.globalProperties.$i18nLang.value = lang;\n\t\t\t};\n\t\t}\n\n\t\tapp.provide('$i18n', app.config.globalProperties.$i18n);\n\t\tapp.provide('$i18nLang', app.config.globalProperties.$i18nLang);\n\t\tapp.provide('$i18nSetLang', app.config.globalProperties.$i18nSetLang);\n\n\t\t/**\n\t\t * @deprecated\n\t\t */\n\t\tapp.provide('i18n', app.config.globalProperties.i18n);\n\t},\n\n} satisfies ObjectPlugin<Options>;\n\n/**\n * Получить доступ к загруженным словарям\n *\n * @see I18n\n */\nexport const useI18n = (): I18n => {\n\t// @ts-ignore - no vue\n\tif (!getCurrentInstance() && window['mo']?.user?.lang) return requirejs('i18n').categories[mo.user.lang];\n\n\treturn inject('$i18n') as I18n;\n};\n\n/**\n * Текущий язык\n */\nexport const useI18nLang = (): Ref<Lang> => {\n\t// @ts-ignore - no vue\n\tif (!getCurrentInstance() && window['mo']?.user?.lang) return ref(mo.user.lang);\n\n\treturn inject('$i18nLang') as Ref<Lang>;\n};\n\n/**\n * Получить функцию для установки языка\n */\nexport const useI18nSetLang = () => {\n\treturn inject('$i18nSetLang') as i18nSetLang;\n};\n"],"names":["i18n","app","options","reactive","ref","lang","forceReload","categoriesActual","categoryName","useI18n","getCurrentInstance","_b","_a","inject","useI18nLang","useI18nSetLang"],"mappings":";AAyFA,MAAeA,IAAA;AAAA,EAEd,SAAS,CAACC,GAAKC,MAAY;AAC1B,IAAAD,EAAI,OAAO,iBAAiB,QAAQE,EAASD,EAAQ,IAAI,GACzDD,EAAI,OAAO,iBAAiB,YAAYG,EAAIF,EAAQ,IAAI,GACpDD,EAAA,OAAO,iBAAiB,eAAe,MAAM;AAAA,IAAA,GAKjDA,EAAI,OAAO,iBAAiB,OAAOA,EAAI,OAAO,iBAAiB,OAG3D,OAAO,SAAW,OAAe,OAAO,cAC3CA,EAAI,OAAO,iBAAiB,eAAe,OAAOI,GAAMC,MAAgB;AACvE,YAAM,OAAO,UAAa,MAAM,EAAE,QAAQD,GAAMC,CAAW;AAE3D,YAAMC,IAAmB,OAAO,UAAa,MAAM,EAAE,WAAWF,CAAI;AACpE,aAAO,KAAKE,CAAgB,EAAE,QAAQ,CAAgBC,MAAA;AACrD,QAAAP,EAAI,OAAO,iBAAiB,MAAMO,CAAY,IAAID,EAAiBC,CAAY;AAAA,MAAA,CAC/E,GAEGP,EAAA,OAAO,iBAAiB,UAAU,QAAQI;AAAA,IAAA,IAIhDJ,EAAI,QAAQ,SAASA,EAAI,OAAO,iBAAiB,KAAK,GACtDA,EAAI,QAAQ,aAAaA,EAAI,OAAO,iBAAiB,SAAS,GAC9DA,EAAI,QAAQ,gBAAgBA,EAAI,OAAO,iBAAiB,YAAY,GAKpEA,EAAI,QAAQ,QAAQA,EAAI,OAAO,iBAAiB,IAAI;AAAA,EACrD;AAED,GAOaQ,IAAU,MAAY;;AAElC,SAAI,CAACC,EAAA,OAAwBC,KAAAC,IAAA,OAAO,OAAP,gBAAAA,EAAc,SAAd,QAAAD,EAAoB,QAAa,UAAU,MAAM,EAAE,WAAW,GAAG,KAAK,IAAI,IAEhGE,EAAO,OAAO;AACtB,GAKaC,IAAc,MAAiB;;AAE3C,SAAI,CAACJ,EAAA,OAAwBC,KAAAC,IAAA,OAAO,OAAP,gBAAAA,EAAc,SAAd,QAAAD,EAAoB,QAAaP,EAAI,GAAG,KAAK,IAAI,IAEvES,EAAO,WAAW;AAC1B,GAKaE,IAAiB,MACtBF,EAAO,cAAc;"}
@@ -86,11 +86,11 @@ export default _default;
86
86
  *
87
87
  * @see I18n
88
88
  */
89
- export declare const useI18n: () => any;
89
+ export declare const useI18n: () => I18n;
90
90
  /**
91
91
  * Текущий язык
92
92
  */
93
- export declare const useI18nLang: () => Ref<any>;
93
+ export declare const useI18nLang: () => Ref<Lang>;
94
94
  /**
95
95
  * Получить функцию для установки языка
96
96
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@topvisor/ui",
3
3
  "private": false,
4
- "version": "1.0.0-rc-3",
4
+ "version": "1.0.1",
5
5
  "type": "module",
6
6
  "description": "Topvisor UI-kit Vue",
7
7
  "author": "Topvisor",
@@ -1,2 +1,2 @@
1
- define(["require","exports","vue","../.chunks/forms-DKL0e9tp.amd","../.chunks/listItem.vue_vue_type_script_setup_true_lang-uKhci19t.amd","../.chunks/menu-DTbsTDGK.amd","../require/css.amd!../assets/project.css"],function(y,c,e,s,i,p){"use strict";if(typeof e>"u")var e=window.Vue;const m={class:"top-selectorCompetitors"},d={class:"top-ellipsis1"},C=e.defineComponent({__name:"selectorCompetitors",props:e.mergeModels({modelValue:{},items:{},showSelectAllItem:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const v=r,o=e.useModel(r,"modelValue"),_=e.computed(()=>{if(v.showSelectAllItem)return{icon:"",title:"Select all",value:"all",content:""}});return(n,a)=>(e.openBlock(),e.createElementBlock("div",m,[e.unref(s.Core).state.isMobile?(e.openBlock(),e.createBlock(i.Popup,{key:0},{opener:e.withCtx(()=>[e.createVNode(s.TopButton,{class:"top-selectorCompetitors_opener",color:"theme",icon:"",icon2:""},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString((t=n.items.find(u=>{var l;return u.value===((l=o.value)==null?void 0:l[0])}))==null?void 0:t.content),1)]}),_:1})]),contentList:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(t,u)=>{var l;return e.openBlock(),e.createBlock(i._sfc_main,{class:e.normalizeClass({"top-active":(l=o.value)==null?void 0:l.includes(t.value)}),"data-top-icon":t.icon,title:t.title,onClick:()=>o.value=[t.value]},{default:e.withCtx(()=>[e.createElementVNode("span",d,e.toDisplayString(t.content),1)]),_:2},1032,["class","data-top-icon","title","onClick"])}),256))]),_:1})):(e.openBlock(),e.createBlock(p.Menu,{key:1,modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=t=>o.value=t),items:n.items,isMultiple:!0,styling:"bar",canBeEmptyMultiple:!1,selectAllItem:_.value},null,8,["modelValue","items","selectAllItem"]))]))}}),f={$style:{"top-selectorCompetitors_opener":"top-selectorCompetitors_opener","top-button":"top-button"}},k=s._export_sfc(C,[["__cssModules",f]]);c.TopSelectorCompetitors=k,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ define(["require","exports","vue","../.chunks/forms-DKL0e9tp.amd","../.chunks/listItem.vue_vue_type_script_setup_true_lang-uKhci19t.amd","../.chunks/menu-DTbsTDGK.amd","../.chunks/i18n-C_OH9IT3.amd","../require/css.amd!../assets/project.css"],function(B,c,e,s,i,p,m){"use strict";if(typeof e>"u")var e=window.Vue;const d={class:"top-selectorCompetitors"},C={class:"top-ellipsis1"},k=e.defineComponent({__name:"selectorCompetitors",props:e.mergeModels({modelValue:{},items:{},showSelectAllItem:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const _=r,o=e.useModel(r,"modelValue"),y=e.computed(()=>{if(_.showSelectAllItem)return{icon:"",title:m.useI18n().Common.Select_all,value:"all",content:""}});return(n,a)=>(e.openBlock(),e.createElementBlock("div",d,[e.unref(s.Core).state.isMobile?(e.openBlock(),e.createBlock(i.Popup,{key:0},{opener:e.withCtx(()=>[e.createVNode(s.TopButton,{class:"top-selectorCompetitors_opener",color:"theme",icon:"",icon2:""},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString((t=n.items.find(u=>{var l;return u.value===((l=o.value)==null?void 0:l[0])}))==null?void 0:t.content),1)]}),_:1})]),contentList:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(t,u)=>{var l;return e.openBlock(),e.createBlock(i._sfc_main,{class:e.normalizeClass({"top-active":(l=o.value)==null?void 0:l.includes(t.value)}),"data-top-icon":t.icon,title:t.title,onClick:()=>o.value=[t.value]},{default:e.withCtx(()=>[e.createElementVNode("span",C,e.toDisplayString(t.content),1)]),_:2},1032,["class","data-top-icon","title","onClick"])}),256))]),_:1})):(e.openBlock(),e.createBlock(p.Menu,{key:1,modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=t=>o.value=t),items:n.items,isMultiple:!0,styling:"bar",canBeEmptyMultiple:!1,selectAllItem:y.value},null,8,["modelValue","items","selectAllItem"]))]))}}),f={$style:{"top-selectorCompetitors_opener":"top-selectorCompetitors_opener","top-button":"top-button"}},v=s._export_sfc(k,[["__cssModules",f]]);c.TopSelectorCompetitors=v,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=project.amd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"project.amd.js","sources":["../../src/components/project/selectorCompetitors/selectorCompetitors.vue","../../src/components/project/project.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Props } from './selectorCompetitors';\nimport Core from '@/core/core/core';\nimport Button from '@/components/forms/button/button.vue';\nimport Popup from '@/components/popup/popup/popup.vue';\nimport ListItem from '@/components/popup/popup/listItem.vue';\nimport Menu from '@/components/formsExt/menu/menu.vue';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tshowSelectAllItem: true,\n});\nconst model = defineModel<Props['modelValue']>();\n\nconst selectAllItem = computed(() => {\n\tif (props.showSelectAllItem) {\n\t\treturn {\n\t\t\ticon: '',\n\t\t\ttitle: 'Select all', // ### TODO: translate\n\t\t\tvalue: 'all',\n\t\t\tcontent: '',\n\t\t};\n\t}\n});\n</script>\n\n<template>\n\t<div class=\"top-selectorCompetitors\">\n\t\t<Popup v-if=\"Core.state.isMobile\">\n\t\t\t<template #opener>\n\t\t\t\t<Button\n\t\t\t\t\tclass=\"top-selectorCompetitors_opener\"\n\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\ticon=\"\"\n\t\t\t\t\ticon2=\"\"\n\t\t\t\t>\n\t\t\t\t\t{{ items.find((item) => item.value === model?.[0])?.content }}\n\t\t\t\t</Button>\n\t\t\t</template>\n\n\t\t\t<template #contentList>\n\t\t\t\t<ListItem\n\t\t\t\t\tv-for=\"(item, index) in items\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'top-active': model?.includes(item.value)\n\t\t\t\t\t}\"\n\t\t\t\t\t:data-top-icon=\"item.icon\"\n\t\t\t\t\t:title=\"item.title\"\n\t\t\t\t\t@click=\"() => model = [item.value]\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"top-ellipsis1\">\n\t\t\t\t\t\t{{ item.content }}\n\t\t\t\t\t</span>\n\t\t\t\t</ListItem>\n\t\t\t</template>\n\t\t</Popup>\n\n\t\t<Menu\n\t\t\tv-else\n\t\t\tv-model=\"model\"\n\t\t\t:items=\"items\"\n\t\t\t:isMultiple=\"true\"\n\t\t\tstyling=\"bar\"\n\t\t\t:canBeEmptyMultiple=\"false\"\n\t\t\t:selectAllItem=\"selectAllItem\"\n\t\t/>\n\t</div>\n</template>\n\n<style module>\n.top-selectorCompetitors_opener.top-button {\n\twidth: 100%;\n}\n</style>","import type { ComponentCustomProps } from 'vue';\n\nimport SelectorCompetitors from './selectorCompetitors/selectorCompetitors.vue';\n\nexport const TopSelectorCompetitors = SelectorCompetitors as typeof SelectorCompetitors & ComponentCustomProps;\n"],"names":["props","__props","selectAllItem","vue","TopSelectorCompetitors"],"mappings":"+iBASA,MAAAA,EAAAC,+BAKAC,EAAAC,EAAA,SAAA,IAAA,CACC,GAAAH,EAAA,kBACC,MAAA,mDAIU,CAEX,CAAA,gwCClBMI"}
1
+ {"version":3,"file":"project.amd.js","sources":["../../src/components/project/selectorCompetitors/selectorCompetitors.vue","../../src/components/project/project.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Props } from './selectorCompetitors';\nimport Core from '@/core/core/core';\nimport Button from '@/components/forms/button/button.vue';\nimport Popup from '@/components/popup/popup/popup.vue';\nimport ListItem from '@/components/popup/popup/listItem.vue';\nimport Menu from '@/components/formsExt/menu/menu.vue';\nimport { useI18n } from '@/core/plugins/i18n';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tshowSelectAllItem: true,\n});\nconst model = defineModel<Props['modelValue']>();\n\nconst selectAllItem = computed(() => {\n\tif (props.showSelectAllItem) {\n\t\treturn {\n\t\t\ticon: '',\n\t\t\ttitle: useI18n().Common.Select_all,\n\t\t\tvalue: 'all',\n\t\t\tcontent: '',\n\t\t};\n\t}\n});\n</script>\n\n<template>\n\t<div class=\"top-selectorCompetitors\">\n\t\t<Popup v-if=\"Core.state.isMobile\">\n\t\t\t<template #opener>\n\t\t\t\t<Button\n\t\t\t\t\tclass=\"top-selectorCompetitors_opener\"\n\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\ticon=\"\"\n\t\t\t\t\ticon2=\"\"\n\t\t\t\t>\n\t\t\t\t\t{{ items.find((item) => item.value === model?.[0])?.content }}\n\t\t\t\t</Button>\n\t\t\t</template>\n\n\t\t\t<template #contentList>\n\t\t\t\t<ListItem\n\t\t\t\t\tv-for=\"(item, index) in items\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'top-active': model?.includes(item.value)\n\t\t\t\t\t}\"\n\t\t\t\t\t:data-top-icon=\"item.icon\"\n\t\t\t\t\t:title=\"item.title\"\n\t\t\t\t\t@click=\"() => model = [item.value]\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"top-ellipsis1\">\n\t\t\t\t\t\t{{ item.content }}\n\t\t\t\t\t</span>\n\t\t\t\t</ListItem>\n\t\t\t</template>\n\t\t</Popup>\n\n\t\t<Menu\n\t\t\tv-else\n\t\t\tv-model=\"model\"\n\t\t\t:items=\"items\"\n\t\t\t:isMultiple=\"true\"\n\t\t\tstyling=\"bar\"\n\t\t\t:canBeEmptyMultiple=\"false\"\n\t\t\t:selectAllItem=\"selectAllItem\"\n\t\t/>\n\t</div>\n</template>\n\n<style module>\n.top-selectorCompetitors_opener.top-button {\n\twidth: 100%;\n}\n</style>\n","import type { ComponentCustomProps } from 'vue';\n\nimport SelectorCompetitors from './selectorCompetitors/selectorCompetitors.vue';\n\nexport const TopSelectorCompetitors = SelectorCompetitors as typeof SelectorCompetitors & ComponentCustomProps;\n"],"names":["props","__props","selectAllItem","vue","i18n","TopSelectorCompetitors"],"mappings":"glBAUA,MAAAA,EAAAC,+BAKAC,EAAAC,EAAA,SAAA,IAAA,CACC,GAAAH,EAAA,kBACC,MAAA,UACO,MAAAI,EAAA,QAAA,EAAA,OAAA,iCAGG,CAEX,CAAA,gwCCnBMC"}
@@ -1,11 +1,12 @@
1
1
  import f from "../core/core.js";
2
- import { defineComponent as C, mergeModels as v, useModel as M, computed as S, openBlock as l, createElementBlock as m, unref as V, createBlock as r, withCtx as n, createVNode as k, createTextVNode as y, toDisplayString as p, Fragment as B, renderList as g, normalizeClass as h, createElementVNode as A } from "vue";
3
- import { C as I, T, _ as b } from "../.chunks/forms-DT_fsN6V.es.js";
2
+ import { defineComponent as C, mergeModels as v, useModel as M, computed as S, openBlock as l, createElementBlock as m, unref as V, createBlock as r, withCtx as n, createVNode as k, createTextVNode as y, toDisplayString as p, Fragment as B, renderList as I, normalizeClass as g, createElementVNode as h } from "vue";
3
+ import { C as A, T, _ as b } from "../.chunks/forms-DT_fsN6V.es.js";
4
4
  import { P as N, _ as w } from "../.chunks/listItem.vue_vue_type_script_setup_true_lang-B3E-SDdg.es.js";
5
5
  import { M as x } from "../.chunks/menu-CcyqVSfg.es.js";
6
+ import { a as E } from "../.chunks/i18n-DuTvft1T.es.js";
6
7
  const _ = ["../assets/project.css"].map((s) => import.meta.resolve(s));
7
8
  f.insertCSSLinkToPage(_, !0);
8
- const E = { class: "top-selectorCompetitors" }, L = { class: "top-ellipsis1" }, P = /* @__PURE__ */ C({
9
+ const L = { class: "top-selectorCompetitors" }, P = { class: "top-ellipsis1" }, $ = /* @__PURE__ */ C({
9
10
  __name: "selectorCompetitors",
10
11
  props: /* @__PURE__ */ v({
11
12
  modelValue: {},
@@ -21,14 +22,13 @@ const E = { class: "top-selectorCompetitors" }, L = { class: "top-ellipsis1" },
21
22
  if (u.showSelectAllItem)
22
23
  return {
23
24
  icon: "",
24
- title: "Select all",
25
- // ### TODO: translate
25
+ title: E().Common.Select_all,
26
26
  value: "all",
27
27
  content: ""
28
28
  };
29
29
  });
30
- return (a, i) => (l(), m("div", E, [
31
- V(I).state.isMobile ? (l(), r(N, { key: 0 }, {
30
+ return (a, i) => (l(), m("div", L, [
31
+ V(A).state.isMobile ? (l(), r(N, { key: 0 }, {
32
32
  opener: n(() => [
33
33
  k(T, {
34
34
  class: "top-selectorCompetitors_opener",
@@ -49,10 +49,10 @@ const E = { class: "top-selectorCompetitors" }, L = { class: "top-ellipsis1" },
49
49
  })
50
50
  ]),
51
51
  contentList: n(() => [
52
- (l(!0), m(B, null, g(a.items, (e, c) => {
52
+ (l(!0), m(B, null, I(a.items, (e, c) => {
53
53
  var o;
54
54
  return l(), r(w, {
55
- class: h({
55
+ class: g({
56
56
  "top-active": (o = t.value) == null ? void 0 : o.includes(e.value)
57
57
  }),
58
58
  "data-top-icon": e.icon,
@@ -60,7 +60,7 @@ const E = { class: "top-selectorCompetitors" }, L = { class: "top-ellipsis1" },
60
60
  onClick: () => t.value = [e.value]
61
61
  }, {
62
62
  default: n(() => [
63
- A("span", L, p(e.content), 1)
63
+ h("span", P, p(e.content), 1)
64
64
  ]),
65
65
  _: 2
66
66
  }, 1032, ["class", "data-top-icon", "title", "onClick"]);
@@ -79,13 +79,13 @@ const E = { class: "top-selectorCompetitors" }, L = { class: "top-ellipsis1" },
79
79
  }, null, 8, ["modelValue", "items", "selectAllItem"]))
80
80
  ]));
81
81
  }
82
- }), $ = {
82
+ }), j = {
83
83
  "top-selectorCompetitors_opener": "top-selectorCompetitors_opener",
84
84
  "top-button": "top-button"
85
- }, j = {
86
- $style: $
87
- }, z = /* @__PURE__ */ b(P, [["__cssModules", j]]), H = z;
85
+ }, z = {
86
+ $style: j
87
+ }, D = /* @__PURE__ */ b($, [["__cssModules", z]]), K = D;
88
88
  export {
89
- H as TopSelectorCompetitors
89
+ K as TopSelectorCompetitors
90
90
  };
91
91
  //# sourceMappingURL=project.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"project.js","sources":["../../src/components/project/selectorCompetitors/selectorCompetitors.vue","../../src/components/project/project.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Props } from './selectorCompetitors';\nimport Core from '@/core/core/core';\nimport Button from '@/components/forms/button/button.vue';\nimport Popup from '@/components/popup/popup/popup.vue';\nimport ListItem from '@/components/popup/popup/listItem.vue';\nimport Menu from '@/components/formsExt/menu/menu.vue';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tshowSelectAllItem: true,\n});\nconst model = defineModel<Props['modelValue']>();\n\nconst selectAllItem = computed(() => {\n\tif (props.showSelectAllItem) {\n\t\treturn {\n\t\t\ticon: '',\n\t\t\ttitle: 'Select all', // ### TODO: translate\n\t\t\tvalue: 'all',\n\t\t\tcontent: '',\n\t\t};\n\t}\n});\n</script>\n\n<template>\n\t<div class=\"top-selectorCompetitors\">\n\t\t<Popup v-if=\"Core.state.isMobile\">\n\t\t\t<template #opener>\n\t\t\t\t<Button\n\t\t\t\t\tclass=\"top-selectorCompetitors_opener\"\n\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\ticon=\"\"\n\t\t\t\t\ticon2=\"\"\n\t\t\t\t>\n\t\t\t\t\t{{ items.find((item) => item.value === model?.[0])?.content }}\n\t\t\t\t</Button>\n\t\t\t</template>\n\n\t\t\t<template #contentList>\n\t\t\t\t<ListItem\n\t\t\t\t\tv-for=\"(item, index) in items\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'top-active': model?.includes(item.value)\n\t\t\t\t\t}\"\n\t\t\t\t\t:data-top-icon=\"item.icon\"\n\t\t\t\t\t:title=\"item.title\"\n\t\t\t\t\t@click=\"() => model = [item.value]\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"top-ellipsis1\">\n\t\t\t\t\t\t{{ item.content }}\n\t\t\t\t\t</span>\n\t\t\t\t</ListItem>\n\t\t\t</template>\n\t\t</Popup>\n\n\t\t<Menu\n\t\t\tv-else\n\t\t\tv-model=\"model\"\n\t\t\t:items=\"items\"\n\t\t\t:isMultiple=\"true\"\n\t\t\tstyling=\"bar\"\n\t\t\t:canBeEmptyMultiple=\"false\"\n\t\t\t:selectAllItem=\"selectAllItem\"\n\t\t/>\n\t</div>\n</template>\n\n<style module>\n.top-selectorCompetitors_opener.top-button {\n\twidth: 100%;\n}\n</style>","import type { ComponentCustomProps } from 'vue';\n\nimport SelectorCompetitors from './selectorCompetitors/selectorCompetitors.vue';\n\nexport const TopSelectorCompetitors = SelectorCompetitors as typeof SelectorCompetitors & ComponentCustomProps;\n"],"names":["props","__props","model","useModel","selectAllItem","computed","TopSelectorCompetitors","SelectorCompetitors"],"mappings":";;;;;;;;;;;;;;;;;;;AASA,UAAAA,IAAAC,GAGAC,IAAAC,EAAAF,GAAA,YAAA,GAEAG,IAAAC,EAAA,MAAA;AACC,UAAAL,EAAA;AACC,eAAA;AAAA,UAAO,MAAA;AAAA,UACA,OAAA;AAAA;AAAA,UACC,OAAA;AAAA,UACA,SAAA;AAAA,QACE;AAAA,IAEX,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDClBMM,IAAAC;"}
1
+ {"version":3,"file":"project.js","sources":["../../src/components/project/selectorCompetitors/selectorCompetitors.vue","../../src/components/project/project.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Props } from './selectorCompetitors';\nimport Core from '@/core/core/core';\nimport Button from '@/components/forms/button/button.vue';\nimport Popup from '@/components/popup/popup/popup.vue';\nimport ListItem from '@/components/popup/popup/listItem.vue';\nimport Menu from '@/components/formsExt/menu/menu.vue';\nimport { useI18n } from '@/core/plugins/i18n';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tshowSelectAllItem: true,\n});\nconst model = defineModel<Props['modelValue']>();\n\nconst selectAllItem = computed(() => {\n\tif (props.showSelectAllItem) {\n\t\treturn {\n\t\t\ticon: '',\n\t\t\ttitle: useI18n().Common.Select_all,\n\t\t\tvalue: 'all',\n\t\t\tcontent: '',\n\t\t};\n\t}\n});\n</script>\n\n<template>\n\t<div class=\"top-selectorCompetitors\">\n\t\t<Popup v-if=\"Core.state.isMobile\">\n\t\t\t<template #opener>\n\t\t\t\t<Button\n\t\t\t\t\tclass=\"top-selectorCompetitors_opener\"\n\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\ticon=\"\"\n\t\t\t\t\ticon2=\"\"\n\t\t\t\t>\n\t\t\t\t\t{{ items.find((item) => item.value === model?.[0])?.content }}\n\t\t\t\t</Button>\n\t\t\t</template>\n\n\t\t\t<template #contentList>\n\t\t\t\t<ListItem\n\t\t\t\t\tv-for=\"(item, index) in items\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'top-active': model?.includes(item.value)\n\t\t\t\t\t}\"\n\t\t\t\t\t:data-top-icon=\"item.icon\"\n\t\t\t\t\t:title=\"item.title\"\n\t\t\t\t\t@click=\"() => model = [item.value]\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"top-ellipsis1\">\n\t\t\t\t\t\t{{ item.content }}\n\t\t\t\t\t</span>\n\t\t\t\t</ListItem>\n\t\t\t</template>\n\t\t</Popup>\n\n\t\t<Menu\n\t\t\tv-else\n\t\t\tv-model=\"model\"\n\t\t\t:items=\"items\"\n\t\t\t:isMultiple=\"true\"\n\t\t\tstyling=\"bar\"\n\t\t\t:canBeEmptyMultiple=\"false\"\n\t\t\t:selectAllItem=\"selectAllItem\"\n\t\t/>\n\t</div>\n</template>\n\n<style module>\n.top-selectorCompetitors_opener.top-button {\n\twidth: 100%;\n}\n</style>\n","import type { ComponentCustomProps } from 'vue';\n\nimport SelectorCompetitors from './selectorCompetitors/selectorCompetitors.vue';\n\nexport const TopSelectorCompetitors = SelectorCompetitors as typeof SelectorCompetitors & ComponentCustomProps;\n"],"names":["props","__props","model","useModel","selectAllItem","computed","useI18n","TopSelectorCompetitors","SelectorCompetitors"],"mappings":";;;;;;;;;;;;;;;;;;;;AAUA,UAAAA,IAAAC,GAGAC,IAAAC,EAAAF,GAAA,YAAA,GAEAG,IAAAC,EAAA,MAAA;AACC,UAAAL,EAAA;AACC,eAAA;AAAA,UAAO,MAAA;AAAA,UACA,OAAAM,EAAA,EAAA,OAAA;AAAA,UACkB,OAAA;AAAA,UACjB,SAAA;AAAA,QACE;AAAA,IAEX,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDCnBMC,IAAAC;"}