alytus-ff 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  <module type="PYTHON_MODULE" version="4">
3
3
  <component name="NewModuleRootManager">
4
4
  <content url="file://$MODULE_DIR$" />
5
- <orderEntry type="inheritedJdk" />
5
+ <orderEntry type="jdk" jdkName="Remote Python 3.12.1 Docker Compose (django at [/Users/eivinas/Dev/CafeMenu/docker-compose.yml])" jdkType="Python SDK" />
6
6
  <orderEntry type="sourceFolder" forTests="false" />
7
7
  </component>
8
8
  </module>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="TypeScriptCompiler">
4
+ <option name="nodeInterpreterTextField" value="$USER_HOME$/.nvm/versions/node/v20.17.0/bin/node" />
5
+ <option name="recompileOnChanges" value="true" />
6
+ <option name="versionType" value="EMBEDDED" />
7
+ </component>
8
+ </project>
package/.idea/misc.xml CHANGED
@@ -3,5 +3,5 @@
3
3
  <component name="Black">
4
4
  <option name="sdkName" value="Python 2.7" />
5
5
  </component>
6
- <component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7" project-jdk-type="Python SDK" />
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="Remote Python 3.12.1 Docker Compose (django at [/Users/eivinas/Dev/CafeMenu/docker-compose.yml])" project-jdk-type="Python SDK" />
7
7
  </project>
package/README.md CHANGED
@@ -1,3 +1,14 @@
1
1
 
2
2
  # Alytus-ff
3
3
 
