@xn-lib/core 0.0.4 → 0.0.10

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/index.cjs CHANGED
@@ -1 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@xn-lib/base");class r{constructor(t){this.state=t}getState(){return this.state}setState(t){o.isObject(t)&&(this.state={...this.state,...t})}}class a{constructor(){this.events=new Map}on(t,e){this.events.has(t)||this.events.set(t,[]),this.events.get(t).push(e)}off(t,e){const s=this.events.get(t);if(s){const i=s.indexOf(e);i>-1&&s.splice(i,1)}}emit(t,...e){const s=this.events.get(t);s&&s.forEach(i=>i(...e))}}exports.EventBus=a;exports.Store=r;
1
+ "use strict";var t=require("vue");function n(t,n,r,e,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void r(t)}c.done?n(a):Promise.resolve(a).then(e,o)}function r(t){return function(){var r=this,e=arguments;return new Promise(function(o,i){var u=t.apply(r,e);function c(t){n(u,o,i,c,a,"next",t)}function a(t){n(u,o,i,c,a,"throw",t)}c(void 0)})}}function e(){
2
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
+ var t,n,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",u=r.toStringTag||"@@toStringTag";function c(r,e,i,u){var c=e&&e.prototype instanceof f?e:f,l=Object.create(c.prototype);return o(l,"_invoke",function(r,e,o){var i,u,c,f=0,l=o||[],v=!1,s={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(n,r){return i=n,u=0,c=t,s.n=r,a}};function p(r,e){for(u=r,c=e,n=0;!v&&f&&!o&&n<l.length;n++){var o,i=l[n],p=s.p,d=i[2];r>3?(o=d===e)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,s.v=e,s.n=i[1]):p<d&&(o=r<3||i[0]>e||e>d)&&(i[4]=r,i[5]=e,s.n=d,u=0))}if(o||r>1)return a;throw v=!0,e}return function(o,l,d){if(f>1)throw TypeError("Generator is already running");for(v&&1===l&&p(l,d),u=l,c=d;(n=u<2?t:c)||!v;){i||(u?u<3?(u>1&&(s.n=-1),p(u,c)):s.n=c:s.v=c);try{if(f=2,i){if(u||(o="next"),n=i[o]){if(!(n=n.call(i,c)))throw TypeError("iterator result is not an object");if(!n.done)return n;c=n.value,u<2&&(u=0)}else 1===u&&(n=i.return)&&n.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((n=(v=s.n<0)?c:r.call(e,s))!==a)break}catch(n){i=t,u=1,c=n}finally{f=1}}return{value:n,done:v}}}(r,i,u),!0),l}var a={};function f(){}function l(){}function v(){}n=Object.getPrototypeOf;var s=[][i]?n(n([][i]())):(o(n={},i,function(){return this}),n),p=v.prototype=f.prototype=Object.create(s);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,o(t,u,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=v,o(p,"constructor",v),o(v,"constructor",l),l.displayName="GeneratorFunction",o(v,u,"GeneratorFunction"),o(p),o(p,u,"Generator"),o(p,i,function(){return this}),o(p,"toString",function(){return"[object Generator]"}),(e=function(){return{w:c,m:d}})()}function o(t,n,r,e){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}o=function(t,n,r,e){function u(n,r){o(t,n,function(t){return this._invoke(n,r,t)})}n?i?i(t,n,{value:r,enumerable:!e,configurable:!e,writable:!e}):t[n]=r:(u("next",0),u("throw",1),u("return",2))},o(t,n,r,e)}exports.useElementOffset=function(n){var o=t.ref(0),i=function(){var t=n.value;if(t){var r,e,o=null!==(r=null==t?void 0:t.$el)&&void 0!==r?r:t,i=null==o||null===(e=o.getBoundingClientRect)||void 0===e||null===(e=e.call(o))||void 0===e?void 0:e.top;i.value=i||(null==o?void 0:o.offsetTop)}};return t.onMounted(r(e().m(function n(){return e().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,t.nextTick();case 1:i();case 2:return n.a(2)}},n)}))),t.onUpdated(r(e().m(function n(){return e().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,t.nextTick();case 1:i();case 2:return n.a(2)}},n)}))),{top:o}};
package/dist/index.d.ts CHANGED
@@ -1,17 +1,9 @@
1
- export declare class EventBus {
2
- private events;
3
- on(event: string, handler: EventHandler): void;
4
- off(event: string, handler: EventHandler): void;
5
- emit(event: string, ...args: any[]): void;
6
- }
7
-
8
- declare type EventHandler = (...args: any[]) => void;
9
-
10
- export declare class Store<T extends Record<string, any>> {
11
- private state;
12
- constructor(initialState: T);
13
- getState(): T;
14
- setState(newState: Partial<T>): void;
15
- }
16
-
17
- export { }
1
+ import type { Plugin } from 'vue';
2
+ import TimeSchedule from './time-schedule/index.vue';
3
+ export declare const components: {
4
+ TimeSchedule: import("vue").DefineComponent<{}, {}, any>;
5
+ };
6
+ export { TimeSchedule };
7
+ declare const plugin: Plugin;
8
+ export default plugin;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,YAAY,MAAM,2BAA2B,CAAA;AAEpD,eAAO,MAAM,UAAU;;CAEtB,CAAA;AAED,OAAO,EAAE,YAAY,EAAE,CAAA;AAEvB,QAAA,MAAM,MAAM,EAAE,MAQb,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -0,0 +1,3 @@
1
+ !function(t,n){"use strict";function r(t,n,r,e,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void r(t)}c.done?n(a):Promise.resolve(a).then(e,o)}function e(t){return function(){var n=this,e=arguments;return new Promise(function(o,i){var u=t.apply(n,e);function c(t){r(u,o,i,c,a,"next",t)}function a(t){r(u,o,i,c,a,"throw",t)}c(void 0)})}}function o(){
2
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
+ var t,n,r="function"==typeof Symbol?Symbol:{},e=r.iterator||"@@iterator",u=r.toStringTag||"@@toStringTag";function c(r,e,o,u){var c=e&&e.prototype instanceof f?e:f,l=Object.create(c.prototype);return i(l,"_invoke",function(r,e,o){var i,u,c,f=0,l=o||[],s=!1,v={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(n,r){return i=n,u=0,c=t,v.n=r,a}};function p(r,e){for(u=r,c=e,n=0;!s&&f&&!o&&n<l.length;n++){var o,i=l[n],p=v.p,d=i[2];r>3?(o=d===e)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,v.v=e,v.n=i[1]):p<d&&(o=r<3||i[0]>e||e>d)&&(i[4]=r,i[5]=e,v.n=d,u=0))}if(o||r>1)return a;throw s=!0,e}return function(o,l,d){if(f>1)throw TypeError("Generator is already running");for(s&&1===l&&p(l,d),u=l,c=d;(n=u<2?t:c)||!s;){i||(u?u<3?(u>1&&(v.n=-1),p(u,c)):v.n=c:v.v=c);try{if(f=2,i){if(u||(o="next"),n=i[o]){if(!(n=n.call(i,c)))throw TypeError("iterator result is not an object");if(!n.done)return n;c=n.value,u<2&&(u=0)}else 1===u&&(n=i.return)&&n.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((n=(s=v.n<0)?c:r.call(e,v))!==a)break}catch(n){i=t,u=1,c=n}finally{f=1}}return{value:n,done:s}}}(r,o,u),!0),l}var a={};function f(){}function l(){}function s(){}n=Object.getPrototypeOf;var v=[][e]?n(n([][e]())):(i(n={},e,function(){return this}),n),p=s.prototype=f.prototype=Object.create(v);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,i(t,u,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=s,i(p,"constructor",s),i(s,"constructor",l),l.displayName="GeneratorFunction",i(s,u,"GeneratorFunction"),i(p),i(p,u,"Generator"),i(p,e,function(){return this}),i(p,"toString",function(){return"[object Generator]"}),(o=function(){return{w:c,m:d}})()}function i(t,n,r,e){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}i=function(t,n,r,e){function u(n,r){i(t,n,function(t){return this._invoke(n,r,t)})}n?o?o(t,n,{value:r,enumerable:!e,configurable:!e,writable:!e}):t[n]=r:(u("next",0),u("throw",1),u("return",2))},i(t,n,r,e)}t.useElementOffset=function(t){var r=n.ref(0),i=function(){var n=t.value;if(n){var r,e,o=null!==(r=null==n?void 0:n.$el)&&void 0!==r?r:n,i=null==o||null===(e=o.getBoundingClientRect)||void 0===e||null===(e=e.call(o))||void 0===e?void 0:e.top;i.value=i||(null==o?void 0:o.offsetTop)}};return n.onMounted(e(o().m(function t(){return o().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,n.nextTick();case 1:i();case 2:return t.a(2)}},t)}))),n.onUpdated(e(o().m(function t(){return o().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,n.nextTick();case 1:i();case 2:return t.a(2)}},t)}))),{top:r}}}(this["@xn-lib/core"]=this["@xn-lib/core"]||{},Vue);
package/dist/index.mjs CHANGED
@@ -1,35 +1,3 @@
1
- import { isObject as h } from "@xn-lib/base";
2
- class r {
3
- constructor(t) {
4
- this.state = t;
5
- }
6
- getState() {
7
- return this.state;
8
- }
9
- setState(t) {
10
- h(t) && (this.state = { ...this.state, ...t });
11
- }
12
- }
13
- class a {
14
- constructor() {
15
- this.events = /* @__PURE__ */ new Map();
16
- }
17
- on(t, e) {
18
- this.events.has(t) || this.events.set(t, []), this.events.get(t).push(e);
19
- }
20
- off(t, e) {
21
- const s = this.events.get(t);
22
- if (s) {
23
- const i = s.indexOf(e);
24
- i > -1 && s.splice(i, 1);
25
- }
26
- }
27
- emit(t, ...e) {
28
- const s = this.events.get(t);
29
- s && s.forEach((i) => i(...e));
30
- }
31
- }
32
- export {
33
- a as EventBus,
34
- r as Store
35
- };
1
+ import{ref as t,onMounted as n,onUpdated as r,nextTick as e}from"vue";function o(t,n,r,e,o,i,u){try{var c=t[i](u),a=c.value}catch(t){return void r(t)}c.done?n(a):Promise.resolve(a).then(e,o)}function i(t){return function(){var n=this,r=arguments;return new Promise(function(e,i){var u=t.apply(n,r);function c(t){o(u,e,i,c,a,"next",t)}function a(t){o(u,e,i,c,a,"throw",t)}c(void 0)})}}function u(){
2
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
+ var t,n,r="function"==typeof Symbol?Symbol:{},e=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,e,o,i){var u=e&&e.prototype instanceof f?e:f,l=Object.create(u.prototype);return c(l,"_invoke",function(r,e,o){var i,u,c,f=0,l=o||[],v=!1,p={p:0,n:0,v:t,a:s,f:s.bind(t,4),d:function(n,r){return i=n,u=0,c=t,p.n=r,a}};function s(r,e){for(u=r,c=e,n=0;!v&&f&&!o&&n<l.length;n++){var o,i=l[n],s=p.p,y=i[2];r>3?(o=y===e)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=s&&((o=r<2&&s<i[1])?(u=0,p.v=e,p.n=i[1]):s<y&&(o=r<3||i[0]>e||e>y)&&(i[4]=r,i[5]=e,p.n=y,u=0))}if(o||r>1)return a;throw v=!0,e}return function(o,l,y){if(f>1)throw TypeError("Generator is already running");for(v&&1===l&&s(l,y),u=l,c=y;(n=u<2?t:c)||!v;){i||(u?u<3?(u>1&&(p.n=-1),s(u,c)):p.n=c:p.v=c);try{if(f=2,i){if(u||(o="next"),n=i[o]){if(!(n=n.call(i,c)))throw TypeError("iterator result is not an object");if(!n.done)return n;c=n.value,u<2&&(u=0)}else 1===u&&(n=i.return)&&n.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((n=(v=p.n<0)?c:r.call(e,p))!==a)break}catch(n){i=t,u=1,c=n}finally{f=1}}return{value:n,done:v}}}(r,o,i),!0),l}var a={};function f(){}function l(){}function v(){}n=Object.getPrototypeOf;var p=[][e]?n(n([][e]())):(c(n={},e,function(){return this}),n),s=v.prototype=f.prototype=Object.create(p);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return l.prototype=v,c(s,"constructor",v),c(v,"constructor",l),l.displayName="GeneratorFunction",c(v,o,"GeneratorFunction"),c(s),c(s,o,"Generator"),c(s,e,function(){return this}),c(s,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:y}})()}function c(t,n,r,e){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}c=function(t,n,r,e){function i(n,r){c(t,n,function(t){return this._invoke(n,r,t)})}n?o?o(t,n,{value:r,enumerable:!e,configurable:!e,writable:!e}):t[n]=r:(i("next",0),i("throw",1),i("return",2))},c(t,n,r,e)}var a=function(o){var c=t(0),a=function(){var t=o.value;if(t){var n,r,e=null!==(n=null==t?void 0:t.$el)&&void 0!==n?n:t,i=null==e||null===(r=e.getBoundingClientRect)||void 0===r||null===(r=r.call(e))||void 0===r?void 0:r.top;i.value=i||(null==e?void 0:e.offsetTop)}};return n(i(u().m(function t(){return u().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e();case 1:a();case 2:return t.a(2)}},t)}))),r(i(u().m(function t(){return u().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e();case 1:a();case 2:return t.a(2)}},t)}))),{top:c}};export{a as useElementOffset};
@@ -0,0 +1,3 @@
1
+ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self)["@xn-lib/core"]=t["@xn-lib/core"]||{},t.Vue)}(this,function(t,n){"use strict";function e(t,n,e,r,o,i,u){try{var c=t[i](u),f=c.value}catch(t){return void e(t)}c.done?n(f):Promise.resolve(f).then(r,o)}function r(t){return function(){var n=this,r=arguments;return new Promise(function(o,i){var u=t.apply(n,r);function c(t){e(u,o,i,c,f,"next",t)}function f(t){e(u,o,i,c,f,"throw",t)}c(void 0)})}}function o(){
2
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
+ var t,n,e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",u=e.toStringTag||"@@toStringTag";function c(e,r,o,u){var c=r&&r.prototype instanceof a?r:a,l=Object.create(c.prototype);return i(l,"_invoke",function(e,r,o){var i,u,c,a=0,l=o||[],s=!1,p={p:0,n:0,v:t,a:v,f:v.bind(t,4),d:function(n,e){return i=n,u=0,c=t,p.n=e,f}};function v(e,r){for(u=e,c=r,n=0;!s&&a&&!o&&n<l.length;n++){var o,i=l[n],v=p.p,d=i[2];e>3?(o=d===r)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=v&&((o=e<2&&v<i[1])?(u=0,p.v=r,p.n=i[1]):v<d&&(o=e<3||i[0]>r||r>d)&&(i[4]=e,i[5]=r,p.n=d,u=0))}if(o||e>1)return f;throw s=!0,r}return function(o,l,d){if(a>1)throw TypeError("Generator is already running");for(s&&1===l&&v(l,d),u=l,c=d;(n=u<2?t:c)||!s;){i||(u?u<3?(u>1&&(p.n=-1),v(u,c)):p.n=c:p.v=c);try{if(a=2,i){if(u||(o="next"),n=i[o]){if(!(n=n.call(i,c)))throw TypeError("iterator result is not an object");if(!n.done)return n;c=n.value,u<2&&(u=0)}else 1===u&&(n=i.return)&&n.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((n=(s=p.n<0)?c:e.call(r,p))!==f)break}catch(n){i=t,u=1,c=n}finally{a=1}}return{value:n,done:s}}}(e,o,u),!0),l}var f={};function a(){}function l(){}function s(){}n=Object.getPrototypeOf;var p=[][r]?n(n([][r]())):(i(n={},r,function(){return this}),n),v=s.prototype=a.prototype=Object.create(p);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,i(t,u,"GeneratorFunction")),t.prototype=Object.create(v),t}return l.prototype=s,i(v,"constructor",s),i(s,"constructor",l),l.displayName="GeneratorFunction",i(s,u,"GeneratorFunction"),i(v),i(v,u,"Generator"),i(v,r,function(){return this}),i(v,"toString",function(){return"[object Generator]"}),(o=function(){return{w:c,m:d}})()}function i(t,n,e,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}i=function(t,n,e,r){function u(n,e){i(t,n,function(t){return this._invoke(n,e,t)})}n?o?o(t,n,{value:e,enumerable:!r,configurable:!r,writable:!r}):t[n]=e:(u("next",0),u("throw",1),u("return",2))},i(t,n,e,r)}t.useElementOffset=function(t){var e=n.ref(0),i=function(){var n=t.value;if(n){var e,r,o=null!==(e=null==n?void 0:n.$el)&&void 0!==e?e:n,i=null==o||null===(r=o.getBoundingClientRect)||void 0===r||null===(r=r.call(o))||void 0===r?void 0:r.top;i.value=i||(null==o?void 0:o.offsetTop)}};return n.onMounted(r(o().m(function t(){return o().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,n.nextTick();case 1:i();case 2:return t.a(2)}},t)}))),n.onUpdated(r(o().m(function t(){return o().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,n.nextTick();case 1:i();case 2:return t.a(2)}},t)}))),{top:e}}});
package/package.json CHANGED
@@ -1,36 +1,33 @@
1
1
  {
2
+ "private": false,
2
3
  "name": "@xn-lib/core",
3
- "version": "0.0.4",
4
- "description": "XN core functionality",
5
- "main": "./dist/index.cjs",
6
- "module": "./dist/index.mjs",
7
- "types": "./dist/index.d.ts",
4
+ "version": "0.0.10",
5
+ "description": "",
8
6
  "exports": {
9
7
  ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.mjs",
12
- "require": "./dist/index.cjs"
8
+ "require": "./dist/index.cjs",
9
+ "import": "./dist/index.mjs"
13
10
  },
14
- "./package.json": "./package.json"
11
+ "./dist/index.css": {
12
+ "require": "./dist/index.css",
13
+ "import": "./dist/index.css"
14
+ }
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
15
18
  },
16
19
  "files": [
17
- "dist"
20
+ "dist",
21
+ "package.json"
18
22
  ],
19
- "scripts": {
20
- "build": "vite build",
21
- "dev": "vite build --watch",
22
- "clean": "rimraf dist"
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/zjwmmx/mmx-ui"
23
26
  },
24
- "keywords": [
25
- "xn",
26
- "core"
27
- ],
28
27
  "author": "",
29
- "license": "MIT",
30
- "publishConfig": {
31
- "access": "public"
32
- },
28
+ "license": "ISC",
33
29
  "dependencies": {
34
- "@xn-lib/base": "^0.0.4"
30
+ "lodash": "^4.17.21",
31
+ "vue": "^3.3.4"
35
32
  }
36
33
  }