4
+ ## Publish
5
+
6
+ ````commandline
7
+ npm version patch # For patch updates (1.0.1 -> 1.0.2)
8
+ npm version minor # For minor updates (1.0.1 -> 1.1.0)
9
+ npm version major # For major updates (1.0.1 -> 2.0.0)
10
+
11
+ npm run build
12
+
13
+ npm publish
14
+ ````
@@ -1,5 +1,27 @@
1
- import { defineComponent as a, openBlock as c, createElementBlock as p, createElementVNode as s, toDisplayString as i, renderSlot as l } from "vue";
2
- const u = a({
1
+ import { defineComponent as n } from "vue";
2
+ const p = (r) => {
3
+ if (typeof r == "object")
4
+ return r;
5
+ const t = r.substr(0, 10).split("-");
6
+ return new Date(parseInt(t[0], 10), parseInt(t[1], 10) - 1, t.length <= 2 ? 1 : parseInt(t[2], 10));
7
+ }, o = (r, t) => {
8
+ for (const e in r)
9
+ if (r[e].id === t.id) {
10
+ r[e] = t;
11
+ return;
12
+ }
13
+ r.push(t);
14
+ }, i = (r, t) => {
15
+ for (const e in t)
16
+ Object.prototype.hasOwnProperty.call(t, e) && (r[e] = t[e]);
17
+ }, a = (r, t) => {
18
+ for (let e = 0; e < r.length; e++)
19
+ if (r[e].id === t) {
20
+ r.splice(e, 1);
21
+ return;
22
+ }
23
+ };
24
+ n({
3
25
  name: "PageTitle",
4
26
  props: {
5
27
  title: {
@@ -7,26 +29,10 @@ const u = a({
7
29
  required: !0
8
30
  }
9
31
  }
10
- }), d = (t, e) => {
11
- const n = t.__vccOpts || t;
12
- for (const [o, r] of e)
13
- n[o] = r;
14
- return n;
15
- }, f = { class: "mt-6 mb-3 ec-page-title" }, _ = { class: "text-h5 font-weight-bold" };
16
- function m(t, e, n, o, r, g) {
17
- return c(), p("div", f, [
18
- s("span", _, i(t.title), 1),
19
- s("div", null, [
20
- l(t.$slots, "buttons")
21
- ])
22
- ]);
23
- }
24
- const b = /* @__PURE__ */ d(u, [["render", m]]), y = (t) => {
25
- if (typeof t == "object") return t;
26
- const e = t.substr(0, 10).split("-");
27
- return new Date(parseInt(e[0], 10), parseInt(e[1], 10) - 1, e.length <= 2 ? 1 : parseInt(e[2], 10));
28
- };
32
+ });
29
33
  export {
30
- b as PageTitle,
31
- y as parseSysDate
34
+ p as parseSysDate,
35
+ a as removeFromListById,
36
+ i as syncItemChanges,
37
+ o as syncToList
32
38
  };
@@ -1 +1 @@
1
- (function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n["Alytus-FF"]={},n.Vue))})(this,function(n,e){"use strict";const c=e.defineComponent({name:"PageTitle",props:{title:{type:String,required:!0}}}),a=(t,o)=>{const s=t.__vccOpts||t;for(const[r,i]of o)s[r]=i;return s},p={class:"mt-6 mb-3 ec-page-title"},l={class:"text-h5 font-weight-bold"};function d(t,o,s,r,i,m){return e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("span",l,e.toDisplayString(t.title),1),e.createElementVNode("div",null,[e.renderSlot(t.$slots,"buttons")])])}const f=a(c,[["render",d]]),u=t=>{if(typeof t=="object")return t;const o=t.substr(0,10).split("-");return new Date(parseInt(o[0],10),parseInt(o[1],10)-1,o.length<=2?1:parseInt(o[2],10))};n.PageTitle=f,n.parseSysDate=u,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
1
+ (function(r,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(r=typeof globalThis<"u"?globalThis:r||self,s(r["Alytus-FF"]={},r.Vue))})(this,function(r,s){"use strict";const i=e=>{if(typeof e=="object")return e;const t=e.substr(0,10).split("-");return new Date(parseInt(t[0],10),parseInt(t[1],10)-1,t.length<=2?1:parseInt(t[2],10))},o=(e,t)=>{for(const n in e)if(e[n].id===t.id){e[n]=t;return}e.push(t)},p=(e,t)=>{for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},u=(e,t)=>{for(let n=0;n<e.length;n++)if(e[n].id===t){e.splice(n,1);return}};s.defineComponent({name:"PageTitle",props:{title:{type:String,required:!0}}}),r.parseSysDate=i,r.removeFromListById=u,r.syncItemChanges=p,r.syncToList=o,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,12 @@
1
+ declare const _default: import('vue').DefineComponent<{
2
+ title: {
3
+ type: StringConstructor;
4
+ required: true;
5
+ };
6
+ }, unknown, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
7
+ title: {
8
+ type: StringConstructor;
9
+ required: true;
10
+ };
11
+ }>>, {}, {}>;
12
+ export default _default;
@@ -0,0 +1 @@
1
+ export * from './Page/PageTitle.vue';
@@ -1,3 +1,2 @@
1
- import './src/styles/main.scss'
2
- export * from './components';
3
1
  export * from './utils';
2
+ export * from './components';
@@ -0,0 +1,3 @@
1
+ export type Dict = {
2
+ [name: string]: any;
3
+ };
@@ -0,0 +1,2 @@
1
+ export * from '../index'
2
+ export {}
@@ -0,0 +1,6 @@
1
+ import { Dict } from '../types/base';
2
+ export declare const syncToList: (collection: Dict[], item: Dict) => void;
3
+ export declare const syncItemChanges: (obj: Dict, changes: Dict) => void;
4
+ export declare const removeFromListById: (collection: {
5
+ id: number;
6
+ }[], item_id: number) => void;
@@ -0,0 +1 @@
1
+ export declare const parseSysDate: (d_str: string) => Date;
@@ -0,0 +1,2 @@
1
+ export * from './date';
2
+ export * from './data_sync';
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "alytus-ff",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "description": "Frontend framework",
6
6
  "main": "index.ts",
7
- "types": "index.d.ts",
7
+ "types": "dist/types/index.d.ts",
8
8
  "scripts": {
9
- "build": "run-p type-check \"build-only {@}\" --",
10
- "build-only": "vite build",
11
- "test": "echo \"Error: no test specified\" && exit 1"
9
+ "build": "vite build",
10
+ "build:types": "vue-tsc --declaration --emitDeclarationOnly --outDir dist/types"
12
11
  },
13
12
  "author": "EG",
14
13
  "license": "ISC",
@@ -22,6 +21,7 @@
22
21
  "sass": "^1.77.8",
23
22
  "sass-loader": "^16.0.1",
24
23
  "typescript": "^5.5.4",
25
- "vite": "^5.4.2"
24
+ "vite": "^5.4.2",
25
+ "vite-plugin-dts": "^4.2.1"
26
26
  }
27
27
  }
@@ -0,0 +1 @@
1
+ export * from "./Page/PageTitle.vue"
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./utils"
2
+ export * from "./components"
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["base.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+
2
+ export type Dict = {
3
+ [name: string]: any
4
+ }
@@ -0,0 +1,24 @@
1
+ export const syncToList = (collection, item) => {
2
+ for (const i in collection) {
3
+ if (collection[i].id === item.id) {
4
+ collection[i] = item;
5
+ return;
6
+ }
7
+ }
8
+ collection.push(item);
9
+ };
10
+ export const syncItemChanges = (obj, changes) => {
11
+ for (const prop in changes) {
12
+ if (Object.prototype.hasOwnProperty.call(changes, prop))
13
+ obj[prop] = changes[prop];
14
+ }
15
+ };
16
+ export const removeFromListById = (collection, item_id) => {
17
+ for (let i = 0; i < collection.length; i++) {
18
+ if (collection[i].id === item_id) {
19
+ collection.splice(i, 1);
20
+ return;
21
+ }
22
+ }
23
+ };
24
+ //# sourceMappingURL=data_sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data_sync.js","sourceRoot":"","sources":["data_sync.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,UAAkB,EAAE,IAAU,EAAE,EAAE;IACzD,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE;QACxB,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE;YAC9B,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;YACpB,OAAM;SACT;KACJ;IACD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAS,EAAE,OAAa,EAAE,EAAE;IACxD,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;QACxB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;YACnD,GAAG,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACjC;AACL,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAA4B,EAAE,OAAe,EAAE,EAAE;IAChF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,EAAE;YAC9B,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACxB,OAAO;SACV;KACJ;AACL,CAAC,CAAA"}
@@ -0,0 +1,25 @@
1
+ import {Dict} from "@/types/base";
2
+
3
+ export const syncToList = (collection: Dict[], item: Dict) => {
4
+ for (const i in collection) {
5
+ if (collection[i].id === item.id) {
6
+ collection[i] = item
7
+ return
8
+ }
9
+ }
10
+ collection.push(item);
11
+ }
12
+ export const syncItemChanges = (obj: Dict, changes: Dict) => {
13
+ for (const prop in changes) {
14
+ if (Object.prototype.hasOwnProperty.call(changes, prop))
15
+ obj[prop] = changes[prop];
16
+ }
17
+ }
18
+ export const removeFromListById = (collection: { id: number }[], item_id: number) => {
19
+ for (let i = 0; i < collection.length; i++) {
20
+ if (collection[i].id === item_id) {
21
+ collection.splice(i, 1);
22
+ return;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,7 @@
1
+ export const parseSysDate = (d_str) => {
2
+ if (typeof (d_str) === "object")
3
+ return d_str;
4
+ const arr = d_str.substr(0, 10).split("-");
5
+ return new Date(parseInt(arr[0], 10), parseInt(arr[1], 10) - 1, arr.length <= 2 ? 1 : parseInt(arr[2], 10));
6
+ };
7
+ //# sourceMappingURL=date.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.js","sourceRoot":"","sources":["date.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE;IAC1C,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC7C,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3C,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAChH,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./date"
2
+ export * from "./data_sync"
package/tsconfig.json CHANGED
@@ -1,5 +1,8 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "declaration": true, // Generate declaration files (.d.ts)
4
+ "declarationDir": "types", // Specify the output directory for declaration files
5
+ "emitDeclarationOnly": true, // Only emit .d.ts files, no JavaScript
3
6
  "target": "esnext",
4
7
  "module": "esnext",
5
8
  "moduleResolution": "node",
@@ -0,0 +1 @@
1
+ export * from "./Page/PageTitle.vue";
@@ -0,0 +1,2 @@
1
+ export * from "./utils";
2
+ export * from "./components";
package/vite.config.ts CHANGED
@@ -1,11 +1,19 @@
1
1
  import { defineConfig } from 'vite';
2
2
  import vue from '@vitejs/plugin-vue';
3
+ import dts from 'vite-plugin-dts';
3
4
 
4
5
  export default defineConfig({
5
- plugins: [vue()],
6
+ plugins: [
7
+ vue(),
8
+ dts({
9
+ outputDir: 'dist/types', // Output directory for .d.ts files
10
+ insertTypesEntry: true, // Generates an entry file for types
11
+ copyDtsFiles: true, // Copies .d.ts files to the output directory
12
+ })
13
+ ],
6
14
  build: {
7
15
  lib: {
8
- entry: './index.ts',
16
+ entry: './src/index.ts',
9
17
  name: 'Alytus-FF',
10
18
  fileName: (format) => `alytus-ff.${format}.js`,
11
19
  },
@@ -1,4 +0,0 @@
1
-
2
- import PageTitle from '../src/components/Page/PageTitle.vue'
3
-
4
- export { PageTitle }
package/dist/style.css DELETED
@@ -1 +0,0 @@
1
- .ec-page-title,.ec-page-subtitle{display:flex;justify-content:space-between;align-items:center}.ec-page-title .v-btn,.ec-page-subtitle .v-btn{text-transform:unset;letter-spacing:.045em}
package/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { DefineComponent } from 'vue';
2
-
3
- declare const MyComponent: DefineComponent<{
4
- title: String;
5
- description: String;
6
- }, {}, any>;
7
-
8
- export default MyComponent;
package/utils/index.ts DELETED
@@ -1,4 +0,0 @@
1
-
2
- import {parseSysDate} from "../src/utils/date"
3
-
4
- export { parseSysDate }